Q-Learn

What is quantum error correction?

Updated · Part of Learn quantum computing: the beginner’s guide

The short answer

Quantum error correction protects quantum information from noise by spreading one reliable "logical" qubit across many physical qubits. Repeated checks, called syndrome measurements, reveal which error has happened without measuring, and so destroying, the information itself. It is the main route to quantum computers big and reliable enough to run algorithms like Shor's.

Learn this step by step in the Future of Quantum Computing course, in the free Q-Learn app. Get it on Google PlayGet Q-Learn

Why qubits need it

Ordinary transistors almost never make mistakes. Qubits do. On today's best hardware, a two-qubit gate fails somewhere around once in a few hundred to once in a few thousand operations. That sounds small, but useful algorithms such as Shor's need billions of operations in a row. Without a way to catch and fix errors, the answer would be lost in noise long before the end.

Errors come from heat, stray electromagnetic fields, imperfect control pulses, and the slow leaking of quantum information into the environment, known as decoherence.

Why it is harder than classical error correction

The classical solution is simple: keep three copies of each bit and take a majority vote. Quantum information cannot be handled that way, for three reasons:

  • You cannot copy a qubit. The no-cloning theorem says an unknown quantum state cannot be duplicated.
  • Looking destroys it. Measuring a qubit to check it collapses its superposition.
  • There are more kinds of error. As well as bit flips (0 becoming 1), qubits suffer phase flips, which change the sign between |0⟩ and |1⟩, and errors can be any small mixture of the two.

The basic idea: the three-qubit code

Here is the simplest example. To protect a qubit α|0⟩ + β|1⟩ against bit flips, encode it across three qubits as α|000⟩ + β|111⟩. That is not three copies: it is one entangled state spread over three qubits.

Now, instead of measuring the qubits themselves, measure two parity checks: "do qubits 1 and 2 agree?" and "do qubits 2 and 3 agree?". These questions have the same answer whatever α and β are, so asking them reveals nothing about the stored information. But if one qubit has flipped, the pattern of answers, called the syndrome, tells you exactly which one, and you can flip it back.

This code only handles bit flips. In 1995 Peter Shor found a nine-qubit code that corrects any error on a single qubit, proving that quantum error correction was possible at all.

Surface codes

The most studied approach today is the surface code. Physical qubits are laid out on a two-dimensional grid. Some hold the data, and others sit between them, repeatedly measuring parity checks with their neighbours. A classical computer reads the stream of syndromes and works out the most likely errors in real time.

Surface codes are popular because they only need each qubit to talk to its nearest neighbours, and they tolerate relatively high error rates. The key number is the threshold: if physical errors are below roughly 1%, making the code bigger makes the logical qubit more reliable, and the improvement is exponential in the size of the code.

Where things stand

For years, adding qubits to an error-correcting code made things worse, because each extra qubit added more noise than the code removed. In December 2024, Google reported that its Willow chip had crossed the threshold: as its surface code grew from a 3×3 to a 5×5 to a 7×7 grid of data qubits, the logical error rate roughly halved at each step. Other groups using trapped ions and neutral atoms have also demonstrated logical qubits that outperform their physical ones.

The cost: overhead

Error correction is expensive. Depending on the hardware and the code, one good logical qubit can need hundreds or even thousands of physical qubits. That is why estimates for breaking RSA talk about hundreds of thousands to millions of physical qubits, while the algorithm itself needs only a few thousand logical ones. Newer codes, such as the quantum LDPC codes IBM is pursuing, aim to cut that overhead sharply.

Fault tolerance

The end goal is a fault-tolerant quantum computer: one where every operation, including the error correction itself, is designed so that errors cannot spread out of control. Reaching it is what separates today's experimental machines from ones that can run long, useful algorithms. When will quantum computers be useful? looks at the timeline.