Emmanuel Jeandel

The rational fragment of the ZX-calculus

, our axiomatisation does not use any meta-rule, but relies instead on a more natural rule, called the cyclotomic supplementarity rule, that was introduced previously in the literature.

Our axiomatisation is only complete for diagrams using rational angles, and is not complete in the general case. Using results on diophantine geometry, we characterize precisely which diagram equality involving arbitrary angles are provable in our framework without any new axioms, and we show that our axiomatisation is continuous, in the sense that a diagram equality involving arbitrary angles is provable iff it is a limit of diagram equalities involving rational angles.

We use this result to give a complete characterization of all Euler equations that are provable in this axiomatisation.

, may be expressed exactly), and the general fragment (where every matrix can be represented).

. However, the set of rules the authors found to obtain a complete axiomatisation is arguably not satisfying, as it either relies on using an additional generator (the triangle generator), or on using so-called meta-rules. We solve this problem in this article by proving that one can use instead the generalized cyclotomic rule, that was introduced previously in [11], which is an easier rule to state and to use.

. This full axiomatisation relies on adding only one new nonlinear rule, but this rule, while necessary, is arguably hard to use and understand. To better understand this new rule, we investigate when it is necessary, by characterizing exactly which diagram inequalities can be proven without using this rule. We prove in particular that diagram equalities provable without this rule are exactly the diagram equalities that are "limits" (in some sense) of diagram equalities involving only rational angles. Using this result and classical results on rotations in the three-dimensional space, we will in the last section give a complete list of all so-called Euler equations that can be proven without this rule.

1 Definitions and Statement of the Results

Syntax and Semantics

Let G be a subgroup of R that contains 2π. We call G a fragment. Of particular interest will be the following fragments:

As an abuse of notation, we will call G the π/4 fragment.

• G = { kπ 2 n , k, n ∈ Z}. We will call G the π 2 • fragment. • G = Qπ. This is the rational fragment. We will call any angle of G a rational angle.

Introduction

The ZX-calculus is a graphical calculus for quantum computing introduced by Coecke and Duncan [START_REF] Coecke | Interacting quantum observables: categorical algebra and diagrammatics[END_REF], which represent quantum evolutions (matrices) by diagrams. The language is powerful enough to represent in particular quantum circuits, and is equipped with a set of transformation rules for diagrams so that one may simplify a diagram without changing its interpretation (the matrix it represents).

The initial set of rules as presented in [START_REF] Coecke | Interacting quantum observables: categorical algebra and diagrammatics[END_REF] is not complete, in the sense that there exists two diagrams that represent the same matrix but such that one could not be transformed into the other using the set of rules. Thi initial set of rules was studied and refined over the years [START_REF] Backens | Making the stabilizer ZX-calculus complete for scalars[END_REF][START_REF] Backens | A simplified stabilizer ZX-calculus[END_REF][START_REF] Perdrix | Supplementarity is necessary for quantum diagram reasoning[END_REF] until some complete axiomatisation were found for the ZX-calculus [START_REF] Jeandel | Diagrammatic reasoning beyond clifford+t quantum mechanics[END_REF][START_REF] Jeandel | A complete axiomatisation of the ZX-calculus for Clifford+T quantum mechanics[END_REF][START_REF] Hadzihasanovic | Two complete axiomatisations of pure-state qubit quantum computing[END_REF][START_REF] Jeandel | A generic normal form for zx-diagrams and application to the rational angle completeness[END_REF].

The exact set of rules one should use depends on the particular fragment of the ZX-calculus we need, i.e. the set of angles/rotations one may use inside the diagrams. Of particular interest are the π/4 fragment (an approximatively universal fragment), the rational fragment (where most quantum circuits, e.g. The standard interpretation of the ZX-diagrams associates to any diagram D : n → m a linear map D : C 2 n → C 2 m inductively defined as follows:

R (n,m) Z (α) : n → m m • • • α • • • n R (n,m) X (α) : n → m m • • • α • • •
D 1 ⊗ D 2 := D 1 ⊗ D 2 D 2 • D 1 := D 2 • D 1 := 1 := 1 0 0 1 := 1 √ 2 1 1 1 -1 :=    
1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1

    := 1 0 0 1 :=     1 0 0 1    
For any α ∈ G, α := 1 + e iα , and for any n, m ≥ 0 such that n + m > 0:

m • • • α • • • n := 2 n        1 0 • • • 0 0 0 0 • • • 0 0 . . . . . . . . . . . . . . . 0 0 • • • 0 0 0 0 • • • 0 e iα                     2 m m • • • α • • • n := ⊗m • m • • • α • • • n • ⊗n where M ⊗0 = 1 and M ⊗k = M ⊗ M ⊗k-1 for any k ∈ N * .
In the particular case where we want to emphasize the phase group G in which the angles α live, we will write ZX G instead of ZX.

Rules for the π 2 • fragments

The set of rules of Figure 1 has been introduced in [START_REF] Jeandel | A complete axiomatisation of the ZX-calculus for Clifford+T quantum mechanics[END_REF] and has been proven complete for the π/4 fragment. As subtler distinctions are not needed in this article, we will suppose that all the rules of Figure 1 are given for all possible, real, values of the angles α, β, γ.

Given two diagrams D 1 , D 2 , we say that ZX ⊢ D 1 = D 2 if we can prove that the two diagrams are equal using only the axioms of Figure 1, along with some natural topological axioms not presented for simplicity.

The theorem of [START_REF] Jeandel | A complete axiomatisation of the ZX-calculus for Clifford+T quantum mechanics[END_REF] can be rephrased as follows: If D 1 and D 2 are two diagrams with angles only in the π/4 fragment, and

D 1 = D 2 , then ZX ⊢ D 1 = D 2 .
The result is actually a bit stronger, as we only to consider the restrictions of the rules of Figure 1 to angles in the π/4 fragment (said otherwise: to prove that two diagrams of the π/4 fragment are equal, we do not need e.g. to introduce the angle π/8 or any other angle). We write this for reference but we stress again that this distinction is not needed in this paper.

Later in [START_REF] Jeandel | A generic normal form for zx-diagrams and application to the rational angle completeness[END_REF], it has been proven that the same set of rules is actually complete for the π/2 • fragment. In fact, using the proof methods from [START_REF] Jeandel | Diagrammatic reasoning beyond clifford+t quantum mechanics[END_REF], one can prove an even stronger result:

Theorem 1. Let D 1 (α) and D 2 (α) be two ZX-diagrams linear in α = α 1 , . . . α k with constants in π 2 • Z. If D 1 (α) = D 2 (α) for all values of α, then ZX ⊢ D 1 (α) = D 2 (α) for all values of α.
By a diagram linear in α, we mean that every angle appearing in the diagram is a linear combination with integer coefficients of the angles α i , possibly with a constant term in π 2 • Z. The exact definition may be found in [START_REF] Jeandel | Diagrammatic reasoning beyond clifford+t quantum mechanics[END_REF]. While the theorem was only proven for the π/4 fragment in [START_REF] Jeandel | Diagrammatic reasoning beyond clifford+t quantum mechanics[END_REF], it is easy to see that the same method of proof gives the result for this larger fragment.

The Qπ-fragment

The set of axioms of Figure 1 is not enough for completeness of bigger fragments of the ZX-calculus and additional axioms are needed.

In [START_REF] Jeandel | A generic normal form for zx-diagrams and application to the rational angle completeness[END_REF], the authors have introduced a "meta-axiom" to obtain a set of rules complete for the Qπ fragment.

If one does not want meta-axioms, one can see from the same article that the set of axioms represented in Figure 2 is enough to obtain a complete set of rules:

If two diagrams D 1 , D 2 with rational angles are equal, then ZX ∪ {CY C p , p ≥ 3} ⊢ D 1 = D 2 .
This set of rules relies on an additional generator, the triangle generator, which is related to the right side of the (BW ) rule: The standard interpretation of this new generator is the matrix 1 1 0 1 .

• • • • • • α . . . β • • • • • • = (S1) • • • β + α • • • = (S2) = (S3) = (B1) = (B2) -π 4 π 4 = (E) α β π α γ β -γ = (C) β α π β -γ α γ = (EU) π 2 π 2 -π 2 π α = (K) α π -α π π 4 π 4 π 4 π 4 -π 2 π 4 π 4 = (BW) π 2 π 4 π 4 π π π 4 π 4 • • • α • • • = (H) • • • α • • • α α + π = (SUP) 2α + π

The general fragment

Adding the cyclotomic axioms is again not enough to obtain completeness for the general fragment. An additional axiom, presented in Figure 3 was introduced in [START_REF] Jeandel | Diagrammatic reasoning beyond clifford+t quantum mechanics[END_REF], and it is proven that this new axiom is sufficient to obtain a complete axiomatisation (Another axiomatisation, relying on much more axioms, was also given independently in [START_REF] Hadzihasanovic | Two complete axiomatisations of pure-state qubit quantum computing[END_REF]).

π π 4 π 4 θ 1 π 2 θ 2 -α α β -β = θ 3 -γ γ π 4 π 4
Assuming 2e iθ3 cos(γ) = e iθ1 cos(α) + e iθ2 cos(β)

Figure 3: The general rule (A).

Compared to the other rules, it is important to note that this one cannot be applied everywhen, but only if the angles satisfy the technical condition stated on the rule.

Results

We are now ready to state the main results of the paper.

The results are twofold. First, we prove that the ugly rule of Figure 2 can be represented by the well known generalized supplementarity rule. This rule was introduced in [START_REF] Jeandel | ZX-calculus: Cyclotomic supplementarity and incompleteness for Clif-ford+T quantum mechanics[END_REF] and is the content of Figure 4.

(SU P p ) α α + 2π p • • • α + 2(p-1)π p = • • • pα + (p -1)π
Figure 4: The generalized supplementarity rules (SU P p ).

The result may be stated as follows: For any prime number p, ZX ∪ {SU P p } ⊢ CY C p . It is interesting to note that the proof uses complicated angles: To prove CY C 11 for instance, our proof uses diagrams involving the angle π/32.

Our second series of results concern the other ugly rule of Figure 3. This rule is the only rule that is nonlinear and involves a precondition to be tested. This rule is known to be necessary, but we are interested here in what can be proved without this rule.

Here are our results:

• An equality D 1 = D 2 is provable without rule (A) iff it is a specialization of a more general diagram equality D ′ 1 (α 1 , α 2 . . . , α n ) = D ′ 2 (α 1 , α 2 , . . . α n ) with rational angles, that is: -For all values of α i , ZX ⊢ D ′ 1 (α 1 , α 2 . . . , α n ) = D ′ 2 (α 1 , α 2 , . . . α n ) -D ′
1 and D ′ 2 use, apart from α 1 . . . α n , only rational angles. -For some value of α 1 . . . α n , D 1 and D 2 are equal respectively to

D ′ 1 (α 1 , α 2 . . . α n ) and D ′ 2 (α 1 , α 2 . . . α n ). • An equality D 1 = D 2 is provable without rule (A) iff it is a "limit" of dia-
gram equalities involving only rational angles: There exists two sequences of diagrams D n 1 and D n 2 with rational angles s.t.

-For all n, ZX ⊢

D n 1 = D n 2 -D n 1 n→∞ ----→ D 1 -D n 2 n→∞ ----→ D 2
Convergence here is to be understood as point-wise convergence of angles: Diagrams D n 1 and D n 2 are structurally identical to D 1 and D 2 , but with different angles, that converge to the real angles when n goes to infinity.

• As a consequence of the previous result, we give a complete characterization of all equalities related to the Euler decomposition that are provable without rule (A). This list is not surprising and contains all usual suspects.

2 Cyclotomic Supplementarity as a sufficient rule

In this section, we will prove that the ZX-calculus as presented in Figure 1 together with the supplementarity rules (SU P p ) of Figure 4 is a complete axiomatisation of the rational fragment of the ZX-calculus.

The article [START_REF] Jeandel | A generic normal form for zx-diagrams and application to the rational angle completeness[END_REF] introduced a meta-rule to make the ZX-calculus complete for the rational fragment. However, it is also clear from the article that the set of rules CY C p gives also a complete axiomatisation:

Theorem 2 ([8]
). The axioms of ZX, as presented in Figure 1, together with the axioms (CY C p ) for prime numbers p as presented in Figure 4 is a complete axiomatisation of the rational fragment of the ZX-calculus.

We will prove in this section that we can replace the cyclotomic axioms CY C p by the supplementarity axioms: Theorem 3. Let p be an odd prime number. Then ZX ∪ {SU P p } ⊢ CY C p .

We now proceed to the proof of the theorem. In all the following, p is fixed to some odd prime number.

We will first explain informally the structure of the proof. If terms of interpretation, the supplementarity rule SU P p is stating that for all α, P 1 (e iα , e iβ ) P 2 (e iα , e iβ ) = P 3 (e iα , e iβ ) P 4 (e iα , e iβ ) where P, Q, P ′ , Q ′ are some polynomials, and

β = 2π/p. The cyclotomic rule CY C p is stating that 1 R(e iβ ) = 1 0
for some polynomial R and β = 2π/p. To obtain CY C p from SU P p , we will proceed in two steps:

• First, rewrite SU P p in such a way that the new diagram equality can be interpreted, as saying, in terms of interpretation that:

1 S(e iα , e iβ ) = 1 0 when β = 2π/p.

• It turns out that the polynomial R involved in the cyclotomic rule CY C p is actually one of the terms of the polynomial S. In the next step, we will explain how this term can be extracted diagrammatically, which will prove the result. Now, for the first step. Using elementary manipulation, we get to rewrite the supplementarity in the form Lemma 1. The following diagram equation is provable in ZX ∪ {SU P p }:

π pα π α α + 2π p • • • α + 2(p-1)π p ⊗p = π pα
In terms of matrices, this can be interpreted as the following equality:

1 2 (1 + e ipα ) k (e iα+2kπ/p + 1) + (1 -e ipα ) k (e iα+2kπ/p -1) -(1 -e ipα ) k (e iα+2kπ/p + 1) -(1 + e ipα ) k (e iα+2kπ/p -1) = 2e piα 0
or more simply

P (e iα ) Q(e iα ) = 2e piα 0
for some polynomials P and Q. The next step is to split this diagram into two diagrams, one that speaks of P , and one that speaks of Q. For this we introduce three diagrams. D is the generalization of the supplementarity diagrams, and D 1 , D 2 somehow corresponds to the two polynomials. Definition 1. We define three (families of ) diagrams as follows:

D(α, β) = π pα π α α + β • • • α + (p -1)β ⊗p D 1 (α, β) = pα α α + β • • • α + (p -1)β ⊗p D 2 (α, β) = π pα + π α α + β • • • α + (p -1)β ⊗p
The three diagrams have the following interpretations:

D(α, β) = 1 2 (1 + e ipα ) k (e iα+kβ + 1) + (1 -e ipα ) k (e iα+kβ -1) -(1 -e ipα ) k (e iα+kβ + 1) -(1 + e ipα ) k (e iα+kβ -1) = P (e iα , e iβ ) Q(e iα , e iβ ) D 1 (α, β) = 1 1 2 (1 + e ipα ) k (e iα+kβ + 1) + (1 -e ipα ) k (e iα+kβ -1) = 1 P (e iα , e iβ ) D 2 (α, β) = 1 -1 2 (1 -e ipα ) k (e iα+kβ + 1) + (1 + e ipα ) k (e iα+kβ -1) = 1 Q(e iα , e iβ )
We therefore have the following: Proposition 1. The following equations are provable in ZX ∪ {SU P p }:

(i) π D 1 (α, β) D 2 (α, β) = D(α, β) (ii) π D 1 (α, β) D 1 (α, β) = π D 1 (α, β) (iii) D 1 (α, β) = (iv) π D 1 (α, β) = D(α, β) (v) D(α, 2π p ) = π pα
Proof. The first four are true for all α, β and are therefore provable by Theorem 1.

The last one is the supplementary equality in the form provided by the previous lemma.

Proposition 2. The following equation is provable in ZX ∪ {SU P p }:

D 2 (α, 2π p ) = Proof.
By putting (i) and (v) together we get:

π D 1 (α, 2π p ) D 2 (α, 2π p ) = π pα Therefore: D 1 (α, 2π p ) π D 1 (α, 2π p ) D 2 (α, 2π p ) = π pα D 1 (α, 2π p )
Applying (ii) on the left and simplifying the right term:

D 2 (α, 2π p ) π D 1 (α, 2π p ) = π pα D 1 (α, 2π p )
Now we apply (iv) then (v) on the left and (iii) on the right: That is, at least one term of the matrix is fixed to a value that doesn't depend on e iα (and is nonzero). Now, the equality of the previous proposition means that Q(e iα , e i 2π p ) is identically 0, which means that each coefficient of the polynomial (in e iα ) is equal to 0.

D 2 (α, 2π
It is easy to see that the first coefficient of Q(e iα , e iβ ) is 0 (independently of β).

Notice that the term of degree 1 (in e iα ) of the polynomial Q(e iα , e iβ ) is exactly -1 -e iβ -e i2β -• • • -e i(p-1)β .

If we find a way to retrieve the term of degree 1 of a polynomial with a diagrammatic construction, we are close to our result. This is done with the following result:

Proposition 3. Let P (X) = r≤d a r X r be a polynomial of degree d. Choose n such that 2 n > d. Then

2 n -1 k=0 P (e 2kiπ/2 n ) e 2kiπ/2 n = 2 n a 1
Proof. Indeed k e 2irkπ/2 n = 0 if r = 0 mod 2 n and k e 2irkπ/2 n = 2 n otherwise.

We will use this idea to extract diagrammatically the first coefficient of our polynomial.

Definition 2. We define recursively a family of diagrams W n as follows:

W 1 = W n • • • = W 1 W n-1 • • • W n-1 • • •
For reference, here are the interpretations of W 1 and W 2 :

1 0 0 0 0 1/2 1/2 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1/4 1/4 0 1/4 0 0 0 1/4 0 0 0 0 0 0 0 It is easy to see by induction that W n is the matrix whose first row contains a 1 in position 0 and whose second row contains 2 -n in position 2 i for all i.

The astute reader may remark that W n is a slight variant of the W-state presented e.g. in the ZW calculus [START_REF] Hadzihasanovic | A diagrammatic axiomatisation for qubit entanglement[END_REF].

The previous proposition then gives us immediately the following:

Proposition 4. Let n be big enough s.t. 2 n > 2p.
The following equality is provable in ZX:

p -1 β = π W n -0π 2 n D 2 (0, β) • • • -kπ 2 n D 2 ( kπ 2 n , β) • • • -(2 n -1)π 2 n D 2 ( (2 n -1)π 2 n
, β)

(the brace means this part of the diagram should be repeated p -1 times).

Proof. By the previous proposition, the two diagrams have the same interpretations (the interpretation of D 2 is a polynomial of degree 2p < 2 n in e iα ). Now these two diagrams are (apart from β) diagrams where all angles are of the form kπ/2 n and the two diagrams have the same interpretations for all possible values of β. Therefore the equality is provable by Theorem 1.

Proposition 5. The following is provable in ZX ∪ {SU P p }.

p -1 2π p = That is, ZX ∪ {SU P p } ⊢ CY C p .
Proof. By the previous proposition and Proposition 2:

p -1 2π p = π W n -0π 2 n • • • -kπ 2 n • • • -(2 n -1)π 2 n
Therefore:

p -1 2π p = π W n • • • • • •
And therefore:

p -1 2π p =
where the last equality comes from the fact the two right terms have the same interpretations and are in the fragment π/4 and therefore are provably equal by completeness.

Equalities provable without rule (A)

In this section we characterize which diagram equalities D 1 = D 2 can be proven without rule (A). This section will primarily deal with vectors of variables. The notation a in this section will denote the vector a 1 . . . a n . The size of the vector is usually either irrelevant or obvious from the context. On some occasions, we will use the notation (a i ) i∈I which is not a typo, but refers to a tuple of vectors.

Greek letters will represent variables. By an abstract diagram D 1 (α) we mean a diagram of the ZX-calculus where some of the angles inside the green and red nodes are replaced by some of the variables α i . We say the diagram is rational if the other angles are in Qπ. If x is a vector of real numbers of the same size as α, we denote by D 1 (x) the diagram where the variable α i is replaced by the real number x i .

Many of the results of this section are based on the following remark. Consider two abstract diagrams D 1 (α) and D 2 (α). Then the set

S = {x ∈ R l | D 1 (x) = D 2 (x) }
has a special structure that can be exploited. This special structure is best evidenced by not seeing S as a subset of (vectors of) reals, but as points of the unit circle, i.e. by investigating:

S ′ = {e ix | D 1 (x) = D 2 (x) }
We will then rely on classical results from algebraic group theory and diophantine geometry. The two main results we will use is the fact that any linear commutative compact groups is a quasi-torus [START_REF] Onishchik | Lie groups and algebraic groups[END_REF] (which is well-known in linear algebraic group theory, or in Lie theory, and easy to prove once all relevant definitions are given), and the Mordell-Lang conjecture on rational points on algebraic varieties (which is lesser known and whose proof is much harder, even in our context [START_REF] Laurent | Equations diophantiennes exponentielles[END_REF]).

To simplify the exposition, we will state these classical results only when necessary, and only in terms of real numbers (or in terms of numbers in the quotient space R/2πZ which is compact), but the reader should be aware that the results in the cited litterature are usually expressed in terms of points of the unit circle.

To begin our investigation, we note that we can do the same trick as in the beginning of the paper: From the fact ZX ∪ {SU P p , p ≥ 3} is complete for the rational fragment, we deduce that all linear equalities are also provable.

It will be useful in what follows to state this theorem precisely, which needs a few notations.

By an affine form, we mean a function of the form f (α) = f (α 1 , . . . , α k ) = p 0 + p i α i where all coefficients p i are integer. The form is rational if p 0 is a rational angle. It is linear if p 0 = 0. By a (rational) affine transformation F , we mean a finite sequence of (rational) affine forms f 1 . . . f n , and we will write F (α) for f 1 (α), . . . f n (α). Notice that a linear affine transformation is essentially a matrix with integer coefficients. Theorem 4. Let D 1 (α) and D 2 (β) be two abstract rational ZX-diagrams.

Let F, G be two rational transformations s.t. for all (vector of ) angles x,

D 1 (F (x)) = D 2 (G(x))
Then for all angles x,

ZX ∪ {SU P p , p ≥ 3} ⊢ D 1 (F (x)) = D 2 (G(x))
This theorem follows mutatis mutandis from the similar theorem in [START_REF] Jeandel | Diagrammatic reasoning beyond clifford+t quantum mechanics[END_REF].

Our first result in this section is that this previous theorem is somehow an if and only if: Theorem 5. Let D 1 (α) and D 2 (β) be two abstract rational diagrams of the ZX-calculus Let x and y be two (vectors of ) angles.

Then the following are equivalent:

(i) ZX ∪ {SU P p , p ≥ 3} ⊢ D 1 (x) = D 2 (

y)

(ii) There exists n s.t. for all positive integers k ≡ 1 mod n:

D 1 (kx) = D 2 (

ky)

(iii) There exist rational affine transformations F, G s.t.

• For all values of z, we have

D 1 (F (z)) = D 2 (G(z))
• There exist some value of z s.t. x = F (z) and y = G(z)

What this theorem means is that there is no coincidence: If a diagram equality is provable without the rule (A), then the diagram equality is not provable only for the angles that appear in it, but (ii) is also provable if all angles are multiplied by some constants and (iii) the diagram equality is actually an instance of a much more general diagram equality.

We note that it is likely that (i) → (iii) could be proven directly by a cumbersome induction on the structure of the proof. However, we will adopt here an algebraic approach that will be useful for the next theorem.

Proof. (iii) → (i) is exactly the statement of the previous theorem. Now let's prove (i) → (ii). First, as a diagram with variables α is a fortiori a diagram with variables α and β, we may suppose wlog that D 1 and D 2 are two diagrams with the same set of variables α and that x = y. Now suppose that ZX ∪ {SU P p , p ≥ 3} ⊢ D 1 (x) = D 2 (x). As a proof is finite, only finitely many axioms of the form SU P p are used. Let q be an upper bound of the denominators p of the rational angles kπ/p that are involved in the diagrams D 1 and D 2 and on the numbers p s.t. SU P p is used in the proof.

In particular, we have

ZX ∪ {SU P p , p < q} ⊢ D 1 (x) = D 2 (x).
Let n = 8q! and let k be an integer.Consider the two diagrams D 1 (x) and D 2 (x) where all angles are multiplied by kn + 1.

By our choice of q, it is easy to see that all rational coefficients inside D 1 and D 2 do not change. Therefore the two new diagrams we obtain are actually equal to D 1 ((kn + 1)x) and D 2 ((kn + 1)x) Furthermore, by our choice of q, all axioms of ZX and SU P p , p < q remain valid where their angles are multiplied by kn + 1. As a consequence, we have for all k, ZX ∪ {SU P p , p < q} ⊢ D 1 ((kn + 1)x) = D 2 ((kn + 1)x)

In particular for all positive values of k, D 1 ((kn + 1)x) = D 2 ((kn + 1)x) . Now let's prove (ii) → (iii). As before we may suppose wlog that D 1 and D 2 are two diagrams with the same set of variables α and that x = y. Let m be the size of x.

Let S = {(kn + 1)x, k ≥ 0}, seen as a subset of (R/2πZ) m and X be its topological closure. Each individual coefficient of the interpretation of D 1 (α) and D 2 (α) is an exponential polynomial in α, and therefore is continuous. As a consequence, for all z ∈ X, we have D 1 (z) = D 2 (z) .

It remains to know what X looks like. Such sets have been extensively studied in the context of algebraic groups. To be more exact, {knx, k ≥ 0} is a monoid, and its closure Y is a compact subgroup of (R/2πZ) m , and each such group is a linear quasi-torus [START_REF] Onishchik | Lie groups and algebraic groups[END_REF], which means that there exists a rational linear transformation F and finitely many (vectors of) rational numbers (l i ) i∈I s.t.

Y = i∈I {F (z) + l i , z ∈ (R/2πZ) m }
It is a routine exercise1 to show that this implies the same result for X = x + Y :

X = i∈I {F (z) + l ′ i , z ∈ (R/2πZ) m } = i∈I {F i (z), z ∈ (R/2πZ) m }
for some rational forms F i .

As a nontrivial example, let

x = ( √ 2, 2 √ 3, π/3 + √ 2, √ 2 + √
3) and n = 3. Then one can prove with some work (using linear independence of √ 2, √ 3 and π) that the topological closure Y of {knx, k ≥ 0} can be defined by Y = {(t, 2u, t, u + t), (t, u) ∈ (R/2πZ) m } ∪ {(t, 2u, π + t, t + u), (t, u) ∈ (R/2πZ) m }. Similarly, one can prove that the topological closure X of S = {knx+1, k ≥ 0} is X = {(t, 2u, π/3 + t, u + t), (t, u) ∈ (R/2πZ) m } ∪ {(t, 2u, 4π/3 + t, t + u), (t, u) ∈ (R/2πZ) m }. Now x ∈ X. Therefore there exists i s.t. x ∈ {F i (z), z ∈ (R/2πZ) m }. Then

• {F i (z), z ∈ (R/2πZ) m } ⊆ X and therefore D 1 (F (z)) = D 2 (F (z)
) for all values of z.

• x ∈ {F i (z), z ∈ (R/2πZ) m }, therefore there exists z s.t x = F i (z).

Such sets have been widely used in the context of the Mordell-Lang conjecture, and it is known that each of them is the finite union of translates of algebraic groups, which is in our particular case a result of Laurent [START_REF] Laurent | Equations diophantiennes exponentielles[END_REF]. In our formalism, this can be rewritten as follows: There exists finitely many rational affine transformations (F j ) j∈J s.t. (as before)

X = j∈J {F j (z), z ∈ (2πQ/2πZ) m }
Now as J is finite, infinitely many of the x i are in the same set, say F j . Write S = {F j (z), z ∈ (2πQ/2πZ) m }. By taking a subsequence, we may suppose that all of the x i are in S.

• S ⊆ X. Therefore for all w ∈ S, D 1 (w) = D 2 (w) .

• Therefore for all z ∈ (2πQ/2πZ) m , D 1 (F j (z)) = D 2 (F j (z)) . By continuity this is also true for any z ∈ (R/2πZ) m .

• Therefore by Theorem 4, the equality is not only true but provable: For all z, we have ZX ∪

{SU P p , p ≥ 3} ⊢ D 1 (F j (z)) = D 2 (F j (z))
• Now it remains to show that there exists some z s.t. F j (z) = x which will prove that ZX ∪ {SU P p , p ≥ 3} ⊢ D 1 (x)) = D 2 (x). But this is obvious: For each i, as x i ∈ S, we may find z i ∈ (R/2πZ) m s.t. F j (z i ) = x i and we may suppose (upto a converging subsequence) that z i converges to some z. And for this particular z we have F j (z) = x.

Applications to Euler transforms

As an application of the previous result, we will characterize in this section the set of Euler equalities that are provable without rule (A). By a Euler equality, we mean an equality of the form:

α 3 α 2 α 1 = β 3 β 2 β 1
possibly also involving (nonzero) scalars. For simplicity of the presentation, we will not represent the scalars in the proofs. Our main result is the following:

Theorem 7. The only Euler equalities that are provable in ZX ∪{SU P p , p ≥ 3} are:

α 3 + nπ (-1) n α 2 nπ = mπ (-1) m α 3 α 2 + mπ nπ (-1) n α 2 (m + n)π = α 2 -β 1 mπ (-1) m β 1 (-1) n α 2 nπ mπ -α 2 = nπ -α 3 mπ (-1) m α 3 nπ + α 3 nπ + π/2 nπ + π/2 = mπ + π/2 mπ + π/2 mπ + α 3 nπ + α 3 nπ + π/2 nπ -π/2 = mπ + π/2 mπ -π/2 mπ -α 3 mπ -π/2 nπ + α 3 nπ + π/2 = mπ + π/2 mπ + α 3 nπ -π/2 mπ -π/2 nπ + α 3 nπ + π/2 = mπ -π/2 mπ -α 3 nπ + π/2
and their color-swapped variants.

Our method to prove the result is obvious from the previous sections: We only have to find the Euler equalities satisfied by rational angles to deduce the equalities satisfied by arbitrary angles.

To find Euler equalities for rational angles, we will use the following result, original formulated in the context of tilings • Suppose that α 2 = π. Then we get immediately β 1 = π so that the top-left coefficients are equal.

The quotient of the bottom-left value by the top-right value should be equal in the two matrices, and we get β 2 = -α 1 .

• If α 2 = 0, we get by a similar argument that β 1 = 0 and β 2 = α 1 .

• If α 2 ∈ {0, π}, we can look again at the two quotients (as the denominators are nonzero) and we get simultaneously β 2 = α 1 and β 2 = -α 1 , and therefore β 2 = α 1 = 0 or β 2 = α 1 = π from which we get the same conclusions as before by the red-green symmetry.

Proof ot the theorem. It is enough to find all equalities relating rational angles. Take such an equality. By slightly rewriting it, we see that the diagram

α 3 α 2 α 1 -β 1 -β 2 -β 3
represents the identity matrix upto a scalar. By Theorem 8, one of the coefficient should be in {0, π} or two consecutive coefficients are equal to ±π/2. The rest of the proof is just an enumeration of all possible cases.

• α 1 = nπ. Then the equation can be rewritten:

α 3 + nπ (-1) n α 2 = β 3 β 2 β 1
and therefore

α 3 + nπ (-1) n α 2 -β 1 = β 3 β 2
upto a scalar. We therefore get the first two cases of the theorem by the previous proposition.

• The cases α 3 = nπ, β 1 = nπ, β 3 = nπ are treated in the same way and give symmetric conditions.

• The cases α 2 = nπ, β 2 = nπ can be treated by rewriting the equality in the form

-β 3 α 3 α 2 = β 2 β 1 -α 1
and we recover one of the previous cases.

• α 1 = π/2 and α 2 = π/2. Then the equation can be rewritten: and we can apply the previous proposition. We obtain the fourth case of the theorem for n = 0 (notice that (-1) m π/2 = mπ + π/2).

• α 1 = -π/2 and α 2 = -π/2 is treated in a similar way and gives use the fourth case with n = 1.

• α 1 = -π/2 and α 2 = π/2. The same computation gives us: And we apply again the proposition.

• The case {α 2 , α 3 } ⊆ {π/2, -π/2} is done in the same way. The case {α 1 , β 1 } ⊆ {π/2, -π/2} is done by rewriting the equality as before.

nH : 1 → 1 e : 0 → 0 I : 1 → 1 σ : 2 → 2 ǫ : 2 1 .•

 110112221 → 0 η : 0 → 2 where n, m ∈ N and α ∈ G. The generator e is the empty diagram. and the two compositions: • Spacial Composition: for any D 1 : a → b and D 2 : c → d, D 1 ⊗ D 2 : a + c → b + d consists in placing D 1 and D 2 side by side, D 2 on the right of D Sequential Composition: for any D 1 : a → b and D 2 : b → c, D 2 • D 1 : a → c consists in placing D 1 on the top of D 2 , connecting the outputs of D 1 to the inputs of D 2 .

Figure 1 Figure 2 :

 12 Figure 1: Rules

  result. Now the advantage of the diagram D 2 over the original supplementarity equation is that its interpretation is 1 Q(e iα , e i 2π p )

2 :

 2 Theorem 8 ([18]). Let α 1 . . . α n ∈ Qπ s.t. the diagram 3 α n . . .

α 2 α 1 representsProposition 6 . 2 α 1 β 2 β 1 represents 2 e

 1621212 the identity matrix up to a scalar. Then either there exists i s.t. α i ∈ {0, π} or there exists i s.t. {α i , α i+1 } ⊆ {π/2, -π/2}. Now we can begin the proof of the theorem. We first investigate the case of equalities involving only four nodes: Suppose that the two diagrams α the same matrix up to a scalar. Then either (α 1 = β 2 = nπ and β 1 = (-1) n α 2 ) or (α 2 = β 1 = nπ and β 2 = (-1) n α 1 ).Proof. The two diagrams represents respectively the matrices:1 2 e iα2 + 1 (1 -e iα2 )e iα11 -e iα2 (1 + e iα2 )e iα1 and 1 iβ1 + 1 1 -e iβ1 (1 -e iβ1 )e iβ2 (1 + e iβ1 )e iβ2

α 3 -α 3 -β 1 = β 3 -

 3313

2 -α 3 -β 1 = β 3 -π/2 β 2

 2132

Notice that nx ∈ Y therefore nx = F (w) + l i for some w and some i thus x = F (w/n) + ℓ for some (vector of) rational angles ℓ. The result follows by a change of variables

The astute reader should remark that this theorem subsumes most of the results of Backens[START_REF] Backens | The ZX-calculus is complete for the single qubit Clif-ford+T fragment[END_REF] and Mastumoto-Amano[START_REF] Matsumoto | Representations of quantum circuits with Clifford and π/8 gates[END_REF].

the last node is green if n is even, and red otherwise.

Corollary 1. Let D 1 (α) and D 2 (β) be two rational diagrams of the ZX-calculus Suppose that ZX ∪ {SU P p , p ≥ 3} ⊢ D 1 (x) = D 2 (y) for some angles x, y.

Then there exist two sequences of (vectors of ) rational angles x i , y i that converges respectively to x and y s.t. for all values of i,

Proof. Use (i) → (iii) in the previous theorem, and choose a sequence of rational angles z i that converges to z and take x i = F (z i ) and

This is actually a characterization: Theorem 6. Let D 1 (α) and D 2 (β) be two rational diagrams of the ZX-calculus.

Let x i , y i be two sequences of rational angles that converge respectively to x and y and s.t. for all values of i,

Corollary 2. A limit of provable equalities is again a provable equality.

Proof ot the Corollary. Let x i , y i be two sequences of angles that converge respectively to x and y and s.t. for all values of i,

By the previous corollary, we may find, for each i, rational angles arbitrarily close to x i and y i s.t. the equality remains provable for these angles.

But this implies that we can find rational angles arbitrarility close to x and y s.t. the equality remains provable for these angles. Which implies by the previous theorem that ZX ∪ {SU P p , p

Proof of the Theorem. As before, by seeing D 1 and D 2 as diagrams over a bigger set of variables, we may suppose wlog that x i = y i . Now, the key idea is to consider

X is therefore the set of (vectors of) rational angles for which the diagram equality is true. We note that all x i are in X. Now take Y = {e iz , z ∈ X} Each individual coefficient of D 1 and D 2 are polynomials in e iz1 . . . e iz l . The set Y itself can therefore be seen as the intersection between the set of zeroes of some polynomials, and the set of (vectors consisting of) roots of unity.

Further work

The work that has been done for the Euler equalities can be also done for the rule (A) itself, to find for which angles rule (A) is actually provable without rule (A). The technical condition below rule (A) can be rewritten as a sum of 6 exponential terms, and has been investigated previously by Mann [START_REF] Henry | On linear relations between roots of unity[END_REF] and Conway and Jones [START_REF] Conway | Trigonometric diophantine equations[END_REF] (see in particular Theorem 6). The most complicated equality with rational angles uses angles of the form π/3 and π/5.

Replacing the rule CY C p (or the metarule) by the rule SU P p gives a nicer set of rules for the rational fragment of the ZX-calculus. What remains is to find a nicer replacement for rule (A) for the full fragment. The obvious candidate is of course Euler equalities, but we do not know if adding Euler equalities to the rule of ZX is sufficient to prove rule (A) in its full generality.