Nonlocality & the CHSH Inequality
Nonlocality & the CHSH Inequality
Are the perfect correlations of a Bell pair just hidden pre-agreed answers — a classical "the particles decided in advance" story? Bell's astonishing answer is no, and it is testable. The CHSH inequality turns the philosophy of EPR into an experiment: any theory of local pre-set values obeys , yet quantum mechanics with a Bell state reaches . This lesson derives both bounds from scratch and shows you the experiment in code. It is the sharpest demonstration that entanglement is a genuinely non-classical resource — the bedrock under quantum cryptography and device-independent protocols.
Learning Objectives
After this lesson you will be able to:
- State the assumptions of a local hidden-variable (LHV) model and reconstruct the EPR argument for "incompleteness."
- Derive the classical CHSH bound from locality and realism alone.
- Define the CHSH operator, compute for a Bell state, and reach the quantum (Tsirelson) bound .
- Identify the optimal measurement settings and that saturate the violation.
- Explain what a CHSH violation does — and does not — imply for quantum computing and cryptography, and reproduce in NumPy.
Intuition
Two distant labs, Alice and Bob, each receive one qubit of a shared Bell pair. Each freely chooses one of two measurement settings and records a outcome. They repeat many times and tally how often their outcomes agree. The classical worldview — local realism — says each particle carries a predetermined answer for every possible setting (realism), and Alice's choice can't influence Bob's distant outcome (locality). Bell's genius was to find a single number , built from four correlation tallies, that any such pre-set strategy must keep at . Quantum mechanics, using a genuinely entangled pair and cleverly misaligned measurement angles, pushes all the way to $2\sqrt2\approx 2.83$. Nature sides with quantum mechanics. The correlations are not pre-agreed answers; there is no local script. That is nonlocality, and CHSH is how we catch it red-handed.
Theory
Local hidden-variable models and the EPR argument
[EPR35] noticed that for a Bell pair, measuring qubit lets you predict qubit with certainty without disturbing . By their "criterion of reality," must then have a pre-existing definite value — an element of reality — for that observable. But you can do the same for a different, incompatible observable by measuring differently. EPR concluded that both incompatible observables of have simultaneous definite values, which quantum mechanics refuses to assign, so QM must be incomplete: there should exist hidden variables that fix all outcomes in advance.
A local hidden-variable (LHV) model formalizes this. There is a shared variable (drawn with some distribution ) carrying everything decided "at the source." Alice's outcome for setting is a fixed function ; Bob's for setting is . The two crucial assumptions:
- Realism: outcomes are functions of — definite before measurement.
- Locality: does not depend on Bob's setting , nor on Alice's setting (no spooky influence at a distance).
The measured correlation for settings is the expected product of outcomes,
Deriving the classical CHSH bound
Alice picks between two settings ; Bob between . Define the CHSH quantity
Work with a single fixed first. Write , , , , each in . Group the four products:
Here is the key combinatorial fact. Since , exactly one of and is and the other is :
- if , then and ;
- if , then and .
So the whole expression equals or , and since , its value is exactly :
Now average over with , . Averaging cannot increase the magnitude (triangle inequality / Jensen):
This is the CHSH inequality [CHSH69] — a theorem about any local-realistic theory, with no quantum mechanics used. Violating it rules out all such theories at once.
The CHSH operator and the quantum prediction
Quantum mechanics replaces -valued functions with -eigenvalued observables. A single-qubit measurement "along direction " is the Hermitian observable , with eigenvalues (1.3.2). Restricting to the – plane and parametrizing by an angle , define
Let Alice use observables , on her qubit and Bob , on his. The quantum correlation is the expectation of the joint observable,
For the Bell state a direct computation gives a remarkably clean result. Using , , and the mixed terms (from Lesson 1.4.2),
So the Bell-state correlation depends only on the angle difference: . Define the CHSH operator
The Tsirelson bound and the optimal angles
We want to maximize . Set the four relative angles so that three terms are and the subtracted one is . The standard choice:
Then every relevant angle gap is or , and (recall , so the relevant doubled gaps are and ):
This violates the classical bound by a factor . The value is not an accident of these angles — it is the maximum achievable in quantum mechanics, Tsirelson's bound.
Proof of Tsirelson's bound. Each is Hermitian with , and operators on different qubits commute, . Consider . Expanding and using and commutativity across the tensor factors,
(The comes from the four squared terms; the cross terms collect into the commutator product — a short but careful expansion.) Now bound the operator norm. For Hermitian with , , and likewise . Hence
so . Since for any state,
The Bell state with the angles above saturates it. ∎
What violation means for quantum computing
A CHSH violation certifies, assuming only locality and the validity of quantum statistics, that:
- The state is genuinely entangled — no separable state can exceed (separable correlations are convex mixtures of products, hence LHV, hence ).
- The correlations are not reproducible by any local pre-set strategy: entanglement is a real physical resource, not bookkeeping.
- It underwrites device-independent protocols: in device-independent QKD and certified randomness, the security/randomness is guaranteed by the observed value of alone, without trusting the internal workings of the devices — a violation of proves the presence of fresh, unpredictable quantum randomness.
What it does not mean: no faster-than-light signaling (the marginal of each side is unaffected by the other's setting — the no-signaling principle holds), and a CHSH violation by itself does not imply a computational speedup. Entanglement is necessary for quantum advantage but not sufficient; the speedup story is Term 3.
Worked Examples
Example 1 — A best-possible classical strategy still gives
Suppose the hidden variable always sets and (everyone says "" always). Then for all settings, and . A more adversarial deterministic strategy: , , gives : . By the derivation, no deterministic (or randomized) local strategy can beat — these saturate the classical bound but cannot reach the quantum .
Example 2 — Computing one quantum correlator by hand
Take (so ) and (so $B_0=\cos45^\circ,Z+\sin45^\circ,X =\tfrac1{\sqrt2}(Z+X)$). Then
This matches , confirming the angle-difference formula on a single term.
Example 3 — Why misaligned angles are essential
If Alice and Bob use the same two settings (, "aligned"), correlators become and , and the four-term sum collapses to — no violation. The violation requires the relative angles to be apart so that all four cosine terms cooperate. Maximal entanglement provides the perfect correlation ; the angles convert that into a value above . Both ingredients — the entangled state and clever incompatible measurements — are necessary.
Hands-on (Python)
import numpy as np
# Single-qubit Pauli observables (eigenvalues ±1):
Z = np.array([[1, 0], [0, -1]], dtype=complex)
X = np.array([[0, 1], [1, 0]], dtype=complex)
kron = np.kron
# Measurement observable in the X–Z plane at "angle" theta (radians):
# M(θ) = cos(2θ) Z + sin(2θ) X (still Hermitian, M² = I, eigenvalues ±1)
def M(theta):
return np.cos(2*theta) * Z + np.sin(2*theta) * X
# Bell state |Φ+> = (|00> + |11>)/√2:
ket0 = np.array([1, 0], dtype=complex)
ket1 = np.array([0, 1], dtype=complex)
phi = (kron(ket0, ket0) + kron(ket1, ket1)) / np.sqrt(2)
def correlator(a, b, state=phi):
"""E(a,b) = <ψ| M(a) ⊗ M(b) |ψ> (real-valued correlation in [-1,1])."""
op = kron(M(a), M(b))
return np.real(state.conj() @ op @ state)# Standard optimal CHSH settings (in degrees -> radians):
deg = np.pi / 180
a0, a1 = 0*deg, 45*deg # Alice's two settings
b0, b1 = 22.5*deg, 67.5*deg # Bob's two settings
E00 = correlator(a0, b0)
E01 = correlator(a0, b1)
E10 = correlator(a1, b0)
E11 = correlator(a1, b1)
S = E00 - E01 + E10 + E11 # the CHSH combination
print(f"E(a0,b0)={E00:+.4f} E(a0,b1)={E01:+.4f} "
f"E(a1,b0)={E10:+.4f} E(a1,b1)={E11:+.4f}")
print(f"S = {S:.6f} classical bound = 2 Tsirelson = {2*np.sqrt(2):.6f}")
# E(a0,b0)=+0.7071 E(a0,b1)=-0.7071 E(a1,b0)=+0.7071 E(a1,b1)=+0.7071
# S = 2.828427 classical bound = 2 Tsirelson = 2.828427
print("Violates |S| <= 2 ?", abs(S) > 2) # True# Sanity checks: a separable (product) state can NEVER violate |S| <= 2.
prod = kron(ket0, ket0) # |00>, a product state
Sp = (correlator(a0, b0, prod) - correlator(a0, b1, prod)
+ correlator(a1, b0, prod) + correlator(a1, b1, prod))
print(f"Product-state S = {Sp:.6f} (|S| <= 2, no violation)")
# Brute-force confirmation of Tsirelson: optimize over all four angles.
best = 0.0
grid = np.linspace(0, np.pi, 181) # 1° grid
for a0g in grid:
e0 = np.array([correlator(a0g, bg) for bg in grid]) # E(a0, ·)
for a1g in grid:
e1 = np.array([correlator(a1g, bg) for bg in grid]) # E(a1, ·)
# S = E(a0,b0) - E(a0,b1) + E(a1,b0) + E(a1,b1);
# the b0 contribution is (e0 + e1), the b1 contribution is (-e0 + e1).
cand = np.max(e0[:, None] + e1[:, None] + (-e0[None, :] + e1[None, :]))
best = max(best, cand)
print(f"max S over angle grid ≈ {best:.4f} (→ 2√2 = {2*np.sqrt(2):.4f})")A brief Braket version estimates one correlator from shots on the free local simulator (no AWS charges). To measure we rotate that axis onto with , then measure in the computational basis and assign to outcomes .
# pip install amazon-braket-sdk
from braket.circuits import Circuit
from braket.devices import LocalSimulator
device = LocalSimulator() # free, runs locally
def estimate_E(theta_a, theta_b, shots=20000):
"""Estimate E(a,b)=<M(a)⊗M(b)> on a Bell pair via shot statistics."""
c = Circuit().h(0).cnot(0, 1) # prepare |Φ+>
c.ry(0, -2*theta_a).ry(1, -2*theta_b) # rotate measurement axes onto Z
counts = device.run(c, shots=shots).result().measurement_counts
e = 0.0
for bitstring, n in counts.items():
# outcome value = (+1 for '0', -1 for '1') on each qubit; product gives ±1
parity = (-1)**(int(bitstring[0]) + int(bitstring[1]))
e += parity * n
return e / shots
deg = 3.141592653589793/180
E00 = estimate_E(0*deg, 22.5*deg); E01 = estimate_E(0*deg, 67.5*deg)
E10 = estimate_E(45*deg, 22.5*deg); E11 = estimate_E(45*deg, 67.5*deg)
S = E00 - E01 + E10 + E11
print(f"Shot-estimated S ≈ {S:.3f} (expect ≈ 2.83, > 2)")Shots and statistics. The shot estimate fluctuates by (Appendix E §7); with shots per correlator you will reliably see between roughly and — comfortably above . Real experiments must also close the locality and detection loopholes; the first loophole-free violations came in 2015.
Exercises
E1 (easy). A friend claims a clever classical (LHV) strategy that reaches . Without computing their strategy, explain why they must be mistaken.
Solution
The derivation shows that for every hidden variable , the bracket , so the average . No LHV strategy — deterministic or randomized — can exceed . A claimed either uses entanglement (not LHV) or contains an error. ∎
E2 (easy). Verify for the optimal angles using .
Solution
, , so and $E=\cos(2\cdot(-22.5^\circ)) =\cos(-45^\circ)=\tfrac1{\sqrt2}$. ✓
E3 (medium). Show that the aligned settings , give (no violation), confirming that misalignment is essential.
Solution
; ; ; . Then . Exactly the classical bound — no violation. ∎
E4 (medium). Derive the correlator formula for from and .
Solution
. Taking the expectation in and dropping the zero cross terms, $E=\cos2a\cos2b,\langle Z\otimes Z\rangle+\sin2a\sin2b,\langle X\otimes X\rangle =\cos2a\cos2b+\sin2a\sin2b=\cos(2a-2b)=\cos(2(a-b))$, using the cosine difference identity. ∎
E5 (hard). Prove Tsirelson's bound by establishing and bounding norms. (Fill in the expansion.)
Solution
Write . Square it; let , . . With and , , so . The cross part is where and . Hence the cross part , but with a sign giving (track the signs carefully). Now , (commutator of unit-norm Hermitians), so and . Thus . ∎
E6 (hard). Show that no-signaling holds: Alice's marginal outcome statistics are independent of Bob's setting choice, even at the maximal violation. (So CHSH violation does not enable FTL communication.)
Solution
Alice's marginal for outcome under setting is , where is her projector and acts on Bob's qubit. This expression contains no reference to Bob's setting — summing Bob's measurement over a complete set of outcomes always gives on his side, regardless of which observable he chose. So is the same whatever Bob does; Alice cannot tell Bob's choice from her data alone. No signaling, hence no FTL communication. (Concretely for , every local marginal is .) ∎
Checkpoint
- State the two assumptions of an LHV model and the EPR conclusion drawn from Bell-pair correlations.
- Reproduce the one-line algebraic fact that forces for each .
- What is the CHSH operator, and what correlator does a Bell state give as a function of the angle gap?
- Give the optimal angles and the resulting value of . Why is a hard ceiling?
- Name one thing a CHSH violation proves and one thing it does not prove.
Answers
- Realism (outcomes are predetermined functions of setting and ) and locality (a side's outcome doesn't depend on the other's setting). EPR concluded QM is incomplete — there should be hidden variables fixing all outcomes.
- With , exactly one of is and the other is , so the expression reduces to .
- ; for , .
- give . The ceiling is Tsirelson's bound, from for any quantum observables/state.
- Proves: the state is entangled and no local hidden-variable theory can explain the correlations (also enables device-independent randomness/QKD). Does not prove: faster-than-light signaling (no-signaling holds) or a computational speedup (necessary sufficient).
Further Reading
- [EPR35] Einstein, Podolsky & Rosen — the "incompleteness" argument and elements of reality.
- [Bell64] J. S. Bell — the original inequality showing LHV theories are testable.
- [CHSH69] Clauser, Horne, Shimony & Holt — the experimentally friendly inequality derived here.
- [NC] Nielsen & Chuang, §2.6 — the EPR/Bell discussion and the CHSH game.
- [Pre] Preskill, Ph219, Ch. 4 — Bell inequalities and Tsirelson's bound.
← Prev: Bell States · Up: Term 1 · Next: Schmidt Decomposition →