You are reading without signing in. Sign in or continue as guest to take quizzes and keep XP.
Error correction in one lesson
The three-qubit repetition code, syndromes, and the road to a logical qubit.
- Encode one logical bit in three physical qubits and detect a bit flip without measuring the data.
- Explain what a syndrome is.
- Place the surface code and the threshold in context.
You cannot copy a qubit, and you cannot look at it without collapsing it. Error correction gets around both: spread the information over several qubits (entangle, do not copy) and measure only parities, which reveal where an error happened but nothing about the encoded value.
Detect and correct a flip with feed-forward
q0 is the data, encoded into q0 q1 q2; an X on q1 simulates an error; q3 and q4 read the two parities; if-blocks apply the correction; the final measurement decodes. Simulate: the logical bit c[0] reads 1 every time despite the error. Move the X to q2 and watch the syndrome change.
OPENQASM 3.0;
include "stdgates.inc";
qubit[5] q;
bit[3] c;
x q[0];
cx q[0], q[1];
cx q[0], q[2];
barrier q;
x q[1];
barrier q;
cx q[0], q[3];
cx q[1], q[3];
cx q[1], q[4];
cx q[2], q[4];
c[1] = measure q[3];
c[2] = measure q[4];
if (c[1] && !c[2]) {
x q[0];
}
if (c[1] && c[2]) {
x q[1];
}
if (!c[1] && c[2]) {
x q[2];
}
cx q[0], q[1];
cx q[0], q[2];
c[0] = measure q[0];
The repetition code only fixes bit flips. Real codes such as the surface code protect against phase flips too, use hundreds of physical qubits per logical qubit, and work only if physical error rates are below a threshold near 1%. Today's best devices sit just below it, which is why the first logical qubits with lower error than their parts appeared only in 2023–2024.
Why measure Z₀Z₁ instead of Z₀ and Z₁ separately?
Sign in to answer and earn XP; you will come back to this lesson.
What does the threshold theorem say?
Sign in to answer and earn XP; you will come back to this lesson.
Error correction spreads one logical qubit over many physical ones and reads only parities. Below the threshold, bigger codes mean fewer logical errors; that regime is where the field is arriving now.
Up next: Circuit cutting · Cutting and Quantum ML