Computing Library › Quantum Logic Gates
Quantum Logic Gates

CNOT Gate (Controlled-X)

The CNOT flips the target qubit if the control is |1⟩ — the two-qubit gate that creates entanglement and anchors nearly every quantum circuit.

Matrix

Unitary matrix
1000010000010010

Circuit symbol

Kronos motion — control room

Action on basis states

inputoutput
|00⟩|00⟩
|01⟩|01⟩
|10⟩|11⟩
|11⟩|10⟩

How it works

CNOT (CX) is Clifford and, with H, turns a product state into a Bell state: H on the control then CNOT gives (|00⟩+|11⟩)/√2. With arbitrary single-qubit gates it is universal. It is the standard entangler and the syndrome-extraction workhorse of error correction.

In code (Qiskit)

python
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)   # Bell state
two-qubitCliffordentangling