Computing Library › Quantum Foundations
Quantum Foundations

The CNOT Gate

The controlled-NOT gate flips a target qubit when the control is 1; combined with single-qubit gates it enables universal computation and entanglement.

A two-qubit gate

The controlled-NOT (CNOT or CX) gate acts on two qubits. It flips the target qubit if and only if the control qubit is |1>, and does nothing if the control is |0>. It is the most common entangling gate in the circuit model.

CNOT (control, target)

1
0
0
0
0
1
0
0
0
0
0
1
0
0
1
0

Truth table on basis states

controltargettarget-out
000
011
101
110

On computational basis states CNOT looks like a classical XOR written into the target. The quantum power appears when the control is in superposition.

Creating entanglement

Put the control in superposition first. Apply H to qubit 1 of |00> to get (|00>+|10>)/sqrt(2), then CNOT to get (|00>+|11>)/sqrt(2) — a Bell state. The control and target are now entangled and neither has a definite value alone. CNOT is the standard entangler.

Universality and no-cloning

CNOT together with arbitrary single-qubit gates forms a universal set. It might look like a copier — it maps |x>|0> to |x>|x> for x in {0,1} — but on a superposition it entangles rather than copies, consistent with the no-cloning theorem. Applying CNOT to (|0>+|1>)|0> gives the entangled Bell state, not two independent copies.