Optimisation and verification of quantum circuits with string - - PowerPoint PPT Presentation

optimisation and verification of quantum circuits with
SMART_READER_LITE
LIVE PREVIEW

Optimisation and verification of quantum circuits with string - - PowerPoint PPT Presentation

Optimisation and verification of quantum circuits with string diagrams Aleks Kissinger STRING 3; Birmingham 2019 Aleks Kissinger STRING 3, 2019 1 / 43 Quantum software 1. := the code the runs on a quantum computer factoring search quantum


slide-1
SLIDE 1

Optimisation and verification of quantum circuits with string diagrams

Aleks Kissinger

STRING 3; Birmingham 2019

Aleks Kissinger STRING 3, 2019 1 / 43

slide-2
SLIDE 2

Quantum software

  • 1. := the code the runs on a quantum computer

factoring search

quantum simulation hidden subgroup linear systems & codes pattern matching collision-finding network flows NLP ...

  • 2. := the code that makes that code (better)
  • quantum programming languages
  • compilers
  • optimisation
  • verification

Aleks Kissinger STRING 3, 2019 2 / 43

slide-3
SLIDE 3

Problem: no quantum computers

Rigetti Aspen 16Q IBM Q 20 Tokyo Google Bristlecone

(+ Oxford, Vienna, Delft, Sussex, Grenoble...)

Aleks Kissinger STRING 3, 2019 3 / 43

slide-4
SLIDE 4

Problem: limited quantum computers

Noisy intermediate-scale quantum (NISQ) devices

  • short coherence times (e.g. µs-scale)
  • small memory (8-80 qubits)
  • noisy primitive operations (gates & measurements)
  • limited connectivity:
  • ...

⇒ small advances in software give big gains on NISQ hardware!

Aleks Kissinger STRING 3, 2019 4 / 43

slide-5
SLIDE 5

Quantum circuits

  • := the ‘assembly language’ of quantum computation, e.g.

INIT 5 CNOT 1 0 H 2 Z 3 H 0 H 1 CNOT 4 2 ...

H H

⊕ ⊕

H Z X Z

⊕ ⊕

S T

⊕ ⊕

Aleks Kissinger STRING 3, 2019 5 / 43

slide-6
SLIDE 6
  • Built out of fixed set of complex unitary matrices, or gates, e.g.

⊕ :=     1 1 1 1    

H

:=

1 √ 2

1 1 1 −1

  • S

:= 1 i

  • ...combined by ⊗ and ◦.
  • Universal sets can gates can be used to construct any 2n × 2n unitary

matrix

  • Gates describe physical evolutions of a q. state, which take time and

introduce noise

  • Lower gate count / gate depth is good!

Aleks Kissinger STRING 3, 2019 6 / 43

slide-7
SLIDE 7

H H

⊕ ⊕

H Z X Z

S T

⊕ ⊕

Aleks Kissinger STRING 3, 2019 7 / 43

slide-8
SLIDE 8

H H

⊕ ⊕

H Z X Z

S T

⊕ ⊕

Aleks Kissinger STRING 3, 2019 7 / 43

slide-9
SLIDE 9

H H

⊕ ⊕

H Z X Z S T

⊕ ⊕

Aleks Kissinger STRING 3, 2019 7 / 43

slide-10
SLIDE 10

H H

⊕ ⊕

H Z X Z S T

⊕ ⊕

Aleks Kissinger STRING 3, 2019 7 / 43

slide-11
SLIDE 11

⊕ ⊕ ⊕ = ⊕

H H

= ⊕

H H

⊕ ⊕ = ⊕ ⊕ ⊕

Z

=

Z H

=

S H S H H

. . .

Aleks Kissinger STRING 3, 2019 8 / 43

slide-12
SLIDE 12

* Selinger 2015

Aleks Kissinger STRING 3, 2019 8 / 43

slide-13
SLIDE 13

* Selinger 2015

Aleks Kissinger STRING 3, 2019 8 / 43

slide-14
SLIDE 14

* Amy, Chen, & Ross 2018

Aleks Kissinger STRING 3, 2019 8 / 43

slide-15
SLIDE 15

* Nam et al 2018

Aleks Kissinger STRING 3, 2019 8 / 43

slide-16
SLIDE 16

H H

⊕ ⊕

H Z X Z

⊕ ⊕

S T

⊕ ⊕

π π π

π 2 π 4 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2

Aleks Kissinger STRING 3, 2019 9 / 43

slide-17
SLIDE 17

H H

⊕ ⊕

H Z X Z

⊕ ⊕

S T

⊕ ⊕

π π π

π 2 π 4 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2

Aleks Kissinger STRING 3, 2019 9 / 43

slide-18
SLIDE 18

π π π

π 2 π 4 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2

Aleks Kissinger STRING 3, 2019 9 / 43

slide-19
SLIDE 19

π π π

π 2 π 4 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2

ZX-diagram

Aleks Kissinger STRING 3, 2019 9 / 43

slide-20
SLIDE 20

ZX-diagrams

...are made of spiders:

  • α

... ...

  • =

      1 ... ... eiα      

α

... ... := ...

α

...

  • :=

1 √ 2 1 1 1 −1

  • Aleks Kissinger

STRING 3, 2019 10 / 43

slide-21
SLIDE 21

α

π 2 3π 2

β π

Aleks Kissinger STRING 3, 2019 11 / 43

slide-22
SLIDE 22

α

π 2 3π 2

β π

Aleks Kissinger STRING 3, 2019 11 / 43

slide-23
SLIDE 23

α

π 2 3π 2

β π

Aleks Kissinger STRING 3, 2019 11 / 43

slide-24
SLIDE 24

1

ZX calculus

these 8 rules = ⇒ everything before

1Vilmart 2018. arXiv:1812.09114 Aleks Kissinger STRING 3, 2019 12 / 43

slide-25
SLIDE 25

H H

⊕ ⊕

H Z X Z

⊕ ⊕

S T

⊕ ⊕

Aleks Kissinger STRING 3, 2019 13 / 43

slide-26
SLIDE 26

π π π

π 2 π 4 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2

Aleks Kissinger STRING 3, 2019 13 / 43

slide-27
SLIDE 27

π

π 4 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2

π 2π

Aleks Kissinger STRING 3, 2019 13 / 43

slide-28
SLIDE 28

π

π 4 π 2 π 2 π 2 π 2 π 2 π 2

π

Aleks Kissinger STRING 3, 2019 13 / 43

slide-29
SLIDE 29

π

π 4 π 2 π 2 π 2 π 2 π 2 π 2

π

Aleks Kissinger STRING 3, 2019 13 / 43

slide-30
SLIDE 30

π 4 π 2 π 2 π 2 π 2 π 2

π π

Aleks Kissinger STRING 3, 2019 13 / 43

slide-31
SLIDE 31

π 4 π 2

π

Aleks Kissinger STRING 3, 2019 13 / 43

slide-32
SLIDE 32

π 4 π 2

Aleks Kissinger STRING 3, 2019 13 / 43

slide-33
SLIDE 33

π 4 π 2

Aleks Kissinger STRING 3, 2019 13 / 43

slide-34
SLIDE 34

π 4 π 2

Aleks Kissinger STRING 3, 2019 13 / 43

slide-35
SLIDE 35

Q: How do we scale up?

π π π

π 2 π 4 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2
  • ∼30 spiders

  • 103-107 spiders

A: Automation.

Aleks Kissinger STRING 3, 2019 14 / 43

slide-36
SLIDE 36

Quantomatic

  • General-purpose, medium scale tool for teaching and experimenting

with graphical calculi

Aleks Kissinger STRING 3, 2019 15 / 43

slide-37
SLIDE 37

PyZX

  • Special-purpose, large scale circuit optimisation tool for ZX-calculus

Aleks Kissinger STRING 3, 2019 16 / 43

slide-38
SLIDE 38

The idea

  • 1. Turn equations into directed rewrite rules

β

... ...

α+β

... ...

β

... ...

α

... =

= ⇒

β

... ...

α+β

... ...

β

... ...

α

... →

  • 2. Focus on tractible fragements of the language.

Aleks Kissinger STRING 3, 2019 17 / 43

slide-39
SLIDE 39

CNOT circuits

  • Built from:

CNOT :=

  • Efficient to classically simulate (Z2-linear maps)
  • Always equal to a circuit of poly depth (O(n2)-bounded)
  • Expressible using phase-free ZX-diagrams

... ... ; ... ...

Aleks Kissinger STRING 3, 2019 18 / 43

slide-40
SLIDE 40

Clifford circuits

  • Built from:

CNOT := H := S :=

π 2

  • Efficient to classically simulate (Gottesman-Knill theorem)
  • Always equal to a circuit of poly depth (O(n2)-bounded)
  • Expressible by Clifford ZX-diagrams

❦π 2 ...

... ;

❦π 2 ...

... k ∈ Z

Aleks Kissinger STRING 3, 2019 19 / 43

slide-41
SLIDE 41

Clifford ZX-calculus

β

... ...

α+β

... ... ... ... ... ... ...

α

...

α

... ...

π 2 π 2 π 2

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... = = = = = = =

complete for Clifford ZX-diagrams

Aleks Kissinger STRING 3, 2019 20 / 43

slide-42
SLIDE 42

Equations Rewrite rules

Aleks Kissinger STRING 3, 2019 21 / 43

slide-43
SLIDE 43

Equations Rewrite rules

β

... ...

α+β

... ... ... ... ... ... ...

α

...

α

... ...

π 2 π 2 π 2

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... = = = = = = =

Aleks Kissinger STRING 3, 2019 21 / 43

slide-44
SLIDE 44

Equations Rewrite rules

β

... ...

α+β

... ... ... ... ... ... ...

α

...

α

... ...

π 2 π 2 π 2

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → = = = → →

Aleks Kissinger STRING 3, 2019 21 / 43

slide-45
SLIDE 45

Equations Rewrite rules

β

... ...

α+β

... ... ...

α

...

α

... ...

π 2 π 2 π 2

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → = = → → ... ... → ... ... → ... ... → ... ... ... ... ... ... =

Aleks Kissinger STRING 3, 2019 21 / 43

slide-46
SLIDE 46

Equations Rewrite rules

β

... ...

α+β

... ... ...

α

...

α

... ...

π 2 π 2 π 2

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → = = → → ... ... → ... ... → ... ... → ... ... ... ... ... ... =

Aleks Kissinger STRING 3, 2019 22 / 43

slide-47
SLIDE 47

Equations Rewrite rules

β

... ...

α+β

... ... ... ... ... ... ...

α

...

α

... ...

π 2 π 2 π 2

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → = = = → → ... ... → ... ... → ... ... → ... ... ... ... ... ...

Aleks Kissinger STRING 3, 2019 22 / 43

slide-48
SLIDE 48

Equations Rewrite rules

β

... ...

α+β

... ... ... ... ... ... ...

α

...

α

... ...

π 2 π 2 π 2

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → = = = → → ... ... → ... ... → ... ... → ... ... ... ... ... ...

Aleks Kissinger STRING 3, 2019 22 / 43

slide-49
SLIDE 49

Equations Rewrite rules

β

... ...

α+β

... ... ... ... ... ... ...

α

...

α

... ...

π 2 π 2 π 2

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → → = = → → ... ... → ... ... → ... ... → ... ... ... ... ... ...

Aleks Kissinger STRING 3, 2019 22 / 43

slide-50
SLIDE 50

Equations Rewrite rules

β

... ...

α+β

... ... ... ... ... ... ...

α

...

α

... ...

π 2 π 2 π 2

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → → → = → → ... ... → ... ... → ... ... → ... ... ... ... ... ...

Aleks Kissinger STRING 3, 2019 22 / 43

slide-51
SLIDE 51

π 2 3π 2

π

Aleks Kissinger STRING 3, 2019 23 / 43

slide-52
SLIDE 52

π 2 3π 2

π

Aleks Kissinger STRING 3, 2019 23 / 43

slide-53
SLIDE 53

π 2 3π 2

π

Aleks Kissinger STRING 3, 2019 23 / 43

slide-54
SLIDE 54

Equations Rewrite rules

β

... ...

α+β

... ... ... ... ... ... ...

α

...

α

... ...

π 2 π 2 π 2

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → → → = → → ... ... → ... ... → ... ... → ... ... ... ... ... ...

Aleks Kissinger STRING 3, 2019 24 / 43

slide-55
SLIDE 55

Equations Rewrite rules

β

... ...

α+β

... ... ... ... ... ... ...

α

...

α

... ...

π 2 π 2 π 2

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → → → = → → ... ... → ... ... → ... ... → ... ... ... ... ... ...

Aleks Kissinger STRING 3, 2019 24 / 43

slide-56
SLIDE 56

Equations Rewrite rules

β

... ...

α+β

... ...

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → → → ... ... →

∓ π 2

... ... ... ... ... ... ... ... ... ... ... ...

∓ π 2 ∓ π 2 ∓ π 2 ± π 2

❦π

...

❥π

... ... → ... ... ... ... ... ... ... ... ...

❦π ❦π ❥π ❥π

... ... → ... ... ... →

π

... ...

α

...

α

... ... →

Aleks Kissinger STRING 3, 2019 24 / 43

slide-57
SLIDE 57

Equations Rewrite rules

β

... ...

α+β

... ...

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → → → ... ... →

∓ π 2

... ... ... ... ... ... ... ... ... ... ... ...

∓ π 2 ∓ π 2 ∓ π 2 ± π 2

❦π

...

❥π

... ... → ... ... ... ... ... ... ... ... ...

❦π ❦π ❥π ❥π

... ... → ... ... ... →

π

... ...

α

...

α

... ... → pivoting local complementation

Aleks Kissinger STRING 3, 2019 24 / 43

slide-58
SLIDE 58

Computing the skeleton

π 2 π 2 3π 2 π 2 5π 4 π 2 π 2 π 2 π 2 3π 2 π 2 3π 2 π 4 π 2 3π 2 3π 2 π 2 3π 2 3π 2 3π 2 π 2 π 2 3π 2 3π 2 3π 2 3π 2 3π 4 π 2 3π 2 π 2 π 2 π 2 π 2 π 2 π 2 3π 2 π 2 π 2 3π 2 3π 2 3π 2 3π 2 π 2 π 2 π 2 π 2 π 2 3π 2 3π 2 π 2 3π 2 3π 4 3π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2 3π 2 3π 2 π 2 π 2

... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...

π 2 π 4 5π 4 π 2 π 4 π 4

π π

Aleks Kissinger STRING 3, 2019 25 / 43

slide-59
SLIDE 59

Aleks Kissinger STRING 3, 2019 26 / 43

slide-60
SLIDE 60

ZX-diagram circuit?

π 2 π 4 5π 4 π 2 π 4 π 4

π π

  • ZX-diagrams can represent any linear map, but circuits are always

unitary

  • =

⇒ not all ZX-diagrams are equal to circuits

Aleks Kissinger STRING 3, 2019 27 / 43

slide-61
SLIDE 61

Problem (Circuit extraction problem)

Given a ZX-diagram that represents a unitary linear map, find an equivalent quantum circuit.

Conjecture

If the circuit extraction problem is solvable with polynomial overhead, then BQP = PostBQP. = ⇒ need heuristics or extra data

Aleks Kissinger STRING 3, 2019 28 / 43

slide-62
SLIDE 62

π

7π 4

π

3π 2 π 2 π 2 π 4

Aleks Kissinger STRING 3, 2019 29 / 43

slide-63
SLIDE 63

π

7π 4

π

3π 2 π 2 π 2 π 4

Aleks Kissinger STRING 3, 2019 29 / 43

slide-64
SLIDE 64

π

7π 4

π

3π 2 π 2 π 2 π 4

Aleks Kissinger STRING 3, 2019 29 / 43

slide-65
SLIDE 65

π

7π 4

π

3π 2 π 2 π 2 π 4

* * *

Aleks Kissinger STRING 3, 2019 29 / 43

slide-66
SLIDE 66

π

7π 4

π

3π 2 π 2 π 2 π 4

Aleks Kissinger STRING 3, 2019 29 / 43

slide-67
SLIDE 67

7π 4 3π 2 π 2 π 2 π 4

π π

Aleks Kissinger STRING 3, 2019 29 / 43

slide-68
SLIDE 68

7π 4 3π 2 π 2 π 2 π 4

π π

    1 1 1 1 1    

Aleks Kissinger STRING 3, 2019 29 / 43

slide-69
SLIDE 69

7π 4 3π 2 π 2 π 2 π 4

*

π π

    1 1 1 1 1     R1 := R1 + R4     1 1 1 1    

Aleks Kissinger STRING 3, 2019 29 / 43

slide-70
SLIDE 70

7π 4 3π 2 π 2 π 2 π 4

π π

Aleks Kissinger STRING 3, 2019 29 / 43

slide-71
SLIDE 71

π

7π 4

π

π 2 π 2 π 4 3π 2

Aleks Kissinger STRING 3, 2019 29 / 43

slide-72
SLIDE 72

Extraction and gFlow

  • Strategy always works iff the graph of a ZX-diagram has generalised

flow (gFlow) ∃≺, g.∀v. g(v) ⊆ v≻ ∧ Odd(v) ∩ I ∩ v≺ = {v}

  • Easy: quantum circuits have gFlow
  • Harder: these rules all preserve gFlow:

β

... ...

α+β

... ...

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → → → ... ... →

∓ π 2

... ... ... ... ... ... ... ... ... ... ... ...

∓ π 2 ∓ π 2 ∓ π 2 ± π 2

❦π

...

❥π

... ... → ... ... ... ... ... ... ... ... ...

❦π ❦π ❥π ❥π

... ... → ... ... ... →

π

... ...

α

...

α

... ... → pivoting local complementation

Aleks Kissinger STRING 3, 2019 30 / 43

slide-73
SLIDE 73

Clifford+T circuits

  • Built from:

CNOT := H := T :=

π 4

  • Contains Clifford circuits (S = T 2)
  • Universal for quantum computation

∀U∃C.C ≈ U

  • =

⇒ probably NOT efficient to simulate classically

Aleks Kissinger STRING 3, 2019 31 / 43

slide-74
SLIDE 74

T-count reduction

  • := reducing the number of T-gates in a circuit

7π 4 π 4 7π 4 π 4 π 4 π 4 7π 4 7π 4 π 4 7π 4 π 4 π 4 π 4 7π 4 7π 4 π 4 7π 4 π 4 π 4 π 4 7π 4

T gates

  • Q: Why T gates?
  • A: ∼100X more overhead in fault-tolerant quantum computing

2

2A Game of Surface Codes. Litinski 2019 Aleks Kissinger STRING 3, 2019 32 / 43

slide-75
SLIDE 75

β

... ...

α+β

... ...

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → → → ... ... →

∓ π 2

... ... ... ... ... ... ... ... ... ... ... ...

∓ π 2 ∓ π 2 ∓ π 2 ± π 2

❦π

...

❥π

... ... → ... ... ... ... ... ... ... ... ...

❦π ❦π ❥π ❥π

... ... → ... ... ... →

π

... ...

α

...

α

... ... →

Aleks Kissinger STRING 3, 2019 33 / 43

slide-76
SLIDE 76

...

❥π

... → ... ... ... ...

π 4

???

Aleks Kissinger STRING 3, 2019 34 / 43

slide-77
SLIDE 77

...

❥π

... → ... ... ... ...

π 4

???

Aleks Kissinger STRING 3, 2019 34 / 43

slide-78
SLIDE 78

...

❥π

... → ... ... ... ...

π 4

???

Aleks Kissinger STRING 3, 2019 34 / 43

slide-79
SLIDE 79

...

❥π

... → ... ... ... ...

π 4

???

Aleks Kissinger STRING 3, 2019 34 / 43

slide-80
SLIDE 80

...

❥π

... ... → ... ... ... ... ... ... ... ... ...

❥π ❥π

π 4 π 4

Aleks Kissinger STRING 3, 2019 34 / 43

slide-81
SLIDE 81

...

❥π

... ... → ... ... ... ... ... ... ... ... ...

❥π ❥π

π 4 π 4

Aleks Kissinger STRING 3, 2019 34 / 43

slide-82
SLIDE 82

...

❥π

... ... → ... ... ... ... ... ... ... ... ...

❥π ❥π

π 4 π 4

phase gadget

Aleks Kissinger STRING 3, 2019 34 / 43

slide-83
SLIDE 83

β

... ...

α+β

... ...

β

... ...

α

...

β

... ...

α+β

... ...

β

... ...

α

... → → → → ... ... →

∓ π 2

... ... ... ... ... ... ... ... ... ... ... ...

∓ π 2 ∓ π 2 ∓ π 2 ± π 2

❦π

...

❥π

... ... → ... ... ... ... ... ... ... ... ...

❦π ❦π ❥π ❥π

... ... → ... ... ... →

π

... ...

α

...

α

... ... → ...

❥π

... ... → ... ... ... ... ... ... ... ... ...

❥π ❥π

π 4 π 4

... ... ...

α β

→ ... ... ...

α + β

Aleks Kissinger STRING 3, 2019 35 / 43

slide-84
SLIDE 84

T-count reduction

7π 4 π 4 7π 4 π 4 π 4 π 4 7π 4 7π 4 π 4 7π 4 π 4 π 4 π 4 7π 4 7π 4 π 4 7π 4 π 4 π 4 π 4 7π 4

7π 4 7π 4 π 4 π 4 π 4 7π 4 7π 4 π 4 π 4 7π 4 π 4 π 4 7π 4 π 4 7π 4

7π 4 π 4 7π 4 π 4 3π 2 π 4 7π 4 π 4 7π 4 π 4 7π 4 7π 4 π 4 7π 4 π 4 π 2 π 2 π 4

Aleks Kissinger STRING 3, 2019 36 / 43

slide-85
SLIDE 85

T-count reduction

Circuit n T Best prev. Method PyZX adder8 24 399 213 RMm 173 Adder8 23 266 56 NRSCM 56 Adder16 47 602 120 NRSCM 120 Adder32 95 1274 248 NRSCM 248 Adder64 191 2618 504 NRSCM 504 barenco-tof3 5 28 16 Tpar 16 barenco-tof4 7 56 28 Tpar 28 barenco-tof5 9 84 40 Tpar 40 barenco-tof10 19 224 100 Tpar 100 tof3 5 21 15 Tpar 15 tof4 7 35 23 Tpar 23 tof5 9 49 31 Tpar 31 tof10 19 119 71 Tpar 71 csla-mux3 15 70 58 RMr 62 csum-mux9 30 196 76 RMr 84 cycle173 35 4739 1944 RMm 1797 gf(24)-mult 12 112 56 TODD 68 gf(25)-mult 15 175 90 TODD 115 gf(26)-mult 18 252 132 TODD 150 gf(27)-mult 21 343 185 TODD 217 gf(28)-mult 24 448 216 TODD 264 ham15-low 17 161 97 Tpar 97 ham15-med 17 574 230 Tpar 212 ham15-high 20 2457 1019 Tpar 1019 hwb6 7 105 75 Tpar 75 hwb8 12 5887 3531 RMm&r 3517 mod-mult-55 9 49 28 TODD 35 mod-red-21 11 119 73 Tpar 73 mod54 5 28 16 Tpar 8 nth-prime6 9 567 400 RMm&r 279 nth-prime8 12 6671 4045 RMm&r 4047 qcla-adder10 36 589 162 Tpar 162 qcla-com7 24 203 94 RMm 95 qcla-mod7 26 413 235 NRSCM 237 rc-adder6 14 77 47 RMm&r 47 vbe-adder3 10 70 24 Tpar 24

  • Compared with state of the art for

(ancilla-free) T-count reduction:

  • Amy, Maslov, Mosca. 2014
  • Amy, Mosca. 2016
  • Heyfron, Campbell. 2018
  • Nam et al. 2018
  • As of March 2019:
  • 26/36 ≈ 72% match SotA
  • 6/36 ≈ 17% beat SotA
  • In April 2019, Zhang and Chen matched

PyZX numbers

Aleks Kissinger STRING 3, 2019 37 / 43

slide-86
SLIDE 86

Circuit routing

Aleks Kissinger STRING 3, 2019 38 / 43

slide-87
SLIDE 87

Circuit routing

PyZX uses Gaussian elimination to extract circuits:

π

7π 4

π

π 2 π 2 π 4 3π 2

    1 1 1 1 1     R1 := R1 + R4     1 1 1 1    

By constrained GE, we produce routed circuits:

1 2 5 4 3 6 7 8 ⇒

⊕ ⊕ ⊕ ⊕ ⊕ 4 1 2 6 7 8 5 3 t1 t2 t3 t4 ⊕ t5

Aleks Kissinger STRING 3, 2019 39 / 43

slide-88
SLIDE 88

Circuit routing

Architecture CNOT QuilC PyZX Savings 9q-square 3 3.8 3 21.05% 9q-square 5 10.82 5.2 51.94% 9q-square 10 20.08 11.6 42.23% 9q-square 20 46.24 25.85 44.10% 9q-square 30 72.89 35.55 51.23% 16q-square 4 6.14 4.44 27.69% 16q-square 8 19.68 12.41 36.94% 16q-square 16 48.13 33.08 31.27% 16q-square 32 106.75 82.95 22.30% 16q-square 64 225.69 147.38 34.70% 16q-square 128 457.35 168.12 63.24% 16q-square 256 925.85 169.28 81.72% rigetti-16q-aspen 4 7.05 4.15 41.13% rigetti-16q-aspen 8 28.2 11.22 60.21% rigetti-16q-aspen 16 69.15 33.95 50.90% rigetti-16q-aspen 32 147.3 101.75 30.92% rigetti-16q-aspen 64 324.6 189.15 41.73% rigetti-16q-aspen 128 664.65 220.75 66.79% rigetti-16q-aspen 256 1367.89 222.15 83.76% ibm-qx5 4 6.75 4 40.74% ibm-qx5 8 23.7 8.95 62.24% ibm-qx5 16 60.5 26.55 56.12% ibm-qx5 32 140.05 84.4 39.74% ibm-qx5 64 301.05 152.65 49.29% ibm-qx5 128 600.9 188.25 68.67% ibm-qx5 256 1247.8 193.8 84.47% ibm-q20-tokyo 4 5.5 4 27.27% ibm-q20-tokyo 8 17.3 7.69 55.55% ibm-q20-tokyo 16 43.83 20.44 53.37% ibm-q20-tokyo 32 93.58 66.93 28.48% ibm-q20-tokyo 64 215.9 165.6 23.30% ibm-q20-tokyo 128 432.65 237.64 45.07% ibm-q20-tokyo 256 860.74 245.84 71.44%

  • up to 5X more efficient vs. Rigetti, CQC,

IBM

Aleks Kissinger STRING 3, 2019 40 / 43

slide-89
SLIDE 89

Verification

  • Q: How do we verify correctness of optimised circuits?

C D = ⇒ C = D

  • QMA-complete
  • PyZX optimiser is self-checking

C D = ⇒ C; D−1 1

  • ∼O(n1.5)
  • Sound approx. of circuit equality helps find bugs:

Aleks Kissinger STRING 3, 2019 41 / 43

slide-90
SLIDE 90

Where to?

  • More aggressive optimisation more difficult circuit extraction
7π 4 7π 4 π 4 π 4 π 4 7π 4 7π 4 π 4 π 4 7π 4 π 4 π 4 7π 4 π 4 7π 4

=

7π 4 7π 4 π 4 π 4 π 4 7π 4 7π 4 π 4 π 4 7π 4 π 4 π 4 7π 4 π 4 7π 4
  • Circuit routing for general circuits
  • Quantum static analysis
  • PyZX simplifier can prove “=”
  • Alternative models can prove “=”
  • Functorial semantics ‘abstract interpretation’ for string diagrams
  • Smart compilers

Hybrid systems

AZX

Quipper Python

ProjectQ/PyQuil

LIQUi|>

Languages Models Implementations

Plain Circuits Surface code EC Circuits MBQC

Ancilla-mediated

Ion Traps Optics Superconducting circuits

Software Engineering & Formal Methods Quantum Computation Systems Architecture

  • • •

Aleks Kissinger STRING 3, 2019 42 / 43

slide-91
SLIDE 91

Thanks!

  • Graph-theoretic Simplification of Quantum Circuits with the ZX-calculus. Ross

Duncan, Simon Perdrix, AK, John van de Wetering. arXiv:1902.03178 [quant-ph]

  • Reducing T-count with the ZX-calculus. AK, John van de Wetering

arXiv:1903.10477 [quant-ph]

  • CNOT circuit extraction for topologically-constrained quantum memories. AK,

Arianne Meijer-van de Griend arXiv:1903.00633 [quant-ph]

Quantomatic: quantomatic.github.io PyZX: github.com/Quantomatic/pyzx

Aleks Kissinger STRING 3, 2019 43 / 43