The Magic Square as a nonlocal game #
MIPRE.LCS.MagicSquare.game is the Mermin--Peres magic square as an LCS instance;
nonlocalGame is the two-player game it induces through MIPRE.LCS.Game.toNonlocalGame, which
is what blueprint lem:ms-direct-anticomm and the Pauli basis test's Magic Square subtest are
about.
The point of this file is the non-vacuity witnesses. A decider that accepts everything, or
rejects everything, makes every soundness statement about the game either false or empty, and
that is not a hypothetical: reports/clgame-format-check-missing.md records the seeded CL
game's missing format check doing exactly that. So each of the four possibilities is pinned
here by decide on explicit answers:
- an oriented pair that is accepted (
accepts_zero), in both orientations; - one that is rejected because the bits disagree (
rejects_disagree); - one that is rejected because the assignment violates its equation
(
rejects_unsatisfied) --- note this one has the bits agreeing, so it isolates the parity check; - one that is rejected because an answer has the wrong shape (
rejects_shape).
layout.V 5 = {2, 5, 8} carries the odd right-hand side, so rejects_odd_column also checks
that the parity actually reads game.b rather than always testing against zero.
The Magic Square as a nonlocal game.
Equations
Instances For
Non-vacuity #
The all-zero assignment satisfies equation 0 (whose right-hand side is 0), so with the
matching bit it is accepted; changing the bit, or the assignment's parity, is rejected.
The all-zero assignment.
Equations
Instances For
The last column has right-hand side 1, so the all-zero assignment fails it: the parity
check reads game.b and does not always test against zero.
... and the assignment that is 1 at variable 2 alone does satisfy it.
An off-support incidence is rejected: variable 3 does not occur in equation 0.
The cells of a constraint #
The magic square's six equations are the three rows and the three columns, in that order, so
the j-th cell of equation c is 3c + j for a row and 3j + (c - 3) for a column.
The j-th cell of constraint c.
Equations
- MIPRE.LCS.MagicSquare.cell c j = ⟨MIPRE.LCS.MagicSquare.cellNat ↑c ↑j, ⋯⟩
Instances For
The position of the variable j within the support of constraint c, the inverse of
cell c; junk (2) for a variable outside the support.
Equations
- MIPRE.LCS.MagicSquare.cellIdx c j = if MIPRE.LCS.MagicSquare.cell c 0 = j then 0 else if MIPRE.LCS.MagicSquare.cell c 1 = j then 1 else 2