Checkpoint: Detect an Error
This is a cumulative checkpoint for Module 14. You will assemble the complete three-qubit bit-flip detection circuit — encoding, error injection, and syndrome measurement — in a single exercise.
What you need to build
The three-qubit bit-flip code stores a logical qubit across three physical qubits . Logical encodes as ; logical encodes as . Two extra syndrome ancilla qubits, and , will hold the parity check results.
Step 1 — Encoding
With and , the encoding circuit is two CNOTs:
Because the data qubit starts in both ancillas remain . (Had the data been , the CNOTs would have spread it to .)
Step 2 — Injected error
An adversarial bit flip strikes , turning the data from to . The circuit stub already includes this line — do not remove it.
Step 3 — Syndrome measurement
Two parity checks identify the faulty qubit without revealing the logical value:
| Syndrome bit | Parity checked | Circuit | |---|---|---| | into | | CNOT , then CNOT | | into | | CNOT , then CNOT |
Each target qubit accumulates the XOR of its control qubits because each CNOT flips the target once iff the control is . After two CNOTs, target — the standard fanout trick for parity extraction.
With the injected error (, ):
Syndrome is the unique signature of a bit flip on . A flip on would give ; a flip on would give ; no error gives .
Expected final state
After the correct circuit the five-qubit statevector has a single non-zero amplitude: the computational-basis state
Data qubits hold (the corrupted codeword), syndrome qubits hold (flagging qubit 1 as the error site). The grader checks the full statevector.
Try it
Complete the three missing sections — encoding, syndrome for , and syndrome
for . The error injection on line c.x(1) is already in place.
Once your circuit passes, inspect the Statevector panel: only the basis state should carry amplitude, confirming that the syndrome bits correctly flag the injected error.
Sign in on the full site to ask questions and join the discussion.