Shors Algorithm - Advanced Theory of Computation - Lecture Slides, Slides of Theory of Computation

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

2013/2014

Uploaded on 01/31/2014

samiksha
samiksha 🇮🇳

4.2

(9)

102 documents

1 / 20

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Shor’s Algorithm
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Partial preview of the text

Download Shors Algorithm - Advanced Theory of Computation - Lecture Slides and more Slides Theory of Computation in PDF only on Docsity!

Shor’s Algorithm

Overview 

Shor's algorithm

is a quantum algorithm for

factoring a number

N

in O((log

N

) time and

O(log

N

) space, named after Peter Shor.

The algorithm is significant because it impliesthat RSA, a popular public-key cryptographymethod, might be easily broken, given asufficiently large quantum computer

Overview 

Like many quantum computer algorithms, Shor'salgorithm is probabilistic

It gives the correct answer with high probability,and the probability of failure can be decreased byrepeating the algorithm.

Overview 

Shor's algorithm was discovered in 1994 by PeterShor, but the classical part was known before.

it is credited to G. L. Miller. Seven years later, in2001.

it was demonstrated by a group at IBM, whichfactored 15 into 3 and 5, using a quantumcomputer with 7 qubits.

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

< 2N

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(

^5

Gcd(

^3

We have successfully factored 15!

4/2 4/

References 

Peter W. Shor “Polynomial-Time Algorithms forPrime Factorization and Discrete Logarithms on aQuantum Computer “, SIAM Journal onComputing (1997)

www.eecis.udel.edu/~saunders/courses/879-03s/

http://en.wikipedia.org/wiki/Shor's_algorithm

Q & A

Thank You