🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
💞 Servicesâ„đïļ About✉ïļ ContactView Pricing Plansfrom $10

What Is a Qubit?

A qubit (quantum bit) is the fundamental unit of quantum information. Unlike a classical bit that can only be 0 or 1, a qubit can exist in a superposition of both states simultaneously.

Mathematically, a qubit state is represented as a vector in a two-dimensional complex Hilbert space:

where and are complex probability amplitudes satisfying the normalization condition:

The states and form the computational basis:

A concrete state makes the numbers tangible. Take and . Normalization holds because , and a computational-basis measurement returns 0 with probability and 1 with probability . The factor in is a relative phase: it changes nothing in Z-basis statistics, yet it completely changes the outcome of an X-basis measurement. Holding onto that distinction — probabilities come from amplitude magnitudes, interference comes from amplitude phases — is the most useful habit when reading any quantum circuit.

Hardware realizes this two-level space in very different ways. Superconducting transmons encode the two levels in an anharmonic microwave resonator cooled to roughly 15 mK, giving single-gate times near 50 ns but coherence windows of about 50–300 ξs. Trapped-ion qubits use two electronic levels of an ion such as ytterbium-171: gates take microseconds instead of nanoseconds, but coherence reaches seconds. Photonic qubits store the state in polarization and travel at the speed of light, which is ideal for quantum networks and useless for memory. The math in this lesson is identical across all three platforms; only the noise numbers change.

Qubits versus classical bits

PropertyClassical bitQubit
State spaceTwo values, 0 and 1Continuous family of states in a 2D complex space
CopyingFreely copyableForbidden by the no-cloning theorem
MeasurementNon-destructive readoutProjective collapse; the pre-measurement state is gone
Dominant noiseBit flipsBit flips, dephasing, and idle decay
Algorithmic powerDeterministic logic onlySuperposition plus interference

Dirac (Bra-Ket) Notation

Paul Dirac introduced a compact notation for quantum states:

  • Ket: denotes a column vector (state vector)
  • Bra: denotes the conjugate transpose (row vector)
  • Inner product: gives a complex scalar
  • Outer product: gives an operator

The completeness relation for a single qubit is:

This identity operator ensures probability conservation during measurement. Inserting it between a bra and a ket lets you expand any state in any basis without changing the physics, which is exactly how change-of-basis calculations are done by hand.

Three properties get used constantly. Orthogonality: because the basis vectors point along different axes. Normalization: for every physical state. Linearity in the second argument: . Work one inner product by hand to build the muscle. With , the bra is — conjugation flips the sign of — so . Skipping the conjugate is the most common hand-calculation error in introductory quantum mechanics.

Example: Bell State

The Bell state is written as:

Neither qubit in this state has a definite individual value, yet each measured alone gives a fair coin flip: the expansion gives with . The correlation is perfect — the two outcomes always match — which is stronger than any shared classical random seed can produce. The Bell state is the simplest entangled state, and it is the resource consumed by teleportation, superdense coding, and entanglement-based key distribution later in this course.

The Bloch Sphere

Every pure qubit state can be visualized on the Bloch sphere. Using spherical coordinates , a general qubit is:

The half-angles are not an arbitrary convention. Global phase is unobservable, so the physically distinct pure states of a qubit fill a sphere rather than a four-dimensional complex ball. Key points on the Bloch sphere:

CoordinatesStateLocation
North pole
South pole
, plus state+X axis
, minus state−X axis
, +i state+Y axis

States with definite Z value sit at the poles; states with definite X value sit on the equator at and . Mixed states — the correct description of a qubit that has decohered or was never prepared cleanly — live inside the sphere, with the center representing the maximally mixed state that carries no information at all.

Any single-qubit gate corresponds to a rotation on the Bloch sphere, and the rotation table below covers every single-qubit gate you will meet in the circuits of this course:

GateRotationEffect
Pauli-Xπ rotation about XSwaps and
Hadamardπ rotation about the X+Z diagonalSends poles to equator and back
Phase Sπ/2 about ZAdds a quarter-turn of relative phase
Tπ/4 about ZEighth-turn; the gate that makes the Clifford group non-universal

Superposition

Superposition is the ability of a qubit to be in multiple states at once. When we apply a Hadamard gate to :

The state is an equal superposition of and . This is not a classical mixture — it is a fundamentally quantum coherence that enables quantum parallelism.

Superposition vs Classical Randomness

A key distinction: superposition involves interference between amplitudes, while classical randomness has no phase relationships. This interference is what powers quantum algorithms. The numbers make it concrete. Prepare — two "branches" that each look like a fair coin — and the amplitudes combine to with certainty, because the amplitudes cancel while the amplitudes add. A classical random coin wired to the same branch structure could never produce that outcome; it would always return heads half the time. Every quantum speedup in this course is some carefully engineered version of that cancellation.

Measurement

Measurement collapses a qubit state to one of the basis states with probabilities given by the Born rule:

After measuring , the state becomes:

The expectation value of an observable is:

Two practical numbers follow immediately. First, shot noise: running the same circuit times estimates with standard error , which at and shots is about 0.0055 — this is why hardware results are always quoted with error bars and why 8192 is a common default shot count on cloud backends. Second, readout error: real devices misassign and roughly 0.5–4% of the time depending on calibration, so an observed probability is a mixture of the true Born-rule value and the assignment matrix. Expectation values of Pauli observables are usually computed as , which for the state equals 0 even though every single shot returns a definite bit.

Quantum State Tomography

To fully reconstruct an unknown qubit state, we perform quantum state tomography by measuring in multiple bases. For a single qubit, we need measurements in the X, Y, and Z bases to reconstruct the density matrix:

where is the Bloch vector and are the Pauli matrices.

Two bases are not enough: Z-basis statistics fix only , leaving a whole circle of states on the same latitude with identical computational-basis outcomes but different interference behavior. Adding the X basis pins down , and the Y basis finishes . With shots per basis, each Bloch component is estimated to precision on the order of , so resolving the vector to ±0.01 costs roughly 10,000 shots per basis — about 30,000 shots for one qubit. For qubits the state space has dimension , which is why full tomography dies somewhere around 10–12 qubits and why researchers instead use techniques such as shadow tomography that reuse each measurement sample across many observables.

Python: Simulating a Qubit

python
import numpy as np

# Define computational basis
KET_0 = np.array([1, 0], dtype=complex)
KET_1 = np.array([0, 1], dtype=complex)

# Hadamard gate
H = (1 / np.sqrt(2)) * np.array([[1, 1],
                                   [1, -1]], dtype=complex)

# Apply H to |0>
psi = H @ KET_0
print(f"State after Hadamard: {psi}")
# Output: [0.707+0.j 0.707+0.j]

# Probabilities
probs = np.abs(psi) ** 2
print(f"P(|0>) = {probs[0]:.4f}, P(|1>) = {probs[1]:.4f}")

This demonstrates how a deterministic unitary operation creates a superposition with equal probabilities of measuring or .

The full single-qubit toolkit — every gate in the rotation table plus Bloch-vector readout and finite-shot sampling — fits in the second script below. The bloch_vector function is the bridge between the abstract state and the geometry: it computes the three Pauli expectation values that a real experiment would measure, then you can compare the sampled frequencies against the exact Born-rule probabilities.

python
import numpy as np

rng = np.random.default_rng(7)

GATES = {
    "X": np.array([[0, 1], [1, 0]], dtype=complex),
    "Y": np.array([[0, -1j], [1j, 0]], dtype=complex),
    "Z": np.array([[1, 0], [0, -1]], dtype=complex),
    "H": (1 / np.sqrt(2)) * np.array([[1, 1], [1, -1]], dtype=complex),
    "S": np.array([[1, 0], [0, 1j]], dtype=complex),
    "T": np.array([[1, 0], [0, np.exp(1j * np.pi / 4)]], dtype=complex),
}

def apply(psi, *names):
    for name in names:
        psi = GATES[name] @ psi
    return psi

def bloch_vector(psi):
    x = 2 * np.real(np.conj(psi[0]) * psi[1])
    y = 2 * np.imag(np.conj(psi[0]) * psi[1])
    z = float(np.abs(psi[0])**2 - np.abs(psi[1])**2)
    return np.array([x, y, z])

def sample(psi, shots=8192):
    probs = (np.abs(psi) ** 2).real
    return rng.choice([0, 1], size=shots, p=probs)

plus  = apply(np.array([1, 0], dtype=complex), "H")
plusi = apply(np.array([1, 0], dtype=complex), "H", "S")
print("Bloch vector of |+> :", np.round(bloch_vector(plus), 4))
print("Bloch vector of |+i>:", np.round(bloch_vector(plusi), 4))

counts = sample(plus)
print(f"Sampled P(0) from H|0> = {counts.mean():.4f} (theory 0.5000)")

Running the second script prints a Bloch vector of approximately [1, 0, 0] for the plus state and [0, 1, 0] for the +i state, confirming that the phase gate moved the state a quarter-turn around the Z axis while leaving the measurement statistics in the computational basis untouched.

Common Mistakes

Treating the amplitudes Îą and Îē as probabilities directly.

Fix: Only the squared magnitudes are probabilities. The amplitudes themselves are complex numbers whose phases drive interference; square them before interpreting anything as a chance.

Assuming a superposition means the qubit is secretly 0 or 1 and we just do not know which.

Fix: A classical mixture and a coherent superposition give identical Z-basis frequencies but different X-basis frequencies. Interference in a second basis is the experimental test that distinguishes them.

Forgetting the half-angle convention on the Bloch sphere.

Fix: The polar angle in the state formula is Îļ/2, not Îļ. A full 2π rotation of the physical state brings back only a global sign, so 2π of Bloch rotation equals the identity on the qubit.

Key Takeaways

  • A qubit is a normalized pair of complex amplitudes: measurement probabilities come from squared magnitudes, interference comes from relative phase.
  • Dirac notation compresses linear algebra: bras conjugate, kets do not, and completeness inserts the identity in any basis without changing physics.
  • The Bloch sphere represents every pure single-qubit state as a point on a sphere with half-angle coordinates; single-qubit gates are rotations on that sphere.
  • State tomography needs three measurement bases and on the order of 10,000 shots per basis for percent-level precision, which is why full state reconstruction scales exponentially with qubit count.
CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-10-16

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Need Expert Quantum Computing Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement