Grover s Algorthm + Quantum Zeno Effect + Vadman CS 294-2 Bomb 10/12/04 Fall 2004 Lecture 11 Grover s algorthm Recall that Grover s algorthm for searchng over a space of sze wors as follows: consder the two dmensonal subspace that conssts of two states: the target state a and ψ 0 x 1 x Start wth the state ψ 0, and repeat for O( () steps: reflect about a and then reflect about ψ 0 To mplement the reflecton about ψ 0, we use the Dffuson operator D (assume 2 n ), whch wors as follows Frst, apply H 2 n, whch maps ψ 0 000 Then reflect around 000 Fnally, apply H 2 n to return to the orgnal bass (ote that ths s smply a reflecton around the zero vector n the Hadamard bass) Let s wrte out ths dffuson operator explctly to gve another way of understandng Grover s algorthm: Clam: The Dffuson operator D has two propertes: 1 It s untary and can be effcently realzed 2 It can be seen as an nverson about the mean Proof: 1 For 2 n, D can be decomposed and rewrtten as: D 1 0 0 0 1 0 H H 0 0 1 2 0 0 H + I H 2 0 0 H H + I 2/ 2/ 2/ 2/ 2/ 2/ + I 2/ 2/ 2/ CS 294-2, Fall 2004, Lecture 11 0-1
2/ + 1 2/ 2/ 2/ 2/ + 1 2/ 2/ 2/ 2/ + 1 Observe that D s expressed as the product of three untary matrces (two Hadamard matrces separated by a condtonal phase shft matrx) Therefore, D s also untary Regardng the mplementaton, both the Hadamard and the condtonal phase shft transforms can be effcently realzed wthn O(n) gates 2 Consder D operatng on a vector α to generate another vector β : D α 1 α If we let be the mean ampltude, then the expresson 2 descrbes a reflecton of about the mean Thus, the ampltude of β 2 j α j + 2 + can be consdered an nverson about the mean wth respect to β 1 β β The quantum search algorthm teratvely mproves the probablty of measurng a soluton Here s how: 1 Start state s ψ 0 x 1 x 2 Invert the phase of a usng f 3 Then nvert about the mean usng D 4 Repeat steps 2 and 3 O( ) tmes, so n each teraton α a ncreases by 2 Ths process s llustrated n Fgure 01 Suppose we just want to fnd a wth probablty 2 1 Untl ths pont, the rest of the bass vectors wll have ampltude at 1 least 2 2 In each teraton of the algorthm, α a ncreases by at least 2 2 Eventually, α a 1 2 The number of teratons to get to ths α a s More applcatons Grover s algorthm s often called a database search algorthm, where you can query n superposton Other thngs you can do wth a smlar approach: 1 Fnd the mnmum 2 Approxmately count elements, or generate random ones 3 Speed up the collson problem 4 Speed up the test for matrx multplcaton In ths problem we are gven three matrces, A, B, and C, and are told that the product of the frst two equals the thrd We wsh to verfy that ths s ndeed true An effcent (randomzed) way of dong ths s pcng a random array r, and checng to see whether Cr ABr A(Br) Classcally, we can do the chec n O(n 2 ) tme, but usng a smlar approach to Grover s algorthm we can speed t up to O(n 175 ) tme CS 294-2, Fall 2004, Lecture 11 0-2
(a) (b) (c) Fgure 01: The frst three steps of Grover s algorthm We start wth a unform superposton of all bass vectors n (a) In (b), we have used the functon f to nvert the phase of α After runnng the dffuson operator D, we amplfy α whle decreasng all other ampltudes CS 294-2, Fall 2004, Lecture 11 0-3
φ 0 R θ 0 U M R θ 0 U M Fgure 02: Ths fgure shows the crcut used for fndng a bomb There are steps, and n each step we rotate the control bt and run U Vadman s Bomb To llustrate some of the concepts behnd Grover s algorthm, we ll brefly consder a problem nown as Vadman s bomb In ths problem, we have a pacage that may or may not contan a bomb However, the bomb s so senstve that smply loong to see f the bomb exsts wll cause t to explode So, can we determne whether the pacage contans a bomb wthout settng t off? Paradoxcally, quantum mechancs says that we can In partcular, we wll demonstrate that there s a sequence of measurements such that f the pacage contans a bomb, we wll loo wth probablty 1/, and f the pacage does not contan a bomb, we wll loo wth certanty The Quantum Zeno Effect To acheve ths goal, we ll tae advantage of a phenomenon nown as the Quantum Zeno Effect (also referred to as the watched pot or the watchdog effect) Consder a quantum state consstng of a sngle qubt Ths qubt starts at 0, and at every step we wll rotate t toward 1 by θ π/2 After one rotaton, we have φ α 0 + β 1, where β sn θ 1/ After steps, the state wll be 1, so any measurement wll return 1 wth hgh probablty ow what f we decde to measure the state after each rotaton? After the frst rotaton, we wll measure 0 wth hgh probablty, but ths measurement collapses the state bac to 0 Thus, each measurement has a hgh probablty of yeldng 0 ; the probablty of gettng 1 by the end s approxmately 1 1 2, as opposed to the extremely hgh probablty n the prevous case Essentally, the Quantum Zeno Effect says that f we have a quantum state that s n transton toward a dfferent state, mang frequent measurements can delay that transton by repeatedly collapsng the qubt bac to ts orgnal state Loong for the Bomb To determne whether Vadman s bomb exsts wthout actually loong at t, we want to tae advantage of the Quantum Zeno Effect We ll have a control qubt that ndcates whether or not we plan to loo at the contents of the pacage, and we ll have a measurement that collapses ths qubt bac to 0 n the case that a bomb s present We ll assume that we have a devce that can measure whether a bomb s present We wll model ths devce as a quantum crcut U that has one nput (the control qubt φ ) and one output (a qubt that s 1 f a bomb s defntely present) If there s no bomb, then U maps φ 0 φ 0 ; n other words, U behaves as the dentty If there s a bomb, then U maps 0 0 0 0 (there s a bomb, but we ddn t loo) and 1 0 1 1 (we looed at the bomb); that s, U behaves as a COT gate We want to fgure out whether there s a bomb (e, we want to test U s behavor) wthout settng off the bomb very often Fgure 02 shows the crcut we wll use We ntalze the control qubt φ to 0 In each step of the algorthm, we rotate the control qubt toward 1 by θ and then run U; we ll execute the algorthm for steps Consder the case where there s no bomb; our ntal nput s 0 0 If we rotate the control qubt by θ, the nput to the frst U gate s (α 0 +β 1 ) 0, and the output of U s the same state (snce U s the dentty) Measurng the output qubt always returns 0 and doesn t alter the state; thus, each step rotates the qubt further untl β 1 at the last measurement ow consder the case where there s a bomb Once agan, our ntal nput s 00 After the frst rotaton, the nput to CS 294-2, Fall 2004, Lecture 11 0-4
U s (α 0 +β 1 ) 0, and the output of U s α 0 0 +β 1 1 When we measure the last qubt, we have a β 2 1/ 2 probablty of loong at the bomb and settng t off Otherwse, we measure 0 for the output qubt, whch means we ddn t loo at the bomb However, ths measurement collapses the state bac to 0 0 Thus, subsequent steps n the algorthm wll smply repeat ths process Overall, we only have a β 2 1/ chance of actually loong at the bomb Vadman and Grover To see the relatonshp to Grover s algorthm, consder a partcularly unfortunate case where we have pacages, 1 of whch contan bombs We want to fnd the one pacage that does not contan a bomb, though we don t mnd settng off a few of the bombs n the process Grover s algorthm has a property smlar to Vadman s method where the ampltude of one target bass vector s amplfed whle all others are constantly dmnshed or reset The mportant thng to note s that t s hghly counterntutve to be able to search n steps By queryng n superposton, we manage to search usng fewer steps than there are locatons to search! CS 294-2, Fall 2004, Lecture 11 0-5