Finite-Field Qudit ZH Calculus
- Qudit ZH calculus is a diagrammatic language that represents quantum processes using finite-field arithmetic with specialized generators like Z-spiders and H-boxes.
- It leverages finite-field semantics over F_q to ensure the multiplicative invertibility of nonzero elements, enabling diagrammatic representations that support division-dependent algorithms.
- The calculus integrates classical reversible logic with quantum operations through Fourier structures and universal synthesis of linear maps, facilitating efficient quantum circuit design.
Qudit ZH calculus is a family of diagrammatic languages for quantum processes in which nonlinear arithmetic on basis labels is represented directly by graphical generators. In its finite-field form, it generalizes the ZH calculus from qubits and prime-dimensional qudits to qudits of prime-power dimension by replacing cyclic ring semantics over with field semantics over . This replacement preserves multiplicative invertibility of nonzero elements, which is operationally significant for algorithms that require division, and yields a universal graphical language for linear maps with entries in , up to normalization factors, where is a primitive th root of unity (Gao, 2024).
1. Historical development and conceptual position
The ZH calculus belongs to the same diagrammatic lineage as the ZX and ZW calculi. ZX is tailored to linear gates and complementary observables, whereas ZH emphasizes classical nonlinearity by introducing H-boxes whose semantics realize multiplication on computational-basis labels. In the qubit setting, Z-spiders copy basis states and H-boxes encode Boolean AND, so Toffoli-like structure becomes diagrammatically simple (Gao, 2024).
The first systematic qudit generalization considered prime dimensions. For prime , the phase-free qudit ZH calculus generalizes the qubit rules, is universal for matrices over up to global factors, and is tightly connected to circuits generated by the two-qudit 0-controlled 1 gate and the 2-dimensional Hadamard 3. In odd prime dimension, the gate set 4 is approximately universal, and phase-free ZH diagrams correspond exactly to postselected circuits over that gate set with ancillas in 5 and postselection onto 6 (Roy et al., 2023).
A different line of development used discrete-integral semantics to define a unified ZXH-calculus for any fixed qudit dimension 7, including composite dimensions. In that approach, qudit ZX and qudit ZH share a scalar-exact semantics based on a discrete measure, with white and gray dots, multicharacter H-boxes, and rewrite systems that remain meaningful even when 8 is composite (Beaudrap et al., 2023).
The finite-field formulation for arbitrary prime powers addresses a specific gap in these earlier approaches. Roy’s prime-dimensional calculus uses the isomorphism 9, but that identification ceases to be available when 0 with 1. Conversely, cyclic-ring approaches over 2 handle arbitrary dimensions but do not implement genuine field arithmetic when 3 is not prime. The finite-field qudit ZH calculus therefore isolates the case in which the computational basis is indexed by 4 itself, rather than by a cyclic ring, and makes the field structure diagrammatically available (Gao, 2024).
2. Finite-field semantics and generators
Fix 5 with 6 prime, choose a primitive element 7 such that 8, and identify the qudit Hilbert space with 9, whose computational basis is 0. Let 1 be a primitive 2th root of unity. The scalar ring is 3, and for normalized H-boxes one adjoins 4 to account for Fourier normalization (Gao, 2024).
In the 2024 finite-field presentation, phases are mediated by an 5-valued symmetric bilinear pairing
6
defined as the dot product of coordinate vectors in the basis 7. With this choice, the basic generators are the Z-spider
8
which copies computational-basis states, and the generalized H-spider
9
where the products are taken in 0. The one-wire case 1 is unitary, and 2 is self-transpose up to exchanging inputs and outputs because the pairing is symmetric (Gao, 2024).
A distinguished state, the 3-lollipop,
4
is included because powers of 5 generate all nonzero field elements when 6 is not prime. The calculus also admits phased H-boxes 7 for labels 8 in a ring 9 containing 0 (Gao, 2024).
A closely related formulation appears in the 2026 characterization via Graphical Algebraic Geometry, where the H-spider is written using the field trace 1: 2 and the special 3 case is the discrete Fourier transform over 4 with entries 5 (Gao et al., 13 May 2026).
The special cases reproduce the expected lower-dimensional calculi. For qubits, 6, 7, and the pairing reduces to the usual mod-8 dot product, so the H-box yields Boolean AND and the X-spider yields XOR. For qutrits, 9 and the calculus recovers addition and multiplication in 0. For 1, taking 2 with 3 exhibits the genuinely non-prime case in which every nonzero element remains invertible even though the dimension is composite (Gao, 2024).
3. Arithmetic encoding, Fourier structure, and rewrite principles
The finite-field qudit ZH calculus is designed so that addition and multiplication arise as small derived diagrams. An X-spider, constructed from Z-spiders and H-spiders, acts as addition on the computational basis. The unary X gadget implements negation,
4
and the binary X gadget implements
5
Likewise, a binary H gadget followed by 6 implements multiplication,
7
while a 8 H gadget followed by 9 yields 0 (Gao, 2024).
The arithmetic Fourier transform underlying these constructions is governed by the orthogonality identity
1
This identity drives many contractions and is the finite-field analogue of the Fourier cancellations familiar from qubit and prime-qudit diagrammatics (Gao, 2024).
A subtlety specific to non-prime prime powers is the failure of flexsymmetry. Over 2 with 3, one does not generally have 4, so H-boxes are not flexsymmetric. The remedy is a canonical dualizer
5
where 6 and 7 is its transpose with respect to the bilinear pairing. This compensates for the asymmetry and gives a controlled replacement for naive wire-bending symmetry (Gao, 2024).
The equational theory includes nine core rewrite rules corresponding to elementary algebra over 8: Z-spider fusion, the identity rule for the 9 Z-spider, the characteristic-0 rule, H-spider fusion, the Frobenius splitting rule 1, copying through the computational basis, two bialgebra-like laws for addition and multiplication, and phase multiplication on Z-spiders. The calculus also supports derived Fourier-copy behavior and scalar gadgets for assembling powers of 2 (Gao, 2024).
For arbitrary fixed dimension 3, the discrete-integral approach supplies a different but related qudit ZH semantics. There the white dot copies in the computational basis, the gray dot enforces a sum-to-zero constraint modulo 4, generalized-not dots implement affine negation, and multicharacter H-boxes carry amplitudes 5. Choosing the measure parameter 6 makes the Fourier transform unitary and yields scalar-exact versions of white fusion, gray fusion, white-gray bialgebra, color change via unit-labeled H-boxes, and H-box multiplication (Beaudrap et al., 2023).
4. Universality, synthesis, and normal-form considerations
The central expressivity theorem for the finite-field calculus states that if 7, 8, and 9—or 0 up to normalization factors—then every linear map
1
with entries in 2 is representable by a diagram in the phased finite-field ZH calculus (Gao, 2024).
The proof is constructive. First, an arbitrary matrix is decomposed as a Schur product of pseudo-binary matrices. Second, each pseudo-binary matrix is encoded by a formula over the field signature 3. Third, every such formula is converted into a polynomial 4 satisfying 5 iff the formula holds. Fourth, a phase-free diagram computes a test for whether 6 vanishes, using field addition, multiplication, and the map 7, which sends nonzero elements to 8 and 9 to 00. Finally, a phased H-effect and Choi–Jamiołkowski bending recover the desired linear map. The construction relies essentially on the field structure, especially cyclicity of 01 and the availability of the normalization scalars used by the Fourier transform (Gao, 2024).
The prime-dimensional predecessor already established two related universality results. Labeled qudit ZH over a commutative ring 02 is universal for matrices over 03, and for prime 04 the phase-free fragment is universal for matrices over 05 up to global powers of 06. The phase-free proof uses successor gadgets, Pascal-triangle constructions, Schur products of H-labels, and an overview of 07 for arbitrary 08 without introducing free labels (Roy et al., 2023).
Completeness remains more limited than universality in higher dimensions. For qubits, the phase-free ZH rules are complete for matrices over 09. For prime qudits, the 2023 work proves universality but leaves completeness open. The finite-field calculus for arbitrary prime powers similarly does not claim a full canonical normal form or a finite sound and complete axiom system, although many reductions needed for field addition, multiplication, Fourier manipulations, and scalar normalization are available (Roy et al., 2023). The discrete-integral ZXH framework likewise provides a complete rule set only for selected fragments, notably the ZX stabiliser fragment and a multicharacter fragment of ZH, rather than for the full calculus in arbitrary dimension (Beaudrap et al., 2023).
5. Circuit correspondences and algorithmic applications
One of the major motivations for qudit ZH is its close relation to reversible arithmetic and generalized Toffoli structure. In prime dimension 10, the two-qudit gate
11
plays the role that the Toffoli gate plays in the qubit setting. For odd 12, every classical reversible qudit logic circuit can be built from this gate using 13 many gates and 14 ancillas, and there are reversible functions requiring at least 15 one- and two-qudit gates even with 16 ancillas. The same work proves that 17 is approximately universal for odd prime qudit quantum computing and that phase-free ZH diagrams coincide with postselected circuits over this gate set (Roy et al., 2023).
The finite-field calculus sharpens the arithmetic side of this picture by making actual field multiplication available on basis labels. This is exploited in the diagrammatic treatment of polynomial interpolation over 18. Given a degree-19 polynomial
20
classically 21 queries suffice and are necessary in the worst case; quantumly, the best known bound quoted in the paper is 22 queries with bounded error, while Boneh–Zhandry showed that 23 queries suffice. The finite-field ZH presentation gives a graphical account of a reduction that first lowers to the linear case with 24 classical queries and then uses one quantum query for 25 (Gao, 2024).
The critical point is that classical Lagrange interpolation depends on inverses: 26 and those inverses exist uniformly in 27 but not in 28 when 29 is composite. For the linear case, the oracle is extended linearly from 30 to the controlled query
31
Starting from the state
32
one applies the oracle, then a controlled unitary that is trivial on 33 and uses multiplication-by-34 together with inverse Fourier transform when 35. Because multiplication by 36 is invertible precisely for 37, the controlled transformation is unitary in the required branch. After a non-demolition measurement onto the subspace spanned by 38 with 39, the probability of obtaining 40 is 41; conditioned on 42, the first register returns 43 with probability 44 and the second returns 45 with probability 46 (Gao, 2024).
This application is not merely illustrative. It shows that the distinction between field arithmetic and cyclic ring arithmetic is semantically visible at the level of diagrammatic calculi: division-dependent algorithms are naturally expressible in the former but not in the latter (Gao, 2024).
6. Relations to Graphical Algebraic Geometry, alternative semantics, and open problems
A 2026 reformulation places qudit ZH in a broader algebraic setting. Graphical Algebraic Geometry constructs complete graphical languages for commutative algebras, ideals, varieties, and structured spans over finite fields, and then characterizes qudit ZH as a minimal extension of finite-field GAG by adding a single Fourier-basis state and one scalar. In that sense, Graphical Algebraic Geometry is to ZH what Graphical Linear Algebra is to ZX (Gao et al., 13 May 2026).
More precisely, the extension adds a Fourier-basis Z state
47
and a scalar interpreted as 48. There is a semantics-preserving functor from ZH into this extended GAG language, and two sound rules express that the Fourier-basis state is copied by the classical comultiplication and deleted to 49. From these rules one proves that any ZH diagram can be rewritten, up to a power of 50, as a pure GAG diagram followed by a single Fourier-basis state at the boundary (Gao et al., 13 May 2026).
This reduction has an algorithmic consequence for amplitude evaluation. If 51 is a scalar ZH diagram over 52, then its value can be computed using exactly 53 queries to an oracle that evaluates closed GAG diagrams, that is, counts 54-rational points satisfying the corresponding polynomial constraints. The resulting amplitude has the form
55
where each 56 is an integer count returned by the oracle. For fixed qudit dimension 57, this is a constant number of oracle calls (Gao et al., 13 May 2026).
The comparison with cyclic-ring semantics remains important. The discrete-integral ZXH framework works for every fixed 58 and gives especially simple scalar-exact rules when 59, but its arithmetic is formulated over 60, with units and non-units treated uniformly. The finite-field ZH calculus instead singles out the prime-power case and changes the computational-basis arithmetic from cyclic-ring multiplication to multiplication in 61. The payoff is access to multiplicative inverses for every nonzero basis label; the trade-off is loss of flexsymmetry in non-prime 62, which must be repaired by the dualizer construction (Beaudrap et al., 2023).
Several limitations are explicit in the literature. The finite-field calculus depends on the choice of primitive element 63 and on the basis-dependent bilinear pairing used to define phases, though any such choice yields a sound calculus. Universality is proved for the phased calculus over 64, but completeness is not claimed. Proposed directions include completeness, successor gadgets and synthesis algorithms for the phase-free fragment, stabilizer-like fragments over finite fields, and mixed-wire calculi involving multiple fields or multiple presentations of the same field (Gao, 2024). The GAG characterization likewise does not provide a complete rewrite theory for the full qudit ZH calculus itself; its completeness results apply to the nonlinear classical backbone rather than to all of ZH (Gao et al., 13 May 2026).