Quantum internet applications coordinate classical control, local quantum operations, and entanglement/communication across independent nodes under strict protocol ordering constraints. While Qoala and QNodeOS provide programming and execution abstractions for such applications, there is no compiler infrastructure that systematically lowers Qoala programs to executable node-level code while enabling optimization. We present the first multi-level compiler pipeline for Qoala quantum internet programs. The compiler lowers programs through three MLIR-based IRs that progressively expose hybrid control flow, explicit quantum memory, and Qoala block structure. On top of this pipeline, we implement (i) local peephole rewrites, and (ii) a block-reordering pass formulated as a MILP to reduce qubit lifetimes under precedence and resource constraints. We also provide static analyses for gate counts, qubit lifetimes, fidelity estimation, and quantum-memory efficiency. We evaluate on rotation-merging and blind quantum computing benchmarks using density-matrix simulation and IRderived estimates, showing that block reordering improves fidelity and memory reuse in latency-dominated regimes with modest compilation overhead.
Quantum internet applications coordinate classical control, local quantum operations, and entanglement/communication across independent nodes under strict protocol ordering constraints. While Qoala and QNodeOS provide programming and execution abstractions for such applications, there is no compiler infrastructure that systematically lowers Qoala programs to executable node-level code while enabling optimization. We present the first multi-level compiler pipeline for Qoala quantum internet programs. The compiler lowers programs through three MLIR-based IRs that progressively expose hybrid control flow, explicit quantum memory, and Qoala block structure. On top of this pipeline, we implement (i) local peephole rewrites, and (ii) a block-reordering pass formulated as a MILP to reduce qubit lifetimes under precedence and resource constraints. We also provide static analyses for gate counts, qubit lifetimes, fidelity estimation, and quantum-memory efficiency. We evaluate on rotation-merging and blind quantum computing benchmarks using density-matrix simulation and IRderived estimates, showing that block reordering improves fidelity and memory reuse in latency-dominated regimes with modest compilation overhead.
Recently, a first-of-its-kind operating system for programmable quantum network nodes was developed, called QNodeOS. Here, we present an extension of QNodeOS called Qoala, which introduces (1) a unified program format for hybrid interactive classical-quantum programs, providing a well-defined target for compilers, and (2) a runtime representation of a program that allows joint scheduling of the hybrid classical-quantum program, multitasking, and asynchronous program execution. Based on concrete design considerations, we put forward the architecture of Qoala, including the program structure and execution mechanism. We implement Qoala in the form of a modular and extendible simulator that is validated against real-world quantum network hardware (available online). However, Qoala is not meant to be purely a simulator, and implementation is planned on real hardware. We evaluate Qoala's effectiveness and performance sensitivity to latencies and network schedules using an extensive simulation study. Qoala provides a framework that opens the door for future computer science research into quantum network applications, including scheduling algorithms and compilation strategies that can now readily be explored using the framework and tools provided.
Execution of quantum network applications requires a software stack for nodes. Recently, the first designs and demonstrations have been proposed for such software stacks, including QNodeOS and its extension, Qoala. The latter enables compilation strategies previously not possible in QNodeOS. Here, we show how the extensions provided by Qoala can be used by a compiler to improve the performance of quantum network applications. We define new compilation strategies that allow the compiler to influence the scheduling and execution of quantum programs on a quantum network node. Through simulation, we demonstrate that our compilation strategies can reduce the execution time by up to 29.53% and increase the success probability by up to 25.12%. Our work highlights the potential of compiler optimizations for quantum network programs.
We present a multi-level quantum-classical intermediate representation (IR) that enables an optimizing, retargetable, ahead-of-time compiler for available quantum programming languages. To demonstrate our architecture, we leverage our proposed IR to enable a compiler for version 3 of the OpenQASM quantum language specification. We support the entire gate-based OpenQASM 3 language and provide custom extensions for common quantum programming patterns and improved syntax. Our work builds upon the Multi-level Intermediate Representation (MLIR) framework and leverages its unique progressive lowering capabilities to map quantum language expressions to the LLVM machine-level IR. We provide both quantum and classical optimizations via the MLIR pattern rewriting sub-system and standard LLVM optimization passes, and demonstrate the programmability, compilation, and execution of our approach via standard benchmarks and test cases. In comparison to other standalone language and compiler efforts available today, our work results in compile times that are 1000x faster than standard Pythonic approaches, and 5-10x faster than comparative standalone quantum language compilers. Our compiler provides quantum resource optimizations via standard programming patterns that result in a 10x reduction in entangling operations, a common source of program noise. Ultimately, we see this work as a vehicle for rapid quantum compiler prototyping enabling language integration, optimizations, and interoperability with classical compilation approaches.
Decades of research have gone into classical compiler design, producing sophisticated frameworks that transform high-level programs into efficient machine code. Quantum computing faces the same challenge: translating quantum algorithms into hardware-executable instructions. A classical-first approach extends established compiler frameworks with quantum concepts, treating quantum processors as specialized accelerators within larger computing systems. This article presents multilevel intermediate representation (MLIR) as an effective foundation for this approach and demonstrates its use in the Munich Quantum Software Stack, which connects high-level applications to diverse quantum hardware through a modular, high-performance computing (HPC)-integrated pipeline. MLIR dialects support multiple abstraction levels while providing built-in parsing, transformation, and optimization infrastructure. Quantum programs are represented through complementary dialects: one explicitly encodes the circuit's dataflow graph, while the other mirrors established languages for seamless tool interoperability. The resulting framework, the Munich Quantum Toolkit Compiler Collection, supports compiler passes for both flat circuits and structured control flow. It is available at https://github.com/munich-quantum-toolkit/core.
As in classical computing, compilers play an important role in quantum computing. Quantum processors typically support a limited set of primitive operations or quantum gates and have certain hardware-related limitations. A quantum compiler is responsible for adapting a quantum program to these constraint environments and decomposing quantum gates into a sequence of the primitive ones. During the compilation process, it is also critical for the compiler to optimize the quantum circuits in order to reduce the noise in the computation results. Since the noise is introduced by operations and decoherence, reducing the gate count is the key for improving performance. In this paper, we propose a novel quantum compiler optimization, named relaxed peephole optimization (RPO) for quantum computers. RPO leverages the single-qubit state information that can be determined statically by the compiler. We define that a qubit is in a basis state when, at a given point in time, its state is either in the X-, Y-, or Z-basis (|+) / |-〉, |L〉 / R〉 and 10〉 / |1〉). When basis qubits are used as inputs to quantum gates, there exist opportunities for strength reduction, which replaces quantum operations with equivalent but less expensive ones. Compared to the existing peephole optimization for quantum programs, the difference is that our proposed optimization does not require an identical unitary matrix, thereby named `relaxed' peephole optimization. We also extend our approach to optimize the quantum gates when some input qubits are in known pure states. Both optimizations, namely the Quantum Basis-state Optimization (QBO) and the Quantum Pure-state Optimization (QPO), are implemented in the IBM's Qiskit transpiler. Our experimental results show that our proposed optimization pass is fast and effective. The circuits optimized with our compiler optimizations obtain up to 18.0% (11.7% on average) fewer CNOT gates and up to 8.2% (7.1% on average) lower transpilation time than that of the most aggressive optimization level in the Qiskit compiler. When running on real quantum computers, the success rates of 3-qubit quantum phase estimation algorithm improve by 2.30X due to the reduced gate counts.
Abstract Distributed quantum computing requires compiler infrastructure capable of partitioning quantum circuits across multiple quantum processing units (QPUs) and synthesizing entanglement-assisted communication channels. Existing quantum compilers—including Qiskit, t|ket⟩, and BQSKit—operate on single-QPU execution models and lack native support for multi-QPU intermediate representations. We present DQC, an MLIR-based distributed quantum compiler featuring a custom dqc dialect and a five-pass compilation pipeline: (1) interaction-graph-based qubit partitioning with weighted edge-cut minimization, (2) TeleGate synthesis replacing cross-QPU gates with EPR pair allocations and quantum teleportation sequences, (3) greedy operation reordering for communication pre-staging, (4) MPI dialect lowering for distributed runtime abstraction, and (5) LLVM IR emission targeting a quantum simulation runtime. We evaluate DQC on a distributed 4-qubit Quantum Fourier Transform and four additional benchmarks, demonstrating correct multi-QPU execution with verified quantum state output. To our knowledge, DQC is the first open-source MLIR-native compiler infrastructure targeting distributed quantum circuit execution with end-to-end compilation from high-level quantum IR to executable LLVM IR.