# Is there a way to write a generic low dimensional Clifford matrix?

Suppose I want to write a general $$2\times2$$ special unitary matrix in a given basis, I can write it as such: $$\begin{pmatrix} \alpha & -\overline\beta\\ \beta & \overline \alpha\end{pmatrix}$$ with $$|\alpha|^2+|\beta|^2=1$$. However I do not know if such a form exists for Clifford matrices/gates. Is there such a way to represent $$2\times2$$ or $$4\times 4$$ or even higher dimensions Clifford in terms of conditions between its matrix elements?

• There's a formula for the matrix elements of a $n$-qubit Clifford unitary up to a global phase. It's essential the same as for stabilizer states (quantumcomputing.stackexchange.com/questions/14851/…), since the Choi state is a stabilizer state and has the same coefficients. The only resource for this is the Dehaene-de Moor paper (arxiv.org/abs/quant-ph/0304125) which is close to unreadable. I can try to write it up more cleanly at some point. Feb 16, 2023 at 9:54
• @MarkusHeinrich if you can write it for $2\times 2$ unitaries that would be awesome! Feb 21, 2023 at 16:19

The unitary group is an infinite group, which is why unitary matrices can be parameterized by continuous parameters. Your representation is incomplete. A $$2\times 2$$ unitary matrix has four parameters, and one represenation is $$e^{i\phi/2} \begin{pmatrix} e^{i\phi_1/2}\cos\theta & e^{i\phi_2/2}\sin\theta \\ -e^{-i\phi_2/2}\sin\theta & e^{-i\phi_1/2}\cos\theta \end{pmatrix}$$

The Clifford group is a finite, i.e. The $$n$$-qubit Clifford group has a finite number of elements. The first few such sizes are $$|C(1)| = 192, \quad |C(2)| = 92160, \quad |C(3)| = 743178240.$$

So, it's not possible to parameterize them with continuous parameters.

If instead, you are interested in generating all possible Clifford gates (for small n), there are algorithms that systematically construct them all from the generators.

• So to be clear, if such a parametrized exists, it would be parametrized with integer variables and it would be so complicated that it would just be best to look it up in a list? Feb 12, 2023 at 13:27
• @Mauricio I posted an answer with a parameterization using integer variables. Take a look and judge for yourself if it is so complicated that it would be better to just look it up in a list. You may be right! Feb 12, 2023 at 20:40
• There are various conventions for counting the size of the Clifford group. The answer is always some multiple of the size of the Clifford group in the corresponding projective unitary group. The convention used here includes $\zeta_8=e^{i \pi/4}$, a primitive $8$ th root of unity, in the Clifford group so the size given in this answer is 8 times the projective size. The size given in my answer below is for the determinant 1 Clifford group so it is the projective size times 2 (2 here is the size of the center of the corresponding special unitary group). Feb 12, 2023 at 20:44

For an n-qubit gate, the stabilizer tableau of a clifford operation $$C$$ maps each Pauli generator $$P \in \{X_1,Z_1,X_2,Z_3,\dots,X_n,Z_n\}$$ to the conjugated Pauli string $$C^{-1}P C$$. I like to lay these out into a table where each input generator corresponds to a column and you read down the column to get the output:

$$\begin{array}{c|cc|cc|cc|c|cc|} &X_1&Z_1&X_2&Z_2&X_3&Z_3&\dots&X_n&Z_n\\ \hline \text{sign}&\pm&\pm&\pm&\pm&\pm&\pm&\dots&\pm&\pm\\ \hline q_1&C_{X_{1,1}}&C_{Z_{1,1}}&C_{X_{1,2}}&C_{Z_{1,2}}&C_{X_{1,3}}&C_{Z_{1,3}}&\dots&C_{X_{1,n}}&C_{Z_{1,n}}\\ q_2&C_{X_{2,1}}&C_{Z_{2,1}}&C_{X_{2,2}}&C_{Z_{2,2}}&C_{X_{2,3}}&C_{Z_{2,3}}&\dots&C_{X_{2,n}}&C_{Z_{2,n}}\\ q_3&C_{X_{3,1}}&C_{Z_{3,1}}&C_{X_{3,2}}&C_{Z_{3,2}}&C_{X_{3,3}}&C_{Z_{3,3}}&\dots&C_{X_{3,n}}&C_{Z_{3,n}}\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\ddots&\vdots&\vdots\\ q_n&C_{X_{n,1}}&C_{Z_{n,1}}&C_{X_{n,2}}&C_{Z_{n,2}}&C_{X_{n,3}}&C_{Z_{n,3}}&\dots&C_{X_{n,n}}&C_{Z_{n,n}}\\ \hline \end{array}$$

A tableau is valid if, for each $$k$$, the column $$C_{X_{\ast,k}}$$ anticommutes with the column $$C_{Z_{\ast,k}}$$, and all other column pairs commute. Note that, for example, this means the signs are totally irrelevant to whether a tableau is valid.

Let's consider single qubit tableaus:

$$\begin{array}{c|cc|} &X_1&Z_1\\ \hline \text{sign}&\pm&\pm\\ \hline q_1&A&B\\ \hline \end{array}$$

The only condition here is that $$A$$ anticommutes with $$B$$. If we define

$$\overline{P} = \text{next}(P) = \begin{cases} X &\rightarrow Y\\ Y &\rightarrow Z\\ Z &\rightarrow X\\ \end{cases}$$

then we can summarize this as requiring that the tableau be of this form:

$$\begin{array}{c|cc|} &X_1&Z_1\\ \hline \text{sign}&(-1)^a&(-1)^b\\ \hline q_1&A&\overline{A} \oplus A^c\\ \hline \end{array}$$

where $$\oplus$$ means to multiply while discarding scalar factors, and $$a,b,c$$ are each set to 0 or to 1.

We can move the $$c$$ bit dependence into the choice of whether to use $$Z_1$$ or $$Y_1$$ as the generator:

$$\begin{array}{c|cc|} &X_1&Z_1 \oplus X_1^c\\ \hline \text{sign}&(-1)^a&(-1)^b\\ \hline q_1&A&\overline{A}\\ \hline \end{array}$$

If we set all the bits to 0, we get

$$\begin{array}{c|cc|} &X_1&Z_1\\ \hline \text{sign}&+&+\\ \hline q_1&A&\overline{A}\\ \hline \end{array}$$

which is kinda reminiscent of

$$\begin{bmatrix} a & -\overline{b}\\ b & \overline{a} \end{bmatrix}$$

but is perhaps even more reminiscent of the real and imaginary parts of the single complex entry in a 1x1 unitary matrix having to form a unit vector.

I'm not aware of a "nice" way to phrase the two qubit tableaus in this way, but probably there is one. It may also be the case that breaking the Paulis down into pairs of bits reveals nicer patterns.

• Maybe an example of $A$ and how it works with the table would be helpful. Feb 12, 2023 at 13:25
• @Mauricio Well, for example, $A$ can be the Pauli X matrix. Feb 12, 2023 at 13:28
• And $\overline A = - Z$? Feb 12, 2023 at 13:40
• @Mauricio The pauli terms in the tableau are unsigned (the signs are kept in a separate row), so you'd never encounter a negative sign like $\overline{A}=-Z$. There's $\overline{X}=Y$, $\overline{Y}=Z$, and $\overline{Z}=X$. Note that overline is a custom function here, not conjugating the imaginary term. It happens to correspond to computing C^-1PC where C is a 120 degree rotation around X+Y+Z. Feb 12, 2023 at 13:56

I don't know if this is what you would consider a parameterization but here goes:

As you note above every element of $$SU_2$$ can be written $$\begin{pmatrix} \alpha & -\overline\beta\\ \beta & \overline \alpha\end{pmatrix}$$ with $$|\alpha|^2+|\beta|^2=1$$, in other words all $$(\alpha,\beta)$$ on the unit sphere $$S^3$$ in $$\mathbb{C}^2$$. This is the same thing as all $$a_1I+a_2iZ+b_1XZ+b_2iX$$ with $$(a_1,a_2,b_1,b_2)$$ on the unit sphere $$S^3$$ in $$\mathbb{R}^4$$. There are $$48$$ Clifford gates in $$SU_2$$. We can write them down by the values of $$(a_1,a_2,b_1,b_2)\in S^3 \subset \mathbb{R}^4$$ they correspond to.

$$(1,0,0,0)$$ is the identity matrix. This has order $$1$$ and projective order $$1$$.

$$(-1,0,0,0)$$ is the identity matrix. This has order $$2$$ and projective order $$1$$

The $$6$$ signed permutations of $$(0,1,0,0)$$ correspond to the $$6$$ other determinant $$1$$ Pauli matrices $$\pm iZ, \pm iX, \pm XZ$$. These have order $$4$$ and projective order $$2$$.

The $$12$$ signed permutations of $$(\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}},0,0)$$ for which the first entry is nonzero correspond to the square roots of the Pauli matrices. These have order $$8$$ and projective order $$4$$.

The $$12$$ signed permutations of $$(0,\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}},0)$$ for which the first entry is zero correspond to the Hadamard type Cliffords. These have order $$4$$ and projective order $$2$$.

The $$16$$ signed permutations of $$(\frac{1}{2},\frac{1}{2},\frac{1}{2},\frac{1}{2})$$ correspond to the Cliffords of order divisible by $$3$$. These all have order $$3$$ or $$6$$ and have projective order $$3$$.

The $$48$$ determinant $$1$$ single qubit Cliffords all correspond to $$\mathbb{Z}[\frac{1}{\sqrt{2}}]$$ points on the unit sphere $$S^3$$. It is tempting to say that the implication reverses but there are $$\mathbb{Z}[\frac{1}{\sqrt{2}}]$$ points on the unit sphere $$S^3$$, like $$(\frac{1}{2},\frac{1}{2},\frac{1}{\sqrt{2}},0)$$, which correspond to non-Clifford gate.

• This is a very nice answer. Is it possible to generalize this analysis to larger $n$? Has someone done so? Feb 13, 2023 at 1:30
• I was trying to think about that the other day. Certainly you can still take the coordinates of the multiqubit Clifford group in terms of a Pauli basis. I think that an arbitrary element of $SU(2^n)$ always has real coordinates with respect to a determinant 1 Pauli basis, but I'm not 100% sure. I'm also not quite sure if the coordinate vectors are always unit vectors for generic $SU(2^n)$. But these are all really interesting questions I'd be interested to learn more about! Feb 13, 2023 at 15:17
• @AbdullahKhalid you can come up with a formula for the matrix elements of a $n$-qubit Clifford unitary up to a global phase. It's a bit messy, but it's essential the same as for stabilizer states (quantumcomputing.stackexchange.com/questions/14851/…), since the Choi state is a stabilizer state and has the same coefficients. I wanted to write this up cleanly for a while now, because the only resource is the Dehaene-de Moor paper (arxiv.org/abs/quant-ph/0304125) which is close to unreadable. Feb 16, 2023 at 9:44
• @MarkusHeinrich Do you know if all Clifford unitaries (of determinant 1 say) have coordinates with respect to the Pauli basis which are $\{0,\pm1, \pm 1/2,\pm 1/\sqrt{2} \}$? Feb 16, 2023 at 17:08
• @IanGershonTeixeira that's certainly wrong as $e^{i\pi/4 P}=(I + i P)/\sqrt{2}$ is a Clifford of det 1. In general (for $n$ qubits), the coefficients are of the from $i^{Q(v)}$ where $Q$ is a quadratic form over $\mathbb Z_4$ and the support forms a subgroup or a coset (see also arxiv.org/abs/2006.14040). Feb 17, 2023 at 13:41