State-independent quantum contextuality with projectors of nonunit rank

Virtually all of the analysis of quantum contextuality is restricted to the case where events are represented by rank-one projectors. This restriction is arbitrary and not motivated by physical considerations. We show here that loosening the rank constraint opens a new realm of quantum contextuality and we demonstrate that state-independent contextuality can even require projectors of nonunit rank. This enables the possibility of state-independent contextuality with less than 13 projectors, which is the established minimum for the case of rank one. We prove that for any rank, at least 9 projectors are required. Furthermore, in an exhaustive numerical search we find that 13 projectors are also minimal for the cases where all projectors are uniformly of rank two or uniformly of rank three.


I. INTRODUCTION
Experiments provide strong evidence that the measurements on quantum systems cannot be modeled by a noncontextual hidden variable model (NCHV). In a NCHV model each outcome of any measurement has a preassigned value and this value in particular does not depend on which other measurement outcomes are possible in the measurement. This phenomenon is called quantum contextuality. Being closely connected to the incompatibility of observables 1 , quantum contextuality is the underlying feature of quantum theory that enables, for example, the violation of Bell inequalities 2 , enhanced quantum communication 3,4 , cryptographic protocols 5,6 , quantum enhanced computation 7,8 , and quantum key distribution 9 .
The first example of quantum contextuality was found by Kochen and Specker 10 and required 117 rank-one projectors. Subsequently the number of projectors was reduced until it was proved that the minimal set has 18 rank-one projectors 11 . This analysis was based on the particular type of contradiction between value assignments and projectors that was already used in the original proof by Kochen and Specker. The situation changed with the introduction of state-independent noncontextuality inequalities, where any NCHV model obeys the inequality, while it is violated for any quantum state and a certain set of projectors. With this enhanced definition of state-independent contextuality (SIC), Yu and Oh 12 found an instance of SIC with only 13 rank-one projectors and subsequently it was proved that this set is minimal 13 provided that all projectors are of rank one.
In contrast, SIC involving nonunit rank projectors has been rarely considered. To the best of our knowledge, the only examples [14][15][16][17] which use nonunit rank are based on the Mermin star 18 . In these examples it was shown that nonunit projectors are sufficient for SIC, but it was not shown whether nonunit projectors are also necessary for SIC. Furthermore, in a graph theoretical analysis by Ramanathan and Horodecki 19 a necessary condition for SIC was provided which also allows one to study the case of nonunit rank.
In this article, we develop mathematical tools to analyze SIC for the case of nonunit rank. We first show that in certain situations nonunit rank is necessary for SIC. Then we approach the question whether projectors with nonunit rank enable SIC with less than 13 a) Electronic mail: zhen-peng.xu@uni-siegen.de b) Electronic mail: xiao-dong.yu@uni-siegen.de c) Electronic mail: matthias.kleinmann@uni-siegen.de projectors. We find that in this case at least 9 projectors are required. For the special cases of SIC where all projectors are of rank 2 or rank 3 we find strong numerical evidence that 13 is indeed the minimal number of projectors. This paper is structured as follows. In Section II we give an introduction to quantum contextuality using the graph approach. We extend this discussion to SIC in Section III and we give an example where rank-two projectors are necessary for SIC. In Section IV we provide a general analysis of the case of nonunit rank and show that scenarios with 8 or less projectors do not feature SIC, irrespective of the involved ranks. This analysis is used in Section V to show in an exhaustive numerical search that all graphs smaller then the graphs given by Yu and Oh do not have SIC, if the rank of all projectors is 2 or 3. We conclude in Section VI.

II. CONTEXTUALITY AND THE GRAPH THEORETIC APPROACH
Our analysis is based on the graph approach to quantum contextuality 20 . In this approach an exclusivity graph G with vertices V (G) and edges E(G) specifies the contextuality scenario. The vertices represent events and two events are exclusive if they are connected by an edge. Consequently, the cliques of the graph form the contexts of the scenario. (In Appendix A we give definitions of essential terms from graph theory.) We consider now two types of models implementing the exclusivity graph, quantum models and noncontextual hidden variable models.
In a quantum model of the exclusivity graph G one assigns projectors Π k to each event k such that k∈C Π k is again a projector for every context C. This is equivalent to having Π k Π l = 0 for any two exclusive events k and l. With such an assignment and a quantum state ρ one obtains the probability for event k as The set of all probability assignments P QT that can be reached with some projectors (Π k ) k and some state ρ is a convex set which coincides 20 with the theta body TH(G) of the graph G.
In contrast, in a NCHV model for the exclusivity graph G the events are predetermined by a hidden variable λ ∈ Λ. That is, to each event k one associates a response function R k : Λ → { 0, 1 }. For a context C the function λ → k∈C R k (λ) has to be again a response function, which is equivalent to R k (λ)R l (λ) = 0 for all λ and any pair of exclusive events k and l. The probability of an event k is now given by where µ is some probability distribution over the hidden variable space Λ. The set of all probability assignments P NCHV that can be reached with some response functions (R k ) k and some distribution µ forms a polytope which can be shown 20 to be the stable set STAB(G) of the graph G. Quantum models and NCHV models are both noncontextual in the sense that the computation of the probability P (k) of an event k does not depend on the context in which k is contained. Quantum contextuality occurs now for an exclusivity graph G if we can find a quantum model with probability assignment P QT which cannot be achieved by any NCHV model and hence P QT ∈ TH(G) \ STAB(G). Since STAB(G) is convex, it is possible to find nonnegative numbers (w k ) k∈V (G) ≡ w such that separates all NCHV models from some of the quantum models. That is, there exists some α, such that I w (P NCHV ) ≤ α holds for any P NCHV ∈ STAB(G), while I w (P QT ) > α holds true for some P QT ∈ TH(G). This can be further formalized by realizing that the weighted independence number 21 α(G, w) is exactly the maximal value that I w attains within STAB(G) and similarly that the weighted Lovász number 22 ϑ(G, w) is exactly the maximum of I w over TH(G). Consequently the inequality I w (P NCHV ) ≤ α(G, w) holds for all NCHV probability assignments and this inequality is violated by some quantum probability assignment if and only if 20 ϑ(G, w) > α(G, w) holds. In addition, one can show 20 that the value of ϑ(G, w) can always be attained for some quantum model employing only rank-one projectors.

III. STATE-INDEPENDENT CONTEXTUALITY AND NONUNIT RANK
The discussion so far concerns quantum models as being specified by the projectors assigned to each event together with a quantum state. In SIC one removes the quantum state from the specification of a quantum model and instead requires that probabilities from the quantum model cannot be reproduced by a NCHV model, independent of the quantum state. Therefore we consider the set of probability assignments formed by all quantum states and fixed projectors (Π k ) k , This set is also convex, since P is linear and the set of quantum states is convex. Hence, in the case of SIC it is again possible to find a nonnegative numbers (w k ) k ≡ w such that I w separates STAB(G) from P SIC . Therefore, it holds that k w k tr(ρΠ k ) > α(G, w), for all ρ, or, equivalently, that the eigenvalues of are all strictly positive.
FIG. 2. Illustration of the graph G r . G has vertices a, b, c, d and here ra = 2, r b = 1, rc = 1, r d = 3. In the product graph, vertices enclosed by a line form a clique, that is, they are all mutually connected by an edge.
We say that the projectors (Π k ) k of a quantum model of G form a rank-r projective representation a of G, when r = (r k ) k∈V (G) with r k the rank of Π k . The smallest known contextuality scenario which allows SIC is given by the exclusivity graph G YO with 13 vertices 12 . This graph is shown in Figure 1 (a). For this scenario it is sufficient to consider rank-one projective representations. It also has been shown that no exclusivity graph with 12 or less vertices allows SIC 13 , provided that all projectors are of rank one, r = 1. But this does not yet show that SIC requires 13 projectors, since it is possible that a contextuality scenario features SIC only if some of the projectors are of nonunit rank.
This rises the question whether projectors of nonunit rank can be of advantage regarding SIC. We now show that this is the case by analyzing the exclusivity graph G Toh with 30 vertices 17 . This graph is shown in Figure 1 (b). One can find a rank-two projective representation of this graph 17 , such that k Π k = 7 + 1 2 . Since the independence number of G Toh computes to 7, that is, α(G Toh ) ≡ α(G Toh , 1) = 7, this shows that rank two is sufficient for SIC in this scenario.
For necessity, we show that no rank-one projective representation featuring SIC of G Toh exists. We first note that such a representation would be necessarily constructed in a fourdimensional Hilbert space. This is the case because the largest clique of G Toh has size four and hence any projective representation must contain at least four mutually orthogonal projectors of rank one. For an upper bound on the dimension d of any projective representation featuring SIC we use the result 19,23 d < χ f (G) (7) where χ f (G) denotes the fractional chromatic number of G. One finds χ f (G Toh ) = 4 + 2 7 implying d ≤ 4. We do not find any rank-one projective representation of G Toh in dimension d = 4 using the numerical methods discussed in Section V B and in Appendix B we prove also analytically that no such representation exists.

IV. GRAPH APPROACH FOR PROJECTIVE REPRESENTATIONS OF ARBITRARY RANK
The example of the previous section showed that considering projective representations of nonunit rank can be necessary for the existence of a quantum model with SIC. Since the case of rank-one has already been analyzed in detail, it is helpful to reduce the case of nonunit rank to the case of rank one. To this end we adapt the notation 24 G r for the graph where each vertex k is replaced by a clique C k of size r k and all vertices between two cliques C k and C are connected when [k, ] is an edge. See Figure 2 for an illustration. That is, a An projective representation obeys Π k Π l = 0 if [k, l] ∈ E(G). In contrast, an orthogonal representation obeys ψ k |ψ l = 0 if [k, l] ∈ E(G).
The construction of G r is such that if (Π k,i ) k,i is a rank-one projective representation of G r , then evidently Π k = i Π k,i defines a rank-r projective representation of G. Vice versa, if (Π k ) k is a rank-r projective representation of G, then one can immediately construct a rank-one projective representation of G r by decomposing each projector Π k into rank-one For a given graph G we denote by d π (G, r) the minimal dimension which admits a rank-r projective representation and by χ f (G, r) the fractional chromatic number for the graph G with vertex weights r ∈ N |V (G)| . In addition we abbreviate the Lovász function of the complement graph by ϑ(G, r) = ϑ(G, r). For these three functions we omit the second argument if r k = 1 for all k, that is, The proof is provided in Appendix C. As a consequence we extend the relation 22 ϑ(G) ≤ d π (G) (see also Appendix A) to the case of nonunit rank, Similarly we have generalization of the condition in Eq. (7): Whenever a graph G has a rank-r projective representation featuring SIC, then it holds that Following the ideas from Refs. 19 and 25, we consider quantum models that use the completely depolarized state ρ depol = 1 1/d, where d is the dimension of the Hilbert space. For a rank-r projective representation, the corresponding probability assignment is then simply given by If the representation features SIC, then P depol / ∈ STAB(G), since, by definition, P depol ∈ P SIC while P SIC and STAB(G) are disjoint sets. This is the motivation to define the set RANK(G) of all probability assignments P depol which arise from any projective representation of G. That is, Denoting by RANK(G) the topological closure of RANK(G) we show in Appendix D the following inclusions.
This implies that any NCHV probability assignment can be arbitrarily well approximated by a quantum probability assignment using the completely depolarized state. Conversely, if RANK(G) ⊂ STAB(G) for an exclusivity graph G, then any quantum probability assignment using the completely depolarized state can be reproduced by a NCHV model and hence no projective representation of G can feature SIC. This is the case for all graphs with at most 8 vertices, as we show in Appendix E by using a linear relaxation of RANK(G).
Theorem 3. STAB(G) = RANK(G) for any graph G with 8 vertices or less.
In particular, any scenario allowing SIC requires more than 8 events.

V. MINIMAL STATE-INDEPENDENT CONTEXTUALITY
We now aim to find the smallest scenario allowing SIC, that is, the smallest exclusivity graph which has a projective representation featuring SIC. Here, we say that a graph G is smaller than a graph G if either G has less vertices than G or if both have the same number of vertices and G has less edges than G. With this notion, the smallest known graph allowing SIC is G YO with 13 vertices and 23 edges, b where G YO is G YO but with one edge removed as shown in Figure 1 (a). Due to Theorem 3 it remains to consider the graphs with 9 and up to 12 vertices as well as all graphs with 13 vertices and 23 edges or less.
Instead of testing for a projective representation featuring SIC, we use the weaker condition in Eq. (11) and we limit our considerations to rank-r representations where all projectors have the same rank and r = 1, r = 2, or r = 3. We now aim to establish the following.
Note that this assertion implies that G YO is the smallest graph with a rank-r projective representation with SIC for r = 1, 2, 3.
Our approach to Assertion 4 consists of two steps. First we identify four conditions that are easy to compute and are satisfied by any minimal graph G with d π (G, r) < χ f (G, r). For graphs which satisfy all these conditions and for r = r1 with r = 1, 2, 3, we then implement a numerical optimization algorithm in order to compute d π (G, r1). We then confirm Assertion 4, aside from the uncertainty that is due to the numerical optimization.

A. Conditions
Here we introduce four conditions necessary conditions that are satisfied if G is the smallest graph with d π (G, r) < χ f (G, r) for some fixed r. First, we consider the case where G is not connected. Then there exists a partition of the vertices V (G) into disjoint subsets V i V (G) such that no two vertices from different subsets are connected. We write G i for the corresponding induced subgraph and similarly r i . It is easy to see (see But this is at variance with the assumption that G is minimal. Hence we require the following. Third, we write G − e for the subgraph with the edge e removed. Clearly, d π (G − e, r) ≤ d π (G, r). Thus, if d π (G, r) < χ f (G, r) and χ f (G, r) = χ f (G − e, r), then we have already d π (G − e, r) < χ f (G − e, r) and G cannot be minimal. In order to avoid this contradiction, we need the following.
b In fact, G YO has the same rank-one projective representation as G YO and one immediately verifies that . Thus the scenario G YO also admits SIC.
We apply these five conditions to the cases r = r1 with r = 1, 2, 3 to all graphs with n = 9, 10, 11, 12 vertices and all graphs with n = 13 vertices and 23 or less edges. The resulting numbers of graphs are listed in Table I. First, all nonisomorphic graphs are generated using the software package "nauty" 26 , where then all graphs violating Condition 1 or Condition 2 are discarded. Subsequently, Condition 3 is implemented and for the remaining graphs, ϑ(G), χ f (G), and min e χ f (G − e) are computed, which then allows to evaluate Condition 4 and Condition 5 for r = r1 with r = 1, 2, 3.
For the computation of χ f , we use a floating point solver for the corresponding linear program. On the basis of the solution of the program, an exact fractional solution is guessed and then verified using the strong duality of linear optimization. The Lovász number ϑ is computed by means of a floating point solver for the corresponding semidefinite program. The dual and primal solutions are verified and the gap between both are used to obtain a strict upper bound on the numerical error. This error is in practice of the order of 10 −10 or better for the vast majority of the graphs.

B. Numerical estimate of the dimension
If an exclusivity graph G has a rank-r projective representation with SIC, then, according to Theorem 1 and the subsequent discussion, there must be a rank-one projective representation of G r in dimension d = χ f (G, r) − 1. At this point, we do not further exploit the structure of the problem. We rather consider methods which allow us to verify or falsify the existence of a rank-one projective representation in dimension d of an arbitrary graph G with n vertices.
If such a projective representation exists, then one can assign normalized vectors y k ∈ C d to each vertex k ∈ V (G) such that y † y k = 0 for all edges [ , k] ∈ E(G). Collecting these vectors in the columns of a matrix Y , we obtain the feasibility problem This problem is equivalent to the optimization problem where the problem in Eq. (14) is feasible if and only if the problem in Eq. (15) yields zero. The optimization can be executed using a standard algorithm like the conjugate-gradient method 27 . However, the obtained value can be from a local minimum and depend on the initial value used in the optimization. Hence obtaining a value greater than zero does not conclusively exclude the existence of a projective representation, but this problem can be mitigated by performing the minimization for many different initial values. Instead of employing one of the standard optimization algorithms, we use a faster method that allows us to repeat the minimization with many different initial values. For this we denote by L the set of all (n × n)-matrices X which satisfy the constraints of the problem in Eq. (14) and we write R for the set of all matrices X for which X = Y † Y for some (d × n)-matrix Y . In an alternating optimization, we generate a sequence (X (j) ) j from an initial value X (0) such that By construction, δ j = X (j) − X (j−1) is a nonincreasing sequence and hence δ ∞ = lim j→∞ δ j exists. Consequently, for the existence of a projective representation it is sufficient if δ ∞ = 0 because then X (∞) = lim j→∞ X (j) exists with X (∞) ∈ R∩L. In Appendix F we show that this alternating optimization can be implemented efficiently for the Frobenius norm M F = i,j |M i,j | 2 .
We run the optimization with 100 randomly chosen initial values X (0) for each of the remaining graphs with corresponding rank r. We stop the optimization if δ k−2 /δ k < 1 + 10 −5 . For all graphs and all repetitions the optimization converges with a final value of δ k in the order of 1. In comparison, we test the algorithm for many graphs with known d π where the graphs have up to 40 vertices. In all these cases, the algorithm converges to δ k in the order of 10 −9 , which gives us confidence that the alternating optimization is reliable. In summary this constitutes strong numerical evidence that none of the remaining graphs with corresponding rank has a projective representation with SIC.

VI. CONCLUSION AND DISCUSSION
The search for a primitive entity of contextuality does not have reached a conclusion despite of decades of research on this topic. Of course, one can argue that the pentagon scenario by Klyachko et al. 28 does provide a provably minimal scenario. But the drawback of the pentagon scenario is that it is state-dependent. That is, contextuality is here a feature of both, the state and the measurements. In contrast, in the state-independent approach, contextuality is a feature exclusively of the measurements and we argue that a primitive entity of contextuality should embrace state-independence. Among the known SIC scenarios, the one by Yu and Oh 12 is minimal and this has also been proved rigorously for the case where all measurement outcomes are represented by rank-one projectors.
As we pointed out here, there is no guarantee that the actual minimal scenario will also be of rank one: We showed that a scenario by Toh 17 -albeit far from minimal-requires projectors of rank two. This motivated our search for the minimal SIC scenario for the case of nonunit rank. Due to Theorem 3, we can exclude the case where the exclusivity graph has 8 or less vertices. For the remaining cases of 9 to 12 vertices, we also obtain a negative result, however, under the restriction that the projective representation is uniformly of rank two or uniformly of rank three. A key to this result is a fast and empirically reliable numerical method to find or exclude projective representations of a graph, which might be also a useful method for related problems in graph theory.
Curiously, there is no simple argument that shows that the scenario by Yu and Oh is minimal, even when assuming unit rank. This in contrast to the case of state-dependent contextuality, where the reason that the pentagon scenario is the simplest scenario beautifully has the origin in graph theory 20 . With the current methods it is not possible to ultimately show that the scenario by Yu and Oh is the minimal SIC scenario. For the future it will be interesting to develop additional methods, in particular for the case of heterogeneous rank. It will be particularly interesting whether this problem can be solved using more methods from graph theory, whether it can be solved using new numerical methods, or whether the problem turns out to be genuinely hard to decide.
G(W, F ) is a subgraph of G(V, E) induced by the subset W . In the case where is not an edge in G. A clique inḠ is an independent set of G. Independent sets are also called stable sets. If any strict superset of W is not an independent set, then W is a maximally independent set. Now, the index vector of a given subset of vertices W is defined as where δ W (k) = 1 if k ∈ W and δ W (k) = 0 otherwise. Let I denote the set of all independent sets of graph G, then the stable set polytope STAB(G) is the convex hull of the set { ∆ W | W ∈ I }.
A collection of real vectors (v i ) i∈V is an orthogonal representation (OR) of G, provided that [i, j] ∈ E implies v i · v j = 0. The Lovász theta body of a given graph G can be defined as 29 where s = (1, 0, . . . , 0). We also use the following, equivalent definition of TH(G). A collection of projectors (Π k ) k∈V (over a complex Hilbert space) is a projective representation Then, one can also write 20 Note that in the definition, the projectors might be of any rank. For a vector r of nonnegative real numbers, is the weighted independence number 29 and the weighted Lovász number is given 30 by For convenience, we write ϑ(G, r) = ϑ(G, r).
The weighted chromatic number χ(G, r) can be defined as 24 where c I are nonnegative integers. Equivalently, if C = χ(G, r), then there exists an rcoloring of G with C colors, that is, C is the minimal number of colors such that r k colors are assigned to each vertex k and two vertices i and j do not share a common color if they are connected. The weighted fractional chromatic number χ f (G, r) is a relaxation of the integer program in Eq. (A8) to a linear program 24 where x I are now nonnegative real numbers. Being a linear program with rational coefficients, all x I can be chosen to be rational numbers and hence one can find a b ∈ N such that all bx I are integer. This yields the relation Finally, we use d π (G, r) as defined in the main text, that is, d π (G, r) is the minimal dimension admitting a rank-r PR. We also omit the weights r for the functions d π , χ f , and ϑ, if r = 1. We now show the known relation 22 ϑ(G) ≤ d π (G), which is extended to the case of r = 1 in Eq. (10) in the main text.
Proof. For a given d-dimensional rank-1 PR (Π k ) k of G, a d 2 -dimensional rank-1 PR (P k ) k of G can be constructed as where complex conjugation is with respect to some arbitrary, but fixed orthonormal basis |1 , |2 , . . . , |d . Using Ψ = j,l |jj ll|, we have tr(ΨP k ) = 1 and tr(Ψ) = d.
We consider now an arbitrary rank-1 PR (Q k ) k of G together with an arbitrary density operator ρ acting on the same Hilbert space as the PR. Then (P i ⊗ Q j ) i,j is a PR of G ⊗ G and (i, i) is connected with (j, j) either within G or within G, for any two vertices i = j.
Therefore, k P k ⊗ Q k ≤ 1 1 and consequently, By virtue of Eq. (A5) we obtain x i ≤ d for all x ∈ TH(G), which then yields the desired inequality due to Eq. (A7) and d ≤ d π (G).
The disjoint union G = G 1 ∪G 2 of two graphs consists of the disjoint union of the vertices, is an edge in G if it is an edge in either G 1 or G 2 . For Condition 1 in Section V A we use the following observation.
can find a d-dimensional rank-r i PR for each G i . Since the subgraphs are mutually disjoined, these PRs jointly form already a d-dimensional rank-r PR of G. Thus d ≥ d π (G, r).
For the fractional chromatic number, one first observes that G r = i G ri i . Hence the assertion reduces to χ f ( i G ri i ) = max i χ f (G r i i ), which is a well-known relation for disjoint unions of graphs 31 .
The join G = G 1 + G 2 of two graphs is similar to the disjoint union, however with an additional edge between any two vertices [i, j] if i ∈ V (G 1 ) and j ∈ V (G 2 ). For Condition 2 in Section V A we use then the following observation.
where j ∈ G i and O k is the zero-operator acting on the space of the PR of G k . This construction achieves that ((P j,i ) j∈V (Gi) ) i is a ( i d i )-dimensional rank-r PR of G and therefore d π (G, r) ≤ i d π (G i , r i ) holds. Conversely, from a given d-dimensional rank-r PR of G, we can deduce a d i -dimensional rank-r i PR of each G i , where d i is the dimension of the subspace S i where (Π j ) j∈Gi acts nontrivially. Since each of subspace S i is orthogonal to the other subspaces S j , we obtain For the fractional chromatic number, we note that G r = i G ri i and since χ f is additive under the join of graphs 31 , the assertion follows.
Appendix B: G Toh has no rank-one projective representation It can be verified numerically that there is no 4-dimensional rank-1 PR of G Toh with our numerical methods in Appendix F. Here, we give an analytical proof with the help of the computer algebra system Mathematica.
Since each (row) vector v corresponds to a rank-1 projector P (v) = v † v/|v| 2 , we can use vectors instead of projectors in the case of rank-1 PR. Also, two non-zero vectors v 1 and v 2 are called equal if P (v 1 ) = P (v 2 ). For three independent vectors v 1 , v 2 , v 3 in the 4-dimensional Hilbert space, from Cramer's rule we know that their common orthogonal vector is proportional to where the sum i + j is modulo 4. The proof that there is no 4-dimensional rank-1 SIC set for G 30 can be divided in two cases.
(i) In the main text, above Theorem 1, it was already shown, that any rank-one PR of G r induces a rank-r PR of G and vice versa. Hence the assertion follows.
(ii) For the chromatic number we also have χ(G r , 1) = χ(G, r), as it follows by an argument completely analogous to the proof of d π (G r , 1) = d π (G, r) (using colorings instead of projectors). This implies, (iii) By definition, the weighted Lovász number of G is calculated as where the maximum is taken over all state ρ and all PRs (Π k ) k of G. However, if (Π k ) k is a PR of G then (Π k ) k,i is a (r-fold degenerate) PR of G r , due to Thus, ϑ(G r ) ≥ ϑ(G, r). Conversely, let (P k,i ) k,i be any PR of G r . For any state ρ we let P k = P k,î forî the index that maximizes tr(ρP k,i ). Then (P k ) k is a PR of G and hence ϑ(G, r) ≥ ϑ(G r ).
(iv) This follows directly from the definition in Eq. (A9) by substituting x I by mx I and r by mr.
(v) This follows at once from the definition in Eq. (A7).
where Π s 1 + Π s To take more advantage of these relations, we consider the intersections of subspaces which are related to the projectors in the PR. Denote Π I = ∩ i∈I Π i for a given set I of vertices in G and let Π ∅ = 1 1. By definition, Π I = 0 if I is not an independent set. This implies that Π I1 and Π I2 are orthogonal if I 1 ∪ I 2 is no longer an independent set for two given independent sets I 1 , I 2 .
For a given graph G, denote the set of all independent sets as I. Then define the corresponding independent set graph G as the graph such that For example, if G = C 5 is the 5-cycle graph, then the independent set graph G is as shown in Fig. 3. Denote C as the set of all cliques in G. For a given clique C ∈ C, denote H C as the set of vertices in V (G) which are connected to all vertices in C. That is, (E3) Then we have the following constraints on the PRs of G: where dim(Π) = dim(Π)/d. By combining all the constraints in Eq. (E4) with the non-negativity constraints, we have a polytope whose elements are possible values for {dim(Π s I )} I∈I . If we only consider the possible values of {dim(Π {vi} )} vi∈V (G) , then we have a linear relaxation of RANK(G). We denote such a linear relaxation as LRANK(G). Note that we can add extra constraints that dim(Π I ) ∈ N, ∀I ∈ I if we only focus on a specific dimension d.
For a given graph, we can calculate LRANK(G) as described above with computer programs. If LRANK(G) = STAB(G), then we know that RANK(G) = STAB(G). As it turns out, LRANK(G) = STAB(G) if G is a graph with no more than 8 vertices. Thus, we have proved Theorem 3.
To have a closer look at this linear relaxation method, we illustrate it with odd cycles. It is known that STAB(G) = TH(G) if G is perfect 22 , which means that those graphs cannot be used to reveal quantum contextuality. Recall that a graph is called perfect if all the induced subgraph of G are not odd cycles or odd anti-cycles 32 . Hence, odd cycles and odd anti-cycles are basic in the study of quantum contextuality 33 . Note that STAB(G) is a polytope which can be determined by the set of its facets I(G, w) = α(G, w), where w ≥ 0. Each point outside of STAB(G) violates at least one of the tight inequalities, i.e., the inequalities defining the facets. For a given facet I(G, w) = α(G, w), if the subgraph of {i|w i > 0} is a clique, then we say that this facet is trivial. This is because max I(G, w) = 1 in both the NCHV case and the quantum case. Thus, we only need to consider the nontrivial tight inequalities one by one. For the odd cycle C 2n+1 in Fig. 4, the only non-trivial facet is 32 is a PR of the odd cycle C 2n+1 , then Eq.(E4) implies that dim(Π s 1 ) + dim(Π s 2 ) + dim(Π s 2n+1 ) ≤ 1 + dim(Π s {2,2n+1} ), dim(Π s I k ) + dim(Π s k+1 ) + dim(Π s 2n−k ) ≤ 1 + dim(Π s I k+1 ), ∀k = 1, . . . , n − 2, dim(Π s In−1 ) + dim(Π s n+1 ) + dim(Π s n+2 ) ≤ 1, where I k = ∪ k j=1 {2j, 2(n − j) + 3}. Equation (E6) implies that, for any PR Thus, STAB(G) = RANK(G) if G is an odd cycle. Appendix F: Implementation of the alternating optimization Note that there exists a (d × n)-matrix Y such that R = Y † Y if and only if R ≥ 0 and rank(R) ≤ d. Then, the fast implementation of the alternating optimization is based on the fact that the following two optimizations can be evaluated analytically: where the Frobenius norm is defined as M F = tr(M † M ) = k |M k | 2 . The first optimization can be solved using a semidefinite variant of the Eckart-Young-Mirsky theorem 34 , which states that for any n × n matrix M , the best rank-d (more precisely, rank no larger than d) approximation with respect the Frobenius norm (that is, (s 1 , s 2 , . . . , s d , 0, . . . , 0) where M = U diag(s 1 , s 2 , . . . , s n )V † is the singular value decomposition of M , and the singular values satisfy that s 1 ≥ s 2 ≥ · · · ≥ s n ≥ 0. We mention that M d is not unique if s d is a degenerate singular value. Now, let us consider the optimization in Eq. (F1). As X is Hermitian, it admits the decomposition X = X + − X − , where X + = P + XP + ≥ 0, X − = −P − XP − ≥ 0, and Here λ 1 ≥ λ 2 ≥ · · · ≥ λ n are the eigenvalues of X, and |ϕ i are the corresponding eigenvectors. Furthermore, let R + = P + RP + , R − = P − RP − , and then the optimization in Eq. (F1) satisfies that where the first two lines follow from that M F ≥ P + M P + +P − M P − F = P + M P + F + P − M P − F , and the last line follows from the Eckart-Young-Mirsky theorem as well as the facts that rank(R + ) = rank(P + RP + ) ≤ rank(R) ≤ d and M 1 + M 2 F ≥ M 1 F when M 1 , M 2 ≥ 0. Moreover, one can easily verify that all inequalities in Eq. (F6) are saturated when R = X + d , because P + X + d P + = X + d and P − X + d P − = 0. By noting that X + d satisfies that X + d ≥ 0 and rank(X + d ) ≤ d, we get that the optimization in Eq. (F1) is achieved when R = X + d , which gives the solution k≥d+1,λ k ≥0 The solution of the second optimization in Eq. (F2) follows directly from the definition of the Frobenius norm M F = k |M k | 2 . One can easily verify that the minimization is achieved when L kk = 1, k = 1, 2, . . . , n L k = 0, [k, ] ∈ E(G), L k = X k , k = and [k, ] / ∈ E(G), and the solution is