Contextuality as a resource for measurement-based quantum computation beyond qubits

Contextuality - the obstruction to describing quantum mechanics in a classical statistical way - has been proposed as a resource that powers quantum computing. The measurement-based model provides a concrete manifestation of contextuality as a computational resource, as follows. If local measurements on a multi-qubit state can be used to evaluate non-linear boolean functions with only linear control processing, then this computation constitutes a proof of strong contextuality - the possible local measurement outcomes cannot all be pre-assigned. However, this connection is restricted to the special case when the local measured systems are qubits, which have unusual properties from the perspective of contextuality. A single qubit cannot allow for a proof of contextuality, unlike higher-dimensional systems, and multiple qubits can allow for state-independent contextuality with only Pauli observables, again unlike higher-dimensional generalisations. Here we identify precisely that strong non-locality is necessary in a qudit measurement-based computation that evaluates high-degree polynomial functions with only linear control. We introduce the concept of local universality, which places a bound on the space of output functions accessible under the constraint of single-qudit measurements. Thus, the partition of a physical system into subsystems plays a crucial role for the increase in computational power. A prominent feature of our setting is that the enabling resources for qubit and qudit measurement-based computations are of the same underlying nature, avoiding the pathologies associated with qubit contextuality.


I. INTRODUCTION
Computers that exploit quantum phenomena are believed to be more powerful than those obeying classical rules. Many features of quantum theory have been proposed as the origin of this supposed quantum computational power: entanglement, superposition, and exponential scaling of Hilbert spaces to name a few. Recently, contextuality has been investigated in a variety of scenarios as a potential resource for quantum computation [1][2][3][4][5][6][7][8][9]. Contextuality can be thought of as the impossibility of assigning pre-determined outcomes to all potential measurements of a quantum system [10][11][12][13]. This fundamental but peculiar property of quantum systems can exhibit in many ways, most famously in allowing quantum systems to circumvent constraints on classical correlations, leading to Bell non-locality.
While the majority of recent research into contextuality as a resource for quantum computation sits in the framework of the circuit model, perhaps the most striking results in this direction arise in the measurement-based model of quantum computation (MBQC) [14]. Anders and Browne [15] showed that a simple control computer limited to evaluating linear boolean functions can be boosted in power, to one that can evaluate general (nonlinear) functions, when given the measurement outcomes on a resource state that constitutes a proof of contextuality. Their key example was Mermin's simplified GHZ paradox [11] (a common proof of contextuality), where linear control of the local measurement settings allows for the evaluation of a non-linear NAND gate. Subsequently, Raussendorf [1] extended these results, proving that the computation of a non-linear function (from mea-surement outcomes with linear pre-and post-processing) implies the impossibility of non-contextual assignments to the single qubit observables.
These previous results are quite strongly dependent on qubits (two-dimensional quantum systems) being the elementary measured systems. While qubits are standard in quantum computation, they are unusual from the perspective of contextuality. For example, an individual qubit is unique as a quantum system that cannot be used to prove Kochen-Specker contextuality [10,12]. On the other hand, multi-qubit states allow for stateindependent proofs of contextuality using only Pauli observables (such as in Mermin's simplified Peres and GHZ paradoxes [11]), whereas the natural generalisation of these thought experiments to higher-dimensional systems are non-contextual [16,17]. As highlighted in Anders and Browne, deriving a generalisation of their result for measurements of higher-dimensional systems is not straightforward. In particular, using qudits (higherdimensional quantum systems) has the potential to confuse the role of contextuality within an individual system with the exhibition of contextuality as a non-local (in Bell's sense) correlation between quantum systems. In addition, the Mermin-style proof of contextuality which serves as the key non-linear example in the qubit case does not straightforwardly generalise to qudits (with generalised Pauli observables). The key prior research in this direction is by Hoban et al. [18], where the qudit case was considered from the perspective of Bell inequalities for multi-qudit systems. It was shown that evaluation of a sufficiently high order polynomial function on a multiqubit system constituted a proof of contextuality.
In this paper, we characterise the role of contextu-arXiv:1804.07364v2 [quant-ph] 1 May 2018 ality and non-locality within a general framework of both qubit and qudit MBQC. We give examples of noncontextual qudit MBQCs (with local dimension d ≥ 3) that evaluate non-linear functions, a result that sits in stark contrast to the qubit case; these examples show that a naive generalisation of Raussendorf's result is not possible. We then consider the space of functions that can be evaluated using MBQCs that admit predetermined local value assignments to each measured observable. For a polynomial function (in several variables) the existence of a value assignment to local observables places a restriction on its combined degree. In particular, we prove that the evaluation of a polynomial of sufficiently high degree gives a proof of contextuality, reproducing the result of Ref. [18], in a way that emphasises the distinctive role of contextuality in local vs global systems and correlations. A key ingredient in the argument is the notion of local universality, which captures both the computational power of MBQCs that admit local value assignments, and exposes the importance of localitythat grouping qubits or qudits together to form larger degrees of freedom can lead to additional computational power. While our results are general (and can apply to post-quantum theories more broadly), we give particular emphasis to the stabilizer-based MBQCs that are most commonly considered in the quantum computing literature. The paper is organised as follows. We present a general framework for MBQC on both qubits and qudits in Sec. II. In Sec. III, we highlight some of the problems in going from the qubit to the qudit case. For instance, we give explicit examples that show how non-linear functions can be computed even in non-contextual qudit MBQC. In Sec. IV, we review some results on functions in finite fields, and derive a description of subspaces in the space of polynomial functions invariant under linear preand post-processing. We also introduce the crucial notion of local universality, and prove that MBQC within the stabilizer formalism is itself locally universal, i.e., it allows to implement arbitrary functions on individual qudits. The classification of function spaces together with local universality eventually leads to a generalisation of Raussendorf's theorem from qubits to qudits, given in Sec. V.

II. THE SETUP
We start by introducing the notion of computation we consider, called ld-MBQC for "MBQC with Z d -linear classical processing". This notion fits within the computational framework first introduced in Anders and Browne [15], and is a generalisation of the l2-MBQC defined by Raussendorf [1]. Many of our results are not restricted to this particular implementation but hold more generally for any resource with non-local correlations, thus characterising not only the quantum but arbitrary non-local correlations.
The general setup consists of two components: a correlated quantum resource, and a control computer with restricted computational power. The quantum resource consists of N local parties, each of which contains a quantum system of dimension d (i.e., a qudit) and a measurement device. For each party there is a choice of d measurement settings, each with d measurement outcomes.
Each party exchanges data with the control computer once. Namely, each party receives a measurement setting q k ∈ Z d from the control computer to determine the choice of measurement M k (q k ), and returns the measurement outcome m k (q k ) ∈ Z d , where here and thereafter k ∈ {1, . . . , N } labels the party. We assume that the eigenvalues of each M k (q k ) are of the form ω z for ω = e 2πi d a dth root of unity and z ∈ Z d . Note that such operators are not Hermitian, but we use the terminology 'measurement of M k ' to denote a rank-1 projective measurement in the eigenbasis of M k , where we associate the measurement outcome m k (q k ) ∈ Z d with the eigenvalue ω m k (q k ) .
The control computer is tasked with evaluating a func- It is responsible for the side processing of classical data that determines both the measurement settings and the overall computational output from the measurement outcomes. It has very restricted computational power in that it is only capable of performing processing that is Z d -linear. The input q k to each party is determined in a Z d -linear way from the input i only. (This type of computation is called temporally flat, in Sec. V D we consider the case where the input is also determined by previous measurement outcomes. ) In particular, for each input i, the control computer evaluates N linear functions f k ∶ Z n d → Z d on the input string i, which determine the local measurement settings q k = f k (i) for each party. The control computer evaluates the output function o(i) by adding the measurement outcomes m k (q k ) modulo d. We can say that the quantum resource state is a genuine resource, in that it increases the computational power of the control computer, if this ld-MBQC scheme allows for the evaluation of functions that are not Z d -linear.
In order to ensure we are exposing only the computational power of the resource, we make a further restriction. Namely, we have that the inputs i ∈ Z n d form a group (so do the q k by linearity of the f k ) and we require measurements to be unitarily related, where the U k (q k ) form a projective representation of Z d for some fiducial measurement choice M k (0). In doing so, we have removed the possibility of non-linear functions being introduced through the choice of measurement setting alone, thereby incidentally increasing the power of the control computer separately from the quantum resource state (cf. Appendix A in Ref. [7]). This requirement is only necessary when d ≥ 3, as in the qubit case, any function f ∶ Z 2 → Z 2 is linear.
In practice, we will often restrict unitaries to the Clifford group, a projective representation of the group The fiducial measurements M k (0) are required to have a spectrum given by the dth roots of unity as described above. However, we do not require the M k (0)'s for different k to be generalised Pauli operators in the same Pauli frame, and as such our setup is sufficient to allow for universal quantum computation.
In summary, we have the following definition of an ld-MBQC, that is schematically illustrated in Fig. 1.

Definition 1.
A ld-MBQC with input string i ∈ Z n d and output o(i) ∈ Z d consists of the following components: 1. an N qudit system each of local dimension d where the overall resource state is represented by ψ⟩ ∈ (C d ) ⊗N ; 2. a set of measurement settings q k = f k (i) for some Z d -linear functions f k ∶ Z n d → Z d , independent of previous measurement outcomes (temporally flat); 3. a set of measurements M k (q k ) on each qubit satisfying Eq. (1), each with d possible eigenvalues We remark that with a suitably chosen resource state, such as (qudit) cluster states, this model is universal for quantum computation [14,19].

A. Structure of ld-MBQCs
In the case of deterministic computations, the sum of the measurement outcomes is fixed, independent of the individual outcomes. This means the product of all local measurements stabilizes the resource state ψ⟩, and we can describe the deterministic ld-MBQC concisely through a set of eigenvalue equations, for each i ∈ Z n d . For a given input i, we define the 'global observable' M (i) as the tensor product of the local measurements. The global observables are important as their eigenvalues encode the computational output according to Eq. (2). We will restrict our attention to deterministic ld-MBQCs throughout the paper for simplicity, however our main results generalise to the probabilistic case as discussed in Appendix C.
The connection with contextuality is as follows. Each input i ∈ Z n d can be regarded as selecting a context C(i) (that is, a set of commuting observables) through We have included the global observable in each context as its measurement outcome is fixed in the deterministic case, and corresponds to the computational output o(i) (that is inferred from outcomes of the local measurements). The task of finding a non-contextual hidden variable model is to find (perhaps many) value assignments to local observables that are consistent with the global value assignment. Since the global value assignment is fixed by the computational output, in general, some computations may result in an obstruction to finding a non-contextual hidden variable model in our setting.

B. Anders and Browne Qubit Example
Here we review the instructive example, due to Anders and Browne [15], which shows that (at least in the qubit d = 2 case) evaluating deterministic non-linear functions with l2-MBQC is possible with an appropriate quantum resource state.
Following Anders and Browne, we consider an l2-MBQC with a three-qubit GHZ state, ψ GHZ ⟩ = ( 001⟩ − 110⟩) √ 2, on which local measurements of Pauli observables X or Y on each qubit enable the deterministic computation of the non-linear NAND gate. The control computer receives two bits i = (i 1 , i 2 ) ∈ Z 2 2 as input. The classical pre-processing to determine the measurement settings on each qubit amounts to evaluating the linear functions The bits q k = f k (i) determine the measurement setting on each qubit according to M k (0) = X and M k (1) = Y , for k ∈ {1, 2, 3}. These measurement settings are related by the unitary transformation U = 1 These measurement settings define the global observables, with the state ψ GHZ ⟩ an eigenvector of each observable, and with corresponding eigenvalues given by In other words, the measurement outcomes of the local X and Y measurements can be linearly processed to compute the output function . Thus, the l2-MBQC evaluates a non-linear function of the input that could not be evaluated by the control computer alone.

C. Central Questions
What ld-MBQCs can compute non-linear functions? And what properties of the quantum resource state enable this additional power? In the qubit case, the conditions under which an l2-MBQC allows for the computation of non-linear boolean functions-functions that would otherwise be beyond the capabilities of the control computer-have been well characterised. In particular, Raussendorf has shown that any l2-MBQC that computes a non-linear boolean function constitutes a proof of contextuality [1]; if a l2-MBQC can be described by a non-contextual 'hidden variable model', where the outcomes associated with measurements are pre-determined by (local) value assignments, it is restricted to computing linear functions. (Note that this result also holds in the temporally ordered case, where measurement settings can be additionally determined by past measurement outcomes.) More specifically, we say that a quantum experiment is strongly contextual [20] if, for all measurement outcomes that occur with non-zero probability quantum mechanically, no consistent value assignment exists. The above example is strongly contextual, and so there does not exist any assignment of pre-determined measurement outcomes to each of the local observables that can reproduce the correlations required for the computation of the NAND gate. We restate Raussendorf's theorem of Ref. [1].
The qudit case with d ≥ 3 is much less explored. While qubits are natural to consider in (measurementbased) quantum computation, they are pathological from the perspective of contextuality. Single qubits are noncontextual by the Kochen-Specker theorem, while entangled qubits exhibit state-independent contextuality using only Pauli observables in contrast to its qudit counterparts. A natural question is whether the interplay between contextuality and non-linearity holds more generally in ld-MBQCs with d ≥ 3.
In the following section, we will show that the qudit case is not so straightforward, and certain kinds of non-linear functions may be computed even with noncontexual ld-MBQCs.

III. EXAMPLES AND PUZZLES
In this section, we illustrate some of the subtleties involved in the qudit case. We focus on a particularly interesting class of ld-MBQCs based on the qudit stabilizer formalism. Unlike the qubit case, such ld-MBQCs are non-contextual. (An explicit non-contextual hidden variable model for the qubit stabilizer theory is given by the discrete Wigner function [16,17]. There has been a considerable amount of recent research investigating the differences between the qubit and qudit stabilizer subtheories from the perspective of contextuality; see for example [3-6, 16, 21-23]. ) Contrary to what one might naively expect, we will see that qudit stabilizer ld-MBQCs possess a computational power that exceeds Z d -linear processing. That is, nonlinear functions can be evaluated using an MBQC that is entirely non-contextual, in stark contrast to the qubit case. This demonstrates that the relationship between contextuality and non-linearity in the qubit case is not the end of the story, and for qudits with d ≥ 3 we need finer notions of both.
In this section we will be restricting to the case where the measurements M k belong to the qudit Pauli group, and the unitaries U k that relate these measurements as in Eq. (1) belong to the Clifford group. Important to our considerations is that when d is odd, this subtheory admits a non-contextual description [16]. We outline a very restricted case under which linearity in the output can be recovered, along with two examples within this non-contextual framework that result in non-linear output functions.

A. Sympletic Structure of Qudit Stabilizer Formalism
Our results will make extensive use of the sympletic structure of the qudit Clifford group, and so we briefly review this formalism here. For more details, see Ref. [24].
Recall that the Pauli group P ⊗N d over Z d is the group generated by N -fold tensor products of individual ele- Note that Weyl operators are generalized Pauli operators with a particular choice of phase.
The Clifford group into a Weyl operator W x and an element of the group of symplectic Clifford operators U σ ∈ σC N (d). Symplectic Clifford operators act as automorphisms on the set of Weyl operators, i.e. for all v ∈ Z 2N d , in fact, they preserve the underlying symplectic structure, where the symplectic matrix is given as

B. Computational Output and (Non-)Linearity
Let us now relate the transformation properties of Pauli observables under Clifford operations to the computational output of the ld-MBQC, using the symplectic formalism. From the defining commutation relation of Weyl operators, and the fact that symplectic operators preserve the symplectic inner product, we obtain the following relation for individual qudits (for clarity we omit the subscript k labeling different qudit sites), for any Clifford unitary U ∈ C N (d) (where we define the exponent of ω to be zero if f (i) = 0). Note that the phase in Eq. (10) is independent of the qudits we act on and only depends on the Weyl commutation relations.
From Eq. (11), we infer that conjugation of a Pauli operator by Pauli operators results in multiplication of a phase, yet does not change the context. That is M (i) ∝ M (0) and C(i) ∝ C(0) for all inputs, meaning the output o(i) is linearly related to o(0). As a result, we are trivially restricted to be non-contextual.

Example 2: Quadratic Output
In the next two examples we remain within the stabilizer subtheory but extend to arbitrary Clifford unitaries. First, we show how using control unitaries that are symplectic Cliffords (i.e., Cliffords that are not Paulis) allows us to compute quadratic functions from the symplectic inner product. In the following, we assume d ≥ 3.
The generalised phase gate S is an element of the symplectic Clifford group, which up to phase acts on the generalised Pauli X = Consider the following state of N = 2d qudits, We fix all of the linear functions f k (i) = f (i) to be the same, and note that we have the following stabilizer relations, We can use this setup together with the symplectic structure of Weyl operators to implement quadratic output functions through accumulated symplectic products. Without loss of generality, we choose the first qudit and take U 1 = SW x for x = (0, −1) ⊺ in Eq. (12) Despite C S being a linear map, it leads to quadratic output functions due to the symplectic structure of the Weyl group.

Example 3: General Non-Linear Output
With our final example, we show that one can even go beyond quadratic functions. Another symplectic Clifford operator is given by, where R × denotes the multiplicative group of units within a ring R.
The output function o(i) = u −f (i) is again non-linear, however, the underlying system is part of the qudit stabilizer formalism and can be given a non-contextual hidden variable model with local value assignments m k (f k (i)) such that o(i) = ∑ N k=1 m k (f k (i)) [16,24]. Examples 2 and 3 are therefore in clear contrast to Raussendorf's result in the qubit case, as they allow for the evaluation of non-linear functions with MBQCs that are non-contextual. It turns out that linearity is a special property of boolean functions which does not translate to the qudit case.

IV. FINITE FIELDS AND LOCAL UNIVERSALITY
Given these conceptual differences between the qubit and qudit cases as illustrated by the examples in the previous section, it will be helpful to take a more abstract view on the problem. We begin by reviewing some properties of functions on finite fields.

A. Functions on Finite Fields
Let F d be the finite field with d elements and Ω F d n ∶= F d [x 1 , . . . , x n ] the polynomial ring in n variables, x 1 , . . . , x n ∈ F d .
For infinite fields there are many non-polynomial functions, but not so for finite fields.
Theorem (Functions on finite fields). Let F d be the finite field with d elements, and n ∈ N. Then every function g ∶ F n d → F d is given by a polynomial, g ∈ Ω F d n of partial degree less or equal to d − 1 in each variable x i .

Proof. See Appendix A.
Here, the partial degree of a variable within a product is the exponent of that variable.
For qubits, Raussendorf proved that computability of a non-linear function implies contextuality of the underlying quantum system [1]. We note that this result depends critically on the application of the above theorem to d = 2, where it states that all functions φ ∶ Z 2 → Z 2 are linear. In a non-contextual hidden variable model, the measurement outcomes m k are determined by a local value assignment that can depend on the choice of measurement setting q k = f k (i); these local value assignments m k (f k (i)) are necessarily linear by the above theorem. In the same way, the final output function o(i) on an l2-MBQC on N qubits is a linear combination of the measurement outcomes at each site, If o(i) is non-linear, then the assumption of noncontextuality must be incorrect. Non-linearity in this case can only arise from products of at least two different inputs, as in Anders and Browne's NAND gate illustrated in Sec. II B.
In generalizing to the qudit case, however, a local value assignment is not required to be a linear function of the choice of measurement. Here, this simple connection between non-contextuality and linearity is lost. Nevertheless, we now show how to use the above theorem for functions on finite fields to build a new, general connection.

B. Linearly Closed Subspaces
We would like to characterise the space of all functions of the form o ∶ F n d → F d in terms of non-trivial subspaces under linear pre-and post-processing, which we denote by ⊂ l . First, define the space of linear functions as where x = (x 1 , . . . , x n ). Then a schematic that represents the linear pre-and post-processing that we consider is given in Fig. 2. Note first that the space of functions available after pre-and post-processing will at least contain the original function space, as the identity is a linear function. Consider the two trivial cases: the space of all functions Ω F d n ; and the space of linear functions L F d n . Any linear combination of linear functions results again in a linear function, hence, we find L F d n ⊂ l Ω F d n . Aside from these two trivial cases, there also exist nontrivial spaces that are stable under linear pre-and postprocessing. Define the following subspaces for 1 ≤ δ ≤ n(d − 1), using the notation ⟨⋅⟩ l for linear span, The function spaces Ω F d n (δ) depend on the field F d , the number of inputs n and the maximal combined degree of monomials δ. (The combined degree within a product of variables is the sum of their respective exponents as in Eq. (16).) In other words, Ω F d n (δ) contains all polynomials φ ∶ F n d → F d of degree at most δ. We prove a lemma, detailing the behaviour of these subspaces under linear pre-and post-processing.
, then all polynomials generated by linear preand post-processing satisfy, Proof. We focus on the space of functions generated by linear pre-processing first. We find thatφ ○ L F d n ⊆ l Ω F d n (δ) as evaluating monomials x j on linear functions results in polynomials of degree at most j. As the definition of Eq. (16) already captures linear post-processing, we also have On the other hand we can always choose a linear function such that after evaluation on x j the resulting polynomial and x j are linearly independent (by producing other terms of less degree). Hence, taking linear combinations we can generate all polynomials of degree at most j, We conclude that the subspaces closed under linear pre-and post-processing are exactly the Ω F d n (δ) for 1 ≤ δ ≤ n(d − 1), where Ω F d n (1) = L F d n .

C. Local Universality
In the qubit case, F 2 = Z 2 , every local output function m ∶ Z n 2 → Z 2 is linear. Put another way, with any given local function φ ∈ Ω F d 1 together with linear pre-and post-processing, we can realise arbitrary functions m ∶ Z 2 → Z 2 . We say (somewhat trivially) that linear functions are universal for local qubit value assignments. For qudits (d = p r , p prime, r ∈ N and corresponding finite field F d ), local output functions are still maps from the field to itself, m ∶ F d → F d . However, it is no longer true that all functions of this type are linear; any monomial of degree higher than one is clearly not.
Hence, whereas linear pre-and post-processing turned out to be universal (in the sense of being able to evaluate any function m ∶ Z 2 → Z 2 ) for individual (local) qubit value assignments, this is not the case for qudits. Therefore, we define a new property capturing this universality for both cases, qubits and qudits, as follows.
Definition 2 (Local universality). A system of the type depicted in Fig. 2 Note that the system size crucially enters this definition by means of the finite field F d , where d denotes the qudit dimension.
With this definition, we are now able to identify the generalized connection between computational power and contextuality for qudit systems. In a non-contextual hidden variable model, we again have local output functions m k ∶ F n d → F d ; these are not required to be linear in the qudit case. Nonetheless, as we now show, this does not allow for the evaluation of any non-linear function. For qubits, non-linear functions arose (by necessity) from crossterms, i.e., terms with combined degree greater than 1, such as the term i 1 i 2 in the NAND gate in the example of Sec. II B. For qudits, local universality allows us to implement some crossterms for finite fields with more than two elements; however, by Lem. 1 we find that we can only implement a strict subset within the space of all polynomials, Local universality is a restriction on the space of (global) functions o ∶ F n d → F d , but a necessary requirement to maximise the computational power for (local) functions m k ∶ F d → F d . In short, locally universal models are in the class Ω F d n (d − 1) and, The key observation is that for both qubits and qudits non-contextual models are at most locally universal, slightly more general we have: Theorem 1. Consider an implementation of the setup in Fig. 2(b), where each function m k is within the class Ω F d n (δ) for δ < d = p r , p prime, n, r ∈ N. If the computed function o ∶ F n d → F d is deterministically evaluated, and (when written as a polynomial) involves at least one term of the form ∏ n j=1 x aj j , s.t. ∑ n j=1 a j > δ, then this MBQC is (strongly) contextual, and specifically Bell non-local.
Proof. The theorem is a direct consequence of Lem. 1 and the fact that the local functions φ k are restricted to the class Ω F d 1 (δ). Note that Thm. 1 is independent of the particular physical implementation of these function evaluations. In the next section we will look at the particular case of ld-MBQC.

V. NON-LOCALITY IN MBQC
In this section we connect these results with ld-MBQC as outlined in Def. 1. We have the immediate corollary of Thm. 1. We note that Cor. 1 was first reported in Ref. [18]. In order to see how tight this bound is, we check whether general ld-MBQC instances, and specifically non-contextual ones, satisfy local universality.
For qubits, this is trivially the case. In this section, we prove that local universality rather than linearity also generalises to ld-MBQCs on qudits of prime dimension.
We give a brief note regarding our restriction to prime values of d. Recall that in the setting of ld-MBQC, we are dealing with rings of integers modulo d. For d a prime number, Z d is in fact a field, but not all finite fields arise this way. Thm. 1 holds for all finite fields F d , i.e., also fields of order a prime power d = p r . However, F d ≅ Z d whenever n ≥ 2, as the latter is a ring but not a field. Functions on unital, commutative rings are not polynomials in general. For these reasons, we will restrict to fields Z p in this section, but we note that our results allow for partial inferences in the case of rings Z d with d odd as well.

A. Local Universality in MBQC
We show that functions arising from ld-MBQCs with single-qudit Clifford unitaries as the classical control operations are locally universal. In fact, this is true even under the restriction to stabilizer states. Note that for general rings Z d and d odd, the function , , x n ] contains non-polynomial functions. Nevertheless, the proof of Thm. 2 extends to rings Z d for d odd, hence, Cor. 1 remains true in those cases whenever the output function is a polynomial.
In Sec. III B 1, we proved that using Pauli unitaries for classical control is not powerful enough to yield nonlinear functions, yet within the full stabilizer subtheory of Clifford unitaries the MBQCs allow for non-linear output functions. Thm. 2 shows that Clifford unitaries already generate all non-linear functions, φ ∶ Z d → Z d , in particular, the bound in Cor. 1 is tight.
Note also that the function space accessible using the stabilizer subtheory contains at least Ω Z d n (d − 1) by Thm. 2. On the other hand the existence of a nonnegative discrete Wigner function restricts the stabilizer subtheory to local universality. Proof. The discrete Wigner function provides a noncontextual description for any implementation of the stabilizer subtheory [16]. Hence, such implementations are not strongly contextual. Yet any implementation evaluating a function o(i) ∉ Ω Z d n (d − 1) is strongly contextual by Cor. 1.
In particular, we cannot harness any computational power from non-local correlations using only stabilizer states.
Up until now we have focussed on deterministic MBQCs. We note however, in analogy to the qubit case, Cor. 1 extends to a probabilistic version for success probabilities within a finite interval around p S = 1. We provide the details of this generalisation in Appendix C.

B. Scaling under Composition
At the core of the framework of MBQC is the identification of locally-measureable systems, and the power of correlations between these systems. Within this framework, we make a distinction between contextuality 'within' a local system and the non-local contextuality between them. So far we have shown how non-local contextuality leads to correlations that can be used as a resource for computational power. To further illustrate this connection, we consider (somewhat reversely) how computational power constrains the composition of local systems; specifically, how quantum mechanics combines system dimensions multiplicatively rather than additively. To this end we assume an implementation of Fig. 1 on general finite fields F d , rather than restricting to Z d in ld-MBQC.
Consider a single qudit system with d = p 2 for p prime, and corresponding finite field F d of d elements. Using single qudit Clifford gates we can implement general poly- From the results on linearly invariant subspaces in Sec. IV, we know that the functional restriction between those spaces lies in the combined degree of its monomials.
Furthermore, assume we are given a device that allows us to perform non-local (correlated) measurements resulting in products of individual monomials. It is clear that with such a device (and local measurements) we can again implement arbitrary functions f ∶ F n d → F d . Given these preliminary considerations, we consider the scenario in which dimensions of subsystems were to combine additively under composition. We choose the system size such that the total dimension satisfies d = p 2 and d − 2 is prime (for instance, we can choose d = 3 2 ). The theorem on functions on finite fields then applies to both, composite as well as individual systems (with respective dimensions d − 2 and 2 under addition and dimension √ d under multiplication), and we find that the respective function spaces are given as Ω and Ω F2 n (2 − 1) = L F2 n . Next we apply our (hypothetical) correlation device, which multiplies the (highest) monomial terms within the respective spaces, together with mod p arithmetic in order to obtain an output in the target field Z p for p = 3, Evidently, taking products of monomials within Ω F d−2 n (d− 3) and L F2 n does not yield a polynomial with individual degrees p − 1. We conclude that under additive composition of these two systems one cannot reproduce all functions that are accessible when viewing the system as a composite upon which we can act with a single local measurement.
On the contrary, if we assume that physical subsystems combine multiplicatively with respect to their dimensions, we find upon otherwise similar reasoning, which exactly reproduces the full space of functions g ∶ F d → Z 2 p as required. Hence, under the constraint that function spaces corresponding to a system are the same whether viewed as composite or in terms of its subsystems, we find that system dimensions need to scale multiplicatively.
The tensor product is multiplicative in the dimension of the respective Hilbert spaces, hence, for quantum systems we reproduce the above result. However, note that we have not assumed Hilbert spaces or any other related structures from quantum mechanics. In fact, the scheme in Fig. 2 is a general setup for correlated systems, thus the result is independent of the physical implementation and holds as long as it is locally universal.

C. Classical vs Quantum Computing
Finally, we take a look at the scaling behaviour of quantum vs classical implementations of output functions o(i). Assuming local universality on n subsystems, we only gain an advantage in the case where the quantum system exhibits non-local features. Such features by definition do not arise from local functions, hence, it is a priori unclear how many qudits are necessary to implement them. However, if we consider arbitrary polynomials, we can take as an estimate the overall degree of the combined polynomial, i.e. d max = n(d − 1).
On the other hand, to classically implement a func- , we need to have access to a monomial of degree up to d max = n(d − 1). The only way to achieve this is by increasing the system size, i.e., combining systems to bigger ones. Classical systems combine under addition of their respective dimension, and so the number of systems we require to implement a function of highest degree in Ω F d n is Similar to the quantum case, we then need up to n(d − 1) copies in order to implement an arbitrary function, leaving C as the additional scaling factor. Hence, whereas the quantum system is linear in n under our assumption, the classical system scales quadratically in n.

D. Temporal Ordering
In this paper we have restricted the discussion to temporally flat MBQCs. That is, the measurement settings for the kth qudit depend only on the input i to the control computer and not previous measurement outcomes from qudits k ′ < k. Temporal flatness turns out to be a crucial requirement, as we have seen that non-locality is the key resource behind computational speed-up. Allowing temporal ordering means to allow for (one-way) communication between the locally separated qudit sites. The constraints in Thm. 1 and Cor. 1 can be understood as Bell-like constraints on correlations for which communication is naturally excluded.
In fact, if we allowed for temporal ordering, we would have access to recursive function calls. It is straightfor-ward to show that a classification of function spaces under iterative function calls with linear processing only has two stable subspaces, the entire space Ω F d n and the space of linear functions L F d n . This is why temporal ordering can be allowed in the qubit case. On the other hand, it means that any non-linear function φ ∶ F d → F d elevates the control computer to arbitrary functions in Ω F d n under linear processing.
In particular, we can obtain an upper bound on the polynomial degree for non-contextual ld-MBQCs even in the temporally ordered case, but it will be larger in general. We first define a directed graph G that contains all of the information of the temporal ordering. Namely, we have a vertex for each party (qudit), and an edge whenever the choice of measurement on one party depends on the measurement result of another. For the computation to be executable, we require that there are no cycles in the graph. As such, the graph for the temporally flat case contains no edges.
To find an upper bound on the degree of a computed polynomial in a non-contextual ld-MBQC, we find the longest (directed) path l in the graph G. Let the number of vertices in this path be denoted l . Then by composing a degree d − 1 polynomial l times, we obtain a polynomial of degree (d − 1) l . Whenever an ld-MBQC is evaluating a function that is a polynomial with degree greater than (d − 1) l , we have a proof of contextuality. Thus with temporal ordering, it is more difficult to find proofs of contextuality within the setting of ld-MBQC. This temporal ordering aspect again highlights the difference between the qubit and general (qudit) cases.

VI. DISCUSSION
In summary, we have placed a bound on the space of output functions of general MBQCs if the underlying system is non-contextual. This generalises Raussendorf's result [1] for qubits. Nontrivial MBQCs on qudits do not directly make use of (local) contextuality (in quantum systems of dimension at least three), but instead harness a type of global contextuality, namely non-locality. In fact, Thm. 1 can be understood as a deterministic version of Bell's Theorem restricted to MBQC: assuming local hidden variables, m k (x), and local (single qudit) measurements, Ω F d n (d − 1) is already maximal. Our results highlight locality as the crucial ingredient to Thm. 1, and show how non-local correlations between spatially separated subsystems can boost the computational power of the classical control computer.
We conclude with a number of directions for further research in this area.
A key open question is whether our results (specifically, Cor. 1) generalise to qudits with arbitrary nonprime-power dimensions. Most of our proofs rely on the theorem regarding polynomials in finite fields, which says that all functions over finite fields are polynomials. However, this result no longer holds true if d ≠ p r for p prime and r ∈ N, and so a generalisation would need to consider more general functions.
We have seen that the standard framework for MBQC in quantum theory is locally universal, and due to nonlocal correlations they can even compute functions outside of Ω F d n (d − 1). However, it is not clear whether local universality allows us to compute all functions in Ω F d n . It remains to determine if MBQCs of this form in quantum theory can saturate the space of functions (perhaps focussing on prime power dimensions). A more detailed analysis of the connections between the computational results and multi-party Bell inequalities as derived in Ref. [18] provides a natural starting point.
We focussed on generalized Pauli-like measurements with Clifford control unitaries as our framework, as this is standard for quantum computation, and showed that it is locally universal. With a different choice of control unitaries, it might be possible to exclude local universality. In this case, one may be able to obtain a proof of contextuality with the computation of polynomial with degree lower than d − 1.
Contextuality has recently been related to group cohomology [7,8]. It would be a worthwhile goal to pursue such classifications further and bring them in contact with our result on computational complexity. It would be interesting to understand the relationship between polynomial degree in our setting, and the nontriviality of a certain cocycle within the cohomological frameworks of Refs. [7,8].
In the latter case we can improve the number of qudits needed to implement the δ-function and generalise to qudits of arbitrary odd dimension d. Note that in any ring of integers modulo d, a 2 = 1 mod d ⇐⇒ (a − 1)(a + 1) = 0 mod d, has solutions a = ±1. We can use this to construct,