Skip to content
DAH

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
Why other work relies on it

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.

  1. 1Physical qubits fail about one in a thousand
  2. 2Spread information across many qubits
  3. 3Parity checks reveal errors, not data
  4. 4Decoder fixes errors in real time
  5. 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 pp. If pp is below a constant threshold pthp_{\mathrm{th}}, 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 ZZ basis or the XX basis. A logical error requires a chain of errors stretching across the whole patch, of length at least the code distance dd. A patch uses about 2d22d^2 physical qubits, and the logical error rate falls roughly like (p/pth)(d+1)/2(p/p_{\mathrm{th}})^{(d+1)/2}: every increase of dd by 2 divides it by a factor Λ\Lambda. Google's 2024 Willow chip measured Λ≈2.1\Lambda\approx2.1, reaching 0.14% logical error per cycle at d=7d=7.

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 TT gate needs magic states.

Scale. A useful algorithm may need a logical error rate near 10−1210^{-12} per operation. With Λ≈2\Lambda\approx2 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 kk logical qubits into nn 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 pthp_{\mathrm{th}}, any circuit of size LL can be simulated reliably with only polylog(L)\mathrm{polylog}(L) 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-dd rotated surface-code patch uses d2d^2 data qubits and d2−1d^2-1 measurement qubits and suppresses logical errors roughly as pL≈A (p/pth)(d+1)/2p_L\approx A\,(p/p_{\mathrm{th}})^{(d+1)/2}. The suppression factor Λ\Lambda when dd grows by 2 is the headline hardware metric. Google's Willow processor (Nature 2025) ran a distance-7 memory on 101 qubits with Λ=2.14±0.02\Lambda=2.14\pm0.02 and 0.143%0.143\% logical error per cycle, beyond the lifetime of its best physical qubit, and decoded a distance-5 code in real time with 63 μ63\,\mus average latency at a 1.1 μ1.1\,\mus 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 TT 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)
Words on this page
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)
New to this? Read first
AI-reviewedAn AI drafted this explanation. Check it against the technical text.

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.

  1. Start with
  2. Step 2
  3. Step 3
  4. Then

Open problems & questions

Progress timeline

  1. Nov 16, 2026
    Stability of a variant of the BDL family (preprint, Part I)
    Related to: A self-correcting quantum memory in three dimensions

    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.

    source
  2. Sep 30, 2026
    Cubic code ruled out (preprint)
    Related to: A self-correcting quantum memory in three dimensions

    Stengele et al. proved the cubic code thermalises rapidly at all positive temperatures.

    source
  3. May 11, 2026
    Claimed passive 3D memory (preprint)
    Related to: A self-correcting quantum memory in three dimensions

    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.

    source
  4. Oct 10, 2025
    Layer codes partially self-correct
    Related to: A self-correcting quantum memory in three dimensions

    Williamson, and independently Gu et al., showed partial self-correction for layer codes.

    source
  5. Aug 24, 2024
    Below threshold in hardware

    Google's Willow processor showed logical error suppression with Λ=2.14\Lambda=2.14 from distance 3 to 7.

    source
  6. Sep 28, 2023
    Layer codes
    Related to: A self-correcting quantum memory in three dimensions

    Williamson and Baspin built 3D codes with optimal parameters and a polynomial energy barrier.

    source
  7. Aug 4, 2012
    Surface-code engineering guide

    Fowler et al. gave the standard account of surface-code quantum computing.

    source
  8. Dec 14, 2011
    Partial self-correction in the cubic code
    Related to: A self-correcting quantum memory in three dimensions

    Bravyi and Haah proved memory time LcβL^{c\beta} up to a size L∗∼eβ/3L^*\sim e^{\beta/3}.

    source
  9. Jan 10, 2011
    Cubic code
    Related to: A self-correcting quantum memory in three dimensions

    Haah introduced 3D stabilizer codes without string logical operators.

    source
  10. Oct 11, 2008
    2D no-go
    Related to: A self-correcting quantum memory in three dimensions

    Bravyi and Terhal proved that 2D stabilizer codes have constant energy barriers.

    source
  11. Oct 24, 2001
    Topological quantum memory

    Dennis, Kitaev, Landahl and Preskill analysed the surface code as a memory and its threshold.

    source
  12. Nov 14, 1996
    Threshold theorem

    Aharonov and Ben-Or posted their proof that computation tolerates a constant error rate; Knill, Laflamme and Zurek and Kitaev gave independent proofs.

    source
  13. Oct 1, 1995
    First quantum error-correcting code

    Shor's 9-qubit code was published in Physical Review A (month of the issue).

    source