t count optimization of quantum circuits using graph
play

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


  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

  2. Quantum circuit optimization § We want to use quantum resources as efficiently as possible.

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

  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:

  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

  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 = R Z p π 4 q )

  7. Circuit diagrams NOT = CNOT = + + An example quantum circuit: ` T ` H S ` S

  8. Circuit identities = + + = H H T : = T = T T S

  9. Gate commutation = + + + + T T = + + = T T T T + + + +

  10. More circuit equalities

  11. And more circuit equalities

  12. And even more circuit equalities

  13. Things get messy because circuits are very rigid

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

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

  16. ZX-diagrams What gates are to circuits, spiders are to ZX-diagrams. Z-spider X-spider | 0 ¨ ¨ ¨ 0 y x 0 ¨ ¨ ¨ 0 | | + ¨ ¨ ¨ + y x + ¨ ¨ ¨ + | ` e i α | 1 ¨ ¨ ¨ 1 y x 1 ¨ ¨ ¨ 1 | ` e i α | - ¨ ¨ ¨ - y x - ¨ ¨ ¨ - | α α ... ... ... ...

  17. ZX-diagrams What gates are to circuits, spiders are to ZX-diagrams. Z-spider X-spider | 0 ¨ ¨ ¨ 0 y x 0 ¨ ¨ ¨ 0 | | + ¨ ¨ ¨ + y x + ¨ ¨ ¨ + | ` e i α | 1 ¨ ¨ ¨ 1 y x 1 ¨ ¨ ¨ 1 | ` e i α | - ¨ ¨ ¨ - y x - ¨ ¨ ¨ - | α α ... ... ... ... Spiders can be wired in any way: π 2 β 3 π 2 α 0 π

  18. Quantum gates as ZX-diagrams Every quantum gate can be written as a ZX-diagram: S “ T “ π π 2 4 H “ := π π π 2 2 2 CNOT “ CZ “ “

  19. Quantum gates as ZX-diagrams Every quantum gate can be written as a ZX-diagram: S “ T “ π π 2 4 H “ := π π π 2 2 2 CNOT “ CZ “ “ Universality Any linear map between qubits can be represented as a ZX-diagram.

  20. Rules for ZX-diagrams: The ZX-calculus α ... ... “ ... α ` β “ ... ... α α ... ... β ... ... a π a π a π a π “ a π α “ ... ... a π α p - 1 q a α ... ... a π a π “ “ “ α, β P r 0 , 2 π s , a P t 0 , 1 u

  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).

  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.

  23. Optimization using ZX-diagrams § Write circuit as ZX-diagram.

  24. Optimization using ZX-diagrams § Write circuit as ZX-diagram. § Turn it into graph-like ZX-diagram.

  25. Optimization using ZX-diagrams § Write circuit as ZX-diagram. § Turn it into graph-like ZX-diagram. § Simplify the diagram.

  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.

  27. Graph-like diagrams π π 2 2 π π π 2 2 2 π π 2 2 π 2 = π π 2 2 π π π 2 2 2 π π 2

  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.

  29. The tools: Local complementation and pivoting ˘ π α 1 ¯ π α n ¯ π 2 2 2 ... ... ... α 1 α n “ ... ... ... α 2 ¯ π α n 1 ¯ π 2 2 ´ α 2 α n 1 ´ ... ... ... ... ... ... ... ... j π k π α 1 γ 1 α 1 ` k π γ 1 ` j π ... ... ... ... “ ... α n γ n α n ` k π γ n ` j π ... ... ... ... β n ... ... β n ` p j ` k ` 1 q π β 1 ... ... β 1 ` p j ` k ` 1 q π ... Duncan, Kissinger, Perdrix, vdW (2019)

  30. Circuit extraction Example result after simplification: 7 π 5 π 4 4 π 2 3 π 5 π 2 4 3 π π 4 2

  31. Circuit extraction Example result after simplification: 7 π 5 π 4 4 π 2 3 π 5 π 2 4 3 π π 4 2 The important thing: We can turn this back into a circuit.

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

  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.

  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.

  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)

  36. Demonstration time

  37. Future work § Allow routing for restricted architectures (With help from the Unitary Fund)

  38. Future work § Allow routing for restricted architectures (With help from the Unitary Fund) § Optimize for different metrics.

  39. Future work § Allow routing for restricted architectures (With help from the Unitary Fund) § Optimize for different metrics. § Allow auxiliary qubits.

  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

  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

Recommend


More recommend