Quantum

CNOT and the Bell States

One gate, four states, the entire foundation of quantum communication. CNOT is where a pair of qubits stops behaving like two coins and starts behaving like one shared fact.

Classical 2-bit logic is, in a real sense, finished. With AND, OR, and NOT you can build any boolean function of any number of bits. Add a clock and some memory and you have a CPU. The whole edifice of digital computing rides on the fact that two bits have four possible joint states and any deterministic function between bit strings can be wired up as a circuit of those three gates.

What classical logic can't do is reproduce a particular set of correlations between two coins. Specifically: hand Alice and Bob each one of a pair of correlated coins, separate them by a light-year, let them each pick from one of two measurement settings, and ask how often their outcomes match. There is a hard mathematical ceiling — the CHSH bound, |S| ≤ 2 — on how strong those correlations can be if the coins were prepared by any classical process: a shared random seed, a hidden agreement, a lookup table, anything “local” you want to invent. Quantum-mechanical pairs of particles routinely measure |S| ≈ 2√2. The classical bound isn't violated by a little. It's violated by something nature can apparently produce and no deterministic two-bit circuit ever will.

Those pairs of particles are entangled. The quantum operation that produces them — that lifts a pair of qubits from “two independent coins” to “one shared fate” — is the CNOT gate, fed a qubit already in superposition. That's the whole essay. Read on for the matrix, the four canonical entangled states, and a recipe for building each one with the buttons below.

CNOT is a controlled flip

CNOT takes two qubits — a control and a target — and does exactly one thing: flip the target when the control is |1⟩, leave it alone when the control is |0⟩. On classical inputs it's the same gate you've seen in textbooks under the name “controlled NOT”; the truth table is the XOR you'd expect:

  • |00⟩ → |00⟩   (control = 0, target unchanged)
  • |01⟩ → |11⟩   (control = 1, target flipped from 0 to 1)
  • |10⟩ → |10⟩   (control = 0, target unchanged)
  • |11⟩ → |01⟩   (control = 1, target flipped from 1 to 0)

Register order: |q₁ q₀⟩, LSB-first, q₀ as control, q₁ as target. As a 4×4 matrix in the basis {00,01,10,11}\{|00\rangle, |01\rangle, |10\rangle, |11\rangle\} it's just a permutation — swap the last two columns of the identity — and that fact is the source of every bit of confusion you've ever had about CNOT. Read on the computational basis it does nothing interesting. It's a 4×4 rearrangement of classical bits.

The interesting behavior shows up the moment the control isn't classical. If q₀ is in superposition (|0⟩ + |1⟩)/√2, the “flip or don't” question has no determinate answer yet — and CNOT, being linear, applies both branches at once. The result is a state in which q₁'s value is bound to q₀'s value: not because q₀ has been measured, but because no factorization into “a state for q₀” ⊗ “a state for q₁” can describe what just happened. That's entanglement; that's the Bell pair.

Build the four Bell states

The four Bell states are the orthonormal basis of maximally entangled two-qubit states. You build all four from the same two-gate recipe — Hadamard on q₀, then CNOT(0, 1) — just by varying the input. Here's the canonical circuit for the first one, |Φ⁺⟩ = (|00⟩ + |11⟩)/√2:

q0 q1 H
Remix in sandbox →
The canonical Bell-state preparation. H on q₀ creates the superposition; CNOT(0, 1) ties q₁'s fate to it.

Below are the live widgets. ProbabilityBars shows P(outcome) over the four basis states; the two MiniBloch cards show the per-qubit reduced state — they'll shrink to the origin and flash an “Entangled” badge once you've built any Bell pair. The buttons let you set up an input state (X flips a qubit; H + CNOT runs the recipe).

P over |q₁ q₀⟩, in order |00⟩, |01⟩, |10⟩, |11⟩.

P(|0⟩) = …, P(|1⟩) = …

q0

|0⟩ |1⟩
Reduced state of q₀

r = 1.000

q1

|0⟩ |1⟩
Reduced state of q₁

r = 1.000

Try this: reset, then press H on q₀, then CNOT(0, 1). The bars collapse to exactly two outcomes, |00⟩ and |11⟩, each at 50%. Both Bloch cards shrink to the origin and light up “Entangled.” That's |Φ⁺⟩.

Now vary the input. The full mapping, in our LSB-first register convention, is:

  • |00⟩  → H, CNOT →  |Φ⁺⟩ = (|00⟩ + |11⟩) / √2
  • |01⟩  → H, CNOT →  |Φ⁻⟩ = (|00⟩ − |11⟩) / √2
  • |10⟩  → H, CNOT →  |Ψ⁺⟩ = (|01⟩ + |10⟩) / √2
  • |11⟩  → H, CNOT →  |Ψ⁻⟩ = (|01⟩ − |10⟩) / √2

Try this: reset, press X on q₀ to load |01⟩, then H on q₀, then CNOT(0, 1). The probability bars look identical to |Φ⁺⟩ — same two outcomes, same 50/50 split — but the state vector that produced them is |Φ⁻⟩, with a minus sign hiding in the phase. The bars can't see it; an interferometric measurement (the Bell-state-discrimination protocol you'd use in teleportation) can.

Two notes on convention. First: textbooks usually write the Bell table in MSB-first order, so they'll say “|10⟩ → |Φ⁻⟩.” That's the same physics — they just label the qubits the other way around. Our q₀ is their second bit. Second: every recipe above uses H on q₀ and CNOT with q₀ as control. There are nine other equivalent prep circuits (swap roles, use H on q₁, etc.); they all reach the same four-state basis.

Why CNOT, and what it unlocks

Per-qubit Bloch cards going to the origin is the visual you saw in the entanglement essay — the reduced density matrix of either qubit in a Bell pair is the maximally mixed state I/2, which sits at the center of the sphere. From q₀ alone, the Bell pair is indistinguishable from a fair coin. The whole information content of the joint state lives in the correlation between q₀ and q₁, and partial tracing — “please summarize what one qubit looks like on its own” — throws exactly that information away. A measurement on q₀ alone is genuinely random. A measurement on the pair is perfectly correlated. Both facts are simultaneously true; this is the geometric face of entanglement.

Once you have the Bell pair, you can do things classical bits can't. EPR (Einstein–Podolsky–Rosen): Alice and Bob each take one half of a |Φ⁺⟩ pair, fly arbitrarily far apart, and when either of them measures in the Z basis they instantly know the other's outcome. No signal is sent (the result on each end is 50/50 random; you need to compare notes to see the correlation), but the joint statistics are stronger than any local-hidden- variable model can reproduce — the CHSH violation again.

Quantum teleportation: Alice has an unknown qubit she wants to send Bob. They share a |Φ⁺⟩. Alice performs a Bell-basis measurement on her unknown qubit + her half of the pair, gets one of four classical 2-bit outcomes, and phones it to Bob. Bob applies one of four corrective single-qubit gates determined by Alice's bits, and his half of the pair becomes the state Alice started with. No qubits travel; one Bell pair plus two classical bits carries one qubit of information. The protocol is impossible without the shared entanglement.

Both protocols boil down to: the four-element Bell basis is the natural language two qubits speak to each other, and CNOT is the only gate in the standard kit that can rotate between the product-state basis and the Bell basis. That's why CNOT — and not its cousins SWAP or Toffoli — is the entangling gate every universal gate set picks first.

Self-test

  1. Build |Ψ⁻⟩ = (|01⟩ − |10⟩) / √2 from |00⟩ using only the four operation buttons above. What order do you press them in? (Verify: both Bloch cards should be at the origin and the probability bars should show |01⟩ and |10⟩ at 50% each.)
  2. |Φ⁺⟩ and |Φ⁻⟩ are perfectly orthogonal — they're different basis states. But the probability bars look identical for both. Where, exactly, does the distinguishing information live, and what kind of measurement would you have to do to read it out? (Hint: H on q₀ before measuring is the start of an answer.)

Open the Bell pair in the sandbox →

The Bell basis, the CNOT matrix, and the CHSH bound

The four Bell states, written out in the computational basis:

Φ±  =  12(00±11),Ψ±  =  12(01±10)|\Phi^\pm\rangle \;=\; \tfrac{1}{\sqrt{2}} \bigl(|00\rangle \pm |11\rangle\bigr), \qquad |\Psi^\pm\rangle \;=\; \tfrac{1}{\sqrt{2}} \bigl(|01\rangle \pm |10\rangle\bigr)

They form an orthonormal basis of the two-qubit Hilbert space C2C2\mathbb{C}^2 \otimes \mathbb{C}^2, and every one of them is maximally entangled: the reduced state of either qubit is I/2I/2.

CNOT with q₀ as control and q₁ as target, in the basis {00,01,10,11}\{|00\rangle, |01\rangle, |10\rangle, |11\rangle\}:

CNOT01  =  [1000000100100100]\text{CNOT}_{0 \to 1} \;=\; \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \end{bmatrix}

It permutes 0111|01\rangle \leftrightarrow |11\rangle and leaves the other two basis vectors alone — exactly the truth table at the top of the essay, written as a 4×4 matrix.

The CHSH inequality (Clauser–Horne–Shimony–Holt, 1969) is the tightest two-party, two-setting, two-outcome Bell inequality. For any local-hidden-variable model the correlation sum is bounded by S2|S| \leq 2; quantum mechanics with a shared Φ+|\Phi^+\rangle reaches S=22|S| = 2\sqrt{2} (Tsirelson's bound). Experimentally confirmed many times over, most decisively in the 2015 loophole-free tests by Hensen et al. and Giustina et al. — the result that, more than any other, shut the door on local realism.