Quantum mechanical computers have the potential to quickly perform calculations that are infeasible with present technology. There are quantum algorithms to simulate efficiently the dynamics of quantum systems1 and to decompose integers into their prime factors2, problems thought to be intractable for classical computers. But quantum computation is not a magic bullet — some problems cannot be solved dramatically faster by quantum computers than by classical ones. Is a quantum computer necessarily a special-purpose device then, suitable only for number-theoretic calculations or problems that are inherently quantum? There might be hope for more generality. Writing in Physical Review Letters3, Aram Harrow, Avinatan Hassidim and Seth Lloyd describe how quantum computers can extract information about the solutions to linear equations, a fundamental task with broad applications.

The basic problem of finding a vector x satisfying A x = b for some given matrix A and vector b arises throughout science and engineering. For example, signal processing, convex optimization and finite-element analysis all rely on solving linear equations. Owing to the importance of linear systems, considerable effort has been spent on finding fast algorithms for solving them. One simple approach is known as Gaussian elimination, a method that was already used in ancient China, and that today is standard fare in courses on linear algebra. Alternative methods offer improved speed and better numerical stability, and some can take advantage of special properties such as sparsity of A. However, if A is an N × N matrix (or a rectangular matrix for which the larger dimension is N), all of these methods use a number of operations at least proportional to N.

The authors3 suggest approaching this problem using quantum simulation. Given an N × N sparse Hermitian matrix A, a quantum state |b〉 and a time t, quantum simulation provides a method for preparing the quantum state eiAt|b〉 using a number of operations that is only polynomial in log(N) (ref. 4). In the approach of Harrow et al., the vector b is first encoded into a quantum state |b〉. Then, by a well-known technique called phase estimation5, the ability to produce eiAt|b〉 is leveraged to create a quantum state |x〉 proportional to A−1|b〉. (A similar approach can be applied when the matrix A is non-Hermitian, or even when A is non-square.) The result is a solution to the system of linear equations encoded as the quantum state |x〉.

Producing a quantum state proportional to A−1|b〉 does not, by itself, solve the task at hand. To extract information from a quantum state, we must perform a measurement. Learning all N amplitudes of an N-dimensional quantum state requires a number of measurements at least proportional to N. Thus, if our goal is to completely reconstruct a solution x, there is no hope for a quantum algorithm to offer a significant advantage over classical methods. However, for some problems we might not be interested in the entire vector x, but rather in some special feature of it, such as an expectation value. Then a quantum computer may be able to solve the problem rapidly.

In addition to readout, the approach suffers from other significant limitations. The vector b must be given in a way that allows quick preparation of the quantum state |b〉. Methods are available for doing this if b has a suitable implicit description, but the approach is useless if b is given by explicit classical data. Furthermore, as in classical methods for solving linear equations, the performance depends crucially on the condition number κ, a measure of how close A is to being singular. The running time of the quantum algorithm is polynomial in log(N) and in κ, so the quantum advantage is only significant when κ is not too large.

Having lowered the bar for the sense in which we hope to solve a system of linear equations, one might wonder whether this quantum algorithm3 offers a real advantage over classical computing at all. To address this concern, in perhaps the most interesting aspect of their work, Harrow, Hassidim and Lloyd prove that the problem they solve is as hard as anything a quantum computer can do. In particular, they show that any quantum computation can be encoded into an instance of solving linear equations, even with the restrictions required for their quantum solver to be efficient. Therefore, either ordinary classical computers can efficiently simulate quantum ones — a highly unlikely proposition — or the quantum algorithm for solving linear equations performs a task that is beyond the reach of classical computation.

Proving 'hardness' results of this kind is a widely used strategy for establishing the non-triviality of quantum algorithms. Similar constructions are known for problems such as finding ground states by adiabatic evolution6, computing invariants of knots7, estimating entries of powers of matrices8 and contracting tensor networks9, among other tasks. But what sets linear equations apart is their ubiquity in scientific computing and engineering applications.

Will the quantum solution of linear equations3 turn out to be a widely used tool, or are its limitations too great for the technique to be of practical significance? Unfortunately, no concrete task has yet been proposed for which the quantum algorithm provides a clear advantage. But it will be exciting to explore the impact of this and related applications of quantum computing, in particular as the methods can be put into practice.