# Optimizing Quantum Circuits via ZX Diagrams using Reinforcement Learning and Graph Neural Networks

arXiv: https://arxiv.org/abs/2504.03429 · HTML: https://mlsanity.com/paper/2504.03429/

## Key facts

- Cited by 2 papers in the map (data through 14 Oct 2026).
- Placed in Quantum reinforcement learning, one of 15 directions in Deep reinforcement learning methods.
- Builds on 18 of its 52 references that are in the map.
- First posted on arXiv 4 Apr 2025.

## Placed in

- Deep reinforcement learning methods / [Quantum reinforcement learning](https://mlsanity.com/deeprl/quantum-reinforcement-learning/)

## Builds on (most cited first, 18 of 18)

- [Proximal Policy Optimization Algorithms](https://mlsanity.com/paper/1707.06347/) (2017)
- [Semi-Supervised Classification with Graph Convolutional Networks](https://mlsanity.com/paper/1609.02907/) (2016)
- [Fast Graph Representation Learning with PyTorch Geometric](https://mlsanity.com/paper/1903.02428/) (2019)
- [Geometric Deep Learning: Grids, Groups, Graphs, Geodesics, and Gauges](https://mlsanity.com/paper/2104.13478/) (2021)
- [Dota 2 with Large Scale Deep Reinforcement Learning](https://mlsanity.com/paper/1912.06680/) (2019)
- [Quantum Circuit Optimization with AlphaTensor](https://mlsanity.com/paper/2402.14396/) (2024)
- [Grow Your Limits: Continuous Improvement with Real-World RL for Robotic Locomotion](https://mlsanity.com/paper/2310.17634/) (2023)
- [Graph-theoretic Simplification of Quantum Circuits with the ZX-calculus](https://mlsanity.com/paper/1902.03178/) (2019)
- [On Efficient Reinforcement Learning for Full-length Game of StarCraft II](https://mlsanity.com/paper/2209.11553/) (2022)
- [Phase Gadget Synthesis for Shallow Circuits](https://mlsanity.com/paper/1906.01734/) (2019)
- [A Verified Optimizer for Quantum Circuits](https://mlsanity.com/paper/1912.02250/) (2019)
- [Optimizing ZX-Diagrams with Deep Reinforcement Learning](https://mlsanity.com/paper/2311.18588/) (2023)
- [Exact and practical pattern matching for quantum circuit optimization](https://mlsanity.com/paper/1909.05270/) (2019)
- [Reinforcement Learning for Node Selection in Branch-and-Bound](https://mlsanity.com/paper/2310.00112/) (2023)
- [Reducing 2-QuBit Gate Count for ZX-Calculus based Quantum Circuit Optimization](https://mlsanity.com/paper/2311.08881/) (2023)
- [Verifying the Smallest Interesting Colour Code with Quantomatic](https://mlsanity.com/paper/1706.02717/) (2017)
- [A universal completion of the ZX-calculus](https://mlsanity.com/paper/1706.09877/) (2017)
- [Optimized Noise Suppression for Quantum Circuits](https://mlsanity.com/paper/2401.06423/) (2024)

## Built on by (most cited first, 2 of 2)

- [Equivariant Reinforcement Learning for Clifford Quantum Circuit Synthesis](https://mlsanity.com/paper/2605.10910/) (2026)
- [Reinforcement Learning for Adaptive Composition of Quantum Circuit Optimisation Passes](https://mlsanity.com/paper/2601.21629/) (2026)

## Abstract (arXiv)

Quantum computing is currently strongly limited by the impact of noise, in particular introduced by the application of two-qubit gates. For this reason, reducing the number of two-qubit gates is of paramount importance on noisy intermediate-scale quantum hardware. To advance towards more reliable quantum computing, we introduce a framework based on ZX calculus, graph-neural networks and reinforcement learning for quantum circuit optimization. By combining reinforcement learning and tree search, our method addresses the challenge of selecting optimal sequences of ZX calculus rewrite rules. Instead of relying on existing heuristic rules for minimizing circuits, our method trains a novel reinforcement learning policy that directly operates on ZX-graphs, therefore allowing us to search through the space of all possible circuit transformations to find a circuit significantly minimizing the number of CNOT gates. This way we can scale beyond hard-coded rules towards discovering arbitrary optimization rules. We demonstrate our method's competetiveness with state-of-the-art circuit optimizers and generalization capabilities on large sets of diverse random circuits.
