Warp-Speed Algebra: New Algorithm Does Algebra in a Snap

New quantum algorithm can solve monster-size equations

Join Our Community of Science Lovers!

Quantum computers can do wondrous things: too bad they do not exist yet. That has not stopped physicists from devising new algorithms for the devices, which can calculate a lot faster than ordinary computers—in fact, exponentially faster, in quite a literal sense. Once quantum computers do become available, the algorithms could become a key part of applications that require number crunching, from engineering to video games.

The latest quantum algorithm is generating excitement among physicists. It tackles linear equations: expressions such as 3x + 2y = 7 and typically written with unknowns on one side and constants on the other. Many high schoolers learn the trite mechanics of solving systems of such equations by eliminating one unknown at a time. Speed becomes crucial when systems contain billions of variables and billions of equations, which are not unusual in modern applications such as simulations of weather and other physical phenomena. Efficient algorithms can solve large, “N by N” systems (systems having N linear equations and N unknowns) by computer. Still, calculation time grows at least as fast as N does: if N gets 1,000 times larger, the problem will take at least 1,000 times longer to solve, often more.

The quantum algorithm now proposed by Aram W. Harrow of the University of Bristol in England and Avinatan Hassidim and Seth Lloyd of the Massachusetts Institute of Technology takes a clever shortcut. It can return the most relevant information about the solution without fully calculating the solution itself, thus trading off the amount of data it produces for speed. (For example, in the case of weather prediction it could return the average temperature over a town rather than the temperatures predicted city block by city block.)


On supporting science journalism

If you're enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.


Like all quantum algorithms, their method, described in the October 9 Physical Review Letters, encodes all the relevant information about the system into quantum bits. Contrary to ordinary, or “classical,” bits, quantum bits can exist both as 0 and 1 simultaneously—or, as physicists say, in a superposition of states. The algorithm transforms the bits into a state that essentially encodes a superposition of all possible solutions of the system, meaning for all possible values of the constants on the right hand sides of the equations. From this “universal solution,” one can then extract the relevant information about particular solutions without calculating them fully.

The gain in speed is enormous: the time required to produce the universal solution grows only with the number of digits in N. Thus, if N gets 1,000 times larger, the algorithm takes three times as long (because three digits are added to N), as opposed to 1,000 times as long. Even writing down the result for all the variables would involve 1,000 times more steps in the classical case. “It takes exponentially less time to solve the problem than to read the solution,” Lloyd says only half-jokingly.

“Every single quantum algorithm that shows a clear speedup when compared with its classical analogue is still a big deal,” says Artur Ekert of the National Uni­versity of Singapore. Only a handful of quantum algorithms can boast that achieve­ment—such as those invented in the 1990s for factoring large numbers into primes or for searching databases.

So far only experimental quantum computers exist, containing only a few bits. But a small demonstration of the new algorithm should be feasible in the not too distant future, says Martin Plenio of the University of Ulm in Germany. “It will be many years, though, before a quantum computer of a sufficient size can be built to solve a problem that cannot be attacked on classical devices,” he adds.

Some applications could be possible sooner, Lloyd says, if they exploit the intrinsically quantum nature of photons. He proposes, for example, that the algorithm could be embodied in a “superimaging device” that would remove optical distortions in a telescope. Each photon measured by the telescope would play the role of the constant terms of the equation, and the distortions would correspond to a linear system of equations. Finding the solutions would mean reversing the distortions, thus improving image quality.

It’s Time to Stand Up for Science

If you enjoyed this article, I’d like to ask for your support. Scientific American has served as an advocate for science and industry for 180 years, and right now may be the most critical moment in that two-century history.

I’ve been a Scientific American subscriber since I was 12 years old, and it helped shape the way I look at the world. SciAm always educates and delights me, and inspires a sense of awe for our vast, beautiful universe. I hope it does that for you, too.

If you subscribe to Scientific American, you help ensure that our coverage is centered on meaningful research and discovery; that we have the resources to report on the decisions that threaten labs across the U.S.; and that we support both budding and working scientists at a time when the value of science itself too often goes unrecognized.

In return, you get essential news, captivating podcasts, brilliant infographics, can't-miss newsletters, must-watch videos, challenging games, and the science world's best writing and reporting. You can even gift someone a subscription.

There has never been a more important time for us to stand up and show why science matters. I hope you’ll support us in that mission.

Thank you,

David M. Ewalt, Editor in Chief, Scientific American

Subscribe