An interactive exploration of Bell inequality and quantum advantage
The CHSH game is a cooperative game between two players — Alice and Bob — who cannot communicate once the game begins. A Referee coordinates each round.
Click Play or Step to watch a round of the CHSH game unfold.
The referee’s rule is designed to test whether Alice and Bob can truly coordinate without communication. In three of the four cases, they just need to agree. But in the special (1,1) case, they must disagree — creating a tension that’s impossible to resolve perfectly with any classical strategy.
Formally, Alice and Bob win when their answers satisfy:
The XOR of their answers must equal the AND of their questions:
| x | y | x ∧ y | Need a ⊕ b = | To Win |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | a = b (same) |
| 0 | 1 | 0 | 0 | a = b (same) |
| 1 | 0 | 0 | 0 | a = b (same) |
| 1 | 1 | 1 | 1 | a ≠ b (different) |
Try to beat the 75% classical limit! Choose answers for Alice and Bob each round, or pick a strategy and run automatically.
Each player has 4 deterministic strategies (a function from input to output). That's 4 × 4 = 16 combinations. None beats 75%.
You've seen that every classical strategy maxes out at 75%. This isn't bad luck or a bad strategy — it's a provable mathematical ceiling. No amount of cleverness, pre-planning, or shared randomness can push past it.
But remarkably, quantum mechanics allows Alice and Bob to break this barrier — not by communicating, but through the correlations hidden in entanglement.
The quantum strategy follows the same rules as the classical game — Alice and Bob still cannot communicate once the game begins. The difference is what they share beforehand: instead of just a pre-agreed plan, they share an entangled quantum state.
Before the game, Alice and Bob prepare a Bell state — a pair of qubits in a specific entangled superposition:
Alice takes the first qubit, Bob takes the second. This state means: if both measure in the standard \(|0\rangle, |1\rangle\) basis, they always get the same result — either both 0 or both 1, with equal probability. But the power of entanglement goes further than perfect correlation in one basis.
The referee sends a random bit \(x\) to Alice and \(y\) to Bob, exactly as in the classical game. They must each reply with a bit (\(a\) and \(b\)) without communicating.
Here is the key quantum ingredient. Each player picks a measurement angle \(\theta\) that depends on their input. This angle defines a rotated basis in the \(|0\rangle / |1\rangle\) plane:
Outcome 0 if the qubit is found in \(|0_\theta\rangle\), outcome 1 if found in \(|1_\theta\rangle\).
At \(\theta = 0\), this is just the standard basis: \(|0_\theta\rangle = |0\rangle\) and \(|1_\theta\rangle = |1\rangle\). As \(\theta\) increases, the basis rotates — the “0-direction” tilts away from \(|0\rangle\) toward \(|1\rangle\).
Each player measures their qubit in their chosen basis. The measurement collapses the qubit to one of the two basis states, giving output 0 or 1. That output is their answer to the referee.
When Alice and Bob measure in similar directions (small angle difference), the entanglement causes their outcomes to agree with high probability. When they measure in very different directions (large angle difference), outcomes tend to disagree. By carefully choosing which angle to use for each input, they can make agreements happen in the three “same answer” cases and disagreement happen in the one “different answer” case — beating 75%.
Here is the circuit that implements the quantum strategy. The left half prepares the shared Bell state; the right half shows each player measuring in their input-dependent basis.
H = Hadamard, ⊕ = CNOT, R(θ) = measurement basis rotation. The rotation angle depends on the input: θA(x) for Alice, θB(y) for Bob.
Each angle \(\theta\) defines a measurement basis — a rotated version of the standard \(|0\rangle / |1\rangle\) basis. The optimal strategy spaces four angles evenly at \(\pi/8\) increments. Let's examine each of the four input cases and the exact basis states used.
For the Bell state \(|\Phi^+\rangle\), the probability of getting the same outcome is:
The closer the two measurement directions, the more likely the outcomes agree. At 0 difference → 100% agreement. At \(\pi/4\) → 50%. At \(\pi/2\) → 0%.
Notice the elegant symmetry: the first three cases need agreement (small angle \(\pi/8\) → high cos²), while the special (1,1) case needs disagreement (large angle \(3\pi/8\) → high sin²). All four cases achieve the same ≈ 85.4% win rate!
Adjust the measurement angles and see how the win probability changes. The optimal angles are pre-set — try moving them to see why they're special!
| x | y | Δθ | P(win) | Need |
|---|
For three of the four (x,y) cases, Alice and Bob need the same output. The probability of agreement is \(\cos^2(\Delta\theta)\), which is maximized when the angle difference is small. But for the (1,1) case they need different outputs, with probability \(\sin^2(\Delta\theta)\), maximized when the angle difference is large.
The geometry forces a tradeoff: the four angular gaps between measurement bases are constrained. If you space them evenly at \(\pi/8\) increments around the circle, three gaps are small (\(\pi/8\) each, giving \(\cos^2(\pi/8) \approx 85.4\%\) agreement) and the remaining gap is \(3\pi/8\) (giving \(\sin^2(3\pi/8) \approx 85.4\%\) disagreement). Every case wins with the same high probability!
Let \(d\) be the angular spacing. With evenly spaced angles, the average win probability over all four cases is:
Taking the derivative and setting it to zero, the optimum is at \(d = \pi/8 = 22.5°\), giving \(P_{\text{win}} = \cos^2(\pi/8) \approx 85.36\%\).
Run the same random questions against both strategies simultaneously. The classical strategy always outputs 0; the quantum strategy uses optimal entangled measurements. Watch the gap emerge!
How does each (x,y) input pair contribute? Watch how the quantum advantage concentrates on the special (1,1) case.
| Case | Classical | Quantum | Δ |
|---|---|---|---|
| x=0, y=0 | Run a simulation to see results | ||