- #1
SK1.618
- 10
- 0
Homework Statement
Show that three controlled-NOT gates (for a 2 qubit system) can be combined to form a SWAP gate. The control qubit alternates between the 2 qubits for each consecutive c-NOT gate. (The diagram is Figure 5 of the following notes: http://www-inst.eecs.berkeley.edu/~cs191/fa07/lectures/lecture9_fa07.pdf )
Homework Equations
The explicit matrix form of a controlled-NOT gate is
\begin{matrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0
\end{matrix}
The Attempt at a Solution
Multiply the following 3 matrices, representing c-NOTs with alternating control gate:
\begin{matrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0
\end{matrix}
\begin{matrix}
0 & 1 & 0 & 0 \\
1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{matrix}
\begin{matrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0
\end{matrix}
The correct answer should be (for a SWAP gate):
\begin{matrix}
1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1
\end{matrix}
But this is not what I get. I think there may be a problem with my matrix representation of the second c-NOT gate in the series.