Three-qubit bit-flip syndrome table (source code)

= Three-qubit bit-flip syndrome table
{title2=$(g_1,g_2)=(Z_1Z_2,Z_2Z_3)$}

Measure the commuting <stabilizer generators> $g_1=Z_1Z_2$ and $g_2=Z_2Z_3$ in that order. Use <error syndrome> bit $0$ for <eigenvalue> $+1$ and bit $1$ for <eigenvalue> $-1$. For $X_j$ the <Pauli X gate> on physical <qubit> $j$, every row holds for arbitrary normalized $\alpha,\beta$. This ordered parity-check convention follows https://www.preskill.caltech.edu/ph229/notes/chap7.pdf[Preskill, §7.1]{ref}:

|| Error
|| State before recovery
|| $(g_1,g_2)$ <eigenvalues>
|| <Error syndrome>
|| Recovery

| $I$
| $\alpha|000\rangle+\beta|111\rangle$
| $(+1,+1)$
| $00$
| $I$

| $X_1$
| $\alpha|100\rangle+\beta|011\rangle$
| $(-1,+1)$
| $10$
| $X_1$

| $X_2$
| $\alpha|010\rangle+\beta|101\rangle$
| $(-1,-1)$
| $11$
| $X_2$

| $X_3$
| $\alpha|001\rangle+\beta|110\rangle$
| $(+1,-1)$
| $01$
| $X_3$

Each pair of <computational basis> words within a row has the same two parities. Consequently the <projective measurement> reveals the row without distinguishing its two amplitudes. For example, $|\psi_L\rangle=(\sqrt3/2)|000\rangle+(i/2)|111\rangle$ becomes $(\sqrt3/2)|010\rangle+(i/2)|101\rangle$ under $X_2$. Both checks give $-1$ with <probability> one, and applying $X_2$ restores both coefficients exactly, including the relative phase $i$.

One implementation uses two <quantum ancillas> initialized to $|00\rangle$. Two <controlled-NOT gates> from data <qubits> 1 and 2 to the first <quantum ancilla> write their parity; two more from data <qubits> 2 and 3 to the second <quantum ancilla> write the other parity. Measuring only the <quantum ancillas> in the <computational basis> gives $(s_1,s_2)$. Measuring the individual data <qubits> instead would reveal the encoded <computational basis> value and destroy the unknown <quantum superposition>. The existing <coherent syndrome extraction for the three-qubit repetition code> uses the alternative ordered checks $(Z_2Z_3,Z_1Z_3)$, so its bit labels differ from this table.

\Image[/quantum-bit-flip-syndromes.png]
{title=Parity checks identify a bit flip without reading the logical amplitudes}

The recovery also handles coherent errors. Put $E_0=I,E_1=X_1,E_2=X_2,E_3=X_3$. Their images of the code are mutually <orthogonal>, giving $PE_a^\dagger E_bP=\delta_{ab}P$, the <Knill--Laflamme condition> for this family. For any <linear combination> $E=\sum_{a=0}^3c_aE_a$, its component in sector $s(E_a)$ is $c_aE_a|\psi_L\rangle$. Measuring that <error syndrome> has <probability> $|c_a|^2/\sum_b|c_b|^2$ on the normalized erroneous state, and recovery $E_a$ returns $|\psi_L\rangle$. More generally one recovery <quantum channel> corrects every noise <quantum channel> whose <Kraus operators> belong to this span. The assumption concerns the whole jointly correctable family; it does not extend to the span of arbitrary single-site <Pauli errors>. https://www.preskill.caltech.edu/ph229/notes/chap7.pdf[Preskill, §7.2: correction of an error span]{ref}.

A fully computed coherent example is the <unitary operator> $U=\exp(-i\theta X_2)=\cos\theta\,I-i\sin\theta\,X_2$. At $\theta=\pi/6$ it gives
$$
U|\psi_L\rangle=\frac{\sqrt3}{2}|\psi_L\rangle-\frac{i}{2}X_2|\psi_L\rangle.
$$
The <error syndromes> $00$ and $11$ occur with <probabilities> $3/4$ and $1/4$, independently of $\alpha,\beta$. Doing nothing for $00$ and applying $X_2$ for $11$ restores the same <logical qubit> in both branches; the scalar $-i$ in the second branch is an irrelevant <global phase>. This is an example of <linearity of coherent quantum error correction>, rather than an assumption that the original error was a classical random bit flip.