Fast Template Matching for Quantum Circuits Using Hypergraph
Xin Hong, Jintao Yu, Runhong He, Shenggang Ying, Sanjiang Li, Mingsheng Ying
Abstract
Quantum circuit optimization is a key step toward the efficient execution of quantum algorithms. Template matching has emerged as one of the dominant approaches for simplifying quantum circuits, yet it confronts the intrinsic challenge of accommodating gate commutativity. The state-of-the-art template-matching algorithm relies on a directed acyclic graph (DAG) representation. While this DAG-based technique handles gate commutativity satisfactorily, it fails to preserve the local connectivity inherent to quantum circuits, thereby leading to relatively high matching complexity. In this paper, we introduce a hypergraph representation (HG), a commutativity-aware representation that collapses commuting gates into a single super-node while retaining all local connectivity. This enables matches to be extended locally without revisiting the rest of the circuit, with incremental updates limited to the immediate neighborhood. Experimental results demonstrate that our HG matcher achieves 11--606x speed-up over the DAG-based implementation in Qiskit (Iten et al., 2022) on both random and arithmetic benchmarks, while maintaining the same optimization quality. The acceleration increases with circuit size, confirming that preserving locality and connectivity is the key to scalable quantum circuit optimisation.
Create a lesson
Metadata
- Comments
- Accepted and Presented at Design Automation Conference 2026
Related papers
Is training worth it? Matched-budget search over untrained circuits as a baseline for sparse dictionary learning with parameterized quantum-circuit atoms
Shared title terminologyquant-phAshley Stewart Morgan
Shallow quantum circuits beat prime modular circuits
Shared title terminologyquant-phMichael de Oliveira, Min-Hsiu Hsieh
Exploiting system geometry and spatial Markovianity to simulate quantum circuits
Shared title terminologyquant-phManuel S. Rudolph, Zoë Holmes
Realization of Discrete-Time Quantum Walks via Dynamic Circuits
Shared title terminologyquant-phWei-Ting Wang, Ching-Ray Chang
Exact and Efficient Quantum Circuits for Complex-Parameterized Fermionic Excitations
Shared title terminologyquant-phMoeko Harada, Haifeng Lang, Hiromichi Hayashi et al.
Hybrid Quantum--Classical Proximal Policy Optimization with Variational Quantum Circuits
Shared title terminologyquant-phSheng-Chieh Tseng, Samuel Yen-Chi Chen, Ying-Jer Kao