Gates & circuits

controlled-NOT gate (CNOT)

The CNOT gate is a two-qubit operation with a simple rule: one qubit is the control, the other is the target, and the gate flips the target (swaps |0> and |1>) only when the control is |1>. If the control is |0>, nothing happens. Think of it like a light switch wired to a sensor — the light flips only when the sensor is triggered, and stays put otherwise. On plain |0> and |1> inputs it behaves exactly like ordinary if-then logic, which makes it easy to reason about.

The interesting part shows up when the control is in superposition. Because the gate acts on the whole two-qubit state at once (and, like all quantum gates, is reversible), feeding in a control that is a mix of |0> and |1> links the two qubits together: the target's value becomes tied to the control's. The result can be an entangled state that you cannot describe by giving each qubit its own separate state — measuring one tells you something about the other. This is why CNOT is the workhorse entangling gate in most hardware, and why a single-qubit gate plus CNOT together cover everything you need to build any quantum circuit.

CNOT (H|0>)|0> = (|00> + |11>)/sqrt(2)

Put the control into an equal superposition with H, then apply CNOT: the two qubits come out entangled in a Bell state — measure one and you instantly know the other.

CNOT does not 'copy' the control qubit and cannot clone an unknown quantum state; it correlates the two qubits, which is a different and more subtle thing.

Also called
controlled-X gateCX gate