Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

ACM International Conference on Computing Frontiers: Workshops and Special Sessions (CF Companion)

Compiling Linear Algebra Workloads from C to Quantum Circuits via Multi Level Intermediate Representation

Salvatore Pio Conte, Simone Cosenza, Giacomo Lancellotti, Giovanni Agosta

Published May 19, 2026• 0 citations
Publisher

Abstract

Linear algebra kernels are central to many quantum algorithms, yet existing quantum compilers primarily target scalar arithmetic, limiting their expressiveness and applicability to such workloads. In this work, we extend the QuantumC compilation framework to support the compilation of C programs containing linear algebra operations into quantum circuits. Our approach introduces pattern-based recognition of common vector and matrix computations, including vector addition, dot product, and matrix–matrix multiplication, and integrates a dedicated intermediate representation into the existing QuantumC pipeline. This design allows selecting between two quantum arithmetic backends—ripple-carry and quantum Fourier transform—enabling trade-offs in quantum resource usage. Additionally, we introduce a compile-time sparsity optimization pass that statically analyzes vector and matrix structures. For matrices with \(90\%\) sparsity in matrix multiplication, this optimization reduces qubit count by 91–\(97\%\), T-depth by 85–\(99\%\), and T-count by \(99\%\), depending on the selected arithmetic backend.

DOI
10.1145/3801488.3806071

Related papers

Quantum Circuit Synthesis from C via Multi-Level Intermediate Representation

Giacomo Lancellotti, Francesco Rosnati, Leonardo Ignazio Pagliochini +1 more

Programming quantum computers is a complex endeavor that requires highly specialized knowledge. Given the growing momentum of quantum computing, high-level synthesis of quantum circuits from well-known classical languages could significantly benefit the ecosystem, allowing specialists to focus on the parts of an application where quantum computing offers the greatest advantage, while letting the compiler handle the boilerplate code. To bridge this gap, we present a high-level synthesis framework that translates C programs into quantum circuits through a sequence of modular and structured Multi-Level Intermediate Representation (MLIR) dialects. These dialects expose classical control and data flow in a form compatible with quantum constraints, enabling reversible and unitary circuit generation. Our framework maps conditionals, loops, and arithmetic operations, supports configurable bitwidths, and allows retargetability to different quantum backends. Furthermore, we demonstrate a correlation between classical program metrics—such as instruction count and cyclomatic complexity—and the performance characteristics of the resulting quantum circuits. To validate our methodology, we quantify compilation resource usage, showing a linear scaling of memory footprint and a quadratic scaling of CPU time as a function of quantum circuit complexity. Our tool generates circuits in OpenQASM format, facilitating integration with current quantum programming frameworks.

ACM Symposium on Applied Computing•Mar 23, 2026•1 citation

Cobble: Compiling Block Encodings for Quantum Computational Linear Algebra

Charles Yuan

Quantum algorithms for computational linear algebra promise up to exponential speedups for applications such as simulation and regression, making them prime candidates for hardware realization. But these algorithms execute in a model that cannot efficiently store matrices in memory like a classical algorithm does, instead requiring developers to implement complex expressions for matrix arithmetic in terms of correct and efficient quantum circuits. Among the challenges for the developer is navigating a cost model in which conventional optimizations for linear algebra, such as subexpression reuse, can be inapplicable or unprofitable. In this work, we present Cobble, a language for programming with quantum computational linear algebra. Cobble enables developers to express and manipulate the quantum representations of matrices, known as block encodings, using high-level notation that automatically compiles to correct quantum circuits. Cobble features analyses that compute the time and space usage of programs, as well as optimizations that reduce overhead and generate efficient circuits using state-of-the-art techniques such as the quantum singular value transformation. We evaluate Cobble on benchmark kernels for simulation, regression, search, and other applications, showing 2.6x-25.4x speedups on these benchmarks compared to the unoptimized baseline.

cs.PLCross-listedarXiv:2511.01736•Proceedings of the ACM on Programming Languages•Nov 4, 2025•0 citations

Reducing the Complexity of Matrix Multiplication by Quantum Computing

Jiaqi Yao, Tianjian Huang, Tonghe Zhang +1 more

Matrix multiplication is a fundamental operation in compute-intensive tasks and a key component of modern quantum acceleration frameworks. Here we present a quantum matrix multiplication algorithm based on quantum kernels (QKMM), achieving an elementary gate complexity of \(O(N^2\log_2N)\), with amplitude encoding overhead explicitly included and without assuming a QRAM oracle. This scaling is asymptotically lower than that of the best-known classical matrix multiplication algorithm \(O(N^{2.371339})\). Building upon QKMM, we establish a family of quantum linear algebra operators, including Quantum Vector Inner Product (V${\scriptstyle 2}$V), Quantum Vector-Matrix Multiplication (V${\scriptstyle 2}$M), QKMM (M${\scriptstyle 2}$M), Quantum One-to-Many Matrix Multiplication(O${\scriptstyle 2}$M) and Quantum Sequential Matrix Multiplication (SMM), providing a unified framework from vector operations to parallel and sequential matrix transformations. Through noiseless simulations, realistic noise modelling and experiments on a superconducting quantum processor, we systematically characterize the numerical accuracy, resource requirements and hardware execution limits of this operator framework. Furthermore, we integrate SMM into deep neural-network inference, enabling intermediate features to propagate coherently across layers without repeated measurement and re-encoding. These results establish a pathway from quantum circuit-level algorithm design to end-to-end coherent computation, providing a quantum computing framework for matrix-centric compute-intensive applications.

quant-pharXiv:2602.05541•Feb 6, 2026•0 citations

Enabling Retargetable Optimizing Compilers for Quantum Accelerators via a Multi-Level Intermediate Representation

Thien Nguyen, Alexander McCaskey

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.

arXiv:2109.00506•Sep 1, 2021•0 citations

Quantum compilation framework for data loading

Guillermo Alonso-Linaje, Utkarsh Azad, Jay Soni +3 more

Efficient encoding of classical data into quantum circuits is a critical challenge that directly impacts the scalability of quantum algorithms. In this work, we present an automated compilation framework for resource-aware quantum data loading tailored to a given input vector and target error tolerance. By explicitly exploiting the trade-off between exact and approximate state preparation, our approach systematically partitions the total error budget between precision and approximation errors, thereby minimizing quantum resource costs. The framework supports a comprehensive suite of state-of-the-art methods, including multiplexer-based loaders, quantum read-only memory (QROM) constructions, sparse encodings, matrix product states (MPS), Fourier series loaders (FSL), and Walsh transform-based diagonal operators. We demonstrate the effectiveness of our framework across several applications, where it consistently uncovers non-obvious, resource-efficient strategies enabled by controlled approximation. In particular, we analyze a computational fluid dynamics workflow where the automated selection of MPS state preparation and Walsh transform-based encoding, combined with a novel Walsh-based measurement technique, leads to resource reductions of over four orders of magnitude compared to previous approaches. We also introduce two independent advances developed through the framework: a more efficient circuit for d-diagonal matrices, and an optimized block encoding for kinetic energy operators. Our results underscore the indispensable role of automated, approximation-aware compilation in making large-scale quantum algorithms feasible on resource-constrained hardware.

quant-pharXiv:2512.05183•Quantum Science and Technology•Dec 8, 2025•1 citation

Learned Intermediate Representations in Quantum Compilers

João Vitor Pansani Relvas

This preprint introduces a conceptual and experimental framework for integrating learned continuous representations into quantum compiler architectures. Modern quantum compilers rely on symbolic intermediate representations and rule-based transformation passes applied over circuit graphs. While effective, such approaches are inherently discrete and constrained by handcrafted rewrite rules and heuristic search strategies. This work proposes a Learned Intermediate Representation (LIR) paradigm in which quantum circuits are embedded into a continuous latent space. Within this framework: Circuit graphs are mapped to fixed-dimensional embeddings. Latent representations capture structural and operational properties of quantum circuits. Learned models guide symbolic transformation selection. Structural validity and physical correctness are enforced by a symbolic compilation layer. The proposed approach does not replace existing compilation infrastructures. Instead, it augments traditional symbolic pipelines with a learnable representation layer that enables data-driven optimization strategies while preserving correctness guarantees. The preprint includes: A formal definition of the encoder and latent representation space. A hybrid neural-symbolic decoding formulation. An experimental methodology for comparing neural-guided and rule-based compilation. Evaluation metrics focused on structural cost reduction (e.g., two-qubit gate count). Discussion of theoretical considerations, limitations, and future research directions. This work represents an initial investigation into continuous intermediate representations for quantum compilation and is intended as a foundation for further research in adaptive and data-driven compiler design.

•Feb 25, 2026•0 citations
Linear algebra kernels are central to many quantum algorithms, yet existing quantum compilers primarily target scalar arithmetic, limiting their expressiveness and applicability to such workloads. In this work, we extend the QuantumC compilation framework to support the compilation of C programs containing linear algebra operations into quantum circuits. Our approach introduces pattern-based recognition of common vector and matrix computations, including vector addition, dot product, and matrix–matrix multiplication, and integrates a dedicated intermediate representation into the existing QuantumC pipeline. This design allows selecting between two quantum arithmetic backends—ripple-carry and quantum Fourier transform—enabling trade-offs in quantum resource usage. Additionally, we introduce a compile-time sparsity optimization pass that statically analyzes vector and matrix structures. For matrices with (90%) sparsity in matrix multiplication, this optimization reduces qubit count by 91–(97%), T-depth by 85–(99%), and T-count by (99%), depending on the selected arithmetic backend.
Programming quantum computers is a complex endeavor that requires highly specialized knowledge. Given the growing momentum of quantum computing, high-level synthesis of quantum circuits from well-known classical languages could significantly benefit the ecosystem, allowing specialists to focus on the parts of an application where quantum computing offers the greatest advantage, while letting the compiler handle the boilerplate code. To bridge this gap, we present a high-level synthesis framework that translates C programs into quantum circuits through a sequence of modular and structured Multi-Level Intermediate Representation (MLIR) dialects. These dialects expose classical control and data flow in a form compatible with quantum constraints, enabling reversible and unitary circuit generation. Our framework maps conditionals, loops, and arithmetic operations, supports configurable bitwidths, and allows retargetability to different quantum backends. Furthermore, we demonstrate a correlation between classical program metrics—such as instruction count and cyclomatic complexity—and the performance characteristics of the resulting quantum circuits. To validate our methodology, we quantify compilation resource usage, showing a linear scaling of memory footprint and a quadratic scaling of CPU time as a function of quantum circuit complexity. Our tool generates circuits in OpenQASM format, facilitating integration with current quantum programming frameworks.
Quantum algorithms for computational linear algebra promise up to exponential speedups for applications such as simulation and regression, making them prime candidates for hardware realization. But these algorithms execute in a model that cannot efficiently store matrices in memory like a classical algorithm does, instead requiring developers to implement complex expressions for matrix arithmetic in terms of correct and efficient quantum circuits. Among the challenges for the developer is navigating a cost model in which conventional optimizations for linear algebra, such as subexpression reuse, can be inapplicable or unprofitable. In this work, we present Cobble, a language for programming with quantum computational linear algebra. Cobble enables developers to express and manipulate the quantum representations of matrices, known as block encodings, using high-level notation that automatically compiles to correct quantum circuits. Cobble features analyses that compute the time and space usage of programs, as well as optimizations that reduce overhead and generate efficient circuits using state-of-the-art techniques such as the quantum singular value transformation. We evaluate Cobble on benchmark kernels for simulation, regression, search, and other applications, showing 2.6x-25.4x speedups on these benchmarks compared to the unoptimized baseline.
Matrix multiplication is a fundamental operation in compute-intensive tasks and a key component of modern quantum acceleration frameworks. Here we present a quantum matrix multiplication algorithm based on quantum kernels (QKMM), achieving an elementary gate complexity of O(N2log⁡2N)O(N^2\log_2N)O(N2log2​N), with amplitude encoding overhead explicitly included and without assuming a QRAM oracle. This scaling is asymptotically lower than that of the best-known classical matrix multiplication algorithm O(N2.371339)O(N^{2.371339})O(N2.371339). Building upon QKMM, we establish a family of quantum linear algebra operators, including Quantum Vector Inner Product (V2{\scriptstyle 2}2V), Quantum Vector-Matrix Multiplication (V2{\scriptstyle 2}2M), QKMM (M2{\scriptstyle 2}2M), Quantum One-to-Many Matrix Multiplication(O2{\scriptstyle 2}2M) and Quantum Sequential Matrix Multiplication (SMM), providing a unified framework from vector operations to parallel and sequential matrix transformations. Through noiseless simulations, realistic noise modelling and experiments on a superconducting quantum processor, we systematically characterize the numerical accuracy, resource requirements and hardware execution limits of this operator framework. Furthermore, we integrate SMM into deep neural-network inference, enabling intermediate features to propagate coherently across layers without repeated measurement and re-encoding. These results establish a pathway from quantum circuit-level algorithm design to end-to-end coherent computation, providing a quantum computing framework for matrix-centric compute-intensive applications.
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.
Efficient encoding of classical data into quantum circuits is a critical challenge that directly impacts the scalability of quantum algorithms. In this work, we present an automated compilation framework for resource-aware quantum data loading tailored to a given input vector and target error tolerance. By explicitly exploiting the trade-off between exact and approximate state preparation, our approach systematically partitions the total error budget between precision and approximation errors, thereby minimizing quantum resource costs. The framework supports a comprehensive suite of state-of-the-art methods, including multiplexer-based loaders, quantum read-only memory (QROM) constructions, sparse encodings, matrix product states (MPS), Fourier series loaders (FSL), and Walsh transform-based diagonal operators. We demonstrate the effectiveness of our framework across several applications, where it consistently uncovers non-obvious, resource-efficient strategies enabled by controlled approximation. In particular, we analyze a computational fluid dynamics workflow where the automated selection of MPS state preparation and Walsh transform-based encoding, combined with a novel Walsh-based measurement technique, leads to resource reductions of over four orders of magnitude compared to previous approaches. We also introduce two independent advances developed through the framework: a more efficient circuit for d-diagonal matrices, and an optimized block encoding for kinetic energy operators. Our results underscore the indispensable role of automated, approximation-aware compilation in making large-scale quantum algorithms feasible on resource-constrained hardware.
This preprint introduces a conceptual and experimental framework for integrating learned continuous representations into quantum compiler architectures. Modern quantum compilers rely on symbolic intermediate representations and rule-based transformation passes applied over circuit graphs. While effective, such approaches are inherently discrete and constrained by handcrafted rewrite rules and heuristic search strategies. This work proposes a Learned Intermediate Representation (LIR) paradigm in which quantum circuits are embedded into a continuous latent space. Within this framework: Circuit graphs are mapped to fixed-dimensional embeddings. Latent representations capture structural and operational properties of quantum circuits. Learned models guide symbolic transformation selection. Structural validity and physical correctness are enforced by a symbolic compilation layer. The proposed approach does not replace existing compilation infrastructures. Instead, it augments traditional symbolic pipelines with a learnable representation layer that enables data-driven optimization strategies while preserving correctness guarantees. The preprint includes: A formal definition of the encoder and latent representation space. A hybrid neural-symbolic decoding formulation. An experimental methodology for comparing neural-guided and rule-based compilation. Evaluation metrics focused on structural cost reduction (e.g., two-qubit gate count). Discussion of theoretical considerations, limitations, and future research directions. This work represents an initial investigation into continuous intermediate representations for quantum compilation and is intended as a foundation for further research in adaptive and data-driven compiler design.