Reinforcement Learning for Adaptive Composition of Quantum Circuit Optimisation Passes
Daniel Mills, Ifan Williams, Jacob Swain, Gabriel Matos, Enrico Rinaldi, Alexander Koziell-Pipe · 2026
Read Reinforcement Learning for Adaptive Composition of Quantum Circuit Optimisation Passes by Daniel Mills, Ifan Williams, Jacob Swain, Gabriel Matos, Enrico Rinaldi, Alexander Koziell-Pipe (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-21629.txt.
Introduction
Daniel Mills, Ifan Williams, Jacob Swain, Gabriel Matos, Enrico Rinaldi, and Alexander Koziell-Pipe teach a learner to order quantum circuit optimizations. Quantum toolkits ship many optimization passes, each well tested on its own. The order in which passes run, though, is left to the user or to a generic default.
The authors use reinforcement learning to compose pass sequences for each circuit. A good order for one circuit can be poor for another, so adapting per circuit beats one fixed recipe. Better ordering means smaller, faster circuits. That helps today's small quantum machines, where every saved operation counts.
Catalog record
| CREATOR | Daniel Mills, Ifan Williams, Jacob Swain, Gabriel Matos, Enrico Rinaldi, Alexander Koziell-Pipe |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 37 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2601-21629
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Reinforcement Learning for Adaptive Composition of Quantum Circuit Optimisation Passes Daniel Mills, Ifan Williams, Jacob Swain, Gabriel Matos, Enrico Rinaldi, Alexander Koziell-Pipe Abstract Many quantum software development kits provide a suite of circuit optimisation passes. These passes have been highly optimised and tested in isolation. However, the order in which they are applied is left to the user, or else defined in general-purpose default pass sequences. While general-purpose sequences miss opportunities for optimisation which are particular to individual circuits, designing pass sequences bespoke to particular circuits requires exceptional knowledge about quantum circuit design and optimisation. Here we propose and demonstrate training a reinforcement learning agent to compose optimisation-pass sequences. In particular the agent’s action space consists of passes for two-qubit gate count reduction used in default PyTKET pass sequences. For the circuits in our diverse test set, the (mean, median) fraction of two-qubit gates removed by the agent is ( 57.7 % , 56.7 % ) (57.7\%,\ 56.7\%) , compared to ( 41.8 % , 50.0 % ) (41.8\%,\ 50.0\%) for the next best default pass sequence. 1 Introduction Quantum circuit optimisation transforms a quantum circuit to improve the quality of its output. This quality can, for example, be measured by the fidelity of the output state to the ideal output state, or the accuracy of some derived quantity such as an observable expectation value. Often the number of two-qubit gates in the circuit is the dominant noise source [ 35 ] , and so can be used as a proxy for the total noise affecting the circuit. In such cases, to increase the quality of a circuit’s output it is desirable to reduce the number of two-qubit gates. Optimisation passes for reducing two-qubit gate count are the most relevant for existing devices, and as such are abundant and readily available in popular quantum software development kits (QSDKs) [ 50 , 20 , 61 , 11 , 57 , 22 , 32 , 18 ] . Examples include passes for Clifford subcircuit optimisation [ 12 ] , unitary resynthesis [ 61 ] , ZX-calculus-based rewriting [ 22 ] , and Pauli-gadget-based optimisation [ 32 ] . Many QSDKs offer default heuristic based sequences of optimisation passes, constructed to perform well in the typical case. There are however at least two obstacles to the widespread effective utilisation of optimisation passes. Firstly, optimisation passes regularly target particular circuit structures or employ advanced circuit rewriting techniques. As such, recognising when an optimisation pass can be beneficially applied often requires extraordinary expertise in circuit construction and optimisation. Secondly, selecting a sequence of optimisations is susceptible to the Phase Ordering Problem [ 6 ] , wherein the order of application of optimisations can impact the quality of the resulting circuit. Again, this can be hard to account for without very careful study of the particular circuit of concern. For the above reasons, fixed default pass sequences cannot be optimal in all cases, and a sequence bespoke to the circuit is preferred. Here we resolve this by using reinforcement learning (RL) to train an agent to analyse a quantum circuit, and propose a bespoke sequence of optimisation passes. We use Proximal Policy Optimisation (PPO) [ 47 ] with graph neural network (GNN) layers [ 45 , 58 ] , leveraging the native graph structure of quantum circuits. The model draws actions from a set of existing optimisation passes, improving on the utilisation of already available techniques. In particular, we demonstrate that when our model chooses from a selection of PyTKET [ 50 ] passes it outperforms default sequences of optimisation passes provided by PyTKET. On our comprehensive test set, the (mean, median) fraction of initial two-qubit gates removed by the agent is (57.7\%,\ 56.7\%) , compared to (41.8\%,\ 50.0\%) for the next best PyTKET default pass sequence. Finally, we compare our model to search-based approaches, which also create circuit-bespoke pass sequences. We demonstrate that our model produces optimised circuits of comparable two-qubit gate count to these search-based approaches, but at a notably lower time cost at execution. 2 Related Work [ 37 , 36 , 38 ] consider the related problem of selecting the device and the default optimisation-pass sequence best suited for a particular circuit. Here we focus on outperforming the default passes and fix the device. Further, the choice of neural network architecture used in [ 37 , 36 , 38 ] limits the agent to inputs from a fixed-size observation space consisting of a fixed number of features of the circuit. The agent introduced in this work takes the whole circuit as input, with no limit to the size of the circuit imposed by the model architecture, so it is not limited to making predictions based on only a few features. [ 10 ] also consider optimisation-pass selection but, rather than using neural networks, rely on classical simulation to rank optimisation passes. Clifford circuits similar to the original circuit, rather than the original circuit itself, are optimised and used to predict the performance of optimisation passes on the original circuit. Not using the original circuit limits the accuracy of the predictions, which is why we do use the original circuit here. This work sets out to improve the utilisation of existing global optimisation passes; those which rewrite the entirety of – or large parts of – a circuit at once. We consider global passes as they are the most abundant and well developed, and have been composed into the most carefully considered baseline default pass sequences. However, other works have used machine learning (ML) to support local rewriting. [ 15 ] employ convolutional neural networks acting on 3D grid representations of quantum circuits. The trained RL agent selects simple local rewrites, such as gate commutation and cancellation, on circuits with nearest neighbour connectivity. [ 24 ] utilise learned local representations of gates in a circuit to select a location in a circuit and a local transform to apply at that location, introducing a splitting of the action space to reduce its dimension. Neural network architectures have also been employed to select more complex local transformations based on the ZX calculus [ 28 , 42 , 5 , 27 ] . Relatedly, [ 60 , 59 ] perform a greedy search over local rewrites. Besides two-qubit gate count optimisation, [ 43 ] consider T-gate count reduction; translating circuits into a 3D “signature tensor” and utilising an extension of the AlphaTensor [ 14 ] transformer-based model to optimise portions of a circuit. Other works have considered the problems of routing and circuit layout , which take into account the constraints inherent to the connectivity of underlying hardware architecture. These works use techniques such as Monte-Carlo tree search [ 62 , 53 ] and RL [ 33 , 31 , 29 , 51 ] . As well as optimising existing circuits, ML has also been employed for the purpose of circuit synthesis [ 52 , 56 , 23 , 55 , 41 ] , where a target state or unitary is given and a new circuit implementing it must be constructed. It has also been employed to search for variational quantum algorithm ansatzes [ 44 ] . 3 RL for Pass Sequence Selection In this work,