












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This lecture is part of complete lecture series on Advanced Theory of Computation. Key points in this lecture are: Shors Algorithm, Rsa, Public Key, Prime Numbers, Depth Analysis, Preparing Data, Superposition Collapse, Qft, References
Typology: Slides
1 / 20
This page cannot be seen from the preview
Don't miss anything!













Overview
Overview
Overview
Shor’s Algorithm - Periodicity ^
Choose N = 15 and x = 7 and we get the following:
mod 15 = 1 7
mod 15 = 7 7
mod 15 = 4 7
mod 15 = 13 7
0 1 2 3 4 mod 15 = 1
An important result from Number Theory:
F(a) = x mod N
is a periodic function
a
Shor’s Algorithm - In Depth Analysis
To Factor an odd integer N (Let’s choose 15) :
Determine if the number
n
is a prime, a even number, or an
integer power of a prime number. If it is we will not use Shor'salgorithm. There are efficient classical methods for determining ifa integer
n
belongs to one of the above groups, and providing
factors for it if it is. This step would be performed on a classicalcomputer.
Choose an integer
q
such that N
q
2
let’s pick 256
Choose a random integer
x
such that GCD(
x , N) = 1
let’s pick 7
2
2
Shor’s Algorithm - Preparing Data^ 5.
Load the input register with an equally weightedsuperposition of all integers from 0 to
q
0 to 255
Load the output register with all zeros.
The total state of the system at this point will be:
1 √^256
∑
|a, 000> 255 a=
InputRegister
OutputRegister
Note: the comma heredenotes that theregisters are entangled
Shor’s Algorithm - Modular Arithmetic
Apply the transformation
x
mod N to each number in
the input register, storing the result of each computationin the output register.
a
Input Register
7
Mod 15
Output Register
|0>
7
Mod 15
1
|1>
7
Mod 15
7
|2>
7
Mod 15
4
|3>
7
Mod 15
13
|4>
7
Mod 15
1
|5>
7
Mod 15
7
|6>
7
Mod 15
4
|7>
7
Mod 15
13
a 0 1 2 3 4 5 6 7
Note that we are using decimalnumbers here only for simplicity.
..
Shor’s Algorithm - Entanglement 9.
Since the two registers are entangled, measuring the outputregister will have the effect of partially collapsing the inputregister into an
equal superposition
of each state between 0
and
q
-1 that yielded
c
(the value of the collapsed output
register.)
Now things really get interesting!
Since the output register collapsed to |1>, the input registerwill partially collapse to:
The probabilities in this case are
since our register is
now in an equal superposition of 64 values (0, 4, 8,... 252)
1 √^64
1 √^64
1 √^64
1 √^64 1 √^64
Shor’s Algorithm - QFT We now apply the Quantum Fourier transform on thepartially collapsed input register. The fourier transform hasthe effect of taking a state |a> and transforming it into astate given by:
1 √ q
∑
**|c> ***
e
q-1 c=
2
i ac /
q
Shor’s Algorithm - QFT
The QFT will essentially peak the probability amplitudes atinteger multiples of
q
/r , where
r is the desired period in our
case r is 4.
So we no longer have an equal superposition of states, theprobability amplitudes of the above states are now higherthan the other states in our register.Measure the state of register one, call this value
m
, this
integer
m
has a very high probability of being a multiple of
q /
r With our knowledge of q, and m, there are methods ofcalculating the period (one method is the continuous fractionexpansion of the ratio between q and m.)
Shor’s Algorithm - The Factors :)^ 10. Now that we have the period, the factors of N can be
determined by taking the greatest common divisor of Nwith respect to
x ^ (P/2) +
1 and
x ^ (P/2)
The idea
here is that this computation will be done on a classicalcomputer.
We compute:Gcd(
Gcd(
We have successfully factored 15!
4/2 4/
References