Steven GellerQuantum Computing, End to End

Book contents

Current section

Part VI. Reliability and Fault Tolerance

  1. Decoherence and Error Channels
  2. Error Mitigation vs Error Correction
  3. Stabilizers and Syndrome Measurement
  4. Repetition, Bit-Flip, Phase-Flip, and Shor Codes
  5. Surface Codes and Threshold Intuition
  6. LDPC, Bosonic, Cat, GKP, and Topological Approaches
  7. Decoders and Real-Time Classical Control
  8. Logical Qubits and Reliable Operations
  9. Why Useful Quantum Computers Are Systems Engineering Projects

Part VI. Reliability and Fault Tolerance · Chapter 49

Surface Codes and Threshold Intuition

The surface code dominates fault-tolerance roadmaps for a boring reason: it only asks qubits to talk to their nearest neighbors. This chapter builds the threshold intuition — why crossing an error-rate line lets code distance buy reliability — and keeps the overhead in view the whole time.

Lab
In this chapter 16 sections

Below a model-specific threshold, with local stochastic errors, repeated syndrome extraction, and a decoder whose latency and accuracy meet the cycle contract, logical error per cycle falls approximately exponentially with odd distance while patch area, syndrome volume, and logical-operation time grow roughly with distance.

There is no universal surface-code threshold; geometry, circuit, decoder, leakage, correlations, and metric change the number. The companion formula is a labeled sensitivity model and omits lattice surgery, factories, correlated errors, boundary details, and calibrated timing.

Surface-code threshold as a family of crossingsLogical failure curves for increasing code distances improve below a protocol-specific crossing and reverse above it.logical failurephysical errorcrossing bandlarger d helpslarger d hurts
Figure 49.1. Surface-code threshold and overhead sensitivity plot: The curves join a conditional suppression model to distance, area, cycle time, and decoder evidence.

A patch stores information in boundaries and checks

Define data/check roles, X/Z stabilizers, logical operators, distance, and a syndrome cycle at the needed level.

Surface codes matter because their checks are local: each stabilizer touches only a few neighboring qubits on a two-dimensional grid, a layout many hardware approaches can plausibly build. The central intuition is threshold behavior. If the physical error rate sits below a threshold value — and the other assumptions hold — then increasing the code distance drives the logical error rate down. Above the threshold, more qubits mean more places to fail, and distance makes things worse.

Surface codes use local stabilizer measurements on a two-dimensional architecture and offer threshold behavior under explicit models. [surface-codes-2012]

What a distance-d patch actually promises

A planar surface-code patch arranges data qubits and local X- and Z-type checks on a two-dimensional geometry. Repeated ancilla measurements report check eigenvalues without directly reading logical data. Boundaries are chosen so that one nontrivial string of Pauli operators connects one pair of boundaries and implements logical X, while a crossing string connects the other pair and implements logical Z.

Distance d is the minimum weight of an undetectable logical operator under the specified patch and fault model. With perfect syndrome measurement, up to (d1)/2\lfloor(d-1)/2\rfloor suitably modeled data errors can be corrected. With noisy extraction, faults live in space-time and the relevant distance depends on the syndrome circuit and number of rounds. Patch width alone is not the complete protection parameter.

Checks are local, but a logical operation need not be instantaneous. Moving boundaries, braiding defects, or lattice-surgery measurements consume patch area and syndrome cycles. A memory patch count therefore cannot be reused as a complete computation estimate without a logical-operation schedule.

Threshold appears as a family of crossings

For a fixed decoding protocol and noise model, plot logical failure per declared cycle against physical error for several distances. Below the crossing region, larger distance should suppress logical error; above it, the added fault locations overwhelm the extra protection. Finite sizes produce a band of crossings rather than a perfectly universal point.

The companion relation pL=A(pphys/pth)(d+1)/2p_L=A(p_{phys}/p_{th})^{(d+1)/2} is a sensitivity model. When pphys/pth=0.5p_{phys}/p_{th}=0.5, every increase of distance by two multiplies pL by 0.5. At ratio 0.9 the improvement is much slower. At ratio 1.1 the same formula increases with distance, explicitly demonstrating that the below-threshold extrapolation no longer buys protection.

The prefactor A, threshold pth, exponent, and even the denominator of pL depend on the circuit, decoder, physical noise, and whether the reported event is memory failure, logical operation failure, or per-round detection. A “one-percent threshold” copied from another protocol is not an input measurement for this one.

Threshold is a crossing of scaling curves

Compare logical error versus distance above and below threshold without presenting a single universal percentage.

Overhead never disappears, though. Larger distance means more physical qubits per logical qubit, more syndrome rounds, more decoding work, and more control infrastructure. Threshold says the trade can pay off; it does not say the trade is cheap.

Fault-tolerance thresholds are conditional on noise, operations, syndrome extraction, and decoder assumptions. [fault-tolerant-roads][preskill-notes]

Size distance from the workload, not a headline

If a workload exposes one logical patch to C relevant cycles and assigns total failure budget ε to that path, the union-bound teaching target is pLϵ/Cp_L\le\epsilon/C. For many patches and operation classes, allocate separate rows and keep their sum within the total budget. A longer algorithm tightens the per-cycle target even when the physical hardware is unchanged.

Search odd distances and verify the selected cell in the original formula. Because d changes by two, a small adjustment to pphys, A, C, or ε can produce a step in qubit count. The report prints the rejected distance’s pL, the accepted distance’s pL, and the target. Those witness values explain the discontinuity.

A workload budget also needs a denominator. “Logical error 10−12” is incomplete; it could mean per syndrome round, logical gate, code cycle, or entire algorithm. Multiplying a per-gate number by code cycles is a unit error even when both are probabilities.

Solve distance for a workload failure budget

Use the companion model to allocate per-cycle error and find the minimum odd distance.

Keep the overhead relation on the table: QphysicalQlogicalqper logicalQ_{\mathrm{physical}}\approx Q_{\mathrm{logical}}q_{\mathrm{per\ logical}}, where the multiplier grows with the distance your reliability target demands. And keep the syndrome picture from Chapter 47 in mind: every cycle produces s=Hee(mod2)s=H_e e\pmod 2, and the decoder turns streams of those syndromes into corrections.

Code distance controls a correctable-error boundary and increasing it introduces physical and temporal overhead. [nielsen-chuang][surface-codes-2012]

Distance buys several kinds of overhead

A rotated patch uses a geometry-dependent number proportional to d² physical code qubits. Write Qpatch=cqd2+O(d)Q_{patch}=c_qd^2+O(d) and state the convention behind cq. A machine needs additional routing space, logical ancillas, magic-state factories, spare capacity, couplers, readout, and control hardware. Patch qubits are not packaged-system qubits.

Syndrome volume also grows. If a patch has csd2c_sd^2 checks measured for R rounds, the decoder receives on the order of csd2Rc_sd^2R raw syndrome bits before compression or sparsification. Logical lattice-surgery steps often require a number of rounds proportional to d, so temporal overhead rises with the same distance that suppresses error.

Cycle time is seconds per round. Decoder latency is seconds from available syndrome to required decision, while throughput is syndrome bits per second. A decoder can meet average throughput yet miss a feed-forward deadline in the tail. Publish latency percentiles, hardware used, batch size, and the logical schedule’s reaction deadline.

Suppose a simplified patch coefficient yields 1,000 physical code qubits at one distance and 3,000 at the next distance required by a tighter budget. Ten simultaneous logical patches then move from roughly 10,000 to 30,000 code qubits before factories or routing. The tripling follows a reliability decision, not an algorithmic width change.

Distance buys area, time, and decoder load

Generate a table of physical patch qubits, cycles, syndrome bits, and assumed latency with units.

Threshold intuition is only as good as the machinery underneath it. If syndrome extraction is too noisy, the decoder too slow, or leakage unhandled, the conditional fails and distance stops helping. Code distance is an overhead-and-reliability lever, and levers need a fulcrum.

Resource implications must be connected to the full control and decoding stack rather than patch area alone. [full-stack-review]

Three ways the simple curve can fail

First, spatial or temporal correlations can create long error chains more often than the local stochastic model predicts. Crosstalk, shared control faults, radiation events, and drift can couple many locations. A scalar average physical error cannot preserve the tail structure that determines logical failure.

Second, leakage leaves the computational subspace and can persist across rounds, corrupting repeated interactions. Unless the circuit includes leakage reduction and the simulator models the leaked level, distance scaling from a Pauli model may be optimistic. Discarding leaked shots changes the denominator and must be reported.

Third, the decoder can be part of the failure mechanism. Approximation, limited search windows, stale calibration weights, and missed deadlines can raise logical error even when the code and physical process are unchanged. Threshold curves from two decoders are different protocol results, not measurements of one code constant.

Measurement errors add a time-like ambiguity. One wrong syndrome bit can resemble a data fault in a single round; repeated rounds allow the decoder to distinguish their space-time patterns. A perfect-measurement threshold cannot be compared numerically with a circuit-level noisy-measurement threshold without translating the model.

Correlations and leakage can invalidate the curve

Identify the error-model assumptions whose failure makes the extrapolation non-comparable to hardware.

Suppose one logical qubit needs a teaching overhead of 1,000 physical qubits at your current reliability target. A ten-logical-qubit workload then costs roughly 10,000 physical qubits. Now tighten the target logical error rate — the workload got longer, or the answer got more valuable — and the required distance pushes the overhead to 3,000 per logical qubit. The same ten logical qubits now cost roughly 30,000 physical qubits.

Concrete resource estimates must publish their chosen surface-code model instead of importing a headline threshold. [gidney-ekera-2021][surface-codes-2012]

What empirical suppression evidence must contain

The central experimental signature is logical-error suppression as protection grows under the same declared protocol. Compare at least two, preferably three, distances with matched logical task, physical operating regime, number of rounds, decoder, inclusion rules, and logical-error denominator. Show confidence intervals and raw failure counts; a zero-failure point is an upper bound determined by trials, not proof of zero error.

Plot both sides of the fitted crossing when the claim concerns threshold behavior. Below-threshold data should improve with distance. Above-threshold or intentionally stressed data should not be hidden; it checks that the analysis can see the reversal. A fit that forces monotone suppression on every dataset has encoded the conclusion.

Cross-experiment comparison fails when geometry, syndrome circuit, decoder, leakage handling, noise bias, correlation structure, or metric differs. Calibration date and cycle duration matter too. Normalize only quantities with the same operational definition; do not rank platforms by isolated threshold percentages.

Evidence is suppression as protection grows

Define an empirical claim as measured logical scaling across distances under a stated protocol.

The algorithm never changed. The reliability requirement did, and the hardware budget tripled. This is why resource estimation and threshold talk are the same conversation, and why the sensitivity discipline of Chapter 43 applies here unchanged.

Surface codes use local stabilizer measurements on a two-dimensional architecture and offer threshold behavior under explicit models. [surface-codes-2012]

Connect threshold evidence back to resource estimates

A resource estimate selects distance using a suppression model supported—or explicitly not supported—by evidence. It then adds logical layout, factories, routing, decoder compute, timing, and failure-budget allocations. Changing the suppression fit must regenerate the whole estimate because patch area and logical-operation time both depend on d.

The model card names the formula, valid domain, pphys and pth definitions, distance set, decoder, cycle, units, omitted mechanisms, code revision, and source date. The CSV keeps raw pL values rather than only a plot. Every curve point and selected distance must regenerate from the committed command.

The decision rule is conditional but sharp: below the protocol-specific threshold and with decoding/control deadlines met, increased distance is evidence-backed protection when logical failure falls. If those curves flatten, reverse, or become non-comparable, more qubits are overhead without demonstrated suppression. That is the boundary a best-in-class threshold discussion should make impossible to miss.

The three exercise ratios expose different resource consequences. At 0.5, a modest distance increase produces rapid suppression and may meet the workload target before area dominates. At 0.9, many more distance steps may be required, sharply increasing patch area and syndrome volume. At 1.1, no distance search should return a protected design; the estimator must report “outside model’s suppressing regime” instead of exhausting an arbitrary maximum and calling the last distance a result.

A confidence-aware crossing analysis retains failure counts and trials for every distance and physical-error setting. Near the crossing, uncertainty can change curve order. Report an interval or posterior appropriate to the acquisition design, and avoid declaring a precise threshold from overlapping finite-size points. More distances and operating points test scaling more directly than simply adding shots to one cell.

Resource tables must preserve time as well as area. For each chosen distance, include code qubits per patch, number of checks, syndrome rounds per logical operation, syndrome bits per round, cycle seconds, decoder latency seconds, and peak patches. A single “physical qubits” column cannot show whether the selected design stalls on decoding or factories.

Finally, distinguish threshold demonstration from break-even. A logical memory can outperform one chosen physical baseline over one duration without mapping an entire threshold curve; a family of distances can show suppression without yet beating the best physical component at the workload’s duration. Both are useful evidence when their comparators and denominators are explicit. Neither licenses the claim that arbitrary fault-tolerant computation is already available.

The model must also reject even distance when its geometry and search assume odd patches. Quietly rounding an input changes both reliability and area; report the invalid request instead.

Claim-to-source ledger

Surface codes use local stabilizer measurements on a two-dimensional architecture and offer threshold behavior under explicit models. [surface-codes-2012]

Fault-tolerance thresholds are conditional on noise, operations, syndrome extraction, and decoder assumptions. [fault-tolerant-roads][preskill-notes]

Code distance controls a correctable-error boundary and increasing it introduces physical and temporal overhead. [nielsen-chuang][surface-codes-2012]

Resource implications must be connected to the full control and decoding stack rather than patch area alone. [full-stack-review]

Concrete resource estimates must publish their chosen surface-code model instead of importing a headline threshold. [gidney-ekera-2021][surface-codes-2012]

Surface-code threshold and overhead sensitivity plot

Format: Reuse `resources.py`; generate logical-error curves above/below threshold and a units-bearing distance/patch/latency CSV with model metadata.

Artifact acceptance contract
inputoutputreject when
assumptions, units, source/date, workloadraw and derived values, uncertainty, commandunits or comparison scope are missing
synthetic fixture labeled syntheticdeterministic record and PASS lineattributed to real hardware
named baselinesame task and denominatormetric or evidence class differs
from hashlib import sha256
def logical_error(p_phys, distance, threshold=.01):
    if distance < 3 or distance % 2 == 0:
        raise ValueError("distance must be odd and at least three")
    return .1 * (p_phys / threshold) ** ((distance + 1) / 2)
def physical_qubits(distance):
    return 2 * distance * distance - 1
baseline = [logical_error(.001, d) for d in (3, 5, 7)]
counterfactual = [logical_error(.02, d) for d in (3, 5, 7)]
overhead = [physical_qubits(d) for d in (3, 5, 7)]
try:
    logical_error(.001, 4)
    raise AssertionError("even distance accepted")
except ValueError:
    invalid_rejected = True
digest = sha256(repr((.001, .02, (3, 5, 7), .01)).encode()).hexdigest()[:10]
assert baseline == sorted(baseline, reverse=True) and counterfactual == sorted(counterfactual)
assert overhead == [17, 49, 97] and invalid_rejected
print(f"PASS: 49 threshold evidence below={baseline} above={counterfactual} qubits={overhead} input={digest}")

Verification: Tests require logical error to decrease with odd distance only for p_phys<p_th, reject invalid distances, and validate physical-qubit scaling and input hashes.

Commissioned exercise

Prompt: Generate logical-error curves for p_phys/p_th values 0.5, 0.9, and 1.1 across odd distances 3–15, then size one workload failure budget.

Deliverable: Plot, CSV, model card, selected distance/patch budget, and explanation of why the above-threshold curve invalidates scaling.

Pass condition: Axes and probabilities are labeled, monotonic behavior matches the model, the above-threshold case is not extrapolated as protection, and omissions are explicit.

Verifiable solution

Format: Generated reference curves and independently checked distance calculation.

Verification: Regenerate from committed JSON and compare data hashes, monotonicity, distance parity, and sampled formula cells.

With A=0.1 and threshold 0.01, p_phys=0.001 produces a logical-error sequence that decreases as odd distance grows from 3 to 7. At p_phys=0.02 the same expression increases with distance. The second curve is therefore evidence of model failure above threshold, not protection.

Companion work

Artifacts for this chapter

These entries resolve to checked-in local source. Commands are reproduced exactly from the chapter manifest, and source-embedded fixtures are exported as direct downloads.

  1. Reproduce or test

    python3 tools/validate_briefs.py --briefs data/editorial_briefs_36_63.json --from 36 --through 63 --check-rewritten-sources --execute-artifacts

Provenance

Sources and review

  1. Austin G. Fowler et al.. Surface codes: Towards practical large-scale quantum computation. Physical Review A. 2012peer-reviewed review
  2. Earl T. Campbell, Barbara M. Terhal, and Christophe Vuillot. Roads towards fault-tolerant universal quantum computation. Nature. 2017peer-reviewed review
  3. John Preskill. Lecture Notes for Physics 219: Quantum Computation. California Institute of Technology. 2018graduate lecture notes
  4. Michael A. Nielsen and Isaac L. Chuang. Quantum Computation and Quantum Information. Cambridge University Press. 2010textbook
  5. Lieven M. K. Vandersypen et al.. A look at the full stack. Nature Reviews Physics. 2021peer-reviewed perspective
  6. Craig Gidney and Martin Ekerå. How to factor 2048 bit RSA integers in 8 hours using 20 million noisy qubits. Quantum. 2021primary peer-reviewed resource estimate

The load-bearing claims in the chapter are mapped inline to this registered source set. A citation supports only the bounded claim beside it.

Cite this chapter