Scalable Bell inequalities for graph states of arbitrary prime local dimension and self-testing

Bell nonlocality—the existence of quantum correlations that cannot be explained by classical means—is certainly one of the most striking features of quantum mechanics. Its range of applications in device-independent protocols is constantly growing. Many relevant quantum features can be inferred from violations of Bell inequalities, including entanglement detection and quantification, and state certification applicable to systems of arbitrary number of particles. A complete characterisation of nonlocal correlations for many-body systems is, however, a computationally intractable problem. Even if one restricts the analysis to specific classes of states, no general method to tailor Bell inequalities to be violated by a given state is known. In this work we provide a general construction of Bell expressions tailored to the graph states of any prime local dimension. These form a broad class of multipartite quantum states that have many applications in quantum information, including quantum error correction. We analytically determine their maximal quantum values, a number of high relevance for device-independent applications of Bell inequalities. Importantly, the number of expectation values to determine in order to test the violation of our inequalities scales only linearly with the system size, which we expect to be the optimal scaling one can hope for in this case. Finally, we show that these inequalities can be used for self-testing of multi-qutrit graph states such as the well-known four-qutrit absolutely maximally entangled state AME(4,3).


Introduction
The first Bell inequalities were introduced to show that certain predictions of quantum theory cannot be explained by classical means [1].In particular, correlations obtained by performing local measurements on joint entangled quantum states are able to violate Bell inequalities and hence cannot arise from a local hidden variable model (LHV).The existence of such non-local correlations is referred to as Bell non-locality or simply non-locality.
Since then the range of applications of Bell inequalities has become much wider.In particular, they can be used for certification of certain relevant quantum properties in a deviceindependent way, that is, under minimal assumptions about the underlying quantum system.First, violation of Bell inequalities can be used to certify the dimension of a quantum system [2] or the amount of entanglement present in it [3].Then, Bell violations are used to certify that the outcomes of quantum measurements are truly random [4], and to estimate the amount of generated randomness [5,6,7].
The maximum exponent of the certification power of Bell inequalities is known as selftesting.Introduced in [8], self-testing allows for almost complete characterization of the underlying quantum system based only on the observed Bell violation.It thus appears to be one of the most accurate methods for certification of quantum systems which makes self-testing a highly valuable asset for the rapidly developing of quantum technologies.In fact, self-testing techniques have shown to be amenable for near-term quantum devices, allowing for a proofof-principle state certification of up to few tens of particles [9,10].For this reason self-testing has attracted a considerable attention in recent years (see, e.g., Ref. [11]).
However, most of the above applications require Bell inequalities that exhibit carefully crafted features.In the particular case of self-testing one needs Bell inequalities whose maximal quantum values are achieved by the target quantum state and measurements that one aims to certify.Deriving Bell inequalities tailored to generic pure entangled states turns out to be in general a difficult challenge.Even more so if one looks for inequalities applicable to systems of arbitrary number of parties or arbitrary local dimension.The standard geometric approach to derive Bell inequalities has been successful in deriving many interesting and relevant inequalities [12,13,14,15,16], but typically fails to serve a self-testing purpose, providing inequalities with unknown maximal quantum violation.
In order to construct Bell inequalities that are tailored to specific quantum states, a more promising path is to exploit the "quantum properties" of the considered system such as its symmetries.Two proposals in this direction have succeeded in designing different classes of Bell inequalities tailored to the broad family of multi-qubit graph states [17,18] and the first Bell inequalities maximally violated by the maximally entangled state of any local dimension [19].The success of these methods was further confirmed by later applications to design the first self-testing Bell inequalities for graph states [17], for genuinely entangled stabilizer subspaces [20,21] or maximally entangled two-qutrit states [22], as well as to derive many other classes of Bell inequalities tailored to two-qudit maximally entangled [23,24] or many-qudit Greenberger-Horne-Zeilinger states [25].Some of these constructions were later exploited to provide self-testing schemes for the maximally entangled [23,26] or the GHZ states [27] of arbitrary local dimension.
In this work we show that similar ideas can be used to provide a general construction of Bell inequalities tailored to graph states of arbitrary prime local dimension.Graph states constitute one of the most representative classes of genuinely entangled multipartite quantum states considered in quantum information, covering the well-known Greenberger-Horne-Zeilinger, the cluster [28] or the absolutely maximally entangled states [29], that have found numerous applications, e.g., in quantum computing [30,31,32] or quantum metrology [33].Interestingly, our construction provides the first example of Bell inequalities maximally violated by the absolutely maximally entangled states of non-qubit local dimension such as the four-qutrit AME(4,3) state [29].Moreover, it generalizes and unifies in a way the constructions of Refs.[34] and [22] to graph states of arbitrary prime local dimension.
The manuscript is organized as follows.In Sec. 2 we provide some background information which is necessary for further considerations; in particular we explain in detail the notions of the multipartite Bell scenario and graph states and also state the definition of self-testing we use in our work.Next, in Sec. 3 we introduce our general construction of Bell inequalities for graph states.We then show in Sec. 4 that our new Bell inequalities allow for self-testing of all graph states of local dimension three.We conclude in Sec. 5 where we also provide a list of possible research directions for further studies that follow from our work.

Bell scenario and Bell inequalities
Let us begin by introducing some notions and terminology.We consider a multipartite Bell scenario in which N distant observers A i share a quantum state ρ defined on the product Hilbert space H = H 1 ⊗ . . .⊗ H N . (1) Each observer A i can perform one of m i measurements M i x i ≡ {M i a i |x i } a i on their share of this state, where x i stand for the measurement choices, whereas a i denote the outcomes; here we label them as x i = 1, . . ., m and a i = 0, . . ., d − 1, respectively.Recall that the measurement operators satisfy M i a i |x i ≥ 0 for any choice of a i and x i as well as ∑ a i M i a i |x i = 1 for any x i .
The observers repeat their measurements on the local parts of the state ρ which creates correlations between the obtained outcomes.These are captured by a collection of probability distributions p ≡ {p( a| x)} ∈ R (md) N , where p( a| x) ≡ p(a 1 , . . . ,a N |x 1 , . . . ,x N ) is the probabil- ity of obtaining the outcome a i by the observer i upon performing the measurement M i x i and can be represented by the Born rule A behaviour p is said to be local or classical if for any a and x, the joint probabilities p( a| x) factorize in the following sense, where λ is a random variable with a probability distribution µ(λ) representing the possibilities for the parties to share classical correlations and p i (a i |x i , λ) is an arbitrary probability distribution corresponding to the observer A i .On the other hand, if a behavior p does not admit the above form, we call it Bell non-local or simply non-local.In any Bell scenario correlations that are classical in the above sense form a polytope with finite number of vertices, denoted L N,m,d .Any non-local distribution p can be detected to be outside the local polytope from the violation of a Bell inequality.The generic form of such inequalities is where β L = max p∈L N,m,d I is the classical bound of the inequality and α a, x are some real coefficients defining the inequality.Any p that violates a Bell inequality is detected as non-local.
Let us finally introduce another number characterizing a Bell inequality-the so-called quantum or Tsirelson's bound-which is defined as where the maximisation runs on all quantum behaviours, i.e., all distributions p that can be obtained by performing quantum measurements on quantum states of arbitrary local dimension.The set of quantum correlations Q N,m,d is in general not closed [35] and thus β Q is a supremum and not a strict maximum.Determining the quantum bound for a generic Bell inequality is an extremely difficult problem.However, interestingly, in certain cases it can still be found analytically.A way to obtain β Q or at least an upper bound on it is to find a sum-of-squares decomposition of a Bell operator B corresponding to the Bell inequality.More specifically, if for any choice of measurement operators one is able to represent the Bell operator as where P k are some operators composed of M i n i |x i , then η is an upper bound on β Q .Indeed, Eq. ( 6) implies that for all |ψ , ψ|B|ψ η, and thus, β Q ≤ η.If a quantum state saturates this upper bound, then it follows from (6) that P k |ψ = 0 for all k.As we will see later such relations are particularly useful to prove a self-testing statement from the maximal violation of a Bell inequality.
For further convenience we also introduce an alternative description of the Bell scenario in terms of generalized expectation values (see, e.g., Ref. [25]).These are in general complex numbers defined through the N-dimensional discrete Fourier transform of {p( a| x)}, where ω = exp(2πi/d) is the dth root of unity, a := (a 1 , . . ., a N ) ∈ {0, . . ., d − 1} N and n := (n 1 , . . ., n N ) ∈ {0, . . ., d − 1} N , and a • n = ∑ i a i n i .The inverse transformation gives Combining Eqs. ( 2) and ( 8) one finds that if the correlations p are quantum, that is, originate from performing local measurements on composite quantum states, the complex expectation values can be represented as where A i n i |x i are simply Fourier transforms of the measurement operators M i a i |x i given by Clearly, due to the fact that the Fourier transform is invertible, for a given x i and i, the d operators A i n i |x i with n i = 0, . . ., d − 1 uniquely represent the corresponding measurement M i x i .
Let us now discuss a few properties of the Fourier-transformed measurement operators that will prove very useful later.For clarity of the presentation we consider a single quantum measurement M = {M a } and the corresponding A n operators obtained via Eq.(10).First, one easily finds that A 0 = 1.Second, which is a consequence of the fact that ω d−n = ω −n = (ω n ) * holds true for any n ∈ {0, . . ., d − 1}.Third, A † n A n ≤ 1 for any n = 0, . . ., d − 1 (for a proof see Ref. [22]).
Let us finally mention that if M is projective then all A n are unitary and their eigenvalues are simply powers of ω; equivalently A d n = 1.It is also not difficult to see that in such a case, In this way we recover a known fact that a projective measurement can be represented by a single observable.We exploit these properties later in our construction of Bell inequalities as well as in deriving the self-testing statement.In fact, in what follows we denote the observables measured by the party i by A i,x i .

Self-testing
Here we introduce the definition of N-partite self-testing that we adopt in this work.Let us consider again the Bell scenario described above, assuming, however, that the shared state ρ, the Hilbert space it acts on as well as the local measurements are all unknown.The aim of the parties is to deduce their form from the observed correlations p( a| x).Since the dimension of the joint Hilbert space H is now unconstrained (although finite) we can simplify the latter problem by assuming that the shared state is pure, i.e., ρ = |ψ ψ| for some |ψ ∈ H, and the measurements are projective, in which case they are represented by unitary observables A i,x i acting on H i .
Consider then a target state | ψ ∈ (C d ) ⊗N and the corresponding measurements Âi,x i , giving rise to the same behaviour {p( a| x)}.We say that the observed correlations self-test the given state and measurements if the following definition applies.Definition 1.If from the observed correlations {p( a| x)} one can identify a qudit in each local Hilbert space in the sense that H i = C d ⊗ H i for some auxiliary Hilbert space H i , and also deduce the existence of local unitary operations U i : for some |aux ∈ H i ⊗ . . .⊗ H N , and, moreover, where 1 i is the identity acting on H i , then we say that the reference quantum state | ψ and measurements Âi,x i have been self-tested in the experiment.
Importantly, only non-local correlations can give rise to a valid self-testing statement.Moreover, since it is based only on the observed correlations {p( a| x)}, self-testing can characterize the state and the measurements only up to certain equivalences.In particular, the statement above includes all possible operations that keep the correlations {p( a| x)} unchanged, such as: (i) the addition of an auxiliary state |aux on which the measurements act trivially and (ii) the rotation by an arbitrary local unitary operations.It is also not difficult to check that {p( a| x)} does not change if one applies the transposition map to the quantum state as well as all the observables, and thus sometimes one needs to take into account this extra degree of freedom, which leads to a slightly weaker definition of self-testing [22,36].In the present case, since the graph states are all real the transposition does not pose any problem as far as the state self-testing is concerned, yet it does for the measurements.

Graph states
Let us finally recall the definition of multipartite graph states of prime local dimension [37,38,39].Consider a graph G = (V, E , R, d), where d is any prime number such that d ≥ 2, V := {1, . . ., N} is the set of vertices of the graph, E is the set of edges connecting vertices, and R := {r i,j } is a set of natural numbers from {0, . . ., d − 1} specifying the number of edges connecting vertices i, j ∈ V; in particular, r i,j = 0 means there is no edge between i and j.We additionally assume that r i,i = 0 for all i, meaning that the graph has no loops as well as that the graph G is connected, meaning that it does not have any isolated vertices.By N i we denote the neighbourhood of the vertex i which consists of all elements of V that are connected to i.
Assume then that each vertex i ∈ V of the graph corresponds to a single quantum system held by the party A i and let us associate to it the following N-qudit operator with X and Z being the generalizations of the qubit Pauli matrices to d-dimensional Hilbert spaces defined via the following relations where the addition is modulo d.Due to the fact that XZ = ω −1 ZX, it is not difficult to see that the operators G i mutually commute.It then follows that there is a unique pure state |G ∈ (C d ) ⊗N , called graph state, which is a common eigenstate of all G i corresponding to the eigenvalue one, i.e., Given the above property, the G i are usually referred to as stabilizing operators.Notice also that in the particular case of d = 2 this construction naturally reproduces the N-qubit graph states [39], where vertices can only be connected by single edges.
Let us illustrate the above construction with a couple of examples.
Example 1: Maximally entangled two-qudit state.Let us start with the simplest possible graph, consisting of two vertices connected by an edge (cf.Fig. 1(a)).The corresponding generators are given by and stabilize a single state in C d ⊗ C d which is equivalent up to local unitary operations to the maximally entangled state of two qudits, in which both local Schmidt bases are the computational one.In fact, the above state is stabilized by another pair of operators, namely, which are obtained from G i by an application of the Fourier matrix to the second site.
Example 2: GHZ state.The above two-vertex graph naturally generalizes to a star graph consisting of N vertices (cf.Fig. 1(b)).The associated generators are of the form and and stabilize an N-qudit state which is equivalent under local unitary operations to the wellknown Greenberger-Horne-Zeilinger (GHZ) state Example 3: AME(4,3).The third and the last example is concerned with the four-qutrit absolutely maximally entangled state1 , named AME(4,3) [29].The graph defining it is presented in Fig. 1(c).The stabilizing operators corresponding to this graph read They stabilize a three-qutrit maximally entangled state AME(4,3) which is equivalent under local unitary operations and relabelling of the subsystems to (see, e.g., Ref. [41]), where the addition is modulo three.

Construction of Bell inequalities for arbitrary graph states of prime local dimension
Here we present our first main result: a general construction of Bell inequalities whose maximal quantum value is achieved by the N-qudit graph states of arbitrary prime local dimension and quantum observables corresponding to mutually unbiased bases at every site.Our construction is inspired by the recent approach to construct CHSH-like Bell inequalities for the N-qubit graph states presented in Ref. [34] and by another construction of Bell inequalities maximally violated by the maximally entangled two-qudit state introduced in Ref. [22].First, in Sec.3.1 we recall the general class of Bell inequalities maximally violated by Nqubit graph states of Ref. [34].Then, in Sec.3.2 we introduce the main building block to generalise this construction to arbitrary prime dimension.We illustrate the Bell inequality construction with some simple examples in Sec.3.3 and then move to introduce the general form of the inequality valid of any N-qudit graph state of prime dimension in Sec.3.4.

Multiqubit graph states
Let us assume that d = 2 and let us consider a graph G. Without any loss of generality we can assume that a vertex with the largest neighbourhood is the first one, that is, If there are many vertices with the maximal neighbourhood in G, we are free to choose any of them as the first one.
To every generator G i we associate an expectation value in which the X and Z Pauli matrices are replaced by quantum observables or their combinations using the following rule.At the first qubit we make the following assignment, whereas the Pauli matrices at the remaining sites are directly replaced by observables, that is, with i = 2, . . ., N. Recall that the first index enumerates the parties, while the second one measurement choices.This procedure gives us N expectation values which after being combined altogether lead us to the following Bell inequality [34]: where the classical bound can directly be determined for any graph G and is given by More importantly, the maximal quantum value can also be analytically computed for any graph and amounts to This value is achieved by the graph state |G ∈ (C 2 ) ⊗N corresponding to the graph G and the following observables: for the first observer and A i,0 = X and A i,1 = Z for the remaining observers i = 2, . . ., N.
It is worth stressing here that one of the key observations making the construction of Ref. [34] work is that for any graph there exists a choice of observables at any site, given by the above formulas, turning the quantum operators appearing in the expectation values of ( 27) into the stabilizing operators G i ; in particular, it is a well-known fact that combinations of the Pauli matrices in Eq. ( 28) are proper quantum observables with eigenvalues ±1.

Replacement rule for operators of arbitrary prime dimension
We now move on to introduce the main ingredient needed to generalise the above construction to graph states of prime local dimension d ≥ 3.
A naive approach to constructing Bell inequalities for graph states of higher local dimensions would be to directly follow the d = 2 strategy.That is, at a chosen site the X and Z operators are replaced by combinations of general d-outcome observables A 0 and A 1 .However, this simple approach fails to work beyond d = 3 because for any prime d ≥ 3 it is impossible find nonzero complex numbers α, β ∈ C for which is a valid quantum observable; in fact, for no complex numbers the above combinations can be unitary, unless d = 2 (cf.Fact 2 in Appendix A).This makes the transformation (28) irreversible.Phrasing differently, there are no unitary observables A 0 and A 1 such that X = αA 0 + βA 1 and Z = δA 0 + γA 1 for some complex numbers α, β, γ, δ ∈ C.
Nevertheless, there exist other sets of d-outcome quantum observables which can be linearly combined to form quantum observables, and thus are convenient for our purposes.One such choice is the following set of d unitary matrices Let us now assume that d is a prime number greater than two (d ≥ 3) and consider the following linear combinations of O k and their powers, where x = 0, 1, . . ., d − 1 and λ n are complex coefficients defined as [22]: where n d is the Legendre symbol2 , and, finally, the coefficients g(n, d) are given by Importantly, it was proven in Ref. [22] (see Appendix D therein) that O (n) x are unitary and satisfy x turns out to be the nth power All this means that for any x the set {O (n) x } n=0,...,d−1 represents a legitimate d-outcome projective quantum measurement.Let us finally mention that the linear transformation (31) can be inverted, giving The fact that both O k and O k are unitary quantum observables that are related by a linear reversible transformation given by Eqs. ( 31) and ( 36) is the key ingredient in our construction.
That is, we can proceed in analogy to d = 2 case, where we used the replacement defined in Eq. ( 25) to define the Bell inequality and we could later reverse it by a suitable choice of quantum observables (28) to obtain the maximal quantum violation with a graph state.
The replacement rule we use for the case of arbitrary prime dimension becomes: where A t with t = 0, . . ., d − 1 are unitary observables.Notice that since we deal now with d-outcome quantum measurements we need to also take into account the powers n of the corresponding observables.In fact, these under the Fourier transform represent the outcomes of projective measurements.
Crucially, this transformation can be inverted in the sense that there exist a choice of observables A i,t , for which k in Eq. ( 37) can be brought back to XZ k .These new operators A (n) k satisfy the following relations (see Fact 3 in Appendix A for a proof): for any pair n, k = 0, . . ., d − 1, and for any n = 0, . . ., d − 1.

Examples
Before presenting our construction in full generality, let us first illustrate how to use the qudit replacement rule to obtain valid Bell inequalities tailored to graph states by means of two examples.
Example 1: AME(4,3).As mentioned in Sec.2.3, the the four-qutrit absolutely maximally entangled state is a graph state corresponding to the graph presented on Fig. 1.The stabilizing operators defining this state are given in Eq. ( 23).We recall them here Since the neighbourhood of all vertices of this graph is of size two, each vertex is equally good to implement the transformation (37).For simplicity we choose it to be the first site.Moreover, as in the previous example, we denote the observables measured by the four parties as A x , B y , etc. Now, to create the set of matrices XZ k [necessary for the transformation (37)] at the first site we consider the stabilizing operators G 1 , G 1 G 2 , and G 1 G 2 2 .These are, however, insufficient to uniquely define |AME(4, 3) as they do not include G 3 and G 4 .Since G 3 has the identity at the first position we can include it as it is, whereas we need to take a product of G 4 with G 1 to create XZ at the first site.As a result, the final set of stabilizing operators which we use to construct a Bell inequality for |AME(4, 3) consists of Now, to each of these stabilizing operators we associate an expectation value in which particular matrices are replaced by quantum observables or their combinations.For pedagogical purposes, let us do it site by site.As already mentioned, at the first site we use Eq. ( 37) which for d = 3 gives where 32), ( 33) and ( 34)] and we denoted for simplicity A i ≡ A i .We dropped the subscript n appearing in the transformation (37) Eq. ( 39)]; nevertheless, we need to take into account the case n = 2 when constructing the Bell inequality.
We then note that at the second site we also have three independent unitary observables [note that (ZX) 3 = (ZX 2 ) 3 = 1] and therefore we can directly substitute At the third site we have Z, Z 2 which represent a single measurement (cf.Sec.2.1), and X which is independent of the other two.We thus substitute Z k → C k 0 with k = 1, 2 and X → C 1 .Analogously, for the fourth party we have Z → D 0 and ZX → D 1 .
Taking all the above substitutions into account we arrive at the following assignments and for G 3 : Notice that the expectation values corresponding to n = 2 in the assignment (37) are simply complex conjugations of the above ones.By adding all the obtained expectation values, we finally obtain a Bell inequality of the form where c.c. stands for the complex conjugation of all five terms and represents the expectation values obtained for the case n = 2 of the assignment (37); in particular, it makes the Bell expression real.Moreover, the second line comes with 1/2 coefficient for reasons that will become clear later.The classical value in this case is Let us prove that the maximal quantum violation of this inequality is β Q AME = 8.First, denoting by B AME a Bell operator constructed from I AME , we can write the following sum-ofsquares decomposition where A x , B y , etc. are arbitrary three-outcome unitary observables.To prove that this decomposition holds true one simply expands its right-hand side and uses the property [cf.Eq. ( 40)], which in the particular case d = 3 reads, Now it becomes clear why the second line of I AME comes with 1/2.From this decomposition we immediately conclude that 81 − B AME ≥ 0 for any choice of the local observables, which implies that also for any state |ψ , ψ|B AME |ψ ≤ 8. To show that this bound is tight it suffices to provide a quantum realisation achieving it.Such a realisation can be constructed by inverting the transformation in Eqs. ( 43) and (44), that is, by taking and B y = ZX y with y = 0, 1, 2, C 0 = Z and C 1 = X, and D w = ZX w with w = 0, 1, we can bring the Bell operator B AME to which is simply a sum of the stabilizing operators of |AME(4, 3) .As a result, the latter achieves the maximal quantum value of the Bell inequality (48).
Example 2: Two-qudit maximally entangled state.Let us then consider the case of arbitrary prime d and construct Bell inequalities for the simplest graph state which is the maximally entangled state (18) stabilized by the two generators given in Eq. ( 19).Since we are now concerned with the bipartite scenario we can denote the observables measured by the parties by A x and B y ; the numbers of observables on both sites will be specified later.As already explained, to construct Bell inequalities we cannot simply use the replacement (25), we rather need to employ the one in Eq. (37).Let us moreover assume that we implement this transformation at Alice's site.
To be able to apply the above assignments, we need to consider a larger set of stabilizing operators which apart from X and Z k operators contain also (XZ k ) n with k = 0, . . ., d − 1 and For comparison we also present the maximal quantum values.
n = 1, . . ., d − 1.To construct such a set one can for instance take the following products of G i given in Eq. ( 19): However, to take into account all the outcomes of the measurements performed by both parties we need to also include the powers of the above stabilizing operators [cf.Sec.
We can now construct Bell inequalities maximally violated by the two-qudit maximally entangled states.Precisely, to each of the stabilizing operators G n k we associate an expectation value in which the particular matrices appearing at the first site are replaced by the combinations (37) of the observables A x , whereas at the second site we substitute directly In other words, we associate with k = 0, 1, 2 and n = 1, 2.
Adding then all the obtained expectation values and exploiting the fact that λ −1 n = λ * n , we finally arrive at Bell inequalities derived previously in Ref. [22]: where β C max stands for the maximal classical value of I max .It is in general difficult to compute β C max analytically, however, for the lowest values of d = 3, 5, 7 it was found numerically in [22]; for completeness we listed these values in Table 1.
On the other hand, these Bell inequalities are designed so that their maximal quantum value can be determined straightforwardly.Let us formulate and prove the following fact.

Fact 1. The maximal quantum value of the Bell expressions I
Proof.The proof is straightforward and consists of two steps.First, we denote by a Bell operator associated to the expression max , where A x and B y are arbitrary d-outcome unitary observables.Second, one uses Eq. ( 40) as well as the fact that the Bell operator is Hermitian to observe that the following sum-of-squares decomposition holds true Consequently, d(d − 1)1 − B max is a positive semi-definite operator for any choice of local observables, and thus β . To prove that this inequality is tight we can construct a quantum realisation for which . Precisely, we notice that for the following choice of observables for Alice and Bob [cf.Eq. ( 38)], the Bell operator B max simply becomes a sum of the stabilizing operators of |ψ + d , , which completes the proof.

General construction
We are now ready to provide our general construction of Bell inequalities for arbitrary graph states.Let us first set the notation.
Consider a graph G = (V, E , R, d) and choose two of its vertices that are connected.Without any loss of generality we can label them by 1 and 2. Let then N 1 and N 1 be respectively the neighbourhood of the first vertex, i.e., the set of all vertices that are connected to it, and its cardinality.Clearly, we can relabel all the other neighbours of vertex 1 by j ∈ N 1 \ {2} ≡ {3, . . ., N 1 + 1}.We finally label the remaining vertices that are not connected to the first vertex as l ∈ V \ {1, N 1 } ≡ {N 1 + 2, . . ., N}.The generators corresponding to the graph G are denoted G i [see Eq. ( 14) for the definition thereof], whereas the graph state stabilized by them by |G .
Let us then define the Bell scenario.It will be beneficial for our construction to slightly modify the way we denote the observers and the observables they measure.Precisley, the observables measured by the first two parties are denoted by A x and B y with x, y = 0, . . ., d − 1, respectively; notice that both them can choose among d different settings.Then, the other observers connected to the first party A measure three observables which we denote C (i) z with z = 0, 1, 2 and i ∈ N 1 \ {2}.The remaining observers (that do not belong to N 1 ) have only two observables at their disposal, denoted To derive a Bell inequality tailored to the graph state |G we begin by rewriting the stabilizing operators G i corresponding to G by explicitly presenting operators acting on the first two sites as well as on the neighbourhood N 1 .The first two stabilizing operators read and Then, those associated to the other vertices belonging to N 1 are given by where j = 3, . . ., N 1 , whereas the remaining G i 's for i ∈ {N 1 + 2, . . ., N} are of the following form It is worth adding here that since by assumption the first two vertices are connected, r 1,2 = 0.Moreover, G 1 acts trivially on all sites that are outside N 1 ∪ {1}.
Given the stabilizing operators, let us then follow the procedure outline already in the previous examples.We begin by constructing a suitable set of stabilizing operators.First, to create at the first site the operators XZ k required for the assignment (37), we consider products G 1 G k 2 with k = 0, . . ., d − 1.This set, however, does not uniquely define the graph state |G as it lacks the other generators.To include them we first notice that any G i with i ∈ N 1 \ {2} contains the Z operator or its power at the first position and therefore we take their products with G 1 , that is, G 1 G i with i ∈ N 1 \ {2}, again to obtain XZ k at the first site.On the other hand, the remaining generators G i for i ∈ {N 1 + 2, . . ., N} have the identity at the first position and therefore we directly add them to the set.
Thus, the total list of the stabilizing operators that we use to construct a Bell inequality is where we have added powers to include all outcomes in the Bell scenario.Let us now write these operators explicitly for k = 3, . . ., N 1 + 2, and for k ∈ {N 1 + 2, . . ., N}.
We associate to each of these stabilizing operators an expectation value in which the local operators are replaced by d-outcome observables or combinations thereof.Let us begin with the first site where we have (XZ kr 1,2 ) n with k = 0, . . ., d − 1, XZ r 1,i with i = 3, . . ., N 1 and the identity.It is important to notice here that due to the fact that d is a prime number, for any r 1,2 = 0, kr 1,2 spans the whole set {0, . . ., d − 1} for k = 0, . . ., d − 1; in other words, the function f (k) = kr 1,2 defined on the set {0, . . ., d − 1} is a one-to-one function.Thus, XZ kr 1,2 contains all the d different matrices appearing in the transformation (37).We thus substitute Analogously, we substitute Let us then move to the second site.The matrices appearing there are Z r 1,2 X k with k = 0, . . ., d − 1 and Z n(r 1,2 +r 2,i ) with i = 3, . . ., N 1 + 1.Since for any r 1,2 the former are all proper observables in our scenario, that is, they are unitary and their spectra belong to {1, ω 1 , . . ., ω d−1 }, we can directly substitute them by observables B k .Specifically, for k = 0 we assign which implies in particular that and for the remaining k = 1, . . ., d − 1, We distinguish the case k = 0 to simplify the assignment of observables to the other set of matrices Z n(r 1,2 +r 2,i ) with i = 3, . . ., N 1 + 1.These are simply powers of Z and thus we associate with them a single observable B 0 ; precisely, Let us now consider all sites from N 1 \ {2}.From Eqs. (69), ( 70) and (71) it follows that the operators appearing there are Z r 1,i X with i = 3, . . ., N 1 + 1 and powers of Z, and thus we can make the following replacements for any i = 3, . . ., N 1 .Finally, for the remaining sites we have simply the X operator at various sites and powers of Z. Thus, for any Collecting all these substitutions together we have and for k = 1, . . ., d − 1.Then, with k ∈ {3, . . ., N 1 + 1}, and, finally, for k ∈ {N 1 + 2, . . ., N}.
Lastly, by taking a weighted sum of expectation values of the above operators, we arrive at the following class of Bell expressions for a given graph state: where c i,k > 0 are some free parameters that satisfy for each k = 1, . . ., d − 1, where the second sum goes over all j such that for a fixed k, r 1,j = kr 1,2 .As we will see below the conditions (85) are used for constructing sum-of-squares decompositions of the Bell operators corresponding to I G , which in turn are crucial for determining the maximal quantum values of I G .In fact, we can prove the following theorem.
Theorem 2. The maximal quantum value of I G is Proof.To prove this statement let us consider a Bell operator corresponding to I G , i,k are defined in Eqs. ( 80)-( 83).We show that B G admits the following sum-of-squares decomposition To verify that this decomposition holds true let us expand the expression appearing in the square brackets for a particular n, where B (n) G is a part of the Bell operator corresponding to a particular n, that is, We now notice that by summing all the conditions (85) one can deduce that which implies that the coefficient in front of the identity simplifies to where the second line follows from the fact that apart from the first position all the local operators in G (n) i,k are unitary (notice also that G (n) 3,k have the identity at the first position), whereas the second line stems from the conditions ( 40) and (85).All this allows us to rewrite (89) simply as 2 Taking finally the sum of these terms over n = 1, . . ., d − 1 we arrive at the decomposition (88), which completes the first part of the proof.
From the decomposition (88) one directly infers that (d − 1)(d + N − N 1 − 1)1 − B G is a positive semi-definite operator for any choice of the local observables, which is equivalent to say that for any Bell operator B G corresponding to I G and any pure state |ψ , the following inequality is satisfied To show that this inequality is tight, and at the same time complete the proof, let us provide a particular quantum realisation that achieves it.To this end, we can invert the transformation we used to construct I G .Precisely, we let the first party measure d observables A k with k = 0, . . ., d − 1 which are defined in Eq. ( 38); for them A for i = 3, . . ., N 1 + 1, and, finally, It is not difficult to see that for this choice of quantum observables the Bell operator reduces to a combination of the stabilizing operators of the given graph state |G , that is, Owing to the conditions (85) as well as (91), one finds that which is what we aimed to prove.
We have thus obtained a family of Bell expressions whose maximal quantum values are achieved by graph states of arbitrary prime local dimension.To turn them into nontrivial Bell inequalities one still needs to determine their maximal classical values which is in general a hard task.For the simplest cases such as Bell inequalities for the AME(4,3) state or those tailored to the maximally entangled state of two qudits for low d's, the classical bounds can be determined numerically [cf.Eq. ( 49) and Table 1].On the other hand, in the next section we show that our inequalities allow to self-test the graph states of local dimension three, and thus for all of them the classical bound is strictly lower than the Tsirelson's bound.It is also worth mentioning that the ratio between the maximal quantum and classial values will certainly depend on the choice of vertices 1 and 2, in particular on the number of neighbours of the first vertex N 1 because this number appears in the formula for β Q (86).
Let us finally mention that our inequalities are scalable in the sense that the number of expectation values they are constructed from scales linearly with N. Indeed, it follows from Eq. ( 84) that the number of expectation values in I G is which in the worst case . This number can still be lowered twice because the expectation values in I G for n = d/2 , . . ., d − 1 are complex conjugations of those for n = 1, . . ., d/2 .Another possibility for lowering it number is to choose as the first vertex the one with the lowest neighbourhood.While it is an interesting question whether it is possible to design another construction which requires measuring even less expectation values, it seems that the linear scaling in N is the best one can hope for.

Self-testing of qutrit graph states
Here we show our second main result: we demonstrate that our Bell inequalities can be used to self-test arbritrary graph states of local dimension d = 3.In this particular case the general Bell expression (84) can be written as or explicitly as, where c.c. stands for the complex conjugation and represents the n = 2 term in Eq. ( 84), whereas the coefficients c 1,k and c 2,k satisfy the condition (85).
Let us now prove that maximal violation of I G can be used to self-test the corresponding graph state according to Definition 1.To this aim, we state the following theorem.Theorem 3. Consider a connected graph G and assume that the maximal quantum value of the corresponding Bell expression I G is achieved by a pure state |ψ ∈ H 1 ⊗ . . .⊗ H N and observables A x , B y , etc. acting on the local Hilbert spaces H i .Then, each Hilbert space H i decomposes as H i = C 3 ⊗ H i and there exist local unitary operators U i with i = 1, . . ., N such that with |aux being some state from the auxiliary Hilbert space H 1 ⊗ . . .⊗ H N .
Before we present our proof let us mention that it is follows a similar reasoning to the proof of self-testing of N-qubit graph states in [34], but since we deal here with qutrits it also makes a use of one of the results of Ref. [22], which for completeness we state in Appendix B as Fact 5.
Proof.Let us first notice that it is convenient to assume that the local reduced density matrices of the state |ψ are full rank; otherwise we are able to characterize the observables only on the supports of these reduced density matrices.Moreover, we assume for simplicity that r 1,2 = 1; recall that by construction r 1,2 = 0.The proof for the other case of r 1,2 = 2 goes along the same lines.
The sum-of-squares decomposition (88) implies the following relations for the state and observables that achieve the maximal quantum value of the Bell expression for k = 3, . . ., N 1 + 1, and G for k = N 1 + 2, . . ., N.
Before we employ the above relations in order to prove our self-testing statement let us recall that A (n) x (x = 0, 1, 2) are combinations of the first party's observables and are not unitary in general; still, they satisfy A (2)

and D (i)
w are all unitary observables which in the particular case d = 3 satisfy B 2 y = B † y etc.This implies that G (2) The main technical step we need is to identify at each site two unitary observables whose anticommutator is unitary.This allows us to make use of Fact 5 and Corollary 4 (see Appendix B) to define local unitary operators that map the two unkown observables to the qutrit ones.For parties having three measurement choices, the remaining observable will be directly mapped to other qutrit operators thanks to anticommutation relations that can be inferred from the sum-of-squares decompositions.
Our proof is quite technical and long and therefore to make it easier to follow we divide it into a few steps.In the first four we characterize every party's observables that give rise to the maximal quantum violation of the inequality, while in the last one we prove the self-testing statement for the state.
Step 1. (A x observables).Let us first determine the form of the first party's observables A x .To this end, we concentrate on conditions (103) which for n = 1 and r 1,2 = 1 can be rewritten as where C i and D are short-hand notations for where i = 1, 2, and, finally, Recall that in the case d = 3, A i,k = G (1) † i,k , Eq. ( 103) for n = 2 gives another set of conditions, similar to (106) but with all local operators being Hermitianconjugated.By the very definition, B i , C i and D are unitary and satisfy The above equations contain all three operators A i (i = 0, 1, 2).Let us then concentrate on the first condition in (106) and use the fact that B 0 and C 1 are unitary to rewrite it as which, taking into account that B 3 0 = 1 as well as We can now use again the first condition in Eq. ( 106) but with all local operators being "daggered" (recall that it follows from Eq. (103) for n = 2), which allows us to obtain A 2 0 |ψ = A † 0 |ψ .Since the reduced density matrix corresponding to the first subsystem of |ψ is full rank, the latter is equivalent to the following relation Using similar arguments one then shows that A 0 is unitary, which together with (111) implies that A 3 0 = 1 and thus A 0 is a proper quantum observable.
Employing then the second and the third relation in Eq. ( 106), one can draw the same conclusions for the other two operators on Alice's side, A 1 and A 2 .As a consequence, all three A i are quantum observables; in particular, they satisfy Let us now use (112) to characterize A x observables.By substituting Eq. ( 108) into it one finds, after a bit of algebra, that the observables A x are related via the following formula: where i, j, k = 0, 1, 2 and i = j = k.Using again Eq. ( 108) one can also derive similar relations for the tilted observables, with i, j, k = 0, 1, 2 such that i = j = k.Importantly, equations (113) and, analogously, (114) were solved in Ref. [22].In fact, it was proven there (cf.Fact 5 and Corollary 4 in Appendix B) that one can identify a qutrit Hilbert space in H 1 in the sense that H 1 = C 3 ⊗ H 1 for some auxiliary Hilbert space H 1 , and that there exists a unitary operation U 1 : H 1 → H 1 such that [notice that the third observable A 2 is obtained from the first two by using (114)] (i = 1, 2) are two projectors such that P (1) = 1 1 , where 1 1 is the indentity on H 1 .There are thus two inequivalent sets of observables at the first site that give rise to the maximal violation of our Bell inequality: XZ i with i = 0, 1, 2 and their transpositions.
Step 2. (B y observables).We can now move on to characterizing the B y observables.First, by combining the identities in (106) with Eq. ( 114) and then by using the fact that C 1 and C 2 commute as well as that A i are unitary, one finds the following equations for all triples i, j, k such that i = j = k.By virtue of the fact that all the single-party reduced density matrices of |ψ are full rank, these are equivalent to the following matrix equations and thus the B y observables satisfy analogous relations to A x .This implies that H 2 = C 3 ⊗ H 2 for some auxiliary Hilbert space H 2 , and there exists a unitary operation U 2 : H 2 → H 2 such that (cf.Fact 5 and Corollary 4) for i = 0, 1, 2, where P (2) 1 and P (2) 1 are two orthogonal projectors such that P (2) , where 1 2 is the identity acting on H 2 [notice that as before the form of the third observable B 2 follows from (117)].

Step 3. (C (i)
z observables).Let us now move on to the C (i) z observables that are measured by the observers numbered by i = 3, . . ., N 1 + 1, and consider the first equation in (106) and the conditions that follow from (104), which for our purposes we state as with k = 3, . . ., N 1 + 1, and Importantly, r 1,k = 0 for any k = 3, . . ., N 1 + 1, and hence all equations in (120) contain either A 1 or A 2 .Let us then exploit the fact that all local operators in both Eqs. ( 119) and ( 120) are unitary and therefore these equations can be rewritten as Crucially, C 0,k , C 0,k commute and therefore we deduce that where for simplicity we denoted λ k = −(1 + r 1,k + r 2,k ).In a fully analogous way we can derive Step 4. (D (i) w observables).Let us finally focus on the D observables.We first consider all vertices i ∈ {N 2 + 2, . . ., N} that are connected to the second vertex.For them r 2,k = 0 and therefore we have from Eq. (105), where At the same time, Eq. ( 103) for k = 1 gives where We then rewrite both Eqs. ( 128) and (131) as Since as already proven, the anticommutator of B −r 2,k 0 and B 1 is unitary for any k such that r 2,k = 0, the above equations imply that for all k = N 1 + 2, . . ., N for which r 2,k = 0, the anticommutator of D We can now move on to those vertices i ∈ {N 1 + 2, . . ., N} that are connected to the remaining neighbours of the first vertex.In this case we proceed in the same way as above, however, we now combine the conditions (104) and (105) as well as we employ the forms of the C (i) z operators given in Eqs. ( 126) and (127) to observe that for any site k which is connected to a neighbour m of the first vertex the anticommutator of D Let us finally consider the remaining vertices that are not neighbours of the first vertex.For each of them we can prove that the anticommutator of the local observables D (k) 0/1 or powers thereof is unitary in a recursive way starting from vertices connected to those that are connected to the neighbours of the first vertex and employing the relations (105).
Step by step we can prove the same statement for all D sites exploiting the fact that the graph is connected and therefore for each vertex there is a path connecting it with any other vertex in the graph.
We thus conclude that for all vertices k = N 1 + 2, . . ., N the local Hilbert is H k = C 3 ⊗ H k for some finite-dimensional H k and that there exists a unitary U k such that (cf.Fact 5 and Corollary 4 in Appendix B) The state.Having determined the form of all local observables we can now move on to proving the self-testing statement for the state.After substituting the above observables, the "rotated" Bell operator corresponding to the Bell inequality which is maximally violated can be expressed as where U = U 1 ⊗ . . .⊗ U N and P (i) m i are projections introduced above that satisfy P through the application of the identity map (m i = 0) or the transposition map (m i = 1) to the observables appearing at site i.Here, G a,b are the stabilizing operators of the graph state |G defined in Eqs.(68) for n = 1 and d = 3, which for completeness we restate here as with k = 3, . . ., with k = N 1 + 2, . . ., N. The subscripts were added to X and Z to denote the site at which these operators act; recall also that we fixed r 1,2 = 1.The formula (135) takes into account the fact that at each site we have two choices of measurements, with and without the transposition.Thus, the Bell operator is composed of 2 N N-qutrit Bell operators.For instance, for m 1 = . . .= m N = 0 no partial transposition is applied to B and therefore B 0...0 ≡ B, whereas for m 1 = . . .= m N = 1 the partial transposition is applied to every site and hence B 1...1 = B T , where T stands for the global transposition.
In order to find the form of the state maximally violating our inequality we now determine the eigenvector(s) of the Bell operator B G corresponding its maximal eigenvalue which is 2(N − N 1 + d − 1) [cf.Eq. ( 86)].To this end, let us focus on the N-qutrit operators B m and prove that the latter number is an eigenvalue of only two of them, B and B T , which correspond to the cases m 1 = m 2 = . . .= m N = 0, 1, whereas the eigenvalues of the remaining operators are all lower.
Clearly, B is composed of the stabilizing operators of the graph state |G and therefore its maximal eigenvalue conincides with the maximal quantum violation of the inequality which is 2(N − N 1 + d − 1).The same applies to B T because the transposition does not change the eigenvalues and the graph state is real.
Let us then move on to the remaining cases, i.e., m i are not all equal.We will show that in all those 2 N − 2 cases the B m operators have eigenvalues lower than 2(N − N 1 + 2) because for all those cases one can pick a few stabilizing operators G a,b whose partial transpositions cannot stabilize a common pure state anymore.For further benefits let us denote by G m a,b the stabilizing operators which are partially transposed with respect to those subsystems i for which m i = 1.We divide the proof into three parts corresponding to three cases: (i) m 1 = m 2 = 0, (ii)m 1 = m 2 = 1 and (iii) m 1 = 0, m 2 = 1 or m 1 = 1, m 2 = 0, and also a few sub-cases.
• The first one assumes that either m 1 = 1 and m 2 = 0 or m 1 = 0 and m 2 = 1, i.e., we take the transposed observables at the first or the second site, but not both at the same time.
For simplicity let us then fix m 1 = 1 and m 2 = 0. We consider three operators G T 1 1,i with i = 0, 1, 2, where T 1 is the transposition applied to the observables at the first site.It is not difficult to observe that using the explicit forms of the stabilizing operators [cf.Eqs.(137) and ( 138)] and including the transposition at the first site, one obtains where we also used the fact that the products of the observables at the remaining sites amounts to identity.Using then the fact that ZX = ωXZ, the above simplifies to This simple fact precludes that there exists a common eigenvector of G T 1 1,i (i = 1, 2, 3) with eigenvalue one.
• Next, we consider the case when the observables at the first two sites are not transposed, i.e., m 1 = m 2 = 0.There thus exists i = 1, 2 such that m i = 1.Let us first assume that this particular vertex belongs to i ∈ {3, . . ., N 1 + 1}, i.e., we take the transposed observables for this site.We then consider two operators G 1,0 and G 2,i .Notice then that the first of these operators has the Z observable at site i because i ∈ N 1 , i.e., it is connected to the first vertex, whereas the second one has Z r 1,i X at this position.At the remaining positions different than the first two they have only Z observable or the identity which do not feel the action of transposition.All this means that in this case G m 1,0 = G 1,0 and G m 2,i = G T i 2,i .Due to the fact that the transposition at site i modifies X appearing in G 2,i to X † , the operators G 1,0 and G T i 2,i do not commute (recall that by the very definition the stabilizing operators without the transposition commute).By virtue of Fact 4 stated in Appendix A this implies that G 1,0 and G T i 2,i do not stabilize a common pure state.
Let us now move on to the second sub-case in which m i = 1 for any i ∈ N 1 and there exist i ∈ {N 1 + 2, . . ., N} such that m i = 2. Since the graph is connected there exist another vertex j = 1, i which is connected to i. Analogously to the previous case, we consider two operators: G m 3,i and one of G m a,b , where the choice of the latter operator is dictated by the choice of the vertex j which i is connected to: for j = 2 we take G m 1,1 ; for j ∈ {3, . . ., N 1 + 1} we take G m 2,j ; finally, for j ∈ {N 1 + 2, . . ., N} we take G m 3,j .Now, G m 3,i has the X operator at site i and the Z operator at the remaining "D" sites, whereas all the other operators G m k .As already discussed above, this condition can be met for only two of these operators, B and B T .Moreover, the stabilizing operators that B (and thus also B T ) are composed of stabilize a unique state, which is the graph state |G .Consequently, |ψ i 1 ,...,i N = |G for any sequence i 1 , . . ., i N for which the corresponding local vectors are the eigenvectors of P (k) 0 (or P (k) 1 in the case of B T ).On the other hand, we showed that the eigenvalues of the remaining operators B m are lower than the maximal violation of the Bell inequality and thus in all those cases Eq. ( 145) can be satisfied iff the corresponding vectors vanish, |ψ i 1 ,...,i N = 0. Taking all this into account, we conclude that the state |ψ has the following form where |ϕ is some state from the auxiliary Hilbert spaces H 1 ⊗ . . .⊗ H N that satisfies

Conclusions and outlook
In this work we introduced a family of Bell expressions whose maximal quantum values are achieved by graph states of arbitrary prime local dimension.While at the moment we are unable to compute their maximal classical values, we believe the corresponding Bell inequalities are all nontrivial.This belief is supported by a few examples of Bell inequalities for which the classical bound was found numerically, and the fact that in the particular case of qutrit states they enable self-testing of all graph states.We thus introduced a broad class of Bell inequalities that can be used for testing non-locality of many interesting and relevant multipartite states, including the absolutely maximally entangled states.Moreover, in the particular case of manyqutrit systems our inequalities can also be employed to self-test the graph states, in particular the four-qutrit absolutely maximally entangled state.
There is a few possible directions for further research that are inspired by our work: • First of all, as far as implementations of self-testing are concerned it is a problem of a high relevance to understand how robust our self-testing statements are against noises and experimental imperfections.
• Another possible direction that is related to the possibility of experimental implementations of self-testing is to find Bell inequalities maximally violated by graph states that require performing the minimal number of two measurement per observer to self-test the state.For instance, for the GHZ state such a Bell inequality [25] and a self-testing scheme [26] based on the maximal violation of this inequality were introduced recently; this inequality is based, however, on a slightly different construction which is not directly related to the stabilizer formalism used by us here.
• Third, it is interesting to explore whether one can derive self-testing statements based on the maximal violation of our inequalities for higher prime dimensions d ≥ 0. While it is already known (cf.Ref. [22]) that these inequalities do not serve the purpose as far as quantum observables are concerned because there exist many different choices of them that are not unitarily equivalent, whether they enable self-testing of graph states remains open.In other words, it is unclear whether the given graph state is the only one (up to the above equivalences) that meets the necessary and sufficient conditions for the maximal quantum violation of the corresponding Bell inequality stemming from the sum-of-squares decomposition.
• The fourth possible direction is to generalize our construction so that it allows for designing Bell inequalities that are maximally violated by other classes of states such as for instance the hyper-graph states [42] (see also Ref. [43] in this context).
• Last but not least, one can also explore the possibility of self-testing of genuinely entangled subspaces within the stabilizer formalism in Hilbert spaces of arbitrary prime local dimension along the lines of Refs.[20,21]. where Then, by applying Depending on the value of r 1,k = 0, both (159) and (161) are used in Eqs.(126) and (127).

• (D (i)
w observables) By applying the above observables (159) one can bring them to the following form which is used in Eqs.(133) and (134).

)
It is not difficult to check that O d k = 1 d for any k = 0, . . ., d − 1 and prime d, meaning that the eigenvalues of each of these unitary matrices belong to the set {1, ω, . . ., ω d−1 }, and thus are proper d-outcome observables in our formalism.It is also worth mentioning that for any prime d ≥ 2 their eigenvectors together with the standard basis in C d form d + 1 mutually unbiased bases.

0
] r m,k is unitary and therefore D (k) 0/1 satisfy the assumptions of Fact 5 in Appendix B.
any site i = 1, . . ., N, B m with m := m 1 . . .m N , where m i = 0, 1, are N-qutrit Bell operators obtained from m a,b for a = 1, 2, 3 and b = i listed above have only either the Z operator or the identity at all "D" sites.Thus, G m a,b = G a,b for any a = 1, 2, 3 and b = i and any sequence m in which m l = 1 for l = 1, . . ., N 1 + 1, and G m 3,i = G T i 3,i .Now, it clearly follows that G m 3,i does not commute with the chosen G a,b because the transposition at site i changes the X operator to X 2 and because, by the very definition, G 3,i (without the transposition) commutes with any other G a,b .As before this implies thatG m 3,i G a,b = ω q G a,b G m3,i for some q = 1, 2, and therefore these two operators cannot stabilize a common pure state [cf.Fact 4 in Appendix A].•The last case to consider is when m 1 = m 2 = 1; the remaining m i can take arbitrary values except for being all equal to one, which corresponds to the already-considered case of all observables being transposed.Here we can use the fact that G m a,b for all a, b stabilize the graph state |G if and only if [G m a,b ] T does, where T is the global transposition.We can thus apply the global transposition to all the operators G m a,b and consider again the case when m 0 = m 2 = 0 and there is some i = 1, 2 such that m i = 1, which has already been considered above.Knowing that among all the B m operators only B and B T give rise to the maximal quantum violation of the Bell inequality corresponding to the considered graph, we can determine the form of the state |ψ maximally violating the inequality.Due to the fact that each local Hilbert space decomposes as H k = C 3 ⊗ H k we can write the state as|ψ = ∑ i 1 ,...,i N |ψ i 1 ,...,i N ⊗ |i 1 1 ⊗ . . .⊗ |i N N ,(143)where |ψ = (U 1 ⊗ . . .⊗ U N )|ψ , |ψ i 1 ,...,i N are some vectors from (C 3 ) ⊗N and the local bases |i k are the eigenbases of the projectors P(k)m k .The fact that |ψ achieves the maximal quantum value of the inequality,β Q = 2(N − N 1 + 2), means that the following identity B G |ψ = 2(N − N 1 + 2)|ψ(144)holds true.Plugging Eqs.(143) and (135) into the above equation one finds that it is satisfied iff for every sequence m, B m |ψ i 1 ,...,i N = 2(N − N 1 + 2)|ψ i 1 ,...,i N , (145) holds true for all those sequences i 1 , . . ., i N for which the local vectors |i k at site k are the eigenvectors of the operator P (k)

Table 1 :
Maximal classical values of the Bell expression I max given in Eq. (59) for d = 3, 5, 7.
2.1] which leads us to the following d(d − 1) stabilizing operators of |ψ + d :