Linear Program for Testing Nonclassicality and an Open-Source Implementation

Phys Rev Lett. 2024 Feb 2;132(5):050202. doi: 10.1103/PhysRevLett.132.050202.

Abstract

A well-motivated method for demonstrating that an experiment resists any classical explanation is to show that its statistics violate generalized noncontextuality. We here formulate this problem as a linear program and provide an open-source implementation of it which tests whether or not any given prepare-measure experiment is classically explainable in this sense. The input to the program is simply an arbitrary set of quantum states and an arbitrary set of quantum effects; the program then determines if the Born rule statistics generated by all pairs of these can be explained by a classical (noncontextual) model. If a classical model exists, it provides an explicit model. If it does not, then it computes the minimal amount of noise that must be added such that a model does exist, and then provides this model. We generalize all these results to arbitrary generalized probabilistic theories (and accessible fragments thereof) as well; indeed, our linear program is a test of simplex embeddability as introduced in Schmid et al. [PRX Quantum 2, 010331 (2021).2691-339910.1103/PRXQuantum.2.010331] and generalized in Selby et al. [Phys. Rev. A 107, 062203 (2023).PLRAAN2469-992610.1103/PhysRevA.107.062203].