The Mermin-Peres magic square provides a simple example of a system of linear equations over
Z/2Z which has no classical solutions but does have a finite-dimensional operator solution. For a long time, it was not known how to construct similar examples over
Z/dZ with
d odd. In this paper, we construct, for every integer
d≥2, a linear system over
Z/dZ that has a finite-dimensional operator solution but no classical solution. For an odd prime
p, our operators act on two
p-dimensional qudits and generate a finite
p-group obtained by adjoining diagonal polynomial phase operators to the generalized Pauli group, thereby forming a natural analogue of the Mermin--Peres magic square. Classical inconsistency follows from an elementary linearity argument comparing assignments on abelian subgroups. Furthermore, we prove a sharp threshold for the required degree of the added polynomial phase operators: our construction uses polynomials up to degree
p−1, and we show that the group formed by polynomials up to degree
p−2 is noncontextual.
We have implemented the six series of three commuting measurement of the Mermin-Peres magic square on an online, five qubit, quantum computer. The magic square tests if the measurements of the system can be described by physical realism (in the EPR sense) and simultaneously are non-contextual. We find that our measurement results violate any realistic and non-contextual model by almost 28 standard deviations. We also find that although the quantum computer we used for the measurements leaves much to be desired in producing accurate and reproducible results, the simplicity, the ease of re-running the measurement programs, and the user friendliness compensates for this fact.
We introduce an algebraic structure for studying state-independent contextuality arguments, a key form of quantum non-classicality exemplified by the well-known Peres-Mermin magic square, and used as a source of quantum advantage. We introduce \emph{commutation groups} presented by generators and relations, and analyse them in terms of a string rewriting system. There is also a linear algebraic construction, a directed version of the Heisenberg group. We introduce \emph{contextual words} as a general form of contextuality witness. We characterise when contextual words can arise in commutation groups, and explicitly construct non-contextual value assignments in other cases. We give unitary representations of commutation groups as subgroups of generalized Pauli
n-groups.