| A | B | C | D | E | F | G | H | I | J | K | L | M | N | |
| 1 | pm1 | 1 | n | 55 | a | 10 | No Error | T1 Shor | ||||||
| 2 | pm2 | 55 | x | 13 | y | 34 | Periodicity | 20 | r1 | 5 | 10 | |||
| 3 | Register 2 | 28 | q | 8192 | p | 5 | a0 | 9 | ||||||
| 4 | Register 1 | 4915 | q max | 16384 | q | 11 | Loop count | 3 | 5 | 7 | ||||
| 5 | a | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 6 | x^a mod(n) | 1 | 13 | 4 | 52 | 16 | 43 | 9 | 7 | 36 | 28 | 34 | 2 | 26 |
| 7 | Register 2 | 1 | 2 | 4 | 7 | 8 | 9 | 13 | 14 | 16 | 17 | 18 | 26 | 28 |
| 8 | M | 410 | 410 | 410 | 410 | 409 | 410 | 410 | 409 | 410 | 409 | 409 | 409 | 410 |
| 9 | Register 1 | 0 | 409 | 819 | 1228 | 1638 | 2048 | 2457 | 2867 | 3276 | 3686 | 4096 | 4505 | 4915 |
| 10 | ||||||||||||||
| 11 | Eureka | 5 | 11 | max level | 2 | loop count | 5 | |||||||
| 12 | Eureka | 5 | 11 | loop count | 1 |
| Factorize |
As part of Step 1 the program displays the three calculated values n = pm1*pm2 in Cell (1,E) x in Cell (2,E) and q in Cell (3,E). q = 2^x
Next the program asks the following question: Option Enter x"
You can Enter a new value for x, if you want. If you do than a new value for q is calculated.
As part of Step 2 the results of x^a mod n is calculated in row 6 as a function of a. The value of a is displayed in row 5
As part of step 3 a list numbers is displayed showing how often each value (x^a mod n) is calculated. The values x^a mod n are displayed in row 7 and the list (the variable M) in row 8. In fact this are the values stored in the array nxn explained in the next paragraph.
Next the following message is displayed: Select a number from Register 2 line
If you do not enter a number than the program selects at random a number out of the list in row 7.
As part of step 4 the following message is displayed: All FFT state values? S = short list; blank = skip
Next the following message is displayed: All probability values ? S = short list; Enter = skip
At the end of step 4 a list of the most probable measured values is displayed.
This are the values q*d/r for d going from 0 to r.
For Example if you want to find the prime numbers of 55, at the beginning of the program Enter 1 and 55. In step 3 Enter 28 and as part of Step 4 Enter S (Short list) twice . The first time to observe the FFT state values and the second time to observe the probability.
As part of step 5 the following message is displayed: Enter Measured value. Enter = Random . The purpose is to enter a value out of the previous displayed list. You can also enter any value. If no value is selected that the program selects one out of this list.
Finally the factorization results of Classical Algorithm and Fermat's sieve Algorithm are displayed in resp. row 11 and row 12. Which both algorithms the number of calculations is displayed in column K.
For Example: try 5 and 43 to observe that Shor's Algorithm has periodicity 84, Classical Algorithm requires 4 calculations and Fermat's Algorithm requires 10 calculations.
| A | B | C | D | E | F | G | |
| 1 | pm1 | pm2 | n | x | q | Type | periodicity |
| 2 | 3 | 5 | |||||
| 3 | 3 | 5 | 15 | 9 | 512 | T2 | 2 |
| 4 | 5 | 7 | 35 | 12 | 4096 | T1 | 12 |
| 5 | 7 | 11 | 77 | 14 | 16384 | T2 | 5 |
| 6 | 11 | 13 | 143 | 16 | 65536 | T3 | 15 |
| 7 | 13 | 17 | 221 | 17 | 131072 | T2 | 6 |
| 8 | 17 | 19 | 323 | 18 | 262144 | T1 | 2 |
| GetPrime |
Those two numbers are used as start values for 50 prime number combinations. Multiplication of those two numbers gives a number n which is factorized 50 times using Shor's Algorithm in 2 steps.
As part of Step 1 for each of the 50 combinations the program displays the three calculated values n = pm1*pm2 in Cell (3,C) x in Cell (3,D) and q in Cell (3,E). q = 2^x
As part of Step 2 for each of the 50 combinations x^a mod n is calculated as a function of a. This calculation terminates when the result is 1 or is equal to any previous calculated value.
When the result is 1 the periodicity is equal to a. This value is stored in Cell (3,G).
What the program shows is that the periodicity becomes very large and in worst cases is almost equal to: pm1*pm2/2. This challenges the usefulness of Shor's Algorithm.
The program also works for rather large prime number combinations.
Back to my home page: Contents of This Document