# qgym: A Gym for Training and Benchmarking RL-Based Quantum Compilation

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

## Key facts

- Cited by 5 papers in the map (data through 14 Oct 2026).
- Builds on 8 of its 28 references that are in the map.
- First posted on arXiv 1 Aug 2023.

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

- [Proximal Policy Optimization Algorithms](https://mlsanity.com/paper/1707.06347/) (2017)
- [OpenAI Gym](https://mlsanity.com/paper/1606.01540/) (2016)
- [CompilerGym: Robust, Performant Compiler Optimization Environments for AI Research](https://mlsanity.com/paper/2109.08267/) (2021)
- [On the qubit routing problem](https://mlsanity.com/paper/1902.08091/) (2019)
- [ScaffCC: Scalable Compilation and Analysis of Quantum Programs](https://mlsanity.com/paper/1507.01902/) (2015)
- [OpenQL : A Portable Quantum Programming Framework for Quantum Accelerators](https://mlsanity.com/paper/2005.13283/) (2020)
- [Resource-Efficient Quantum Computing by Breaking Abstractions](https://mlsanity.com/paper/2011.00028/) (2020)
- [Algorithmic Theory of Qubit Routing](https://mlsanity.com/paper/2305.02059/) (2023)

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

- [Quantum Architecture Search: A Survey](https://mlsanity.com/paper/2406.06210/) (2024)
- [Challenges for Reinforcement Learning in Quantum Circuit Design](https://mlsanity.com/paper/2312.11337/) (2023)
- [KetGPT - Dataset Augmentation of Quantum Circuits using Transformers](https://mlsanity.com/paper/2402.13352/) (2024)
- [CNOT Minimal Circuit Synthesis: A Reinforcement Learning Approach](https://mlsanity.com/paper/2510.23304/) (2025)
- [QAISim: A Toolkit for Modeling and Simulation of AI in Quantum Cloud Computing Environments](https://mlsanity.com/paper/2512.17918/) (2025)

## Abstract (arXiv)

Compiling a quantum circuit for specific quantum hardware is a challenging task. Moreover, current quantum computers have severe hardware limitations. To make the most use of the limited resources, the compilation process should be optimized. To improve currents methods, Reinforcement Learning (RL), a technique in which an agent interacts with an environment to learn complex policies to attain a specific goal, can be used. In this work, we present qgym, a software framework derived from the OpenAI gym, together with environments that are specifically tailored towards quantum compilation. The goal of qgym is to connect the research fields of Artificial Intelligence (AI) with quantum compilation by abstracting parts of the process that are irrelevant to either domain. It can be used to train and benchmark RL agents and algorithms in highly customizable environments.
