Quantum in 7 Sessions › Session 3
Session 3 — Entanglement
Session 3 of 7Self-studySimulator only
On this page: Read · Key ideas · Worked example · Try it · Second experiment · Common mistakes · Check yourself · Project
1. Read
Read the chapter first. The summary below is a reminder, not a replacement.
2. Key ideas
- Two qubits have four basis states: |00⟩, |01⟩, |10⟩, |11⟩. In general n qubits need 2ⁿ amplitudes.
- A CNOT flips the target qubit only when the control qubit is 1.
- H on the first qubit followed by CNOT produces the Bell state (|00⟩ + |11⟩)/√2. It cannot be written as “a state of qubit A” times “a state of qubit B”. That is entanglement.
- Each qubit alone looks random, but the two results always agree. Agreement in one basis is not yet proof of entanglement; you need a second measurement basis to rule out an ordinary shared coin.
3. Worked example
Work through this with pen and paper before touching the code.
Build the Bell state step by step, writing states as |first qubit, second qubit⟩.
- Start: |00⟩.
- H on the first qubit: (|00⟩ + |10⟩)/√2.
- CNOT with the first qubit as control flips the second qubit only in the |10⟩ term: (|00⟩ + |11⟩)/√2.
Why it is not two separate qubits. A product state looks like (a|0⟩ + b|1⟩)(c|0⟩ + d|1⟩) = ac|00⟩ + ad|01⟩ + bc|10⟩ + bd|11⟩. To match the Bell state we need ad = 0 and bc = 0, but also ac ≠ 0 and bd ≠ 0. If ad = 0 then a = 0 or d = 0, which makes ac or bd zero. No choice works, so the state cannot be split.
4. Try it
Build the Bell state and look at which outcomes appear. Write down what you expect before you run the code.
from qiskit import QuantumCircuit from qiskit_aer import AerSimulator qc = QuantumCircuit(2, 2) qc.h(0) # put qubit 0 in superposition qc.cx(0, 1) # entangle qubit 1 with qubit 0 qc.measure([0, 1], [0, 1]) counts = AerSimulator(seed_simulator=7).run(qc, shots=1000).result().get_counts() print(counts) # only '00' and '11' appear
Output (counts will vary slightly from run to run):
{'11': 511, '00': 489}
What to notice
Only 00 and 11 appear, each about half the time; 01 and 10 never do. Each qubit on its own is 50/50, but together they are perfectly correlated. Note that Qiskit prints the bit string with qubit 0 on the right.
5. Second experiment
Measure the same Bell state in a different basis by adding an H on each qubit just before measurement. Predict first.
from qiskit import QuantumCircuit from qiskit_aer import AerSimulator qc = QuantumCircuit(2, 2) qc.h(0) qc.cx(0, 1) # Bell state qc.h([0, 1]) # rotate both qubits: measure in the X basis instead of Z qc.measure([0, 1], [0, 1]) print(AerSimulator(seed_simulator=7).run(qc, shots=1000).result().get_counts())
Output:
{'11': 511, '00': 489}
What it shows
The results are still only 00 and 11. A pair of classical coins that merely agree would give all four outcomes here. Perfect correlation in two different bases is the signature that separates a Bell state from a shared classical coin.
6. Common mistakes and tips
Common mistakes
- Saying “the qubits are both 0 or both 1, we just do not know which”. That describes a classical shared coin, not a Bell state.
- Believing that measuring one qubit sends a signal to the other. The correlations cannot be used to communicate.
- Reading Qiskit bit strings left to right. Qiskit prints qubit 0 on the right.
Tips
- To test for entanglement, measure in a second basis. A classical mixture loses its correlation there; a Bell state keeps it.
- Count amplitudes: n qubits need 2ⁿ of them. This is why classical simulation gets hard quickly.
- Draw the circuit before writing code. Most errors are a control and target swapped.
7. Check yourself
Answer each question on paper, then open the answer to compare.
- A classical pair of coins glued together also gives only 00 and 11. What extra measurement separates that from a Bell state?
Show answer
Measure both qubits in the X basis (an H on each before measuring). A Bell state still gives only 00 and 11. A classical mixture of 00 and 11 gives all four outcomes about equally.
- Add a third qubit and one more CNOT to make a GHZ state. Which outcomes do you expect?
Show answer
Only 000 and 111, each about half the time.
- How many amplitudes describe 10 qubits? 30 qubits?
Show answer
2¹⁰ = 1,024 and 2³⁰ = 1,073,741,824, about a billion.
8. Do a project
Pick one. Each follows the routine from Guide 1: predict, run the baseline, change one variable, analyze.
← Session 2Session 4: Real hardware: compilation and noise →
For instructors: Teacher notes for Session 3