Shor's Nine-Qubit Code and Beyond
Shor's nine-qubit code was the first code to protect a qubit against any single-qubit error. It wraps the three-qubit phase-flip code around three copies of the three-qubit bit-flip code. It works because of one key fact. Once the parity checks act, every possible single-qubit error — even a tiny partial turn — behaves like one of just four cases. The four cases are: no error, a bit flip (X), a phase flip (Z), or both (XZ).
Why isn't one three-qubit code enough?
In this course you have built two codes.
- The three-qubit bit-flip code catches bit flips. These are errors that act like an unwanted
Xgate, swapping |0⟩ and |1⟩. - The three-qubit phase-flip code catches phase flips. These are errors that act like an unwanted
Zgate. They flip the sign between the |0⟩ and |1⟩ parts of a superposition (a state that is a weighted mix of |0⟩ and |1⟩).
Each code is blind to the other error type. A Z passes straight through the bit-flip code. An X passes straight through the phase-flip code.
Real hardware makes both kinds at once. Energy loss and dephasing — the T1 and T2 processes from why qubits fail — do not politely stick to one type. So a useful code must handle any single-qubit error. That means any unwanted change to one qubit, including partial turns that are neither a full X nor a full Z.
Think of a house with a smoke alarm but no burglar alarm. It is safe from one danger and wide open to the other. You want both. In 1995 Peter Shor published the first code that handles both. It uses nine physical qubits to protect one. Its trick is to put one code inside another. This is called concatenation. Here the house picture breaks: two alarms just sit side by side, but Shor's two codes are nested, one inside the other. Before we get to the nine qubits, we have to answer the objection every engineer raises first.
- How can a discrete code fix a continuous error?
- How does a partial turn become a clean either/or?INTERACTIVE
- What if the partial error becomes a full flip?INTERACTIVE
- How does the nine-qubit code nest the two three-qubit codes?
- What do the numbers say about the protection?
- What came after nine qubits?
- Has anyone run these codes on real hardware?
You’ve read the opening of chapter 6. Pro unlocks the other 7 sections — plus every chapter of every course, with circuits you can run right on the page. That’s $11.99 a month, about the price of a coffee, or $99.99 a year (save 30%). The first chapter of every course, and the whole math course, stay free.