logoalt Hacker News

Strilanc • yesterday at 11:57 PM • 1 reply • view on HN

That paper is not a valid quantum factoring.

In section 4.1 you can see the circuit that they ran only had 8 phase estimation qubits. But Shor's algorithm needs 2n phase estimation qubits to factor an n bit number, so they need 16 not 8. With only 8 they can't determine the phase accurately enough to reconstruct the denominator that reveals the period. Even if the QC was perfect they'd just be measuring random values and getting false positives.

Note they took 1000 shots. If you sample a random number and feed it into the post-processing for Shor's algorithm it would succeed after less than 10 shots on average. So success is really the wrong metric here. At best you can look at the distribution of outputs and compare it to the expected distribution to determine whether the quantum computer is working or not. They don't do this.

They do say they observed 249 different values (out of a possible 256, after taking 1000 shots). That tells us something about the distribution: it must be quite flat. 249 is roughly how many numbers you see when sampling a flat 256 item disribution with replacement 1000 times. So this 249 is consistent with them sampling from a uniformly random distribution, rather than the peaked one that Shor's algorithm is supposed to produce when performed correctly. I'd say this indicates the quantum computer is noisy, except that they didn't use enough qubits of phase estimation meaning the expected distribution is ~flat so it's impossible to distinguish if it's ~uniformly random due to the noisy machine or due to their misconfiguration of the algorithm.

Lastly, there's a very strange error in section 4.1 where they say the period of multiplying by 3 mod 221 is r=20, when actually it's r=48. Feeding r=20 into the period-to-factor postprocessing math.gcd(pow(3, r//2, 221) + 1, 221) yields 1 which isn't a non-trivial factor of 221.

I am not away of ANY quantum factoring paper that factors a number larger than 15 that doesn't have either serious issues like the ones above or else that performs invalid precompilations that require preknowledge of the period.


Replies

tagrun • today at 1:31 AM

I don't have access to that paper through my institution, and it's not on arxiv so I only read the abstract (which states "by implementing Shor’s algorithm using IBM’s quantum resource and Qiskit framework to factor the number 221").

Based on what you said, it sounds to me like the paper has some typos, and they didn't use a text-book QPE (no it doesn't "need" 2n qubits; it can be done iteratively with far fewer qubits if mid-circuit measurements are available; some IBM devices do offer mid-circuit measurements).

I also don't know which IBM device they used, but since you have access to the paper, you can easily check the error rates https://quantum.cloud.ibm.com/computers Their two qubits errors aren't that good in general, so it is no surprise to me that it is "noisy". But I find it hard to believe your claim that they published a paper with a flat distribution. Observing 249 (out of 256) distinct values over 1000 shots doesn't equate to a flat distribution (for example, getting 248 numbers that are not 221 and 752 numbers that are 221 is not a "flat" distribution).

That paper aside, there is nothing stopping anyone going (slightly) beyond 15, you can literally do it yourself on their devices: factoring 21 (like it was done in https://www.nature.com/articles/s41598-021-95973-w) is left as a mundane exercise in their tutorial: https://qiskit.qotlabs.org/docs/tutorials/shors-algorithm#ch... Since you claim you have never seen N>15 factored before using Shor's algorithm and have such a strong disbelief, I strongly recommend you to create an account with them run it yourself.