Tutorials · Quantum computing
Quantum Error Correction, an Introduction
Why qubits fail, how quantum error correction protects them without ever looking at them, and what "logical qubits", "code distance" and "below threshold" mean when you read them in the news. With pictures you can play with.
Every few weeks someone announces a new error-correction record. The headlines talk about logical qubits, code distance and running below threshold. This page explains what those words mean, and why this is the part of quantum computing that decides whether the whole thing works. You need a little background on qubits and nothing else.
Qubits are fragile
Section titled “Qubits are fragile”The transistors in your laptop are astonishingly reliable. A logic gate might get a bit wrong perhaps once in a billion billion operations. Today’s best qubits get something wrong roughly once every thousand operations, and many are worse.
Errors come from everywhere. A whiff of stray heat. A passing cosmic ray. A control pulse that is a hair too long. A neighbouring qubit that was supposed to stay quiet and didn’t. A qubit stores its information in the lengths and the angles of its arrows (its amplitudes and their phase), and the outside world is constantly nudging both. Each nudge leaks a little information about the qubit into its surroundings. Physicists call this decoherence, and it is the same process that stops a coffee cup from ever being in two places at once.
Now the problem. The algorithms people actually want, such as breaking today’s encryption or simulating a useful catalyst, need billions of operations in a row. At one error per thousand, the answer is garbage long before the calculation ends. Better hardware helps, but no realistic improvement closes a gap of a factor of a million. We need a way to find and fix errors as they happen.
The classical trick: repetition
Section titled “The classical trick: repetition”Ordinary engineers solved their version of this problem long ago. Want to send a bit over a crackly line? Send it three times:
If one copy gets flipped on the way, say 000 arrives as 010, a majority vote still gives the right answer. The
scheme only fails if two of the three copies flip, which is much less likely. If each copy flips with probability ,
the vote fails with probability about . For that is , more than thirty times better.
Use five copies and it takes three flips to fool you. Seven copies, four flips. Each step up buys another big factor, as long as is small to begin with. That last condition matters more than it looks. Try it:
If the noise is so bad that most copies are wrong, the majority is usually wrong too, and adding copies makes things worse. There is a tipping point. For the repetition code it is 50%. Hold onto that idea; it comes back, with a much smaller number, at the end of this page.
Why quantum makes this hard
Section titled “Why quantum makes this hard”So just copy the qubit three times and vote? Three things get in the way, and for years they looked fatal.
- You can’t copy a qubit. It’s a theorem, called the no-cloning theorem: there is no machine that takes an unknown state and produces two copies of it. Quantum information can be moved, but not duplicated.
- Looking destroys it. Measuring a qubit in superposition gives a plain 0 or 1 and wipes out the arrows. A majority vote that peeks at every copy would wreck the very thing it was protecting.
- Errors are continuous. A classical bit either flips or it doesn’t. A qubit’s arrow can drift by any small angle. Worse, it can suffer phase errors, where the angle between its arrows changes, and those have no classical counterpart at all.
Many physicists suspected that quantum computers would always drown in noise. In 1995 Peter Shor showed they don’t have to.
The quantum fix: spread it out, check parities
Section titled “The quantum fix: spread it out, check parities”The trick is not to copy the state, but to spread it. Using entanglement, one qubit’s worth of information gets smeared across several physical qubits. The simplest example is the three-qubit bit-flip code:
Look carefully: this is not three copies of the original qubit. It is a single entangled state of three qubits. The amplitudes and aren’t written down in any one place. They live in the whole.
Now the clever bit. We never measure the qubits themselves. Instead we ask comparison questions: “Are qubits 1 and 2 the same?” and “Are qubits 2 and 3 the same?” These are parity checks. In the state above, both and answer “yes, same” to both questions. So the answers tell you nothing about or , and asking them doesn’t disturb the stored information. But if one qubit has been flipped, the answers change.
The pair of answers is called the syndrome, like a doctor’s list of symptoms, and it points straight at the culprit:
| Parity 1–2 | Parity 2–3 | Diagnosis |
|---|---|---|
| same | same | no error |
| different | same | qubit 1 flipped |
| different | different | qubit 2 flipped |
| same | different | qubit 3 flipped |
Flip the guilty qubit back and the state is restored, with and untouched. The checks are carried out by extra helper qubits, called ancilla or measure qubits, and they repeat over and over in rounds, like a heartbeat.
What about those continuous, small drifts? This is the most surprising part of the whole story. Measuring the syndrome forces a small, smeared-out error to make up its mind. A tiny rotation becomes either “no error” (most of the time) or “a full flip” (occasionally), and a full flip is something the code can see and fix. The measurement turns analog noise into digital errors. It is the same quantum rule that makes a half-way arrow give a definite 0 or 1, working in our favour for once.
Logical qubits and code distance
Section titled “Logical qubits and code distance”The protected, spread-out qubit is called a logical qubit. The pieces of hardware underneath are physical qubits. When a lab says “we ran 12 logical qubits on 98 physical qubits”, that is the relationship they mean: many fragile qubits working together as a few sturdy ones.
How sturdy? A code’s strength is measured by its distance, : the smallest number of physical errors that can fool it into a wrong answer without being noticed. The three-qubit code has against bit flips: it takes three flips (turning into ) to change the stored value silently. Bigger distance means more qubits, and much stronger protection, but only if the hardware is good enough. You’ll see why in a moment.
The surface code
Section titled “The surface code”The workhorse of today’s experiments is the surface code. Picture a chessboard. Data qubits sit at the corners of the squares; each square holds a measure qubit that checks the parity of the data qubits around it. Squares come in two kinds, in a checkerboard pattern: one kind watches for bit flips, the other for phase flips.
Play with it for a minute and you’ll discover the surface code’s central fact. The checks don’t see errors directly. They see the ends of chains of errors. A single error lights up the checks on either side of it. Two neighbouring errors light up only the outer pair, because the check between them sees two flips and calls it even. Software called a decoder looks at the pattern of lit checks each round and works out the most likely set of errors that would produce it.
The danger is a chain that runs all the way across the board. Its ends fall off the edges, nothing lights up, and the stored information has been flipped without anyone noticing. The shortest such chain has length , which is exactly what the distance measures. A bigger board means a logical error needs a longer conspiracy of physical errors.
The surface code’s big advantages are practical. Each qubit only needs to talk to its nearest neighbours on a flat chip, which is what most hardware can actually build. It also tolerates fairly noisy qubits. The cost is size: a distance- surface code uses about physical qubits, so roughly 100 for and thousands for the distances useful algorithms will need.
Newer families called qLDPC codes (the letters stand for “low-density parity check”) can pack more logical qubits into fewer physical ones, which is why some company roadmaps, IBM’s among them, rely on them. The catch is that they need longer-range connections between qubits.
Below threshold: the number that matters
Section titled “Below threshold: the number that matters”Here is the race at the heart of it all. Adding qubits to a code adds protection, but it also adds more places for errors to happen. Which effect wins?
It depends on how good the qubits are. If physical errors are too common, a bigger code just has more things going wrong, and fails faster. If they are rare enough, the bigger code wins, and it keeps winning every time you grow it. It’s the repetition code’s 50% tipping point again, but for the surface code, with all its checks that can themselves fail, the line sits much lower: around 1% error per operation.
That crossover is the threshold. Below it, each step up in distance () divides the logical error rate by roughly the same factor, written Λ (lambda). Try it:
That is what “below threshold” means in a headline. It is the moment error correction starts paying for itself: from then on, more qubits means fewer errors, not more. Google showed this convincingly on its Willow chip in late 2024, where going from distance 3 to 5 to 7 roughly halved the logical error rate each time (). Since then the race has moved on to bigger , more logical qubits, and logical operations rather than just stored memory.
What still has to happen
Section titled “What still has to happen”Keeping one protected qubit alive is the first step, not the last. A useful fault-tolerant computer also needs:
- Logical gates that act on encoded qubits without spreading errors around. The hardest is a gate called the T gate, often supplied by preparing special “magic states” separately and feeding them in.
- Fast decoding. The decoder has to keep up with the hardware’s heartbeat. For superconducting qubits that means digesting a round of checks every microsecond or so, without falling behind.
- Scale. Estimates for the size of machine needed to break RSA-2048 encryption have fallen to under a million physical qubits. That is still far beyond today’s machines, which have from a few hundred to a few thousand.
Reading the news
Section titled “Reading the news”When the next error-correction announcement lands, these questions will tell you how big a deal it is:
- Is it below threshold, and is reported? Bigger is better.
- How many logical qubits, and at what distance?
- Is it a memory experiment (just keeping a qubit alive), or are logical gates being performed?
- Is decoding done in real time, or afterwards on a classical computer?
- Is it peer-reviewed, or a press release and a preprint?
Glossary
Section titled “Glossary”- Physical qubit: one actual piece of quantum hardware.
- Logical qubit: one protected qubit encoded across many physical qubits.
- Syndrome: the pattern of parity-check results that points to an error.
- Code distance (): the fewest physical errors that can cause a logical error.
- Threshold: the physical error rate below which bigger codes give fewer logical errors.
- Λ (lambda): how much the logical error rate drops each time the distance grows by two.
- Decoder: classical software that turns syndromes into corrections.
- Fault tolerance: computing reliably even though every component, including the checks themselves, can fail.
Where to go next
Section titled “Where to go next”- What is Quantum Computing?: qubits, gates and interference, and why noise is the main obstacle.
- The learning path: the rest of the road, from the maths to the algorithms.
- News: error-correction milestones as they happen.
Seeking Psi
Quantum physics and quantum computing, explained from the ground up.
© 2026 Seeking Psi · Educational content, not investment advice.