The power of qutrits for non-adaptive measurement-based quantum computing

Non-locality is not only one of the most prominent quantum features but can also serve as a resource for various information-theoretical tasks. Analysing it from an information-theoretical perspective has linked it to applications such as non-adaptive measurement-based quantum computing (NMQC). In this type of quantum computing the goal is to output a multivariate function. The success of such a computation can be related to the violation of a generalised Bell inequality. So far, the investigation of binary NMQC with qubits has shown that quantum correlations can compute all Boolean functions using at most $2^n-1$ qubits, whereas local hidden variables (LHVs) are restricted to linear functions. Here, we extend these results to NMQC with qutrits and prove that quantum correlations enable the computation of all ternary functions using the generalised qutrit Greenberger-Horne-Zeilinger (GHZ) state as a resource and at most $3^n-1$ qutrits. This yields a corresponding generalised GHZ type paradox for any ternary function that LHVs cannot compute. We give an example for an $n$-variate function that can be computed with only $n+1$ qutrits, which leads to convenient generalised qutrit Bell inequalities whose quantum bound is maximal. Finally, we prove that not all functions can be computed efficiently with qutrit NMQC by presenting a counterexample.


INTRODUCTION
Measurement-based quantum computing uses adaptive single-qubit measurements on highly entangled resource states, together with feedforward, to implement universal quantum computing [1]. Achieving this adaptivity experimentally requires fast switching of measurement bases, which is technically very challenging.
However, even a reduced measurement-based model without adaptivity-non-adaptive measurement-based quantum computing (NMQC)-allows universal classical computing [2,3]. Beyond that, NMQC opens up new avenues for studying fundamental questions in quantum physics, in particular, non-locality [4]. One can show that quantum correlations have an advantage over local hidden variables (LHVs) in the computation of classical functions, and the success probability of computing a function correctly has been linked to the violation of a generalised Bell inequality [3]. The fact that in NMQC the distinct measurement sites do not communicate enables a space-like separation, which is needed for loophole-free Bell test experiments.
So far, NMQC has primarily been discussed in the context of computing Boolean functions and qubit resource states. Though few generalisations to higher-dimensional functions have been considered, the discussion mostly revolved around the limitations of LHVs [5,6]. The full power of quantum correlations of higher-dimensional systems, qudits, has remained largely unexplored.
In this work, we investigate the power of qutrits and their quantum correlations in the framework of NMQC. To distinguish NMQC with qutrits from its qubit analogue, we will use the term 3-NMQC in contrast to 2-NMQC for qubits.
We study the generalised l-qutrit GHZ state as a resource state for 3-NMQC and show that it enables the computation of all ternary functions f : {0, 1, 2} n → {0, 1, 2} using at most l = 3 n − 1 qutrits. In particular, any such ternary function induces a generalised qutrit Bell inequality for which the quantum violation is maximal. To show the power of 3-NMQC we give an example for a family of n-variate functions whose computation requires only n + 1 qutrits. Furthermore, we prove that despite enabling the computation of all ternary functions, it is not possible to compute all of them efficiently with the qutrit GHZ state. Our work paves the way arXiv:2203.12411v1 [quant-ph] 23 Mar 2022 for measurement-based quantum computing with qudits that may have an advantage with regard to scalability and information encoding compared to their qubit counterparts.

II. NMQC
We will first give an introduction into NMQC and its relation to Bell inequalities by summarising the most relevant results and literature.

A. General NMQC
We start by introducing the concept of NMQC for pdimensional quantum systems and p-valued logic, p being prime. The goal is to compute a function f : F n p → F p . F p ≡ ({0, 1, . . . , p − 1}, ⊕, ·) is the finite field of order p consisting of the set {0, 1, . . . , p − 1} equipped with addition and multiplication mod p, denoted by ⊕ and ·. F n p = ({0, 1, . . . , p − 1} n , ⊕, ·)) denotes the n-dimensional coordinate vector space over F p . For the remainder of our work, p will either be equal to two, meaning the procedure uses qubits and binary logic, or equal to three, meaning qutrits and ternary logic. The procedure goes as follows (see also This restricted computer now pre-processes an ndimensional p-valued input vector x ∈ F n p and turns it into an l-dimensional p-valued output vector s (∈ F l p ). This pre-processing procedure can be seen as a matrix-vector multiplication: where P is an l-by-n matrix with elements in F p and the ⊕ in the index denotes that the matrixvector product is evaluated with respect to F p [5].

Measurement settings:
The elements of s (s 0 , ..., s l−1 ) now determine the settings for measurements on a computational resource state. This resource state has l qu-p-it subsystems, e.g. l qubits or qutrits.
For each subsystem, we have a set of p measurement operatorsm i , e.g. two different operators for qubit systems and three for qutrit systems. The number of measurement outcomes per measurement operator is also p, meaning qubit measurements have two possible outcomes and qutrit measurements have three possible outcomes.
6. Verification: The computation (for a given input vector x) is successful if f (x) = z. We say that an NMQC scheme is deterministic if it outputs z = f (x) for every x.

B. 2-NMQC
For 2-NMQC it has been shown that if the measurement statistics are described by LHVs [29], the output z is restricted to linear functions, i.e. functions that can be written as follows: The pre-processing computer is already capable of outputting linear functions, i.e. functions that can be writ- The additional bit c can be added in post-processing. This means that LHVs do not "boost" the pre-processor in any way [3]. Note that, we use the term linear for functions of the form Non-local quantum correlations, however, can enhance the pre-processor to classical universality. Using the generalised l-qubit GHZ state one can compute all functions f : F n 2 → F 2 with at most l = 2 n − 1 qubits. The computation of a non-linear function-one that cannot be written as in Eqn. (5)thus requires non-locality and can be seen as a type of GHZ paradox [3].
One can show that the n-bit pairwise AND function can be computed efficiently with only l = n + 1 qubits prepared in the state given by Eqn. (6) [3]. In contrast, the computation of the n-tuple AND function demands at least 2 n − 1 qubits [3]. Therefore, not every Boolean function can be efficiently computed with 2-NMQC. Note that the pairwise AND function given by Eqn. (7) is invariant with respect to coordinate permutation. The n-tuple AND function given by Eqn. (8) only outputs 1 if all input bits are 1 and outputs 0 in all other cases. We will use these two observations for our own results in section VI.

C. 2-NMQC and Bell inequalities
The success of a 2-NMQC computation is closely related to the violation of a Bell inequality. In particular, every Boolean function f : F n 2 → F 2 induces a 2-NMQC game. Further, each game is defined by a sampling probability distribution w(x) and a pre-processing P . The average success probability of such a game is bounded by a Bell inequality.
In each round of the game, an input x ∈ F n 2 is sampled with respect to w(x) before the entire NMQC procedure from above is performed. If the output z = f (x), the round is won. The pre-processing and the resource state must thus be chosen, so that the total average success probability is maximised. This average success probabilityp S is defined by [3]: where p(z = f (x)|s = (P x) ⊕ ) is the probability that z is equal to f (x) given that the measurement settings are s = (P x) ⊕ .
It can be shown thatp S is related to the bound u of a Bell inequality in terms of expectation values [3]: The inequality (11) is a normalised Bell inequality with a classical (LHV) bound c and a quantum bound q. The expectation values are defined to be: where p(z = 0|s) is the probability that z is equal to 0 and p(z = 1|s) is the probability that z is equal to 1 given the measurement settings were determined by s. Note that deterministic NMQC for an n-variate function corresponds to a probabilistic NMQC game where w(x) = 1/2 n with the quantum average success probabilityp q S = 1, and thus q = 1. Eqn. (11) is an element of the complete set of n-variate Bell inequalities with two possible measurement settings and two possible measurement results per site, called (n, 2, 2) Bell inequalities. As the term (−1) f (x) w(x) can realise any real number between -1 and 1, the entire set of (normalised) (n, 2, 2) Bell inequalities can be found through probabilistic 2-NMQC games [3]. The GHZ state always maximally violates the (n, 2, 2) Bell inequalities and minimises the number of required qubits for a violation [30,31]. It is thus also optimal for both probabilistic and deterministic 2-NMQC [3].
LHVs in 3-NMQC are slightly boosted by the preprocessor [5]. Before the pre-processing, they are capable of computing functions f : F n 3 → F 3 that can be written as: where c (j) i ∈ F 3 are coefficients and c ∈ F 3 is an offset. After the pre-processing, LHVs can compute all polynomials up to a degree of 2 [5,6], meaning that they are slightly elevated by the pre-processing. Nevertheless, they are still incapable of computing all functions, as the maximum degree of an n-variable function over F 3 is n·2. For example, LHVs cannot compute f (x) = x 2 0 x 1 . The computation of polynomials of a higher degree is a demonstration of non-locality [5], or more specifically strong non-locality [6], following the definition of strong contextuality and non-locality in [37]. The differences between 2-NMQC and 3-NMQC are compared in Fig. 1. In both cases, an input vector x with n elements is sent to the pre-processor. For 2-NMQC, these elements are bits (elements of {0, 1}) whereas for 3-NMQC, these elements are trits (elements of {0, 1, 2}). The pre-processor takes this n-entry vector and transforms it into another l-entry vector, called s, via s = (P x)⊕. Note that the pre-processor operates with bits using mod 2 addition in 2-NMQC, while it operates with trits using mod 3 addition in 3-NMQC. The vector s now contains information about the measurement settings on the computational resource, either consisting of qubits or qutrits. The respective measurements at the l measurement sites of the correlated resource are carried out and the measurement results are mapped to the values mi. These values mi are summarized in the vector m, which is sent back to the pre-processor. The pre-processor then computes the sum over all mi, called z, which is supposed to be equal to f (x), either a Boolean function for 2-NMQC or a ternary function for 3-NMQC.

E. 3-NMQC and qutrit Bell inequalities
Similar to 2-NMQC, there is a corresponding probabilistic 3-NMQC game for a given pre-processing P and a given function, where in every round, an input x ∈ F n 3 is sampled with respect to a sampling distribution w(x). Its average success probabilityp S is analogously defined to the success probability of the probabilistic 2-NMQC game in Eqn. (9): p S can be related to a generalised Bell inequality via the discrete Fourier transform [5]: where E M (z|s) is defined as: The right hand side of Eqn. (15) is a normalised sum over expectation values and can thus be seen as a generalised qutrit Bell inequality. Note that if f (x) = z ∀x, then the inner sum in Eqn. (15) will always be: resulting in a success probabilityp S of 1.
As is the case for qubits, the probabilistic 3-NMQC game can be interpreted as a way to demonstrate non-locality. The LHV success probabilityp c S is limited by the LHV bound of the generalised Bell inequality on the right hand side of Eqn. (15). A success probability that is larger thanp c S requires the violation of such a generalised Bell inequality and thus non-locality.

III. SIMPLIFIED BELL INEQUALITIES FOR 3-NMQC
Having covered the necessary background, we continue with our own derivations. We start by simplifying the qutrit Bell inequalities and rewrite Eqn. (15): where we have defined u 3 as the normalised sum over x and M in Eqn. (19). As before, c and q are the LHV and the quantum bound of u 3 . We can now interpret u 3 as a generalised Bell inequality bounded by c for LHV and q for quantum correlations: In Eqn. (19) the sum runs from M = 1 to 2, requiring the measurement of 3 n × 2 expectation values for an nvariate function. However, one can reduce this number of expectation values to be evaluated by exploiting the fact that Re e = −1/2, leading to an alternative generalised Bell inequality: which is related top S via (see Appendix A): Eqn. (22) requires only 3 n expectation values E(z|s) in contrast to twice as many in Eqn. (15). In the following, we base our derivations on the version of the generalised Bell inequality given by Eqn. (22).
Note that the deterministic computation of a function f : F n 3 → F 3 with qutrits corresponds to a probabilistic 3-NMQC game with a uniform sampling distribution w(x) = 1/3 n where q = 1.

IV. QUANTUM CORRELATIONS ELEVATE A TERNARY RESTRICTED COMPUTER TO CLASSICAL UNIVERSALITY
We now show that quantum correlations are capable of computing all ternary functions in 3-NMQC, as summarised in the following Theorem: Theorem 1. One can deterministically compute all nvariate functions over F 3 with 3-NMQC and l qutrits using the generalised l-qutrit GHZ state |GHZ qutrit , where l is at most 3 n − 1.
It follows directly from Eqn. (23) that any function f : F n 3 → F 3 induces a qutrit Bell inequality for which quantum correlations reach the maximum possible bound q = 1. One can additionally conclude that for any ternary function that LHVs cannot compute, one can find an appropriate 3-NMQC procedure which can be seen as a generalised GHZ paradox.
In the rest of this section, we sketch the main idea of the proof of Theorem 1. The full proof can be found in Appendix B.

A. Main idea behind the proof of Theorem 1
Due to the definition of 3-NMQC, we require unitary observables with eigenvalues in Ω.
We choose the generalised qutrit GHZ state from Eqn. (1) as a resource and rotated generalised qutrit X operators as measurement operators, similar to the qubit case in [3]. The generalised X and Z operators for 3dimensional quantum systems are given by the operator X that acts the following way on a qutrit in the state |n (in the computational basis {|0 , |1 , |2 }) [38]: and a Z operator that acts the following way on a qutrit in the state |n [38]: The eigenvalues of both X and Z are Ω = {1, ω, ω 2 } and the eigenstates of Z are the computational basis states.
We can now define a rotated X operator, leading to the measurement operatorm i corresponding to the ith element of s: where α = ω 1 3 [34,39]. The φ i are real numbers that have yet to be specified. For every s i , the eigenvalues of m i (s i ) are the elements of Ω. Note that for s i = 0,m i is equal to X, in analogy to 2-NMQC.
As defined above, the measurement results M i are mapped to the values m i via ω mi = M i . As a result, if the tensor product . The input is pre-processed using the instructions from Proposition 1. Then, the three-qutrit GHZ state (symbolised using graph notation) is measured with respect to the resulting measurement operatorsmi(si) determined by Eqn. (34). The exponent in the measurement result's expectation value im i is equal to z. Evaluating f2(x = (1, 2)) shows that z = f (x) for this input. defined by Eqn. (1), we obtain: For the 3-NMQC procedure to deterministically compute a function f : F n 3 → F 3 , Eqn. (29) must be equal to ω f (x) |GHZ qutrit . Therefore, the conditions that have to hold for such a deterministic 3-NMQC scheme are: where c ∈ F 3 is a post-processing trit that can be added after the computation. Note that the fulfilment of condition (31) implies the fulfilment of condition (30).
On the left hand side of (30), in the exponent, there is a weighted sum of strictly linear functions over F 3 with coefficients ∈ R. In analogy to [3], we need to show that the exponent can represent any function f : F n 3 → F 3 using at most l = 3 n − 1 terms. The full proof can be found in Appendix B.

V.
A FAMILY OF n-VARIABLE FUNCTIONS THAT CAN BE COMPUTED WITH ONLY n + 1 QUTRITS Given Theorem 1, the question arises whether one can find suitable functions that can be computed with a sufficiently small number of qutrits and, thereby, demonstrate that the superiority of quantum correlations in 3-NMQC is experimentally feasible. In this section, we show that indeed this is the case and prove that to compute the function: one requires no more than n + 1 qutrits when using the generalised qutrit GHZ state from Eqn. (1) as a resource. Note that f 2 (x) is not defined by Eqn. (32) due to the sum indices going up to n−3. We therefore directly state its definition: We summarise the result in the following Proposition: Proposition 1 (Computing f n (x) with 3-NMQC). In order to compute the function f n : F n 3 → F 3 , as defined by Eqn. (32), with 3-NMQC one requires no more than n + 1 qutrits. To realise the function, one needs the same measurement operators for every qutrit: with α = e 2πi 9 , and the pre-processing This also means that for any function that LHVs cannot deterministically compute, there is a corresponding generalised Bell inequality for n measurement sites and 3 n expectation values (given by Eqn. (22)) that quantum correlations maximally violate with the help of the |GHZ qutrit state.
This follows since in [6] it was shown that at most degree 2 functions can be computed deterministically by LHV theories, and the functions above have higher degree.
It can also be seen as a generalised GHZ paradox for all n. As a visual example, the computation of f 2 (x) with 3-NMQC using the three-qutrit GHZ state for x = (1, 2) is illustrated in Fig. 2.

A. Main idea behind the proof of Proposition 1
We briefly explain the reasoning for the ansatz in Proposition 1 as it demonstrates the mathematical parallels to 2-NMQC. Its full proof via natural induction can be found in Appendix C.
For n = 2, we evaluate f 2 (x) for every x and verify that the condition for deterministic 3-NMQC, given by Eqn. (30), always holds when using the pre-processing from Proposition 1. This is summarised in Table I. For n ≥ 3, the idea behind finding f n (x) and its appropriate measurement operators and pre-processing follows the pre-processing of its qubit analogue, the pairwise AND function (Eqn. (7)). To compute the pairwise AND function, one chooses the measurement operatorŝ m i (s i = 0) = σ x andm i (s i = 1) = σ y for all i and a qubit GHZ state (Eqn. (6)). The pre-processing is given by (see [3]): The resulting tensor product of measurement operators always contain an even number of σ y operators, so that any global phase in front of the qubit GHZ state is an element of Ω = {−1, 1}. Thus, the expectation value will also always be an element of Ω. For 3-NMQC, we now choose the qutrit measurement operators given by Eqn. (34). The pre-processing: results in the following expectation values with respect to the qutrit GHZ state: These always consist of multiples of α that are divisible by 3, i.e. that the expectation value is an element of the set of the third roots of unity Ω = {1, ω, ω 2 } for all x. By evaluating the expectation values given by Eqn. (38) for all inputs x for some n and interpolating to find the so-called "Reed-Muller expansion" from [40], we inferred the expression in Eqn. (32) for the function that can be computed with this pre-processing. We prove that this is the correct form for all n in Appendix C. It is important to note that, just as in the case of F 2 and the pairwise AND function, f n (x) is invariant under all coordinate permutation.

B. Generalised qutrit Bell inequality
Let us now discuss the generalised qutrit Bell inequality for the generalised qutrit GHZ paradox induced by the deterministic computation of the function given by Eqn. (32). The quantum bound of this generalised Bell inequality is the maximal q = 1 due to Proposition 1 (as explained in Section III). If we insert f 2 (x) from Eqn. (33) and w(x) = 1/3 n into Eqn. (22) for the related generalised qutrit Bell inequality, we obtain: The LHV bound c was found numerically. We also computed c for n = 3, i.e. for three input trits and l = 4 qutrits and find that the classical bound of the induced Bell inequality, which we will not explicitly state here, is c = 1/2. The bound has decreased by a considerable amount with an increase of the number of qutrits.
It turns out that the inequality (39) coincides with one of the Mermin inequalities for 3 qutrits discussed in [34]. The LHV bound of the expectation value of the equivalent Mermin inequality is, thereby, in agreement with the LHV bound c = 2/3 of our normalised Bell inequality given by Eqn. (39). Therefore, we may say that with f n (x) in Eqn. (32), for n > 2, we have found another version of the Mermin operator for 3 qutrits in [34].

VI. NOT ALL FUNCTIONS CAN BE EFFICIENTLY COMPUTED WITH 3-NMQC
One might think that the scalability of the computation of Eqn. (32) implies that all functions can be computed efficiently with qutrits and 3-NMQC using the , which is the expectation value of the tensor product of the three measurement operators determined by x0 and x1 with regard to the three-qutrit GHZ state. We see that, using the pre-processing as defined in Proposition 1, the expectation value is always equal to ω f (x) , fulfilling the condition for deterministic 3-NMQC given by Eqn. (30). Therefore, for n = 2, the chosen pre-processing and measurement operators result in the computation of f2(x).
qutrit GHZ state in Eqn. (1). However, it turns out that there are functions whose computation scales exponentially with the number of input trits. They are analogous to their binary counterparts, in that they differ from a constant function at only one input x (see Section II B): To compute a function f : F n 3 → F 3 with a (Hamming) distance 1 to a constant function f (x) = c with c ∈ F 3 with 3-NMQC and the generalised qutrit GHZ state (defined in (1)) as a resource, one needs no fewer than (3 n − 1)/2 qutrits.
We prove Proposition 2 in Appendix D. Just as it was the case for 2-NMQC, Proposition 2 demonstrates that not all functions can be computed efficiently with 3-NMQC and the qutrit GHZ state. There is a stark contrast between the required numbers of qutrits for the computation of f n (x), defined in Eqn. (32), and a function with a Hamming distance of 1 to a constant one when using the qutrit GHZ state. We visualise this difference in scaling for some numbers n of input trits in Fig. 3.

VII. POSSIBLE EXPERIMENTAL REALISATIONS OF 3-NMQC
As we have proven that the generalised qutrit GHZ state is a universal resource for 3-NMQC, it is also the most obvious resource for an experimental implementation of 3-NMQC. It has also been shown that if a 3-NMQC model can compute a function of a degree greater or equal to 3 [6], it is strongly non-local, following the definition of strong non-locality in [37]. Thus, the computation of the function given by Eqn. (32) with qutrits could serve as an experimental demonstration of strong non-locality.
One possible way of realising qutrit systems is to utilise superconducting transmon processors [11,20,21]. Addressing three energy levels of the transmons, thereby, allows for implementing single-and two-qutrit gates and even the generation of a three-qutrit GHZ state has been demonstrated [21]. In a similar way, quantum processors with trapped ions benefit from the multi-level structure of the ions, which has led to the implementation of singlequtrit gates [28].
Another promising system to generate and measure qutrit GHZ states is the photonic system [25,[41][42][43], which has already been used to implement 2-NMQC [44]. Naturally, photonic degrees of freedom such as path, orbital angular momentum (OAM), or photon number, can be of arbitrary dimensions. Employing OAM, the authors of [25] have generated a three-qutrit GHZ state and shown that it would be suited to violate the Bell/Mermin inequality given in [34]. It would therefore realise the computation of the function f 2 (x) [see Eqn. (33)]. The necessary single-qutrit measurement operations have been discussed in [41] and [23] for path and OAM degrees of freedom, respectively, and could be implemented in future experiments. One could further generalise these setups to realise the computation of the

VIII. CONCLUSION AND OUTLOOK
We have derived a series of novel findings on non-adaptive measurement-based quantum computing (NMQC) with qutrits and ternary logic (3-NMQC).
We showed that with a qutrit GHZ state as a resource, a restricted ternary pre-processor can be boosted to compute any ternary function in 3-NMQC. The associated generalised Bell inequalities are maximally violated by qutrit GHZ states. We showed that the minimum size of the qutrit GHZ state that is required to compute a function that differs from a constant function at only one input value scales exponentially with n.
We also presented a family of n-variate functions which require only n + 1 qutrits using the qutrit GHZ state for NMQC. Interestingly, the probabilistic NMQC game induced by the equivalent function in the binary case, the pairwise AND function, is related to a Svetlichny inequality [3]. There, the ratio of the quantum to the classical bound q/c increases exponentially with the number of qubits. We conjecture that our function may also be related to a generalised Svetlichny inequality for qutrits.
It is an interesting open question whether the generalised Bell inequalities induced by the probabilistic 3-NMQC game form a complete set of Bell inequalities. The binary NMQC game can describe the entire, complete set of qubit (n, 2, 2) Bell inequalities [3] which are maximally and optimally violated by the generalised qubit GHZ state. Due to the similarities between binary and 3-NMQC, the 3-NMQC game might also describe an entire complete set of generalised qutrit Bell inequalities, which are also optimally and maximally violated by the generalised qutrit GHZ state.
A natural extension of our work is general p-NMQC, where the goal is to compute a function f : F n p → F p . It is interesting to see whether our proof can be extended to p > 3 and whether quantum correlations can indeed elevate any pre-processor to classical universality. Furthermore, it is an interesting question whether the parallel between binary and ternary NMQC with regard to the functions that cannot be efficiently computed remains for p-NMQC in general.
Appendix A: Derivation of the alternative generalised Bell inequality (22) We start out with the expectation values: Now, we note that, multiplying ω −f (x) with E 1 (z|s) ≡ E(z|s) leads to: If we now sum up Eqn. (A2) over all x, weighted by w(x) and discard the imaginary part, we arrive at: 2|s)) that z is not equal to f (x) given that the measurement settings are determined by s. In Eqn. (A5) we insert the definition ofp S (see Eqn. (14)). We now redefine u 3 as: As outlined in section IV A, the idea behind the proof of Theorem 1 is to show that the exponent on the l.h.s. of the condition for deterministic 3-NMQC: which is a sum in R of strictly linear functions, can represent any function for l ≤ 3 n − 1. Here, we complete the proof. The idea of the proof is relatively simple. Observe that if we write out Eqn. (B1) for every x, we have a system of 3 n equations that have to hold true. On both sides there is an ω in the base (α = ω 1 3 ) and on the left hand side there is a sum over the reals of strictly linear functions defined and evaluated in F 3 in the exponent. All 3 n equations are true if the exponents on both sides are always equal. This would mean that (absorbing the factor 1/3 into φ i , i.e., We can now interpret the set of these 3 n equations as one single condition for the function vector f = (f (x = (0, 0, . . . , 0)), f (x = (0, 0, . . . , 1)), . . . , f (x = (2, 2, . . . , 2))) T of f : F n 3 → F 3 , which is the sorted image of f . On the left hand side, we then have a sum in the reals over the function vectors of the strictly linear functions: whereby we write strictly linear functions as a scalar product: and index its function vector with the vector v ∈ F n 3 that defines it. Thus, what we need to show is that the function vectors of the (strictly) linear functions in F p , augmented by the function vector of the constant function f (x) = c ∀x, c ∈ {1, 2}, (realised by the post-processing trit) can represent any vector in R 3 n . There are 3 n − 1 non-trivial vectors v ∈ F n 3 and thus 3 n − 1 non-trivial (strictly) linear functions. If we augment this set by the function vector f c of the constant function, we arrive at a set of 3 n vectors. As we want to represent any vector in a 3 n -dimensional vector space over R, it only remains to show that the set of function vectors of strictly linear functions, augmented by the function vector of the constant one, is linearly independent over R.
In Lemma 2 we show exactly that. Then, we directly conclude that Theorem 1 holds due to the reasoning outlined above.

A useful Lemma
We begin with lemma 2: Lemma 2. Let f v denote the function vector of a non-trivial strictly linear function f : Proof of lemma 2 In the following, we abbreviate To prove lemma 2, we must show that the following equation: leads to λ v = 0 ∀v ∧ λ c = 0. In the sum subscript, we wrote v = 0 as v = 0. First, all strictly linear functions are 0 at x = 0. Therefore, the first line of the linear system of equations Eqn. (B5) is: We can split up all elements of F n 3 except the zero vector into sets of (3 n − 1)/2 sets dubbed X and 2X in which no element is the additive inverse of another one. Then, the following holds true: ∀x ∈ X∃y ∈ 2X : y = 2x.
(B7) (We are still talking about element-wise modulo 3 addition and scalar multiplication.) If a vector v ∈ F n 3 \ 0 fulfils the condition v · x = 1 for some x ∈ X, then one can find the (unique) additive inverse y ∈ 2X with y = 2x and it follows that v · y = v · 2x = 2. Let us get back to the linear system of equations Eqn. (B5).
For an x ∈ X we can split the sum up into three terms: We can do the same with the corresponding inverse y = 2x from the set 2X: Obviously, if v · x = 0 then v · 2x = 2(v · x) = 0. (This is true for addition and multiplication modulo 3 as well.) So the coefficients in the first term on the right hand sides of Eqn. (B8) and Eqn. (B9) are the same: We are left with the terms where v · x equals 1 and 2. If (2x) · v = 1, then x · v = 2 and if (2x) · v = 2, then x · v = 1. So one can rewrite equations (B8) and (B9) as: λ v · 2 = 0. (B12) We end up with the following two conditions for all x ∈ X: v∈F n 3 \{0},v·x=2 They have to hold for λ v ∈ R∀v and addition and multiplication in R (not F 3 !). This is only possible if: So the conditional sum over all v that fulfil v · x = 0 for some x ∈ F n 3 \ {0} is the same for every x. For a given v ∈ F n 3 \ {0}, how many x are there that fulfil v · x = 1? Every x has n elements. Without loss of generality, we can fix one index k for which v k is not zero (There exists at least one such index if v is non-zero.) and keep the corresponding x k fixed. We can then freely choose all other n − 1 elements of x and then have to pick the left over x k such that v · x = 1. The n − 1 elements of x that can be freely chosen lead to 3 n−1 x ∈ F n 3 \ {0} that fulfil x · v = 1 for a given v ∈ F n 3 \ {0}. The same is true for the condition v · x = 2. Keeping this in mind, we sum one of the terms in Eqn. (B15) over all x ∈ F n 3 \ {0}: where δ v·x=1 is 1 if v · x = 1 and 0 otherwise. Remembering Eqn. (B16) leads to the conclusion: Now, we take an arbitrary x ∈ F n 3 \ {0} and split it up into a = (x 0 , x 1 , ..., x k ) and b = (x k+1 , x 1 , ..., x n−1 ) for some k : 1 ≤ k ≤ n − 2. Eqn. (B18) leads us to: λ v on the l.h.s. in the second line of Eqn. (B19) is zero due to Eqn. (B15). We continue by splitting up other sums analogously to how we split up v∈F n 3 \{0} v·a=1 v·b=2 (All sums v∈F n 3 \{0} v·y=m λ v for some y ∈ F n 3 and some m ∈ F 3 vanish due to Eqn. (B15).) In the same manner, one can show that for any m, n ∈ F 3 and any a, b defined as above: We can now split up the vector a = (x 0 , ...., x k ) into a = (x 0 , ..., x l ) andã = (x l+1 , ..., x l ) for some arbitrary l with 1 ≤ l ≤ k − 1 and rewrite the sum in Eqn. (B27) as: Following the same procedure as from the second line of Eqn. (B19) onwards, one arrives at: for all m ,m, n ∈ F 3 . Continuing in the same manner, i.e. splitting x up into increasingly smaller, non-overlapping segments, we end up with the following: for all x, y, v ∈ F n 3 . Evidently, Eqn. (B30) can only be true for all v and all x if λ v = 0 ∀v ∈ F n 3 \ {0}. This completes the proof of lemma 2.
With this, we have shown that any function f : F n 3 → F 3 can be written as a weighted sum of (strictly) linear functions over F 3 with coefficients in R. Therefore, every function can be realised in the exponent on the l.h.s of Eqn. (B1). Each strictly linear function stems from a measurement setting s i and the real coefficient is the angle φ i (see Eqn. (B1).) (The constant function can be realised by the post-processing trit in Eqn. (B1).) There are 3 n − 1 non-trivial strictly linear functions left over, hence the maximal number of 3 n − 1 qutrits. This finalises the proof of Theorem 1.
One might object to allowing arbitrary real numbers as angles. We can consider rational approximations of the real numbers, but the result still holds.
One arrives at that conclusion by splitting up the sum over all x 2 i at i = n and by factoring out the x 2 n and x n in all terms that contain it. The terms that do not contain any non-zero power of x n are part of f n (x). One can verify that the expression in square brackets in Eqn. (C3) is equal to: That is because multiplying these two expression leads to one term containing the sum over all x i (whereby the 2 · 2 becomes 1 due to mod 3 arithmetic), to one term containing the sum over all x 2 i (so the 2 stays there) and to two terms containing the sum over all combinations of x i and x j , i = j. (Both of these terms are preceded by a 2, resulting in a 2 ⊕ 2 = 1). The two expressions in Eqn. (C4) only contain the sums (mod 3) over all x i . We abbreviate n−1 i=0 x i by S (for sum) and arrive at: We have obtained an expression for f n+1 (x) that contains only f n (x), x n and S, the sum over all x i for i < n. Therefore, in order to check if the induction hypothesis Eqn. (C1) is fulfilled for n + 1, it remains to differentiate between a handful of cases. We insert Eqn. (C5) and S = n−1 i=0 x i into Eqn. (C1) and set n → n + 1: Now, we insert the induction hypothesis for n: (c) x n = 2, S = 0. The l.h.s. of Eqn. (C8) is α 2+1 = ω 1 and the r.h.s. results in: Analogously, one can show that Eqn. (C8) holds for all other combinations of x n and S. This completes the proof of Proposition 1.

Appendix D: Proof of Proposition 2
To prove Proposition 2, we first show that one can compute a function with a distance of 1 to a constant one with 3-NMQC and a pre-processing matrix P if and only if one can compute it with a pre-processing matrix P = P M , where M is an n by n ternary invertible matrix. Then we show that if every row in P does not contain all 1s or 2s, it is impossible to compute the function. In the end we combine these two facts and show that, given l < (3 n − 1)/2, one can always find an invertible matrix M that turns P into a P in which every row is unequal to (1, 1, 1, .., 1) and (2, 2, 2, ..., 2), which completes the proof.
We begin by, without loss of generality, fixing the function f (x) to be computed as: so f (x) differs from the constant function g(x) = 1 atx = 0. Other cases can be retrieved from this one by relabelling in-and output bits. Now, if we apply condition Eqn. (30), we arrive at: The first step is to observe that Eqn. (D2), for this particular f (x), is equivalent to: where P = P M . (As a reminder, α = e 2πi 9 .) That is because P = P M leaves the x = 0 case unchanged (as in this case one multiplies the row P i by a zero-vector and the only non-zero term left to be chosen is the post-processing trit c.) All other cases lead to the same term on the r.h.s, namely ω 1+c . So if Eqn. (D2) is fulfilled for all x, then Eqn. (D3) is too. This, in turn means that, if we find a P = P M for which Eqn. (D3) is not fulfilled, Eqn. (D2) does not hold. This was the first step of the proof.
We continue with the second step, showing that Eqn. (D2) leads to a contradiction if every row of P is unequal to a row of all 1s or a row of all 2s. If we apply condition Eqn. (D2) for x = 0, we get: We conclude that c must be zero. For x = 0, one arrives at: where k x is an integer dependent on x. Now we introduce the sum: The r.h.s. of Eqn. (D6) is zero if every row P i in P contains at least one P ij = 0. One realises that by looking at the sum on the r.h.s. over x: Without loss of generality, we fix P i,n−1 = 0. As the last element of the row P i is zero, the last element of x does not matter and if all elements before that one are zero, the sum over the elements of P i is zero too: We are left with 3 n − 3 presumably non-zero terms in the sum Eqn. (D7). We can write x as x = (x , x n−1 ) T , where x is an n − 1 dimensional vector with entries in F 3 . As the inner sum in Eqn. (D7) is the same for x = (x , 0) T , x = (x , 1) T and x = (x , 2) T , the sum of the terms in Eqn. (D7) over these three different values of x is: (The sum over the roots of one is zero.) As we can divide all 3 n − 3 left over x into 3 n−1 − 1 sets , one sees that Eqn. (D7) is zero, if there is a zero in every row P i of P : This is not the only case in which the sum in Eqn. (D6) is zero. In fact: So the sum Eqn. (D7) is zero if P i is not a row containing only 1s or a row containing only 2s. This is due to the fact that we can split the sum into different terms (for P ij = 0∀j): As the order of the index j does not matter, we reorder P ij and x j such that P ij = 1 for j = 0, .., m − 1 and P ij = 2 for j ≥ m. (P ij = 0 ∀i, j as we have already covered this case above.) This results in: There are 3 m−1 x = (x 0 , ..., x m−1 ) such that m−1 j=0 x j = l and 3 n−m−1 x = (x m , ..., x n−1 ) such that n−1 j=m x j = l for any l ∈ F 3 . We continue: x =0   ω k x k j (P ij x j ) ⊕   = 3 m−1 · 3 n−m−1 ω 1 + 3 m−1 · 3 n−m−1 ω 0 + 3 m−1 · 3 n−m−1 ω 2 + 3 m−1 · 3 n−m−1 · 2ω 2 + 3 m−1 · 3 n−m−1 · 2ω 0 + 3 m−1 · 3 n−m−1 · 2ω 1 = 3 n−2 (ω + ω 1 + ω 2 ) + 2 · 3 n−2 (ω + ω 1 + ω 2 ) = 0. ω k x k (3 + 9k x ) = 0. (D15) In the first sum x =0 3ω k x k all terms except the ones for x = (0, .., 1) T and x = (0, ..., 2) T cancel out due to the same reasons as above and we are left with: x =0 ω k x k 3 = 3(ω 1 + ω 2 ) = −3.
The two imaginary parts Im{K 1 } and Im{K 2 } in Eqn. (D18) are multiples of Im ω 1 and Im ω 2 : whereK 1 andK 2 are integers. The two real parts Re{K 1 } and Re{K 2 } are multiples of Re ω 1 and Re ω 2 with the same factorsK 1 andK 2 . As Im{ω} = − Im ω 2 and the total imaginary part on the left hand side in Eqn. (D18) must be zero,K 1 must be equal toK 2 ≡K, hence: −3 + 9(K 0 + K 1 + K 2 ) = −3 + 9(Im{K 1 } + Im{K 2 }) + 9(Re{K 1 } + Re{K 2 } + K 0 ) = −3 + 9 · 0 + 9(K 1 Re{ω} +K 2 Re{ω} + K 0 ) = −3 + 9(− 1 2K − 1 2K + K 0 ) = −3 + 9(−K + K 0 ) = 0. (D20) In the third line of Eqn. (D20) we inserted Re{ω} = Re ω 2 = Re e It remains to show that, given l < (3 n −1)/2, one can always transform P into a P that leads to such a contradiction. If we have less than 3 n − 1 qutrits, the rows of P will not contain every possible combination for a string of n trits. We denote one missing row by y. We can always find an invertible (hence injective) map M : F n 3 → F n 3 that maps y ≡ (1, 1, ..., 1) to the missing row y y M = y. (D21) Conversely, the inverse M −1 maps all stringsỹ = y to stringsỹ = y . This, alongside the fact that condition Eqn. (D5) is equivalent to: where P = P M for some invertible map M : F n 3 → F n 3 , would finalise the proof, as we could always find an M such that Eqn. (D21) holds, leading to the contradiction derived above. However, the sum in Eqn. (D11) is also zero for P i = (2, ..., 2). This is why we need no fewer than (3 n − 1)/2 qutrits: If l < (3 n − 1)/2, this means that there are at least (3 n − 1)/2 + 1 non-trivial missing strings. This means that we can find a missing string y whose additive inverse 2y is also missing. We can then find an M that fulfils Eqn. (D21), and it will automatically fulfil: where y is a string containing all ones. Therefore, the inverse M −1 maps all stringsỹ = y, 2y to anything but a string containing all ones or all twos. The third step is complete, and hence the proof.