# Usage example of stabilizer codes QEC

This question directly follows the previous one about $X$ stabilizers and phase-flip errors:

Practical example of stabilizer codes

Let's now consider a second part of the quantum circuit that is able to detect and correct bit-flip errors:

Just a recall of the Steane code and its stabilizers used in this example: $$\left|0\right\rangle_L \equiv \frac{1}{\sqrt{8}}(\left|0000000\right\rangle + \left|1010101\right\rangle + \left|0110011\right\rangle + \left|1100110\right\rangle + \left|0001111\right\rangle + \left|1011010\right\rangle + \left|0111100\right\rangle + \left|1101001\right\rangle)$$ $$\left|1\right\rangle_L \equiv \frac{1}{\sqrt{8}}(\left|1111111\right\rangle + \left|0101010\right\rangle + \left|1001100\right\rangle + \left|0011001\right\rangle + \left|1110000\right\rangle + \left|0100101\right\rangle + \left|1000011\right\rangle + \left|0010110\right\rangle)$$ $$K^1 = IIIXXXX$$ $$K^2 = XIXIXIX$$ $$K^3 = IXXIIXX$$ $$K^4 = IIIZZZZ$$ $$K^5 = ZIZIZIZ$$ $$K^6 = IZZIIZZ$$

The state of both parts, individually considered, is:

$$\left|\psi\right\rangle_F={1\over 2}(\left|\psi\right\rangle_I+U\left|\psi\right\rangle_I)\left|0\right\rangle + {1\over 2}(\left|\psi\right\rangle_I-U\left|\psi\right\rangle_I)\left|1\right\rangle\;\;\;\;(1)$$

where $U \in \left\lbrace K^1,K^2,K^3\right\rbrace$ for the first part and $U \in \left\lbrace K^4,K^5,K^6\right\rbrace$ for the second part.

Determined how does the first part of the circuit work, the second part uses $K^4, K^5, K^6$ generators to check whether the input has a bit-flip error or not. $K^4, K^5, K^6$ act checking the parity of the input; if the parity checking operation gives back an odd result, then one qubit flipped. Through syndrome measurement we are able to detect where the error occurred and correct it by triggering the right $X_i$ gate. Is this how detection and correction work for this part of the circuit?

Further trouble: considering the syndrome measurement about $(1)$, how does it come? Since, in this case, ancilla qubits are used as control qubit for $K^i$ generators and not vice versa, then is it thanks to the superposition nature of the system that, if we measure $\left|1\right\rangle$ from the syndrome, we project the input to the state $\left|\psi\right\rangle_F = \left|\psi\right\rangle_I - U\;\left|\psi\right\rangle_I$, so the error occurrence?

Thank you

-
This might be a good opportunity to encourage posters to spell out abbreviations (at least once). Abbreviations may not be obvious to readers with a different background. – Qmechanic Nov 1 '13 at 11:18
The right part of the circuit works like the left part, right part it corrects $X_i$ errors, while the left part corrects $Z_i$ errors, but it is the same logic, and you describe it correctly. I don't understand clearly the second part of your question, but the syndrome measurement step does not change the state of the 7-codeworld, see previous answer, step $4$ – Trimok Nov 1 '13 at 12:04