Agentic MLIR-to-QIR Translation with Dual-Backend Testing: A Hybrid Deterministic and LLM Approach
Sharmin Afrose, Vicente Leyton-Ortega, Narasinga Rao Miniskar, Elaine Wong, Travis S. Humble
Abstract
Quantum frameworks each define their own Multi-Level Intermediate Representation (MLIR) dialect, so porting a circuit to a Quantum Intermediate Representation (QIR) runtime needs a hand-written pass per dialect. Our translator selects among three paths: a deterministic compiler path for known grammars (Catalyst and Quake), a large language model (LLM) agentic path for unseen dialects, and a repair path invoked when deterministic output fails testing. A dual-backend pipeline executes the source MLIR and generated QIR on independent simulators, comparing output distributions by total variation distance (TVD). For smaller open-weight models we replace retrieval-augmented generation with inline context engineering and add a guardrail-assembler that rebuilds valid QIR from incomplete output. Across 41 circuits spanning three dialects and 1-100 qubits, the deterministic path is gate-exact on all 70 circuit-dialect pairs, averaging above 95% TVD similarity (1-TVD). On an unseen fault-tolerant (FTQC) dialect, four of six models produce valid logical-level QIR on the first iteration.
Create a lesson
Related papers
QWeaver: Quantum Circuit Cut Workflow with MLIR-based Compiler, Runtime, and Weaver Hybrid Tasks
Shared title terminology · Narasinga Rao Miniskar, Elaine Wong, Vicente Leyton-Ortega et al.
Convex splitting by binary quantum hypothesis testing
Shared title terminology · Mark M. Wilde
Self-testing in Fermionic Networks
Shared title terminology · Fatemeh Moradi Kalarde, Luis Muñecas Tomás, Marc-Olivier Renou
Soft Mixture of Quantum Experts for Hybrid Quantum-Classical Learning
Shared title terminology · Valeria Repetto, Romina D'Aurizio, Piero Farinelli
Virtual Autopurification in Translationally Invariant Quantum States
Shared title terminology · Atsushi Iwaki, Hideaki Hakoshima, Nobuyuki Yoshioka
Doppler effect on dual-downlink time-bin quantum key distribution and a proposed ephemeris-assisted witness-field correction
Shared title terminology · Sacha Gressani, Luca Furfaro, Erik Kerstel et al.