Fault Tolerance
The [[4,2,2]] Error-Detecting Code: quick reference
Encodes two logical qubits in four physical ones and flags a bit-flip anywhere with a single parity check.
- Topic
- Fault Tolerance
- Level
- Advanced
- Circuit size
- 5 Qubits
- Key result
- The smallest code that detects any single-qubit error
Concepts covered: Error Detection, Stabilizer Codes, Code Parameters [[n,k,d]], Post-Selection
How the [[4,2,2]] Error-Detecting Code works, step by step
- Encode a Logical State. A Hadamard and three CNOTs entangle the four data qubits. Every part of the state has an even number of 1s.
- A Bit-Flip Error Occurs. Noise flips Q2. Now every part of the state has an odd number of 1s.
- Measure the Parity Check. Four CNOTs add up the parity of the data qubits on the flag qubit (Q4).
- Read the Flag. The flag reads 1. An error occurred, so this run is discarded.
Frequently asked questions
What is the [[4,2,2]] Error-Detecting Code?
Encodes two logical qubits in four physical ones and flags a bit-flip anywhere with a single parity check. It is a advanced-level topic in fault tolerance.
How many qubits does the [[4,2,2]] Detection Code circuit use?
The QuanBit tutorial uses a 5 qubits circuit. Key result: The smallest code that detects any single-qubit error.
Can I simulate [[4,2,2]] Detection Code online for free?
Yes. The interactive [[4,2,2]] Detection Code tutorial at https://www.quanbit.tech/learn/error-detection-422 runs free in the browser with nothing to install. You can step through the circuit gate by gate, watch the probabilities, statevector and Bloch spheres update, build the circuit yourself and take a short quiz.