Maximal nonlocality from maximal entanglement and mutually unbiased bases, and self-testing of two-qutrit quantum systems

Bell inequalities are an important tool in device-independent quantum information processing because their violation can serve as a certificate of relevant quantum properties. Probably the best known example of a Bell inequality is due to Clauser, Horne, Shimony and Holt (CHSH), which is defined in the simplest scenario involving two dichotomic measurements and whose all key properties are well understood. There have been many attempts to generalise the CHSH Bell inequality to higher-dimensional quantum systems, however, for most of them the maximal quantum violation---the key quantity for most device-independent applications---remains unknown. On the other hand, the constructions for which the maximal quantum violation can be computed, do not preserve the natural property of the CHSH inequality, namely, that the maximal quantum violation is achieved by the maximally entangled state and measurements corresponding to mutually unbiased bases. In this work we propose a novel family of Bell inequalities which exhibit precisely these properties, and whose maximal quantum violation can be computed analytically. In the simplest scenario it recovers the CHSH Bell inequality. These inequalities involve $d$ measurements settings, each having $d$ outcomes for an arbitrary prime number $d\geq 3$. We then show that in the three-outcome case our Bell inequality can be used to self-test the maximally entangled state of two-qutrits and three mutually unbiased bases at each site. Yet, we demonstrate that in the case of more outcomes, their maximal violation does not allow for self-testing in the standard sense, which motivates the definition of a new weak form of self-testing. The ability to certify high-dimensional MUBs makes these inequalities attractive from the device-independent cryptography point of view.


Introduction
Nonlocality of quantum mechanics, in the sense first described by Einstein, Podolsky and Rosen [EPR35] and later formalised by Bell [Bel64], is arguably one of its most counterintuitive features. While the original motivation for studying Bell inequalities was to rule out a classical (local-realistic) description of the system under study, we now understand that Bell nonlocality can also be used in a constructive manner. If we assume that our system is governed by quantum mechanics, we can use Bell violations to certify specific quantum properties. One can, for instance, certify the dimension [BPA + 08], the amount of entanglement present in the state [MBL + 13], or the degree of incompatibility of the measurements [CS16,CBLC16]. Bell violations are also used to certify randomness produced in the experiment, which is often applied to device-independent cryptography, e.g. randomness generation/expansion [Col06, PAM + 10, CK11, VV12, MS16,BPPP14], quantum key distribution [BHK05, AGM06, ABG + 07, RUV13, VV14, MS16, AFDF + 18] or multi-party cryptography [SCA + 11, KW16, RTK + 18, RMW16,RMW18]. In some cases the observed nonlocal correlations give us a full description of the system under study (up to well-understood equivalences). This constitutes the most complete variant of device-independent certification and goes under the name of self-testing [MY98,MY04]. Most selftesting schemes allow us to certify states which are locally qubits [BLM + 09, McK14, MYS12, YN13, BP15, WWS16,ŠASA16]. These results were combined to give certification schemes for higher-dimensional systems [YN13,CGS17,ŠCAA18]. However, they are still based on the violation of many two-outcome Bell inequalities; in particular, the observables they use are constructed out of single-qubit measurements. It remains a highly nontrivial and interesting problem to propose certification schemes for quantum states of higher local dimension based on a single d-outcome Bell inequality and exploiting genuine d-outcome measurements such as higher-dimensional mutually unbiased bases. The main aim of our work is to fill this gap.
The certification aspect adds a new layer of complexity to nonlocality. Given a Bell inequality it is no longer sufficient to find the local and quantum values, but one should go one step further to investigate whether the observed violation can be used for certification of quantum resources. Numerous Bell inequalities have been proposed in the last 25 years (see Ref. [BCP + 14] for a comprehensive review), but their certification properties are in most cases poorly understood.
The simplest and most-studied Bell inequality is due to Clauser, Horne, Shimony and Holt (CHSH) [CHSH69]. In the CHSH scenario there are two devices which have two settings and two outcomes each. It is well known that this inequality can be maximally violated by performing maximally incompatible qubit measurements on the maximally entangled state of two qubits. In fact, this is essentially the only manner of achieving the maximal violation [Tsi87,SW87,PR92,Tsi93]. Several generalisations of the CHSH inequality to Bell scenarios involving d-outcome measurements have been proposed. However, for most of them the maximal quantum value is not known [CGL + 02, BM05,BKP06,SLK06]. For those for which the maximal quantum value can be computed, the maximal quantum violation is achieved by the maximally entangled state, but the optimal measurements do not correspond to mutually unbiased bases [dV15,SAT + 17,Col18].
In this work we introduce a generalisation of the CHSH Bell inequality which fills this gap. To this aim we consider the Bell functional due to Buhrman and Massar (BM) [BM05] in which the settings and outcomes instead of being bits come from the set {0, 1, . . . , d − 1} for some integer d and the winning condition is interpreted modulo d. While this functional seems to be quite a natural generalisation of the CHSH one, it turns out to be surprisingly hard to analyse. In particular, the quantum value is only known for d = 3 (and the proof is numerical). Here we define a modification of the BM inequality for d being an odd prime and show that it has several desirable features. Most importantly, we can compute the quantum value by first exhibiting a sum-of-squares (SOS) decomposition of the Bell operator and then giving an explicit quantum realisation which saturates this bound. This quantum realisation uses the maximally entangled state of local dimension d and rank-1 projective measurements which are pairwise mutually unbiased. On the other hand, finding the classical value of our Bell expressions turns out to be a difficult problem and we compute it only for d = 3, 5, 7. Nevertheless, we conjecture that the classical and quantum values differ for any prime d.
Importantly, the SOS decomposition allows us to derive explicit algebraic relations that the optimal observables must satisfy. For d = 3 we are able to completely solve these relations, i.e. for this inequality we obtain a complete self-testing statement. To the best of our knowledge this is the first analytical self-testing statement, which does not rely on self-testing results for twodimensional systems (except for Ref. [CS17] which relates the self-testing problem to representations of a certain group). Note that a partial self-testing statement for the maximally entangled state of two qutrits has recently been proven numerically for a different Bell inequality [SAT + 17]. For d = 5 and d = 7, on the other hand, the situation becomes more complicated: we show that the maximal violation can be achieved by quantum realisations which are not equivalent according to the standard definition of self-testing.
The paper is organised as follows. In Section 2 we es-tablish notation, whereas in Section 3 we explicitly state the modified BM inequality and compute its quantum value. In Section 4 we provide a partial characterisation of the quantum realisations saturating the quantum bound and derive a self-testing statement for d = 3. We summarise our findings and discuss some resulting open questions in Section 5.

Preliminaries
This section sets up the scenario and introduces the relevant notation and terminology from the area of Bell nonlocality.

Measurements and observables
Throughout this work we assume all the systems to be finite-dimensional. A measurement with d outcomes is a collection of positive semidefinite operators {F a } d−1 a=0 satisfying d−1 a=0 F a = 1. Given a measurement and an integer n ∈ Z we define where ω := exp(2πi/d). Clearly, the operator corresponding to n = 0 is fixed by the normalisation condition: A (0) = 1. Since this is a discrete Fourier transform, the inverse transformation is given by Therefore, we may think of the operators A (1) , . . . , A (d−1) as an alternative description of the measurement. This representation turns out to be convenient for our purposes. Since all computations in this work are performed at the level of operators A (n) , let us state some of their properties (see Appendix A for proofs). For arbitrary n we have

Moreover, it is clear that
i.e. there are at most d − 1 distinct operators (because A (0) = 1). This description becomes particularly simple when the original measurement is projective, i.e. the measurement operators satisfy F a F b = δ ab F a with δ ab being the Kronecker delta. Then, the entire measurement can be encoded into a single operator: it is easy to verify that A (n) = A n for A := A (1) . In such a case we will refer to the unitary operator A as the observable and one can check that its spectrum is contained in {1, ω, ω 2 , . . . , ω d−1 }. To ensure that an unknown measurement is projective, it suffices to check that the operator A (1) is unitary, i.e. A (1) † A (1) = 1.

Bell scenario and Bell inequalities
In this work we consider a bipartite Bell scenario in which two parties, traditionally named Alice and Bob, share some bipartite physical system, and each of them performs a number of measurements on their share of this system. We assume that both parties perform d measurements and each measurement has exactly d outcomes. The measurement choices of Alice and Bob are labelled by j and k, whereas the outcomes by a and b, respectively, and we use the convention that a, b, j, k ∈ {0, 1, . . . , d−1}. Denoting the probability of observing outcomes a and b given settings j and k by P (ab|jk), the above experiment, termed also Bell experiment, is described by a set of probability distributions {P (ab|jk)}.
It is natural to assume that any correlations observed in such a Bell experiment satisfy the no-signalling principle, meaning that the outcomes of one of the parties cannot depend on the measurement choice made by the other party. Mathematically, this is expressed as a set linear constraints of the form for all a, j and k = k . By the very definition, correlations obeying the no-signalling principle form a convex polytope that for further purposes we denote N d . Imagine now that Alice and Bob share a quantum system represented by a bipartite density matrix ρ AB and perform quantum measurements on it. Then, the conditional probabilities are given by the following well-known formula where {F j a }, {G k b } represent the measurements of Alice and Bob, respectively. Let us notice that all such quantum correlations, that is, correlations obtained from quantum states (if we do not constrain their local dimension) form a convex set, denoted Q d , whose structure is in general unknown and difficult to characterise [Slo17].
The last set of correlations we need to introduce here is that of correlations admiting the local-realistic description, that is, those for which P (ab|jk) can be represented as where λ are the hidden variables, while D A (a|x, λ) (and similarly D B (b|y, λ)) is a deterministic function that for a given x and λ returns a fixed outcome with probability one. Correlations admitting such description are usually referred to as local or classical, and, similarly to the nosignalling correlations, they form a convex set that is a polytope, denoted P d . For a given scenario it holds that P d Q d N d . In particular, a natural way to show that P d Q d is to use Bell inequalities. To define them explicitly let us consider a Bell functional where c abjk are some real coefficients. Computing then the maximal value of β over the local set P d , that is, β C := max P d β, one arrives at a Bell inequality abjk c abjk P (ab|jk) ≤ β C (6) whose violation indicates nonlocality. Let us also denote by β Q and β N S the maximal values of β over the quantum and no-signalling sets, that is, is the Bell operator constructed from the measurements {F j a } and {G k b }. It will be highly beneficial for us to reformulate the Bell operator in terms of quantum observables instead of positive semi-definite measurements operators, in particular it will facilitate devising a sum of squares decomposition for our Bell where as before the summations go over {0, 1, . . . , d − 1}.
The coefficients correspond to the 2-dimensional discrete Fourier transform of the Bell coefficients (c abjk ). Since (c abjk ) are real, the Fourier coefficients satisfy We will later use the fact that this condition is also sufficient for the Bell coefficients to be real. Analytic bounds on the quantum value of a Bell operator can be obtained by constructing an SOS decomposition. More specifically, suppose that we can show that for all valid measurements of Alice and Bob we have where c ∈ R is a constant and (L j ) t j=1 is a collection of bipartite operators constructed from the measurement operators of Alice and Bob. This immediately implies that for any state ρ AB we have tr(W ρ AB ) ≤ c. Moreover, if the SOS decomposition is tight, i.e. β Q = c, it yields explicit restrictions on the optimal realisation: any quantum realisation that achieves tr(W ρ AB ) = β Q must satisfy tr(L † j L j ρ AB ) = 0 (10) for all j ∈ {1, 2, . . . , t}. Note that tr(L † j L j ρ AB ) = L j ρ 1/2 AB 2 F , where ||·|| F is the Frobenius norm. Therefore, Eq. (10) is equivalent to L j ρ 1/2 AB = 0 and immediately implies L j ρ AB = 0.

Two approaches to self-testing
Self-testing constitutes the most complete form of deviceindependent certification in which the quantum realisation is determined up to local unitaries and extra degrees of freedom. These two ambiguities cannot be resolved in a device-independent scenario and it is implicitly understood that in the task of self-testing we identify the quantum realisation up to these two equivalences. For brevity we will refer to them as the standard equivalences. While for many scenarios these equivalences are sufficient, in some cases there is an extra equivalence resulting from the fact that the quantum realisation can be transposed to obtain an inequivalent realisation [MM11, Kan17, ABB + 17]. Since the transpose is as well-understood and unavoidable as the other two equivalences, we believe it is justified to also refer to this phenomenon as self-testing.
If we want to base a self-testing statement on the observed Bell violation, there are two approaches we can choose from. The starting point of a self-testing argument are algebraic relations satisfied by the optimal observables. Typically, in order to derive such relations from the observed Bell value, we examine the SOS decomposition (although in some cases one can also look at the square of the Bell operator [Kan17]). In the first approach we use the knowledge of the ideal observables to propose a swap unitary. This unitary acts jointly on one part of the unknown state and a fresh register and attempts to swap out the relevant part of the state into the new register. Such a unitary is applied on both sides and we then use the algebraic relations to show that at the end the new registers hold the desired ideal state.
In this work, however, we use a different method proposed originally by Popescu and Rohrlich [PR92]. We use the previously deduced algebraic relations to derive relations which contain observables of a single party only. Since properties of observables can only be determined on the support of the reduced states ρ A and ρ B , it is convenient to assume that the reduced states are full-rank (this assumption does not affect the conclusions, but it significantly simplifies the mathematical description of the problem). These single-party algebraic relations allow us to deduce the exact form of the local observables for each party up to local unitaries and extra degrees of freedom. Once the local observables have been characterised, we can simply construct the Bell operator and diagonalise it. The state shared by the players is now determined by the eigenspace corresponding to the largest eigenvalue.

The modified Buhrman-Massar functional
We are now ready to present our main result. We begin with a new generalisation of the CHSH Bell inequality to d-outcome Bell scenarios.
In the CHSH scenario the settings j, k and the outcomes a, b are bits and the Bell functional is given by It is well known that β L = 3/4, β Q = 1/2 + 1/(2 √ 2) and β N S = 1. Buhrman and Massar proposed a natural generalisation of the CHSH functional by extending the input and output alphabet to {0, 1, . . . , d − 1} and replacing the XOR operation by addition modulo d [BM05]. The BM functional is defined as otherwise.
The no-signalling value of this functional equals β N S = 1 for all d [BM05] and is achieved by a straightforward generalisation of the Popescu-Rohrlich box [PR94]. The quantum value is in general not known and the only analytic bound states that whenever d is prime we have [BS15] For small values of d upper and lower bounds have been computed numerically by Liang et al. [LLD09]. The only case in which the two bounds coincide corresponds to d = 3 and the resulting value is in excellent agreement with the analytic expression given in Ref.
[JLL + 08]. The local value has been explicitly computed for prime d up to d = 13 [LLD09], but no analytic formula is known. Although the BM functional is clearly a natural generalisation of the CHSH functional, its quantum value seems hard to determine. To avoid this problem, we propose a modification of the BM functional for which the quantum value can be computed analytically. Writing the BM operator in terms of operators A We consider a generalisation of this Bell operator given by where λ n are complex numbers of unit modulus. To ensure that condition (9) is satisfied, we must choose λ 0 to be real, i.e. λ 0 = 1, and λ n = λ * d−n for n ∈ {1, 2, . . . , d − 1}.
In the remainder of this section we show that for every prime dimension d ≥ 3 there exists a valid choice of phases λ n for which the quantum value can be computed analytically. In the first step we show that regardless of the choice of λ n we have which means that the upper bound given in Eq. (11) holds for arbitrary phase factors. In the second step we specify the phases and give a quantum realisation which saturates this bound.
To prove the generic upper bound given in Eq. (13) we construct a SOS decomposition. For an integer n where , which allows us to write the Bell operator as The term corresponding to n = 0 is proportional to identity, whereas terms n and d − n are conjugate to each other. Therefore, it is convenient to write the Bell operator as (Note that since d is odd, (d − 1)/2 is an integer.) This expression can be rewritten as which gives the desired operator bound. Before proceeding to the second step, let us make two comments about this SOS decomposition. First note that so far we have only used the fact that d is odd. However, the decomposition easily generalises to the case of even d (the only difference being that the operator T n corresponding to n = d/2 is a single sum of Hermitian operators). This shows that the upper bound given in Eq. (11) holds for all dimensions d (not necessarily prime). Moreover, note that the SOS decomposition can be straightforwardly generalised to the case where the coefficients λ n are arbitrary complex numbers satisfying λ n = λ * d−n . To show that the upper bound given in Eq. (13) can be saturated, we specify the phases and give an explicit quantum realisation. For an odd prime d the phases are chosen as (see Appendix D for details) n d is the Legendre symbol 1 and The optimal quantum realisation is inspired by that of Ji et al.
[JLL + 08]: Alice and Bob share a maximally entangled state of local dimension d, 1 Recall that the Legendre symbol n d equals +1 if n is a quadratic residue modulo d and −1 otherwise. and perform rank-1 projective measurements which are (pairwise) mutually unbiased. Since the measurements are projective, they are fully determined by a single unitary operator: the observable. These are conveniently expressed in terms of the Heisenberg-Weyl operators: where the summation goes over j ∈ {0, 1, . . . , d − 1} and |d ≡ |0 . The observable corresponding to the k-th mea-surement of Bob is given by It is straightforward to check that these are valid observables (they are clearly unitary, while the correctness of the spectrum can be verified by showing that B d k = 1), and therefore B To see that these observables correspond to mutually unbiased bases note that if we disregard the multiplicative factor ω k(k+1) , which corresponds to a cyclic shift of the outcomes, we obtain one of the standard constructions of a complete set of mutually unbiased bases in prime dimension [BBRV02].
Before defining the observables of Alice, it is convenient to explore some properties of the observables of Bob. If we compute the corresponding operator C itself is a valid observable (i.e. it is unitary and has the correct spectrum). Moreover, the higher-order operators satisfy The first observation enables us to define the observables of Alice as where * denotes the complex conjugation in the standard basis (which does not affect the spectrum of the operator). The power relation given in Eq. (23) allows us to evaluate all the terms appearing in the Bell functional: This immediately implies that which saturates the upper bound given in Eq. (13).
Since this quantum realisation saturates the Bell expression term-by-term, it is clear that the same will be true if we rescale terms corresponding to distinct n by arbitrary non-negative numbers (the scaling must preserve the condition (9)). In other words, we have obtained a whole family of Bell inequalities saturated by precisely the same set of probability points. For certification purposes in the exact case, i.e. when the violation is maximal, all these inequalities are equivalent. In the presence of noise they will not be the same, but it is not clear what the optimal choice of weights is.
Having presented the quantum realisation saturating the upper bound, it is easy to see how the phases λ n were computed. We started from the observables of Bob given in Eq. We have shown how to achieve the quantum value using quantum systems of local dimension d, but it is not a priori clear that one cannot achieve it using quantum systems of lower dimension. To gain some intuition we have performed numerical search over quantum strategies of local dimension r < d for d = 3, 5. We have used the standard see-saw procedure in which we pick a random quantum realisation (states and measurements) on C r ⊗ C r and optimise until we reach a local maximum. This procedure is not guaranteed to converge to the global maximum, but given a sufficient number of repetitions one can hope to explore the entire landscape of realisations in a fixed dimension. Let β r Q be the largest value achievable using quantum systems of local dimension r. Clearly β 1 Q = β L , whereas for our inequalities β d Q = β Q , therefore, we only consider r ∈ {2, 3, . . . , d − 1}. For completeness for d = 3, 5, 7 we have also computed the classical value (by enumerating all deterministic strategies).
For d = 3 we have The numerical search over two-qubit strategies did not yield a single instance exceeding the classical value. One might ask whether these Bell inequalities correspond to facets of the local set, but we believe that this is not the case. For d = 3 and d = 5 we have found all the deterministic points saturating the local bound (9 and 125 points, respectively) and these did not correspond to a facet. We conjecture that the inequalities for larger values of d behave in analogous manner.

Quantum realisations which achieve the maximal violation
In the previous section we have proposed a new Bell functional and shown that the quantum value can be achieved by performing mutually unbiased measurements on the maximally entangled state of dimension d. A natural follow-up question is whether this Bell functional is a selftest, i.e. whether this is the only manner of achieving the quantum value (up to the standard equivalences).
In this section we show that the optimal observables are fully characterised by simple algebraic relations. For d = 3 these conditions are sufficient to explicitly derive the form of the observables, which leads to a complete self-testing statement (although the extra freedom coming from the transposition map must be included). On the other hand, for d = 5 and d = 7 we have found additional, inequivalent quantum realisations, which implies that the introduced Bell functionals are not self-tests.

Necessary and sufficient algebraic conditions
As explained in Section 2.2 a tight SOS decomposition leads to explicit algebraic conditions that every optimal realisation must satisfy. To achieve the quantum value every term in Eq. (15) must be saturated, i.e. tr(T n ρ AB ) = 2d for all n ∈ {1, 2, . . . , (d − 1)/2}. By the SOS decomposition given in Eq. (16) this implies that tr B leads to an analogous SOS decomposition, which implies Conditions (24) and (25) simply require that the observables of Alice and Bob correspond to measurements which are projective on the (local) support of the state. Under the assumption that the reduced states are fullrank, we deduce that all the measurements are projective. As explained in Section 2.1 this allows us to write A (1) k , which is unitary and satisfies B d k = 1. (27), on the other hand, imply some relations between the observables of Alice and Bob, namely:

Conditions (26) and
for n ∈ {1, 2, . . . , d − 1}. Our goal now is to infer what impact these two relations have on the form of the operators C (n) j . Let us start with n = 1. The fact that the observables of Alice are unitary implies that Tracing out the subsystem of Alice and using the fact that ρ B is full-rank gives C where we have used the relation (28) twice: for n = t and n = 1. This immediately implies that for all t ∈ {1, 2, . . . , n − 1}.
In the previous paragraph we have established that the maximal violation requires the operators C (n) j to be unitary, have the correct spectrum and satisfy the power relation (30). Since the operators C (n) j are constructed out of the observables of Bob, these conditions are restrictions on the observables B k . However, it follows immediately from the calculations presented in Section 3 that any observables satisfying these conditions can be used to construct the entire quantum realisation: we simply take the maximally entangled state and define the observables of Alice as A j := C

A complete self-testing statement for d = 3
For d = 3 the algebraic characterisation is sufficient to derive the explicit form of the observables. In this case the condition C (1) j 3 = 1 is equivalent to which can be rewritten as for ω = exp(2πi/3) and λ 1 = e −iπ/18 . Since the observables of Bob are projective, we have B 2 j = B † j , which leads to where we have used the fact that By taking suitable linear combinations of Eq. (31) corresponding to distinct values of j ∈ {0, 1, 2} we arrive at and these relations turn out to be sufficient to reconstruct the observables of Bob. As explained in Section 2.4 sometimes the standard equivalences must be supplemented by the freedom resulting from the transposition map and this is precisely what happens in this case. In Appendix B we show that projectivity and the commutation relations above imply that the Hilbert space of Bob H B contains a qutrit, where the canonical observables are given by and Q 1 , Q 2 are orthogonal projectors satisfying Q 1 + Q 2 = 1 B . These two projectors identify the orthogonal subspaces corresponding to the two inequivalent solutions. Since the Bell functional is symmetric, we obtain analogous relations for the observables of Alice: we conclude that H A ≡ H A ⊗ H A for H A ≡ C 3 and that one can find a unitary U A : where P 1 , P 2 are orthogonal projectors satisfying P 1 + P 2 = 1 A . This characterisation allows us to write down the Bell operator as where U := U A ⊗ U B , the summation goes over x, y ∈ {0, 1} and W xy is the two-qutrit Bell operator corresponding to the canonical observables k . The two-qutrit Bell operators can be diagonalised explicitly and we find that only W 01 and W 10 contain µ = 1 3 + 2 3 √ 3 as an eigenvalue. In both cases the corresponding eigenspace is 1-dimensional and the eigenvector is simply the maximally entangled state of two qutrits: |Φ := (|00 + |11 + |22 )/ √ 3. It follows that any state that achieves the maximal violation must be of the form where σ A B is an arbitrary state satisfying Condition (33) implies that the maximal violation certifies the maximally entangled state of two qutrits, which can be extracted by tracing out the auxiliary registers A and B . Condition (34) shows that the maximal violation is only possible when the observables of Alice and Bob belong to the two inequivalent classes. This self-testing result has a couple of immediate consequences. First of all, the maximal violation is achieved by a single probability point in the quantum set of correlations, which implies that this is an exposed 3 point of the quantum set. Moreover, the marginal distributions of outcomes are uniform and it is easy to see that they remain uniform even for an eavesdropper who holds a purification. Intuitively speaking, this comes from the fact that the randomness is produced from the pure entangled state Φ A B , whereas the adversary can only hold the purification of σ A B . The maximal violation certifies log 3 bits of local randomness (for each input of Alice or Bob) against an external adversary, which makes this Bell inequality a good candidate for cryptographic tasks like generation of certified randomness or secret key.

Inequivalent quantum realisations for d = 5 and d = 7
Having fully solved the d = 3 case one might expect to obtain similar results for higher dimensions. Perhaps surprisingly, this turns out not to be the case: we have found that in dimensions d = 5 and d = 7 there exist additional, inequivalent choices of local observables which give rise to the maximal violation. The construction is a simple generalisation of the original observables given in Eq. j . To see that these are not equivalent to the original observables, it suffices to look at commutation relations: the observables defined above satisfy On the other hand, the original observables from Eq. (22) satisfy whereas their transposes satisfy Clearly, whenever d ≥ 5 choosing q = 2 in Eq. (35) gives rise to a solution which is neither unitarily equivalent to the original realisation nor to its transpose. Nevertheless, all these realisations use the maximally entangled state of local dimension d. Therefore, it is possible that the maximal violation certifies the state, but not the measurements. Finally, let us point out that these distinct quantum realisations lead to the same probability point. Therefore, one might conjecture that despite the ambiguity at the level of quantum realisations, the Bell functional is maximised by a single probability point.

Conclusions
The Buhrman-Massar generalisation of the CHSH inequality, despite its apparent simplicity, turns out to be hard to analyse. In particular, despite both analytical and numerical studies the behaviour of its quantum value is not known. In this work we propose a simple modification which allows us to analyse the resulting functional. More specifically, we propose a family of Bell functionals labelled by prime d ≥ 3, whose quantum value can be determined analytically. For every such d we give an explicit realisation which achieves the quantum value in which Alice and Bob share the maximally entangled state of local dimension d and perform local rank-1 projective measurements which are pairwise mutually unbiased. We thus generalise the CHSH Bell inequality to d-outcome Bell scenarios, preserving at the same time the most relevant of its properties: (i) analytical computability of its maximal quantum value and (ii) achievability of the maximal quantum violation by the maximally entangled state and mutually unbiased bases. Once we know the quantum value and we have a particular quantum realisation of it, one might ask whether this realisation is unique (up to some well-understood equivalences). The SOS decomposition yields explicit algebraic relations that the local measurements must satisfy. For d = 3 these can be fully resolved: the quantum realisation is unique up to extra degrees of freedom, local unitaries and transposition. Unfortunately, the situation becomes more complicated for higher d. For d = 5 and d = 7 we have found alternative realisations which despite apparent similarity (they also employ the maximally entangled state and mutually unbiased bases) are not equivalent according to the definition of self-testing (even if we allow for the extra freedom coming from the transposition map).
The first follow-up question that arises from our work is whether the new Bell functional is a self-test in some weaker sense. We conjecture that the maximal violation requires maximal entanglement and mutually unbiased bases, but providing a mathematical formulation of this conjecture is not trivial: for instance, it is clear that not all possible combinations of mutually unbiased bases will give rise to the maximal violation.
Another interesting direction would be to investigate whether the new Bell functionals can be modified to be maximally violated by other entangled states, keeping at the same time their attractive features, i.e. analytically computable quantum value and an explicit quantum realisation achieving it. Similarly to how adding a marginal term to the CHSH inequality yields the tilted CHSH inequality [AMP12], which has found numerous applications, one might add an analogous local term to the new Bell operator and investigate the consequences. On one hand, one might expect such an inequality to be maximally violated by a non-maximally entangled state of dimension d. On the other hand, given the recent nonclosure results [Slo17, DPP17, CS18], it is not even guaranteed that the maximal violation can be achieved by finite-dimensional states. Therefore, adding the marginal term could have much more dramatic consequences that in the case of binary outcomes, which makes the problem even more interesting to study. ropean Regional Development Fund. J. K. acknowledges support from the POLONEZ programme which has received funding from the European Union's Hori-

A Measurements and observables
In this appendix we prove some properties stated in Section 2.1 and let us start with the following proposition.  = 1), which implies that V V † = Π for some projector Π and in particular V V † ≤ 1. Combining this with the fact that U is a unitary immediately implies To prove the second part note that The "if" part is clear, so let us focus on the "only if" statement. The trace of A † A satisfies If A † A = 1, this inequality is tight, which means that for all a = b we have Since the phases are distinct, we deduce that tr(F a F b ) = 0, which for positive semidefinite operators implies orthogonality, i.e. F a F b = 0 for a = b. The fact that the upper bound is tight implies that F 2 a = F a for all a.
Let us now apply these results to the operators A (n) . Recall that for a d-outcome measurement given by {F a } d−1 a=0 the operator A (n) is defined as for ω := exp(2πi/d). The first part of Proposition A.1 immediately implies that [A (n) ] † A (n) ≤ 1 for all n. If the original measurement is projective, i.e. the measurement operators are orthogonal projectors F a F b = δ ab F a , the measurement can be encoded in an observable A := A (1) (it is easy to verify that A (n) = A n ). This observable is unitary A † A = AA † = 1 and satisfies A d = 1. The second part of Proposition A.1 allows us to deduce that the measurement is projective by looking only at the A (n) operators: the operator A (1) satisfies the condition of the proposition, so if [A (1) ] † A (1) = 1, then the measurement is projective. In fact, the same argument works for A (k) for any integer k which is coprime to d.

B Optimal observables for d = 3
In this appendix we show that the commutation relations derived in Sec. 4.2 allow us to reconstruct the optimal observables. Let us start with two technical propositions.
where q and d are coprime. Then, dim(H) = d · t for some integer t ≥ 1 and there exists a unitary U : Proof. Let t ∈ N be the multiplicity of the λ = 1 eigenvalue of B 0 and let {|e The commutation relation implies that for any k ∈ N It is also clear that the vectors {|e k=0 is the standard basis on C d and {|g j } t−1 j=0 is an arbitrary basis on C t . In Eq. (36) we have chosen the canonical observables to be Z q and X, but clearly we can replace them with any observables satisfying the right commutation relation (this is precisely what Prop. B.1). For our purposes it is better to make a different choice. For d = 3 and q = 1 we choose the unitary U such that whereas for d = 3 and q = 2 we choose where Q 1 and Q 2 are orthogonal projectors satisfying Q 1 + Q 2 = 1 B .
Proof. The unitarity of the anticommutator reads and is equivalent to This implies that the eigenvalues of T satisfy λ + λ * + 1 = 0 and since T is unitary, the only possibilities are λ = ω and λ = ω 2 . Let us now show that the unitaries B 0 and B 1 respect the block structure of T . We choose a basis in which T reads and write B 0 in the same basis Let Since R = B † 1 B 0 B 1 , we also have R † = R 2 , which in the block form reads The top-left entries of Eqs. (39) and (41), i.e.
Similarly, the bottom-right entries imply F 1 F 0 = 0. The bottom-left entries read Right-multiplying both equations by F 0 yields which immediately implies that F † 0 F 0 = 0 and, therefore, F 0 = 0. Similarly, by looking at the top-right entry we deduce that F 1 = 0. Therefore, B 0 respects the block structure of T . Since the same argument applies to B 1 , when solving the equation T = B † 0 B † 1 B 0 B 1 it suffices to solve the two blocks separately. Fortunately, on each block the unitaries B 0 and B 1 satisfy a commutation relation covered by Proposition B.1, so we already have the solution. In particular, if we use the canonical observables specified in Eqs. (37) and (38) the unitaries B 0 and B 1 in the block form are given by The final step is to incorporate the block structure into the tensor product according to the equivalence which gives rise to the projectors Q 1 and Q 2 .
This proposition allows us to prove the results stated in the main text. The commutation relation B † 2 = −ω{B 0 , B 1 } implies that the anticommutator {B 0 , B 1 } is unitary, which allows us to determine the exact form of B 0 and B 1 . Finally, the observable B 2 can be computed from the same relation.

C Quadratic Gauss sums
In this appendix we compute certain quadratic Gauss sums which we use in our considerations in Appendix D.
Observation C.1. Let a and b be two integers and let ω = exp(2πi/d) with d being a prime number. Then, Proof. Assuming first b to be even, we have the following chain of equalities where to get the third expression we shifted the summation range by an integer b/2, while the third equality is a result of the fact that for prime d this shifting does not change the value of the Gauss sum. Let us then consider the case of odd b. We notice that although b/2 is not an integer, (d − b)/2 is due to the fact that d is odd and a difference of two odd numbers is an even number. Moreover, ω −ndi = 1, and therefore we can follow the same reasoning as above, which gives Observation C.2. Let a be an even integer and b = c/2 for some odd integer c and let ω = exp(2πi/d) with d being a prime number. Then, the following identities hold true Proof. We could follow the above reasoning, however, b is not an integer. To overcome this difficulty, we exploit the fact that d is odd and therefore b ≡ b + d/2 is an integer. Moreover, due to the fact that a is even ω aid/2 = 1 for any i, and consequently, We then obtain (45) by applying Eq. (42) to the last term in the above expression, which completes the proof.

D Determining the phases λ n
Here we will show how the phases λ n appearing in the Bell operator (12) can be fixed so that the maximal quantum violation of the corresponding Bell inequality is achieved by the maximally entangled state (21); in other words, we will justify the choice of phases defined in Eqs. (18) and (20). We will also justify the choice of Alice's observables made in the main text.
To make this section self-contained let us recall the definition of the Bell operator stated already in Eq. (12): where We begin by deriving the optimal observables of Alice. For this purpose, let us first show that for a suitable choice of λ 1 , the operators C (1) j ≡ C j , defined as are proper observables in our scenario, that is, they are unitary and have eigenvalues ω i with i = 0, . . . , d − 1. In fact, it is not difficult to see, with the aid of formula (42), that for any choice of the phase λ 1 , the operators C j are indeed unitary. Let us then determine the value of λ 1 for which the second condition is satisfied too. To this aim, we demand that C d j = 1 for any j, which is equivalent to say that C j have the required spectrum.
Before exploiting the above condition, let us first obtain a simpler matrix form of C j . From (48) and the fact that B k = ω k(k+1) XZ k we have where to obtain second equality we have used the explicit matrix form of the Z operator and we have denoted The last sum has already been computed in Appendix C and its closed formula is given in Eq. (42). Now, taking the dth power of C j we obtain After quite tedious algebra one finds, by virtue of Eq. (42), that the above product of Gauss sums amounts to G(i, j, d) · . . . · G(i + d − 1, j, d) = ε d d d d/2 ω −d(d 2 −1)/12 and thus C d j = 1 if λ 1 = ω (d 2 −1)/12 /ε d which agrees with Eqs.
Having established that C j are proper observables in Bell scenario, we define Alice's observables as A j = C * j , with the main reason being the fact that in such a case A j ⊗ C j is a stabilizing operator of |Φ AB for any j, that is, Let us now determine the phases λ n for n > 1. To this aim we impose the following condition for any j and n, which we will use to determine the explicit values of λ n . Owing to the well-known property of the maximally entangled state that X ⊗ Y |Φ AB = 1 ⊗ Y X T |ψ AB for any pair of matrices X, Y , the condition (54) can be stated equivalently as C In order to exploit this condition, we need to find the matrix form of each of its sides. We begin with C we can write C for even n.
Even n. Assume first that j is odd and n mod 4 ≡ 0, meaning that n = 4m with m ∈ N. Let us also assume that d = 4p + 1 with p ∈ N. Then, comparison of Eq. (65) with the first formula in Eq. (59) for l = 2k as well as Eq. (66) with the second formula in Eq. (59) for l = 2k + 1, gives If we then assume that d = 4p + 3 with p ∈ N and compare Eq. (65) with the second formula in (59) with l = 2k, we Comparison of Eq. (66) with the first formula in Eq. (59) with l = 2k + 1, leads to the same formula.
Let us finally consider the case of n = 4m + 2 for any m ∈ N. Then, as before we consider two cases d = 4p + 1 and d = 4p + 3 with p ∈ N. In the first case, we use Eq. (65) and the second formula in Eq. (59) to get (72). As the same time, the same formula for λ n is obtained from Eq. (66) and the first formula in Eq. (59) with l = 2k.
Then, in the second case, i.e., d = 4p + 3, we exploit Eq. (65) with the first formula in Eq. (59), which leads us to λ n given in Eq. (71). At the same time, comparison of Eq. (66) with the second formula in Eq. (59) with l = 2k + 1 gives exactly the same formula.
One then checks that the same phases are obtained under the assumption that j is even.