Fault Tolerance

Quantum Error
Correction

Quantum systems are extraordinarily fragile — decoherence and gate imperfections threaten every computation. Quantum error correction uses entanglement and redundancy to detect and fix errors without ever directly measuring — and therefore collapsing — the quantum data.

Decoherence Shor Code Steane Code Syndrome Measurement Surface Code Qubit Overhead

The Fragility Problem

A classical computer bit is robust — it is either 0 or 1, and thermal noise typically must cross a large energy barrier to flip it. A qubit, by contrast, exists in a delicate superposition that can be disrupted by any interaction with the environment. This process is called decoherence.

Decoherence manifests in two timescales: T1 (energy relaxation, where |1⟩ spontaneously decays to |0⟩) and T2 (dephasing, where the phase relationship between |0⟩ and |1⟩ is randomised). Current superconducting qubits have T1 and T2 times on the order of microseconds to milliseconds — far shorter than the time required for useful algorithms.

Gate operations also introduce errors. Even the best two-qubit gates today have error rates of around 0.1–1% per operation. For algorithms requiring millions of gates (like Shor's algorithm at cryptographically relevant scales), errors accumulate disastrously without correction.

🚫

No-Cloning Theorem

Classical redundancy copies bits: 0 → 000, then majority vote corrects errors. Quantum mechanics forbids copying an unknown quantum state, so direct redundancy is impossible.

🔍

Measurement Collapse

Checking a qubit for errors by measuring it destroys the superposition. QEC instead uses ancilla qubits to measure error syndromes — properties that reveal error type without revealing (collapsing) the logical state.

🔄

Continuous Error Space

Classical errors are discrete (a bit flips or doesn't). Quantum errors are continuous rotations. The key insight: any error on a qubit is a linear combination of Pauli operators {I, X, Y, Z} — so correcting these discrete cases covers all possibilities.

Two Error Types

Quantum errors come in two flavours: bit-flip errors (X: swaps |0⟩ and |1⟩) and phase-flip errors (Z: sends |+⟩ to |−⟩). A complete QEC code must handle both simultaneously.

q₁ q₂ q₃ q₄ q₅ q₆ q₇ q₈ q₉ Block 1 Block 2 Block 3 H H H Error E Syndrome Correct H = Hadamard • = control ⊕ = CNOT target
Shor's 9-qubit code (1995) — the first quantum error-correcting code. One logical qubit is encoded across nine physical qubits in two nested layers: three inner groups of three qubits each handle bit-flip errors; the outer structure handles phase-flip errors. Any single-qubit error can be corrected. Source: Wikimedia Commons

Syndrome Measurement

The central technique in QEC is measuring stabilisers — multi-qubit Pauli operators that commute with the code space but anticommute with errors. Measuring these stabilisers projects the error onto a discrete set of outcomes (the error syndrome) without disturbing the logical information encoded in the code space.

For example, in the three-qubit bit-flip code (|0⟩ → |000⟩, |1⟩ → |111⟩), measuring the parity of qubits 1&2 and qubits 2&3 reveals which (if any) qubit flipped without revealing whether the logical qubit is 0 or 1. The error is then corrected by applying the appropriate Pauli gate.

Code Physical Qubits Logical Qubits Errors Corrected Notes
Shor code 9 1 Any single-qubit First QEC code; combines bit-flip + phase-flip codes
Steane code 7 1 Any single-qubit CSS code; based on classical Hamming [7,4,3] code
5-qubit code 5 1 Any single-qubit Smallest possible code for single-qubit error correction
Surface code ~1,000 (per logical) 1 Many errors (high threshold ~1%) Leading candidate for fault-tolerant quantum computers
Toric / topological codes L² (lattice) 2 O(L) errors Theoretical basis for surface codes; high fault-tolerance
Planar surface code lattice diagram showing data qubits, smooth/rough boundaries, and logical operator chains
The planar surface code. Data qubits (circles) sit on lattice vertices; ancilla qubits (squares) measure X-type and Z-type stabilisers on each plaquette and vertex. Errors manifest as chains of stabiliser violations; a classical decoder identifies and corrects them. Source: LeftAsExercise

A Critical Milestone

The threshold theorem states: if physical gate error rates fall below a code-specific threshold, then by encoding information in more physical qubits, logical error rates can be suppressed arbitrarily close to zero. Below the threshold, more redundancy helps; above it, more qubits make things worse.

Surface code threshold: Approximately 1% per gate — achievable with current hardware. IBM's and Google's best processors reach ~99.5–99.9% two-qubit gate fidelity, putting them near but not yet comfortably below the threshold when all overhead is included.

The overhead cost: Current estimates suggest approximately 1,000 physical qubits per logical qubit at achievable error rates. A fault-tolerant attack on RSA-2048 via Shor's algorithm requires roughly 4,000 logical qubits → ~4 million physical qubits. Today's processors have ~1,000–2,000 physical qubits total.

Recent progress: In 2023, Google demonstrated that their surface code below the error threshold — meaning adding more qubits genuinely reduced the logical error rate for the first time. This is a landmark experimental confirmation of the threshold theorem in practice.