Spekkens' toy model in all dimensions and its relationship with stabilizer quantum mechanics

Spekkens' toy model is a non-contextual hidden variable model with an epistemic restriction, a constraint on what an observer can know about reality. The aim of the model, developed for continuous and discrete prime degrees of freedom, is to advocate the epistemic view of quantum theory, where quantum states are states of incomplete knowledge about a deeper underlying reality. Many aspects of quantum mechanics and protocols from quantum information can be reproduced in the model. In spite of its significance, a number of aspects of Spekkens' model remained incomplete. Formal rules for the update of states after measurement had not been written down, and the theory had only been constructed for prime-dimensional, and infinite dimensional systems. In this work, we remedy this, by deriving measurement update rules, and extending the framework to derive models in all dimensions, both prime and non-prime. Stabilizer quantum mechanics is a sub-theory of quantum mechanics with restricted states, transformations and measurements. First derived for the purpose of constructing error correcting codes, it now plays a role in many areas of quantum information theory. Previously, it had been shown that Spekkens' model was operationally equivalent in the case of infinite and odd prime dimensions. Here, exploiting known results on Wigner functions, we extend this to show that Spekkens' model is equivalent to stabilizer quantum mechanics in all odd dimensions, prime and non-prime. This equivalence provides new technical tools for the study of technically difficult compound-dimensional stabilizer quantum mechanics.


Introduction
A long tradition of research, starting from the famous "EPR paper" [1], has consisted of analysing quantum theory in terms of hidden variable models, with the aim of obtaining a more intuitive understanding of it. This has led to some crucial results in foundation of quantum mechanics, namely Bell's and Kochen-Specker's no-go theorems [2] [3]. Nowadays a big question is whether to interpret the quantum state according to the ontic view, i.e. where it completely describes reality, or to the epistemic view, where it is a state of incomplete knowledge of a deeper underlying reality which can be described by the hidden variables. In 2005, Robert Spekkens [4] constructed a non-contextual hidden variable model to support the epistemic view of quantum mechanics. The aim of the model was to replace quantum mechanics by a hidden variable theory with the addition of an epistemic restriction (i.e. a restriction on what an observer can know about reality). The first version of the model [4] was developed in analogy with quantum bits (qubits), with 2-outcome observables. Despite the simplicity of the model, it was able to support many phenomena and protocols that were believed to be intrinsically quantum mechanical (such as dense coding and teleportation). Spekkens' toy model has influenced much research over the years: e.g. people provided a new notation for it [19], studied it from the categorical point of view [20], used it for quantum protocols [21], exploited similar ideas to find a classical model of one qubit [22], and tried to extend it in a contextual framework [23]. Also Spekkens' toy model addresses many key issues in quantum foundations: whether the quantum state describes reality or not, finding a derivation of quantum theory from intuitive physical principles and classifying the inherent nonclassical features.
A later version of the model [5], which we will call Spekkens' Theory (ST), introduced a more general and mathematically rigorous formulation, extending the theory to systems of discrete prime dimension, where dimension refers to the maximum number of distinguishable measurement outcomes of observables in the theory, and continuous variable systems. Spekkens called these classical statistical theories with epistemic restrictions as epistricted statistical theories. By considering a particular epistemic restriction that refers to the symplectic structure of the underlying classical theory, the classical complementarity principle, theories with a rich structure can be derived. Many features of quantum mechanics are reproduced there, such as Heisenberg uncertainty principle, and many protocols introduced in the context of quantum information, such as teleportation. However, as an intrinsically non-contextual theory, it cannot reproduce quantum contextuality (and the related Bell non-locality), which, therefore arises as the signature of quantumness. Indeed, for odd prime dimensions and for continuous variables, ST was shown to be operationally equivalent to sub-theories of quantum mechanics, which Spekkens called quadrature quantum mechanics.
In the finite dimensional case quadrature quantum mechanics is better known as stabilizer quantum mechanics (SQM). The latter is a sub-theory of quantum mechanics developed for the description and study of quantum error correcting codes [6] but subsequently playing a prominent role in many important quantum protocols. In particular, many studies of quantum contextuality can be expressed in the framework of SQM, including the GHZ paradox [8] and the Peres-Mermin square [9] [10]. This exposes a striking difference between odd and even dimensional SQM. Even-dimensional SQM contains classical examples of quantum contextuality while odd-dimensional SQM exhibits no contextuality at all, necessary for its equivalence with Spekkens' Theory. While developed for qubits, SQM was rapidly generalised to systems of arbitrary dimension, [6]. However, for non-prime dimensions SQM remains poorly characterised and little studied (recent progress in this was recently reported in [13]).
In spite of its importance, there remain some important aspects of Spekkens' Theory which have not yet been characterised and studied. First of all, all prior work on ST have only considered systems where the dimension is prime. Furthermore, while Spekkens' recent work strengthens the mathematical foundations of the model [5], one key part of the theory has not yet been described in a general and rigorous way. These are the measurement update rules, the rules which tell us how to update a state after a measurement has been made. In prior work, these rules, and the principles behind them have been described but not formalised.
In this paper, we complete this step, deriving a formal description of the measurement rules for prime-dimensional ST. Having done so, we now have a fully formal description of the model, which can be used as a basis to generalise it. We do so, generalising the framework from prime-dimensions to arbitrary dimensions and finding that it is the measurement update rule, where the richer properties of the non-prime dimension can be seen, which provides the key to this generalisation.
Having developed ST for all finite dimensions, we then focus on the general odd-dimensional case, and prove that in all odd-dimensional cases Spekken's Theory is equivalent to Stabilizer Quantum Mechanics. The bridge between SQM and ST is given by Gross' theory (GT) of discrete Wigner function [15]. Unlike most other studies, Gross' treatment considered both prime and non-prime cases in its original formulation.
To summarise the contributions of this paper, we provide a compete formulation of ST in all discrete dimensions, even and odd, endowed with the updating rules for sharp measurements both for prime and non-prime dimensional systems. We extend the equivalence between ST and SQM via Gross' Wigner functions to all odd dimensions, and find the measurement updating rules also for the Wigner functions. The above equivalence allows us to shed light onto a complete characterisation of SQM in non-prime dimensions. Finally the incredibly elegant analogy between the three theories in odd dimensions: ST, SQM and GT, is depicted in terms of their updating rules.
The remainder of the paper is structured as follows. In section 1 we precisely and concisely describe the original framework of Spekkens' theory, in particular we define ontic and epistemic states, observables and the rule to obtain the outcome of the measurement of an observable given a state. In section 2 and 3 we state and prove the updating rules in Spekkens' theory respectively for prime and non-prime dimensional systems. We prove these in two steps: first considering the case in which the state and measurement commute, and then the more general (non-commuting) case. The mathematical difference between the set of integers modulo d, for d prime and non-prime, results in having two levels of observables: the fundamental ones -the fine graining observables -and the ones that encode some degeneracy -the coarse-graining observables. The latter are problematic and are only present in the non-prime case. This is the reason why we need a different formulation in the two cases. The updating rules for the coarse graining observables will need a step in which the coarse-graining observables are written in terms of fine graining ones. In section 4 we state the equivalence of ST and SQM via Gross' Wigner functions in all odd dimensions. We also express the already found updating rules in terms of Wigner functions and we use them to depict the elegant analogies between these three theories. The paper ends with a discussion of the possible applications of our achievements and with a summary of the main results.

Spekkens' theory
We start by reviewing and introducing Spekkens' theory for prime-dimensional systems. We take a slightly different approach to [4] and [5]. ST is a hidden variable theory, where the hidden variables are points in a phase space. The state of the hidden variables is called the ontic state. In Spekkens' model the ontic state is hidden and can never be known by an experimenter. The experimenter's best description of the system is the epistemic state, representing a probability distribution over the points in phase space.
For a single d-dimensional system, a phase space can be defined via the values of two conjugate fiducial variables, which we label X and P , in analogy to position and momentum. X and P can each take any value between 0 and d − 1, and a single ontic state of the system is specified by a pair (x, p), where x is the value of X and p is the value of P . This phase space is equivalent to the space Z 2 d . In figure 1 three examples of epistemic states of one trit (d = 3) are depicted, where X and P are represented by the rows and columns in the phase space Z 3 .
A collection of n systems is described by n pairs of independent conjugate variables X j and P j , with j ∈ 0, . . . , n − 1 a label indexing the systems. The phase space, denoted by Ω, is simply the cartesian product of single system phases spaces and thus Ω ≡ (Z d ) 2n . ‡ The ontic state of the n-party system represents a set of values for each fiducial observables X j and P j . In other words, an ontic state is denoted by a point in the phase space λ ∈ Ω. We call X j and P j observables because they correspond to measurable quantities, and assume that these observables are sufficient to uniquely define the ontic state. We can refer to Ω as a vector space where the ontic states are vectors (bold characters) whose components (small letters) are the values of the fiducial variables: Not only are the fiducial variables important for defining the state space, they also generate the set of all general observables in the theory. A generic observable, denoted by Σ, is defined by any linear combination of fiducial variables:  In the figures above we consider the case of one trit and we find the isotropic subspaces V and V ⊥ and the corresponding Spekkens epistemic state. In these cases the observables(linear functionals) are always of the form aX + bP = 0, where a, b ∈ Z 3 . Moreover in the above examples we assume w = 0. In figure 1a the observer only knows X = 0 and this implies that the generator of V is Σ = (1, 0). The subspace V ⊥ can be simply calculated from V by definition. In figure 1b the observer only knows that X + P = 0 and this implies the generator of V to be Σ = (1, 1). In figure 1c nothing is known. The subspace V is generated by Σ = (0, 0) only. Here V ⊥ coincides with the whole phase space Ω. Note that it is not possible to have V ⊥ = (0, 0), because this would correspond to have the knowledge of the ontic state.
where a m , b m ∈ Z d and m ∈ 0, . . . , n − 1. The observables inhabit the dual space Ω * , which is isomorphic to Ω itself. Therefore we can define them as vectors, in analogy with ontic states, The formalism provides a simple way of evaluating the outcome σ of any observable measurement Σ given the ontic state λ, i.e. by computing their inner product: where all the arithmetic is over Z d . Spekkens' theory gains its special properties, and in particular, its close analogy with stabilizer quantum mechanics via the imposition of an epistemic restriction, a restriction on what an observer can know about the ontic state of a system. The observer's best description is called the epistemic state, which is represented by a probability distribution p(λ) over Ω (figure 1).
The epistemic restriction of ST is called classical complementarity principle and it states that two observables can be simultaneously measured only when their Poisson bracket is zero. This is motivated by Stabilizer Quantum Mechanics, since it captures the condition for two observables in SQM to commute. We shall adopt the quantum terminology here, and say that if the Poisson bracket between two observables is zero they commute. This can be simply recast in terms of the symplectic inner product: where J = n j=1 0 1 −1 0 j is the symplectic matrix. Note that each observable Σ j partitions Ω into d subsets, each of the form (span{Σ j }) ⊥ + w, where w is any ontic state such that Σ j T · w = σ j .
Let us now consider sets of variables that can be jointly known by the observer. Such variables commute, and represent a sub-space of Ω known as an isotropic subspace. We denote the subspace of the known variables as V = span{Σ 1 , . . . , Σ n } ⊆ Ω, where Σ i denotes one of the generators (commuting observables) of V .
Sets of known commuting variables are important as these define the epistemic states within the theory. In particular, we can define an epistemic state by the set of variables V that are known by the observer and also the values σ 1 , . . . , σ n that these variables take.
This means that Σ T j · w = σ j , where w ∈ V is an ontic state that evaluates the known observables. We will call w a representative ontic state for the epistemic state. More precisely we can state the following theorem. Proposition 1. The set of ontic states consistent with the epistemic state described by (V, w) is where the perpendicular complement of V is, by definition, Proof. Let us start by considering the set of ontic states λ such that Σ T j λ = 0 ∀j. By definition of perpendicular complements, the ontic states λ belong to V ⊥ . If we consider an ontic state w such that Σ T j w = σ j , then Σ T j (λ + w) = σ j . Therefore the ontic states consistent with the epistemic state associated to (V, w) are the ones of the kind λ + w, i.e. the ones belonging to V ⊥ + w.
Note that the presence of w = 0 simply implies a translation, that is why we can also call it shift vector.
By assumption the probability distribution associated to the epistemic state (V, w) is uniform (indeed we expect all possible ontic states to be equiprobable), so the probability distribution of one of the possible ontic states in the epistemic state (V, w) is where the delta is equal to one only if λ ∈ V ⊥ + w (note this means that the theory is a possibilistic theory). In figure 1 we specify the subspaces V and V ⊥ in three different examples of epistemic states of one trit. We can sum up our approach to Spekkens' model as follows: (i) Start from the intuitive (physically justified) formula (4) that relates observables Σ j , ontic states λ and outcomes σ j .
(ii) Epistemic restriction: the compatible observables are the ones whose symplectic inner product is zero.
(iii) Compute the shift vector w. This allows us to shift back the set of points λ to obtain a subspace.
(iv) The set of ontic states compatible with the epistemic state where V is the isotropic subspace spanned by the observables Σ j (the set of known variables).
We say that this approach is physically intuitive because we start with equation (4), which is physically motivated and states, observables and the corresponding outcomes are defined in terms of it. Equation (4) also allows us to see that the shift comes from the need to recover the subspace structure.
3 Updating rules -prime dimensional case The formulation of ST in [5], made for prime (and infinite) dimensional systems and described in the previous section, does not provide a full treatment of the transformative aspect of measurements, i.e. how the epistemic state has to be updated after a measurement procedure. In the following we will provide a proper formalization of it, and in the next section we will generalise the formalism to all dimensions, non-prime too. The set of integers modulo d shows different features depending on d being prime or not. In particular in the non-prime case it is not always possible to uniquely define the inverse of a number. The consequences of this will directly affect the updating rules. In particular the possible observables sometimes will not show full spectrum: some outcomes will not be possible because they would derive from arithmetics involving numbers with not well-defined inverses. This will divide the set of possible observables in two categories depending on whether they have full spectrum or not. We start from the prime case where problematic observables are not present because inverses always exist.
Like in quantum theory, duality in the description of states and measurements characterises ST. This means that we can represent the elements of a measurement Π in an epistemic-state way, (V Π , r), where we can go from one element of the measurement to the other by simply shifting the representative ontic vector r (see figure 2). In ST the measurement process corresponds to the process of learning some information (aka asking questions) about the ontic state of the system. According to the classical complementarity principle only the observables that are compatible (i.e. Poisson-commute) with the state of the system can be learned (jointly knowable). This means that the state after measurement will be given by the generators of the state before the measurement and the generators of the measurement which are compatible with it. § It is then fundamental to understand how compatible sets of ontic states (the isotropic subspaces of known variables V and their perpendicular V ⊥ ) change when independent observables are added and removed from the set of known variables V . § As an abuse of language we here talk of generators of a state meaning the orthogonal basis set that generates the subspace of known variables associated with the state.  Figure 2: Epistemic representation of a measurement. The elements of the measurement Π can be represented as epistemic states. This duality is present also in quantum theory. The elements of the measurement Π 0 , Π 1 , Π 2 can be thought as the analogue of the projectors {|0 0| , |1 1| , |2 2|}. We can always go from one element to the other by shifting the representative ontic vector. In the above case we can go, for example, from Π 0 to Π 1 by adding to r = (0, 0) the vector (1, 0), thus getting r 1 = (1, 0). The example above shows the measurement corresponding to asking the question "what is the value of the variable X?" about the ontic state of the system.

Adding and removing generators to/from V
(i) Let us start with the case of adding a generator Σ to the set of generators of V = span{Σ 1 , . . . , Σ n }. We assume that Σ is linear independent with respect to the set spanned by the Σ j . Let us see what happens to V ⊥ . The subspace V after the addition becomes By definition the direct sum of two subspaces A ⊕ B returns a subspace such that for each a ∈ A and b ∈ B, the sum a + b belongs to A ⊕ B. The direct sum of two subspaces is a subspace. We are interested in the orthogonal complement of a direct sum. It is well known that (A ⊕ B) ⊥ = A ⊥ ∩ B ⊥ . This means that by adding a generator to V, its perpendicular V ⊥ is given by Note that V ⊥ is smaller than V ⊥ .
(ii) We now analyse what happens if we remove a generator, say Σ n , from the set of generators of V. This means that now V = span{Σ 1 , . . . , Σ n−1 }. The set V ⊥ is clearly contained in V ⊥ , since any vector orthogonal to all elements of V must also be orthogonal to all elements of V . By definition, the set V ⊥ is composed by all the ontic states λ such that Σ T j λ = 0 for all j < n, but Σ T n λ = 0. This means that we need to remove the constraint Σ T n λ = 0 to enlarge V ⊥ to V ⊥ , i.e. we simply need to add the ontic states λ = cγ to V ⊥ , where c ∈ Z d = 0 and γ is a vector such that Σ T n γ = 1. Indeed this implies that Σ T n (λ + λ ) = Σ T n (λ + cγ) = 0 + c = 0. In prime dimensions γ uniquely exists and it corresponds to k −1 Σ n , where k = Σ T n Σ n . Indeed the inverse of an integer k ∈ Z d = 0 always uniquely exists if d is a prime number. The formula for V ⊥ then reads where the addition of +w n means that the whole set V ⊥ is shifted by w n , and V n = span{Σ n }. The previous trick in general works as follows. Given the ontic state λ, the observable Σ and the outcome σ associated with them, i.e. Σ T λ = σ, then it is possible to shift the value σ by a constant k such that Σ T n Σ n = k, by only adding Σ itself to the ontic state: Note that the above identity allows us to change the value of the outcome associated with an ontic state by a constant factor (that we can also choose) without affecting any commuting observable (in this case Σ).

Measurement updating rules
We now want to find the updating rules for the state (V, w) of a prime dimensional system when we perform a measurement (V Π , r) on it. We will consider V Π being spanned by the generators denoted as Σ j . The representative ontic vector associated to the measurement, r, is such that, by definition, Σ T j r = σ j , where the σ j are the outcomes associated with the measurement. The subspace of known variables V can be written in terms of the sets generated by the generators Poisson-commuting with all the Σ j , V commute , and non-commuting ones, V other . According to this definition V commute will always be a subspace. We cannot state the same for V other , since the null vector does not belong to it. For this reason we augment V other with the null vector in order to create a subspace. This implies that we can decompose V as We can also prove the following lemma. Proof. Let us initially assume the measurement to consist only of one non-commuting generator Σ , so m = 1. Let us prove the lemma by contradiction. Let u, v be two orthogonal non-zero elements of V other . Note that, by definition of a subspace, if u, v ∈ V other , also a linear combination of u, v has to belong to V other . By definition u, v do not commute with Σ . Therefore we can write where a, b = 0. In particular there will exist a constant c ∈ Z d such that a − bc = 0. This implies that Hence the linear combination (u − cv) belongs to V commute . This is a contradiction, therefore V other has dimension 1. From the same reasoning, in the case of m noncommuting generators of the measurement, the subspace V other has dimensions at maximum equal to m. Let us assume now that the dimension of V other is m − 1. This is not possible because it would mean that, for example, Σ m−1 can be written as a linear combination of Σ 0 , . . . , Σ m−2 . However this is not the case because, by definition of basis set, all the generators are linearly independent. Therefore V other has dimension m.
We will now provide the updating rules both for V and w in two steps: first considering the state and measurement to commute, and then the general (noncommuting) case. Theorem 1. Commuting case. The epistemic state (V, w) after a measurement (V Π , r) that commutes with it, i.e. their generators all Poisson commute, is described by the epistemic state (V , w ) such that where w is given by equation where Σ i are the generators of the measurement Π and γ i is such that Σ T i γ i = 1.
Proof. When the state and measurement commute we have to add the generators of the measurement to the set of generators of V, as we have seen in the previous subsection 3.1 (learning stage). Therefore the updating rule for the subspace V is (equation (8)) In terms of perpendicular subspaces this implies that Let us initially assume the measurement to consist only of one generator Σ . Let us recall that the outcome associated with Σ is σ . We assume w is not compatible with this outcome, i.e. Σ T w = σ + x, for some shift x ∈ Z d , and we want to find w such that The identity (11) we used in the previous section does the job. More precisely, where the vector γ is such that Σ T γ = 1. The above expression can be also written as The inverse of k always exists because we are in the prime dimensional case. Without referring to x we can restate the updating rule for the representative ontic vector as Note that if we consider more than one generator of the measurement, we simply have to sum over all those generators in the second term. This immediately follows from considering the whole measurement Π as a sequence of measurements given by each generator Σ i and apply every time the rule (17). We state again that the above formula always holds for prime dimensional systems. We cannot claim the same in non-prime dimensions. The correct updating rule for the subspace V ⊥ is found by combining the updating rules for V and w as in (13). This correction simply sets the subspaces to the same origin in order to correctly compute their intersection, as schematically shown in figure 4. At the end we obtain for the epistemic state We recall that the probability associated to each ontic state consistent with the epistemic state is uniform, i.e. given by where | · | indicates the size of the subspace. Figure 3 shows a basic example of theorem 1.
Theorem 2. Non-commuting case. The epistemic state (V, w) after a measurement (V Π , r) that does not commute with it, i.e. some of the generators do not Poisson commute with the state, is described by the epistemic state (V , w ) such that where V ⊥ commute is given by The representative ontic vector w is given by where Σ i are the generators (even the non-commuting ones) of the measurement Π and γ i is such that Σ T i γ i = 1.
Proof. Let us assume that Σ j , for j ∈ {0, . . . , m − 1}, do not commute with the generators of V. In addition to the learning stage of the previous commuting case, we also have a removal stage of the disturbing part of the measurement. We have already seen that we can split the subspace State after measurement (V ⇧ , r) Figure 3: Updating rules in the prime commuting case. The figure above shows a simple one-trit example of theorem 1 regarding the updating rule to predict the state after a sharp measurement that commutes with the original state. The state after measurement is given by In the above case the shift vectors are all (0, 0), the perpendicular Note that with "measurement" we are here representing one element of the measurement. The other elements can be obtained by simply shifting r as seen in figure 2. The final state is associated to each element of the measurement, each one with a corresponding probability of happening. The same reasoning holds for figures 5 and 8. is generated, from lemma 1, by all the Σ j , for j ∈ {0, . . . , m − 1}. Therefore we can reduce to the commuting case if we only consider V commute instead of the whole V. The updating rule for the subspace V then becomes In terms of the perpendicular subspaces note that we can both write from the usual property that the perpendicular of a direct sum is the intersection of the perpendicular subspaces. The updating rule for the representative ontic vector is the same as in the previous case (equation (14)). The correct updating rule for ⌦ V ? Figure 4: Updating rules via Venn diagrams. The figure above schematically shows the subspaces V ⊥ , V ⊥ Π , V ⊥ and the shifted ones (after applying the corresponding representative ontic vectors w, r, w ). In particular this picture explains the expression as a result of combining the updating rules for the epistemic subspaces and the representative ontic vectors. It is important to notice that to obtain the correct intersection we have to shift the subspaces V ⊥ + w and V Π + r back to the same origin (this is the role of w ). Indeed note that the subspace V ⊥ is found by combining the updating rules for V and w as in the previous case (13), where V ⊥ is replaced by V ⊥ commute . At the end we obtain for the epistemic state (V , w ) that

Updating rules -non prime dimensional case
It is quite common in studies of discrete theories, like Spekkens' model and SQM, to only consider the prime dimensional case because of the particular features of the set of integers modulo d, Z d , when d is non-prime, like the impossibility of uniquely define inverses of numbers. For example in our present case, figure 6 shows the State after measurement X-P=0 (V ⇧ , r) Figure 5: Updating rules in the prime non-commuting case. The figure above shows a simple one-trit example of theorem 2 regarding the updating rule to predict the state after a sharp measurement that does not commute with the original state. The state after measurement is given by In the above case the shift vectors are all (0, 0), the perpendicular subspaces are peculiar properties of the observable 3X in d = 6, which has not full spectrum of outcomes. The general formulation of Spekkens' model of section 2 does not change; not even the rules for calculating the probabilities of outcome and the updating of the state after a reversible evolutions (which are present in [5]). The new formulation we provide affects the observables and the related measurements updating rules. More precisely our issue, as already noticed, regards the updating-rule formula (14) and (19) for the shift vector w and the subspace V ⊥ commute , which do not always hold when the dimension d is non-prime. In fact the vector γ i such that Σ T i γ i = 1 does not always exist in that case. On the other hand, in prime dimensions, it always uniquely exists because γ i = k −1 i Σ i and the inverse of the integer k i = Σ T i Σ i always uniquely exists. Unlike the original formulation due to Spekkens, we will now characterise Spekkens' model in non-prime dimensions. In particular we characterise which are the observables that are problematic in the above sense -the coarsegraining observables, like 3X in d = 6 -and we then find the updating rules for a state subjected to the measurement of such observables by rewriting them in terms of non-problematic observables -the fine-graining observables.
In the next subsection we assume single-system observables (i.e. of the kind Σ = aX + bP, a, b ∈ Z d ) in order to soften the notation and facilitate the comprehension. This will bring more easily to the updating rules even in the most general case of many systems (subsection 4.2). In this case we recall, without making any reference to the quantity k −1 , but just in terms of the vector γ, the updating rule for the shift vector w , where, as usual, x = −Σ T (r − w), and the expression for

Coarse-graining and fine-graining observables
We define a fine-graining observable as an observable that has full spectrum, i.e. it can assume all the values in Z d . On the contrary a coarse-graining observable has not full spectrum.

Lemma 2.
An observable O f g has full spectrum, i.e. it is a fine-graining observable, if and only if it has the following form, where a , b ∈ Z d are such that they do not share any integer factor or power factor of d.
On the contrary a coarse-graining observable is written as where a , b ∈ Z d are again such that they do not share any integer factor or power factor of d and D is a factor shared by a, b ∈ Z d . More precisely the factor D is called degeneracy and it is defined as where D 1 , D 2 , . . . are different integer factors of d shared by a and b, and n 1 , n 2 , . . . are the maximum powers of these factor such that they can still be grouped out from a and b. We take the maximum powers because we want the remaining part, a X + b P, to not share any common integer factor or power factor of d between a and b . In this way we can associate a fine-graining observable to a coarse graining one by simply dropping the degeneracy D from the latter.
Proof. Let us first prove that an observable of the kind (23), O f g = a X + b P, is a full spectrum one. This can be proven by using Bezout's identity [24]: let a and b be nonzero integers and let D be their greatest common divisor. Then there exist integers X and P such that aX + bP = D. In our case the greatest common divisor D is equal to one, since a , b are coprime. Therefore we have proven that there exist values of the canonical variables X, P ∈ Z d such that O f g = a X + b P = 1. In order to reach all the other values of the spectrum we simply need to multiply both X and P in the previuos equation by j ∈ Z d .
We now prove the converse, i.e. that a full spectrum observable implies it to be written as (23). We prove this by seeing that an observable written as (24) has not full spectrum, i.e. we negate both terms of the reverse original implication. Proving the latter is straightforward, since the multiplication modulo d between an arbitrary quantity and a factor D, which is given by powers of integer factors of d, gives as a result a multiple of D. Since the multiples of D do not cover the whole Z d , then any observable of the form (24) has not full spectrum. ¶ Since an observable of the form (23) is an observable that cannot be written as (24) by definition, we obtain that a full spectrum observable implies the observable to be written as (23).
Given lemma 2 we have got the expressions (24) and (23) for coarse-graining and fine-graining observables. We want now to prove the following lemma to ensure that fine-graining observables are characterised by precisely defined updating rules. Proof. Let us prove that if we have a fine graining observable the vector γ exists. In our case Σ = (a , b ) and, by definition of a , b (as usual defined for fine-graining observables) and full spectrum, we can always find a vector γ = (γ a , γ b ) such that Σ T γ = a γ a + b γ b equals 1.
It could be that a , b share a factor which is not a factor of d. In this case the argument follows identically as if they were coprime.
¶ Multiples of D do not cover the whole spectrum of Z d because D has not an inverse D −1 (it is not coprime with d) and so we cannot obtain the whole values σ of Z d by simply finding X, P such that a X + b P = D −1 σ.
Let us prove the converse. We now have the vector γ such that Σ T γ = aγ a + bγ b = 1, where the coefficients a, b ∈ Z d define our observable aX + bP = σ. We want to prove that σ can achieve all the values of Z d . Since Σ T γ = 1 we can set the values of (X, P ) as equal to (γ a , γ b ) in order to reach the value σ = 1. We can now achieve all the other values of the spectrum by simply redefining γ asγ = cγ, where c assumes all the values in Z d .
The above lemma 3 should convince us that in order to find the updating rules in the presence of a coarse graining observable, it is appropriate to decompose it in terms of fine-graining observables. Let us assume that our coarse-graining observable is O cg = aX + bP = D(a X + b P ) = σ, and the associated isotropic subspace and representative ontic vector are (V cg , r cg ). To this observable we can associateD different fine-graining observables O f g = a X + b P = σ j , where j ∈ 0, . . . ,D − 1. The quantityD is the degeneracy D without the powers n 1 , n 2 , . . . , i.e.D = D 1 · D 2 · . . . . Indeed the powers n 1 , n 2 , . . . simply represent multiplicities associated to each corresponding fine-graining observable. The associated isotropic subspaces and representative ontic vectors are (V f g , r figure 6).
By definition the perpendicular isotropic subspaces are It is clear that V ⊥ cg ⊃ V ⊥ f g and we can therefore construct V ⊥ cg as where the subspace V D provides all the vectors that we need to combine with the vectors of V ⊥ f g to reach the whole V ⊥ cg . We call the subspace V D the degeneracy subspace because it encodes the degeneracy of V cg with respect to V f g . It has dimension 1 and sizeD. This is consistent with the fact that the dimensions of V ⊥ cg and V ⊥ f g are respectively 2 and 1. The sizes are respectivelyD · d and d. The size of V ⊥ f g is d because it is always a maximally isotropic subspace and its dimension is 1 because from one generator we get all the other vectors of the subspace by multiplication with j ∈ Z d . The dimension V ⊥ cg is 2 because it cannot be 1 (it would be the same subspace as V ⊥ f g ) and it cannot be greater than 2 since also the whole phase space Ω = Z 2 d has dimension 2. In order to know the size of V ⊥ cg we need to count all the jv, where j ∈ {0, 1, . . . ,D − 1}, that meansD · d. Therefore it can be written as V D = span{v}, and all itsD vectors are of the kind v j = jv. The above reasoning easily extends to the case of n systems, where the dimensions are dim(V ⊥ cg ) = 2n, dim(V ⊥ f g ) = n, dim(V D ) = n, and the sizes are We can now prove that V D is a vector space.
Proof. The definition of V D is To see that it is a vector space we just need to see that (0, 0) belongs to V D and that V D is closed under addition and multiplication, i.e. under linear combinations. The null vector belongs to V D because in the definition (29) we would remain with Let us imagine that we have two vectors v, z ∈ V D . Is the vector γv + δz, where γ, δ ∈ Z d , still belonging to V D ? It is easy to see that if we apply the definition (29) we would get αw + β(γv + δz), which can be rewritten as where each of the two terms in parenthesis belong to V ⊥ cg , and therefore the whole expression belongs to it too.
We now define the shift vectors r (j) f g in terms of r cg and see that we can encode the degeneracy expressed by V D in there. The idea is schematically depicted in figure  7.
Given the shift vector associated to the coarse-graining observable r cg , the shift vectors r (j) f g associated to the corresponding fine-graining observables are of the kind r (j) where v j ∈ V d and are therefore of the kind jv, where j ∈ {0, . . . ,D − 1}. This implies that if we assume the outcome associated to the coarse-graining observable to be σ cg , i.e. Σ T cg r cg = σ cg , where Σ cg = (a, b), then the outcomes associated to the fine graining-observables are where C is the anti-degeneracy and it is defined as a non-zero number belonging to Z d such that D · C = 0 mod(d). The idea is that the vector v ∈ V D is such that Σ T f g v = C = 0, so it does not belong to V ⊥ f g , but it does belong to V ⊥ cg , since D · C = 0 mod(d). An easy way to find one of the possible v is to calculate it as CΣ f g , where Σ f g is the generator of V f g . In this way we know that Dv = 0, but v does not belong to It is important to notice that equation (31) implies that not all the outcomes are allowed for the fine-graining observables associated to the coarse-graining one; they are allowed only when the ratio σcg D exists. Figure 6 also explains this fact.
where v is the generator of V D . Note that, as a consequence of the degeneracy characterising the coarsegraining observable, we could keep adding D −1 j=0 jv = Dv without changing the validity of the expression of V ⊥ cg + r cg . We can see it just by noticing that V D + D −1 j=0 jv = V D or, more simply, that Dv = D · CΣ fg = 0, since D · C = 0mod(d).

Measurement updating rules
Let us assume to have n systems and to measure the coarse-graining observable O cg = a 1 X 1 + b 1 P 1 + · · · + a n X n + b n P n = D(a 1 X 1 + b 1 P 1 + · · · + a n X n + b n P n ) = σ cg , with corresponding isotropic subspace of known variables V cg and shift vector r cg , on the state ρ = α 1 X 1 + β 1 P 1 + · · · + α n X n + β n P n = σ, with corresponding isotropic subspace of known variables V = span{Σ 1 , . . . , Σ n } and shift vector w. The idea in order to find the updating rules for the state after measurement, the subspace of known variable V and the representative ontic vector w is to compute the updating rule of the initial state ρ with the fine-graining observables that are associated to the coarse graining observable O cg , i.e. O (j) f g = a 1 X 1 + b 1 P 1 + · · · + a n X n + b n P n = σ (j) f g (indeed we know that the updating rules are valid for them from theorem 3), and then combine them together. More precisely, the following theorem holds.
Theorem 3. The epistemic state (V, w) after a coarse-graining measurement (V cg , r cg ) is described by the epistemic state (V , w ) such that where the shift vector w is the shift vector deriving from the updating rule of the state after the measurement of the fine-graining observable O where the vectors γ i are defined such that Σ T i γ i = 1, and Σ i are the n generators of the subspace V f g associated to the fine-graining observable O (j) f g . The subspace V ⊥ commute is given by the original V after having removed the non-commuting part, i.e. equation (19), where γ l is such that Σ T l γ l = 1 and V l are the subspaces spanned by the (n − N ) non-commuting generators Σ l . Obviously if the state and measurement commute, then V ⊥ commute = V ⊥ . The above theorem tells us that the way we combine the updating subspaces of the state with each individual fine-graining observables is through their union. This result is clear in terms of schematic diagrams ( figure 7). The updated shift vector is just one of the updated shift vectors of the state with the fine-graining observables, because the information needed to update the shift vector of the state is encoded in just one of the fine-graining shift vectors. The degeneracy includes a meaningless multiplicity in the coarse-graining shift vector, and therefore every fine-graining observable can do the job of correctly updating the shift vector of the state. Actually every combination of the shift vectors w j can do the job, apart from the ones that sum to 0 mod(d), like D −1 j=0 w j . Note also that in the definition of V ⊥ commute the vector γ l is, in general, degenerate. This is not a problem because any degenerate value of γ l brings to the same subspace V ⊥ commute , since by definition its role is to add the vectors λ = cγ l to V ⊥ such that Σ T n λ = 0.
Proof. We find the expression for the updated subspace V ⊥ by simply reusing the already found formulas (13) and (19) of the prime-dimensional case and substituting V ⊥ Π with V ⊥ cg and r with r cg , . If we now consider the decomposition of V ⊥ cg + r cg as in (28) and (30), we obtain Since the intersection of a union is the union of the intersections, we have proven the first part of the theorem, The second part of the proof regards w being equal to any of the w j . Because of the degeneracy, any w j is equivalent to the others (with different value of j) in order to provide us with w , indeed it is possible to find one from another just by adding a vector v ∈ V D . The latter can be proven as follows. For simplicity let us assume to be in the case n = 1 and that v is the generator of V D . We know that, by the definition of state after measurement of a fine-graining observable, the updated shift vector w j is such that Σ T f g w j = σcg D + jC = σ (j) f g , where C = Σ T f g v is the antidegeneracy (equation (31)). It is straightforward to see that if we add v to w j , Figure 8 shows a basic example of theorem 3.

Equivalence of Spekkens' theory and SQM in all odd dimensions
In [5] it has been shown that SQM and Spekkens' toy model are two operationally equivalent theories in odd prime dimensions via Gross' theory of discrete non-negative Wigner functions. We have generalised Spekkens' model to all discrete dimensions.
In the above case the shift vectors are w = (0, 0), r The above equivalence does not hold in even dimensions, but we will now see that it holds in all odd dimensions. We will also state the equivalence in terms of the updating rules, where all its elegance arises. We recall that SQM and Gross' theory of non-negative Wigner functions are equivalent in all odd dimensions [15].

SQM -updating rules
Stabilizer quantum mechanics is a subtheory of quantum mechanics where we only consider common eigenstates of tensors of Pauli operators, unitaries belonging to the Clifford group, and Pauli measurements [6]. We can always write a stabilizer state ρ as where N = T r[ρ 1 · ρ 2 · · · · · ρ N ], j ∈ {1, . . . , N ≤ n}, n is the number of qudits and where g j is a stabilizer generator, more precisely a Weyl operator: where χ(pq) = e 2πi d pq , q, p are the coordinates of the phase space point λ = (q, p), andŜ,B are respectively the shift and boost operators (generalised Pauli operators) and the arithmetics is modulo d, When considering more than one qudit, the Weyl operator is given by the tensor product of the single Weyl operators. We can write the stabilizer state ρ in a more compact way as However we will mostly use the following notation in terms of stabilizer generators, We now analyse the updating rules for the state ρ under the stabilizer measurement Π, where p k is a stabilizer generator of Π and k ∈ {1, . . . , M ≤ n}. We analyse the updating rules first in the commuting case ([ρ, Π] = 0) and then in the general case.
(i) For non-disturbing (commuting) measurements, the state after measurement ρ is given by adding the stabilizer generators of the measurement Π and the state ρ, unless some generators coincide. In the latter case we obviously count them only once.
where we have here considered the case in which no generators coincide. This formula means that the state ρ is now where N * = N + M and r j is a stabilizer generator of ρ , i.e. it is either a valid (commuting) generator g j or p j . In the case where e.g. F generators coincide, then N * = N + M − F.
(ii) For disturbing (non-commuting) measurements (the most general case) the idea is that if we remove the non-commuting factors ρ j from the state ρ, i.e.
[ρ j , Π] = 0, this case reduces to the previous commuting one. We assume the state ρ to have only one non-commuting factor, say ρ N , which corresponds to the stabilizer generator g N . The state after measurement ρ is given by removing the non-commuting generator and adding the remaining ones of the state and measurement, unless some generators coincide. In the latter case we obviously count them only once.
where we have here considered the case in which no generators coincide. This formula means that the state ρ is now where N * = N + M − 1 and r j is a stabilizer generator of ρ , i.e. it is either a valid (commuting) generator g j or p j . In the case where e.g. F generators coincide, then N * = N + M − 1 − F.
To sum up, in the commuting case we add generators of state and measurement to obtain the state after measurement. In the non-commuting case we remove the non-commuting generator of the state and add all the others as in the commuting case. This structure is perfectly analogue to Spekkens' updating rules, which are just motivated by the classical complementarity principle.

Gross' Wigner functions -updating rules
Gross theory. In Gross' theory the Wigner function of a state ρ in a point of the phase space λ ∈ Ω is given by whereÂ(λ) is the phase point operator associated to each point λ, whereŴ (λ) are the Weyl operators defined in equation (37). Note that the normalisation is such that T r[Â(λ)] = 1. We recall that a stabilizer state is a joint eigenstate of a set of commuting Weyl operators. Two Weyl operators commute if and only if the corresponding phase-space points a, a have vanishing symplectic inner product: where M C is the symplectic complement of M. Moreover the transformations that preserve the positivity of the Wigner functions are the Clifford unitaries. Gross' theory of non-negative Wigner functions is a faithful way of representing SQM. Equivalence of ST and GT. The Wigner function (48) has the same form of the probability distribution (7) associated to the epistemic state (V, w) in Spekkens' theory. More precisely, they are equivalent if we assume M = JV, + indeed this transformation implies that V ⊥ = M C . The equivalence between Gross' theory and Spekkens theory, using the symplectic matrix J as the bridge, also extends in terms of transformations and measurement statistics [5]. This equivalence also implies the equivalence between Spekkens' theory and SQM in odd dimensions. Therefore we can see the description based on known variables (Spekkens) and the description based on Wigner functions (Gross) as two equivalent descriptions of stabilizer quantum mechanics in odd dimensions. We will now translate the already found updating rules of ST into Gross' Wigner functions.
Updating rules. Let us consider a stabilizer state ρ = ρ 1 · ρ 2 · · · · · ρ n , where n is the number of qudits (odd prime dimensions), and a measurement Π on the stabilizer state Π = Π 1 · Π 2 · · · · Π m , where, in general, m ≤ n. Let us assume m = n in order to consider "total" measurements (not only to a part of the state).
where λ ∈ Ω and R Π denotes the Wigner function (also called response function) associated with the measurement Π. The normalisation factor N is Proof. We rewrite the formula (49) by replacing the Wigner functions with their definition in terms of Spekkens' subspaces, The proof is straightforward. The RHS is one if and only if both the deltas are one; this means that λ has to belong simultaneously to V ⊥ + w and V ⊥ Π + r, i.e. λ ∈ (V ⊥ + w) ∩ (V ⊥ Π + r). If we recall equation (13) (and figure 4), we see that (V ⊥ + w) ∩ (V ⊥ Π + r) = (V ⊥ ) + w , and we can conclude that the RHS of equation (50) is one if and only if the LHS is one. At this point we can insert the normalisation factors on the RHS and the LHS. These guarantee that λ∈Ω W ρ (λ) = 1 and the uniformity as expected.
In the commuting case the updating rule in SQM consists of the addition of the stabilizer generators of state and measurement (equation (43)). In ST the updating rule consists of the intersection of the perpendicular isotropic subspaces (equation (13)). In GT addition and intersection translate into the product of the Wigner functions (equation (49)). In particular this stage consists of introducing zeros to the Wigner function in correspondence of the addition of generators to the subspace of known variables V (and so removing generators from the subspace V ⊥ ). We will call this process -where we learn information about the state -the localization stage.
Theorem 5. Non-commuting case. Let us assume the measurement, in general, not to commute with the state, i.e. [ρ, Π] = 0. The Wigner function of the state after measurement is where λ ∈ Ω, V other is the set spanned by the non-commuting generators of Spekkens' subspace V associated to the state ρ. The normalisation factor N is Note that we could have stated the theorem in terms of stabilizer generators instead of Spekkens' generators. The former being related to the latter as follows, where J is the usual symplectic matrix, Σ j are Spekkens' generators and g j the corresponding stabilizer generators. The relation (52) follows from the relation between ST and GT previously described, where the bridge between the two formulations is given by the matrix J.
In order to simplify the proof, let us assume the case of only one noncommuting generator, say ρ n . In the present case we know, from the structure of SQM and Spekkens' updating rules (adding the commuting factors between state and measurement and removing the non-commuting ones), that the state after measurement is ρ = ρ * Π, where ρ * = ρ 1 · . . . ρ n−1 . This means that we can write the state after measurement as a product of two commuting terms: ρ * and Π. Therefore we can write the Wigner function of ρ according to the product rule for the commuting case (equation (49)): We want now to prove that equation (51) is equal to the latter. This means we want to prove the following: We can simplify the terms R Π (λ), thus getting At this point, in order to prove the above theorem, we rewrite the formula (51) by replacing the Wigner functions with their definition, i.e. Kronecker deltas, where V ⊥ commute = V ⊥ ⊕ V other . Note that we have removed the response function of the measurement. This also implies that we do not have to change w, because we have only modified V ⊥ into V ⊥ commute and w is not affected. We now want to see that the LHS of equation (54) is different from zero exactly when the RHS is. The LHS is different from zero when at least one t ∈ V other is such that λ − t ∈ V ⊥ + w. The latter corresponds to λ ∈ V ⊥ + w + t. This means that λ ∈ V ⊥ ⊕ V other + w, i.e. λ ∈ V ⊥ commute + w, which is precisely what makes the RHS different from zero.
In the most general non-commuting case, in addition to the localization stage, in SQM we also have to remove the non-commuting generators from the state (equation (44)). In ST this consists of the union and shifts in the perpendicular subspace (equation (22)). In GT removal and union translate into the averaging out of the Wigner function (equation (51)). In particular this stage consists of introducing ones to the Wigner function in correspondence of the removal of generators from the subspace of known variables V (and so adding generators to the subspace V ⊥ ). We can think of this process as the one where, after having learned some information in the localization stage, we need to forget something, otherwise we would get too much information about the ontic state, which is forbidden by the classical complementarity principle. This also explains why non-commuting measurements are also called disturbing measurements. We will call this forgetting-part of the process the randomization stage. Finally note that the general-case formula (51) reduce to the product rule (49) in the commuting case. Figure 9 summarises the updating rules in the three theories in prime dimensions.
In the non-prime dimensional case, we can rephrase all the reasonings already done in ST in terms of Wigner functions.

Spekkens Theory
Wigner Functions Figure 9: Equivalence of three theories in odd dimensions in terms of measurement updating rules: Spekkens' toy model, stabilizer quantum mechanics and Gross' theory.
The table above shows the updating rules in the three mentioned theories in odd prime dimensions both for the commuting and the more general non-commuting case. In SQM the updating rules were already known: if state and measurement commute then the final state ρ is given by the stabilizer generators of both ρ and Π. If, more generally, they do not commute, we also need to remove the noncommuting generators (g N in the table above) of the original state. In Spekkens' model the updating rules for the epistemic state (V, w) and the measurement (V Π , r) have the same structure of the ones in SQM. At the level of the perpendicular subspaces, the updating rules involve the intersection and also the direct sum (union and shifts) of the state perpendicular subspace V ⊥ with the noncommuting subspace V other . The updating rules for the representative ontic vector w are written in terms of the measurement generators Σ i and the vector γ i such that Σ T i γ i = 1. The table above does not show, for aesthetics reasons, the influence of the shift vectors w, r, w on the perpendicular subspaces. The actual updating rule would be V ⊥ = (V ⊥ commute +w −w )∩(V ⊥ Π +r−w ). In Gross' theory the updating rule for Wigner functions of stabilizer states are given by a simple product of the Wigner functions associated to the state, W ρ , and measurement, R Π , in the commuting case, and an averaging over the non-commuting subspace V other in the general case. It is easy to see that the latter formula reduces to the previous in the commuting case (i.e. V other = {(0, 0)}). Lemma 4. The Wigner function W cg (λ) of the coarse-graining observable O cg = a 1 X 1 + b 1 P 1 + · · · + a n X n + b n P n = D(a 1 X 1 + b 1 P 1 + · · · + a n X n + b n P n ) = σ cg , can be written in terms of the Wigner functions W (j) f g (λ) of the associated fine graining observables O (j) f g = a 1 X 1 + b 1 P 1 + · · · + a n X n + b n P n = σ Proof. First of all the normalisation factor 1 D is due to the fact that we are addinḡ D Wigner functions, each of them having a normalisation factor of 1 d , since they are Wigner functions of maximally isotropic subspaces (of dimension d). The proof of the rest of the formula is straightforward. According to the definition of Wigner functions, we need to prove that From the decomposition of the isotropic subspaces and shift vectors in Spekkens' model, equations (28) and (30), we already know that , which exactly proves that the RHS of (56) is one if and only if the LHS is one.
From the above construction and theorem 3 we can immediately write the Wigner function of a stabilizer state after a coarse-graining measurement, thus generalising theorem 5.
Theorem 6. The Wigner function of the state ρ of n-qudit systems, where the dimension d is a non-prime intger, after the (non-commuting) measurement Π is given by where λ ∈ Ω, V other is the set spanned by the non-commuting generators of Spekkens' subspace V associated to the state ρ. The response function of the j − th fine-graining measurement is denoted by R

Spekkens Theory
Wigner Functions

Prime dimensional systems
Non-prime dimensional systems f g ). The updated shift vector w is just one of the updated shift vectors w j of the state with the fine-graining observables. In terms of Wigner functions, the union translates into a sum ofD terms, and the response functions of the fine-graining observables are denoted as R (j) f g .

Discussion
The importance of completing Spekkens' theory with updating rules to determine the state after a sharp measurement relies on the possible applications of this theory for future works. In particular we think it is interesting to characterise ST in terms of its computational power, i.e. exploring which are the quantum computational schemes that can be represented by ST. As an example ST can be used as a noncontextual hidden variable model to represent the classically simulable part of some state-injection schemes, thus witnessing non-contextuality and also contributing to the aim of proving that contextuality is necessary for quantum speed-up in such schemes.
The result about the equivalence between ST and SQM and the associated updating rules in prime and non-prime odd dimensions can provide a powerful new way to use and analyse SQM in non-prime dimensions, about which almost nothing is known. For example we are now facilitated to state, given a set of commuting Pauli operators, whether the joint eigenstate that they represent is pure. In non-prime dimensions the latter issue is not trivial because for coarse-graining observables the number of independent generators is not equal to the number of observables. However, from our construction to decompose coarse-graining into finegraining observables, we know that the number of independent generators is equal to the number of fine-graining observables. Therefore if the set of commuting Pauli operators has the number of independent generators that equals the number of finegraining observables, then the state is pure. Indeed fine-graining observables are associated to pure states. In addition, in the field of quantum error correction it could be interesting to study if the coarse-graining observables have any usefulness.
Finally, the enforced equivalence of SQM, ST and Gross' theory in odd dimensions can be exploited to address a given problem from different perspectives, where, depending on the cases, one theory can be more appropriate than another. An example is the already mentioned one of addressing protocols based on SQM with Spekkens theory instead of SQM or Wigner functions.

Conclusion
Spekkens' toy model is a very powerful model which has led to meaningful insights in the field of quantum foundations and that seems to have interesting applications in the field of quantum computation. We have extended it from prime to arbitrary dimensional systems and we have derived measurement updating rules for systems of prime dimensions when the state and measurement commute, equations (13)(14), when they do not, equations (18) (14), and for systems of non-prime dimensions (theorem 3). These results directly derive from the basic axiom of the theory: the classical complementarity principle. The latter characterises a structure for the updating rules which is the same as in stabilizer quantum mechanics: the state after measurement is composed by the generators of the measurement and the compatible (i.e. commuting) generators of the original state.
Spekkens showed the equivalence between SQM and ST in odd prime dimensions via Gross' Wigner functions. We have extended this result to all odd dimensions and we have translated the updating rules of ST in terms of Wigner functions (theorems 4, 5, 6). We stress again that Spekkens' model and our measurement updating rules hold in all dimensions, in even dimensions too. However the equivalence between ST and SQM only holds in odd dimensions. The main reason is that SQM in even dimensions shows contextuality, while ST does not. One of the main future challenges is to find a hidden variable toy model which is also equivalent to qubit SQM.
We treat the problem with systems of non-prime dimensions, which arises from the problem of defining an inverse in Z d , by decomposing the problematic (coarsegraining) observables in terms of the non-problematic (fine-graining) ones. This approach naturally suggests the form of the updating rules. By comparing the updating rules in the three mentioned theories we highlight the beauty and the elegance of this equivalence, where addition and removal of generators in SQM correspond to intersection and union in ST and product and randomization in GT. This correspondence is schematically depicted, for the prime-dimensional case, in table 9. The non-prime case correspondence is represented in table 10. We believe that the fresh perspective gained by moving from one theory to another can give powerful new tools for new insights in the field of quantum computation.

Acknowledgments
We would like to thank Misja Steinmetz for suggesting Bezout's identity. This work was supported by EPSRC Centre for Doctoral Training in Delivering Quantum Technologies [EP/L015242/1].