---
title: Triorthogonal Quantum Codes
url: https://www.emergentmind.com/topics/triorthogonal-codes
type: topic
---

# Triorthogonal Quantum Codes

Triorthogonal codes are quantum Calderbank–Shor–Steane (CSS) codes defined by a binary matrix whose rows obey simultaneous pairwise and triplewise even-overlap constraints. In the binary setting, these constraints are imposed on the supports of generator rows, and they underlie several of the best-known constructions for transversal non-Clifford logical gates, especially in magic-state distillation and related fault-tolerant protocols [1209.2426][1304.3709][2408.02916]. Subsequent work has connected triorthogonal matrices to CSS-\(T\) codes, characterized their equivalence classes and extremal structure, developed constructive and classification methods, and extended the framework to decoding and to non-binary qudit settings [2408.02916][2605.24519].

## 1. Definition and structural identities

Let \(T\in\mathbb F_2^{m\times n}\) have row vectors \(r_1,\dots,r_m\in\mathbb F_2^n\). The matrix is *triorthogonal* when, for all distinct pairs and triples of rows,
\[
|r_i\star r_j| \equiv 0 \pmod 2,
\qquad
|r_i\star r_j\star r_k| \equiv 0 \pmod 2,
\]
where \(\star\) denotes the Schur product and \(|\cdot|\) denotes Hamming weight modulo \(2\) [2408.02916]. Equivalent formulations in the literature describe the same condition as every pair of rows overlapping in an even number of coordinates and every triple of rows also overlapping in an even number of coordinates [1209.2426][2211.00777].

A standard decomposition separates odd-weight and even-weight rows. If the top \(k_1\) rows are odd and the bottom \(k_0\) rows are even, so that \(T=[G_1;G_0]\), then one has
\[
T\,T^\top=
\begin{pmatrix}
I_{k_1} & 0\\
0 & 0
\end{pmatrix},
\]
which is a useful normal-form identity for binary triorthogonal matrices [2408.02916]. In the CSS interpretation, the even-weight rows become \(X\)-type stabilizer generators, while the odd-weight rows correspond to logical \(X\) operators [2211.00777][1209.2426].

This binary definition is the core combinatorial object. Many later results amount to determining which linear codes admit such a generating matrix, how these matrices behave under equivalence and puncturing, and which logical gates their associated CSS codes support.

## 2. CSS and CSS-\(T\) formulations

If \(G\in\mathbb F_2^{(k_1+k_0)\times n}\) is triorthogonal and \(C=\mathrm{Rowsp}(G)\), then
\[
C^{\star 2}\subseteq C+C^\perp,
\]
and the hull
\[
\mathrm{Hull}(C)=C\cap C^\perp
\]
is exactly \(\mathrm{Span}(G_0)\) [2408.02916]. This identifies triorthogonal codes as a special subclass of CSS-\(T\) constructions. In particular, the CSS pair
\[
(C_1,C_2)=(C,\mathrm{Hull}(C))
\]
satisfies the CSS-\(T\) condition
\[
C_2\subseteq (C_1^{\star 2})^\perp\cap C_1,
\]
and therefore yields an \([[n,k_1,\ge d_Z]]\) quantum code with \(k_1=\dim C-\dim\mathrm{Hull}(C)\) and \(d_Z\ge d(C+C^\perp)\) [2408.02916].

This formulation makes the odd/even row split intrinsic rather than basis-dependent. A key structural consequence is that a binary triorthogonal matrix determines the parameters of the corresponding triorthogonal quantum code uniquely: if \(G\) and \(MG\) are equivalent and both triorthogonal, then they give rise to the same \([[n,k_1,d]]\) parameters [2408.02916]. More precisely, \(MG\) is triorthogonal if and only if
\[
M=
\begin{pmatrix}
P & *\\
0 & M_4
\end{pmatrix},
\]
where \(P\) is a permutation matrix on the odd-weight rows, \(M_4\) is invertible on the even-weight rows, and \(*\) is arbitrary [2408.02916]. Thus equivalent triorthogonal generator matrices differ only by permuting odd rows, mixing in \(\mathrm{Hull}(C)\), or changing the basis of \(\mathrm{Hull}(C)\).

The same paper introduces a partial order on triorthogonal codes,
\[
C\le C' \iff C\subseteq C' \text{ and } \mathrm{Hull}(C)\subseteq \mathrm{Hull}(C'),
\]
and characterizes extremal elements in this CSS-\(T\) poset. A code is minimal if and only if it is one-dimensional and even, so \(\mathrm{Hull}(C)=C\); it is maximal if and only if
\[
(C^{\star 2})^\perp=\mathrm{Hull}(C)
\]
[2408.02916]. These results make precise when a triorthogonal code can no longer be reduced or enlarged without leaving the triorthogonal class.

## 3. Transversal gates and logical action

Triorthogonal codes were introduced in connection with magic-state distillation, where the central operational property is a transversal realization of non-Clifford gates [1209.2426]. In the Bravyi–Haah construction, any triorthogonal matrix gives a stabilizer code for which there exists a diagonal Clifford \(U\), composed only of \(\Lambda(Z)\) and \(S\) gates, such that
\[
U\,T^{\otimes n}
\]
acts as a logical \(T\) on all encoded qubits simultaneously [1209.2426]. Later formulations state the same operational fact as a transversal \(T\) followed by prescribed Clifford fixups, typically single-qubit \(S\) and two-qubit \(\mathrm{CZ}\) corrections [2408.12752].

The logical action can be sharper under additional conditions. In the CSS framework \(C_2\subset C_1\), a full generator matrix of \(C_1\) realizes physical transversal \(T^{\otimes n}\) as logical \(T^{\otimes k}\) without further Clifford correction if and only if the matrix is triorthogonal and an additional Hamming-weight condition modulo \(8\) holds:
\[
w_H(x\oplus a)\equiv w_H(c)\pmod 8
\]
for the appropriate logical representative \(x\), stabilizer element \(a\in C_2\), and logical bit pattern \(c\in\mathbb F_2^k\) [2001.04887][1910.09333]. The same line of work proves that triorthogonal codes are, essentially, the most general CSS codes that realize logical transversal \(T\) via physical transversal \(T\) [1910.09333][2001.04887].

A second major gate-theoretic property is transversal \(\mathrm{CCZ}\). Any triorthogonal code admits
\[
\mathrm{CCZ}^{\otimes n}
\]
as a logical \(\mathrm{CCZ}\) on three encoded blocks, because the triple-overlap condition cancels all unwanted phase terms except the logical cubic phase [1304.3709]. Together with transversal Hadamard plus fault-tolerant error correction, this yields a universal distillation-free gate set [1304.3709]. More recently, for \(T\)-triorthogonal CSS codes \(Q^T\), parallel physical \(\mathrm{CZ}\) gates between corresponding qubits of two blocks were shown to implement logical \(\mathrm{CZ}\), and this property was used to construct lower-overhead logical \(H\) gadgets and teleportation protocols between a triorthogonal code and a companion symmetric CSS code [2510.05708].

The gate-theoretic picture therefore has two layers: triorthogonality guarantees level-3 Clifford-hierarchy structure, while additional constraints determine whether the implementation is exact, corrected by a Clifford, or embedded into a larger code-switching architecture.

## 4. Construction methods and propagation rules

Several distinct construction paradigms are now known. The earliest systematic family is the Bravyi–Haah \([[3k+8,k,2]]\) family, which exists for every even \(k\) and gives encoding rate \(k/(3k+8)\approx 1/3\) [1304.3709][1209.2426]. The same work introduced a numerical search method based on column types and linear equations over \(\mathbb F_2\), yielding, among other examples, a distance-5 \([[49,1,5]]\) code [1209.2426].

A more algebraic route starts from binary self-dual codes. An algorithm in "Triorthogonal Codes and Self-dual Codes" constructs a maximal triorthogonal subspace \(H\subseteq C\) inside a self-dual \([2k,k]\) code \(C\) by iteratively adding codewords that satisfy pairwise orthogonality and triplewise orthogonality with the current generating set [2408.09685]. That paper also generalizes classical shortening and extending to the triorthogonal setting. Shortening on a coordinate preserves triorthogonality, and extending by prepending a standard basis column \(e_i\) likewise preserves triorthogonality [2408.09685]. Additional propagation rules include direct concatenation, block-diagonal direct sum, Plotkin-style sums, and a building-up construction by a single extra row [2408.09685].

The CSS-\(T\) viewpoint yields another propagation rule. If \(C\) is triorthogonal and \(v\in (C^{\star 2})^\perp\), then
\[
C' = C+\langle v\rangle
\]
is again triorthogonal [2408.02916]. If \(v\) has odd weight, the associated quantum code gains one logical qubit, producing parameters \([[n,k_1+1,d]]\); if \(v\) has even weight, the logical dimension is unchanged, but the distance bound \(d(C'+C'^\perp)\) may improve [2408.02916].

A third construction framework is optimization-based. "On Constructing and Decoding Quantum Triorthogonal Codes" formulates the search for even-weight triorthogonal generator matrices with prescribed dual distance as an integer linear program combining triorthogonality constraints, MacWilliams identities, and Krawtchouk-polynomial conditions [2605.24519]. For odd \(n\le 80\), dual distance \(d=3\), and \(k_0=6,\dots,10\), this approach finds nontrivial \(\llbracket n,1,3\rrbracket\) codes at lengths
\[
39, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79,
\]
with some marked as triply-even and others explicitly not necessarily generated by classical triply-even codes [2605.24519].

## 5. Representative families, examples, and finite-length classification

The finite-length landscape is anchored by a small set of canonical examples. The \([[15,1,3]]\) punctured Reed–Muller code is the first standard nontrivial case and remains the prototypical triorthogonal \(T\)-code [1209.2426][2408.12752]. The \([[49,1,5]]\) code can be viewed as a doubling of the \([[17,1,5]]\) self-dual color code and the \([[15,1,3]]\) Reed–Muller code, and the \([[95,1,7]]\) code is obtained by doubling the \([[23,1,7]]\) Golay code with the \([[49,1,5]]\) triorthogonal code [2307.14425].

| Code | Construction | Role noted in the literature |
|---|---|---|
| \([[15,1,3]]\) | punctured Reed–Muller | standard small triorthogonal \(T\)-code |
| \([[49,1,5]]\) | doubling \([[17,1,5]]\) and \([[15,1,3]]\) | crucial ingredient in Golay conversion |
| \([[95,1,7]]\) | doubling \([[23,1,7]]\) and \([[49,1,5]]\) | transversal \(T\) and code-conversion target |

For the doubling construction, the distance formula is explicit. The \([[49,1,5]]\) code satisfies
\[
d_{49}=\min(d_{17},d_3+2)=\min(5,3+2)=5,
\]
and the \([[95,1,7]]\) code satisfies
\[
d_{95}=\min(7,5+2)=7
\]
[2307.14425]. These are not isolated examples: a 2024 compilation lists triorthogonal \([[n,1,d]]\) codes for odd distances \(d\le 31\) with lengths
\[
15,49,95,185,279,417,575,777,983,1317,1651,2033,2415,2813,3211,
\]
and states, to the authors’ knowledge, that these are the smallest known triorthogonal codes for their respective distances [2408.12752]. In that family the qubit overhead scales as \(n\sim O(d^2)\), and the stabilizer generator weights scale roughly as \(\sqrt n\) [2408.12752].

At very small sizes, the classification problem is essentially complete. There are exactly \(38\) distinguished triorthogonal subspaces with \(n+k\le 38\), and every triorthogonal code in that range descends from one of them through puncturing and deleting qubits [2107.09684]. This classification is phrased in terms of Reed–Muller indicator polynomials and provides a finite-length taxonomy of all small examples [2107.09684].

A useful caution appears already in the smallest worked examples. For the \(n=5\) matrix with three odd rows and no even rows,
\[
G_1=
\begin{pmatrix}
1&0&0&1&1\\
0&1&0&1&1\\
0&0&1&1&1
\end{pmatrix},
\]
the formal CSS-\(T\) lower bound gives \([[5,3,\ge d(C+C^\perp)]]=[[5,3,\ge 5]]_2\), but in fact \(C^\perp=\mathrm{span}\{1^5\}\) and \(C+C^\perp=\mathbb F_2^5\) has distance \(1\) [2408.02916]. This clarifies a recurring point: formal lower bounds arising from the hull construction need not coincide with the true \(Z\)-distance.

## 6. Decoding, applications, limitations, and non-binary extensions

Triorthogonal codes are the workhorse for low-overhead magic-state distillation because their pairwise and triplewise even-overlap structure guarantees that a transversal \(T\)-gate on physical qubits implements a logical \(T\) on the distilled subspace [2605.24519]. In the original Bravyi–Haah framework, recursive distillation based on an \([[n,k,d]]\) triorthogonal code gives overhead
\[
O\!\bigl(\log^\gamma(1/\epsilon)\bigr),
\qquad
\gamma=\frac{\log(n/k)}{\log d},
\]
and the \([[3k+8,k,2]]\) family approaches \(\gamma\to \log_2 3\approx 1.58\) [1209.2426]. Generalized triorthogonal constructions later pushed asymptotic distillation efficiency toward \(\gamma\to 1\) [1709.02832].

On the decoding side, recent work evaluates high-distance triorthogonal codes over the dephasing channel using bounded-distance decoding, belief propagation plus ordered-statistics post-processing, and an adapted GRAND decoder [2605.24519]. For the \(\llbracket49,1,5\rrbracket\) and \(\llbracket95,1,7\rrbracket\) codes, qGRAND with large query budget is reported as slightly better at low \(p\) than the best BP+OSD variants on the \(\llbracket49,1,5\rrbracket\) code, and competitive or better on the denser \(\llbracket95,1,7\rrbracket\) code; the paper concludes that the GRAND-based decoder is a promising option [2605.24519].

Triorthogonal codes also appear in code-conversion architectures. The \([[23,1,7]]\) Golay code can be fault-tolerantly converted to a \([[95,1,7]]\) triorthogonal code with a transversal \(T\) gate, using only transversal Clifford operations, single-qubit measurements, and an ancilla construction based on the \([[49,1,5]]\) code [2307.14425]. A different universal-computation route pairs a triorthogonal code with a symmetric CSS code so that \(T\) and \(\mathrm{CZ}\) are transversal in the triorthogonal block while Clifford gates are transversal in the symmetric block, with logical teleportation between the two [2510.05708].

In secure multi-party quantum computation, triorthogonal CSS codes broaden the set of feasible node counts relative to triply-even codes. Reported examples include \(\llbracket23,1,3\rrbracket\), \(\llbracket27,1,3\rrbracket\), and \(\llbracket37,1,3\rrbracket\), whereas the small triply-even examples are \(\llbracket15,1,3\rrbracket\) and \(\llbracket49,1,5\rrbracket\) [2211.00777]. This supports the narrower but important distinction that triply-even codes form a subclass of triorthogonal codes, while triorthogonality permits additional small-length instances [2211.00777][2605.24519].

Several limitations recur across the literature. Known binary triorthogonal codes often have relatively low distance, frequently \(d=2\) or \(3\), and \(k\) is often small, commonly \(k=1\) [1304.3709][2211.00777]. Logical Hadamard is generally not transversal in a single triorthogonal code and must be supplied by error correction, teleportation, or code switching [1304.3709][2211.00777][2510.05708]. These constraints motivate current work on higher-distance constructions, better decoding, and hybrid architectures.

The framework has also been generalized beyond binary qubits. For qutrits, there is a family of \([[9m-k,k,2]]_3\) triorthogonal codes with
\[
\gamma=\log_2\!\Bigl(2+\frac{6}{3m-2}\Bigr),
\]
which tends to \(1\) as \(m\to\infty\); the \([[20,7,2]]_3\) example has \(\gamma\approx 1.51\) [2403.06228]. Over \(\mathbb F_{2^{2m}}\), asymptotically good triorthogonal codes with transversal \(\mathrm{CCZ}\) have been constructed, including a \([[42,14,6]]_{64}\) example [2512.21874]. For all prime dimensions, punctured Reed–Muller constructions yield sublogarithmic overhead, and a \([[519,106,5]]_5\) code with \(\gamma=0.99\) is explicitly reported [2510.10852]. These non-binary results suggest that triorthogonality is not merely a qubit-specific device but a broader coding-theoretic mechanism for transversal level-3 Clifford-hierarchy gates.

Source: https://www.emergentmind.com/topics/triorthogonal-codes