Papers
Topics
Authors
Recent
Search
2000 character limit reached

Unitaria: Quantum Linear Algebra via Block Encodings

Published 11 May 2026 in quant-ph, cs.ET, cs.SE, and math.NA | (2605.10768v1)

Abstract: We introduce Unitaria, a Python library that brings the simplicity of classical linear algebra toolkits such as NumPy and SciPy to the implementation of quantum algorithms based on block encodings, a general-purpose abstraction in which a matrix is embedded as a sub-block of a larger unitary operator. Their implementation has so far required deep knowledge of low-level circuit construction, which Unitaria aims to eliminate. The library provides a composable, array-like interface through which users can define block encodings of matrices and vectors, combine them through standard operations such as addition, multiplication, tensor products, and the Quantum Singular Value Transformation, and extract the resulting quantum circuits automatically. A key feature is a matrix-arithmetic evaluation path in which every operation can be computed directly on encoded vectors and matrices without dependence on ancilla qubits or circuit simulation. This enables correctness verification and classical simulation that scale well beyond what state vector simulation permits and also allows resource estimation, including gate counts, qubit counts, and normalization constants, without executing any circuit. Together, these capabilities allow researchers to develop, verify, and analyze quantum linear algebra algorithms today, ahead of the availability of error-corrected hardware. Unitaria is open source and available at https://github.com/tequilahub/unitaria.

Summary

  • The paper introduces Unitaria, a Python library using block encodings to translate advanced linear algebra into quantum circuits.
  • It details core operations and incorporates Quantum Singular Value Transformation for scalable quantum algorithm design.
  • It presents a dual matrix-arithmetic and circuit evaluation model for classical verification and resource estimation.

Unitaria: High-Level Quantum Linear Algebra via Block Encodings

Introduction

The paper "Unitaria: Quantum Linear Algebra via Block Encodings" (2605.10768) introduces the Unitaria Python library, which establishes an array-based, compositional programming environment for constructing, manipulating, and analyzing quantum algorithms based on the block encoding formalism. Block encodings, central to much of modern quantum algorithmics, embed non-unitary matrices as sub-blocks within unitary operators, thereby facilitating the translation of abstract linear algebra structures into executable quantum circuits. Prior to Unitaria, employing such techniques required detailed knowledge of quantum circuit synthesis and manipulation. Unitaria abstracts these details, providing a high-level interface similar to classical numerical libraries such as NumPy and SciPy.

Theoretical Foundation: Block Encodings and Matrix Operations

Block encodings represent a matrix AA as a principal sub-block of a larger unitary UU and normalization ฮณโ‰ฅโˆฅAโˆฅ2\gamma \geq \|A\|_2, with associated (input/output) subspace projectors. By supporting arbitrary subspace structures and normalization, Unitaria generalizes over the common (ฮฑ,a,ฮต)(\alpha, a, \varepsilon)-block-encoding definition and is generic for non-square, rectangular, or even vector objects (i.e., state preparation). The formalization separates encoding from approximation, focusing on the precise subspace mapping and normalization at the data structure level.

The major algebraic operations required for quantum linear algebra are implemented:

  • Adjoint/Conjugate Transpose: Obtained directly by circuit reversal and index swapping.
  • Multiplication: Managed through sequenced application of subspace-aligned circuits, with intermediate permutations as necessary.
  • Tensor Product: Parallelizes block encoding operations on disjoint qubit subsets.
  • Block Diagonal and Addition: Recursed via control and composition, leveraging the Linear Combination of Unitaries (LCU) construction.

All such operations respect the internal normalization and subspace logistics, providing consistent abstraction of matrix-level quantum manipulations.

Integration of Quantum Singular Value Transformation (QSVT)

Unitaria natively incorporates QSVT, the foundational technique for implementing matrix polynomials on quantum states [Gilyรฉn et al., (Gilyรฉn et al., 2018); Martyn et al., (Martyn et al., 2021)]. QSVT's complexity lies in phase angle determination, controlled interleaving, and efficient handling of high-degree polynomial approximationsโ€”tasks streamlined through Unitaria's QSVT node classes and interoperability with tools such as pyqsp.

This formalism is essential for quantum eigenvalue transformation, Hamiltonian simulation, quantum linear systems algorithms, optimization, and various forms of quantum machine learning.

Matrix-Arithmetic Pathway and Resource Estimation

A key architectural advance in Unitaria is the matrix-arithmetic evaluation path. Every block encoding operation is dual-purposed: it can be (1) realized as a quantum circuit, or (2) evaluated directly at the matrix/vector layer, entirely circumventing circuit-level simulation. This is especially significant because:

  • Classical Verification: Correctness of complex quantum algorithm logic is verified over large matrices, bypassing the exponential burden of state vector simulation.
  • Resource Estimation: Gate depth, ancillary qubit count, and normalization constants are extracted statically from the computational graph, parameterized before quantum hardware execution.
  • No Ancilla/Measurement Overhead: Matrix-level simulation does not require explicit ancilla handling, dramatically increasing scalability.

This approach enables the development, debugging, and benchmarking of quantum algorithms for system sizes vastly exceeding the reach of current hardware or brute-force circuit simulators (2605.10768).

Software Architecture

Unitaria models every algebraic operation as a node in a computational directed acyclic graph (DAG), enabling:

  • Lazily Evaluated, Cached Operation Trees: Avoids repeated instantiation of expensive objects (circuits, matrices).
  • Operator Overloading: Enhances expressivity, e.g., using +, @, *, for addition, matrix multiplication, and scalar multiplication; tensor/kron products and block diagonals are similarly overloaded.
  • Indexable Subspaces: Subspace management is formalized via compressed representations supporting non-trivial register partitioning and basis mappings.

Integration with Tequila (and via it, multiple quantum simulation/hardware backends), ensures rapid mapping from abstract operator DAGs to executable quantum circuits, covering state-of-the-art simulated/hardware execution environments.

Numerical Examples and Application Scope

The paper details a range of concrete example applications, highlighting Unitariaโ€™s expressiveness and practical reach:

  • Finite Element PDE Solver: Discretized Laplacians are encoded, their pseudo-inverses constructed, and quantum circuits synthesized for algorithmic solving of second-order elliptic PDEs, e.g., simulating behavior under Dirichlet boundary conditions.
  • Multi-dimensional Convolutions: Gaussian kernel convolution is block-encoded with explicit separation of kernel-loading, index shifting, and overflow-handling logic, showcasing the coding-level reduction.
  • Generalized Matrix Computations: Matrix slicing, custom subspaces, and embedding within high-dimensional tensor networks are trivially composable.

These examples demonstrate both typical quantum algorithmic workflows and advanced use-cases previously limited by software engineering bottlenecks.

Comparison with Existing Ecosystem

The manuscript provides an extensive review of related toolkits (Qiskit, Cirq, PennyLane, Qrisp, Qualtran, Fable, Cobble) and contemporaneous efforts to abstract block encodings. While frameworks such as Qualtran and PennyLane expose basic block encoding support, they lack the integrated matrix-arithmetic/circuit duality and operator-level symbolic execution that Unitaria provides. Qrisp introduced user-defined operator abstraction, but Unitaria surpasses it in completeness, scope, and formalization of subspace structures [PZ26, HKY+24, Yua25].

Implications and Future Directions

The theoretically robust, practically accessible abstraction layer offered by Unitaria has several noteworthy implications:

  • Software Portability and Longevity: Code implementing quantum linear algebra via Unitaria is less vulnerable to hardware and platform churn; the abstraction may form the foundation for cross-compiler intermediate representations.
  • Algorithm Engineering: Research into normalization minimization, QSVT polynomial synthesis, and quantum resource optimization can proceed at the operator algebra layer, decoupled from hardware constraints.
  • Scalability: By decoupling logic verification from quantum hardware or classical circuit simulation, Unitaria enables the design of quantum algorithms significantly beyond current resource limits, expediting readiness for fault-tolerant devices.
  • Interoperability: The subspace and node abstraction may be adopted by future quantum computing frameworks as a de facto IR, as happened with classical linear algebra libraries.

Conclusion

Unitaria (2605.10768) advances the state-of-the-art in quantum algorithm design software by providing a compositional, array-based interface for block encoding algebra. Its dual matrix-arithmetic/circuit-centric paradigm bridges theory and practice, enabling high-level algorithm development, scalable classical prototyping, and static resource analysis. Unitariaโ€™s abstraction framework lowers the barrier for cross-disciplinary algorithmics in quantum linear algebra and is poised to shape how advanced quantum scientific computing is programmed, tested, and optimized. Future directions include further node specialization, automated normalization improvement, and continued integration with emerging quantum hardware 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.