310 likes | 492 Views
Four approaches to Shor. A mixture of a few. David Poulin LITQ Université de Montréal Supervisor Gilles Brassard ( SAWUNEH ma y 2001). Summary. Shor’s entire algorithm formally Probability analysis Phase estimation Shor as phase estimation Quantum circuit for QFT
E N D
Four approaches to Shor A mixture of a few David Poulin LITQ Université de Montréal Supervisor Gilles Brassard (SAWUNEH may 2001)
Summary • Shor’s entire algorithm formally • Probability analysis • Phase estimation • Shor as phase estimation • Quantum circuit for QFT • Semi-classical circuit for QFT • Single qubit phase estimation • Mixed state quantum computing
A bit of number theory... • Theorem • If a b (mod N) but a2 b2 (mod N) • Then gcd(a+b,N) is a factor of N. • Proof • a2 - b2 0 (mod N) • (a - b)(a+b) 0 (mod N) • ( t) [ (a - b) (a+b) = tN ] gcd(a+b, N) is a non trivial factor of N. uN vN
Easy Easy Easy Easy Easy Shor’s entire algorithm • N is to be factored: • Choose random x: 2 x N-1. • If gcd(x,N) 1, Bingo! • Find smallest integer r : xr 1 (mod N) • If r is odd, GOTO 1 • If r is even, a = xr/2 (mod N) • If a = N-1 GOTO 1 • ELSE gcd(a+1,N) is a non trivial factor of N. Hard Easy
Add this step to Shor’s algorithm: 0. -Test if N=N’2l and apply Shor to N’ -Compute for 2 j ln2N. If one of these root is integer, apply Shor to this root. Probability of success ½. Success probability Theorem If N has k different prime factors, probability of success for random x is 1- 1/2k-1. Easy
F F-1 Modular exponentiation EN,x HA dim= HB dim= Order finding Quantum Fourier transform = 2n n = 2lnN
For sake of analysis! m Order finding A B C D m Hn F-1 |0 EN,x |0 Bit bucket r : xr 1 (mod N)
EN,x B The second register is r-periodic since xnr+bmodN = xbmodN Step by step Hn A |0|0
Step by step m on the second register and obtain y a power of x. What is left in the first register is an equal superposition of everything consistent with y. y xs xs+r xs+jrmodN m C
Step by step Quantum Fourier transform F-1 D
What we want is r : xr 1 (mod N) ! Consider a c : t integer with 0 rc-t r/2 t rc t +r/2 t j jrc / tj +rj/2 tj +1/2 0 jrc / 1/2 plus a integer! Measure the first register: m “c” with probability |c|2 = What’s that probability?
Length of the arc: Length of the cord: |c|2 What’s that probability?
What’s that probability? If 0 rc-t r/2 then |c|2 #{c : 0 c -1 and (t)[0 rc-t r/2 ]} r Pr( getting a good c ) What the heck is so special about those c ?
Assume there is another t’/r’ satisfying this condition: Since Hence tr’ – t’r =0 t and r are unique. They can be found by continuous fraction algorithm!!! Continuous fractions The condition can be written c/ is the best n bits estimation of t/r.
That was Shor’s algorithm formally. Now I’ll show what Shor’s algorithm really is. Do you need a break?
Interference |0 |0 |1 ei |1 m |0 H H |0 |0+|1 |0+ei |1 (1+ ei )|0+ (1- ei )|1 Pr(“0”)=cos2(/2) Pr(“1”)=sin2(/2)
Phase kick back The previous dynamics can be simulated by: Same state as previous slide! |0 H |u |u U Apply U if top wire is 1 Bit bucket Where |u is an eigenstate of U: U|u = ei |u |0|u (|0+ |1)|u = |0|u+|1|u |0|u +ei |1|u (|0+ei |1)|u
4 |0+ei2 |1 Hn | |0 |0+ei |1 2 3 4 U2 |u |u U2 U2 U2 U Phase estimation In Deutsch’s problem, we were able to determine whether was 0 or . Q: Can me determine any ? A: We can get the best n bit estimation of /2.
F So applying F-1 to | will yield |x that is the best n bit estimation of /2. Phase estimation (binary extension of x/ - integer)
UN,a Multiplication Consider UN,a : |x |ax mod N. Then, for k = 1,...,r are eigenstates of UN,a with eigenvalues If we could prepare such a state, we could obtain an estimation of k/r hence of r. It requires the knoledge of r.
Multiplication Consider the sum Since The state |1 is easy to prepare. In what follows, we show that it can be used to get an estimation of k/r for random k.
m F-1 m m Make measurement here to collapse the state to a random |k : get an estimation of k/r for random k. This measurement commutes with the Us so we can perform it after. This measurement is useless! Phase estimation Hn |0 2 3 4 U2 |1 U2 U2 U2 U N,a N,a N,a N,a N,a
F-1 |x0 H Qubit n-1 depends on x0 with a phase 0 or -/2 and on x1 with a phase 0 or - |x1 R1 H |x0 H QFT circuit Qubit n is |0+ |1 if x0 is |0 and |0- |1 if x0 is |1. (x0 with a phase 0 or -)
H R1 R2 H R1 H Rk Note 2: Rk QFT circuit We define the gate Rk as a -/2k phase gate. |x3 R1 R2 R3 H |x2 |x1 |x0 Note 1: H = R0
Measurements! H Semi-classical QFT |x3 H |x2 R1 H |x1 R1 R2 H |x0 R3 R2 R1 All controlled phase gates are now classically controlled!
Single qubit phase estimation … … |0+ |1 H … |0+ |1 H … R1 |0+ |1 H … R1 |0+ |1 R2 H … … n-1 |1 2 1 0 … U2 U2 U2 U2 Bit bucket
Almost anything will do the job!!! Single qubit phase estimation |0+ |1 |0+ |1 |0+ |1 … |0+ |1 Rn-2 H H Rn-1 Rn H H … … |1 n-1 2 … U2 U2 1 0 U2 U2 The are measurements. The Rk are phase gates with an angle 0.b1b2...bk-1 where bj is the classical outcome of the jth measurement.
The other eigenvectors of UN,aare of the form: Where gd are solutions of gar-g 0 mod N and rd is the period of the period x gdaxmod N. Mixed state computing Maximally mixed state: Independent of the basis |k. The |kk=1,2,...,r are orthogonal, but do not form a complete basis since r < .
We express the maximally mixed state as a mixture of the eigenvalues of UN,a. The output of the algorithm will then be the best n bit estimation of jd/rd for d and jd chosen at random. The result is useful if gd=1: Prob = Mixed state computing Theorem: Given q and p : N = pq, then gar-g 0 mod N for at most p+q-1 values of g.
Mixed state computing Since I is independent of the basis, we can input anything in the bottom register and it will work pretty well. In particular, this is useful for NMR computing. (it’s impossible to prepare a pure state)