Go further · Chapter 8 · 8a · Real-world case

How does the surface code work?

The short answer (tap to open)

The surface code lays qubits on a chessboard-like grid. Data qubits hold the information; check qubits between them repeatedly ask whether their neighbours agree. An error lights up a pair of checks around it, and a fast ordinary computer matches the lit checks to find the likeliest error. A bigger grid survives more errors before it's fooled.

What's on the grid?

Picture a chessboard. Data qubits sit on the corners of the squares and hold one logical qubit between them. A check qubit sits in the middle of each square and asks its four corners a parity question, as in chapter 8's puzzle. Two kinds of check alternate across the board: one catches flips, the other catches the "wobble" errors of page 3b.

What does an error look like?

If one data qubit flips, the checks on either side of it change their answer: a pair of lights comes on. If a line of qubits flips, only the checks at the two ends of the line light up. The checks never reveal the stored information, only where something changed.

Who works out the fix?

An ordinary computer called the decoder reads the lights every round, a million times a second or so, and pairs them up by the shortest likely chains of errors. Then it records the correction. Doing this fast enough is a serious engineering job (chapter 8). IBM reported a real-time decoder for its own code in under half a millionth of a second in November 2025.

Hidden data qubits have flipped and some checks have lit up. Tap the data qubits along the shortest path between lit checks, or from a lit check to the nearest side, to put the lights out.

Lit checks: 1

A worked example, in words

A distance-3 board. One data qubit flips, and the two checks on either side of it light up. Tap that one qubit and the lights go out: fixed. Tap the qubits on the other side of each lit check instead, out to the edges of the board, and the lights also go out, but the error and the fix now run all the way across the board: a logical error.

What's "distance"?

The distance is the fewest errors that could slip through unnoticed by forming a chain across the board. A distance-3 code can always fix one error; distance 5, two; distance 7, three. In December 2024 Google's Willow grew its code from distance 3 to 5 to 7 and halved the logical error rate at each step (chapter 8).

Check

Two quick ones

Q1

What do the check qubits reveal?

Q2

Why use a bigger grid?

Collect

Your aha card

Lights in pairs, matched fast.

The surface code finds errors by where checks change, never by looking at the data.

Next optional page · 8b

How many logical qubits exist today?

Next optional page

Ask a question

We use your email only to send the answer. See the privacy notice.