In a classical computer, hardware errors are so rare that most software can ignore them. A quantum computer is different: its qubits lose their state quickly, and every operation on them is slightly imperfect. Long computations are possible only if errors are found and removed while the computation runs, and quantum error correction is the method for doing so.
Why do quantum computers need error correction?
Qubits are fragile. Interaction with the environment gradually destroys their state, a process called decoherence, and every gate and measurement adds a small error; the article on NISQ describes these effects. Because errors accumulate, an uncorrected processor can run only short circuits. Algorithms such as Shor’s algorithm need many orders of magnitude more operations than that.
Classical systems deal with errors through redundancy: store a bit three times and take a majority vote. Quantum mechanics rules out the direct equivalent for two reasons. The no-cloning theorem states that an unknown quantum state cannot be copied, so three identical copies of a qubit cannot be made. And measuring a qubit to check its value destroys the superposition it holds.
How does quantum error correction work?
The solution, first worked out in the mid-1990s by Peter Shor, Andrew Steane and others, is to spread the information instead of copying it. One logical qubit is encoded in an entangled state of many physical qubits, arranged so that no single physical qubit holds the information on its own.
Errors are found with additional qubits, known as check qubits or ancilla qubits. Each one is made to interact with a small group of data qubits and is then measured. The measurement answers a collective question about the group, for example whether an even or an odd number of its qubits have flipped, and reveals nothing about the encoded data itself. The stored state therefore survives the check.
The idea resembles a table of figures with row and column totals, where a total that no longer adds up shows which entry is wrong. The comparison breaks down in one respect: an accountant can also read the entries, whereas in a quantum code only the totals may be read.
The pattern of check results is called the syndrome. A classical program, the decoder, works out from it which error most probably occurred, so that the error can be undone or accounted for. This cycle repeats continuously, and the decoder has to keep pace with the processor.
What is the surface code?
The surface code is the most studied quantum error-correcting code. Data qubits and check qubits alternate on a two-dimensional grid, like the squares of a chessboard, and each check involves only its nearest neighbours. Two kinds of check are used, one for each kind of error a qubit can suffer: bit flips and phase flips. The layout matches chips on which qubits are connected only to adjacent ones, as with superconducting qubits, and the code tolerates comparatively high physical error rates.
The size of the code is given by its distance. A larger distance means a larger grid, more physical qubits and more simultaneous errors that can be corrected. Other families, such as quantum low-density parity-check (qLDPC) codes, are being studied because they may protect the same information with fewer qubits, in exchange for longer-range connections.
What is the error threshold?
Adding qubits also adds places where errors can occur, so a larger code is not automatically better. The threshold is the physical error rate that decides the matter: below it, enlarging the code suppresses logical errors rapidly; above it, enlarging the code makes them worse. For the surface code the threshold is usually quoted at around one per cent per operation, depending on the assumptions made about the noise.
In December 2024 Google reported this behaviour on its Willow chip: as the surface code was made larger, the logical error rate fell. The experiment protected a stored logical qubit, not a full computation, but it showed the central prediction of the theory holding on real hardware.
What does error correction cost?
The cost is overhead. Each logical qubit requires many physical qubits, and stronger protection requires more. Operations on logical qubits add further overhead, and useful algorithms need many logical qubits. A fault-tolerant machine for a task such as breaking current public-key cryptography is therefore expected to need far more physical qubits than any processor has today.
Until such machines exist, most work relies on error mitigation, which is a different thing:
| Error mitigation | Error correction | |
|---|---|---|
| What it does | Reduces the effect of noise on an averaged result | Detects and repairs errors during the computation |
| Extra cost | Many additional circuit runs | Many additional qubits, real-time decoding |
| Long computations | Not suited; the cost grows rapidly with circuit size | Suited in principle, below the threshold |
| Status | In routine use | Early demonstrations |
How Q&Co can help
Q&Co’s projects include a performance and resource assessment, which shows what a given problem requires from the hardware, and the company also advises on quantum hardware selection. To discuss what that means for your use case, contact us.