Chapte 5 Quantum Fouie Tansfom Many poblems in physics and mathematics ae solved by tansfoming a poblem into some othe poblem with a known solution. Some notable examples ae Laplace tansfom, Legende tansfom, etc., but by fa the most commonly used tansfomations is the Fouie tansfomation. A discete vesion Fouie tansfomation can be defined as y k Ô N ÿ x j e 2fii j k/n (5.) N whee x (x 0, x,..., x N ) is the vecto that is being tansfomed. The quantum Fouie tansfom in based on essentially the same idea with the only di eence that the vectos x and y ae state vectos, i.e. x y N ÿ N ÿ x j jí (5.2) y j jí. (5.3) Then the action on the components of state vecto x is descibed by 5. so that o N ÿ x j jí æ N ÿ N ÿ x j jí æ y k kí Ô N ÿ N N ÿ N ÿ x j e 2fii j k/n kí (5.4) N ÿ x j Ô e 2fii j k/n kí. (5.5) N 5
CHAPTER 5. QUANTUM FOURIER TRANSFORM 52 In othe wods the incoming amplitude x j of a given basis vecto jí (in oiginal o position space) is distibuted among all basis vecto (in Fouie o momentum space) N ÿ x j jí æx j Ô e 2fii j k/n kí. (5.6) N What is, howeve, di eent is that both the oiginal vecto x and the tansfomed vecto y is ecoded using the vey same Hilbet space. 5. Quantum Cicuit In the case of quantum computation the basis vectos jí ae the computational basis vectos (i.e. j œ N) fo let say n q-bits. Then it will be useful to adopt the binay epesentation j : N æ{0, } n (5.7) such that and binay function such that nÿ j [j j 2...j n ] j i 2 n i (5.8) i 0. : {0, } m æ (0, ) (5.9) mÿ 0.(j,j 2,..., j m ) j i 2 m. (5.0) i
CHAPTER 5. QUANTUM FOURIER TRANSFORM 53 Then (5.6) implies 2 jí [j j 2...j n ]Í æ 2 n ÿ n 2 2fii j k 2 n2 [k...k n ]Í A A ÿ ÿ n B B 2 n ÿ 2... 2fii j k l 2 n l 2 n [k...k n ]Í k 0 k n0 l ÿ ÿ np 2 n 2... 2fii j kl 2 l2 k l Í 2 k 0 k n0 l Q np ÿ 2 n 2 a R 2fii j k l 2 l2 k l Íb l k l 0 np 2 2 n 2 0Í + 2fii j 2 l Í 2 l A A A np n B B B 2 n ÿ 2 0Í + 2fii j k 2 n k 2 l Í l k 2 n 2 ( 0Í +(2fii 0.(jn )) Í)... ( 0Í +(2fii 0.(j...j n ))(5.) Í). whee in the last step we used A A n BB A A ÿ n l BB Q Q RR ÿ nÿ 2fii j k 2 (n l) k 2fii j k 2 (n l) k a2fii a j k 2 (n l) k bb k k kn l+ Q Q RR nÿ a2fii a j k 2 (n l) k bb. (5.2) kn l+ Then we can constuct a collection of two q-bit gates which descibe otations of elative phase 0 R k 2fii. (5.3) 2 k 0 e These otations can be used to constuct the following cicuit on a system of n q-bits:
CHAPTER 5. QUANTUM FOURIER TRANSFORM 54 It is easy to see that the above cicuit would pefom a quantum Fouie tansfom on the input gates. Afte the fist Hadamad gate we get 2 2 0Í + e 2fii 0.(j ) Í 2 j 2...j n Í (5.4) since Y ] e 2fii 0.(j) + if j 0 [ if j, afte the contolled-r 2 gate (5.5) 2 2 0Í + e 2fii 0.(j j 2 ) Í 2 j 2...j n Í (5.6) and so on until afte the contolled-r n gate we get 2 2 0Í + e 2fii 0.(j j 2..j n) Í 2 j 2...j n Í. (5.7) Then we do a simila opeation on the second bit to get 2 2 2 0Í + e 2fii 0.(j j 2..j n) Í 2 0Í + e 2fii 0.(j 2..j n) Í 2 j 3...j n Í (5.8) and so on until we get 0Í + e 2fii 0.(j j 2...j n) Í 2 0Í + e 2fii 0.(j 2...j n) Í 2... 0Í + e 2fii 0.(jn) Í 2 2 n 2 (5.9) and finally we can pefom a swap opeation to evese the ode of q-bits 2 n 2 0Í + e 2fii 0.(j n) Í 2... 0Í + e 2fii 0.(j j 2..j n) Í 2 (5.20) which is the desied esult accoding to the poduct ansion of (5.). How many gates have we used? It is plus n/2 swaps each using thee C-NOT gates n +(n ) +... + (5.2) n +(n ) +... ++3 n 2 O(n2 ) (5.22) swaps. The best classical algoithm of pefoming Fouie tansfom (namely Fast Fouie Tansfom o FFT) on a vecto in 2 n dimensional space uses onentially many gates (n2 n ). (5.23) Of couse, keep in mind that not all of the infomation about the Fouie tansfomed state vecto can be etieved, but one can still use it to design e cient quantum algoithms using the so-called phase estimation pocedue.
CHAPTER 5. QUANTUM FOURIER TRANSFORM 55 5.2 Phase Estimation Conside a unitay opeato U whose eigenvecto ÂÍ has eigenvalue e 2fii Ï, i.e. U ÂÍ e 2fii Ï ÂÍ. (5.24) Let us also suppose that we ae able to pefom contolled-u 2k (fo any k) opeations on state vecto ÂÍ and ou task is to estimate Ï. Then we can constuct the following quantum cicuit: whee Fn epesents an invese Quantum Fouie Tansfom on n q-bits. The initial state of the system is afte applying the Hadamad gates it is 2 n 2 0Í n ÂÍ (5.25) 2 n ÿ jí ÂÍ (5.26) all of the contolled opeations (but befoe Fn ) the state of the systems is 2 n 2 0Í + e 2fii 2 0Ï Í 2 0Í + e 2fii 2Ï Í 2... 0Í + e 2fii 2n Ï Í 2 ÂÍ 2 n 2 Fo example if 2 n ÿ (5.27) Ï [0.Ï Ï 2...Ï n ] (5.28) then Eq. (5.27) can be witten as 2 n 2 0Í + e 2fii [0.Ï Ï 2...Ï n] Í 2 0Í + e 2fii [0.Ï 2...Ï n] Í 2... 0Í + e 2fii [0.Ïn] Í 2 ÂÍ. (5.29) This is exactly what we we had in (5.9), and thus by evesing the Quantum Fouie Tansfomation cicuit (but without swapping bits) we get ÏÍ ÂÍ (5.30) whee Ï is an estimated value of Ï (to fist n bits in binay ansion). e 2fii Ïj jí ÂÍ.
CHAPTER 5. QUANTUM FOURIER TRANSFORM 56 5.3 Ode-finding Fo positive integes x and N such that x<n the ode of x modulo N is defined to be the smallest intege such that o in othe wods thee exist R œ N such that Note that x ( mod N). (5.3) x RN +. (5.32) x 0 ( mod N) x ( mod N) x 2 ( mod N)... (5.33) The poblem of finding when x and N have no common factos is believed to be a had poblem on a classical compute in a sense that no algoithm is known to solve the poblem using polynomial esouces in the numbe of bits, i.e. O (log N) k2 (5.34) fo any k. Thee is howeve an e cient quantum algoithm based on phase estimation. Conside a collection of unitay opeatos U x which act on state vectos as U x yí xy ( mod N)Í (5.35) whee y œ{0, } L and L is the numbe of q-bits. It is also assumed that U acts non-tivially only if y<n, i.e. Y ] xy ( mod N) if 0 Æ y<n xy ( mod N) [ y if N Æ y Æ 2 L. (5.36) Then the eigenstates of U ae u s Í /2 ÿ 2fii sk x k ( mod N)Í (5.37) with eigenvalues 3 4 2fii s (5.38)
CHAPTER 5. QUANTUM FOURIER TRANSFORM 57 fo 0 Æ s Æ. This can be veified by diect computation U u s Í /2 ÿ 2fii sk x k+ ( mod N)Í 3 4 2fii s ÿ 2fii sk /2 x k ( mod N)Í k 3 4 A B 2fii s /2 x ÿ 2fii sk ( mod N)Í + x k ( mod N)Í k 3 4 2fii s /2 ÿ 2fii sk x k ( mod N)Í 3 4 2fii s u s Í. (5.39) So, if we ae able to ceate such a state then we can use the phase estimation pocedue to detemine s/ fom which the ode can be detemined. But fo that we should fist show how to pepae any of the state vectos u s Í (with non-tivial eigenvalues) and also to implement contolled-u 2k (fo any intege k) used in the phase estimation pocedue. In fact the application of contolled-u 2k gates phase estimation pocedue is equivalent to zí yí æ zíu zt2k...u z 2 0 yí zí x zt2k...x z 2 0 y( mod N)Í zí x z y( mod N)Í. (5.40) which can be accomplished using the thid egiste, zí yí 0Í æ zí yí x z ( mod N)Í æ zí yx z ( mod N)Í zí yx z ( mod N)Í æ zí yx z ( mod N)Í 0Í. (5.4) What is less tivial is how to pepae a vecto u s Í (without a pio knowledge of ) if not in an eigenstate, at least in a useful supeposition. Note that we
CHAPTER 5. QUANTUM FOURIER TRANSFORM 58 can ess Í in eigenbasis u s Í as /2 ÿ u s Í /2 ÿ /2 ÿ s0 s0 ÿ ÿ s0 ÿ 2fii sk x k ( mod N)Í 2fii sk x k ( mod N)Í 0k x k ( mod N)Í Í. (5.42) Theefoe U j Í U /2 ÿ u s Í 5.4 Shoe algoithm s0 x j ( mod N)Í /2 ÿ e 2fiisj/ u s Í (5.43) s0 Now we can descibe the Sho s algoithm to find. Stat with a state (accoding to 5.42) 0...0Í 0...0Í 0Í t ÿ ÿ 2fii sk x k ( mod N)Í (5.44) s0
CHAPTER 5. QUANTUM FOURIER TRANSFORM 59 afte Hadamad gates (accoding to.65) the state is 2 t/2 ÿ j jí ÿ ÿ s0 2fii sk x k ( mod N)Í (5.45) afte modula onentiation is applied (accoding to 5.44) the state is 2 t/2 ÿ j jí ÿ ÿ s0 A 2fii sj B 2fii sk x k ( mod N)Í (5.46) afte measuing second egiste the state is S T ÿ U2 t/2 ÿ 3 4 2fii sj 2fii sk jív x k ( mod N)Í (5.47) s0 j and afte the invese Quantum Fouie Tansfomation ÿ s/í 2fii sk x k ( mod N)Í. (5.48) s0 Then we use the so-called continued faction ansion algoithm to find, i.e. a 0 + a + (5.49) a 2 + a 3... Fo example if s/ 32 0+6 +8 0+4 +2 + 0 0.000 22 64 64 (5.50) then and thus Anothe example 22 64 2+ 20 22 2+ + 0 3 (5.5) 3. (5.52) s/ 32 0+6 +8 0+4 0+2 + 0.000 9 64 64 (5.53) then 9 64 3+ 7 9 3+ 2+ 5 7 3+ 2+ + 2 5 3+ 2+ + 2+ 2 8 27 (5.54)
CHAPTER 5. QUANTUM FOURIER TRANSFORM 60 and 27. (5.55) Since the value of s/ is only appoximate, the algoithm might fail but it is easy to veify fo a given if x ( mod N). (5.56) The most impotant application of Sho s algoithm is fo factoing of lage numbes N (into pime factos). Hee is how it woks:. If N is even output the facto 2. Uses O() steps. 2. Seach though all possible a Ø and b Ø 2 to detemine if N a b.if so, output a (pehaps b times). Uses O(n 3 ) steps. 3. Choose a andom x in the ange < x < N and (using Euclid s algoithm) find the geatest common diviso of x and N (o gcd(x, N)). If gcd(x, N) > then output it. Uses O(n) steps. 4. Use Sho s algoithm to find the ode of x modulo N, i.e. smallest such that x ( mod N). 5. If is even and x /2 N ( mod N) (both of which happen with pobability O()) then compute gcd(x /2,N) and gcd(x /2 +,N) to see if any of these give us a non-tivial facto of N, Uses O(n 3 ) steps. x x /2 2 x /2 + 2 N 0( mod N)