Errors, Noise & Quantum Error Correction
Why qubits fail and what the industry is doing about it: error models, repetition codes you can run, stabilizers, the surface code, logical-qubit overhead, and mitigation vs correction — the layer every vendor roadmap now lives on.
Qubits fail through four measurable channels: energy decay (T1), phase scrambling (T2), imperfect gates, and imperfect readout. Each one is quantified on real device specification pages, and each compounds exponentially with circuit length — which is why quantum error correction exists at all.
Because our simulator is deliberately noise-free, we model a discrete error by inserting an actual X (bit-flip) or Z (phase-flip) gate into the circuit at the exact moment the fault would strike. This turns noise into something you can place, trace by hand, and predict exactly — including the surprising rule that one error entering a CX gate exits as two.
You cannot copy an unknown qubit: any machine that correctly copies |0⟩ and |1⟩ is forced by linearity to entangle a superposition rather than duplicate it — two lines of algebra prove it. Quantum error correction therefore protects information by spreading it across entangled qubits, never by keeping backups.
The three-qubit bit-flip code stores one logical qubit as α|000⟩ + β|111⟩, detects any single X error by a majority vote, and undoes it exactly — recovering the original amplitudes, not just their probabilities. This chapter runs the entire encode–error–correct cycle coherently on three qubits, with every prediction traced by hand first.
The bit-flip code is blind to Z (phase-flip) errors: a Z passes every parity check with a clean syndrome while corrupting the stored superposition. The fix is to encode in the |+++⟩/|−−−⟩ basis by wrapping the code in Hadamards, which turns every Z error into an X error the repetition code already catches — because H·Z·H = X.
Shor's nine-qubit code was the first code to protect a qubit against any single-qubit error. It nests the three-qubit phase-flip code around three copies of the three-qubit bit-flip code, and it works because every possible single-qubit error — even a tiny analog rotation — behaves, once the parity checks act, like one of just four discrete cases: no error, a bit flip (X), a phase flip (Z), or both (XZ).
A stabilizer is a parity check — a measurement that asks "are these qubits the same or different?" without ever asking what value either one holds. The answers from all the checks form a bit pattern called the syndrome, and each syndrome points to exactly one correction. That is how a code can locate an error without collapsing the superposition it is protecting.
The surface code protects one logical qubit with a 2D grid of physical qubits linked only by local parity checks between nearest neighbours — the connectivity flat superconducting chips already have. Vendors converged on it because it tolerates physical error rates on the order of 1%, an unusually forgiving threshold, and because you scale it by simply making the patch bigger.
A logical qubit is one error-corrected qubit built from many physical qubits, and the exchange rate is steep: at surface-code distance 25, one logical qubit costs about 1,250 physical qubits, so 1,000 logical qubits means roughly 1.25 million physical ones (illustrative scaling arithmetic, not a vendor figure). That multiplication — plus time and classical-processing overhead — is why you must read every vendor "logical qubit" announcement with the demonstrated-vs-roadmap distinction firmly in hand.
Error mitigation cleans up answers after noisy runs — by re-weighting, extrapolating, or discarding measurement results — without needing extra qubits; error correction prevents errors during the computation but demands large qubit overhead. Today's uncorrected devices rely on mitigation, and its costs grow exponentially with circuit size, which is exactly why the field is engineering its way toward correction.