Skip to content
Lesson 2 · Beginner → IntermediateAvailable

Build a Bell pair, step by step

Two gates turn |00⟩ into the most famous entangled state. Follow each step in code, mathematics and the Studio's visualizations.

Step 1

Start from |00⟩

Both qubits start in |0⟩. Kets are written |q1 q0⟩ (Qiskit order), so the rightmost label is q0.

qc = QuantumCircuit(2, 2)
∣ψ0⟩=∣00⟩|\psi_0\rangle = |00\rangle
Step 2

Hadamard on q0

q0 is now in superposition, but the two qubits are still independent: the state is a product, and both Bloch vectors have length 1.

qc.h(0)
(I⊗H)∣00⟩=12(∣00⟩+∣01⟩)=∣0⟩⊗∣+⟩(I \otimes H)|00\rangle = \tfrac{1}{\sqrt2}(|00\rangle + |01\rangle) = |0\rangle \otimes |+\rangle
Step 3

CNOT with q0 as control

The |01⟩ component (q0 = 1) flips q1, giving |11⟩. The result cannot be written as a product of two single-qubit states: the qubits are entangled.

qc.cx(0, 1)
CX0→1 12(∣00⟩+∣01⟩)=12(∣00⟩+∣11⟩)=∣Φ+⟩\mathrm{CX}_{0\to1}\,\tfrac{1}{\sqrt2}(|00\rangle + |01\rangle) = \tfrac{1}{\sqrt2}(|00\rangle + |11\rangle) = |\Phi^+\rangle
Step 4

Look at one qubit alone

Each qubit on its own is maximally mixed: its Bloch vector shrinks to the centre and its entropy is 1 bit. All the information is in the correlations, not in either qubit.

# Studio → State → Bloch → q0 / q1
ρq0=Trq1∣Φ+⟩⟨Φ+∣=12(1001)=I2\rho_{q_0} = \mathrm{Tr}_{q_1}|\Phi^+\rangle\langle\Phi^+| = \tfrac{1}{2}\begin{pmatrix}1&0\\0&1\end{pmatrix} = \tfrac{I}{2}
Step 5

Measure both qubits

Each outcome is random, but the two records always agree. Measuring in the X basis also gives perfect agreement — try it in the Bell Lab.

qc.measure(0, 0)
qc.measure(1, 1)
P(00)=P(11)=12,P(01)=P(10)=0P(00) = P(11) = \tfrac12,\qquad P(01) = P(10) = 0

Why it matters

Bell pairs are the resource behind teleportation, superdense coding and entanglement-based key distribution. Their correlations are stronger than any local classical model allows — the CHSH value reaches 2√2 instead of 2.

Further reading: M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information (2010), §1.3.6 and §2.6.