 Fig. 16.9, with, for instance, J = X. The circuit is seen to involve two different controlled-U gates (U, U') and two single-qubit gates (X, K), where U, U', K are any unitary gates. We do not need to calculate the corresponding matrix. Instead, consider the evolution of the A rational fraction or rational number can be expressed as the ratio a/b of two integers a, b. 16.4 Quantum circuits Figure 16.9 Basic example of 2-qubit quantum circuit. input tensor state |a) >|x) through the circuit, assuming separately |a) = |0) and |a) = |1), with each of the arrows (->) representing the crossing of a gate: 0x)->0)x)->X0)Kx)=|1)UKx) (16.37) lx)->|1)Ux)->X|1)KUx)=0)KUx). If, for instance, we let U = Y, K = and U'=Z (according to the standard definitions of Y, Z, S in Fig. 16.4), we obtain: |1)ZSx)=|1)zs(a0)+B(1)) = = |1)(a|0) - iB|1)) = a|1)|0> - iB|1)|1) (16.38) |0)SY|x> = [0)SY(a|0) + B|1)) = 10)S(B|0)-a|1)) - = [0)(B|0) - ix|1)) = B|0)|0> - ix|0)|1). Letting B = 0 or a = 1 in Eq. (16.38), we obtain the transformation: u1|0)|0> + u2|0)|1) + u3|1)|0) + u4|1)|1) u1|1)|0> - iu2|1)|1) - iu3|0)|1) + u4|0)|0) (16.39) = u4|0)|0) - iu3|0)|1) + - iu2|1)|1), which corresponds to the circuit matrix and its reduced form: (16.40) As a second illustrative example, consider next the 2-qubit quantum circuit shown in Fig. 16.10, which involves two CNOT gates, three gates A, B, C, and a 8-phase gate S.° It is further assumed that ABC = I. As before, the evolution of the input tensor state 9 A 8-phase gate has for matrix s=(oc) Quantum bits and quantum gates Figure 16.10 Two-qubit quantum circuit with ABC = Iand 8-phase gate S. Figure 16.11 Three-qubit quantum circuit with V2=U. |a) )|x) through the circuit is calculated through the following: |0>|x) |0)C|x) BC|x) |0) BC|x) S|0) ABC|x) = |0>|x) |1)|x)->|1)Cx)->|1)XCx)->|1)BXCx) (16.41) |1)XBXC|x) ei8|1) AXBXC|x). Letting U = eis AXBXC, the above transformation reduces to |0)|x) (16.42) The result shows that when |a>=|0) the circuit leaves the target qubit /x) invariant, and when |a> = |1