# Generators for single qudit Clifford, d=4

The generators for single qubit Clifford are phase $$P$$ and Hadamard $$H$$.

The generators for single qutrit Clifford can be found for example here

What is the set of generators for the qutrit Clifford group?

What are two $$4 \times 4$$ matrices that generate the single qudit Clifford group for $$d=4$$?

• The result in the answer of the post you link to extends to all integers (not just primes). So $H$ (Fourier) + $P$ (Phase or shear) are enough to generate the group. Also see arxiv.org/abs/1307.5087 Jul 11 at 2:47
• @unknown You claim that the linked post extends to all integers. That appears to be false. For example plugging $p=2$ into that definition of $S$ gives the matrix $Z$ which, together with $H$ gate, does not generate the single qubit Clifford group. Similarly, plugging in $p=4$, the matrices $S$ and $H$ constructed that way do not generate a finite group which strongly suggests that they do not generate the single 4-dit Clifford group. Indeed this fact can verified by checking that the determinant 1 versions of these matrices do not generate a finite group in $SU_4$. Jul 11 at 21:21
• For $p=2$, did you use equations 31 and 33?...these should work I think (there's a slight adjustment for p odd or even, eqn 32 vs 33...) Jul 11 at 21:57
• for $p=2,3,4,5$ I get group size = $192,2592,1536,30000$ Jul 11 at 22:27
• Nice! Looks like there was some confusion here. I thought you were saying that the result in the answer to the qutrit post I linked extended to all integers. That would be wrong. But if you were instead saying that the definition in equations 31 & 33 of the arxiv paper you mention extends to all integers then that sounds very promising, I'll definitely take a look! Jul 13 at 14:57

The generators for qudit clifford group are give here https://arxiv.org/abs/1911.08162 This is more concise than the paper in the comment and takes care of subtleties better.

Here is a short GAP program that defines these generators for any dimension:

TestA:=function(p)local Ig,Zg,Xg,Hg,Pg,grp,cen,sgrp,scen,C;
Ig:=IdentityMat(p);
Zg:=DiagonalMat(List([0..p-1],x->E(p)^x));
Xg:=IdentityMat(p){\mod([0..p-1]+1,p)+1};
Hg:=List([0..p-1],x->List([0..p-1],y->E(p)^(x*y)))/ER(p);
Pg:=DiagonalMat(List([0..p-1],x->E(2*p)^(x*(x-\mod(p,2)))));
grp:=Group([Hg,Pg,Zg]);cen:=Center(grp);sgrp:=Size(grp);scen:=Size(cen);
Print(" |G| = ",String(sgrp,-5));Print(" |Cen(G)| = ",String(scen,-5));Print(" |G/Cen(G)| = ",String(sgrp/scen,-5));Print("\n");
if(p=4)then
Print("Z=\n");PrintArray(Zg);
Print("X=\n");PrintArray(Xg);
Print("H=\n");PrintArray(Hg);
Print("P=\n");PrintArray(Pg);
C:=KroneckerProduct([[1,0],[0,1]],[[1,1],[1,-1]]/ER(2));C:=C{[1,3,2,4]}{[1,3,2,4]};
Zg:=C^-1*Zg*C;
Xg:=C^-1*Xg*C;
Hg:=C^-1*Hg*C;
Pg:=C^-1*Pg*C;
grp:=Group([Hg,Pg,Zg]);
Print(" all elements are monomial? ",ForAll(Elements(grp),IsMonomialMatrix),"\n");
fi;
return grp;end;


Running in GAP gives : (takes seconds)

gap> g2:=TestA(2);;
|G| = 192   |Cen(G)| = 8     |G/Cen(G)| = 24
gap> g3:=TestA(3);;
|G| = 2592  |Cen(G)| = 12    |G/Cen(G)| = 216
gap> g4:=TestA(4);;
|G| = 6144  |Cen(G)| = 8     |G/Cen(G)| = 768
Z=
[ [      1,      0,      0,      0 ],
[      0,   E(4),      0,      0 ],
[      0,      0,     -1,      0 ],
[      0,      0,      0,  -E(4) ] ]
X=
[ [  0,  1,  0,  0 ],
[  0,  0,  1,  0 ],
[  0,  0,  0,  1 ],
[  1,  0,  0,  0 ] ]
H=
[ [        1/2,        1/2,        1/2,        1/2 ],
[        1/2,   1/2*E(4),       -1/2,  -1/2*E(4) ],
[        1/2,       -1/2,        1/2,       -1/2 ],
[        1/2,  -1/2*E(4),       -1/2,   1/2*E(4) ] ]
P=
[ [     1,     0,     0,     0 ],
[     0,  E(8),     0,     0 ],
[     0,     0,    -1,     0 ],
[     0,     0,     0,  E(8) ] ]
all elements are monomial? true
gap> g5:=TestA(5);;
|G| = 30000 |Cen(G)| = 10    |G/Cen(G)| = 3000


As a check, the calculated $$G/Cen(G)$$ match the results in this paper https://arxiv.org/abs/1810.10259

The GAP code also calculates the generators in an alternate basis. This is based on this https://arxiv.org/abs/1202.3559 where the entire clifford group consists of monomial matrices (normally only the pauli's are). This can be done when $$p$$ is a square.

As a final note, when $$p$$ is prime $$H$$ and $$P$$ seem enough (so $$Z$$ is redundant in the generators).

• Wow your code is beautiful! The single qubit and single qutrit case definitely look good, I recognize those numbers for $G/Cen(G)$. Jul 13 at 15:01
• Great answer +1 very interesting paper about basis where the entire Clifford group is monomial matrices if $p$ is square. Interesting to note that Markus Heinrich here quantumcomputing.stackexchange.com/questions/13643/… and especially in chapter 4 of his dissertation uses a different definition of Clifford which differs from the standard one if the qudits are not of prime dimension. For example his single qudit Clifford group for d=4 has order $4^3*(4^2-1)= 960$. I'll probably ask a new question about the reason for this alternative definition. Jul 13 at 15:50
• Very interesting that we need to include one of the 4dit Pauli operators (X or Z ) in addition to the $H$ and $P$ generators to get the whole Clifford group. The paper you got this from arxiv.org/abs/1911.08162 does a great job. Looking back at the Farinholt paper you mentioned earlier arxiv.org/abs/1307.5087 it seems that the author has totally overlooked the need to include a Pauli operator in the generating set. The group constructed from his equations 31 & 33 does not contain 4dit X or 4dit Z. Indeed the group is not even irreducible. Do you think its worth emailing the guy? Jul 13 at 16:17
• @IanGershonTeixeira It's an old paper and it looks like this was caught by others. There are many slightly different ways to define the Pauli and Clifford groups (real/complex, global phases, ...) and subtle differences are harder to resolve. That's why I like to calculate things directly when possible...I'll take a look at the other post a little later. Jul 13 at 16:25
• @IanGershonTeixeira It would be a good question to ask about $Z(p^a)$ vs $GF(p^a)$. Gottesman has a lecture on this pirsa.org/19110138 A few things are different for stabilizer codes but to me $Z(n)$ still seems more natural Jul 14 at 14:25