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

In summary, three controlled-NOT gates can be combined to form a SWAP gate by multiplying the matrices representing the c-NOT gates with alternating control qubits. However, it is important to note that the matrix representation of the second c-NOT gate may be incorrect and should be double-checked.
  • #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.
 
Physics news on Phys.org
  • #2
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
 

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

What is quantum computing?

Quantum computing is a type of computing that uses principles of quantum mechanics to store and process information. Traditional computers use bits, which can represent either a 0 or 1, while quantum computers use qubits, which can represent multiple states at once. This allows quantum computers to solve certain problems much faster than traditional computers.

What is a SWAP gate?

A SWAP gate is a quantum logic gate that exchanges the values of two qubits. It essentially swaps the quantum states of two qubits, which can be useful in certain quantum algorithms.

How is a SWAP gate formed using x3 controlled-NOT gates?

A SWAP gate can be formed by using three controlled-NOT gates, also known as CNOT gates. A CNOT gate has two inputs, one control qubit and one target qubit. The target qubit is flipped if and only if the control qubit is in the state |1>. By using three CNOT gates with different control and target qubit combinations, it is possible to create a SWAP gate.

Why is a SWAP gate important in quantum computing?

A SWAP gate is important in quantum computing because it allows for the exchange of information between two qubits. This can be useful in various quantum algorithms, such as quantum error correction and quantum teleportation.

What are some potential applications of quantum computing?

Quantum computing has the potential to revolutionize many fields, including drug discovery, cryptography, and machine learning. It can also help to solve complex optimization problems, such as route planning and financial modeling. However, quantum computers are still in the early stages of development and more research is needed to fully explore their capabilities.

Similar threads

  • Advanced Physics Homework Help
Replies
3
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
802
  • Advanced Physics Homework Help
Replies
14
Views
1K
  • Advanced Physics Homework Help
Replies
5
Views
2K
Replies
2
Views
460
  • Advanced Physics Homework Help
Replies
20
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
3K
  • Advanced Physics Homework Help
Replies
2
Views
1K
  • Advanced Physics Homework Help
Replies
4
Views
2K
Back
Top