8. • The best-known classical algorithm for factoring N
is ”General number field sieve”
• Shor’s Algorithm is polynomial in log𝑁 and uses log 𝑁 space
Factorization
9. • Let N a huge integer s.t.
• p, q are primes
• N= p*q
• We wish to find p, q
Reformulation of factorization
10. • Let N as before.
• Pick randomly a number a< N
• If GCD(a, N )>1 so we achieved the required (we can
do this step using the Euclidean algorithm)
• GCD(a, N ) = 1
Finding an Even Period
11. • Consider the following function :
F(x) = 𝑎𝑥
mod(N) for x integer
• Assume r is the smallest period of F:
F(x+r)=F(x) ∀ m<r F(x+m)≠F(x)
Even Period
13. • a^m = a^(m+r) => a^r=1 a^r-1 =0 mod(N)
• If r is even : a^2-b^2 –(a-b)(a+b)
• 0=a^r-1 = (a^(r/2) -1)(a^(r/2)+1)
• If a^(r/2) =-1Mod(N) =>a^(r/2)=N-1 mod(N)
14. • If r is odd we cannot do anything (need a new a)
• If r is even but 𝑎
𝑟
2 ≡ -1mod(N) we cant factorize N
need a new a
We have r is an even period
𝑎𝑟 ≡ 1 (N)
When r is bad?
17. Examples
The simple
N=15 , a=7
The period: 7,49, 343, 2401
Convert to mod (15): 7,4, 13, 1
➢ r =4
➢GCD(72 +1,15) = 5
➢GCD(72 -1,15) = 3
Wow it works!
18. Examples
Tedious one
N=35 , a=12
Period mod 35: 12,4,13,16,17,29,33,11,27,9,3,1
➢ r =12, we need 126 mod(35)= 29
➢ GCD(126
+1,35) = 5 GCD(126
-1,35) = 7
19. Well….
If some one provides you the period r ,yes.
But no oracles in algorithms. We need to find it
ourselves
Is it that easy?
20. The Quantum Part
• We have a function F s.t.
• F : {0,1}𝑛 -> {0,1}𝑛
• Find an even number r s.t.
• F(x)= F(x+r) ∀ x
• ∀ m< r F(x+m)≠F(x)
40. QFT Properties
• QFT is unitary :
||x||=1 => ||QFT|x>||=1
||x||=1,||y||=1 ,<x,y>=0 => <QFT|x>,QFT|y> > =0
• The order of QFT is a power of 2(2𝑙
)
• Commonuse for FFT is finding periods
(convert a signal from time axis to frequency)
41. QFT – Matrix representation
• QFT is a matrix that its (a, c) entry is:
• We can show that it is a unitary matrix
• A common notation is 𝐴𝑞