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 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
Problem: no quantum computers IBM Q 20 Tokyo Google Bristlecone Rigetti Aspen 16Q (+ Oxford, Vienna, Delft, Sussex, Grenoble...) Aleks Kissinger STRING 3, 2019 3 / 43
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
Quantum circuits • := the ‘assembly language’ of quantum computation, e.g. INIT 5 ⊕ H S 0 CNOT 1 0 ⊕ H 0 H 2 ⇔ Z 3 ⊕ ⊕ ⊕ H X T 0 H 0 ⊕ H 1 0 Z Z CNOT 4 2 ⊕ 0 ... Aleks Kissinger STRING 3, 2019 5 / 43
• Built out of fixed set of complex unitary matrices, or gates , e.g. 1 0 0 0 � 1 � 1 � � 0 1 0 0 1 0 1 := := := H √ S 0 0 0 1 2 1 − 1 0 i ⊕ 0 0 1 0 ...combined by ⊗ and ◦ . • Universal sets can gates can be used to construct any 2 n × 2 n 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
⊕ H S 0 ⊕ H 0 ⊕ ⊕ 0 H X T ⊕ Z Z 0 ⊕ 0 Aleks Kissinger STRING 3, 2019 7 / 43
⊕ ⊕ H S 0 H 0 ⊕ ⊕ 0 H X T ⊕ Z Z 0 ⊕ 0 Aleks Kissinger STRING 3, 2019 7 / 43
H S 0 H 0 ⊕ ⊕ 0 H X T ⊕ Z Z 0 ⊕ 0 Aleks Kissinger STRING 3, 2019 7 / 43
H S 0 H 0 ⊕ ⊕ 0 H X T ⊕ Z Z 0 ⊕ 0 Aleks Kissinger STRING 3, 2019 7 / 43
⊕ ⊕ H H = = ⊕ ⊕ ⊕ H H = Z Z = ⊕ ⊕ = H S H S H H ⊕ ⊕ ⊕ . . . Aleks Kissinger STRING 3, 2019 8 / 43
* Selinger 2015 Aleks Kissinger STRING 3, 2019 8 / 43
* Selinger 2015 Aleks Kissinger STRING 3, 2019 8 / 43
* Amy, Chen, & Ross 2018 Aleks Kissinger STRING 3, 2019 8 / 43
* Nam et al 2018 Aleks Kissinger STRING 3, 2019 8 / 43
⊕ H S 0 ⊕ H 0 ⊕ ⊕ ⊕ H X T 0 ⊕ 0 Z Z ⊕ 0 π π π π 2 2 2 2 π π π 2 2 2 π π π π π 2 2 2 4 π π Aleks Kissinger STRING 3, 2019 9 / 43
⊕ H S 0 ⊕ H 0 ⊕ ⊕ ⊕ H X T 0 ⊕ 0 Z Z ⊕ 0 π π π π 2 2 2 2 π π π 2 2 2 π π π π π 2 2 2 4 π π Aleks Kissinger STRING 3, 2019 9 / 43
π π π π 2 2 2 2 π π π 2 2 2 π π π π π 2 2 2 4 π π Aleks Kissinger STRING 3, 2019 9 / 43
π π π π 2 2 2 2 π π π 2 2 2 π π π π π 2 2 2 4 π π ZX-diagram Aleks Kissinger STRING 3, 2019 9 / 43
ZX-diagrams ...are made of spiders : 1 0 � � ... 0 0 = α ... ... ... 0 0 e i α 0 � 1 � 1 1 := � � := √ ... ... α α ... ... 1 − 1 2 Aleks Kissinger STRING 3, 2019 10 / 43
π 2 β 3 π 2 α π Aleks Kissinger STRING 3, 2019 11 / 43
β 3 π α 2 π π 2 Aleks Kissinger STRING 3, 2019 11 / 43
β π 3 π α 2 π 2 Aleks Kissinger STRING 3, 2019 11 / 43
1 ZX calculus these 8 rules = ⇒ everything before 1 Vilmart 2018. arXiv:1812.09114 Aleks Kissinger STRING 3, 2019 12 / 43
⊕ H S 0 ⊕ H 0 ⊕ ⊕ ⊕ 0 H X T ⊕ Z Z 0 ⊕ 0 Aleks Kissinger STRING 3, 2019 13 / 43
π π π π 2 2 2 2 π π π 2 2 2 π π π π π 2 2 2 4 π π Aleks Kissinger STRING 3, 2019 13 / 43
π π π 2 2 π π π 2 2 2 π π π π π 2 2 2 4 2 π Aleks Kissinger STRING 3, 2019 13 / 43
π π π 2 2 π π 2 2 π π π π 2 2 4 Aleks Kissinger STRING 3, 2019 13 / 43
π π π 2 2 π π 2 2 π π π π 2 2 4 Aleks Kissinger STRING 3, 2019 13 / 43
π π 2 π π 2 2 π π π π 2 2 4 Aleks Kissinger STRING 3, 2019 13 / 43
π 2 π π 4 Aleks Kissinger STRING 3, 2019 13 / 43
π 2 π 4 Aleks Kissinger STRING 3, 2019 13 / 43
π 2 π 4 Aleks Kissinger STRING 3, 2019 13 / 43
π 2 π 4 Aleks Kissinger STRING 3, 2019 13 / 43
Q: How do we scale up? π π π π 2 2 2 2 π π π 2 2 2 ≪ π π π π π 2 2 2 4 π π � �� � ∼ 30 spiders � �� � 10 3 - 10 7 spiders A: Automation. Aleks Kissinger STRING 3, 2019 14 / 43
Quantomatic • General-purpose, medium scale tool for teaching and experimenting with graphical calculi Aleks Kissinger STRING 3, 2019 15 / 43
PyZX • Special-purpose, large scale circuit optimisation tool for ZX-calculus Aleks Kissinger STRING 3, 2019 16 / 43
The idea 1. Turn equations into directed rewrite rules ... ... ... = ⇒ ... α α = → ... ... ... ... α + β α + β ... ... ... ... β β β β ... ... 2. Focus on tractible fragements of the language. Aleks Kissinger STRING 3, 2019 17 / 43
CNOT circuits • Built from: CNOT := • Efficient to classically simulate ( Z 2 -linear maps) • Always equal to a circuit of poly depth ( O ( n 2 )-bounded) • Expressible using phase-free ZX-diagrams ... ... ... ... ; Aleks Kissinger STRING 3, 2019 18 / 43
Clifford circuits • Built from: CNOT := H := S := π 2 • Efficient to classically simulate (Gottesman-Knill theorem) • Always equal to a circuit of poly depth ( O ( n 2 )-bounded) • Expressible by Clifford ZX-diagrams ... 2 ... ... 2 ... ; k ∈ Z ❦ π ❦ π Aleks Kissinger STRING 3, 2019 19 / 43
Clifford ZX-calculus ... ... = ... ... α = α = ... ... ... ... α + β α + β ... ... = ... ... β β β β ... ... = = = ... ... ... ... ... ... ... ... α α π π π 2 2 2 complete for Clifford ZX-diagrams Aleks Kissinger STRING 3, 2019 20 / 43
Equations � Rewrite rules Aleks Kissinger STRING 3, 2019 21 / 43
Equations � Rewrite rules ... ... = ... ... α = α = ... α + β ... ... α + β ... ... ... = ... ... β β β β ... ... = = = ... ... ... ... ... ... ... ... α α π π π 2 2 2 Aleks Kissinger STRING 3, 2019 21 / 43
Equations � Rewrite rules ... ... → ... ... α → α → ... α + β ... ... α + β ... ... ... → ... ... β β β β ... ... = = = ... ... ... ... ... ... ... ... α α π π π 2 2 2 Aleks Kissinger STRING 3, 2019 21 / 43
Aleks Kissinger ... ... ... α ... α ... β β ... ... → = ... ... ... → α + β α Equations � Rewrite rules ... ... ... ... ... ... ... α ... ... β β ... ... → → = ... ... ... α + β ... ... ... ... → ... = → → STRING 3, 2019 2 π ... π 2 2 π 21 / 43
Aleks Kissinger ... ... ... α ... α ... β β ... ... → = ... ... ... → α + β α Equations � Rewrite rules ... ... ... ... ... ... ... α ... ... β β ... ... → → = ... ... ... α + β ... ... ... ... → ... = → → STRING 3, 2019 2 π ... π 2 2 π 22 / 43
Aleks Kissinger ... ... ... α ... α ... β β ... ... → = ... ... ... → α + β α Equations � Rewrite rules ... ... ... ... ... ... ... α ... ... ... β β ... ... ... → → = ... ... ... α + β ... ... ... ... ... ... → ... = → → STRING 3, 2019 2 π ... π 2 2 π 22 / 43
Aleks Kissinger ... ... ... α ... α ... β β ... ... → = ... ... ... → α + β α Equations � Rewrite rules ... ... ... ... ... ... ... α ... ... ... β β ... ... ... → → = ... ... ... α + β ... ... ... ... ... ... → ... = → → STRING 3, 2019 2 π ... π 2 2 π 22 / 43
Aleks Kissinger ... ... ... α ... α ... β β ... ... → = ... ... ... → α + β α Equations � Rewrite rules ... ... ... ... ... ... ... α ... ... ... β β ... ... ... → → → ... ... ... α + β ... ... ... ... ... ... → ... = → → STRING 3, 2019 2 π ... π 2 2 π 22 / 43
Aleks Kissinger ... ... ... α ... ... α β β ... ... → → ... ... ... → α + β α Equations � Rewrite rules ... ... ... ... ... ... ... α ... ... ... β β ... ... ... → → → ... ... ... α + β ... ... ... ... ... ... → ... = → → STRING 3, 2019 2 π ... π 2 2 π 22 / 43
π 2 3 π 2 π Aleks Kissinger STRING 3, 2019 23 / 43
Recommend
More recommend