pyzx quantum circuit optimization using the zx calculus
play

PyZX: Quantum circuit optimization using the ZX-calculus Aleks - PowerPoint PPT Presentation

PyZX: Quantum circuit optimization using the ZX-calculus Aleks Kissinger aleks@cs.ru.nl John van de Wetering john@vdwetering.name Institute for Computing and Information Sciences Radboud University Nijmegen February 3, 2019 Quantum


  1. PyZX: Quantum circuit optimization using the ZX-calculus Aleks Kissinger aleks@cs.ru.nl John van de Wetering john@vdwetering.name Institute for Computing and Information Sciences Radboud University Nijmegen February 3, 2019

  2. Quantum computation § Quantum computation is done by quantum circuits .

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

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

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

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

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

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

  9. Circuit diagrams NOT = CNOT = + +

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

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

  12. Gate commutation = + + + + T T = + + = T T T T + + + +

  13. More circuit equalities

  14. And more circuit equalities

  15. And even more circuit equalities

  16. Things get messy because circuits are very rigid

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

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

  19. ZX-diagrams What gates are to circuits, spiders are to ZX-diagrams. Z-spiders: X-spiders: ( α P r 0 , 2 π s ) α α ... ... ... ...

  20. ZX-diagrams What gates are to circuits, spiders are to ZX-diagrams. Z-spiders: X-spiders: ( α P r 0 , 2 π s ) α α ... ... ... ... Spiders can be wired in any way: π 2 β 3 π 2 α 0 π

  21. ZX-diagrams What gates are to circuits, spiders are to ZX-diagrams. Z-spiders: X-spiders: ( α P r 0 , 2 π s ) α α ... ... ... ... Spiders can be wired in any way: π 2 β 3 π 2 α 0 π Note: “Only connectivity matters”

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

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

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

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

  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). So instead of dozens of circuit equalities, we just have a few simple rules.

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

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

  29. PyZX § PyZX is an open-source Python library. § github.com/Quantomatic/pyzx § Its goal is to allow easy manipulation of large ZX-diagrams. § Visualisation: Jupyter and Matplotlib. § Documentation: Sphinx § Numpy for various things.

  30. PyZX and optimization § Recall: we want to minimize T-count.

  31. PyZX and optimization § Recall: we want to minimize T-count. § So how well does PyZX do this?

  32. PyZX and optimization § Recall: we want to minimize T-count. § So how well does PyZX do this? § For every circuit tested matches or beats the state-of-the-art.

  33. PyZX and optimization § Recall: we want to minimize T-count. § So how well does PyZX do this? § For every circuit tested matches or beats the state-of-the-art. (Usually performs similarly, but goes up to 50% better than previous best)

  34. PyZX and optimization § Recall: we want to minimize T-count. § So how well does PyZX do this? § For every circuit tested matches or beats the state-of-the-art. (Usually performs similarly, but goes up to 50% better than previous best) § What about other metrics: gate count/depth?

  35. PyZX and optimization § Recall: we want to minimize T-count. § So how well does PyZX do this? § For every circuit tested matches or beats the state-of-the-art. (Usually performs similarly, but goes up to 50% better than previous best) § What about other metrics: gate count/depth? § Work in progress.

  36. Demonstration time

  37. Future work § Allow routing for restricted architectures.

  38. Future work § Allow routing for restricted architectures. § Optimize for different metrics.

  39. Future work § Allow routing for restricted architectures. § Optimize for different metrics. § Allow ancillae.

  40. Future work § Allow routing for restricted architectures. § Optimize for different metrics. § Allow ancillae. § Closer integration with other frameworks/libraries.

  41. Thank you for your attention

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend