Mermin-Peres Magic Square Game
Overview
Mermin-Peres Magic Square Game
The Mermin-Peres magic square game is a striking demonstration of quantum pseudo-telepathy: a cooperative game that two players, Alice and Bob, can win every single time using shared entanglement but can never win with certainty using any classical strategy, even with unlimited shared randomness. In the game, Alice is given a row of a 3x3 grid and must fill in three values of plus or minus one whose product is plus one, while Bob is given a column and must fill in three values whose product is minus one; they win only if their entries agree in the cell where the row and column intersect. The parity constraints make a consistent classical assignment impossible, capping the classical win rate below 100%, yet by sharing two Bell pairs and measuring commuting observables arranged in the magic square, Alice and Bob can satisfy every constraint simultaneously and win with probability one. This Cirq example builds the shared entangled state, implements the measurement strategy for each row and column, simulates repeated rounds, and confirms the perfect quantum win rate. It is a vivid, self-contained illustration of how entanglement provides correlations with no classical explanation.
Run it
pip install -r requirements.txt
python magic_square.py
Source and license
Imported from examples/magic_square.py in quantumlib/Cirq at v1.6.1, under the Apache License 2.0. Original authors: The Cirq Developers. The upstream LICENSE is included alongside this example.
This entry was created automatically from publicly available records. QCR links to public sources and only stores repository content where the license permits redistribution.
Versions
Cite all versions? Use the base QCR ID to always reference the latest version of this entry.
Join the Discussion
Comments (0)
No comments yet. Be the first to share your thoughts!