Quantum Circuit Transformations with a Multi-Level Intermediate Representation Compiler

Thien Nguyen, Dmitry I. Lyakh, Raphael C. Pooser, Travis S. Humble, Timothy Proctor, Mohan SarovararXiv 2021

Introduction

In the current Noisy Intermediate-Scale Quantum (NISQ) era, quantum computers are plagued by errors stemming from decoherence, gate inaccuracies, and crosstalk. A critical challenge for researchers is Verification and Validation (V&V): determining whether the output of a quantum program reflects the intended algorithm or is merely hardware-induced noise. While "mirror circuits"—circuits designed to return a predictable result—are a known solution for estimating error, their implementation has traditionally been a manual and bespoke process. This paper presents a systematic, automated approach to integrate these diagnostics directly into the compilation pipeline using the Multi-Level Intermediate Representation (MLIR) framework.

The QCOR/MLIR Compilation Framework

The authors leverage the MLIR infrastructure, a flexible compiler framework originally developed for classical high-performance computing, and integrate it into QCOR, a full-stack quantum compilation framework. MLIR’s "dialect" system is uniquely suited for quantum computing, allowing the compiler to reason about programs at multiple levels—from high-level logical gates down to physical hardware constraints like connectivity and native gate sets.

The QCOR software stack leveraging MLIR for quantum-classical optimization and transformation.

Automated Validation via Mirror Circuits

The core of this work is a compiler "pass" that automatically generates Mirror Circuits. This process involves a "compute-then-uncompute" strategy where the compiler takes a target circuit $C$, appends random Pauli gates, and adds a "quasi-inverse" circuit $C^{-1}$. In an ideal scenario, this mirrored circuit returns a predictable bit string (e.g., all zeros). The insertion of random gates ensures that coherent errors are revealed as detectable noise. Using MLIR’s PassManager, these circuits are automatically injected during the "lowering" phase, translating high-level code into machine instructions.

Flowchart of the automated validation process within the MLIR compiler pipeline.

Experimental Evaluation and Results

The compiler's performance was evaluated using a Variational Quantum Eigensolver (VQE) ansatz for calculating the ground state energy of a deuteron. Benchmarks were conducted across diverse hardware, including IBM's superconducting Falcon processors (ibmq_lima, ibmq_bogota) and Honeywell’s H1 trapped-ion hardware.

Key Findings

  • Hardware Performance: Honeywell H1 demonstrated the highest fidelity with a success probability ($P'$) of approximately 0.991, while IBM devices ranged from 0.935 to 0.951.
  • Metric Correlation: The success probability of automated mirror circuits correlated strongly with standard statistical distance measures (Wasserstein, Energy, KL, and JS), validating $P'$ as a reliable proxy for algorithmic fidelity.
  • Cross-Platform Efficiency: The MLIR approach enabled rapid, automated testing of the same high-level OpenQASM code across fundamentally different qubit technologies.

Conclusion and Future Directions

By moving V&V from a manual post-processing task to a native compiler feature, this work provides a scalable method for estimating execution fidelity. Future work will focus on distinguishing gate errors from readout errors and scaling these diagnostic techniques to larger, deeper circuits. Additionally, "local circuit inversions" could help pinpoint specific hardware failure locations within a circuit.

Summary updated

BibTeX
@misc{nguyen2021quantum,
  author = {Thien Nguyen and Dmitry I. Lyakh and Raphael C. Pooser and Travis S. Humble and Timothy Proctor and Mohan Sarovar},
  title = {{Quantum Circuit Transformations with a Multi-Level Intermediate Representation Compiler}},
  year = {2021},
  eprint = {2112.10677},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2112.10677},
}
Figure