The surface code and the threshold theorem
Fault tolerance lets a quantum computer run arbitrarily long computations if physical error rates are below a threshold; the surface code, with a threshold near 1% and only local checks, is the leading way to get there.
On this page16 sections
Almost every resource estimate for useful quantum algorithms (Shor, chemistry) assumes surface-code error correction, so its threshold, qubit overhead and decoders set the size of the machines that must be built.
How noisy qubits are combined into reliable ones, and why errors can be beaten if each part is good enough.
- 1Physical qubits fail about one in a thousand
- 2Spread information across many qubits
- 3Parity checks reveal errors, not data
- 4Decoder fixes errors in real time
- 5Bigger code, exponentially fewer errors
Classical intuition. The repetition code stores a bit as 000 or 111; one flipped bit is fixed by majority vote. Quantum states cannot be copied, and measuring them disturbs them, so quantum codes instead measure stabilizers: parity checks such as "are qubits 1 and 2 equal?" whose outcomes reveal the error pattern (the syndrome) but say nothing about the encoded information.
Threshold theorem. Suppose each gate or measurement fails independently with probability . If is below a constant threshold , encoding and correcting repeatedly drives the logical error rate as low as needed, with overhead growing only polylogarithmically in the computation size.
Surface code. Data qubits sit on a 2D grid; between them, measurement qubits check the parity of their four neighbours, either in the basis or the basis. A logical error requires a chain of errors stretching across the whole patch, of length at least the code distance . A patch uses about physical qubits, and the logical error rate falls roughly like : every increase of by 2 divides it by a factor . Google's 2024 Willow chip measured , reaching 0.14% logical error per cycle at .
Decoding. A classical decoder must infer the most likely errors from the syndromes in real time, typically by minimum-weight perfect matching, pairing up the "defects" with the shortest connecting paths.
Gates. CNOTs and other Clifford gates are done by merging and splitting patches (lattice surgery); the remaining gate needs magic states.
Scale. A useful algorithm may need a logical error rate near per operation. With that requires distances in the twenties, which is why each logical qubit costs about a thousand physical ones.
Go deeper
The full technical text.
Codes and the threshold theorem
Quantum error correction encodes logical qubits into physical ones so that errors on a few qubits can be detected by measuring stabilizers (parity checks) and corrected without learning the encoded state. Shor's 9-qubit code (1995) was the first; Calderbank and Shor (1996) and Steane showed good codes exist.
The threshold theorem (Aharonov and Ben-Or; Knill, Laflamme and Zurek; Kitaev; 1996–1997) says that if every gate, preparation and measurement fails independently with probability below a constant , any circuit of size can be simulated reliably with only overhead. Noise is not a fundamental obstacle, provided it is weak and not too correlated.
The surface code
Kitaev's toric code places qubits on the edges of a square lattice with four-body checks on vertices and faces; the planar surface code is its version with boundaries. Dennis, Kitaev, Landahl and Preskill (2002) worked out its use as a quantum memory, Raussendorf and Harrington (2007) gave a fault-tolerant scheme in two dimensions with a threshold of about 0.75%, and Fowler et al. (2012) gave the standard engineering account. Under circuit-level noise the threshold is around 1% (estimates range from roughly 0.5% to 1% depending on the noise model and decoder). Only nearest-neighbour two-qubit gates on a square grid are needed, which suits superconducting chips.
A distance- rotated surface-code patch uses data qubits and measurement qubits and suppresses logical errors roughly as . The suppression factor when grows by 2 is the headline hardware metric. Google's Willow processor (Nature 2025) ran a distance-7 memory on 101 qubits with and logical error per cycle, beyond the lifetime of its best physical qubit, and decoded a distance-5 code in real time with s average latency at a s cycle. Rare correlated error bursts, about once an hour, limited its repetition-code tests.
Decoding and simulation
A decoder turns the syndrome history into a correction. Minimum-weight perfect matching is the standard surface-code decoder, implemented in PyMatching and made fast by the sparse-blossom algorithm (Higgott and Gidney, 2025); union-find and neural-network decoders trade accuracy for speed. Decoders must keep up with the syndrome stream, or a backlog builds up. The stabilizer simulator Stim (Gidney, 2021) samples circuit-level noise fast enough to benchmark codes at large distance.
Logical operations
Clifford operations are done by lattice surgery, merging and splitting patches with measurements (Horsman et al., 2012; Litinski, 2019). Non-Clifford gates such as cannot be done transversally (Eastin–Knill) and are supplied by magic states. Neutral-atom experiments (Bluvstein et al., Nature 2024) ran circuits on up to 48 logical qubits with error-detecting codes, and trapped-ion processors run many encoded qubits beyond break-even; this experimental frontier moves fast.
Limits
The surface code encodes one logical qubit per patch, so overhead is large: estimates for Shor's algorithm with surface codes needed hundreds of thousands to millions of physical qubits. High-rate quantum LDPC codes reduce this at the price of long-range connectivity. And in two dimensions no stabilizer code protects itself passively at finite temperature (Bravyi and Terhal, 2009), so the surface code needs active correction forever.
Words on this page (8)
- qubit
- The quantum version of a bit, which can be in a superposition of 0 and 1.
- stabilizer
- A parity check whose result reveals errors without revealing the stored information.
- syndrome
- The pattern of parity-check results, used to locate errors.
- threshold theorem
- If every part's error rate is below a threshold, arbitrarily long reliable computation is possible.
- code distance
- The fewest physical errors needed to cause an undetected logical error.
- toric code
- Kitaev's lattice code on a torus; the surface code is its version with edges.
- decoder
- A classical algorithm that turns syndromes into a correction.
- magic state
- A special resource state used to perform the T gate fault-tolerantly.
New to this? Read first (3)
- Quantum error correction (Wikipedia)From the bit-flip code to stabilizers and thresholds.
- Toric code (Wikipedia)The lattice picture behind the surface code.
- Threshold theorem (Wikipedia)Why noise is not a fundamental barrier.
Understanding map
map of the whole wiki →What to read before The surface code and the threshold theorem (left), and what builds on it: entries that depend on it and its open problems (right). Every box links to its page.
- Start with
- Step 2
- Quantum algorithmsAlgorithm
- Step 3
- The surface code and the threshold theoremYou are here
- Then
- Magic states: distillation and cultivationTheory
- Quantum LDPC codesTheory
- A self-correcting quantum memory in three dimensionsOpen problem · D72
Open problems & questions
Progress timeline
- Nov 16, 2026Stability of a variant of the BDL family (preprint, Part I)Related to: A self-correcting quantum memory in three dimensionssource
Hayden's 84-page preprint claims that a three-layer variant of the Balasubramanian-Davydova-Lin code family is stable: stretched-exponential memory time below a critical temperature for local Markovian baths with bounded rates, and, at zero temperature, a uniform gap and superpolynomially long lifetime under weak superpolynomially decaying perturbations. Part II is needed for the rest of the perturbed positive-temperature phase diagram. The paper says Gemini 4 Argon performed most of the detailed proof construction and that Lean 4 formulations of the main theorems are machine-checked in the author's repository. Unrefereed; DARC has not checked the proof or rebuilt the Lean code.
- Sep 30, 2026Cubic code ruled out (preprint)Related to: A self-correcting quantum memory in three dimensionssource
Stengele et al. proved the cubic code thermalises rapidly at all positive temperatures.
- May 11, 2026Claimed passive 3D memory (preprint)Related to: A self-correcting quantum memory in three dimensionssource
Balasubramanian, Davydova and Lin posted a 102-page preprint constructing a 3D Pauli stabilizer Hamiltonian that, they claim, stores a qubit for exponentially long times when coupled to a bath at nonzero temperature. It is unrefereed and DARC has not checked the proof.
- Oct 10, 2025Layer codes partially self-correctRelated to: A self-correcting quantum memory in three dimensionssource
Williamson, and independently Gu et al., showed partial self-correction for layer codes.
- Aug 24, 2024Below threshold in hardwaresource
Google's Willow processor showed logical error suppression with from distance 3 to 7.
- Sep 28, 2023Layer codesRelated to: A self-correcting quantum memory in three dimensionssource
Williamson and Baspin built 3D codes with optimal parameters and a polynomial energy barrier.
- Aug 4, 2012Surface-code engineering guidesource
Fowler et al. gave the standard account of surface-code quantum computing.
- Dec 14, 2011Partial self-correction in the cubic codeRelated to: A self-correcting quantum memory in three dimensionssource
Bravyi and Haah proved memory time up to a size .
- Jan 10, 2011Cubic codeRelated to: A self-correcting quantum memory in three dimensionssource
Haah introduced 3D stabilizer codes without string logical operators.
- Oct 11, 20082D no-goRelated to: A self-correcting quantum memory in three dimensionssource
Bravyi and Terhal proved that 2D stabilizer codes have constant energy barriers.
- Oct 24, 2001Topological quantum memorysource
Dennis, Kitaev, Landahl and Preskill analysed the surface code as a memory and its threshold.
- Nov 14, 1996Threshold theoremsource
Aharonov and Ben-Or posted their proof that computation tolerates a constant error rate; Knill, Laflamme and Zurek and Kitaev gave independent proofs.
- Oct 1, 1995First quantum error-correcting codesource
Shor's 9-qubit code was published in Physical Review A (month of the issue).