
124 CHAPTER III. QUANTUMQuantum algorithms COMPUTATION33 Figure 1.19. Quantum circuit implementing Deutsch’s algorithm. Figure III.22: Quantum circuit for Deutsch algorithm. [fig. from Nielsen & Chuang (2010)] is sent through two Hadamard gates to give 0 + 1 0 1 ψ1 = | i | i | i| i . (1.42) | i p p D Quantum algorithms 2 2 A little thought shows that if we apply Uf to the state x ( 0 1 )/p2thenweobtain f(x) p | i | i| i D.1the state Deutsch-Jozsa ( 1) x ( 0 1 )/ algorithm2. Applying Uf to ψ1 therefore leaves us with one of two possibilities:− | i | i| i | i D.1.a Deutsch’s algorithm0 + 1 0 1 | i | i | i| i if f(0) = f(1) p p 8 ± 2 2 In this section youψ = will encounter your first example of a quantum algorithm(1.43) 2 that can compute| i faster than0 a1 classical0 1 algorithm for the same problem. < | i| i | i| i if f(0) = f(1). This is a simplified version± ofp Deutsch’s2 p original2 algorithm,6 which shows how itThe is possible final Hadamard to extract gate: global on the first information qubit thus about gives us a function by using quantum 8 parallelism and interference (Fig.0 III.22).1 0 | i| i if f(0) = f(1) Suppose we have a function f p: 2 2,asinSec.C.5.Thegoalisto 8 ±| i 2 ! determine whetherψf(0)= = f(1) with asingle function evaluation. This(1.44) is 3 | i 0 1 not a very interesting problem< 1 (since| i| therei areif f only(0) = fourf(1). such functions), but ±| i p 6 it is a warmup for the Deutsch-Jozsa 2 algorithm. Simple as it is, it could be expensiveRealizing that to decidef(0) f on(1) ais 0classical if f(0) = computer.f(1) and 1 otherwise, For example, we can rewrite suppose thisf result(0) = ⊕ : theconcisely billionth as bit of ⇡ and f(1) = the billionth bit of e.Thentheproblemis to decide if the billionth bits of ⇡ and e are0 the1 same. It is mathematically ψ3 = f(0) f(1) | i| i , (1.45) simple, but computationally| i ±| complex.⊕ i p 2 soTo by see measuring how we the might first qubit solve we this may problem, determine supposef(0) f(1). we This have is a very quantum interesting gate ⊕ arrayindeed:Uf thefor quantumf;thatis, circuitUf hasx giveny = usx they abilityf(x to) determine.Inparticular, a global propertyUf x 0of= f(x), namely f(0) f(1), using| onlyi| ione evaluation| i| ⊕ of f(xi)! This is faster than is possible| i| i with8This a classical is the 1998 apparatus,⊕ improvement which would by Cleve require et al. at to least Deutsch’s two evaluations. 1985 algorithm (Nielsen & Chuang,This 2010, example p. 59). highlights the difference between quantum parallelism and classical randomized algorithms. Naively, one might think that the state 0 f(0) + 1 f(1) | i| i | i| i corresponds rather closely to a probabilistic classical computer that evaluates f(0) with probability one-half, or f(1) with probability one-half. The difference is that in a classical computer these two alternatives forever exclude one another; in a quantum computer it is D. QUANTUM ALGORITHMS 125 x f(x) and Uf x 1 = x f(x) . Usually we set y =0togettheresult |fi(|x) ,buthereyouwillseeanapplicationinwhichwewanti | i| i | i|¬ i y =1. | i Now consider the result of applying Uf to x in the data register and to the superposition = 1 ( 0 1 )inthetargetregister.| i |i p2 | i| i 1 1 1 Uf x = x f(x) x f(x) = x [ f(x) f(x) ]. | i|i p2| i| ip2| i|¬ i p2| i | i|¬ i Now the rightmost square bracket is 0 1 if f(x)=0or 1 0 if f(x)=1.Therefore,wecanwrite | i| i | i| i 1 f(x) f(x) Uf x = x ( ) ( 0 1 )=( ) x . (III.21) | i|i p2| i − | i| i − | i|i [Here, ( )x is an abbreviation for ( 1)x when we want to emphasize that − − f(x) the sign is all that matters.] Since Uf x =( ) x ,theresultof applying it to an equal superposition of| xi|=0andi −x =1is:| i|i 1 1 U x = ( )f(x) x . p f | i|i p − | i|i 2 x 2 2 x 2 X2 X2 If f is a constant function, then f(0) = f(1), and the summation is 1 ( 0 + ± p2 | i 1 ) = + because both components have the same sign.. On the other| i |i hand,±| if if|i(0) = f(1), then the summation is 1 ( 0 1 ) = 6 ± p2 | i| i |i because the components have opposite signs. That is, a constant function±|i|i gives the 0 and 1 components of the data qubit the same phase, and otherwise gives| i them| thei opposite phase. Therefore, we can determine whether the function is constant or not by measuring the first qubit in the sign basis; we get + if f(0) = f(1) and otherwise. With this background, we can state Deutsch’s| i algorithm. |i algorithm Deutsch: Initial state: Begin with the qubits def= 01 . | 0i | i Superposition: Transform it to a pair of superpositions def 1 1 1 = ( 0 + 1 ) ( 0 1 )= + . (III.22) | i p2 | i | i ⌦ p2 | i| i | i 126 CHAPTER III. QUANTUM COMPUTATION by a pair of Hadamard gates. Recall that H 0 = 1 ( 0 + 1 )= + and | i p2 | i | i | i H 1 = 1 ( 0 1 )= . | i p2 | i| i |i Function application: Next apply U to = + . As we’ve seen, f | 1i | i Uf x 0 = x 0 f(x) = x f(x) ,andUf x 1 = x 1 f(x) = x | if| (ix) .Therefore,expandEq.III.22andapply| i| ⊕ i | i| i | i|Ui: | i| ⊕ i | i|¬ i f def= U | 2i f | 1i 1 1 = Uf ( 0 + 1 ) ( 0 1 ) p2 | i | i ⌦ p2 | i| i 1 = [U 00 U 01 + U 10 U 11 ] 2 f | i f | i f | i f | i 1 = [ 0,f(0) 0, f(0) + 1,f(1) 1, f(1) ] 2 | i| ¬ i | i| ¬ i There are two cases: f(0) = f(1) and f(0) = f(1). 6 Equal (constant function): If f(0) = f(1), then 1 = [ 0,f(0) 0, f(0) + 1,f(0) 1, f(0) ] | 2i 2 | i| ¬ i | i| ¬ i 1 = [ 0 ( f(0) f(0) )+ 1 ( f(0) f(0) )] 2 | i | i|¬ i | i | i|¬ i 1 = ( 0 + 1 )( f(0) f(0) ) 2 | i | i | i|¬ i 1 = ( 0 + 1 )( 0 1 ) ±2 | i | i | i| i 1 = ( 0 + 1 ) ±p2 | i | i |i = + . | i The last line applies because global phase (including )doesn’tmatter. ± Unequal (balanced function): If f(0) = f(1), then 6 1 = [ 0,f(0) 0, f(0) + 1, f(0) 1,f(0) ] | 2i 2 | i| ¬ i | ¬ i| i D. QUANTUM ALGORITHMS 127 1 = [ 0 ( f(0) f(0) )+ 1 ( f(0) f(0) )] 2 | i | i|¬ i | i |¬ i| i 1 = [ 0 ( f(0) f(0) ) 1 ( f(0) f(0) )] 2 | i | i|¬ i −| i | i|¬ i 1 = ( 0 1 )( f(0) f(0) ) 2 | i| i | i|¬ i 1 = ( 0 1 )( 0 1 ) ±2 | i| i | i| i 1 = ( 0 1 ) ±p2 | i| i |i = |−−i Clearly we can discriminate between the two cases by measuring the first qubit in the sign basis. In particular, note that in the unequal case, the 1 component has the opposite phase from the 0 component. | i | i Measurement: Therefore we can determine whether f(0) = f(1) or not by measuring the first bit of 2 in the sign basis, which we can do with the Hadamard gate (recall H +| =i 0 and H = 1 ): | i | i |i | i def=(H I) | 3i ⌦ | 2i 0 , if f(0) = f(1) = ±|1i|i, if f(0) = f(1) ⇢ ±| i|i 6 = f(0) f(1) . ±| ⊕ i|i ⇤ Notice that the information we need is in the data register, not the target register. This technique is called phase kick-back (i.e., kicked back into the phase of the data register). In conclusion, we can determine whether or not f(0) = f(1) with a single evaluation of f,whichisquiteremarkable.Ine↵ect,weareevaluatingf on asuperpositionof 0 and 1 and determining how the results interfere with each other. As a result| i we| geti a definite (not probabilistic) determination of aglobalpropertywithasingleevaluation. This is a clear example where a quantum computer can do something faster than a classical computer. However, note that Uf has to uncompute Quantum algorithms 35 128 CHAPTER III. QUANTUM COMPUTATION Figure 1.20. Quantum circuit implementing the general Deutsch–Jozsa algorithm. The wire with a ‘/’ through it Figurerepresents III.23: a set of n Quantumqubits, similar circuitto the common for engineering Deutsch-Jozsa notation. algorithm. [fig. from NC] evenly weighted superposition of 0 and 1. Next, the function f is evaluated (by Bob) f,whichtakesasmuchtimeascomputingit,butwewillseeothercasesusing Uf : x, y x, y f(x) ,giving | i!| ⊕ i (Deutsch-Jozsa) where the speedup is much more than 2 . ( 1)f(x) x 0 1 ⇥ ψ2 = − | i | i| i . (1.48) n | i x p2 p2 X D.1.bAlice nowThe has Deutsch-Jozsaa set of qubits in which algorithm the result of Bob’s function evaluation is stored Thein the Deutsch-Jozsa amplitude of the algorithm qubit superposition is a generalization state. She now of interferes the Deutsch terms algorithmin the super- to position using a Hadamard transform on the query register. To determine the result of n bits,the Hadamard which they transform published it helps it to in first 1992; calculate here the we effect present of the the Hadamard improved transform version ofon Nielsen a state &x .Bycheckingthecases Chuang (2010, p.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages42 Page
-
File Size-