C.2 Quantum Gates
Total Page:16
File Type:pdf, Size:1020Kb
Quantum computation 21 104 CHAPTER III. QUANTUM COMPUTATION = = NOT = = AND > > (a) (b) = = = OR > = XOR > > > (c) (d) = (e) = NAND > = > = (f) = NOR > = > Figure 1.6. On the left are some standard single and multiple bit gates, while on the right is the prototypical Figuremultiple III.9: qubit gate, Left: the controlled- classical gates..Thematrixrepresentationofthecontrolled- Right: controlled-Not gate., UCN [from,iswrittenwith Nielsen respect to the amplitudes for 00 , 01 , 10 ,and 11 ,inthatorder. & Chuang (2010, Fig.| 1.6)] | | | qubit. The action of the gate may be described as follows. If the control qubit is set to C.20, then Quantum the target qubit gatesis left alone. If the control qubit is set to 1, then the target qubit is flipped. In equations: Quantum gates are analogous to ordinary logic gates (the fundamental build- ing blocks of circuits),00 00 but; 01 they must01 ; 10 be unitary11 ; 11 transformations10 . (see(1.18) Fig. III.9, left, for ordinarty| i!| i logic| i! gates).| i | Fortunately,i!| i | i! Bennett,| i Fredkin, and ToAnother↵oli have way already of describing shown the howis all as the a generalization usual logic of the operations classical cangate, be since done reversibly.the action Inof the this gate section may be you summarized will learn as A, the B mostA, important B A ,where quantumis addition gates. modulo two, which is exactly what the gate| does.i! That| is,⊕ thei control qubit⊕ and the C.2.atarget qubitSingle-qubit are ed and gates stored in the target qubit. Yet another way of describing the action of the is to give a matrix represen- Thetation, NOT as showngate is in simple the bottom because right of it Figure is reversible: 1.6. You canNOT easily0 verify= 1 , that NOT the1 first= | i | i | i 0 column.Itsdesiredbehaviorcanberepresented: of UCN describes the transformation that occurs to 00 ,andsimilarlyforthe | iother computational basis states, 01 , 10 ,and 11 . As for| thei single qubit case, the | i | i | i requirement that probability beNOT conserved : is0 expressed1 in the fact that U is a unitary | i 7! | i CN matrix,thatis,UCN† UCN = I. 1 0 . We noticed that the can be regarded| i 7! as a type| i of generalized- gate. Can Noteother that classical defining gates such it on as a the basis definesor the regular it on all quantumgate be understood states. Thereforeas unitary it cangates be in awritten sense similar as a sumto the of way dyads the quantum (outer products):gate represents the classical gate? It turns out that this is not possible. The reason is because the and gates are essentially irreversible or non-invertibleNOT = 1 .Forexample,giventheoutput0 + 0 1 . A B from | ih | | ih | ⊕ an gate, it is not possible to determine what the inputs A and B were; there is an You can read this, “return 1 if the input is 0 ,andreturn 0 if the input irretrievable loss of information associated with the irreversible action of the gate. is 1 .” Recall that in the| standardi basis 0| i=(10)T and| i1 =(01)T. On| i the other hand, unitary quantum gates are always| i invertible, since the| i inverse of a unitary matrix is also a unitary matrix, and thus a quantum gate can always be inverted by another quantum gate. Understanding how to do classical logic in this reversible or invertible sense will be a crucial step in understanding how to harness the power of C. QUANTUM INFORMATION 105 Therefore NOT can be represented in the standard basis by computing the outer products: 0 1 00 01 01 NOT = (1 0) + (0 1) = + = . 1 0 10 00 10 ✓ ◆ ✓ ◆ ✓ ◆ ✓ ◆ ✓ ◆ The first column represents the result for 0 ,whichis 1 ,andthesecond represents the result for 1 ,whichis 0 . | i | i Although NOT is defined| i in terms| ofi the computational basis vectors, it applies to any qubit, in particular to superpositions of 0 and 1 : | i | i NOT(a 0 + b 1 )=aNOT 0 + bNOT 1 = a 1 + b 0 = b 0 + a 1 . | i | i | i | i | i | i | i | i Therefore, NOT exchanges the amplitudes of 0 and 1 . In quantum mechanics, the NOT transformation| i is| i usually called X.It is one of four useful unitary operations, called the Pauli matrices,whichare worth remembering. In the standard basis: def def 10 I = σ = (III.10) 0 01 ✓ ◆ def def def 01 X = σ = σ = (III.11) x 1 10 ✓ ◆ def def def 0 i Y = σ = σ = (III.12) y 2 i 0 ✓ − ◆ def def def 10 Z = σ = σ = (III.13) z 3 0 1 ✓ − ◆ We have seen that X is NOT, and I is obviously the identity gate. Z leaves 0 unchanged and maps 1 to 1 . It is called the phase-flip operator because| i it flips the phase of the| i 1 −component| i by ⇡ relative to the 0 component. (Recall that global/absolute| i phase doesn’t matter.) The Pauli| matricesi span the space of 2 2 complex matrices (Exer. III.18). Note that Z⇥+ = and Z = + .Itisthustheanaloginthesign basis of X (NOT)| i in the|i computational|i | basis.i What is the e↵ect of Y on the computational basis vectors? (Exer. III.12) Note that there is an alternative definition of Y that di↵ers only in global phase: def 01 Y = . 10 ✓ − ◆ 106 CHAPTER III. QUANTUM COMPUTATION This is a 90◦ = ⇡/2counterclockwiserotation:Y (a 0 + b 1 )=b 0 a 1 . Draw a diagram to make sure you see this. | i | i | i | i Note that the Pauli operations apply to any state, not just basis states. The X, Y ,andZ operators get their names from the fact that they reflect state vectors along the x, y, z axes of the Bloch-sphere representation of a qubit, which we will not use in this book. Since they are reflections, they are Hermitian (their own inverses). C.2.b Multiple-qubit gates We know that any logic circuit can be built up from NAND gates. Can we do the same for quantum logic, that is, is there a universal quantum logic gate? We can’t use NAND, because it’s not reversible, but we will see that there are universal sets of quantum gates. The controlled-NOT or CNOT gate has two inputs: the first determines what it does to the second (negate it or not). CNOT : 00 00 | i 7! | i 01 01 | i 7! | i 10 11 | i 7! | i 11 10 . | i 7! | i Its first argument is called the control and its second is called the target, controlled,ordata qubit. It is a simple example of conditional quantum computation. CNOT can be translated into a sum-of-dyads representation (Sec. A.2.d), which can be written in matrix form (Ex. III.21, p. 194): CNOT = 00 00 | ih | + 01 01 | ih | + 11 10 | ih | + 10 11 | ih | We can also define it (for x, y 2), CNOT xy = xz ,wherez = x y, the exclusive OR of x and y. That2 is, CNOT| ix, y | = i x, x y CNOT⊕ is the only non-trivial 2-qubit reversible logic gate.| Notei that| CNOT⊕ i is unitary since obviously CNOT = CNOT† (which you can show using its dyadic representation or its matrix representation, Ex. III.21, p. 194). See the right Introduction to Quantum Computing 15 · gates are unitary. For example 0 1 01 YY = = I. ⇤ 10− 10 ✓ ◆✓− ◆ The controlled-NOT gate, Cnot,operatesontwoqubitsasfollows:itchangesthesecond bit if the first bit is 1 and leaves this bit unchanged otherwise. The vectors 00 , 01 , 10 ,and 11 form an orthonormal basis for the state space of a two-qubit system,| i | a 4i- dimensional| i | complexi vector space. In order to represent transformations of this space in matrix notation we need to choose an isomorphism between thisspaceandthespaceof complex four tuples. There is no reason, other than convention, to pick one isomorphism over another. The one we use here associates 00 , 01 , 10 ,and 11 to the standard 4- T T | T i | i | i T | i tuple basis (1, 0, 0, 0) , (0, 1, 0, 0) , (0, 0, 1, 0) and (0, 0, 0, 1) ,inthatorder.TheCnot transformation has representations Cnot : 00 00 1000 |01i!|01i 0100 . |10i!|11i 0 00011 | i!| i 11 10 B 0010C | i!| i B C @ A The transformation Cnot is unitary since Cnot⇤ = Cnot and CnotCnot = I.TheCnot gate cannot be decomposed into a tensor product of two single-bit transformations. It is useful to have graphical representations of quantum state transformations, especially when several transformations are combined. The controlled-NOT gate Cnot is typically represented by a circuit of the form . b ⇥ The open circle indicates the control bit, and the indicates the conditional negation of the subject bit. In general there can be multiple control⇥ bits. Some authors use a solid circle to indicate negative control, in which the subject bit is toggled when the control bit is 0. Similarly, the controlled-controlled-NOT,whichnegatesthelastbitofthreeifandonly if the first two are both 1,hasthefollowinggraphicalrepresentation. C. QUANTUM INFORMATION 107 b b ⇥ Figure III.10: Diagram for CCNOT or To↵oli gate [fig. from Nielsen & Single bit operationsChuang are (2010)]. graphically Sometimes the representedis replaced by because by appro CCNOTpriatelyxyz = labelled boxes as x, y, xy z . ⇥ ⊕ | i shown. | ⊕ i panel of Fig. III.9 (p. 104) for the matrix and note the diagram notation for CNOT. Y CNOT can be used to produce an entangled state: 1 1 1 CNOT ( 0 + 1 ) 0 = CNOT ( 00 + 10 )= ( 00 + 11 )= β00 . p2 | i | i | i Zp2 | i | i p2 | i | i | i Note also that CNOT x, 0 = x, x , that is, FAN-OUT, which would seem to violate the No-cloning| Theorem,i | i but it works as expected only for x 2.