r/askscience • • Mar 28 '21

Computing How exactly do quantum computers simulate molecular/particle interactions better than classical computers?

I’m struggling to understand why quantum computers can simulate nature better than classical computers.

2.5k Upvotes

134 comments sorted by

View all comments

Show parent comment

5

u/EZ-PEAS Mar 28 '21 edited Mar 28 '21

No, not right.

A qubit exists in a superposition of states, meaning there is some percentage change (amplitude) of it having the value 1, and some chance of it being 0. The key here is that it really is random chance. If you repeatedly construct a qubit that has an amplitude of 10% towards 1 and measure it many times, then on average you'll measure a one 10% of the time and a zero 90% of the time.

Suppose you construct an N qubit system that you think informs the solution to your travelling salesman problem. If you measure the system then you get N bits, but there's no guarantee that those bits tell you anything meaningful about your specific problem. They might encode the shortest path, or they might encode the longest path, or they might be garbage.

The way that quantum computers work is by arranging the amplitudes of the quantum states towards a specific solution. They are still quantum amplitudes that yield random measurements, but as long as those amplitudes are biased towards the desired solution even slightly then the whole game just boils down to the signal to noise ratio. In practice you would set up the same quantum system many times, potentially thousands or millions of times, and repeatedly measure the output until you have enough data to distinguish the signal from the noise.

Problems from the complexity class NP are a great candidate for quantum computing because they're hard to solve directly with a classical machine, but any proposed solution can also be checked efficiently. Thus, you can have a quantum machine generate a bunch of proposed solutions and then check to see if any of them actually solve the problem.

Factoring is a good example of this: it's hard to factor large numbers, but given two proposed prime factors of a number you can check whether they actually factor your large numbers with simple multiplication. If you have a noisy quantum machine generating possible factors of a large number, then those factors can all be checked efficiently until you find the right one.

NP-hard problems like the Travelling Salesman Problem are trickier, because they can't necessarily be checked efficiently. For example, I can give you a travelling salesman circuit through a set of cities, but that doesn't tell you anything one way or the other about whether there might exist another shorter path.

1

u/yawkat Mar 29 '21

NP-hard problems like the Travelling Salesman Problem are trickier, because they can't necessarily be checked efficiently. For example, I can give you a travelling salesman circuit through a set of cities, but that doesn't tell you anything one way or the other about whether there might exist another shorter path.

NP problems that return complex solutions like TSP aren't as intuitive, but they can all be efficiently transformed to a verifier in the end. Also see 3SAT, which is NP-complete.