
Quantum information · institution-dependent · Interactive lesson
The classical bit and the qubit
A bit is a choice between two values. A qubit is a direction in a two-dimensional complex space whose two basis directions are those values, and most directions are neither. Learn to write the state, read its probabilities, discard the one phase nothing can measure, and keep the one that everything else depends on.
UPV-20.01 · Lesson 1 of 9 in this unit. Position is not a completion score.Quantum information · institution-dependent. Your university determines the required depth of these quantum topics, including the use of operators, differential equations and computation. Institution-dependent does not automatically mean optional.
Build the model
A bit picks an element of {0, 1}; a qubit picks a unit vector in C².
The key idea
A qubit is a unit vector α|0⟩ + β|1⟩ in the complex space C², where |0⟩ and |1⟩ are the σz eigenvectors, |α|² + |β|² = 1, and vectors that differ only by an overall phase e(iγ) are the same state.
Example. The vector 3|0⟩ + 4i|1⟩ has norm 5, so the state is 0.6|0⟩ + 0.8i|1⟩: a σz readout gives 0 with probability 0.36 and 1 with probability 0.64, and multiplying the whole vector by −1 or by i changes neither number.
The complete physical model and assumptions
Replace the two-element set {0, 1} with the two-dimensional complex vector space C², and let the old values be its orthonormal basis: |0⟩ = (1, 0)ᵀ and |1⟩ = (0, 1)ᵀ, chosen as the eigenvectors of σz with eigenvalues +1 and −1. A state is then any unit vector |ψ⟩ = α|0⟩ + β|1⟩ with α, β ∈ C and |α|² + |β|² = 1. That is the whole model, and it comes from the postulates already used for spin-½: the Born rule turns |α|² and |β|² into the probabilities of reading 0 and 1, and normalisation is nothing more than the requirement that those probabilities sum to one. Two complex numbers are four real ones; normalisation removes one, and a second disappears because e(iγ)|ψ⟩ gives the same expectation value ⟨ψ|A|ψ⟩ for every Hermitian A, so states are rays rather than vectors. What survives is a polar angle θ and a relative phase φ, |ψ⟩ = cos(θ/2)|0⟩ + e(iφ) sin(θ/2)|1⟩, and the phase is physical: a σz readout cannot see it, but a σₓ readout returns + with probability (1 + sin θ cos φ)/2, which no probabilistic bit can mimic. The cost is twofold. The two continuous parameters are not readable from one copy, since each measurement returns a single bit and leaves the state on the eigenvector it landed on; and the model is a truncation, because almost every real qubit is two levels of a larger system and the algebra holds only while the population outside span(|0⟩, |1⟩) stays negligible.
1A bit is a set; a qubit is a vector space
A classical bit takes one of two values, so its state space is the set {0, 1} and there is nothing between them. The qubit keeps the two labels but changes what they are: |0⟩ = (1, 0)ᵀ and |1⟩ = (0, 1)ᵀ are an orthonormal basis of C², chosen as the eigenvectors of σz = diag(1, −1), so that reading the bit means measuring σz and translating +1 → 0 and −1 → 1. Every unit vector α|0⟩ + β|1⟩ is now a legitimate state, and almost all of them are neither basis vector. The field has to be C, not R. Over the reals the unit vectors form a circle and (|0⟩ + i|1⟩)/√2 does not exist, yet that vector is an eigenstate of σy, an observable as real as σz; complex amplitudes are what let one space carry every direction of a spin-½. In NumPy the object is simply ψ = np.array([α, beta], dtype=complex), and the inner product ⟨φ|ψ⟩ is np.vdot(φ, ψ), which conjugates its first argument exactly as the bra demands.
2Normalise, then read the probabilities off the amplitudes
The Born rule gives P(0) = |⟨0|ψ⟩|² = |α|² and P(1) = |β|², so |α|² + |β|² = 1 is the statement that one of the two outcomes must occur. A vector handed to you unnormalised, say (1, 2)ᵀ, is not yet a state: divide by √(1 + 4) = √5 to get P(0) = 0.20 and P(1) = 0.80. The expectation ⟨σz⟩ = (+1)P(0) + (−1)P(1) = |α|² − |β|² is then −0.60. None of this is visible in one shot. A single σz measurement returns 0 or 1, and the amplitudes only show up as frequencies: in 1000 shots on that state you expect 200 zeros with a binomial spread of √(1000 × 0.2 × 0.8) ≈ 13, so a count of 187 or 213 is unremarkable. Code the readout as p0 = abs(ψ[0])**2 followed by rng.choice([0, 1], size=1000, p=[p0, 1 - p0]) with rng = np.random.defaultrng(); the histogram converges on the amplitudes, the individual shots never do.
3Throw away the global phase and count what is left
Two complex amplitudes are four real numbers. Normalisation spends one. The second goes because the vector e(iγ)|ψ⟩ predicts exactly what |ψ⟩ predicts: for any Hermitian A, ⟨ψ|e(−iγ) A e(iγ)|ψ⟩ = ⟨ψ|A|ψ⟩, and every probability is the expectation value of a projector. So −|ψ⟩, i|ψ⟩ and e(iπ/4)|ψ⟩ are the same state as |ψ⟩; the physical object is the ray, the one-dimensional subspace the vector spans. Two real parameters remain, and the standard way to spend them is to make α real and non-negative: |ψ⟩ = cos(θ/2)|0⟩ + e(iφ) sin(θ/2)|1⟩ with 0 ≤ θ ≤ π and 0 ≤ φ < 2π. The half-angle is not decoration: θ = 0 gives |0⟩ and θ = π gives |1⟩, and those two are orthogonal in C² even though the next lesson will draw them at opposite poles of a sphere. The phase that survives, φ, sits between the two amplitudes rather than on the whole vector, and that is exactly why it cannot be dropped.
4The relative phase is physical: change basis and count again
A σz readout is blind to φ: P(0) = cos²(θ/2) contains no φ at all, so (|0⟩ + |1⟩)/√2 and (|0⟩ − |1⟩)/√2 both return 0 and 1 half the time each. They are still different states, and the way to show it is to measure a different operator. σₓ has eigenvectors |±⟩ = (|0⟩ ± |1⟩)/√2, and ⟨+|ψ⟩ = (cos(θ/2) + e(iφ) sin(θ/2))/√2 gives P(+) = (1 + sin θ cos φ)/2. At θ = π/2 the two states above give P(+) = 1 and P(+) = 0: a phase invisible in one basis is a certainty in another. On hardware nobody rebuilds the detector; the Hadamard H = (1/√2)[[1, 1], [1, −1]] maps |+⟩ → |0⟩ and |−⟩ → |1⟩, so apply H, then read σz, is the σₓ measurement, and in NumPy pₚₗᵤₛ = abs((H @ ψ)[0])**2. Compare a random classical bit, |0⟩ or |1⟩ with probability ½ each. It matches the superposition on P(0) = ½, but in the new basis it gives P(+) = ½|⟨+|0⟩|² + ½|⟨+|1⟩|² = ½, because it has no phase to carry. The qubit's second parameter is what separates them.
5What two continuous parameters do not buy you
It is tempting to read θ and φ as an infinite amount of stored information. They are not retrievable that way. One measurement of any Hermitian operator on C² has at most two outcomes, so it returns at most one bit, and by the projection postulate the state afterwards is the eigenvector it landed on: the original amplitudes are gone. Learning θ and φ means preparing many identical copies and estimating frequencies. With N copies read in σz, the estimate of P(0) has standard deviation √(P(0)(1 − P(0))/N), which for P(0) ≈ ½ and N = 10 000 is 0.005, and the same again in the σₓ and σy bases to pin down φ. That is state tomography, and it is expensive because the resource is the number of copies, not the number of parameters. The Holevo bound makes it a theorem: a single qubit sent on its own, with no entangled partner shared in advance, can transmit at most one classical bit, however finely its amplitudes were prepared. Superposition is a resource for interference and for correlation with other qubits, not a way of packing a real number into a two-level system.
6The model assumes two levels and nothing else
C² is exact for a spin-½ magnetic moment with its position frozen: the operator algebra is su(2) and there is no third level to leak into. Every other qubit is a truncation. A transmon is a weakly anharmonic oscillator with ω₀₁/2π ≈ 5 GHz and a next transition ω₁₂ lower by roughly 200 to 300 MHz; a trapped-ion qubit is two hyperfine levels picked out of many; a photonic qubit is one photon in two modes, with the vacuum one loss away. In each case the true state lives in a larger space, and writing α|0⟩ + β|1⟩ asserts that the population outside span(|0⟩, |1⟩) is negligible. A drive pulse of duration τ has spectral width of order 1/τ, so a 20 ns pulse spreads over about 50 MHz, comfortably inside a 250 MHz anharmonicity, which is why it can flip the qubit without lifting it to |2⟩. Shorten the pulse to 2 ns and its 500 MHz bandwidth reaches the next level, and the two-level algebra of this lesson quietly stops describing the device. Leakage is measured, budgeted and corrected precisely because the model is an approximation.
Key equations
Read the units, assumptions and limits before substituting.
Qubit state in the computational basis
|ψ⟩ = α|0⟩ + β|1⟩ = (α, β)ᵀ, α, β ∈ C
Two amplitudes hold everything the qubit can predict. A bit holds one of two labels; a qubit holds a direction in C².
α and β are dimensionless complex amplitudes; |0⟩ = (1, 0)ᵀ and |1⟩ = (0, 1)ᵀComputational basis as the σz eigenbasis
σz = diag(1, −1), σz|0⟩ = +|0⟩, σz|1⟩ = −|1⟩
Names the operator whose measurement reads the bit. Any Hermitian operator that does not commute with σz has a different eigenbasis and defines a different readout; aI + bσz shares this one.
eigenvalues ±1 label the bit values 0 and 1; ⟨σz⟩ = |α|² − |β|² is dimensionlessBorn rule and normalisation
P(0) = |⟨0|ψ⟩|² = |α|², P(1) = |β|², |α|² + |β|² = 1
One shot returns one bit. The amplitudes appear only as frequencies over many identically prepared copies.
probabilities are dimensionless; an unnormalised (a, b)ᵀ is divided by √(|a|² + |b|²) firstGlobal phase is not a state
e(iγ)|ψ⟩ ≃ |ψ⟩, ⟨ψ|e(−iγ) A e(iγ)|ψ⟩ = ⟨ψ|A|ψ⟩
Four real numbers, minus one for normalisation, minus one for γ, leaves two: the qubit is a two-parameter object.
γ real, A any Hermitian operator; states are rays, the points of the projective line CP¹Two-parameter form
|ψ⟩ = cos(θ/2)|0⟩ + e(iφ) sin(θ/2)|1⟩, 0 ≤ θ ≤ π, 0 ≤ φ < 2π
θ sets the σz statistics through P(0) = cos²(θ/2); φ is invisible to σz and is the whole content of the relative phase.
θ and φ in radians; the half-angle makes θ = π land on |1⟩, orthogonal to |0⟩ at θ = 0Relative phase read in the σₓ basis
P(+) = |⟨+|ψ⟩|² = (1 + sin θ cos φ)/2, |±⟩ = (|0⟩ ± |1⟩)/√2
Change the measured operator and the phase becomes a counted frequency — the test no classical probabilistic bit can pass.
|±⟩ are the σₓ eigenvectors; the Hadamard H maps |±⟩ to |0⟩, |1⟩, so a σz readout after H is a σₓ readoutInteractive lab
Predict first. Explore the model. Compare the result.
Explore the model
Try this. Slide γ through a full turn: both arrows rotate together and not one bar moves, which is the global phase being unobservable. Then slide φ from 0° to 180° at θ = 90°: the σz bars still stay put while the σₓ pair swaps from (1, 0) to (0, 1).
Live results
- P(0), σz READOUT
- 0.500
- P(+), σₓ READOUT
- 0.750
- ⟨σz⟩ = cos θ
- 0.000
- ⟨σₓ⟩ = sin θ cos φ
- 0.500
Results follow this lesson’s model and assumptions. Displayed values are rounded.
Predict → change one variable → check
Plan a change before running it. Every other input stays at the saved baseline.
Saved baseline. Polar angle θ: 90 °; Relative phase φ: 60 °; Global phase γ: 0 °
This experiment is kept only while this page is open. It does not change saved course progress.
Catch the common trap
The error is to read α|0⟩ + β|1⟩ as really 0 or really 1, with probabilities |α|² and |β|², and we simply do not know which. That description is a classical probabilistic bit, and it makes a prediction: measured in any basis, an equal random mixture of |0⟩ and |1⟩ gives each outcome with probability ½, so in particular P(+) = ½. The superposition (|0⟩ + |1⟩)/√2 gives P(+) = 1 and (|0⟩ − |1⟩)/√2 gives P(+) = 0. No assignment of classical probabilities to the labels 0 and 1 carries the relative phase, so the amplitudes are not probabilities in disguise: they are what a σz readout squares and a σₓ readout adds first. The opposite slogan, that the qubit is 0 and 1 at the same time, fails in the same place. The state is one definite vector, and for the operator σₓ the state |+⟩ has a definite value, +1, with no uncertainty at all.
Practice & worked examples
3 authored examples. Make an attempt, then reveal the reasoning one step at a time.
EasyExample 1
A qubit is prepared in the unnormalised vector 3|0⟩ + 4i|1⟩. Normalise it, give the probabilities of a σz readout, find ⟨σz⟩, and say how many zeros to expect in 500 shots.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 4 steps revealed.
- Norm squared: |3|² + |4i|² = 9 + 16 = 25, so the norm is 5 and the state is |ψ⟩ = 0.6|0⟩ + 0.8i|1⟩. The i is a relative phase between the two amplitudes and stays.
- Born rule in the σz eigenbasis: P(0) = |0.6|² = 0.36 and P(1) = |0.8i|² = 0.64; they sum to 1 because the vector is now a unit vector.
- ⟨σz⟩ = (+1)(0.36) + (−1)(0.64) = −0.28, the same number as ⟨ψ|σz|ψ⟩ with σz = diag(1, −1).
- Expected zeros in N = 500 shots: 500 × 0.36 = 180, with binomial standard deviation √(500 × 0.36 × 0.64) = √115.2 ≈ 10.7. Anything from about 169 to 191 is consistent with the state.
Answer. |ψ⟩ = 0.6|0⟩ + 0.8i|1⟩; P(0) = 0.36, P(1) = 0.64; ⟨σz⟩ = −0.28; about 180 ± 11 zeros in 500 shots.
MediumExample 2
Write the qubit with θ = 2π/3 and φ = π/3 in the form cos(θ/2)|0⟩ + e(iφ) sin(θ/2)|1⟩ as a column vector, find its σz probabilities, then find the probability of the + outcome in a σₓ readout. What changes in each readout if φ is increased by π?
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 4 steps revealed.
- θ/2 = π/3, so α = cos(π/3) = 0.5000 and |β| = sin(π/3) = 0.8660. With e(iπ/3) = 0.5000 + 0.8660i, β = 0.8660 × (0.5000 + 0.8660i) = 0.4330 + 0.7500i, and |ψ⟩ = (0.5000, 0.4330 + 0.7500i)ᵀ. Check: 0.2500 + 0.1875 + 0.5625 = 1.
- σz readout: P(0) = cos²(π/3) = 0.2500 and P(1) = 0.7500, so ⟨σz⟩ = −0.5000 = cos θ. Neither number contains φ.
- σₓ readout: ⟨+|ψ⟩ = (α + β)/√2 = (0.9330 + 0.7500i)/√2, so P(+) = (0.9330² + 0.7500²)/2 = (0.8705 + 0.5625)/2 = 0.7165. The closed form agrees: (1 + sin θ cos φ)/2 = (1 + 0.8660 × 0.5000)/2 = 0.7165.
- Adding π to φ multiplies β by −1 and flips the sign of cos φ: the σz probabilities stay at 0.2500 and 0.7500, while P(+) drops to (1 − 0.4330)/2 = 0.2835. The phase that σz cannot see moves 43 per cent of the σₓ counts from one detector to the other.
Answer. |ψ⟩ = (0.5000, 0.4330 + 0.7500i)ᵀ; P(0) = 0.2500, P(1) = 0.7500; P(+) = 0.7165. Adding π to φ leaves the σz probabilities untouched and drops P(+) to 0.2835.
HardExample 3
A source claims to emit |+⟩ = (|0⟩ + |1⟩)/√2 on every shot. A sceptic says it emits a random classical bit, |0⟩ or |1⟩ with probability ½ each. Show that σz readouts cannot settle this, design a σₓ test, quantify it for 20 shots, and say what happens if the source emits (|0⟩ + e(iφ)|1⟩)/√2 with a fresh uniformly random φ on each shot.
Sketch your answer or reasoning, then compare it with the authored solution. Your writing is not automatically graded or saved.
0 of 5 steps revealed.
- σz on |+⟩: P(0) = |⟨0|+⟩|² = ½. σz on the random bit: ½ by construction. The two hypotheses predict identical σz frequencies, so no number of σz shots separates them.
- Measure σₓ instead, with eigenvectors |±⟩ = (|0⟩ ± |1⟩)/√2. For |+⟩, ⟨+|+⟩ = 1, so P(+) = 1 on every shot. For the random bit, |⟨+|0⟩|² = |⟨+|1⟩|² = ½, so P(+) = ½ on every shot whichever label was sent.
- In 20 σₓ shots the superposition gives twenty + outcomes with certainty; the random bit gives that record with probability 2⁻²⁰ = 9.5 × 10⁻⁷. A single − outcome refutes the superposition claim outright; twenty straight + outcomes leave the sceptic a one-in-a-million case.
- Implement it as a rotation, not a new detector: H = (1/√2)[[1, 1], [1, −1]] sends |+⟩ → |0⟩ and |−⟩ → |1⟩, so applying H and then reading σz is the σₓ measurement. In NumPy, abs((H @ ψ)[0])**2 returns 1.0 for ψ = [1, 1]/√2 and 0.5 for ψ = [1, 0] or ψ = [0, 1].
- Now let φ be uniformly random on each shot. That shot has P(+) = (1 + cos φ)/2, whose average over φ is ½, the random bit's value, and the same happens in every other basis. A superposition whose relative phase has been scrambled is operationally a classical random bit; keeping the phase is what makes it a qubit.
Answer. Only a σₓ readout (H, then σz) separates them: P(+) = 1 for |+⟩ against ½ for the random bit, so 20 shots settle it to about 1 in 10⁶. With the relative phase randomised, P(+) averages to ½ and the difference is gone.
Quick check
Select an answer and explain it before checking.
Review & continue
A qubit is a unit vector α|0⟩ + β|1⟩ in the complex space C², where |0⟩ and |1⟩ are the σz eigenvectors, |α|² + |β|² = 1, and vectors that differ only by an overall phase e(iγ) are the same state.
- Explain the relationship without looking at the equation.
- Check a sign, a unit and a model assumption in your working.
- Return to the lab or worked example if a step is still unclear.