Next: Sample Output for n Up: Sample Output Previous: Sample Output for n   Contents

## Sample Output for n = 15

```Welcome to the simulation of Shor's algorithm.
There are four restrictions for Shor's algorithm:
1) The number to be factored (n) must be >= 15.
2) The number to be factored must be odd.
3) The number must not be prime.
4) The number must not be a prime power.

There are efficient classical methods of factoring any of the above numbers, or determining that they are prime.

Input the number you wish to factor.
15
Step 1 starting.
Step 1 complete.
Step 2 starting.
Searching for q, the smallest power of 2 greater than or equal to n^2.
Found q to be 256.
Step 2 complete.
Step 3 starting.
Searching for x, a random integer coprime to n.
Found x to be 13.
Step 3 complete.
Step 4 starting.
Made register 1 with register size = 9
Created register 2 of size 4
Step 4 complete.
Step 5 starting attempt: 1
Step 5 complete.
Step 6 starting attempt: 1
Step 6 complete.
Step 7 starting attempt: 1
Step 7 complete.
Step 8 starting attempt: 1
Making progress in Fourier transform, 38.8235% done!
Making progress in Fourier transform, 78.0392% done!
Step 8 complete.
Step 9 starting attempt: 1
Value of m measured as: 0
Step 9 complete.
Measured, 0 this trial a failure!
Steps 10 and 11 complete.
Step 5 starting attempt: 2
Step 5 complete.
Step 6 starting attempt: 2
Step 6 complete.
Step 7 starting attempt: 2
Step 7 complete.
Step 8 starting attempt: 2
Making progress in Fourier transform, 38.8235% done!
Making progress in Fourier transform, 78.0392% done!
Step 8 complete.
Step 9 starting attempt: 2
Value of m measured as: 0
Step 9 complete.
Measured, 0 this trial a failure!
Steps 10 and 11 complete.
Step 5 starting attempt: 3
Step 5 complete.
Step 6 starting attempt: 3
Step 6 complete.
Step 7 starting attempt: 3
Step 7 complete.
Step 8 starting attempt: 3
Making progress in Fourier transform, 38.8235% done!
Making progress in Fourier transform, 78.0392% done!
Step 8 complete.
Step 9 starting attempt: 3
Value of m measured as: 128
Step 9 complete.
Steps 10 and 11 starting attempt: 3
Measured m: 128, rational approximation for m/q=0.5 is: 1 / 2
Candidate period is 2
13^1 + 1 mod 15 = 14,
13^1 - 1 mod 15 = 12
15 = 3 * 5
Steps 10 and 11 complete.
```

Next: Sample Output for n Up: Sample Output Previous: Sample Output for n   Contents
Matthew Hayward - Quantum Computing and Shor's Algorithm GitHub Repository