Table of Contents
Fetching ...

Integrating Quantum Software Tools with(in) MLIR

Patrick Hopf, Erick Ochoa Lopez, Yannick Stade, Damian Rovara, Nils Quetschlich, Ioan Albert Florea, Josh Izaac, Robert Wille, Lukas Burgholzer

TL;DR

This paper addresses the fragmentation of quantum software toolchains by advocating MLIR as a unifying compilation backbone. It presents a practical integration blueprint, demonstrated through a PennyLane–MQT case study, using dedicated MLIR dialects (Catalyst Quantum and MQTOpt) and a plugin-based workflow to enable seamless PennyLane↔MQT compilation round-trips. The approach includes TypeConverter-based dialect translations, open-source implementations, and a set of best practices to minimize complexity and enhance reusability. By lowering the entry barrier for quantum engineers to adopt MLIR, the work aims to enable modular, interoperable quantum software stacks that can more readily interface with classical/HPC infrastructures and future MLIR-based ecosystems.

Abstract

Compilers transform code into action. They convert high-level programs into executable hardware instructions - a crucial step in enabling reliable and scalable quantum computation. However, quantum compilation is still in its infancy, and many existing solutions are ad hoc, often developed independently and from scratch. The resulting lack of interoperability leads to significant missed potential, as quantum software tools remain isolated and cannot be seamlessly integrated into cohesive toolchains. The Multi-Level Intermediate Representation (MLIR) has addressed analogous challenges in the classical domain. It was developed within the LLVM project, which has long powered robust software stacks and enabled compilation across diverse software and hardware components, with particular importance in high-performance computing environments. However, MLIR's steep learning curve poses a significant barrier to entry, particularly in quantum computing, where much of the software stack is still predominantly built by experimentalists out of necessity rather than by experienced software engineers. This paper provides a practical and hands-on guide for quantum software engineers to overcome this steep learning curve. Through a concrete case study linking Xanadu's PennyLane framework with the Munich Quantum Toolkit (MQT), we outline actionable integration steps, highlight best practices, and share hard-earned insights from real-world development. This work aims to support quantum tool developers in navigating MLIR's complexities and to foster its adoption as a unifying bridge across a rapidly growing ecosystem of quantum software tools, ultimately guiding the development of more modular, interoperable, and integrated quantum software stacks.

Integrating Quantum Software Tools with(in) MLIR

TL;DR

This paper addresses the fragmentation of quantum software toolchains by advocating MLIR as a unifying compilation backbone. It presents a practical integration blueprint, demonstrated through a PennyLane–MQT case study, using dedicated MLIR dialects (Catalyst Quantum and MQTOpt) and a plugin-based workflow to enable seamless PennyLane↔MQT compilation round-trips. The approach includes TypeConverter-based dialect translations, open-source implementations, and a set of best practices to minimize complexity and enhance reusability. By lowering the entry barrier for quantum engineers to adopt MLIR, the work aims to enable modular, interoperable quantum software stacks that can more readily interface with classical/HPC infrastructures and future MLIR-based ecosystems.

Abstract

Compilers transform code into action. They convert high-level programs into executable hardware instructions - a crucial step in enabling reliable and scalable quantum computation. However, quantum compilation is still in its infancy, and many existing solutions are ad hoc, often developed independently and from scratch. The resulting lack of interoperability leads to significant missed potential, as quantum software tools remain isolated and cannot be seamlessly integrated into cohesive toolchains. The Multi-Level Intermediate Representation (MLIR) has addressed analogous challenges in the classical domain. It was developed within the LLVM project, which has long powered robust software stacks and enabled compilation across diverse software and hardware components, with particular importance in high-performance computing environments. However, MLIR's steep learning curve poses a significant barrier to entry, particularly in quantum computing, where much of the software stack is still predominantly built by experimentalists out of necessity rather than by experienced software engineers. This paper provides a practical and hands-on guide for quantum software engineers to overcome this steep learning curve. Through a concrete case study linking Xanadu's PennyLane framework with the Munich Quantum Toolkit (MQT), we outline actionable integration steps, highlight best practices, and share hard-earned insights from real-world development. This work aims to support quantum tool developers in navigating MLIR's complexities and to foster its adoption as a unifying bridge across a rapidly growing ecosystem of quantum software tools, ultimately guiding the development of more modular, interoperable, and integrated quantum software stacks.
Paper Structure (17 sections, 6 figures)

This paper contains 17 sections, 6 figures.

Figures (6)

  • Figure 1: Compilation of a quantum program---preparing the GHZ state---for a T-shaped five-qubit architecture which supports the native gate set $\{\mathrm{H}, \mathrm{T}, \mathrm{CNOT}\}$.
  • Figure 2: Mapping a quantum program defined in PennyLane bergholm_2022 with MQT QMAP Wille_2023 without MLIR integration.
  • Figure 3: Mapping a quantum program defined in PennyLane bergholm_2022 with MQT QMAP Wille_2023 using the MLIR plugin system.
  • Figure 4: Two MLIR dialects representing (parts of) the same quantum program.
  • Figure 5: Overview of a typical file structure of an MLIR-based project and its mlir-opt usage.
  • ...and 1 more figures

Theorems & Definitions (6)

  • Example 1
  • Example 2
  • Example 3
  • Example 4
  • Example 5
  • Example 6