Quantum circuit optimisation, verification, and simulation with PyZX - - PowerPoint PPT Presentation

quantum circuit optimisation verification and simulation
SMART_READER_LITE
LIVE PREVIEW

Quantum circuit optimisation, verification, and simulation with PyZX - - PowerPoint PPT Presentation

Quantum circuit optimisation, verification, and simulation with PyZX Aleks Kissinger aleks.kissinger@cs.ox.ac.uk John van de Wetering john@vdwetering.name Institute for Computing and Information Sciences Radboud University Nijmegen February


slide-1
SLIDE 1

Quantum circuit optimisation, verification, and simulation with PyZX

Aleks Kissinger

aleks.kissinger@cs.ox.ac.uk

John van de Wetering

john@vdwetering.name

Institute for Computing and Information Sciences Radboud University Nijmegen

February 1, 2020

slide-2
SLIDE 2

PyZX: a Python library for manipulating large ZX-diagrams

slide-3
SLIDE 3

Quantum computation

§ Quantum computation is done by quantum circuits.

slide-4
SLIDE 4

Quantum computation

§ Quantum computation is done by quantum circuits. § A quantum circuit consists of quantum gates.

slide-5
SLIDE 5

Quantum computation

§ Quantum computation is done by quantum circuits. § A quantum circuit consists of quantum gates. § Single qubit gates: NOT, S, T, H.

slide-6
SLIDE 6

Quantum computation

§ Quantum computation is done by quantum circuits. § A quantum circuit consists of quantum gates. § Single qubit gates: NOT, S, T, H. NOT S = H ? NOT H H(adamard) T = ? S

slide-7
SLIDE 7

Quantum computation

§ Quantum computation is done by quantum circuits. § A quantum circuit consists of quantum gates. § Single qubit gates: NOT, S, T, H. NOT S = H ? NOT H H(adamard) T = ? S § Two qubit gate: CNOT (controlled NOT).

slide-8
SLIDE 8

Quantum computation

§ Quantum computation is done by quantum circuits. § A quantum circuit consists of quantum gates. § Single qubit gates: NOT, S, T, H. NOT S = H ? NOT H H(adamard) T = ? S § Two qubit gate: CNOT (controlled NOT). § These are all the gates you need.

slide-9
SLIDE 9

Quantum computation

§ Quantum computation is done by quantum circuits. § A quantum circuit consists of quantum gates. § Single qubit gates: NOT, S, T, H. NOT S = H ? NOT H H(adamard) T = ? S § Two qubit gate: CNOT (controlled NOT). § These are all the gates you need. § Our objective (for now) is to minimize number of gates needed

slide-10
SLIDE 10

Circuit diagrams

NOT =

+

CNOT =

+

slide-11
SLIDE 11

Circuit diagrams

NOT =

+

CNOT =

+

An example quantum circuit:

T

` `

H

`

S S

slide-12
SLIDE 12

Circuit identities

+ +

=

H H

=

T T

=

S T: T

=

slide-13
SLIDE 13

Gate commutation

=

+ + + +

T

=

+

T

+

T

=

+ +

T T

+ +

T

slide-14
SLIDE 14

More circuit equalities

slide-15
SLIDE 15

And more circuit equalities

slide-16
SLIDE 16

And even more circuit equalities

slide-17
SLIDE 17

Things get messy because circuits are very rigid

slide-18
SLIDE 18

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

slide-19
SLIDE 19

ZX-diagrams

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

slide-20
SLIDE 20

ZX-diagrams

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

α

... ... X-spiders:

α

... ... (α P r0, 2πs)

slide-21
SLIDE 21

ZX-diagrams

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

α

... ... X-spiders:

α

... ... (α P r0, 2πs) Spiders can be wired in any way:

α

π 2 3π 2

β π

slide-22
SLIDE 22

ZX-diagrams

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

α

... ... X-spiders:

α

... ... (α P r0, 2πs) Spiders can be wired in any way:

α

π 2 3π 2

β π

Note: “Only connectivity matters”

slide-23
SLIDE 23

Quantum gates as ZX-diagrams

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

π 2

T “

π 4

H “ :=

π 2 π 2 π 2

CNOT “

slide-24
SLIDE 24

Quantum gates as ZX-diagrams

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

π 2

T “

π 4

H “ :=

π 2 π 2 π 2

CNOT “

Theorem

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

slide-25
SLIDE 25

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-26
SLIDE 26

Completeness of the ZX-calculus

Theorem

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

slide-27
SLIDE 27

Completeness of the ZX-calculus

Theorem

If two ZX-diagrams represent the same computation, 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 have a few simple rules.

slide-28
SLIDE 28

PyZX

§ PyZX is an open-source Python library. § github.com/Quantomatic/pyzx

slide-29
SLIDE 29

PyZX

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

slide-30
SLIDE 30

PyZX

§ PyZX is an open-source Python library. § github.com/Quantomatic/pyzx § Its goal is to allow easy manipulation of large ZX-diagrams. § Does circuit optimisation § Does circuit verification § Does circuit simulation (WIP)

slide-31
SLIDE 31

Demonstration time

slide-32
SLIDE 32

Want to learn more?

§ github.com/Quantomatic/pyzx § zxcalculus.com

slide-33
SLIDE 33

Want to learn more?

§ github.com/Quantomatic/pyzx § zxcalculus.com

slide-34
SLIDE 34

Want to learn more?

§ github.com/Quantomatic/pyzx § zxcalculus.com

Thank you for your attention!