# 2 ways to do the three qubits bit-flip code

I'm trying to understand the three qubits bit-flip code. I use the book of Phillip Kaye An introduction to quantum computing.

In this book he introduce the three qubits bit-flip code with this circuit : But, I saw in Quantum Error Correction for Beginners (here), that they introduce the three qubits bit-flip code with an another circuit: Therefore, I ask myself, why do we need two more ancilla qubits in the second algorithm ? What do we earn with that ?

Both circuits start by turning $$|\psi\rangle = a |0\rangle + b|1\rangle$$ into $$|\psi\rangle = a |000\rangle + b|111\rangle$$, copying the 0/1 information onto two additional qubits.

Note that, for any pair of qubits in this state, either both are in state $$|0\rangle$$, or both are in state $$|1\rangle$$. Any superposition must be expressed only in terms of states that satisfy this condition.

This gives us a way to check up on whether everything is okay. We make a measurement that checks whether the 0/1 states of two neighbouring qubits are the same or different. We want it to give us only this information and no more, to ensure that preserves superpositions.

Each ancilla in the second circuit is there to perform this exact measurement. The two cnots that act on the ancilla, as well as the measurement gate itself, are all part of the measurement. Th measurement outputs 0 when two qubits can be expressed as a superposition or mixture of $$|00\rangle$$ and $$|11\rangle$$. It outputs 1 if they must be expressed with $$|01\rangle$$ and $$|10\rangle$$.

Given this information, we can see if errors happened, and try to guess what they were. A corresponding correction operator can then be performed.

The first circuit seems like it could probably correct a bit flip on the first qubit. I'm not really sure what it is designed for, though.

• What do you mean by : "It is not a scalable approach to error correction, since it has no measurements to remove the entropy introduced by noise." ? – lufydad Jun 18 at 21:12
• Errors introduce entropy you don't want, and error correction needs to remove it. Usually we do this using measurement to find out what errors occurred. But that sentence was admittedly a bit vague, so I removed it. – James Wootton Jun 19 at 9:09

The second circuit doesn't have to perform a quantum CCNOT operation (which in practice decomposes into a dozen other operations) and doesn't have to leave the code space (allowing it to be applied iteratively).