Surface Code (Distance-3)
Overview
The surface code is a topological quantum error correcting code and the leading candidate for practical fault-tolerant quantum computing. It uses a 2D lattice of qubits with only nearest-neighbor interactions and has an error threshold of ~1% — achievable with today's hardware. Google demonstrated below-threshold operation in 2023.
This implementation is a minimal distance-3 surface code: 9 data qubits + 8 ancilla = 17 total qubits.
Why Surface Code?
| Property | Advantage |
|---|---|
| Error threshold | ~1% (achievable with current superconducting and ion-trap hardware) |
| Gate locality | Only nearest-neighbor CX gates (maps directly to 2D chip layout) |
| Scalable | Increase distance d to exponentially suppress logical error rate |
| Simple stabilizers | Only weight-4 X and Z measurements (no complex multi-qubit gates) |
| Industry consensus | Google, IBM, Quantinuum, and others all pursuing surface-code-based architectures |
2D Lattice Layout (Distance-3)
CODEData qubits (d): vertices Ancillae: between vertices d0 ──── d1 ──── d2 │ X_0 │ X_1 │ d3 ──── d4 ──── d5 │ X_2 │ X_3 │ d6 ──── d7 ──── d8 X stabilizers (stars): measure product of X on 4 adjacent data qubits Z stabilizers (plaquettes): measure product of Z on 4 adjacent data qubits
Stabilizers
X Stabilizers (Stars) — Detect Z Errors
| Stabilizer | Data Qubits | Operator |
|---|---|---|
| X_0 | d0, d1, d3, d4 | X_0 X_1 X_3 X_4 |
| X_1 | d1, d2, d4, d5 | X_1 X_2 X_4 X_5 |
| X_2 | d3, d4, d6, d7 | X_3 X_4 X_6 X_7 |
| X_3 | d4, d5, d7, d8 | X_4 X_5 X_7 X_8 |
Z Stabilizers (Plaquettes) — Detect X Errors
| Stabilizer | Data Qubits | Operator |
|---|---|---|
| Z_0 | d0, d1, d3, d4 | Z_0 Z_1 Z_3 Z_4 |
| Z_1 | d1, d2, d4, d5 | Z_1 Z_2 Z_4 Z_5 |
| Z_2 | d3, d4, d6, d7 | Z_3 Z_4 Z_6 Z_7 |
| Z_3 | d4, d5, d7, d8 | Z_4 Z_5 Z_7 Z_8 |
Key Property: Central Qubit
Qubit d4 participates in all 8 stabilizers (4 X-type + 4 Z-type). An X error on d4 flips all 4 Z stabilizers (syndrome = 1111). This unique signature allows unambiguous identification.
Error Detection
| X Syndrome | Z Syndrome | Interpretation |
|---|---|---|
| 0000 | 0000 | No error |
| 0000 | non-zero | X error detected (Z stabilizers triggered) |
| non-zero | 0000 | Z error detected (X stabilizers triggered) |
| non-zero | non-zero | Y error (both types triggered) |
Logical Operators
- Logical X: Chain of X operators spanning top to bottom (e.g., X_0 X_3 X_6)
- Logical Z: Chain of Z operators spanning left to right (e.g., Z_0 Z_1 Z_2)
- Logical measurement: Determined by boundary conditions
Error Threshold
The surface code can correct errors if the physical error rate satisfies:
p_physical < p_threshold ~ 1%
Below threshold, the logical error rate scales as:
p_logical ~ (p_physical / p_threshold)^((d+1)/2)
Each increase in distance d provides exponential suppression of logical errors.
Scaling with Distance
| Distance d | Data Qubits | Ancilla Qubits | Total Qubits | Logical Error Suppression |
|---|---|---|---|---|
| 3 | 9 | 8 | 17 | baseline |
| 5 | 25 | 24 | 49 | ~100x better |
| 7 | 49 | 48 | 97 | ~10,000x better |
| d | d^2 | d^2 - 1 | 2d^2 - 1 | ~(p/p_th)^((d+1)/2) |
Decoding
The surface code requires a classical decoder to interpret syndromes and choose corrections:
- MWPM (Minimum-Weight Perfect Matching): Standard, near-optimal, O(n^3)
- Union-Find: Faster (almost linear time), slightly suboptimal
- Neural Network: Emerging approach, can adapt to hardware-specific noise
Running the Circuit
PYTHONfrom circuit import run_circuit, verify_surface_code # No error — all syndromes should be trivial result = run_circuit() print(f"Trivial syndrome rate: {result['trivial_syndrome_rate']:.2%}") # X error on qubit 4 (center) — all Z stabilizers should trigger result = run_circuit(error_type='X', error_qubit=4) print(f"Z syndrome: {max(result['z_syndrome_counts'], key=result['z_syndrome_counts'].get)}") # Full verification v = verify_surface_code() for check in v["checks"]: print(f"[{'PASS' if check['passed'] else 'FAIL'}] {check['name']}")
Hardware Progress
| Organization | Milestone | Year |
|---|---|---|
| Below-threshold d=3 to d=5 on Sycamore (Nature 614) | 2023 | |
| IBM | Heavy-hex variant on Eagle/Heron processors | 2023-24 |
| Quantinuum | Ion-trap surface code demonstrations | 2023-24 |
| QuEra | Neutral atom surface code experiments | 2024 |
Code Properties
| Property | Value |
|---|---|
| Notation | [[9, 1, 3]] (distance-3) |
| Data qubits | 9 |
| Ancilla qubits | 8 |
| Total qubits | 17 |
| Error threshold | ~1% |
| Gate locality | Nearest-neighbor only |
| Topology | 2D planar |
| Decoder | MWPM, Union-Find, or neural |