Papers
Topics
Authors
Recent
Search
2000 character limit reached

QLLVM: A Scalable Quantum-Classical Co-Compilation Framework based on LLVM

Published 16 Apr 2026 in quant-ph | (2604.15094v1)

Abstract: To address the urgent need in the NISQ era for high-performance, scalable quantum compilers and to advance the integration of classical and quantum computing, we present QLLVM, an advanced Quantum-Classical co-compilation framework built on LLVM. To our knowledge, QLLVM delivers an end-to-end, LLVM-based compilation workflow that unifies the build of classical high-performance programs, including CUDA, MPI, and C++, together with quantum programs into a single executable. For quantum program compilation, QLLVM adopts a three-stage design: high-level optimizations are implemented in the MLIR Quantum dialect and then lowered to QIR, an LLVM IR-based representation, for low-level optimization and hardware mapping. Its extensible architecture and seamless interoperability with classical high-performance computing provide an efficient, flexible, industrial-grade compilation infrastructure for future quantum software development. Experimental results show that, on the MQTBench benchmark suite, QLLVM reduces circuit depth and gate counts compared with state-of-the-art compilers and demonstrates clear advantages in compiling hybrid classical-quantum programs.

Summary

  • The paper introduces QLLVM, a unified co-compilation framework that integrates quantum and classical workloads within a single LLVM toolchain.
  • It employs a hybrid MLIR-based IR and SABRE heuristic for efficient qubit mapping and dynamic gate-level optimization, reducing circuit complexity.
  • Benchmark results show measurable performance improvements over Qiskit, Cirq, and PennyLane in reducing gate count and circuit depth.

QLLVM: A Scalable Quantum-Classical Co-Compilation Framework Based on LLVM

Overview

The paper "QLLVM: A Scalable Quantum-Classical Co-Compilation Framework based on LLVM" (2604.15094) introduces QLLVM, an extensible compilation framework focused on unified treatment of quantum and classical workloads within the established LLVM toolchain. QLLVM provides an end-to-end compilation workflow, supporting CUDA, MPI, C++, and quantum sources, compiling them seamlessly into a single executable. The key architectural innovation is the integration of quantum and high-performance classical code, realized via a hybrid MLIR-based intermediate representation and a compilation pipeline aware of both quantum circuit constraints and hardware specifics. The framework implements hardware-realistic qubit mapping and routing and demonstrates measurable improvement in quantum circuit optimization over canonical compilers such as Qiskit, Cirq, and PennyLane. Figure 1

Figure 1: The collaborative compilation workflow in QLLVM, illustrating the seamless integration of quantum and classical (C++, CUDA, MPI) compilation pipelines.

Architecture and Compilation Pipeline

QLLVM leverages the LLVM infrastructure to unify the build of high-performance classical and quantum workloads. The driver accepts heterogeneous program components—MPI- or CUDA-enabled C/C++, and quantum kernels (e.g., OpenQASM)—parses their boundaries, compiles each via the optimal respective toolchain, and links them into a cohesive binary. Quantum programs are subjected to a three-tier compilation workflow: lowering to a dedicated MLIR quantum dialect, followed by QIR (LLVM IR-based quantum representation), and culminating in hardware-specific code generation. This pipeline supports multiple frontend languages and back-end targets, offering extensibility and industrial-grade reliability.

Classical modules benefit from existing LLVM optimizations and native handling for CUDA and MPI. For quantum programs, QLLVM interfaces directly with MLIR, providing loop-aware gate-level optimization on high-level dialects, followed by lowering to QIR, where both device-aware qubit mapping and routing are performed using the SABRE mapping heuristic. Figure 2

Figure 2: A hybrid source and compilation example using QLLVM, combining C++, a CUDA kernel, and an OpenQASM quantum program into an integrated workflow.

This architectural model facilitates embedding quantum procedures as callable kernels in high-performance distributed or accelerated classical applications.

Quantum Compilation and Optimization Flow

QLLVM’s quantum pipeline centers around an MLIR-based dialect designed to reflect quantum semantics directly and support efficient transformation and optimization. The dialect models core types (Array, Qubit, Result) and exposes operations for quantum runtime management, gate application (with parameterizable rotation angles and dynamic decomposition), and measurement.

Gate-level optimization proceeds via a two-stage process: fusion of single-qubit gate sequences to reduce depth, and dynamic selection of the most compact Euler decomposition (ZYZ, XYX, ZXZ) tailored to minimize physical gate cost for the target hardware. Unsupported or out-of-gate-set operations are synthesized through decomposition at the MLIR level. The lowering to QIR then enables device- and topology-aware mapping and routing, with the SABRE algorithm efficiently managing SWAP insertion and adjacency constraints.

Hardware-aware qubit mapping is realized as an LLVM IR pass. QIR kernels are analyzed to reconstruct logical-to-physical mappings, construct circuit dependency DAGs, and execute iterative front-layer SABRE routing. This route enables scalable compilation targeted to real hardware connectivity constraints rather than idealized all-to-all models.

Comparative Performance and Optimization Results

Benchmarks against Qiskit, Cirq, and PennyLane on the MQTBench suite (25 circuits, 3–30 qubits) illustrate QLLVM’s quantum circuit optimization efficacy. QLLVM realizes an average 3.98% reduction in gate count and 3.56% circuit depth relative to Qiskit; a 1.19% and 1.61% reduction compared to Cirq; and a pronounced 74.96% (gate count) and 77.06% (depth) improvement over PennyLane. These gains are primarily ascribed to QLLVM’s advanced single-qubit gate fusion and dynamic decomposition strategy, yielding lower hardware noise susceptibility via reduced circuit complexity. Figure 3

Figure 3

Figure 3

Figure 3: QLLVM provides consistently lower gate counts and circuit depths relative to Qiskit, Cirq, and PennyLane across diverse benchmarks.

In hybrid paradigms, QLLVM enables a reproducible, single-command compilation and linkage workflow, dispatching computations across CPU, GPU, and quantum targets transparently and preserving compatibility with conventional build systems.

Integration with High-Performance Classical Toolchains

QLLVM's integration model is symmetric, treating quantum and classical sources (C/C++, CUDA, MPI) equivalently at the driver and linkage levels. CUDA and MPI components are managed via the native nvcc and mpicc pipelines, ensuring device-specific binary generation without overhead or intervention. The resulting binary links quantum kernels as callable routines, realized as externally visible symbols compatible with existing HPC linking models. This tight coupling is indispensable for mixed workloads arising in NISQ-era scientific applications, e.g., quantum-accelerated chemistry or materials simulations embedded in large-scale classical simulation environments.

Limitations and Future Directions

While QLLVM establishes a systems foundation and compiler extensibility for quantum-classical co-compilation, several limitations remain. The initial implementation targets primarily gate-model paradigms; just-in-time compilation for parameterized quantum circuits (e.g., variational algorithms), hardware-specific optimizations for platforms such as neutral atoms or photonics, and richer algorithmic coverage are currently outside its scope. Distributed quantum runtime support (beyond integration with classical MPI) is also not addressed.

Future directions include extending QLLVM to support dynamic circuit generation, deeper automated co-design with quantum control platforms, and integration of machine learning-driven adaptive optimizations. Further, expanding support for alternative IRs and hardware backend targets will reinforce the framework’s role in managing the rapidly evolving quantum/classical computing stack.

Conclusion

QLLVM delivers a robust LLVM-based framework for unified quantum-classical compilation, supporting heterogeneous high-performance workloads and advancing hardware-aware quantum circuit optimization beyond established toolchains (2604.15094). Its unified IR, extensible pipeline, and advanced optimization strategies enable practical deployment of hybrid workloads, with measurable improvements in quantum circuit resource metrics. The framework lays the groundwork for future evolution toward more adaptive, heterogeneous, and high-performance quantum-classical ecosystems.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.