The complexity of simulating local measurements on quantum systems

An important task in quantum physics is the estimation of local quantities for ground states of local Hamiltonians. Recently, [Ambainis, CCC 2014] deﬁned the complexity class P QMA [ log ] , and motivated its study by showing that the physical task of estimating the expectation value of a local observable against the ground state of a local Hamiltonian is P QMA [ log ] -complete. In this paper, we continue the study of P QMA [ log ] , obtaining the following lower and upper bounds.

• We identify a flaw in [Ambainis, CCC 2014] regarding a P UQMA[log] -hardness proof for estimating spectral gaps of local Hamiltonians.By introducing a "query validation" technique, we build on [Ambainis, CCC 2014] to obtain P UQMA[log] -hardness for estimating spectral gaps under polynomial-time Turing reductions.
This work contributes a rigorous treatment of the subtlety involved in studying oracle classes in which the oracle solves a promise problem.This is particularly relevant for quantum complexity theory, where most natural classes such as BQP and QMA are defined as promise classes.

Background on Quantum Hamiltonian Complexity
The use of computational complexity theory to study the inherent difficulty of computational problems has proven remarkably fruitful over the last decades.For example, the theory of NPcompleteness [21,42,46] has helped classify the worst-case complexity of hundreds of computational problems which elude efficient classical algorithms.In the quantum setting, the study of a quantum analogue of NP, known as Quantum Merlin Arthur1 (QMA), was started in 1999 by the seminal "quantum Cook-Levin theorem" of Kitaev [45], which showed that estimating the ground state energy of a given k-local Hamiltonian is QMA-complete for k ≥ 5. Here, a k-local Hamiltonian H can be thought of as a quantum constraint satisfaction system in which each quantum clause acts non-trivially on k qubits.More formally, H ∈ C2 n ×2 n is an exponentially large Hermitian matrix acting on n qubits, but with a succinct description 2 H = i H i , where each local clause H i ∈ C 2 k ×2 k acts non-trivially on k qubits.The "largest total weight of satisfiable clauses" is given by the ground state energy of H, i.e. the smallest eigenvalue of H. Physically, the ground state energy and its corresponding eigenvector, the ground state, are motivated in that they represent the energy level and state of a given quantum system at low temperature, respectively.For this reason, since Kitaev's work [45], a number of physically motivated problems have been shown complete for QMA (this has given rise to the field of Quantum Hamiltonian Complexity, see, e.g., [52], [10] and [31] for surveys 3 ).Many of these QMA-complete problems focus on estimating ground state energies of local Hamiltonians.
Beyond ground state energies.In recent years, however, new directions in quantum complexity theory involving other physical properties of local Hamiltonians have appeared.We attempt to survey a number of such results here.Brown, Flammia and Schuch [15] (also Shi and Zhang [59]) introduced a quantum analogue of #P, denoted #BQP, and showed that computing the ground state degeneracy or density of states of local Hamiltonians is #BQP-complete.Gharibian and Sikora [30] showed that determining whether the ground space of a local Hamiltonian has an "energy barrier" is QCMA-complete, where QCMA [2] is Merlin-Arthur (MA) with a classical proof and quantum prover.This was strengthened by Gosset, Mehta, and Vidick [38], who showed that QCMA-completeness holds even for commuting local Hamiltonians.Bravyi and Gosset [12] studied the complexity of quantum impurity problems, which involve a bath of free fermions coupled to an interacting subsystem dubbed an "impurity".Cubitt, Montanaro, and Piddock [24] have shown that certain simple spin-lattice models are "universal", in the sense that they can replicate the entire physics of any other quantum many-body system.
From a hardness of approximation perspective, Gharibian and Kempe [29] introduced cq-Σ 2 , a quantum generalization of Σ p 2 , and showed that determining the smallest subset of interaction terms of a given local Hamiltonian which yields a frustrated ground space is cq-Σ 2 -complete (and additionally, cq-Σ 2 -hard to approximate).Aharonov and Zhou [3] studied the task of "Hamiltonian sparsification" or "degree-reduction", in which one attempts to simulate an input local Hamiltonian with a new local Hamiltonian with an interaction graph of bounded degree while preserving only the ground space and spectral gap (in general, [3] show this is impossible).This was in pursuit of answering whether classical proof techniques for the classical PCP theorem carry over to the quantum setting.
Finally, various authors have studied spectral gaps of local Hamiltonians from a computability theory perspective.(In computability theory, one asks whether a decision or promise problem can be decided by a Turing machine running in a finite number of steps.In the current paper, our focus is instead on complexity theory, in which problems are typically known to be computable; the question is rather to obtain an estimate of the resources the Turing machine requires to solve the problem.)Gosset and Mozgunov [37] and Bravyi and Gosset [11] have studied spectral gaps for frustrationfree 1D translation-invariant systems (the latter, in particular, shows that distinguishing between gapped and gapless phases is decidable in the spin-1/2 chains studied).Cubitt, Perez-Garcia and Wolf [23] have shown undecidability of estimating spectral gaps in the thermodynamic limit for translation-invariant, nearest-neighbor Hamiltonians on a 2D square lattice.This has very recently been improved to undecidability for 1D translation invariant systems by Bausch, Cubitt, Lucia, and Perez-Garcia [8].Note that both the current paper and [5] also study spectral gaps, but from a complexity theory perspective; in particular, in contrast to the undecidability studies listed above, which consider the thermodynamic limit (i.e. the number of qubits n goes to infinity), in our setting the number of qubits n (expressed in unary) is part of the input to the problem, as is standard in complexity theory.

Simulating local measurements on low-temperature quantum systems
In Section 1.1, we listed a number of results studying properties of local Hamiltonians beyond ground state energies.We intentionally omitted one particular problem, however, which is extremely well motivated physically and which is the starting point of this work.Suppose one cools a manybody quantum system to low temperature in the lab and a priori does not know the system's properties (such as its ground state energy, ground space, etc); this is a natural assumption, as many of these properties are QMA-complete to estimate to begin with.The most "basic" action an experimenter can now take is to perform a local measurement (typically on a constant number of qubits) in an attempt to extract information about the system.The question is: How difficult is it to computationally simulate this "basic" action?
This computational task was formalized by Ambainis [5] (formal definitions in Section 2) and designated Approximate Simulation (APX-SIM): Given a k-local Hamiltonian H and an l-local observable A, estimate the expectation value of the measurement A against the ground state of H, i.e. estimate A := ψ| A |ψ for |ψ a ground state of H.It turned out that not only is this problem "hard", but that it is in fact harder then even QMA.
To formalize this, Ambainis introduced [5] the complexity class P QMA [log] , which intuitively is "slightly harder" than QMA, and showed that APX-SIM is P QMA[log] -complete when the Hamiltonian H and observable A are both O(log n)-local.To help set context before stating our results, we now discuss P QMA[log] and its classical analogue P NP[log] in further depth.QMA[log] , and P NP [log]   Formally, P QMA[log] is the class of decision problems which can be decided by a polynomial-time deterministic Turing machine making O(log n) queries to an oracle for QMA.Thus, it is an example of an oracle complexity class.

Oracle complexity classes, P
Let us make three remarks.First, by "oracle for QMA", one typically means an oracle for a QMA-complete problem Π (since any other problem in QMA may be reduced in polynomial-time to Π); in this paper, we shall set Π as the QMA-complete 2-local Hamiltonian problem (2-LH) [43], an instance (H, a, b) of which asks: Is the ground state energy of H at most a (YES case), or at least b (NO case), for b − a ≥ 1/poly(n)?Second, although P QMA [log] uses a QMA oracle, it in fact also contains the complementary class co-QMA.This is because to solve any co-QMA problem, a P QMA [log] machine can plug the co-QMA problem instance into the QMA oracle, and subsequently flip the oracle's answer in polynomial-time to solve the co-QMA problem.Thus, P QMA[log] = QMA unless co-QMA ⊆ QMA (which is unlikely), and so P QMA[log] is likely strictly harder than QMA.The third remark is that P QMA[log] uses an oracle for a class of promise problems; this is a subtle but crucial point, which we discuss shortly; first, let us set the stage by reviewing the analogous classical class P NP [log] .
The class P NP [log] .P NP[log] is defined analogously to P QMA[log] except it utilizes an NP oracle.Analogous to P QMA [log] , P NP[log] contains both NP and co-NP and thus is likely strictly harder than NP.As an upper bound, P NP[log] ⊆ NP NP = Σ p 2 , where an NP NP machine is an NP machine which nondeterministically makes up to a polynomial number of calls to an NP oracle, and Σ p 2 is the second level of the Polynomial-Time Hierarchy (PH).In contrast, it is unlikely for P QMA[log] to be in PH, as even BQP ⊆ QMA ⊆ P QMA [log] is generally not believed to be in PH [1,20,26,55,56].A natural question is whether P QMA[log] might instead be contained in an appropriate quantum analogue of PH.The answer is not clear, since unlike the fact that Σ p 2 = NP NP , it is not clear that "quantum Σ p 2 " should equal (say) QMA QMA ; see [32] for a discussion and treatment of quantum analogues of PH.Additional references on "quantum PH" are [29,48,63].
As far as we are aware, whether P NP [k] (i.e.k ∈ O(1) NP queries), P NP[log k n] (i.e.O(log k n) NP queries for k ≥ 1), and P NP (i.e.polynomially many NP queries) coincide remains open.Notably, if P NP [1] = P NP [2] , then P NP [1] = P NP [log] and PH collapses [39].But, it is known is that if the queries to the NP oracle are non-adaptive, meaning they are all made in parallel, then the resulting class P ||NP equals P NP[log]  [16,40].(The analogous statement P ||QMA = P QMA [log]  has recently been shown [33].)Similarly, a P machine making O(log k n) adaptive NP queries is equivalent in power to a P machine making O(log k+1 n) non-adaptive queries for all k ≥ 1 [18].In terms of complete problems, determining the election winner in Lewis Carroll's 1876 voting system is P NP[log] -complete [41], and model checking for certain branching-time temporal logics is P NP[log 2 n] -complete [57].
Finally, it is important to note that NP is a class of decision problems.Formally, this means any NP problem is specified by a language L ⊆ { 0, 1 } * with the corresponding decision problem: Given input x ∈ { 0, 1 } * , is x ∈ L? In the context of P NP[log] , this means any string x ∈ { 0, 1 } * is a valid problem instance or query to an NP oracle for language L, since any such x is either in the language or not.Unfortunately, an analogous statement cannot be made about P QMA[log] , complicating its study; this brings us to our third, crucial remark about P QMA[log] from earlier.
Oracles for promise classes and the issue of invalid queries.In contrast to NP, QMA is a class of promise problems.Formally, this means the space of all inputs { 0, 1 } * is partitioned into three sets, A, B, C, where A and C are YES and NO instances, respectively, and B is the set of "invalid" instances.(Classes of decision problems are a special case of this in which A = L, B = ∅, and C = { 0, 1 } * \ L.) Why might this pose a problem for studying P QMA[log] ?
Recall that we assume all calls by the P QMA [log] machine to the QMA oracle Q are for instances (H, a, b) of 2-LH: Is the ground state energy of H at most a (YES case), or at least b (NO case), for b − a ≥ 1/poly(n)?Unfortunately, a P machine cannot in general tell 4 whether the instance (H, a, b) it feeds to Q satisfies the promise conditions of LH; in particular, the ground state energy may lie in the interval (a, b).We call any such instance or query (H, a, b) violating the 2-LH promise "invalid" (these instances belong in the set B of instances above).For any invalid query, the oracle Q is allowed to accept or reject arbitrarily.This raises a potential issue: if the oracle is allowed to respond arbitrarily to invalid queries, how does one ensure a YES instance (or NO instance) of a P QMA [log] problem is well-defined (normally, the P machine conditions its future actions on the response the oracle returns for each query)?To do so, we stipulate (see, e.g., Definition 3 of Goldreich [36]) that the P machine must output the same answer regardless of how any invalid queries are answered by the oracle.We view the issue of formally handling invalid queries as one of the central themes and contributions of this work.

Our results
Our results fall into two categories: Lower bounds (hardness results) and upper bounds (containment in complexity classes).

Lower bounds (hardness results
).We begin by showing three hardness results; two focus on computational problems introduced in [5] (APX-SIM and SPECTRAL-GAP) and one introduces a new problem (APX-2-CORR).
1. P QMA [log] -completeness of APX-SIM for O(1)-local Hamiltonians and single-qubit observables.Recall that in [5], Ambainis introduced P QMA[log] and showed that APX-SIM (i.e.given k-local Hamiltonian H and l-local observable A, simulate measurement A on the ground state of H) is P QMA[log] -complete.This proof required both the Hamiltonian H and observable A to be O(log n)local.From a physical standpoint, however, it is typically desirable to have O(1)-local Hamiltonians and observables -whether P QMA[log] -hardness holds in this regime was left as an open question in [5].We thus first ask: Is APX-SIM still hard for O(1)-local Hamiltonians and 1-local observables?
Let us develop some intuition before answering this question.Typically, computational problems (such as estimating ground state energies) of 1-local Hamiltonians are easy, since the qubits do not interact.This intuition does not, however, carry over to the setting of simulating 1-local measurements.For example, by embedding a 3-SAT instance φ into a 3-local Hamiltonian and then using the ability to repeatedly measure observable Z against single qubits of the ground state, we can extract a solution to φ! Thus, the 3-local Hamiltonian and 1-local observable case is at least NP-hard.Indeed, here we show it is much harder, resolving Ambainis's open question.

Theorem 1.1. Given a 5-local Hamiltonian H on n qubits and a 1-local observable A, estimating
Thus, measuring just a single qubit of the ground state of a local Hamiltonian H with a singlequbit observable A (in fact, A is fixed, independent of H in our construction) is harder than QMA (assuming QMA = P QMA [log] , which is likely as otherwise co-QMA ⊆ QMA).3. P UQMA[log] -hardness of estimating spectral gaps.A third well-motivated problem involving Hamiltonians is SPECTRAL-GAP [5]: Given a k-local Hamiltonian H, estimate λ 1 (H) − λ 2 (H), where λ i (H) denotes the i-th smallest eigenvalue of H. (For clarity, if the ground space of H is degenerate, we define its spectral gap as 0.) In [5], it is shown that SPECTRAL-GAP ∈ P QMA [log] , and a claimed proof is given that SPECTRAL-GAP for O(log n)-local Hamiltonians H is P UQMA[log]hard.Here, P UQMA[log] is P QMA [log] except with a Unique QMA oracle, and Unique QMA is roughly QMA with a unique accepting quantum witness in the YES case (see Section 4.3 for formal definitions).
Recall now that, as discussed in Section 1.3, a central theme of this work is the subtlety involved in the study of oracle classes in which the oracle solves a promise problem (such as P QMA[log] ), as opposed to a decision problem (such as P NP[log] ).In particular, for 2-LH queries to the QMA oracle which violate the promise gap for 2-LH, the oracle is allowed to give an arbitrary answer.We observe that this point appears to have been missed in [5]'s claimed proofs of P QMA[log] -hardness of APX-SIM and of P UQMA[log] -hardness of SPECTRAL-GAP, rendering the proofs incorrect.Though, as shown by our first result, we are able to correct and improve on the proof that APX-SIM is P QMA[log] -hard.
In our last result, we also overcome this difficulty to recover P UQMA[log] -hardness of SPECTRAL-GAP, with the tradeoff that we obtain a "slightly weaker" hardness claim, in the sense that it follows from a Turing reduction as opposed to a Karp or mapping reduction5 ([5] claimed hardness under the latter).In the process, we also improve the locality of H to O(1).Theorem 1.3.Given a 4-local Hamiltonian H, estimating its spectral gap (i.e.SPECTRAL-GAP) is P UQMA[log] -hard under polynomial-time Turing reductions.
Thus, the ability to solve P UQMA[log] problems in polynomial time would imply a polynomial-time algorithm for SPECTRAL-GAP.Note that whether UQMA = QMA remains open.For the cases of NP [60] or MA and QCMA [4], it is known that Unique NP, Unique MA, and Unique QCMA reduce to NP, MA, and QCMA, respectively, under randomized reductions.

Upper bounds (containment in complexity classes).
As mentioned earlier, since both QMA and co-QMA are contained in P QMA[log] , it is likely that P QMA[log] is strictly more powerful than both QMA and co-QMA.This raises the question: What is an upper bound on the power of P QMA [log] ?Two points of reference are worth mentioning here.First, the classical analogue of P QMA[log] , P NP[log] , is known to be upper bounded by PP [9].Here, PP is the set of promise problems solvable in probabilistic polynomial time with unbounded error; in other words, a PP machine accepts YES instances with probability strictly larger than 1/2 and accepts NO instances with probability less than or equal to 1/2.The second point of reference is that QMA is bounded by PP [44,49] ( [61] actually shows the slightly stronger containment QMA ⊆ A 0 PP).We thus ask whether, like its classical analogue, P QMA[log] can bounded by PP, and so is "slightly harder" than QMA.Indeed, we show this is the case.Theorem 1.4.P QMA[log] ⊆ PP.
Thus, QMA ⊆ P QMA[log] ⊆ PP, which rigorously justifies the intuition that P QMA[log] should be thought of as "slightly harder" than QMA.

Proof techniques
We now outline our proof techniques for both our upper bound and lower bound results.
1. P QMA[log] -hardness of APX-SIM.To show Theorem 1.1, our intuition is simple: To design our local Hamiltonian H so that its ground state encodes a so-called history state 6 |ψ for a given P QMA [log] instance such that measuring observable Z on the designated "output qubit" of |ψ reveals the answer of the computation.At a high level, this is achieved by combining a variant of Kitaev's circuit-to-Hamiltonian construction [45] (which forces the ground state to follow the P circuit) with Ambainis's "query Hamiltonian" [5] (which forces the ground state to encode correctly answered queries to the QMA oracle).Making this rigorous requires a careful analysis of the ground space of Ambainis's query Hamiltonian when queries violating the promise gap of the oracle are allowed (Lemma 3.1), showing a simple but useful corollary of Kempe, Kitaev, and Regev's Projection Lemma [43] (Corollary 4.2) that any low energy state of H must be close to a valid history state, which thus allows us to use just a single-qubit observable, and applying Kitaev's unary encoding trick [45] to bring the locality of the Hamiltonian H down to O(1) (Lemma 3.3).
2. Containment of APX-2-CORR in P QMA [log] .The hardness proof for APX-2-CORR is similar to that of APX-SIM, so we focus instead on the containment proof of APX-2-CORR ∈ P QMA [log] , for which a trick is required.For containment, the naive approach would be to run Ambainis's P QMA [log] protocol [5] for APX-SIM independently for each term A ⊗ B , A , and B .However, if a cheating prover does not send the same ground state |ψ for each of these measurements, soundness of the protocol can be violated.
To address this, we exploit a trick of Chailloux and Sattath [19] from the setting of QMA(2): we observe that the correlation function requires only knowledge of the two-body reduced density matrices { ρ ij } of |ψ .A prover can send classical descriptions of the { ρ ij } (which is possible since each ρ ij is of constant size), along with a "consistency proof" for the QMA-complete Consistency problem [47] to ensure the { ρ ij } indeed correspond to some state.The verifier can then freely copy each ρ ij and thus can calculate each term.

P UQMA[log]
-hardness of estimating spectral gaps.As mentioned in Sections 1.3 and 1.4, a central theme of this work is the fact that a P QMA[log] machine can make invalid queries to the QMA oracle, and this point appears to have been missed in [5], where all queries were assumed to satisfy the LH promise.This results in the proofs of two key claims of [5] being incorrect.The first claim was used in the proof of P QMA[log] -completeness for APX-SIM (Claim 1 in [5]); we provide a corrected statement and proof in Lemma 3.1 (which suffices for the P QMA[log] -hardness results in [5] regarding APX-SIM to hold).
The error in the second claim (Claim 2 of [5]), wherein P UQMA[log] -hardness of determining the spectral gap of a local Hamiltonian is shown, appears arguably more serious.The construction of [5] requires a certain "query Hamiltonian" to have a spectral gap, which indeed holds if the P UQMA [log]  machine makes no invalid queries.However, if the machine makes invalid queries, this gap can close, and it is not clear how one can recover P UQMA[log] -hardness under mapping reductions.
To overcome this, we introduce a technique of "query validation": given a query to the UQMA oracle, we would like to determine if the query is valid or "far" from valid.While it is not clear how a P machine alone can perform such "query validation", we show how to use a SPECTRAL-GAP oracle to do so, allowing us to eliminate "sufficiently invalid" queries.Combining this idea with Ambainis's original construction [5], we show Theorem 1.3, i.e.P UQMA[log] -hardness for SPECTRAL-GAP, with the additional improvement that the input Hamiltonians are now O(1)-local, versus O(log n)local as in [5], via the same unary encoding trick from our previous results.Since our "query validation" requires a polynomial number of calls to the SPECTRAL-GAP oracle, this result requires a polynomial-time Turing reduction.Whether this can be improved to a mapping reduction is left as an open question.
Upper bounds.We now move to our upper bound result, which is the most technically involved.To show P QMA[log] ⊆ PP (Theorem 1.4), we exploit the technique of hierarchical voting, used by Beigel, Hemachandra, and Wechsung [9] to show P NP [log] ⊆ PP, in conjunction with the QMA strong amplification results of Marriott and Watrous [49].
To give some intuition as to how the technique works, we sketch its application in the classical case of P NP[log] [9].There, we have a P machine making queries to an NP oracle for SAT (i.e. the i-th query feeds the oracle some SAT formulae φ i ), and the goal is to simulate this by a PP machine.Since the PP machine does not have access to an NP oracle, the best it can do is guess the answer to each query; so, it begins by guessing the answers to each NP query by picking a random assignment x i for each formula φ i in the hope that φ i (x i ) = 1.Of course, such a guess x i can be satisfying only if φ i is satisfiable to begin with; with a bit of thought, this implies that the "correct" query string y * (i.e. the i-th bit of y * equals 1 if and only if φ i is satisfiable) is the lexicographically largest string y * attainable by this guessing process.
Unfortunately, the PP machine might have a very small probability of guessing y * ; thus, it next "boosts" this probability via several rounds of "hierarchical voting".Conceptually, this technique does not actually increase the probability of outputting y * but rather decreases the probability of outputting other, lexicographically smaller query strings y = y * .This works because the machine is a PP machine (i.e. it can have unbounded error), and so it suffices to reduce the probability of obtaining any such y being output to be strictly smaller than the probability of y * being output, in which case the PP machine is more likely to output the correct answer in its simulation of the P NP[log] computation than not, as needed.
We develop a quantum variant of this scheme which is quite natural.However, its analysis is markedly more involved than the classical setting due to both the probabilistic nature of QMA and the possibility of "invalid queries" violating the QMA promise gap.To give a sense of the problems which arise, for P QMA[log] it is no longer necessarily true that the lexicographically largest obtainable y * is a correct query string.

Discussion and open questions
The problems studied here explore the line of research recently initiated by Ambainis [5] on P QMA[log]  and focus on central problems for local Hamiltonian systems.The complexity theoretic study of such problems is appealing in that it addresses the original motivation of physicist Richard Feynman in proposing quantum computers [27], who was interested in avenues for simulating quantum systems.Indeed, hardness results, such as Kitaev's quantum Cook-Levin theorem, rigorously justify Feynman's intuition that such simulation problems are hard.Our work (e.g.Theorem 1.1) strongly supports this view by demonstrating that even some of the simplest and most natural simulation tasks, such as measuring a single qubit (!) of a ground state, can be harder than QMA.Our study of spectral gaps (Theorem 1.3) further highlights another theme: the subtleties which must be carefully treated when studying oracle classes for promise problems (such as P QMA[log] ).As quantum complexity theory commonly focuses on such promise problems, we believe this theme could be of interest to a broader computer science audience.
Moving to open questions, although we resolve one of the open questions from [5], there are others we leave open, along with some new ones.Do our results for APX-SIM and APX-2-CORR hold for more restricted classes of Hamiltonians, such as 2-local Hamiltonians, local Hamiltonians on a 2D lattice, or specific Hamiltonian models of interest (see e.g.[22,53] for QMA-completeness results for estimating ground state energies of the spin-1/2 Heisenberg anti-ferromagnet)?Is SPECTRAL-GAP P UQMA[log] -complete or P QMA[log] -complete (recall SPECTRAL-GAP ∈ P QMA [log] and that [5] and our work together show P UQMA[log] -hardness)?What is the relationship between P QMA [log]  and P UQMA[log] ?Finally, what is the complexity of other physical tasks "beyond" estimating ground state energies?
Remark added later: Since the original preprint of this paper appeared, the present authors, together with Stephen Piddock, have partially answered the first open question above by showing [33] that APX-SIM remains P QMA[log] -complete for any family of local Hamiltonians which can simulate "spatially sparse" [51] Hamiltonians.This, in turn, implies (e.g. using [53], [58], [54]) that APX-SIM remains P QMA[log] -complete even on physically motivated models, such as the Heisenberg interaction on a 2D square lattice.
Organization.This paper is organized as follows: In Section 2, we give notation and formal definitions.In Section 3, we show various lemmas regarding Ambainis's query Hamiltonian.In Section 4.1, Section 4.2, and Section 4.3 we show Theorem 1.1, Theorem 1.2, and Theorem 1.3, respectively.Section 5 proves Theorem 1.4.A result used in Section 3 is proved in Appendix A.

Preliminaries
Notation.For x ∈ { 0, 1 } n , |x ∈ (C 2 ) ⊗n denotes the computational basis state labeled by x.Let X be a complex Euclidean space.Then, L (X ) and D (X ) denote the sets of linear and density operators acting on X , respectively.For subspace S ⊆ X , S ⊥ denotes the orthogonal complement of S. For Hermitian operator H, λ(H) and λ(H| S ) denote the smallest eigenvalue of H and the smallest eigenvalue of H restricted to space S, respectively.The spectral and trace norms are defined A ∞ := max{ A |v 2 : |v 2 = 1} and A tr := Tr √ A † A, respectively, where := denotes a definition.We set [m] := { 1, . . ., m }.

Definitions and lemmas.
PP and PQP.The class PP [34] is the set of decision problems for which there exists a polynomialtime probabilistic Turing machine which accepts any YES instance with probability > 1/2 and accepts any NO instance with probability ≤ 1/2.The quantum analogue of PP, denoted PQP, is defined analogously to BQP except in the YES case the verifier accepts with probability > 1/2 and in the NO case the verifier accepts with probability ≤ 1/2.
P QMA [log] .Defined by Ambainis [5], P QMA[log] is the set of decision problems decidable by a polynomial-time deterministic Turing machine with the ability to query an oracle for a QMAcomplete problem O(log n) times, where n is the size of the input.For clarity, without loss of generality we assume that for any QMA problem instance Π the P machine wishes to solve, it applies a polynomial-time Karp/many-one reduction to map Π to an instance of the QMA-complete problem 2-LH [43] which it then feeds to the QMA oracle.2-LH is defined as: Given a 2-local Hamiltonian H and inverse polynomially separated thresholds a, b ∈ R, decide whether λ(H) ≤ a (YES-instance) or λ(H) ≥ b (NO-instance).Note that the P machine is allowed to make queries which violate the promise gap of 2-LH, i.e. with λ(H) ∈ (a, b); in this case, the oracle can output YES or NO arbitrarily.The P machine is nevertheless required to output the same final answer (i.e.accept or reject) regardless of how such "invalid" queries are answered [36].
For any P machine M making m queries to a QMA oracle, we use the following terminology throughout this article.A valid (invalid ) query satisfies (violates) the promise gap of the QMA oracle.A correct query string y ∈ { 0, 1 } m encodes a sequence of correct answers to all of the m queries.Note that for any invalid query by M , any answer is considered correct, yielding the possible existence of multiple correct query strings.An incorrect query string is one which contains at least one incorrect query answer.
The problem APX-SIM.Definition 2.1 (APX-SIM(H, A, k, l, a, b, δ) (Ambainis [5])).Given a k-local Hamiltonian H, an l-local observable A, and real numbers a, b, and δ such that b − a ≥ n −c and δ ≥ n −c , for n the number of qubits H acts on and c, c > 0 some constants, decide: • If H has a ground state |ψ satisfying ψ| A |ψ ≤ a, output YES.
Kitaev's circuit-to-Hamiltonian construction.Next, we briefly review Kitaev's circuit-to-Hamiltonian construction from the "quantum Cook-Levin theorem" [45].Given a quantum circuit H j , where H j is defined as Above, the notation R i refers to the i-th qubit of any given register R.
where C is a clock register keeping track of time [45], and each U i acts on at most two qubits from registers Q and W . Second, we use the following lower bound7 on the smallest non-zero eigenvalue of Miscellaneous useful facts.Let V denote a QMA verification circuit acting on M proof qubits with completeness c and soundness s.If one runs V on "proof" ρ = I/2 M , then for a YES instance, V accepts with probability ≥ c/2 M (since I/2 M can be viewed as "guessing" a correct proof with probability ≥ 1/2 M ), and in a NO instance, V accepts with probability ≤ s (see, e.g., [49,62]).

Ambainis's Query Hamiltonian
We now show various results regarding Ambainis's "query Hamiltonian" [5], which intuitively aims to have its ground space contain correct answers to a sequence of QMA queries.Let U be a P QMA[log] computation8 , and let be the 2-local Hamiltonian9 corresponding to the i-th query made by U given that the answers to the previous i − 1 queries are given by y (Without loss of generality, we may assume 0 by adding multiples of the identity and rescaling.)The oracle query made at step i corresponds to an input (H 3 ) to 2-LH, with (as in [5]) completeness/"YES case" and soundness/"NO case" parameters and 3 , respectively, for > 0 a fixed inverse polynomial.Then, Ambainis's [5] to encode the answer to query i with Y i encoding the ground state of the corresponding query Hamiltonian ( Recall from Section 2 that a sequence of query answers to a possible execution of U .Since U can make queries to its QMA oracle which violate the QMA promise gap, the set of correct y is generally not a singleton.However, we henceforth assume without loss of generality that U makes at least one valid query (i.e. which satisfies the QMA promise gap).(Assume to the contrary that U makes only invalid queries.Then, since recall we stipulate [36] that the oracle's answer on any invalid query must not affect the final output of U , it follows that for all possible query strings, U outputs the same answer.Moreover, since m ∈ O(log n), we can efficiently verify this property -simply iterate via brute force through all possible polynomially many query strings, and check that U outputs the same answer for each one.Therefore, we can assume that any reduction includes such a check as an implicit subroutine, prepended to the start of the reduction, which will handle any case in which U makes only invalid queries.)We now prove the following about H: Then, there exists a correct query string x ∈ { 0, 1 } m such that the ground state of H lies in H x 1 •••xm .Moreover, suppose this space has minimum eigenvalue λ.Then, for any incorrect query string As discussed in Section 1, Claim 1 of [5] proved a similar statement under the assumption that the correct query string x is unique.In that setting, [5] showed the ground state of H is in H x , and that for all query strings y = x, the space H y has energy at least λ + 4 m−1 .However, in general invalid queries must be allowed, and in this setting this claim no longer holds -two distinct correct query strings can have eigenvalues which are arbitrarily close if they contain queries violating the promise gap.The key observation we make here is that even in the setting of non-unique x, a spectral gap between the ground space and all incorrect query strings can be shown.
Proof of Lemma 3.1.Observe first that H in Equation ( 3) is block-diagonal with respect to register X , i.e. to understand the spectrum of H, it suffices to understand the eigenvalues in each of the blocks corresponding to fixing X i to some string y ∈ { 0, 1 } m .Thus, we can restrict our attention to spaces H y for y ∈ { 0, 1 } m .To begin, let x ∈ { 0, 1 } m denote a correct query string which has lowest energy among all correct query strings against H, i.e. the block corresponding to x has the smallest eigenvalue among such blocks.(Note that x is well-defined, though it may not be unique; in this latter case, any such x will suffice for our proof.)For any y ∈ { 0, 1 } m , define λ y as the smallest eigenvalue in block H y .We show that for any incorrect query string We use proof by contradiction, via an exchange argument 10 .Suppose there exists an incorrect query string y = y 1 • • • y m such that λ y < λ x + /(4 m ).Since y is an incorrect query string, there exists an i ∈ [m] such that y i is the wrong answer to a valid query where y i denotes the complement of bit y i ; for clarity, here we define Note that string y 1 • • • y i−1 y i corresponds to i correct query bits, with y i the correct answer to query i.Then, we claim that any state |φ ∈ H y 1 •••y i (i.e.|φ is of the same dimension as H, with registers X 1 through X i fixed to state |y 1 ⊗ • • • ⊗ |y i ) satisfies the bound of the following lemma.
Here, for clarity, to making query i given responses to queries 1 through i − 1, and queries i + 1 through m are yet to be determined.) , which is block-diagonal in the standard basis with respect to X i .Thus, if query i is a YES instance, the smallest eigenvalue of M lies in the block corresponding to setting X i to (the correct query answer) |1 , and is at most (since we are assuming each query has YES and NO energy thresholds and 3 ).On the other hand, the block with X i set to |0 by definition reduces to 2 I Y i , and hence has all eigenvalues equaling 2 .Thus, setting X i to the correct query answer |1 yields an energy penalty which is at least less than the penalty obtained for setting X i to the wrong query answer, |0 .Analogously, when query i is a NO instance (i.e. the correct query answer is |0 ), a similar argument shows the |0 -block again has eigenvalues equaling 2 and now the |1 -block has eigenvalues at least 3 .We conclude that in both YES and NO cases, setting X i to the correct query answer achieves an energy penalty at least less than setting X i to the wrong query answer.As a result, which implies the claim.
With Lemma 3.2 in hand, we return to our exchange argument.Let M y 1 •••yt denote the set of terms from Equation (3) which are consistent with some prefix y 1 . . .y t (e.g.M y 1 ...yt , M y 1 ...yt0 , M y 1 ...yt1 , etc).Recall that the bits y i+1 • • • y m form the tail of the string y following the incorrect query answer y i .Set We conclude that (again taking into account the normalization factor 1/4 i−1 in Equation ( 3)) where the second inequality follows by the assumption λ y < λ x + /4 m .This is a contradiction.

The next lemma converts H from an O(log n)-local Hamiltonian to an O(1)-local one.
Lemma 3.3.For any x ∈ { 0, 1 } m , let x denote its unary encoding.Then, for any P QMA [log]  circuit U acting on n bits and making m ≥ 1 queries to a QMA oracle, there exists a mapping to a 4-local Hamiltonian H acting on space (C 2 ) ⊗2 m −1 ⊗ Y such that there exists a correct query string x = x 1 Proof.We show how to improve the O(log n)-local construction H of Lemma 3.1 to 4-local H . Specifically, recall that H from Equation (3) acts on (X ⊗ Y).Using a trick of Kitaev [45], we encode the X = X 1 ⊗ • • • ⊗ X m register in unary.Specifically, we can write We now replace register , where |x| is the non-negative integer corresponding to string x.In other words, for Denote the resulting Hamiltonian as H 1 .
To ensure states in X follow this encoding, add a weighted version of Kitaev's [45] penalty Hamiltonian, introduced in Section 2, i.e., our final Hamiltonian is H = H 1 + H stab .To show that H satisfies the same properties as H as stated in the claim, we follow the analysis of Kitaev [45].Namely, partition the space X ⊗ Y into orthogonal spaces S and S ⊥ corresponding to the space of valid and invalid unary encodings of X , respectively.Since H 1 and H stab act invariantly on S and S ⊥ , we can consider S and S ⊥ separately.In S, H is identical to H, implying the claim.In S ⊥ , the smallest non-zero eigenvalue of H stab is at least 3 .Thus, since H 1 0, if we can show that the smallest eigenvalue of H is at most 3 − /4 m , we have shown the claim (since, in particular, we will have satisfied statement 2 of our claim).To show this bound on the smallest eigenvalue, suppose x is all zeros, i.e. set register For completeness, we reproduce the steps from [43] to derive this inequality as follows: Since . Thus, setting |ψ = |ψ 1 yields the claim.
With Corollary 4.2 in hand, we now prove the main result of this section.
Proof.Containment in P QMA [log] was shown 11 for k, l ∈ O(log n) in [5], for n the input size.We show P QMA[log] -hardness of APX-SIM via a polynomial-time mapping/Karp reduction.
Let U be an arbitrary P QMA[log] circuit12 for instance Π, such that U acts on workspace register W and query result register Q. Suppose U consists of L gates and makes m = c log(n) queries, for c ∈ O (1).Without loss of generality, U can be simulated with a similar unitary U which treats Q as a proof register which it does not alter at any point: Namely, U does not have access to a QMA oracle, but rather reads bit Q i whenever it desires the answer to the i-th query.Thus, if a correct query string y 1 • • • y m corresponding to an execution of U on input x is provided in Q as a "proof", then the output statistics of U and U are identical.We can also assume that Q is encoded not in binary, but in unary.Thus, Q consists of 2 m − 1 ∈ poly(n) bits.For simplicity, however, in our discussion we will speak of m-bit query strings y = y 1 • • • y m in register Q.
The construction.We now construct our instance of APX-SIM.First, we map U to a 5-local Hamiltonian H 1 via a modification of the circuit-to-Hamiltonian construction of Kitaev [45], such that H 1 acts on registers W (workspace register), Q (proof register), and C (clock register).Recall (Section 2) that Kitaev's construction outputs Hamiltonian terms H in + H prop + H stab + H out .Set H 1 = ∆(H in + H prop + H stab ) for ∆ to be set as needed.In contrast to [45], it is crucial that H out be omitted from H 1 , as we require our final Hamiltonian H to enforce a certain structure on the ground space regardless of whether the computation should accept or reject.The job of "checking the output" will instead be delegated to the observable A. Formally, following the discussion in Section 2 regarding Equation ( 1), H 1 has a non-trivial null space, which is its ground space, consisting of history states |ψ hist (see Equation ( 1)) which simulate U on registers W and Q.These history states correctly simulate U assuming that Q is initialized to a correct proof.
To thus enforce that Q is initialized to a correct proof, let H 2 be our variant H of Ambainis's query Hamiltonian from Lemma 3.3, such that H 2 acts on registers Q and Q , where for clarity Suppose without loss of generality that U 's output qubit is W 1 , which is set to |0 until the final time step, in which the correct output is copied to it.Then, set observable A = (I + Z)/2 such that A acts on qubit W 1 .Set a = 1 − 1/(L + 1), and b = 1 − 1/2L for L the number of gates in U .Fix η ≥ max( H 2 ∞ , 1) (such an η can be efficiently computed by applying the triangle inequality and summing the spectral norms of each term of H 2 individually).Set ∆ = 128L 3 ηγ for γ a monotonically increasing polynomial function of L to be set as needed.Finally, set δ = 1/∆.This completes the construction.
Correctness.We now prove correctness, meaning that if Π is a YES (NO) instance of a P QMA [log]  problem, then APX-SIM(H, A, 5, 1, a, b, δ) is a YES (NO) instance of APX-SIM.The following pair of lemmas together show this.They both assume the terminology set up in this proof thus far.Lemma 4.3.Suppose Π is a YES instance of a P QMA [log] problem.Then, (H, A, k, l, a, b, δ) is a YES instance of APX-SIM.
Proof.By Lemma 3.3, the ground space of H 2 is spanned by states of the form |x Q ⊗ |φ Q where x is a correct query string encoded in unary.Fix an arbitrary such ground state |x Q ⊗ |φ Q .Since Π is a YES instance, setting Q to x in this manner causes U = U L • • • U 1 to accept with certainty.Consider a version of the history state |ψ hist from Equation (1) on registers W (workspace), C (clock), Q, and Q (Q and Q together are the "proof register", where recall U reads query answers from Q but does not access Q at any point), which by construction lies in the ground space of H 1 .Since U can read but does not alter the contents of Q, the history state has the tensor product form By Equation ( 5) and the Hölder inequality, Write Since any history state |ψ , for any amplitudes α x and unit vectors |φ x , has form (i.e. for any fixed x, |x Q is not altered), and since H 2 is block-diagonal with respect to the standard basis in Q, by Equation ( 7) and Lemma 3.3 we have which follows from the triangle inequality and the structure of the history state.
With Lemma 4.5 in hand, we are ready to complete the proof of Lemma 4.4.Observe that in the right hand side of Equation ( 6), increasing γ by a polynomial factor decreases δ + γ by a polynomial factor.Thus, set γ as a large enough polynomial in L such that Since U rejects any correct query string (with certainty) in the NO case, and since |ψ is a valid history state whose Q register is a superposition over correct query strings (all of which must lead to reject), we conclude that ψ | A |ψ = 1.Moreover, we have that where the first inequality follows from Hölder's inequality, and the second by Equations ( 6) and ( 8).We conclude that ψ| A |ψ ≥ 1 − 1/(2L), completing the proof.
To set up the correctness proof, consider history state |ψ hist for V given quantum proof |φ Q,Q , and define for brevity Thus, via similar reasoning Suppose now that Π is a YES instance.Then there exists a history state |ψ hist in the ground space of H (i.e. with quantum proof |φ Q,Q = |x Q ⊗ |φ Q for a correct query string x) for which W 2 W 3 is set to |φ + in the final seven timesteps (since U is deterministic).Since φ + | Z ⊗ Z |φ + = 1 and φ + | Z ⊗ I |φ + = 0, via Equation ( 11) we have where the ±5 terms correspond to timesteps t = L + 1, . . ., L + 5 and use the fact that Z ∞ = 1.Conversely, suppose Π is a NO instance, and consider any |ψ satisfying ψ| H |ψ ≤ λ(H) + δ.Then, as argued in the proof of Theorem 1.1, there exists a history state |ψ on "proof" |φ 1 Q,Q (consisting of a superposition of correct query strings) satisfying by Equations ( 6), ( 8) and ( 9).Since the history state |ψ has W 2 W 3 set to |00 in all time steps, we know because Z ⊗ Z |00 = |00 that f (|ψ , Z W 2 , Z W 3 ) = 0. Thus, using Equation ( 11) and applying the Hölder inequality to the second term of f (|ψ Proof.The proof combines ideas from Ambainis's original proof of APX-SIM ∈ P QMA[log] [5] (see Theorem 6 therein) and a trick of Chailloux and Sattath [19] from the study of QMA (2).We give a proof sketch here.Specifically, let Π = (H, A, B, k, l, a, b, δ) be an instance of APX-2-CORR.
Similar to [5], the P QMA[log] verification procedure proceeds, at a high level, as follows: 1. Use logarithmically many QMA oracle queries to perform a binary search to obtain an esti- 2. Use a single QMA oracle query to verify the statement: "There exists |ψ satisfying ( 1) The first of these steps is performed identically to the proof of APX-SIM ∈ P QMA[log] [5]; we do not elaborate further here.The second step, however, differs from [5] for the following reason.
Intuitively, [5] designs a QMA protocol which takes in many copies of a proof |ψ , performs phase estimation on each copy, postselects to "snap" each copy of |ψ into a low-energy state |ψ i of H, and subsequently uses states { | ψ i } to estimate the expectation against an observable A. If the ground space of H is degenerate, the states { | ψ i } may not all be identical.This does not pose a problem in [5], as there soundness of the protocol is guaranteed since all low energy states have high expectation against A. In our setting, however, if we use this protocol to individually estimate each of the terms ψ| A ⊗ B |ψ , ψ| A |ψ , and ψ| B |ψ , soundness can be violated if each of these three terms are not estimated using the same state |ψ i , since the promise gap of the input does not necessarily say anything about the values of each of these three terms individually.
To circumvent this, we observe that to evaluate f (|ψ , A, B), we do not need the ground state |ψ itself, but only a classical description of its local reduced density matrices (a similar idea was used in [19] to verify the energy of a claimed product state proof against a local Hamiltonian in the setting of QMA(2)).Specifically, suppose Π consists of a k-local Hamiltonian H acting on n qubits.Then, the prover sends classical descriptions of k-qubit density matrices { ρ S } for each subset S ⊆ [n] of size |S | = k, along with a QMA proof that the states { ρ S } are consistent with a global n-qubit pure state |ψ (recall the problem of verifying consistency is QMA-complete [47]).The verifier runs the QMA circuit for consistency, and assuming this check passes it uses the classical { ρ S } to classically verify that (1) ψ| H |ψ ≤ λ(H) + δ and (2) f (|ψ , A, B) ≥ a (since both of these depend only on the local states { ρ S }).

P UQMA[log] -hardness of SPECTRAL-GAP
We now restate and prove Theorem 1.3.We begin by defining SPECTRAL-GAP and UQMA.Definition 4.9 (SPECTRAL-GAP(H, α) (Ambainis [5])).Given a Hamiltonian H and a real number α ≥ n −c for n the number of qubits H acts on and c > 0 some constant, decide: where λ 2 and λ 1 denote the second and first smallest eigenvalues of H, respectively.
For clarity, if the ground space of H is degenerate, then we define its spectral gap as 0. Definition 4.10 (Unique QMA (UQMA) (Aharonov et al. [4])).We say a promise problem A = (A yes , A no ) is in Unique QMA if and only if there exist polynomials p, q and a polynomial-time uniform family of quantum circuits { Q n }, where Q n takes as input a string x ∈ Σ n , a quantum proof |y ∈ (C 2 ) ⊗p(n) , and q(n) ancilla qubits in state |0 ⊗q(n) , such that: ) with probability at least 2/3, and for all |ŷ ∈ (C 2 ) ⊗p(n) orthogonal to |y , Q n accepts (x, |ŷ ) with probability at most 1/3.
The main theorem of this section is the following.We remark that Ambainis [5] showed that SPECTRAL-GAP ∈ P QMA [log] , and gave a claimed proof that SPECTRAL-GAP is P UQMA[log] -hard for O(log)-local Hamiltonians under mapping reductions.(P UQMA [log] is defined as P QMA[log] , except with a UQMA oracle in place of a QMA oracle.)As discussed in Section 1, however, Ambainis' proof of the latter result does not hold if the P UQMA[log] machine makes invalid queries (which in general is the case).Here, we build on Ambainis' approach [5] to show P UQMA[log] -hardness of SPECTRAL-GAP under Turing reductions even when invalid queries are allowed, and we also improve the hardness to apply to O(1)-local Hamiltonians.We begin by showing the following modified version of Lemma 3.3 tailored to UQMA (instead of QMA).It is crucial to observe that the mapping of Lemma 3.3 which produces Hamiltonian H is efficient, i.e.H can be computed in polynomial time.However, in Lemma 4.11 below, our mapping to a Hamiltonian H is not clearly efficient, meaning the lemma only shows the existence of H. Roughly, this is because the proof of Lemma 4.11 proceeds by replacing invalid queries with "dummy" NO queries to obtain the desired spectral gap.But a polynomial-time machine alone cannot identify such invalid queries, and hence cannot simulate this mapping.
Henceforth, we assume that all calls to the UQMA oracle Q are for an instance (H, a, b) of the Unique-Local Hamiltonian Problem (U-LH) (which is complete for UQMA [5]): Is the ground state energy of H at most with all other eigenvalues at least 3 (YES case), or is the ground state energy at least 3 (NO case), for ≥ 1/poly(n)?Lemma 4.11.For any x ∈ { 0, 1 } m , let x denote its unary encoding.Then, for any P UQMA [log]  circuit U acting on n bits and making m queries to a UQMA oracle, there exists a 4-local Hamiltonian H acting on space (C 2 ) ⊗2 m −1 ⊗ Y such that there exists a correct query string 1.The unique ground state of H lies in subspace |x x| ⊗ Y.

For all strings
Proof.We begin by giving the construction of H.

Construction. As done in [5], we begin with O(log n)-local Hamiltonian
where we define with A any fixed 2-local Hermitian operator with unique ground state of eigenvalue 2 and spectral gap .Our approach is intuitively now as follows.We first run a query validation phase, in which we modify H to obtain a new Hamiltonian H by replacing "sufficiently invalid" queries with high-energy dummy queries.This creates the desired spectral gap.We then apply the technique of Lemma 3.3 to reduce the locality of H , obtaining a 4-local Hamiltonian H, as desired.Note that our proof shows existence of H; unlike Lemma 3.3, however, it is not clear how to construct H in polynomial-time given H , as detecting invalid UQMA queries with a P machine seems difficult.
The query validation runs as follows.Fix any 1/poly(n) < δ < such that − δ ≥ 1/poly(n); for example, set δ = /2.For any G y 1 •••y i−1 whose spectral gap is at most − δ, replace it with in H , denoting the new Hamiltonian as H . Two remarks: By Case 2 of Lemma 4.12 below, the validation phase does not catch all invalid queries.Second, setting 1/poly(n) < δ and − δ ≥ 1/poly(n) (as opposed to, say, 1/ exp(n)) is required for our proof of Theorem 1.3 later.
Correctness.Intuitively, the query validation phase roughly replaces each "sufficiently invalid" query i with a valid NO query.This is formalized by Lemma 4.12, shown subsequently, which should be roughly interpreted as saying a "sufficiently invalid" query i is one for which the spectral gap of G y 1 •••y i−1 is at most − δ.For any such replaced query i, henceforth in this proof, a query string which answers YES (i.e.|1 ) to query i is considered incorrect with respect to H (since i is now a valid NO query in H ). Crucially, if a string x is a correct query string for H , then it is also a correct query string for H .The converse is false; nevertheless, H has at least one correct query string (since any invalid query would have allowed both |0 and |1 as answers), which suffices for our purposes.
As in the proof of Lemma 3.1, observe that H is block-diagonal with respect to register m i=1 X i .Let x ∈ { 0, 1 } m denote a correct query string which has minimal energy among all correct query strings against H , and for any y ∈ { 0, 1 } m , define λ y as the smallest eigenvalue in block H y .A similar analysis to that of Lemma 3.1 shows that for any incorrect query string y, λ y ≥ λ x + /4 m .This is because replacing the term 2 preserves the property that answering NO on query i yields minimum energy 2 .
We now argue that x is in fact unique, and all other eigenvalues of H corresponding to correct query strings have energy at least λ x + ( − δ)/4 m .There are two cases to consider: eigenvalues arising from different query strings and eigenvalues arising from the same query string.
Case 1: Eigenvalues from different query strings.Let y = y 1 • • • y m = x be a correct query string for H . Since both x and y are correct strings, there must exist an invalid query i where First consider the case where G y 1 •••y i−1 has spectral gap at most − δ.Then, after the validation phase, query i is replaced with a valid NO query G y 1 •••y i−1 .Thus, whichever of x or y has a 1 as bit i is an incorrect string for H , and from our previous analysis has energy at least λ x + /4 m against H . (This, in particular, implies x i = 0 and y i = 1, by the minimality of x.) Alternatively, suppose has spectral gap strictly larger than − δ.By Lemma 4.12, the invalid query i must be a "YES instance violating the uniqueness promise" with corresponding query Hamiltonian H ) ≤ .Thus, the 0-block of Equation ( 14) has minimum eigenvalue 2 by construction, whereas the 1-block of Equation (14) has minimum eigenvalue at most .It follows from our previous analysis that whichever of x or y has a 0 as bit i has energy at least λ x + /4 m against H . (This, in particular, implies x i = 1 and y i = 0, by the minimality of x.) Case 2: Eigenvalues from the same query string.Let us next consider eigenvalues in the minimal block H x with correct query string x.In this block, H is equivalent to operator or 3 I (depending on how the validation phase proceeded) if x i = 1.To show our claim, it suffices to show that M has spectral gap ( − δ)/4 m .
Recall now that each B x 1 •••x i−1 acts non-trivially only on space Y i .Therefore, the minimum eigenvalue of M is obtained by setting each space Y i to the ground state vector we can now show that each B x 1 •••x i−1 has a spectral gap of − δ, it will hence follow that swapping |ψ i for any excited state |ψ ⊥ i orthogonal to |ψ i on Y i yields an additive increase in energy of at least − δ against any B x 1 •••x i−1 .It would then follow that the spectral gap of M is at least ( − δ)/4 m , as desired.
So let us argue that each B x 1 •••x i−1 has spectral gap at least − δ.There are three cases to consider: has spectral gap by definition of A.
, then consider first the case where query i was valid.Since is a valid YES instance of U-LH, and so has a spectral gap of at least 2 by definition.
If instead query i was invalid, then since must be that the query validation phase did not catch this invalid query, implying the spectral gap of G y 1 •••y i−1 was strictly larger than − δ.But then Lemma 4.12 implies that the spectral must be at least − δ, as desired.
• Suppose B x 1 •••x i−1 = 3 I; this happens only when the query validation phase replaced an invalid query i with a valid NO query 3 I.But since it also holds that this implies that x is not a correct query string with respect to H (since it answered 1 on query i instead of 0), which is a contradiction.
This completes the correctness proof.
Getting H down to 4-local H. Finally, the approach of Lemma 3.3 allows us to convert O(log n)-local H to 4-local H.
The following lemma is used in the proof of Lemma 4.11 above, and assumes the notation introduced therein.Lemma 4.12.In Equation (14), suppose is invalid.Precisely one of the following cases holds.

(YES case violating uniqueness promise) If λ(H
Proof.Observe that G y 1 •••y i−1 is block-diagonal with respect to register X i ; we will refer to each of these blocks as the 0-and 1-block, respectively.For clarity, when we refer to λ 2 (X) for an operator X below, if the ground space of X is degenerate then we define λ 2 (X) = λ(X).

Case 1. Suppose first that λ(H
), and so the spectral gap of G y by the 0-block.Since the spectral gap of the 0-block is by construction, we thus have that λ ), and so the spectral gap of G y For any δ as defined in the claim, suppose now that the spectral gap of then the smallest two eigenvalues of , and so the spectral gap of the former is at least − δ.Thus, we conclude that either the spectral gap of G y We now prove the main theorem of this section.
Proof of Theorem 1.3.As done in [5], we start with the Hamiltonian H from Equation (13).In [5], it was shown (Section A.3, Claim 2) that if all query Hamiltonians H i,y 1 •••y i−1 Y i correspond to valid UQMA queries, H has a unique ground state and spectral gap at least /4 m .When invalid queries are allowed, however, the spectral gap of H can vanish, invalidating the P UQMA[log] -hardness proof of [5].Thus, we require a technique for identifying invalid queries and "removing them" from H . Unfortunately, it is not clear how a P machine alone can achieve such a "property testing" task of checking if a query is sufficiently invalid.However, the key observation is that an oracle Q for SPECTRAL GAP can help.
We proceed as follows.Given an arbitrary P UQMA[log] circuit U acting on n bits, construct O(log n)-local H from Equation (13).For each term G y 1 •••y i−1 appearing in H , perform binary search using O(log n) queries to Q to obtain an estimate ∆ for the spectral gap of G y 1 •••y i−1 to within sufficiently small but fixed additive error δ ∈ 1/poly(n).(A similar procedure involving a QMA oracle is used in Ambainis' proof of containment of APX-SIM ∈ P QMA [log] to estimate the smallest eigenvalue of a local Hamiltonian; we hence omit further details here.)As done in the proof of Lemma 4.11 (15).Following the construction of Lemma 4.11, we hence can map H to a 4-local Hamiltonian H such that H has a unique ground state and spectral gap ( − δ)/4 m , and the ground state of H corresponds to a correct query string for H .Note that implementing the mapping from H to H requires polynomially many queries to the oracle, hence yielding a polynomial-time Turing reduction.
Next, following [5], let T := y 1 ...ym m i=1 |y i y i | ∈ L (Y), where we sum over all query strings y 1 ...y m which cause U to output 0. Unlike [5], as done in Lemma 3.3, we apply Kitaev's unary encoding trick [45] and implicitly encode the query strings in T in unary.(We remark the term H stab contained in H will enforce the correct unary encoding in register X ).Finally, introduce a single-qubit register B, and define The claim now follows via an analysis similar to [5]

Upper bounds (containment in PP)
We now restate and prove Theorem 1.4.Our approach is to use the strong error reduction technique of Marriott and Watrous [49] to develop a variant of the hierarchical voting scheme used in the proof of P NP[log] ⊆ PP [9].We also require a more involved analysis than present in [9], since QMA is a class of promise problems, not decision problems.Proof.Let Π be a P machine which makes m = c log n queries to an oracle for 2-LH, for c ∈ O (1) and n the input size.Without loss of generality, we assume all queries involve Hamiltonians on M qubits (M some fixed polynomial in n).Define q := (M + 2)m.We give a PQP computation simulating Π (i.e. the PQP computation, which does not have access to a 2-LH oracle, will accept if and only if Π is a YES instance).Since PQP = PP [62], this yields the claim.Let |y| denote the non-negative integer with binary encoding y, and let V denote the verification circuit for 2-LH.The PQP computation is (intuition to follow): 1.For i from 1 to m: 3)) and proof ρ, and measure the output qubit in the standard basis.Set bit y i to the result.(a) If |y| < i, then with probability 1 − 2 −q , set y = #, and with probability 2 −q , leave y unchanged.
4. If y = #, output a bit uniformly at random.Else, run Π on query string y and output Π's answer.

Intuition.
In Step 1, one tries to determine the correct answer to query i by guessing a satisfying quantum proof for verifier V .Suppose for the moment that V has zero error, i.e. has completeness 1 and soundness 0, and that Π only makes valid queries.Then, if Step 1(b) returns y i = 1, one knows with certainty that the query answer should be 1.And, if the correct answer to query i is 0, then Step 1(b) returns y i = 0 with certainty.Thus, analogous to the classical case of an NP oracle (as done in [9]), it follows that the lexicographically largest query string y * obtainable by this procedure must be the (unique) correct query string (note that y * = 1 m necessarily 13 ).Thus, ideally one wishes to obtain y * , simulate Π on y * , and output the result.To this end, Step 3 ensures that among all values of y = #, y * is more likely to occur than all other y = y * combined.We now make this intuition rigorous (including in particular the general case where V is not zero-error and Π makes invalid queries).

Correctness.
To analyze correctness of our PQP computation, it will be helpful to refine our partition of the set of query strings { 0, 1 } m into three sets: • (Correct query strings) Let A ⊆ { 0, 1 } m denote the set of query strings which correspond to correctly answering each of the m queries.Note we may have |A| > 1 if invalid queries are made.
• (Incorrect query strings) Let B ⊆ { 0, 1 } m \ A denote the set of query strings such that for any y ∈ B, all bits of y which encode an incorrect query answer are set to 0 (whereas the correct query answer would have been 1, i.e. we failed to "guess" a good proof for this query in Step 1).
• (Strongly incorrect query strings) Let C = { 0, 1 } m \ (A ∪ B) denote the set of query strings such that for any y ∈ C, at least one bit corresponding to an incorrect query answer is set to 1 (whereas the correct query answer would have been 0).Such an error can only arise due to the bounded-error of our QMA verifier in Step 1(b).
Let Y be a random variable corresponding to the query string y obtained at the end of Step 3. To show correctness, we claim that it suffices to show that ∆ := Pr[Y ∈ A] − Pr[Y ∈ B ∪ C] > 0. To see this, let p 1 , p 2 , and p 3 denote the probability that after Step 3, y = #, y ∈ A, and y ∈ B ∪ C, respectively.Then, p 1 + p 2 + p 3 = 1, and let p 2 − p 3 = ∆ > 0. Suppose now that the input to Π is a YES instance.Then, our protocol outputs 1 with probability at least If the input is a NO instance, the protocol outputs 1 with probability ≤ p 1 2 + p 3 = 1−∆ 2 < 1 2 .We hence have a PQP computation, as desired.We thus now show that ∆ > 0.
To ease the presentation, we begin by making two assumptions (to be removed later): (i) V is zero-error and (ii) Π makes only valid queries.In this case, assumption (i) implies C = ∅ (i.e.all incorrect query strings belong to B), and (ii) implies A is a singleton (i.e.there is a unique correct query string y * ).Thus, here ∆ = Pr 13 Under the assumptions that V has zero error and Π makes only valid queries, y * = 1 m can only be obtained by this procedure if all queries are for YES instances of 2-LH.If, on the other hand, query i is a NO query, then a correct proof cannot be guessed (since it does not exist), and so y * i = 0 necessarily.
probability, in the latter case, there is some fixed probability p with which V outputs 1 each time it is run on a fixed proof.)Finally, define B y * 1 := { y ∈ B | |y| < |y * 1 | } (recall |y| is the non-negative integer with binary encoding y).
Let k * denote the number of divergence points of y * 1 (i.e.k * = I y * 1 ), and k 0 (k 1 ) the number of zeros (ones) of y * 1 arising from valid queries.Thus, k * + k 0 + k 1 = m.Then, Equation (20) becomes where the second inequality follows from Equation ( 23), and the third since k * ≥ 0 and k 1 +k * ≤ m.Thus, ∆ 1 is lower bounded by the expression in Equation ( 21) via an analogous analysis for y * 1 and B y * where I ≤k z k := { t ∈ I z k | t ≤ k }.Note that q i (k) > 0 (since S k = ∅).Else if S k = ∅, set q i (k) = 0. Let q * i be the max such bounded divergence probability: q i (k) and k * i = arg max k∈ [m] q i (k).
The following lemma will be useful.Lemma 5.3.For any y ∈ B y * i , Pr[y chosen in Step 2] ≤ q * i , where recall q * i is the probability from Equation (25).
Proof.Fix any y ∈ B y * i .Since |y| > y * i−1 , there must be an index k such that the k-th bit of y is 1 and that of y * i−1 is 0. Let k denote the first such index.Since y ∈ C (because B y * i ∩ C = ∅), it must be that query k (defined given bits y 1 • • • y k−1 ) is invalid.Thus, bit k is a divergence point of y * i−1 , and there exists a correct query string y ∈ S k .By Equation ( 25), q * i was chosen as the maximum over all bounded diverge probabilities.Thus, q * i ≥ q i (k), where recall q i (k) is the bounded divergence probability for S k , where y ∈ S k .But since y and y agree on bits 1 through k inclusive, we have Pr[y chosen in Step 2] ≤ t∈I ≤k y p y,t = q i (k), from which the claim follows.
To continue with the inductive step, again consider k * , k 0 , and k 1 , now corresponding to y * i .Then, an argument similar to Equation ( 24) says Pr[y * i chosen in Step 2 ] is at least where the first inequality follows from Equation ( 26 19) yields where the first q * i is due to Equation ( 27), and the second q * i to Lemma 5.3.Thus, similar to Equation ( 21), Observing the recurrence that for all i, ∆ i ≥ ∆ i−1 + ζ i , unrolling this recurrence yields ∆ i ≥ ∆ 1 , which by the base case yields the claim.(n c −1) For sufficiently large fixed p, this quantity is strictly positive, yielding Theorem 1.4.implies there exists a valid history state |ψ satisfying where the second inequality follows since 0 ≤ K ≤ η, the third since π 2 /(64L 3 ) ≤ 1 for L ≥ 1 and 1 ≤ η 2 , and the last since ∆ = 128L 3 ηγ and γ ≥ 1.

2 .Theorem 1 . 2 .
P QMA[log] -completeness of APX-2-CORR for O(1)-local Hamiltonians and single-qubit observables.We next introduce a second natural problem related to APX-SIM, denoted APX-2-CORR.APX-2-CORR is defined similarly to APX-SIM except one is given Hamiltonian H and observables A and B and asked to estimate the two-point correlation function A ⊗ B − A B (recall A := ψ| A |ψ for |ψ a ground state of H).By modifying the construction behind the proof of Theorem 1.1, we also show APX-2-CORR is P QMA[log] -complete.Given a 5-local Hamiltonian H on n qubits and a pair of 1-local observables A and B, estimating A ⊗ B − A B (i.e.APX-2-CORR) is P QMA[log] -complete.
query string.Care is now required; the new query bits y i+1 • • • y m may lead to different energy penalties than the previous string y i+1 • • • y m against the Hamiltonian terms in set M y 1 •••y i .In other words, we must upper bound any possible energy penalty increase when exchanging y 1 • • • y i y i+1 • • • y m for y .To do so, recall that all Hamiltonian terms in Equation (3) are positive semidefinite.Thus, for any state |ψ in space H y 1 •••y i , the energy obtained by |ψ against terms in M y 1 •••y i is at least 0. Conversely, in the worst case, since each term in M y 1 •••y i has minimum eigenvalue at most 2 , the eigenvector |ψ of smallest eigenvalue in block H y incurs an additional penalty against H for queries i + 1 through m of at most (taking into account the normalization factor 1/4 3 enforces the ground space of H 2 to contain unary encodings of valid strings of query answers y 1 • • • y m for input Π in register Q, as desired.Our final Hamiltonian is H = H 1 + H 2 , which is 5-local since H 1 is 5-local and H 2 is 4-local.
Finally, we construct H = H 1 +H 2 as in the proof of Theorem 1.1, mapping V to a 5-local Hamiltonian H 1 on registers W , Q, and C, and we set A = Z W 2 and B = Z W 3 for Pauli Z. Similar to the proof of Theorem 1.1, set ∆ = 128L 3 ηγ and δ = 1/∆, for γ large enough so that

2 .
Let y = y 1 • • • y m be the concatenation of bits set in Step 1(b).

1 .
Inductive step.Assume the claim holds for 1 ≤ i − 1 < |A|.We show it holds for i.Let y * i−1 be the choice of y * in the previous iteration i− 1. Define A y * i := { y ∈ A | |y| > y * i−1 }.Partition A y * i into sets S k for k ∈ [m],such that S k is the subset of strings in A y * i which agrees with y * i−1 on the first k − 1 bits, but disagrees on bit k.Note that if S k = ∅, then bit k of y * i−1 is 0 and bit k of any string in S k is 1.For each S k = ∅, choose arbitrary representative z k ∈ S k , and define bounded divergence probability q i (k) :=t∈I ≤k z k p z k ,t ), and the second sinceI y * i − I ≤k * i y * i ≤ k * .Now, define ζ i := Pr[Y = y * i ] − Pr[Y ∈ B y * i ].Applying the argument of Equation (

Finally, combining Lemmas 5 .
1 and 5.2 (recall Lemma 5.1 shows Pr(Y ∈ C) ≤ 2 m 2 p ; note the proof of Lemma 5.1 still applies after assumption (ii) is dropped) yields that Pr[Y ∈ A] − Pr[Y ∈ B ∪ C] is lower bounded by Pr[Y ∈ A] − Pr[Y ∈ B] − Pr[Y ∈ C] ≥ 1 2 q and 2-qubit gates U i and acting on registers Q (proof register) and W (workspace register), this construction maps U to a 5-local Hamiltonian H = H in + H out + H prop + H stab acting on registers Q (proof register), W (workspace register), and C (clock register).Each of H's terms are defined below: First, the null space of H in + H prop + H stab is spanned by history states, which for any proof |ψ have form [7] any candidate proof |ψ to be evaluated in expression Tr(H |ψ ψ|), each penalty term of H forces a structure on any minimizing |ψ : at time zero, H in ensures the workspace register W is set to zero; H out checks that at the end of the computation, i.e. at time step L, the output qubit is close to |1 ; the propagation Hamiltonian H prop ensures all steps of U appear in superposition in |ψ with equal weights.Finally, although we have labeled (for ease of exposition) the clock register in H out and H prop in binary, note that in Kitaev's construction it is actually encoded in unary.In other words, time t in clock register C is encoded as |1 t 0 L−t (note for H stab above, register C is already written in unary); H stab 's role is thus to prevent invalid encodings of time steps.(For the interested reader, we remark that instead of working explicitly with Kitaev's construction, one can also consider the more general Quantum Thue System framework[7].)Inthis paper, we shall use two key properties of H in + H prop + H stab (note H out is omitted).
• • • x m satisfying: 1.The ground state of H lies in subspace |x x| ⊗ Y. 2. For any state |ψ in subspace |x x | ⊗ Y where either x is not a unary encoding of a binary string x or x is an incorrect query string, one has ψ| H |ψ ≥ λ(H ) + /4 m , for inverse polynomial .3. For all strings x ∈ { 0, 1 } m , H acts invariantly on subspace |x x | ⊗ Y.
4. The mapping can be computed in time polynomial in n (recall m ∈ O(log n)).
[43]nergy penalty of exactly 2 , yielding an upper bound on the smallest eigenvalue of H of 2 (Kempe, Kitaev, Regev[43]).Let H = H 1 + H 2 be the sum of two Hamiltonians operating on some Hilbert space H = S + S ⊥ .The Hamiltonian H 1 is such that S is a zero eigenspace and the eigenvectors in S ⊥ have eigenvalue at least J > 2 H 2 ∞ .Then, | S ) denotes the smallest eigenvalue of H 2 restricted to space S. Let H = H 1 + H 2 be the sum of two Hamiltonians operating on some Hilbert space H = S + S ⊥ .The Hamiltonian H 1 is such that S is a zero eigenspace and the eigenvectors inS ⊥ have eigenvalue at least J > 2 H 2 ∞ .Let K := H 2 ∞ .Then, for any δ ≥ 0 and vector |ψ satisfying ψ| H |ψ ≤ λ(H) + δ, there exists a |ψ ∈ S such that | ψ|ψ | 2 ≥ 1 − Consider arbitrary |ψ such that ψ| H |ψ ≤ λ(H) + δ.We can write |ψ = α 1 |ψ 1 + α 2 |ψ 2 for |ψ 1 ∈ S, |ψ 2 ∈ S ⊥ , α 1 , α 2 ∈ R, α 1 , α 2 ≥ 0, and α 2 1 + α 2 2 = 1.The proof of Lemma 4.1 yields [43]his section, we restate and prove Theorem 1.1.For this, we first show a corollary of the Projection Lemma of Kempe, Kitaev, Regev[43].For completeness, we first state the Projection Lemma.Lemma 4.1 W,C .Since the state encodes a correct query string in register Q, |ψ hist lies in the ground space of H 2 .We conclude that |ψ hist is in the joint ground space of H 1 and H 2 , and hence in the ground space of H = H 1 + H 2 .Finally, by assumption, the output qubit W 1 of the construction is set to |0 in timesteps 0 to L − 1.In timestep L, since U accepts with certainty given the correct query string x, W 1 is set to |1 .It follows that, as desired, Thus, the history state |ψ satisfies ψ | H |ψ ≤ λ(H) + (δ + γ ).Unfortunately, a priori the state |φ in the proof register (Q, Q ) of |ψ is arbitrary.Let us now approximate |ψ with another history state |ψ , which contains a string of correct query answers in Q.This is accomplished by the following lemma, which assumes the definitions introduced in this proof thus far.andwhere register Q of |ψ contains only correct query answers when written in the standard basis.Proof.By Lemma 3.3, the ground space G of H 2 is contained in the span of states of the form |x Q ⊗ |φ Q where x is a correct query string encoded in unary.Since the ground spaces of H 1 and H 2 have non-empty intersection, i.e. history states acting on "quantum proofs" from G (which lie in the null space of H 1 and obtain energy λ(H 2 ) against H 2 ), we know λ 4.2 P QMA[log] -completeness of APX-2-CORR We now define APX-2-CORR and show that it is P QMA[log] -complete using similar techniques to Section 4.1.For brevity, define f (|ψ , A, B) := ψ| A ⊗ B |ψ − ψ| A |ψ ψ| B |ψ .We now prove Theorem 1.2 by showing P QMA[log] -hardness in Lemma 4.7 and containment in P QMA[log] in Lemma 4.8.APX-2-CORR is P QMA[log] -hard for k = 5 and l = 1, i.e., for 5-local Hamiltonian H and 1-local observables A and B.
[50]nition 4.6 (APX-2-CORR(H, A, B, k, l, a, b, δ)).Given a k-local Hamiltonian H, l-local observablesA and B, and real numbers a, b, and δ such that a − b ≥ n −c and δ ≥ n −c , for n the number of qubits H acts on and c, c ≥ 0 some constants, decide:• If H has a ground state |ψ satisfying f (|ψ , A, B) ≥ a, output YES.•If for any |ψ satisfying ψ| H |ψ ≤ λ(H) + δ it holds that f (|ψ , A, B) ≤ b, output NO.Proof.For an arbitrary P QMA[log]circuit U , define U as in the proof of Theorem 1.1, consisting of L one-and two-qubit gates.We modify U as follows.Let U 's output qubit be denoted W 1 .We add two ancilla qubits, W 2 and W 3 , which are set to |00 throughout U 's computation.We then append to U a sequence of six 2-qubit gates which, controlled onW 1 , map |00 in W 2 W 3 to |φ + = (|00 + |11 )/ √2, e.g.apply a controlled Hadamard gate and the 5-gate Toffoli construction from Figure4.8 of[50].Appending six identity gates on W 1 , we obtain a . Let |ψ X ,Y denote the unique ground state of H, whose X register contains the (unary encoding of) a correct query string for U .If U accepts, then |i B ⊗ |ψ X ,Y for i ∈ { 0, 1 } are degenerate ground states of H final , implying H final has no spectral gap.Conversely, if U rejects, observe that the smallest eigenvalue of H final lies in the |1 B block of H final .This is because H final is block-diagonal with respect to register X , and we have from the proof of Lemma 3.3 that λ(H) < 3 .Restricted to this |1 B block, the spectral gap of H final is at least ( − δ)/4 m by Lemma 4.11.Alternatively, restricted to the |0 B block, any correct query string in X leads to spectral gap at least 4 (by construction of T , since U outputs 0 in this case), and any incorrect query string in X leads to spectral gap at least ( − δ)/4 m by Lemma 4.11.Hence, H final has an inverse polynomial spectral gap, as desired.
Let y * i be the lexicographically largest query string in S k * i with divergence probability p * i s.t.: That such a y * i ∈ S k * i exists follows from an argument similar to Equation (23): By definition, q * i denotes the bounded divergence probability for all invalid queries up to and including query k * i , and the term exponential in − I y * i + I is obtained by greedily choosing, for all invalid queries of y * i after query k * i , the outcome which occurs with probability at least 1/2.Set B y * i