<s>
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
is	O
a	O
quantum	B-Device
computer	I-Device
algorithm	I-Device
for	O
finding	O
the	O
prime	O
factors	O
of	O
an	O
integer	O
.	O
</s>
<s>
On	O
a	O
quantum	O
computer	O
,	O
to	O
factor	O
an	O
integer	O
,	O
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
runs	O
in	O
polylogarithmic	O
time	O
,	O
meaning	O
the	O
time	O
taken	O
is	O
polynomial	O
in	O
,	O
the	O
size	O
of	O
the	O
integer	O
given	O
as	O
input	O
.	O
</s>
<s>
This	O
is	O
almost	O
exponentially	O
faster	O
than	O
the	O
most	O
efficient	O
known	O
classical	O
factoring	O
algorithm	O
,	O
the	O
general	B-Algorithm
number	I-Algorithm
field	I-Algorithm
sieve	I-Algorithm
,	O
which	O
works	O
in	O
sub-exponential	O
time	O
:	O
.	O
</s>
<s>
The	O
efficiency	O
of	O
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
is	O
due	O
to	O
the	O
efficiency	O
of	O
the	O
quantum	B-Algorithm
Fourier	I-Algorithm
transform	I-Algorithm
,	O
and	O
modular	O
exponentiation	O
by	O
repeated	B-Algorithm
squarings	I-Algorithm
.	O
</s>
<s>
RSA	B-Architecture
is	O
based	O
on	O
the	O
assumption	O
that	O
factoring	O
large	O
integers	O
is	O
computationally	O
intractable	O
.	O
</s>
<s>
However	O
,	O
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
shows	O
that	O
factoring	O
integers	O
is	O
efficient	O
on	O
an	O
ideal	O
quantum	O
computer	O
,	O
so	O
it	O
may	O
be	O
feasible	O
to	O
defeat	O
RSA	B-Architecture
by	O
constructing	O
a	O
large	O
quantum	O
computer	O
.	O
</s>
<s>
In	O
2001	O
,	O
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
was	O
demonstrated	O
by	O
a	O
group	O
at	O
IBM	O
,	O
who	O
factored	O
into	O
,	O
using	O
an	O
NMR	O
implementation	O
of	O
a	O
quantum	O
computer	O
with	O
qubits	O
.	O
</s>
<s>
After	O
IBM	O
's	O
implementation	O
,	O
two	O
independent	O
groups	O
implemented	O
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
using	O
photonic	O
qubits	O
,	O
emphasizing	O
that	O
multi-qubit	O
entanglement	O
was	O
observed	O
when	O
running	O
the	O
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
circuits	O
.	O
</s>
<s>
In	O
2019	O
an	O
attempt	O
was	O
made	O
to	O
factor	O
the	O
number	O
using	O
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
on	O
an	O
IBM	B-Device
Q	I-Device
System	I-Device
One	I-Device
,	O
but	O
the	O
algorithm	O
failed	O
because	O
of	O
accumulating	O
errors	O
.	O
</s>
<s>
Though	O
larger	O
numbers	O
have	O
been	O
factored	O
by	O
quantum	O
computers	O
using	O
other	O
algorithms	O
,	O
these	O
algorithms	O
are	O
similar	O
to	O
classical	O
brute-force	O
checking	O
of	O
factors	O
,	O
so	O
unlike	O
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
,	O
they	O
are	O
not	O
expected	O
to	O
ever	O
perform	O
better	O
than	O
classical	O
factoring	O
algorithms	O
.	O
</s>
<s>
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
consists	O
of	O
two	O
parts	O
:	O
</s>
<s>
A	O
quantum	B-Device
algorithm	I-Device
to	O
solve	O
the	O
order-finding	O
problem	O
.	O
</s>
<s>
The	O
reduction	O
in	O
Shor	O
's	O
factoring	O
algorithm	O
is	O
similar	O
to	O
other	O
factoring	O
algorithms	O
,	O
such	O
as	O
the	O
quadratic	B-Algorithm
sieve	I-Algorithm
.	O
</s>
<s>
The	O
quantum	O
subroutine	O
of	O
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
can	O
be	O
expressed	O
as	O
an	O
application	O
of	O
quantum	B-Algorithm
phase	I-Algorithm
estimation	I-Algorithm
,	O
though	O
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
was	O
not	O
originally	O
stated	O
using	O
phase	B-Algorithm
estimation	I-Algorithm
;	O
the	O
reexpression	O
of	O
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
using	O
phase	B-Algorithm
estimation	I-Algorithm
is	O
due	O
to	O
Kitaev	O
.	O
</s>
<s>
The	O
quantum	O
circuits	O
used	O
for	O
this	O
application	O
of	O
phase	B-Algorithm
estimation	I-Algorithm
are	O
custom	O
designed	O
for	O
each	O
choice	O
of	O
and	O
,	O
where	O
is	O
the	O
number	O
to	O
factor	O
,	O
and	O
is	O
used	O
as	O
a	O
modulus	O
,	O
and	O
is	O
the	O
number	O
to	O
find	O
the	O
order	O
,	O
,	O
of	O
under	O
,	O
with	O
the	O
relationship	O
being	O
.	O
</s>
<s>
Essentially	O
,	O
we	O
are	O
running	O
phase	B-Algorithm
estimation	I-Algorithm
on	O
a	O
superposition	O
of	O
eigenvectors	O
.	O
</s>
<s>
Now	O
all	O
the	O
parameters	O
of	O
the	O
phase	B-Algorithm
estimation	I-Algorithm
circuit	O
have	O
been	O
specified	O
,	O
and	O
the	O
algorithm	O
can	O
be	O
run	O
.	O
</s>
<s>
Let	O
represent	O
the	O
overall	O
transformation	O
that	O
quantum	B-Algorithm
phase	I-Algorithm
estimation	I-Algorithm
applies	O
,	O
right	O
before	O
measurement	O
of	O
the	O
first	O
register	O
.	O
</s>
<s>
The	O
runtime	O
bottleneck	O
of	O
Shor	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
is	O
quantum	O
modular	O
exponentiation	O
,	O
which	O
is	O
by	O
far	O
slower	O
than	O
the	O
quantum	B-Algorithm
Fourier	I-Algorithm
transform	I-Algorithm
and	O
classical	O
pre-/post	O
-processing	O
.	O
</s>
<s>
The	O
simplest	O
and	O
(	O
currently	O
)	O
most	O
practical	O
approach	O
is	O
to	O
mimic	O
conventional	O
arithmetic	O
circuits	O
with	O
reversible	B-Application
gates	I-Application
,	O
starting	O
with	O
ripple-carry	O
adders	O
.	O
</s>
<s>
Reversible	B-Application
circuits	I-Application
typically	O
use	O
on	O
the	O
order	O
of	O
gates	O
for	O
qubits	O
.	O
</s>
<s>
Alternative	O
techniques	O
asymptotically	O
improve	O
gate	O
counts	O
by	O
using	O
quantum	B-Algorithm
Fourier	I-Algorithm
transforms	I-Algorithm
,	O
but	O
are	O
not	O
competitive	O
with	O
fewer	O
than	O
600	O
qubits	O
owing	O
to	O
high	O
constants	O
.	O
</s>
<s>
This	O
gives	O
us	O
an	O
abelian	O
hidden	B-Algorithm
subgroup	I-Algorithm
problem	I-Algorithm
,	O
as	O
corresponds	O
to	O
a	O
group	O
homomorphism	O
.	O
</s>
<s>
A	O
quantum	B-Device
algorithm	I-Device
for	O
solving	O
this	O
problem	O
exists	O
.	O
</s>
<s>
This	O
algorithm	O
is	O
,	O
like	O
the	O
factor-finding	O
algorithm	O
,	O
due	O
to	O
Peter	O
Shor	O
and	O
both	O
are	O
implemented	O
by	O
creating	O
a	O
superposition	O
through	O
using	O
Hadamard	O
gates	O
,	O
followed	O
by	O
implementing	O
as	O
a	O
quantum	O
transform	O
,	O
followed	O
finally	O
by	O
a	O
quantum	B-Algorithm
Fourier	I-Algorithm
transform	I-Algorithm
.	O
</s>
<s>
Due	O
to	O
this	O
,	O
the	O
quantum	B-Device
algorithm	I-Device
for	O
computing	O
the	O
discrete	O
logarithm	O
is	O
also	O
occasionally	O
referred	O
to	O
as	O
"	O
Shor	O
's	O
Algorithm.	O
"	O
</s>
<s>
The	O
order-finding	O
problem	O
can	O
also	O
be	O
viewed	O
as	O
a	O
hidden	B-Algorithm
subgroup	I-Algorithm
problem	I-Algorithm
.	O
</s>
<s>
For	O
any	O
finite	O
abelian	O
group	O
G	O
,	O
a	O
quantum	B-Device
algorithm	I-Device
exists	O
for	O
solving	O
the	O
hidden	B-Algorithm
subgroup	I-Algorithm
for	O
G	O
in	O
polynomial	O
time	O
.	O
</s>
