Quantum Entanglement — Spooky Action at a Distance Explained
In this tutorial, you'll learn about Quantum Entanglement. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.
Quantum Entanglement is a phenomenon where two or more qubits become correlated in such a way that their quantum states cannot be described independently, even when separated by large distances.
What You'll Learn
By the end of this tutorial, you will understand what entanglement is, how to create Bell states, how to verify entanglement using Bell inequalities, and how entanglement enables quantum teleportation and quantum key distribution.
Why It Matters
Entanglement is the resource that makes quantum computing powerful. It enables quantum teleportation, superdense coding, Quantum Cryptography (BB84, E91), and is essential for Quantum Error Correction and quantum internet protocols.
Real-World Use
In 2022, the Nobel Prize in Physics was awarded to Aspect, Clauser, and Zeilinger for experiments with entangled photons. Today, entanglement is used in quantum key distribution systems (like those from ID Quantique) for secure communication. Quantum teleportation over hundreds of kilometers has been demonstrated.
Learning Path
flowchart LR
A[Quantum Circuits] --> B[Entanglement]
B --> C[Quantum Measurement]
C --> D[BB84 QKD]
D --> E[Algorithms]
B --> F{You Are Here}
style F fill:#f90,color:#fff
Prerequisites: Understand quantum circuits, quantum gates, and basic measurement concepts.
What Makes Entanglement Special?
In classical physics, two objects can be correlated (like gloves — left and right). But Quantum Entanglement is stronger. The correlations are non-local and violate Bell inequalities, meaning they cannot be explained by any local hidden variable theory.
Key Properties
- Non-separability: The joint state cannot be written as a product of individual states
- Non-locality: Measuring one qubit instantly affects the other, regardless of distance
- Maximal correlation: Some measurement outcomes are perfectly correlated
- Monogamy: A qubit maximally entangled with one qubit cannot be entangled with another
Bell States
Bell states are the four maximally entangled two-qubit states:
|Φ⁺⟩ = (|00⟩ + |11⟩)/√2
|Φ⁻⟩ = (|00⟩ - |11⟩)/√2
|Ψ⁺⟩ = (|01⟩ + |10⟩)/√2
|Ψ⁻⟩ = (|01⟩ - |10⟩)/√2
Creating Bell States
# bell_states.py
import numpy as np
H = (1/np.sqrt(2)) * np.array([[1, 1], [1, -1]], dtype=complex)
CNOT = np.array([
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 0, 1],
[0, 0, 1, 0]
], dtype=complex)
X = np.array([[0, 1], [1, 0]], dtype=complex)
Z = np.array([[1, 0], [0, -1]], dtype=complex)
def tensor(a, b):
return np.kron(a, b)
def bell_state(index=0):
"""Generate Bell state |Φ⁺⟩ (index 0), |Φ⁻⟩ (1), |Ψ⁺⟩ (2), |Ψ⁻⟩ (3)."""
ket00 = np.array([1, 0, 0, 0], dtype=complex)
# Start with |00⟩
state = ket00.copy()
# Apply H to first qubit
H_I = tensor(H, np.eye(2))
state = H_I @ state
# Apply CNOT
state = CNOT @ state
# Apply correction for different Bell states
if index == 1: # |Φ⁻⟩
state = tensor(Z, np.eye(2)) @ state
elif index == 2: # |Ψ⁺⟩
state = tensor(X, np.eye(2)) @ state
elif index == 3: # |Ψ⁻⟩
state = tensor(Z @ X, np.eye(2)) @ state
return state
names = ['|Φ⁺⟩', '|Φ⁻⟩', '|Ψ⁺⟩', '|Ψ⁻⟩']
for i in range(4):
bs = bell_state(i)
print(f"{names[i]} = {bs}")
Expected output:
|Φ⁺⟩ = [0.70710678 0. 0. 0.70710678]
|Φ⁻⟩ = [ 0.70710678 0. 0. -0.70710678]
|Ψ⁺⟩ = [0. 0.70710678 0.70710678 0. ]
|Ψ⁻⟩ = [ 0. 0.70710678 -0.70710678 0. ]
Verifying Entanglement
Bell Inequality (CHSH)
The CHSH inequality tests whether correlations can be explained by local hidden variables. Quantum mechanics violates this inequality.
# chsh_inequality.py
import numpy as np
def chsh_correlation():
"""Compute the CHSH correlation for the |Φ⁺⟩ Bell state."""
# Measurement angles (in radians)
angles_a = [0, np.pi/2] # Alice's measurement settings
angles_b = [np.pi/4, -np.pi/4] # Bob's measurement settings
# For the |Φ⁺⟩ state, the correlation is cos(2*(a - b))
E = np.zeros((2, 2))
for i, a in enumerate(angles_a):
for j, b in enumerate(angles_b):
E[i, j] = np.cos(2 * (a - b))
# CHSH value: S = E(a,b) + E(a,b') + E(a',b) - E(a',b')
S = E[0,0] + E[0,1] + E[1,0] - E[1,1]
return S
S = chsh_correlation()
print(f"CHSH value S: {S:.4f}")
print(f"Classical bound: |S| <= 2")
print(f"Quantum bound: |S| <= 2√2 = {2*np.sqrt(2):.4f}")
print(f"Quantum violation: {abs(S) > 2}")
Expected output:
CHSH value S: 2.8284
Classical bound: |S| <= 2
Quantum bound: |S| <= 2√2 = 2.8284
Quantum violation: True
The value S = 2√2 exceeds the classical limit of 2, demonstrating that quantum correlations cannot be explained by local hidden variables.
Density Matrix and Partial Trace
For entangled states, the reduced density matrix (tracing out one qubit) gives a mixed state.
# density_matrix.py
import numpy as np
def partial_trace_rho(state_vector, qubit_to_trace, n_qubits=2):
"""Compute the reduced density matrix by tracing out one qubit."""
rho = np.outer(state_vector, np.conj(state_vector))
dim = 2 ** n_qubits
result = np.zeros((dim // 2, dim // 2), dtype=complex)
for i in range(dim // 2):
for j in range(dim // 2):
if qubit_to_trace == 0:
result[i, j] = rho[i, j] + rho[i + dim//2, j + dim//2]
else:
# Trace out second qubit
result[i, j] = (
rho[2*i, 2*j] + rho[2*i + 1, 2*j + 1]
)
return result
# Bell state |Φ⁺⟩
bell = np.array([1, 0, 0, 1], dtype=complex) / np.sqrt(2)
# Reduced density matrix
rho_a = partial_trace_rho(bell, 0)
rho_b = partial_trace_rho(bell, 1)
print("Reduced density matrix ρ_A:")
print(np.round(rho_a, 4))
print(f"\nPurity (tr(ρ²)): {np.trace(rho_a @ rho_a):.4f}")
print(f"Purity = 0.5 indicates a maximally mixed state")
Expected output:
Reduced density matrix ρ_A:
[[0.5+0.j 0. +0.j]
[0. +0.j 0.5+0.j]]
Purity (tr(ρ²)): 0.5000
Purity = 0.5 indicates a maximally mixed state
A pure entangled state has subsystems that are maximally mixed. The purity of 0.5 (less than 1) confirms entanglement.
Entanglement and Cryptography
Entanglement enables secure communication protocols like the E91 quantum key distribution protocol.
How E91 Works
- Alice and Bob each receive one half of an entangled pair
- They randomly choose measurement bases
- When they use the same basis, their results are perfectly correlated
- They publicly compare which bases they used (not the results)
- The matching results form the shared key
- An eavesdropper would disturb the entanglement, revealing their presence
This protocol, proposed by Artur Ekert in 1991, is directly based on entanglement and Bell inequalities. The security comes from the monogamy of entanglement: if an eavesdropper (Eve) interacts with one qubit, she breaks the entanglement between Alice and Bob.
Quantum Teleportation
Quantum teleportation uses entanglement to transfer an unknown quantum state from one location to another without physically moving the qubit.
Teleportation Protocol
# teleportation_demo.py
import numpy as np
def quantum_teleportation(message_state):
"""
Simulate quantum teleportation.
message_state: 2-component vector of the state to teleport
Returns: Bob's final state (should match message_state)
"""
H = (1/np.sqrt(2)) * np.array([[1, 1], [1, -1]], dtype=complex)
X = np.array([[0, 1], [1, 0]], dtype=complex)
Z = np.array([[1, 0], [0, -1]], dtype=complex)
def tensor(a, b, c=None):
if c is None:
return np.kron(a, b)
return np.kron(np.kron(a, b), c)
# Start with |0⟩|0⟩|0⟩
state = np.array([1, 0, 0, 0, 0, 0, 0, 0], dtype=complex)
# Step 1: Create Bell pair between qubits 1 and 2 (Alice and Bob)
# Apply H to qubit 1
H_I_I = tensor(H, np.eye(2), np.eye(2))
state = H_I_I @ state
# Apply CNOT from qubit 1 to qubit 2
# Full 8x8 CNOT matrix for (control=1, target=2)
CNOT_12 = np.zeros((8, 8), dtype=complex)
for i in range(8):
control_bit = (i >> 1) & 1 # qubit 1
target_bit = i & 1 # qubit 2
if control_bit == 1:
target_bit ^= 1
j = (i & 0b110) | target_bit
CNOT_12[j, i] = 1
state = CNOT_12 @ state
# Step 2: Prepare message on qubit 0
# Apply the message state to qubit 0 (initialized to |0⟩)
# We achieve this by applying U such that U|0⟩ = message_state
alpha, beta = message_state
U = np.array([[alpha, -np.conj(beta)],
[beta, np.conj(alpha)]], dtype=complex)
U_I_I = tensor(U, np.eye(2), np.eye(2))
state = U_I_I @ state
# Step 3: Alice applies CNOT from qubit 0 to qubit 1
CNOT_01 = np.zeros((8, 8), dtype=complex)
for i in range(8):
control_bit = (i >> 2) & 1 # qubit 0
target_bit = (i >> 1) & 1 # qubit 1
if control_bit == 1:
target_bit ^= 1
j = (i & 0b100) | (target_bit << 1) | (i & 1)
CNOT_01[j, i] = 1
state = CNOT_01 @ state
# Step 4: Alice applies H to qubit 0
H_I_I2 = tensor(H, np.eye(2), np.eye(2))
state = H_I_I2 @ state
# Step 5: Alice measures qubits 0 and 1 (simplified: project onto outcomes)
# For a full teleportation, we would need to apply corrections based on results
# Here we'll trace out qubits 0 and 1 to get Bob's qubit
# Bob's qubit (qubit 2) state
rho = np.outer(state, np.conj(state))
bob_rho = np.zeros((2, 2), dtype=complex)
for i, j in [(0,0), (0,1), (1,0), (1,1)]:
bob_rho[i, j] = rho[2*i, 2*j] + rho[2*i+1, 2*j+1]
bob_rho += rho[4 + 2*i, 4 + 2*j] + rho[4 + 2*i+1, 4 + 2*j+1]
return bob_rho
# Test teleportation
message = np.array([0.6, 0.8], dtype=complex) # Alice's secret state
bob_state = quantum_teleportation(message)
print(f"Original state: [{message[0]:.3f}, {message[1]:.3f}]")
print(f"Bob's density matrix:")
print(np.round(bob_state, 3))
The teleportation protocol works because entanglement provides a quantum channel between Alice and Bob. Without entanglement, teleportation is impossible.
Common Mistakes
1. Thinking Entanglement Means Instant Communication
Entangled particles are correlated, but you cannot send information faster than light. The measurement outcomes are random and you cannot control them.
2. Confusing Classical Correlation with Entanglement
Classical correlations (like wearing matching socks) can be explained by a shared cause. Quantum Entanglement violates Bell inequalities, proving it is fundamentally different.
3. Assuming All Multi-Qubit States are Entangled
A product state like |00⟩ or |+−⟩ is not entangled. Only states that cannot be written as a product of single-qubit states are entangled.
4. Forgetting that Entanglement is Fragile
Entanglement is destroyed by decoherence. Environmental interactions cause entangled states to decay into mixed states. This is why Quantum Error Correction is necessary.
5. Believing Entanglement Creates Copies
Entanglement does not copy quantum information. The no-cloning theorem still applies. Entanglement allows correlation, not duplication.
Practice Questions
1. What are the four Bell states and how are they related?
The four Bell states are |Φ⁺⟩, |Φ⁻⟩, |Ψ⁺⟩, |Ψ⁻⟩. They differ by phase flips (Z) and bit flips (X) on one qubit of |Φ⁺⟩ = (|00⟩ + |11⟩)/√2.
2. What is the CHSH inequality and what does it measure?
The CHSH inequality bounds the correlations achievable by local hidden variable theories: |S| ≤ 2. Quantum mechanics predicts S = 2√2, violating the bound.
3. How does entanglement enable quantum teleportation?
Entanglement provides a shared quantum channel. Alice performs a Bell measurement on her qubit and the message qubit, sends the classical result to Bob, who applies corrective gates to recover the original state.
4. What is the monogamy of entanglement?
A qubit maximally entangled with one qubit cannot be entangled with any other qubit. If qubit A is maximally entangled with B, it has no quantum correlations with C.
5. How can you detect entanglement experimentally?
By measuring Bell inequality violations, performing quantum state tomography, or checking the purity of reduced density matrices.
Challenge: Entanglement Witness
Implement an entanglement witness operator that can detect whether a given two-qubit state is entangled:
def entanglement_witness(state_vector):
"""
Check if a two-qubit state is entangled.
Returns True if entangled, False otherwise.
Hint: Compute the concurrence or use the PPT criterion.
"""
# Compute concurrence: C = max(0, λ₁ - λ₂ - λ₃ - λ₄)
# where λᵢ are eigenvalues of R = √(√ρ ρ̃ √ρ)
# and ρ̃ = (Y⊗Y)ρ*(Y⊗Y)
pass
Hints: For two qubits, the Peres-Horodecki (PPT) criterion is necessary and sufficient. A state is entangled if the partial transpose has negative eigenvalues.
Real-World Task: Entanglement Distribution
Simulate the distribution of an entangled pair over a noisy channel. Add bit-flip and phase-flip noise to the Bell state and measure the resulting fidelity. Determine how much noise the entanglement can tolerate before becoming separable.
This is the challenge quantum network engineers face when building the quantum internet. Companies like BT and quantum startups are testing entanglement distribution over standard fiber optic cables.
FAQ
Try It Yourself
Create the four Bell states using the Python simulator. Verify they are entangled by computing the concurrence or checking the purity of the reduced density matrix. Try applying noise and observe how the entanglement degrades.
What's Next
You now understand entanglement, the resource that powers quantum computing and Quantum Cryptography. Next, you will learn about quantum measurement and its role in extracting information from quantum systems.
Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro. Last updated: 2026-06-21.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro