This section contains formal definitions, and the proof of Theorem 2.

Definition of AWPP

Let Σ be a finite set of symbols, e.g. Σ = {0, 1}, and let Σ* be the set of all finite sequences over Σ (commonly referred to as strings). For a string x ∈ Σ*, we let |x| denote its length. A gap function over Σ is a function \(g:{\mathrm{\Sigma }}^ \ast \to {\Bbb Z}\); which computes the difference between the number of accepting branches and rejecting branches of some nondeterministic Turing machine N, where N takes no more than T(|x|) computational steps on input |x| for some polynomial T on whatever input x it is given.

Fenner60, Theorem 1.3 characterized AWPP as the class of languages L ⊆ Σ* for which there is a gap-function \(g:{\mathrm{\Sigma }}^ \ast \to {\Bbb Z}\); and a polynomial p, such that

$$x \in L \Rightarrow \frac{2}{3} \le \frac{{g(x)}}{{2^{p(|x|)}}} \le 1;$$ (6A)

$$x\,

otin\, L \Rightarrow 0 \le \frac{{g(x)}}{{2^{p(|x|)}}} \le \frac{1}{3}.$$ (6B)

Combining this with60, Theorem 3.1, more generally we have L ∈ AWPP if and only if

$$x \in L \Rightarrow \frac{2}{3} \le \frac{{g(x)}}{{h(|x|)}} \le 1;$$ (6C)

$$x \,

otin\, L \Rightarrow 0 \le \frac{{g(x)}}{{h(|x|)}} \le \frac{1}{3}.$$ (6D)

for a gap-function g and any poly-time computable function \(h:{\Bbb N} \to {\Bbb N}\). While the original definition of AWPP61,62 further required there to exist a gap-function g and a poly-time computable function h for any polynomial \(r:{\Bbb N} \to {\Bbb N}\), satisfying either g(x)/h(|x|) ∈ [0, 2−r(|x|)] or g(x)/h(|x|) ∈ [1 − 2−r(|x|),1], we instead use the characterizations of both Eqs. (6) and (7) in our results.

Affine turing machines

We define an Affine Turing Machine (AffTM) to be a non-deterministic Turing Machine, in which every transition has an associated real-valued (possibly negative) weight. The weights for a given machine are constant throughout the computation, and should be thought of as defined by the transition function. The weight of a given computational branch is then the product of the weights of the transitions involved. We require that for each symbol being read, the total weight of transitions from a given (non-halting) state is +1. In this article we consider only rational transition weights, but expect that similar results would obtain for algebraic real coefficients.

We interpret AffTMs as a model of quasi-probabilistic computation, as follows. Given an AffTM M whose branches all halt in in a finite number of steps, the acceptance weight α M (x) of M on an input x is the total weight of the accepting paths on input x. An AffTM M is proper if 0 ≤ α M (x) ≤ 1 for all inputs, and that it decides a language L with bounded error if furthermore \(\frac{2}{3} \le \alpha _{\mathbf{M}}(x) \le 1\) for x ∈ L, and \(0 \le \alpha _{\mathbf{M}}(x) \le \frac{1}{3}\) for x ∉ L.

An AffTM is efficient if the number of computational steps it takes in any computational path on any input x is bounded by some polynomial in |x|. The first step towards Theorem 2 is to establish the following:

Lemma 1

The class of languages decided with bounded error by some efficient AffTM is equal to AWPP. The proof of this result is contained in following two sections.

Solving AWPP problems with an affine Turing machine

For L ⊆ AWPP, let \(g:{\mathrm{\Sigma }}^ \ast \to {\Bbb Z}\) be a gap-function satisfying Eq. (6) for some polynomial p. Also let N be the non-deterministic Turing machine whose accepting/rejecting branches determine the gap-function g, and T be the polynomial bounding the number of computational steps of N on its input. By standard results,61 we may require that N have the same number of non-deterministic transitions at each step, which we denote by N ≥ 1, and that all computational branches of N have the same length on input x. We suppose that each transition of N is associated with some label \(\ell \in \{ 1,2, \ldots ,N\}\): the computational branches of N are then in one-to-one correspondence with sequences {1, 2, …, N}T(|x|). We may then consider an AffTM M which simulates N, in the following sense:

1. 1. M first makes T(|x|) non-deterministic transitions, writing a sequence of symbols β 1 , β 2 , …, β T(|x|) ∈ {0, 1, 2, …, N} on the tape to produce a string β ∈ {0, 1, 2, …, N}T(|x|). The weights of these transitions are + 1 for each choice β t ≠ 0, and (1 − N) for each choice β t = 0, so that the transition weights sum to +1. 2. In branches with one or more symbols β t = 0, M transitions deterministically with weight +1 to a state reject. All other branches of M have weight + 1 and record a string β ∈ {1, 2, …, N}T(|x|) indexing some computational branch of N. In these branches, M simulates the computational branch of N whose transitions are indexed by β. 3. For any branch in which the simulation of N rejects, M makes a non-deterministic transition to a state dampen with weight −1, and to the reject state with weight +2. For the branches in which the simulation of N accepts, M transitions deterministically to dampen with weight +1. 4. From the state dampen, M makes a sequence of p(|x|) non-deterministic transitions with weight \(\frac{1}{2}\), in which it writes bits δ 1 , δ 2 , …, δ p(|x|) on the tape, thereby sampling a string δ ∈ {0, 1}p(|x|) uniformly at random. If \(\delta _1,\delta _2, \ldots ,\delta _{p(|x|)}\), M transitions to an accept state; in all other branches it transitions to the reject state.

By the construction of the branch weights, M is an AffTM; and as the number of transitions that M makes is O(T + p), it is efficient. By construction, the total weight of the branches which transition to the dampen state is g(x); sampling the string δ ∈ {0, 1}p(|x|) and rejecting unless \(\delta = 11 \cdots 1\) ensures that the acceptance weight is α M (x) = g(x)/2p(|x|). By hypothesis, this is bounded between 0 and 1, is at least \(\frac{2}{3}\) if x ∈ L, and is at most \(\frac{1}{3}\) otherwise. Thus M decides L with bounded error.

Simulating an Affine Turing Machine in AWPP

Suppose that M is a proper and efficient AffTM which has transitions with rational weights. Let M be the common denominator of the (finite set of) transition weights of M, and let T ∈ O(poly(n)) be the running time of M on an input of length n. Let m > 0 be an integer, chosen such that m ∈ O(T), and such that 2m ≥ MT and 2m ≥ (|u|M)T for all transition weights u of M. We may obtain an AWPP algorithm to approximately simulate M, as follows. We define a non-deterministic machine N, which simulates M in the following sense.

1. The machine N reserves some space on the tape to represent some weight \({\mathrm{\Omega }} \in {\mathbb Q}\); for each branch. We call this the recorded weight of the branch. 2. Consider a transition made by M, with weight u = U/M. To simulate this transition, the machine N replaces the recorded weight Ω with Ω′: = UΩ, and then simulates the actions (writing of symbols and movement of the tape head) performed by M in the original transition. 3. Once N has simulated the final transition of M, it non-deterministically samples a sequence of bits a, b, c 0 , c 1 , …, c m−1 ∈ {0, 1}. If a = 1, we negate Ω if and only if the simulated branch is one in which M rejects. 4. N determines whether to accept or reject, treating \(c_{m - 1}c_{m - 2} \cdots c_1c_0\) as the binary expansion of an integer 0 ≤ C < 2m, as follows. If C ≥ |Ω|, we reject if b = 0, and accept if b = 1.

If 0 ≤ C < |Ω|, we reject if Ω < 0, and accept if Ω > 0.

Consider the gap function g(x) of the machine N. From Step 4, it is clear that if C ≥ |Ω| in any particular branch, N accepts and rejects with equal measure, contributing nothing to g(x). The significance of the contribution of any simulated branch of M is then in proportion to its recorded weight in N, which in absolute value is 2MT times its weight in M (arising from the systemic failure to divide the recorded weight by M at each of the T transitions, and from the two values of b). Let α + (x) be the total weight of those accepting branches of M with positive weight, α − (x) be the total (absolute value of) the weight of accepting branches with negative weight; and similarly for ρ + (x) and ρ − (x) for rejecting branches of positive and negative weight. Then α(x): = α + (x)−α − (x) is the acceptance weight and ρ(x): = ρ + (x)−ρ − (x) is the rejection weight of M on input x. We decompose g(x) = g 0 (x) + g 1 (x), where g 0 (x) is the contribution to the gap from branches in which a = 0, and g 1 (x) is the contribution to the gap from branches in which a = 1. We then have

$$g_0(x) = 2M^T[\alpha _ + (x) + \rho _ + (x) - \alpha _ - (x) - \rho _ - (x)] = 2M^T,$$ (7)

as α(x) + ρ(x) = 1. In the branches where a = 1, the sign of the contribution from rejecting branches is negated, so that

$$\begin{array}{*{20}{l}} {g_1(x)} \hfill & = \hfill & {2M^T[\alpha _ + (x) - \rho _ + (x) - \alpha _ - (x) + \rho _ - (x)]} \hfill \\ {} \hfill & = \hfill & {2M^T[2\alpha (x) - 1],} \hfill \end{array}$$ (8)

again using α(x) + ρ(x) = 1. Then g(x) = 4MTα(x), and for h(n) = 4MT, we have 0 ≤ g(x)/h(|x|) ≤ 1 as M is proper. Furthermore, if M decides a language L with bounded error, then either \(\frac{2}{3} \le g(x)/h(|x|) \le 1\) or \(0 \le g(x)/h(|x|) \le \frac{1}{3}\) according to whether x ∈ L or x ∉ L; then L ∈ AWPP as well.

Constructing affine circuits

The next step towards Theorem 2 is to construct a family of circuits that can simulate a proper, efficient AffTM. The construction of the circuits is based on that used by Yao in ref. 63 to construct quantum circuits that simulate a quantum Turing Machine (and also on that of refs. 64,65 for circuits that simulate a probabilistic Turing machine). As before, let M be a proper and efficient AffTM with alphabet Σ, set of states Q and transition amplitudes \(\delta (q,a,\tau ,q^\prime ,a^\prime ) \in {\mathbb Q}\); with τ ∈ {←, °, →}; the symbols ←, → and ° are interpreted as the tape head of the AffTM moving to the left, moving to the right, and remaining stationary. Here δ is the transition weight of M to change to state q′, print a′ on the tape and move according to τ, if the machine is currently in state q and reading a. The condition on the weights in order for M to be an AffTM is: \(\mathop {\sum}\limits_{\tau ,q^\prime ,a^\prime } \delta (q,a,\tau ,q^\prime ,a^\prime ) = 1\) for all q ∈ Q, a ∈ Σ.

We may denote any configuration of the AffTM by a real basis vector

$$\left. {|s_{ - t},q_{ - t},a_{ - t}, \cdots ,s_i,q_i,a_i, \cdots ,s_t,q_t,a_t} \right)$$ (9)

where the index −t ≤ i ≤ t denotes the ith cell of the tape and t is the run time of the AffTM (there are 2t + 1 cells, numbered from −t to t). Here s i takes on value 0 when the head is not at cell i, value 1 when it is at cell i and the transition step has not occurred and value 2 when the head has just moved according to a transition and is now at cell i. Note that we can represent s i with two bits. The label q i denotes the internal state of the machine at cell i, so \(q_i \in Q \cup \{ \emptyset \}\), where \(q_i = {\emptyset}\) if and only if s i = 0; and a i ∈ Σ denotes the alphabet character printed on cell i. It is clear that \(\ell\) bits, where \(\ell = 2 + \left\lceil {{\mathrm{log}}(|Q| + 1)} \right\rceil + \left\lceil {{\mathrm{log}}(|{\mathrm{\Sigma }}|)} \right\rceil\), are required to represent the information at each cell. One can thus think of these basis vectors as being encoded by strings in \(\{ 0,1\} ^{(2t + 1)\ell }\).

The transitions made along any one branch are represented by a sequence of these vectors, where each element of the sequence is the configuration of the machine at a given moment in time. The full state of the AffTM corresponds to an affine combination of such configurations, and the evolution of the AffTM corresponds to affine transformations of these configurations in superposition. We may then simulate the AffTM by a uniform family of affine circuits.

Here, an “affine circuit” (in analogy to quantum circuits) refers to an acyclic network of “affine gates”, each of which represents an affine transformation acting on real vectors. We demand that the matrices corresponding to these affine transformations have entries (with respect to the standard basis) that can be computed efficiently, i.e. in poly-time, by an ordinary Turing Machine. We also demand that the description of the circuit can be computed efficiently, and in particular that it contain only a polynomial number of gates.

A specific affine circuit in this family will correspond to the concatenation of t identical sub-circuits, which we denote by B. Each sub-circuit B simulates one time-step of the AffTM M. To construct these circuits, each tape cell of the AffTM is associated with \(\ell = 2 + \left\lceil {{\mathrm{log}}(|Q| + 1)} \right\rceil + \left\lceil {{\mathrm{log}}(|{\mathrm{\Sigma }}|)} \right\rceil\) wires in the circuit, which are sufficient to encode a tuple \((s_i,q_i,a_i) \in \{ 0,1,2\} \times (Q \cup \{ \emptyset \} ) \times {\mathrm{\Sigma }}\), as described above. We build the sub-circuit B with \(3\ell\) input wires and \(3\ell\) output wires, constructed from copies of two gates G and I as follows. We first perform a cascading sequence of 2t−1 copies of G (whose behaviour we describe below), with each one shifted right by \(\ell\) wires from the preceding one. We then perform 2t+1 copies of a gate I, in parallel, each acting on \(\ell\) wires. The gate I acting on the ith cell changes the value of s i with value 2 to 1 and value 1 to 2, leaving a value of s i = 0 alone. It is clear that I is an affine transformation and can be built using O(t) gates whose function is to implement the change in s i for a specific i. We denote the ith instance of G as G i . See Fig. 4 for a pictorial representation of B.

Fig. 4 Sub-circuit B simulating one transition of an affine Turing Machine M. This circuit acts on 2t + 1 “cells”, each consisting of \(\ell\) wires and representing the contents of one cell of an affine Turing Machine M, the location of the head, and the state of M Full size image

The intuitive idea behind this construction is as follows. The \(3\ell\) inputs to G should be thought of as describing the contents of three consecutive cells of the AffTM, including the information about the position of the head. We want G to transform the contents of these cells if the head is at the middle cell and the transition step has not occurred (i.e. s i = 1 with i being the middle cell) according to how the AffTM would transform the contents. Thus we design G to act as follows:

1. For all v = |s i−1 , q i−1 , a i−1 , s i , q i , a i , s i+1 , q i+1 , a i+1 ) with s i ≠ 1, we have G(v) = v,

2. For v′ = |0, ∅, a i−1 , 1, q i , a i , 0, ∅, a i+1 ) we have

$$\begin{array}{*{20}{l}} {G(v^\prime )} \hfill & = \hfill & {\mathop {\sum}\limits_{q^\prime ,a^\prime } \delta (q_i,a_i, \leftarrow ,q^\prime ,a^\prime )\left. {|2,q^\prime ,a_{i - 1},0,\emptyset ,a^\prime ,0,\emptyset ,a_{i + 1}} \right)} \hfill \\ {} \hfill & {} \hfill & { + \mathop {\sum}\limits_{q^\prime ,a^\prime } \delta (q_i,a_i, \circ ,q^\prime ,a^\prime )\left. {|0,\emptyset ,a_{i - 1},2,q^\prime ,a^\prime ,0,\emptyset ,a_{i + 1}} \right)} \hfill \\ {} \hfill & {} \hfill & { + \mathop {\sum}\limits_{q^\prime ,a^\prime } \delta (q_i,a_i, \to ,q^\prime ,a^\prime )\left. {|0,\emptyset ,a_{i - 1},0,\emptyset ,a^\prime ,2,q^\prime ,a_{i + 1}} \right).} \hfill \end{array}$$ (10)

We can think of G as a controlled affine transformation that does nothing if the input has s i ≠1 and performs the transition step of the AffTM otherwise. (We may extend this to define G|y) = |y) for any other basis state |y), where \(y \in \{ 0,1\} ^{3\ell }\) does not encode a valid tuple (s i−1 , q i−1 , a i−1 , s i , q i , a i , s i+1 , q i+1 , a i+1 ).) As the configuration of the AffTM is an affine combination of vectors encoding tuples |s −t , q −t , a −t , …, s t , q t , a t ), and as we have defined the action of G (when tensored with the identity on cells on which it does not act) on all such vectors, extending linearly uniquely defines G’s action on all configurations of the AffTM. Note that some linear combination of vectors with s i ≠ 1 can lead to the same output as when G is applied to a vector with s i = 1, so that G may not be reversible. This may be expected, as affine transformations are not reversible in general; nor is there any requirement in the setting of operational theories to realise transformations reversibly.

We construct B using a cascading sequence of G gates, acting on the wires 1 through \(3\ell\) (representing cells −t, −t + 1, and −t + 2), then on the wires \(\ell + 1\) through \(4\ell\), then \(2\ell + 1\) through \(5\ell\), and so forth, as illustrated in Fig. 4. This in effect scans over the contents of the tape of the AffTM M, doing nothing in most cases but simulating one of transition of M on the triple whose middle cell contains the head at the beginning of the transition. The I gates then flip the value of each s i , so that the next simulation step can be performed. In this way, B simulates one step of the AffTM.

We describe the initial state of the tape of M by setting \(a_0a_1 \cdots a_{n - 1} = x_1x_2 \cdots x_n\) (where x ∈ Σ* is the input of length n), and setting a i to the blank symbol for i < 0 and i > n. We describe the initial head position of M by setting s 0 = 1 and s i = 0 for i ≠0; similarly we set q 0 ∈ Q to the initial state of M and q i = ∅ for i ≠ 0. This describes the initial state |s −t , q −t , a −t , …, s t , q t , a t ) which is the input to the affine circuit. The run time of the simulated machine is t, so by concatenating t instances of B acting on the initial state, we obtain an affine circuit simulating the entire run of M, producing a distribution |ψ x ), which is an affine combination of basis vectors |s′ −t , q′ −t , a′ −t , …, s′ t , q′ t , a′ t ) representing the final configuration of all of the branches of the AffTM.

As the position of the head in M in each branch may be different, we define another gate which will allow us to localise the final state of M in a definite subsystem. We define a gate S acting on \(2\ell\) wires which transforms \(\left. {|0,q^{\prime}_i,a^{\prime}_i,1,q^{\prime}_{i + 1},a^{\prime}_{i + 1}} \right) \mapsto \left. {|1,q^{\prime}_{i + 1},a^{\prime}_{i + 1},0,q^{\prime}_i,a^{\prime}_i} \right)\), and leaves all other basis states unchanged. By performing a cascade of S first on the wires \((2t - 1)\ell + 1\) through \((2t + 1)\ell\) (representing cells t−1 and t), then on \(2(t - 2)\ell + 1\) through \(2t\ell\) (representing cells t−2 and t−1), and so forth, each standard basis state is mapped to one of the form \(\left. {|1,\bar q,\bar a,s^{\prime}_0,q^{\prime}_0,a^{\prime}_0, \ldots } \right)\) for some \(\bar q\) which is either the accept state A or reject state R. Acting on |ψ x ), this cascade of S gates produces a vector

$$\left. {|\varphi _x} \right) = \left. {|1,{\mathrm{A}}} \right)\left. {|\varphi _{{\mathrm{A}},x}} \right) + \left. {|1,{\mathrm{R}}} \right)\left. {|\varphi _{{\mathrm{R}},x}} \right).$$ (11)

By the conditions on the acceptance weight of M, the sum w A,x of the coefficients of |ϕ A,x ) satisfies either \(w_{{\mathrm{A}},x} \in \left[ {0,\frac{1}{3}} \right]\) or \(w_{{\mathrm{A}},x} \in \left[ {\frac{2}{3},1} \right]\); the same holds for the sum w R,x of the coefficients of |φ R,x ). Applying the operator j (u| = j (0| + j (1| on all wires, except for the wires 3 through \(\left\lceil {{\mathrm{log}}(|Q| + 1)} \right\rceil + 2\) representing the final state A or R of M, we then obtain a state

$$\left. {|\tilde \varphi _x} \right) = w_{{\mathrm{A}},x}\left. {|{\mathrm{A}}} \right) + w_{{\mathrm{R}},x}\left. {|{\mathrm{R}}} \right)$$ (12)

which is a distribution representing the probability with which M accepts x. The entire affine circuit constructed in this way is illustrated in Fig. 5.

Fig. 5 Schematic illustration of an affine circuit M n simulating an affine Turing Machine (AffTM) M on inputs of length n, which halts in time t. This includes t copies of the gate B, each of which decomposes as the sub-circuit illustrated in Fig. 4 and simulates one transition of M. The gate S serves to simulate shifting the head of the AffTM to the leftmost of a pair of cells; the cascading sequence of S gates serves to shift the head to the left-most cell in every branch of the computation, regardless of its final position when M halts. The preparations |c i ) represent the initial configuration of the AffTM, preparing basis states |c i ) = |s i , q i , a i ) where s 0 = 1 and q 0 is the AffTM initial state (and s i = 0, q i = ∅ for all i ≠ 0), and where the symbols a i represent the symbols written on the ith cell of the tape. The final operations \(\left( {u|} \right. = \mathop {\sum}

olimits_e {\left( {e|} \right.}\) on each cell serves to deterministically erase the information simulating the ith cell; the operation U on the left-most cell similarly erases all information except for the distribution \(\left. {|\tilde \varphi _x} \right)\) representing the weights of the AffTM on the final internal states |A) and |R) Full size image

The probability to accept is then just the factor in front of the basis state corresponding to the accepting configuration. We may thus simulate M by the t-fold application of B on the initial configuration, followed by the cascade of S gates and the application of unit effects described above.

A tomographically local theory

The preceding section shows how to construct a collection of affine circuits that simulate a proper, efficient AffTM. In order to prove Theorem 2, this section constructs in turn a tomographically local operational theory, which can simulate a proper, efficient AffTM. It is important that tomographic locality is satisfied in order that Theorem 2 serves as a converse to Theorem 1. As discussed in ref. 23 theories that do not satisfy tomographic locality may have additional holistic degrees of freedom pertaining to composite systems. Without further constraint, there is nothing to stop such additional degrees of freedom enabling arbitrarily powerful computation.

It is tempting to suppose that we need only construct an operational theory that includes the affine circuits of the last section. Each of the affine circuits outputs a state given by Eq. (13), with accept and reject weights w A,x and w R,x , and it follows from the premise that M is a proper AffTM that w A,x , w R,x ∈ [0, 1]. Hence if a circuit, representing an experiment in an operational theory, consists of the affine circuit, followed by a final measurement onto |A) and |R), the probabilities for the outcomes are at least guaranteed to be bounded by 0 and 1. Of course, closed circuits formed of arbitrary compositions of the same set of gates are not guaranteed to yield coefficients for measurement outcomes ∈ [0, 1], hence cannot be assumed to correspond to valid experiments. For this reason, the operational theory would be a non-free theory, with the set of allowed circuits containing those necessary for the simulation of proper, efficient AffTMs, but not allowing arbitrary rearrangements of gates.

Even with the allowance of a non-free theory, however, it is not sufficient to define an operational theory as allowing exactly those circuits constructed above, along with a final accept/reject measurement. Without further structure, such a theory would simply be a theory of elaborate preparations of a 2-dimensional system, whose states define probabilities for the acceptance and rejection outcomes. Additional structure is needed for the theory to satisfy tomographic locality, in such a way that states, transformations and effects correspond to the vectors and matrices that are involved in the construction of the affine circuits.

The idea, therefore, is to allow circuits consisting of the initial part of one of the affine circuits, followed by measurements with outcomes corresponding to the basis states of each wire. If the effects were literally those dual to the basis states, this would suffice for tomographic locality; but the theory would not be well defined, because such effects would not in general yield sensible probabilities for outcomes. We therefore employ a trick, which is to allow only highly noisy versions of these measurements. If we additionally admix a small amount of noise with the final accept/reject measurement, then the theory can be shown to satisfy tomographic locality, to return sensible probabilities for measurement outcomes in all allowed circuits, and to be able to simulate a proper, efficient AffTM with bounded error. The precise construction is as follows.

Let {M n } n≥1 be the family of affine circuits, simulating a proper AffTM M on inputs of length n ≥ 1. For each n, define types such that each wire gets a type ν n . This allows that the type of system involved can be distinct for each circuit in the family. From hereon, however, we consider a fixed n, suppressing the dependence of the type on n, and writing simply ν. Define an initial segment of M n to consist of any fragment that can be completed to the whole circuit M n by the post-composition of an appropriate sequence of gates (including, as a special case, M n itself). The closed circuits allowed by the theory consist, for each n, of an initial segment of M n , followed by measurement devices attached to any dangling wires.

First, for any system type X, there exists a measurement device realising the trivial measurement: the device pointer has only one position, which occurs with certainty. The outcome of this device corresponds to a deterministic effect, and the outcomes of any other measurement will correspond to effects that sum to the same deterministic effect, hence the theory is causal. For systems of type ν, the deterministic effect is given by

$$\,{}_

u \left( {u|} \right. = \,{}_

u \left( {0|} \right. + \,{}_

u \left( {1|} \right..$$ (13)

For a composite system of type X, the deterministic effect X (u| is given by parallel composition. The deterministic effect may be appended to any dangling wire, following an initial segment of M n .

Second, we define the measurements that enable local tomography. Define effects

$$\begin{array}{l}\,{}_

u \left(a_0\right| = p_

u \left({\,}_

u \left(0\right|\right) + \frac{{\left( {1 - p_

u } \right)}}{2}\left({\,}_

u \left(u\right|\right),\\ {\,}_

u \left(a_1\right| = p_

u \left({\,}_

u \left(1\right| \right) + \frac{{\left( {1 - p_

u } \right)}}{2}\left({\,}_

u \left(u\right|\right),\end{array}$$ (14)

where p ν is a parameter to which we return below. These two effects satisfy

$$\,{}_

u \left( {a_0|} \right. + \,{}_

u \left( {a_1|} \right.{\mathrm{ = }}\,{}_

u \left( {u|} \right.,$$

hence may correspond to the two outcomes of a binary measurement on a system corresponding to a single wire. This measurement may be appended to any dangling wire, following an initial segment of M n .

Finally, there is the accept/reject measurement, which is a joint measurement defined on log(|Q| + 1) systems of type ν. Let the unit effect for such a collection of systems be (u| = ν (u|⊗log(|Q| + 1), and let (A| and (R| denote the duals of the basis states |A) and |R), representing the accept and reject states (respectively) of the AffTM. The operational theory will allow a noisy version of the corresponding measurement, with effects given by:

$$\left( {e_{{\mathrm{acc}}}} \right.|: = q\left( {\mathrm{A}} \right.| + (1 - q)\left( {\mathrm{R}} \right.|,$$ (15)

$$\left( {e_{{\mathrm{rej}}}} \right.|: = q\left( {\mathrm{R}} \right.| + (1 - q)\left( {\mathrm{A}} \right.|,$$ (16)

$$\left( {e_{{\mathrm{none}}}} \right.|: = \left( u \right.| - \left( {e_{{\mathrm{acc}}}} \right.| - \left( {e_{{\mathrm{rej}}}} \right.|,$$ (17)

with q fixed independently of n, and essentially arbitrary as long as 1 > q > 1/2. On pain of generating a disallowed circuit, this measurement cannot be appended to an arbitrary initial segment. The measurement can only be performed following an initial segment that is almost the whole of M n , including at least all of the S gates and the final U gate (see Fig. 5), and can only be performed on the log(|Q| + 1) systems that are the output of the U gate.

The idea of this construction is that (separately for each value of n, the size of the problem input) the parameter p ν can be chosen small enough that the measurements appearing in an allowed circuit always result in probabilities for outcomes that are bounded between 0 and 1. To see this, consider first those allowed circuits that include noisy tomographic measurements, but do not include the final accept/reject measurement. For these circuits, if p ν = 0 then the outcomes of the noisy tomographic measurements each occur, independently, with probability 1/2, regardless of the state. Now consider those allowed circuits that include the final accept/reject measurement, but where the final ν (u| effect on one or more of the other wires has been replaced by noisy tomographic measurements. In this case, the probabilities for the accept and reject outcomes are bounded between q and 1−q, hence strictly between 1 and 0. It follows that if p ν = 0, then the joint probability for either accept or reject, along with any sequence of outcomes for the tomographic measurements, is also strictly between 0 and 1. Now, in the theory under construction, there are only finitely many initial circuit fragments (in the partial construction of a single circuit on inputs of length n) on which to perform measurements. Continuity of the outcome probabilities in the effects therefore ensures that there exists a value p ν > 0 such that joint outcome probabilities are contained in the interval [0, 1], for all circuits that can be constructed from systems of type ν. Fixing such a value of p ν results in noisy measurements that are sufficient for tomography on system ν.

Given a language decided by a poly-time, proper, bounded-error AffTM, the corresponding circuit family in the operational theory will accept yes-instances and reject no-instances with probabilities ≥ (1 + q)/3. If probabilities ≥ 2/3 are required, they can be achieved by running several circuits in parallel. The final step in the proof of Theorem 2 is to show how to combine the preceding constructions to describe an operational theory G not just for a single language in AWPP, but for the entire class.

As shown above, every problem in AWPP can be solved with bounded error by a proper affine Turing machine (AffTM) which halts in polynomial time. Conversely, any poly-time proper AffTM which has an acceptance weight either \(\ge \frac{2}{3}\) or \(\le \frac{1}{3}\) for all inputs, defines a language L ∈ AWPP. We then define a theory G which simply contains enough devices and system types to simulate every such AffTM, and only these AffTMs. In this theory, each system type is parametrised by a (poly-time, proper, bounded-error) AffTM M and an input size n ≥ 1; and each device is one of the sort described in the previous sections, also parameterised by (M, n). The devices G M,n , S M,n , I M,n , and the various preparations and measurements for each system type, may then be used to construct circuits C M,n to simulate the AffTM M on inputs of size n; and for each such M, there will be a deterministic Turing machine U which can generate C M,n in poly(n) time.

To summarise: for any L ∈ AWPP, there is a poly-time, proper AffTM M which decides L with bounded error, which may be simulated by an affine circuit family {M n } n≥1 . This affine circuit family may be constructed uniformly, by the fact that it simulates an AffTM which halts in polynomial time. The family {M n } n≥1 may itself be simulated by a uniform circuit family {C M,n } n≥1 consisting of allowed experiments in the theory G. Then G is a non-free theory in which AWPP ⊆ BGP. Together with Theorem 1, this concludes the proof of Theorem 2.

Promise problems

One might wonder if efficient quantum computation can achieve the bound of Theorem 1. The following complexity-theoretic argument may be considered evidence against such a possibility.

Theorem 3

If PromiseBQP = PromiseAWPP, then

$${\mathrm{NP}} \subseteq {\mathrm{BQP}} \subseteq {\mathrm{AWPP}}.$$ (18)

Here, the classes PromiseBQP and PromiseAWPP are promise versions of the classes BQP and AWPP, meaning that they contain promise rather than decision problems. A promise problem is a generalization of a decision problem, where the input is promised to belong to a subset of all possible inputs, so that there are disjoint subsets Π ACCEPT , Π REJECT ⊆ Σ* of inputs to be accepted or rejected (respectively), but which do not exhaust the set of all inputs. If an input belonging to neither Π ACCEPT nor Π REJECT is given to an algorithm for a certain promise problem, no requirements are placed on the output.

While, logically speaking, it could turn out that BQP = AWPP without PromiseBQP = PromiseAWPP, this seems unlikely. Indeed, problems which are often regarded as complete for BQP or AWPP, respectively, are in fact promise problems. Hence, PromiseBQP and PromiseAWPP can be loosely thought of as characterising the power of BQP and AWPP, respectively. It is also believed unlikely51,60,66 that NP is contained in either BQP or AWPP. Hence Theorem 3 can be regarded as evidence against the assertion that the computational power of quantum theory in the promise problem setting exactly equals PromiseAWPP, and this in turn may be regarded as evidence against the possibility that BQP = AWPP.

The proof of Theorem 3 is as follows.

Proof

Recall that UNIQUE-SAT is the problem of deciding whether a given Boolean formula has exactly one satisfying truth assignment, or no satisfying assignment at all, promised that one of these is the case. It is known that UNIQUE-SAT is contained in PromiseUP, which is a subset of PromiseAWPP.67

The Valiant-Vazirani theorem68 says that if one has an efficient algorithm for solving UNIQUE-SAT in conjunction with the ability to perform random reductions, then one can solve any problem in NP. More precisely, the Valiant-Vazirani theorem says the standard Boolean Satisfiability Problem SAT can be randomly reduced to UNIQUE-SAT.

Now, if PromiseBQP = PromiseAWPP then UNIQUE−SAT ∈ PromiseBQP, so that there is a uniform family of quantum circuits that solve an instance of the promise-problem UNIQUE-SAT (with no requirements made on inputs which do not respect the promise). However, a crucial point is that, as gates in quantum theory are closed under composition (in our terminology: quantum theory is a free operational theory), the output of the algorithm will always result in sensible probabilities, regardless of the input. One can therefore perform the random reduction of Valiant-Vazirani in quantum theory (randomly generating an appropriate instance of SAT, and using this to generate an appropriate experiment of the sort that solves UNIQUE-SAT with bounded error), and run the algorithm many times on each input produced by the reduction to test whether it is a YES instance of UNIQUE-SAT. Performing this reduction many times enables the solution of SAT with bounded error in BQP. It then follows that NP ⊆ BQP, which using Theorem 1 gives NP ⊆ AWPP.

One might wonder why the existence of a non-free theory satisfying BGP = AWPP does not immediately imply NP ⊆ AWPP. The answer is that the theory we have constructed does not necessarily allow the efficient solution of PromiseAWPP problems, since the circuits required to simulate Affine Turing Machines that only have proper behaviour on a subset of inputs are not in the allowed set defined by the theory.

One may then ask: why not construct an operational theory that does contain circuits corresponding to simulations of the improper Affine Turing Machines that solve PromiseAWPP problems? In this case, the Valiant-Vazirani reduction does not go through, since the reduction assumes that it is possible to at least run the computation on inputs that do not satisfy the promise; attempting this in the operational theory must be disallowed since it may result in negative probabilities. On a related note, we would argue that such a theory should be excluded on the grounds discussed at the end of the Methods section.

On computation in non-free theories

This section concludes by addressing a certain issue, which might arise with non-free theories: what if an agent can solve a hard problem (say, outside of AWPP) by simply observing whether a certain type of system exists in the universe or not? Or by simply observing whether a given circuit can be constructed or not? This would amount to a form of cheating, somewhat akin to the construction of non-uniform circuits in the classical or quantum cases. If such cheating were possible in a universe described by a non-free theory G, this would not contradict the claim that BGP ⊆ AWPP, which is a formal mathematical theorem. But it would undermine the significance of the claim, since the definition of BGP could not be said to accurately capture the set of problems that an agent can efficiently solve by physical actions that the agent can do.

Concerning the first of these possibilities, our answer is that we have not said anything about how difficult it is to determine whether a given type of system exists in the universe or not: we can suppose, e.g., that the universe is infinite, and that given a classical description of an Affine Turing Machine, there is no step-by-step procedure that an agent can follow to determine if a corresponding type of system exists. Hence there is no easy way for an agent to solve the (uncomputable) problem of whether a given Affine Turing Machine is proper or not.

Concerning the second possibility, if a particular type of system is employed, the theory we construct does not allow a hard problem to be solved by finding out if a circuit is allowed or not. A closed circuit is allowed if it corresponds to an implementation of the corresponding Affine Turing Machine (or an initial segment thereof, with subsequent noisy measurements), and this is easy to check with a classical computation, hence the observation that a given circuit can or cannot be constructed cannot solve any harder problem. We argue therefore that we can rule out cheating in the theory described. More generally, one might require of a non-free theory something like the following: there exists a deterministic Turing machine, such that if the input is a description of a circuit, then on the promise that all the devices in the circuit exist in the universe, the machine decides in poly time whether the circuit is allowed or not. If the input is not a valid circuit, or contains devices that do not exist, then the output is unconstrained.

Note added—While writing up the current work we became aware of the related but independent work,69 on the characterization of AWPP.