Skip to content
Tutorials Center
My learning

Topics

Lesson 16 of 39 ยท Entanglement

CHSH and Bell's Inequality

See why no hidden-variable theory can reproduce entanglement: play the CHSH game, compute the classical bound of 2 and the quantum value of 2 times sqrt(2) in NumPy simulations.

Einstein, Podolsky and Rosen asked in 1935 whether the correlations of entangled particles could be explained by "hidden" properties fixed in advance, like two sealed envelopes with matching cards. In 1964 John Bell showed that this question has an experimental answer. The simplest form of his argument is the CHSH inequality (Clauser, Horne, Shimony, Holt), and it has been tested again and again. This lesson plays the game, computes the classical limit by brute force, and reaches the quantum value with a Bell pair.

The CHSH game

Two players, Alice and Bob, are separated and cannot communicate. A referee gives Alice a random bit x and Bob a random bit y. Alice replies with a bit a, Bob with a bit b. They win if

a XOR b = x AND y

In words: they must give the same answer unless both received 1, in which case they must differ. They may agree on any strategy beforehand, including shared random numbers, but not communicate during the game.

Best classical strategy: 75 percent

If Alice and Bob use a predetermined strategy (a "hidden variable"), each of them just decides what to output for each of their two possible inputs. There are only 4 choices for Alice (output for x = 0 and x = 1) and 4 for Bob. A shared random number can only mix between these deterministic strategies, so it cannot beat the best one. Check all 16 combinations:

Python Best classical CHSH strategy by brute force

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

No deterministic strategy wins more than 3 of the 4 input pairs, so the classical limit is 75 percent. In terms of the correlation sum

S = E(0,0) + E(0,1) + E(1,0) - E(1,1)

where E(x,y) is the average of (-1)^(a XOR b) for inputs x, y, the classical bound is |S| <= 2. That is the CHSH inequality.

The quantum strategy

Alice and Bob share a Bell pair Phi+ = (|00> + |11>)/sqrt(2), one qubit each. Each measures their qubit in a basis that depends on their input. A measurement "along angle t" means measuring the observable A(t) = cos(t) Z + sin(t) X, with outcomes +1 and -1 (bit 0 and bit 1). For Phi+ and observables in this plane the joint correlation turns out to be

E = cos(t_A - t_B)

Choose these angles:

  • Alice: x = 0 measures at angle 0 (Z basis), x = 1 at 90 degrees (X basis).
  • Bob: y = 0 at 45 degrees, y = 1 at -45 degrees.

Then three of the four correlations equal +1/sqrt(2) and E(1,1) equals -1/sqrt(2), so

S = 4 / sqrt(2) = 2 sqrt(2) ~ 2.828

This exceeds the classical limit of 2 and is the maximum quantum mechanics allows (Tsirelson's bound). The winning probability is cos^2(pi/8) ~ 0.854.

Python Computing the quantum CHSH value exactly

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Playing the game with sampled measurements

The calculation above used expectation values. A real experiment gathers samples. To simulate it, measure each qubit in its chosen basis: rotate the qubit so that basis becomes the 0/1 basis and sample. For the observable at angle t, applying Ry(-t) before a Z measurement does it. Then count how often the players win.

Python Simulating many rounds of the CHSH game

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The empirical win rate sits near 0.85, well above anything a classical strategy can reach. (Counting statistics with 20,000 rounds give an uncertainty of about 0.0025, so 0.75 is many standard deviations away.)

What does it prove?

Bell's theorem says: no theory where outcomes are fixed in advance by local hidden variables can reproduce all quantum predictions. Experiments from the 1970s onward, culminating in "loophole-free" tests in 2015 and later, find violations of the CHSH inequality, and quantum mechanics wins. The 2022 Nobel Prize in Physics honored Alain Aspect, John Clauser and Anton Zeilinger for this line of work.

Two clarifications keep this honest:

  • It does not show faster-than-light signaling. The marginal outcomes stay random, so no message can be sent.
  • It shows that nature is not "locally real" in the Einsteinian sense: one must give up either locality, the idea of pre-existing definite values, or both. Which to give up is a matter of interpretation.

Practical uses

CHSH violations certify entanglement even when you do not trust your devices. This is the basis of device-independent quantum key distribution and randomness generation: if the game is won more often than 75 percent, the outcomes cannot have been predetermined, hence are genuinely random.

When reading a paper, look for the value of S. Anything above 2 (up to 2.828) indicates quantum correlations; anything above 2.828 signals a bug or a non-quantum signaling resource.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the best winning probability for the CHSH game using any classical strategy?

    Brute force over all deterministic strategies shows at most 3 of 4 input pairs can be won; shared randomness cannot improve on that.
  2. 2. What value of S does the quantum strategy with a Bell pair achieve?

    Four correlations of magnitude 1/sqrt(2) add to 2 sqrt(2), Tsirelson's bound.
  3. 3. What does a CHSH violation rule out?

    No model with pre-existing local values can exceed S = 2.
  4. 4. Does a CHSH violation allow faster-than-light messaging?

    Each party's marginal statistics do not depend on the other's choice, so no information is transmitted.

Summary

  • In the CHSH game, players win if a XOR b = x AND y; classically they win at most 75 percent of rounds (|S| <= 2).
  • Sharing a Bell pair and measuring at angles 0, 90 and +/-45 degrees gives S = 2 sqrt(2) and a win rate of about 85 percent.
  • This rules out local hidden-variable theories (Bell's theorem), confirmed by experiments.
  • It does not allow signaling; it certifies entanglement and underpins device-independent cryptography.

Next: Quantum Teleportation