Checkpoint: Predict Then Measure
This lesson is a checkpoint. Before you build a circuit, you should be able to predict what its measurement distribution will look like. Building the circuit and running it is the second step — confirming your prediction. That two-step habit — predict, then verify — is what separates debugging by intuition from debugging by physics.
The CNOT gate
Before building the circuit, meet the gate it relies on. The controlled-NOT (CNOT) is a two-qubit gate with a control qubit and a target qubit: it flips the target if and only if the control is , and leaves the target alone when the control is . On the four basis states (control listed first):
In code, c.cx(control, target) applies it. CNOT is linear, so applied to a
superposition of control values it acts on each branch at once — which is exactly
what turns a product state into an entangled one below. (Module 11 returns to CNOT
and the rest of the controlled-gate family in depth.)
A two-qubit circuit to analyze
Consider the circuit that applies a Hadamard to the first qubit, then a controlled-NOT with the first qubit as control and the second as target:
Let's trace each step carefully.
Step 1 — Hadamard on qubit 0. The initial state is . Applying to qubit 0 and the identity to qubit 1 gives
Both qubits are independent at this point.
Step 2 — CNOT(0 → 1). The CNOT flips qubit 1 whenever qubit 0 is and leaves qubit 1 alone when qubit 0 is . Applying it term by term:
So the state becomes
This is a Bell state — a maximally entangled two-qubit state.
Predicting the measurement distribution
Applying the Born rule to is direct. The state is a superposition of exactly two computational basis states, each with amplitude :
P(11) = \left|\tfrac{1}{\sqrt{2}}\right|^2 = \tfrac{1}{2}.$$ The other two outcomes have **amplitude zero**: $$P(01) = 0, \qquad P(10) = 0.$$ Write down your prediction before running: a histogram with two equal bars at "00" and "11", and empty bars at "01" and "10". <Callout type="tip"> The fact that "01" and "10" never appear reflects entanglement: the two qubits are correlated. Measuring qubit 0 as `0` instantly tells you qubit 1 is also `0`, and measuring qubit 0 as `1` tells you qubit 1 is `1`. A classical mixture that is 50% (00) and 50% (11) would produce the same histogram in this basis — the quantum advantage becomes visible only when the same entangled pair is measured in multiple incompatible bases, as Bell's inequality makes precise. </Callout> ## Try it Build the circuit that produces $|\Phi^+\rangle$ and confirm your prediction by measuring both qubits. The grader checks that the probability distribution matches $P(00) = P(11) = 0.5$ and $P(01) = P(10) = 0$. <RunnableExample /> Open the **Probabilities** tab after running. You should see exactly two bars of equal height at positions "00" and "11" — no probability at "01" or "10". If the pattern matches your written prediction, you have completed the checkpoint.Sign in on the full site to ask questions and join the discussion.