# Stabilizer code: error detection why does it matter?

State vectors take more space when we have to specify certain states. In stabilizer formalism, we can specify these states in a much more compact way.

But in error correction then we say that the error of a particular code can be measured by measuring the generators.

How does it help? What does it give us extra in terms of error detection? (Finding these generators is difficult as well).

• So is the question "Why does the stabilizer formalism help in terms of error correction?"
– glS
Feb 5 at 17:01
• @glS Sorry I didnt see your reply. Yes that's the question Feb 6 at 16:10

Suppose you have a logical qubit encoded using a stabilizer code with generators $$g_1, g_2, \dots, g_k$$. If you measure all the generators and each of the measurements yields $$+1$$ then you know that the state of your logical qubit belongs to the code subspace. On the other hand, if one or more of then measurements of the generators returns $$-1$$ then you know that the state is outside the code subspace and you can conclude that an error occurred. In other words, we achieved the most basic function of an error correcting code: we detected an error. In fact, we can often conclude more: by looking at exactly which generators returned $$-1$$ we can sometimes identify and locate the error.
Consider for example the 3-qubit bit-flip code with stabilizer generators $$IZZ, ZZI$$ and suppose that the measurement of $$IZZ$$ returned $$+1$$ and the measurement of $$ZZI$$ returned $$-1$$. Assuming (as is more likely) that only a single bit-flip occurred, we see that the only possibility compatible with the measurements is $$XII$$.
• First, since this is a bit-flip code, it only detects errors that consist of $I$ and $X$. Second, two or more $X$s are not corrected and I ruled them out by assumption. This leaves $XII$, $IXI$ and $IIX$. However, the latter two make the sign of $IZZ$ negative (because $X$ would be applied to a qubit on which we measure $Z$ and these operators anticommute). Finally, we note that $XII$ is also compatible with measurement of $ZZI$ resulting in $-1$ (reasoning as before). Feb 6 at 16:15