HHL and quantum linear-system solvers
Quantum algorithms that prepare a state proportional to the solution of Ax = b in time polylogarithmic in the dimension, under strong assumptions on input access, sparsity, condition number and what is read out.
On this page14 sections
Claims of exponential quantum speedups for machine learning, differential equations and data analysis mostly reduce to a linear-system or matrix-function subroutine, so its caveats decide whether those claims hold.
Quantum methods for solving huge systems of linear equations, fast only under strict conditions on the input and output.
- 1Load b as a quantum state
- 2Phase estimation finds eigenvalues
- 3Rotate by one over each eigenvalue
- 4Get state proportional to solution
- 5Read only summary numbers
The task. Given a matrix (size ) and a vector , find with . Gaussian elimination, from first-year linear algebra, costs about operations; iterative methods for sparse cost about times a factor depending on the condition number , the ratio of the largest to the smallest eigenvalue magnitude, which measures how sensitive the solution is to small changes.
HHL's idea. Prepare as a quantum state whose amplitudes are the entries of (normalised). Use phase estimation to write the eigenvalues of into a register. Then rotate a helper qubit by an amount proportional to , which multiplies each eigencomponent by , exactly what does. After undoing the phase estimation, the state is proportional to . The cost grows like and polynomially in and the sparsity; later algorithms reach the optimal .
The fine print.
- Loading : for arbitrary data this costs about steps unless special memory hardware exists.
- Output: you get , a quantum state. You can estimate quantities like , but writing out all entries costs about measurements.
- must be small; for discretised differential equations it often grows with .
Why it is still important. HHL proved that this matrix-inversion problem is BQP-complete, as hard as any quantum computation, so a fast classical algorithm in the same setting would be a shock. The open question is applications, not the algorithm.
Worked caveat. For a finite-difference model of heat flow on a grid with points per side, grows roughly like , so the polynomial dependence on can cancel much of the advantage unless the system is preconditioned.
Go deeper
The full technical text.
The problem and the algorithm
Given an Hermitian matrix that is -sparse with efficiently computable entries, with condition number , and a circuit that prepares , the task is to prepare a state -close to . Harrow, Hassidim and Lloyd (HHL, 2009) did this in time : phase estimation on writes eigenvalues into a register, a controlled rotation multiplies each component by , and amplitude amplification boosts the success probability.
Later algorithms improved every parameter. Ambainis (2012) brought the dependence close to linear with variable-time amplitude amplification; Childs, Kothari and Somma (2017) made the precision dependence polylogarithmic in ; adiabatic-inspired methods (Subaşı, Somma and Orsucci, 2019) led to the algorithm of Costa et al. (2022) with complexity , optimal in both parameters. In the quantum singular value transformation framework, solving is applying a polynomial approximation of to a block-encoding of .
Why the speedup is believed to be real
HHL showed that this matrix-inversion problem is BQP-complete: a classical algorithm with similar scaling would simulate any quantum computation efficiently. So for sparse, well-conditioned matrices given by formulas, an exponential separation is expected under the usual belief that BQP is larger than BPP.
The fine print
Aaronson (2015) listed the conditions an application must meet. (1) The vector must be loadable as a quantum state quickly; for generic data this needs a quantum random-access memory or costs . (2) must be sparse (or block-encodable) and well conditioned; often grows with for discretised differential equations. (3) The output is a quantum state, not the vector: reading out all amplitudes costs , so the method only helps when a few quantities such as are needed. (4) When the data are low-rank and stored in a sampling data structure, classical "dequantized" algorithms match the quantum ones up to polynomial factors (Tang, 2019; Chia et al., 2020).
Status
The algorithmic question is largely settled: the optimal dependence on and is known. What is not settled is whether any practically motivated instance meets all four conditions at a size where it beats the best classical solver once error-correction overhead is counted. Proposals cover linear differential equations, some nonlinear equations through linearisation, and least-squares fitting.
Words on this page (7)
- linear system
- A set of equations Ax = b where each equation is a weighted sum of the unknowns.
- sparse matrix
- A matrix in which most entries are zero.
- condition number
- How much the solution of Ax = b can change when b changes slightly; large means ill-behaved.
- quantum state
- The complete description of qubits; here its amplitudes encode a vector.
- BQP-complete
- As hard as any problem a quantum computer solves efficiently.
- dequantization
- Classical algorithms that match a quantum speedup under comparable data access.
- HHL algorithm
- The 2008 quantum linear-systems algorithm of Harrow, Hassidim and Lloyd.
New to this? Read first (2)
- HHL algorithm (Wikipedia)The algorithm and its assumptions in one place.
- Aaronson, Read the fine print (Nature Physics 2015)A short, readable list of the caveats.
Understanding map
map of the whole wiki →What to read before HHL and quantum linear-system solvers (left), and what builds on it: entries that depend on it and its open problems (right). Every box links to its page.
- Start with
- Quantum algorithmsAlgorithm
- Step 2
- Step 3
- Quantum phase estimationAlgorithm
- Step 4
- HHL and quantum linear-system solversYou are here
- Then
Open problems & questions
No open problems or questions on this entry.
Progress timeline
- Nov 16, 2021Optimal scalingsource
Costa et al. gave an solver via a discrete adiabatic theorem.
- Nov 7, 2015Polylogarithmic precision dependencesource
Childs, Kothari and Somma improved the dependence on exponentially.
- Apr 1, 2015Read the fine printsource
Aaronson set out the conditions under which HHL-type speedups are meaningful (Nature Physics, April 2015; month only).
- Oct 21, 2010Near-linear condition-number dependencesource
Ambainis introduced variable-time amplitude amplification.
- Nov 19, 2008HHL algorithmsource
Harrow, Hassidim and Lloyd posted the quantum linear-systems algorithm; it appeared in PRL in October 2009.