Error-Correction Lab
Encode a logical qubit across 3 physical qubits. Introduce errors. Use syndrome measurements to find which qubit broke β without looking at the logical value. Then discover how the Shor 9-qubit code handles both error types.
The problem
Can't copy qubits. Measuring collapses them. How do you check for errors without destroying the quantum computation?
3-qubit encoding
Encode |Οβ© as |000β© or |111β© using CNOT gates. Any single bit-flip error takes |000β© β |001β©, |010β©, or |100β©.
Syndrome measurement
Measure ancilla pairs (q0βq1) and (q1βq2). Results reveal error location without revealing the logical value. Elegant!
Shor 9-qubit code
Corrects both bit-flip AND phase-flip errors using 9 physical qubits. Three groups of three, with outer phase protection.
Step 1 β Why Classical Error Correction Fails for Quantum
2. Error flips one bit β 001
3. Measure all three bits
4. Majority vote: 0,0,1 β 0
5. β Corrected!
2. Can't copy! No |Οβ©|Οβ©|Οβ©
3. Can't measure! Collapses |Οβ©
4. Can't take majority vote
5. β Seems impossible!
Step 2 β Encode & Introduce Error
Step 3 β Syndrome Measurement & Correction
(q0βq1)
(q1βq2)
| Syndrome (a1,a2) | Meaning | Error on | Correction |
|---|---|---|---|
| 0, 0 | All agree | None | I (do nothing) |
| 0, 1 | q1β q2 | q2 | X on q2 |
| 1, 0 | q0β q1 | q0 | X on q0 |
| 1, 1 | q0β q1 and q1β q2 | q1 | X on q1 |
Step 4 β Shor 9-Qubit Code
Error Correction Challenge β Find & Fix!
π§ What you learned in Session 5
- Qubit Zoo (Q13): Superconducting, trapped ion, photonic, and topological qubits each trade off gate speed, coherence time, fidelity, and scalability. No single technology dominates.
- Decoherence (Q14): T1 relaxation and T2 dephasing destroy quantum states. Temperature suppresses noise by e^(-βΟ/kT). The ratio T2/gate_time limits circuit depth.
- 3-qubit bit-flip code: Encode |Οβ© as |000β© or |111β© using CNOT entanglement (not copying). Syndrome measurement detects errors without collapsing the logical qubit.
- Syndrome measurement: Measuring ancilla pairs (q0βq1) and (q1βq2) reveals which qubit errored β a 2-bit code mapping to 4 possible error patterns. Elegant and non-destructive.
- Shor 9-qubit code: The first complete quantum error correcting code. Three bit-flip groups + phase-flip outer structure = correction of any single-qubit error.
Error Correction Master! Session 5 Complete!
You understand the most elegant trick in quantum computing β syndrome measurement!
Optional. Stays on this device only β not sent to WhizzStep.
Key Concepts from Q15
π‘οΈ Check without looking
Syndrome measurement reveals which qubit is broken without collapsing the logical quantum state. It answers: "Is qubit A the same as qubit B?" without asking "What value do A and B have?"
π Physical vs logical
3-qubit code: 3Γ overhead. Shor code: 9Γ. Surface code: ~1,000Γ. Reducing this overhead is the central engineering challenge of fault-tolerant quantum computing.
π The magic threshold
If physical error rate < threshold (~1% for surface code), adding more error correction qubits exponentially suppresses logical errors. Below threshold = fault tolerant computation is possible.
π Hardware complete
You now understand the full hardware stack: qubit physics (Q13), decoherence (Q14), and error correction (Q15). Sessions 6-8 cover applications: chemistry, optimisation, cryptography, and the quantum future.
About this lab
Learning objective: Explore the difference between physical and logical qubits and why error correction matters for fault-tolerant systems.
What this simplifies: This is a local browser simulation, not access to real quantum hardware.
Privacy: No learner input leaves the device.
Teacher prompt: Ask the class why this simulation might mislead someone who takes it too literally.
Reflect: What is one thing this activity showed you that you did not expect?
β Back to all Labs