Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

arXiv:2209.01449 · Quantum

Counting stabiliser codes for arbitrary dimension

Tanmay Singal, Che Chiang, Eugene Hsu, Eunsang Kim, Hsi‐Sheng Goan, Min-Hsiu Hsieh

Published Jul 6, 2023• 5 citations
arXivHTMLPDF

Abstract

In this work, we compute the number of [[n,k]]d stabilizer codes made up of d -dimensional qudits, for arbitrary positive integers d . In a seminal work by Gross \cite{Gross2006} the number of [[n,k]]d stabilizer codes was computed for the case when d is a prime (or the power of a prime, i.e., d=pm , but when the qudits are Galois-qudits). The proof in \cite{Gross2006} is inapplicable to the non-prime case. For our proof, we introduce a group structure to [[n,k]]d codes, and use this in conjunction with the Chinese remainder theorem to count the number of [[n,k]]d codes. Our work overlaps with \cite{Gross2006} when d is a prime and in this case our results match exactly, but the results differ for the more generic case. Despite that, the overall order of magnitude of the number of stabilizer codes scales agnostic of whether the dimension is prime or non-prime. This is surprising since the method employed to count the number of stabilizer states (or more generally stabilizer codes) depends on whether d is prime or not. The cardinality of stabilizer states, which was so far known only for the prime-dimensional case (and the Galois qudit prime-power dimensional case) plays an important role as a quantifier in many topics in quantum computing. Salient among these are the resource theory of magic, design theory, de Finetti theorem for stabilizer states, the study and optimisation of the classical simulability of Clifford circuits, the study of quantum contextuality of small-dimensional systems and the study of Wigner-functions. Our work makes available this quantifier for the generic case, and thus is an important step needed to place results for quantum computing with non-prime dimensional quantum systems on the same pedestal as prime-dimensional systems.

DOI
10.22331/q-2023-07-06-1048

Related papers

A Review of Galois Qudits

Adam Wills

Galois qudits are $q$-dimensional quantum systems whose choice of Pauli group encodes the arithmetic of some finite field $\mathbb{F}_q$. They differ from the more familiar modular qudit, which are the same quantum system but whose choice of Pauli group are the clock and shift operators, which encode the arithmetic of integer addition and multiplication modulo $q$. Galois qudits are a useful mathematical construct that allow us to leverage the mathematical tools that are native to the larger qudit while only physically building smaller qudits. In particular, a Galois qudit of dimension $q = 2^s$ is exactly the same thing as a collection of $s$ qubits, not only in its Hilbert space, but also in its Pauli group, and Clifford hierarchy. This formalism has found a lot of utility recently in constructing quantum error-correcting codes over qubits with useful properties. In this review, we build on existing literature to collect and formalise facts and proofs about Galois qudits over binary extension fields. We define them and their Clifford hierarchies, describe what it means to measure their Pauli operators, describe their stabiliser tableaux, formally define qudit-to-qubit mappings, and finally describe quantum Reed-Solomon codes.

quant-pharXiv:2605.18981•May 20, 2026•0 citations

Classification of translation invariant topological Pauli stabilizer codes for prime dimensional qudits on two-dimensional lattices

Jeongwan Haah

We prove that on any two-dimensional lattice of qudits of a prime dimension, every translation invariant Pauli stabilizer group with local generators and with the code distance being the linear system size is decomposed by a local Clifford circuit of constant depth into a finite number of copies of the toric code stabilizer group (Abelian discrete gauge theory). This means that under local Clifford circuits, the number of toric code copies is the complete invariant of topological Pauli stabilizer codes. Previously, the same conclusion was obtained under the assumption of nonchirality for qubit codes or the Calderbank–Shor–Steane structure for prime qudit codes; we do not assume any of these.

arXiv:1812.11193•Journal of Mathematical Physics•Jan 1, 2021•35 citations

Clifford orbits and stabilizer states

Lingxuan Feng, Shunlong Luo

Abstract Stabilizer states serve as ‘classical objects’ in the stabilizer formalism of quantum theory, and play an important role in quantum error correction, fault-tolerant quantum computation, and quantum communication. They provide an efficient description of many basic features of quantum theory and exhibit a rich structure. For prime dimensional systems, they may be defined by two quite different yet equivalent ways: The first is via stabilizer groups (maximal Abelian subgroups of the discrete Heisenberg–Weyl group). The second is via the orbits of the Clifford group acting on any computational basis state. However, in a general dimensional system, this equivalence breaks down, and consequently, it is desirable to clarify the difference and relation between the above two approaches to stabilizer states. In this work, we show that these two approaches are equivalent if and only if the system dimension is square-free (i.e. has no square factor). Furthermore, we completely reveal the relation between the Clifford orbits and stabilizer states in an arbitrary dimensional system, derive the explicit expressions of the Clifford orbits and determine their cardinalities.

Journal of Physics A Mathematical and Theoretical•Sep 3, 2024•6 citations

Singer-Difference-Set Qudit Stabilizer Codes From Non-Degenerate Quadrics in PG( d , q ): Construction, Structural Theorems, and Monte-Carlo Performance

Michel Kulhandjian, Lajos Hanzo

We propose $\mathcal {Q}(q,d)$ , a new family of $\mathbb {F}_{q}$ -ary non-CSS qudit stabilizer codes parameterised by a prime power $q$ and dimension $d\ge 2$ , constructed from Singer difference sets and non-degenerate quadrics in the projective geometry $\mathop {\mathrm {PG}}\nolimits (d,q)$ . The parity-check matrix $H {\,}\text {=}{\,}(A\mid M_{Q}A)$ couples the Singer-circulant point-hyperplane incidence matrix $A$ with the formal trace-of-square quadric circulant $M_{Q}$ , and a Cancellation Lemma exploits the design-theoretic identity $(k-\lambda){\,}\text {=}{\,}q^{d-1}\equiv 0\pmod p$ to make $H$ symplectic-isotropic over $\mathbb {F}_{q}$ for every $(q,d)$ . The novelty of the construction is concentrated in five original structural theorems: (i) an unconditional cross-correlation modular-constancy theorem $\nu \equiv 1\pmod q$ at $q$ odd, $d\ge 3$ with a sharp two-value pattern $V_{2}-V_{1}{\,}\text {=}{\,}q^{(d-1)/2}$ , proving a 2-torsion distance ceiling; (ii) a Chinese-Remainder-Theorem (CRT) zero-count theorem $\#\{f:\tau _{H,f}{\,}\text {=}{\,}0\}{\,}\text {=}{\,}(|\mathcal {F}|-1)/2$ ; (iii) an explicit Clifford bridge $U_{M}{\,}\text {=}{\,}H^{\otimes n}{\,}\mathrm {CZ}^{(M)}{\,}H^{\otimes n}$ that identifies $\mathcal {Q}(q,2)$ as Clifford-equivalent to a graph-state encoding of the trivial Singer CSS code, with the classical 2021 low-density-spreading (LDS) sign-flip pattern realised by the symmetric circulant $M$ ; (iv) a paired column-rigidity equality $d_{\min }{\,}\text {=}{\,}R_{P}+1$ exactly; and (v) a rigorous lower bound $d_{\min }(\mathcal {Q}(7,2))\ge 8$ from an exhaustive Singer-Frobenius search. Via a Hamada-Smith specialisation we obtain the closed-form logical dimension $k(p,d){\,}\text {=}{\,}\theta _{d}(p)-\binom {p+d-1}{d}-1$ , with the flagship $d{\,}\text {=}{\,}2$ family $\mathcal {Q}(p,2){\,}\text {=}{\,}[[p^{2}+p+1,{\,}p(p+1)/2,{\,}d_{\min }]]_{p}$ attaining asymptotic rate $\tfrac {1}{2}$ . For general odd primes $p\ge 3$ the flagship distance is conjectured to satisfy $d_{\min }(\mathcal {Q}(p,2)){\,}\text {=}{\,}p+1$ ; this conjecture is analytically proven exact at $p{\,}\text {=}{\,}5$ and exhaustively lower-bounded to $d_{\min }\ge 8$ at $p{\,}\text {=}{\,}7$ , and remains open for general $p$ . Concrete instances include $\mathcal {Q}(3,2){\,}\text {=}{\,}[[{13,6,3}]]_{3}$ , $\mathcal {Q}(5,2){\,}\text {=}{\,}[[{31,15,6}]]_{5}$ (double-error correcting), $\mathcal {Q}(7,2){\,}\text {=}{\,}[[57,28,d{\ge }8]]_{7}$ , and $\mathcal {Q}(3,4){\,}\text {=}{\,}[[{121,105,3}]]_{3}$ . Monte-Carlo simulations over $1.5{\times }10^{6}$ trials show that $\mathcal {Q}(5,2)$ achieves a $\sim 70\times $ per-logical-qudit improvement over Steane $[[{7,1,3}]]_{2}$ at depolarising rate $p_{\mathrm {ch}}{\,}\text {=}{\,}10^{-3}$ with zero silent logical errors (the “erase-don’t-mistake” property). We use a textbook bounded-distance decoder throughout, leaving Berlekamp-Massey-style cyclic decoding exploiting the Singer-circulant structure as the natural sequel. A fifteen-row axis-by-axis comparison against the closest prior constructions establishes that the Singer-difference-set + quadric-Gram-matrix combination, together with the closed-form $k$ , the cross-correlation and CRT zero-count theorems, the explicit Clifford bridge to the 2021 LDS construction, and the proven 2-torsion ceiling, is new.

IEEE Open Journal of the Communications Society•Jan 1, 2026•0 citations

Clifford-hierarchy stabilizer formalism with applications to twisted quantum doubles

Christopher Fechisin, Kieran Cooney, Mathi Raja +4 more

Recent work has shown that quantum double models can be used to circumvent the Bravyi-Koenig bound. In particular, this is achieved through code-switching protocols in which non-Pauli stabilizer phases appear as intermediate codes. We introduce the $X\mathcal C^{(k)}_d$ stabilizer formalism, which generalizes the Pauli stabilizer formalism by combining Pauli-$X$ operators with diagonal operators drawn from a fixed level $k$ of the Clifford hierarchy on prime-dimensional qudits. This yields a natural class of beyond-Pauli stabilizer models, including many twisted quantum double phases. We classify a large class of these $X\mathcal C^{(k)}_d$ stabilizer states, showing that they are uniform superpositions over affine-linear subspaces with diagonal phases. In particular, when the stabilizers of a state require operators from level $k$ of the Clifford hierarchy, we show that the diagonal gates required to produce the phases in the wavefunction sit one level higher. We further show that every 2D twisted quantum double ${\cal D}^ω(\mathbb{Z}_p^n)$ with $ω$ a product of type-III cocycles and $p$ an odd prime admits a realization using only Clifford ($k=2$) stabilizers, and we conjecture that phases where $ω$ contains a type-I or type-II cocycle require level-$p$ Clifford-hierarchy stabilizers for $p$-dimensional qudits. Finally, we demonstrate that a pair of qudit toric codes may be deterministically prepared in a logical magic state by measuring $X\mathcal C^{(k)}_d$ stabilizers. Together, these results provide a concrete stabilizer framework for topological codes beyond Pauli stabilizer models and their logical gates.

quant-pharXiv:2610.00464•Oct 2, 2026•0 citations

Quantifying Nonstabilizerness of Quantum Codes by Removing the Inert Background

Yuan Liu, Ke-Mi Xu

Nonstabilizerness (magic) is the quantum resource that, together with stabilizer operations, makes universal quantum computation possible. However, quantifying nonstabilizerness is difficult. The standard measure sums over exponentially many Pauli operators, and for quantum codes no quantitative theory has been available. A structural observation removes this obstacle: the Clifford sector carries no magic and can be removed by a Clifford transformation, leaving an order-three object whose magic is an exactly evaluable fourth moment. Removing this inert background yields closed forms for several code families: a formula for all Dicke states, reducing a 100-qubit case from $4^{100}$ terms to a short binomial sum; a bound for cubic-phase codes (twisted quantum doubles and non-Abelian topological order), saturated only by the $D_4$ code; and a cyclic/zero criterion for group multiplication states. For codeword-stabilized (CWS) codes, the companion paper \cite{Liu26arXiv} carries this reduction to its conclusion: the most magical codes are exactly the Sidon sets, and the nonstabilizerness bounds the code's transversal non-Clifford power. Together these results reduce the computation of nonstabilizerness for a broad class of codes to finite classical counting problems, and identify the maximally magical codes among them.

quant-pharXiv:2609.06177•Sep 8, 2026•0 citations
In this work, we compute the number of [[n,k]]d stabilizer codes made up of d -dimensional qudits, for arbitrary positive integers d . In a seminal work by Gross \cite{Gross2006} the number of [[n,k]]d stabilizer codes was computed for the case when d is a prime (or the power of a prime, i.e., d=pm , but when the qudits are Galois-qudits). The proof in \cite{Gross2006} is inapplicable to the non-prime case. For our proof, we introduce a group structure to [[n,k]]d codes, and use this in conjunction with the Chinese remainder theorem to count the number of [[n,k]]d codes. Our work overlaps with \cite{Gross2006} when d is a prime and in this case our results match exactly, but the results differ for the more generic case. Despite that, the overall order of magnitude of the number of stabilizer codes scales agnostic of whether the dimension is prime or non-prime. This is surprising since the method employed to count the number of stabilizer states (or more generally stabilizer codes) depends on whether d is prime or not. The cardinality of stabilizer states, which was so far known only for the prime-dimensional case (and the Galois qudit prime-power dimensional case) plays an important role as a quantifier in many topics in quantum computing. Salient among these are the resource theory of magic, design theory, de Finetti theorem for stabilizer states, the study and optimisation of the classical simulability of Clifford circuits, the study of quantum contextuality of small-dimensional systems and the study of Wigner-functions. Our work makes available this quantifier for the generic case, and thus is an important step needed to place results for quantum computing with non-prime dimensional quantum systems on the same pedestal as prime-dimensional systems.
Galois qudits are qqq-dimensional quantum systems whose choice of Pauli group encodes the arithmetic of some finite field Fq\mathbb{F}_qFq​. They differ from the more familiar modular qudit, which are the same quantum system but whose choice of Pauli group are the clock and shift operators, which encode the arithmetic of integer addition and multiplication modulo qqq. Galois qudits are a useful mathematical construct that allow us to leverage the mathematical tools that are native to the larger qudit while only physically building smaller qudits. In particular, a Galois qudit of dimension q=2sq = 2^sq=2s is exactly the same thing as a collection of sss qubits, not only in its Hilbert space, but also in its Pauli group, and Clifford hierarchy. This formalism has found a lot of utility recently in constructing quantum error-correcting codes over qubits with useful properties. In this review, we build on existing literature to collect and formalise facts and proofs about Galois qudits over binary extension fields. We define them and their Clifford hierarchies, describe what it means to measure their Pauli operators, describe their stabiliser tableaux, formally define qudit-to-qubit mappings, and finally describe quantum Reed-Solomon codes.
We prove that on any two-dimensional lattice of qudits of a prime dimension, every translation invariant Pauli stabilizer group with local generators and with the code distance being the linear system size is decomposed by a local Clifford circuit of constant depth into a finite number of copies of the toric code stabilizer group (Abelian discrete gauge theory). This means that under local Clifford circuits, the number of toric code copies is the complete invariant of topological Pauli stabilizer codes. Previously, the same conclusion was obtained under the assumption of nonchirality for qubit codes or the Calderbank–Shor–Steane structure for prime qudit codes; we do not assume any of these.
Abstract Stabilizer states serve as ‘classical objects’ in the stabilizer formalism of quantum theory, and play an important role in quantum error correction, fault-tolerant quantum computation, and quantum communication. They provide an efficient description of many basic features of quantum theory and exhibit a rich structure. For prime dimensional systems, they may be defined by two quite different yet equivalent ways: The first is via stabilizer groups (maximal Abelian subgroups of the discrete Heisenberg–Weyl group). The second is via the orbits of the Clifford group acting on any computational basis state. However, in a general dimensional system, this equivalence breaks down, and consequently, it is desirable to clarify the difference and relation between the above two approaches to stabilizer states. In this work, we show that these two approaches are equivalent if and only if the system dimension is square-free (i.e. has no square factor). Furthermore, we completely reveal the relation between the Clifford orbits and stabilizer states in an arbitrary dimensional system, derive the explicit expressions of the Clifford orbits and determine their cardinalities.
We propose Q(q,d)\mathcal {Q}(q,d)Q(q,d) , a new family of Fq\mathbb {F}_{q}Fq​ -ary non-CSS qudit stabilizer codes parameterised by a prime power qqq and dimension d≥2d\ge 2d≥2 , constructed from Singer difference sets and non-degenerate quadrics in the projective geometry PG(d,q)\mathop {\mathrm {PG}}\nolimits (d,q)PG(d,q) . The parity-check matrix H = (A∣MQA)H {\,}\text {=}{\,}(A\mid M_{Q}A)H=(A∣MQ​A) couples the Singer-circulant point-hyperplane incidence matrix AAA with the formal trace-of-square quadric circulant MQM_{Q}MQ​ , and a Cancellation Lemma exploits the design-theoretic identity (k−λ) = qd−1≡0(modp)(k-\lambda){\,}\text {=}{\,}q^{d-1}\equiv 0\pmod p(k−λ)=qd−1≡0(modp) to make HHH symplectic-isotropic over Fq\mathbb {F}_{q}Fq​ for every (q,d)(q,d)(q,d) . The novelty of the construction is concentrated in five original structural theorems: (i) an unconditional cross-correlation modular-constancy theorem ν≡1(modq)\nu \equiv 1\pmod qν≡1(modq) at qqq odd, d≥3d\ge 3d≥3 with a sharp two-value pattern V2−V1 = q(d−1)/2V_{2}-V_{1}{\,}\text {=}{\,}q^{(d-1)/2}V2​−V1​=q(d−1)/2 , proving a 2-torsion distance ceiling; (ii) a Chinese-Remainder-Theorem (CRT) zero-count theorem #{f:τH,f = 0} = (∣F∣−1)/2\#\{f:\tau _{H,f}{\,}\text {=}{\,}0\}{\,}\text {=}{\,}(|\mathcal {F}|-1)/2#{f:τH,f​=0}=(∣F∣−1)/2 ; (iii) an explicit Clifford bridge UM = H⊗n CZ(M) H⊗nU_{M}{\,}\text {=}{\,}H^{\otimes n}{\,}\mathrm {CZ}^{(M)}{\,}H^{\otimes n}UM​=H⊗nCZ(M)H⊗n that identifies Q(q,2)\mathcal {Q}(q,2)Q(q,2) as Clifford-equivalent to a graph-state encoding of the trivial Singer CSS code, with the classical 2021 low-density-spreading (LDS) sign-flip pattern realised by the symmetric circulant MMM ; (iv) a paired column-rigidity equality dmin⁡ = RP+1d_{\min }{\,}\text {=}{\,}R_{P}+1dmin​=RP​+1 exactly; and (v) a rigorous lower bound dmin⁡(Q(7,2))≥8d_{\min }(\mathcal {Q}(7,2))\ge 8dmin​(Q(7,2))≥8 from an exhaustive Singer-Frobenius search. Via a Hamada-Smith specialisation we obtain the closed-form logical dimension k(p,d) = θd(p)−(p+d−1d)−1k(p,d){\,}\text {=}{\,}\theta _{d}(p)-\binom {p+d-1}{d}-1k(p,d)=θd​(p)−(dp+d−1​)−1 , with the flagship d = 2d{\,}\text {=}{\,}2d=2 family Q(p,2) = [[p2+p+1, p(p+1)/2, dmin⁡]]p\mathcal {Q}(p,2){\,}\text {=}{\,}[[p^{2}+p+1,{\,}p(p+1)/2,{\,}d_{\min }]]_{p}Q(p,2)=[[p2+p+1,p(p+1)/2,dmin​]]p​ attaining asymptotic rate 12\tfrac {1}{2}21​ . For general odd primes p≥3p\ge 3p≥3 the flagship distance is conjectured to satisfy dmin⁡(Q(p,2)) = p+1d_{\min }(\mathcal {Q}(p,2)){\,}\text {=}{\,}p+1dmin​(Q(p,2))=p+1 ; this conjecture is analytically proven exact at p = 5p{\,}\text {=}{\,}5p=5 and exhaustively lower-bounded to dmin⁡≥8d_{\min }\ge 8dmin​≥8 at p = 7p{\,}\text {=}{\,}7p=7 , and remains open for general ppp . Concrete instances include Q(3,2) = [[13,6,3]]3\mathcal {Q}(3,2){\,}\text {=}{\,}[[{13,6,3}]]_{3}Q(3,2)=[[13,6,3]]3​ , Q(5,2) = [[31,15,6]]5\mathcal {Q}(5,2){\,}\text {=}{\,}[[{31,15,6}]]_{5}Q(5,2)=[[31,15,6]]5​ (double-error correcting), Q(7,2) = [[57,28,d≥8]]7\mathcal {Q}(7,2){\,}\text {=}{\,}[[57,28,d{\ge }8]]_{7}Q(7,2)=[[57,28,d≥8]]7​ , and Q(3,4) = [[121,105,3]]3\mathcal {Q}(3,4){\,}\text {=}{\,}[[{121,105,3}]]_{3}Q(3,4)=[[121,105,3]]3​ . Monte-Carlo simulations over 1.5×1061.5{\times }10^{6}1.5×106 trials show that Q(5,2)\mathcal {Q}(5,2)Q(5,2) achieves a $\sim 70\times $ per-logical-qudit improvement over Steane [[7,1,3]]2[[{7,1,3}]]_{2}[[7,1,3]]2​ at depolarising rate pch = 10−3p_{\mathrm {ch}}{\,}\text {=}{\,}10^{-3}pch​=10−3 with zero silent logical errors (the “erase-don’t-mistake” property). We use a textbook bounded-distance decoder throughout, leaving Berlekamp-Massey-style cyclic decoding exploiting the Singer-circulant structure as the natural sequel. A fifteen-row axis-by-axis comparison against the closest prior constructions establishes that the Singer-difference-set + quadric-Gram-matrix combination, together with the closed-form kkk , the cross-correlation and CRT zero-count theorems, the explicit Clifford bridge to the 2021 LDS construction, and the proven 2-torsion ceiling, is new.
Recent work has shown that quantum double models can be used to circumvent the Bravyi-Koenig bound. In particular, this is achieved through code-switching protocols in which non-Pauli stabilizer phases appear as intermediate codes. We introduce the XCd(k)X\mathcal C^{(k)}_dXCd(k)​ stabilizer formalism, which generalizes the Pauli stabilizer formalism by combining Pauli-XXX operators with diagonal operators drawn from a fixed level kkk of the Clifford hierarchy on prime-dimensional qudits. This yields a natural class of beyond-Pauli stabilizer models, including many twisted quantum double phases. We classify a large class of these XCd(k)X\mathcal C^{(k)}_dXCd(k)​ stabilizer states, showing that they are uniform superpositions over affine-linear subspaces with diagonal phases. In particular, when the stabilizers of a state require operators from level kkk of the Clifford hierarchy, we show that the diagonal gates required to produce the phases in the wavefunction sit one level higher. We further show that every 2D twisted quantum double Dω(Zpn){\cal D}^ω(\mathbb{Z}_p^n)Dω(Zpn​) with ωωω a product of type-III cocycles and ppp an odd prime admits a realization using only Clifford (k=2k=2k=2) stabilizers, and we conjecture that phases where ωωω contains a type-I or type-II cocycle require level-ppp Clifford-hierarchy stabilizers for ppp-dimensional qudits. Finally, we demonstrate that a pair of qudit toric codes may be deterministically prepared in a logical magic state by measuring XCd(k)X\mathcal C^{(k)}_dXCd(k)​ stabilizers. Together, these results provide a concrete stabilizer framework for topological codes beyond Pauli stabilizer models and their logical gates.
Nonstabilizerness (magic) is the quantum resource that, together with stabilizer operations, makes universal quantum computation possible. However, quantifying nonstabilizerness is difficult. The standard measure sums over exponentially many Pauli operators, and for quantum codes no quantitative theory has been available. A structural observation removes this obstacle: the Clifford sector carries no magic and can be removed by a Clifford transformation, leaving an order-three object whose magic is an exactly evaluable fourth moment. Removing this inert background yields closed forms for several code families: a formula for all Dicke states, reducing a 100-qubit case from 41004^{100}4100 terms to a short binomial sum; a bound for cubic-phase codes (twisted quantum doubles and non-Abelian topological order), saturated only by the D4D_4D4​ code; and a cyclic/zero criterion for group multiplication states. For codeword-stabilized (CWS) codes, the companion paper \cite{Liu26arXiv} carries this reduction to its conclusion: the most magical codes are exactly the Sidon sets, and the nonstabilizerness bounds the code's transversal non-Clifford power. Together these results reduce the computation of nonstabilizerness for a broad class of codes to finite classical counting problems, and identify the maximally magical codes among them.