How many elements does the Pauli group have? The Pauli matrices are
$$e = \begin{bmatrix}1&&0\\0&&1\end{bmatrix},\ X = \begin{bmatrix}0&&1\\1&&0\end{bmatrix},\ Y = i\begin{bmatrix}0&&-1\\1&&0\end{bmatrix},\ Z = \begin{bmatrix}1&&0\\0&&-1\end{bmatrix}$$
I want to create a group that contains all these matrices. I started drawing a Cayley Table as
| * | e | X | Y | Z |
|---|---|---|---|---|
| e | e | X | Y | Z |
| X | X | e |   |   |
| Y | Y |   | e |   |
| Z | Z |   |   | e |

At this point I realize that XY is not equal to YX, i.e. the group is non abelian. So, the rest of the group should have distinct element i.e. 6 more elements, i.e, XY, YX, XZ, ZX, ZY and YZ. Now the total number of elements come out to be 10 now, i.e. e, X, Y, Z, XY, YX, XZ, ZX, ZY and YZ.
But the Pauli matrices is a group with 16 elements. I don't know what I am missing. I am a beginner in Group theory and I am making a colossal mistake somewhere. Please help.
 A: A short and handy way to construct a Cayley table is based on the fact that the Pauli group is the semidirect product of the quaternion group with the cyclic group of order two: $P = Q_8 \rtimes \Bbb Z_2 $. This permits us to uniquely write a group element as $(q, \pm 1)$, where $q \in \{\mathbf{1,i,j,k,-1,-i,-j,-k}\}$ and the multiplication law goes like $(q_1, \epsilon_1)(q_2, \epsilon_2) = (\epsilon_1 q_1 q_2, \epsilon_1 \epsilon_2)$. The correspondence between the elements of $Q_8$ and the Pauli matrices is as follows : 
$$
(\mathbf{ 1 } , +1) =\bigl( \begin{smallmatrix} 1 & 0 \\ 0 & 1\end{smallmatrix} \bigr),
(\mathbf{i}, +1) =\bigl( \begin{smallmatrix} 0 & -1\\ 1 & 0\end{smallmatrix} \bigr),
(\mathbf{j}, +1) =\bigl( \begin{smallmatrix} i &  0\\ 0 & -i\end{smallmatrix} \bigr),
(\mathbf{k}, +1) =\bigl( \begin{smallmatrix} 0 & i\\i & 0\end{smallmatrix} \bigr),
$$
$$
(\mathbf{ -1 } , +1) =\bigl( \begin{smallmatrix} -1 & 0 \\ 0 &-1\end{smallmatrix} \bigr),
(\mathbf{-i}, +1) =\bigl( \begin{smallmatrix} 0 & 1\\ -1 & 0\end{smallmatrix} \bigr),
(\mathbf{-j}, +1) =\bigl( \begin{smallmatrix} -i &  0\\ 0 & i\end{smallmatrix} \bigr),
(\mathbf{-k}, +1) =\bigl( \begin{smallmatrix} 0 & -i\\-i & 0\end{smallmatrix} \bigr)
$$
Note that all those matrices have determinant $+1$ and that all other Pauli matrices have determinant $-1$.
In order to find the other eight elements of the Pauli group it suffices to multiply with $X$, e.g. $(\mathbf{-k}, -1) = \bigl( \begin{smallmatrix} 0 & 1\\1 & 0\end{smallmatrix} \bigr)\bigl( \begin{smallmatrix} 0 & -i\\-i & 0\end{smallmatrix} \bigr) = \bigl( \begin{smallmatrix} -i & 0\\0 & -i\end{smallmatrix} \bigr)$ (in other words, by just swapping the rows, which changes the sign of the determinant).

Examples 


*

*First recall the rules for calculatng with quaternions; 
$$ 
\mathbf{i^2} = \mathbf{j^2} = \mathbf{k^2} = -1, \mathbf{k} = \mathbf{i} \mathbf{j} = -\mathbf{j}\mathbf{i}
$$
What is $(\mathbf{i},-1)(\mathbf{-k},1)$? We have $(\mathbf{i},-1)(\mathbf{-k},1) = (-\mathbf{-ik},-1) = (\mathbf{i}^2\mathbf{j},-1)= (-\mathbf{j},-1)$ where the first of the double minus signs comes from the first epsilon.

*What is the notation of $\bigl( \begin{smallmatrix} 0 & -i\\i & 0\end{smallmatrix} \bigr) $? First of all its determinant is $-1$ so this matrix will not figure in the list above and its epsilon will be $-1$, when we swap the rows we get $\bigl( \begin{smallmatrix} i & 0\\0 & -i\end{smallmatrix} \bigr) $ so the matrix corresponds to $(\mathbf{j},-1)$.

A: $XY\ne YX$ alone doesn't tell you the same about $YZ$ and $ZY$, or $XZ$ and $ZX$. True, they aren't equal, but you have to prove that. Besides, how do you know that (for example) $XY$ and $YZ$ are different elements?
To be sure you aren't missing anything, you have to actually multiply matrices by hand, check what new elements you've got, and continue in this manner until the multiplication of everything by everything fails to produce any new elements. That's when your Cayley table is complete.
A: Yes,  the total number of elements is $16$. Consider the elements $XYZ$ and its six permutations.
A: An approach that often helps me, when working with generators of a group, is to figure out what commutators (in the group theory sense) $[b,a] = b^{-1}a^{-1}ba$ are between the generators. The commutator $[b, a]$ is defined so that you can replace $ba$ with $ab[b, a]$, to "move $b$ across $a$" for a small price (the commutator fee). The idea is that hopefully you can find a format with which you can express all of your group elements; say $X^i Y^j Z^k$ or something like that. This doesn't always work, but here it does.

Here, you can compute that $$[Y, X] = Y^{-1}X^{-1}YX = YXYX = (YX)^2 = -I.$$ Thus, we know that, for example, $YX = XY[Y, X] = XY \cdot (-I) = -XY$: We can always move $Y$ across $X$, at the expense of negating our result.
Our commutators look like 
\begin{align*}
[Y, X] &= -I \\
[Z, Y] &= -I \\ 
[Z, X] &= -I
\end{align*}
Now with the element list $I, -I, X, Y, Z, XY, YX, YZ, ZY, XZ, ZX$, (for $-I$, we have that $X^2 = Y^2 = Z^2 = -I$) we try and write in alphabetic order. Using commutators, we already saw that $YX = -XY$, and similarly $ZY = -YZ$ and $ZX = -XZ$.
We can try and left- and right-multiply things in our new list with each of $X, Y$, and $Z$ to see what new elements we get.
Take $XY$ for example. There isn't anything obvious to do with $XYZ$, but with $ZXY$, we have
\begin{align*}
ZXY 
&= ZX \cdot Y \\
&= XZ[Z, X] \cdot Y \\
&= -XZ \cdot Y \\
&= -X \cdot ZY \\
&= -X \cdot YZ[Z, Y] \\
&= -X \cdot -YZ \\
&= XYZ
\end{align*} (which should be fairly intuitive, when we look back: Moving $Z$ across each of $X$ and $Y$ introduces a negative; move across both, and your negatives cancel).
You can play around with this idea, I believe it'll turn out that we can write the elements as
$$\pm I, \pm X, \pm Y, \pm Z, \pm XY, \pm XZ, \pm YZ, \pm XYZ$$
(and the order checks out, combinatorially: The order is $16 = 2 \cdot 8 = 2 \cdot 2^3$, where the factor of $2$ accounts for the $\pm$'s, and the $2^3$ counts subsets of $\{X, Y, Z\}$.

Using commutators to achieve a standard format for group elements lets you compute the full Cayley table fairly easily (although of course it will take effort). For example, multiplying $XY \cdot XYZ$, we have $X\underbrace{Y \cdot X}_{[Y,X]}YZ = -X^2 Y^2 Z = -Z$.
