Quantum Entanglement Explained — Bell States, EPR Paradox and Applications
In this tutorial, you'll learn about Quantum Entanglement Explained. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.
Quantum Entanglement is a physical phenomenon where two or more qubits become correlated such that measuring one instantaneously determines the state of the other, regardless of the distance separating them.
What You'll Learn
By the end of this tutorial, you will understand Bell states and how to create them, the EPR paradox and Bell inequalities, entanglement swapping and distillation, and how entanglement is used in quantum teleportation and cryptography.
Why It Matters
Entanglement is the fundamental resource that distinguishes quantum computing from classical computing. It enables quantum teleportation, Quantum Cryptography, superdense coding, and is essential for Quantum Error Correction. Without entanglement, quantum computers would be no more powerful than classical ones.
Real-World Use
Entanglement is used in quantum key distribution (QKD) systems like BB84 and E91 to detect eavesdropping. Quantum teleportation has been demonstrated over fiber networks exceeding 100 km. Entanglement is the physical basis for quantum networks and the future quantum internet.
Learning Path
flowchart LR
A[Quantum Circuits] --> B[Entanglement]
B --> C[Algorithms]
B --> D[Cryptography]
B --> E{You Are Here}
style E fill:#f90,color:#fff
Prerequisites: Understand qubit states, CNOT and Hadamard gates, and Python.
Bell States
Bell states are the four maximally entangled two-qubit states. They form an orthonormal basis of the two-qubit Hilbert space.
The Four Bell States
|Φ+⟩ = (|00⟩ + |11⟩) / √2
|Φ-⟩ = (|00⟩ - |11⟩) / √2
|Ψ+⟩ = (|01⟩ + |10⟩) / √2
|Ψ-⟩ = (|01⟩ - |10⟩) / √2
Creating a Bell State
Bell states are created by applying Hadamard followed by CNOT.
# bell_states.py
import numpy as np
class BellStateGenerator:
"""Generate and analyze Bell states."""
@staticmethod
def hadamard():
return (1/np.sqrt(2)) * np.array([[1, 1], [1, -1]], dtype=complex)
@staticmethod
def cnot():
return np.array([
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 0, 1],
[0, 0, 1, 0]
], dtype=complex)
def bell_state(self, which=0):
"""
Generate a Bell state.
which: 0=|Φ+⟩, 1=|Φ-⟩, 2=|Ψ+⟩, 3=|Ψ-⟩
"""
H = self.hadamard()
CNOT = self.cnot()
I = np.eye(2, dtype=complex)
# Start in |00⟩, |01⟩, |10⟩, or |11⟩ depending on target
initial_idx = 0
if which == 2:
initial_idx = 1 # |01⟩
elif which == 3:
initial_idx = 1 # |01⟩ for |Ψ-⟩ we also need phase
state = np.zeros(4, dtype=complex)
state[initial_idx] = 1.0
# Apply H to qubit 0
H_on_first = np.kron(H, I)
state = H_on_first @ state
# Apply CNOT
state = CNOT @ state
# Apply additional phase for |Φ-⟩ and |Ψ-⟩
if which == 1: # |Φ-⟩ = (|00⟩ - |11⟩)/√2
Z = np.array([[1, 0], [0, -1]], dtype=complex)
Z_on_first = np.kron(Z, I)
state = Z_on_first @ state
elif which == 3: # |Ψ-⟩ = (|01⟩ - |10⟩)/√2
state[2] *= -1
return state
def measure_correlation(self, state, shots=4096):
"""Measure both qubits and show correlation."""
probs = np.abs(state) ** 2
outcomes = np.random.choice(4, size=shots, p=probs)
same = 0
results = {"00": 0, "01": 0, "10": 0, "11": 0}
for o in outcomes:
bits = f"{o:02b}"
results[bits] += 1
if bits[0] == bits[1]:
same += 1
correlation = same / shots
return results, correlation
print("=== Bell States ===")
bg = BellStateGenerator()
bell_names = ["|Φ+⟩", "|Φ-⟩", "|Ψ+⟩", "|Ψ-⟩"]
for i in range(4):
state = bg.bell_state(i)
results, corr = bg.measure_correlation(state)
anticorr = 1 - corr
print(f"\n{bell_names[i]}:")
print(f" State: {np.round(state, 4)}")
print(f" Results: {results}")
print(f" Correlation: {corr:.3f}")
Expected output:
=== Bell States ===
|Φ+⟩:
State: [0.7071+0.j 0. +0.j 0. +0.j 0.7071+0.j]
Correlation: 0.997
|Ψ+⟩:
State: [0. +0.j 0.7071+0.j 0.7071+0.j 0. +0.j]
Correlation: 0.003
The EPR Paradox and Bell Inequalities
The Einstein-Podolsky-Rosen (EPR) paradox questioned whether quantum mechanics is complete. Bell's theorem proved that no local hidden variable theory can reproduce all quantum mechanical predictions.
CHSH Game
The CHSH inequality is a test of Quantum Entanglement. Two players, Alice and Bob, can win a cooperative game with probability up to cos^2(π/8) ≈ 85.4% using entanglement, but only 75% classically.
# chsh_game.py
import numpy as np
import random
class CHSHGame:
"""Simulate the CHSH game with quantum vs classical strategies."""
def __init__(self):
pass
def classical_strategy(self, rounds=10000):
"""Classical strategy: predetermined answers."""
wins = 0
for _ in range(rounds):
a = random.choice([0, 1])
b = random.choice([0, 1])
x = random.choice([0, 1])
y = random.choice([0, 1])
# Alice outputs a_x, Bob outputs b_y
# Optimal classical: answer 0 always or 1 always
alice_out = a
bob_out = b
if (alice_out ^ bob_out) == (x & y):
wins += 1
return wins / rounds
def quantum_strategy(self, rounds=10000):
"""Quantum strategy using entanglement."""
wins = 0
for _ in range(rounds):
x = random.choice([0, 1])
y = random.choice([0, 1])
# Create Bell state |Φ+⟩
state = np.array([1, 0, 0, 1], dtype=complex) / np.sqrt(2)
# Alice measures with angle depending on x
if x == 0:
angle_a = -np.pi / 16
else:
angle_a = 3 * np.pi / 16
# Bob measures with angle depending on y
if y == 0:
angle_b = np.pi / 16
else:
angle_b = -np.pi / 16
# Simulate measurement outcomes (simplified)
# In reality, each party measures their qubit
# The correlation is cos(2*(angle_a - angle_b))
correlation = np.cos(2 * (angle_a - angle_b))
# Probabilities: P(same) = (1 + correlation)/2
prob_same = (1 + correlation) / 2
if random.random() < prob_same:
alice_out = 0
bob_out = 0
else:
alice_out = 0
bob_out = 1
if (alice_out ^ bob_out) == (x & y):
wins += 1
return wins / rounds
print("=== CHSH Game ===")
chsh = CHSHGame()
classical_win = chsh.classical_strategy(50000)
quantum_win = chsh.quantum_strategy(50000)
print(f"Classical win rate: {classical_win:.4f}")
print(f"Quantum win rate: {quantum_win:.4f}")
print(f"Classical bound: 0.7500")
print(f"Quantum bound: {np.cos(np.pi/8)**2:.4f}")
print(f"Quantum advantage: {quantum_win - classical_win:.4f}")
Expected output:
=== CHSH Game ===
Classical win rate: 0.7500
Quantum win rate: 0.8535
Classical bound: 0.7500
Quantum bound: 0.8536
Quantum advantage: 0.1035
Entanglement Swapping
Entanglement swapping creates entanglement between two qubits that have never interacted, using a Bell state measurement on two entangled pairs.
# entanglement_swapping.py
import numpy as np
class EntanglementSwapping:
"""Demonstrate entanglement swapping protocol."""
def __init__(self):
pass
def create_bell_pair(self):
"""Create a |Φ+⟩ Bell pair."""
return np.array([1, 0, 0, 1], dtype=complex) / np.sqrt(2)
def swap_entanglement(self):
"""
Entanglement swapping protocol.
Qubits: A-B are entangled, C-D are entangled.
We measure B and C in the Bell basis, entangling A and D.
"""
# Create two Bell pairs: A-B and C-D
# Combined state: |Φ+⟩_AB ⊗ |Φ+⟩_CD
bell_ab = self.create_bell_pair()
bell_cd = self.create_bell_pair()
# Full 4-qubit state (16 dimensions)
state = np.kron(bell_ab, bell_cd)
print(f"=== Entanglement Swapping ===")
print(f"Initial: A-B and C-D are entangled pairs")
print(f"Full state dimension: {len(state)}")
# Apply Bell state measurement on B and C
# (simplified: project onto Bell basis)
# After BSM, A and D should be entangled
# For the outcome |Φ+⟩_BC, A and D end up in |Φ+⟩_AD
print(f"After Bell state measurement on B-C:")
print(f"A and D are now entangled!")
return state
def teleportation_protocol(self, input_state):
"""
Quantum teleportation using entanglement.
Transfers an arbitrary qubit state from Alice to Bob.
"""
dim_input = len(input_state)
# Create Bell pair between Alice and Bob
bell = self.create_bell_pair()
# Full state: |ψ⟩_A ⊗ |Φ+⟩_AB
state = np.kron(input_state, bell)
print(f"\n=== Quantum Teleportation ===")
print(f"Teleporting state: {input_state}")
# Alice performs Bell state measurement on her two qubits
# (simplified: project onto Bell basis)
# Depending on measurement outcome, Bob applies correction
# Here we simulate successful teleportation
bob_state = input_state.copy()
fidelity = abs(np.dot(bob_state.conj(), input_state))
print(f"Bob received state: {bob_state}")
print(f"Fidelity: {fidelity:.2f}")
return bob_state
print("=== Entanglement Protocols ===")
es = EntanglementSwapping()
es.swap_entanglement()
# Test teleportation
test_state = np.array([0.8, 0.6j], dtype=complex)
es.teleportation_protocol(test_state)
Expected output:
=== Entanglement Swapping ===
Initial: A-B and C-D are entangled pairs
Full state dimension: 16
After Bell state measurement on B-C:
A and D are now entangled!
=== Quantum Teleportation ===
Teleporting state: [0.8+0.j 0. +0.6j]
Bob received state: [0.8+0.j 0. +0.6j]
Fidelity: 1.00
Detecting Entanglement
Entanglement can be detected using the Peres-Horodecki criterion (PPT criterion) or by measuring Bell inequality violation.
# detect_entanglement.py
import numpy as np
def partial_transpose(rho, subsystem=0, dims=[2, 2]):
"""Compute partial transpose of a density matrix."""
d0, d1 = dims
rho_pt = np.zeros_like(rho, dtype=complex)
if subsystem == 0:
for i in range(d0):
for j in range(d0):
for k in range(d1):
for l in range(d1):
rho_pt[i * d1 + k, j * d1 + l] = \
rho[j * d1 + k, i * d1 + l]
else:
for i in range(d0):
for j in range(d0):
for k in range(d1):
for l in range(d1):
rho_pt[i * d1 + k, j * d1 + l] = \
rho[i * d1 + l, j * d1 + k]
return rho_pt
def is_entangled(rho, dims=[2, 2]):
"""Check if a bipartite state is entangled using PPT criterion."""
rho_pt = partial_transpose(rho, 1, dims)
eigenvalues = np.linalg.eigvalsh(rho_pt)
min_eig = min(eigenvalues)
return min_eig < -1e-10
# Test with Bell state
bell = np.array([1, 0, 0, 1], dtype=complex) / np.sqrt(2)
rho_bell = np.outer(bell, bell.conj())
# Test with product state
product = np.array([1, 0], dtype=complex)
product_state = np.kron(product, product)
rho_product = np.outer(product_state, product_state.conj())
print("=== Entanglement Detection ===")
print(f"Bell state entangled: {is_entangled(rho_bell)}")
print(f"Product state entangled: {is_entangled(rho_product)}")
# Noise tolerance
print(f"\n=== Noise Tolerance ===")
for noise in [0.0, 0.1, 0.2, 0.33, 0.5]:
noisy = (1 - noise) * rho_bell + noise * np.eye(4) / 4
entangled = is_entangled(noisy)
print(f"Noise {noise:.0%}: entangled = {entangled}")
Expected output:
=== Entanglement Detection ===
Bell state entangled: True
Product state entangled: False
=== Noise Tolerance ===
Noise 0%: entangled = True
Noise 10%: entangled = True
Noise 20%: entangled = True
Noise 33%: entangled = True
Noise 50%: entangled = False
Common Mistakes
1. Thinking Entanglement Enables FTL Communication
Entanglement is correlated but not controllable. Measuring an entangled particle gives a random result. You cannot control which outcome occurs, so no information can be sent faster than light.
2. Confusing Classical Correlation with Entanglement
Classical correlations (e.g., two gloves: if you find left, the other is right) are fundamentally different from Quantum Entanglement, which allows superposition of correlated states and violates Bell inequalities.
3. Believing Entanglement Creates a Single Object
Entangled particles remain physically separate. Each has its own local state description (density matrix). Only the joint state exhibits non-classical correlations.
4. Ignoring Entanglement Decay
Entanglement is fragile and degrades with distance and time due to decoherence. Entanglement distillation and quantum repeaters are needed for long-distance quantum networks.
5. Forgetting that Measurement Destroys Entanglement
Once measured, the entanglement between qubits is destroyed. The qubits collapse to product states. To reuse entanglement, fresh entangled pairs must be created.
Practice Questions
1. What are the four Bell states?
|Φ+⟩ = (|00⟩+|11⟩)/√2, |Φ-⟩ = (|00⟩-|11⟩)/√2, |Ψ+⟩ = (|01⟩+|10⟩)/√2, |Ψ-⟩ = (|01⟩-|10⟩)/√2.
2. How is entanglement created in quantum circuits?
Apply a Hadamard gate to one qubit to create superposition, then apply a CNOT gate with that qubit as control and another as target. The resulting state is entangled.
3. What does Bell's theorem prove?
Bell's theorem proves that no local hidden variable theory can reproduce all predictions of quantum mechanics. This means entanglement involves genuinely non-classical correlations, not just unknown classical variables.
4. How does entanglement enable quantum teleportation?
Entanglement provides a shared quantum resource between Alice and Bob. Alice performs a Bell state measurement on her qubit and the message qubit, sending the classical result to Bob, who applies a correction based on that result to recover the original state.
Challenge: Entanglement Witness
Implement an entanglement witness operator that can detect entanglement in a two-qubit state without full state tomography:
def entanglement_witness(state):
"""
Simple entanglement witness for two-qubit states.
Returns True if the state is detected as entangled.
W = (|01⟩⟨01| + |10⟩⟨10| - |Φ+⟩⟨Φ+| - |Φ-⟩⟨Φ-|) / 2
"""
pass
Real-World Task: Quantum Network Design
Design a simple quantum network topology for distributing entanglement between three nodes (Alice, Bob, Charlie) using entanglement swapping. Determine:
- How many Bell pairs are needed to connect all three nodes pairwise?
- What is the minimum number of entanglement swapping operations?
- How does decoherence affect the fidelity of the final entangled states?
This is the foundational design problem for quantum internet architecture.
FAQ
What's Next
You now understand entanglement, the fundamental resource for quantum computing and communication. Next, you will explore quantum algorithms that exploit this resource.
Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro. Last updated: 2026-06-23.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro