# Minimality in Finite-Dimensional ZW-Calculi

Marc de Visme, Renaud Vilmart

► To cite this version:

Marc de Visme, Renaud Vilmart. Minimality in Finite-Dimensional ZW-Calculi. Computer Science Logic (CSL), Feb 2025, Amsterdam, Netherlands. 10.4230/LIPIcs.CSL.2025.49 . hal-04496193v2

HAL Id: hal-04496193

https://hal.science/hal-04496193v2

Submitted on 1 Aug 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Minimality in Finite-Dimensional ZW-Calculi

Marc de Visme

<figure><img src="image_2.png" /></figure>

Université Paris-Saclay, Inria, CNRS, ENS Paris-Saclay,
Laboratoire Méthodes Formelles, 91190, Gif-sur-Yvette, France

Renaud Vilmart

<figure><img src="image_3.png" /></figure>

Université Paris-Saclay, Inria, CNRS, ENS Paris-Saclay,
Laboratoire Méthodes Formelles, 91190, Gif-sur-Yvette, France

## Abstract

The ZW-calculus is a graphical language capable of representing 2-dimensional quantum systems (qubit) through its diagrams, and manipulating them through its equational theory. We extend the formalism to accommodate finite dimensional Hilbert spaces beyond qubit systems.

First we define a qudit version of the language, where all systems have the same arbitrary finite dimension *d*, and show that the provided equational theory is both complete – i.e. semantical equivalence is entirely captured by the equations – and minimal – i.e. none of the equations are consequences of the others. We then extend the graphical language further to allow for mixed-dimensional systems. We again show the completeness and minimality of the provided equational theory.

**2012 ACM Subject Classification** Theory of computation → Quantum computation theory; Theory of computation → Equational logic and rewriting; Theory of computation → Semantics and reasoning

**Keywords and phrases** Quantum Computing, Categorical Quantum Mechanics, ZW-calculus, Qudits, Finite Dimensional Hilbert Spaces, Completeness, Minimality

**Digital Object Identifier** 10.4230/LIPIcs.CSL.2025.49

**Related Version** Full version with proofs: https://arxiv.org/abs/2401.16225

**Funding** This work is supported by the PEPR integrated project EPiQ ANR-22-PETQ-0007 part of Plan France 2030, by the projects ANR-22-PNCQ-0002 and ANR-22-CE47-0012.

**Acknowledgements** The authors would like to thank Antoine Guilmin-Crépon for discussions about the minimality of the present equational theories. The diagrams of the present paper were drawn using the TikZit tool [33].

## 1 Introduction

Graphical languages for quantum computations are a product of the categorical quantum mechanics program [1, 15] devoted to studying the foundations of quantum mechanics through the prism of category theory. These graphical languages come in different flavours, depending on which generators are used to build the diagrams (graphical representations of the quantum operators), and critically, displaying different kinds of interactions between said generators. The ZX-calculus describes the interaction between two complementary bases [13], the ZW-calculus, the interaction between the two “spiders” derived from the “GHZ” and “W” states, the only two fully entangled tripartite states up to SLOCC-equivalence [14], and the ZH-calculus the interaction between the same GHZ-state inferred spider and a spider obtained by generalising the Hadamard gate [3].

The equations that describe these interactions form “equational theories” that define syntactic equivalence classes of diagrams, that are also semantically equivalent. When the syntactic equivalence matches perfectly the semantic one (i.e. when two diagrams represent the same quantum operator iff they can be turned into one another), we say that the equational

<figure><img src="image_4.png" /></figure>
theory is *complete*. Complete equational theories have been found for the aforementioned graphical languages, betimes for restrictions of them [2, 4, 10, 11, 24, 26, 29, 31, 47].

As is customary for the computer science part of the quantum computation community, the focus was largely set onto *qubit* systems, i.e. systems where the base quantum system is 2-dimensional, yet this is enough to get applications in optimisation [5, 34], quantum error correction [18, 28, 46], verification [22, 27], simulation [35–37]... However, physics allows for qudit systems (where the base quantum system is *d*-dimensional with *d* > 2) and even infinite dimensional systems. Several attempts have hence been made to go beyond the qubit case [7, 25, 48], but it was only recently that a complete equational theory was found for *d*-dimensional (i.e. qudit) systems [42] and later for finite dimensional systems (so-called “qufinite”, i.e. for the category **FdHilb**) [50]. The results were obtained by generalising both the ZX and the ZW calculi and mixing them together. The W-node in particular allows for a neat intuitive (and unique) normal form for the diagrams. Satisfying the necessary conditions for every diagram to be normalisable then yields a complete equational theory. However, we believe that the ones obtained in [42, 50] are far from being *minimal*, due in particular to the presence of the generators from both the ZX and the ZW calculi.

From a foundational perspective, it can be enlightening to know if an equation is a defining property of quantum systems (and hence necessary), or on the contrary if it is derivable from more fundamental properties (see e.g. [16,21]). The redundancy in the equational theory may also cause issues when trying to explore the space of equivalent diagrams, or to transport the completeness result to other diagrammatic languages for qudit systems (every equation has to be proven in the new language, hence the fewer the better); or when trying to generalise further, e.g. to the **FdHilb** setting.

We argue here that the ZW-calculus is enough to get a natural normal form (akin to that of [42]) even in the qudit version, and provide an elegant equational theory that we show to be *complete*, resorting to the normal form instead of transporting the completeness result from [42], for the reason described above. We also show that the equational theory is minimal, meaning that none of the equations can be derived from the others, hence avoiding the aforementioned redundancy in the presentation.

We then adapt diagrams and the equational theory of the graphical language to accommodate all finite dimensional Hilbert spaces (**FdHilb**), in a way that requires no additional generator and only one new equation. Here again we prove the completeness and the minimality of the equational theory, by leveraging that of the qudit setting.

The paper is split into two parts, Section 2 and Section 3, devoted respectively to the **Qudit**<sub>*d*</sub> version, and to the **FdHilb** version. In the **Qudit**<sub>*d*</sub> version, diagrams and their interpretation are introduced in Section 2.1 and the equational theory is introduced and discussed in Section 2.2. We then show its minimality in Section 2.3 and its completeness in Section 2.4. In the **FdHilb** version, diagrams and their interpretation are introduced in Section 3.1, and the equational theory is introduced and shown to be complete in Section 3.2. All missing proofs are provided in the full version.

## The Dirac Notation

All the upcoming diagrams can be given an interpretation as a linear map, in the appropriate category. In quantum information, it is usual to express such linear maps using the so-called Dirac notation. The current section hence serves as a gentle introduction to this notation.

Let $d \ge 2$. In the *d*-dimensional Hilbert space $\mathbb{C}^d$, the canonical basis

$$ \{ (1 \ 0 \ \cdots \ 0)^T, (0 \ 1 \ \cdots \ 0)^T, \dots, (0 \ 0 \ \cdots \ 1)^T \} $$
The symmetry and the compact structure satisfy the following identities:

$$ \begin{array}{ccc} \mathcal{X} = \vert \vert & \vert \vert & \mathcal{X} = \cap \\ \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] 
    \node at (0,0) {$\mathcal{D}$};
    \node at (0,1) {$\mathcal{D}$};
    \node at (1,0) {$\mathcal{D}$};
    \node at (1,1) {$\mathcal{D}$};
    \draw[thick] (0,0) -- (1,1);
    \draw[thick] (0,1) -- (1,0);
\end{tikzpicture} & \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] 
    \node at (0,0) {$\mathcal{D}$};
    \node at (0,1) {$\mathcal{D}$};
    \node at (1,0) {$\mathcal{D}$};
    \node at (1,1) {$\mathcal{D}$};
    \draw[thick] (0,0) -- (1,1);
    \draw[thick] (0,1) -- (1,0);
\end{tikzpicture} & \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] 
    \node at (0,0) {$\mathcal{D}$};
    \node at (0,1) {$\mathcal{D}$};
    \node at (1,0) {$\mathcal{D}$};
    \node at (1,1) {$\mathcal{D}$};
    \draw[thick] (0,0) -- (1,1);
    \draw[thick] (0,1) -- (1,0);
\end{tikzpicture} \\ 
\end{array} $$

This compact structure in particular allows us to define the “upside-down” version of the generators, for instance: $\begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \draw[thick] (0,0) circle (0.5); \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} := \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \draw[thick] (0,0) circle (0.5); \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture}$ and $\begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \draw[thick] (0,0) circle (0.5); \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} := \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \draw[thick] (0,0) circle (0.5); \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture}$

The $\dagger$ functor is defined inductively as:

$$ \begin{array}{l@{\hspace{2em}}l@{\hspace{2em}}l} (D_2 \circ D_1)^\dagger & = & D_1^\dagger \circ D_2^\dagger \\ (D_1 \otimes D_2)^\dagger & = & D_1^\dagger \otimes D_2^\dagger \\ (r)^\dagger & = & \bar{r} \end{array} \qquad \left( \begin{array}{c} \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} \\ \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} \\ \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} \end{array} = \begin{array}{c} \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} \\ \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} \\ \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} \end{array} \quad \text{with the other generators being mapped to their upside-down version.} $$

Notice that thank to the identities satisfied by the $\dagger$-compact prop, the $\dagger$-functor is involutive.

As will be made clearer in what follows, in $\mathbb{ZW}_d$, $d \ge 2$ represents the dimension of the “base” quantum system, called qudit. As this $d$ will be fixed in the following, we may forget to specify it. For convenience, we define an empty white node as a parameter-1 Z-spider: $\begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} := \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture}$ and give the $0 \to 1$ W-node a special symbol, akin to that of $|1\rangle$ (as its interpretation, as we will see later, is merely $|0\rangle$): $\begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} := \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture}$. We generalise the ket symbol inductively as follows (for $2 \le k < d$): $\begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} := \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture}$. These last symbols can be given an upside-down definition using the compact structure as was done for $|1\rangle$ and the W-node.

### 2.1.1 The Interpretation

The point of the diagrams of the $\mathbb{ZW}_d$ is to represent quantum operators on multipartite $d$-dimensional systems. The way those are usually specified is thanks to the category **Qudit**$_d$. This forms again a symmetric $\dagger$-compact prop, where the base object is $1 := \mathbb{C}^d$, and morphisms $n \to m$ are linear maps $\mathbb{C}^{d^n} \to \mathbb{C}^{d^m}$. The symmetry and the compact structure correspond to their counterparts in $\mathbb{ZW}_d$, they will be stated out in the following, as part of the interpretation of $\mathbb{ZW}_d$ diagrams. The $\dagger$ functor is the usual $\dagger$ of linear maps over $\mathbb{C}$.

We may hence interpret diagrams of the $\mathbb{ZW}_d$-calculus thanks to the functor $[\cdot, \cdot] : \mathbb{ZW}_d \to \text{Qudit}_d$ inductively defined as follows:

$$ \begin{array}{l@{\hspace{2em}}l} \llbracket D_2 \circ D_1 \rrbracket & = \llbracket D_2 \rrbracket \circ \llbracket D_1 \rrbracket \\ \llbracket D_1 \otimes D_2 \rrbracket & = \llbracket D_1 \rrbracket \otimes \llbracket D_2 \rrbracket \\ \llbracket \vert \vert \rrbracket & = \sum_k |k\rangle\langle k| \\ \llbracket \times \rrbracket & = \sum_{k,l} |l, k\rangle\langle k, l| \\ \llbracket \cap \rrbracket & = \llbracket \cup \rrbracket^\dagger = \sum_k |k, k\rangle \\ & \qquad \llbracket \bullet \rrbracket = |1\rangle \\ & \qquad [r] = r \end{array} \qquad \begin{array}{l} \llbracket \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} \end{array} = \sum_{k=0}^{d-1} r^k \sqrt{k!}^{n+m-2} |k^m\rangle\langle k^n| \\ \llbracket \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} \end{array} = \sum_{\substack{k \in \{0, \dots, d-1\} \\ i_1 + \dots + i_n = k}} \sqrt{\binom{k}{i_1, \dots, i_n}} |i_1, \dots, i_n\rangle\langle k| \\ \llbracket \bullet \rrbracket = |1\rangle \\ [r] = r $$

where $\binom{k}{i_1, \dots, i_n} = \frac{k!}{i_1! \dots i_n!}$ is a multinomial coefficient. Notice that the interpretation of the $0 \to 1$ W-node is simply: $\begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} = \sum_{\substack{k \in \{0, \dots, d-1\} \\ 0=k}} \sqrt{\binom{k}{0}} |k\rangle = |0\rangle$, and that of the black node symbol $k$ for $k < d$ is $|k\rangle$ up to renormalisation: $\begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}] \node at (0,0) {$\bullet$}; \node at (0,0.5) {$\bullet$}; \node at (0.5,0) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \node at (-0.5,0) {$\bullet$}; \node at (-0.5,-0.5) {$\bullet$}; \node at (0.5,0.5) {$\bullet$}; \node at (0.5,-0.5) {$\bullet$}; \end{tikzpicture} = \sqrt{\binom{k}{1, \dots, 1}} |k\rangle = \sqrt{k!} |k\rangle$. The
presence of $\sqrt{\cdots}$ on the coefficients is not particularly relevant, and is simply an artefact of us maintaining some symmetry between generators and their dagger. Indeed, we want $[[\begin{smallmatrix} k \\ k \end{smallmatrix}] = k!$, and for that the coefficient $k!$ needs to be split between both nodes, resulting in either an asymmetric presentation or a square root (see Section A for an equivalent semantics, without any $\sqrt{\cdots}$ but asymmetric instead).

Notice also that the interpretation of the Z-spider differs from more usual generalisations of its qubit counterpart, because of the $\sqrt{k!}^{n+m-2}$ which depends on the degree of the spider. While it makes the interpretation of the diagrams slightly more complicated, it allows us – as will be stated later – to quite conveniently generalise equations from the qubit ZW-calculus, and hence have a simpler equational theory. It will be shown in the following (Corollary 10), that the above set of generators makes for a universal calculus, i.e. any linear map of $\mathbf{Qudit}_d$ can be represented by a $\mathbf{ZW}_d$-diagram.

To gain intuition about the upcoming equations between diagrams, it can be useful to semantically decompose a diagram into sums of simpler ones<fnref n="1" />. To do so, it can be convenient to understand $|k\rangle$ as a bunch of $k$ indistinguishable particles:

$$[[\begin{smallmatrix} k \\ \vdots \\ \vdots \end{smallmatrix}] = \sum_{i_1+\cdots+i_n=k} \begin{pmatrix} k \\ i_1, \dots, i_n \end{pmatrix} [[\begin{smallmatrix} i_1 \\ \vdots \\ i_n \end{smallmatrix}] \quad (1)$$

$$[[\begin{smallmatrix} k \\ \bullet \\ \bullet \end{smallmatrix}] = \begin{cases} \left[ \begin{smallmatrix} k+\ell \\ | \end{smallmatrix} \right] & \text{if } k+\ell < d \\ \vec{0} & \text{if } k+\ell \ge d \end{cases} \quad (2)$$

$$[[\begin{smallmatrix} k \\ \bullet \\ \vdots \\ \vdots \\ n \end{smallmatrix}] = r^k \left[ \begin{smallmatrix} k \\ \vdots \\ n \end{smallmatrix} \right] \quad (3)$$

$$[[\begin{smallmatrix} k \\ \bullet \end{smallmatrix}] = k! \langle k | \ell \rangle \quad (4)$$

$$[[|]] = \sum_{k=0}^{d-1} \frac{1}{k!} [[\begin{smallmatrix} k \\ \bullet \end{smallmatrix}]] \quad (5)$$

Equation (1) explains how the W-node spreads the $k$ “particles” that enter it following a multinomial distribution. Equation (2) shows that the $2 \to 1$ W-node takes two bunches of particles $k$ and $\ell$ and regroups them into one, and yields the null state if $k + \ell$ exceeds the “capacity” (i.e. the dimension) of a single wire. This will be proven graphically (Lemma 30) from the upcoming equational theory (Figure 1). When $k + \ell < d$, the fact that there is no additional scalar is due to the rescaling of the $k$-dots to represent $\sqrt{k!}|k\rangle$. This rescaling also makes the “copy” more natural: The Z-spider $1 \to n$ copies any bunch of $k$ particles entering it, yielding global scalar $r^k$ in the process, as is shown by Equation (3). This will again be proven graphically (Lemma 27) from the equational theory. The rescaling, however, forces Equation (4). Finally, it can be useful to decompose the identity as a linear combination of products of kets and bras as is done in Equation (5).

## 2.2 Equational Theory

With the above interpretation of the $\mathbf{ZW}_d$, different diagrams may yield the same linear map. All axioms of symmetric $\dagger$-compact props in particular preserve the interpretation. More generally, we may want to relate together all diagrams that have the same semantics. This is done through an equational theory, i.e. a set of equations that can be applied locally in a diagram without changing the semantics of the whole.

<footnote n="1">¹ Notice that here, such decompositions are merely semantical. The upcoming completeness is only interested in equivalence between single diagrams.</footnote>
2.2.1 Equations of the ZW<sub>d</sub>-Calculus

On top of the axioms of symmetric †-compact props, we assume some conventional equations
about the topology of the generators, which should align with the symmetries of the symbols
used to depict them. The Z-spider does not distinguish between any of its connections: it is
“flexsymmetric” [9], meaning that we can interchange any of its legs without changing the

semantics. Graphically, for any permutation of wires σ:

σ: = . On the
... σ ...

other hand, the binary W-node is only co-commutative, which, together with the upcoming Equation (a), means that all the outputs of the n-ary W-node can be exchanged, i.e. for any

permutation of wires σ:

= . With all this in place, we can give the core of the
equational theory, in Figure 1. When diagram D₁ can be turned into diagram D₂ using the

rules of ZW<sub>d</sub>, we write ZW<sub>d</sub> ⊢ D₁ = D₂.

<figure><img src="image_5.png" /><figcaption>Figure 1 Equational theory ZW<sub>d</sub> for the qudit ZW-calculus.</figcaption></figure>

► Remark 1. In this framework, we can tensor global scalars together $r \otimes s$, which graphically could be confused with their product $rs$. This is actually unambiguous in the equational theory, as, using Equation (p):

$$
\mathrm{ZW}_d \vdash \mathbf{r} \otimes \mathbf{s} \stackrel{(\varphi)}{=} \mathbf{r} \cdot \underset{(\mathbf{s})}{\bigcirc} \stackrel{\mathbf{1}}{=} \underset{(\varphi)}{\bigcirc} \stackrel{(\mathbf{s})}{=} \underset{(\mathbf{rs})}{\bigcirc} \stackrel{(\varphi)}{=} \mathbf{rs}
$$

Moreover, using Equation (e), one can easily show that global scalar 1 is the empty diagram (Lemma 21). Scalar multiplication is assumed to be automatically applied, and scalar 1 is assumed to be automatically removed in the following after Lemma 21 is proven.

All rules up to (e) are fairly standard generalisations of rules of the qubit ZW-calculus
(with (b₂) being inspired from [42] to avoid using a fermionic swap<fnref n="2" />). The non-conventional

<footnote n="2">² The fermionic swap, introduced in [24], is a generator that in many situations behave like the actual swap. The qubit version of ZW uses the fermionic swap, but this generator loses many properties (for instance its involution, or the fact that it maps $|k, \ell\rangle$ to $|\ell, k\rangle$ up to some coefficient) when going in larger dimensions. By not using it here, we avoid having to axiomatise it.</footnote>
equation of interest. When such an interpretation is exhibited, we can safely conclude that the equation is necessary, since if it were a consequence of the others, it would also preserve this interpretation. Interpretations like these sometimes simply take the form of a quantity that turns out to be invariant for all equations except the one that is considered. In the realm of quantum graphical theories, such arguments were used for single equations in [23, 30, 32, 39, 44], partial minimality results were obtained for Clifford ZX-calculus [6], unrestricted ZX-calculus [47], and quite recently, full minimality (with completeness) was obtained for quantum circuits [12].

In the following, we show that the equational theory $ZW_d$ from Figure 1 is minimal, i.e. that none of the equations can be derived from the others. It is to be noted that most of the equations in Figure 1 are schemas, that is they are parametrised, and the equation is assumed for all possible values of the parameters. Our minimality result is “weak” in the sense that for each equation schema, we show that *at least* one of the occurrences cannot be derived from the other equations, but we do not pinpoint for which parameters the equation is necessary or not. Nevertheless:

**Theorem 4.** All equations in $ZW_d$ are necessary, hence $ZW_d$ is minimal.

Several arguments in the proof are graphical, meaning that they rely on the understanding that a diagram can also be seen as a special kind of graph with vertices (inputs, outputs, Z-spiders, W-nodes, states, global scalars) and edges (wires, cup, cap, with swaps representing crossings). As such, when we talk about “a W-node in a diagram $D$”, we actually refer to a vertex (of the $Z$ type) of said diagram. One argument in the proof require the notion of “effective Z-path”, that is a path that goes only through Z-spiders and trivial W-nodes – which W-nodes that could be replaced by identity wires without it making any difference – and that can be used in non-trivial computations.

**Definition 5 (Sole effective output of a W-node).** Let $D$ be a diagram with a collections of $n$ distinguished W-node. Let’s call “$a_1”,...,“$a_n$” one output of each, as shown in Equation (6) below. We say that wires “$a_1”,...,“$a_n$” are jointly the sole effective outputs of the W-nodes if Equation (8) is satisfied:

$$ \boxed{\text{[D]}} = \boxed{\text{[D']}} \qquad (6) $$

$$ \boxed{\text{[D']}} = \boxed{\text{[D]}} \qquad (7) $$

In particular, if we only consider one W-node that has a sole effective output – we call such a node a *trivial W-node* – it follows that:

$$ \boxed{\text{[D']}} = \boxed{\text{[D]}} \qquad (8) $$
**► Definition 6 (Effective Z-path).** An *effective Z-path* of a diagram *D* is a path going from a boundary to another (inputs and/or outputs), such that:

- For each W-node it goes through, it cannot use two outputs of the W-node (so it must use its input). Considering all those W-nodes at once, those outputs must be jointly the sole effective outputs of those W-nodes.

- There exists a state $|\phi\rangle$ that is not of the form $\lambda|0\rangle$ or $\lambda|1\rangle$ for some $\lambda \in \mathbb{C}$, that inhabits the path. That is, if we feed to $[D]$ the state $|\phi\rangle$ and/or the effect $\langle\phi|$ to the two inputs and/or outputs of the path, then the result is not $\tilde{0}$.

We can now prove Theorem 4:

*Proof.* We consider each of these equations individually, and give more details in the full version:

(s) When applying the transformation that turns all Z-spider parameters and global scalars to their real part ($r \mapsto \text{Re}(r)$), Equation (s) is the only one that is not preserved.

(a) It is the only equation permitting to create non-trivial W-nodes with arity $> d$ from a diagram that only has non-trivial W-nodes with arity $\le d$.

(id) It is the only equation that can create nodes connected to boundaries from a node-free diagram.

(h) To each wire in a diagram $D$, we associate a number $0 \le k < d$ (or more graphically we annotate each wire by some number $k$)$^3$. The procedure to do so is as follows:

1. annotate all wires with $d-1$

2. rewrite the annotations using the following rules, until a fixed point is reached:

$$ \begin{aligned} & \bullet \quad a \atop \bullet \quad a \neq 0 \quad \rightarrow \quad 0 \atop \bullet \quad a \geq 1 \quad \rightarrow \quad 1 \atop \bullet \quad a := \min(a_i) \end{aligned} $$

This simple procedure obviously terminates, as a step is only applied if at least one of the annotations is decreased. By considering inputs and outputs of $D$ (which are the only wires that can be guaranteed to remain during rewrites with $ZW_d$), we can check that Equation (h) is the only one that can modify the outcome of the procedure.

(b₁) Consider diagrams as graphs, and use the above definition of an “effective Z-path”. All equations except (b₁) preserve the existence of effective Z-paths, although proving it for (b₂) is quite involved and relies on the following lemma:

**► Lemma 7.**

Let $D$ be a diagram of the form shown in Equation (9), such that we have Equation (10).

$$ \boxed{D} = \text{[Diagram with capacities]} \qquad (9) $$

<footnote n="3">³ The annotations produced here are upper bounds on the value of the kets that can go through the wires. As such, they are very closely related to the *capacities* from Section 3.</footnote>
$$ \left[ \left[ \begin{array}{c} \boxed{D} \\ \vdots \\ \boxed{D'} \end{array} \right] \right] = \left[ \left[ \begin{array}{c} \boxed{\bullet} \\ \vdots \\ \boxed{\bullet} \\ \vdots \\ \boxed{\bullet} \\ \vdots \\ \boxed{\bullet} \\ \vdots \\ \boxed{\bullet} \\ \vdots \\ \boxed{\bullet} \end{array} \right] \right] = \left[ \left[ \begin{array}{c} \boxed{\bullet} \\ \vdots \\ \boxed{\bullet} \\ \vdots \\ \boxed{\bullet} \\ \vdots \\ \boxed{\bullet} \\ \vdots \\ \boxed{\bullet} \\ \vdots \\ \boxed{\bullet} \end{array} \right] \right] \quad (10) $$

Then Equation (11) is satisfied:

$$ \left[ \left[ \begin{array}{c} \boxed{\phantom{D'}} \\ \vdots \\ \boxed{\phantom{D'}} \\ \vdots \\ \boxed{\phantom{D'}} \end{array} \right] \right] = \left[ \left[ \begin{array}{c} \boxed{\phantom{D'}} \\ \vdots \\ \boxed{\phantom{D'}} \\ \vdots \\ \boxed{\phantom{D'}} \end{array} \right] \right] \quad (11) $$

(b2) Consider diagrams as graphs, and define a “W-path” in the diagram as a path 1) that goes from a boundary to another boundary, 2) which cannot use two outputs of a W-node (if it goes through a W-node, it has to use the input edge) and 3) that does not go through a Z-spider. All equations, except (b2), preserve the existence of a W-path. (b2) is the only equation that can bring the number of W-paths from non-zero to zero (which is done by adding a Z-spider on the path).

(+) Take the interpretation that maps all the Z-spider parameters (and the global scalars) to their absolute value ($r \mapsto |r|$). This interpretation preserves all equations except (+).

(e) It is the only equation that can create generators out of empty diagrams.

(φ) It is the only equation that can create a non-real scalar from a diagram with only real scalars.

(ℓ) Let $\varpi := e^{i\frac{\pi}{d-1}}$ be the first $(2d-2)$-th root of unity. Consider the $\ell$-compact monoidal functor (i.e. functor that preserves compositions, symmetry and compact structure) that maps the generators as follows:

$$ \begin{array}{ccc} \text{Diagram 1} & \mapsto & \varpi \text{ Diagram 1} \\ \text{Diagram 2} & \mapsto & \left( \begin{array}{c|c} \text{Diagram 3} & \text{Diagram 4} \\ \hline \text{Diagram 5} & \text{Diagram 6} \end{array} \right) \\ \text{Diagram 7} & \mapsto & \text{Diagram 8} \end{array} $$

When $d > 2$, all equations but (ℓ) are preserved by this functor. We can make the argument work when $d = 2$ by choosing any $\varpi$ such that $\varpi^2 \neq 1$ and by working up to a scalar factor.

(u) Take the interpretation that maps **1** (and subsequently all **k**s) to **1**. All rules hold (up to a scalar factor) except (u). ▼

## 2.4 Completeness

Completeness of an equational theory with respect to a semantics is the fundamental property that ensures that semantical equivalence of diagrams is entirely captured by the equational theory. Minimality is worthless without some form of completeness, as it is extremely simple to design minimal, but not complete, equational theories. For instance, the empty equational theory (that contains no axiom) is minimal but clearly not complete for the qudit ZW-diagrams. We hence show in this section that we indeed have completeness.
### 2.4.1 Normal Form and Universality

The usual way to prove completeness is to show that any diagram can be put in a normal form, and that this normal form is unique and similar for all equivalent diagrams. As is customary in a category that is compact-closed, we can focus on states, as there is an isomorphism between operators and states [1]:

$$ \boxed{\text{D}} = \text{D} \cdots = \boxed{\text{D}^\top} \cdots $$

Proving completeness requires a fair amount of diagrammatic derivations, especially when starting from a minimal equational theory, to get enough material to define a normalisation strategy.

**► Definition 8.** We define $\mathcal{N}: \mathbf{Qudit}_d \to \mathbf{ZW}_d$ as the functor that maps any $n$-qudit state

$$ |\psi\rangle = r_0 |0\dots0\rangle + r_1 |0\dots01\rangle + \dots + r_i |x_1^i \dots x_n^i\rangle + \dots $$

to the diagram below. We say of any diagram in the image of $\mathcal{N}$ that it is in normal form.

<figure><img src="image_6.png" /></figure>

This construction is a direct generalisation of the normal form of the qubit ZW-diagrams [24], which is also considered in [25] in the context of $q$-arithmetic. It creates a diagram whose interpretation is the starting state:

**► Proposition 9.** $\forall |\psi\rangle \in \mathbf{Qudit}_d[0, n], [[\mathcal{N}(|\psi\rangle)]] = |\psi\rangle$.

Where for any category $\mathcal{C}$, we write $\mathcal{C}[n, m]$ for the set all the morphisms from $n$ to $m$. As a simple consequence of this proposition, any qudit operator can be represented by a diagram of $\mathbf{ZW}_d$:

**► Corollary 10 (Universality).** $\forall f \in \mathbf{Qudit}_d[n, m], \exists D_f \in \mathbf{ZW}_d[n, m], [[D_f]] = f$.

Since we defined the normal form as the image of a map from the semantics, any diagram can only be associated to a unique normal form.

### 2.4.2 Completeness

Our goal now is to show that any diagram can be put in normal form. To do so, we show that all generators can be put in normal form, and that all compositions of diagrams in normal form can be put in normal form.

We start by showing the latter for the tensor product:

**► Proposition 11.** The spatial composition of diagrams in normal form can be put in normal form, i.e. $\mathbf{ZW}_d \vdash \mathcal{N}(v_1) \otimes \mathcal{N}(v_2) = \mathcal{N}(v_1 \otimes v_2)$.

When turning arbitrary operators into states, the sequential composition turns into the application of cups ⋃ onto pairs of outputs of the state, as:

$$ \boxed{\text{D}_1} = \boxed{\boxed{\text{D}_2} \otimes \boxed{\text{D}_1}} = \boxed{\text{D}_2} $$
**Proposition 12.** The diagram obtained by applying a cup Ⓐ to two outputs of a diagram in normal form can be put in normal form.

Then we move on to showing that all the generators can be put in normal form. To do so, the following lemma will prove useful:

**Lemma 13.** The diagram obtained by applying Ⓐ to two outputs of a normal form can be put in normal form.

**Proposition 14.** All generators of the ZW<sub>d</sub>-calculus can be put in normal form.

Putting all the latter results together, we can show the completeness of the language:

**Theorem 15 (Completeness for Qudit Systems).** The language is complete: for any two diagrams D<sub>1</sub> and D<sub>2</sub> of the ZW<sub>d</sub>-calculus:

$$[[D_1]] = [[D_2]] \iff \mathrm{ZW}_d \vdash D_1 = D_2$$

**Proof.** By Proposition 14, any generator of the language can be put in normal form. Thanks to Propositions 11 and 12, compositions of diagrams in normal form can be put in normal form. As a consequence, any diagram can be put in normal form. By uniqueness of this normal form, if two diagrams share the same semantics, they can be rewritten into the same diagram. This proves completeness. ◀

# 3 Finite Dimensional Hilbert Spaces

In the previous setting, all systems are required to be d-dimensional for some fixed d. Here we relax that constraint, which allows us to go “mixed-dimensional” and to represent morphisms of FdHilb<sup>4</sup>.

FdHilb is the strict symmetric monoidal †-compact category of finite dimensional Hilbert spaces [1]. Its objects are tensor products of finite dimensional Hilbert spaces $C^d(d \in \mathbb{N} \setminus \{0\})$, and its morphisms are linear maps between them. The symmetry and the compact structure are naturally extended from that of Qudit<sub>d</sub>.

In this new setting, we will be able to represent all morphisms of FdHilb, at the cost of annotating the wires of the diagrams to keep track of their dimensions. Instead of the dimension itself, we rather annotate the wire with its dimension −1, i.e. with the largest k such that |k⟩ is allowed on the wire. We call such k the capacity of the wire. This makes the bookkeeping a little bit less tedious.

## 3.1 Diagrams and Interpretation

We also require the following constraints for the capacities around each generator:

- All capacities around a Z-spider are the same

- The input capacity of the W-node must be larger than (or equal to) each of its outputs
The first constraint follows from the fact that Z-spiders in ZW can be seen as a generalisation of graph edges – more precisely they can be seen as hyperedges. Hence the whole hyperedge should have a single capacity. The second constraint simply comes from the fact that a larger capacity on the outputs of a W-node will never be used, so we might as well prevent

<footnote n="4">⁴ Technically, the skeleton of FdHilb, i.e. where all d-dimensional Hilbert spaces are identified with the canonical representative $C^d$. We take the liberty in this paper to name FdHilb this skeleton.</footnote>
$$ 
\begin{aligned}
& [D_2 \circ D_1] = [D_2] \circ [D_1] \\
& [D_1 \otimes D_2] = [D_1] \otimes [D_2]
\end{aligned}
$$

$$ [[ \begin{smallmatrix} a \\ | \end{smallmatrix} ]] = \sum_{k=0}^{a} |k\rangle\langle k| $$

$$ [[ \bigcirc_{\begin{smallmatrix} a \\ | \end{smallmatrix}}^{a} ]] = [[ \bigcirc_{a}^{a} ]]^{\dagger} = \sum_{k=0}^{a} |k, k\rangle $$

$$ [[r]] = r $$

$$ [[ \bigcirc_{\begin{smallmatrix} a \\ | \end{smallmatrix}}^{a} \cdots \bigcirc_{b_1 \cdots b_n}^{b_1 \cdots b_n} ]] = \sum_{\substack{0 \le k_i \le b_i \\ k_1 + \dots + k_n \le a}} \sqrt{\binom{k_1 + \dots + k_n}{k_1, \dots, k_n}} |k_1, \dots, k_n\rangle \langle k_1 + \dots + k_n| $$

$$ [[ \bigcirc_{\begin{smallmatrix} a \\ | \end{smallmatrix}}^{a} \bigcirc_{\begin{smallmatrix} b \\ | \end{smallmatrix}}^{b} ]] = \sum_{k=0}^{a} \sum_{\ell=0}^{b} |\ell, k\rangle\langle k, \ell| $$

$$ [[ \bigcirc_{\begin{smallmatrix} a \\ | \end{smallmatrix}}^{a} \bigcirc_{\begin{smallmatrix} b \\ | \end{smallmatrix}}^{b} \cdots \bigcirc_{m}^{m} ]] = \sum_{k=0}^{a} r^k \sqrt{k!}^{n+m-2} |k^m\rangle\langle k^n| $$

$$ [[ \begin{smallmatrix} 1 \\ | \end{smallmatrix}^{a} ]] = |1\rangle $$

By composition, one can check that, for $k > 1$ and $a \ge k$: $[[ \begin{smallmatrix} a \\ | \end{smallmatrix}^{k} ]] = \sqrt{k!} |k\rangle$.

Notice that we use the same notation for the interpretation of ZW<sub>d</sub>-diagrams, and for the interpretation of the ZW<sub>f</sub>-diagrams. Which interpretation we are referring to should be clear from the context.

## 3.2 Complete Equational Theory

We once again equip the language with an equational theory ZW<sub>f</sub>, defined in Figure 2. This equational theory only slightly differs from the one for qudit systems in Figure 1. It is interesting to notice that 1) the associativity of the W-node is broken down into two equations (a) and (o), whose choice depends on the capacities involved, 2) the W-bialgebra equation (b<sub>2</sub>) does not need a context anymore, but instead side conditions on the capacities, 3) we managed to remove Equation (e), 4) we now need an equation (i) that states that a $|1\rangle$, when “injected” into a larger dimensional Hilbert space, is still a $|1\rangle$.

We also notice the existence of an interesting equation, that we did not include in Figure 2 as it turns out to be derivable; and which states that a $0 \to 1$ Z-state can be “copied” by the

$$ \text{W-node, as follows: } \begin{array}{c} \begin{smallmatrix} a+b \\ | \end{smallmatrix} \\ \begin{smallmatrix} a \\ | \end{smallmatrix} \end{array} = \begin{array}{c} \begin{smallmatrix} a \\ | \end{smallmatrix} \\ \begin{smallmatrix} b \\ | \end{smallmatrix} \end{array}. $$

The category **Qudit**<sub>d</sub> is a full subcategory of **FdHilb**, and as such there is an obvious inclusion functor **Qudit**<sub>d</sub> $\xrightarrow{i_d}$ **FdHilb**. This inclusion transports to the ZW-calculi: we can turn any ZW<sub>d</sub>-diagram into a ZW<sub>f</sub>-diagram through $i_d$ in such a way that the following

$$ \text{diagram commutes: } \begin{array}{ccc} \begin{tikzpicture}[baseline={([yshift=-.5ex]current bounding box.center)}] \node (Wd) at (0,0) {$ZW_d$}; \node (ZWF) at (2,0) {$ZW_f$}; \draw[->] (Wd) -- (ZWF); \draw[->] (Wd) -- (ZWF); \node[above] at (Wd) {$i_d$}; \node[below] at (ZWF) {$|\cdot|$}; \node[left] at (Wd) {$\begin{bmatrix} |\cdot| \end{bmatrix}$}; \node[right] at (ZWF) {$\begin{bmatrix} |\cdot| \end{bmatrix}$}; \end{tikzpicture} & & \begin{tikzpicture}[baseline={([yshift=-.5ex]current bounding box.center)}] \node (Wd) at (0,0) {$ZW_d$}; \node (ZWF) at (2,0) {$ZW_f$}; \draw[->] (Wd) -- (ZWF); \draw[->] (Wd) -- (ZWF); \node[above] at (Wd) {$i_d$}; \node[below] at (ZWF) {$|\cdot|$}; \node[left] at (Wd) {$\begin{bmatrix} |\cdot| \end{bmatrix}$}; \node[right] at (ZWF) {$\begin{bmatrix} |\cdot| \end{bmatrix}$}; \end{tikzpicture} \end{array} $$

The functor $i_d$ simply takes a ZW<sub>d</sub>-diagram and annotates all its wires with $d-1$.

We show that the present equational theory is complete. To do so, we need to adapt the notion of normal form from qudit systems (and we again use the map/state duality to focus on states rather than arbitrary morphisms):

**Definition 16.** We define $\mathcal{N}$: **FdHilb** $\to$ ZW<sub>f</sub> as the functor that maps any n-ary state $|\psi\rangle \in \text{FdHilb}[\emptyset, (a_1, \dots, a_n)]$:

$$ |\psi\rangle = r_0 |0\dots0\rangle + r_1 |0\dots01\rangle + \dots + r_i |x_1^i \dots x_n^i\rangle + \dots $$
<figure><img src="image_7.png" /><figcaption>■ **Figure 2** Equational theory ZW<sub>f</sub> for the finite-dimensional ZW-calculus. In (a), we require that $b = c$ or $b \ge \sum_i a_i$; and in (b<sub>2</sub>) that $c \ge \min(\sum a_i, \sum b_i)$ on the rhs, and that $\ell_{ij} = \min(a_i, b_j)$ on the rhs.</figcaption></figure>

to the diagram below. We say of any diagram in the image of $\mathcal{N}$ that it is in normal form.

<figure><img src="image_8.png" /></figure>

We can once again show that $\mathcal{N}$ builds a diagram that represents $|\psi\rangle$:

$$ \textbf{Lemma 17.} \quad \forall |\psi\rangle \in \text{FdHilb}[\mathbb{Q}, (a_1, \dots, a_n)], \quad [\mathcal{N}(|\psi\rangle)] = |\psi\rangle $$

We hence get universality of the language as a direct consequence:

**Corollary 18 (Universality of ZW<sub>f</sub>).*

$$ \forall f \in \text{FdHilb}[(a_1, \dots, a_n), (b_1, \dots, b_m)], \exists D_f \in \text{ZW}_f[(a_1, \dots, a_n), (b_1, \dots, b_m)], [D_f] = f $$

Most of the arguments given for the minimality of ZW<sub>d</sub> can be adapted to arguments for the necessity of the equations of ZW<sub>f</sub>, and the few remaining equations can be given a new argument. We hence have:

**Theorem 19.** The equational theory ZW<sub>f</sub> is minimal.

**Proof.** The argument given for the necessity of Equation (b<sub>2</sub>) now works for the necessity of Equation (o), and that of Equation (e) now works for Equation (b<sub>2</sub>). Namely, Equation (b<sub>2</sub>) is the only that can create a non-empty diagram from an empty diagram. A less artificial argument for Equation (b<sub>2</sub>) is that it is the only equation that can create a capacity > *k* from a diagram whose capacities are all ≤ *k* for *k* ≥ 1. Moreover:

Equation (i) is the only equation that can create a $|1\rangle$ with capacity $a \neq 1$, from a diagram whose $|1\rangle$s are all on capacity 1.
49:16 Minimality in Finite-Dimensional ZW-Calculi

We can reformulate the argument of Equation (a) as: It is the only equation permitting to create non-trivial W-nodes with arity ≥ 3 from a diagram where all non-trivial W-nodes have arity ≤ 2.

In the argument of Equation (ℓ), one can take for $\bar{\omega}$ any complex number such that $\bar{\omega}^2 \neq 1$, and by working up to a scalar factor, as is done initially for $d = 2$.

In the argument of Equation (h), we can instantiate the protocol by annotating the wires with their capacities, then continue with the protocol as explained in the initial argument.

All the other arguments work right off the bat for their mixed-dimensional counterpart, hence the result of minimality. ◀

Using the normal form, we can then leverage the completeness from the qudit ZW-calculus to get the similar result in the current setting:

**► Theorem 20 (Completeness for Finite Dimensional Systems).** *The language is complete: for any two diagrams $D_1$ and $D_2$ of the $ZW_f$-calculus:*

$$[[D_1]] = [[D_2]] \iff ZW_f \vdash D_1 = D_2$$

**Proof.** The right-to-left implication (soundness) is again a straightforward verification. The other is proven in its entirety in the full version, and uses the completeness of $ZW_d$ for qudit systems. The idea is to show that i) we can turn both $D_1$ and $D_2$ into a diagram with a high enough capacity $d$ everywhere (except boundaries), and that ii) all the equations of $ZW_d$ can be proven in $ZW_f$ (through $\iota_d$). ◀

# 4 Related Work

## 4.1 Qudit Framework

The first and only result to date of a complete equational theory for a graphical language describing qudit systems comes from the “ZXW-calculus” [42]. There, the authors start from a qudit version of the ZX-calculus and most probably end up requiring a W-node in the definition of a normal form, and hence in the equational theory leading to completeness. We argue here that we can get a complete equational theory purely inside the ZW-calculus. By keeping the number of generators as low as possible, we also end up with few, intuitive equations in the equational theory.

The W-node we used is a different generalisation of the qubit W-node than the one used in [42]. The version we used offers two advantages with respect to the aims of the paper. First, it allows to use a single parameter in the Z-spiders (which aligns with the spirit of keeping things as minimal as possible) and to sum such parameters together, while the other version requires to have ($d-1$)-sized lists of coefficients as parameters in order to get a (+)-like rule to sum coefficients together. Second, it allows us to define $|k\rangle$ (up to a scalar) as a composition using only $|1\rangle$ and the W-node. Again, this lowers the number of generators, as all the $|k\rangle$ (for $k > 1$) become syntactic sugar.

Focussing on ZW-calculus is not a new idea. The first ever completeness proof for qubit graphical languages was in the (qubit) ZW-calculus, introduced in [14] and tweaked and made complete in [24, 26]. The ZW-calculus noticeably has very nice combinatorial properties different from those of its counterparts, which in particular allows for a very natural notion of normal form. It is hence not suprising that some attempts were made to get a complete equational theory of qudit systems purely in ZW. There have then been tentative generalisations for qudit systems, in particular in [25] where $q$-arithmetic is used, and in [49]
where the W-node is generalised in a different way (and that we encounter in [42]). It is
to be noted that our two main generators are essentially the same as in [25], except with
usual arithmetic instead of *q*-arithmetic. While some equations are sound with respect to
the *q*-arithmetic semantics, others are truly specific to the standard arithmetic. Adapting
the results of the present paper to *q*-arithmetic semantics hence seems non-trivial. Other
presentations for qudit systems have also been proposed (without proof of completeness)
in [17, 43]. Finally, complete presentations for fragments of qudit quantum mechanics can be
found e.g. in [8, 40].

Another system we are close to is **QPath** [19]. Our W-node is merely the “triangle” node of **QPath** that we truncated to a finite dimension<fnref n="5" />, and we generalised their “line weight” to an *n*-ary Z-spider. The degree-2 Z-spider furthermore has exactly the same interpretation as the line weight. While in **QPath** the triangle nodes satisfy a bialgebra, this is not the case when truncating to finite dimension. Here we could either resort to define a “fermionic swap” that would replace the usual swap in the bialgebra (as in [25] and [49]), or give a context in which the bialgebra works (as is done in [42]). While such a “fermionic swap” exists in our setting, it does not have all the nice properties of the qubit fermionic swap, that in particular allow us to see it as a quasi-proper swap. Instead we went with the latter solution, which as it turns out works in our setting, despite the W-node having a different interpretation from that of [42], and we end up with Equation (b₂).

## 4.2 Finite Dimensional Framework

Another complete presentation of a graphical language for **FdHilb** was announced recently before the first version of the current paper [50]. This one builds upon the aforementioned ZXW-calculus, and introduces a new generator that takes two systems, of dimensions *a* and *b*, and builds a system of dimension *a* × *b*. Our approach builds upon **ZW**<sub>*d*</sub>, the qudit version of the ZW-calculus from Section 2 and hence starts with fewer generators and equations. As a consequence, the graphical language for **FdHilb** we end up with has fewer equations as well. Moreover, we did not require a new generator, and simply promoted the qudit W-node to work with any mix of dimensions in a natural manner, which was enough to provide us with universality.

A version of the ZX-calculus for **FdHilb** was recently provided and shown to be complete [41]. The proof of completeness for their graphical language was obtained by transporting the property from the **ZW**<sub>*r*</sub>-calculus of the first version of the current paper to the ZX-calculus, through a system of translations between the two languages.

# 5 Conclusion

In this paper, we explored the potential for a minimal yet complete diagrammatic language for quantum mechanics beyond qubit systems. This starts with a well-chosen generalisation of the generators of the ZW-calculus, allowing us to have few and intuitive equations. For both qudit systems and finite dimensional systems, we showed that the diagrams are universal, and that the equational theories are both minimal and complete for their respective interpretation.

<footnote n="5">⁵ The idea of truncating this tensor has also been considered in [20] during a translation between graphical languages.</footnote>
References

1 S. Abramsky and B. Coecke. A categorical semantics of quantum protocols. In *Proceedings of the 19th Annual IEEE Symposium on Logic in Computer Science, 2004.*, pages 415–425, July 2004. doi:10.1109/LICS.2004.1319636.

2 Miriam Backens. The ZX-calculus is complete for stabilizer quantum mechanics. In *New Journal of Physics*, volume 16, page 093021. IOP Publishing, September 2014. doi:10.1088/1367-2630/16/9/093021.

3 Miriam Backens and Aleks Kissinger. ZH: A complete graphical calculus for quantum computations involving classical non-linearity. In Peter Selinger and Giulio Chiribella, editors, *Proceedings of the 15th International Conference on Quantum Physics and Logic, Halifax, Canada, 3-7th June 2018*, volume 287 of *Electronic Proceedings in Theoretical Computer Science*, pages 23–42, 2019. doi:10.4204/EPTCS.287.2.

4 Miriam Backens, Aleks Kissinger, Hector Miller-Bakewell, John van de Wetering, and Sal Wolffs. Completeness of the ZH-calculus. *Compositionality*, 5, July 2023. doi:10.32408/compositionality-5-5.

5 Miriam Backens, Hector Miller-Bakewell, Giovanni de Felice, Leo Lobski, and John van de Wetering. There and back again: A circuit extraction tale. *arXiv: Quantum Physics*, 2020. arXiv:2003.01664.

6 Miriam Backens, Simon Perdrix, and Quanlong Wang. Towards a Minimal Stabilizer ZX-calculus. *Logical Methods in Computer Science*, Volume 16, Issue 4, December 2020. doi:10.23638/LMCS-16(4:19)2020.

7 Robert I. Booth and Titouan Carette. Complete ZX-Calculi for the Stabiliser Fragment in Odd Prime Dimensions. In Stefan Szeider, Robert Ganian, and Alexandra Silva, editors, *47th International Symposium on Mathematical Foundations of Computer Science (MFCS 2022)*, volume 241 of *Leibniz International Proceedings in Informatics (LIPIcs)*, pages 24:1–24:15, Dagstuhl, Germany, 2022. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.MFCS.2022.24.

8 Robert I. Booth, Titouan Carette, and Cole Comfort. Graphical symplectic algebra, 2024. doi:10.48550/arXiv.2401.07914.

9 Titouan Carette. *Wielding the ZX-calculus, Flexsymmetry, Mixed States, and Scalable Notations. (Manier le ZX-calcul, flexsymétrie, systèmes ouverts et limandes)*. PhD thesis, University of Lorraine, Nancy, France, 2021. URL: https://tel.archives-ouvertes.fr/tel-03468027.

10 Titouan Carette, Emmanuel Jeandel, Simon Perdrix, and Renaud Vilmart. Completeness of Graphical Languages for Mixed States Quantum Mechanics. In Christel Baier, Ioannis Chatzigiannakis, Paola Flocchini, and Stefano Leonardi, editors, *46th International Colloquium on Automata, Languages, and Programming (ICALP 2019)*, volume 132 of *Leibniz International Proceedings in Informatics (LIPIcs)*, pages 108:1–108:15, Dagstuhl, Germany, 2019. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.ICALP.2019.108.

11 Titouan Carette, Etienne Moutot, Thomas Perez, and Renaud Vilmart. Compositionality of Planar Perfect Matchings: A Universal and Complete Fragment of ZW-Calculus. In Kousha Etessami, Uriel Feige, and Gabriele Puppis, editors, *50th International Colloquium on Automata, Languages, and Programming (ICALP 2023)*, volume 261 of *Leibniz International Proceedings in Informatics (LIPIcs)*, pages 120:1–120:17, Dagstuhl, Germany, 2023. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.ICALP.2023.120.

12 Alexandre Clément, Noé Delorme, and Simon Perdrix. Minimal equational theories for quantum circuits, 2023. doi:10.48550/arXiv.2311.07476.

13 Bob Coecke and Ross Duncan. Interacting quantum observables: Categorical algebra and diagrammatics. *New Journal of Physics*, 13(4):043016, April 2011. doi:10.1088/1367-2630/13/4/043016.

14 Bob Coecke and Aleks Kissinger. The compositional structure of multipartite quantum entanglement. In *Automata, Languages and Programming*, pages 297–308. Springer Berlin Heidelberg, 2010. doi:10.1007/978-3-642-14162-1_25.
15 Bob Coecke and Aleks Kissinger. *Picturing Quantum Processes: A First Course in Quantum Theory and Diagrammatic Reasoning*. Cambridge University Press, Cambridge, 2017. doi: 10.1017/9781316219317.

16 Joseph Collins and Ross Duncan. Hopf-frobenius algebras and a simpler drinfeld double. *Electronic Proceedings in Theoretical Computer Science*, 318:150-180, May 2020. doi:10.4204/eptcs.318.10.

17 Niel de Beaudrap and Richard D. P. East. Simple zx and zh calculi for arbitrary finite dimensions, via discrete integrals, 2023. arXiv:2304.03310.

18 Niel de Beaudrap and Dominic Horsman. The ZX calculus is a language for surface code lattice surgery. *Quantum*, 4:218, January 2020. doi:10.22331/q-2020-01-09-218.

19 Giovanni de Felice and Bob Coecke. Quantum linear optics via string diagrams. In Stefano Gogioso and Matty Hoban, editors, *Proceedings 19th International Conference on Quantum Physics and Logic*, QPL 2022, Wolfson College, Oxford, UK, 27 June - 1 July 2022, volume 394 of *EPTCS*, pages 83-100, 2022. doi:10.4204/EPTCS.394.6.

20 Giovanni de Felice, Razin A. Shaikh, Boldizsár Poór, Lia Yeh, Quanlong Wang, and Bob Coecke. Light-matter interaction in the zxw calculus. *Electronic Proceedings in Theoretical Computer Science*, 384:20-46, August 2023. doi:10.4204/eptcs.384.2.

21 Ross Duncan and Kevin Dunne. Interacting frobenius algebras are hopf. In *2016 31st Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)*, pages 1-10, 2016.

22 Ross Duncan and Maxime Lucas. Verifying the Steane code with Quantomatic. In Bob Coecke and Matty Hoban, editors, *Proceedings of the 10th International Workshop on Quantum Physics and Logic, Castelldefels (Barcelona), Spain, 17th to 19th July 2013*, volume 171 of *Electronic Proceedings in Theoretical Computer Science*, pages 33-49. Open Publishing Association, 2014. doi:10.4204/EPTCS.171.4.

23 Ross Duncan and Simon Perdrix. Graphs states and the necessity of Euler decomposition. *Mathematical Theory and Computational Practice*, 5635:167-177, 2009. doi: 10.1007/978-3-642-03073-4.

24 Amar Hadzihasanovic. A diagrammatic axiomatisation for qubit entanglement. In *2015 30th Annual ACM/IEEE Symposium on Logic in Computer Science*, pages 573-584, July 2015. doi:10.1109/LICS.2015.59.

25 Amar Hadzihasanovic. *The Algebra of Entanglement and the Geometry of Composition*. PhD thesis, University of Oxford, 2017. arXiv:1709.08086.

26 Amar Hadzihasanovic, Kang Feng Ng, and Quanlong Wang. Two complete axiomatisations of pure-state qubit quantum computing. In *Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science*, LICS '18, pages 502-511, New York, NY, USA, 2018. ACM. doi:10.1145/3209108.3209128.

27 Anne Hillebrand. Quantum Protocols involving Multiparticle Entanglement and their Representations. Master's thesis, University of Oxford, 2011. URL: https://www.cs.ox.ac.uk/people/bob.coecke/Anne.pdf.

28 Jiaxin Huang, Sarah Meng Li, Lia Yeh, Aleks Kissinger, Michele Mosca, and Michael Vasmer. Graphical cs code transformation using zx calculus. *Electronic Proceedings in Theoretical Computer Science*, 384:1-19, August 2023. doi:10.4204/eptcs.384.1.

29 Emmanuel Jeandel, Simon Perdrix, and Renaud Vilmart. A complete axiomatisation of the ZX-calculus for Clifford+T quantum mechanics. In *Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science*, LICS '18, pages 559-568, New York, NY, USA, 2018. ACM. doi:10.1145/3209108.3209131.

30 Emmanuel Jeandel, Simon Perdrix, and Renaud Vilmart. Y-calculus: A language for real matrices derived from the zx-calculus. *Electronic Proceedings in Theoretical Computer Science*, 266:23-57, February 2018. doi:10.4204/eptcs.266.2.

31 Emmanuel Jeandel, Simon Perdrix, and Renaud Vilmart. Completeness of the ZX-Calculus. *Logical Methods in Computer Science*, Volume 16, Issue 2, June 2020. doi:10.23638/LMCS-16(2:11)2020.
32 Emmanuel Jeandel, Simon Perdrix, Renaud Vilmart, and Quanlong Wang. ZX-calculus: Cyclotomic supplementarity and incompleteness for Clifford+T quantum mechanics. In Kim G. Larsen, Hans L. Bodlaender, and Jean-François Raskin, editors, *42nd International Symposium on Mathematical Foundations of Computer Science (MFCS 2017)*, volume 83 of Leibniz International Proceedings in Informatics (LIPIcs), pages 11:1-11:13, Dagstuhl, Germany, 2017. Schloss Dagstuhl - Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.MFCS.2017.11.

33 Aleks Kissinger. Tikzit, 2019. URL: https://tikzit.github.io/index.html.

34 Aleks Kissinger and John van de Wetering. Reducing the number of non-Clifford gates in quantum circuits. *Phys. Rev. A*, 102:022406, August 2020. doi:10.1103/PhysRevA.102.022406.

35 Aleks Kissinger and John van de Wetering. Simulating quantum circuits with zx-calculus reduced stabiliser decompositions. *Quantum Science and Technology*, 7(4):044001, July 2022. doi:10.1088/2058-9565/ac5d20.

36 Aleks Kissinger, John van de Wetering, and Renaud Vilmart. Classical Simulation of Quantum Circuits with Partial and Graphical Stabiliser Decompositions. In François Le Gall and Tomoyuki Morimae, editors, *17th Conference on the Theory of Quantum Computation, Communication and Cryptography (TQC 2022)*, volume 232 of Leibniz International Proceedings in Informatics (LIPIcs), pages 5:1-5:13, Dagstuhl, Germany, 2022. Schloss Dagstuhl - Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.TQC.2022.5.

37 Mark Koch, Richie Yeung, and Quanlong Wang. Speedy contraction of zx diagrams with triangles via stabiliser decompositions, 2023. arXiv:2307.01803.

38 Stephen Lack. Composing PROPs. In *Theory and Applications of Categories*, volume 13, pages 147-163, 2004. URL: http://www.tac.mta.ca/tac/volumes/13/9/13-09abs.html.

39 Simon Perdrix and Quanlong Wang. Supplementarity is necessary for quantum diagram reasoning. In *41st International Symposium on Mathematical Foundations of Computer Science (MFCS 2016)*, volume 58 of Leibniz International Proceedings in Informatics (LIPIcs), pages 76:1-76:14, Krakow, Poland, August 2016. doi:10.4230/LIPIcs.MFCS.2016.76.

40 Boldizsár Poór, Robert I. Booth, Titouan Carette, John van de Wetering, and Lia Yeh. The quipit stabiliser zx-travaganza: Simplified axioms, normal forms and graph-theoretic simplification. *Electronic Proceedings in Theoretical Computer Science*, 384:220-264, August 2023. doi:10.4204/eptcs.384.13.

41 Boldizsár Poór, Razin A. Shaikh, and Quanlong Wang. Zx-calculus is complete for finite-dimensional hilbert spaces, 2024. arXiv:2405.10896.

42 Boldizsár Poór, Quanlong Wang, Razin A. Shaikh, Lia Yeh, Richie Yeung, and Bob Coecke. Completeness for arbitrary finite dimensions of zxw-calculus, a unifying calculus. In *2023 38th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)*, pages 1-14, 2023. doi:10.1109/LICS56636.2023.10175672.

43 Patrick Roy, John van de Wetering, and Lia Yeh. The qudit zh-calculus: Generalised toffoli+hadamard and universality. *Electronic Proceedings in Theoretical Computer Science*, 384:142-170, August 2023. doi:10.4204/eptcs.384.9.

44 Christian Schröder de Witt and Vladimir Zamdzhiev. The zx-calculus is incomplete for quantum mechanics. *Electronic Proceedings in Theoretical Computer Science*, 172:285-292, December 2014. doi:10.4204/eptcs.172.20.

45 Peter Selinger. A survey of graphical languages for monoidal categories. In *New Structures for Physics*, pages 289-355. Springer, 2010.

46 Alex Townsend-Teague, Julio Magdalena de la Fuente, and Markus Kesselring. Floquetifying the colour code. *Electronic Proceedings in Theoretical Computer Science*, 384:265-303, August 2023. doi:10.4204/eptcs.384.14.

47 Renaud Vilmart. A near-minimal axiomatisation of zx-calculus for pure qubit quantum mechanics. In *2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)*, pages 1-10, June 2019. doi:10.1109/LICS.2019.8785765.
48 Quanlong Wang. Qutrit zx-calculus is complete for stabilizer quantum mechanics. In Bob Coecke and Aleks Kissinger, editors, *Proceedings 14th International Conference on Quantum Physics and Logic, Nijmegen, The Netherlands, 3-7 July 2017*, volume 266 of Electronic Proceedings in Theoretical Computer Science, pages 58–70, 2018. doi:10.4204/EPTCS.266.3

49 Quanlong Wang. A non-anyonic qudit zw-calculus, 2021. arXiv:2109.11285.

50 Quanlong Wang and Boldizsár Poór. Completeness of qufinite zxw calculus, a graphical language for mixed-dimensional quantum computing, 2023. arXiv:2309.13014.

51 Fabio Zanasi. *Interacting Hopf Algebras – the theory of linear systems*. PhD thesis, Université de Lyon, 2015. URL: http://www.zanasi.com/fabio/#/publications.html.

## A Asymmetric Presentation for Qudit Systems

In this section, we give an alternative semantics for the ZW<sub>d</sub>-diagrams, which breaks the up/down symmetry of the generators. On the one hand, the dagger-functor becomes less natural; on the other hand, the combinatorics associated to the diagrams becomes simpler (except for the cap):

$$ 
\begin{align*}
\llbracket D_2 \circ D_1 \rrbracket_{\mathfrak{z}} &= \llbracket D_2 \rrbracket_{\mathfrak{z}} \circ \llbracket D_1 \rrbracket_{\mathfrak{z}} \\
\llbracket D_1 \otimes D_2 \rrbracket_{\mathfrak{z}} &= \llbracket D_1 \rrbracket_{\mathfrak{z}} \otimes \llbracket D_2 \rrbracket_{\mathfrak{z}} \\
\llbracket \vert \rrbracket_{\mathfrak{z}} &= \sum_k |k\rangle\langle k| \\
\llbracket \bowtie \rrbracket_{\mathfrak{z}} &= \sum_{k,l} |l, k\rangle\langle k, l| \\
\llbracket \cup \rrbracket_{\mathfrak{z}} &= \sum_k k! \langle k, k| \\
\llbracket \cap \rrbracket_{\mathfrak{z}} &= \sum_k \frac{1}{k!} |k, k\rangle \\
\llbracket \bullet \rrbracket_{\mathfrak{z}} &= |1\rangle \quad \text{and} \quad \llbracket \overline{\bullet} \rrbracket_{\mathfrak{z}} &= \langle 1| \\
\llbracket r \rrbracket_{\mathfrak{z}} &= r
\end{align*}
$$

As a direct consequence, we have:

$$ \llbracket \bullet \rrbracket_{\mathfrak{z}} = |k\rangle \quad \text{and} \quad \llbracket \overline{\bullet} \rrbracket_{\mathfrak{z}} = k! \langle k| $$

This semantics being equivalent to $[[–]]_{\mathfrak{z}}$, the equational theory of ZW<sub>d</sub>-diagrams remains universal, sound and complete in this setting.

## B Lemmas for Completeness of Qudit

The full version on Arxiv details the proof of completeness of ZW<sub>d</sub>'s equational theory, including the proof of the following derivable equations:

► Lemma 21.

$$ \mathrm{ZW}_d \vdash 1 = \text{ Nil} $$

► Lemma 22.

$$ \mathrm{ZW}_d \vdash \text{ Nil} = \text{ Nil} $$

► Lemma 23.

<figure><img src="image_9.png" /></figure>