r/askscience • u/[deleted] • 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
126
u/GroundStateGecko Mar 28 '21 edited Mar 28 '21
Shor's algorithm is quite more "indirect". I'll try to give an explanation here, but the level of explain-like-I'm-five-ness will be significantly higher. So this comment will only give you a feeling and please know that this is not by any means rigorous.
In the following formulas, you can assume all numbers are integers.
Shor's algorithm is to find factors for a number. If we want to find the factor for the number B, we happen to prove that there must exist a relationship:
Ap = m * B + 1
where we just randomly pick some number A (without some trivial scenario), and we can eventually find a power P, that the remainder after divided by B is 1.
We now just assume we have found the power P for an A we picked. We can write:
(Ap/2 + 1)(Ap/2 - 1) = m * B
(It's the same thing, just wrote differently. You can multiply this back to the formula above.)
For example, if we want to find the factor of 85, we randomly pick a number 11, and try multiple power P, until we find one that satisfies Ap = m * B + 1:
112 = 1 * 85 + 36
113 = 15 * 85 + 56
114 = 172 * 85 + 21
115 = 1894 * 85 + 61
116 = 20841 * 85 + 76
117 = 229260 * 85 + 71
118 = 2521869 * 85 + 16
119 = 27740561 * 85 + 6
1110 = 305146171 * 85 + 66
1111 = 3356607889 * 85 + 46
1112 = 36922686784 * 85 + 81
1113 = 406149554634 * 85 + 41
1114 = 4467645100979 * 85 + 26
1115 = 49144096110772 * 85 + 31
1116 = 540585057218496 * 85 + 1
Got it!
Now, we wrote:
(118+1)(118-1) = 540585057218496 * 85
which is
214358882*214358880 = 540585057218496 * 85
Now, remember, we want to find C * D, so that C * D = 85.
So we wrote
214358882*214358880 = 540585057218496 * (C * D)
Now, as the left and the right are the same, they MUST share the same factors.
So if neither 214358882 itself nor 214358880 itself is a multiple of 85, it must satisfy:
214358882 = C * something
214358880 = D * something
(or vise versa)
we now know:
85 = C * something
214358882 = C * something
So 85 and 214358882 share factor.
Also 85 and 214358880 share factor.
There is a fast algorithm that is specifically used for finding common factors, called Euclidean algorithm. Which you can even do it by hand for 85 and 214358882 / 214358880.
214358882 = 2521869 * 85 + 17
And 17 is a prime number, so 85 has a factor 17.
214358880 = 2521869 * 85 + 15
85 = 5 * 15 + 10
15 = 1 * 10 + 5
And 5 is a prime number, so 85 has a factor 5.
So we got it! 85 = 5*17
Now, why do we go through this hell?
(Continue on the second part, as Reddit have a 10000 character limit)