Breaking RSA Using Shor's Algorithm
Our construction
The coset representation of modular integers
Following Zalka, the first improvement we make over the reference implementation is to switch
from the usual representation of integers to the coset representation of modular integers. The usual
representation of an integer k in a quantum computer is the computational basis state .
The coset representation is different: It uses a periodic superposition with period and offset
.
In ideal conditions, the integer
is represented by the state
where
is the number of additional padding qubits placed at the end of the register after the high
order bits. The key idea is that the periodicity of the superposition causes a non-modular adder to
perform approximate modular addition on this representation, and the error of the approximation
can be exponentially suppressed by adding more padding to the register.
As we will discuss later, the amount of padding required is logarithmic in the number of
operations. This small cost enables the large benefit of using non-modular adders instead of
modular adders. It is possible to perform a controlled non-modular addition in Toffolis,
significantly cheaper than the
we assumed for a controlled modular adder. Therefore switching
to the coset representation reduces the leading asymptotic term of the Toffoli count of the reference
implementation from
to
.