Chapte 3 Othe uatum agoithms 3. Quick emide of Gove s agoithm We peset hee a uick emide of Gove s agoithm. Iput: a fuctio f : {0,}! {0,}. Goa: fid x such that f (x) =. Seach pobem We have a uatum access to f i.e. we have access to the uatum uitay O f satisfyig: 8x {0,}, O f ( xi 0i) = xi f (x)i. Gove s agoithm: if thee ae T soutios, fids oe with O( eo( T Time(f )) whee we use the otatio eo(b()) = O Gove s agoithm T ) cas to O f ad i time fo ay b(). b() poyog(b()). Ceate the state i=o P f / x{0,} xi 0i = p P x{0,} xi f (x)i.. Decompose ito the good x ad bad x (eca thee ae T soutios). i= = T X x:f (x)= p xi f (x)i+ T X T x:f (x)=0 xi f (x)i T {z } Good i Bad i {z } T Goodi+ T Badi 3. Ateate the foowig opeatios to tasfom i ito a state cose to Good i Phase fip ove f (x) egiste: O Z ( xi f (x)i=( ) f (x) xi f (x)i. Refexio ove i: Ref i( i) = i ; Ref i(? i) = i? fo ay i? othogoa to i. 4. Geometica itepetatio i the subspace { Good i, Bad i}. 0
O Z is a efexio ove Bad i. Ref i is a efexio ove i. O Z ± Ref i is a µ coute cockwise otatio whee cos(µ):=h Bad i h Bad i= T T so µ º whe T ø. 5. Pefom this otatio µ times to be cose to Goodi. Pictuig the agoithm... 3. Phase estimatio Ou fist potoco is a diect appicatio of the uatum Fouie tasfom. Phase estimatio Iput: a uatum uitay U actig o ubits. A eigevecto i of U with eigevaue give as a uatum state. Goa: output. Reca that a eigevecto i of U with eigevaue meas that U( i) = i. Because U is a uitay, = so we ca wite = e iº fo some ea umbe [0,) ([0,[ i Fech otatio). We assume fist that ca be fuy descibed with bits of pecisio, i.e. thee exists a atua umbe C such that = C. We coside a uatum uitay Q satisfyig Q( ki i) = kiu k ( i). fo ay k {0,..., } ad ay state i. We pefom the foowig agoithm:
. Stat fom 0i i ad appy F o the fist egiste. The esutig state is. Appy Q o both egistes. X p ki i. X p U k ki i= p X k ki i = p X e iºkc ki i. 3. Appy the ivese Fouie tasfom F o the fist egiste. The esutig state is Ci i. It is the easy to ecove fom C. Geea case If caot be witte with bits of pecisio, we coside the cosest appoximatio of of the fom C. A eo aaysis (ot detaied hee) shows that the above pocedue wi fid this C with pobabiity at east 4 º. By pefomig sevea iteatios of this pocedue, we ca fid the coect C, i.e. a good appoximatio of with a pobabiity that expoetiay coveges to i the umbe of iteatios. Efficiecy of the agoithm If U ca be computed efficiety ad if, fo ay k {0,..., }, U k ca be computed efficiety the Q ca be computed efficiety ad the whoe agoithm is efficiet. This meas that if we wat ou agoithm to u i time poy() (assumig U ca be computed i time poy()), we have to take = O(og()). 3.. Appicatio : Coutig agoithm Iput: a fuctio f : {0,}! {0,}. Goa: output T = {x : f (x) = }. Seach pobem Desciptio of the agoithm: coside the state i ad the opeatios Ref i ad O Z fom the Gove s agoithm sectio (Sectio 3.) ad et U = O Z ±Ref i. Fom the aaysis of Gove s agoithm, U is a µ coute cockwise otatio i the basis { Bad i, Good i} with µ = accos(h Bad i) = accos( T ). µ cos(µ) si(µ) We ca theefoe wite U = i this basis. si(µ) cos(µ) U has eigevaues e 0 i= p Bad i+i Good i ad e i= p Bad i i Good i with espective eigevaues e iº(µ) ad e iº(µ). Take the state T i= Goodi+ T Badi = Æ e i+ø e i fo some Æ,Ø C which is efficiety computabe. What happes whe we appy the phase estimatio agoithm o i ad U? We, i is ot a eigestate of U but a supepositio of its eigestates. The agoithm wi
output µ (actuay º µ) with pobabiity Æ ad µ with pobabiity Ø. We ca easiy distiguish betwee the cases ad aways output the good vaue fo µ. Fom thee, usig the eatio betwee µ ad T, we ca ecove T. If we wat a agoithm uig i poy() the we ca do this up to a additive eo of poy() i the age µ we fid. 3.. Appicatio : Fouie tasfom F fo ay I Chapte, we showed how to pefom the Fouie tasfom F whe = fo some. Hee, we show how to pefom the Fouie tasfom fo ay. F wi act o a uatum egiste that ca take vaues fom 0 to ad 8k {0,..., }, F ( ki) = p X! k i. whee! := e iº. Let U ad U two uitaies that do the foowig, 8k {0,..., }. U ( ki 0i) = kif ( ki) ; U (F ki 0i) = F ( ki) ki. Fom those two uitaies, we ca pefom F as foows SW AP ki 0i U! kif ( ki)! F ( ki) ki U! F ( ki) 0i. what is eft to show is how to pefom U ad U. U ca be pefomed uite easiy. Let S a uatum uitay such that S ( 0i) = p P i. Sice is ot a powe of, S caot be expessed as Hadamads but we ca sti easiy costuct such a uitay. Let aso O mut satisfyig O mut ( ki i 0i) = ki i k mod i. Let s ow costuct U.. Stat fom ki 0i 0i ad appy S o the secod egiste. The esutig state is. Appy O mut o the thee egistes. kip X i 0i. kip X i k mod i. 3. Appy the uitay xi!! x xi o the thid egiste. 4. Appy O o the thee egistes. We obtai mut kip X! k i k mod i. kip X! k i 0i= kif ( ki) 0i. 3
Swappig egistes is the easy. What is eft to do is to pefom uitay U. We coside the uitay O add such that O add ( ki) = k + mod i. The idea is that F ( ki) is a eigevecto of O add with eigevaue k ad that it wi be easy to ecove k fom k. Doig this i a coheet way wi give U. Fist see that O add F ( ki) = p X! k + mod i=! k X p! k i which meas that F ( ki) is a eigevecto of O add with eigevaue! k =! k. If we appy the phase estimatio fom the pevious sectio, with =dog()e, we obtai F ( ki) 0i Phase Estimatio with O add! F ( ki) ki. Which by appyig xi! xi gives the coect esut. Actuay, the phase estimatio wi oy give k with some (high) pobabiity so this whoe pocess wi costuct a appoximatio of U. Puttig eveythig togethe, we maaged to costuct F ( ki). This uitay has may appicatios, fo exampe fo the Discete Log uatum agoithm. 3.3 Coisio agoithm Coisio pobem Iput: a adom fuctio f : {0,}! {0,}. Goa: fid (x, y) such that f (x) = f (y). Because f is adom, may such coupes. Cassica agoithm. Pick a paamete. Pick a adom subset I µ {0,} of size. Costuct the ist L = {f (i)} ii ad sot it.. Compute f (x) fo adom vaues x I uti we fid f (x) L. Sice f is adom, this takes aveage time fo each x tested this way. This agoithm uses the we kow bithday paadox. The fist step takes time O( og( ) ad the secod oe O( og( ) ). By takig = /, we have a agoithm uig i time O(poy() / ). We exted this to the uatum settig The BHT Agoithm. Pick a paamete. Pick a adom subset I µ {0,} of size. Costuct the ist {f (i)} ii.. Let g : {0,}! {0,} satisfyig g (x) =, x I ad 9i I, f (x) = f (i). º soutios whe ø. 3. Appy Gove o g.fidy such that g (y) =. 4. Fid i I st. f (i) = f (y). Output (i, y). 4
3.3. Time aaysis of BHT Fo simpicity, Time(f ) = ad we igoe eo. List ceatio: time. Gove o g. We defie i= P / x{0,} xi g (x)i QTime = + 0 B C @QTime(Ref i) + {z} A. Ref Bad i Reca that if we have a uitay U( 0i) = i the we ca costuct Ref i usig U twice ad a phase fip. If QTime(Ref i) = the take = /3 ad the tota uig time of the agoithm is /3 (as good as adom waks). If we ae iteested i uey compexity, i.e. the cas to O f the we ca sove the pobem the coisio pobem with eo( /3 ) ueies to O f. Ambaiis showed that it is aso possibe to do this i ea uatum time eo( /3 ) (with a adeuate uatum data stuctue). 5