OQCL   HomeStart Here7 SessionsTextbookProjectsQUEST LabSubmitUse CasesInstructor GuideReferences

Quantum in 7 Sessions › Session 3

1234567

Session 3 — Entanglement

Session 3 of 7Self-studySimulator only

By the end of this session you can write a two-qubit state in the computational basis, build a Bell state with H and CNOT, and say what the measurement results do and do not show.

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

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⟩.

  1. Start: |00⟩.
  2. H on the first qubit: (|00⟩ + |10⟩)/√2.
  3. 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

Tips

7. Check yourself

Answer each question on paper, then open the answer to compare.

  1. 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.

  2. 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.

  3. 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