# The algorithm of the new quantum factoring record 1,099,551,473,989

According to the New Scientist News, the Zapata team is able to factor 1,099,551,473,989 into its factors 1,048,589 and 1,048,601.

According to the New Scientist:

A quantum computing start-up company called Zapata has worked with IBM to develop a new way to factor large numbers, using it on the largest number that has been factored with a quantum computer so far...

The future success of the algorithm used could have big implications

• What is this new algorithm?
• How many q-bits are required to factor 1,099,551,473,989?

The claimed new quantum factoring record is $$n=a(a+b)$$ with $$a=1048589=2^{20}+13$$ and $$b=12$$. It could well be that the form $$n=a(a+b)$$ with $$0\le b\le12$$ (or other small upper bound for $$b$$) defines all the sizable numbers the new record-claiming method can factor (with the indicated $$3$$ qubits on the hardware at hand and the ∼30% success rate, based on the picture in that answer). Such $$n$$ are scarce: their proportion near $$n$$ thins out as $$6.5/\sqrt n+\mathcal o(1/\sqrt n)$$ [*]. The method lacks generality.

Further, the factor $$a$$ of such $$n$$ is effortlessly found using Fermat's factorization method (exposed in a fragment of letter likely to Mersenne circa 1643). If $$n=a(a+b)$$ with $$0\le b\le2\sqrt a$$ (a much larger class of integers), only the first step of Fermat's factoring is required (for all except very small $$n$$): compute $$r=\bigl\lceil\sqrt{4n}\,\bigr\rceil$$, then $$a=(r-\sqrt{r^2-4n})/2$$. That's enough to factor 1099551473989 by hand.

The picture and that other answer refer to Eric R. Anschuetz, Jonathan P. Olson, Alán Aspuru-Guzik, Yudong Cao's Variational Quantum Factoring (arXiv:808.08927, Aug 2018). That reduces factorization to a combinatorial problem with number of unknowns proportional to the bit length of the factors. I find nothing suggesting the preprocessing makes that sublinear in the general case, and conclude that Variational Quantum Factoring is exponential in the bit length of $$n$$, thus essentially pointless since we have sub-exponential algorithms for factorization on classical computers.

Similar stunts of stretching to artificially large numbers what an experimental setup allows have already been pulled. Take the record of 143=11×13 by Nanyang Xu, Jing Zhu, Dawei Lu, Xianyi Zhou, Xinhua Peng, and Jiangfeng Du in Quantum Factorization of 143 on a Dipolar-Coupling Nuclear Magnetic Resonance System (Physical Review Letters, 2012). Their experimental technique factors an integer product of two odd exactly-4-bit integers (thus with two unknown bits per factor). The scarcity of primes in range [8,15] makes 143 the only product of two distinct primes that the technique can factor. Their experimental setup iteratively minimizes a function with a 2-bit input. This achievement (I'm not joking up to this point) has been stretched, without new experiment AFAIK, to:

• 56153=233×241 by Nikesh S. Dattani and Nathaniel Bryans, Quantum factorization of 56153 with only 4 qubits (arXiv:1411.6758, 2014)
• 4088459=2017×2027, by Avinash Dash, Deepankar Sarmah, Bikash K. Behera, and Prasanta K. Panigrahi, Exact search algorithm to factorize large biprimes and a triprime on IBM quantum computer (arXiv:1805.10478, May 2018)
• 383123885216472214589586724601136274484797633168671371=618970019642690137449562081×618970019642690137449562091 by myself (crypto.SE, June 2018), using the technique of the above paper.

[*] Proof: for each $$a$$, there are $$13$$ values of $$b$$ leading to $$13$$ values of $$n$$ of the form $$n=a(a+b)$$ with $$0\le b\le12$$. For large enough $$a$$ there are no two $$(a,b)$$ leading to the same $$n$$[#]. When we increase $$n$$ by $$1$$, $$n^2$$ increases by $$2n+1$$. Taking the inverse, the density of squares near large $$n$$ is $$\displaystyle\frac1{2\sqrt n}+\mathcal o(\sqrt n)$$. Thus the density of $$n$$ of the form $$a(a+b)$$ with $$0\le b\le12$$ is $$\displaystyle\frac{13}{2\sqrt n}+\mathcal o(1/\sqrt n)$$.

[#] Auxiliary proof: Assume $$a(a+b)=a'(a'+b')$$ with $$0\le b\le12$$ and $$0\le b'\le12$$. Let $$c=2a-b$$ and $$c'=2a'-b'$$. It comes $$(c-b)(c+b)/4=(c'-b')(c'+b')/4$$, thus $$c^2-b^2=c'^2-b'^2$$, thus $$c^2-c'^2=b^2-b'^2$$, thus $$|(c-c')(c+c')|\le144$$, thus for $$c\ge72$$ and $$c'\ge72$$ the only solution is $$c=c'$$, hence $$b=b'$$. Thus for $$a\ge42$$ and $$a'\ge42$$ the only solution is $$a=a'$$ and $$b=b'$$. The bound on $$a$$ can be further lowered.

• Could you add a reference for the scarcity of $n=(a-b)(a+b)$ with $|b|\leq 6$ Dec 15 '19 at 15:40
• @kelelaka: I found no reference. Therefore I attempted a derivation, found a mistake in my statement, fixed that, and while at it allowed for about twice as many $n$. Dec 15 '19 at 17:49
• @kelalaka: the scarcity of $n = (a-b)(a+b)$, $|b| \le 6$ is easy to derive; $n$ is of this form iff one of $n, n+1, n+4, n+9, n+16, n+25, n+36$ is a perfect square;the probability of a random value circa $n$ being a perfect square is circa $1/(2\sqrt{n})$, and hence the probability that one of the above will be a square (assuming $n$ large) is $7/(2\sqrt{n})$ Dec 17 '19 at 21:44
• @poncho: yes. But I moved to the form $a(a+b)$ with $0\le b\le12$ and that simple and nice reasoning became the current mess at the bottom of the question :-( Dec 17 '19 at 21:46
• I would like to point out that the value of $a$ is 100000000000000001101 in binary, and b=100000000000000011001. Therefore the number of qubits needed to factor this using the method used for the previous record of 291311, might turn out to be 2, not 3. However such pre-processing has not been done successfully yet for this combination of a(a+b), as far as I know. May 10 '20 at 18:22

How many q-bits are required to factor 1,099,551,473,989?

They preprocessed down to three qubits.

• Q2B videos will be online in about a month Dec 15 '19 at 0:57
• The other 3 authors do not have accounts here, but apparently Eric Anschuetz does. But I don't know if can be tagged for attention. Dec 15 '19 at 2:09

What is this new algorithm?

It's the Variational Quantum Factoring algorithm that the team put up on arXiv last year.

How many q-bits are required to factor 1,099,551,473,989?

Doesn't seem like they've published that yet, but you should be able to estimate the upper bound from FIG. 1 of the paper; the scaling is $$\mathcal{O}(n_m)$$ when classical preprocessing is used.

• It is interesting that the q-bit requirement doesn't show a linear property according to table 1 of the paper. Dec 14 '19 at 18:58
• We don't have another big number on the article like in the news, however, this one can be factored easily by Fermat factoring since the factors are close to each other. Dec 14 '19 at 19:28
• In fact the square root of $1099551473989$ is $1048594.9999828\ldots$, and you quickly see that $1099551473989 = 1048595^2 - 6^2$. Dec 15 '19 at 3:11