Algorithm 7: Shor [17] |
Proceed with the following steps to retrieve a factor of a composite number with highprobability.
-
Pick at random an integer modulo N. If GCD is a non-trivial factor of N, we
have a solution.
-
Otherwise generate, setup, and run the quantum Subroutine (also shown in
Figure 42) to find a candidate for .
Use the continued fraction expansion to retrieve r (or a factor in r when s and r has a common factor).
If r is even, one of GCD may be a non-trivial factor of N. This happens with highprobability. |