Sign in
← Atlas
Strong empiricalAlgorithmsQuantum linear algebra

HHL linear-systems reference

A linear-algebra reference that forces the catalog to show input loading, conditioning, and output observability.

linear systemsPDEfinancecondition number

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.

HHL is often cited for quantum linear systems, but it is best used as a requirements checklist: sparse access, a well-conditioned system, a state-preparation model, and an observable—not a free classical vector output.

Circuit & simulation
Observable of x70%
What this takes and returns
TakesNothingWhat joins here

No input port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.

Nothing in the Atlas meets this end.

ReturnsNothingWhat joins here

No output port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.

Nothing in the Atlas meets this end.

This record publishes no gate sequence and no register, so there is nothing here to read an interface off. Absent rather than empty. See all 152 →

Where this sits

This record is named by the layer graph at:

  • HHL: eigenvalue inversion by phase estimation Method

    Takes An access model for AA — sparse row/column entry oracles, or a block-encoding; a unitary preparing b\lvert b\rangle; a known upper bound κ\kappa on the condition number; the normalisation A1\lVert A\rVert \le 1; and a target state error ε\varepsilon. Returns A flagged state ε\varepsilon-close in 2\ell_2 to A1b/A1bA^{-1}\lvert b\rangle/\lVert A^{-1}\lvert b\rangle\rVert. It does not return x\lVert x\rVert, any entry of xx, or any classical functional of xx — those cost extra and are decided a layer above.

How it works

HHL estimates an observable of the solution xA1b|x\rangle\propto A^{-1}|b\rangle to a linear system Ax=bAx=b for Hermitian, ss-sparse AA (or made Hermitian via a standard block embedding). The circuit encodes AA's eigenvalues into a phase register via quantum phase estimation on eiAte^{iAt}, applies a controlled rotation proportional to λ1\lambda^{-1} on an ancilla, and uncomputes the phase register, leaving x|x\rangle entangled with an ancilla flag. Under the coherent access model, circuit cost scales roughly as O(sκ2log(1/ϵ))O(s\,\kappa^2\log(1/\epsilon)) where κ=λmax/λmin\kappa=|\lambda_{\max}|/|\lambda_{\min}| is AA's condition number and ϵ\epsilon the target precision — versus roughly O(sκ)O(s\kappa) for classical conjugate gradient, so the advantage narrows as κ\kappa grows. Crucially, x|x\rangle is a quantum state: reading out every component costs O(N)O(N) measurements and erases any speedup, so — matching this record's caveat — HHL is only useful when a single scalar observable of xx, not the full vector, is the actual goal.

Implementation
Native
hhl_reference.py
from qiskit import QuantumCircuit

qc = QuantumCircuit(3)
# Prepare |b⟩ and encode a small Hermitian A.
qc.h(0)
# QPE(A), controlled reciprocal rotation, and uncompute
qc.barrier()

FINAL_CIRCUIT = qc

This is a requirements-oriented skeleton; it does not claim a full HHL implementation or application speedup.

Quantum vs classical
MetricClassicalQuantum
Dependence on Npoly(N)O(log N)
Condition-number costO(s κ)O(s κ² log(1/ε))
Outputfull solution x|x⟩ (observable only)
Impactbaselineexp. in N (with caveats)

Classical baseline

Conjugate gradient, sparse direct solvers, preconditioned iterative methods, or classical PDE solvers.

Quantum claim

Potentially favorable scaling for estimating selected observables of a sparse, well-conditioned system under a quantum input/output model.

How to compare

Account for condition number, sparsity, state preparation, block encoding, precision, and the cost of extracting the desired observable.

Declared gaps

Nobody has reviewed this record for gaps yet.

Literature & references
Quantum algorithm for solving linear systems of equations2008 · Aram W. Harrow, Avinatan Hassidim, Seth Lloyd

Original HHL linear-systems algorithm and its sparse-access/output-observable assumptions.

arxiv.org/abs/0811.3171