# Can someone please explain how the syndrome bit still ends up being 0 in this quantum error correction circuit using repetition code?

I'm not too great at dealing with superpositions and applying the CNOT gate when superpositions are involved. Can you go through it in detail each gate using math/matrices etc. It's based on the quantum error correction (using repetition codes) part of the Qiskit textbook.

Link to the specific page in the textbook: https://qiskit.org/textbook/ch-quantum-hardware/error-correction-repetition-code.html

• If you are talking about the 0 to the right of the downwards error of the measurement operator, that’s the index of the classical bit in which the measurement is stored, not the measurement result Oct 1 at 5:32
• @epelaaez, you are correct about that. However, it is also true that the measurement result for this circuit will indeed always be 0. Oct 1 at 5:39
• Yes, it will be 0, can you explain how though using each gate step by step? Oct 1 at 7:29

You have the initial state $$|000\rangle$$. The first Hadamard gate on qubit zero sends the register to $$\frac{1}{\sqrt{2}}\left(|000\rangle + |100\rangle\right)$$. Then, the $$\text{CX}$$ controlled on qubit zero and target on qubit one takes the state to $$\frac{1}{\sqrt{2}}\left(|000\rangle + |110\rangle\right)$$. And the next $$\text{CX}$$ between qubit zero and qubit two takes it to $$\frac{1}{\sqrt{2}}\left(|000\rangle + |111\rangle\right)$$. At this point we have a maximally entangled $$\text{GHZ}$$ state, but we are still missing a final $$\text{CX}$$ gate. This is between qubit one and two, with qubit one being the control. Thus, the final state is $$\frac{1}{\sqrt{2}}\left(|000\rangle + |110\rangle\right)$$. Therefore, as you can see, qubit three will always be projected into $$|0\rangle$$ when measured in the $$Z$$ basis.