Equivalence between contextuality and negativity of the Wigner function for qudits

Contextuality and negativity of the Wigner function are two notions of non-classicality for quantum systems. Howard, Wallman, Veitch and Emerson proved recently that these two notions coincide for qudits in odd prime dimension. This equivalence is particularly important since it promotes contextuality as a ressource that magic states must possess in order to allow for a quantum speed-up. We propose a simple proof of the equivalence between contextuality and negativity of the Wigner function based on character theory. This simplified approach allows us to generalize this equivalence to multiple qudits and to any qudit system of odd local dimension.

The ressemblance between contextuality and negativity was first noticed by Spekkens who generalized these two notions in order to prove that they coincide [26]. However, this result remains difficult to apply, since a large number of Wigner functions must be probed to identify contextuality. Howard et al. [17] showed that, if one restricts to a particular class of measurements, namely Pauli measurements, one can select a particular Wigner function which allows by itself to characterize contextuality. They proved that contextuality for stabilizer measurements and negativity of Gross' Wigner function [25] are equivalent for a single qudit of odd prime dimension. In the present work, we extends this result to multiple qudits and to any odd local dimension. We prove that, for quantum systems of odd local dimension, these two notions are equivalent. Such a neat equivalence between these features introduced in different fields is quite unexpected. Indeed, while contextuality is a concept from the fondation of quantum physics, Wigner functions originate from quantum optics. In addition, our proof of this equivalence is much more straightforward. Indeed, we directly compute the value of the Wigner function in terms of the hidden variable model and we observe that if the hidden variable model is non-contextual then the Wigner function is non-negative.
Our proof of this equivalence relies on the choice of a simple definition of contextuality based on value assignments whereas the work of Howard et al. is based on the graphical formalism of Cabello et al. [27]. The relations between these different notions of non-classicality are depicted in Fig. 1. In this work, we consider only contextuality of stabilizer measurements and hidden variable models are assumed to be deterministic. This article is organized as follows. The necessary stabilizer formalism is recalled in Section 2. Section 3 introduces a notion contextuality based on value assignment and prove the equivalence between this notion and the negativity of Gross' discrete Wigner function, i.e. (ii) ⇔ (iv). The purpose of Section 4 is to prove the equivalence between the 2 notions of contextuality (i) and (ii), completing the square in Fig. 1.

Background on the stabilizer formalism
In what follows, we consider the Hilbert space H = (C d ) ⊗n , where d is an odd integer and n is a non-negative integer. We consider an orthonormal basis (|a ) a∈Z d of C d . The n-fold tensor products of these vectors provide an orthonormal basis (|a ) a∈Z n d of the Hilbert space H indexed by Z n d . The space V = Z n d × Z n d that is called the phase space and will be used to index Pauli operators acting on H. Vectors in V are denoted (u Z , u X ), where both u Z and u X live in Z n d . The space Z n d is equipped with the standard inner product (a|b) = n i=1 a i b i for all a, b ∈ Z n d , whereas the phase space V is equipped with the symplectic inner product defined by Pauli matrices can be generalized to obtain matrices acting on C d as follows. Let ω be the d-th root of unity, ω = e 2iπ/d . The Pauli matrices X and Z are defined by for all a ∈ Z d . Tensor products of these matrices are denoted Z a = Z a 1 ⊗ . . . Z an and X a = X a 1 ⊗ . . . X an where a = (a 1 , . . . , a n ) ∈ Z n d . They satisfy Z a X b = ω (a|b) X b Z a . Generalized Pauli operators acting on this Hilbert space H are of the form ω a Z u Z X u X where u = (u Z , u X ) ∈ V , and a ∈ Z d . Just as qubits Pauli operators, they form a group. We fix the phase of Z u Z X u X to be ω −(u Z |u X )/2 . This defines Heisenberg-Weyl operators for all u ∈ V . Recall that, since d is an odd integer, the term (u Z |u X )/2 in Eq.(1) is a well defined element of Z d . This choice is well suited to describe measurement outcomes since Measuring a family of m mutually commuting operators C = {T a 1 , . . . , T am } returns the outcome s = (s 1 , . . . , s m ) ∈ Z m d with probability Tr(Π s u ), where Π s u is the projector onto the common eigenspace of the operators T a i with respective eigenvalue ω s i . When no confusion is possible, this projector is simply denoted Π s C . For a single operator T u , we have T u = s∈Z d ω s Π s u , by definition of these projectors. Moreover, Π s u can be obtained from the operator T u as In order to generalize Eq.(2) to a family C = {T a 1 , . . . , T am } of operators, introduce the Z d -linear subspace M a = a 1 , . . . , a m of V generated by the vectors a i . Any measurement outcome s ∈ Z m d induces a Z d -linear form ℓ s : . . , m. This map ℓ s parametrizes the group generated by the operators ω s i T a i as follows ω s i T a i = {ω ℓs(u) T u | u ∈ M a }. The projector Π s a can be written

Contextuality of value assignments and negativity
In this section, we prove that the notion of non-contextuality based on the existence of coherent value assignments is equivalent to the non-negativity of the discrete Wigner function. This equivalence was proven by Howard et al. [17] in the case of a single qudit in odd prime dimension. We propose a simple proof of this result which allows us to generalize this equivalence to multiple qudits and to any odd local dimension.
Recall that contextuality refers to the fact that measurement outcomes cannot be described in a deterministic way. One cannot associate a fixed outcome λ(A) with each observable A in such a way that this value is simply revealed after measurement. The algebraic relations between compatible observables must be satisfied by outcomes as well, making the existence of such pre-existing outcomes impossible. For instance, given two commuting operators A and B, the three observables A, B and C = AB can be measured simultaneously and the values λ(A), λ(B) and λ(C) associated with these operators must satisfy λ(C) = λ(A)λ(B). No value assignment satisfying all these algebraic constraints exists in general.
The Wigner functions of a state is a description of this state that was introduced in quantum optics in order to identify states with a classical behavior. Quantum states with a non-negative Wigner function are considered as quasi-classical states. The non-negativity of the Wigner function allows to describe the statistics of the outcomes of a large class of measurements in a classical way. The success of this representation motivated their generalization to finite dimensional Hilbert spaces, called discrete Wigner function. Different generalizations have been considered and finding a finite-dimensional Wigner representation that behaves as nicely as its original infinite-dimensional version [23] of use in quantum optics is a non-trivial question. The qubit case illustrates the difficulty of this task [28,29]. In this work, we restrict ourselve to system of qudits with odd local dimension and we consider Gross' discrete Wigner function which encloses most of the features of its quantum optics counterpart [25].

Value assignments are characters in odd local dimension
In this definition, the HVM associates a deterministic eigenvalue λ ν (a) ∈ U d with each operator T a . Measurements only reveal this pre-existing values that are independent on other compatible measurements being performed. Formally, non-contextual value assignments are defined as follows.
Definition 1. Let ρ be a density matrix over H. A set of NC value assignments for the state ρ is a triple (S, q ρ , λ) where S is a finite set, q ρ is a probability distribution over S and λ is a collection of maps λ ν : V → U d , for each ν ∈ S, such that Without loss of generality, one can assume that the value assignment associated with distinct states ν ∈ S are distincts. Then, S is necessarily a finite set since there is only a finite number of distinct maps λ ν from V to U p . A map λ ν which satisfies λ ν (u + v) = λ ν (u)λ ν (v) for all u, v such that [u, v] = 0, is called a value assignment. Recall that the value λ ν (u) is associated with the operator T u defined in Eq. (1). With this phase convention, a value assignment is defined in such a way that the value of the product T u+v = T u T v of two compatible operators is the products of their values. As we will see later, multiplicativity of λ ν whenever [u, v] = 0 is the non-contextuality assumption whereas the condition Tr(T u ρ) = ν∈S λ ν (u)q ρ (ν) ensures that this triple is sufficient to recover the prediction of quantum mechanics.
A value assignment is a map λ ν that satisfies the constraint λ ν (u + v) = λ ν (u)λ ν (v), for all pairs of vectors such that [u, v] = 0. For instance, the |V | = d 2n characters of V , which satisfy this constraint for all pairs u, v, provide d 2n value assignments λ ν . However, if value assignments λ ν : V → C * coicinde with a character of V over any isotropic subspace, nothing in Def.1 guarantees that these assignments are actually characters of V . The next lemma proves this property, i.e. the only consistent value assignments of the HVM are given by the d 2n characters of V . Lemma 1. For any odd integer d > 1 and for any integer n ≥ 2, value assignments λ ν are characters of V .
Proof. To make the proof easier to follow, we regard λ as a map from V to Z d (through the group isomorphism between U d and Z d ) and we use the additive notation λ(u) In particular for all u ∈ V and for all k ∈ Z d we have λ(ku) = kλ(u).
Consider the canonical basis of Z n d × Z n d that we denote (e 1 , . . . , e n , f 1 , . . . f n ). Clearly, [e i , f i ] = 1 and the planes P i = e i , f i are pairwise orthogonal for all i = 1, . . . , n. The orthogonality between these planes allows us to write It remains to prove that the restriction of λ to any plane P i is additive.
We will use a second plane P j = e j , f j with j = i (which exists only when n ≥ 2). Denote This decomposition is chosen in such a way that (u We will also use the orthogonality relations [u ± v ′ , v ± u ′ ] = 0 and between the planes P i and P j . We obtain This proves that λ is a character.

Discrete Wigner functions
The purpose of this section is to recall that a set of NC value assignments can be derived from a discrete Wigner function of a state whenever this function is non-negative.
Quantum states are generally represented by their density matrix ρ. The Wigner function W ρ of a state ρ is an alternative description of the state ρ. This representation is sometimes more convenient than the density matrix. Wigner functions have been introduced in quantum optics [23] and the negativity of the Wigner function of a state is regarded as an indicator of non-classicality of this quantum state. In the present work, we consider their finite dimensional generalization which is called discrete Wigner function [7,24].
We focus on Gross' discrete Wigner function [25] The family (A u ) u∈V is an orthonormal basis of the space of (d n × d n )-matrices equipped with the inner product (A|B) = d −n Tr (A  † B). The values W ρ (u) for u ∈ V are simply the coefficients of the decomposition of the matrix ρ in this basis: This proves that the Wigner function W ρ fully describes the state ρ.
In order to describe measurement outcomes, the Wigner representation can be extended to POVM elements (E s ) s . The Wigner function of a POVM element E s is defined to be W Es (u) = Tr(E s A u ). This definition is chosen in such a way that the probability Tr(E s ρ) of the outcome s is given in terms of the Wigner functions W ρ and W Es by This expression is obtained by replacing ρ by its decomposition (4).
Consider for instance the measurement of an operator T a . It corresponds to the POVM elements (Π s a ) s∈Z d . Calculating the value of the Wigner function of the POVM element Π s a , we find W Π s a (u) = δ [a,u],s , and injecting this in Eq.(5) yields Tr(Π s a ρ) = u∈V δ [a,u],s . Using the decomposition of T a as a sum of projectors, this provides the expectation of T a .

Lemma 2. For all Heisenberg-Weyl operators T a given in Eq.(1), it holds that
Comparing Lemma 2 with Def. 1, we see that the triple (V, W ρ , (λ u ) u∈V ) is a set of NC value assignments for λ u (a) = ω [a,u] whenever the Wigner function of the state ρ is nonnegative. Note that all characters of V can be written as ω [ * ,u] for some u ∈ V .

Equivalence between NC value assignments and non-negativity
The previous section shows that non-negativity of W ρ implies the existence of a set of NC value assignments for the state ρ. We now prove the converse statement. Proposition 1. Let n ≥ 2 and let ρ be a n-qudits state of odd local dimension d > 1. If ρ admits a set of NC value assignments then W ρ ≥ 0.
Proof. Given a set of NC value assignments, let us compute the value of the Wigner function of ρ to prove that it is non-negative. We have The fact that such a sum is positive or even real is not clear. However, Lemma 1 shows that ω [u,·] λ ν (·) is also a character. Hence, any sum v∈V ω [u,v] λ ν (v) is either 0 or d 2n [30]. Since q ρ (ν) ≥ 0, this proves that W ρ (u) ≥ 0.
Actually the HVM derived from the discrete Wigner function is essentially unique. The following corollary shows that the distribution q ρ of any set of NC value assignments can be identified with the Wigner function distribution W ρ over V . Corollary 1. Let n ≥ 2 and let ρ be a n-qudits state of odd local dimension d > 1. If (S, q ρ , λ) is a NC set of value assignments for ρ then there exists an bijective map σ : S → V such that Proof. Let us refine the argument of the proof of Proposition 1. By Lemma 1 and since value assignments corresponding to distinct states of S are assumed to be different, there exists an injective map φ : S → V such that λ ν = ω [φ(ν),·] . Without loss of generality, we can assume that φ is sujective by adding extra elements to S corresponding to the missing characters of V . For these new elements ν ∈ S, we simply set q ρ (ν) = 0 to preserve the prediction of this triple. With this notation, the expression of W ρ (u) obtained in the previous proof becomes For all vectors u, there exists a unique state ν ∈ S such that u + φ(ν) = 0. Denote by ν u φ ′ (u) this state. Then, Eq.(6) becomes W ρ (u) = q ρ (ν u ). To conclude the proof, note that the map u → ν u is invertible, by bijectivity of φ. Its inverse is the map σ of the corollary.

Deterministic hidden variable model
The role of a hidden variable model (HVM) is to describe the outcome distribution of Pauli measurements for a state ρ. In what follows, an ordered family of commuting operators C = {T a 1 , . . . , T am } is called a context. This guarantees that they can be measured simultaneously. We denote by C the set of all the contexts, that is of all ordered tuples of commuting Heisenberg-Weyl operators T u .
The HVM considered in Def. 1 is designed to predict the expectation of single Pauli operators. We now consider a framework which is a priori more general. The HVM is required to predict the outcome distribution of the measurement of any Pauli context C ∈ C.

Definition 2.
A HVM for a state ρ is defined to be a triple (S, q ρ , p) such that S is a set, q ρ is a distribution over S and p = (p C ) C∈C is a family of conditional probability distributions p C (s|ν) over the possible outcome s for any context C ∈ C and for any state ν ∈ S. We require that the prediction of the HVM matches the quantum mechanical value, i.e.
for all context C ∈ C and for all outcome s ∈ Z m d .
The set S is the set of states of the HVM. Note that this set is not a priori the same as the set used in Def. 1. We understand the probability q ρ (ν) as the probability that the system is in the state ν ∈ S. As suggested by the notation, the probability p C (s|ν) can be interpreted as the probability of an outcome s when measuring the operators of the context C and when the system is in the state ν of the HVM. It is then natural to define the prediction of the HVM as in Eq.(7).
In the present work, we consider HVM that are deterministic in the following sense. We can associate a fixed measurement outcome s with each state ν of the model. In other words, conditional probabilities p C (s|ν) are delta functions. Definition 3. A HVM (S, q ρ , p) is said to be deterministic if conditional distributions p C are all delta functions, i.e. for all C ∈ C and for all outcome s, we have p C (s|ν) = δ αν (C),s for some map α ν that associates a value α ν (C) ∈ Z |C| d with each context.
We often denote such a HVM by the triple (S, q, α). When C contains m operators, both α ν (C) and s are m-tuples. If α ν (C) = (x 1 , . . . , x m ), then δ αν (C),s is the product of the delta functions δ x i ,s i .

Operational definition of non-contextuality
Within our formalism restricted to measurement of Pauli operators T a , there exists different ways to realize a measurement. The operational notion of contextuality refers to the fact that the conditional distribution of outcomes in the HVM may depend on the way the measurement is implemented. This section presents a formal definition of this notion.
To illustrate what should be the right definition of an implementation, we start with some examples. We can measure the operators of a context C = {T a 1 , . . . , T a ℓ } ∈ C and return the corresponding outcome s = (s 1 , . . . , s ℓ ). This realizes the measurement defined by the family of orthogonal projectors (Π s a ) s for s ∈ Z m d . Different contexts C may produce the same family of projectors, that is the same measurement. For instance, the 2-qudit measurement defined by the projectors P x 1 ,x 2 = |x 1 x 1 | ⊗ |x 2 x 2 |, indexed by (x 1 , x 2 ) ∈ Z 2 d , can be implemented via the contexts C = {X ⊗ I, I ⊗ X} or alternatively via C ′ = {X ⊗ I, X ⊗ X}.
We can also measure of a family of operators but read only a subset of the outcomes or even of function of the outcomes. Such a classical postprocessing extends the set of projectors that can be reached. For instance, for u ∈ V consider a pair of projectors {Π 0 = Π 0 u , Π 1 = I −Π 0 u }. This measurement is realized by measuring T u and returning 0 if the outcome is 0 and returning 1 for all other outcome s ∈ Z d \{0}. To provide an example with a less trivial postprocessing consider the measurement (Π t u+v ) with outcome t ∈ Z d , for u, v ∈ V such that [u, v] = 0. We can realize this measurement by measuring the pair C = {T u , T v } and by returning only the sum t = s u + s v ∈ Z d of the two outcomes.
These examples motivate our definition of an implementation of a measurement. Consider a measurement defined by a family of stabilizer projectors (Π s ) s∈O , that sum up to identity, indexed by the elements of a finite set O.
Neither the choice of the context C nor the corresponding map σ C is unique. The postprocessing map is assumed to be surjective only to ensure that all the projectors of the family (Π s ) s∈O are reached.
Let (S, q ρ , ν) be a HVM describing measurement outcomes for a state ρ. Consider an implementation (C, σ C ) of a measurement (Π s ) s∈O . By definition of the projectors Π s , the HVM predicts that the outcome s occurs with probability when the system is in position ν. Quantum mechanics predicts that the distribution of the outcome of a measurement only depends on the projectors Π s and not on the implementation. That means that for any two implementations (C, σ C ) and (C ′ , σ C ′ ) of a measurement Π s , we have However, nothing in Def. 2 requires that the probabilities p C (σ −1 C (s)|ν) and p C ′ (σ −1 C ′ (s)|ν) coincide for all ν ∈ S. This assumption is a notion of non-contextuality.

Definition 5.
A HVM (S, q ρ , p) is said to be non-contextual if for all implementation (C, σ C ) of a measurement (Π s ) s∈O , for all ν ∈ S, the conditional probability p C (σ −1 C (s)|ν) depends only on the projector Π s and not on the implementation (C, σ C ).
For instance, we saw that the measurement (Π s u+v ) s∈Z d can be implemented by C = {T u+v } with a trivial map σ C but also using C ′ = {T u , T v } with the postprocessing map σ C ′ (s u , s v ) = s u +s v . For a non-contextual model, the corresponding conditional probabilities p C (s|ν) and p C ′ (σ −1 C ′ (s)|ν) coincide for all states ν of the HVM. In this example, we have

Equivalence of the two definitions of non-contextuality
In this section we prove that the existence of a NCHMV as given in Def. 5 and the existence of a set of NC value assignments as in Def. 1 are two equivalent notions of non-contextuality. This is the equivalence (i) ⇔ (ii) in Fig. 1.
The following proposition shows that the implication (ii) ⇒ (i) holds.
Proposition 2. Let (S, q ρ , λ) be a set of NC value assignments. Then (S, q ρ , p) defines a deterministic NCHVM where p is defined by The notations M a and ℓ s used in Eq.(8) were introduced in Eq. (3). Recall that, by deterministic, we mean p C (s|ν) ∈ {0, 1}.
Proof. First, let us prove that the HVM (S, q ρ , p) defined in this proposition produces the same prediction as quantum mechanics. By Eq. Replacing Tr(T u ρ) by its value in terms of the value assignments, we obtain This proves that the HVM (S, q ρ , p) defined by Eq.(8) reproduces the quantum mechanical predictions.
It is deterministic since the sum u∈Ma ω ℓs(u) · λ ν (u), which is the sum of the values of a character, is either 0 or |M a |, implying that p C (s|ν) ∈ {0, 1}. This HVM is also noncontextual. Indeed, conditional probabilities are defined in such a way that they do not depend on the particular choice of generators a i for the subspace M a , that is they do not depend on the context. We now prove the converse statement. Together with the non-contextuality assumption, determinism of the HVM yields extra compatibility contraints on the functions α ν . The following proposition proves that α ν is completely determined by its value α ν ({T u }) over single operator contexts {T u }. We shorten the notation α ν ({T u }) by α ν (u). Moreover, we show that α ν is additive when [u, v] = 0. Then, we will prove that we can construct a set of NC value assignments from the maps α ν . Proposition 3. If (S, p, α) is a deterministic NCHVM then, • for all context C = {T a 1 , . . . , T am } ∈ C, we have α ν ({T a 1 , . . . , T am }) = (α ν (a 1 ), . . . , α ν (a m )), To prove the first item, we consider two implementations of the measurement (Π s a i ) s∈Z d for some a i ∈ V . First, one can simply measure {T a i } and reveal the outcome s i . A second implementation is obtained via the context C = {T a 1 , . . . , T am } ∈ C and the map σ C that sends a measurement outcome t = (t 1 , . . . , t m ) onto its i-th component t i . In other words, we measure these m operators but we only keep the outcome of T a i . By non-contextuality, these two procedures yield the same conditional probabilities at the level of the HVM, that is p C (σ −1 C (s)|ν) = p Ta i (s|ν) for all ν ∈ S, for all s ∈ Z d . Replacing the first term by its definition, we obtain Fix ν ∈ S and denote α ν (C) = (x 1 , . . . , x m ). Sharpness of the measurements implies that p C (t|ν) = m j=1 δ x j ,t j and p Ta i (s|ν) = δ αν (a i ),s . Injecting these expressions in Eq.(9) produces the equality (t 1 ,...,tm)∈Z m d t i =s m j=1 δ x j ,t j = δ αν (a i ),s .
that is satisfied for all s ∈ Z d . The only possibility to have a non-trivial product at the left-hand side is to pick t j = x j for all j = i, leading to This equality is satisfied for all s ∈ Z d , proving that α ν (a i ) = x i . This concludes the proof of the first property.
The second item is proven using two implementations of the measurement of (Π s u+v ) s∈Z d . First, we consider the direct implementation by measuring T u+v . Then, we use the context C = {T u , T v } with the postprocessing map σ C (s u , s v ) = s u + s v . Non-contextuality leads to k∈Z d p C ((k, s − k)|ν) = p T u+v (s|ν).
As a corollary, we prove that the maps u → α ν (u) define a family of NC value assignments. This complete the proof of the equivalence between (ii) and (iii).
Corollary 2. If (S, q ρ , α) is a deterministic NCHVM then the triple (S, q ρ , λ) where the map λ ν : V → U d is defined by λ ν (u) = ω αν (u) for all ν, is a set of NC value assignments.
Proof. Additivity of the maps λ ν was proven in Proposition 3. It remains to prove that this value assignment provides a good prediction for the expectation of operators T u . Writing this operator as a linear combination of projectors T u = s∈Z d ω s Π s u , we find Tr(T u ρ) = s∈Z d ω s Tr(Π s u ρ).
Using the prediction of the HVM and sharpness of the measurements, we obtain proving the Corollary.