Quantum algorithmic measurement

There has been recent promising experimental and theoretical evidence that quantum computational tools might enhance the precision and efficiency of physical experiments. However, a systematic treatment and comprehensive framework are missing. Here we initiate the systematic study of experimental quantum physics from the perspective of computational complexity. To this end, we define the framework of quantum algorithmic measurements (QUALMs), a hybrid of black box quantum algorithms and interactive protocols. We use the QUALM framework to study two important experimental problems in quantum many-body physics: determining whether a system’s Hamiltonian is time-independent or time-dependent, and determining the symmetry class of the dynamics of the system. We study abstractions of these problems and show for both cases that if the experimentalist can use her experimental samples coherently (in both space and time), a provable exponential speedup is achieved compared to the standard situation in which each experimental sample is accessed separately. Our work suggests that quantum computers can provide a new type of exponential advantage: exponential savings in resources in quantum experiments.

S ince the early days of physics, innovative methods have been invented to interrogate physical systems via experiments. By example, some experiments measure constants of nature, such as the speed of light or the charge the electron; others quantify dynamical properties of systems, such as rates of chemical reactions; yet others infer structural properties, like the symmetry group of a crystal. Often experiments seek to learn more abstract information, such as the chain of chemical reactions that comprise photosynthesis, or whether Yang-Mills theory describes the strong force. We can ask: what exactly is an experiment, in its full scope of generality?
Over the past two decades, we have witnessed a new era in this respect, in which ingredients, ideas and concepts originating from the world of quantum computation are being incorporated into the experimental physics toolbox  . This body of work constitutes strong evidence that leveraging quantum computational resources to manipulate and measure physical systems may dramatically enhance experimental capabilities. However, what is the extent of these improvements? And what is the right model in which one can study the possibilities and limitations of these more general quantum experiments? A theoretical framework for the systematic study of general quantum experiments, and the resources they require, does not exist yet. The quantum Church Turing thesis 26 suggests that any physical process can be efficiently (i.e., with only polynomial overhead) simulated by a quantum algorithm applying local quantum gates. This observation not only constitutes the pillar on which the entire theory of quantum algorithms and quantum computational complexity stands, but it has also had a profound impact on our understanding of quantum physics in the past two decades (see, e.g. ref. 27 ). We take this insight one step further to the setting of quantum experiments.
In this work we provide a computational complexity framework for quantum experiments. We argue that (i) Experiments should be viewed as generalizations of quantum algorithms. They can be studied and designed abstractly, using quantum gates and circuits. (ii) One can study the computational complexity of quantum experiments, as an extension of the way the computational complexity of quantum algorithms is studied. We thus use the language of computational complexity to define an abstract model of general experiments, which we call quantum algorithmic measurements, or QUALMs, which we hypothesize is universal for quantum experiments. Initial seeds for our approach were given in 24,28 .

Results
The quantum algorithmic measurement framework. Our starting point is the postulate that the goal of any physical experiment is to compute a function from an input physical system to a classical outcome. The value of the function holds the information that the experimentalist wishes to extract about that physical system. In contrast to standard (quantum or classical) algorithms, the input for a physical experiment is a physical system; the experimentalist is not given a full classical description of it. Instead, access to the physical input system is mediated by quantum operations and measurements, which in general provide only limited information.
A first natural attempt is to model experiments as "black box" quantum algorithms: queries to the physical system (namely applications of the unknown superoperator describing the system) are interlaced with controlled quantum computations applied by the experimentalist. However, it turns out that this model is not general enough to describe all quantum experiments; in particular, it does not allow the physical system being studied to maintain its own inaccessible (or private) quantum memory.
Towards defining a universal model of experiments, consider the concrete example of an X-ray diffraction experiment, performed to determine the crystal structure of a material. The experiment involves a crystal sample; X-ray photons, which exhibit an electromagnetic interaction with the crystal; and a camera as well as other lab equipment, which only interact with the photons (see Fig. 1(a)). This is a very general situation: in a physical experiment, the experimentalist usually cannot fully interact with all degrees of freedom of the physical system she desires to measure. We thus model a general experimental system as consisting of three subsystems (registers). The first is called "Nature", denoted by N, which we view as the system that Nature holds secretly, and to which the experimentalist has no direct access in the experiment (this is the crystal in the above example). Our apparatus in the lab is denoted by W for "work space" (e.g. the camera and data processors in the X-ray example). The degrees of freedom that the experimentalist does have access to, but which couple to the hidden degrees of freedom of N, comprise the "lab" register L (e.g., the X-ray photons).
In the X-ray example, the input physical system, which the experimentalist would like to measure or learn about, can be described by the combination of the (unknown) state and structure of the crystal, together with the (unknown) interaction between the crystal and the photons (it is unknown since it is a function of the unknown properties of the crystal). More generally, we model an input physical system by a lab oracle. The description of the lab oracle contains the initial state of the hidden degrees of freedom N, its dynamics, and the interaction between N and L.
Definition 1 (Roughly) A lab oracle is described by a pair LOðN; LÞ ¼ ðE NL ; ρ N Þ, where E NL is a superoperator acting jointly on N and L, and ρ N is the initial state of the N system.
Our general model of a physical experiment is described in Fig. 1(b). We model a physical experiment as an interactive protocol applied between the work space W and Nature N; these two registers communicate using the lab register L, which serves as a "message" register. The superoperator E NL describing the interaction between L and N, given by the physical system to be measured or probed, is unknown and is viewed as a black box, which can be "queried"; namely, it can be applied at will by the experimentalist. The addition of the Nature register N allows us to arrive at a rather simple hybrid model, which combines two basic models in computer science: interactive protocols, and black box algorithms.
We next introduce a notion paralleling that of a computational problem in the algorithmic world. It is called a Task, and it encapsulates the experimental goal that the experimentalist wishes to achieve. The Task consists of the information that the experimentalist wishes to extract, expressed as a function from lab oracles (capturing physical systems) to classical outputs. It also includes the constraints on the experiment due to various limitations in the lab, specified by the admissible gate set. These gates are constrained to not act on N, and they can also express additional constraints in the labratory such as geometric restrictions on the interactions.
Definition 2 (Roughly) A task is a tuple Task ¼ ðS in ; S out ; f ; GÞ, associated with a given system N ⊗ L ⊗ W. Here, S in , S out ⊆ W consist of p and q qubits respectively; f is a function f : fLO 0 ; LO 1 ; LO 2 ; :::g f0; 1g p À!f0; 1g q ; and G is a set of admissible gates on L ⊗ W. In the domain of f, {LO 0 , LO 1 , LO 2 , . . . } is a set of lab oracles.
Note that the function f in the above definition has as its inputs not only the lab oracle, but also a classical bit string. The latter should be thought of as additional parameters that describe the desired data, e.g. the specification of the temperature at which the experimentalist may want to perform a certain experiment. While in the above definition the output of f is deterministic, a very natural generalization is for the output to be a probability distribution over classical output strings; this allows expressing approximated tasks or taking into account finiteness of precision (see discussion in Example 1 in the Supplementary Information).
Finally we can define a QUALM; this specifies an experimental protocol, i.e., a way to implement the experiment such that it achieves the desired task.
Definition 3 (Roughly) A QUALM(N, L, W) is a specification of a sequence of admissable gates from a set G on the subsystems L, W, interlaced with applications of a black box operator □ acting on N, L; some of the qubits (i.e., those in S in ) in the register W are marked as inputs and some (i.e., those in S out ) as outputs.
We note that this definition is tightly related to the definitions of quantum strategies 29 and quantum combs 30 introduced in the context of quantum interactive protocols or games. A QUALM is designed in order to achieve a specific experimental Task. To see which Task is achieved by the QUALM, we can view the QUALM naturally as a map from the input lab oracle ðE NL ; ρ N Þ to a standard quantum circuit, acting on N ⊗ L ⊗ W, whose input bits are in S in and output bits are in S out . N is initialized to ρ N , all qubits in W and L except for S in are initialized to 0, and the input to the circuit is given in S in . The circuit applies to this initial state the gate sequence of the QUALM, where whenever □ appears, E NL is applied. The output of the circuit is given by measuring S out in the computational basis. We say that a QUALM achieves a given Task if (i) the sets G; S in ; S out are the same for the QUALM and the Task, and (ii) for every lab oracle LO and input string x to S in , the result of the measurement of the output qubits S out (after the application of the corresponding circuit) is equal (or close, in cases of approximations) to f(LO, x), with f being the Task function.
The computational complexity of a QUALM is the number of gates plus the number of lab oracle applications; the QUALM complexity of the Task is that of the most efficient QUALM that achieves it. We propose that QUALM complexity is a standardized way to quantify and study the (asymptotic behavior of the) cost of achieving an experimental task in the laboratory.
In the Supplementary Information, we provide a versatile set of examples for how different experimental tasks can be viewed as Tasks and be realized by QUALMs. We hypothesis that the QUALM framework is a universal model for quantum experiments, in the sense that any physical process realizing an experimental task can be simulated efficiently (i.e., with at most polynomial overhead in all resources) by a QUALM; in other words, we speculate that the quantum Church Turing thesis can be extended from computational problems to experiments, by generalizing quantum algorithms to QUALMs. We stress that all the ingredients included in the QUALM framework seem to be necessary for its universality; in particular, the register N is necessary in order to describe some of the more sophisticated physical experiments (see, e.g., the verification example in Supplementary Note B in the Supplementary Information). We thus arrive at a framework that allows us to initiate a rigorous study of the resources required in order to perform physical experimental tasks.
Exponential advantage of coherent QUALMs. An overwhelming majority of quantum experiments performed in contemporary laboratories are of a much more restricted type than general QUALMs. In those more restricted experiments, which we call incoherent QUALMs, the physical system is usually probed by preparing it in some state, possibly letting it evolve, applying a measurement, and then post-processing the measurement's Schematic of a quantum algorithmic measurement. a Illustration of a QUALM for X-ray diffraction, where N is the crystal sample, L consists of the X-ray photons (including the incoming and outgoing ones), and W contains the camera and other lab equipment for taking and processing the image. b Schematic illustrating the structure of a QUALM as an interaction between Nature and the experimentalist's controlled degrees of freedom. Here N represents the 'Nature' register, L is the 'lab' register, and W is the 'working space' register. The experimentalist does not have direct measurement access to the N register, which should be thought of as the "hidden" degrees of freedom of the physical system on which the experiment is conducted. The initial state on N is ρ N , and the input and output subsets of W are specified. outcome classically. This may be repeated many times, and the initial state and the basis of measurement may even depend adaptively on previous outcomes. The key point is that these experiments do not utilize coherence between different accesses of the lab oracle, or between the lab space and the working space. We formally define incoherent QUALMs using the notion of LOCC (local operations and classical communication) protocols; see Fig. 1(c).
The first question we choose to address in the QUALM framework is whether generalizing quantum experiments beyond incoherent QUALMs, could lead to significant savings in resources in physics experiments. To this end, we compare incoherent QUALMs to the most general possible QUALMs, which are allowed to leverage a full-fledged quantum computer, apply quantum gates on the lab register during the experiment, and so on. We refer to these general, unrestricted experiments as coherent QUALMs.
We study this question in the context of two basic experimental tasks. The first is the task of distinguishing a Floquet system from a random quantum evolution. Roughly speaking, we want to design an experiment that distinguishes a fixed Hamiltonian from a time-dependent, random Hamiltonian. We consider the following toy version of this problem: Definition 4 (The fixed unitary problem) (Roughly) Consider two lab oracles LO 0 and LO 1 , corresponding to two physical systems. The first lab oracle LO 0 picks a Haar-random unitary, remembers it (forever), and then subsequently applies that same unitary to L each time the oracle is called. By contrast, the second lab oracle LO 1 applies a new Haar-random unitary to L each time the oracle is called. The goal is to distinguish between LO 0 and LO 1 with non-negligible success probability.
There is a very simple coherent QUALM that distinguishes between LO 0 and LO 1 : just call the lab oracle twice and perform a SWAP test on the two output states. Indeed, variants of the fixed unitary problem and the SWAP protocol have been previously studied (see e.g. 31,32 ). However, it turns out that an incoherent QUALM would require exponential resources. Here we provide such an exponential complexity separation. This is implied by the following lower bound: Theorem 1 (Exponential lower bound for incoherent adaptive QUALMs for the fixed unitary problem) (Roughly) For any incoherent QUALM for the "fixed unitary problem" on ℓ qubits (i.e., L has ℓ qubits), its QUALM complexity is lower bounded by an exponential in ℓ, namely Ω(2 2ℓ/7 ).
The proof is not too difficult if the incoherent QUALM is nonadaptive, however the argument becomes far more complicated in the adaptive setting. We sketch here the two key points of the proof (See the Methods section and the Supplementary Information for more details).
The first is to reduce incoherent QUALMs to simple measurement QUALMs. In a generic incoherent QUALM, there can be multiple rounds of classical communications between L and W, before and after each application of the lab oracle (see Fig. 1(c)). However, we show that a generic incoherent QUALM is equivalent to a probabilistic average over a family of "simple measurement QUALMs", which refers to special incoherent QUALMs that simply (i) prepare a state, (ii) apply the lab oracle to that state, (iii) measure the result, and then repeat (i), (ii), (iii) with different settings. The state preparations and measurement bases can depend adaptively on the measurement results of previous steps.
The other key part of the proof is our lower bound for the simple measurement QUALMs required to perform the task. Let P k be the probability distribution of the k measurement results in the case of the lab oracle applying a newly-chosen random unitary each time. P k is uniformly random. Q k is the distribution over all k intermediate measurement results for the fixed unitary oracle, and we show it is exponentially close to P k . This is achieved using the Weingarten functions W(τ, D); we write: with A s and B s operators corresponding to the adaptive choice of preparation state and basis of measurement for each of the oracle calls. σ, τ are elements of the permutation group. The difficulty here is that in computing the 1-norm distance between P k and Q k , the sum over s cannot be carried over straightforwardly, due to the dependence of the input states and bases of measurement on previous measurement results. A key ingredient in the proof is to show that in the above sum, the term corresponding to each permutation τ on the k oracle calls can be partitioned to two, such that the sum associated with each part is done one by one over parameters, which are independent from the remaining parameters in the sum. Our second physically motivated task is to determine the symmetry class of the dynamics of a quantum many-body system. The symmetries of a many-body system are essential to its physical properties, and are the core of all analytic treatments. It is generally difficult to ascertain the symmetries of an uncharacterized quantum system; however, we might intuit that a quantum computer could aid in this endeavor. We study the following toy version of the problem: Definition 5 (The Symmetry Distinction Problem) Distinguish, with non-negligible success probability, between three classes of lab oracles: (i) a lab oracle LO U , which applies a fixed Haar-random unitary to the L system; (ii) a lab oracle LO O, which applies a fixed Haar-random orthogonal matrix to the system; (iii) a lab oracle LO Sp, which applies a fixed Haar-random symplectic matrix to the system. (Suppose that L contains an even number of qubits).
If one is allowed coherent access, then one can use a generalization of the SWAP test (this time on a maximally entangled state and with a little more sophistication) to determine the symmetry type of the lab oracle. However, extending the techniques used in the proof of Theorem 1, we can prove our second main theorem, stating that any incoherent (even adaptive) QUALM for the symmetry distinction problem will have QUALM complexity at least of order Ω(2 2ℓ/7 ). The idea of the proof is that LO U , LO O and LO Sp are each indistinguishable from the lab oracle LO 1 that generates a new Haar-random unitary each time it is queries, and so are indistinguishable from one another.

Discussion
Our motivation in this work is Physics. We argued that recent developments involving computational elements in quantum experiments, suggest a general model for quantum experiments, which clarifies the paradigm of experimentation itself. We have demonstrated an exponential advantage in QUALM complexity of coherent over incoherent access QUALMs (even when the latter are adaptive), for two physically motivated problems. Moreover, this exponential advantage is achieved using an very simple coherent QUALM, based solely on the SWAP test.
At first glance, it might seem that early quantum black box algorithms such as Simon's algorithm 33 already provide an exponential advantage of coherent over incoherent QUALMs, even if not for physically motivated tasks. However, when viewed as a QUALM, Simon's algorithm in fact falls within the incoherent QUALM framework. Indeed, Simon's algorithm accesses each sample separately, uses product state preparations, and only utilizes measurements in a tensor product basis. However, recently, Simon's algorithm was upgraded to a recursive version 34 , which was used to provide an example of an exponential separation between the computational power of quantum circuits (with access to a black box) of different depths. Another example of such a separation of the depth hierarchy was given in 35 . Interestingly, these results can be interpreted (with a little bit of translation work) into two other examples of exponential separations between coherent and incoherent QUALMs, albeit for tasks, which are quite contrived from a physics perspective.
It is also interesting to view related and previous works in the language of QUALMs, and compare to our work. Some previous results imply a quadratic advantage in QUALM complexity, and only under the strong assumption of non-adaptive access in the incoherent setting 36,37 . For other results an exponential lower bound is only conjectured (e.g., refs. 38,39 ). An example more closely related to our work is ref. 40 , which provides a proven exponential advantage of coherent QUALMs over what we call "single register access" (which is a restricted case of incoherent QUALMs) for a quantum state distinction problem emerging from the dihedral hidden subgroup problem. However, importantly, the coherent protocol suggested has exponential gate complexity, and so the related experiment is not known to be efficient even in the coherent access setting (also, once again, the lower bound holds only under the strong non-adaptive assumption). The recent independent work of ref. 41 studied a closely related setting, and provided an exponential query complexity separation between incoherent and coherent QUALMs for a state tomography task, using quantum machine learning; however, as in ref. 40 , the focus of ref. 41 is on query complexity; both their coherent and incoherent experiments have exponential gate complexity.
We gave the first evidence that entanglement and coherence could be truly exponentially advantageous (in terms of physical resources) when performing experiments in the lab, for physically motivated tasks. Our work suggests that coherence could be an immense resource in quantum experiments, and highlights the fact that quantum computers have a huge potential not only in speeding up the solution for computational problems, but also in providing dramatic savings in performing experimental tasks. In particular, important savings in resources may be achievable by using more sophisticated quantum algorithmic ideas, much beyond the SWAP test, which is used here.
Looking forward, we hope that the QUALM framework will be helpful in the study and development of new experimental techniques leveraging quantum computational components and ideas. Numerous interesting open questions are raised; for example, does adaptiveness help in the incoherent setting (see refs. 42,43 )? How can more sophisticated quantum input states and measurement bases help in various experiments? How much does a larger work space buy us? Importantly, the examples we provided here lose their exponential advantage in the presence of noise. Can exponential advantages in QUALM complexity be exhibited in the NISQ era? More generally, can the advantages be achieved in settings closer to reality, e.g., where the lab oracles are efficient? It would be very interesting to experimentally demonstrate advantages of coherent quantum experiments.

Methods
Notations. We consider a total Hilbert space H = N ⊗ L ⊗ W (we use the same notation to denote the subsystems and their associated Hilbert spaces). N stands for the "Nature" Hilbert space of n qubits, to which the experimentalist has no direct access; The "lab" Hilbert space is denoted L and consists of ℓ qubits, corresponding to the degrees of freedom of the physical system, which the experimentalist can access, and W, a subsystem of w qubits, can be thought of as the "working space" of the experimentalist. The set of states (density matrices) on each subsystem will be denoted by DðNÞ; DðLÞ; DðWÞ; :::; we similarly denote classical probability distributions on {0, 1} k by Dðf0; 1g k Þ. We denote the Hilbert space of the union of two subsystems L, W (as well as the set of qubits) by LW, or L ⊗ W. Operators, superoperators, as well as sets thereof, will be denoted using a calligraphic font: E; Q; O etc. We will often abuse notation, and refer to an ordered sequence of superoperators Q ¼ ðQ 1 ; Q 2 ; :::; Q k Þ as equal to the operator Q ¼ Q k Á Á Á Q 2 Q 1 , which is the result of applying the superoperators in the sequence in the given order.
The QUALM framework. We now provide the definitions required for the QUALM framework; The setup is summarized in Fig. 1. Our first definition is that of the lab oracle; it models the input physical system on which the experiment is performed.
Definition 6 (Lab Oracle). A lab oracle is specified by a pair LO ¼ ðE NL ; ρ N Þ where E NL is a quantum superoperator (i.e. a completely positive trace-preserving map) on N ⊗ L and ρ N is state on N. The set of lab oracles is denoted by LOðN; LÞ. Now we define the notion of a task, which corresponds to the "experimental problem" to be solved: it describes what it is that the experimentalist wants to measure. The experimentalist must achieve the task only by using the lab oracle superoperator, together with the operations at her disposal in her laboratory (i.e., the admissible gates on L ⊗ W).
Definition 7 (Admissible gates). We denote by G a set of "admissible gates", namely a set of quantum superoperators acting on L ⊗ W. (Note that superoperators include measurements).
Definition 8 (Task). A 'task' is a tuple Task ¼ ðS in ; S out ; f ; GÞ, associated with a given system N ⊗ L ⊗ W (which is usually implicit). Here, S in is a p-qubit subsystem of W, S out is a q-qubit subsystem of W, f is a function f : fLO 0 ; LO 1 ; LO 2 ; :::g f0; 1g p À!f0; 1g q ; ð3Þ and G is a set of admissible gates on L ⊗ W. In the domain of f, {LO 0 , LO 1 , LO 2 , . . . } is a set of lab oracles (here we denoted this set as discrete, but of course one can also consider a continuous set of lab oracles as input), i.e. a subset of LOðN; LÞ. This definition can be thought of as follows. Given a set of lab oracles that represent possible input physical systems, the task is to compute the function f, which takes as input a lab oracle, some classical lab settings (i.e., bit strings in {0, 1} p ), and outputs a classical 'experimental result' (i.e., bit strings {0, 1} q ). The task is to be achieved by constructing a circuit from admissible gates in G, in conjunction with interspersed calls to the lab oracle superoperator. In many situations it is more natural to consider output probability distributions and define f to be f : fLO 0 ; LO 1 ; LO 2 ; :::g f0; 1g p À!Dðf0; 1g q Þ : Such is the case for classical sampling tasks, for continuous sets of input lab oracles (see example 2 in subsection 2.5 in Supplementary Information), as well as in the context of the task of distinguishing between lab oracles, which is the main focus of this paper; in this case, this generalized notion of a task in fact reduces to Definition 8.
We can now define a QUALM, which can be viewed as a specific choice of protocol for the execution of a Task.
Definition 9 (QUALM) A QUALM over the set of admissible gates G acting on registers L, W, is an ordered sequence of symbols Q ¼ ðQ 1 ; Q 2 ; :::; Q final Þ from the alphabet G ∪ f&g, together with a specification of input and output subsystems S in , S out ⊆ W. Here, we are treating G as a set of symbols (i.e., each gate labels a distinct symbol) and likewise □ is a symbol. Each QUALM has an associated map This function takes in a lab oracle LO, and outputs a quantum circuit on N ⊗ L ⊗ W. Specifically, QUALM(LO) 'compiles' a quantum circuit Q ¼ ðQ 1 ; Q 2 ; :::; Q final Þ where each symbol in G is replaced by its corresponding gate, and each □ is replaced by the superoperator E NL corresponding to LO. S in , S out correspond to the input and output subsystems of the resulting circuit, respectively. In less formal terms, a QUALM is a quantum circuit built out of an admissible gate set, where the circuit has designated spots for a lab oracle superoperator to be inserted, and specified input and output qubits.
Now we explain what it means for a QUALM to achieve a particular Task. We first define the output density matrix of a QUALM for a given lab oracle LO. The idea is to compile the quantum circuit QUALM(LO) for the lab oracle LO, and then to use it to evaluate f(LO, x). To do so, we construct the initial state of the circuit to be (i) ρ LO N (i.e. the state corresponding to the lab oracle LO) on N, (ii) x j i x h j on S in , and (iii) the zero state elsewhere. The full initial state will be denoted as ρ LO N x j ihxj S in j0i 0 h j. We will run the initial state through the circuit QUALM(LO), and then trace out everything not in S out : Note that this definition reduces to stadard quantum algorithms, by letting the set of lab oracles in the domain be the empty set.
Remark 1 (Subroutines, Error reduction by repetition, Approximation). We remark that standard manipulations from the theory of algorithms carry over to the QUALM setting in a natural way. In particular, a QUALM can be used as a subroutine by another QUALM, as long as they both act on the same lab register L (like in standard subroutines, we can decide which qubit "wires" to glue from the original QUALM to the input qubits of the subroutine QUALM, and similarly for the outputs).
Using such subroutine QUALMs, one can achieve error reduction (also known as amplification); this is a standard primitive in probabilistic algorithms 44 , which is also needed in this work. This is done by a straightforward generalization of the way it is done for algorithms. For example, suppose we want to reduce the error probability of a given QUALM, which achieves a certain deterministic task with error 1/3; and further suppose that the image of the function f has a single output bit, measured at the end of the QUALM in the computational basis. One can construct a new QUALM 0 , which first copies the p-bit input string xm times (for some desired amplification parameter m). It then applies QUALM as a subroutine m times, each time with a new set of qubits initialized to 0 (which together with the p qubits containing the appropriate copy of x, constituting the working register W of the particular subroutine). QUALM 0 then applies a majority calculation on all outputs of the m subroutines; this majority is the output bit of the QUALM 0 .
In the same manner, we can consider amplifications for QUALMs, which compute probabilistic functions. If for two different lab oracles the output distributions are δ apart in total variation distance, one can amplify the distance by repetition and classical postprocessing.
QUALM complexity. Having defined tasks and QUALMs, we now turn to defining QUALM complexity.
Definition 10 (Gate complexity, query complexity, and QUALM complexity). The gate complexity of a given QUALM over the admissible set of gates G is the length (i.e. the number of symbols from G ∪ f&g) of the sequence Q, minus the number of □ symbols. We denote this by GateComplexity[QUALM], and call this the QUALM gate complexity. Similarly, the query complexity is the number of □'s appearing in Q, and this is denoted by QueryComplexity[QUALM]. This is called the QUALM query complexity. We call the sum the QUALM complexity. The exact (respectively, approximate) QUALM complexity of a task is given by the QUALM with least QUALM complexity, which achieves the task exactly (respectively, approximately).
We also note that it might be relevant, in various situations, to weight gates versus query calls differently, namely to consider the QUALM complexity to be GateComplexity½QUALM þ λ QueryComplexity½QUALM ð 9Þ for some suitable penalty factor λ.
As usual in computational complexity 45 , one is interested in families of tasks and QUALMs, where some parameter dictating the size of the problem grows to infinity, and we ask how the complexity grows as a function of that parameter.
Different types of access to a lab oracle. Towards clarifying the power of different QUALMs in terms of their computational abilities, we consider different types of accesses of QUALMs to a lab oracle. The most natural (though presently least realistic) one is the access of a full quantum computer. By this we mean a general QUALM, without the restrictions to be specified shortly. In particular, the set of admissible gates G can be a universal set, and there is no restriction on which gates can be applied at any given time.
Definition 11 (Coherent access). We will refer to a general QUALM (i.e., with a universal gate set) defined in Definition 9 as a QUALM with coherent access to the lab oracle.
In realistic physics experiments, access is often far more limited. The experimental setup may not be able to introduce quantum entanglement between the physical system N ⊗ L and the rest of the lab W. Measurements to the system may destroy the quantum coherence in the physical system or even completely destroy the quantum state. In the QUALM framework this is captured by restrictions on the admissible gate sets and the allowed sequences of gates. To make concrete progress we consider a model of many contemporary experiments, which we call incoherent access. To this end, we need to recall the definition of a oneround LOCC protocol between two parties (see, e.g., 46 ). First, we recall that a map N R on density matrices on the register R is completely positive (CP for short) if it can be associated with a set of Kraus operators fA α g α such that for all ρ on R A completely positive trace-preserving (CPTP) map is often called, simply, a quantum channel. Now we specify a quantum channel that implements a certain kind of communication between subsystems A and B called a "one-round LOCC" (see 46 ).
Definition 12 (One-round LOCC. A one-round LOCC operator from subsystems A to B is a quantum channel (i.e. a CPTP map) E AB acting on DðA BÞ, which is of the form with M A α a completely positive (CP) map acting on the A subsystem, and N B α a completely positive and trace-preserving (CPTP) map acting on the B subsystem.
It should be noted that this definition in fact requires E A ∑ α M A α to be a CPTP map (instead of merely a CP map), since E A is the reduced channel obtained by tracing over B in E AB .
With the above definition in mind, we can now define incoherent access QUALMs: Definition 13 (Incoherent access). We say a QUALM uses incoherent access to the lab oracle if the following holds for the sequence of symbols Q. Let k be the number of times the symbol □ appears in Q ¼ ðQ 1 ; Q 2 ; :::; Q final Þ. As usual, we associate Q with the channel Q ¼ Q final Á Á Á Q 2 Q 1 , and regroup terms as where C i is a the sequence of gates applied after the ith call to the lab oracle, and before the (i + 1)st one. We require that • For each i ∈ {0, . . . , k}, the sequence of admissible gates C i can be written as an r i -round LOCC protocol, for some finite number of rounds r i . In other words, C i can be written as a composition C i ¼ C i;r i Á Á Á C i;2 C i;1 such that for every j, C i;j is a one-round LOCC channel. Without losing generality, we can assume C i;j alternates between L-to-W and W-to-L one-round LOCC channels, since the composition of two L-to-W oneround LOCC's is still a one-round LOCC.
• Moreover we also require that for each i there exists at least one index j ∈ {1, . . . , r i } such that C i;j is a complete measurement, which is a special one-round LOCC operator from L to W, as follows: such that M L α is a rank one projection for each α, i.e., M L α ðρÞ ¼ ψ α ψ α ψ α ρ ψ α for some pure state ψ α , and f ψ α g α2f0;1g ' is an orthonormal basis for L.
The above definition roughly means that the interaction between the L and W registers is an LOCC throughout the QUALM protocol; moreover, between any two applications of the lab oracle, the lab register L is measured using a complete measurement. No coherence can be generated between the state generated by a given single call to the lab oracle, and any other register used by the QUALMthis is the source for the term "incoherent access QUALM".
We note that the above definition allows adaptive access to the lab oracle; namely, the state of the register L before an application of the lab oracle may depend on previous measurement results both of L and of W, and those in turn may depend on the lab oracle.
Sketch of the proof of Theorem 1. The proof of Theorem 1 consists of two steps. The first step is to study a special case, which we call a 'simple measurement' (SM) QUALM, and show that it cannot distinguish the two lab oracles LO 1 (ℓ), LO 0 (ℓ) . The second step is to show that the output of a general incoherent access QUALM can be related to a probabilistic average of those SM QUALMs, so that a general incoherent access QUALM cannot do better than a SM QUALM. In the following we will first define the SM QUALM and sketch the proof for this special case, and then discuss how the general incoherent QUALM is reduced to SM QUALM.
Definition 14 (Roughly) Single measurement QUALM. The SM QUALM is illustrated in Fig. 2. It describes a QUALM where there is only one measurement carried out after each application of lab oracle. The measurements are of a particular form: each is a POVM in which each element is of rank one. In the ith round, the measurement output s i is recorded in a new tensor factor of W, denoted by W i . The ith POVM is thus described by We note that both y i s 0 s 1 :::s i E and λ i s 0 s 1 :::s i depend not only on s i but also on all previous measurement results s 0 , . . . , s i−1 or in short, s j<i . After the measurement, L is prepared into a mixed state σ i s 0 s 1 :::s i , which again can depend on the previous measurement results s 1 , . . . , s i−1 . After the last measurement, a readout channel C out is applied to W, which maps the diagonal density operator of W to a single qubit output state.
For the SM QUALM, the output density operator is determined by applying the readout channel C final to the diagonal density operator of W, which encodes the probability distribution of the measurement results s 0 , s 1 , . . . , s k . For the fixed random unitary lab oracle LO 0 (ℓ) (Definition 4), the probability distribution is In the following we will often denote the ordered sequence s 0 , s 1 , . . . , s k by s for simplicity. Our conclusion is that these two probability distributions Q k and P k are difficult to distinguish. More precisely, for k < 2 ' = ffiffi ffi 6 p À Á 4=7 , we will prove The key mathematical tool we use is the Weingarten functions of the unitary group: Z Here I, J, K, L label an orthonormal basis in the k-copied Hilbert space. The action of the permutation group elements σ and τ corresponds to the permutation of different Hilbert space copies. Using Eqn. (19), Q k in Eq. (16) can be rewritten as In the second step we have used trðA s σÞ ≤ 1. Carrying the sum over s and using known properties of the Weingarten function 47 , for k < 2 ' = ffiffi ffi 6 p À Á 4=7 we obtain and coefficients The remaining task is to bound T.
T contains a product of matrix elements of the form However, we can decompose this string into two segments and use the simple inequality 2|ab| ≤ |a| 2 + |b| 2 . By carefully choosing the segments, we prove that the sum over s can now be carried using the completeness condition, and the adaptiveness does not cause a problem because one can always start the sum from the latest index s k . Using this method we obtain Using Eq. (23) this proves the bound (18) with c 2 T the dominant term. The remaining task is to prove that a general incoherent QUALM ( Fig. 2(b)) cannot do better than SM QUALM. Here we will only provide an intuitive explanation of the idea, leaving more details in the Supplementary Information. In a general incoherent QUALM, multiple rounds of classical communication occur between L and W between two applications of the lab oracle. If we consider a case when the communication is only one way from L to W, then it is equivalent to a sequence of weak measurements, followed by a projective measurement in a complete basis. One can always consolidate all these measurements into a single POVM that is in the form of the one we have in SM QUALM. The problem becomes more nontrivial because there are communication from W to L, which measures the state of W, and tells L to apply a quantum channel determined by the measurement output. More precisely, the measurement corresponds to a family of CP maps M W ν . For a state ρ W , the measurement output ν has probability p ν ¼ tr M W ν ρ W À Á À Á . When the measurement output is ν, a quantum channel N L ν is applied to L. The key idea is that this procedure can always be replaced by a deterministic (i.e., classical) computation based on previous measurement results and some random numbers. In other words, even if W is a quantum computer, since it is only allowed to send classical information to L, it can be simulated by a classical computer with random number generators. Consequently, we can replace all W to L one-way LOCC by deterministic instructions with random number inputs. Then for fixed values of these random numbers, what happens to L is just some quantum channels applied between weak measurements. In this case the consolidation can be done to reduce the QUALM to an SM QUALM. This establishes that a general incoherent QUALM is equivalent to a classical probabilistic average over SM QUALMs. Since the probabilistic average cannot perform better than the best SM QUALM, we have proved Theorem 1.

Data availability
No data was collected for this work.