QCIR: Pattern Matching Based Universal Quantum Circuit Rewriting Framework

Mingyu Chen,Yu Zhang,Yongshang Li,Zhen Wang,Jun Li,Xiangyang Li
DOI: https://doi.org/10.1145/3508352.3549405
2022-01-01
Abstract:Due to multiple limitations of quantum computers in the NISQ era, quantum compilation efforts are required to efficiently e x ecute q u antum a l gorithms o n N I SQ devices. Program rewriting based on pattern matching can improve the generalization ability of compiler optimization. However, it has rarely been explored for quantum circuit optimization, further considering physical features of target devices. In this paper, we propose a pattern-matching based quantum circuit optimization framework QCIR with a novel pattern description format, enabling the user-configured c ost m o del and two categories of patterns, i.e., generic patterns and folding patterns. To get better compilation latency, we propose a DAG representation of quantum circuit called QCir-DAG, and QVF algorithm for subcircuit matching. We implement continuous single-qubit optimization pass constructed by QCIR, achieving 10% and 20% optimization rate for benchmarks from Qiskit and ScaffCC, respectively. The practicality of QCIR is demonstrated by execution time and experimental results on the quantum simulator and quantum devices.
What problem does this paper attempt to address?