T-count optimization of quantum circuits using graph-theoretical - - PowerPoint PPT Presentation

t count optimization of quantum circuits using graph
SMART_READER_LITE
LIVE PREVIEW

T-count optimization of quantum circuits using graph-theoretical - - PowerPoint PPT Presentation

T-count optimization of quantum circuits using graph-theoretical rewriting of ZX-diagrams Aleks Kissinger aleks@cs.ru.nl John van de Wetering john@vdwetering.name Institute for Computing and Information Sciences Radboud University Nijmegen


slide-1
SLIDE 1

T-count optimization of quantum circuits using graph-theoretical rewriting of ZX-diagrams

Aleks Kissinger

aleks@cs.ru.nl

John van de Wetering

john@vdwetering.name

Institute for Computing and Information Sciences Radboud University Nijmegen

February 20, 2019

slide-2
SLIDE 2

Quantum circuit optimization

§ We want to use quantum resources as efficiently as possible.

slide-3
SLIDE 3

Quantum circuit optimization

§ We want to use quantum resources as efficiently as possible. § So quantum circuits should contain as few gates as possible.

slide-4
SLIDE 4

Quantum circuit optimization

§ We want to use quantum resources as efficiently as possible. § So quantum circuits should contain as few gates as possible. § Several important metrics:

slide-5
SLIDE 5

Quantum circuit optimization

§ We want to use quantum resources as efficiently as possible. § So quantum circuits should contain as few gates as possible. § Several important metrics:

§ Gate-depth § 2-qubit gate count

slide-6
SLIDE 6

Quantum circuit optimization

§ We want to use quantum resources as efficiently as possible. § So quantum circuits should contain as few gates as possible. § Several important metrics:

§ Gate-depth § 2-qubit gate count § Number of T gates: T-count

( T = RZp π

4 q )

slide-7
SLIDE 7

Circuit diagrams

NOT =

+

CNOT =

+

An example quantum circuit:

T

` `

H

`

S S

slide-8
SLIDE 8

Circuit identities

+ +

=

H H

=

T T

=

S T: T

=

slide-9
SLIDE 9

Gate commutation

=

+ + + +

T

=

+

T

+

T

=

+ +

T T

+ +

T

slide-10
SLIDE 10

More circuit equalities

slide-11
SLIDE 11

And more circuit equalities

slide-12
SLIDE 12

And even more circuit equalities

slide-13
SLIDE 13

Things get messy because circuits are very rigid

slide-14
SLIDE 14

Things get messy because circuits are very rigid Enter ZX-diagrams

slide-15
SLIDE 15

ZX-diagrams

What gates are to circuits, spiders are to ZX-diagrams.

slide-16
SLIDE 16

ZX-diagrams

What gates are to circuits, spiders are to ZX-diagrams. Z-spider X-spider |0 ¨ ¨ ¨ 0y x0 ¨ ¨ ¨ 0| |+ ¨ ¨ ¨ +y x+ ¨ ¨ ¨ +| `eiα |1 ¨ ¨ ¨ 1y x1 ¨ ¨ ¨ 1| ` eiα |- ¨ ¨ ¨ -y x- ¨ ¨ ¨ -|

α

... ...

α

... ...

slide-17
SLIDE 17

ZX-diagrams

What gates are to circuits, spiders are to ZX-diagrams. Z-spider X-spider |0 ¨ ¨ ¨ 0y x0 ¨ ¨ ¨ 0| |+ ¨ ¨ ¨ +y x+ ¨ ¨ ¨ +| `eiα |1 ¨ ¨ ¨ 1y x1 ¨ ¨ ¨ 1| ` eiα |- ¨ ¨ ¨ -y x- ¨ ¨ ¨ -|

α

... ...

α

... ... Spiders can be wired in any way:

α

π 2 3π 2

β π

slide-18
SLIDE 18

Quantum gates as ZX-diagrams

Every quantum gate can be written as a ZX-diagram: S “

π 2

T “

π 4

H “ :=

π 2 π 2 π 2

CNOT “ CZ “ “

slide-19
SLIDE 19

Quantum gates as ZX-diagrams

Every quantum gate can be written as a ZX-diagram: S “

π 2

T “

π 4

H “ :=

π 2 π 2 π 2

CNOT “ CZ “ “

Universality

Any linear map between qubits can be represented as a ZX-diagram.

slide-20
SLIDE 20

Rules for ZX-diagrams: The ZX-calculus

β

... ...

α

... ... “ ... ... ...

α`β p-1qaα

aπ aπ aπ α

... ...

aπ aπ

...

aπ α

“ ...

aπ aπ α

... “

α

... “ “ “ α, β P r0, 2πs, a P t0, 1u

slide-21
SLIDE 21

Completeness of the ZX-calculus

Theorem (Vilmart 2018)

If two ZX-diagrams represent the same linear map, then they can be transformed into one another using the previous rules (and one additional one).

slide-22
SLIDE 22

Completeness of the ZX-calculus

Theorem (Vilmart 2018)

If two ZX-diagrams represent the same linear map, then they can be transformed into one another using the previous rules (and one additional one). So instead of dozens of circuit equalities, we just need a few simple rules.

slide-23
SLIDE 23

Optimization using ZX-diagrams

§ Write circuit as ZX-diagram.

slide-24
SLIDE 24

Optimization using ZX-diagrams

§ Write circuit as ZX-diagram. § Turn it into graph-like ZX-diagram.

slide-25
SLIDE 25

Optimization using ZX-diagrams

§ Write circuit as ZX-diagram. § Turn it into graph-like ZX-diagram. § Simplify the diagram.

slide-26
SLIDE 26

Optimization using ZX-diagrams

§ Write circuit as ZX-diagram. § Turn it into graph-like ZX-diagram. § Simplify the diagram. § Extract a circuit from the diagram.

slide-27
SLIDE 27

Graph-like diagrams

π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2

=

π 2

π

π 2 π 2 π 2 π 2 π 2

slide-28
SLIDE 28

Graph-like diagrams

π 2 π 2 π 2 π 2 π 2 π 2 π 2 π 2

=

π 2

π

π 2 π 2 π 2 π 2 π 2

Now we are ready for simplification. The game: Remove as many interior vertices as possible.

slide-29
SLIDE 29

The tools: Local complementation and pivoting

˘ π

2

α1 αn

... ... ... “ ...

α1¯ π

2

...

αn ¯ π

2

α2

...

αn

´ 1

...

α2¯ π

2

...

αn

´ 1¯ π 2

... ...

jπ α1

αn β1 βn γ1 γn kπ

... ... ...

αn ` kπ βn ` pj ` k ` 1qπ

...

β1 ` pj ` k ` 1qπ γ1 ` jπ α1 ` kπ

... ...

γn ` jπ

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

Duncan, Kissinger, Perdrix, vdW (2019)

slide-30
SLIDE 30

Circuit extraction

Example result after simplification:

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

slide-31
SLIDE 31

Circuit extraction

Example result after simplification:

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

The important thing: We can turn this back into a circuit.

slide-32
SLIDE 32

PyZX

§ PyZX is an open-source Python library. § github.com/Quantomatic/pyzx § Its goal is to allow easy manipulation of large ZX-diagrams.

slide-33
SLIDE 33

PyZX

§ PyZX is an open-source Python library. § github.com/Quantomatic/pyzx § Its goal is to allow easy manipulation of large ZX-diagrams. § It implements our rewrites and circuit extraction.

slide-34
SLIDE 34

PyZX

§ PyZX is an open-source Python library. § github.com/Quantomatic/pyzx § Its goal is to allow easy manipulation of large ZX-diagrams. § It implements our rewrites and circuit extraction. § T-count: matches or beats previous best in almost every case.

slide-35
SLIDE 35

PyZX

§ PyZX is an open-source Python library. § github.com/Quantomatic/pyzx § Its goal is to allow easy manipulation of large ZX-diagrams. § It implements our rewrites and circuit extraction. § T-count: matches or beats previous best in almost every case.

(Up to 50% better than previous best)

slide-36
SLIDE 36

Demonstration time

slide-37
SLIDE 37

Future work

§ Allow routing for restricted architectures

(With help from the Unitary Fund)

slide-38
SLIDE 38

Future work

§ Allow routing for restricted architectures

(With help from the Unitary Fund)

§ Optimize for different metrics.

slide-39
SLIDE 39

Future work

§ Allow routing for restricted architectures

(With help from the Unitary Fund)

§ Optimize for different metrics. § Allow auxiliary qubits.

slide-40
SLIDE 40

Future work

§ Allow routing for restricted architectures

(With help from the Unitary Fund)

§ Optimize for different metrics. § Allow auxiliary qubits. § Closer integration with other libraries

slide-41
SLIDE 41

Thank you for your attention

Further Reading:

Backens 2014, arXiv:1307.7025 The ZX-calculus is complete for stabilizer quantum mechanics Vilmart 2018, arXiv:1812.09114

A Near-Optimal Axiomatisation of ZX-Calculus for Pure Qubit Quantum Mechanics

Duncan, Kissinger, Perdrix, vdW 2019, arXiv:1902.03178 Graph-theoretic Simplification of Quantum Circuits with the ZX-calculus