A complete characterization of all-versus-nothing arguments for stabilizer states

An important class of contextuality arguments in quantum foundations are the all-versus-nothing (AvN) proofs, generalizing a construction originally due to Mermin. We present a general formulation of AvN arguments and a complete characterization of all such arguments that arise from stabilizer states. We show that every AvN argument for an n-qubit stabilizer state can be reduced to an AvN proof for a three-qubit state that is local Clifford-equivalent to the tripartite Greenberger–Horne–Zeilinger state. This is achieved through a combinatorial characterization of AvN arguments, the AvN triple theorem, whose proof makes use of the theory of graph states. This result enables the development of a computational method to generate all the AvN arguments in on n-qubit stabilizer states. We also present new insights into the stabilizer formalism and its connections with logic. This article is part of the themed issue ‘Second quantum revolution: foundational questions’.


Introduction
quantum computation speed-up [4,5] and in device-independent quantum security [6]. Bell's proof of his famous theorem, as well as the subsequent formulation due to Clauser et al. [7], relies on the derivation of an inequality involving empirical probabilities, which must be satisfied by any local theory but is violated by quantum mechanics. Greenberger and co-workers [8,9] gave a stronger proof of contextuality, which revolves around only possibilistic features of quantum predictions, without taking into account the actual values of the probabilities. This version of the phenomenon corresponds to the notion of strong contextuality in the hierarchy introduced by Abramsky & Brandenburger [10]. In 1990, Mermin presented a simpler proof of this phenomenon, which rests on deriving an inconsistent system of equations in Z 2 , and became known in the literature as the original 'all-versus-nothing' (AvN) argument [11]. Recent work on the mathematical structure of contextuality [10] allowed a powerful formalization and generalization of Mermin's proof to a large class of examples in quantum mechanics using stabilizer theory [12]. This work is of particular significance in the context of measurement-based quantum computation (MBQC), where AvN contextuality plays an important role [5,[13][14][15]. The general theory of AvN arguments introduced in [12] raises the natural question of whether it is possible to identify the states admitting this type of proof of contextuality. In this paper, we address this question by combining the general theory of AvN arguments with the graph-state formalism [16]. We summarize our results as follows: -We show that generalized AvN arguments on stabilizer states can be completely characterized by AvN triples, proving part of what was previously known as the AvN triple conjecture [17].
AvN triples are triples of elements of the Pauli n-group satisfying certain combinatorial properties. The presence of such a triple in a stabilizer group was proved in [12] to be a sufficient condition for AvN contextuality. We show that the converse of this statement is also true for the case of maximal stabilizer subgroups, or, equivalently, for stabilizer states, yielding a complete combinatorial characterization of AvN arguments using stabilizer states. This new description of AvN arguments leads to another important result: -We prove that any AvN argument on an n-qubit stabilizer state can be reduced to an AvN argument involving only three qubits that are local Clifford (LC)-equivalent to the tripartite Greenberger-Horne-Zeilinger (GHZ) state.
The last part of the paper is dedicated to an application of this characterization: -We present a computational method to generate all AvN arguments for n-qubit stabilizer states (for n sufficiently small).
Until now, we have had a rather limited number of examples of quantum-realizable strongly contextual models giving rise to AvN arguments. The technique we introduce here gives us a large amount of instances of this type of model. These findings are introduced after a theoretical digression on general AvN arguments for stabilizer states, which provides interesting new insights on their relationship to logic. In particular: -We represent the well-known link between subgroups of the Pauli n-group and their stabilizers in the Hilbert space of n qubits as a Galois connection, which allows us to establish a relationship with the Galois connection between syntax and semantics in logic (e.g. [18]). semantic paradoxes is shown in [12]. The Galois correspondence we exhibit is a step towards a precise understanding of this interaction. Outline The remainder of the paper is organized as follows. In §2, we recall the original AvN argument by Mermin and generalize it to a class of empirical models. Section 3 introduces the stabilizer formalism, the Galois correspondence and the connections with logic. In §4, we prove the AvN triple theorem and investigate its consequences. Finally, in §5, we present and illustrate the method to generate AvN triples.

All-versus-nothing arguments (a) Mermin's original formulation
In this section, we review Mermin's AvN proof of strong contextuality of the GHZ state.
Recall the definition of the Pauli operators, dichotomic observables corresponding to measuring spin in the x-, y-and z-axes, with eigenvalues ±1: These matrices are self-adjoint, have eigenvalues ±1, and together with identity matrix I satisfy the following relations: The GHZ state is a tripartite qubit state, defined by We consider a tripartite measurement scenario where each party i = 1, 2, 3 can perform a Pauli measurement in {X i , Y i } on GHZ, obtaining, as a result, an eigenvalue in {±1}. 1 By adopting the viewpoint of [10], this experiment can be seen as an empirical model whose support is partially described by table 1 (the remaining choices of measurements give rows with full support and can therefore be ignored). These partial entries of the table can be characterized by the following equations in Z 2 : It is straightforward to see that this system is inconsistent. Indeed, if we sum all the equations, we obtain 0 = 1, as each variable appears twice on the left-hand side. This means that we cannot find a global assignment 1} consistent with the model, showing that the GHZ state is strongly contextual.

(b) General setting
The description of empirical models as generalized probability tables provided by [10]  In the examples considered here, we typically present only the rows corresponding to maximal contexts, as probabilities of outcomes for smaller contexts are determined from these by marginalization-this corresponds to a compatibility condition which is a generalized form of no-signalling [10]. An empirical model e is strongly contextual if there is no global assignment g : X → O which is consistent with e in the sense that the restriction of g to each context U yields a joint outcome for that context which is possible (has non-zero probability) in e. Formally, there is no g : In the setting we will consider, all the measurements are dichotomic and produce outcomes in Z 2 . 2 To an empirical model e := {e U } U∈U , we associate an XOR theory T ⊕ e . It uses a Z 2 -valued variablex for each measurement label x ∈ X. For each context U ∈ U , T ⊕ e will include the assertion x∈Ux = 0 whenever the support of e U contains joint outcomes of only even parity, i.e. with an even number of 1s, and x∈Ux = 1 whenever it contains joint outcomes of only odd parity, i.e. with an odd number of 1s. In other words, it includes the assertion x∈Ux = o whenever x∈U s(x) = o for all s ∈ Z U 2 such that e U (s) > 0.
We say that the model e is AvN if the theory T ⊕ e is inconsistent. As an inconsistent theory implies the impossibility of defining a consistent global assignment X → Z 2 , we have the following result: . If an empirical model e is AvN, then it is strongly contextual.
As an example, we consider the Popescu-Rohrlich (PR) box model [22] given in table 2. The XOR theory of the PR box model consists of the following four equations: a 1 ⊕b 1 = 0,ā 2 ⊕b 1 = 0, a 1 ⊕b 2 = 0,ā 2 ⊕b 2 = 1, which lead to 0 = 1. Hence, the theory is inconsistent and the model is strongly contextual.   Although it is obviously not always the case that parity equations can fully describe the support of an empirical model, this setting is particularly suited for the study of strong contextuality in stabilizer states, as we shall see in the following sections.

The stabilizer world
Stabilizer quantum mechanics [23,24] is a natural setting for general AvN arguments and allows us to see how AvN models can arise from quantum theory. In this section, we recall the main definitions and present new insights on the connection between AvN arguments and logical paradoxes.

(a) Stabilizer subgroups
Let n ≥ 1 be an integer. The Pauli n-group P n is the group whose elements have the form The group P n acts on the Hilbert space of n qubits H n := (C 2 ) ⊗n via the action α(P i ) n i=1 · |ψ 1 ⊗ · · · ⊗ |ψ n := αP 1 |ψ 1 ⊗ · · · ⊗ P n |ψ n .
(3.1) Given a subgroup S ≤ P n , the stabilizer of S is the linear subspace The subgroups of P n that stabilize non-trivial subspaces must be commutative and contain only elements with global phases ±1. We call such subgroups stabilizer subgroups.

(b) Stabilizer subgroups induce XOR theories
We are interested in a quantum measurement scenario where n parties share an n-qubit state and can each choose to perform a local Pauli operator X, Y or Z on their respective qubit. The set of measurement labels is thus X = n i=1 {x i , y i , z i }, and the contexts are subsets of X that contain at most one element for each index i, as each party can perform at most only one measurement. In other words, the maximal contexts are the sets {m 1 , . . . , m n } where m i ∈ {x i , y i , z i }, and the contexts are subsets of these. Note that this is a Bell-type scenario, of the kind considered in discussions of non-locality, a particular case of contextuality. However, we will often need to consider only a subset of the contexts-and even a subset of the measurement labels-in order to derive an AvN argument.
Let P = α(P i ) n i=1 ∈ P n be an element of the Pauli n-group and |ψ ∈ H n a state stabilized by P (hence we must have α = ±1). Then, α(P 1 ⊗ · · · ⊗ P n )|ψ = |ψ , and so |ψ is a α-eigenvector of P 1 ⊗ · · · ⊗ P n . Consequently, the expected value satisfies From footnote 1, this means that, given n qubits prepared on the state |ψ , any joint outcome s ∈ Z n 2 resulting from measuring P i at each qubit i must have even (respectively, odd) parity when α = 1 (respectively, α = −1).
Therefore, to any stabilizer group S ≤ P n , we associate an XOR theory Note that, from the discussion above, it follows that this is (a subset of) the XOR theory T ⊕ e of every empirical model e obtained from local Pauli measurements on any n-qubit state stabilized by S, i.e. any |ψ ∈ V S . Consequently, given an AvN subgroup S ≤ P n and any state |ψ ∈ V S , the n-partite empirical model realized by |ψ under the Pauli measurements is strongly contextual. Indeed, the inconsistency of T ⊕ S implies the impossibility of finding a global assignment compatible with the support of the empirical model [12]: Proposition 3.1. AvN subgroups of P n give rise to strongly contextual empirical models admitting AvN arguments.

(c) Galois connections and relations with logic
Proposition 3.1 shows that an AvN argument is essentially a logical paradox: to a strongly contextual model corresponds an inconsistent XOR theory. Previous work has already outlined this intriguing connection between contextuality and logical paradoxes. In [19], it is shown how quantum violations to Bell inequalities can be systematically viewed as arising from logical inconsistencies. In [12], a structural equivalence between PR box models and liar paradoxes is observed. Here, the link between logical XOR paradoxes and the contextuality of stabilizer subgroups is formalized using a Galois connection.
There is a well-known correspondence between the rank of a subgroup S of P n and the dimension of its stabilizer [24]: In particular, when S is a maximal stabilizer subgroup, we have k = n, hence dim V S = 1, so S stabilizes a unique state (up to global phase). We call such states stabilizer states. We formalize and extend this link by introducing a Galois correspondence between subgroups of P n and their stabilizers.
Given two partially ordered sets A and B, an (antitone) Galois connection between A and B is a pair f , g of order-reversing maps f : Define a relation R ⊆ P n × H n by This induces a Galois connection between the powersets P(P n ) and P(H n ), ordered by inclusion: Note that closed sets S ⊥⊥ and V ⊥⊥ are subgroups of P n and vector subspaces of H n , respectively. Therefore, by restricting (3.3) to closed sets, we obtain a Galois connection SG(P n ) ←→ SS(H n ) between the closed subgroups of P n and the closed subspaces of H n . Explicitly, the connection is given by the maps F : SG(P n ) ←→ SS(H n ) : G, with F :: S −→ V S and G :: where (P n ) |ψ := {A ∈ P n | A · |ψ = |ψ } denotes the isotropy group of |ψ . As the Galois connection is constructed through closed sets, it is tight in the sense of [25], and hence F is an orderisomorphism, with inverse G.
This result suggests an intriguing relation with the Galois connection between syntax and semantics in logic [18,26]: where L is a formal language. The Galois closure operators correspond to deductive closure on the side of theories, and closure under the equivalence induced by the logic on the side of models. Let ⊕-Th denote the set of all XOR theories. The map is order-preserving and allows us to establish a link between the Galois connection SG(P n ) ←→ SS(H n ) and the one described in (3.4). In particular, we have the following commutative diagram: where ⊕-Str denotes the set of XOR structures, and the order-preserving function M ⊕ maps a subspace V of H n to the set Note that, in categorical terms, an antitone Galois connection is a dual adjunction between poset categories. One can easily show that the pair of functors T ⊕ , M ⊕ is a monomorphism of adjunctions [27].

Characterizing all-versus-nothing arguments
Using the general theory of AvN arguments for stabilizer states reviewed in the last section, we present a characterization of AvN arguments based on the combinatorial concept of an AvN triple [12]. To achieve this result, we will take advantage of the graph-state formalism, which will also enable us to conclude that a tripartite GHZ state always underlies any AvN argument for stabilizer states.
(a) All-versus-nothing triples As AvN subgroups give rise to strongly contextual empirical models, we are naturally interested in characterizing this property. In [12], this problem is addressed by introducing the notion of AvN triple. We rephrase the definition from [12] in slightly more general terms:   1 (cf. [12], definition 3). An AvN triple in P n is a triple e, f , g of elements of P n with global phases ±1 that pairwise commute and that satisfy the following conditions: Note that the only difference with respect to the original definition from [12] is that we allow elements of an AvN triple to have global phase −1.
A key result from [12] is that AvN triples provide a sufficient condition for AvN proofs of strong contextuality. A similar argument shows that this is still true for the slightly more general notion of AvN triple.
We denote by N f the number of 'i's such that e i = g i = f i and e i , f i , g i = I, which is odd by definition 4.1(ii). The global phase of h := efg is given by Indeed, we get a local phase −1 for each of the N f indices where e i = g i = f i , because e i f i g i = −e i g i f i = −f i . Thus, if we consider the four equations corresponding to these elements in the XOR theory of the subgroup, summing their right-hand sides yields a ⊕ b ⊕ c ⊕ (a ⊕ b ⊕ c ⊕ 1) = 1. On the other hand, by definition 4.1(i), we have {e i , f i , g i } = {P, Q} with at least two elements equal to P. Thus, by (2.1), the product e i f i g i will be Q up to a phase, and so, as this is absorbed into the global phase, h i = Q. This means that each column of the four equations contains two 'P's and two 'Q's. Therefore, summing all the four equations, we obtain 0 = 1.
It was conjectured by the first author that the presence of an AvN triple in a stabilizer subgroup is also necessary for the existence of an AvN proof of strong contextuality. The intuition is that short AvN proofs suffice. This is the AvN triple conjecture [17]. We will now prove the AvN triple conjecture for the case of maximal stabilizer subgroups, or, equivalently, for stabilizer states, by taking advantage of the graph-state formalism, which is briefly reviewed in the following subsection.

(b) Graph states
Graph states are special types of multi-qubit states that can be represented by a graph. Let G = (V, E) be an undirected graph. For each u ∈ V, consider the element g u = (g u v ) v∈V ∈ P |V| with global phase +1 and components where N (u) denotes the neighbourhood of u, i.e. the set of all the vertices adjacent to u. The graph state |G associated to G is the unique 3 state stabilized by the subgroup generated by these elements, (4.2) One of the key properties of graph states is their generality with respect to stabilizer states, as stated in the following theorem due to Schlingemann [28]. Recall the definition of the LC group  where U acts by conjugation on elements of P n via the representation of α(P i ) n i=1 as the operator αP 1 ⊗ · · · ⊗ P n . Two states |ψ , |ψ ∈ H n are said to be LC-equivalent whenever there is a U ∈ C n 1 such that |ψ = U|ψ . An instance of this result will be important for us. Consider the n-partite GHZ state We apply an LC transformation consisting of a Hadamard unitary H := 1 √ 2 1 1 1 −1 at every qubit of GHZ except the kth one (where 1 ≤ k ≤ n can be chosen arbitrarily) to obtain |ψ = 1 √ 2 (|+ · · · + 0 k + · · · + + |− · · · − 1 k − · · · − ).
The stabilizer group of |ψ is generated by the elements e, f 1 , f 2 , . . . , f k−1 , f k+1 , . . . , f n , where By the definition of a graph state, this list of stabilizers coincides with the star graph centred at the vertex corresponding to the kth qubit (figure 1). As k was chosen arbitrarily, all the graph states corresponding to star graphs on n vertices and different centres are LC-equivalent. Another important property of graph states is that they allow us to characterize LCequivalence between them by a simple operation on the underlying graphs. This is the notion of local complementation. Given a graph G = (V, E) and a vertex v ∈ V, the local complement of G at v, denoted by G v, is obtained by complementing the subgraph of G induced by the neighbourhood N (v) of v and leaving the rest of the graph unchanged [30]. The following theorem is due to Van den Nest et al. [31] (see also [32]).
Thanks to this theorem, we can show that the n-partite GHZ state is LC-equivalent both to the state corresponding to the star graph (cf. figure 1) and to the one corresponding to the complete graph on n vertices. Indeed, it is sufficient to choose a vertex v of the complete graph and apply a local complementation to it to obtain a star graph centred at v, as illustrated in figure 2.

(c) The all-versus-nothing triple theorem and its consequences
In this section, we prove the theorem characterizing AvN arguments on stabilizer states.
Firstly, we need to make some observations. Note that the Born rule is invariant under any unitary action acting simultaneously on the measurement by conjugation and on the state. Therefore, if we have a quantum-realizable empirical model specified by a state |ψ and a set of measurements X, then, given any unitary U, the empirical model specified by the state U|ψ and the set of measurements UXU † = {UAU † | A ∈ X} is equivalent to the original one, in the sense that it assigns the same probabilities, which of course implies that it has the same contextuality properties.
In the particular case when |ψ is a stabilizer state for the subgroup S ≤ P n and U is an LC operation, then the state U|ψ is a stabilizer state for the subgroup USU † = {UPU † | P ∈ S}.
An important fact we shall need is that AvN triples are sent to AvN triples by such LC operations. The reason is that LC operations are composed of local unitaries that act as permutations on the set {±X, ±Y, ±Z}, and therefore preserve all the conditions of definition 4.1.
We now show that AvN triples fully characterize AvN arguments for stabilizer states and that a tripartite GHZ state is always responsible for the existence of such an AvN proof of strong contextuality.

Theorem 4.5 (AvN triple theorem). A maximal stabilizer subgroup S of P n is AvN if and only if it contains an AvN triple. The AvN argument can be reduced to one concerning only three qubits. The state induced by the subgraph for these three qubits is LC-equivalent to a tripartite GHZ state.
Proof. Sufficiency follows from proposition 4.2. So, suppose that the maximal stabilizer subgroup S is AvN. Let |ψ be the stabilizer state corresponding to S. As any stabilizer state is LC-equivalent to a graph state by theorem 4.3 and as LC transformations preserve AvN triples, we can suppose without the loss of generality that |ψ is a graph state |G induced by a graph G = (V, E), and consequently that S = S G as in (4.2).
Given that the empirical model obtained from the state |G and local Pauli operators is strongly contextual, there must exist at least one vertex u with degree at least 2, i.e. |N (u)| ≥ 2. Indeed, if G has no such vertex, G is a union of disconnected edges and vertices, which implies that |G is a tensor product of 1-qubit and 2-qubit states, which do not present strongly contextual behaviour for any choice of local measurements [33,34]. Let u ∈ V have degree ≥ 2 and let v, w be two distinct vertices in N (u). We have two possible cases: 1. There is an edge between v and w. Then, in accordance with (4.1), the elements g u , g v , g w of S G have the form 4 : which are easily seen to constitute an AvN triple.
2. There is no edge between v and w. Then, we have and the elements g u , g u g v , g u g w form an AvN triple: Notice that in both cases the AvN argument is reduced to just three qubits. Moreover, by the discussion at the end of the previous subsection, we know that the state corresponding to the subgraph induced by u, v, w in either of these two cases is LC-equivalent to a tripartite GHZ state: in case 1, we have a complete graph on three vertices, while in case 2, we have a star graph centred at u.
The second part of the above result means that the essence of the contradiction is witnessed by looking at only three qubits. In fact, in the contexts being considered, the experimenters at the remaining n − 3 parties perform either no measurement or a Z measurement. We could imagine that, in trying to build a consistent global assignment of outcomes in Z 2 to all the measurements, each of these n − 3 parties i is allowed to freely choose a value 0 or 1 for the variableZ i . Then, the equations for the variables representing the measurements of the remaining three parties would be those of the usual GHZ argument, up to flipping an even number of the values on the righthand side. In terms of the state, we can use the 'partial inner product' operation described, for example, in [35, p. 129] 5 to apply the eigenvectors corresponding to the chosen values for the other n − 3 parties to |G , resulting in a three-qubit pure state that is LC-equivalent to the GHZ state.
From this theorem, we immediately obtain the following corollaries:  The graph theoretic arguments used in the proof of the AvN triple theorem present some similarities to the techniques developed in [37] to derive Bell inequalities that are maximally violated by some graph states. In fact, corollary 4.6 also follows from theorem 1 in [37]. However, it is important to note that the AvN triple theorem goes beyond the graph-state formalism to expose the underlying algebraic structure of AvN arguments, which ultimately rests on AvN triples.    We provide some examples to clarify the statement of theorem 4.5. Cluster states are a fundamental resource in MBQC [15,[38][39][40]. The four-qubit two-dimensional cluster state is described by the graph in figure 3. Its stabilizer group S is generated by the following elements of P 4 : The stabilizer group S contains the following four AvN triples, corresponding to the triples of qubits highlighted in figure 4: As another example, consider the graph state |G represented in figure 5. Its stabilizer S is generated by the following elements of P 4 :    Figure 6. Qubits generating the AvN triples of (4.5). Each triple of qubits is LC-equivalent to GHZ.
and contains the following AvN triples: which correspond to the triples of qubits illustrated in figure 6.

Applications
In this section, we take advantage of the characterization introduced above to develop a computational method to identify all the possible AvN arguments.

(a) Counting all-versus-nothing triples
We start by introducing an alternative definition of AvN triple. Proof. Given two arbitrary elements h, k ∈ P n , we have Thus, e and f commute if and only if N := |{i | e i = f i ∧ e i , f i = I}| is even. By hypothesis, for each i, at least two of e i , f i , g i are equal, hence Therefore, e, f commute ⇐⇒ N e and N f have the same parity.
Similarly, f , g commute ⇐⇒ N f and N g have the same parity, e, g commute ⇐⇒ N e and N g have the same parity, and the result follows.
Note that this new definition can be used to derive an alternative proof of the fact that any AvN triple for n-partite states can be reduced to an AvN triple that involves only three qubits, in accordance with theorem 4.5. Indeed, given an AvN triple e, f , g in P n , as N g , N e , N f are odd, we can always choose three indices 1 ≤ i 1 , i 2 , i 3 ≤ n such that Clearly, the elements of the triple restricted to these indices constitute an AvN triple in P 3 and therefore an AvN argument.
The rationale for introducing definition 5.1 is that it allows us to better understand AvN triples from a computational perspective. We show a first example by providing a closed formula for the number of AvN triples in P n . Proposition 5.3. Let n ≥ 3. The number of AvN triples in P n is given by where [n] ∈ Z 2 denotes the parity of n.
Proof. The factor of 2 3 = 8 corresponds to the possible choices of global phase ±1 for each element in the triple.
By definition 5.1, an AvN triple e, f , g is essentially determined by three odd numbers N e , N f and N g . Their sum S := N e + N f + N g ≤ n can be seen as the number of columns of the triple that play an active part in the AvN argument. Let us compute the amount of AvN triples having S 'relevant' columns. We start by counting the number of solutions to the equation where N e , N f , N g and S are all odd numbers. Let k, e, f , g ≥ 0 be integers such that S = 2k + 1 and N i = 2i + 1 for i = e, f , g. We have N e + N f + N g = S ⇐⇒ 2e + 1 + 2f + 1 + 2g + 1 = 2k + 1 ⇐⇒ e + f + g = k − 1.
By stars and bars [41],  I  I  I   P  P  P   P I I  I P I  I I P   P P I  P I P  I P P, where P has to be chosen in {X, Y, Z} for a total of (3 · 7 + 1) n−S = 22 n−2k−1 possibilities. Hence, the number of AvN triples in P n having S = 2k + 1 relevant columns is Now, the amount of odd numbers of relevant columns S ≤ n that we can select is given by (

(b) Generating all-versus-nothing triples
We devote this last section to the presentation of a computational method to generate all the AvN triples contained in P n . Until now, we only had a rather limited number of examples of quantum-realizable models featuring AvN proofs of strong contextuality. Thanks to the AvN triple theorem 4.5, the technique we introduce allows us to find all such models for a sufficiently small n. Check vectors [23] are a useful way to represent elements of P n in a computation-friendly way. Given an element P := α(P i ) n i=1 ∈ P n , its check vector r(P) is a 2n-vector r(P) = (x 1 , x 2 , . . . , x n , z 1 , z 2 , . . . , z n ) ∈ Z 2n 2 whose entries are defined as follows: Every check vector r(P) completely determines P up to phase (i.e. r(P) = r(αP) for all α ∈ {±1, ±i}). We can use this representation to express the conditions for an AvN triple. More specifically, we represent an AvN triple, up to the global phases of each of its elements, as a matrix M ∈ M 3×2n (Z 2 ) whose rows are the check vectors of each element of the triple. Condition (i) of definition 5.1 can be rewritten as Hence, in order to find all the AvN triples in P n , we need to solve the following problem: Find all M ∈ M 3×2n (Z 2 ) such that M verifies (5.1), N g , N e and N f are odd, which is easily programmable.
An implementation of this method using MATHEMATICA [42] can be found in [43], where we present the algorithm and the resulting list of all 216 AvN triples in P 3 and all 19 008 AvN triples in P 4 , disregarding the choice of global phases ±1 for each element-in order to get the total number of AvN triples from proposition 5.3, note that these numbers need to be multiplied by a factor of 8 to account for this choice of these global phases. By theorem 4.5, this list generates all the possible AvN arguments for three-qubit and four-qubit stabilizer states.
We note that extensive computations of AvN arguments have been carried out in [44]; it would be interesting to relate this work to our approach.

Conclusion
The recent formalization and generalization of AvN arguments in stabilizer quantum mechanics [12] allowed us to study their properties from a purely mathematical standpoint.
Thanks to this framework, we have introduced an important characterization of AvN arguments based on the combinatorial concept of AvN triple [12], leading to a computational technique to identify all such arguments for stabilizer states. The graph-state formalism, which played a crucial role in the proof of the AvN triple theorem, also allowed us to infer an important structural feature of AvN arguments, namely that any such argument can be reduced to an AvN proof on three qubits, which is essentially a standard GHZ argument. This result shows in particular that the GHZ state is the only three-qubit stabilizer state, up to LC-equivalence, admitting an AvN argument for strong contextuality.
Our computations provide a very large number of quantum-realizable strongly contextual empirical models admitting AvN arguments. These new models could potentially find applications in quantum information and computation, as well as contributing to the ongoing theoretical study of strong contextuality as a key feature of quantum mechanics [10,12,19,34].
The abstract formulation of generalized AvN arguments has also allowed us to introduce new insights into the connections between logic and the study of contextuality. Recent work on logical Bell inequalities [19] and the relation between contextuality and semantic paradoxes [12] suggests a strong connection between these two domains. In this work, we have taken a first step towards a formal characterization of this link in the quantum-realizable case by showing the existence of a Galois connection between subgroups of the Pauli n-group and subspaces of the Hilbert space of n qubits, which can be seen as the stabilizer-theoretic counterpart of the Galois connection between syntax and semantics in logic.
Data accessibility. This article has no additional data. Authors' contributions. All authors contributed equally to this work and gave final approval for publication. Their names are listed in alphabetical order.
Competing interests. The authors declare no competing interests. Funding. Support from the following is gratefully acknowledged: the Simons Institute for the Theory of