Code
qcr:2606.09747.1

HHL Algorithm for Linear Systems (Qiskit)

The Harrow-Hassidim-Lloyd (HHL) algorithm is the foundational quantum routine for solving systems of linear equations of the form Ax = b, where A is a Hermitian matrix and b a known vector. Rather than returning the full solution vector classically (which would already cost time linear in the system size and erase any speedup), it prepares a quantum state proportional to the inverse of A applied to b and then estimates functions (observables) of that solution, giving an exponential speedup in the system dimension for sparse, well-conditioned matrices under suitable oracle assumptions. This is the clean, modern Qiskit implementation maintained as the quantum_linear_solvers package, the continuation of the HHL code that originally shipped inside Qiskit (IBM, 2021-2022) before it was removed from the core library. It runs on Qiskit 1.x and exposes a well-structured HHL solver alongside the building blocks the algorithm needs: efficient Hamiltonian-evolution matrices such as the tridiagonal Toeplitz matrix, observables such as MatrixFunctional and AbsoluteAverage that read out linear functionals of the solution, and a NumPy reference solver for verification. Internally it performs the canonical three stages: quantum phase estimation to write the eigenvalues of A into a register, an eigenvalue-inversion rotation of an ancilla via an exact reciprocal or a Chebyshev approximation, and uncomputation through inverse phase estimation to disentangle the registers, with optional Richardson extrapolation to reduce the error introduced by Trotterized Hamiltonian simulation. It is an excellent, production-quality reference for how phase estimation and controlled rotations combine to perform linear algebra on a quantum computer.
Linear Algebra
Qubit
Circuit-based
Uploaded 2 days ago
14
Views
Citing this entry? Use this QCR ID
Uploaded by
QL
QCR Librarian

Overview

anedumla/quantum_linear_solvers
2722
README.md

Quantum linear solvers

Contains classical and quantum algorithms to solve systems of linear equations such as the HHL algorithm.

Installation

git clone https://github.com/anedumla/quantum_linear_solvers.git
cd quantum_linear_solvers
pip install .

Documentation

Tutorial: https://learn.qiskit.org/course/ch-applications/solving-linear-systems-of-equations-using-hhl-and-its-qiskit-implementation

Join the Discussion

Comments (0)

No comments yet. Be the first to share your thoughts!

Indexed by QCR Librarian

This entry was created automatically from publicly available records. QCR links to public sources and only stores repository content where the license permits redistribution.

Publication

doi:10.48550/arxiv.0811.3171
Quantum algorithm for solving linear systems of equations

Aram W. Harrow, Avinatan Hassidim, Seth Lloyd

Versions

v1 Latest
Jun 17, 2026
qcr:2606.09747.1

Cite all versions? Use the base QCR ID to always reference the latest version of this entry.

Tools used

Qiskit

Keywords

hhl
linear-systems
phase-estimation
linear-algebra
qiskit

You may also like5