Skip to content
DAH
Wiki/Quantum AlgorithmsAlgorithmActive

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
Why other work relies on it

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.

  1. 1Load b as a quantum state
  2. 2Phase estimation finds eigenvalues
  3. 3Rotate by one over each eigenvalue
  4. 4Get state proportional to solution
  5. 5Read only summary numbers

The task. Given a matrix AA (size N×NN\times N) and a vector bb, find xx with Ax=bAx=b. Gaussian elimination, from first-year linear algebra, costs about N3N^3 operations; iterative methods for sparse AA cost about NN times a factor depending on the condition number κ\kappa, the ratio of the largest to the smallest eigenvalue magnitude, which measures how sensitive the solution is to small changes.

HHL's idea. Prepare bb as a quantum state ∣b⟩|b\rangle whose amplitudes are the entries of bb (normalised). Use phase estimation to write the eigenvalues λj\lambda_j of AA into a register. Then rotate a helper qubit by an amount proportional to 1/λj1/\lambda_j, which multiplies each eigencomponent by 1/λj1/\lambda_j, exactly what A−1A^{-1} does. After undoing the phase estimation, the state is proportional to A−1bA^{-1}b. The cost grows like log⁡N\log N and polynomially in κ\kappa and the sparsity; later algorithms reach the optimal κlog⁡(1/ε)\kappa\log(1/\varepsilon).

The fine print.

  • Loading bb: for arbitrary data this costs about NN steps unless special memory hardware exists.
  • Output: you get ∣x⟩|x\rangle, a quantum state. You can estimate quantities like xTMxx^TMx, but writing out all NN entries costs about NN measurements.
  • κ\kappa must be small; for discretised differential equations it often grows with NN.

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 NN points per side, κ\kappa grows roughly like N2N^2, so the polynomial dependence on κ\kappa can cancel much of the log⁡N\log N advantage unless the system is preconditioned.

Go deeper

The full technical text.

The problem and the algorithm

Given an N×NN\times N Hermitian matrix AA that is ss-sparse with efficiently computable entries, with condition number κ\kappa, and a circuit that prepares ∣b⟩|b\rangle, the task is to prepare a state ε\varepsilon-close to ∣x⟩∝A−1∣b⟩|x\rangle\propto A^{-1}|b\rangle. Harrow, Hassidim and Lloyd (HHL, 2009) did this in time O~(log⁡(N) s2κ2/ε)\tilde O(\log(N)\,s^2\kappa^2/\varepsilon): phase estimation on eiAte^{iAt} writes eigenvalues λj\lambda_j into a register, a controlled rotation multiplies each component by 1/λj1/\lambda_j, and amplitude amplification boosts the success probability.

Later algorithms improved every parameter. Ambainis (2012) brought the κ\kappa dependence close to linear with variable-time amplitude amplification; Childs, Kothari and Somma (2017) made the precision dependence polylogarithmic in 1/ε1/\varepsilon; adiabatic-inspired methods (Subaşı, Somma and Orsucci, 2019) led to the algorithm of Costa et al. (2022) with complexity O(κlog⁡(1/ε))O(\kappa\log(1/\varepsilon)), optimal in both parameters. In the quantum singular value transformation framework, solving Ax=bAx=b is applying a polynomial approximation of 1/x1/x to a block-encoding of AA.

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 bb must be loadable as a quantum state quickly; for generic data this needs a quantum random-access memory or costs Ω(N)\Omega(N). (2) AA must be sparse (or block-encodable) and well conditioned; κ\kappa often grows with NN for discretised differential equations. (3) The output is a quantum state, not the vector: reading out all NN amplitudes costs Ω(N)\Omega(N), so the method only helps when a few quantities such as ⟨x∣M∣x⟩\langle x|M|x\rangle 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 κ\kappa and ε\varepsilon 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)
Words on this page
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)
New to this? Read first

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.

  1. Start with
  2. Step 2
  3. Step 3
  4. Step 4
  5. Then

Open problems & questions

No open problems or questions on this entry.

Progress timeline

  1. Nov 16, 2021
    Optimal scaling

    Costa et al. gave an O(κlog⁡(1/ε))O(\kappa\log(1/\varepsilon)) solver via a discrete adiabatic theorem.

    source
  2. Nov 7, 2015
    Polylogarithmic precision dependence

    Childs, Kothari and Somma improved the dependence on 1/ε1/\varepsilon exponentially.

    source
  3. Apr 1, 2015
    Read the fine print

    Aaronson set out the conditions under which HHL-type speedups are meaningful (Nature Physics, April 2015; month only).

    source
  4. Oct 21, 2010
    Near-linear condition-number dependence

    Ambainis introduced variable-time amplitude amplification.

    source
  5. Nov 19, 2008
    HHL algorithm

    Harrow, Hassidim and Lloyd posted the quantum linear-systems algorithm; it appeared in PRL in October 2009.

    source