The principle of the three-qubit Bit Flip Code is straight forward at first sight. Using CNOT you basically encode

$$a|0\rangle + b|1\rangle $$


$$ a|000\rangle + b|111\rangle$$

using entanglement. Now we assume that noise flips one of the qubits so that the state becomes

$$ a|100\rangle + b|011\rangle.$$

Since the three bits are entangled, I was wondering why the first bit can flip by noise without any impact on the other two bits (assuming a higher probability for one bit to flip than two or three). In the case of decoherence, I would assume that the first bit would not be entangled to the other two bits anymore due to noise.

  • $\begingroup$ you can include math in the post using mathjax. E.g. $a |0\rangle + b|1\rangle$ renders as $a \lvert 0\rangle+b \lvert 1\rangle$ $\endgroup$
    – glS
    Aug 3, 2020 at 12:09

3 Answers 3


We're trying to build a code to protect against single bit flips. That is, we are assuming the noise model. By assumption, it has the form $\sigma_x \otimes \mathbb{I} \otimes \mathbb{I}$, therefore, it only flips one of them. Of course, in general, the noise does whatever it wants, and therefore, we need to build codes that can protect against more general kinds of noise -- which we know how to (for example ones that protect against phase flips, combining which with bit flip code, we can protect against any single-qubit noise).

Once the noise model is assumed, its action on a single qubit is simply from the linearity and the tensor-product structure of the noise.


I would like to add to keisuke.akira answer.

The Noise Model in which only a Single Qubit Flips is correct. However we can assume a more general Noise Model which may be more realistic and still see the use of Bit Flip Code.

Since Quantum Circuits are analog, hence it is rare that a qubit flips completely. It is more likely that there is a small coherent rotation due to noise. This error is modeled as $E=e^{i\epsilon\sigma_x}$ (a small coherent rotation) where $\sigma_x$ is the Pauli-X matrix i.e $\begin{bmatrix}0 & 1 \\ 1& 0\end{bmatrix}$.

Here $\epsilon$ is small and represents the tiny probability of an error.

Thus $E=e^{i\epsilon\sigma_x} = \sin{(\epsilon)}\sigma_x + \cos{(\epsilon)}\sigma_I$

Now if this error was applicable on single qubit in state $|0\rangle$ (It works exactly same in case of $|1\rangle$). It would become

$$E|0\rangle = (i\sin{(\epsilon)}\sigma_x + \cos{(\epsilon)}\sigma_I)|0\rangle \\ = \cos{(\epsilon)}\sigma_I|0\rangle + i\sin{(\epsilon)}\sigma_x|0\rangle \\ = i\sin{(\epsilon)}|1\rangle + \cos{(\epsilon)}|0\rangle $$

Measuring this qubit would result in $|1\rangle$ with $P(1)=\sin^2(\epsilon) = O(\epsilon^2)$. Thus probability of error is $O(\epsilon^2)$

It is correct that the BitFlip Code protects against any single Bit Flip Error. However, by encoding one logical qubit in 3 qubits even in a general case where more than one BitFlip Error can take place. We decrease the error probability by an order of magnitude to $O(\epsilon^4)$.


In Bit Flip Code $|0\rangle_L = |000\rangle$ and $|1\rangle_L = |111\rangle$ Now when $U=E^{\otimes 3}$ is applied to $|000\rangle$,

$$U|000\rangle = E^{\otimes 3}|000\rangle \\ = (i\sin{(\epsilon)}\sigma_x + \cos{(\epsilon)}\sigma_I)^{\otimes 3}|000\rangle \\ = (-i\sin^3{(\epsilon)}\sigma_x\sigma_x\sigma_x - \\ \sin^2{(\epsilon)}\cos{(\epsilon)}\sigma_x\sigma_x\sigma_I - \sin{(\epsilon)}\cos{(\epsilon)}\sin{(\epsilon)}\sigma_x\sigma_I\sigma_x - \cos{(\epsilon)}\sin^2{(\epsilon)}\sigma_I\sigma_x\sigma_x - \\ i\sin{(\epsilon)}\cos^2{(\epsilon)}\sigma_x\sigma_I\sigma_I + i\cos{(\epsilon)}\sin{(\epsilon)}\cos{(\epsilon)}\sigma_I\sigma_x\sigma_I + i\cos^2{(\epsilon)}\sin{(\epsilon)}\sigma_I\sigma_I\sigma_x + \\ \cos^3{(\epsilon)}\sigma_I\sigma_I\sigma_I)|000\rangle \\ = (-i\sin^3{(\epsilon)}|111\rangle - \\ \sin^2{(\epsilon)}\cos{(\epsilon)}(|110\rangle + |101\rangle + |011\rangle) + \\ i\cos^2{(\epsilon)}\sin{(\epsilon)}(|100\rangle + |001\rangle + |010\rangle) + \\ \cos^3{(\epsilon)}|000\rangle) $$

While Decoding the Bit Flip Code Essentially find the majority of the 3 qubit states. In this case the majority is state $|1\rangle$ when after $U$ the state are $\{|110\rangle,|101\rangle,|011\rangle,|111\rangle\}$.

Thus probability of final measurement yielding us $1$ is $$P(1) = (\sin^3(\epsilon))^2 + 3(\sin^2(\epsilon)\cos(\epsilon))^2 \\ = \sin^6(\epsilon) + 3\sin^4(\epsilon)\cos^2(\epsilon) = O(\epsilon^4)$$

In this manner Bit Flip Error Correcting Code has reduced the error probability from $O(\epsilon^2)$ to $O(\epsilon^4)$.


You are analysing the case where you know a unitary has definitely been applied on the first qubit. In that case, it should not be surprising that there's no change in entanglement. You can take a couple of perspectives:

  • single qubit unitaries do not change entanglement. To change entanglement with a unitary requires a two-qubit unitary.
  • If you know what error has occurred, you can undo it with no problem.

The real trick with error correcting codes is that they still work even if you don't know that the error has occurred. For example, if you have a probability $p$ that the error occured, you should really be describing your state as $$ \rho=(1-p)|\psi\rangle\langle\psi|+(1-p)X_1|\psi\rangle\langle\psi|X_1, $$ where $|\psi\rangle$ was your original (encoded) state. Here, the entanglement will most definitely vary with $p$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.