The CNOT (Controlled-NOT) gate is a two-qubit gate that performs an X gate on the second qubit (target qubit) if the state of the first qubit (control qubit) is ∣1⟩. The CNOT gate is also known as the Controlled-X gate. The CNOT gate is used to entangle two qubits and is a fundamental gate in quantum computing. The CNOT gate is a conditional gate that acts on two qubits. The CNOT gate is represented as CX in the circuit.
In CNOT gate if the control qubit is in the state ∣0⟩, the target qubit remains unchanged. If the control qubit is in the state ∣1⟩, the target qubit is flipped.
CNOT Gate
Suppose we have two qubits initially in the state ∣00⟩, represented as:
∣q0⟩=∣0⟩(2)∣q1⟩=∣0⟩(3)
The CNOT gate is represented by the following matrix:
CX=1000010000010010(4)
To apply the CNOT gate to the qubits ∣q0⟩=∣0⟩ and ∣q1⟩=∣0⟩, we perform a matrix multiplication of the CNOT gate matrix with the state vector representing ∣00⟩.
Thus, the CNOT gate does not change the state of the qubits ∣00⟩.
It does not affect the state of the qubits ∣00⟩ as the control qubit is in the state ∣0⟩. So, the CNOT gate does not introduce any change to the qubits ∣00⟩. Instead, it flips the state of the target qubit if the control qubit is in the state ∣1⟩.
Now, let's take another example where the control qubit is in the state ∣1⟩ and the target qubit is in the state ∣1⟩.
Suppose we have two qubits initially in the state ∣10⟩, represented as:
∣q0⟩=∣1⟩(8)∣q1⟩=∣1⟩(9)
To apply the CNOT gate to the qubits ∣q0⟩=∣1⟩ and ∣q1⟩=∣1⟩, we perform a matrix multiplication of the CNOT gate matrix with the state vector representing ∣11⟩.
Well instead of performing the matrix multiplication, we can use the shortcut method to determine the output state of the qubits after applying the CNOT gate.
The shortcut method is as follows:
If the control qubit is in the state ∣0⟩, the target qubit remains unchanged.
If the control qubit is in the state ∣1⟩, the target qubit is flipped.
PS: break the above state of qubits into two qubits, the first qubit represents the control qubit and the second qubit represents the target qubit. ie ∣q0q1⟩ = ∣q0⟩∣q1⟩ and apply the CNOT gate to the qubits.