# Which codes have transversal $T$ gate?

A previous post transversal P (phase) gate shows that codes where all stabilizer elements have weights that are multiple of 4 will have a transversal $$P$$ gate.

"Transversal" seems to have multiple definitions; here a gate $$G$$ is transversal for the code with stabilizer $$S$$ if it is in the normalizer of $$S$$ in the full unitary group : $$G \in U_n : G' S G = S\,.$$ (note $$G$$ need not be in the clifford group). This is shown using $$P^\dagger X P = \imath XZ\,.\\ P^\dagger Z P = Z\,.$$ At first guess I thought that codes where all stabilizer elements have weight that's a multiple of 8 would have a transversal $$T$$ gate. ($$T^2=P$$); but $$T^\dagger X T = w_8 P Z X\,,\\ T^\dagger Z T=Z\,,$$ where $$w_8^8=1$$. So it's not obvious if a similar argument can be used. Does anyone know how to extend the result for $$P$$ gate to $$T$$?

• I think this is impossible due to the Eastin–Knill theorem: en.wikipedia.org/wiki/Eastin%E2%80%93Knill_theorem Commented Jun 7, 2022 at 5:47
• Yes, but it's a part of an active research project of mine that I wouldn't want to give too much away on! In short, look for "triorthogonal codes". Commented Jun 7, 2022 at 6:37
• @VictoryOmole this doesn't violate Eastin-Knill. It just tells you that you cannot have transversal Hadamard (which in turn says that the code cannot be a self-dual CSS code). Commented Jun 7, 2022 at 6:51
• Ah, I see. Thanks. Commented Jun 7, 2022 at 8:41
• Probably very relevant: arxiv.org/abs/2001.04887 Commented Jun 9, 2022 at 22:34

The $$11$$ qubit $$d=3$$ error-correcting quantum code we find here

https://arxiv.org/abs/2310.17652

is probably the smallest code with transversal $$T=\begin{bmatrix} 1 & 0 \\ 0 & e^{i \pi/4}\end{bmatrix}$$.

The code is permutationally invariant and has codewords $$|\overline{0} \rangle= \sqrt{\frac{5}{16}} | D^{11}_0 \rangle + \sqrt{\frac{11}{16}} | D^{11}_8 \rangle$$ and $$|\overline{1} \rangle = \sqrt{\frac{5}{16}} | D^{11}_{11} \rangle + \sqrt{\frac{11}{16}} | D^{11}_3 \rangle$$ where $$| D^{11}_w \rangle$$ represents a normalized uniform superposition over all $$11$$ qubit computational basis kets of weight $$w$$. So $$| D^{11}_0 \rangle =|00000000000 \rangle$$ while $$| D^{11}_8 \rangle$$ is $$1/\sqrt{\binom{11}{8}}$$ times the uniform sum of all $$\binom{11}{8}$$ many of the weight $$8$$ basis kets. Similarly for $$| D^{11}_{11}\rangle$$ and $$| D^{11}_3 \rangle$$

The logical $$T$$ gate for this code is implemented by $$(T^3)^{\otimes 11}$$.

The code has weight enumerator $$A=(1, 0, \frac{187}{10}, 0, \frac{4081}{60}, 0, \frac{3619}{20}, 0, \frac{1001}{4}, 0, \frac{6061}{12}, 0)$$ and dual weight enumerator $$B=(1, 0, \frac{187}{10}, \frac{1265}{24}, \frac{4081}{60}, \frac{1771}{4}, \frac{3619}{20}, \frac{8371}{10}, \frac{1001}{4}, \frac{60643}{60}, \frac{6061}{12}, \frac{29149}{40})$$ So one can verify that the distance is 3 by observing that $$A_0=1=B_0 \\ A_1=0=B_1 \\ A_2=18.7=B_2 \\ A_3=0\neq \frac{1265}{24}=B_3$$ A sanity check here is that the A weight enumerators should sum to $$2^{n-k}$$ (for a proof of this see Do the coefficients of the weight enumerator polynomial add up to $2^{n-k}$ for any $[\![n,k]\!]$ code?) where $$n=11$$ is the number of physical quibts and $$k=1$$ is the number of logical qubits. Similarly, the B weight enumerators should sum to $$2^{n+k}$$. We can check indeed that the weight enumerators I gave above have $$\sum_{i=0}^{11} A_i= 1024$$ and $$\sum_{i=0}^{11} B_i= 4096$$

Aside on weight enumerators: The weight enumerators of a code are defined by

\begin{align*} A_i &= \frac{1}{(Tr(\Pi))^2} \sum_{E \in \mathcal{E}_i} Tr(E \Pi)Tr(E^\dagger \Pi) \\ B_i &= \frac{1}{Tr(\Pi)} \sum_{E \in \mathcal{E}_i} Tr( E \Pi E^\dagger \Pi) \end{align*} Here $$\Pi$$ is the code projector and $$\mathcal{E}_i$$ are the Pauli errors with weight $$i$$. The code has at least distance $$d$$ if and only if both $$A_d < B_d$$ and $$A_i=B_i$$ for all $$i \leq d-1$$.

To construct a code projector for an $$((n,2,d))$$ with logical code words $$| \overline{0} \rangle$$ and $$| \overline{1} \rangle$$ the code projector $$\Pi$$ is given by $$\Pi= | \overline{0} \rangle \langle \overline{0} | + | \overline{1} \rangle \langle \overline{1} |$$

• interesting paper! It was straight forward to verify that $(T^3)^{\otimes 11}$ acts as $[[1,0],[0,E(8)]]$ on $[\bar 0,\bar 1]$. Since this is not a stabilizer code, I don't have any existing code to check the distance so I couldn't verify the $d=3$ part. How did you check the distance? Commented Mar 29 at 21:59
• @unknown there is some theory in the paper about reducing the d=3 condition to satisfying a single quadratic form in this special case, but to check more directly you can just compute the weight enumerators, which I have added. Commented Apr 8 at 13:29
• sorry but my I'm not too familiar with non-stabilizer codes; how are these enumerators defined?...with stabilizer codes you have the stabilizer code and its normalizer to work with but here what "groups" or "codes" are involved? Commented Apr 8 at 17:23
• @unknown I added an aside on weight enumerators Commented Apr 8 at 19:01
• @unknown usually it takes many hours to do all the weight enumerators $A_0, \dots, A_{11}$ and $B_0, \dots B_{11}$ if you compute every term explicitly from the defintion but if you use the permutation invariance then lots of terms in the sum you know will be identical so you can compute way fewer terms and get the weight enumerators faster Commented Apr 13 at 15:53

A well known way to construct codes with transversal T gates is from a triorthogonal check matrix.

Each column of the matrix is a qubit. Each row of the matrix is an $$X$$ stabilizer. All pairs of rows must have an even number of 1-on-qubit-in-both-rows. All triplets of rows must have an even number of 1-on-qubit-in-all-three-rows.

This won't exhaust all ways of getting a good logical T, but it's a simple way to get one.