Triorthogonal codes are a basic ingredient in magic-state distillation, as they enable transversal implementation of logical
T gates. As a non-Clifford operation, the
T gate enables universal fault-tolerant quantum computation when combined with Clifford operations. We derive an existence criterion for even-weight triorthogonal generator matrices with a target dual minimum distance. The criterion combines triorthogonality constraints with MacWilliams identities via Krawtchouk-polynomial conditions on the dual weight distribution, yielding an integer linear programming formulation for the construction problem. We find novel nontrivial triorthogonal codes (degenerate and non-degenerate) that are not necessarily constructed from triply even binary linear codes. By imposing automorphism-group constraints, the formulation also recovers the known [[49,1,5]] and [[95,1,7]] triorthogonal codes. We also evaluate the performance of the obtained high-distance triorthogonal codes over the dephasing channel using different decoding methods, showing that automorphism ensemble decoding (AED) and guessing random additive-noise decoding (GRAND) are promising options.
We study cyclic triorthogonal codes in prime dimension
p, on which a transversal third-level diagonal gate acts as a logical non-Clifford gate. For odd
p, we use a definition of triorthogonality that does not require self-orthogonality. For cyclic codes of length coprime to
p, triorthogonality reduces to a sumset condition on the spectral support, which makes exhaustive search feasible: for two natural constructions, we enumerate all maximal codes of this kind for
p=3 up to length
121 and
p=5,7 up to length
96. For qubits, we prove that a cyclic code of odd length is triply even if and only if it is classically triorthogonal, giving a complete description of triply-even cyclic codes, and we determine all such codes up to length
763. For qudits, we find codes such as
[[19,1,3]]3 and
[[7,1,3]]7, which improve on the shortest Reed-Muller and Reed-Solomon codes in both overhead exponent and distillation threshold. The latter is the first member of an infinite family of
[[p,1,2⌊p/6⌋+1]]p codes.