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?
-
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 Answers
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}$$

- 4,301
- 1
- 10
- 21
-
1See 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