You are reading without signing in. Sign in or continue as guest to take quizzes and climb the ranks.
Error correction in one lesson
The three-qubit repetition code, syndromes, and the road to a logical qubit.
- 01Encode one logical bit in three physical qubits and detect a bit flip without measuring the data.
- 02Explain what a syndrome is.
- 03Place 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; one helper qubit q3 reads both parities in turn (reset in between, so four qubits are enough); 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[4] 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];
c[1] = measure q[3];
reset q[3];
cx q[1], q[3];
cx q[2], q[3];
c[2] = measure q[3];
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.
2 questions · one try each counts
Why measure Z₀Z₁ instead of Z₀ and Z₁ separately?
Sign in to answer and climb the ranks; you will come back to this lesson.
What does the threshold theorem say?
Sign in to answer and climb the ranks; you will come back to this lesson.