The Surface Code Explained for Beginners
Why a code is needed
Physical qubits make errors often, and you cannot simply copy a qubit to make backups because of the no-cloning rule. Error correction solves this by spreading one qubit's information across many entangled qubits so that damage can be detected and fixed without learning the data itself.
How the layout works
In the surface code, qubits sit on a 2D lattice in a checkerboard pattern. Some are data qubits that hold the information. Others are measurement qubits that sit between them. Each measurement qubit repeatedly checks a parity, a yes or no property about its few neighbors, such as whether an even number of them flipped. These checks are called stabilizers.
Finding errors
The checks run again and again in cycles. If a data qubit flips, the neighboring checks change their results, creating a pattern of "defects." A classical program called a decoder reads the pattern, infers the most likely error, and tracks or corrects it. The data qubits are never measured directly during this process, which is what keeps the stored quantum state intact.
Distance, threshold and overhead
- Code distance: the size of the grid. A larger distance means more errors must line up before the logical qubit fails.
- Threshold: if physical error rates are below a critical value, making the code bigger reduces logical errors, often dramatically. Above it, adding qubits only adds more noise. Commonly cited thresholds for the surface code are around the one percent level per operation, which is relatively forgiving.
- Overhead: the number of physical qubits per logical qubit grows roughly with the square of the distance. Useful machines may need hundreds to thousands of physical qubits per logical qubit, with the exact figure depending on hardware quality and the target accuracy.
One more detail: the logical qubit is only useful if operations on it, such as gates between logical qubits, can also be done without breaking protection. Techniques such as lattice surgery and magic state preparation exist for this purpose, and they add a significant share of the total cost of a full computer.
Why it is popular
It only needs qubits to interact with nearest neighbors on a flat grid, which matches superconducting chips well. Its high threshold makes it achievable with realistic hardware. Google researchers have reported experiments in which a larger surface code performed better than a smaller one, a milestone often described as operating below threshold. As with any lab result, details and scope matter.
Drawbacks and open questions
The big cost is overhead. Running logical operations also takes extra effort, and the decoder must keep up in real time with a constant stream of measurements. Other codes may need fewer qubits but require longer range connections, which suits some neutral atom or ion systems. Which code families win is not settled. For the bigger picture of why this matters, see NISQ explained and the timeline.
Frequently asked questions
What is the surface code?
It is a quantum error correction scheme using a 2D grid of physical qubits, where repeated neighbor checks protect one logical qubit.
What is a stabilizer?
It is a check that measures a joint property of a few qubits, such as parity, without revealing the stored data.
What does code distance mean?
It measures how many physical errors are needed to cause a logical error. Larger distance means stronger protection but more qubits.
What is the error threshold?
It is the physical error rate below which making a code bigger lowers the logical error rate. Above it, bigger codes do not help.
How many physical qubits make one logical qubit?
It depends on the hardware error rate and the target accuracy. Estimates for useful machines range from hundreds to thousands per logical qubit.
Is the surface code the only option?
No. Other code families exist and may use fewer qubits but need more connectivity. The best choice depends on the hardware.
Keep reading
- Quantum Error Correction Explained
Qubits are fragile, so quantum computers need error correction. Learn how logical qubits are built and why this is the key challenge. - NISQ Explained: Noisy Intermediate-Scale Quantum Computers
What does NISQ mean? Learn why today's noisy, mid-size quantum computers are limited, what they can do, and how the field plans to move past them. - Superconducting Qubits Explained in Depth
How do superconducting qubits work? A clear look at circuits, microwave control, strengths, weaknesses and open questions in widely used quantum hardware. - Quantum Benchmarks Explained: Why Qubit Count Misleads
How do you measure a quantum computer? Learn what error rates, fidelity, coherence time and quantum volume mean, and why qubit count alone is not enough.
All Quantum computing guides | Back to top | Search the site
Main pages: Quantum computing explained | Quantum and crypto | Companies | Quantum news | Glossary