2

Considering a 3 qubit system, what does the matrix operation will look like if I apply CNOT on qubit 1 and qubit 2 and then apply CNOT on qubit 1 and qubit 3?

Ajay Rao
  • 55
  • 5
  • See also this answer for general approach how to descibe a quantum gate acting on two non-adjacent qubits: https://quantumcomputing.stackexchange.com/questions/9180/how-do-i-write-the-matrix-for-a-cz-gate-operating-on-nonadjacent-qubits/9185#9185 – Martin Vesely Mar 14 '20 at 23:01

1 Answers1

1

By taking into account this representation of the CNOT gate:

$$CNOT = | 0 \rangle \langle 0 | \otimes I + | 1 \rangle \langle 1 | \otimes X$$

We can write:

$$CNOT(1, 3) = | 0 \rangle \langle 0 | \otimes I \otimes I + | 1 \rangle \langle 1 | \otimes I \otimes X$$

$$CNOT(1, 2) = | 0 \rangle \langle 0 | \otimes I \otimes I + | 1 \rangle \langle 1 | \otimes X \otimes I$$

That's why:

\begin{align*} &CNOT(1, 3) CNOT(1, 2) = | 0 \rangle \langle 0 | \otimes I \otimes I + | 1 \rangle \langle 1 | \otimes X \otimes X = \\ &= \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} \otimes \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} \otimes \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} + \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix} \otimes \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \otimes \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = \end{align*}

$$= \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ \end{pmatrix}$$

Answers to the related questions: [1] and [2].

Davit Khachatryan
  • 4,301
  • 1
  • 10
  • 21
  • 1
    See also this answer for general approach how to descibe a quantum gate acting on two non-adjacent qubits: https://quantumcomputing.stackexchange.com/questions/9180/how-do-i-write-the-matrix-for-a-cz-gate-operating-on-nonadjacent-qubits/9185#9185 – Martin Vesely Mar 14 '20 at 23:01
  • 1
    That was helpful. Thanks so much – Ajay Rao Mar 17 '20 at 10:28