A Pattern Matching Based Framework for Quantum Circuit Rewriting

Research output: Contribution to journalArticlepeer-review

1 Scopus citations

Abstract

The realization of quantum algorithms relies on specific quantum compilations according to the underlying quantum processors. However, there are various ways to physically implement qubits and manipulate those qubits in different physical devices. These differences lead to different communication methods and connection topologies, with each vendor implementing its own set of primitive gates. Therefore, quantum circuits have to be rewritten or transformed in order to be transplanted from one platform to another. We propose a pattern matching based framework for rewriting quantum circuits, called QRewriting. It takes advantage of a new representation of quantum circuits using symbolic sequences. Unlike the traditional approach using directed acyclic graphs, the new representation allows us to easily identify the patterns that appear non-consecutively but are reducible. Then, we convert the problem of pattern matching into that of finding distinct subsequences and propose a polynomial-time dynamic programming based pattern matching and replacement algorithm. We develop a rule library for basic optimizations and rewrite the arithmetic and Toffoli circuits from a commonly used gate set to the gate set supported by the Surface-17 quantum processor. Compared with a state-of-the-art quantum circuit optimization framework PaF optimized on the BIGD benchmarks, QRewriting further reduces the depth and the gate count by an average of 26.5% and 17.4%, respectively.

Original languageEnglish
Pages (from-to)1312-1327
Number of pages16
JournalJournal of Computer Science and Technology
Volume39
Issue number6
DOIs
StatePublished - Nov 2024

Keywords

  • pattern matching
  • quantum circuit rewriting
  • subsequence

Fingerprint

Dive into the research topics of 'A Pattern Matching Based Framework for Quantum Circuit Rewriting'. Together they form a unique fingerprint.

Cite this