# Error syndrome on logical operators

The stabilizers and logical operators (for five qubit-codes) are given by

$$\hat{S}_1= \hat{X}_1\hat{Z}_2\hat{Z}_3\hat{X}_4 \\ \hat{S}_2= \hat{X}_2\hat{Z}_3\hat{Z}_4\hat{X}_5 \\ \hat{S}_3= \hat{X}_1\hat{X}_3\hat{Z}_4\hat{X}_5 \\ \hat{S}_4= \hat{Z}_1\hat{X}_2\hat{X}_4\hat{Z}_5 \\ \hat{X}_L= \hat{X}_1\hat{X}_2\hat{X}_3\hat{X}_4\hat{X}_5 \\ \hat{Z}_L= \hat{Z}_1\hat{Z}_2\hat{Z}_3\hat{Z}_4\hat{Z}_5$$

How to find the error syndromes for single qubit $$\hat{X},\hat{Y},\hat{Z}$$ errors on qubit 3.

• Also, is this homework? You have been asking a couple of questions related to stabilizer codes recently that could very well be homework. Please note that, while homework questions are not prohibited, it is generally favoured to show your own work, and show where (and if possibly why) you got stuck, instead of rather just posing the homework question without any context.
– JSdJ
Apr 6 at 8:43

TL/DR: The error syndrome of the errors are: $$$$\begin{split} X_{3} &= 1100, \\ Z_{3} &= 0010, \\ Y_{3} &= 1110, \\ \end{split}$$$$ because of the commutation relations with the generators, where the error syndrome bit is $$1$$ if it anti-commutes, and $$0$$ if it commutes with the generator in question. There are four generators, so there are four error syndrome bits.

As @AdamZalcman already explained in his answer to your previous question on Shor's code, what we care about in quantum error correction is the commutation relations of our error with a set of generators for the stabilizer. By only measuring these stabilizers, we can check for errors and correct them, while not affecting the code space itself - a wonderful feat that makes it possible to perform quantum computation with real-life machines - or at least, that is the hope. I won't go into much detail here, because the linked answer already gives an explanation, and there are many texts to be found online that explain it much better than I can.

Now, to the actual computations. They are relatively easy, after some considerations. Paulis either commute or anti-commute, which means that our error syndrome bits will be unambiguous. We have four generators $$S_{i}$$, so we will have four error syndrome bits $$e_{i}$$; these bits encode the information of the commutation relation of a generator $$S_{i}$$ with the error $$E$$. We assume that the error $$E$$ is a Pauli operator. Then, we set $$\begin{split} e_{i} &= 0\,\,\, \mathrm{ iff }\,\,\, [E, S_{i}] = ES_{i} - S_{i}E = 0 \\ e_{i} &= 1\,\,\, \mathrm{ iff }\,\,\, \{E, S_{i}\} = ES_{i} + S_{i}E = 0 \\ \end{split}$$ and, since $$E$$ and $$S_{i}$$ are Paulis, these are the only two options.

A note of warning: sometimes people don't use $$0$$ and $$1$$ as I did, but they use $$+1$$ and $$-1$$. To me, both are fine, but I find the $$0$$ and $$1$$ slightly more intuitive, as I interpret it as the generator begin 'turned to its on/excited state' by the error if its a $$1$$ - its as if the generator tells us with a $$0$$ that everything is fine, and it 'raises a flag' (i.e. the $$1$$) when it finds that something is out of the order. But, maybe the $$+1$$, $$-1$$ reasoning is more useful to you - use per your own discretion.

Every generator and every error operator that we have here is a $$5$$-qubit operator, which can be represented by a $$32 \times 32$$ matrix - we could write out all matrices involved, and compute the error bits from actually multiplying them, subtracting them, and then checking the outcome of the computation. This is a lot of work, but luckily we can be smarter about it.

Because we are working with ($$n$$-qubit) Paulis, we have extra structure in our operators: they are all tensor products of single qubit operators/ $$2\times 2$$ matrices. The commutation relations of the tensor factors alone determine the commutation relation of the full tensor product: If I have an operator $$X_{1}X_{2}$$ and an operator $$Z_{1}Z_{2}$$, its commutation relation is determined by the commutation relations of the pairs $$X_{1}, Z_{1}$$ and $$X_{2},Z_{2}$$. The total commutation relation is just the sum of all the bits of the relations of the single-qubit tensor factors - mod $$2$$. Thus, the pair $$X_{1}, Z_{1}$$ doesn't commute (and thus anti-commutes), and the pair $$X_{2}, Z_{2}$$ doesn't commute either, so their 'commutation relation bits' are both $$1$$. That makes the 'commutation relation bit' of the pair $$X_{1}X_{2}, Z_{1}Z_{2}$$ $$1+1 = 2 \rightarrow 0$$; i.e. they in fact do commute. This works for $$5$$-qubit operators as well.

The second thing we can realize is that our error operator is either $$X_{3}, Z_{3}$$ or $$Y_{3}$$. That's shorthand for $$I_{1}I_{2}X_{3}I_{4}I_{5}$$ etc. - we thus see that for our commutation relations of the pairs $$E,S_{i}$$ we only need to look at the commutation relations of the third qubit, because all other factors of $$E$$ are the identity, and everything commutes with the identity, so those 'commutation relations bits' will always be $$0$$.

Our error syndrome bit $$e_{i}$$ is thus solely determined by only the third factors of the generators. The third factor of the generators are, in order: $$$$\begin{split} &S_{1} \rightarrow Z_{3} \\ &S_{2} \rightarrow Z_{3} \\ &S_{3} \rightarrow X_{3} \\ &S_{4} \rightarrow I_{3} \\ \end{split}$$$$

Lastly, the commutation relations of single-qubit Paulis are fairly straightforward: everything commutes with $$I$$, and the Paulis $$X,Y,Z$$ in between each other commute with themselves and anti-commute with the other two.

Thus, for the error $$E = X_{3}$$, $$E = Z_{3}$$ and $$E = Y_{3}$$, we get error syndromes $$$$\begin{split} E = X_{3} \rightarrow& \{e_{1},e_{2},e_{3},e_{4}\} = \{1,1,0,0\} \\ E = Z_{3} \rightarrow& \{e_{1},e_{2},e_{3},e_{4}\} = \{0,0,1,0\} \\ E = Y_{3} \rightarrow& \{e_{1},e_{2},e_{3},e_{4}\} = \{1,1,1,0\} \\ \end{split}$$$$

Some final notes on your inclusion of the logical operators $$X_{L}$$ and $$Z_{L}$$: The generators say something about (actually, they make) the codespace. Errors (or rather, correctable errors), are maps that map the entire codespace to some other, orthogonal part of the Hilbert space of all qubits, while preserving the inner structure of the codespace. That is some fancy talk for the fact that errors don't care about what's going on in the codespace - they can't even influence it, because then they can influence the information encoded into the logical state - a big nono because this is exactly what we're trying to preserve.

The logical operators, on the other hand, are exactly those operators that do something within the codespace: they map logical states to other logical states. It doesn't really matter what are the commutation relations of the error with the logical operators - they work on a different 'realm', and the generators are there to keep the errors out of the codespace itself. This is a bit hand-wavy, and also not entirely precisely correct, but for me it is a very strong intuitive picture.

As JSdJ points out, you need to specify what stabilizers you are actually using before anyone can determine what the syndromes would be given those errors. See my previous answer here for some info about how this works generally, if it helps.

• These are logical operators, not generators for the stabilizer ~ the commutation relations with the logical operators are not the error syndrome. Note that $X_{L}$ and $Z_{L}$ don't even commute themselves (as they should, because they are the logical operators for $X$ and $Z$, and not operators in the stabilizer)
– JSdJ
Apr 6 at 8:47
• Ah yes right, that's what I get for doing this first thing in the morning hah. If OP doesn't mention what stabilizers are actually being used, then I would also vote to close the question. Apr 6 at 10:00