One Surface-Code Error-Correction Cycle
Walk a single stabilizer measurement round of a small surface code, inject one bit-flip error, and show how the syndrome localizes it.
Setup
The surface code stores logical information in a 2D lattice of data qubits interleaved with measurement qubits. Each measurement qubit repeatedly measures a stabilizer, a product of Pauli operators on neighboring data qubits, without disturbing the encoded state. A change in a stabilizer outcome flags a nearby error.
Stabilizers
Consider a small patch with X-type plaquette stabilizers and Z-type vertex stabilizers. In the error-free ground state every stabilizer returns +1. A single X (bit-flip) error on one data qubit anticommutes with the two adjacent Z stabilizers, flipping both their outcomes to -1.
import numpy as np
# 5 data qubits in a plus shape; two Z-stabilizers each act on a pair
stab=[(0,1),(1,2)] # qubits each Z-stabilizer checks
state=np.zeros(3,int) # no error -> all parities 0
err=1 # X error on data qubit 1
for s,(a,b) in enumerate(stab):
parity=((a==err)+(b==err))%2
print('stabilizer',s,'->',parity) # both fire: 1,1
Decoding
The pattern of flipped stabilizers is the syndrome. A decoder, often minimum-weight perfect matching, pairs up the defects and infers the shortest error chain that explains them, here a single X on the shared qubit. Applying the inferred correction returns all stabilizers to +1 without ever measuring the logical state.
- Errors are detected only through parity changes, so the logical qubit is never directly measured and stays coherent.
- A chain of errors spanning the lattice edge to edge is a logical error the code cannot detect; larger distance d suppresses this exponentially.
- Kronos control electronics research treats fault-tolerant qubits as a candidate for real-time plasma control co-processors, not current hardware.