Bell / CHSH · entanglement breaks local realism
Can the correlations between two entangled particles be explained by any theory in which each particle carries predetermined answers fixed at emission (a 'local hidden variable') — or does nature refuse to be locally real?

▶ Run the simulationSee the measured result
Units: dimensionless (CHSH correlator S = 2√2, Tsirelson's bound)
How the lab tests it
Emit two spin-½ particles in the singlet Bell state |ψ⁻⟩ = (|↑↓⟩ − |↓↑⟩)/√2 toward two distant analyzers. Alice measures spin along an axis at angle a, Bob along b, each getting ±1; quantum mechanics gives the correlation E(a,b) = ⟨AB⟩ = −cos(a−b). Monte-Carlo-sample the ±1 outcomes from the QM joint distribution (never the formula for S), estimate the four correlators from the counts, and form the CHSH combination S = E(a,b) − E(a,b′) + E(a′,b) + E(a′,b′) at the optimal angles a=0°, a′=90°, b=45°, b′=135°, swept across 24 seeds. Controls: an explicit local-hidden-variable model (shared emission angle λ, deterministic local response), and a Werner state of tunable visibility V.
What it checks
Tsirelson's bound S = 2√2 ≈ 2.828 — recovered from the sampled counts to ±0.01, with EVERY seed exceeding the local-realist bound |S| ≤ 2 by ≈ 0.83 (the violation is unambiguous on each single run). This is Bell's theorem, measured: no theory of local hidden variables can reproduce quantum mechanics. Two controls falsify local realism — the explicit local-hidden-variable model, scanned over all analyzer settings, never climbs past S = 2 (it saturates there but cannot reach 2√2); and a Werner state gives S(V) = 2√2·V, so the violation switches off CONTINUOUSLY and crosses the classical bound exactly at V = 1/√2 ≈ 0.707. The bound 2√2 is never plugged in — it emerges from the sampled outcomes. Bell (1964) / CHSH (1969) / Tsirelson (1980), confirmed by Aspect (1982) and the loophole-free tests (2015), Nobel Prize 2022 — the lab's first world about quantum entanglement and nonlocality
Bell / CHSH inequality calculator (correlator, Tsirelson bound, Werner visibility, pairs needed)
Two particles, four dials, and a number that decides whether the world carries its answers with it. Nothing on this page is stored: the local bound is the exact integer 2, the no-signalling bound the exact integer 4, and Tsirelson's ceiling is ASSEMBLED as 2·√2 = 2.8284271247461903 — never pasted, never reached through a cosine. Everything else is built from the analyzer angles you type. The singlet correlator is E(a,b) = −cos(a−b), and the CHSH combination of four of them is bounded by 2 for ANY theory in which each particle left the source carrying predetermined answers. Quantum mechanics reaches 2√2 and stops there. THE ONE-PARAMETER FAMILY IS WHERE THIS PAGE EARNS ITS KEEP, because it turns the theorem into a function you can differentiate: put the four dials at 0, φ, 2φ, 3φ and S(φ) = 3cos φ − cos 3φ, whose maximum sits at φ = 45° EXACTLY — dS/dφ = 3(sin 3φ − sin φ) vanishes when 3φ = π − φ — and equals 4/√2 = 2√2 there. Feed the SAME four angles to the best local hidden variable, a shared emission direction with deterministic local responses, and its triangular correlator returns −2 for every φ in the band: local realism has a PLATEAU exactly where quantum mechanics has a PEAK, and the peak is taller by a factor of √2. THE EXCESS OVER THAT PLATEAU IS THE PHYSICS, and it is the hardest number here to compute. S(φ) − 2 differences two quantities that both tend to 2, so the obvious spelling destroys it: scored against a 400-bit fixed-point truth, (3cos φ − cos 3φ) − 2 is 5.9e-5 wrong at φ = 1e-6 rad, 48% wrong at 1e-8, and 100% wrong at 1e-10, where it returns a flat zero against a true excess of 3e-20. Written as the versine 2sin²(3φ/2) − 6sin²(φ/2) it is correctly rounded everywhere measured — and at the peak it returns the correctly-rounded double for 2√2 − 2 while the obvious 2·SQRT2 − 2 lands TWO ulps high. That subtraction is exact — add 2 back and fl(2√2) returns bit-for-bit — and it is wrong anyway, because fl(2√2) was rounded at a quantum four times coarser than the answer's own and an exact subtraction cannot give back a bit the rounding already spent. The violation margin is the one number in Bell's theorem that has to be positive, so this page assembles it cancellation-free and reuses that value wherever it is needed. Three more things fall out of it. The three ceilings are in geometric progression — 2, 2√2, 4, each step exactly √2 — so quantum mechanics climbs precisely half way from what a lookup table can do to what causality alone permits, and nothing in relativity says why it stops. The margin 2√2 − 2 = 2(√2−1) = 0.8284 is ALSO the symmetric detection efficiency a CHSH test must beat before the fair-sampling loophole closes, which is why loophole-free tests waited until 2015. And the statistics are gentler than the reputation: each correlator is a mean of ±1 draws, so SE(S) = √(4(1−E²)/N) = √(2/N) at the optimal angles, and a five-sigma violation needs N = 2z²/(2√2−2)² — seventy-three pairs per setting. The difficulty of these experiments was never the counting statistics. The engine's trig is disclosed rather than hidden: at the optimal settings all four correlators are 1/√2 in exact arithmetic and the engine returns two distinct doubles among them, so the assembled |S| misses fl(2√2) in the last place — a fact about cosines, not about spin. Three things this page will NOT do. It will not derive E(a,b) = −cos(a−b): that is the Born rule applied to the singlet, i.e. quantum mechanics itself, and Bell's theorem takes those correlations as given. It will not tell you whether an experiment closed a loophole — that is a question about spacelike separation and real detectors, not about four numbers. And it will not correct a single value the finding recovered; it prices closed forms against them and reports the gap rather than choosing a winner.
E(a,b) = −cos(a−b) · S = E(a,b) − E(a,b′) + E(a′,b) + E(a′,b′) · local realism |S| ≤ 2, quantum |S| ≤ 2√2 = 2.8284271, no-signalling |S| ≤ 4 · optimal family a=0, b=φ, a′=2φ, b′=3φ: S(φ) = 3cos φ − cos 3φ, max at φ = 45° exactly · S − 2 = 2sin²(3φ/2) − 6sin²(φ/2) · Werner: S(V) = 2√2·V, threshold V* = 1/√2 · SE(S) = √(4(1−E²)/N) = √(2/N) at the optimal angles, N = 2z²/(2√2−2)² pairs per setting