{"id":4070,"date":"2024-09-21T12:40:39","date_gmt":"2024-09-21T12:40:39","guid":{"rendered":"https:\/\/workhouse.sweetdishy.com\/?p=4070"},"modified":"2024-09-21T12:40:40","modified_gmt":"2024-09-21T12:40:40","slug":"multi-qubit-gates","status":"publish","type":"post","link":"https:\/\/workhouse.sweetdishy.com\/index.php\/2024\/09\/21\/multi-qubit-gates\/","title":{"rendered":"Multi-Qubit Gates"},"content":{"rendered":"\n<p>Two qubits together can be represented as 4-column vectors in Hilbert<\/p>\n\n\n\n<p>space. The most general 2-qubit gate is therefore a 4\u00d74 unitary. An operation<\/p>\n\n\n\n<p>on two qubits that acts independently on each of the two can be expressed as<\/p>\n\n\n\n<p>a direct product of two single-qubit operations as de\ufb01ned in Equation 3.31:<\/p>\n\n\n\n<p>O = O<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>\u2297 O<\/p>\n\n\n\n<p>2<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>For example, the 2-qubit H gate is represented by the action<\/p>\n\n\n\n<p>H<\/p>\n\n\n\n<p>\u22972<\/p>\n\n\n\n<p>|xi|yi = H|xi \u2297 H|yi, (7.14)<\/p>\n\n\n\n<p>with matrix representation<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>2<\/p>\n\n\n\n<p>&#8220;<\/p>\n\n\n\n<p>1 1<\/p>\n\n\n\n<p>1 \u22121<\/p>\n\n\n\n<p>#<\/p>\n\n\n\n<p>\u2297<\/p>\n\n\n\n<p>&#8220;<\/p>\n\n\n\n<p>1 1<\/p>\n\n\n\n<p>1 \u22121<\/p>\n\n\n\n<p>#<\/p>\n\n\n\n<p>=<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>2<\/p>\n\n\n\n<p>\uf8ee<\/p>\n\n\n\n<p>\uf8ef<\/p>\n\n\n\n<p>\uf8ef<\/p>\n\n\n\n<p>\uf8ef<\/p>\n\n\n\n<p>\uf8f0<\/p>\n\n\n\n<p>1 1 1 1<\/p>\n\n\n\n<p>1 \u22121 1 \u22121<\/p>\n\n\n\n<p>1 1 \u22121 \u22121<\/p>\n\n\n\n<p>1 \u22121 \u22121 1<\/p>\n\n\n\n<p>\uf8f9<\/p>\n\n\n\n<p>\uf8fa<\/p>\n\n\n\n<p>\uf8fa<\/p>\n\n\n\n<p>\uf8fa<\/p>\n\n\n\n<p>\uf8fb<\/p>\n\n\n\n<p>. (7.15)<\/p>\n\n\n\n<p>You need to distinguish between the di\ufb00erent possibilities shown in Figure<\/p>\n\n\n\n<p>7.4. The circuit diagrams for these gates will clarify the di\ufb00erence.<\/p>\n\n\n\n<p>H \u2297 H \u2297 H \u2297 H<\/p>\n\n\n\n<p>H H<\/p>\n\n\n\n<p>H<\/p>\n\n\n\n<p>H<\/p>\n\n\n\n<p>FIGURE 7.4: H gates acting in di\ufb00erent ways on two qubits.<\/p>\n\n\n\n<p>These sort of gates can easily be generalized to any dimensions.<\/p>\n\n\n\n<p>Exercise 7.9. Construct the matrix representations for the operators shown in<\/p>\n\n\n\n<p>Figure 7.4.<\/p>\n\n\n\n<p>Exercise 7.10. Find the matrix representing X \u2297 Z.<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"https:\/\/learning.oreilly.com\/api\/v2\/epubs\/urn:orm:book:9781482238129\/files\/bg99.png\" width=\"685\" height=\"830\"><\/p>\n\n\n\n<p>128 Introduction to Quantum Physics and Information Processing<\/p>\n\n\n\n<p>The interesting thing about multi-qubit gates is that in general, they would<\/p>\n\n\n\n<p>not act independently on the individual qubits, but entangle them. This is<\/p>\n\n\n\n<p>the hallmark of quantum information processing that gives the most crucial<\/p>\n\n\n\n<p>advantage over classical processing. For example, consider the most famous<\/p>\n\n\n\n<p>2-qubit gate, the controlled-NOT or CNOT gate whose classical version we<\/p>\n\n\n\n<p>saw in Chapter 6. This gate \ufb02ips the target qubit when the control qubit is set<\/p>\n\n\n\n<p>to 1. The truth table of the CNOT is used to de\ufb01ne the action of the quantum<\/p>\n\n\n\n<p>gate on the computational basis states:<\/p>\n\n\n\n<p>U<\/p>\n\n\n\n<p>CNOT<\/p>\n\n\n\n<p>=<\/p>\n\n\n\n<p>\uf8ee<\/p>\n\n\n\n<p>\uf8ef<\/p>\n\n\n\n<p>\uf8ef<\/p>\n\n\n\n<p>\uf8ef<\/p>\n\n\n\n<p>\uf8f0<\/p>\n\n\n\n<p>1 0 0 0<\/p>\n\n\n\n<p>0 1 0 0<\/p>\n\n\n\n<p>0 0 0 1<\/p>\n\n\n\n<p>0 0 1 0<\/p>\n\n\n\n<p>\uf8f9<\/p>\n\n\n\n<p>\uf8fa<\/p>\n\n\n\n<p>\uf8fa<\/p>\n\n\n\n<p>\uf8fa<\/p>\n\n\n\n<p>\uf8fb<\/p>\n\n\n\n<p>\u2261<\/p>\n\n\n\n<p>&#8220;<\/p>\n\n\n\n<p>0<\/p>\n\n\n\n<p>0 X<\/p>\n\n\n\n<p>#<\/p>\n\n\n\n<p>(7.16)<\/p>\n\n\n\n<p>Notice that the truth table for the second output corresponds to the well-<\/p>\n\n\n\n<p>known XOR operation on the inputs. The operation is, however, completely<\/p>\n\n\n\n<p>reversible. We denote the action of this gate by<\/p>\n\n\n\n<p>U<\/p>\n\n\n\n<p>CNOT<\/p>\n\n\n\n<p>|xi|yi = |xi|x \u2295 yi. (7.17)<\/p>\n\n\n\n<p>Note that when we use letters x and y to label quantum states, they refer to the<\/p>\n\n\n\n<p>computational basis states. This gate is represented by the circuit of Figure 7.5.<\/p>\n\n\n\n<p>An important caveat here: though the control qubit seems to come out of the<\/p>\n\n\n\n<p>|xi<\/p>\n\n\n\n<p>\u2022<\/p>\n\n\n\n<p>|xi<\/p>\n\n\n\n<p>|yi |x \u2295 yi<\/p>\n\n\n\n<p>FIGURE 7.5: CNOT gate.<\/p>\n\n\n\n<p>gate unchanged when it is in a computational basis state, the output will in<\/p>\n\n\n\n<p>general be entangled with the state of the target qubit, as we will see in the<\/p>\n\n\n\n<p>next example.<\/p>\n\n\n\n<p>Example 7.2.1. As an illustration of how a controlled gate acts on superpo-<\/p>\n\n\n\n<p>sition states, consider<\/p>\n\n\n\n<p>CN OT (\u03b1|0i + \u03b2|1i)|0i = CNOT (\u03b1|00i + \u03b2|10i)<\/p>\n\n\n\n<p>= \u03b1|00i + \u03b2|11i (7.18)<\/p>\n\n\n\n<p>which is an entangled state. Figure 7.6 gives the circuit for this process.<\/p>\n\n\n\n<p>\u03b1|0i + \u03b2|1i<\/p>\n\n\n\n<p>\u2022<\/p>\n\n\n\n<p>\u03b1|00i + \u03b2|11i<\/p>\n\n\n\n<p>|0i<\/p>\n\n\n\n<p>\uf8fc<\/p>\n\n\n\n<p>\uf8fd<\/p>\n\n\n\n<p>\uf8fe<\/p>\n\n\n\n<p>FIGURE 7.6: CNOT producing entanglement.<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"https:\/\/learning.oreilly.com\/api\/v2\/epubs\/urn:orm:book:9781482238129\/files\/bg9a.png\" width=\"685\" height=\"992\"><\/p>\n\n\n\n<p>Quantum Gates and Circuits 129<\/p>\n\n\n\n<p>This example also illustrates the No-cloning theorem of Chapter 4. The CNOT<\/p>\n\n\n\n<p>gate appears as a cloner if the target qubit is |0i:<\/p>\n\n\n\n<p>U<\/p>\n\n\n\n<p>CNOT<\/p>\n\n\n\n<p>|xi|0i = |xi|xi. (7.19)<\/p>\n\n\n\n<p>However, this is true i\ufb00 |xi is a computational basis state. If the control qubit<\/p>\n\n\n\n<p>is a generic quantum state |\u03c8i, the output of this gate is an entangled state.<\/p>\n\n\n\n<p>If our gate were a cloner, then the output ought to have been |\u03c8i\u2297|\u03c8i, which<\/p>\n\n\n\n<p>is a separable state.<\/p>\n\n\n\n<p>The notion of a conditional or controlled gate can be extended to any<\/p>\n\n\n\n<p>unitary single-qubit operation U by de\ufb01ning<\/p>\n\n\n\n<p>U<\/p>\n\n\n\n<p>CU<\/p>\n\n\n\n<p>|xi|yi = |xiU<\/p>\n\n\n\n<p>x<\/p>\n\n\n\n<p>|yi (7.20)<\/p>\n\n\n\n<p>The notation makes it obvious that the operator U acts on the target qubit |yi<\/p>\n\n\n\n<p>only if the control qubit is set to 1. Figure 7.7 shows the circuit representation<\/p>\n\n\n\n<p>for this action.<\/p>\n\n\n\n<p>|xi<\/p>\n\n\n\n<p>\u2022<\/p>\n\n\n\n<p>|xi<\/p>\n\n\n\n<p>|yi<\/p>\n\n\n\n<p>U<\/p>\n\n\n\n<p>U<\/p>\n\n\n\n<p>x<\/p>\n\n\n\n<p>|yi<\/p>\n\n\n\n<p>FIGURE 7.7: Circuit representing a controlled-U gate.<\/p>\n\n\n\n<p>The matrix representation of such a gate is<\/p>\n\n\n\n<p>U<\/p>\n\n\n\n<p>CU<\/p>\n\n\n\n<p>=<\/p>\n\n\n\n<p>&#8220;<\/p>\n\n\n\n<p>0<\/p>\n\n\n\n<p>0 U<\/p>\n\n\n\n<p>#<\/p>\n\n\n\n<p>. (7.21)<\/p>\n\n\n\n<p>You can prove that U<\/p>\n\n\n\n<p>CU<\/p>\n\n\n\n<p>is unitary if U is.<\/p>\n\n\n\n<p>One can use either of the input qubits as the control or the target. We will<\/p>\n\n\n\n<p>use the notation C<\/p>\n\n\n\n<p>ij<\/p>\n\n\n\n<p>to denote the i<\/p>\n\n\n\n<p>th<\/p>\n\n\n\n<p>bit as the control bit and the j<\/p>\n\n\n\n<p>th<\/p>\n\n\n\n<p>bit as<\/p>\n\n\n\n<p>the target.<\/p>\n\n\n\n<p>Exercise 7.11. Show that (H \u2297H)C<\/p>\n\n\n\n<p>12<\/p>\n\n\n\n<p>(H \u2297H) = C<\/p>\n\n\n\n<p>21<\/p>\n\n\n\n<p>, i.e., if you change basis<\/p>\n\n\n\n<p>from computational basis to the X basis {|+i, |\u2212i}, then the control and<\/p>\n\n\n\n<p>target bits get interchanged. The circuit for the problem looks like Figure<\/p>\n\n\n\n<p>7.8.<\/p>\n\n\n\n<p>H<\/p>\n\n\n\n<p>\u2022<\/p>\n\n\n\n<p>H<\/p>\n\n\n\n<p>\u2261<\/p>\n\n\n\n<p>H H<\/p>\n\n\n\n<p>\u2022<\/p>\n\n\n\n<p>FIGURE 7.8: CNOT with second qubit as control and \ufb01rst as target.<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"https:\/\/learning.oreilly.com\/api\/v2\/epubs\/urn:orm:book:9781482238129\/files\/bg9b.png\" width=\"692\" height=\"1011\"><\/p>\n\n\n\n<p>130 Introduction to Quantum Physics and Information Processing<\/p>\n\n\n\n<p>X<\/p>\n\n\n\n<p>\u2022<\/p>\n\n\n\n<p>X<\/p>\n\n\n\n<p>\u2261<\/p>\n\n\n\n<p>FIGURE 7.9: A 0-controlled gate.<\/p>\n\n\n\n<p>The control action can be conditioned on the control bit set to 0 instead<\/p>\n\n\n\n<p>of 1. Such a gate is represented in Figure 7.9.<\/p>\n\n\n\n<p>For more than one qubit, a variety of control possibilities are illustrated<\/p>\n\n\n\n<p>in Figure 7.10.<\/p>\n\n\n\n<p>Multiple target CNOT<\/p>\n\n\n\n<p>\u2022 \u2022 \u2022<\/p>\n\n\n\n<p>\u2261<\/p>\n\n\n\n<p>Multiple control (CCNOT):<\/p>\n\n\n\n<p>\u2022<\/p>\n\n\n\n<p>\u2022<\/p>\n\n\n\n<p>(No simple equivalent)<\/p>\n\n\n\n<p>FIGURE 7.10: Di\ufb00erent control operations<\/p>\n\n\n\n<p>Example 7.2.2. Creating Bell states<\/p>\n\n\n\n<p>Prototype entangled states are the Bell states of Equation 4.10, and they<\/p>\n\n\n\n<p>can be produced using CNOT gates. For example,<\/p>\n\n\n\n<p>|0i \u2297 |0i<\/p>\n\n\n\n<p>H\u2297<\/p>\n\n\n\n<p>\u2212\u2212\u2212\u2192<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>\u221a<\/p>\n\n\n\n<p>2<\/p>\n\n\n\n<p>(|0i + |1i) \u2297 |0i<\/p>\n\n\n\n<p>C<\/p>\n\n\n\n<p>12<\/p>\n\n\n\n<p>\u2212\u2212\u2192<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>\u221a<\/p>\n\n\n\n<p>2<\/p>\n\n\n\n<p>(|00i + |11i), (7.22)<\/p>\n\n\n\n<p>producing the \ufb01rst Bell state |\u03b2<\/p>\n\n\n\n<p>00<\/p>\n\n\n\n<p>i. It\u2019s easy to deduce that the general Bell<\/p>\n\n\n\n<p>state is produced by the simple circuit given in Figure 7.11:<\/p>\n\n\n\n<p>|xi<\/p>\n\n\n\n<p>H<\/p>\n\n\n\n<p>\u2022<\/p>\n\n\n\n<p>|\u03b2<\/p>\n\n\n\n<p>xy<\/p>\n\n\n\n<p>i<\/p>\n\n\n\n<p>|yi<\/p>\n\n\n\n<p>FIGURE 7.11: Circuit for preparing Bell States<\/p>\n\n\n\n<p>Exercise 7.12. Verify that the operation depicted in circuit 7.11 is reversible<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Two qubits together can be represented as 4-column vectors in Hilbert space. The most general 2-qubit gate is therefore a 4\u00d74 unitary. An operation on two qubits that acts independently on each of the two can be expressed as a direct product of two single-qubit operations as de\ufb01ned in Equation 3.31: O = O 1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4041,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[496],"tags":[],"class_list":["post-4070","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-quantum-gates-and-circuits"],"jetpack_featured_media_url":"https:\/\/workhouse.sweetdishy.com\/wp-content\/uploads\/2024\/09\/quantum-2.png","_links":{"self":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/4070","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/comments?post=4070"}],"version-history":[{"count":1,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/4070\/revisions"}],"predecessor-version":[{"id":4071,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/4070\/revisions\/4071"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/media\/4041"}],"wp:attachment":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/media?parent=4070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/categories?post=4070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/tags?post=4070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}