<figure><img src="image_1.png" /></figure>

HAL
open science

# On the System loophole of generalized noncontextuality

Victor Gitton, Mischa P Woods

► To cite this version:

Victor Gitton, Mischa P Woods. On the System loophole of generalized noncontextuality. Physical Review Research, 2024, 6 (4), pp.043289. 10.1103/PhysRevResearch.6.043289. hal-04886263

HAL Id: hal-04886263

https://hal.science/hal-04886263v1

Submitted on 14 Jan 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# System loophole of generalized noncontextuality

Victor Gitton*

Institute for Theoretical Physics, ETH Zurich, Switzerland

Mischa P. Woods†

University Grenoble Alpes, Inria, Grenoble, France
and Institute for Theoretical Physics, ETH Zurich, Switzerland

<figure><img src="image_3.png" /></figure>

(Received 7 April 2023; accepted 30 September 2024; published 18 December 2024)

Generalized noncontextuality is a well-studied notion of classicality that is applicable to a single system, as opposed to Bell locality. It relies on representing operationally indistinguishable procedures identically in an ontological model. However, operational indistinguishability depends on the set of operations that one may use to distinguish two procedures: we refer to this set as the reference of indistinguishability. Thus, whether or not a given experiment is noncontextual depends on the choice of reference. The choices of references appearing in the literature are seldom discussed, but typically relate to an implicit notion of a system underlying the experiment. This shift in perspective then begs the question: how should one define the extent of the system underlying an experiment? This question depends in part on one's beliefs in the universe being fundamentally continuous or fundamentally composite. To draw a coherent picture of the possible approaches one may use, we start by formulating a notion of noncontextuality for prepare-and-measure scenarios with respect to an explicit reference of indistinguishability. We investigate how verdicts of noncontextuality depend on this choice of reference, and in the process we introduce the concept of the noncontextuality graph of a prepare-and-measure scenario. We then discuss several proposals that one may appeal to in order to fix the reference to a specific choice, and we relate these proposals to different conceptions of what a system really is. With this discussion, we advocate that whether or not an experiment is noncontextual is not as absolute as often perceived.

DOI: 10.1103/PhysRevResearch.6.043289

## I. INTRODUCTION

### A. Nonclassicality in quantum theory

On the face of it, quantum theory looks radically different from classical mechanics. However, how does one capture this difference formally? The seminal work of Bell [1] demonstrated the stringent difference between correlations obtained across spacelike-separated agents depending on whether the resources they share are classical or quantum. This gap is at the heart of many important quantum protocols, such as quantum key distribution [2], quantum communication [3], or randomness certification [4] (see also Ref. [5] for a review of Bell nonlocality). The settings of such protocols inevitably involve several agents that are macroscopically separated. Yet, our intuition is that even a single-system quantum experiment defies our classical intuition. Kochen and Specker [6] (see Ref. [7] for a simplified argument) paved the way for devising formal requirements that a hidden variable model should satisfy in the context of a single system. The crucial

idea therein is that joint measurability of quantum observables should be reflected at the level of the hidden variable model in a noncontextual manner, i.e., in a manner in which the outcome of an observable A does not depend on the context of whether one jointly measures the compatible observable B or C together with A. This notion of noncontextuality has been shown to be a resource for quantum computation [8–11] and quantum communication [12,13].

### B. Generalized noncontextuality

Spekkens [14] conceptually generalized this notion to what is now known as generalized noncontextuality. Generalized noncontextuality is a constraint that is built on top of hidden variable models, and in this context, one would rather think of hidden variable models as being tentative ontological models of nature [14,15]. An ontological model ought to describe what is really going on in a system, and the meaning of “what is really going on” is acquired through the constraints that one implements on top of the ontological model. Specifically, the constraints of generalized noncontextuality follow from the principle that operational equivalences should be explained by equivalences within the ontological model. This principle has been traced back to Leibniz and identified as a crucial methodological principle for the construction of general relativity in Ref. [16]. More practically, generalized noncontextuality has been demonstrated to be a resource in parity-oblivious random access coding [17–19], state discrim-

Published by the American Physical Society under the terms of the Creative Commons Attribution 4.0 International license. Further distribution of this work must maintain attribution to the author(s) and the published article's title, journal citation, and DOI.

<footnote>*Contact author: vgitton@ethz.ch</footnote>

<footnote>†Contact author: mischa.woods@gmail.com</footnote>
ination [20–22], state-dependent cloning [23], and quantum communication [24].

### C. Objectives of this work

The constraints of generalized noncontextuality require a notion of equivalence between operational procedures. However, the exact methodology that one should follow to identify the relevant operational equivalences that hold in a given experiment evades a precise account in the existing literature. Interrogating this methodology has long-reaching implications. For instance, a primary object of study in this field is the existence of a generalized noncontextual ontological model for a prepare-and-measure scenario, and this existence depends on the operational equivalences that one takes into account when formulating the noncontextuality constraints. The objective that we set for this work is the following. We would like to attempt to rebuild a notion of generalized noncontextuality in a way that treats every assumption of the formalism in an operational manner when possible, and that otherwise discusses carefully the remaining conceptual aspects. This leads us to formulate a notion of noncontextuality that explicitly features a choice of reference procedures that one uses to determine the operational equivalences that hold in the prepare-and-measure scenario. For clarity, we call this notion *relative noncontextuality*. We then discuss different proposals for how the choice of these reference procedures can be fixed. Each such proposal yields a different notion of noncontextuality, and some of these proposals are related to different conceptions of what a system really is: this is sketched in Fig. 1. These proposals attempt to reflect the existing literature when possible. As we shall argue, these proposals each have limitations with respect to the extent to which they are well-defined in their current stage or with respect to how they fit in the existing literature. While we do not claim to be able to settle this discussion, we would like to bring it forward in the community. Furthermore, we would like to advocate in favor of more transparency with respect to the methodology that one chooses to endorse in a given study and more discussions with respect to the motivations and foundations of such methodologies.

### D. Outline of the paper

The main notions are summarized in Fig. 2. We start in Sec. II by introducing the necessary operational ingredients. The formalism that we use is mostly standard in the literature and follows closely that of, e.g., Ref. [14], but we make sure not to presume an underlying notion of system. Prepare-and-measure scenarios are introduced in Sec. II A, and our notion of indistinguishability is introduced in Sec. II B: an important concept is that of the reference of indistinguishability, which describes the set of procedures that one uses in order to establish indistinguishability relations. In Sec. II C, given a prepare-and-measure scenario, we introduce a preorder between different choices of references: the preorder describes the case in which a reference is a fine-graining of another one with respect to the indistinguishability relations that are seen at the level of the prepare-and-measure scenario.

<figure><img src="image_4.png" /><figcaption>FIG. 1. Possible approaches to noncontextuality given a prepare-and-measure scenario (“PM” stands for “prepare-and-measure” and “NC” stands for “noncontextuality”). This illustrative diagram should be understood as a Venn diagram in the space of all operational procedures. The operational procedures (i.e., preparations and measurements) of the prepare-and-measure scenario are enclosed in the shaded blue region. The regions enclosed by the red circles correspond to the set of procedures that should be used as a reference of indistinguishability in noncontextuality according to different approaches. In operational noncontextuality, one chooses the procedures of the prepare-and-measure scenario as a reference. Pragmatic noncontextuality allows for investigating several choices of reference that extend beyond the prepare-and-measure scenario, and each choice of reference is thought of as being more or less relevant according to some pragmatic considerations. In ontic-system noncontextuality, the prepare-and-measure scenario is thought of as being a subset of procedures that probe the true extent of the ontic system’s set of operations, although the latter is in general unknown.</figcaption></figure>

Section III focuses on the notion of relative noncontextuality. In Sec. III A, we formulate at first a definition of an ontological model for a prepare-and-measure scenario, and then we specialize to relative noncontextual ontological models in Definition 6. A relative noncontextual ontological model can be thought of as a generalized noncontextual ontological model in the original sense [14], but with an explicit parametrization of the indistinguishability relations that one imposes at the ontological level. In that sense, formally speaking, a relative noncontextual ontological model is similar to the generalized noncontextual ontological model of Ref. [25]. The key difference is that while Ref. [25] assumed a fixed set of operational equivalences as an input, without necessarily specifying how these should be obtained in practice, we parametrize this set of operational equivalences by a choice of reference procedures, which is quite natural and convenient for our purposes. Indeed, the reference procedures will later be related to the procedures that one considers as probing the system. Then, Sec. III B formulates some basic results that relate the reference preorder to the existence of relative noncontextual ontological models for different references. This leads, in Sec. III C, to the notion of relative noncontextuality graph: given a prepare-and-measure scenario, one introduces a vertex in the graph for each choice of reference and indicates, for each vertex, whether there exists a relative noncontextual ontological model for the prepare-and-measure
<figure><img src="image_5.png" /><figcaption>FIG. 2. The relationships between the main notions of this work. For brevity, we use “PM” for “prepare-and-measure,” “OMs” for “ontological models,” and “NC” for “noncontextuality.” A directed edge indicates that the child notion builds on top of the parent notion.</figcaption></figure>

scenario with respect to the reference assigned to the vertex. The vertices of the graph are then ordered with respect to the reference preorder, which constrains the structure of the relative noncontextuality graph according to the results of Sec. III B. As shown in Fig. 8, the generic relative noncontextuality graph will display a behavior where noncontextuality emerges as one fine-grains the indistinguishability relations of the prepare-and-measure scenario.

In Sec. IV, we investigate possible approaches with respect to fixing the reference of indistinguishability that one uses in relative noncontextuality. This is motivated by the fact that generalized noncontextuality in its standard form appears to be concerned with a fixed set of operational equivalences [14,16,25]. We first discuss the notion of in-principle indistinguishability [16,26,27] in Sec. IV B, and we argue in favor of replacing it, in this context, with a notion of indistinguishability with respect to a set of procedures, or indistinguishability with respect to all procedures on a system: indeed, we argue that in-principle indistinguishability is always fundamentally of this form. In Sec. IV C, we describe the proposal of operational noncontextuality [28] that chooses the extent of the prepare-and-measure scenario itself to define the reference of indistinguishability, as represented in Fig. 1. This proposal has the merit of being methodologically simple, but perhaps at the expense of being agnostic of more general considerations. The proposal of Sec. IV D is that of pragmatic noncontextuality: a pragmatic system is a system defined by a set of procedures, and this system is argued to be more or less relevant based on pragmatic considerations (e.g., how interesting that system is, how it is related to interesting tasks, how fundamental it is believed to be, etc.). In the approach of pragmatic noncontextuality, one then embeds the prepare-and-measure scenario into different pragmatic systems, as shown in Fig. 1, each time choosing the reference of indistinguishability to be used in noncontextuality as corresponding to the procedures that define the pragmatic system. Verdicts of pragmatic contextuality are then weighted by the relevance of the choice of pragmatic system under consideration. In Sec. IV E, we discuss the notion of ontic systems, which are conceptual entities whose operational content is in general unknown as suggested

in Fig. 1. This results in the notion of ontic-system noncontextuality: there, given a prepare-and-measure scenario, one should have a prescription of the ontic system that the prepare-and-measure scenario is interacting with, and choose the true tomographically complete set of operations that probe the ontic system as the reference of indistinguishability: this is a possible reading of Ref. [29]. Finally, in Sec. IV F, we discuss the limits of replacing notions of pragmatic systems and ontic systems with notions of locality. We conclude in Sec. V with some open questions.

## II. PREPARE-AND-MEASURE SCENARIOS AND OPERATIONAL INDISTINGUISHABILITY

In this section, we introduce the operational framework on top of which we describe the type of prepare-and-measure scenarios that we shall consider. Furthermore, we introduce a notion of operational indistinguishability that will become crucial in Sec. III when we define relative noncontextual ontological models.

### A. Operational framework

#### 1. Operational procedures and events

We consider an agent in a laboratory. The agent has access to a number of possible actions (“press the blue button,” “turn the red knob to the right,” etc.). The agent furthermore has access to a measurable space $(\Omega, \Sigma)$, where $\Omega$ is a set of atomic observation events (“the green light is flashing,” “the Geiger counter ticked,” “the coin landed on tails,” etc.) and $\Sigma$ is a $\sigma$-algebra over $\Omega$, i.e., a collection of subsets of $\Omega$ that is closed under complement, countable unions, and intersections, and such that $\emptyset, \Omega \in \Sigma$. Here, $\emptyset$ is the empty set that describes the “null event” that never occurs, while $\Omega$ corresponds to the “trivial event” that always occurs. An event that can be observed by the agent is any $\omega \in \Sigma$. For instance, $\omega = \{\text{“the green light is flashing,” “the coin landed on tails”}\}$ is the event describing that the green light is flashing or the coin landed on tails (or both). We denote set union with $\cup$ and set intersection with $\cap$, so that for all $\omega_1, \omega_2 \in \Sigma$, $\omega_1 \cup \omega_2 \in \Sigma$
is the event denoting that $\omega_1$ or $\omega_2$ (or both) occur, while $\omega_1 \cap \omega_2 \in \Sigma$ is the event denoting that both $\omega_1$ and $\omega_2$ occur.

## 2. Procedures, preparations, and effects

The agent can then generate what we refer to as operational procedures, typically denoted $L$, by chaining certain actions, conditioned on the observed events that happened in the past. The set of such procedures is denoted Procedures. This tacitly requires the agent to be equipped with a trusted classical memory. In other words, a procedure is a finite algorithm of the form “execute this action first, then, conditioned on observing this event, execute this second action, else execute this third action, etc.” Preparations, typically denoted $S \in$ Procedures (where the letter choice comes from the analogy to “states”), are simply instances of such general operational procedures. On the other hand, an effect, typically denoted $E$, consists of a procedure $L \in$ Procedures together with an event $\omega \in \Sigma$ that describes the condition of “success” of the effect. This is typically denoted $E = \omega|L \in$ Effects, so that we identify Effects with $\Sigma \times$ Procedures. For instance, the effect $E$ could correspond to “press the blue button and consider the effect a success if the red light is on afterwards,” which is denoted $E = \omega|L$, where $\omega \in \Sigma$ corresponds to “the red light is on” and $L \in$ Procedures corresponds to “press the blue button.” In general, one can compose procedures together, but for our purposes we shall only look at composing effects after preparations. The result is also an effect: for instance, the effect $E|S$ is thought of as being successful if, given a decomposition $E = \omega|L$, the agent sees the event $\omega$ after carrying out the preparation procedure $S$ followed by the procedure $L$. We will occasionally consider effects that correspond to observing an event $\omega \in \Sigma$ without any prior action: this could be denoted $\omega|\text{“do nothing”} \in$ Effects, but we will simply denote this $\omega \in$ Effects by a slight abuse of notation.

## 3. Probabilities

For all $E \in$ Effects, for all $S \in$ Procedures, we assume that the agent has a prescribed probability $\text{Pr}(E|S) \in [0, 1]$ that describes the trust that the agent has in the success of the procedure $E|S$. These probabilities may, for instance, come from an assumption that the agent can repeat the procedure $E|S$ in an independent manner many times, and the probability $\text{Pr}(E|S)$ is the best estimate known for the expected frequency of success of the procedure $E|S$, but this does not really matter for our purposes. Still, this probability distribution must satisfy the following requirements: for all preparations $S \in$ Procedures,

(i) trivial event $\Omega$: for all $E \in$ Effects such that $E = \Omega|L$ for some $L \in$ Procedures, it holds that $\text{Pr}(E|S) = 1$;

(ii) additivity: for all $E_1, E_2, E_3 \in$ Effects such that there exist $L \in$ Procedures and $\omega_1, \omega_2 \in \Sigma$ satisfying

$$E_1 = \omega_1|L, \quad (1a)$$

$$E_2 = \omega_2|L, \quad (1b)$$

$$E_3 = \omega_1 \cup \omega_2|L, \quad (1c)$$

$$\emptyset = \omega_1 \cap \omega_2, \quad (1d)$$

<table><thead><tr><th></th><th>S<sub>1</sub></th><th>S<sub>2</sub></th><th>S<sub>3</sub></th><th>S<sub>4</sub></th><th>S<sub>5</sub></th></tr></thead><tbody><tr><th>Ø</th><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><th>Ω</th><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><th>E<sub>1</sub></th><td>1</td><td>0</td><td><sup>1</sup>&frasl;<sub>2</sub></td><td><sup>1</sup>&frasl;<sub>2</sub></td><td><sup>1</sup>&frasl;<sub>2</sub></td></tr><tr><th>E<sub>2</sub></th><td>0</td><td>1</td><td><sup>1</sup>&frasl;<sub>2</sub></td><td><sup>1</sup>&frasl;<sub>2</sub></td><td><sup>1</sup>&frasl;<sub>2</sub></td></tr><tr><th>E<sub>3</sub></th><td><sup>1</sup>&frasl;<sub>2</sub></td><td><sup>1</sup>&frasl;<sub>2</sub></td><td>1</td><td>0</td><td><sup>1</sup>&frasl;<sub>2</sub></td></tr></tbody></table>

FIG. 3. An instance of a data table. Each entry represents the probability $\text{Pr}(E|S) \in [0, 1]$ of success that one attributes to the execution of the preparation $S$ associated with each column followed by the execution of the effect $E$ associated with each row. The effects $Ø$ and $\Omega$ correspond to the null and trivial events, respectively.

it holds that $\text{Pr}(E_1|S) + \text{Pr}(E_2|S) = \text{Pr}(E_3|S)$. In other words, if an effect is a coarse-graining of mutually incompatible effects, then the probabilities are additive.

It is easy to see that this implies that if $E = Ø|L$ for some $L \in$ Procedures, then $\text{Pr}(E|S) = 0$ for all $S \in$ Procedures.

## 4. Classical mixtures

We additionally endow the agent with a trusted classical random number generator. This allows the agent to generate classical mixtures of preparations, referred to as preparation densities, and classical mixtures of effects, referred to as effect densities. For instance, given a set of preparations $S \subseteq$ Procedures and a set of effects $\mathcal{E} \subseteq$ Effects, the set of preparation densities is denoted $\text{conv}(S)$ and the set of effect densities is denoted $\text{conv}(\mathcal{E})$. A preparation density $s \in \text{conv}(S)$ stands for the formal convex mixture $s = \sum_{S \in \mathcal{S}} \text{Pr}_s(S)S$, where the real coefficients $\{\text{Pr}_s(S)\}_{S \in \mathcal{S}}$ are such that $\text{Pr}_s(S) \ge 0$ and $\sum_{S \in \mathcal{S}} \text{Pr}_s(S) = 1$. Similarly, an effect density $e \in \text{conv}(\mathcal{E})$ stands for the formal convex mixture $e = \sum_{E \in \mathcal{E}} \text{Pr}_e(E)E$ where the real coefficients $\{\text{Pr}_e(E)\}_{E \in \mathcal{E}}$ are such that $\text{Pr}_e(E) \ge 0$ and $\sum_{E \in \mathcal{E}} \text{Pr}_e(E) = 1$. The resulting probabilities of success are then obtained in a convex-linear fashion:

$$\text{Pr}(e|s) = \sum_{E \in \mathcal{E}, S \in \mathcal{S}} \text{Pr}_e(E)\text{Pr}_s(S)\text{Pr}(E|S), \quad (2)$$

i.e., the function $\text{Pr}(\cdot|\cdot):$ Effects $\times$ Procedures $\rightarrow$ [0, 1] is extended convex-linearly in both arguments. Note that a preparation density $s$ or effect density $e$ is an explicit classical mixture, but a preparation $S$ or an effect $E$ may also involve classical randomness in its description.

## 5. Data tables

It will be convenient to represent the probabilities associated with a set of preparations and effects in the form of a data table. A typical data table is shown in Fig. 3. This specific data table is rather idealized since it contains 1's and 0's for nontrivial effects. More generally, a data table can be denoted abstractly as a matrix $\{\text{Pr}(E|S)\}_{E \in \mathcal{E}, S \in \mathcal{S}}$. The sets $S \subseteq$ Procedures of preparations and $\mathcal{E} \subseteq$ Effects of effects are sets of interests. Importantly, we do not really need
<figure><img src="image_6.png" /><figcaption>FIG. 4. An example prepare-and-measure scenario: the set of preparations $S_{pm}$ (set of effects $\mathcal{E}_{pm}$) belonging to the prepare-and-measure scenario is a subset of the columns (rows), and we shade the relevant probabilities.</figcaption></figure>

nor want to assume that a data table is ever “complete”: in principle, there are always additional measurements one could add in the rows and preparations in the columns (which may or may not be redundant). For our purposes, what is important is to remind ourselves that every data table could in principle be extended, but that we nonetheless restrict our attention to a particular finite data table. We shall always assume that any preparation $\mathbf{S}$ or effect $\mathbf{E}$ that we mention is such that we know the associated probability $\text{Pr}(\mathbf{E}|\mathbf{S})$.

## 6. Prepare-and-measure scenarios

In the rest of this work, we will use this definition:

**Definition 1** A prepare-and-measure scenario $(S_{pm}, \mathcal{E}_{pm})$ consists of a finite set of preparations $S_{pm} \subset \text{Procedures}$ and a finite set of effects $\mathcal{E}_{pm} \subset \text{Effects}$ such that the null event and trivial event belong to $\mathcal{E}_{pm}$, i.e., $\emptyset, \Omega \in \mathcal{E}_{pm}$.

In principle, one could allow for infinite sets $S_{pm}$ and $\mathcal{E}_{pm}$, but this is not very important for our purposes. As we will later clarify, given a prepare-and-measure scenario $(S_{pm}, \mathcal{E}_{pm})$, one is really interested in preparation densities belonging to $\text{conv}(S_{pm})$ and effect densities belonging to $\text{conv}(\mathcal{E}_{pm})$. Typically, the prepare-and-measure scenario is a subset of a more general set of preparations and effects that one has performed. Thus, typically, a prepare-and-measure scenario’s data table is a subset of the data table that one has investigated. We can represent this graphically: for instance, we can pick $S_{pm} = \{S_i\}_{i=1}^3$ and $\mathcal{E}_{pm} = \{\emptyset, \Omega\} \cup \{E_i\}_{i=1}^2$ in the example of Fig. 3, which we represent as in Fig. 4.

## B. Indistinguishability

Noncontextual ontological models are based on relations of operational equivalence, or equivalently, of indistinguishability. We make these notions precise here. Let us define what a reference of indistinguishability is, or, for brevity, a reference:

**Definition 2** (Reference of indistinguishability). A reference (of indistinguishability) is any pair $(S_{\text{ref}}, \mathcal{E}_{\text{ref}})$ consisting of a set of preparations $S_{\text{ref}} \subseteq \text{Procedures}$, the reference preparations, and a set of effects $\mathcal{E}_{\text{ref}} \subseteq \text{Effects}$, the reference effects.

Let $(S_{pm}, \mathcal{E}_{pm})$ be a prepare-and-measure scenario. The role of the reference effects in $\mathcal{E}_{\text{ref}}$ is to define an equiva-

<figure><img src="image_7.png" /><figcaption>FIG. 5. An example indistinguishability relation. Visually, looking for a preparation indistinguishability relation in a data table amounts to looking for two convex combinations of columns such that the components within the subset of rows corresponding to the reference $\mathcal{E}_{\text{ref}}$ agree. Looking for an effect indistinguishability relation is analogous, but exchanging the roles of rows and columns.</figcaption></figure>

lence relation of indistinguishability on preparation densities in $\text{conv}(S_{pm})$: we say that two preparation densities $s, s' \in \text{conv}(S_{pm})$ are indistinguishable with respect to $\mathcal{E}_{\text{ref}}$, denoted

$$s \stackrel{\mathcal{E}_{\text{ref}}}{\sim} s', \qquad (3)$$

if and only if it holds that

$$\forall \mathbf{E} \in \mathcal{E}_{\text{ref}} : \text{Pr}(\mathbf{E}|s) = \text{Pr}(\mathbf{E}|s'). \qquad (4)$$

The binary relation $\stackrel{\mathcal{E}_{\text{ref}}}{\sim}$ is an equivalence relation, since it is clearly reflexive, symmetric, and transitive. We repeat these considerations, but exchanging the role of preparations and effects: two effect densities $e, e' \in \text{conv}(\mathcal{E}_{pm})$ are indistinguishable with respect to $S_{\text{ref}}$, denoted

$$e \stackrel{\mathcal{E}_{\text{ref}}}{\sim} e', \qquad (5)$$

if and only if it holds that

$$\forall \mathbf{S} \in \mathcal{S}_{\text{ref}} : \text{Pr}(e|\mathbf{S}) = \text{Pr}(e'|\mathbf{S}). \qquad (6)$$

**Example.** Let us consider the data table of Fig. 3. We choose the prepare-and-measure scenario $S_{pm} = \{S_i\}_{i=1}^3$ and $\mathcal{E}_{pm} = \{\emptyset, \Omega\} \cup \{E_i\}_{i=1}^2$, and the reference sets $S_{\text{ref}} = S_{pm}$ and $\mathcal{E}_{\text{ref}} = \mathcal{E}_{pm}$. This yields the indistinguishability relation

$$S_3 \stackrel{\mathcal{E}_{\text{ref}}^{(1)}}{\sim} \frac{1}{2} S_1 + \frac{1}{2} S_2. \qquad (7)$$

On the other hand, choosing $\mathcal{E}_{\text{ref}}^{(2)} = \{\emptyset, \Omega\} \cup \{E_i\}_{i=1}^3$ lifts this indistinguishability relation:

$$S_3 \stackrel{\mathcal{E}_{\text{ref}}^{(2)}}{\sim} \frac{1}{2} S_1 + \frac{1}{2} S_2, \qquad (8)$$

since these two preparation densities yield different probabilities for the effect $E_3 \in \mathcal{E}_{\text{ref}}^{(2)}$. These considerations are summarized in Figs. 5 and 6: the setting of Eq. (7) is repre-
<figure><img src="image_8.png" /><figcaption>FIG. 6. The indistinguishability relation of Fig. 5 no longer holds because of the larger reference $\mathcal{E}_{\text{ref}}^{(2)}$.</figcaption></figure>

sented in Fig. 5, while the setting of Eq. (8) is represented in Fig. 6.

### C. Reference preorder and faithful references

Let us define the preorder relation

$$ (S_{\text{ref}}, \mathcal{E}_{\text{ref}}) \stackrel{(S_{\text{pm}}, \mathcal{E}_{\text{pm}})}{\leq} (S'_{\text{ref}}, \mathcal{E}'_{\text{ref}}) \quad (9) $$

that intuitively describes that $(S'_{\text{ref}}, \mathcal{E}'_{\text{ref}})$ is a “better or equivalent” reference than $(S_{\text{ref}}, \mathcal{E}_{\text{ref}})$ with respect to distinguishing the procedures of the prepare-and-measure scenario $(S_{\text{pm}}, \mathcal{E}_{\text{pm}})$. In the following, a preorder $\leq$ is a relation on a set $X$ such that $x \leq x$ for all $x \in X$ (reflexivity) and such that $x \leq x'$ and $x' \leq x''$ implies $x \leq x''$ (transitivity) [30].

**Definition 3** (Reference preorder). Let $(S_{\text{pm}}, \mathcal{E}_{\text{pm}})$ be a prepare-and-measure scenario, and let $(S_{\text{ref}}, \mathcal{E}_{\text{ref}})$ and $(S'_{\text{ref}}, \mathcal{E}'_{\text{ref}})$ be two choices of references. The preorder relation

$$ (S_{\text{ref}}, \mathcal{E}_{\text{ref}}) \stackrel{(S_{\text{pm}}, \mathcal{E}_{\text{pm}})}{\leq} (S'_{\text{ref}}, \mathcal{E}'_{\text{ref}}) \quad (10) $$

holds if and only if, for all $s, s' \in \text{conv}(S_{\text{pm}})$, for all $e, e' \in \text{conv}(\mathcal{E}_{\text{pm}})$, the following implications hold:

$$ s \stackrel{\mathcal{E}'_{\text{ref}}}{\sim} s' \Rightarrow s \stackrel{\mathcal{E}_{\text{ref}}}{\sim} s', \quad (11a) $$

$$ e \stackrel{\mathcal{S}'_{\text{ref}}}{\sim} e' \Rightarrow e \stackrel{\mathcal{S}_{\text{ref}}}{\sim} e'. \quad (11b) $$

Not all choices of references $(S_{\text{ref}}, \mathcal{E}_{\text{ref}})$ are satisfactory for our later endeavors. A faithful reference is one that allows us to better (or equally well) distinguish the preparations and effects of a prepare-and-measure scenario as the prepare-and-measure scenario itself does. This can be guaranteed by ensuring that $S_{\text{pm}} \subseteq S_{\text{ref}}$ and $\mathcal{E}_{\text{pm}} \subseteq \mathcal{E}_{\text{ref}}$, but this condition is not necessary. Indeed, it could be that subsets $S_{\text{ref}} \subseteq S_{\text{pm}}$ and $\mathcal{E}_{\text{ref}} \subseteq \mathcal{E}_{\text{pm}}$ still give rise to a faithful reference $(S_{\text{ref}}, \mathcal{E}_{\text{ref}})$ for $(S_{\text{pm}}, \mathcal{E}_{\text{pm}})$: this could be the case if, in some loose sense, $(S_{\text{ref}}, \mathcal{E}_{\text{ref}})$ is a “tomographically complete” subset of $(S_{\text{pm}}, \mathcal{E}_{\text{pm}})$. The criterion that will become relevant is the following:

**Definition 4** (Faithful reference). Let $(S_{\text{pm}}, \mathcal{E}_{\text{pm}})$ be a prepare-and-measure scenario. A reference $(S_{\text{ref}}, \mathcal{E}_{\text{ref}})$ is a faithful reference with respect to $(S_{\text{pm}}, \mathcal{E}_{\text{pm}})$ if and only if

$$ (S_{\text{pm}}, \mathcal{E}_{\text{pm}}) \stackrel{(S_{\text{pm}}, \mathcal{E}_{\text{pm}})}{\leq} (S_{\text{ref}}, \mathcal{E}_{\text{ref}}) \quad (12) $$

with respect to the preorder of Definition 3.

As we will later point out, choosing an unfaithful reference for a prepare-and-measure scenario forbids the existence of a relative noncontextual ontological model.

### III. RELATIVE NONCONTEXTUALITY

In this section, building upon the operational formalism of Sec. II, we will introduce relative noncontextual ontological models. These should be thought of as being a conceptual generalization of the noncontextual ontological models of Ref. [14] in the sense that they allow us to explicitly parametrize the indistinguishability relations that one imposes at the level of the ontological model through the choice of a reference $(S_{\text{ref}}, \mathcal{E}_{\text{ref}})$. In Sec. IV, we will attempt to describe how existing notions of noncontextuality can be recovered from relative noncontextuality together with a prescription of how to fix the reference $(S_{\text{ref}}, \mathcal{E}_{\text{ref}})$.

#### A. Definitions

##### 1. Ontological models

Let us first introduce ontological models. An ontological model [14,15] for a prepare-and-measure scenario $(S_{\text{pm}}, \mathcal{E}_{\text{pm}})$ (Definition 1) is a causal model that mediates the influence of the preparation to the success of the effect through a classical hidden variable. More specifically, it consists of the following:

(i) A finite set $\Lambda$ [31].

(ii) A probability distribution $\mu_s$ over $\Lambda$ for each preparation density $s \in \text{conv}(S_{\text{pm}})$.

(iii) An effect $\xi_e$ over $\Lambda$ for each effect density $e \in \text{conv}(\mathcal{E}_{\text{pm}})$.

We refer to $\Lambda$ as an ontic space, to $\mu_s$ as an ontic state distribution, and to $\xi_e$ as an ontic response function. The intuition of such a model is that upon implementing the preparation density $s \in \text{conv}(S_{\text{pm}})$, one really prepares “something” in the state $\lambda \in \Lambda$ with probability $\mu_s(\lambda)$, and if a given state $\lambda \in \Lambda$ was “really prepared,” then one would observe the success of the effect density $e \in \text{conv}(\mathcal{E}_{\text{pm}})$ with probability $\xi_e(\lambda)$—one thus expects that $\text{Pr}(e|s) = \sum_{\lambda \in \Lambda} \xi_e(\lambda)\mu_s(\lambda)$, on average. The consistency conditions that the ontological model must satisfy are made explicit in Definition 5:

**Definition 5** (Ontological model). Consider a prepare-and-measure scenario $(S_{\text{pm}}, \mathcal{E}_{\text{pm}})$. An ontological model for $(S_{\text{pm}}, \mathcal{E}_{\text{pm}})$ is a triplet

$$ (\Lambda, \{\mu_s\}_{s \in \text{conv}(S_{\text{pm}})}, \{\xi_e\}_{e \in \text{conv}(\mathcal{E}_{\text{pm}})}) \quad (13) $$

such that $\Lambda$ is a finite set, and for all $\lambda \in \Lambda$, for all $s, s' \in \text{conv}(S_{\text{pm}})$, for all $e, e' \in \text{conv}(\mathcal{E}_{\text{pm}})$, the following holds:

(i) The ontic state distributions are well-defined:

$$ \mu_s(\lambda) \geq 0 \quad \text{and} \quad \sum_{\lambda \in \Lambda} \mu_s(\lambda) = 1. \quad (14) $$
(ii) The ontic response functions are well-defined:

$$0 \le \xi_e(\lambda) \le 1. \qquad (15)$$

(iii) The ontic response function implements the trivial event trivially: for all $\mathbf{E} \in \mathcal{E}_{pm}$ such that $\mathbf{E} = \Omega|L$ for some $L \in \text{Procedures}$, it holds that

$$\xi_E(\lambda) = 1. \qquad (16)$$

(iv) The ontic response function is additive with respect to coarse-grainings of mutually incompatible observations: for all $\mathbf{E}_0 \in \mathcal{E}_{pm}$, $\{\mathbf{E}_i \in \mathcal{E}_{pm}\}_{i=1}^n$ such that there exist $L \in \text{Procedures}$, $\{\omega_i \in \Sigma\}_{i=1}^n$ satisfying

$$\mathbf{E}_0 = \cup_{i=1}^n \omega_i | L, \qquad (17a)$$

$$\forall i \in \{1, \dots, n\} : \mathbf{E}_i = \omega_i | L, \qquad (17b)$$

$$\forall i \neq j \in \{1, \dots, n\} : \emptyset = \omega_i \cap \omega_j, \qquad (17c)$$

it holds that [32]

$$\xi_{E_0}(\lambda) = \sum_{i=1}^{n} \xi_{E_i}(\lambda). \qquad (18)$$

(v) The ontological model implements classical mixtures as ontic mixtures, i.e., $\mu$ is convex-linear on $\text{conv}(\mathcal{S}_{pm})$ and $\xi$ is convex-linear on $\text{conv}(\mathcal{E}_{pm})$, which explicitly reads for $s = \sum_{\mathbf{S} \in \mathcal{S}_{pm}} \text{Pr}_{\mathbf{S}}(\mathbf{S})\mathbf{S}$ and $e = \sum_{\mathbf{E} \in \mathcal{E}_{pm}} \text{Pr}_{\mathbf{E}}(\mathbf{E})\mathbf{E}$:

$$\mu_s(\lambda) = \sum_{\mathbf{S} \in \mathcal{S}_{pm}} \text{Pr}_s(\mathbf{S})\mu_s(\lambda), \qquad (19a)$$

$$\xi_e(\lambda) = \sum_{\mathbf{E} \in \mathcal{E}_{pm}} \text{Pr}_e(\mathbf{E})\xi_e(\lambda). \qquad (19b)$$

(vi) The ontological model reproduces the expected statistics:

$$\text{Pr}(e|s) = \sum_{\lambda \in \Lambda} \xi_e(\lambda)\mu_s(\lambda). \qquad (20)$$

In principle, one could relax this definition to allow for subnormalized ontic state distributions, i.e., allow for $\sum_{\lambda \in \Lambda} \mu_s(\lambda) \le 1$, as is discussed in, e.g., Ref. [33], to capture that a preparation procedure can fail to produce the desired result. We do not feel compelled to embrace this relaxation, since “no system produced” ought to correspond to an ontic state of reality where there is “truly nothing.” For instance, the ontological model of Ref. [34] includes an ontic state that correspond to a null occupation number of a photonic mode in the arm of an interferometer. Still, such a generalization is of course possible to implement in the present framework.

Importantly, there always exists an ontological model for any prepare-and-measure scenario (it is easy to explicitly construct one where the ontic space $\Lambda$ is identified with the set of preparations $\mathcal{S}_{pm}$—this is for instance demonstrated in the proof of Lemma 9). In order for the existence of an ontological model to be non-trivial and potentially useful as a classicality criterion, it is thus necessary to add further constraints.

## 2. Relative noncontextuality

A relative noncontextual ontological model for a prepare-and-measure scenario ($\mathcal{S}_{pm}$, $\mathcal{E}_{pm}$) with respect to a reference ($\mathcal{S}_{ref}$, $\mathcal{E}_{ref}$) is an ontological model for ($\mathcal{S}_{pm}$, $\mathcal{E}_{pm}$) that satisfies additional constraints. These are that indistinguishability

relations induced by the reference ($\mathcal{S}_{ref}$, $\mathcal{E}_{ref}$) must be reflected exactly in the ontological model, in the sense that two preparation densities (effect densities) that yield the same statistics as far as $\mathcal{E}_{ref}$ ($\mathcal{S}_{ref}$) is concerned should be represented by the same ontic state distribution (ontic response function) in the ontological model. Formally, using the notation of Sec. II B for indistinguishability relations:

**Definition 6** (Relative noncontextual ontological model). Let ($\mathcal{S}_{pm}$, $\mathcal{E}_{pm}$) be a prepare-and-measure scenario (Definition 1) and ($\mathcal{S}_{ref}$, $\mathcal{E}_{ref}$) be a reference (Definition 2). A relative noncontextual ontological model for ($\mathcal{S}_{pm}$, $\mathcal{E}_{pm}$) with respect to the reference ($\mathcal{S}_{ref}$, $\mathcal{E}_{ref}$) is an ontological model

$$(\Lambda, \{\mu_s\}_{s \in \text{conv}(\mathcal{S}_{pm})}, \{\xi_e\}_{e \in \text{conv}(\mathcal{E}_{pm})}) \qquad (21)$$

for ($\mathcal{S}_{pm}$, $\mathcal{E}_{pm}$) such that, for all $s, s' \in \text{conv}(\mathcal{S}_{pm})$, for all $e, e' \in \text{conv}(\mathcal{E}_{pm})$, the following noncontextuality relations hold:

$$s \stackrel{\mathcal{E}_{ref}}{\approx} s' \Rightarrow \mu_s = \mu_{s'}, \qquad (22a)$$

$$e \stackrel{\mathcal{S}_{ref}}{\approx} e' \Rightarrow \xi_e = \xi_{e'}. \qquad (22b)$$

This definition allows us to say that a prepare-and-measure scenario is noncontextual relative to a certain reference if it admits a relative noncontextual ontological model with respect to that reference. Thus, relative noncontextuality is not an absolute property of a prepare-and-measure scenario, but rather a joint property of a prepare-and-measure scenario and a reference. We will return to the relation between relative noncontextuality and conventional notions of noncontextuality in Sec. IV.

## B. Varying the reference

We now formulate basic results that clarify the consequences of choosing different reference procedures ($\mathcal{S}_{ref}$, $\mathcal{E}_{ref}$). These are proven in the Supplemental Material [35]. First off, in order to allow for the possibility of a relative noncontextual ontological model, it is necessary for the reference to be a faithful reference, i.e., to be a reference that does not coarse-grain the indistinguishability relations induced by the prepare-and-measure scenario itself.

**Lemma 7.** Suppose that a prepare-and-measure scenario ($\mathcal{S}_{pm}$, $\mathcal{E}_{pm}$) admits a relative noncontextual ontological model with respect to a reference ($\mathcal{S}_{ref}$, $\mathcal{E}_{ref}$). Then, the reference ($\mathcal{S}_{ref}$, $\mathcal{E}_{ref}$) is faithful with respect to ($\mathcal{S}_{pm}$, $\mathcal{E}_{pm}$) in the sense of Definition 4.

Now, with respect to the preorder introduced in Definition 3, we have that if

$$(\mathcal{S}_{ref}, \mathcal{E}_{ref}) \stackrel{(\mathcal{S}_{pm}, \mathcal{E}_{pm})}{\le} (\mathcal{S}'_{ref}, \mathcal{E}'_{ref}), \qquad (23)$$

then ($\mathcal{S}'_{ref}$, $\mathcal{E}'_{ref}$) is a reference that allows us to distinguish the operational preparations and effects of a prepare-and-measure scenario at least as well as ($\mathcal{S}_{ref}$, $\mathcal{E}_{ref}$) does, and as a result, constructing a relative noncontextual ontological model for a prepare-and-measure scenario with ($\mathcal{S}'_{ref}$, $\mathcal{E}'_{ref}$) is at least as easy as it is with ($\mathcal{S}_{ref}$, $\mathcal{E}_{ref}$).

**Lemma 8.** Consider a prepare-and-measure ($\mathcal{S}_{pm}$, $\mathcal{E}_{pm}$) and two choices of references ($\mathcal{S}_{ref}$, $\mathcal{E}_{ref}$) and ($\mathcal{S}'_{ref}$, $\mathcal{E}'_{ref}$). If

$$(\mathcal{S}_{ref}, \mathcal{E}_{ref}) \stackrel{(\mathcal{S}_{pm}, \mathcal{E}_{pm})}{\le} (\mathcal{S}'_{ref}, \mathcal{E}'_{ref}), \qquad (24)$$
<figure><img src="image_9.png" /><figcaption>FIG. 7. An example prepare-and-measure scenario and reference on a data table such that the assumptions of Lemma 9 are met, i.e., the reference perfectly distinguishes all the preparations of the prepare-and-measure scenario.</figcaption></figure>

then the existence of a relative noncontextual ontological model for $(S_{pm}, \mathcal{E}_{pm})$ with respect to the reference $(S_{ref}, \mathcal{E}_{ref})$ implies the existence of a relative noncontextual ontological model for $(S_{pm}, \mathcal{E}_{pm})$ with respect to the reference $(S'_{ref}, \mathcal{E}'_{ref})$.

An extreme case happens if the reference $(S_{ref}, \mathcal{E}_{ref})$ is “so good” that there does not exist any nontrivial indistinguishability relation. In that case, constructing a relative noncontextual ontological model becomes trivial. This is, for instance, the case if, for all $S \in S_{pm}$, there exists $E_S \in \mathcal{E}_{ref}$ such that

$$ \forall S, S' \in S_{pm} : \Pr(E_S|S') = \begin{cases} 1 & \text{if } S = S', \\ 0 & \text{otherwise.} \end{cases} \quad (25) $$

Visually, this corresponds to the existence of a subset of rows of the data table inducing a submatrix that looks like an identity block—see, for instance, Fig. 7.

In that case, we have that if some $s, s' \in \text{conv}(S_{pm})$ satisfy

$$ s \stackrel{\mathcal{E}_{ref}}{\sim} s', \quad (26) $$

then, in particular, for all $S \in S_{pm}$, it holds that

$$ \Pr(E_S|s) = \Pr(E_S|s'), \quad (27) $$

which is equivalent to the following: for all $S \in S_{pm}$,

$$ \Pr_S(S) = \Pr_{S'}(S), \quad (28) $$

or in other words, $s = s'$. In general, we can write the following lemma, also proven in the Supplemental Material [35]:

**Lemma 9.** Let $(S_{pm}, \mathcal{E}_{pm})$ be a prepare-and-measure scenario, and let $(S_{ref}, \mathcal{E}_{ref})$ be a faithful reference that is such that for all $s, s' \in \text{conv}(S_{pm})$,

$$ s \stackrel{\mathcal{E}_{ref}}{\sim} s' \Rightarrow s = s'. \quad (29) $$

Then, $(S_{pm}, \mathcal{E}_{pm})$ admits a relative noncontextual ontological model with respect to the reference $(S_{ref}, \mathcal{E}_{ref})$.

### C. Visualizing changes of reference: The relative noncontextuality graph

We now introduce a convenient way of visualizing the effect of choosing different references. Given a prepare-and-

measure scenario $(S_{pm}, \mathcal{E}_{pm})$, we introduce a directed graph $G = (V, E)$ whose vertex set is a (finite) set of references, i.e.,

$$ V = \{(S_{ref}^i, \mathcal{E}_{ref}^i)\}_i. \quad (30) $$

For any two vertices $(S_{ref}^i, \mathcal{E}_{ref}^i)$, $(S_{ref}^j, \mathcal{E}_{ref}^j) \in V$, the edge set $E$ contains the directed edge from $(S_{ref}^i, \mathcal{E}_{ref}^i)$ to $(S_{ref}^j, \mathcal{E}_{ref}^j)$ if and only if

$$ (S_{ref}^i, \mathcal{E}_{ref}^i) \stackrel{(S_{pm}, \mathcal{E}_{pm})}{\le} (S_{ref}^j, \mathcal{E}_{ref}^j), \quad (31) $$

i.e., if the reference $(S_{ref}^j, \mathcal{E}_{ref}^j)$ distinguishes the procedures of $(S_{pm}, \mathcal{E}_{pm})$ at least as well as the reference $(S_{ref}^i, \mathcal{E}_{ref}^i)$ does [36]. We then equip the graph with a Boolean function

$$ f: V \to \{\Box, \bigcirc\} \quad (32) $$

such that $f(v) = \Box$ if $(S_{pm}, \mathcal{E}_{pm})$ admits a relative noncontextual ontological model with respect to the reference $v$ and $f(v) = \bigcirc$ otherwise.

**Example.** A toy example of such a graph is depicted in Fig. 8, where the main features that this graph inherits from Lemmas 7 to 9 are presented. Importantly, the graph shown in Fig. 8 is obtained from a prepare-and-measure scenario $(S_{pm}, \mathcal{E}_{pm})$ that does not admit a relative noncontextual ontological model with respect to the reference $(S_{ref}, \mathcal{E}_{ref}) = (S_{pm}, \mathcal{E}_{pm})$, otherwise, Lemma 8 proves that the graph would only ever feature $\Box$ nodes (as long as all references of the graph are faithful ones). We include in our graph some choices of references that satisfy the assumptions of Lemma 9: there exists a relative noncontextual ontological model for $(S_{pm}, \mathcal{E}_{pm})$ with respect to these references, so that the corresponding vertices in the relative noncontextuality graph are $\Box$ vertices. Such vertices should lie relatively high up in the tree, since they correspond to “good” references with respect to distinguishing the preparations. They are not necessarily “terminal vertices” since other choices of references could improve the distinguishability of the effects in $\mathcal{E}_{pm}$. In Fig. 8, several $\bigcirc \to \Box$ edges are present: each of these corresponds to a transition from contextuality to noncontextuality, or, conceptually, to a transition from nonclassicality to classicality. In general, we do not expect there to be a single such edge: multiple inequivalent transitions from nonclassicality to classicality are logically possible for a given prepare-and-measure scenario.

## IV. CHOICES OF REFERENCES AND NOTIONS OF SYSTEMS

### A. Preliminaries

Given a prepare-and-measure scenario $(S_{pm}, \mathcal{E}_{pm})$, we have so far only described the question of whether or not $(S_{pm}, \mathcal{E}_{pm})$ admits a relative noncontextual ontological model with respect to some choice of reference $(S_{ref}, \mathcal{E}_{ref})$. Importantly, different choices of references are typically associated with different answers to this question—the generic case is depicted in Fig. 8. If $(S_{ref}, \mathcal{E}_{ref})$ is sufficiently large, there will be no statistical equivalences at all: the smallest operational distinction between two operational procedures can always
(assumed to satisfy the assumptions of Lemma 9)

<figure><img src="image_10.png" /></figure>

FIG. 8. A toy example of relative noncontextuality graph. Given a fixed prepare-and-measure scenario ($S_{pm}, \mathcal{E}_{pm}$), each vertex of the graph is associated with a reference ($S_{ref}, \mathcal{E}_{ref}$), and the vertex style represents the answer to the question “does ($S_{pm}, \mathcal{E}_{pm}$) admit a relative noncontextual ontological model with respect to the reference ($S_{ref}, \mathcal{E}_{ref}$)?”: a “yes” is depicted as a black box, and a “no” is depicted as a white circle. The directed edges reflect the preorder relation of Eq. (31). For readability, we omit the directed edge from a vertex to itself, and we also omit the directed edges that can be obtained from the transitivity of the preorder relation. Because of Lemma 7, we omit any choice of reference that is not faithful, which implies that for any drawn reference ($S_{ref}, \mathcal{E}_{ref}$), the directed edge from ($S_{pm}, \mathcal{E}_{pm}$) to ($S_{ref}, \mathcal{E}_{ref}$) exists. Lemma 8 forbids the existence of any edge. If we include reference choices that satisfy the assumptions of Lemma 9, then the corresponding vertices (high up in the tree) are necessarily of type. Broken arrows indicate additional information about a particular vertex.

be witnessed. As Ref. [37] puts it, “it is always logically possible that there exists a measurement that simply reads out a complete description of the preparation. In that case, no two distinct preparations would be equivalent, and so any model would be trivially noncontextual” (p. 4)—see also Lemma 9. Operationally, such a measurement could be implemented by looking at suitable video recordings of what the agent did in the laboratory. To obtain a meaningful notion of classicality from relative noncontextuality, one thus has to motivate a restriction of the scope of procedures going into the reference ($S_{ref}, \mathcal{E}_{ref}$), but moreover, it can be desirable to fix the reference once and for all when looking at a given prepare-and-measure scenario. The rest of this section is dedicated to reviewing different proposals for this purpose.

**System-based approaches to noncontextuality.** Most of the proposals of this section will fall into what we would like to call system-based approaches to noncontextuality. The overarching idea of such approaches is to use some definition of a system that relates to the prepare-and-measure scenario and that furthermore suggests a candidate reference

($S_{ref}, \mathcal{E}_{ref}$). Depending on the relations that one posits between the prepare-and-measure scenario, the reference, and the system, this yields different approaches to noncontextuality. It is important to already highlight that a physical theory, such as quantum theory, does not provide an absolute definition of the system. In nonrelativistic quantum mechanics, the typical situation is that each experiment will be described through operators acting on a Hilbert space. The latter could thus define the system indirectly. However, systems need not be in one-to-one correspondence with Hilbert spaces: it is, to some extent, up to the practitioner of quantum mechanics to place the cut between the system and the environment, between the relevant and irrelevant procedures, etc. Even under the assumption that each system should correspond to some Hilbert space, this does not solve the bulk of the issue: any prepare-and-measure scenario can be physically embedded into several inequivalent Hilbert space representations.

## B. The limits of in-principle indistinguishability

Before turning to the actual proposals, it is useful to fix, to some extent, the terminology that we shall use, as well as some methodological elements. In Ref. [16], noncontextuality is motivated based on a methodological principle traced back to Leibniz. Here, we would like to discuss one specific point that is relevant for our purposes: namely, that “the Leibnizian methodological principle does not appeal to a parochial kind of empirical indiscernibility, judged relative to the particular in-born capabilities of humans or their particular technological capabilities at a given historical moment, but rather to the in-principle variety of empirical indiscernibility” (p. 8, [16]). We argue that it is conceptually and methodologically advantageous for our purposes to consistently replace the phrase “in-principle indiscernibility” with something along the lines of “indiscernibility with respect to all procedures pertaining to the system.”

### 1. Distinguishability in physical theories

For instance, consider the case of a closed laboratory that is either (i) accelerated vertically by means of a rocket attached to the bottom of the laboratory, or (ii) at rest on the surface of Earth, such that the acceleration felt inside the laboratory is identical in the two cases, as discussed in Sec. I B of Ref. [16], and which we illustrate in Fig. 9. Clearly, the type of indiscernibility relation that relates cases (i) and (ii) rests on the assumption that the agent in the laboratory does not look outside the laboratory. Thus, rather than thinking of “in-principle indiscernibility between (i) and (ii),” we would rather think of “indiscernibility between (i) and (ii) with respect to arbitrary procedures pertaining to the spatial extent of the inside of the laboratory.” This is in fact consistent with typical statements of the strong equivalence principle [38] that entail restrictions on the type of experiments (typically referred to as “local experiments”) that should be considered when formulating equivalences between scenarios such as (i) and (ii). These considerations extend more generally to other theories such as quantum theory, which does not contain fundamental indistinguishability relations, but rather indistinguishability relations with respect to some system (or, more generally, with respect to a restriction of the scope of experiments that are allowed
<figure><img src="image_11.png" /><figcaption>FIG. 9. Inspired from Ref. [16]. Consider the preparations $S^{(i)}$ = “perform an experiment in a laboratory accelerated to +g by means of a rocket” and $S^{(ii)}$ = “perform the same experiment in a laboratory on the surface of Earth whose gravitational acceleration is -g.” The two preparations are indistinguishable with respect to the measurements in the set $\mathcal{E}_{\text{ref}}^{(1)}$ that only look at the inside of the laboratory, but are distinguishable with respect to the measurements in the set $\mathcal{E}_{\text{ref}}^{(2)}$ that look outside of the laboratory.</figcaption></figure>

to be used to verify the indistinguishability relation). Thus, we would like to negate, or at least question, the idea that, in the context of indistinguishability, “what is possible in principle is determined by the physical theory that one is assessing” (p. 5, [27]). For instance, in the example of Fig. 9, general relativity does not prevent one from analyzing light coming into the laboratory from the outside and distinguishing the scenarios (i) and (ii). Similarly, quantum theory does not prevent one from distinguishing between the preparation described as “prepare a uniform mixture of the two orthogonal states $|0\rangle$ and $|1\rangle$” and “prepare a uniform mixture of the two orthogonal states $|0\rangle$ and $|1\rangle$” (i.e., $|0\rangle \pm |1\rangle/\sqrt{2}$): indeed, to distinguish between the two, it is always possible to look at video recordings of what happened in the laboratory, or to investigate side effects over the environment of the different preparations corresponding to $|0\rangle$, $|1\rangle$, and $|\pm\rangle$—e.g., it could be that the preparations in fact really prepare states of the form $|0\rangle \otimes |\psi_0\rangle_E, |1\rangle \otimes |\psi_1\rangle_E, |\pm\rangle \otimes |\psi_{\pm}\rangle_E$, where $|\psi_0\rangle_E, |\psi_1\rangle_E$, and $|\psi_{\pm}\rangle_E$ are four orthogonal states of the environment (in fact, the case of the video recording falls into this category upon identifying the possible contents of the video recording with these four perfectly distinguishable states).

## 2. Applications to noncontextuality

Of course, one can define in-principle indistinguishability as a contextual statement where the context provides the relevant notion of system, but this does not fit our goal of interrogating the interplay between different notions of systems and noncontextuality. For instance, we do not embrace without additional considerations the statement that “generalized noncontextuality only implies constraints on the ontological representations of operational processes which are genuinely operationally equivalent—that is, those that give exactly the same predictions for any operational scenario in which they appear. For example, two preparation procedures are only operationally equivalent if they give the same statistics for the outcomes of all possible measurements” (p. 20, [26]). Such a statement only makes sense with respect to an underlying notion of system, and we wish to make this assumption explicit in the absence of a consensus on the status of this assumption. Furthermore, even if the community comes to a consensus on

the appropriate notion of system that one should use in this context, there remains the question of whether one can provide a definitive methodology for identifying the specific system that is relevant for a given prepare-and-measure scenario.

## C. Operationally noncontextual ontological models

A simple approach is to choose the prepare-and-measure scenario ($S_{pm}, \mathcal{E}_{pm}$) itself as the reference. This is, presumably, the approach that requires the least amount of additional considerations and inputs from other notions, such as notions of system. In that sense, one can think of this approach as being an approach to noncontextuality that does not involve systems. Alternatively, one can think of this approach as using a notion of system in which any prepare-and-measure scenario can be thought of as defining a system that does not extend beyond the prepare-and-measure scenario. This yields the following definition:

**Definition 10 (Operational noncontextuality).** A prepare-and-measure scenario ($S_{pm}, \mathcal{E}_{pm}$) is said to be operationally noncontextual if it admits a relative noncontextual ontological model with respect to the reference being ($S_{pm}, \mathcal{E}_{pm}$) itself, otherwise ($S_{pm}, \mathcal{E}_{pm}$) is said to be operationally contextual.

In fact, this choice turns out to be equivalent [39] to the reduced space approach of Ref. [28]. There, a so-called operationally noncontextual ontological model was formulated for a quantum (or, more generally, GPT) model of a prepare-and-measure scenario. Establishing the equivalence thus relies on formulating a sensible definition of a quantum representation of an operational prepare-and-measure scenario as defined in the present Definition 1. Consider the following informal equivalence statement, which is formalized and proven in the Supplemental Material [35], which includes in particular a proof that any prepare-and-measure scenario admits a quantum model.

**Theorem 11 (Informal).** Consider a prepare-and-measure scenario ($S_{pm}, \mathcal{E}_{pm}$), and consider any quantum model of ($S_{pm}, \mathcal{E}_{pm}$). ($S_{pm}, \mathcal{E}_{pm}$) is operationally noncontextual if and only if the quantum model of ($S_{pm}, \mathcal{E}_{pm}$) admits an operationally noncontextual ontological model in the sense of Ref. [28].

Other approaches to noncontextuality can occasionally agree with operational noncontextuality: this is, for instance, the case of Refs. [40,41], where it is shown that a prepare-and-measure scenario corresponding to all quantum states and measurements on some Hilbert space does not admit a noncontextual ontological model with respect to the indistinguishability relations that can be read off from the Hilbert space representation of the prepare-and-measure scenario—the proof is explicitly reproduced is Sec. 3.3.2 of Ref. [28].

**Is nature operationally contextual?** One can say, for instance, that nature is indeed operationally contextual because it admits prepare-and-measure scenarios ($S_{pm}, \mathcal{E}_{pm}$) that are operationally contextual [40,41]. Looking back at the relative noncontextuality graph of Fig. 8, we see that this is the most easily achieved type of contextuality, since we do not allow the reference to be any better than the prepare-and-measure scenario itself. In that sense, it is sensible to say that nature is contextual according to this approach, but this claim is the easiest to establish compared to some other system-based
approaches that we describe below. On the other hand, compared to these other approaches, the operational contextuality conclusions are robust in the sense that the reference is uniquely and unambiguously identified given the prepare-and-measure scenario.

## D. Pragmatic-system approaches to noncontextuality

In this section, we describe an approach to noncontextuality that is based on a pragmatic notion of system. A pragmatic system is based on an operational notion of a system in which a system is defined as a set of operational procedures that are thought of as “probing primarily the system.” The complement of these operational procedures corresponds to those procedures that “probe the system as well as other systems.” Obviously, this definition is not particularly formal, but it should be sufficient for our purposes. This definition is supported, for instance, by Ref. [42], which suggests to “*think of physical systems as being defined by an experimental scenario*” (p. 19). A pragmatic system is a construction on top of an operational system: namely, a pragmatic system is an operational system together with a justification of its importance. Such a justification typically involves relating the set of procedures that defines the pragmatic system to other notions such as, e.g., the richness of a pragmatic system’s phenomenology, the relation of this system to interesting constraints or interesting tasks, etc.

### 1. Examples of pragmatic systems

For instance, based on the collective interest that we have in photonic experiments, it is pragmatically justified to think of a photon polarization system as corresponding to procedures that “[probe] a photon’s polarization in conventional ways (using wave plates and beam splitters)” (p. 2, [43]). Furthermore, one can think of discriminating between different pragmatic systems based on statistical evidence: this is, for instance, a possible reading of some of the considerations of Ref. [44], whose system of interest is the polarization of a single photon, and where other choices of systems related to multiple photons are excluded statistically by experimentally demonstrating the rarity of multiphoton events. In Ref. [14], it is stated that “*An equivalence class of preparation procedures is associated with a density operator $\rho$. This is a positive trace-1 operator over the Hilbert space $\mathcal{H}$ of the system*” (p. 3): this can be seen as a pragmatic definition of quantum-mechanical systems being associated with some Hilbert space. This is a generic feature of pragmatic systems: a physical theory and the associated phenomenology contribute towards understanding certain systems as potentially more fundamental than others. For a different flavor of pragmatism, Ref. [17] considers a system defined by an operational constraint, namely a parity-oblivious constraint, that restricts the scope of possible measurements: “*The parity-oblivious constraint requires that [...] there is no outcome of any measurement for which posterior probabilities for [parity] 0 and [parity] 1 are different*” (p. 2). Such a system inherits its relevance from the relevance of the parity-oblivious constraint.

### 2. Pragmatic-system approaches to noncontextuality

Following the idea that the reference of indistinguishability to be used in a relative noncontextual ontological model should be associated with an underlying system, a pragmatic system is eligible to be used as such. This gives the following notion of noncontextuality:

**Definition 12 (Pragmatic noncontextuality).** A prepare-and-measure scenario ($S_{pm}, \mathcal{E}_{pm}$) is said to be pragmatically noncontextual if, upon identifying a pragmatic system to which ($S_{pm}, \mathcal{E}_{pm}$) belongs, ($S_{pm}, \mathcal{E}_{pm}$) admits a relative non-contextual ontological model with respect to the reference ($S_{ref}, \mathcal{E}_{ref}$) that contains all relevant procedures from the underlying pragmatic system. Otherwise, ($S_{pm}, \mathcal{E}_{pm}$) is said to be pragmatically contextual.

In general, the relevance of a statement of pragmatic noncontextuality is inherited from the extent to which the pragmatic system is well-chosen. As such, there is an influence from the relevance of a pragmatic system to the relevance of pragmatic noncontextuality claims. However, if pragmatic noncontextuality is deemed a relevant notion, there may also be a backaction: for instance, if one prefers to have a pragmatic noncontextual ontological model for a prepare-and-measure scenario, then this could suggest to adjust one's pragmatically chosen system to allow for such a pragmatic noncontextual ontological model. For instance, in Ref. [45], a toy theory that can reproduce some quantum phenomena is developed. This toy theory can be seen as a noncontextual ontological model for a subset of procedures on a qubit (see, e.g., Appendix D of Ref. [46]). Furthermore, in Ref. [45], it is claimed that the toy theory, being a theory of epistemic states, brings us to a better conceptual understanding of “*a great number of quantum phenomena that are mysterious from the ontic viewpoint*” (p. 2). This supports the idea that noncontextual ontological models are useful for our understanding of nature. As a byproduct, this supports the idea that one’s notion of pragmatic systems should not be completely agnostic of considerations of pragmatic noncontextuality.

### 3. Is nature pragmatically contextual?

An important property of a pragmatic system is the extent to which it is thought of as being “fundamental.” In the literature, pragmatic systems associated with some Hilbert space are frequently considered. These are typically considered as being rather fundamental. For instance, in Ref. [14], it is said that “*This terminology allows one to use the phrase ‘quantum theory is contextual’ as a shorthand for ‘quantum theory does not admit a noncontextual ontological model’*” (p. 3). This statement may suggest that Ref. [14] considers that quantum theory is primarily concerned with a particular choice of pragmatic systems, namely those associated with some Hilbert space $\mathcal{H}$: recall that there, “[a]n equivalence class of preparation procedures is associated with a density operator $\rho$. This is a positive trace-1 operator over the Hilbert space $\mathcal{H}$ of the system” (p. 3, [14]). Since there exist pragmatically contextual prepare-and-measure scenarios when the pragmatic system is associated with some Hilbert space [14,40,41], this shows that nature is indeed pragmatically contextual with respect to this type of pragmatic systems. However, there remains the subjectivity of one’s choice of pragmatic Hilbert space to
associate with a prepare-and-measure scenario: as Ref. [42] puts it, “tomographic completeness is contingent on the way that we define the boundaries of the physical system of interest. For example, doing tomography on the polarization of a photon necessarily ignores all other aspects of its wave function; all physical objects are embedded in larger environments that have to be disregarded” (p. 19). Furthermore, as we discussed in the previous paragraph, the conceptual usefulness of having access to a noncontextual ontological model for a prepare-and-measure scenario [45] could potentially be used to argue against this type of pragmatic system as being the most adequate choice. This is indeed a major distinction between (i) the pragmatic systems corresponding to local experiments [38] that appear in the equivalence principle, and (ii) the pragmatic systems corresponding to Hilbert spaces that appear in traditional proofs of contextuality. While the choice of case (i) allowed for (and, in fact, fueled) the development of general relativity, the choice of case (ii) forbids the use of noncontextual ontological models as alternative descriptions of quantum mechanics. As such, a proponent of the pragmatic approach to noncontextuality that wishes to infer from traditional proofs of contextuality [14, 40, 41] that nature itself is contextual should further motivate the reasons for considering other choices of pragmatic system assignments to prepare-and-measure scenarios as being unreasonable.

### E. Ontic-system approaches to noncontextuality

Let us turn to another system-based approach to noncontextuality. Recall that in the previous notions of pragmatic systems, systems were defined primarily through a choice of operational procedures that were then justified and related to other conceptual notions: in that sense, the notion of procedures preceded the notion of system. One can approach the notion of system from a different angle, and argue that a system is a conceptual entity that exists independently of our attempts to probe it: in that sense, a system is seen as more fundamental than potential procedures that probe it. Let us refer to such a system as an “ontic system.” The name reflects the fact that the cut between the system and its environment, in this approach, is seen as a true, ontic property of nature. To each ontic system, we attach a complete set of operations that probe the ontic system: let us refer to this set as the “ontic set of operations.” In general, this set contains operations that have not yet been performed, for which we do not have a description yet, and whose derived statistics are unknown. For instance, let us consider the investigations of Ref. [43] with respect to the polarization degree of freedom of a photon. In an ontic-system interpretation of the polarization degree of freedom of a photon, it is sensible to expect that “The full scope of possible preparations and measurements for photon polarization might be radically different from what our quantum expectations dictate (incorporating new exotic procedures)” (p. 3, [43]): in other words, in general, the ontic set of operations probing an ontic system can incorporate procedures that are not necessarily known yet. Presumably, one’s operational characterization of an ontic system is in general a nonempty inner approximation of the ontic set of operations: this relies on the fact that, typically, one trusts that some known operations really do probe the ontic system under

consideration. To support this claim, one may, for instance, “presume that there is a principle of individuation for different degrees of freedom, which is to say a way to distinguish what degree of freedom an experiment is probing. For instance, we presume that we can identify certain experimental operations as preparations and measurements of photon polarization and not of some other degree of freedom” (p. 9, [43]).

#### 1. The example of a particle

To give an explicit example, consider a particle, and in particular three flavors thereof: a classical particle, described through its position and momentum; a nonrelativistic quantum particle, described with its wave function; and a hypothetical postquantum particle. In the pragmatic approach to systems, the classical, quantum, and postquantum particle are three valid and distinct pragmatic systems that are defined, primarily, through the associated operations. The reason why these three pragmatic systems are distinct is because they are associated with different operations. These three systems are, however, not necessarily unrelated, since one can see a classical particle as corresponding to a restricted set of operations on a quantum particle, and one may argue that the quantum particle is a more fundamental pragmatic system than the classical-particle pragmatic system. On the other hand, in the ontic-system approach, a possible ontic system could be “a particle.” The operations associated with a classical particle would be a naive attempt to try to probe a particle, but more fundamentally, the operations associated with a quantum particle probe more properties of the particle. Whether or not the quantum operations associated with a quantum particle completely capture the essence of the particle depends on the existence of a postquantum theory that would come with a notion of particle and new operations on it.

#### 2. Ontic-system noncontextuality

We now discuss what an ontic-system approach to noncontextuality could look like. Consider this quote from Ref. [29]: “The operational approach to contextuality due to Spekkens requires finding operationally equivalent preparation procedures [14]. Previously these have been obtained by demanding indistinguishability under a set of measurements taken to be tomographically complete. In the language of generalized probability theories, this requires the ability to explore all the dimensions of the system’s state space. However, if the true tomographically complete set is larger than the set assumed, the extra measurements could break the operational equivalences and hence eliminate the putative contextuality. Such extra dimensions could arise in post-quantum theories, but even if quantum theory is exact there can be unexpected degrees of freedoms due to imperfections in an experiment” (p. 1). In the language developed in this section, one may understand this quote as the following approach to noncontextuality. Given a prepare-and-measure scenario, one should first have a prescription of which ontic system the prepare-and-measure scenario is probing. Because the system associated with the prepare-and-measure scenario is an ontic system, it is a conceptual entity whose ontic set of operations—its “true tomographically complete set”—is, in general, unknown. Turning to noncontextuality, the refer-
ence for indistinguishability that one uses in noncontextuality should be the ontic set of operations of the ontic system—in particular, equivalences between preparations should be based on “indistinguishability under a set of measurements taken to be tomographically complete.” We can summarize these considerations in the following tentative definition:

**Definition 13** (Ontic-system noncontextuality). A prepare-and-measure scenario ($S_{pm}$, $\mathcal{E}_{pm}$) is ontic-system noncontextual if ($S_{pm}$, $\mathcal{E}_{pm}$) can be seen as part of an ontic system and if ($S_{pm}$, $\mathcal{E}_{pm}$) admits a relative noncontextual ontological model with respect to the reference ($S_{ref}$, $\mathcal{E}_{ref}$) made out of the ontic set of operations corresponding to the relevant ontic system. Otherwise, ($S_{pm}$, $\mathcal{E}_{pm}$) is said to be ontic-system contextual.

### 3. Is nature contextual in the ontic-system approach to noncontextuality?

The ontic-system approach to noncontextuality is advantageous with respect to investigations of nature's contextuality in the following sense: because the ontic systems are understood as being fundamental entities independent of our technological capabilities, if there exists at least one ontic system that is contextual, then it is sensible to say that nature is contextual. However, to establish a claim of ontic-system contextuality, one needs to assume that one's reference of indistinguishability captures all of the ontic set of operations associated with the ontic system. Even under the strong assumption that all of our theories of nature are final and that there will be no significant update thereof, it seems hard to falsify the hypothesis that a certain set of operations really corresponds to the ontic set of operations associated with the ontic system: from an operational perspective, the separation between an ontic system and “the rest” is a subjective cut that is elevated to an ontic property of nature. In particular, this cut is not forced upon us by a physical theory, as discussed in Sec. IV B. It would also be interesting to discuss whether or not the notion of an ontic system is reconcilable with the intuition that the ontic reality takes places on a continuous spacetime background.

### F. Locality considerations

Can locality considerations help in this context? It is relatively clear that thinking about the local structure of an experiment can help to enrich one's notion of pragmatic-system noncontextuality, and can support one's notion of ontic-system noncontextuality. Additionally, there exist relations between Bell nonlocality and noncontextuality: for instance, as discussed in Sec. V of Ref. [24], Bell nonlocality implies preparation contextuality. It appears unclear, however, that one can entirely dismiss the above discussion of pragmatic and ontic systems in favor of some notion of locality. Suppose, for instance, that one uses the following methodology of “local noncontextuality”: given a prepare-and-measure scenario, (i) identify the region of spacetime over which the prepare-and-measure scenario takes place, (ii) choose the reference made out of all the procedures pertaining to this region of spacetime, and (iii) investigate the existence of a relative noncontextual ontological model with respect to this reference. An issue in this methodology is step (i): assigning a precise spacetime extent to a given procedure is rather

<figure><img src="image_12.png" /><figcaption>FIG. 10. Consider a procedure S that Alice implements by interacting with a classical device that in turns interacts with a microscopic system. Interactions propagating in space are represented by → arrows, and the arrows between the classical device and the microscopic system should be understood as possible interactions (one may not know exactly how the information propagates to the microscopic system). Suppose that one attaches a spatial region R to the procedure S: we represent R as the shaded red region. This region necessarily looks like a cut in the measurement chain, i.e., a chosen subset of the spatial regions that must be influenced by the procedure S. A reasonable cut of that sort can presumably be placed on the right of the classical device, but this does not guarantee the uniqueness of the cut.</figcaption></figure>

subjective. Given any tentative spacetime region R that one assigns to a given procedure, as is typically done in algebraic quantum field theory [47], there is necessarily information flowing from the agent to R, such that R in fact looks like a subjective (although, of course, potentially pragmatic) cut in a measurement chain: we represent this situation in Fig. 10. This cut is possibly specified at a microscopic scale. This is rather distinct from the locality considerations of, e.g., Bell scenarios [1,48]: there, the locality assumptions have to do with the spacelike separation of two macroscopic regions assigned to Alice and Bob. If one tackles steps (i) and (ii) pragmatically, i.e., using as a reference a common, interesting choice of procedures that are typically taken to probe the spatial extent of the prepare-and-measure scenario, then one falls back on an instance of pragmatic-system noncontextuality. Assuming that one obtains a verdict of contextuality, this opens up the door to discussions about whether there is a useful update of one's notion of (microscopic) locality that could be used to allow for a noncontextual explanation of the prepare-and-measure scenario.

## V. CONCLUSION

### A. Relative noncontextuality

In Sec. II, we introduced an operational formulation of prepare-and-measure scenarios including a reference for indistinguishability, i.e., including an explicit choice of operational procedures that one uses to talk about indistinguishability of the operational procedures belonging to the prepare-and-measure scenario. This allowed us, in Sec. III, to formulate noncontextual ontological models in a way where the indistinguishability relations that one uses are explicitly tied to a choice of reference for indistinguishability. We named these models relative noncontextual ontological models—see Definition 6. Two choices of references are occasionally comparable if one induces a fine-graining or coarse-graining of the indistinguishability relations that the other induces. Relative noncontextual ontological models
are, in some sense, monotone under such fine-grainings or coarse-grainings: a better reference that can distinguish more procedures of the prepare-and-measure scenario makes it more likely for there to exist a relative noncontextual ontological model. Conceptually, the generic situation is depicted in Fig. 8, which shows whether or not a given prepare-and-measure scenario admits a relative noncontextual ontological model with respect to different choices of references in a way compatible with the fine-graining relations that hold between different choices of references. Ultimately, an arbitrarily good reference will allow for the existence of a relative noncontextual ontological model—see Lemma 9. For relative noncontextual ontological models to be a useful conception of classicality for a prepare-and-measure scenario, it is thus necessary to restrict the scope of the reference to some extent.

## B. Fixing the reference

We offered a few approaches towards answering the question of how to meaningfully fix the reference used in relative noncontextual ontological models in Sec. IV. We first used Sec. IV B to justify the idea that in-principle indistinguishability is, in this context, not descriptive enough. Then, the simplest idea described in Sec. IV C is to take the procedures of the prepare-and-measure scenario itself to act as a reference for indistinguishability. The remaining two approaches are related to notions of systems. We distinguish two notions of systems: pragmatic systems are any set of operational procedures endowed with some relevance that is established pragmatically, while ontic systems are conceptual entities that preexist our attempts to probe them, and whose ontic set of operations (the set of operations that would probe the entire extent of the ontic system) is in general unknown. The reference of indistinguishability can then be chosen according to the following tentative methodologies, respectively: given a prepare-and-measure scenario, choose an interesting pragmatic system to which the prepare-and-measure scenario belongs and use the procedures defining the pragmatic system as the reference for indistinguishability in relative noncontextual ontological models, or identify an ontic system to which the prepare-and-measure scenario belongs and use the best guess one has for the ontic set of operations of the ontic system to generate the reference of indistinguishability.

## C. Outlook

This work did not discuss transformations, although these can also be described in a noncontextual ontological model

[14]: it would be interesting to reflect further on possible insights drawn from the case of transformation noncontextuality. Practically speaking, it could be of interest to adapt existing algorithms for testing noncontextuality [25,26] to the general case of relative noncontextuality. With the exception of operationally noncontextual ontological models (Sec. IV C), the approaches to fix the reference of indistinguishability that we described have not been fully developed and require further discussion and motivation. Some concrete open questions are the following: in the approach of pragmatic noncontextuality, are there prepare-and-measure scenarios traditionally deemed contextual that could be reassessed as being noncontextual with respect to another choice of pragmatic system acting as the reference of indistinguishability? More generally, in both the pragmatic and ontic-system approaches to noncontextuality, to what extent is contextuality an artifact of our choice of partition of the world into subsystems, and how well can one motivate any such partition? In light of the discussion of Sec. IV F, discussing these questions may provide an interesting prism for comparing different notions of microscopic locality. With respect to the existing literature, we hope that our work will help to open up new avenues for clarifying the foundations of noncontextuality. This could, for instance, involve a conceptual and methodological enrichment of some of the approaches for fixing the reference that we developed in Sec. IV, but it could well be that other approaches defying our attempted categorization are of greater interest. Of course, one can always question the virtue of wanting to fix a reference in the first place. It is possible that there will never be a satisfactory methodology for doing so and that it is more meaningful to examine pragmatically chosen noncontextuality graphs (see Fig. 8) for a given experiment instead.

## ACKNOWLEDGMENTS

We thank Nuriya Nurgalieva and Martin Sandfuchs for useful feedback. We thank Elie Wolfe and Rob Spekkens for interesting discussions and for hosting a seminar about this work [49]. This work was supported as a part of NCCR QSIT, a National Centre of Competence (or Excellence) in Research, funded by the Swiss National Science Foundation (Grant No. 51NF40-185902). M.W. acknowledges support from the Swiss National Science Foundation (SNSF) via an AMBIZIONE Fellowship (PZ00P2_179914).

[1] J. S. Bell, On the Einstein podolsky rosen paradox, Phys. Fiz. 1, 195 (1964).

[2] A. K. Ekert, Quantum cryptography based on Bell's theorem, Phys. Rev. Lett. 67, 661 (1991).

[3] H. Buhrman, R. Cleve, S. Massar, and R. de Wolf, Nonlocality and communication complexity, Rev. Mod. Phys. 82, 665 (2010).

[4] S. Pironio, A. Acín, S. Massar, A. B. de la Giroday, D. N. Matsukevich, P. Maunz, S. Olmschenk, D. Hayes, L. Luo, T. A.

Manning, and C. Monroe, Random numbers certified by Bell's theorem, Nature (London) 464, 1021 (2010).

[5] N. Brunner, D. Cavalcanti, S. Pironio, V. Scarani, and S. Wehner, Bell nonlocality, Rev. Mod. Phys. 86, 419 (2014).

[6] S. Kochen and E. Specker, The problem of hidden variables in quantum mechanics, Indiana Univ. Math. J. 17, 59 (1967).

[7] A. Peres, Incompatible results of quantum measurements, Phys. Lett. A 151, 107 (1990).
[8] R. Raussendorf, Contextuality in measurement-based quantum computation, Phys. Rev. A **88**, 022322 (2013).

[9] M. Howard, J. J. Wallman, V. Veitch, and J. Emerson, Contextuality supplies the magic for quantum computation, Nature (London) **510**, 351 (2014).

[10] J. Bermejo-Vega, N. Delfosse, D. E. Browne, C. Okay, and R. Raussendorf, Contextuality as a resource for models of quantum computation on qubits, Phys. Rev. Lett. **119**, 120505 (2017).

[11] M. Frembs, S. Roberts, and S. D. Bartlett, Contextuality as a resource for measurement-based quantum computation beyond qubits, New J. Phys. **20**, 103011 (2018).

[12] D. Saha, P. Horodecki, and M. Pawlowski, State independent contextuality advances one-way communication, New J. Phys. **21**, 093057 (2019).

[13] S. Gupta, D. Saha, Z.-P. Xu, A. Cabello, and A. S. Majumdar, Quantum contextuality provides communication complexity advantage, Phys. Rev. Lett. **130**, 080802 (2023).

[14] R. W. Spekkens, Contextuality for preparations, transformations, and unsharp measurements, Phys. Rev. A **71**, 052108 (2005).

[15] L. Hardy, Quantum ontological excess baggage, Stud. Hist. Philos. Sci. Part B **35**, 267 (2004).

[16] R. W. Spekkens, The ontological identity of empirical indiscernibles: Leibniz's methodological principle and its significance in the work of Einstein, arXiv:1909.04628 [physics.hist-ph].

[17] R. W. Spekkens, D. H. Buzacott, A. J. Keehn, B. Toner, and G. J. Pryde, Preparation contextuality powers parity-oblivious multiplexing, Phys. Rev. Lett. **102**, 010401 (2009).

[18] A. Chailloux, I. Kerenidis, S. Kundu, and J. Sikora, Optimal bounds for parity-oblivious random access codes, New J. Phys. **18**, 045003 (2016).

[19] A. Ambainis, M. Banik, A. Chaturvedi, D. Kravchenko, and A. Rai, Parity oblivious d-level random access codes and class of noncontextuality inequalities, Quantum Inf. Proc. **18**, 111 (2019).

[20] D. Schmid and R. W. Spekkens, Contextual advantage for state discrimination, Phys. Rev. X **8**, 011015 (2018).

[21] S. Mukherjee, S. Naonit, and A. K. Pan, Discriminating three mirror-symmetric states with a restricted contextual advantage, Phys. Rev. A **106**, 012216 (2022).

[22] K. Flatt, H. Lee, C. R. I. Carceller, J. B. Brask, and J. Bae, Contextual advantages and certification for maximum-confidence discrimination, PRX Quantum **3**, 030337 (2022).

[23] M. Lostaglio and G. Senno, Contextual advantage for state-dependent cloning, Quantum **4**, 258 (2020).

[24] S. A. Yadavalli and R. Kunjwal, Contextuality in entanglement-assisted one-shot classical communication, Quantum **6**, 839 (2022).

[25] D. Schmid, R. W. Spekkens, and E. Wolfe, All the noncontextuality inequalities for arbitrary prepare-and-measure experiments with respect to any fixed sets of operational equivalences, Phys. Rev. A **97**, 062103 (2018).

[26] J. H. Selby, E. Wolfe, D. Schmid, and A. B. Sainz, An open-source linear program for testing nonclassicality, Phys. Rev. Lett. **132**, 050202 (2024).

[27] L. Catani, M. Leifer, D. Schmid, and R. W. Spekkens, Reply to “Comment on ‘Why interference phenomena do not capture the essence of quantum theory,’” arXiv:2207.11791 [quant-ph].

[28] V. Gitton and M. P. Woods, Solvable criterion for the contextuality of any prepare-and-measure scenario, Quantum **6**, 732 (2022).

[29] M. F. Pusey, L. del Rio, and B. Meyer, Contextuality without access to a tomographically complete set, arXiv:1904.08699 [quant-ph].

[30] On the other hand, a partial order is such that $x \preceq x'$ and $x' \preceq x$ implies $x = x'$: in our case, there can be different choices of references that induce the same indistinguishability relations, so we do not have a partial order to start with.

[31] In some contexts [25,28], noncontextuality assumptions can be used to explicitly prove that one can assume $\Lambda$ to be finite without loss of generality compared to the generic infinite case. In this work, we assume a finite ontic set $\Lambda$ for simplicity.

[32] This formulation with $n$ effects is necessary: we cannot rely on successive binary coarse-grainings since the intermediate effects may not be part of the set $\mathcal{E}_{pm}$ of the prepare-and-measure scenario.

[33] J. H. Selby, D. Schmid, E. Wolfe, A. B. Sainz, R. Kunjwal, and R. W. Spekkens, Accessible fragments of generalized probabilistic theories, cone equivalence, and applications to witnessing nonclassicality, Phys. Rev. A **107**, 062203 (2023).

[34] L. Catani, M. Leifer, D. Schmid, and R. W. Spekkens, Why interference phenomena do not capture the essence of quantum theory, Quantum **7**, 1119 (2023).

[35] See Supplemental Material at http://link.aps.org/supplemental/10.1103/PhysRevResearch.6.043289 for the proofs of Lemmas 7–9, together with the formalization and proof of Theorem 11.

[36] One may instead want to associate the vertices in V with equivalence classes of references that induce the same indistinguishability relations on the prepare-and-measure scenario: this is a pragmatic choice since the reference only enters the definition of a relative noncontextual ontological model through the indistinguishability relations that the reference induces, and it would furthermore guarantee that the graph G is acyclic, but we do not consider this construction for simplicity.

[37] M. F. Pusey, Robust preparation noncontextuality inequalities in the simplest scenario, Phys. Rev. A **98**, 022112 (2018).

[38] M. P. Haugan and C. Lämmerzahl, Principles of equivalence: Their role in gravitation physics and experiments that test them, in Gyros, Clocks, Interferometers...: Testing Relativistic Gravity in Space, Lecture Notes in Physics, edited by C. Lämmerzahl, C. W. F. Everitt, and F. W. Hehl (Springer, Berlin, 2001), pp. 195–212.

[39] Strictly speaking, operational noncontextuality as defined in Definition 10 is a slight generalization of Ref. [28]: the difference lies in whether or not one imposes that effects corresponding to a complete set of outcomes are all included in the prepare-and-measure scenario.

[40] C. Ferrie and J. Emerson, Frame representations of quantum mechanics and the necessity of negativity in quasi-probability representations, J. Phys. A **41**, 352001 (2008).

[41] R. W. Spekkens, Negativity and contextuality are equivalent notions of nonclassicality, Phys. Rev. Lett. **101**, 020401 (2008).

[42] M. P. Mueller and A. J. P. Garner, Testing quantum theory with generalized noncontextuality, Phys. Rev. X **13**, 041001 (2023).

[43] M. D. Mazurek, M. F. Pusey, K. J. Resch, and R. W. Spekkens, Experimentally bounding deviations from quantum
theory in the landscape of generalized probabilistic theories, PRX Quantum **2**, 020302 (2021).

[44] M. D. Mazurek, M. F. Pusey, R. Kunjwal, K. J. Resch, and R. W. Spekkens, An experimental test of noncontextuality without unphysical idealizations, Nat. Commun. **7**, 11780 (2016).

[45] R. W. Spekkens, Evidence for the epistemic view of quantum states: A toy theory, Phys. Rev. A **75**, 032110 (2007).

[46] D. Schmid, J. H. Selby, E. Wolfe, R. Kunjwal, and R. W. Spekkens, Characterization of noncontextuality in the frame-

work of generalized probabilistic theories, PRX Quantum **2**, 010331 (2021).

[47] C. J. Fewster and K. Rejzner, Algebraic quantum field theory–an introduction, arXiv:1904.04051 [hep-th].

[48] J. F. Clauser, M. A. Horne, A Shimony, and R. A. Holt, Proposed experiment to test local hidden-variable theories, Phys. Rev. Lett. **23**, 880 (1969).

[49] V. Gitton, On the system loophole of generalized noncontextuality (Perimeter Institute for Theoretical Physics, 2022), https://pirsa.org/22110079.