CNOT Gate
CNOT Gate inverts the right Qubit (target qubit) if the left qubit (control qubit) is $1$: $$\displaylines{
CNOT\ket{00} = \ket{00}, \
CNOT\ket{01} = \ket{01}, \
CNOT\ket{10} = \ket{11}, \
CNOT\ket{11} = \ket{10}.
}$$
As we can see, the control qubit is unchanged while the target qubit becomes the XOR of the inputs: $$CNOT\ket a \ket b = \ket a \ket {a \oplus b}.$$ Thus CNOT is a quantum XOR Gate. Also, since the X Gate is the NOT Gate, the CNOT gate is also called the CX gate or controlled-X gate.
As a quantum circuit, CNOT spans two qubits or two lines:
The solid dot indicates control, and the $⊕$ denotes the target.
The matrix form of applying CNOT gate on two qubits is: $$CNOT = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \end{pmatrix}.$$
Acting on a general superposition, this would give us: $$CNOT(c_0\ket{00} + c_1\ket{01} + c_2\ket{10} + c_3\ket{11}) = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \end{pmatrix}\begin{pmatrix}c_0 \\ c_1 \\ c_2 \\ c_3\end{pmatrix} = \begin{pmatrix}c_0 \\ c_1 \\ c_3 \\ c_2\end{pmatrix}.$$ So, the amplitudes of $\ket{10}$ and $\ket{11}$ are swapped, as expected.
# Sources
# Uses
- It is an important Quantum Gate as it can produce Entanglement.