A Simplified Stabilizer ZX-calculus

Report 5 Downloads 242 Views
arXiv:1602.04744v1 [quant-ph] 15 Feb 2016

A Simplified Stabilizer zx-calculus Miriam Backens

Simon Perdrix

Quanlong Wang

School of Mathematics, University of Bristol, UK [email protected]

CNRS, LORIA, Universit´e de Lorraine, France [email protected]

LORIA, Universit´e de Lorraine, France [email protected]

The stabilizer zx-calculus is a rigorous graphical language for reasoning about stabilizer quantum mechanics. This language has been proved to be complete in two steps: first in a setting where scalars (diagrams with no inputs or outputs) are ignored [1] and then in a more general setting where a new symbol and three additional rules have been added to keep track of scalars [2]. Here, we introduce a simplified version of the stabilizer zx-calculus: we give a smaller set of axioms and prove that meta-rules like ‘only the topology matters’, ‘colour symmetry’ and ‘upside-down symmetry’, which were considered as axioms in previous versions of the stabilizer zx-calculus, can in fact be derived. In particular, we show that the additional symbol and one of the rules introduced for proving the completeness of the scalar stabilizer zx-calculus are not necessary. We furthermore show that the remaining two rules dedicated to scalars cannot be derived from the other rules, i.e. they are necessary.

1

Introduction

The zx-calculus is a high-level and intuitive graphical language for pure qubit quantum mechanics (QM), based on category theory [4]. It comes with a set of rewrite rules that potentially allow this graphical calculus to be used to replace matrix-based formalisms entirely for certain classes of problems. However, this replacement is only possible without losing deductive power if the zx-calculus is complete for this class of problems, i.e. if any equality that is derivable using matrices can also be derived graphically. The overall zx-calculus for pure state qubit quantum mechanics is incomplete, and it is not obvious how to complete it [10]. Yet, the zx-calculus is complete for stabilizer quantum mechanics [6]. Stabilizer QM is a restricted fragment of quantum theory – in fact, it is efficiently classically simulable [7] – that nevertheless exhibits many important quantum properties, like entanglement and non-locality. It is furthermore of central importance in areas such as quantum error correcting codes [8] and measurementbased quantum computation [9]. The completeness of the stabilizer zx-calculus has been established first in a setting where scalars (i.e. diagrams with no input nor output) are ignored [1]. In this setting, when two diagrams are equal according to the rules of the language, their matrices are equal up to a non-zero scalar factor. To make the stabilizer zx-calculus with scalars complete, a new symbol and three rules have been added to the original zx-calculus [2]. We simplify the proof of completeness for the scaled stabilizer zxcalculus by showing that there is no need to introduce a new symbol for making the language complete for scalars. Moreover, we show that one of the three new axioms is not necessary and can be derived from the rest of the language. We end up with only two rules that we prove to be necessary. Beyond the treatment of scalars, we also consider a simplified set of rules for the full stabilizer zx-calculus. Usually, in addition to about a dozen of explicit rewrite rules, there is a convention that any rule also holds with the colours red and green swapped or with the diagrams flipped upside-down,

2

A Simplified Stabilizer zx-calculus

effectively nearly quadrupling the available set of rewrite rules1 . Furthermore, the zx-calculus generally includes a meta-rule ‘only the topology matters’, which means that two diagrams represent the same matrix whenever one can be transformed into the other by moving components around without changing their connections. Here, we give a new system of just nine rules for the stabilizer zx-calculus with scalars. We prove that these rules are sound and that all the old rules, including their colour-swapped and upside-down versions, as well as the meta-rule ‘only the topology matters’ (explicitly the commutativity of the green copy and its colour-swapped and upside-down versions), can be derived from the new system of rules. This implies that the simplified rule system is complete. In other words, we have a greatly simplified stabilizer zx-calculus.

2

The zx-calculus for stabilizer quantum mechanics

The zx-calculus is a rigorous graphical language for reasoning about pure state qubit quantum computation with post-selected measurements. It was first introduced by Coecke and Duncan [3, 4]. The calculus is universal, meaning any pure state, unitary operation, and pure projective measurement can be represented graphically. Here, we consider only the zx-calculus for stabilizer quantum mechanics [6], the subtheory of pure qubit quantum mechanics in which only the following operations are allowed: • preparation of qubits in the state |0i, • application of Clifford unitaries, which are generated by the single-qubit phase and Hadamard gates: 1 0 S= 0 i

! and

! 1 1 1 H= √ , 2 1 −1

(1)

together with the two-qubit controlled-not gate:  1 0 C X =  0 0

0 1 0 0

0 0 0 1

 0  0 , 1  0

and

(2)

• measurements in the computational basis.

2.1

The elements of the stabilizer zx-calculus and their interpretations

We denote the standard interpretation map from zx-calculus diagrams to matrices by J·K. This is in fact a functor from the dagger compact closed category of zx-calculus diagrams to MatC , the category whose objects are natural numbers and whose arrows are complex matrices. A diagram in the zx-calculus is composed of four different types of nodes, which are interpreted as 1 Some rules are symmetric under the operations of swapping the colours and/or flipping them upside-down, hence the effective rule set is not quite four times the size of the explicitly-given one.

Miriam Backens, Simon Perdrix & Quanlong Wang

3

follows, where the phase angles α, β take values in {0, π2 , π, − π2 }: u

n

}

u

w w w w v

... α ...

   = |0i⊗m h0|⊗n + eiα |1i⊗m h1|⊗n  ~

w w w w w v

m

t |

= |+i h0| + |−i h1|

k

... β ... l

}     = |+i⊗l h+|⊗k + eiβ |−i⊗l h−|⊗k  ~ J K=

1 2

The universal zx-calculus can be recovered by allowing phase angles to take arbitrary values in (−π, π]. Of the above components, the green and red spiders and the yellow Hadamard node are part of the original zx-calculus. The star node was introduced in [2]. Two zx-calculus diagrams can be composed by connecting the inputs of one to the outputs of the other. The monoidal product of zx-calculus diagrams is constructed by putting the diagrams side-byside. The symmetry isomorphism is given by a wire crossing and the compact structure is given by wire ‘caps’ and ‘cups’. The dagger of a diagram can be constructed by flipping it upside-down and flipping the signs of all the phase angles. All of these operations interact nicely with the interpretation functor.

2.2

The rewrite rules

The zx-calculus is not just a notation: it comes with a set of rewrite rules that allow equalities to be derived entirely graphically. The reason we are considering the zx-calculus for stabilizer quantum mechanics here is that for this theory a complete set of rewrite rules is known: this means that any equality that can be derived using matrices can also be derived graphically using that set of rewrite rules [1, 2]. It is known that the currently-used set of rewrite rules is incomplete for the universal zx-calculus, but not how to complete it [10]. The set of rewrite rules for the stabilizer zx-calculus with scalars – as used in [2] – is given in Figure 1. All of those rules also hold upside-down and/or with the colours red and green swapped. Whenever a rule contains an ellipsis to indicate that it applies to spiders with different numbers of inputs or outputs, those numbers can take any non-negative integer value, including zero. The dashed square on the righthand side of rule (SR) is meant to emphasise the fact that this side of the equality consists of an empty diagram. Rules (SR), (ZO), and (ZS) were newly introduced there. The Euler decomposition rule (EU) was introduced in [5]. All other rules were part of the original definition of the zx-calculus, although some of them have been modified because equality in the original zx-calculus was only up to a global phase, i.e. two diagrams were considered equal if they represented matrices that differed by a scalar factor of eiφ for some φ ∈ (−π, π]. In addition to those explicit rewrite rules there is also a meta-rule: ‘only the topology matters’, which means that two diagrams represent the same matrix whenever one can be transformed into the other by moving components around without changing their connections. The topology rule is a consequence of the underlying dagger compact closed structure and the fact that all basic components are symmetric

4

A Simplified Stabilizer zx-calculus

... α

...

...

β ...

=

α+β

=

...

=

π

···

π

(K1)

=

-π/2

= π

(EU)

π/2

π

(K2)

... =

α

...

(ZO)

(B2)

π -α

...

π/2 π/2

α

=

π

···

-π/2

(SR)

=

(B1)

α

=

(S10 )

α

...

(S3)

=

π

...

α

(S1)

...

=

π

...

...

α

(H)

...

π

α

= π

(ZS)

Figure 1: Rules for the stabilizer zx-calculus with scalars. All of these rules also hold when flipped upside-down, or with the colours red and green swapped. The right-hand side of (SR) is an empty diagram. Ellipses denote zero or more wires. under interchange of any two legs, as well as under partial transpose. Graphically, a partial transpose is taken by bending some input wires to become outputs and an equal number of outputs to become inputs. All of the rewrite rules given in Figure 1 are sound with respect to the standard interpretation, meaning that for any rule: JLHS K = JRHS K ,

(3)

where LHS is the left-hand side diagram, and RHS the right-hand side diagram. Thus, any equality derived using some combination of those rewrite rules is sound as well. Furthermore, as mentioned above, this set of rewrite rules is also complete for the stabilizer zxcalculus, meaning that for any two stabilizer zx-calculus diagrams D and D0 : JDK = JD0 K =⇒ D = D0 .

(4)

Miriam Backens, Simon Perdrix & Quanlong Wang

5

Therefore, any question within the fragment of pure stabilizer QM can be analysed entirely graphically without loss of deductive power.

3

Minimal axioms for scalars in zx-calculus

To make the stabilizer zx-calculus complete for scalars, a new symbol together with three axioms (SR), (ZS), and (ZO) have been added [2]. We show in this section that the new symbol and one of those axioms are not necessary for completeness. We end up with a simplified set of rules (Figure 2) with only two axioms (IV) and (ZO) dedicated to scalars. We show the minimality of the two axioms in the sense that they cannot be derived form the other rules of the language (Theorem 3.5).

3.1

Replacing the star

The symbol has been introduced as an inverse of . Since the interpretation of is 2, the interpretation of is 1/2. It turns out that there exists a -free diagram which has the same interpretation: |

t

=

1 = J K. 2

By completeness = can be derived using the rules of the stabilizer zx-calculus. We give an explicit proof of this property: Lemma 3.1. In the zx-calculus, i.e. using the rules of Figure 1, = . Proof. =

=

=

=

,

where the second equality is obtained using the so-called Hopf law

=

=

proved for instance in [4]. The third equality is based on the fact that follows: =

=

which can be proved as

= . 

By Lemma 3.1, it is not necessary to introduce the symbol calculus. However, to remove the

, the only axiom

=

, since

already exists in the zx-

using this symbol needs to be

6

A Simplified Stabilizer zx-calculus

treated carefully. Indeed, notice that this axiom is necessary for the completeness in the sense that the equation = which is true by combining axiom (SR) and Lemma 3.1, cannot be proved without axiom (SR) since there is no other axiom than can be used to transform an empty diagram to a non empty diagram. To remove the , one could straightforwardly replace all its occurrences – including in the rewrite rules – by , and consider = as an axiom. We show that the following simpler axiom can be used instead:

=

(inverse rule)

Lemma 3.2. Given the -free rules of Figure 1,

=

=

⇔ =

Proof. [⇒]. Decompose the green dot using the fact that the inverse rule twice. [⇐]. We have =

=

=

. (see Lemma 3.1), and then in apply

= 

where second equality is obtained using the Hopf law.

Theorem 3.3. The -free rules of Figure 1 together with the inverse rule are complete for non-zero stabilizer quantum mechanics. Proof. By completeness of the rules given in Figure 1, any true equation in stabilizer quantum mechanics can be derived. One can syntactically replace all occurrences of the by and get a valid proof using -free rules and the inverse rule, where each use of the axiom (SR) is replaced by =

. 

3.2

Zero scalar rule is not necessary

We show that the (ZS) rule π α = π is not necessary for completeness and can be derived from the other rules of the language. Indeed the (ZS) rule can be derived from the the other rules of Figure 1. In this section we show equivalently that the (ZS) rule can be derived from the rules of Figure 2. To do this, we need the following

Miriam Backens, Simon Perdrix & Quanlong Wang

7

Lemma 3.4. Given the rules of Figure 2, α

=

. Proof. We have: α

=

π π

=

π

π

π

=

-α α

=

π

-α α

α

=

,

where we use the π-copy rule (K1), the inverse rule (IV) and the π-commutation rule (K2).



Theorem 3.5. Given the rules of Figure 2, π

α

= π.

(5)

Proof. First,

π

= π

= π

= π

.

Then,

π

α

= π

= π α

= π

= π

= π.

α

Here we used the inverse rule (IV), the zero rule (ZO) and Lemma 3.4.



Corollary 3.6. The rules of Figure 2 are complete for stabilizer quantum mechanics.

3.3

Minimality of the scalar axioms

From the the rules and symbol dedicated to scalars in Figure 1, we have eliminated one symbol and one rule, with two scalar rules remaining in Figure 2. This set of rules is optimal for scalars in the sense that both axioms are necessary. The inverse rule (IV) cannot be proved using the other rules since this is the only one which equates an empty diagram and a non empty diagram. To prove that the zero rule (ZO) is also necessary, we introduce an alternative interpretation of the diagrams which is sound for all the rules of the language except for the zero rule. Theorem 3.7. The zero-rule π

cannot be derived from the other rules of Figure 2.

= π

8

A Simplified Stabilizer zx-calculus

Proof. Consider an alternative interpretation of stabilizer zx-calculus diagrams denoted by J·K\ and defined as follows: u

}\

w v

 ~ t |\

u w v

π 2

t |\

=

}\

u =

= u

w  = vπ~ =

wπ v ~

}\

u

 ~

w = v

−π 2

}\

u

 ~ =

w v

π 2

}\

}\

u

 ~

w = v

}\ −π 2

 ~ =

It is a routine check that J·K\ is a sound interpretation for all rules but the (ZR) rule of Figure 2. Here we just check the Euler decomposition rule (EU) in detail: u w w w v

-π 2 -π 2

π 2 π 2 π 2

}\    ~

=

=

=

=

=

t

|\

Now we consider the interpretation of the diagrams in the zero rule. On the one hand, u

}\

wπ v

 ~ =

on the other hand, t

π

|\

=

Therefore, the zero-rule is not derivable in the stabilizer zx-calculus.



To sum up, we have removed the rules (SR) and (ZS), and replaced them with the inverse rule (IV). The remaining rules about scalars – (IV) and (ZO) – are not derivable from the other rules of the zxcalculus. They therefore form a set of minimal axioms for scalars in the stabilizer zx-calculus.

Miriam Backens, Simon Perdrix & Quanlong Wang

... α

...

...

β ...

9

...

... =

α+β

α

(S 1)

... =

...

...

(S 10 )

α

...

=

= π

(S 3) =

(B1) α

=

π

···

π

(K1)

π

··· =

-π/2 -π/2

=

(EU)

π/2

(K2) ...

=

α

...

(IV)

π

π -α

...

π/2 π/2

α

=

(B2)

α

(H)

...

π

= π

(ZO)

Figure 2: Rules for the scaled stabilizer zx-calculus with minimal axioms for scalars. All of these rules also hold when flipped upside-down, or with the colours red and green swapped. As before, the righthand side of (IV) is an empty diagram and ellipses denote zero or more wires.

4

Simplified zx-calculus for stabilizer quantum mechanics

In this section, we give a new system of rules for the stabilizer zx-calculus, shown in Figure 3. The new rules are much simpler than those given in Figure 2, while being just as powerful: the new set of rules can be proved to be equivalent to the old ones without any reference to the convention that any rule also holds with the colours red and green swapped or diagrams flipped upside-down, nor to the meta-rule ‘only the topology matters’, yet has the advantage of possessing fewer equalities. To attain this, we assume that we are working in a symmetric compact closed category, which means any diagram can slide along either line of a swap freely and the following equations hold: =

=

=

=

10

A Simplified Stabilizer zx-calculus

... α

...

...

β ...

... =

α+β

=

(S 1)

(S 20 )

...

=

=

π/2

=

=

=

(B1)

... -π/2

(EU 0 )

π/2

=

(S 30 )

... =

α

...

(IV 0 )

(B20 )

α

(H)

...

π

= π

(ZO0 )

Figure 3: Simplified rules for stabilizer zx-calculus, still using the conventions that the right-hand side of (IV0 ) is an empty diagram and that ellipses denote zero or more wires.

4.1

Soundness of the simplified rule set

The zx-calculus with the rules given in Figure 1 has been shown to be sound [4, 2], and we have shown in the previous section that the rule system in Figure 2 is equivalent to the former. Now, the rules (S1), (S30 ), (B1) and (H) of the new system in Figure 3 already exist in Figure 2 ((S30 ) simply contains the colour-swapped, as well as the original, version of (S3)). Thus, we only need to show that the rest of the rules (S20 ), (B20 ), (EU0 ), (IV0 ) and (ZO0 ) can be derived from the rules in Figure 2 to make the new system sound. Lemma 4.1. Rule (S20 ) is sound, i.e. given the rules in Figure 2, we have: = Proof. We have: =

=

=

where we used the colour-swapped version of (S1), the colour-swapped original and upside-down versions of (S3), and the compact structure rule. 

Miriam Backens, Simon Perdrix & Quanlong Wang

11

Lemma 4.2. Rule (B20 ) is sound, i.e. given the rules in Figure 2, we have:

= = , as shown in the proof of Lemma 

Proof. It follows immediately from (B2) via the fact that 3.1.

Lemma 4.3. The rule (EU0 ) is sound, i.e. given the rules in Figure 2, we have: π/2

=

-π/2

π/2

Proof. First, note that: -π 2

π 2

=

π 2 π 2 π 2 π 2

-π 2

=

-π 2

=

π 2

-π 2 -π 2

π 2

=

-π 2 -π 2

π 2

π 2

=

-π 2

π 2

,

(6)

-π 2

where we have used the colour-swapped version of (EU), (IV), (B1) and Lemma 3.4. Then: π 2 π 2

-π 2

=

-π 2 -π 2

π 2 π 2

π 2

=

=

using (6), the colour-swapped version of (S1), (EU), and (IV).



Lemma 4.4. The rule (IV0 ) is sound, i.e. given the rules in Figure 2, we have: = Proof. It follows immediately from Lemma 3.2.



Lemma 4.5. The rule (ZO0 ) is sound, i.e. given the rules in Figure 2, we have: π

= π

Proof. Starting from the left-hand side of the above, we find:

π

= π

= π

= π

by applying (ZO) and then using Theorem 3.5.



12

4.2

A Simplified Stabilizer zx-calculus

Completeness

We now prove that all the rules in Figure 2, including their colour-swapped and upside-down versions, as well as the meta-rule ‘only the topology matters’, can be derived from the rules listed in Figure 3. As for ‘only the topology matters’, we need only to consider the commutativity of the green copy and its colour-swapped and upside-down versions, since we work in a symmetric compact closed category. We will derive the rules in Figure 2 as well as their colour-swapped and upside-down versions one by one in the following order: (H), (S1) & (S3), (B1), (IV), (B2), (S10 ), (K1), (EU), (K2), (ZO). Finally, we give the derivation of the commutativity of the green copy map and its colour swapped and upside-down versions. Any derivation in this section only uses rules from Figure 3 and the symmetric and compact structure of the underlying category, though we will not mention this explicitly in each proof. To derive the colour-swapped version of (H), it is useful to first show that the Hadamard node is self-inverse. We proceed in two steps. Lemma 4.6. A green node with one input and one output is equal to the identity: =

(7)

Proof. By the compact structure, we have: =

=

=

=

where we also used the rules (S1) and (S30 ).

=



The above Lemma is just the colour-swapped version of (S20 ). Lemma 4.7. The Hadamard node is self-inverse: (8)

= Proof. We use (S20 ) and (7), as well as the colour change rule, (H):

=

=

=

This yields the desired result.



Proposition 4.8. The colour-swapped version of (H) can be derived: ... α

...

... =

α

...

(9)

Miriam Backens, Simon Perdrix & Quanlong Wang

13

Proof. This follows immediately by applying Hadamard nodes to all inputs and outputs of (H) and using (8).  Note that the upside-down version of (H) is itself, and similarly for the upside-down version when the colours in (H) are swapped. Proposition 4.9. The upside-down flipped version of (S3) can be derived: =

(10)

Proof. By Lemma 4.6, we have: =

=

=

=

where we have used the rules (S1) and (S30 ), and the compact structure.



Proposition 4.10. The upside-down flipped version of (S1) can be derived: ... ... β ... α+β = ... α ... ...

(11)

Proof. First note that by the rule (S1) we have:

α

=

α

=

α

α

Using these inductively, together with the compact structure, (S30 ) and (10), we obtain: ... ...

β

...

... =

α

...

β

...

β

=

... α

...

α

...

...

...

... ... ... =

...

α+β

... =

α+β

...

...

...

...

... = α+β ...

14

A Simplified Stabilizer zx-calculus 

which is the desired result.

Proposition 4.11. The colour-swapped version of (S1), and its upside-down flipped version can be derived: ... ... ... ... ... α β ... α+β α+β = = (12) ... α β ... ... ... ... ... Proof. This follows immediately from (S1) and (11) via the colour change rule (H) and (8).



Since the colour-swapped version of (S3) already exists in (S30 ), we need only to prove the colourswapped upside-down version. Proposition 4.12. The flipped upside-down colour-swapped version of (S3) can be derived: =

(13)

Proof. Apply (S20 ) and (12) to create red spiders from the left-hand side of the above: =

=

=

=

The result then follows by (S30 ) and the compact structure.



Lemma 4.13. The red-green scalar can be flipped upside-down without changing its value: =

=

=

=

Proof. This follows from (S30 ) and the spider rules.

(14) 

A similar property holds for the inverse of the red-green scalar. As a consequence of this, we do not need to worry about the orientation of scalars when deriving the upside-down version of a rewrite rule. Since the upside-down version of the scalar is also its colour-swapped version, the same is true when colour-swapping rewrite rules. Proposition 4.14. The colour-swapped version of (B1) can be derived: =

(15)

Proof. This follows immediately from applying Hadamard nodes to all outputs of (B1) by (H), (9), and (8).  Proposition 4.15. The upside-down version of (B1) can be derived: =

(16)

Miriam Backens, Simon Perdrix & Quanlong Wang

15

Proof. By (S1), (S30 ), and (10), the green co-copy map can be turned into a green copy map with curved inputs and outputs. We then find: =

=

=

=

=

using (S30 ), (11), (B1), and (12).



Proposition 4.16. The colour-swapped and flipped upside-down version of (B1) can be derived: =

(17)

Proof. This follows from applying Hadamard nodes to all inputs of (16) via (H), (8), and (9).



While the compact structure allows the removal of twists in cups and caps, it is not immediately clear what to do with a twist in an otherwise straight wire. The following lemma will therefore be useful. Lemma 4.17. A sideways loop can be removed:

=

(18)

Proof. By the compact structure, the ‘cup’ at the bottom of the loop can be twisted back on itself. Then:

=

=

=

=

=

using (S30 ), (10), (11), (7) and the compact structure.



Lemma 4.18 (Hopf law). The Hopf law holds, i.e.:

=

(19)

Proof. By (18), we can introduce a twist in one of the wires connecting the red and green spiders on the left-hand side of the above. Then: =

=

=

=

where we used (S30 ), (S1), (13), (12), (B20 ), (16) and (10).

=

=

=



16

A Simplified Stabilizer zx-calculus

Lemma 4.19. A dot can be decomposed: =

=

(20)

Proof. Starting from the right-hand side, use (IV0 ), (S1), Hopf law, (17), (S30 ), (8), (9) and (12). Then:

=

=

=

=

=

=

=

= =

This completes the proof.



Proposition 4.20. The inverse rule (IV) can be derived:

=

(21)

Proof. The proof is the same as the [⇐] part proof of Lemma 3.2, using (IV0 ), Hopf law and (20).



The colour-swapped version of (IV) is the same as its upside-down flipped version, and can be derived immediately from the colour change rule (H), (9), and (8). Proposition 4.21. (B2) can be derived:

= Proof. This follows immediately from (B20 ) via (20) and (21).

(22)



Since (IV) and (B2) have been derived from the rules listed in Figure 3, we will use them in the future for the derivation of other rules in Figure 2. Proposition 4.22. The colour-swapped version of (B2) can be derived:

=

(23)

Proof. This follows immediately from (B2) via (H), (8), and (9).



Flipping (B2) upside-down has the same effect as swapping the colours, so there are only two versions of this rule. Proposition 4.23. The rule (S10 ) can be derived: ... α

...

... =

α

...

(24)

Miriam Backens, Simon Perdrix & Quanlong Wang

17

Proof. ...

...

α

α

...

... =

α

=

...

...

=

...

α

... =

...

α

...

where we used (19), (S1), (S30 ), (11), (13), (12) and (IV0 ).



Proposition 4.24. The colour-swapped version of (S10 ) can be derived: ...

... =

α

α

...

(25)

...

Proof. This follows from (24) via (H), (9), (S30 ), (10), (13) and (8).



The upside-down version of (S10 ) is (S10 ) itself, and the same holds for the colour-swapped version. Now, to derive various rules involving non-trivial phases, we first show some equalities (up to scalars) between red states with phase ± π2 and green states with phases ∓ π2 . These results are very similar to (6) in Section 4.1, but (6) was proved using the rules from Figure 1, whereas we are now using the rule set in Figure 3. Lemma 4.25. The red state with phase − π2 is equal to the green state with phase -π 2

=

π 2

up to some scalars:

π 2

-π 2

(26)

Proof. We first use (9) and (EU0 ). Then: -π/2 -π 2

-π/2

=

π/2

-π/2

= π/2

= π/2

-π/2

=

-π 2

π 2

by (S1), (IV), and (15).



Composing with the Hadamard node on both sides of (26), we get: -π 2

=

π 2

-π 2

(27)

Furthermore, multiplying both sides of (26) by the red-green scalar and using (IV), we find: -π 2

=

-π 2

π 2

(28)

18

A Simplified Stabilizer zx-calculus

Lemma 4.26. Applying a red co-copy map to two green states with phases − π2 and with zero phase: -π/2

π 2

yields the red state

π/2

=

(29)

Proof. Using (27) and (28), we have: -π/2

π/2

=

π 2

-π 2

π 2

π 2

=

-π 2

= 

where the last step is by (11).

Corollary 4.27. Two green nodes with no inputs or outputs and phases − π2 and π2 , respectively, are equal to two copies of the red-green scalar: π 2

-π 2

=

(30)

Proof. Using (S1), each green node can be pulled apart into two nodes connected by an edge. Then: -π/2 π 2

-π 2

π 2

-π 2

=

=

π/2

=

, 

by (16) and (29). Corollary 4.28. The scalars in (26) and (27) can be brought to the other side: π 2

π 2

=

π 2

=

π 2

-π 2

(31)

-π 2

(32)

Proof. To prove (31), start with the right-hand side of that equality, substitute with (26) and then use (30): -π 2

π 2

π 2

=

-π 2

π 2

=

π 2

=

π 2

Then (32) can derived by applying Hadamard gates on both sides of (31) and using (H) and (9).



Lemma 4.29. The inner product between a green state of any phase and the red zero-phase effect is equal to the red-green scalar: -π 2

=

π 2

=

π

=

(33)

Miriam Backens, Simon Perdrix & Quanlong Wang

19

Proof. We prove equality to the red-green scalar for each phase angle in turn. If the phase is − π2 , substitute for the green state using (27). By (H), a red node with no outputs or inputs is equal to a green node with the same phase. The desired result then follows via (30) and (IV). For phase π2 we start with (31) and then proceed as before: -π 2

=

-π 2

π 2

=

-π 2

π 2

=

=

(34)

π 2

=

π 2

-π 2

=

-π 2

π 2

=

=

(35)

If the phase is π, we begin by splitting the green node using (S1) and applying (27). We then apply (11), followed by (16). The final steps use (H), (30), (IV), and (34): π 2

-π 2

π

=

-π 2

=

-π 2

-π 2

π 2

=

-π 2

-π 2

π 2

=

-π 2

=

-π 2

π 2

=

,

-π 2



This completes the proof. Lemma 4.30. A green π phase shift is equal, up to normalisation, to a loop with a Hadamard in it: π

=

(36)

Proof. Starting from the right-hand side, use (EU0 ) followed by (S1) and (11). Then: -π/2 π/2

=

-π/2

=

π

=

π

-π/2

= π

π/2

where the last steps use (19), (IV) and (33).



It follows immediately from (36) via the green spider rule and the upside-down version of (S30 ) that a green π-phase state can also be written in phase-free form: π

=

=

(37)

Lemma 4.31. The green π-phase state is copied by the red copy map, up to normalisation: π

π

=

π

(38)

20

A Simplified Stabilizer zx-calculus

Proof. Write the state in the phase-free representation derived in (37). The subsequent steps variously use (23), (8), (H) and its colour-swapped version, (S30 ) and its upside-down version, as well as (S1) and its colour-swapped and/or upside-down equivalents. In the step to the last row we use the Hopf law and in the next step, (H) and (8).

π

=

=

=

=

=

=

=

=

=

π

=

=

π

= 

Finally, the result follows via (38). Similar to the proof of (16), we have the following as a consequence of (38): = π

(39) π

π

Now we prove the π-copy rule (K1). Proposition 4.32. (K1) can be derived: π

=

···

π

π

(40)

···

Proof. By (12), it suffices to prove the following: π

π

=

=

π

π

Miriam Backens, Simon Perdrix & Quanlong Wang

21

Actually, we have:

π

=

=

π π

=

=

=

π

=

π

=

π

=

=

π

π



using (36), (IV), (11), (16), (H), (23), and (38). Proposition 4.33. The upside-down version of (K1) can be derived: ···

··· π

=

π

π

(41)

Proof. By the red spider rule (11), it suffices to prove that π

= π

=

π

π

By (40), (S30 ) and its upside-down equivalents, the spider rules, and the compact structure, we have:

π

=

=

π

=

π π

=

π

=

=

π

π

=

π

π



The result then follows by induction over the number of inputs and/or outputs. Proposition 4.34. The colour-swapped versions of (K1) and its upside-down version can be derived: ··· π

···

=

π

π

π

··· =

π

π

(42)

···

Proof. This follows immediately from (H), (9), and (8). Using the π-copy rule (40), we get another form of the Euler decomposition rule (EU0 ).



22

A Simplified Stabilizer zx-calculus

Lemma 4.35. The rule (EU0 ) also holds with the signs of the phases flipped: π 2

-π 2

=

π 2

π 2

-π 2

(43) -π 2

Proof. Starting from (EU0 ), use (S1) to split π-phase shifts of the top and bottom nodes: -π 2 π 2

-π 2

π 2

π

=

-π 2

-π 2

-π 2

π

=

π

= -π 2

-π 2

π 2

-π 2 -π 2



The result then follows from (42), (S1), and its upside-down equivalent. Proposition 4.36. (EU) can be derived: -π/2

=

-π/2

π/2 π/2

(44)

π/2

Proof. Start from the right-hand side. Then: π 2 π 2 π 2

-π 2 -π 2

=

π 2

-π 2

π 2

-π 2

π 2

=

-π 2 -π 2

π 2 π 2

π 2

-π 2

=

π 2 -π 2

π 2 π 2

-π 2

π 2

where we used the red spider rule (12), (32), (26), (30) and (IV).

-π 2

= 

Proposition 4.37. The colour-swapped version of (EU) can be derived: π 2 π 2 π 2

-π 2

=

-π 2

Proof. This follows immediately from (44) via (H), (9), and (8).

(45)



The upside-down flipped version of (EU) is just itself. Proposition 4.38. (K2) can be derived: α π

α

=

π

π -α

where α ∈ {0, π2 , π, − π2 }.

(46)

Miriam Backens, Simon Perdrix & Quanlong Wang

23

Proof. Using (33), it is easy to see that (K2) holds for α = 0. For α = π2 , we have π 2

π

π - π2

=

π 2

π -π 2

π

π 2

=

π 2

-π 2

π 2 -π 2

π

=

π

π 2

-π 2 -π 2

-π 2

π

π 2

=

π

π

where the first step uses the red spider rule (12) and (26), the second step uses the π-copy rule (40) and the green spider rule, the third step uses (32) and (27), and the last step the red spider rule, (30), and (IV). For α = π, we split the red phase shift and use the above result twice: π 2 π 2

π

=

π

π 2

π 2

=

=

π

π - π2

π

π 2

π 2

π

π

π 2

π - π2 - π2

=

π 2

π

π π

=

π

π

π

π

Then, the scalars can be simplified using (39), the red and green spider rules, and (IV). For α = − π2 , we proceed similarly, splitting the red phase shift into π and π2 and applying both of the above results in sequence. π 2

- π2

π

=

π

π 2

π

=

π

π

π

π

π 2

π

=

π

π

π - π2 π

π 2

π

=

π π 2

π

- π2 π

= π

π 2



The scalars can then be simplified as before, completing the proof.

Note that this proves the π-commutation rule only for phase angles that are integer multiples of π/2. It is unknown whether or not (K2) is necessary when more general phase angles are allowed. Proposition 4.39. The upside-down version of (K2) can be derived: π α

α -α

=

π

(47)

π

where α ∈ {0, π2 , π, − π2 }. Proof. By (46), we have: α -α π

π

=

α



π

π

=

α

-α π

π

π

α

α -α

= π

π α

π

=

π

using (IV), the π-copy rule (40), the red spider rule (12), and (33).

α

π

=

α



24

A Simplified Stabilizer zx-calculus

Proposition 4.40. The colour-swapped versions of (K2) and its upside-down equivalent can be derived:

α

α

=

π

π

π

π -α

α

α -α

=

π

(48)

π

where α ∈ {0, π2 , π, − π2 }. 

Proof. These follow immediately from the colour change rule (H), (9), and (8). Proposition 4.41. (ZO) can be derived:

π

= π

(49)

Proof. From the left-hand side of the above, first apply (IV). Then:

π

= π

= π

= π

= π

= π

= π

.

where the second step uses (ZO0 ), the third step uses the fact that a green node is equal to two copies of the red-green scalar, followed by (IV), (S20 ) and the red spider rule. The fourth step again uses (ZO0 ). The fifth equality holds by the copy rule. Finally, (ZO0 ) is applied again to complete the proof.  Proposition 4.42. The colour-swapped and/or flipped upside-down versions of (ZO) can be derived:

π

= π

π

= π

Proof. These follow immediately from the colour change rule (H), (9), and (8).

π

= π

(50)



Finally, we prove the commutativity of green co-copy and copy. Proposition 4.43. The green co-copy map is commutative:

=

(51)

Proof. The obvious rewrite rule for removing a wire crossing is (B2). We rewrite the diagram until that can be applied, using (S20 ), the spider rules, and the Hopf law (which is used twice, symmetrically). This

Miriam Backens, Simon Perdrix & Quanlong Wang

25

covers the rewrite steps in the top row. The rule (B2) is applied over the line break.

=

=

=

=

=

=

=

=

We then use the spider rule, the Hopf law again, the upside-down copy law, and (S20 ) to simplify the diagram again, thus completing the proof.  Proposition 4.44. The green copy map is commutative: =

(52)

Proof. We have upside-down versions of all the rules used in the proof of that the green co-copy map is commutative (Proposition 4.43). That proof can therefore be straightforwardly repeated upside-down.  The colour-swapped versions of the above Propositions also hold: Proposition 4.45. Both the red copy and co-copy maps are commutative:

=

=

(53)

Proof. These follow immediately from applying Hadamard nodes to all inputs and outputs of Propositions 4.43 and 4.44 by the colour-swapped colour change rule (9) and the symmetric structure.  We have thus proved that all the original rules of the zx-calculus – as given in Figure 1 – can be derived from the new system of rules. As that system of rules is known to be complete, so is the system in Figure 3.

26

5

A Simplified Stabilizer zx-calculus

Conclusion and further work

The stabilizer zx-calculus has a complete set of rewrite rules which allow any equality that can be derived using matrices to also be derived graphically. We show that a new symbol and one of three axioms that were added to make the zx-calculus complete for scalars are not actually necessary. Then we simplify another axiom for scalars and verify that the remaining axioms for scalars in zx-calculus have minimality in the sense that they cannot be derived from the other rules of the language. Furthermore, we give a new system of rules for the stabilizer zx-calculus with scalars. Our system contains nine rewrite rules and makes use of the axioms of a symmetric compact closed category, where the previous complete system of zx-calculus rules involved twelve explicit rewrite rules, each of which came in up to four variations, and a meta rule. We prove that the new rules are sound and complete, the latter by showing that the previous rules in all their variations can be derived from the new system. So we have a significantly simplified the stabilizer zx-calculus. Given this simplified system of rules for the stabilizer zx-calculus, it is natural to consider the question of a minimal rule system: one in which provably none of the rules can be derived from the others. It is unclear whether our system is minimal. Work on this question is ongoing.

6

Acknowledgements

The authors would like to thank Bob Coecke, Ross Duncan, Emmanuel Jeandel, and Aleks Kissinger for valuable discussions. MB acknowledges funding from EPSRC, QW acknowledges funding from R´egion Lorraine.

References [1] Miriam Backens (2014): The ZX-calculus is complete for stabilizer quantum mechanics. New Journal of Physics 16(9), p. 093021, doi:10.1088/1367-2630/16/9/093021. [2] Miriam Backens (2015): Making the stabilizer ZX-calculus complete for scalars. Electronic Proceedings in Theoretical Computer Science 195, pp. 17–32, doi:10.4204/EPTCS.195.2. [3] Bob Coecke & Ross Duncan (2008): Interacting Quantum Observables. In: Automata, Languages and Programming, 5126, Springer Berlin Heidelberg, pp. 298–310, doi:10.1007/978-3-540-70583-3 25. [4] Bob Coecke & Ross Duncan (2011): Interacting quantum observables: categorical algebra and diagrammatics. New Journal of Physics 13(4), p. 043016, doi:10.1088/1367-2630/13/4/043016. [5] Ross Duncan & Simon Perdrix (2009): Graph States and the Necessity of Euler Decomposition. In: Mathematical Theory and Computational Practice, 5635, Springer Berlin Heidelberg, pp. 167–177, doi:10.1007/978-3-642-03073-4 18. [6] Daniel Gottesman (1997): Stabilizer Codes and Quantum Error Correction. Ph.D. thesis, Caltech. Available at http://arxiv.org/abs/quant-ph/9705052. [7] Daniel Gottesman (1998): The Heisenberg Representation of Quantum Computers. arXiv:quant-ph/ 9807006. [8] Michael A. Nielsen & Isaac L. Chuang (2010): Quantum Computation and Quantum Information. Cambridge University Press, Cambridge. [9] Robert Raussendorf & Hans J. Briegel (2001): A One-Way Quantum Computer. Physical Review Letters 86(22), pp. 5188–5191, doi:10.1103/PhysRevLett.86.5188.

Miriam Backens, Simon Perdrix & Quanlong Wang

27

[10] Christian Schr¨oder de Witt & Vladimir Zamdzhiev (2014): The ZX-calculus is incomplete for quantum mechanics. EPTCS 172, pp. 285–292, doi:10.4204/EPTCS.172.20.