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

Markus Frembs,1 Sam Roberts,2 and Stephen D. Bartlett2 1Department of Physics, Imperial College , London SW7 2AZ, United Kingdom 2Centre for Engineered Quantum Systems, School of Physics, The University of , Sydney, 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 pos- sible 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 surement outcomes with linear pre- and post-processing) implies the impossibility of non-contextual assignments Computers that exploit quantum phenomena are be- to the single qubit observables. lieved to be more powerful than those obeying classical These previous results are quite strongly dependent rules. Many features of quantum theory have been pro- on qubits (two-dimensional quantum systems) being the posed as the origin of this supposed quantum computa- elementary measured systems. While qubits are stan- tional power: entanglement, superposition, and exponen- dard in quantum computation, they are unusual from tial scaling of Hilbert spaces to name a few. Recently, the perspective of contextuality. For example, an indi- contextuality has been investigated in a variety of sce- vidual qubit is unique as a quantum system that cannot narios as a potential resource for quantum computation be used to prove Kochen-Specker contextuality [15, 17]. [1–14]. Contextuality can be thought of as the impossibil- On the other hand, Pauli observables on multi-qubit sys- ity of assigning pre-determined outcomes to all potential tems (such as in Mermin’s simplified Peres and GHZ measurements of a quantum system, independent of their paradoxes [16]) allow for state-independent proofs of con- measurement context [15–18]. This fundamental but pe- textuality, whereas the natural generalisation of these culiar property of quantum systems can exhibit in many thought experiments to higher-dimensional systems are ways, most famously in allowing quantum systems to cir- non-contextual [21, 22]. As highlighted in Anders and cumvent constraints on classical correlations, leading to Browne, deriving a generalisation of their result for mea- strong non-locality (to be defined shortly). surements of higher-dimensional systems is not straight- While the majority of recent research into contextu- forward. In particular, using qudits (higher-dimensional ality as a resource for quantum computation sits in the quantum systems) has the potential to confuse the role of contextuality within an individual system with the ex- arXiv:1804.07364v3 [quant-ph] 25 Sep 2018 framework of the circuit model, perhaps the most striking results in this direction arise in the measurement-based hibition of contextuality as a non-local (in Bell’s sense) model of quantum computation (MBQC) [19]. Anders correlation between quantum systems. In addition, the and Browne [20] showed that a simple control computer Mermin-style proof of strong contextuality which serves limited to evaluating linear boolean functions can be as the key non-linear example in the qubit case does not boosted in power, to one that can evaluate general (non- straightforwardly generalise to qudits (with generalised linear) functions, when given the measurement outcomes Pauli observables). The key prior research in this direc- on a resource state that constitutes a proof of contextu- tion is by Hoban et al. [23], where the qudit case was ality. Their key example was Mermin’s simplified GHZ considered from the perspective of Bell inequalities for paradox [16] (a common proof of contextuality), where multi-qudit systems. It was shown that evaluation of a linear control of the local measurement settings allows sufficiently high order polynomial function on a multi- for the evaluation of a non-linear NAND gate. Subse- qudit system constituted a proof of strong contextuality. quently, Raussendorf [1] extended these results, proving In this paper, we characterise the role of contextu- that the computation of a non-linear function (from mea- ality and non-locality within a general framework of 2 both qubit and qudit MBQC. We give examples of non- we are primarily concerned with generalising the results contextual qudit MBQCs (with local dimension d 3) of Raussendorf [1] to qudits of prime power dimension, that evaluate non-linear functions, a result that sits in many of our results are not restricted to this particular stark contrast to the qubit case; these examples show≥ implementation and hold more generally for any resource that a naive generalisation of Raussendorf’s result is with non-local correlations. As such we briefly review the not possible. We then consider the space of functions Anders and Browne setup before discussing the special that can be evaluated using MBQCs that admit pre- case of MBQC. determined local value assignments to each measured ob- A general MBC consists of two components: a corre- servable. For a polynomial function (in several variables) lated resource, and a control computer with restricted the existence of a value assignment to local observables computational power. The correlated resource consists places a restriction on its combined degree. In partic- of N local parties, each of which is allowed to exchange ular, we prove that the evaluation of a polynomial of classical information with the control computer once. No sufficiently high degree gives a proof of strong contextu- communication between parties is allowed during the ality, reproducing the result of Ref. [23], in a way that computation, and the correlations in their output are emphasises the distinctive role of contextuality in local vs entirely due to interactions prior to the computation. global systems and correlations. A key ingredient in the During the exchange with the control computer, each argument is the notion of local universality, which cap- party receives an element of Zk from the control com- tures both the computational power of MBQCs that ad- puter (called the measurement setting), and returns an mit local value assignments, and exposes the importance outcome that is an element of Zl (called the measurement of non-locality—that grouping qubits or qudits together outcome). The control computer combines the measure- to form larger degrees of freedom can lead to additional ment outcomes in a linear way to produce the computa- computational power. While our results are general (and tional output. can apply to post-quantum theories more broadly), we We are interested in the case where inputs and output give particular emphasis to the stabilizer-based MBQCs are of fixed dimension d, such that d k l pr for p that are most commonly considered in the quantum com- prime, r N. In this case we refer to the system as an puting literature. ld-MBC, which is defined more precisely= as= follows.= The paper is organised as follows. In Sec. II we present ∈ a general framework for measurement-based computa- Definition 1. A ld-MBC with classical input i and clas- tions (MBC) following Anders and Browne [20], and fo- sical output o i consists of N parties, each of which re- cus on the important case of MBQC on both qubits and ceives an input qk Zd from the control computer, and qudits. In Sec. III, we highlight some of the problems returns an outcome( ) sk Zd, for k 1,...N. The in- in generalising the qubit-based results. For instance, we puts and computational∈ output satisfy the following con- give explicit examples that show how non-linear functions ditions: ∈ = can be computed even in non-contextual qudit MBQC. 1. The computational output o i Zd is a linear In Sec. IV, we review some results on functions in fi- function of the local measurement outcomes s nite fields, and derive a description of subspaces in the s1, , sN ⊺, ( ) ∈ space of polynomial functions invariant under linear pre- = and post-processing. We also introduce the crucial no- ( ⋯ ) o i Zs s0 mod d, (1) tion of local universality, and prove that MBQC within the stabilizer formalism is itself locally universal, i.e., it for s0 Zd and( ) =Z Mat+ n Zd . allows to implement arbitrary functions on individual qu- 2. The choice of measurements q q , , q ⊺ is re- dits. The classification of function spaces together with ∈ ∈ ( ) 1 N lated to the measurement outcomes s and the - local universality eventually leads to a generalisation of Zd valued classical input i i , ,= i ( ⊺ via⋯ ) Raussendorf’s theorem from qubits to qudits, given in 1 n Sec. V. q T s Qi= (mod⋯ d, ) (2)

for some T,Q= Mat+n Zd . II. THE SETUP 3. For a suitable ordering∈ ( of) the parties 1, , n the ma- trix T in Eq. (2) is lower triangular with vanishing We start by introducing the notion of computation we diagonal. If T 0 the ld-MBC is called⋯ temporally consider, called ld-MBC for “Measurement-Based Com- flat. putation with Zd-linear classical processing”. This no- = tion fits within the computational framework first intro- In the above, Matn Zd denotes the space of n n ma- duced in Anders and Browne [20] to study the computa- trices with entries in Zd. We will mostly be concerned tional power of correlated resources in a general setting with a special implementation( ) of this setup known× as that includes MBQC. For MBQC it is natural to choose ld-MBQC, where the correlated resource is given by a the input and output alphabet to be a cyclic group and quantum state, and the exchanged information with each we restrict our definition of ld-MBC in this way. While party are local measurement settings and outcomes. In 3 particular, a general ld-MBQC consists of two compo- the control computer separately from the quantum re- nents: a correlated quantum resource, and a control com- source state (cf. Appendix A in Ref. [7]). puter with restricted computational power. The quan- In practice, we will often restrict unitaries to the tum resource consists of N local parties, each of which Clifford group, a projective representation of the group 2N 2N contains a quantum system of dimension d (i.e., a qu- Zd Sp Zd (cf. Sec. III A). The fiducial measure- dit) and a measurement device. For each party there is a ments Mk 0 are required to have a spectrum given by choice of d measurement settings, each with d measure- the d⋊th roots( ) of unity as described above. However, ment outcomes. we do not( require) the Mk 0 ’s for different k to be Each party exchanges data with the control computer generalised Pauli operators in the same Pauli frame, once. Namely, each party receives a measurement set- and as such our setup is sufficient( ) to allow for universal ting qk Zd from the control computer to determine the quantum computation. choice of measurement Mk qk , and returns the measure- ment outcome∈ mk qk Zd, where here and thereafter In summary, we have the following definition of a tem- k 1,...,N labels the( party.) We assume that the porally flat ld-MBQC (cf. Fig. 1). z 2πi eigenvalues of each(Mk) q∈k are of the form ω for ω e d a d∈th{ root of unity} and z . Note that such operators Definition 2. A temporally flat ld-MBQC with input Zd string i n and output o i , consists of the follow- are not Hermitian, but( we) use the terminology ‘measure-= Zd Zd ment of M ’ to denote a∈ projective measurement in the ing components: k ∈ ( ) ∈ eigenbasis of Mk, where we associate the measurement 1. an N qudit system each of local dimension d where mk qk 1 outcome mk qk Zd with the eigenvalue ω ( ) . the overall resource state is represented by ψ The control computer is tasked with evaluating a func- ⊗N ; n n Cd tion o Zd ( Zd) ∈on some input i Zd . It is responsible S ⟩ ∈ for the side processing of classical data that determines 2. (a set) of measurement settings qk fk i for some n both the∶ measurement→ settings and∈ the overall compu- Zd-linear functions fk Zd Zd, independent of tational output from the measurement outcomes. It has previous measurement outcomes; = ( ) very restricted computational power in that it is only ∶ → 3. a set of measurements M on each qubit satisfy- capable of performing processing that is Zd-linear. The k ing Eq. (3), each with d possible eigenvalues ωmk , input qk to each party is determined in a Zd-linear way from the input i only. (This type of computation is called where mk Zd is the measurement outcome; temporally flat, in Sec. V C we consider the case where 4. the computational output is a linear function of the the input is also determined by previous measurement ∈ measurement outcomes m m , , m N , outcomes.) 1 N Zd In particular, for each input i, the control computer n o i Zm mod= { d, ⋯ } ∈ (4) evaluates N linear functions fk Zd Zd on the input string i, which determine the local measurement settings for some Z Mat( ) =n Zd . qk fk i for each party. The control∶ Ð→ computer evaluates the output function o i by adding the measurement out- ∈ ( ) comes= (m)k qk modulo d. We can say that the quantum n Control computer ( ) i Zd ... resource state is a genuine resource, in that it increases P o i Zd the computational( ) power of the control computer, if this p q P ld-MBQC scheme allows for the evaluation of functions q1 m1 q2 m2 ... qN mN that are not Zd-linear. In order to ensure we are exposing only the computa- MM1 MM2 MMN tional power of the resource we require measurements to d N ψ C b be unitarily related, | y P p q

qk −qk Mk qk Uk Mk 0 Uk , (3) FIG. 1. Schematic of the ld-MBQC. where the U q form a projective representation of k k ( ) = ( ) Zd We remark that with a suitably chosen resource state, for some fiducial measurement choice Mk 0 . In doing so, we have removed( ) the possibility of non-linear functions such as (qudit) cluster states, this model is universal for being introduced through the choice of measurement( ) set- quantum computation [19, 24]. ting alone, thereby incidentally increasing the power of A. Structure of ld-MBQCs

1 Note that the projective measurement Mk is only constrained on We first consider the case of deterministic computa- outcomes, in particular, the quantum system can be of dimension tions for which the output function has a fixed value greater than d for non-rank-1 projective measurements. for every input i, independent of the local measurement 4 outcomes (which individually might change at different The connection with ld-MBQCs is as follows. Each n runs), and where the output is the mod-d sum of the input i Zd can be regarded as selecting a context i measurement outcomes. In this case, the product of all (that is, a set of commuting observables) through local measurements stabilizes the resource state ψ , and ∈ C( ) we can describe the particular output function, i M1 q1 f1 i ,...,MN qN fN i ,M i . S ⟩ (6) N WeC( have) = { included( = the( global)) observable( = M (i )) M1( )}q1 o i m , k M2 q2 MN qN in each context as its measure- k=1 ment outcome is fixed in the deterministic( case,) = and( cor-)⊗ ( ) = Q concisely through a set of eigenvalue equations, responds( ) ⊗ to ⋯ ⊗ the computational( ) output o i (that is in- ferred from outcomes of the local measurements). The N task of finding a non-contextual hidden( variable) model fk(i) −fk(i) o(i) Uk Mk 0 Uk ψ ω ψ , (5) is to find (perhaps many) value assignments to local ob- k=1 servables that are consistent with the global value as- A n ( ) S ⟩ = S ⟩ signment. Since the global value assignment is fixed by for each i Zd . For a given input i, we define the ‘global observable’ M i as the tensor product of the local mea- the computational output, in general, some computations surements.∈ The global observables are important as their may result in an obstruction to finding a non-contextual eigenvalues encode( ) the computational output according hidden variable model in our setting. to Eq. (5). We will restrict our attention to deterministic ld-MBQCs throughout the paper for simplicity, however our main results generalise to the probabilistic case as B. Anders and Browne Qubit Example discussed in Appendix C. Here we review the instructive example, due to An- ders and Browne [20], which shows that (at least in the 1. Non-contextual and local value assignments qubit d 2 case) evaluating non-linear functions deter- ministically with l2-MBQC is possible with an appropri- We first define the notion of contextuality we consider, ate quantum= resource state. called strong contextuality, before making the connec- Following Anders and Browne, we consider an l2- tion with ld-MBQCs. We note that we only present the MBQC with a three-qubit GHZ state, ψGHZ 001 definition of strong contextuality as it pertains to the 110 2, on which local measurements of Pauli observ- quantum case, for the definition that applies to general ables X√ or Y on each qubit enable theS deterministic⟩ = (S ⟩ − no-signalling models see Ref. [25]. Denote the set of ob- computationS ⟩)~ of the non-linear NAND gate. The con- 2 servables by . A measurement context consists of trol computer receives two bits i i1, i2 Z2 as input. a set of mutually commuting observables, and we denote The classical pre-processing to determine the measure- the set of allO contexts by . A non-contextualC ⊆ O value ment settings on each qubit amounts= ( to) evaluating∈ the linear functions f i i , f i i and f i i i . assignment (NCVA) is a function s R with the 1 1 2 2 3 1 2 following properties M The bits qk fk i determine the measurement setting on ∶ O → each qubit according( ) to= Mk 0( ) =X and Mk( 1) = Y⊕, for i s A sp A A (that is, s A is an eigenvalue k 1, 2, 3 .= These( ) measurement settings are related by 1 of A), the unitary transformation U( ) =√ X Y . If( the) = eigen- 2 ( ) ( ) ∈ ( ) ∀ ∈ O ( ) ∈ { } value 1 ( 1) is observed, then the outcome mk qk 0 ii , s A s B s AB A, B, AB . = ( + ) (mk qk 1) is recorded. These+ measurement− settings define the global( observ-) = (The) ∀ NCVAsC ∈ M s(A) should( ) = be( thought) ∀ of as assigning∈ C an outcome that is revealed upon measurement of A. Im- ables,( ) = portantly, in the( setting) of MBQC, the value assignments must be compatible with the resource state in the follow- M 0, 0 X X X, (7) ing sense: we only consider NCVAs that assign a set of M 1, 0 Y X Y, (8) ( ) = ⊗ ⊗ outcomes that can jointly occur with nonzero probability M 0, 1 X Y Y, (9) ( ) = ⊗ ⊗ upon measurement of the resource state. If no such glob- M 1, 1 Y Y X, (10) ally consistent NCVAs exist, then the system is strongly ( ) = ⊗ ⊗ contextual. with the state ψGHZ( an) = eigenvector⊗ ⊗ of each observable, In the special case of product observables A A1 A2, and with corresponding eigenvalues given by B B1 B2, AB A1B1 A2B2 the locally measur- S ⟩ o i ,i i i 1 NAND i ,i able observables A1 and B1 (A2 and B2) compose= ⊗ indi- 1 ( 1 2) 1 1 2+ 1 ( 1 2). (11) vidually,= ⊗ hence local= value assignments⊗ must too (this is a special case of noncontextuality). When no such lo- In other(− ) words,= ( the− ) measurement= (− ) outcomes of the lo- cal assignment exists, we say that the system is strongly cal X and Y measurements can be linearly processed to non-local. compute the output function o i 3 m i , which k=1 k ( ) = ∑ ( ) 5 by Eq. (11) gives o i1, i2 NAND i1, i2 . Thus, the l2- variable model for the qubit stabilizer theory is given by MBQC evaluates a non-linear function of the input that the discrete Wigner function [21, 22]. There has been a could not be evaluated( by) = the control( computer) alone. considerable amount of recent research investigating the differences between the qubit and qudit stabilizer sub- theories from the perspective of contextuality; see for ex- C. Central Questions ample [3–6, 10, 21, 26, 27].) Contrary to what one might naively expect, we will see What ld-MBQCs can compute non-linear functions? that qudit stabilizer ld-MBQCs possess a computational And what properties of the quantum resource state en- power that exceeds Zd-linear processing. That is, non- able this additional power? In the qubit case, the con- linear functions can be evaluated using an MBQC that ditions under which an l2-MBQC allows for the com- is entirely non-contextual, in stark contrast to the qubit putation of non-linear boolean functions—functions that case. This demonstrates that the relationship between would otherwise be beyond the capabilities of the con- strong contextuality and non-linearity in the qubit case trol computer—have been well characterised. In par- is not the end of the story, and for qudits with d 3 we ticular, Raussendorf has shown that any l2-MBC and need a finer functional constraint. thus any l2-MBQC that computes a non-linear boolean In this section we will be restricting to the case≥ where function constitutes a proof of strong contextuality [1]; if the measurements Mk belong to the qudit Pauli group, a l2-MBQC can be described by a non-contextual ‘hid- and the unitaries Uk that relate these measurements as den variable model’, where the outcomes associated with in Eq. (3) belong to the Clifford group. Important to measurements are pre-determined by (local) value as- our considerations is that when d is odd, this subtheory signments, it is restricted to computing linear functions. admits a non-contextual description [21]. We outline a (Note that this result also holds in the temporally or- very restricted case under which linearity in the output dered case, where measurement settings can be addition- can be recovered, along with two examples within this ally determined by past measurement outcomes.) The non-contextual framework that result in non-linear out- above example is strongly contextual, and so there does put functions. not exist any assignment of pre-determined measurement outcomes to each of the local observables that can re- produce the correlations required for the computation of A. Symplectic Structure of Qudit Stabilizer the NAND gate. We restate Raussendorf’s theorem of Formalism Ref. [1]. Our results will make extensive use of the symplectic Theorem (Raussendorf). Be M an l2 MBC which n structure of the qudit Clifford group, and so we briefly re- deterministically evaluates a boolean function o Z2 view this formalism here. For more details, see Ref. [28]. . If o i is non-linear mod 2 in i − n then M is Z2 Z2 Z2 Recall that the Pauli group ⊗N over is the group strongly contextual. ∶ Ð→ d Zd generated by N-fold tensor products of individual ele- ( ) ∈ ∈ 1 The qudit case with d 3 is much less explored. ments from Xk,Zk, ω k , k P 1, ,N with X z z 2πi While qubits are natural to consider in (measurement- z 1 , Z z ω z , and ω e d a d-th root of unity. based) quantum computation,≥ they are pathological from These qudit⟨ Pauli operators⟩ can∈ { be⋯ conveniently} repre-S ⟩ = the perspective of contextuality. Single qubits are non- sentedS + ⟩ (upS ⟩ to= phase)S ⟩ by Weyl= operators. A Weyl operator ⊺ 2N contextual by the Kochen-Specker theorem, while multi- Wv for v a, b Zd is defined as the N-fold tensor ab a b 2 ple qubits exhibit state-independent contextuality using product of local operators Wa,b τ − Z X where τ ω only Pauli observables in contrast to its qudit counter- and a, b =Zd(. Note) ∈ that Weyl operators are generalised parts. A natural question is whether the interplay be- Pauli operators with a particular= choice of phase. = ⊗N ⊗N tween contextuality and non-linearity holds more gener- The Clifford∈ group N d d of d is the ally in ld-MBQCs with d 3. † ⊗N group of unitary operators such that VPV d for all In the following section, we will show that the qu- N C ( ) ⊂ U(H ) P P ⊗ , V N d . All (N-qudit) Clifford operators dit case is not so straightforward,≥ and certain kinds of d V N d factorise, ∈ P non-linear functions may be computed even with non- ∈ P ∈ C ( ) contexual ld-MBQCs. 2N ∈ C ( ) V UWx, x Zd ,

into a Weyl operator= Wx and an∈ element of the group III. EXAMPLES AND PUZZLES of symplectic Clifford operators U σ N d . These are defined as automorphisms on the set of Weyl operators, 2N † In this section, we illustrate some of the subtleties in- i.e. for all v Zd it holds that UW∈ vUC ( W) w for some 2N volved in the qudit case. We focus on a particularly in- w Zd , in fact, they preserve the underlying symplectic teresting class of ld-MBQCs based on the qudit stabi- structure, ∈ = lizer formalism. Unlike the qubit case, such ld-MBQCs ∈ −1 are non-contextual. (An explicit non-contextual hidden UWvU WCU v, for some CU Sp2N Zd .

= ∈ ( ) 6

The group Sp2N Zd denotes the group of symplec- 2. Example 2: Quadratic Output tic transformations, i.e. of linear transformations C 2N 2N T Zd Zd such( that) C σ2N C σ2N where the sym- In the next two examples we remain within the stabi- 1 0N N ∶ lizer subtheory but extend to arbitrary Clifford unitaries. plectic matrix is given as σ2N 1 . More- Ð→ = N 0N First, we show how using control unitaries that are sym- over, the symplectic inner product is given by v, w plectic Cliffords (i.e., Cliffords that are not Paulis) allows T 2N =   v σ2nw, for v, w Zd . − 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 sym- B. Computational Output and (Non-)Linearity plectic Clifford group, ≥

d 1 Let us now relate the transformation properties of − 2 S τ z z z σ d , Pauli observables under Clifford operations to the com- 1 z 0 putational output of the ld-MBQC, using the symplectic = = Q S ⟩⟨ S ∈ C ( ) formalism. From the defining commutation relation of which up to phase acts on the generalised Pauli X k k Weyl operators, Wv, v 0, 1 ⊺ by multiplication with Pauli Z, S XS− τ −kZkX. Consider the following state of N 2d qudits,= [v,w] WvWw ω WwWv , (12) = ( ) = d 1 1 − 2 2 = 2 and the fact that symplectic= operators preserve the sym- ψ z ⊗ z 1 ⊗ z d 1 ⊗ . d plectic inner product, we obtain the following relation z=0 for individual qudits (for clarity we omit the subscript k S ⟩ = √ Q S ⟩ S + ⟩ ⋯ S + − ⟩ We fix all of the linear functions f i f i to be labeling different qudit sites), k the same, and note that we have the following stabilizer relations, ( ) = ( )

f(i) −f(i) V Wv V 2d Sf(i)W S−f(i) ψ ψ , v 0, 1 ⊺. (15) UW f(i) W UW −f(i) v k x v x k=1 f(i)−1 −1 f(i)−1 ‰ Ž S ⟩ = S ⟩ = ( ) UWx WCU x WCU v W−CU x W−xU A = ( ) ( ) where the parentheses k denote the subsystem on W W f(i) W f(i) W f(i) W CU x C x C v C x −CU x which the operator acts. = ( ) U U − U( ) f(i) 2 f(i) f(i) f(i) We can use this setup(⋅) together with the symplectic CU x,CU v+CU x,CU v+ ⋯ +CU x,CU v = ω( ⋯ ) ( ⋯ W f()i) CU v structure of Weyl operators to implement quadratic out- f(i)−1 k put functions through accumulated symplectic products. = [x,CU v] = ω∑k 0 W f(i) , (13) CU v Without loss of generality, we choose the first qudit and take V1 SWx 1 for x 0, 1 ⊺ in Eq. (15) such that for= any Clifford unitary V d . Note that the k N x,CSv k, while leaving Vk Sk for k 2. Hence, phase in Eq. (13) is state-independent, it only depends = ( ) = ( − ) on the Weyl commutation relations.∈ C ( ) [ ] = f(i)−1 = ≥ k f i f i 1 o i x,CSv . k 0 2 = ( )( ( ) − ) 1. Example 1: Linear Output ( ) = Q [ ] = Despite CS being a linear map, it leads to quadratic out- put functions due to the symplectic structure of the Weyl As a first example, we examine the very restrictive group. case, where the controlled unitary operators in Def. 2 are Pauli operators. Using only controlled Pauli operators in Eq. (13), i.e., V W , 1 U σ d , the phase depends x 1 3. Example 3: General Non-Linear Output linearly on the input functions f i . In fact, we simply obtain a variant= of Eq. (12),= ∈ C ( ) ( ) With our final example, we show that one can even go W f(i)W W −f(i) ωf(i)[x,v]W . (14) beyond quadratic functions. Another symplectic Clifford x v x v operator is given by, From Eq. (14), we infer that conjugation= of a Pauli opera- d−1 tor by Pauli operators results in multiplication of a phase, × Mu uk k , u Zd , (16) yet does not change the context. That is M i M 0 k=0 and i 0 for all inputs, meaning the output o i ∶= Q S ⟩⟨ S ∈ is linearly related to o 0 . As a result, we are( ) ∝ trivially( ) where R× denotes the multiplicative group of units within restrictedC( ) ∝ toC be( ) non-contextual. ( ) a ring R. ( ) 7

⊺ 2 Now let ψ 1 Cd, v 1, 0 Zd and consider the on the choice of measurement setting qk fk i ; these f(i) local value assignments m i are necessarily linear by symplectic Clifford unitary U Mu σ 1 d for some k × S ⟩ = S ⟩ ∈ = ( ) ∈ the above theorem. In the same way, the= final( ) output u Zd acting on Z Wv, = ∈ C ( ) function o i on an l2-MBQC( ) on N qubits is a linear −1 f(i) −f(i) combination of the measurement outcomes at each site, ∈ UWvU = ψ M WvM ψ u u ( ) ( ) N WCf i v ψ Mu S ⟩ = S ⟩ o i mk i . (18) u−f(i) = ω ψS .⟩ (17) k=1 ( ) = Q ( ) f i If o i is non-linear, then the assumption of non- The output function o= i u−S (⟩) is again non-linear, contextuality must be incorrect. Non-linearity in this however, the underlying system is part of the qudit stabi- case( can) only arise from products of at least two dif- lizer formalism and can be( given) = a non-contextual hidden ferent inputs, as in Anders and Browne’s NAND gate variable model with local value assignments mk i such illustrated in Sec. II B. N that o i k 1 mk i [21, 28]. In generalising to the qudit case, however, a local value = ( ) Examples 2 and 3 are therefore in clear contrast to assignment is not required to be a linear function of the ( ) = ∑ ( ) Raussendorf’s result in the qubit case, as they allow for choice of measurement. Here, this simple connection be- the evaluation of non-linear functions with MBQCs that tween non-contextuality and linearity is lost. Neverthe- are non-contextual. It turns out that linearity is a special less, we now show how to use the above theorem for func- property of boolean functions which does not translate to tions on finite fields to build a new, general connection. the qudit case. B. Linearly Closed Subspaces IV. FINITE FIELDS AND LOCAL UNIVERSALITY We would like to characterise the space of all functions n of the form g Fd Fd in terms of non-trivial subspaces Given these conceptual differences between the qubit under linear pre- and post-processing, which we denote and qudit cases as illustrated by the examples in the pre- by l. First, define∶ Ð→ the space of linear functions as vious section, it will be helpful to take a more abstract n ⊂Fd Fd n view on the problem. We begin by reviewing some prop- Ln l Ωn l x c0 cjxj, x Fd , cj Fd , erties of functions on finite fields. j=1 ∶= { ∈ S ( ) = + Q ∈ ∈ } where x x1, . . . , xn . Then a schematic that represents the linear pre- and post-processing that we consider is A. Functions on Finite Fields n given in= Fig.( 2. Every) measurement outcome mk Fd n r Fd is a function from the inputs i Fd to measurement Let d be the finite field with d p (p prime and d F outcomes that decomposes into a linear function fk∶ LF→ Fd n r N) elements and Ωn Fd x1, . . . , xn the polynomial and a contribution φk Fd Fd, ∈ ring in n variables, x1, . . . , xn Fd. = ∈ ∈For infinite fields there∶= are many[ non-polynomial] func- mk φk ∶fk, → k 1, ,N . (19) tions, but not so for finite fields.∈ We refer to φks as= correlation○ ∀ functions.∈ { ⋯ } Theorem (Functions on finite fields). Let Fd be the finite Note first that the space of functions available after field with d elements, and n N. Then every function pre- and post-processing will at least contain the origi- n Fd g Fd Fd is given by a polynomial, g Ωn of partial nal function space, as the identity is a linear function. degree less or equal to d 1 in∈ each variable xi. Consider the two trivial cases: the space of all functions Fd Fd ∶ Ð→ ∈ Ωn ; and the space of linear functions Ln . Any linear Proof. See Appendix A. − combination of linear functions results again in a linear function, hence, we find LFd ΩFd . Here, the partial degree of a variable within a product n l n Aside from these two trivial cases, there also exist non- is the exponent of that variable. trivial spaces that are stable⊂ under linear pre- and post- For qubits, Raussendorf proved that computability of a processing. Define the following subspaces for 1 δ non-linear function using an l2-MBC implies strong con- n d 1 , using the notation l for linear span, textuality of the underlying system [1]. We note that ≤ ≤ n n a this result depends critically on the application of the ( − ) Fd j ⟨⋅⟩ Ωn δ xj aj Fd, aj δ . (20) l above theorem to d 2, where it states that all func- j=1 j=1 tions g Z2 Z2 are linear. In a non-contextual hidden ( ) ∶= b M U ∈ Q ≤ g Fd variable model, the measurement= outcomes mk are de- The function spaces Ωn δ depend on the field Fd, the termined∶ by→ a local value assignment that can depend number of inputs n and the maximal combined degree of ( ) 8

(a) C. Local Universality

LFd LFd n n 1 Fd i φk : Fd Fd mk i Fd Q In the qubit case, F2 Z2, every local output function ÝÑ p q P n mk Z2 Z2 is linear. Put another way, with any Fd = (b) given function φ Ω1 together with linear pre- and post- ∶ Ð→ n processing, we can realise arbitrary functions mk Z2 LFd LFd n N 2. We say (somewhat∈ trivially) that linear functions are φ1 : Fd Fd Z Fd Ln ÝÑ universal for local qubit value assignments. ∶ Ð→ φ2 : Fd Fd r ÝÑ For qudits (d p , p prime, r N and corresponding fi- nite field ), local measurement outcomes are still maps n . N Fd Fd i . o i k 1 αkmk i Fd Q . p q “ “ p q P of the form, φk =Fd Fd. However,∈ it is no longer true Fd Ln ř that all functions of this type are linear; any monomial φN 1 : Fd Fd Fd ´ of degree higher∶ thanÐ→ one is clearly not. Ln ÝÑ φN : Fd Fd ÝÑ Hence, whereas linear functions turned out to be uni- versal (in the sense of being able to evaluate any function FIG. 2. Schematic of functional signatures within the general φk Z2 Z2), this is not the case for higher dimensional correlation setup introduced by Anders and Browne [20]. (a) n systems where there can be more than two measurement In a non-contextual setting, local value assignments mk ∶ Fd → outcomes.∶ Ð→ Therefore, we define a new property capturing split into (classical) linear pre- and post-processing and Fd this universality for both cases. local (quantum) measurements φk. (b) The same holds for n N the output function o Fd Fd, o i k=1 αkmk i for ∶ → ( ) = ∑ ( ) Definition 3 (Local universality). A ld-MBC is called some αk ∈ Fd. Any additional complexity arises from the locally universal if it implements all functions φ (quantum) measurements φk ∶ Fd → Fd. Fd Fd Fd Ω1 . ∶ Ð→ monomials δ. (The combined degree within a product of Note∈ that the system size crucially enters this defini- variables is the sum of their respective exponents as in tion by means of the finite field Fd, where d denotes the Fd qudit dimension. Eq. (20).) In other words, Ωn δ contains all polynomi- n With this definition, we are now able to identify the als g Fd Fd of degree at most δ. We prove a lemma, detailing( ) the behaviour of these generalised connection between computational power and subspaces∶ Ð→ under linear pre- and post-processing. contextuality for qudit systems. In a non-contextual hid- den variable model, we again have local output functions n Fd m ; these are not required to be linear in Lemma 1. Let g Ωn be a polynomial of degree g k Fd Fd δ n d 1 , then the set of all polynomials generated by the qudit case. Nonetheless, as we now show, this does Fd not∶ allowÐ→ for the evaluation of any non-linear function. linear pre- and post-processing∈ coincides with Ωn δ ,S i.e.S = ≤ ( − ) For qubits, non-linear functions arose (by necessity) from Fd Fd Fd crossterms, i.e., terms with combined degree greater than L1 g Ln Ωn δ . ( ) 1, such as the term i1i2 in the NAND gate in the exam- Proof. We focus on the○ ○ space= of functions( ) generated by ple of Sec. II B. For qudits, local universality allows us Fd Fd linear pre-processing first. We find that g Ln l Ωn δ to implement some crossterms for finite fields with more as evaluating monomials xj on linear functions results than two elements; however, by Lem. 1 we find that we in polynomials of degree at most j. As the○ definition⊆ ( of) can only implement a strict subset within the space of all Eq. (20) already captures linear post-processing, we also polynomials, have Fd Fd Ωn δ Ωn δ 1, . . . , d 1 . Fd Fd Fd Fd Fd L1 g Ln l L1 Ωn δ Ωn δ . Local universality( ) is⊊ a restriction∀ ∈ { on the space− } of (global) n On the other○ hand○ we⊆ can○ always( ) choose= ( a linear) func- functions o Fd Fd, but a necessary requirement to j tion such that after evaluation on x the resulting polyno- maximise the computational power of correlations in φk j mial and x are linearly independent (by producing other Fd Fd. In∶ short,Ð→ locally universal models are in the Fd terms of less degree). Hence, taking linear combinations class Ωn d 1 and, ∶ we can generate all polynomials of degree at most j, Ð→ Fd Fd Fd Ωn δ( − Ω) n d 1 Ωn , δ 1, . . . , d 1 . Fd Fd Fd L1 g Ln l Ωn δ . The key( ) observation⊆ ( − ) is⊊ that for both∈ { qubits− and} qu- ○ ○ ⊇ ( ) dits non-contextual models are at most locally universal, slightly more general we have: We conclude that the subspaces closed under linear Fd pre- and post-processing are exactly Ωn δ for 1 δ Theorem 1. Consider a deterministic ld-MBC of prime Fd Fd r n d 1 , where Ωn 1 Ln . power dimension d p , p prime, r N. If the resource ( ) ≤ ≤ ( − ) ( ) = = ∈ 9 state is not strongly non-local then the output polynomial Proof. See Appendix B. has maximal degree bounded by d, i.e. Note that for general rings Zd and d odd, the function d o i ΩF d 1 . (21) ˜ Zd n n space Ωn g Zd Zd Zd x1, , xn contains non-polynomial functions. Nevertheless, the proof of Proof. The theorem is( a) direct∈ ( consequence− ) of Lem. 1 and Thm. 2 extends= { to∶ rings→ Zd }for⊋d odd,[ hence,] Cor. 1 the fact that the correlation functions φk are restricted remains true in those cases whenever the output function Fd to the class Ω1 δ . Here we use strong non-locality in is a polynomial. the sense of [25]. ( ) In Sec. III B 1, we proved that using Pauli unitaries Note that Thm. 1 is independent of the particular for classical control is not powerful enough to yield non- physical implementation of these function evaluations. linear functions, yet within the full stabilizer subtheory of In the next section we will look at the particular case of Clifford unitaries the MBQCs allow for non-linear output ld-MBQC. functions. Thm. 2 shows that Clifford unitaries already generate all non-linear functions, φ Zd Zd, in par- ticular, the bound in Cor. 1 is tight. Note also that the function space∶ accessibleÐ→ using V. NON-LOCALITY IN MBQC Zd the stabilizer subtheory contains at least Ωn d 1 by Thm. 2. On the other hand the existence of a non- In this section we connect these results with ld-MBQC negative discrete Wigner function restricts the( stabilizer− ) as outlined in Def. 2. We have the immediate corollary subtheory to local universality. of Thm. 1. Corollary 2. The stabilizer subtheory in ld-MBQC with Corollary 1. Let M be a ld-MBQC for d prime, which n d prime is strictly bounded by local universality, i.e. its deterministically evaluates a function o Zd Zd. If computation class is ΩZd d 1 . o i (when written as a polynomial) involves at least one n term of the form n xaj , s.t. n a ∶ d,Ð→ then M is j=1 j j=1 j Proof. The discrete Wigner( − function) provides a non- strongly( ) contextual, and specifically strongly non-local. contextual description for any implementation of the sta- ∏ ∑ ≥ bilizer subtheory [21]. Hence, such implementations are We note that Cor. 1 was first reported in Ref. [23]. not strongly contextual. Yet any implementation evalu- In order to see how tight this bound is, we check Zd ating a function o i Ωn d 1 is strongly contextual whether general ld-MBQC instances, and specifically by Cor. 1. non-contextual ones, satisfy local universality. For ( ) ∉ ( − ) qubits, this is trivially the case. In this section, we prove In particular, we cannot harness any computational that local universality rather than linearity also gener- power from non-local correlations using only stabilizer alises to ld-MBQCs on qudits of prime dimension. states. 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 Up until now we have focussed on deterministic prime number, is in fact a field, but not all finite MBQCs. We note however, in analogy to the qubit case, Zd Cor. 1 extends to a probabilistic version for success prob- fields arise this way. Thm. 1 holds for all finite fields Fd, i.e., also fields of order a prime power d pr. However, abilities within a finite interval around pS 1. We pro- whenever r 2, as the latter is a ring but not vide the details of this generalisation in Appendix C. Fd Zd = a field. Functions on unital, commutative= rings are not polynomials≅~ in general.≥ For these reasons, we will restrict B. Scaling under Composition to fields Zp in this section, but we note that our results allow for partial inferences in the case of rings Zd with d odd as well. At the core of the framework of ld-MBC is the identi- fication of locally-measureable systems, and the power of correlations between these systems. Within this A. Local Universality in MBQC framework, we make a distinction between contextual- ity ‘within’ a local system and the non-locality between We show that functions arising from ld-MBQCs with them. So far we have shown how non-locality leads to single-qudit Clifford unitaries as the classical control op- correlations that can be used as a resource for compu- erations are locally universal. In fact, this is true even tational power. To further illustrate this connection, we under the restriction to stabilizer states. consider (somewhat reversely) how computational power constrains the composition of systems. To this end we Theorem 2. The stabilizer subtheory in ld-MBQC with assume a locally universal ld-MBC with finite field Fd, d prime is locally universal. rather than restricting to Zd in ld-MBQC. 10

From the results on linearly invariant subspaces in as Bell-like constraints on correlations for which commu- Sec. IV, we know that any restriction on functional com- nication is naturally excluded. putability lies in the maximal degree of the function’s In fact, if we allowed for temporal ordering, we would monomials. Under the constraint of locality, functions have access to recursive function calls. It is straightfor- can be computed locally only and combined after, lead- ward to show that a classification of function spaces un- Fd ing to Ωn d 1 in Thm. 1. However, when taken as der iterative function calls with linear processing only has Fd a single system the individual systems can be combined two stable subspaces, the entire space Ωn and the space Fd first and functions( − ) computed after. Now assume we are of linear functions Ln . This is why temporal ordering given a device that allows us to perform non-local (cor- can be allowed in the qubit case. On the other hand, it related) measurements and thus to combine systems first means that any non-linear function φ Fd Fd elevates Fd before computing. It is clear that with such a device we the control computer to arbitrary functions in Ωn under n can again implement arbitrary functions g Fd Fd. linear processing. ∶ Ð→ Given these preliminary considerations, we consider the In particular, we can obtain an upper bound on the two scenarios in which dimensions of subsystems,∶ Ð→ i.e. the polynomial degree for non-contextual ld-MBQCs even in number of different local outcomes (cf. Zl in Sec. II), were the temporally ordered case, but it will be larger in gen- to combine additively vs multiplicatively under composi- eral. We first define a directed graph that contains all tion. of the information of the temporal ordering. Namely, we Take a composite system of dimension d pr, p have a vertex for each party (qudit), andG an edge when- prime, r N. Any decomposition into subsystems d ever the choice of measurement on one party depends on M l allows for a hypothetical input space= of size m=1 m the measurement result of another. For the computation D M ∈ l d, in general. For instance, consider= a to be executable, we require that there are no cycles in m=1 m ∑ d−1 the graph. As such, the graph for the temporally flat maximal decomposition into 2 subsystems of size 2 and= one∏ of size≠ 3. Applying our (hypothetical) corre- case contains no edges. lation device we combine subsystems and find an input To find an upper bound on the degree of a computed d−1 space of size D 3 2 2  d, clearly larger than the polynomial in a non-contextual ld-MBQC, we find the FD Fd longest (directed) path l in the graph . Let the number original space. Evidently, Ωn Ωn , we conclude that under additive composition∶= ⋅ of systems there would be a of vertices in this path be denoted l . Then by composing difference in viewing the system≠ as composite or as sum a degree d 1 polynomial l times, we obtainG a polynomial of its parts. On the contrary, if we assume that physi- of degree d 1 SlS. Whenever an ldS S-MBQC is evaluating cal subsystems combine multiplicatively with respect to a function− that is a polynomialS S with degree greater than their dimensions, we find upon otherwise similar reason- d 1 SlS,( we− have) a proof of strong contextuality. Thus ing, D pr d which exactly reproduces the full space with temporal ordering, it is more difficult to find proofs n (of strong− ) contextuality within the setting of ld-MBQC. of functions g Fd Fd as required. Hence,∶= under= the constraint that function spaces cor- responding to∶ a systemÐ→ are the same whether viewed as composite or in terms of its subsystems, we find that VI. DISCUSSION system dimensions need to scale multiplicatively. The tensor product is multiplicative in the dimension of the In summary, we have placed a bound on the space respective Hilbert spaces, quantum systems thus fit into of output functions of general MBQCs if the underlying the above argument. However, note that we have not system is non-contextual. This generalises Raussendorf’s assumed Hilbert spaces or any other related structures. result [1] for qubits. Nontrivial MBQCs on qudits do not The same argument therefore applies to all correlated directly make use of (local) contextuality (in quantum systems independent of their physical implementation systems of dimension at least three), but instead harness under local universality. a type of global contextuality, namely strong non-locality. In fact, Thm. 1 can be understood as a deterministic version of Bell’s Theorem restricted to MBQC: assuming C. Temporal Ordering local hidden variables, mk x , and local (single qudit) Fd measurements, Ωn d 1 is already maximal. In this paper we have restricted the discussion to tem- Our results highlight strong( ) non-locality as the crucial porally flat MBQCs. That is, the measurement settings ingredient to Thm.( 1,− and) show how non-local correla- for the kth qudit depend only on the input i to the con- tions between spatially separated subsystems can boost trol computer and not previous measurement outcomes the computational power of the classical control com- from qudits k′ k. Temporal flatness turns out to be puter. a crucial requirement, as we have seen that non-locality We conclude with a number of directions for further is the key resource< behind computational speed-up. Al- research in this area. lowing temporal ordering means to allow for (one-way) A key open question is whether our results (specifi- communication between the locally separated qudit sites. cally, Cor. 1) generalise to qudits with arbitrary non- The constraints in Thm. 1 and Cor. 1 can be understood prime-power dimensions. Most of our proofs rely on the 11 theorem regarding polynomials in finite fields, which says degree lower than d 1. that all functions over finite fields are polynomials. How- Contextuality has recently been related to cohomol- ever, this result no longer holds true if d pr for p prime ogy [7, 8, 30, 31, 33].− It would be a worthwhile goal and r N, and so a generalisation would need to consider to pursue such classifications further and bring them in more general functions. ≠ contact with our result on computational complexity. It We∈ have seen that the standard framework for MBQC would be interesting to understand the relationship be- in quantum theory is locally universal, and due to non- tween polynomial degree in our setting, and the non- local correlations they can even compute functions out- triviality of a certain cocycle within the cohomological Fd side of Ωn d 1 . However, it is not clear whether local frameworks of Refs. [7, 8]. Fd universality allows us to compute all functions in Ωn . It remains( to− determine) if MBQCs of this form in quan- tum theory can saturate the space of functions (perhaps ACKNOWLEDGMENTS focussing on prime power dimensions). A more detailed analysis of the connections between the computational We thank Robert Spekkens and Joel Wallman for dis- results and multi-party Bell inequalities as derived in cussions. This work is supported by the Australian Re- Ref. [23] provides a natural starting point. search Council (ARC) via the Centre of Excellence in We focussed on generalised Pauli-like measurements Engineered Quantum Systems (EQuS) project number with Clifford control unitaries as our framework, as this CE170100009 and through a studentship in the Centre is standard for quantum computation, and showed that for Doctoral Training on Controlled Quantum Dynam- it is locally universal. With a different choice of control ics at Imperial College London funded by the EPSRC. unitaries, it might be possible to exclude local universal- SR also acknowledges support from the Australian Insti- ity. In this case, one may be able to obtain a proof of tute for Nanoscale Science and Technology Postgraduate contextuality with the computation of polynomial with Scholarship (John Makepeace Bennett Gift).

[1] R. Raussendorf, “Contextuality in measurement-based e-prints (2017), arXiv:1711.08676 [quant-ph]. quantum computation,” Physical Review A 88, 022322 [11] S. Mansfield and E. Kashefi, “Quantum advantage from (2013), arXiv preprint arXiv:0907.5449. sequential transformation contextuality,” ArXiv e-prints [2] M. Howard, J. Wallman, V. Veitch, and J. Emerson, (2018), arXiv:1801.08150 [quant-ph]. “Contextuality supplies the magic for quantum compu- [12] Nadish de Silva, “Logical para- tation,” Nature 510, 351 (2014). doxes in quantum computation,” in [3] J. Bermejo-Vega, N. Delfosse, D. E. Browne, C. Okay, Proceedings of the 33rd Annual ACM/IEEE Symposium and R. Raussendorf, “Contextuality as a resource for on Logic in Computer Science (ACM, 2018) pp. 335– models of quantum computation with qubits,” Physical 343. Review Letters 119, 120505 (2017). [13] Ernesto F. Galv˜ao,“Discrete wigner functions and quan- [4] N. Delfosse, P.-A. Guerin, J. Bian, and R. Raussendorf, tum computational speedup,” Phys. Rev. A 71, 042302 “Wigner function negativity and contextuality in quan- (2005). tum computation on rebits,” Physical Review X 5, [14] Hakop Pashayan, Joel J. Wallman, and Stephen D. 021003 (2015). Bartlett, “Estimating outcome probabilities of quantum [5] R. Raussendorf, D. E. Browne, N. Delfosse, C. Okay, and circuits using quasiprobabilities,” Phys. Rev. Lett. 115, J. Bermejo-Vega, “Contextuality and wigner-function 070501 (2015). negativity in qubit quantum computation,” Physical Re- [15] S. Kochen and E. P. Specker, “The problem of hidden view A 95, 052334 (2017). variables in quantum mechanics,” Journal of Mathemat- [6] A. Karanjai, J. J. Wallman, and S. D. Bartlett, “Con- ics and Mechanics 17, 59–87 (1967). textuality bounds the efficiency of classical simulation [16] N. D. Mermin, “Simple unified form for the major no- of quantum processes,” arXiv preprint arXiv:1802.07744 hidden-variables theorems,” Physical Review Letters 65, (2018). 3373 (1990). [7] R. Raussendorf, “Cohomological framework for con- [17] N. David Mermin, “Hidden variables and the two theo- textual quantum computations,” arXiv preprint rems of John Bell,” Reviews of Modern Physics 65, 803 arXiv:1602.04155 (2016). (1993). [8] C. Okay, S. Roberts, S. D. Bartlett, and R. Raussendorf, [18] A. Peres, “Two simple proofs of the Kochen-Specker the- “Topological proofs of contextuality in quantum mechan- orem,” Journal of Physics A: Mathematical and General ics,” Quantum Information & Computation 17, 1135– 24, L175 (1991). 1166 (2017). [19] R. Raussendorf, D. E. Browne, and H. J. Briegel, [9] V. Veitch, S. A. H. Mousavian, D. Gottesman, and “Measurement-based quantum computation on cluster J. Emerson, “The resource theory of stabilizer quantum states,” Physical Review A 68, 022312 (2003), quant- computation,” New Journal of Physics 16, 013009 (2014). ph/0301052. [10] L. Catani and D. Browne, “State-injection schemes of [20] J. Anders and D. E. Browne, “Computational power quantum computation in Spekkens’ toy theory,” ArXiv of correlations,” Physical Review Letters 102, 050502 12

(2009), arXiv:0805.1002 [quant-ph]. Appendix A: Proof of Theorem on Functions on [21] D. Gross, “Hudson’s theorem for finite-dimensional quan- Finite Fields tum systems,” Journal of Mathematical Physics 47, 122107–122107 (2006), quant-ph/0602001. Let g n . We first show how to obtain the δ- [22] V. Veitch, C. Ferrie, D. Gross, and J. Emerson, “Nega- Fd Fd function from a polynomial with partial degree less than tive quasi-probability as a resource for quantum compu- n tation,” New Journal of Physics 14, 113011 (2012). or equal∶ to d→ 1. For any y Fd consider the delta [23] M. Hoban, J. Wallman, and D. E. Browne, “Generalized function defined as Bell-inequality experiments and computation,” Physical − ∈ 1 if x y Review A 84, 062107 (2011). δ x y (A1) [24] D. L. Zhou, B. Zeng, Z. Xu, and C. P. Sun, “Quantum 0 otherwise. computation based on d-level cluster state,” Physical Re- = ( − ) = œ view A 68, 062303 (2003). Then it holds that [25] S. Abramsky and A. Brandenburger, “The sheaf- n theoretic structure of non-locality and contextuality,” d−1 New Journal of Physics 13, 113036 (2011). δ x y 1 xi yi , (A2) i 1 [26] S. Abramsky, R. S. Barbosa, G. Car`u, and S. Perdrix, = ( − ) = M( − ( − ) ) “A complete characterization of all-versus-nothing argu- which follows from Fermat’s little theorem for d prime ments for stabilizer states,” Philisophical Transactions of and for general finite fields as every element in the mul- the Royal Society A 375, 20160385 (2017). × tiplicative group Fd has order a divisor of d 1. We can [27] P. Lillystone, J. J. Wallman, and J. Emerson, “Con- n textuality and single-qubit stabilizer formalism,” arXiv express any function g Fd Fd as a linear combination preprint arXiv:1802.06121 (2018). of delta functions, − [28] N. De Beaudrap, “A linearized stabilizer formalism for ∶ → systems of finite dimension,” Quantum Information & g x δ x y φ y . (A3) y n Computation 13, 73–115 (2013). ∈Fd [29] Samson Abramsky, Rui Soares Barbosa, and Shane ( ) = Q ( − ) ( ) Mansfield, “Contextual fraction as a measure of contex- which along with Eq. (A2), completes the proof. tuality,” Phys. Rev. Lett. 119, 050504 (2017). [30] C. Okay, E. Tyhurst, and R. Raussendorf, “The coho- mological and the resource-theoretic perspective on quan- Appendix B: Proof of Theorem 2 tum contextuality: common ground through the contex- tual fraction,” ArXiv e-prints (2018), arXiv:1806.04657 Proof of Thm. 2. Lem. 1 says a polynomial φ of degree [quant-ph]. φ l generates all functions of less or equal degree via [31] G. Caru, “Towards a complete cohomology invariant for non-locality and contextuality,” ArXiv e-prints (2018), linear pre- and post-processing. The higher its degree arXiv:1807.04203 [quant-ph]. theS S = more valuable a function becomes when viewed as [32] Samson Abramsky and Adam Brandenburger, “The a resource for computational tasks under the scheme in sheaf-theoretic structure of non-locality and contextual- Fig. 2. It is thus sufficient to show that we can imple- ity,” New Journal of Physics 13, 113036 (2011). ment a function of highest degree within the limits of [33] Samson Abramsky, Shane Mansfield, and ld-MBQC. Here we will make use of the Clifford control Rui Soares Barbosa, “The cohomol- unitary explored in the example of Sec. III B 3. ogy of non-locality and contextuality,” in Instead of proving the existence of a function of degree Proceedings 8th International Workshop on Quantum p 1, p prime we take a slightly different route and con- Physics and Logic, Nijmegen, Netherlands, October sider the δ x -function over the finite field . It is clear 27-29, 2011, Electronic Proceedings in Theoretical Zp − Computer Science, Vol. 95, edited by Bart Jacobs, Peter Selinger, and Bas Spitters (Open Publishing ( ) 0 1 ⋯ p − 1 Association, 2012) pp. 1–14. δ(x) 1 0 ⋯ 0

that with δ x as a resource we can generate in particu- lar any polynomial m Zp x via linear combinations of the form, ( ) ∈ [ ] p−1 m x mjδ x j , j=0 ( ) = Q ( − ) where mj Zp are constants specific to m. In all finite fields the sum of elements within a sub- × group of the∈ multiplicative group Fd vanishes as, S g g h g′ hS. − ′ g∈G h 1g∈G g ∈G ∶= Q = Q = Q = 13

Observe, that the exponential function ux maps the ad- In the latter case we can improve the number of qu- × ditive group Zp into its multiplicative group Zp . We as- dits needed to implement the δ-function and generalise × x sume u to be a primitive element of Zp , then u is surjec- to qudits of arbitrary odd dimension d. Note that in any x × tive and we obtain non-trivial subgroups u Zp , for ring of integers modulo d, all x 0, p 1. One computes, ⟨ ⟩ ⊆ a2 1 mod d a 1 a 1 0 mod d, x p−1 × S⟨u ⟩S−1 ≠x k − Zp x k u u has solutions a 1. We can use this to construct, ux = ⇐⇒ ( − )( + ) = k=1 S S k=0 Q( ) = p 1 Q ( ) p 1 if x 0, p 1, =1± 1 if x 0 S⟨ ⟩S g (B1) δ x d 1 kx x u g ux ⎧0 otherwise, 2 k 1 ⎧0 otherwise − ∈⟨ ⟩ ⎪ − = − =± ⎪ = = Q = ⎨ ( ) = Q ( − ) = ⎨ as the sum eitherS⟨ ⟩S runs over all⎪ non-zero group elements ⎪ ⎩⎪ and thus arbitrary functions m Z⎩⎪d Zd, x × in Zp in case u is a primitive of Zp , or over the subgroup ux × for x 0, p 1. p−1 1 ∶ Ð→ Zp k(x−j) As shown in the example of Sec. III B 3, we can obtain m x mj d 1 , j 0 2 k 1 ⟨this⟩ exponential⊆ ≠ function− using the symplectic Clifford = =± ( ) = Q Œ Q ( − ) ‘ unitary Mu of Eq. (16). Using Eq. (B1) and the expo- using the Clifford unitary Md−1 on 2p qudits under lin- nential function constructed in Eq. (17) with linear pre- ear pre- and post-processing (without temporal order- and post-processing on p 1 qudits we implement the ing). function, − p−1 1 if x 0, p 1, −1 x l Appendix C: The Probabilistic Case σp x p 1 u (B2) l 1 ⎧0 otherwise. = ⎪ = − ( ) ∶= ( − ) Q ( ) = ⎨ Cor. 1 holds in the deterministic case only, however, For p 5 and r 2, the exponentials⎪ and their sum in ⎩⎪ the result remains valid at least in a small neighbourhood Eq. (B2) are explicitly given in the table below around the success probability pS 1, where = = x 0 1 2 3 4 p min Prob τ i o i , S n = i∈Z 2x 1 2 4 3 1 d 2x ∶= ( ( ) = ( )) 2 1 4 1 4 1 τ i the factual result of a computation with input string 3x n 2 1 3 4 2 1 i Zd . This is an immediate generalisation of the analo- 24x 1 1 1 1 1 gous( ) result for qubits in [1], with some slight adjustments. First,∈ we define ∆ as follows, σ5(x) 1 0 0 0 1

∆ Zd Z (d−1) Finally, we use another linear operation to recover δ x 2 from σ x , p ∶ Ð→q if q q ( ) ∆ q . ( ) p 1 p−1 ⎧ q if q q δ x 1 1 σ kx . (B3) ⎪ < − 2 p ( ) ∶= ⎨ k=1 ⎪− > − n − Next, we define the distance⎩⎪ ν of a function o Zd Zd ( ) = + ( + Q ( )) to the closest polynomial function in ΩZd d 1 , In summary, we construct any function m Zp Zp n using the Clifford unitary M on p p 1 2 qudits under ∶ → u ν o min ∆ o i p i , (C1) linear pre- and post-processing (without temporal∶ Ð→ order- ( − ) p ΩZd d 1 i n ing), ( − ) ∈ n ( − ) ∈Zd ( ) ∶= Q ( ( ) − ( )) where the minimum is taken over all polynomial func- p−1 p 1 p−1 p−1 m x m 1 1 p 1 −1 ulk(x−j) tions of degree at most d 1. Generalising the qubit case j 2 j=0 k=1 l=1 [1] we observe strong non-locality for, − − ( ) = Q1 p−1 Œ + p−1 pŒ−1+ Q Œ( − ) Q ‘‘‘ lk(x−j) 1 2ν o mj 1 u . p 1 . (C2) 2 S n j=0 k=1 l=1 d d 1 ( ) = Q Œ + Q Q ‘ > − In [29] the authors derive a( stronger− ) result based on Note that the proof holds for general finite fields as the average success probability, long as we can implement the exponential function, yet 1 Eq. (17) relies on the explicit ld-MBQC implementation p¯ Prob τ i o i . S n d n and constrains to Zp for p prime. i∈Zd ∶= Q ( ( ) = ( )) 14

Decomposing the empirical model e (a set of probabil- linear functions were considered. The analogous deriva- ity distributions for outcomes and experiments corre- tion holds under the appropriate change in Eq. (C1). sponding to different contexts, cf. [32]) underlying the Note that the success probability depends on the non- ld-MBQC into a non-contextual and strongly contextual contextual fraction NFC e , which measures the amount part, of non-contextuality inherent in the probabilistic case. On the other hand it also( ) depends on ν o , the minimal e NCF e eNC CF e eSC, distance of the output function to a function realisable in the non-contextual case. We could thus( achieve) a better where NCF e = 0, 1 ,( CF) e + 1 (NCF) e , the average success probability if we restricted to functions that all probability of failure,p ¯F 1 p¯S, satisfies the relation, have a certain minimal distance from the set of possible ( ) ∈ [ ] ( ) = − ( ) output functions. However, as the space of output func- p¯F NFC= −e ν o . Zd tions under non-contextuality, Ωn p 1 , is non-linear, we cannot use bent functions as in the qubit case. A violation of this inequality yields a proof of non-locality ≥ ( ) ( ) ( − ) and thus generalises the result achieved in [29] where only