# how to construct a ((7,2,3)) code and verify its properties

These two recent papers describe a process to construct (non-stabilizer) codes with "exotic" transversal gates : paper1 paper2

Most of the codes have distance $$d=2$$ which makes them less desirable, but at least one has $$d=3$$ and I'm trying to construct and verify its properties. The math is fairly involved but there's GAP code sniplets that make it easier to follow the construction. The code in question is a $$((7,2,3))_2$$ code with a transversal group of order 120.

I can duplicate many of the results so far but for a possibly important parameter I'm getting a different value (this would affect the distance, so I'd like to clear it first) :

Here's my version of the GAP calculations :

TestA:=function()local grp,irr,f,g,n,R,Dec,dec;
grp:=PerfectGroup(120);
irr:=Irr(grp);
f:=irr[2];
g:=irr[3];
Print("|G|=",Size(grp)," dim(f)=",Degree(f)," dim(g)=",Degree(g),"\n");
Print("\n");

for n in [1..10] do
R:=SymmetricPower(f,2*n);
Dec:=List(irr,x->ScalarProduct(x,R));
Print("n=",String(n,-2)," dim(R)=",String(Degree(R),-3)," dec=",Dec,"\n");
od;

Print("\n");;

for n in [1..21] do
dec:=ScalarProduct(g,f^n);
if(dec>0)then Print("n=",String(n,-2)," (g,f^n)=",dec,"\n");fi;
od;;
Print("\n");;

Dec:=List(irr,x->ScalarProduct(x,f*f));Print("(f*f) dec=",Dec,"\n");;
Dec:=List(irr,x->ScalarProduct(x,g*g));Print("(g*g) dec=",Dec,"\n");;
Dec:=List(irr,x->ScalarProduct(x,f*g));Print("(f*g) dec=",Dec,"\n");;

return grp;
end;


Running it gives the following :

gap> TestA();;
|G|=120 dim(f)=2 dim(g)=2

n=1  dim(R)=3   dec=[ 0, 0, 0, 0, 1, 0, 0, 0, 0 ]
n=2  dim(R)=5   dec=[ 0, 0, 0, 0, 0, 0, 0, 1, 0 ]
n=3  dim(R)=7   dec=[ 0, 0, 0, 1, 0, 1, 0, 0, 0 ]
n=4  dim(R)=9   dec=[ 0, 0, 0, 0, 0, 1, 0, 1, 0 ]
n=5  dim(R)=11  dec=[ 0, 0, 0, 1, 1, 0, 0, 1, 0 ]
n=6  dim(R)=13  dec=[ 1, 0, 0, 0, 1, 1, 0, 1, 0 ]
n=7  dim(R)=15  dec=[ 0, 0, 0, 1, 1, 1, 0, 1, 0 ]
n=8  dim(R)=17  dec=[ 0, 0, 0, 1, 0, 1, 0, 2, 0 ]
n=9  dim(R)=19  dec=[ 0, 0, 0, 1, 1, 2, 0, 1, 0 ]
n=10 dim(R)=21  dec=[ 1, 0, 0, 1, 1, 1, 0, 2, 0 ]

n=7  (g,f^n)=1
n=9  (g,f^n)=8
n=11 (g,f^n)=44
n=13 (g,f^n)=209
n=15 (g,f^n)=924
n=17 (g,f^n)=3928
n=19 (g,f^n)=16321
n=21 (g,f^n)=66880

(f*f) dec=[ 1, 0, 0, 0, 1, 0, 0, 0, 0 ]
(g*g) dec=[ 1, 0, 0, 1, 0, 0, 0, 0, 0 ]
(f*g) dec=[ 0, 0, 0, 0, 0, 1, 0, 0, 0 ]


Everything up to the last line is consistent with the papers. Here $$f=\chi_2$$ and $$g=\chi_3=\lambda$$. Page 10 of the first paper has $$\lambda \otimes \lambda^* =\chi_1 + \chi_4$$. Since $$\lambda^*$$ is just $$\chi_2$$ my result seem different : $$\lambda \otimes \lambda^* = \chi_6$$. What's the discrepancy?

At least one of the authors (Ian) is active on this forum; hopefully he can provide an explanation; or better yet an explicit way to construct the code and check its properties. Other comments from others also welcome.

[ Correction to original question post ] :

As pointed out in the answer, $$\chi_2 ^* = \chi_2$$ and $$\chi_3^* = \chi_3$$ and not what I wrote before. I can now verify the code construction and its distance.

GAP code used to construct the code :

Tensor:=mats->Iterated(mats,KroneckerProduct);

TestB:=function()local grp,irr,f,g,n,R,Dec,dec,rep,elm,ff,gg,W;
grp:=PerfectGroup(120);
rep:=IrreducibleRepresentations(grp,Cyclotomics);;
elm:=Elements(grp);
n:=7;;
ff:=List(elm,x->x^rep[2]);;
gg:=List(elm,x->x^rep[3]);;
W:=2*Sum([1..Size(grp)],x->TraceMat(GaloisCyc(gg[x],-1))*Tensor(List([1..n],y->ff[x])))/Size(grp);;
Print(W^2=W," W^2=W; dim(w)=",DimensionsMat(W)," rnk(W)=",RankMat(W),"\n");;
return W;
end;


results :

 true W^2=W; dim(w)=[ 128, 128 ] rnk(W)=2

• If the B enumerator you obtain using the code snippet above is the same as what I got then the A enumerator should also be the same as what I got, that's because of the quantum MacWilliams identity arxiv.org/abs/quant-ph/9610040 which says that A enumerator determines B enumerator, and vice versa. Not sure what's going wrong with $A_6$ but technically you could compute it from the $B$ enumerator just to check? Commented Apr 17 at 0:24
• I found the source of the problem : I was using the equations from an older version of this post : quantumcomputing.stackexchange.com/questions/26754/… . It must have been updated since I looked last; the current version gives the right results for A and B. Commented Apr 17 at 2:03

This is Eric (other author). If $$\lambda = \chi_3$$ then $$\lambda^* = \chi_3$$ (not $$\chi_2$$). You check this explicitly in GAP using $$\texttt{ComplexConjugate(\lambda)=\lambda;}$$ which evaluates to $$\texttt{true}$$.

The reason $$\chi_3^* = \chi_3$$ is because $$\chi_3$$ has real character values (and is a quaternionic irrep with Frobenius–Schur indicator $$-1$$). See table I in the appendix of the first paper cited (or table S2 of our other paper). Note that every irrep of $$\mathrm{2I}$$ is either real or quaternionic so every irrep of this group has this "self dual" property. You can find the Frobenius-Schur indicator of irreps in GAP using the following code: \begin{align} \texttt{G:=PerfectGroup(120); }\\ \texttt{ct:=CharacterTable(G); } \\ \texttt{Indicator(ct,2); } \end{align} A Frobenius-Schur indicator of $$1$$ means the irrep is real, $$-1$$ means the irrep is quaternionic, and $$0$$ means the irrep is complex (and complex irreps are the only type that aren't self dual).

To construct the $$((7,2,3))_2$$ code explicitly, simply construct the isotypic projector $$\Pi = \frac{2}{120} \sum_{g \in \mathrm{2I}} \mathrm{Tr}(\rho_{\chi_3}(g^{-1})) \rho_{\chi_2}(g)^{\otimes 7},$$ where $$\rho_{\chi}(g)$$ is the $$2 \times 2$$ irreducible representation of the element $$g \in \mathrm{2I}$$ with respect to the character $$\chi$$. The code will be the image of this projector (since $$\chi_3$$ has multiplicity 1 in $$\chi_2^7$$).

There are also codes of this kind in 9 qubits, i.e., $$((9,2,3))_2$$ codes that implement $$\mathrm{2I}$$ transversally. In this case construct the isotypic projector $$\Pi = \frac{2}{120} \sum_{g \in \mathrm{2I}} \mathrm{Tr}(\rho_{\chi_3}(g^{-1})) \rho_{\chi_2}(g)^{\otimes 9}.$$ The image of this projector has dimension 16 (since $$\chi_3$$ has multiplicity 8 in $$\chi_2^9$$) but the results of the first paper you cited show that any 2-dim subspace (that still transforms as $$\chi_3$$ of $$\mathrm{2I}$$) will be a $$((9,2,3))_2$$ code. One way to choose such a subspace in a fairly practical way is to pick an arbitrary vector $$|\psi_0 \rangle$$ in the image of $$\Pi$$ and then define $$| \psi_1 \rangle := X^{\otimes 9} |\psi_0 \rangle$$ where $$X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$$ is the Pauli-$$X$$ matrix. Then with a fairly high probability the subspace $$\{ | \psi_0 \rangle, | \psi_1 \rangle \}$$ will be a $$((9,2,3))_2$$ code (although there is some chance that this only transforms in an irrep of a subgroup of $$\mathrm{2I}$$ in which case you have to be more creative, e.g., by defining $$| \psi_1 \rangle := \Phi^{\otimes 9} | \psi_0 \rangle$$ where $$\Phi$$ is a gate we define in the paper I linked above).

• thanks for the correction and explicit construction. I constructed $\Pi$ and checked that $\Pi^2=\Pi$ and that its rank is 2 as expected. I also calculated the distance to be 3. Are there any expected symmetries for the code (permutation invariance,...)? Next I'd like to compare this code to the $[[7,1,3]]$ CSS Steane code...I'll probably post a separate question on this. thanks again for the answer... Commented Apr 16 at 2:29
• @unknown Yes the $((7,2,3))$ icosahedral code will be permutation invariant because the unique copy of $g$ in $f^7$ lives in the totally symmetric part of the 7th tensor power. Here I am using your notation g=irr[3] and f=irr[2]. Commented Apr 16 at 15:59
• thanks this makes sense. Do you happen to have the weight enumerators? I calculated the first 5 terms without using permutation invariance and the A and B values gave the distance to be 3. B also adds up to 256 but something strange happens to $A_6$ : it's not rational and A doesn't sum up to 64. Maybe the equation for $\Pi$ needs clarification : $\chi_3^*(g)$ is the trace over $\rho_3(g)$ and $g^{\otimes 7}$ is $(\rho_2(g))^{\otimes 7}$. I'll add the GAP code I used to get the actual matrices in my question. Commented Apr 16 at 16:08
• @unknown the weight enumerators are A enumerator $(1, 0, 7, 0, 7, 0, 49, 0)$ and B enumerator $(1, 0, 7, 42, 7, 84, 49, 66)$ Commented Apr 16 at 17:35
• thanks, I get the same values for everything except $A_6$...(I get some cyclotomic number). Did you generate the explicit $2 \times 2$ matrices the same way I did? Commented Apr 16 at 17:57