|q⟩ Bad Qubits

beginner · Programming · Measurement & Probability in Code

Collapse After Measurement

Measurement does two things at once: it produces a classical outcome and it changes the quantum state permanently. The second effect — state collapse — is what makes quantum information fundamentally different from classical information.

What happens during a measurement

Consider a qubit prepared in a superposition

ψ=α0+β1,|\psi\rangle = \alpha|0\rangle + \beta|1\rangle,

where α2+β2=1|\alpha|^2 + |\beta|^2 = 1. Before any measurement the qubit genuinely holds both amplitudes; quantum interference between them is physically possible.

The moment you measure in the computational basis:

  1. A single classical outcome — 0 or 1 — is obtained at random. The Born rule assigns probability α2|\alpha|^2 to outcome 0 and β2|\beta|^2 to outcome 1.
  2. The state collapses to the basis state matching that outcome. If you saw 0, the qubit is now in 0|0\rangle; if you saw 1, it is now in 1|1\rangle. The original amplitudes α\alpha and β\beta are gone.

More compactly, measuring ψ|\psi\rangle and obtaining outcome b{0,1}b \in \{0,1\} leaves the qubit in state b|b\rangle with probability bψ2|\langle b|\psi\rangle|^2.

Why collapse is irreversible

Unitary gates — XX, HH, RyR_y, and every other circuit element you have seen — are reversible operations on the state vector. Measurement is not. Once collapse has occurred, no gate can restore the original superposition because the information about the discarded amplitude has been lost to the environment (or to you, when you read the outcome).

This is not a limitation of technology; it is a feature of how quantum mechanics works. The no-cloning theorem (which follows from the linearity of quantum mechanics) and the collapse rule (the measurement postulate) are distinct but complementary restrictions: together they mean you cannot extract an arbitrary amplitude without destroying it.

Repeat measurement is deterministic

One immediate consequence of collapse is that measuring the same qubit twice in a row gives the same result both times. After the first measurement the qubit is in a definite basis state, say 0|0\rangle. The Born rule now gives P(0)=002=1P(0) = |\langle 0|0\rangle|^2 = 1 and P(1)=0P(1) = 0. There is no randomness left to observe — the second measurement is entirely predictable.

This is the defining property of projective measurement: the operator that describes the measurement is its own square (P2=PP^2 = P), so applying it twice is the same as applying it once.

Collapse in a two-qubit circuit

The collapse rule extends naturally to multi-qubit registers. If you have two qubits in the state

ψ=12(00+11)|\psi\rangle = \tfrac{1}{\sqrt{2}}\bigl(|00\rangle + |11\rangle\bigr)

and you measure only the first qubit, two things happen simultaneously. With probability 1/21/2 you obtain 0 and the two-qubit state collapses to 00|00\rangle; with probability 1/21/2 you obtain 1 and it collapses to 11|11\rangle. In either case the second qubit has also acquired a definite value — this is the entanglement-driven correlation that makes quantum information remarkable. Measuring one part of an entangled state determines the state of the other part instantly, regardless of whether you then go on to measure the second qubit at all.

The lesson on entanglement will return to this in detail; for now, the key point is that collapse is a global update of the entire state vector, not just of the qubit you physically touched.

Sign in on the full site to ask questions and join the discussion.