Breaking RSA Using Shor's Algorithm
Our construction
Abstract circuit model cost estimate
We have now described all the details necessary to estimate the cost of our implementation in the
abstract circuit model. The cost depends on the two parameters specified by the problem (the
input size and the number of exponent qubits
) and also the four controllable parameters
we have discussed (the exponentiation window size
, the multiplication window size
, the
runway separation
, and the padding/runway length
).
Although we do consider alternate values when producing tables and figures, in general we have
found that the settings work
well. In this overview we will focus on these simple, though slightly suboptimal, values.
Recall that an exponentiation may be reduced to a sequence of multiplications, which we
process in groups of size
. For each multiplication, we do two multiply-adds. Each multiply add will use several small additions to temporarily reduce the runway registers to single qubits.
The multiply-add then needs to perform a sequence of additions controlled by the n main register
qubits, the
coset padding qubits, and the
reduced runway qubits. Using windowed
arithmetic, these additions are done in groups of size
with each group handled by one lookup
addition. Therefore the total number of lookup additions we need to perform is
The lookup additions make up essentially the entire cost of the algorithm, i.e. the total Toffoli
count is approximately equal to the Toffoli count of a lookup addition times the lookup addition
count. This works similarly for the measurement depth. Ignoring the negligible cost of uncomputing the lookup, the Toffoli count of a lookup addition is and the
measurement depth is
. Therefore
These approximate upper bounds, with set to
, are the formulae we report in the abstract
and in Table 1 for the cost of factoring RSA integers.