ensor elements {|c)|a)|b)} = {|0)|0)|0), |0)|0)|1), |1)|1)|1)}, with the first state |c) corresponding to the control qubit. In this basis, and using the definition of ASWAP in Eq. (16.32), the 8 x 8 matrix AC-SWAP takes the reduced and explicit forms: 10000000 01000000 00100000 00010000 AC-SWAP = (16.35) 00001000 00000010 00000100 0000000 1 Toffoli or CCNOT gate In Chapter 15, we have seen that the Toffoli gate corresponds to the logical function controlled-controlled-NOT, or CCNOT. To recall, in the classical version of the Toffoli gate, a, b are two control bits, and C is the "target" bit to process. The gate then outputs a, b, c' with c'= c a ab, meaning that, classically, the Toffoli gate is an XOR gate with ab and C as inputs, together with the conservation of the control bits a, b, to ensure computational reversibility. Here, consider that the input-output information is not about "bits" but "qubits." Defining the two control qubits as |c1), |c2), and the target bit as |a), it is easily established that in the basis {|c1)|c2)|a)} the corresponding 8 X 8 matrix 16.3 Quantum gates with multiple inputs and outputs CCNOT Figure 16.6 Controlled-controlled-X or CCNOT or Toffoli gate. ccu-[! @ Figure 16.7 Controlled-controlled-U, or CCU, gate with corresponding 8 X 8 matrix in reduced form. takes the form 10000000 1000000 00100000 00010000 (16.36) 00001000 00000100 00000001 00000010 where I is the 6 x 6 identity matrix and X is the 2 x 2 quantum NOT matrix. The quantum circuit representation of the CCNOT gate and its reduced matrix are provided in Fig. 16.6. It is clear that the CCNOT gate transforms the target qubit |a) into X|a), if and only if |c1) |c2>= |1) and leaves |a) invariant when |c1> = |c2> |0). Controlled-controlled-U or CCU gate This is a 3-qubit gate similar to the CCNOT or Toffoli gate, except that one uses any unitary transform U for the 2 x 2 operator, see Fig. 16.7, along with the corresponding reduced matrix. It is clear that the CCU gate transforms the target qubit |a) into U|a), if and only 