Table of Contents
Fetching ...

Cobble: Compiling Block Encodings for Quantum Computational Linear Algebra

Charles Yuan

TL;DR

Cobble presents a high-level language and compiler for block-encoded matrices in quantum computational linear algebra, addressing the abstraction gap between matrix expressions and gate-level circuits. It introduces a cost model that captures both gate count and subnormalization, enabling sound optimizations like sum fusion and polynomial fusion via QSVT. The system is shown to significantly reduce runtime costs (up to 25.4x in benchmarks) and to scale to sizable programs, outperforming existing circuit optimizers on several kernels. By combining a formal type system, denotational semantics, and practical benchmarks, Cobble demonstrates how high-level algebraic reasoning can drive efficient quantum circuit generation for linear-algebraic applications.

Abstract

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 estimate leading factors in time and space usage of programs, as well as optimizations that reduce overhead and generate efficient circuits using leading 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 not achieved by existing circuit optimizers on these benchmarks.

Cobble: Compiling Block Encodings for Quantum Computational Linear Algebra

TL;DR

Cobble presents a high-level language and compiler for block-encoded matrices in quantum computational linear algebra, addressing the abstraction gap between matrix expressions and gate-level circuits. It introduces a cost model that captures both gate count and subnormalization, enabling sound optimizations like sum fusion and polynomial fusion via QSVT. The system is shown to significantly reduce runtime costs (up to 25.4x in benchmarks) and to scale to sizable programs, outperforming existing circuit optimizers on several kernels. By combining a formal type system, denotational semantics, and practical benchmarks, Cobble demonstrates how high-level algebraic reasoning can drive efficient quantum circuit generation for linear-algebraic applications.

Abstract

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 estimate leading factors in time and space usage of programs, as well as optimizations that reduce overhead and generate efficient circuits using leading 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 not achieved by existing circuit optimizers on these benchmarks.

Paper Structure

This paper contains 88 sections, 3 theorems, 22 equations, 12 figures, 4 tables.

Key Result

theorem 1

If $M: \tau$, then $\llbracket {M} \rrbracket$ is a valid matrix and $\llparenthesis {M} \rrparenthesis$ is a valid quantum circuit.

Figures (12)

  • Figure 1: Initial quantum circuit that Cobble produces for the system in \ref{['eq:two-particle']}. The eight gates in orange are queries to $\mathcal{B}[X] = \textcolor{orange!80!black}{X}$ and $\mathcal{B}[Y] = \textcolor{orange!80!black}{Y}$. Filled $\bullet$ denotes control on $\ket{\texttt{1}}$ while hollow $\circ$ denotes control on $\ket{\texttt{0}}$. The notation ${}$ denotes post-selection: measuring the qubit and starting over until $\ket{\texttt{0}}$ is observed.
  • Figure 2: Final optimized circuit that Cobble produces for \ref{['eq:two-particle']} after performing sum fusion.
  • Figure 3: Initial quantum circuit that Cobble produces for the loss function in \ref{['eq:loss']}. The 12 gates in orange are queries to the black-box operators $\mathcal{B}[A] = \textcolor{orange!80!black}{U_A}$ and $\mathcal{B}[B] = \textcolor{orange!80!black}{U_B}$, assumed to use one ancilla.
  • Figure 4: Intermediate circuit that Cobble produces for \ref{['eq:loss']} after sum fusion.
  • Figure 5: Final optimized circuit that Cobble produces for \ref{['eq:loss']} after polynomial fusion.
  • ...and 7 more figures

Theorems & Definitions (6)

  • definition 1
  • definition 2
  • definition 3
  • theorem 1
  • theorem 2
  • theorem 3