# The commutativity of $I$ and $Y$ in a stabilizer code

Let $$P_1 = \lbrace I, -I, iI, -iI, X, -X, iX, -iX, Y, -Y, iY, -iY, Z, -Z, iZ, -iZ\rbrace$$. Let $$P_n$$ be the $$n$$-tensor fold of $$P_1$$. It is said that two operators either commute if $$AB = BA$$ or anti-commute if $$AB = -BA$$ for all $$A,B \in P_n$$.

Let us have $$n=1$$ and $$A=I$$ and $$B=Y$$, then we have:

\begin{align*} IY &\stackrel{\text{true}}{=} YI,\\ IY &\stackrel{\text{true}}{=} -YI. \end{align*}

In other words, $$I$$ and $$Y$$ both commute and anti-commute. I have also added a matlab code snippet for completeness.

I = [1 0; 0 1];
Y = [0 -i;i  0];
if isequal(I*Y,Y*I)
disp('commute')
end
if isequal(I*Y,-Y*I)
disp('ANTI-commute')
end


I am referring to Daniel Gottesman's PhD thesis.

What am I missing?

Edit: My Matlab code should run only one of the if statements (not both). It seems that my machine was caching the answers from previously. A restart of the program has fixed the issue.

• Did you run the code? What does it show? (I did, and it showed what it should.) Aug 31 '20 at 13:41
• Slightly off-topic, but you really should not include any $i$'s or $-i$'s in these kind of sets if you're talking about stabilizer codes. And definitely not $-I$! Also, note that the concept of commutativity is not only defined for the Pauli group, but for any pair of operators (of course, the concept even extends beyond operators).
– JSdJ
Aug 31 '20 at 15:36
• There are two groups at play : the "normal" Pauli group with center $\{\pm I,\pm \imath\}$ and the "real" version with center $\{\pm I\}$. Authors switch between them without warning sometimes. "Two operators commute or anti-commute" applies to the real case only. In general the commutator is in the center of the group in both cases. Aug 31 '20 at 17:02
• @NorbertSchuch, the output is that they commute and anti-commute. My concern that it should be one or the other, not both. Aug 31 '20 at 22:33
• That's not what the code gave on my computer! Aug 31 '20 at 22:46

It should be $$IY \ne - YI$$ instead of $$IY = - YI$$. $$IY \ne - YI \\ \begin{pmatrix} 1&0\\ 0& 1 \end{pmatrix} \begin{pmatrix} 0&-i\\ i& 0 \end{pmatrix} \ne -\begin{pmatrix} 0&-i\\ i& 0 \end{pmatrix} \begin{pmatrix} 1&0\\ 0& 1 \end{pmatrix} \\ Y = \begin{pmatrix} 0&-i\\ i& 0 \end{pmatrix} \ne -\begin{pmatrix} 0&-i\\ i& 0 \end{pmatrix} = -Y$$

So $$I$$ and $$Y$$ don't anti-commute. Moreover $$I$$ anti-commutes only with the matrix with all $$0$$ entries. Also, $$I$$ commutes with all matrices, because from definition $$IM = M = MI$$, where $$M$$ is a random matrix.

On the contrary all pairs from $$\{X, Y, Z \}$$ anti-commute with each other. As an example:

$$\{X Z \} = XZ + ZX = 0$$

because $$XZ = -ZX$$. Also, we have thess relations: $$XY = -YX$$ and $$YZ = -ZY$$ from which we can conclude $$\{XY\} = \{ZY\} = 0$$.

• In the thesis referred to in the question in equation 1.4, the anti-commuter function is defined as: $\lbrace \sigma_i,\sigma_j\rbrace = \sigma_i\sigma_j + \sigma_j\sigma_i = 0$ for $i, j \in \lbrace X,Y,Z\rbrace$. It means that $\lbrace \sigma_i,\sigma_j\rbrace = \sigma_i\sigma_j = -\sigma_j\sigma_i$. Am I missing something? Aug 31 '20 at 9:39
• @M.AlJumaily, you have written in the comment $i,j \in \{X, Y, Z \}$...note that $I$ is not included. Please add the reference link to the question. Aug 31 '20 at 9:48
• Alright, I have been working for long hours now and I need to sleep (it is 7am now). I will go over all of this and see what happens. Thank you for the help :)! Aug 31 '20 at 10:50
• This was addressed towards M.AlJumaily, not towards you:) They dropped the $i$ somewhere in the comments, it was just a reminder to not do that:)
– JSdJ
Aug 31 '20 at 16:22
• @DavitKhachatryan, thank you for all of the help, the edit and the time :)! Sep 1 '20 at 10:22