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.
