Exact and practical pattern matching for quantum circuit optimization
Not on the map. Why?
Abstract (arXiv)
Quantum computations are typically compiled into a circuit of basic quantum gates. Just like for classical circuits, a quantum compiler should optimize the quantum circuit, e.g. by minimizing the number of required gates. Optimizing quantum circuits is not only relevant for improving the runtime of quantum algorithms in the long term, but is also particularly important for near-term quantum devices that can only implement a small number of quantum gates before noise renders the computation useless. An important building block for many quantum circuit optimization techniques is pattern matching, where given a large and a small quantum circuit, we are interested in finding all maximal matches of the small circuit, called pattern, in the large circuit, considering pairwise commutation of quantum gates. In this work, we present a classical algorithm for pattern matching that provably finds all maximal matches in time polynomial in the circuit size (for a fixed pattern size). Our algorithm works for both quantum and reversible classical circuits. We demonstrate numerically that our algorithm, implemented in the open-source library Qiskit, scales considerably better than suggested by the theoretical worst-case complexity and is practical to use for circuit sizes typical for near-term quantum devices. Using our pattern matching algorithm as the basis for known circuit optimization techniques such as template matching and peephole optimization, we demonstrate a significant (~30%) reduction in gate count for random quantum circuits, and are able to further improve practically relevant quantum circuits that were already optimized with state-of-the-art techniques.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). First posted on arXiv 11 Sep 2019.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2024: 2; 2025: 2.
4 papers.
- 2024'Eliv'agar: Efficient Quantum Circuit Search for Classificationcited by 12
- 2024Quantum Circuit Synthesis and Compilation Optimization: Overview and Prospectscited by 8
- 2025Optimizing Quantum Circuits via ZX Diagrams using Reinforcement Learning and Graph Neural Networkscited by 2
- 2025Neural Guided Sampling for Quantum Circuit Optimizationcited by 0
- 2025Neural Guided Sampling for Quantum Circuit Optimization14 Oct 2025
- 2025Optimizing Quantum Circuits via ZX Diagrams using Reinforcement Learning and Graph Neural Networks4 Apr 2025
- 2024Quantum Circuit Synthesis and Compilation Optimization: Overview and Prospects30 Jun 2024
- 2024'Eliv'agar: Efficient Quantum Circuit Search for Classification17 Jan 2024