Quantum computing - form a SWAP gate from x3 controlled-NOT gates

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 5K views
SK1.618
Messages
8
Reaction score
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.
 
Physics news on Phys.org
turns out, as you guessed, the matrix representation of the CNOT(2->1) gate is incorrect.

CNOT(2->1) = I[itex]\otimes[/itex]|0><0| + X[itex]\otimes[/itex]|1><1|

=
1 0 0 0
0 0 0 1
0 0 1 0
0 1 0 0