Optimizing ZX-Diagrams with Deep Reinforcement Learning (2311.18588v3)
Abstract: ZX-diagrams are a powerful graphical language for the description of quantum processes with applications in fundamental quantum mechanics, quantum circuit optimization, tensor network simulation, and many more. The utility of ZX-diagrams relies on a set of local transformation rules that can be applied to them without changing the underlying quantum process they describe. These rules can be exploited to optimize the structure of ZX-diagrams for a range of applications. However, finding an optimal sequence of transformation rules is generally an open problem. In this work, we bring together ZX-diagrams with reinforcement learning, a machine learning technique designed to discover an optimal sequence of actions in a decision-making problem and show that a trained reinforcement learning agent can significantly outperform other optimization techniques like a greedy strategy, simulated annealing, and state-of-the-art hand-crafted algorithms. The use of graph neural networks to encode the policy of the agent enables generalization to diagrams much bigger than seen during the training phase.
- “Picturing quantum processes: A first course in quantum theory and diagrammatic reasoning”. Cambridge University Press. (2017).
- Ross Duncan. “A graphical approach to measurement-based quantum computing”. In Quantum Physics and Linguistics: A Compositional, Diagrammatic Discourse. Oxford University Press (2013).
- “Barren plateaus in quantum tensor network optimization”. Quantum 7, 974 (2023).
- “Graphical structures for design and verification of quantum error correction”. Quantum Science and Technology 8, 045028 (2023).
- “Verifying the smallest interesting colour code with quantomatic.”. In Proceedings 14th International Conference on Quantum Physics and Logic. (2107). arXiv:1706.02717.
- “Speeding up quantum circuits simulation using ZX-calculus” (2023). arXiv:2305.02669.
- “Graph-theoretic simplification of quantum circuits with the ZX-calculus”. Quantum 4, 279 (2020).
- “Reducing 2-qubit gate count for ZX-calculus based quantum circuit optimization”. In Proceedings 19th International Conference on Quantum Physics and Logic. (2022). arXiv:2311.08881.
- “Annealing optimisation of mixed ZX phase circuits”. In Proceedings 19th International Conference on Quantum Physics and Logic. (2023). arXiv:2206.11839.
- Aleks Kissinger and John van de Wetering. “Reducing the number of non-clifford gates in quantum circuits”. Phys. Rev. A 102, 022406 (2020).
- “A recursively partitioned approach to architecture-aware ZX polynomial synthesis and optimization” (2023). arXiv:2303.17366.
- “Playing atari with deep reinforcement learning” (2013). arXiv:1312.5602.
- “A general reinforcement learning algorithm that masters chess, shogi, and go through self-play”. Science 362, 1140–1144 (2018).
- “Reinforcement learning in robotics: A survey”. The International Journal of Robotics Research 32, 1238–1274 (2013).
- “Learning dexterous in-hand manipulation”. The International Journal of Robotics Research 39, 3–20 (2020).
- “Graph convolutional policy network for goal-directed molecular graph generation”. Advances in neural information processing systems31 (2018).
- “Graphaf: a flow-based autoregressive model for molecular graph generation”. In International Conference on Learning Representations. (2020). arXiv:2001.09382.
- “Reinforcement learning with neural networks for quantum feedback”. Phys. Rev. X 8, 031084 (2018).
- “Simultaneous discovery of quantum error correction codes and encoders with a noise-aware reinforcement learning agent” (2023). arXiv:2311.04750.
- “Reinforcement learning decoders for fault-tolerant quantum computation”. Machine Learning: Science and Technology 2, 025005 (2020).
- “Experimental deep reinforcement learning for error-robust gate-set design on a superconducting quantum computer”. PRX Quantum 2, 040324 (2021).
- “Realizing a deep reinforcement learning agent discovering real-time feedback control strategies for a quantum system”. Nat. Comm. 14, 7138 (2023).
- “Quantum circuit optimization with deep reinforcement learning” (2021). arXiv:2103.07585.
- “Quarl: A learning-based quantum circuit optimizer” (2023). arXiv:2307.10120.
- “Graph neural networks: A review of methods and applications”. AI Open 1, 57–81 (2020).
- Renaud Vilmart. “A near-minimal axiomatisation of ZX-calculus for pure qubit quantum mechanics”. In 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS). Pages 1–10. (2019).
- John van de Wetering. “ZX-calculus for the working quantum computer scientist” (2020). arXiv:2012.13966.
- “Reinforcement learning: An introduction”. MIT press. (2018).
- “Proximal policy optimization algorithms” (2017). arXiv:1707.06347.
- “Neural message passing for quantum chemistry”. In International conference on machine learning. Pages 1263–1272. PMLR (2017).
- “Tf-gnn: Graph neural networks in tensorflow” (2022). arXiv:2207.03522.
- “The theory and practice of simulated annealing”. Pages 287–319. Springer US. Boston, MA (2003).
- “Graph neural networks: Foundations, frontiers, and applications”. Springer Singapore. Singapore (2022). url: graph-neural-networks.github.io.
- “Flow-preserving ZX-calculus rewrite rules for optimisation and obfuscation”. In Proceedings of the Twentieth International Conference on Quantum Physics and Logic. Volume 384 of Electronic Proceedings in Theoretical Computer Science, pages 203–219. Open Publishing Association (2023).
- Jan Nogué Gómez. “Reinforcement learning based circuit compilation via ZX-calculus”. Master’s thesis. Universitat de Barcelona. (2023).
- Maximilian Nägele. “Code for optimizing ZX-diagrams with deep reinforcement learning”. GitHub repository (2023). url: github.com/MaxNaeg/ZXreinforce.
- Schulmann John. “Approximating KL divergence”. personal blog (2020). url: http://joschu.net/blog/kl-approx.html.
- Schulmann John. “Modular rl”. GitHub repository (2018). url: github.com/joschu/modular_rl.
- “Adam: A method for stochastic optimization” (2014). arXiv:1412.6980.
- “What matters for on-policy deep actor-critic methods? a large-scale study”. In International conference on learning representations. (2020). arXiv:2006.05990.