Skip to content
Seeking Psi

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.

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.

Ordinary engineers solved their version of this problem long ago. Want to send a bit over a crackly line? Send it three times:

0  →  000,1  →  1110 \;\to\; 000, \qquad 1 \;\to\; 111

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 pp, the vote fails with probability about 3p23p^2. For p=1%p = 1\% that is 0.03%0.03\%, 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 pp is small to begin with. That last condition matters more than it looks. Try it:

10%
Copies:

Try it: with three copies and a 10% flip chance, the vote is wrong only about 3% of the time. Five and seven copies do better still. Now push the flip chance past 50%: suddenly more copies make things worse, because the majority is usually wrong. Every error-correcting code has a tipping point like this, called its threshold.

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.

So just copy the qubit three times and vote? Three things get in the way, and for years they looked fatal.

  1. You can’t copy a qubit. It’s a theorem, called the no-cloning theorem: there is no machine that takes an unknown state ∣ψ⟩|\psi\rangle and produces two copies of it. Quantum information can be moved, but not duplicated.
  2. 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.
  3. 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:

α∣0⟩+β∣1⟩  ⟶  α∣000⟩+β∣111⟩\alpha|0\rangle + \beta|1\rangle \;\longrightarrow\; \alpha|000\rangle + \beta|111\rangle

Look carefully: this is not three copies of the original qubit. It is a single entangled state of three qubits. The amplitudes α\alpha and β\beta 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 ∣000⟩|000\rangle and ∣111⟩|111\rangle answer “yes, same” to both questions. So the answers tell you nothing about α\alpha or β\beta, 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 α\alpha and β\beta 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.

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, dd: the smallest number of physical errors that can fool it into a wrong answer without being noticed. The three-qubit code has d=3d = 3 against bit flips: it takes three flips (turning 000000 into 111111) 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 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.

Error type:

Try it: click a qubit (the circles; or Tab to one and press Enter) to give it a bit flip. The two check tiles beside it light up: that's the syndrome. Click its neighbour too and watch the lit checks move to the ends of the chain; the checks only ever see where a chain of errors ends. Now flip a whole column from top to bottom: nothing lights up at all, yet the stored information has been flipped. That's a logical error, and the smallest chain that can do it has length 5, the code distance.

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 dd, 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-dd surface code uses about 2d22d^2 physical qubits, so roughly 100 for d=7d = 7 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.

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 (d→d+2d \to d+2) divides the logical error rate by roughly the same factor, written Λ (lambda). Try it:

Simplified model: logical error per round ≈ 0.1 × (p / 1%)(d+1)/2. Real hardware has extra error sources, but the shape is the same: below threshold every step up in distance divides errors by the same factor, Λ.

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 (Λ≈2\Lambda \approx 2). Since then the race has moved on to bigger Λ\Lambda, more logical qubits, and logical operations rather than just stored memory.

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.

When the next error-correction announcement lands, these questions will tell you how big a deal it is:

  1. Is it below threshold, and is Λ\Lambda reported? Bigger is better.
  2. How many logical qubits, and at what distance?
  3. Is it a memory experiment (just keeping a qubit alive), or are logical gates being performed?
  4. Is decoding done in real time, or afterwards on a classical computer?
  5. Is it peer-reviewed, or a press release and a preprint?
  • 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 (dd): 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.

Seeking Psi

Quantum physics and quantum computing, explained from the ground up.

© 2026 Seeking Psi · Educational content, not investment advice.