Correcting a Bit Flip
Once syndrome measurement has told us which qubit flipped, the correction step is straightforward: apply the gate that undoes the error. For a bit-flip code this means applying a Pauli to the identified qubit, because .
Recap: the three-qubit bit-flip code
The three-qubit bit-flip code protects one logical qubit by spreading it across three physical qubits:
A general logical state lives in the two-dimensional code space spanned by and .
If qubit suffers a bit flip, the error moves the code space into an error space:
| Error | Logical 0 state | Logical 1 state | |-------|-----------------|-----------------| | none | | | | | | | | | | | | | | |
The four error spaces are mutually orthogonal, so they can be distinguished without any information about or .
The syndrome and what it means
Syndrome measurement computes two parity bits using ancilla qubits and CNOT gates, without ever measuring the data qubits directly:
The two bits together identify the error:
| | | Syndrome | Indicated error | |--------|--------|----------|-----------------| | 0 | 0 | 00 | No error | | 1 | 1 | 11 | (qubit 1 flipped) | | 1 | 0 | 10 | (qubit 0 flipped) | | 0 | 1 | 01 | (qubit 2 flipped) |
Applying the correction
Given syndrome , we know qubit 1 flipped. The correction is simply
because . More generally the correction table is:
| Syndrome | Gate to apply | |----------|---------------| | 00 | None () | | 11 | on qubit 1 | | 10 | on qubit 0 | | 01 | on qubit 2 |
After correction the register is back in the code space, with the logical information intact.
Try it
The starter code injects an error on qubit 1, placing the register in . The syndrome would read . Apply the correction gate to restore the state to .
After pressing Check you should see the statevector collapse back to the all-zero state , confirming that the logical information has been recovered.
Sign in on the full site to ask questions and join the discussion.