Large violations in Kochen Specker contextuality and their applications

The Kochen-Specker (KS) theorem is a fundamental result in quantum foundations that has spawned massive interest since its inception. We present state-independent non-contextuality inequalities with large violations, in particular, we exploit a connection between Kochen-Specker proofs and pseudo-telepathy games to show KS proofs in Hilbert spaces of dimension $d \geq 2^{17}$ with the ratio of quantum value to classical bias being $O(\sqrt{d}/\log d)$. We study the properties of this KS set and show applications of the large violation. It has been recently shown that Kochen-Specker proofs always consist of substructures of state-dependent contextuality proofs called $01$-gadgets or bugs. We show a one-to-one connection between $01$-gadgets in $\mathbb{C}^d$ and Hardy paradoxes for the maximally entangled state in $\mathbb{C}^d \otimes \mathbb{C}^d$. We use this connection to construct large violation $01$-gadgets between arbitrary vectors in $\mathbb{C}^d$, as well as novel Hardy paradoxes for the maximally entangled state in $\mathbb{C}^d \otimes \mathbb{C}^d$, and give applications of these constructions. As a technical result, we show that the minimum dimension of the faithful orthogonal representation of a graph in $\mathbb{R}^d$ is not a graph monotone, a result that that may be of independent interest.


INTRODUCTION
The Kochen-Specker (KS) theorem [1] is a central result in quantum foundations, that states that in any Hilbert space C d of dimension d ≥ 3, there exist finite sets of projectors that do not admit of a deterministic noncontextual value assignment. By non-contextual is meant the property that the value assignments to the projectors do not depend on the context, i.e., the other compatible projectors with which they are measured. Quantum contextual correlations have been shown to be a useful resource in several information processing tasks [34,50,51].
The KS theorem is usually proved by showing a finite set of vectors S = {|v 1 , . . . , |v n } ⊂ C d for which no deterministic assignment f : S → {0, 1} is possible satisfying the KS conditions that (i) |v ∈O f (|v ) ≤ 1 for every set O ⊂ S of mutually orthogonal vectors, and (ii) |v ∈B f (|v ) = 1 for every complete basis B ⊂ S of d mutually orthogonal vectors. An assignment f satisfying the two conditions is called a {0, 1}-coloring of S and KS vectors sets are said to be {0, 1}-uncolorable. A generalization of the KS sets due to Renner and Wolf [32] called weak Kochen Specker sets also serves to prove the KS theorem. A weak KS set [32] is a set of (unit) vectors S ⊂ C d such that for any function f : S → {0, 1} satisfying |u ∈b f (|v ) = 1 for all orthogonal bases b ⊂ S, there exist two orthogonal unit vectors |u 1 ⊥ |u 2 ∈ S such that f (|u 1 ) = f (|u 2 ) = 1. The quantum contextual correlations from the KS proofs lead to violation of non-contextuality inequalities by any quantum state in C d leading to the notion of state-independent contextuality. Smaller sets of projectors can also be found to demonstrate contextuality. For these, the violation of the corresponding non-contextuality inequality occurs only when the projectors are measured on particular states in C d , we say that such sets give rise to state-dependent contextuality. The simplest (requiring fewest projectors) state-dependent non-contextuality inequalities were introduced in [7]. Finally, there exist certain sets S exhibiting state-dependent contextuality of a special type. For these sets, it is possible to find valid {0, 1}-colorings, however in any such coloring, there exist two special nonorthogonal vectors |v 1 and |v 2 that cannot both be assigned the value 1. This class of special statistical statedependent KS arguments were introduced by Clifton in [25].
An interesting question is to study how contextual quantum mechanics is, when considering such stateindependent and state-dependent non-contextuality argument. In [13], the authors investigated how large contextuality can be in quantum theory for state-dependent non-contextuality inequalities. In these inequalities, the contextuality witness is expressed as a sum S of n probabilities (corresponding to n projectors). The independence number α(G) and the Lovasz-theta number θ(G) of the corresponsing orthogonality graph are then the maximum values attainable in non-contextual theories, and in quantum theory respectively. The authors made use of a graph-theoretic result by Feige [29] stating that for every > 0, an n-vertex graph G exists such that θ(G)/α(G) > n 1− to show that quantum theory allows for maximal contextuality in this case. In [30], Simmons studied how contextual quantum mechanics is when considering state-independent non-contextuality inequalities, as measured by the fraction of projectors in the KS proof that must have a valuation that depends on the context in which they are measured. This paper is organized as follows. We first introduce some notation and elementary concepts, in particular the representation of KS sets as graphs. In the next section, we introduce KS sets with large violations, making use of a connection between Kochen Specker proofs and pseudotelepathy games from [32]. We present an application of the large violation KS sets to finding classical channels where shared entanglement increases the one-shot zeroerror capacity. We also show that, despite their foundational interest, the maximum violation of KS stateindependent non-contextuality inequalities do not serve to certify intrinsic randomness. To remedy this fault, we study large violations in a class of state-dependent non-contextuality inequalities known as 01-gadgets in the subsequent section . Interestingly, we show a technical result here that the minimum dimension of a faithful orthogonal representation of a graph in R d is not graph monotone, a result that has fundamental applications in constructions of KS proofs. We derive a one-to-one correspondence between 01-gadgets in C d and two-player Hardy paradoxes for the maximally entangled state in C d ⊗ C d . We use this connection to construct novel large violation 01-gadgets, with an explicit construction shown in Appendix II. Finally, we show that 01-gadgets are natural candidates for self-testing under the assumption of a fixed dimension, a result which has interesting application for contextuality-based randomness generation. We conclude with some open questions.

PRELIMINARIES
In this section, we define some graph-theoretic notation useful in the study of KS contextuality.
Orthogonality Graphs. Throughout the paper, we will deal with simple undirected finite graphs G, i.e., finite graphs without loops, multi-edges or directed edges. We denote V (G) the vertices of G and E(G) the edges of G. It is convenient to represent the orthogonality relations in a KS set S by means of an orthogonality graph G S [8,9]. In the orthogonality graph, each vector |v i in S is represented by a vertex v i of G S and two vertices v 1 , v 2 of G S are connected by an edge if the associated vectors Orthogonal representations. For a given graph G, an orthogonal representation S of G in dimension d is a set of non-zero vectors S = {|v i } in C d obeying the orthogonality conditions imposed by the edges of the graph, i.e., v 1 ∼ v 2 ⇒ v 1 |v 2 = 0 [42]. We denote by d(G) the minimum dimension of an orthogonal representation of G and we say that G has dimension d(G). A faithful orthogonal representation of G is given by a set of vectors S = {|v i } that in addition obey the condition that non-adjacent vertices are assigned non-orthogonal vectors, i.e., v 1 ∼ v 2 ⇔ v 1 |v 2 = 0 and that distinct vertices are assigned different vectors, i.e., v 1 = v 2 ⇔ |v 1 = |v 2 . We denote by d * (G) the minimum dimension of such a faithful orthogonal representation of G and we say that G has faithful dimension d * (G).
KS graphs. While the non-{0, 1}-colorability of a set S translates into the non-{0, 1}-colorability of its orthogonality graph G S , the non-{0, 1}-colorability of an arbitrary graph G translates into the non-{0, 1}-colorability of one of its orthogonal representations only if this representation has the minimal dimension d(G) = ω(G), where ω(G) denotes the size of the maximum clique in the graph. If a graph G is not {0, 1}-colorable and has dimension d(G) = ω(G), it follows that its minimal orthogonal representation S forms a KS set. If in addition d * (G) = ω(G), we say that G is a KS graph (this last condition can always be obtained by considering the faithful version of G, i.e., the orthogonality graph G S of its minimal orthogonal representation S).
The problem of finding KS sets can thus be reduced to the problem of finding KS graphs. However, deciding if a graph is {0, 1}-colorable is known to be NP-complete [23]. In addition, while finding an orthogonal representation for a given graph can be expressed as finding a solution to a system of polynomial equations, efficient numerical methods for finding such representations are still lacking. Thus, finding KS sets in arbitrary dimensions is a difficult problem towards which a huge amount of effort has been expended [33]. In particular, "records" of minimal Kochen-Specker systems in different dimensions have been studied [26], the minimal KS system in dimension four is the 18-vector system due to Cabello et al. [26,28] while lower bounds on the size of minimal KS systems in other dimensions have also been established.

LARGE VIOLATIONS OF KS STATE-INDEPENDENT NON-CONTEXTUALITY INEQUALITIES
In [13], the authors investigated how large contextuality can be in quantum theory for state-dependent noncontextuality inequalities. In these inequalities, the contextuality witness is expressed as a sum S of n probabilities (corresponding to n projectors). The independence number α(G) and the Lovasz-theta number θ(G) of the corresponsing orthogonality graph are then the maximum values attainable in non-contextual theories, and in quantum theory respectively. The authors made use of a graph-theoretic result by Feige [29] stating that for every > 0, an n-vertex graph G exists such that θ(G)/α(G) > n 1− to show that quantum theory allows for maximal contextuality in this case. It must be noted, however that the proof is not constructive and does not single out explicit scenarios.
An open question has remained as to how contextual quantum mechanics is, when considering stateindependent non-contextuality inequalities, i.e., inequalities arising from KS proofs or from statistical stateindependent KS arguments. In [30], Simmons carried out mathematical investigations as to how (maximally) contextual is quantum mechanics, measuring this by the fraction of projectors in the KS proof that must have a valuation that depends on the context in which they are measured. An upper bound was derived on this quantity q(G) for arbitrary KS proofs in n-dimensional Hilbert space as [30] However, it was shown that there is a gulf between the values achieved by the best-known KS proofs and the upper bound shown above. The Peres-Mermin magic square [54,55] achieves a value q(G) = 0.083, Cabello's 18vertex proof [26,28] achieves the value q(G) = 0.05, while two-qubit stabiliser quantum mechanics (that forms a KS proof using 60 projectors and 105 contexts) achieves the value q(G) = 0.1. Note that for the Peres-Mermin magic square, the value for the alternative figure-of-merit is θ(G)/α(G) = 6/5 = 1.2, while the value for Cabello's 18-vertex proof is θ(G)/α(G) = 4.5/4 = 1.125. Here, we show a KS proof for Hilbert spaces of dimension n ≥ 2 17 which achieves θ(G)/α(G) ≈ 2. Attempts to find KS proofs that yield a high value of this quantity can be thought of as extensions of the search for small Kochen-Specker sets, to which much attention has been devoted in the literature [26,28,33]. Finding KS proofs with large violation is thus an open question of fundamental significance, besides having applications as we shall see. In this paper, we consider the usual figure-of-merit, namely the ratio of the quantum to the classical bias, and show a KS set with large value for this parameter. More precisely, we show that the corresponding ratio of the quantum bias to the classical bias (defined as the ratio of the quantities normalized such that θ(G) = 1 minus the random assignment value of 1/2) is O ( √ n/ log n), yielding the large violation statement. Theorem 1. In Hilbert spaces of dimension n ≥ 2 17 , there exist Kochen Specker proofs consisting of N = 2 n−1 + n 2 /2 projectors such that for the corresponding orthogonality graph G, it holds that Proof. The proof follows from two crucial ingredients. Firstly, we make use of the hidden-matching game from Buhrman et al. [31] which is non-locality game between two players that can be won with certainty by a quantum strategy using log n shared EPR-pairs between the players, while any classical strategy has winning probability at most 1 2 + O log n √ n . Secondly, we make use of a connection between pseudo-telepathy games and weak Kochen-Specker proofs shown by Renner and Wolf in [32]. The non-local hidden matching game is defined as follows [31]. Let n be a power of 2 and M n be the set of all perfect matchings on the set [n]. Alice is given as input x ∈ {0, 1} n and Bob is given as input M ∈ M n , distributed uniformly. Alice's output is a string a ∈ {0, 1} log n and Bob's output is an edge (i, j) ∈ M and a bit string b ∈ {0, 1} log n . They win the game if the following condition is true (a ⊕ b)(i ⊕ j) = x i ⊕ x j . In [31], the authors showed that the classical value of the game obeys ω c ≤ 1 2 + O log n √ n , while a quantum strategy exists that achives the value ω q = 1. In other words, the non-local hidden matching game is a pseudotelepathy game. In [32], Renner and Wolf showed that for every two-player pseudo-telepathy game with the optimal strategy achieved by a maximally entangled state, the union of the sets of projectors measured by the two parties constitutes a (weak) KS proof.
We first derive the optimal constant in the big-O value for the classical success probability in the game. Lemma 1. The classical success probability in the nonlocal hidden matching game is bounded as Proof. We follow the argument in [31] using the Kahn-Kalai-Linial (KKL) inequality. The inequality states that for every δ ∈ [0, 1] and f : wheref (S) denotes the Fourier coefficient. Informally, the inequality says that a {−1, 0, 1}-valued function with small support cannot have too much of its Fourier weight on low degrees. The KKL inequality is used to bound the expected bias of k-bit parities over a set A ⊆ {0, 1} n . Suppose we pick a set S ⊆ [n] of k indices uniformly at random, and consider the parity of the k-bit substring induced by S and a uniformly random x ∈ A. Intuitively, if A is large then we expect that for most S, the bias of this parity to be small: the number of x ∈ A with χ S (x) = 1 should be roughly the same as with χ S (x) = −1. From [6], we derive and minimizes the right hand side of (5).
So that For the hidden matching problem we have k = 2. If Alice sends c bits to Bob, |A| 2 n = 2 −c . From (7), we have .
From (6), we have 2 ) Based on (8) and (9), we deduce that the constant α obeys Thus, we have ω c ≤ 1 2 + 8 √ n log n n−1 . Now, following the quantum protocol of the non-local hidden matching problem, we can construct a Kochen-Specker set. The orthogonal bases pair of H = H n ⊗H n is (P x , Q M ), where the x is the input of Alice and M is the input of Bob. The set of projectors measured by Alice is P = ∪ x P x and the corresponding set for Bob is Q = ∪ M Q M . The KS vector set is then given as S = P ∪ Q.
Let H = H ⊗ log n , the vector P i x in basis P x is given as: is an x-dependent phase-flip matrix, and x i is the i − th bit of the binary bit string x.
Now P x is a complete basis with n orthogonal vectors and in basis Q M is given as: Given a determined perfect matching M , the n 2 pairs (i, j) are all disjoint in the matching, i.e., if (i, j) and (i , j ) are pairs in M , then i = j = i = j . We obtain that Now Q M is a complete basis with n orthogonal vectors and Q = M Q M . The KS vector set is then given by S = P ∪ Q.
Application I. Entanglement assisted one-shot zero-error capacity of a classical channel For a classical channel N connecting the the sender Alice and receiver Bob, the behaviour of the channel is described by the conditional probability distribution over outputs given the input. Two inputs of the channel N are confusable if their outputs overlap. Shannon introduced the confusability graph G(N ) of a classical channel N : the inputs are expressed as vertices in the graph, two vertices are connected by an edge if and only if they are confusable. Classically, the maximum number of different messages Alice can send to Bob without error through the classical channel N is the independence number of the confusability graph G(N ). In [34], Cubitt et al. showed that given single use of a channel based on certain proofs of the KS theorem, entangled states of a system shared by the sender and receiver can be used to increase the number of (classical) messages which can be sent with no chance of error. In other words, for these KS channels, one can improve the zero-error classical communication capacity using entanglement.
We now need to verify that the classical channel N constructed from our KS graph G satisfies the conditions on the channel imposed by Cubitt et al.'s proof. If so, we can show an example of a classical channel N for which the entanglement-assisted classical zero-error capacity far exceeds the classical zero-error capacity without shared entanglement. Firstly, we construct the classical channel N using our KS graph G. The classical one-shot zeroerror capacity of the corresponding channel is: Now, the condition that must be satisfied by the KS graph G is that the graph can be partitioned into an integral number of disjoint cliques of size n. We show in Lemma 2 that our KS graph G consists of q = 2 (n−1) + n 2 2 disjoint cliques of size n. This implies that the classical one-short zero-error capacity of the corresponding channel can be increased when the sender and receiver share a maximally entangled state ρ AB of rank n. The entanglement-assisted zero-error capacity c SE can be shown to be exactly the number of the disjoint cliques: To see this, note the protocol for the task outlined in the proof by Cubitt et al. [34]. In order to send a message m ∈ q, Alice can choose a projector j in clique m randomly and measure her side of the state. She then inputs (m, j) into the channel. Bob's output will be a subset containing (m, j) and its orthogonal vertices. After performing a projective measurement on his side of the state, he can infer which message m ∈ q Alice has sent with certainty. In other words, the protocol works perfectly when the KS graph G can be partitioned into an integral number of disjoint cliques of size n.
Lemma 2. The KS graph G obtained from the non-local hidden matching problem can be partitioned into disjoint cliques of size n.
Proof. To show this, we show the equivalent statement that in the optimal quantum strategy for the non-local hidden matching game, the bases measured by the two parties do not have any overlap. In other words, for any pair of bit strings x = x , if one of the vectors P i x = ±P j x , then the bases P x = P x . This means that if one of the vectors P i x = ±P j x , then for any other vector P p x in basis P x , we can find a corresponding vector P q x in basis P x , such that P p This implies that for any other vector P p x in basis P x , we have Writing s, p, i, d, q as log n-bit binary strings, we obtain that (16) so that Similarly, we have q r = j r ⊕ d r = j r ⊕ p r ⊕ i r . We have thus found the exact vector P q x in basis P x , such that P p x = ±P q x . Therefore, for given different bit strings x and x , the bases P x and P x will never overlap. Now, in the hidden matching problem, Bob's matching is chosen uniformly from And the pairs (i, j) in matching M k are given by: Therefore, the pair (i, j) will never repeat in different matchings M and M , so that the bases Q M and Q M never overlap. Having seen that the bases of Alice and Bob do not overlap, we infer that the total number of disjoint bases in the KS set S is the total number of questions of Alice and Bob, which gives q = 2 n−1 n + n 2 . Since each basis includes n orthogonal vectors, we also deduce that the total number of vectors in the KS set S is 2 n−1 + n 2 2 .
Application II. KS State-Independent Contextuality does not certify intrinsic randomness The result in the previous subsection has foundational significance and has some very interesting applications. Surprisingly, an application that one may anticipate from every contextual (and non-local) behavior, namely the certification of randomness cannot be obtained from the violation of any KS state-independent non-contextuality inequality. This comes from the following curious observation.
Consider for the sake of concreteness the KS proof known as the Peres-Mermin (PM) square, consisting of nine binary observables {σ where σ x , σ y σ y refer to the usual Pauli observables. The commutation hypergraph of these observables consists of three rows and three columns, with the quantum mechanical predictions On the other hand, denoting the observables in general as {A, B, C, a, b, c, α, β, γ} the maximum value in noncontextual theories of the expression (20) is 4. Since non-contextual theories comprise (mixtures of) all deterministic behaviors, one may expect to certify randomness when a honest user observes the value of the expression to be equal to 6 as predicted by quantum mechanics. However, this is not the case under the general paradigm of randomness certification [].
In this paradigm, the observable(s) from which the honest user intends to extract the randomness (the hashing function h) is announced beforehand and is assumed to be known to the adversary, the reason being that no a priori private randomness is available to randomise the choice of hashing function. Now, the maximum quantum value of the state-independent non-contextuality inequality (the value 6 in the example of the PM square) is achievable by the maximally mixed state (the state 1 2 ⊗ 1 2 in the PM square). These facts together imply that, irrespective of the choice of hashing function h used by the honest party, a (contextual) behavior can be found that achieves the same maximum value of the inequality while also having the property that the output of the hashing function is deterministic. Indeed, this contextual behavior can be obtained by simply performing the measurements on the eigenstate of the hash observable. In the concrete example of the PM square, if the honest user chooses to extract the randomness from the observable σ x ⊗ σ x , then there exists a contextual behavior (obtained by performing the PM measurements on the state |+ ⊗ |+ where |+ = 1 √ 2 (|0 + |1 )) that achieves the value 6 for the PM expression and such that the outcome of measurement of σ x ⊗ σ x is deterministic. It can be readily seen that the same observation extends to any arbitrary state-independent non-contextuality inequality, so that KS state-independent contextuality does not certify any randomness. Indeed, the state-independent inequalities are as yet unique in this respect. It would be interesting to see if there is any other non-contextuality or Bell inequality with the property that its violation does not certify any randomness (even against a quantum adversary as considered here).

LARGE VIOLATIONS IN 01-GADGETS AND APPLICATIONS.
In contrast to state-independent non-contextuality inequalities, state-dependent inequalities in general allow for certification of intrinsic quantum randomness, for instance see the protocols in [15][16][17]. In particular, the state-dependent inequalities from measurement scenarios known as 01-gadgets [39] are especially useful in 'localising' the value-indefiniteness that is guaranteed by the violation of a non-contextuality inequality [2,3]. The 01-gadgets are {0, 1}-colorable and thus do not represent by themselves KS sets. However, they do not admit arbitrary {0, 1}-coloring: in any {0, 1}-coloring of a 01gadget, there exist two special non-orthogonal vectors |v 1 and |v 2 that cannot both be assigned the value 1.
The 01-gadgets or 'bugs' were first introduced as a means of constructing statistical KS arguments by Clifton [25] (see Fig. ) and have since been studied in the literature. In particular, 01-gadgets were also used in [23] to show that the problem of checking whether certain families of graphs (which represent natural candidates for KS sets) are {0, 1}-colorable is NP-complete. Specific 01gadgets have already been studied in the literature, for instance as 'definite prediction sets' in [33] and recently as 'true-implies-false sets' in [10] where also minimal constructions in several dimensions were explored. Recently, some of us showed that 01-gadgets form a fundamental primitive in constructing KS proofs, in the sense that every KS set contains a 01-gadget and from every 01-gadget one can construct a KS set.  In other words, while a 01-gadget S gad admits a {0, 1}coloring, in any such coloring the two distinguished nonorthogonal vertices cannot both be assigned the value 1 (as if they were actually orthogonal). We can give an equivalent, alternative definition of a gadget as a graph.
In the following when we refer to a 01-gadget, we freely alternate between the equivalent set or graph definitions.
An example of a 01-gadget in dimension 3 is given by the following set of 8 vectors in C 3 : where the two distinguished vectors are |v 1 = |u 1 and |v 2 = |u 8 . Its orthogonality graph is represented in Fig. . It is easily seen from this graph representation that the vertices u 1 and u 8 cannot both be assigned the value 1, as this then necessarily leads to the adjacent vertices u 4 and u 5 to be both assigned the value 1, in contradiction with the {0, 1}-coloring rules. This graph was identified by Clifton, following work by Stairs [25,40], and used by him to construct statistical proofs of the Kochen-Specker theorem. We will refer to it as the Clifton gadget G Clif . The Clifton gadget and similar gadgets were termed "definite prediction sets" in [33].
In this section, we show constructions of 01-gadgets that achieve large violations in the sense that the overlap between the special vectors |v 1 and |v 2 can be made arbitrary. We also show constructions that achieve the self-testing property that under the constraint of a fixed dimension, there is a unique orthogonal realization (up to rotations) of the 01-gadget. We apply our constructions to show interesting novel applications of the 01-gadgets. We also show a property of the faithful representations that underscores how difficult it is to construct novel KS proofs and 01-gadgets.
The minimum dimension of a faithful orthogonal representation in R d is not graph monotone In graph theory, a graph propertyP is said to be monotone if every subgraph of a graph with property P also has property P . In other words, the graph property is closed under removal of edges and vertices. Recall that a faithful orthogonal (also orthonormal, since all vectors are taken to have unit norm) representation of G is given by a set of vectors S = {|v i } in C d that obey the orthogonality conditions imposed by the edges of the graph, and in addition obey the condition that non-adjacent vertices are assigned non-orthogonal vectors and that distinct vertices are assigned different vectors. We had denoted by d * (G) the minimum dimension of such a faithful orthogonal representation of G. Let us now denote by d * R (G) the corresponding minimum dimension when C d is replaced by R d in the above definition. That is, d * R (G) is the minimum dimension in real vector spaces of a faithful orthogonal representation of the graph G.
Given a graph G that has a faithful orthogonal representation in dimension d, let us form a new graph G ∪ uv by adding an edge uv (if such is possible) to G. In general, we expect that the minimum dimension of the orthogonal representation increases by this operation of adding edges, i.e., that d * R (G ∪ uv) > d * R (G). Conversely, consider the operation of deleting an edge uv (if such is possible) of G. In general, we expect d * . The question we address in this section is whether this holds always, i.e., • Is the graph-property P d,n of all the graphs on n vertices which admit a faithful orthogonal representation in R d monotone-decreasing?
Surprisingly, we show that the answer to this question is negative. Our proof is constructive, we give an explicit example of a graph G which has a faithful orthogonal representation in R 3 , and yet deleting an edge uv ∈ E(G) increases the minimum dimension of the faithful orthogonal representation of the resulting graph, i.e., d * R (G\uv) > 3.
Given that one may readily discover candidate non-{0, 1}-colorable graphs or candidate 01-gadget graphs, see for instance [18,19], a large part of the difficulty in constructing KS proofs and 01-gadgets is in finding minimum dimensional faithful orthogonal representations of such candidate graphs. The surprising property that deleting edges does not retain the dimension of the representation and that in some cases one may have to increase the dimension of the representation after this operation, is thus an important discovery in the research project aimed at constructing minimal KS proofs and 01-gadgets. It also underscores the importance of the alternative construction methods presented in the rest of the paper. Proposition 1. The graph property P d,n of all the graphs on n vertices which admit a faithful orthogonal representation in R d is not monotone-decreasing.
Proof. The proof comes from a specific 01-gadget construction shown in Fig. 2. This gadget has representation in R 3 , and moreover the two distinguished vectors |v 1 and |v 2 have overlap at most 1/2 in this dimension, i.e., | v 1 |v 2 | ≤ 1/2, for a proof see [39]. We use this gadget to construct the graph G shown in Fig. 3. In the graph G which has a representation in R 3 , the pairs of vectors |v 1 , |v 2 , |v 2 , |v 3 and |v 3 , |v 1 are connected by the 01gadget, as well as the pairs of vectors |v 4 , |v 5 , |v 5 , |v 6 and |v 6 , |v 4 . Furthermore, the six vectors |v 1 , . . . , |v 6 all lie on a single plane since they are all distinct and connected by edges to vector |v 7 which we may take without loss of generality to be |v 7 = (0, 0, 1) T . It then follows from the aforementioned property of the 01-gadget that the faithful orthogonal representation in R 3 is only possible if the maximum overlap | v i |v j | = 1/2 is achieved for every pair of vectors |v i , |v j connected by the 01-gadget. Now, the edge v 2 , v 6 (and also each of the edges v 1 , v 5 and v 3 , v 4 ) ensures that the overlaps | v 1 |v 4 | = √ 3/2, | v 2 |v 5 | = √ 3/2 and | v 3 |v 6 | = √ 3/2 are rigid, i.e., these overlaps are necessary for the representation in R 3 . Deleting one of these edges, say v 2 , v 6 then means that the resulting graph G = G \ (v 2 , v 6 ) no longer has a faithful orthogonal representation in R 3 . In other words, for the graph obtained by the edge deletion operation we have d * R (G \ (v 2 , v 6 )) > 3. Therefore, we conclude that the graph property P d,n of all the graphs on n vertices which admit a faithful orthogonal representation in R d is not monotone-decreasing.
Note that the minimum dimension is clearly also not monotone-increasing, one can readily find examples of graphs in which deleting an edge reduces the minimum dimension.
Large violations in 01-gadgets via a one-to-one connection with two-player Hardy paradoxes In this subsection, we show a method to construct 01-gadgets by establishing a one-to-one connection with the non-locality proofs known as two-player Hardy paradoxes. In particular, we show that for every twoplayer Hardy paradox for a maximally entangled state in C d ⊗ C d , the union of the sets of projectors measured by the two players constitutes a 01-gadget contextuality proof in C d . The converse statement is already well known, see for instance [39]. Namely, it is possible to construct a Hardy proof of non-locality in C d ⊗ C d by considering the Bell scenario in which each of two parties performs the projective measurements corresponding to any 01-gadget in C d .
Let us first give a general definition of a two-player Hardy paradox suited to our purpose. The general Hardy paradox consists of two parts: (i) a set of Hardy constraints HC that impose that the probability of a certain set of events (input-output combinations) is zero, and (ii) a particular Hardy probability which can be inferred to be zero in all classical (local hidden variable) theories from the Hardy constraints HC, while being non-zero for a particular choice of quantum entangled state and measurements that still satisfy HC.
Definition. Let H = H 1 ⊗ H 2 and let |ψ ∈ H be a pure state. A two-player Hardy paradox with respect to |ψ is a pair (B 1 , B 2 ) where B i is a set of orthonormal bases of H i such that the following holds.
Let HC be the set of Hardy constraints defined on B 1 × B 2 as follows. HC((b 1 , b 2 )) is the set of pairs (u 1 , u 2 ) ∈ b 1 × b 2 satisfying ψ|u 1 , u 2 = 0, i.e., the measurement outcome (u 1 , u 2 ) has zero probability of occurring if |ψ is measured with respect to the basis b 1 × b 2 of H.
Then there exists a basis b * 1 × b * 2 of H and a pair (u * 1 , u * 2 ) ∈ b * 1 × b * 2 obeying ψ|u * 1 , u * 2 = 0 such that for every pair of functions (s 1 , s 2 ), where s i is defined on B i and Let us first recall the following Proposition 2 which states that one can construct a two-player Hardy paradox with respect to the maximally entangled state in C d ⊗ C d in the Bell scenario in which Alice and Bob each perform measurements given by the projectors forming a 01-gadget in C d . The proof is by construction, and is given in [39].  S is a 01-gadget in H, then (B,B) is a Hardy paradox with respect to |ψ .
We now move to the result of this subsection. Namely, for any Hardy paradox with respect to the maximally entangled state in C d ⊗ C d , the union of the sets of projectors measured by Alice and Bob constitutes a 01-gadget in C d .

Proposition 3.
Let H = C d , let B 1 and B 2 be two orthonormal bases of H, and let |ψ = If (B 1 , B 2 ) is a Hardy paradox with respect to |ψ , then S is a 01-gadget in H.
Proof. The proof follows a similar idea linking KS proofs to pseudo-telepathy games in [32]. Let f : S → {0, 1} be a function such that for all orthonormal bases b ⊆ S, we have v∈b f (v) = 1.
Since (B 1 , B 2 ) is a Hardy paradox with respect to the maximally entangled state |ψ , there exist bases implies that this output pair occurs with probability 0 in all classical (local hidden variable) theories. In other words f (u * 1 ) + f (u * 2 ) ≤ 1. On the other hand, we have In other words, the two vectors |u * 1 and |u * 2 are nonorthogonal vectors such that in any classical deterministic assignment f of the vectors in the set S, it holds that f (u * 1 ) + f (u * 2 ) ≤ 1. Therefore, the set of vectors in S constitutes a 01-gadget with |u * 1 and |u * 2 being the two distinguished non-orthogonal vectors that cannot both be assigned value 1 in any non-contextual assignment.
The results in this subsection, linking two fundamental aspects of non-locality and contextuality, are useful in the construction of novel 01-gadgets and Hardy paradoxes with properties suited to specific applications. In the Appendix II, we use this connection to give a novel construction of a 01-gadget contextuality proof for any arbitrary two vectors in C d , in particular with the overlap between the two distinguished vectors being arbitrarily close to unity.

CONCLUSION AND OPEN QUESTIONS
In this paper, we have studied large violations of state-independent and special state-dependent noncontextuality inequalities. In particular, we exploited a connection between Kochen Specker proofs and pseudotelepathy games from [32] to show KS sets with large violations in Hilbert spaces of dimension d ≥ 2 17 . We also showed that these KS sets satisfy the condition for a boost in one-shot zero-error capacity through shared entanglement, providing an interesting class of channels for this application. Intriguingly, we showed that despite their foundational interest, the maximum violation of KS state-independent non-contextuality inequalities does not serve to certify intrinsic randomness. To remedy this fault, we studied large violations in a class of state-dependent non-contextuality inequalities known as 01-gadgets.We showed an intriguing technical result here that the minimum dimension of a faithful orthogonal representation of a graph in R d is not graph monotone, a result that has fundamental applications in constructions of KS proofs. We derived a one-to-one correspondence between 01-gadgets in C d and two-player Hardy paradoxes for the maximally entangled state in C d ⊗ C d and exploited this connection to construct novel large violation 01-gadgets. Finally, we show that 01-gadgets are natural candidates for self-testing under the assumption of a fixed dimension, a result which has interesting application for contextuality-based randomness generation which we study in future work.
In future, it would be interesting to study the selftesting properties of 01-gadgets [52] and derive rigorous security proofs of contextuality-based randomness certification protocols using these. Similarly, the connection to two-player Hardy paradoxes serves as a natural tool to construct optimal randomness amplification protocols [15][16][17]. It is also interesting to investigate applications of large violations of the non-contextuality inequalities studied here for one-way communication problems [21]. Finally, it would be good to phrase the large violation results in a resource-theoretic framework, in particular to show that the non-contextual simulation of the large violation demands a correspondingly large classical memory [53]. In this Appendix, we show a structural property of the large violation KS graph, that is useful in deriving large separations in the success probability in communication tasks such as shown in [21]. We divide the vertices in the KS graph into two sets arising from the non-local hidden matching game, the vectors from Alice's optimal quantum strategy form the bases P and the vectors from Bob's optimal strategy form the bases Q. The KS set S is then the union of the two bases sets, i.e., S = P ∪ Q. The number of bases in Q is n 2 and the number of vectors in bases set Q is n 2 2 . The number of neighbours for an arbitrary vector Q and the i , j of these vectors depend on the matching M . In total, there are ( n 2 − 1)(n − 4) vectors orthogonal to Q . . .
[j] . . . [n] is orthogonal to p, we have [i] + [j] = 0. There are a total of 2 n−2 ×2 2 vectors in bases set P that meet this requirement.
Consider these three cases, the number of neighbour of Q In order to find all the neighbours of p, we first consider inverting two entries of vector p at the same time. And these two entries must come from different terms sets, i.e., one entry [ We then proceed to flip six, eight entries and so on, until we invert all the entries of p . In total, the number of neighbours of p is thus found to be 1 + C 1 will be orthogonal to P i x . In basis Q M , half of the vectors are orthogonal to p. In bases set Q, ( n 2 )( n 2 ) = n 2 4 vectors are orthogonal to p. In total, the number of neighbours of p is thus found to be C In this Appendix, we present a construction of a 01-gadget in which the two distinguished vectors, denoted here by A 0 4k and B 0 4k exhibit arbitrary separation as k → ∞, i.e., with 0 ≤ | A ) 4k |B 0 4k | ≤ 1 as k → ∞. The construction makes use of a version of the ladder proof of Hardy non-locality from [46] and a one-to-one correspondence between Hardy non-locality and 01-gadget contextuality shown in the main text. The ladder proof in [46] shows a version of Hardy non-locality for the maximally entangled state of two spin-1 particles. By the Proposition 2 and 3 shown in the main text, the projectors measured by the two parties in the Hardy paradox can be converted into a 01-gadget proof of contextuality for a single spin-1 particle.

Case 1 in bases set
The 01-gadget construction is shown in Fig. and the optimal vectors are given as: