The CNOT Gate —
The Entanglement Maker
CNOT flips the target qubit only when the control qubit is $|1\rangle$. On definite inputs, the rule is completely classical. But when the control is in superposition, that simple conditional flip creates something neither qubit had before — entanglement.
You Already Know CNOT — You Just Don't Know You Know It
The Bell pair circuit is: Hadamard on qubit 1, then CNOT with qubit 1 as control and qubit 2 as target. After H, qubit 1 is in state $(|0\rangle + |1\rangle)/\sqrt{2}$. Qubit 2 is still $|0\rangle$. When CNOT runs, what happens to the $|1\rangle$ branch of qubit 1's superposition?
In L13 you built a Bell pair — the most fundamental entangled state in quantum computing — using two gates: a Hadamard, then a CNOT. The Hadamard put the control qubit into superposition. The CNOT did something to the target qubit based on what the control was doing. And suddenly the two qubits were entangled. Measuring one instantly determined the other.
At the time, we called CNOT "the entanglement maker" and moved on. Now we go deeper. What exactly is the rule it follows? Why does applying a simple conditional flip to a superposed qubit produce something no classical gate ever can?
This lesson is the complete answer to those questions.
The Light Switch Analogy
Before any mathematics, here is the classical picture of what CNOT does.
The rule is simple: if the master switch is ON, pressing the target switch flips it. If the master switch is OFF, pressing the target switch does absolutely nothing — the lamp stays exactly as it was.
That is the CNOT gate. Control is the master switch. Target is the lamp switch. The rule: "if control is $|1\rangle$, flip the target. If control is $|0\rangle$, do nothing to the target."
Now here is where the analogy breaks with something extraordinary. What if the master switch is not ON or OFF — but genuinely both at once? Superposition.
Then the lamp ends up in superposition too — but not just any superposition. It becomes entangled with the control. The two switches now share one quantum fate. That is what no classical switch can ever do.
The classical version of CNOT is completely ordinary — it is exactly the XOR gate you may have studied in a computer science class. CNOT XORs the target with the control. What makes CNOT quantum is not the rule itself. The rule is simple. What makes it quantum is that qubits can be in superposition — and when you apply a conditional rule to a superposed qubit, something fundamentally new emerges.
The Truth Table — All Four Cases
For definite input states, CNOT behaves entirely classically. There are four possible inputs — $|00\rangle$, $|01\rangle$, $|10\rangle$, $|11\rangle$ — and the output is completely predictable in every case.
| Control in | Target in | Control out | Target out | What happened |
|---|---|---|---|---|
| $|0\rangle$ | $|0\rangle$ | $|0\rangle$ | $|0\rangle$ | Control is 0 — target unchanged |
| $|0\rangle$ | $|1\rangle$ | $|0\rangle$ | $|1\rangle$ | Control is 0 — target unchanged |
| $|1\rangle$ | $|0\rangle$ | $|1\rangle$ | $|1\rangle$ ↑ | Control is 1 — target flipped 0→1 |
| $|1\rangle$ | $|1\rangle$ | $|1\rangle$ | $|0\rangle$ ↑ | Control is 1 — target flipped 1→0 |
Two things to notice immediately. First: the control qubit is never changed by the CNOT. Only the target changes. The control passes through exactly as it arrived. Second: this is reversible. Look at the last two rows — apply CNOT again to either result and you're back to where you started. CNOT is its own inverse. Apply it twice and you get the identity.
What CNOT Looks Like in a Circuit
In a quantum circuit diagram, CNOT has a distinctive and unmistakable visual. Once you see it, you will never mistake it for anything else.
The filled dot (●) on the top wire marks the control qubit. The circled plus symbol (⊕) on the bottom wire marks the target qubit. The vertical line shows these two qubits are involved in the same gate. You read it as: "if the ● wire is $|1\rangle$, apply an X gate (flip) to the ⊕ wire."
A Superposed Control — The Moment Everything Changes
Every row in the truth table above had a definite control qubit — either $|0\rangle$ or $|1\rangle$. The outputs were boring and predictable. Now put the control qubit in superposition.
Suppose the control is $\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$ — exactly the state you get from a Hadamard on $|0\rangle$ — and the target starts in $|0\rangle$. The joint starting state of the two-qubit system is:
$$\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle) \otimes |0\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |10\rangle)$$Now apply CNOT. Because quantum gates are linear, CNOT acts on each term in the superposition separately. This is the key mathematical fact. It is not a special property of CNOT — all quantum gates are linear. But the consequences here are extraordinary:
$$\text{CNOT}\,\frac{1}{\sqrt{2}}(|00\rangle + |10\rangle) = \frac{1}{\sqrt{2}}\bigl(\text{CNOT}|00\rangle + \text{CNOT}|10\rangle\bigr)$$ $$= \frac{1}{\sqrt{2}}\bigl(|00\rangle + |11\rangle\bigr) = |\Phi^+\rangle$$The $|00\rangle$ term had control 0, so the target was left alone — stays $|00\rangle$. The $|10\rangle$ term had control 1, so the target was flipped from $|0\rangle$ to $|1\rangle$ — becomes $|11\rangle$. The result is the Bell state $|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)$.
This state cannot be written as a product of two independent qubit states. No matter how you try to factor it, you cannot. The qubits are entangled — they share one quantum fate.
CNOT Explorer
Choose the state of the control and target qubits, then apply CNOT. Try all four classical inputs first — the outputs will be completely predictable. Then set the control to $|{+}\rangle$ (superposition) and watch what the output becomes. That is the moment entanglement appears.
The key moment to find: set control to |+⟩ and target to |0⟩, then apply CNOT. The output cannot be written as two separate qubit states — it is the entangled Bell state. Both qubits now share one quantum fate.
The Mathematics — Every Step Shown
CNOT is a 4×4 matrix, because it acts on a two-qubit system whose state lives in a four-dimensional space — spanned by $|00\rangle$, $|01\rangle$, $|10\rangle$, $|11\rangle$.
The Bell state derivation — complete step by step
Why CNOT Is Reversible — And Why That Matters
Every quantum gate — except measurement — must be reversible. This is not a design choice. It is a physical necessity. Quantum mechanics is time-reversible: any valid quantum evolution can be run backwards. This means quantum gates must be reversible operations on quantum states.
CNOT achieves reversibility elegantly: it is its own inverse. Apply CNOT twice and you get the identity — the gate that does nothing. To undo a CNOT, you just apply another CNOT. The gate reverses itself.
Why? Because flipping a bit twice returns it to its original state. If control is $|1\rangle$, you flip the target twice — it comes back. If control is $|0\rangle$, the target was never changed, so two applications still give you the original. Either way: CNOT² = Identity.
This is completely unlike classical gates like AND and OR, which are irreversible — multiple inputs map to the same output, so you cannot infer the input from the output. CNOT never loses information. Every output maps back to exactly one input.
What You Now Know About the CNOT Gate
- CNOT flips the target qubit if and only if the control is $|1\rangle$Control $|0\rangle$ → target unchanged. Control $|1\rangle$ → target flipped. The control itself is never changed by the gate — it always passes through intact. On definite inputs, this is completely classical: quantum XOR.
- On a superposed control, CNOT creates entanglementWhen the control is $(|0\rangle + |1\rangle)/\sqrt{2}$, CNOT produces $(|00\rangle + |11\rangle)/\sqrt{2}$ — the Bell state. This state cannot be written as two independent qubit states. The qubits are entangled: measuring one instantly determines the other. The simple conditional rule, applied to superposition, produces something qualitatively new.
- Circuit symbol: filled dot (●) on control wire, circled plus (⊕) on target wireThis notation is universal across every quantum computing platform, textbook, and research paper. The dot is always the control, the ⊕ is always the target — regardless of which wire is on top. A vertical line connects them.
- CNOT is its own inverse — CNOT² = IdentityApply CNOT twice and you get back to where you started. Reversibility is a physical requirement for all quantum gates, and CNOT satisfies it because XOR is self-inverse. Unlike classical AND or OR, CNOT never destroys information.
- CNOT + single-qubit gates form a universal gate setAny quantum computation can be decomposed into CNOT gates and single-qubit rotations (like H, X, Z, T). This is proved in Barenco et al. (1995). Every quantum algorithm you will encounter in this course — Bell pairs, Grover's search, quantum teleportation — is built from exactly these primitives.
You understand H and CNOT separately.
Now combine them — one circuit, two gates —
and build the simplest entangled state in the universe.
The Bell pair. Your first real quantum circuit.
- Nielsen, M. A. & Chuang, I. L. — Quantum Computation and Quantum Information, Cambridge, 2000. §1.3 "Quantum computation" (Bell pair derivation) and §4.2 "Single qubit and CNOT gates are universal."
- Barenco, A. et al. (1995). "Elementary gates for quantum computation." Physical Review A, 52, 3457 — proves that CNOT plus single-qubit gates form a universal gate set for quantum computing.
- Preskill, J. — Ph219 Lecture Notes, Chapter 6. theory.caltech.edu/~preskill/ph219/ — entanglement theory and two-qubit gates.
- IBM Qiskit Textbook — "Multiple Qubits and Entanglement." learning.quantum.ibm.com — interactive Bell pair circuits with real hardware execution.