QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Ryutaoh Matsumoto Nagoya Univesity, Japan Send you comments to yutaoh.matsumoto@nagoya-u.jp Septembe 2018 @ Tokyo Tech. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 1 / 21
Acknowledgment and Copyight Mateials pesented hee can by eused unde the Ceative Commons Attibution 4.0 Intenational License https://ceativecommons.og/licenses/by/4.0. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 2 / 21
Answes to the pevious execise 1. Let U = ( 1 0 0 exp(2πi5/16 Find the all eigenvalues of U. Answe: Obviously 1 and exp(2πi5/16. 2. Let u be the eigenvecto of U and assume U u u. Assume that we do the phase estimation with t = 3. Then thee ae eight possible measuement outcomes. Compute the pobability distiibution of outcomes. I ecommend you to use Mathematica, Matlab, Maple, and so on. Answe: By the fomula, fo l = 0,..., 7, the coefficient of l afte the IQFT is 2 1 t 1 ( 2πikl 2 t exp 2 t exp(2πikθ = 12 2 t 1 t exp(2πik(θ l/2 t k=0 = 1 8 k=0 7 exp(2πik(5 2l/16 Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 3 / 21 k=0
By cumbesome computation, we can see that the coefficients ae l ( squed nom of coefficient l 2 t θ > 3/8 1 1 7 64 1 + ( 1 + 2 2 cos ( ( π 8 2 sin π 2 8 0.0162432 Yes ( 1 0 64 1 + ( 1 + 2 2 cos ( ( π 8 + 2 sin π 2 8 0.022601 ( 1 1 64 1 + ( 1 + 2 + 2 cos ( ( π 8 2 sin π 2 8 0.0506223 ( 1 b = 2 64 1 + ( 1 + 2 + 2 cos ( ( π 8 + 2 sin π 2 8 0.410533 2 t θ = 2.5 ( 1 3 64 1 + ( 1 + 2 + 2 cos ( ( π 8 + 2 sin π 2 8 0.410533 ( 1 4 64 1 + ( 1 + 2 + 2 cos ( ( π 8 2 sin π 2 8 0.0506223 ( 1 5 64 1 + ( 1 + 2 2 cos ( ( π 8 + 2 sin π 2 8 0.022601 ( 1 6 64 1 + ( 1 + 2 2 cos ( ( π 8 2 sin π 2 8 0.0162432 Yes Obseve that 5/16 is 0. }{{} 010 1, which implies b = 2. The two neaest values l = 2, 3 to tue θ have the highest pobability. =b Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 4 / 21
3. By using p( m b > e 1 2(e 1 compute the lowe bound on the pobability of the event that the mesuement outcome of θ is within 3/8 fom the tue value θ = 5/16. How much diffeence exists between the lowe bound and the tue pobability? Answe: Since the equied accuacy is 3/8, the measuement outcomes 0, 1, 2, 3, 4, 5 have the desied accuacy. The tue pobability is oughly 0.968. In this case b = 010 = 2. We have to choose e = 2. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 5 / 21
We have to choose e = 2, because (daw a figue on the black boad the acceptable measuement outcomes m ae 0, 1, 2, 3, 4, 5, m = 6, 7 should be included in the event m b > e, m b > e is consideed modulo 2 t, and e is an intege, we have to choose e = 2. p( m b e 1 1/2(e 1 = 1 1/2 = 1/2. The diffeence between the tue pobability and its lowe bound is 0.968 0.5 = 0.468. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 6 / 21
Factoing N Suppose that we ae given N. We assume that N is odd, and is NOT a pime powe. It can be checked by seeing if i N is an intege fo some i log3 N. In ode to beak the RSA, we need this kind of computation. Fistly andomly choose 2 x N 1, and see if gcd(x, N = 1. If gcd > 1, then we have gotten a nontivial facto of N. Othewise, compute the ode of x modulo N, that is od(x, N = min{i 1 x i mod N = 1} If gcd(x, N > 1 then thee is no i such that x i mod N = 1. So we have to exclude this case fist. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 7 / 21
Oveview of the factoization pocedue Factoization by the ode finding given N: 1 Choose 1 x N 1 andomly. If gcd(x, N > 1 then output gcd as a facto of N. 2 Compute = od(x, N (ode finding. 3 Check if is even. If is odd, then etun to Step 1. 4 Compute z = x /2 mod N. 5 Check if z 1 (mod N. If tue, then etun to Step 1. By Theoem 1, Step 1 is epeated moe than once with a pobability at most 1/4. 6 As a facto of N output gcd(z + 1, N if gcd(z + 1, N 1, othewise output gcd(z 1, N( 1. Theoem 2 ensues that the output is a facto. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 8 / 21
Suppoting theoems Theoem 1 Choose an intege x unifomly at andom such that gcd(x, N = 1 and 1 x N 1, define = od(x, N. Then the pobability of the event that is even that and x /2 mod N N 1 is 3/4. Poof. Omitted. You can find a poof in Quantum Computation and Quantum Infomation, ISBN: 0521635039. Assume that is even and x /2 mod N N 1. Othewise choose x again until the above condition is satisfied. Theoem 2 Let z be an intege such that 2 z N 2 and z 2 mod N = 1. Then at least one of gcd(z + 1, N o gcd(z 1, N is geate than 1 and divides N. Poof. Omitted. You can find a poof in Quantum Computation and Quantum Infomation, ISBN: 0521635039. Thus, gcd(x /2 + 1 mod N, N o gcd(x /2 1 mod N, N is a facto of N. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 9 / 21
Computing the ode of x modulo N Thee is no known fast algoithm fo computing the ode of x modulo N by digital computes. I will intoduce a fast quantum algoithm. Let 2 L 1 N 2 L 1 and 0 y 2 L 1, define the unitay opeato U such that U y = xy mod N. We define xy mod N = y if N y 2 L 1. The ode of x modulo N is elated to the phase of eigenvalues of U as follows. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 10 / 21
Recall = od(x, N. Fo 0 s 1, define the L-qubit quantum state Then we have u s = 1 1 ( 2πisk exp x k mod N. k=0 1 1 ( 2πisk U u s = exp k=0 1 1 ( 2πisk = exp k=0 1 ( 2πis(k 1 = exp k=1 ( 2πis 1 ( 2πisk = exp exp k=1 U x k mod N x k+1 mod N x k mod N x k mod N Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 11 / 21
( 2πis 1 ( 2πisk U u s = exp exp k=1 ( 2πis 1 1 ( 2πisk = exp exp k=0 ( 2πis = exp u s x k mod N x k mod N If we could estimate the phase of the eigenvalue of u s, we would know s/. Fom which we could know. The obstacle is that the pepaation of u s equies the knowledge of. Let us see how we can bypass this difficulty. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 12 / 21
Pepaation fo eigenvectos We can show that 1 1 u s = 1 1 1 ( 2πisk exp xk mod N (1 k=0 1 ( 2πisk exp = δ k0. (2 Its poof is given in the Appendix of handout. Substitution of Eq. (2 into Eq. (1 gives 1 1 u s = x 0 mod N = 1 = 0 0 0 1. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 13 / 21
Useful shape of pobability distibution of measuement outcomes If we use the phase estimation algoithm with 1, then we get outcomes nea to s/ with pobability 1/ fo s = 0,..., 1 (Daw a figue hee. You ae equested to daw a simila figue in Question 6.. In the next lectue, I will show that how to compute fom a binay factional ditits 0.b 1 b 2... b t that is close to s/ fo some unknown 0 s 1. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 14 / 21
Execise 1. Let N = 5 7 and x = 8. Compute = od(x, N. 2. Tell whethe o not x /2 mod N N 1. 3. Tell whethe eithe gcd(n, x /2 1 mod N o gcd(n, x /2 + 1 mod N is a facto of N o not. 4. Compute u s with above values and s = 1. 5. Let U be as defined in the lectue. With above x and N, what is the eigenvalue of U to which u 1 belongs? 6. Suppose that we execute the phase estimation pocedue with the above U and 1 1 u s with t = 4 qubits fo ecoding the value of a phase s/. Thee ae 2 t = 16 possible outcomes. Plot those 16 pobabilities and obseve that outcomes coesponding to s/ fo s = 0,..., 1 have highe pobabilities than the est. The final epot will be simila to Q4 6. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 15 / 21
Hint fo Q6 In ode to find the pobability distibution of outcomes of phase estimation, we need to calculate the quantum state immediately befoe the measuement in the phase estimation. Let v s be the quantum state befoe measuement when the input state to the phase estimation is u s as visualized below: ( 0 + 1 t u s unitay manipulation in phase estimation v s u s measuement of v s in phase estimation Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 16 / 21
Because the input state to the phase estimation is 1 1 u s, we have 1 1 ( 0 + 1 t u s unitay manipulation in phase estimation 1 1 v s u s measuement of v s in phase estimation Fo each s = 0,..., 1, we compute v s. Since we use t = 4 qubits fo the phase estimation, We expess v s as a linea combination of 0,..., 15. Let α s,l be v s s complex coefficient of l, i.e., v s = 15 l=0 α s,l l. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 17 / 21
By Unit 9, ecall that α s,l is given by 2 1 t 1 2 t [exp ( 2πi(θ l/2 t ] k. (3 k=0 Waning: Some students assumed the input-output elation between u s and v s is linea. But it is not clea. u s has 6 = log 2 35 qubits while v s has 4 = t qubits. Thei elation cannot be unitay, which suggests it is not linea eithe. Thus, when the input is a linea combination of u s, the output cannot be assumed as a linea combination of v s without a justifying explanation. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 18 / 21
The phase estimation measues v s and does not measue u s. To compute the pobability distibution of the measuement outcomes, we need to compute the patial tace ove the quantum system containing v s, and emove u s fom the quantum state. Fistly, the vecto epesentation of output is Its matix epesentation is 1 1 v s u s. s,s v s v s 1 u s u s, whose patial tace is... (please do the est by youself. Please veify whethe the total of the pobabilities is 1. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 19 / 21
Appendix: Poof of Eq. (2 Let 1 k 1. Conside the sequence 0k mod, k mod, 2k mod,.... Define d = min{j 1 jk mod = 0}. d must divide othewise k mod would not be zeo. Moeove, jk mod = (j + dk mod. Theefoe, 1 ( 2πisk exp = d 1 ( 2πisk exp d On the othe hand, if 0 j j d 1 then jk mod j k mod, othewise (j j k mod = 0, which is a contadiction to the minimality of d. This means that ( ( ( 2πi0k 2πi1k 2πi(d 1k exp, exp ae paiwise distinct oots of X d 1 = 0.,..., exp Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 20 / 21
d 1 ( 2πisk X d 1 = (X exp d 1 ( 2πisk = X d + exp X d 1 + 1. This means that d 1 ( 2πisk exp = 0. Matsumoto (Nagoya U. QIP Couse 10: Quantum Factoization Algoithm (Pat 3 Sept. 2018 21 / 21