arXiv:2006.03530v2 [cs.CC] 3 Mar 2021 ste“rnil fsf storage” safe of “principle the as o eeal pc ffiin.Mr pcfial,i quantum a if specifically, More [ computation efficient. a space of generally end not the to measurements ca “spac resources and these circuit) how the understand in to gates and of computa operates), number quantum circuit the of (i.e., models “time” feasible prin as of experime of power near-term “proof algorithmic on from problems the transitions useful now field solving have to the advantage we As fruition, a labs. experiments from industrial quantum far constrained resource be but still impressive may computers quantum unu optto a h oeta ooti rmtcsp dramatic [ obtain e.g., to (see, potential simulation quantum the has computation Quantum Introduction 1 eto ahmtc tMIT. at Mathematics of ment uis f o example, for if, qubits; esrmnsi unu optto seeg,[ e.g., (see computation quantum a in measurements m needed lmntn nemdaeMaueet nSaeBuddQ Space-Bounded in Measurements Intermediate Eliminating ∗ 1 nemdaemaueet,tecircuit the measurements, intermediate orsodn uhr esrmuhcg.d;prin o portions [email protected]; author, Corresponding h picpeo eerdmaueet saohrcmo n common another is measurement” deferred of “principle The onainlqeto nti raak fi spsil to possible is it if asks area this in question foundational A esle yaqatmcmue nls pc hnsespsil by possible seems than space less in standar computer many quantum of a by versions solved well-conditioned be w the is approach, that class our of showing complexity component involves quantum key space-bounded A effi a a time measurements. intermediate of and to efficient definition natural space the quite simultaneously that is is that It measurements of diate number efficient. number the the space increasing in generally without overhead t not measurements While large intermediate is a eliminate computation. so introduce the and not of an does qubits, circuit end quantum it the a that at take meaning measurements to possible always makes is that it that shows storage,” space egv naraiease oti usinb xiiigaprocedur a exhibiting by question this to answer affirmative an give We know computation, quantum of theory the in result foundational A . eateto optrSine h nvriyo Chicago of University The Science, Computer of Department s = O (log 19 ilFffra n ahr Remscrim Zachary and Fefferman Bill 1 , t 29 ttsta ti laspsil to possible always is it that states and ) )aditgrfcoiain[ factorization integer and ]) m Computation Q Θ( = ′ 2 osrce sn hspicpeoeae on operates principle this using constructed , Abstract 34 t ,ti nal an entails this ), ,ti rcdr ssetaaclaqbt,ads is so and qubits, ancilla extra uses procedure this ], 1 18 hsrsac eecmltdwieamme fteDepart- the of member a while completed were research this f , 24 m o hsresult. this for ame , 32 etraded-off. be n ebigipeetdi ayaaei and academic many in implemented being , il”dmntain fpoal quantum provable of demonstrations ciple” t,i spriual rtclt characterize to critical particularly is it nts, 36 ”(.. h ubro uiso hc the which on qubits of number the (i.e., e” in hthv etitv eore,such resources, restrictive have that tions circuit , 45 eusfripratpolm uhas such problems important for eedups space-efficiently 43 ihmyb fidpnetinterest, independent of be may hich , 49 nee nectn eidi which in period exciting an entered xoeta blowup exponential .Wiefuttlrn,flyscalable fully fault-tolerant, While ]. ieragbacpolm may problems linear-algebraic d faclayqubits. ancillary of – bs oalwn rforbidding or allowing to obust rdc neuvln circuit equivalent an produce d time-efficiently in.I atclr hsshows this particular, In cient. Q i rcdr stm efficient, time is procedure his 51 lsia computer. classical a ae,i ssetaancillary extra uses it gates, ∗ kwehri spsil to possible is it whether sk ) hl lsi eutknown result classic a While ]). cson acts ste“rnil fsafe of “principle the as n oeiiaealinterme- all eliminate to e s lmnt intermediate eliminate uisadperforms and qubits ee intermediate defer nteaon of amount the in uantum s + poly ( m ) Our main result solves this problem. We show that every problem solvable by a “general” quan- tum algorithm, which may make arbitrary use of quantum measurements, can also be solved, using the same amount of space, by a “unitary” quantum algorithm, which may not perform any intermedi- ate measurements. As an immediate corollary, this shows that, in the space-bounded setting, unitary quantum algorithms are at least as powerful as probabilistic algorithms, resolving a longstanding open problem [32, 50]. In the process of proving this result, we also obtain the following result, which is likely of independent interest: approximating the solution of the “well-conditioned” versions of various standard linear-algebraic problems, such as the determinant problem, the matrix inversion problem, or the matrix powering prob- lem, is complete for the class of bounded-error logspace quantum algorithms. These are a new class of natural problems on which quantum computers seem to outperform their classical counterparts.

1.1 Eliminating Intermediate Measurements Before proceeding further, it is worthwhile to briefly discuss why it is desirable to be able to eliminate intermediate measurements. Firstly, quantum measurements are a natural resource, much as time and space are. In addition to the general desirability of using as few resources as possible in any sort of computational task, it is especially desirable to avoid intermediate measurements, due to the technical challenges involved in implementing such measurements and resetting qubits to their initial states (for a discussion of these issues from an experimental perspective see, e.g., [14]). Secondly, unitary computations are reversible, whereas quantum measurement is an inherently irreversible process. The ability to “undo” a unitary subroutine, by running it in reverse, is routinely used in the design and analysis of quantum algorithms (see, for instance, [5,17,18,31,33,44,53]). Moreover, reversible computations may be performed without generating heat [27]. Thirdly, by demonstrating that unitary quantum space and general quantum space are equivalent in power, we show that the definition of quantum space is quite robust. Allowing intermediate measurements, or even general quantum operations, does not provide any additional power in the space-bounded setting. Let BQUSPACE(s) (resp. BQSPACE(s)) denote the class of promise problems recognizable with two- sided bounded-error by a uniform family of unitary (resp. general) quantum circuits, where, for each input of length n, there is a corresponding circuit that operates on O(s(n)) qubits and has 2O(s(n)) gates. Note that it is standard to require that the running time of a computation is at most exponential in its space bound; see, for instance, [32, 40, 49, 51] for the importance of this restriction in quantum and/or probabilistic space-bounded computation. Furthermore, let QUMASPACE(s) (resp. QMASPACE(s)) de- note those promise problems recognized by a unitary (resp. general) quantum Merlin-Arthur protocol that operates in space O(s(n)) and time 2O(s(n)). An equivalent definition of these complexity classes may be given using quantum Turing machines; see Section 2.2 for further details. Our main result is:

Theorem 1. For any space-constructible function s : N N, where s(n) = Ω(log n), we have →

BQUSPACE(s)= BQSPACE(s)= QUMASPACE(s)= QMASPACE(s).

Remark. Note that BPSPACE(s) BQUSPACE(s) was not previously known to hold, where BPSPACE(s) ⊆ denotes the class of problems recognizable by a probabilistic algorithm in space O(s) (and time 2O(s)); see, e.g., [32,50] for discussion of this question. As one would expect quantum computation to generalize probabilistic computation, the lack of a proof of this containment was unfortunate. Since it is clear that BPSPACE(s) BQSPACE(s), we have BPSPACE(s) BQUSPACE(s), resolving this question. ⊆ ⊆ Remark. To further clarify the parameters of our result, given a general quantum algorithm that operates in space s and time t, we produce a unitary quantum algorithm that operates in space O(s+log t) and time poly(t2s). Note that these parameters coincide with that of the space-efficient simulation of a deterministic

2 algorithm by a (classical) reversible algorithm [28]. Further note that in the extreme (but natural) setting in which t = 2O(s) (e.g. quantum logspace), this procedure is simultaneously space-efficient and time- efficient. On the other hand, in the opposite extreme setting in which t = poly(s), this procedure is no longer time-efficient; of course, in this setting, the standard “principle of deferred measurement” is simultaneously space-efficient and time-efficient. Between these two extremes, one has time-space tradeoffs analogous to those of the simulation of deterministic algorithms by reversible algorithms [10]. We also study the one-sided (bounded-error and unbounded-error) analogues of the aforementioned two-sided bounded-error space-bounded quantum complexity classes. We establish analogous results concerning the relationship between the unitary and general versions of these classes; see Section 5 for a formal statement of these results.

1.2 Exact and Approximate Linear Algebra Let intDET denote the problem of computing the determinant of an n n integer-valued matrix, and, × 1 following its original definition by Cook [12], let DET∗ denote the class of problems NC (Turing) reducible to intDET. Let BQUL = BQUSPACE(log(n)), BQL = BQSPACE(log(n)), and BPL = BPSPACE(log(n)) denote the bounded-error quantum and probabilistic logspace classes. Before our work, the following relationships were known [49,51]: BQUL BQL DET∗ and BPL BQL. Many natural linear-algebraic ⊆ ⊆ ⊆ problems are DET∗-complete, such as intDET, intMATINV (the problem of computing a single entry of the inverse of a matrix), and intITMATPROD (the problem of computing a single entry of the product of polynomially-many matrices). It seems rather unlikely that any such DET∗-complete problem is in the class BQL, as this would imply BQL = DET∗, and, therefore, NL BQL. ⊆ We next consider the problem of approximating the answer to such linear-algebraic problems. Let poly-conditioned-MATINV denote the problem of approximating, to additive 1/poly(n) accuracy, a single entry of the inverse of an n n matrix A with condition number κ(A)= poly(n) (see Section 3 for a precise × definition). Ta-Shma [45], building on the landmark result of Harrow, Hassidim, and Lloyd [21], showed poly-conditioned-MATINV BQL. Fefferman and Lin [18] improved upon this result by presenting a ∈ unitary quantum logspace algorithm and proving a matching BQUL-hardness result, thereby exhibiting the first known natural BQUL-complete (promise) problem. We further extend this line of research by proving the following theorem, which demonstrates an intriguing relationship between BQUL and DET∗:

Theorem 2. All of the poly-conditioned versions of the “standard” DET∗-complete problems, given in Definitions 9 and 10 are BQUL-complete.

This shows that several natural linear-algebraic problems are in BQUL, and, moreover, are not in BPL (unless BQUL = BPL). In particular, the above theorem shows poly-conditioned-ITMATPROD BQUL. ∈ We also show that this problem is BQL-hard, which implies BQL = BQUL; Theorem 1, which states the more general equivalence for any larger space bound, then follows from a standard padding argument. We next exhibit several other applications of this theorem. Firstly, in Section 4, we consider fully logarithmic approximation schemes, whose study was initiated by Doron and Ta-Shma [16]. Using the preceding theorem, we show that the BQL vs. BPL question is equivalent to several distinct questions involving the relative power of quantum and probabilistic fully logarithmic approximation schemes. Sec- ondly, consider κ(n)-conditioned-DET, the problem of approximating, to within a multiplicative factor 1 + 1/poly(n), the determinant of an n n matrix with condition number κ(n). Boix-Adser`a, Eldar, × and Mehraban [8] recently showed that κ(n)-conditioned-DET DSPACE(log(n) log(κ(n))poly(log log n)). ∈ They also raised the following question: is poly-conditioned-DET BQL-complete? As an immediate con- sequence of Theorem 2, we answer their question in the affirmative.

Corollary 3. poly-conditioned-DET is BQL(= BQUL)-complete.

3 To see the significance of the previous corollary, recall the well-known “dequantumization” result given by Watrous [51]: BQL DSPACE(log2 n). It is natural to ask if a stronger upper bound on BQL can be ⊆ established. We note that the strongest currently known “derandomization” result of this type, given by 3 2 ǫ Saks and Zhou [41], states BPL DSPACE(log 2 n). Note that the statement BQL DSPACE(log − n) ⊆ ⊆ would follow from either a small improvement in the result of Boix-Adser`a, Eldar, and Mehraban (i.e., proving a stronger upper bound on the needed amount of deterministic space in terms of κ(n)) or from a small improvement in our result (i.e., proving κ(n)-conditioned-DET remains BQL-hard for subpolynomial 2 ǫ κ(n)). Therefore, if BQL DSPACE(log − n), ǫ> 0, then both our result and their result are essentially 6⊆ ∀ optimal (in terms of the dependence on κ(n)). Moreover, we note that our paper and that of Boix-Adser`a, Eldar, and Mehraban used similar power series techniques to produce space-efficient algorithms for κ(n)-conditioned-DET. However, our quantum algorithm can make use of a power series with an exponentially larger number of terms than seems possible for their (or any other) classical algorithm. This suggests a possible mechanism for explaining the supposed advantage of quantum computers over classical computers in the space-bounded setting. In Section 5, we study well-conditioned versions of the “standard” C=-complete problems. We establish a result, very much analogous to Theorem 2, which shows that these problems are complete for the one-sided error versions of space-bounded quantum complexity classes. This enables us to prove results, analogous to Theorem 1, concerning the relative power of unitary and general quantum space in the one-sided error cases. We conclude by stating several open problems related to our work in Section 6.

1.3 Techniques We now briefly discuss the techniques used to prove Theorem 2, which states that the poly-conditioned versions of the “standard” DET∗-complete problems are BQUL-complete. As discussed earlier, Fefferman and Lin [18] showed that poly-conditioned-MATINV is BQUL-complete. In order to establish the BQUL- completeness of the other poly-conditioned problems, we exhibit a long cycle of reductions through these problems. We note that reductions between the standard versions of these problems (i.e., where there is no assumption of being well-conditioned) are well-known [4,6,12,13,30,46–48]. However, these reductions, generally, do not preserve the property of being poly-conditioned. Therefore, we must exhibit reductions that are rather different from the “standard” reductions. As a motivating example, consider poly-conditioned-DET+ and poly-conditioned-SUMITMATPROD. While Berkowitz’s algorithm [6] provides a reduction from DET+ to SUMITMATPROD, this reduction does not preserve the property of being poly-conditioned. We now provide a brief sketch of a reduction which does preserve this property; see Lemma 19 for a formal proof. Consider a positive definite n n × matrix H, with σ (H) 1 and κ(H)= poly(n). We wish to obtain an additive 1/poly(n) approximation 1 ≤ of ln(det(H)). By Jacobi’s formula, ln(det(H)) = tr(ln(H)), where ln(H) denotes the matrix logarithm. ∞ (I H)k We have σ1(I H) 1 1/poly(n) < 1, which implies that the series −k converges to ln(H). − ≤ − − k=1 ∞ tr((I H)k) P Therefore, ln(det(H)) = −k . Moreover, as σ1(I H) 1 1/poly(n), the aforementioned − k=1 − ≤ − m P tr((I H)k) series converges “quickly,” which implies that, for some m = poly(n), the quantity −k is a − k=1 sufficiently good approximation of ln(det(H)). Estimating this quantity corresponds toP an instance of poly-conditioned-SUMITMATPROD. In Section 3.2, we exhibit a collection of reductions between these various linear-algebraic problems, which use a variety of techniques to preserve the property of being poly-conditioned.

4 1.4 Related Work Simultaneously and independently of our work, Girish, Raz, and Zhan [20] proved the following weaker version of our Theorem 2: contraction-MATPOW BQUL, where contraction-MATPOW is a special case ∈ of our poly-conditioned-MATPOW. We note that the techniques used in their proof differed substantially from ours. As a consequence of this result, they then obtain the following weaker version of our Theorem 1: BQUL = BQQL, where BQQL BQL is a version of quantum logspace that allows a special type of ⊆ intermediate measurements to be performed, but does not allow using the (classical) result of earlier measurements to control later steps of the computation.

2 Preliminaries

2.1 General Notation and Definitions Let Mat(n) = Cn n denote the set of all n n complex matrices and let Herm(n) = A Mat(n) : × × { ∈ A = A denote the set of all n n Hermitian matrices. For A Mat(n), let σ (A) σn(A) 0 †} × ∈ 1 ≥···≥ ≥ denote its singular values, and let λ (A), . . . , λn(A) C denote its eigenvalues (with multiplicity); if 1 ∈ A Herm(n), then λj(A) R, j, and we order the eigenvalues such that λ (A) λn(A). Let ∈ ∈ ∀ 1 ≥ ··· ≥ In denote the n n identity matrix, Pos(n) = A Herm(n) : λn(A) 0 denote the n n positive × { ∈ ≥ } × semidefinite matrices, Proj(n) = A Pos(n) : A2 = A denote the n n projection matrices, U(n) = { ∈ } × A Mat(n) : AA† = In denote the n n unitary matrices, and Den(n) = A Pos(V ) : tr(A) = 1 { ∈ } × r+ci { ∈ O(n) } denote the n n density matrices. Let Q[i]n = : r, c, d Z, r , c , d 2 denote the set × { d ∈ | | | | | | ≤ } of all O(n)-bit Gaussian rationals and let Mat(n) (resp. Herm(\ n), Pos(n), etc.) denote the subset of Mat(n) (resp. Herm(n), Pos(n), etc.) consisting of those matrices whose entries are all in Q[i]n. We define Mat(n, c, d)= A Mat(n) : c σn(Ad) σ (A) d and we alsod analogously define Mat(n, c, d), { ∈ ≤ ≤ 1 ≤ } Herm(n, c, d), etc. Let [n]= 1,...,n . { } We assume that the reader has familiarity with quantum computation and the theoryd of quantum information; see, for instance, [25, 34, 54] for an introduction. A quantum system, on s qubits, that is in s a pure state is described by a unit vector ψ in the 2s-dimensional Hilbert space C2 . A mixed state of | i the same system is described by some ensemble (pi, ψi ) : i I , for some index set I, where pi [0, 1] { | i ∈ } 2s ∈ denotes the probability of the system being in the pure state ψi C , and i pi = 1. This ensemble s | i ∈ corresponds to the density matrix A = pi ψi ψi Den(2 ). i | ih |∈ P Let T(n,m) denote the set of all superoperators of the form Φ : Mat(n) Mat(m) (i.e., Φ is a P → C-linear map from the C-vector space Mat(n) to the C-vector space Mat(m)). Let T(n) = T(n,n) and let 1n T(n) denote the identity operator. Consider some Φ T(n,m). We say that Φ is positive ∈ ∈ if, A Pos(n), we have Φ(A) Pos(m). We say that Φ is completely positive if Φ 1r is positive, ∀ ∈ ∈ ⊗ r N, where denotes the tensor product. We say that Φ is trace-preserving if tr(Φ(A)) = tr(A), ∀ ∈ ⊗ A Mat(n). If Φ is both completely positive and trace-preserving, then we say Φ is a quantum channel; ∀ ∈ let Chan(n,m) = Φ T(n,m) : Φ is a quantum channel denote the set of all such channels, and let { ∈ } Chan(n) = Chan(n,n). Let vec denote the usual vectorization map that takes a matrix A Mat(n) 2 ∈ to the vector vec(A) Cn consisting of the entries of A (in some fixed order). For Φ T(n), let ∈ ∈ K(Φ) Mat(n2) denote the natural representation of Φ, which is defined to be the (unique) matrix for ∈ which vec(Φ(A)) = K(Φ)vec(A), A Mat(n). ∀ ∈ We consider parameterized promise problems of the form = ( n,f ,...,f )n N, for functions f1,...,fh : P P 1 h ∈ N R; n,f ,...,f consists of instances of size n which satisfy various conditions expressed in terms of → P 1 h f (n),...,fh(n). For a promise problem defined over some alphabet Σ, we, by slight abuse of notation, 1 P also write to denote the subset of Σ that satisfies the promise; analogously, we write n,f ,...,f to P ∗ P 1 h denote those instances of size n that satisfy the promise. For X , let ( X ) 0, 1 denote the h i ∈ P P h i ∈ { } desired output on input X. We also use the notation = ( , ), where j = X : ( X )= j . P P1 P0 P {h i ∈ P P h i }

5 2.2 Space-Bounded Quantum Computation We briefly recall the definitions of several needed space-bounded quantum complexity classes. We begin by noting that, in many of the previous papers that considered space-bounded quantum computation [24, 32, 36, 45, 49–52], quantum Turing machines were used to define the various complexity classes of interest. Arguably, this is the “natural” model to be used to define these classes. However, as the (equivalent) model of uniformly generated quantum circuits are more familiar to quantum complexity theorists and physicists, we state these definitions using quantum circuits. We emphasize that all of the results in this paper apply to both quantum circuits and quantum TMs. Definition 4. A (unitary) quantum circuit is a sequence of quantum gates, each of which is a member of some fixed set of gates that is universal for quantum computation (e.g., H,CNOT,T ). We say that { } a family of quantum circuits Qw : w is DSPACE(s)-uniform if there is a deterministic TM that, on { ∈ P} O(s( w )) any input w , runs in space O(s( w )) (and hence time 2 ), and outputs a description of Qw. ∈ P | | | | Definition 5. Consider functions c, k : N [0, 1] and s : N N, with s(n) = Ω(log n), all of which are → → computable in DSPACE(s). Let QUSPACE(s)c,k denote the collection of all promise problems = ( , ) P P1 P0 such that there is a DSPACE(s)-uniform family of (unitary) quantum circuits Qw : w , where Qw O(s( w )) { ∈ P} acts on hw = O(s( w )) qubits and has 2 | | gates, which has the following properties. The circuit | | hw Qw is applied to hw qubits that were initialized in the all-zeros state 0 , after which the first qubit is | i measured in the standard basis. If the result is 1, then we say Qw accepts w; if, instead, the result is 0, then we say Qw rejects w. We require that the following conditions hold:

Completeness: w Pr[Qw accepts w] c( w ). ∈ P1 ⇒ ≥ | | Soundness: w Pr[Qw accepts w] k( w ). ∈ P0 ⇒ ≤ | | Let BQUSPACE(s)= QUSPACE(s) 2 1 denote (two-sided) bounded-error unitary quantum space s and let 3 , 3 BQUL = BQUSPACE(log n) denote unitary quantum logspace.

O(s( w )) Note that, in the preceding definitions, Qw has 2 | | gates (this requirement is forced by the uniformity condition). That is to say, in our definition of quantum space s(n), we require that the O(s( w )) computation also runs in time 2 | | ; see the excellent survey paper by Saks [40] for a thorough discussion of the desirability of requiring that space-bounded probabilistic computations run in time at most exponential in their space bound, as well as, e.g., [32,49,51] for discussions of the analogous issue for quantum computations. Note that the particular choice of universal gate set does not affect the definition of BQUSPACE(s) due to the space-efficient version [32] of the Solovay-Kitaev theorem. Furthermore, the 1 class BQUL would remain the same if defined as QUSPACE(log n)c,k for any c, k for which c(n) = 1 poly(n) , 1 1 − k(n)= , and q : N N> , where q(n)= poly(n), such that c(n) k(n) , n [17]. poly(n) ∃ → 0 − ≥ q(n) ∀ We next consider general space-bounded quantum computation. Most fundamentally, we wish to define a model of quantum computation that allows intermediate quantum measurements. That is to say, rather than considering a purely unitary quantum computation in which a single measurement is performed at the end of the computation, we now allow measurements to be performed throughout the computation, and for the results of those measurements to be used to control the computation. As we wish for our main result (the fact that unitary and general space-bounded quantum computation are equivalent in power) to be as strong as possible, we wish to define a model of general space-bounded quantum computation that is as powerful as possible. To that end, we will define a space-bounded variant of the general quantum circuit model considered in the classic paper of Aharonov, Kitaev, and Nisan [2], in which gates are now arbitrary quantum channels.

Definition 6. A general quantum circuit on h qubits is a sequence Φ = (Φ1,..., Φt) of quantum channels, h where each Φj Chan(2 ). By slight abuse of notation, we use Φ to denote the element Φt ∈ ◦···◦

6 Φ Chan(2h) obtained by composing the individual gates of the circuit in order. We say that a 1 ∈ family of general quantum circuits Φw = (Φw, ,..., Φw,t ) : w is DSPACE(s)-uniform if there { 1 w ∈ P} is a deterministic Turing machine that, on any input w , runs in space O(s( w )) (and hence time O(s( w )) ∈ P | | 2 | | ), and outputs a description of Φw; to be precise, a description of Φw consists of the entries of 2h each K(Φw,j), where we require that K(Φw,j) Mat(2 ). ∈ The operation of applying a unitary transformation is a special case of a quantum channel, and so d the general quantum circuit model extends the unitary quantum circuit model. Moreover, the process of performing any (partial or full) quantum measurement is described by a quantum channel, and the pre- ceding definition allows the results of intermediate measurements to be used to control which operations are applied at later stages of the computation (this can be accomplished by using a subset of the qubits as classical bits to store the results of earlier measurements, thereby making these results available to gates that appear later in the computation). It is necessary to establish some reasonable restriction on the complexity of computing a description of each gate of the circuit, as we do not wish to unreason- ably increase the power of the model by allowing, for example, non-computable numbers to be used in defining each gate (see, e.g., [32,37,38,51] for further discussion of this issue). We note that this general quantum circuit model is equivalent to the space-bounded (general) quantum Turing machine model of Watrous [51]. We also note that the results of this paper would apply to any “reasonable” variant of space-bounded quantum computation that is classically controlled, which includes all of the “standard” variants that have been considered (e.g., [32, 36, 45, 51]). We refer the reader to [32, Section 2] for a thorough discussion of the various models of space-bounded quantum computation, and, in particular, of the reasonableness of requiring classical control. Definition 7. Consider functions c, k : N [0, 1] and s : N N, with s(n) = Ω(log n), all of which are → → computable in DSPACE(s). Let QSPACE(s)c,k denote the collection of all promise problems = ( , ) P P1 P0 such that there is a DSPACE(s)-uniform family of general quantum circuits Φw : w , where Φw O(s( w )) { ∈ P} acts on hw = O(s( w )) qubits and has 2 | | gates, that has the following properties. The circuit | | hw Φw is applied to hw qubits that were initialized in the all-zeros state 0 , after which the first qubit | i is measured in the standard basis. If the result is 1, then Φw accepts w; otherwise, Φw rejects w. We require that w Pr[Φw accepts w] c( w ) and w Pr[Φw accepts w] k( w ). We define ∈ P1 ⇒ ≥ | | ∈ P0 ⇒ ≤ | | general quantum space BQSPACE(s)= QSPACE(s) 2 1 and BQL = BQSPACE(log n). 3 , 3 We next define space-bounded quantum Merlin-Arthur proof systems, essentially following [18]. Definition 8. Consider functions c, k : N [0, 1] and s : N N, with s(n) = Ω(log n), all of which are → → computable in DSPACE(s). Let QUMASPACE(s)c,k (resp. QMASPACE(s)c,k) denote the collection of all promise problems = ( 1, 0) such that there is a DSPACE(s)-uniform family of unitary (resp. general) P P P O(s( w )) quantum circuits Vw : w , where Vw acts on mw+hw = O(s( w )) qubits and has 2 gates, that { ∈ P} | | | | has the following properties. Let Ψmw denote the set of mw-qubit states. For each w , the verification hw ∈ P circuit Vw is applied to the state ψ 0 , where ψ Ψm is a (purported) proof of the fact that w | i ⊗ | i | i∈ w ∈ . Then, the first qubit is measured in the standard basis. If the result is 1, then w is accepted; otherwise, P1 w is rejected. We require that w ψ Ψm , Pr[Vw accepts w, ψ ] c( w ) and w ∈ P1 ⇒ ∃| i ∈ w | i ≥ | | ∈ P0 ⇒ ψ Ψmw , Pr[Vw accepts w, ψ ] k( w ). We then define QUMASPACE(s) = QUMASPACE(s) 2 , 1 , ∀| i ∈ | i ≤ | | 3 3 QMASPACE(s)= QMASPACE(s) 2 1 , QUMAL = QUMASPACE(log n), and QMAL = QMASPACE(log n). 3 , 3 Lastly we define analogues of the preceding classes for other error types. One-sided bounded-error: RQUSPACE(s) = QUSPACE(s) 1 , RQMASPACE(s) = QMASPACE(s) 1 , etc. One-sided unbounded- 2 ,0 2 ,0 error: NQSPACE(s) = QSPACE(s)c,0, NQMASPACE(s) = QMASPACE(s)c,0, etc. Note c:N (0,1] c:N (0,1] that RQMASPACE and NQMASPACE→S have perfect soundness. We define→S QMASPACE with perfect com- pleteness: QMASPACE1(s)= QMASPACE(s)1, 1 and PreciseQMASPACE1(s)= QMASPACE(s)1,k. 2 k:N [0,1) →S 7 3 Well-Conditioned Determinant

We define the following well-conditioned versions of the standard DET∗-complete problems [12]. We first define well-conditioned versions of DET and MATINV. The input to each problem consists of a matrix A (among other values) which is promised to be well-conditioned (among other promises): A ∈ Mat(n, 1/κ(n), 1). Recall that, by definition, this means that σ (A) 1 and σn(A) 1/κ(n), which 1 ≤ ≥ implies A has condition number at most κ(n). d Definition 9. Consider functions κ : N R 1 and ǫ : N R>0. → ≥ → DETn,κ,ǫ−1 Input: A Mat(n), b R 0 ∈ ∈ ≤ Promise: A Mat(n, 1/κ(n), 1), det(A) (0, eb ǫ(n)] [eb, 1] ∈ | |∈ − ∪ Output: 1ifddet(A) eb, 0 otherwise + | |≥ DETn,κ,ǫ−1 d Input: A Mat(n), b R 0 ∈ ∈ ≤ Promise: A Pos(n, 1/κ(n), 1), det(A) (0, eb ǫ(n)] [eb, 1] ∈ ∈ − ∪ Output: 1 ifd det(A) eb, 0 otherwise ≥ MATINVn,κ,ǫ−1 d Input: A Mat(n), s,t [n], b R 0 ∈ ∈ ∈ ≥1 Promise: A Mat(n, 1/κ(n), 1), A− [s,t] [0, b ǫ(n)] [b, κ(n)] ∈ 1 | |∈ − ∪ Output: 1ifdA− [s,t] b, 0 otherwise + | |≥ MATINVn,κ,ǫ−1 d Input: A Mat(n), s,t [n], b R 0 ∈ ∈ ∈ ≥ Promise: A Pos(n, 1/κ(n), 1), A 1[s,t] [0, b ǫ(n)] [b, κ(n)] ∈ − ∈ − ∪ Output: 1ifdA 1[s,t] b, 0 otherwise − ≥ d We next define well-conditioned versions of the various matrix multiplication problems; here, “well- conditioned” has a somewhat different definition. For a sequence of matrices A1,...,Am, and for indices j2 j1, j2, where 1 j1 j2 m, let Aj1,j2 = Aj. We require that all partial products have small ≤ ≤ ≤ j=j1 singular values σ (Aj ,j ) κ(n). Q 1 1 2 ≤ Definition 10. Consider functions m : N N, κ : N R 1, and ǫ : N R>0. → → ≥ → MATPOWn,m,κ,ǫ−1 Input: A Mat(n), s,t [n], b R 0 ∈ ∈ ∈ ≥ Promise: σ (Aj) κ(n) j [m], Am[s,t] [0, b ǫ(n)] [b, κ(n)] 1 ≤ ∀ ∈ | |∈ − ∪ Output: 1ifdAm[s,t] b, 0 otherwise | |≥ ITMATPRODn,m,κ,ǫ−1 Input: A1,...,Am Mat(n), s,t [n], b R 0 ∈ ∈ ∈ ≥ Promise: σ (Aj ,j ) κ(n) 1 j j m, A ,m[s,t] [0, b ǫ(n)] [b, κ(n)] 1 1 2 ≤ ∀ ≤ 1 ≤ 2 ≤ | 1 |∈ − ∪ Output: 1if A1,m[s,t]db, 0 otherwise | 0 |≥ ITMATPRODn,m,κ,ǫ≥ −1 Input: A1,...,Am Mat(n), s,t [n], b R 0 ∈ ∈ ∈ ≥ Promise: σ (Aj ,j ) κ(n) 1 j j m, A ,m[s,t] [0, b ǫ(n)] [b, κ(n)] 1 1 2 ≤ ∀ ≤ 1 ≤ 2 ≤ 1 ∈ − ∪ Output: 1if A ,m[s,t]db, 0 otherwise 1 ≥ SUMITMATPRODn,m,κ,ǫ−1 2 Input: A1,...,Am Mat(n), E [n] , b R 0 ∈ ⊆ ∈ ≥ d 8 Promise: σ1(Aj1,j2 ) κ(n) 1 j1 j2 m, A1,m[s,t] [0, b ǫ(n)] [b, E κ(n)] ≤ ∀ ≤ ≤ ≤ (s,t) E ∈ − ∪ | | ∈ P

Output: 1if A1,m[s,t] b, 0 otherwise (s,t) E ≥ ∈ P + With the exception of the problem DET (and DET ), each of the above problems are defined such that they correspond to approximating some quantity with additive error ǫ/2; for example, MATINV 1 1 involves determining if A− [s,t] b ǫ or A− [s,t] b. To clarify our definition of DET, this | ǫ | ≤ − | | ≥ problem corresponds to a e± 2 multiplicative approximation of det(A) , which is equivalent to an ap- | | proximation of ln( det(A) ) with additive error ǫ/2. As we will see in Section 3.2 and Section 4, this | | is the “correct” definition of DET, in the sense that it is the version of the determinant problem that most closely corresponds to the other linear-algebraic problems (matrix powering, matrix inversion, etc.). Moreover, these problems, defined as they are above, are somewhat “over parameterized.” For exam- 1 ple, if A, s, t, b MATINVn,κ(n),ǫ−1(n), then MATINV( A, s, t, b ) = MATINV( ǫ(n)A,s,t,ǫ− (n)b ) and h 1 i ∈ h i h i ǫ(n)A,s,t,ǫ (n)b MATINV −1 . These additional parameters are convenient as they allow h − i ∈ n,κ(n)ǫ (n),1 us to express certain results more cleanly.

Definition 11. For each promise problem −1 (resp. −1 ) in Definitions 9 and 10, we define Pn,κ,ǫ Pn,m,κ,ǫ poly-conditioned- to be the promise problem O(1) O(1) (resp. O(1) O(1) O(1) ). For example, P Pn,n ,n Pn,n ,n ,n poly-conditioned-DET Input: A Mat(n) and b R 0 ∈ ∈ ≤ −O(1) Promise: A Mat(n,n O(1), 1), det(A) (0, eb n ] [eb, 1] ∈ − | |∈ − ∪ Output: 1ifddet(A) eb, 0 otherwise | |≥ d ′ We say that = ( n,f1,...,fh )n N is (many-one) reducible to ′ = ( m,f′ ′ ,...,f ′ )m N if p0,..., , where P P ∈ P P 1 h′ ∈ ∃ N each pj is a real (h + 1)-variate polynomial, such that n , gn : n,f1,...,fh m,f′ ′ ,...,f ′ such that the ∀ ∈ ∃ P → P 1 h′ following conditions hold: (1) ( X )= (gn( X )), X n,f ,...,f , (2) m = p (n,f (n),...,fh(n)), P h i P′ h i ∀h i ∈ P 1 h 0 1 and (3) fj′(m) = pj(n,f1(n),...,fh(n)), j. If(gn)n N is computable in deterministic logspace (resp. ∀ ∈ uniform NC1, uniform AC0), we write m (resp. m , m ). For a C, P ≤L P′ P ≤NC1 P′ P ≤AC0 P′ we say that is C-complete if (1) C and (2) m , C. P′ P′ ∈ P ≤L P′ ∀P ∈ Fefferman and Lin [18] showed that poly-conditioned-MATINV is BQUL-complete. We extend their result by showing that by showing that all of the above poly-conditioned problems are BQUL-complete. Along the way to proving this result, we also show that BQUL = BQL. To accomplish this, we will prove several lemmas that exhibit reductions between particular problems in Definitions 9 and 10. The proofs of these lemmas share a common structure: for a pair of promise problems , , we show how P P′ to transform an instance w to an instance f(w) such that the reduction function f preserves ∈ P ∈ P′ the answer (i.e., (w)= (f(w))) and also preserves the property of being well-conditioned. Note that P P′ m poly-conditioned- m poly-conditioned- . P ≤L P′ ⇒ P ≤L P′ 3.1 Eliminating Intermediate Measurements In this section, we show that intermediate measurements may be eliminated without any increase in needed space. We begin by showing that poly-conditioned-ITMATPROD is BQL-hard and is in BQUL, which implies BQL = BQUL; the general equivalence then follows from a standard padding argument. 1 In the following, we assume that m(n), κ(n), and ǫ(n)− can be computed to O(log n) bits of precision 0 in uniform AC . For m N 1 and r, c [m], define Fm,r,c Mat(m) such that Fm,r,c[r, c] = 1 and ∈ ≥ ∈ ∈ Fm,r,c[r , c ] = 0, (r , c ) = (r, c). ′ ′ ∀ ′ ′ 6 d Lemma 12. ITMATPROD m MATPOW. ≤AC0

9 m Proof. Consider A1,...,Am, s, t, b ITMATPRODn,m,κ,ǫ−1. Following [12], let A = Fm+1,r,r+1 Ar h i∈ r=1 ⊗ ∈ Mat(nm + n) consist of n n blocks, where the blocks immediately above the mainP diagonal blocks are × b given by A ,...,Am, and all other entries are 0. For j [m], we have 1 ∈ d m+1 j j − A = Fm+1,r,r+j Ar,r+j 1. ⊗ − r=1 X b m Let s = s, t = nm+t, b = b. Then A [s, t]= A ,m[s,t], which implies ITMATPROD( A ,...,Am, s, t, b )= 1 h 1 i MATPOW( A, s, t, b ). Moreover, j [m], we have h i ∀ ∈ b b b b b b m+1 j m+1 j j b b b b − − σ1(A )= σ1 Fm+1,r,r+j Ar,r+j 1 = σ1 Ar,r+j 1 = max σ1(Ar,r+j 1) κ(n). ⊗ − − r − ≤ r=1 ! r=1 ! X M b Therefore, A, s, t, b MATPOW −1 . h i∈ nm+n,m,κ(n),ǫ (n) Lemma 13. MATPOW m MATINV. b b b b ≤AC0 m+1 j − Proof. Consider A, s, t, b MATPOWn,m,κ,ǫ−1 . Following [12], let Gj = Fm+1,r,r+j Mat(m + 1), h i∈ r=1 ∈ j [m]. Let Y = G A Mat(nm + n) consist of n n blocks, where theP blocks immediately above ∀ ∈ 1 ⊗ ∈ × d the main diagonal blocks are all given by A. Let Z = Inm+n Y Mat(nm + n) and observe that d − ∈ m 1 j d Z− = Gj A . ⊗ j X=0 1 m Let s = s and t = nm + t. Then Z [s, t] = A [s,t]. We have σ (Z) σ (Inm n)+ σ (Y ) 1+ κ(n) − 1 ≤ 1 + 1 ≤ and b b b m mb m m 1 j j j σ (Z− )= σ Gj A σ (Gj A ) 1+ σ (A ) 1+ κ(n) 1+ mκ(n). 1 1  ⊗  ≤ 1 ⊗ ≤ 1 ≤ ≤ j j j j X=0 X=0 X=1 X=1   1 1 1 1 This implies σnm+n(Z) = σ1(Z− )− (1 + mκ(n))− . Let Z = 1+κ(n) Z Mat(nm + n) and ≥ ⌈ ⌉ ∈ b = 1+ κ(n) b. We then conclude that Z, s, t, b MATINVnm+n,(1+mκ(n)) 1+κ(n) , 1+κ(n) −1 ǫ−1(n) and ⌈ ⌉ h i ∈ b ⌈ ⌉ ⌈d ⌉ MATPOW( A, s, t, b )= MATINV( Z, s, t, b ). h i h i b b b b b Lemma 14. MATINV m MATINV+. ≤NC1 b b b b

1 A†A A† Proof. Consider A, s, t, b MATINV −1 . We define H = − Pos(2n). Note that h i ∈ κ,ǫ 3 A 2I ∈ 1 1  −  1 2(A†A)− A− 1 2 2 H = 3 . Moreover, σ (H) 1 and σb n(H) (σn(A)) (3dκ(n)) . Let s = s, − (A ) 1 I 1 ≤ 2 ≥ 9 ≥ −  † −  t = t+n, and b = 3b. Then H 1[s, t] = 3A 1[s,t]. Therefore, MATINV( A, s, t, b )= MATINV( H, s, t, b ) b − − b b h i h b i and H, s, t, b MATINV+ . h i∈ 2n,(3κ(n))2,(3ǫ(n))−1 b b b b b b b b Lemma 15. poly-conditioned-ITMATPROD BQUL. b b b b ∈ m + m m Proof. By Lemmas 12 to 14, ITMATPROD NC1 MATINV . Recall NC1 ′ poly-conditioned- NC1 ≤ P ≤+ P ⇒ P ≤ poly-conditioned- . By [18, Theorem 13], poly-conditioned-MATINV BQUL. P′ ∈

10 Lemma 16. poly-conditioned-ITMATPROD is BQL-hard.

Proof. Suppose = ( 1, 0) BQL. By definition, there is a uniform family of general quantum circuits P P P ∈ O(1) Φw = (Φw,1,..., Φw,tw ) : w , where Φw acts on hw = O(log w ) qubits and has tw = w gates, { ∈ P} 2 | | | 1| such that if w , then Pr[Φw accepts w] , and if w , then Pr[Φw accepts w] . Without ∈ P1 ≥ 3 ∈ P0 ≤ 3 loss of generality we may, for convenience, assume that Φw “cleans-” its workspace at the end of the computation, by measuring the first qubit in the computational basis, and then forcing every other qubit to the state 0 (by measuring each such qubit in the computational basis and, if the result 1 is obtained, | i flipping its value). 2hw O(1) Let dw = 2 = w . For each j [tw], we define A(w)j = K(Φw,tw j+1); note that, by | | ∈ − Definition 6, A(w)j Mat(dw) and A(w)j can be constructed in DSPACE(log( w )). Moreover, as Φw,j hw ∈ hw | | ∈ Chan(2 ), j [tw], we have Φw,tw j2+1 Φw,tw j1+1 Chan(2 ), which by [39, Theorem 1] ∀ ∈ − ◦···◦ − ∈ implies the following boundd on the largest singular value of any partial product of the A(w)j,

j2 O(1) σ1(A(w)j1,j2 )= σ1 A(w)j = σ1(K(Φw,tw j2+1 Φw,tw j1+1)) dw = n .   − ◦···◦ − ≤ j=j Y1 p   hw 1 hw 1 hw hw Let xw = 10 10 and yw = 0 0 . By Definition 7, | − ih − | | ih |

tw Pr[Φw accepts w]= A(w)j [xw,yw]= A(w) ,t [xw,yw].   1 w j Y=1   2 2 Therefore, ITMATPROD( A(w) ,...,A(w)t ,xw,yw, ) = (w) and A(w) ,...,A(w)t ,xw,yw, h 1 w 3 i P h 1 w 3 i ∈ poly-conditioned-ITMATPROD.

For the sake of completeness, in Appendix A, we also prove a version of the preceding lemma for the (equivalent) version of quantum logspace that is defined using quantum Turing machines.

BQUL Lemma 17. QMAL QUMAL . ⊆ Proof. This follows by an argument similar to that of the proof of Lemma 16. Suppose = ( , ) P P1 P0 ∈ QMAL. There is a uniform family of general quantum circuits Φw = (Φw,1,..., Φw,tw ) : w , where O(s( w )) { ∈ P} Φw acts on mw + hw = O(s( w )) qubits and has 2 gates, that has the following properties. Let | | | | Π1 = 1 1 I2mw+hw−1 and let Ψmw denote the set of mw-qubit states. For each w , the verification | ih |⊗ hw ∈ P circuit Φw is applied to the state ψ 0 , where ψ Ψm is a (purported) proof of the fact that | i ⊗ | i | i ∈ w w 1. Then, the first qubit is measured in the standard basis. If the result is 1, then w is accepted; ∈ P 2 otherwise, w is rejected. If w 1, then ψ Ψmw , Pr[Φw accepts w, ψ ] 3 , and if w 0, then ∈ P 1 ∃| i ∈ | i ≥ ∈ P ψ Ψm , Pr[Φw accepts w, ψ ] . ∀| i∈ w | i ≤ 3 hw hw hw hw We have Pr[Φw accepts w, ψ ]= Π1, Φw( ψ ψ 0 0 ) = Φw† (Π1), ψ ψ 0 0 . Let hw |hwi h mw| ih | ⊗ | ih | i h 2 | ih | ⊗ | ih |i 1 M = (I 0 )Φw† (Π1)(I 0 ) Pos(2 ). Then w 1 λ1(M) 3 and w 0 λ1(M) 3 . ⊗ h | ⊗ | i ∈ ∈ P 2⇔ ≥ 1 ∈ P ⇔ ≤ Given access to M, the problem, of determining if λ (M) or λ (M) , is obviously in QUMAL. 1 ≥ 3 1 ≤ 3 By the same argument as in the proofd of Lemma 16, estimating an entry of M (to 1/poly(n) precision) corresponds to an instance of poly-conditioned-ITMATPROD, which, by Lemma 15, is in BQUL. Therefore, BQUL QUMAL . P ∈ Lemma 18. BQUL = BQL = QUMAL = QMAL.

Proof. Clearly, BQUL BQL. By Lemma 16, poly-conditioned-ITMATPROD is BQL-hard, and, by ⊆ Lemma 15, poly-conditioned-ITMATPROD BQUL; this implies BQL BQUL. Therefore, BQL = BQUL. ∈ ⊆ By [18, Theorem 18] QUMAL = BQUL (in fact, their argument shows QUMALO = BQULO, for any

11 oracle ). Clearly, BQL QMAL, and so it suffices to show QMAL BQL. By Lemma 17, and the O ⊆ ⊆ (straightforward) fact that BQL is self-low, we have

BQUL BQUL BQL QMAL QUMAL = BQUL BQL = BQL. ⊆ ⊆ We now prove Theorem 1 from Section 1.1, which we restate here for convenience.

Theorem 1. For any space-constructible function s : N N, where s(n) = Ω(log n), we have →

BQUSPACE(s)= BQSPACE(s)= QUMASPACE(s)= QMASPACE(s).

Proof. Clearly, BQUSPACE(s) BQSPACE(s). The containment BQSPACE(s) BQUSPACE(s) follows ⊆ ⊆ from Lemma 18 and a standard padding argument; for the sake of completeness, we briefly state this argument in Appendix B. Analogous statements hold for QMASPACE.

3.2 BQUL Completeness

We next show that the poly-conditioned versions of all of the standard DET∗-complete problems (Defini- 2 tions 9 and 10) are BQUL-complete. By [18, Theorem 13], poly-conditioned-MATINV is BQUL-complete ; therefore, it suffices to exhibit a chain of reductions through the various poly-conditioned- . Recall that P m poly-conditioned- m poly-conditioned- P ≤L P′ ⇒ P ≤L P′ Lemma 19. DET+ m SUMITMATPROD. ≤AC0 + Proof. Consider H, b DETn,κ,ǫ−1 . By the promise, H Pos(n), λ1(H) = σ1(H) 1, and λn(H) = 1 h i ∈ ∈ 1 ≤ σn(H) κ(n) , which implies σ (I H) = λ (I H) = 1 λn(H) 1 κ(n) < 1. This implies ≥ − 1 − 1 − − ≤ − − ∞ (I H)k d ln(H)= −k , where here ln(H) denotes the matrix logarithm. Recall that, as a consequence of − k=1 Jacobi’s formula,P ln(det(H)) = tr(ln(H)). m (I H)k ∞ (I H)k For m N 1, let Sm = −k , let Rm = −k = log(H) Sm, and let Dm Mat(m) ∈ ≥ k=1 k=m+1 − − ∈ 1 denote the diagonal matrix whereP Dm[k, k]= . LetPl = 1+log( κ(n) ) , let A = I b ( Dm (I H)) k ⌊ ⌊ ⌋ ⌋ 1 ⊕ − ⊗ −d ∈ b Mat(nl + nm), and, for k [m], let Ak = In(l+k 1) (Im+1 k (I H)) Mat(nl + nm). Then ∈ − ⊕b − ⊗ − ∈ b m m d b b (I H)k d b A ,m = Aj = I b − − . 1 nl ⊕ k j ! Y=1 Mk=1 b b Let Em = (d, d) : d [nl + nm] . We then have { ∈ } m b (I H)k A ,m[s,t] = tr(A ,m) = tr(I b) tr − = nl tr(Sm)= nl + ln(det(H)) + tr(Rm). 1 1 nl − k − (s,t) Em k=1   X∈ X b b b b Moreover, for 1 j j m, we have ≤ 1 ≤ 2 ≤

k σ1(Aj1,j2 ) max σ1(Inbl), max σ1((I H) ) = 1. ≤ k 0,...,j2 j1 −  ∈{ − }  2 + Note that Ref. [18] showed bpoly-conditioned-MATINV ∈ BQUL and that poly-conditioned-MATINV is BQUL-hard, but the equivalence between these two problems is “obvious” (and shown explicitly in Lemma 14)

12 As shown above, σ (I H) 1 κ(n) 1, which implies 1 − ≤ − − k k 1 k m+1 ∞ (I H) ∞ (σ1(I H)) ∞ (1 κ(n)− ) 1 σ1(Rm)= σ1 − − − κ(n) 1 . k ! ≤ k ≤ k ≤ − κ(n) k=Xm+1 k=Xm+1 k=Xm+1   If m κ(n) ln(2nκ(n)ǫ(n) 1), then ≥ − −1 −1 1 κ(n) ln(2nκ(n)ǫ(n) ) 1 ln(2nκ(n)ǫ(n) ) 1 tr(Rm) nσ (Rm) nκ(n) 1 nκ(n) = ǫ(n). ≤ 1 ≤ − κ(n) ≤ e 2     1 1 Let m = κ(n) 1 + log( 2nκ(n)ǫ(n) ) κ(n) ln(2nκ(n)ǫ(n) ) and E = E b . Note that tr(Rm) 0. ⌈ ⌉⌊ ⌊ − ⌋ ⌋≥ − m ≥ We then have, b b 1 nl + ln(det(H)) A1,m[s,t]= nl + ln(det(H)) + tr(Rmb ) nl + ln(det(H)) + ǫ(n). ≤ b ≤ 2 (s,tX) E b ∈ b b b b b ǫ(n) 1 If det(H) e , then A1,m[s,t] nl + b; if det(H) e − , then A1,m[s,t] nl + b 2 ǫ(n). ≥ (s,t) Eb ≥ ≤ (s,t) Eb ≤ − P∈ P∈ Let b = nl + b. Therefore, bA ,..., A b ,bE, b SUMITMATPROD b b and DETb ( H, b ) = h 1 m i ∈ n(l+mb ),m,b 1,2ǫ−1(n) h i SUMITMATPROD( A1,..., Amb , E, b ). b b h b i b b b m 0 Lemma 20. ITMATPROD ITMATPROD≥ . b ≤bAC0b b Proof. Consider A ,...,Am, s, t, b ITMATPROD −1 . For j [2m + 1], we define h 1 i∈ n,m,κ,ǫ ∈

Aj, j m ≤ Aj = t t , j = m + 1 | ih |  A2†m+2 j , j m + 2 b − ≥  2 We then have A , m [s,s] = A ,m[s,t]A ,m[s,t] = A ,m[s,t] . Consider j , j such that 1 j j 1 2 +1 1 1 | 1 | 1 2 ≤ 1 ≤ 2 ≤ m +1. If j m + 1 j , then 1 ≤ ≤ 2 b 2 σ1(Aj ,j )= σ1 Aj ,m t t A† σ1(Aj ,m)σ1( t t )σ1 A† κ(n) . 1 2 1 | ih | j2,m ≤ 1 | ih | j2,m ≤     If j2 m+1, then σ1(Aj1,j2 )= σ1(Aj1 m 1,j2 m 1) 2 ≤ −0 − − − ≤ κ(n). Let s = t = s and b = b . Then A1,..., A2m+1, s, t, b ITMATPRODn,≥2m+1,κ2,ǫ−2 and b h i ∈ b ITMATPROD( A1,...,Am, s, t, b )= ITMATPROD( A1,..., A2m+1, s, t, b ). b h b b i b h b b b b i 0 m Lemma 21. ITMATPROD≥ 0 DET. ≤AC b b b b b m 0 Proof. Consider A1,...,Am, s, t, b ITMATPRODn,m,κ,ǫ≥ −1 . Let Y = Fm+1,r,r+1 Ar Mat(nm+n) h i∈ r=1 ⊗ ∈ consist of n n blocks, where the blocks immediately above the mainP diagonal blocks are given by × d A ,...,Am, and all other entries are 0. Let B = Inm n Y Mat(nm + n) and observe that 1 + − ∈ m m+1 1 d B− = Inm+n + Fm+1,r,c Ar,c 1. ⊗ − r c r X=1 =X+1 Let C = B + nm + t s . By the matrix determinant lemma, and the fact that det(B) = 1, | ih | 1 1 det(C)=(1+ s B− nm + t ) det(B)=1+ B− [s,nm + t]=1+ A ,m[s,t]. h | | i 1

13 Next, observe that

σ1(C) σ1( nm + t s )+ σ1(I)+ σ1(Y ) 2+max σ1(Aj ) 2+ κ(n). ≤ | ih | ≤ j ≤ m 1 j Notice that B− = Y , which implies j=0 P m m m 1 j σ1(B− ) σ1(Y ) 1+ max σ1(Ak,k+j 1) 1+ κ(n)=1+ mκ(n). ≤ ≤ k [m j+1] − ≤ j j j X=0 X=1  ∈ −  X=1 1 1 1 1 1 By the Sherman-Morrison formula, C− = B− (I (1 + s B− nm + t )− nm + t s B− ). Recall that, 1 − h | | i | ih | by the promise, s B− nm + t = A1,m[s,t] R 0. Therefore, h | | i ∈ ≥ 1 1 1 1 1 σ (C− ) σ (B− )(σ (I)+ σ ((1 + s B− nm + t )− nm + t s )σ (B− )) (1 + mκ(n))(2 + mκ(n)). 1 ≤ 1 1 1 h | | i | ih | 1 ≤ 1 1 1 This implies σnm+n(C) = σ1(C− )− ((1 + mκ(n))(2 + mκ(n)))− . Let l = 1 + ln( 2+ κ(n) ) and bl ≥ bl ⌊ ⌊ ⌋ ⌋ let C = e− C Mat(nm + n). Then, for j [nm + n], σj(C)= e− σj(C); in particular, σ1(C) 1 and ∈ 3 ∈ b ≤ σnm n(C) (2 + mκ(n)) . Moreover, + ≥ − b d b b b b b l(nm+n) l(nm+n) l(nm+n) b det(C) = e− det(C) = e− (1 + A1,m[s,t]) = e− (1 + A1,m[s,t]). | | | | | | b Let a = ln(1 +bb ǫ(n)) l(nm + n) and b = ln(1 + b) l(nm + n). If A1,m[s,t] b, then det(C) e ; if − − ba − ≥ | |≥ A ,m[s,t] b ǫ(n), then det(C) e ; thus, ITMATPROD( A ,...,Am, s, t, b )= DET( C, b ). Finally, 1 ≤ − | |≤ h 1 i h i b b b b b 1+ b ǫ(n) ǫ(n) ǫ(n) b a = ln b = ln 1+ ln 1+ b b . − 1+ b ǫ(n) 1+ b ǫ(n) ≥ 1+ κ(n) ≥ 2(1 + κ(n))  −   −    b Therefore, bC, b DET 3 −1 . h i∈ nm+m,(2+mκ(n)) ,ǫ (n)(2+2κ(n)) Lemma 22. DET m DET+. b b ≤NC1 2 Proof. Consider A, b DETn,κ,ǫ−1 . Let H = AA† Pos(n) and b = 2b. Then, det(H)= det(A) and 2 h i ∈ ∈ | | σj(H)= σj (A), j. Therefore, H, b DETn,κ2,2ǫ−1 and DET( A, b )= DET( H, b ). ∀ h i∈ b d h b i h i b Lemma 23. MATINV+ m SUMITMATPROD. b ≤AC0 b b b b Proof. Consider H, s, t, b MATINV+ . For m N, we have h i∈ κ,ǫ−1 ∈ m j 1 m+1 (I H) = H− (I (I H) ). − − − j X=0 1 Let m = κ(n) 1 + log( 4κ(n)ǫ(n)− ) . For j [m], let Aj = Ijn (Imb j+1 (I H)) Mat(nm + n). ⌈ ⌉⌊ ⌊ ⌋ ⌋ ∈ ⊕ − ⊗ − ∈ For 1 j j m, we have ≤ 1 ≤ 2 ≤ b b b d b mb j1+1 − b min(k,j2 j1+1) k σ1(Aj1,j2 )= σ1 Ij1n (I H) − = max σ1((I H) ) = 1.  ⊕  −  k 0,...,j2 j1+1 − k M=1 ∈{ − } b    Let E = (s + jn,t + jn) : j [m] . We then have { ∈ } mb b b j 1 mb +1 A1,mb [s, t]= (I H) [s,t] = (H− (I (I H) ))[s,t]. b − − − (s,b bt) E j=0 X∈ X b b b 14 This implies

1 1 mb +1 1 mb +1 A1,mb [s, t] H− [s,t] (H− (I H) )[s,t] σ1(H− (I H) ) b − | | ≤ | − |≤ − (s,b bt) E X∈ b b b mb +1 1 mb +1 1 1 σ (H− )(σ (I H)) κ(n) 1 ǫ(n). ≤ 1 1 − ≤ − κ(n) ≤ 4   1 Let b = b ǫ(n). We then conclude that A ,..., A b , E, b SUMITMATPROD b b −1 and − 4 h 1 m i ∈ nm+n,m,1,2ǫ (n) MATINV( H, s, t, b )= SUMITMATPROD( A1,..., Amb , E, b ). b h i h b b bi b Lemma 24. SUMITMATPROD m ITMATPROD. ≤AC0 b b b b

Proof. Consider A ,...,Am, E, b SUMITMATPROD −1 . Let Tc,d Mat(n) denote the per- h 1 i ∈ n,m,κ,ǫ ∈ mutation matrix corresponding to interchanging elements c, d [n] and leaving all other elements ∈ fixed. For j [m], let Aj = T1,tAjT1,s Mat(n E ). Let R Mat( Ed) be defined such that ∈ (s,t) E ∈ | | ∈ | | L∈ Rr,c = 1 if r = c or r =b 1, and Rr,c = 0 otherwise;d let A0 = R In anddAm+1 = A† . We then have ⊗ 0 A0,m+1[1, 1] = A1,m[s,t]. Notice that σ1(A0)= σ1(Am+1)= σ1(R)σ1(In) 2 E , which implies (s,t) E b b ≤ | b| ∈ p b P b b 2 σ Aj ,j 2 E σ A 2 E κ(n) 2n κ(n), for 0 j j m + 1. 1 1 2 ≤ | | 1 max(j1,1),min(j2,m) ≤ | | ≤ ≤ 1 ≤ 2 ≤    Let s =b t = 1 and b = b. Then A ,..., Am , s, t, b ITMATPROD 3 2 −1 and h 0 +1 i ∈ n ,m+2,2n κ(n),ǫ (n) SUMITMATPROD( A ,...,Am, E, b )= ITMATPROD( A ,..., Am , s, t, b ). h 1 i h 0 +1 i b b b b b b b b We now prove Theorem 2 from Section 1.2, which we restate here for convenience. b b b b b Theorem 2. All of the poly-conditioned versions of the “standard” DET∗-complete problems, given in Definitions 9 and 10 are BQUL-complete.

Proof. By [18, Theorem 13], poly-conditioned-MATINV is BQUL-complete. By Lemmas 12 to 14 and 19 to 24, we have

MATINV+ m SUMITMATPROD m ITMATPROD m MATPOW m MATINV m MATINV+ ≤AC0 ≤AC0 ≤AC0 ≤AC0 ≤NC1 and

+ m m m 0 m m + DET 0 SUMITMATPROD 0 ITMATPROD 0 ITMATPROD≥ 0 DET 1 DET . ≤AC ≤AC ≤AC ≤AC ≤NC Recall that m or m reducibility implies m reducibility, and m poly-conditioned- m ≤AC0 ≤NC1 ≤L P ≤L P′ ⇒ P ≤L poly-conditioned- . Therefore, each such poly-conditioned- is BQUL-complete. P′ P 4 Fully Logarithmic Approximation Schemes

We next study the class of functions that are well-approximable in quantum logspace, following (es- sentially) the notation and definitions of [16]. In particular, we work with the general (resp. unitary) quantum Turing machine model, rather than the equivalent model of a uniform family of general (resp. unitary) quantum circuits; of course, all results also apply to the quantum circuit model. For simplic- ity, throughout this section, we fix the alphabet Σ = 0, 1 . We say that a function f :Σ R is { } ∗ → poly-bounded if f(w) poly( w ), w Σ . | |≤ | | ∀ ∈ ∗

15 Definition 25. We say that a poly-bounded f has a fully logarithmic quantum approximation scheme FLQAS if there is a (general) quantum TM Mf that, on input x,ǫ,δ , where x Σ and ǫ, δ R> , h i ∈ ∗ ∈ 0 runs in time poly( x ,ǫ 1, log(δ 1)) and space O(log( x ) + log(ǫ 1) + log(log(δ 1))), and outputs a value | | − − | | − − y R such that Pr[ f(x) y ǫ] δ (to be precise, Mf outputs a string that encodes a dyadic rational ∈ | − |≥ ≤ number y). In other words, with confidence at least 1 δ, the value y is an additive approximation of − f(x) with error at most ǫ. We analogously say that f has a FLQUAS if Mf is a unitary quantum TM, a FLRAS if Mf is a randomized TM, and a FLAS if Mf is a deterministic TM (where, in this last case, we set δ = 0 and remove the dependence on δ from the time and space bounds).

Following the notation established in Section 2.1 and Definitions 9 to 11, let

O(1) (poly-matinv)= A,s,t : A Mat(n,n− , 1),s,t [n] . D n {h i ∈ ∈ } [ d In other words, (poly-matinv) consists of encodings of instances of a variant of poly-conditioned-MATINV D 1 where we only have a promise involving the singular values (i.e., no restriction on A− [s,t] involving b). We then consider the poly-conditioned matrix inversion function poly-matinv( ) : (poly-matinv) R 0, | · | D → ≥ which is given by poly-matinv( A,s,t ) = A 1[s,t] . | h i | | − | Similarly, (poly-itmatprod) consists of all A ,...,Am,s,t , where m = poly(n), A ,...,Am D h 1 i 1 ∈ Mat(n), σ (Aj ,j ) poly(n) for 1 j j m, and s,t [n]. We then define the function 1 1 2 ≤ ≤ 1 ≤ 2 ≤ ∈ poly-itmatprod( ) : (poly-itmatprod) R 0 by poly-itmatprod( A1,...,Am,s,t ) = A1,m[s,t] . | · | D → ≥ | h i | | | Lastly,d we define (poly-det) = A : A Mat(n,n O(1), 1) . Note that the promise problem DET, D n{h i ∈ − } given in Definition 9, corresponds to approximating the function ln( poly-det( ) ) : (poly-det) R 0, S | · | D → ≤ defined in the obvious way. d Note that, following [16], we have defined fully logarithmic (quantum, randomized, etc.) approx- imation schemes with respect to additive error ǫ; that is to say, we approximate f(x) by a value y such that Pr[ f(x) y ǫ] δ. We then define a multiplicative fully logarithmic (quantum, ran- | − | ≥ ≤ domized, etc.) approximation scheme of a function g :Σ∗ R 0 as an analogous procedure that → ≥ produces an approximation z such that Pr[z [e ǫg(x), eǫg(x)]] δ. Note that here, for convenience, 6∈ − ≤ we follow the convention (as used in, for example, [22]) that multiplicative approximations are defined using e ǫ, rather than the more standard (and essentially equivalent) (1 ǫ). Note that ln( poly-det( ) ) ± ± | · | has an (additive) FLQUAS (resp. FLQAS, FLRAS, FLAS) if and only if poly-det( ) has a multiplicative | · | FLQUAS (resp. FLQAS, FLRAS, FLAS); this follows from the fact that ln( det(A) ) y ǫ if and only if | | | − |≥ ey [e ǫ det(A) , eǫ det(A) ]. 6∈ − | | | | The function poly-matinv( ) is known to have a FLQAS [16]. We improve on this result. | · | Lemma 26. Each of poly-matinv( ) , poly-itmatprod( ) , and ln( poly-det( ) ) have a FLQUAS. More- | · | | · | | · | over, poly-det( ) has a multiplicative FLQUAS. | · | Proof. By [18, Theorem 14] (and the discussion following it), poly-matinv( ) has a FLQUAS. By Lem- | · | mas 12 and 13, poly-itmatprod( ) has a FLQUAS. Finally, by Lemmas 19, 22 and 24, ln( poly-det( ) ) | · | | · | has a FLQUAS; this implies poly-det( ) has a multiplicative FLQUAS. | · | Doron and Ta-Shma [16, Theorem 6] showed that, if BQL = BPL, then every poly-bounded function that has a FLQAS also has a FLRAS (recall that we use BQL and BPL to denote classes of promise problems, which differs from the notation used in [16]). By combining this with the BQUL-hardness of the various poly-conditioned promise problems (Theorem 2) and our result that BQUL = BQL (Lemma 18), the following proposition is immediate; we note that a partial (weaker) version of this proposition was implicit in [15].

Proposition 27. The following statements are equivalent.

16 (i) BQL = BPL.

(ii) Every poly-bounded function that has a FLQAS also has a FLRAS.

(iii) Every poly-bounded function that has a FLQUAS also has a FLRAS.

(iv) poly-matinv( ) has a FLRAS. | · | (v) poly-itmatprod( ) has a FLRAS. | · | (vi) ln( poly-det( ) ) has a FLRAS. | · | (vii) poly-det( ) has a multiplicative FLRAS. | · | Remark. The preceding proposition suggests that poly-det( ) does not have a multiplicative FLRAS, as | · | this would imply the seemingly unlikely statement BQL = BPL. It is natural to compare this with the result of Jerrum, Sinclair, and Vigoda [22] which shows the existence of a multiplicative FPRAS (fully polynomial randomized approximation scheme) for the permanent of a nonnegative integer matrix.

5 Well-Conditioned Singular

The class C=L has a collection of natural complete problems, given by the “verification” versions of the standard DET∗-complete problems [42]. We now study the well-conditioned versions of these problems.

Definition 28. Consider functions m : N N, κ : N R 1, and ǫ : N R>0. → → ≥ → SINGULARn,ǫ−1 Input: A Herm(\ n) ∈ Promise: σ (A) 1, σn(A) 0 [ǫ(n), 1] 1 ≤ ∈ { }∪ Output: 1if σn(A) = 0, 0 otherwise vMATINVn,κ,ǫ−1 Input: A Mat(n), s,t [n], b Q[i]n ∈ ∈ ∈ 1 Promise: A Mat(n, 1/κ(n), 1), A− [s,t] b 0 [ǫ(n), 2κ(n)] ∈ 1 | − | ∈ { }∪ Output: 1ifdA− [s,t]= b, 0 otherwise vMATPOWn,m,κ,ǫd−1 Input: A Mat(n), s,t [n], b Q[i]n ∈ ∈ ∈ Promise: σ (Aj) κ(n) j [m], Am[s,t] b 0 [ǫ(n), 2κ(n)] 1 ≤ ∀ ∈ | − | ∈ { }∪ Output: 1ifdAm[s,t]= b, 0 otherwise vITMATPRODn,m,κ,ǫ−1 Input: A ,...,Am Mat(n), s,t [n], b Q[i]n 1 ∈ ∈ ∈ Promise: σ (Aj ,j ) κ(n) 1 j j m, A ,m[s,t] b 0 [ǫ(n), 2κ(n)] 1 1 2 ≤ ∀ ≤ 1 ≤ 2 ≤ | 1 − | ∈ { }∪ Output: 1if A1,m[s,t]=db, 0 otherwise We begin by exhibiting reductions between the above problems; in subsequent sections, we will use these reductions to prove new properties of quantum logspace. Lemma 29. vMATINV m SINGULAR. ≤AC0 1 b − Proof. Consider A, s, t, b vMATINVn,κ,ǫ−1 . We define B = (2 κ(n) A) 1 2 κ(n) I1 Mat(n + h i∈ ⌈ ⌉ ⊕ − ⌈ ⌉ ∈ 1), u = s + n + 1 , v = t + n + 1 , and C = B vu Mat(n + 1). By the matrix determinant lemma, | i | i | i | i − † ∈ b d 1 1 1 A− [s,t] b b A− [s,t] det(C) = (1 uB− v) det(B)= 1 b b + 1 d det(B)= − det(B). − − 2 κ(n) − 2 κ(n) 2 κ(n)   ⌈ ⌉  ⌈ ⌉  ⌈ ⌉ b b b b b 17 1 1 If A− [s,t] = b, then det(C) = 0, which implies σn+1(C) = 0. Next, suppose A− [s,t] b ǫ(n), ǫ(n) | − | ≥ then det(C) 2 κ(n) det(B) . By the Weyl inequalities, σ1(C) σ1(B)+σ1( vu†)= σ1(B)+1 and, for | |≥ ⌈ ⌉ | b| b ≤ − j [n+1], we have σj(C) σj 1(B)+σ2( vu†)= σj 1(B). Moreover, σ1(B) = 2 κ(n) σ1(A) 2 κ(n) , ∈ b ≤ b − − − 1 b b ⌈ ⌉ b ≤ ⌈ ⌉ σ (B) = 2 κ(n) σ (A) 2, and σ (B)= 1 b − 2 . Therefore, n n n+1 2 κ(n) √5 ⌈ ⌉ b≥ b − ⌈ ⌉ b ≥ b

b ǫ(nb) det(C) 2 κ(n) det( B) ǫ(n)σn(B)σn+1(B) 2ǫ(n) σn (C)= | | ⌈ ⌉ | | = . +1 n ≥ n 1 ≥ √ σ (C) σ (C) − 2 κ(n) (σ1(B) + 1) 5 κ(n) (2 κ(n) + 1) 1 b j (σ1(B) + 1) bσj(B) ⌈ ⌉ b b ⌈ ⌉ ⌈ ⌉ b j=2 j=1 Q Q b b b b b 1 0n+1 C \ Let d = 2 κ(n) +1 and H = d Herm(2n + 2). Notice that H has eigenvalues ⌈ ⌉ C† 0n+1! ∈ b dσ1(Cb),..., dσn+1(C) .b Thisb implies σ1(H) = dσ1(C) 1 and σ2n+2(H) = dσb n+1(C) 0 {± ± } b ≤ ∈ { } ∪ 2ǫ(n) , 1 . Moreover, σ (H) = 0 A 1[s,t] = b. Therefore, vMATINV( A, s, t, b ) = √5 κ(n) (2 κ(n) +1)2 2n+2 − b⌈ b⌉ ⌈ ⌉ b b b ⇔ b b b b h b i h i SINGULAR( H ) and H SINGULAR2n+2,(2ǫ(n))−1√5 κ(n) (2 κ(n) +1)2 . h i h i∈ b ⌈ ⌉ ⌈ ⌉ The followingb lemmasb have proofs analogous to those of Lemma 12 and Lemma 13, respectively. Lemma 30. vITMATPROD m vMATPOW. ≤AC0 Lemma 31. vMATPOW m vMATINV. ≤AC0

5.1 RQSPACE vs. RQUSPACE vs. RQUMASPACE In this section, we will prove the following relationships between the various one-sided bounded-error space-bounded quantum complexity classes.

Theorem 32. For any space-constructible function s : N N, where s(n) = Ω(log n), we have →

RQUMASPACE(s)= RQUSPACE(s) RQSPACE(s) coQUMASPACE1(s). ⊆ ⊆ This theorem, which is very much the one-sided error analogue of Theorem 1, has a proof which follows the same general structure. For those promise problems given in Definition 28, we define P poly-conditioned- as in Definition 11. P Lemma 33. poly-conditioned-vITMATPROD is coRQL-hard.

Proof. Precisely analogous to the proof of Lemma 16.

Lemma 34. RQUMAL RQUL ⊆ Proof (sketch). Apply the well-known technique of replacing Merlin’s proof with the totally mixed state [31], which preserves perfect soundness [26]; then use space-efficient probability amplification for one-sided bounded-error (unitary) quantum logspace [50]. We present the details in Appendix C.

Lemma 35. poly-conditioned-SINGULAR is QUMAL1-complete.

Proof. We first show QUMAL1-hardness. Suppose = ( , ) QUMAL1. By definition, there is a uni- P P1 P0 ∈ form family of (unitary) quantum circuits Vw = (Vw, ,...,Vw,t ) : w , where Vw acts on mw + hw = { 1 w ∈ P} O(log w ) qubits and has tw = poly( w ) gates, such that w 1 ψ Ψmw , Pr[Vw accepts w, ψ ] | | | | ∈ P ⇒ ∃| 1i∈ | i ≥ c = 1, and w 0 ψ Ψmw , Pr[Vw accepts w, ψ ] k = 2 , where Pr[Vw accepts w, ψ ] = h∈w P 2 ⇒ ∀| i ∈ | i ≤ | i Π Vw( ψ 0 ) . k 1 | i ⊗ | i k

18 We make use of the Kitaev clock Hamiltonian construction [25, Section 14.4], in a manner sim- ilar to [18, Lemma 21] (though, without the need to first apply space-efficient probability amplifi- mw +hw cation techniques). Let dw = 2 (tw +1) = poly( w ), define the dw-dimensional Hilbert space m h 2 w 2 w tw+1 | | mw +hw w = C C C , and let Πb = I2b−1 1 1 I2mw +hw−b Proj(2 ) denote the pro- H ⊗ ⊗ mw hw ⊗ | ih |⊗ ∈ jection onto the subspace of C2 C2 spanned by states in which the bth qubit is 1. We define the prop in out ⊗ Hamiltonians Hw ,H ,H ,Hw Pos(dw) on w as follows: d w w ∈ H tw prop 1 d H = Vw,j j j 1 V † j 1 j + I mw +hw ( j j + j 1 j 1 ) w 2 − ⊗ | ih − |− w,j ⊗ | − ih | 2 ⊗ | ih | | − ih − | j X=1   mw+hw in out in prop out H = Πb 0 0 ,H = Π tw tw , and Hw = H + H + H . w ⊗ | ih | w 1 ⊗ | ih | w w w b=Xmw+1 By [25, Section 14.4], r0, r1 R>0, such that w we have: σ1(Hw) r0, w 1 σdw (Hw) 1 c ∃ ∈ 1 √k ∀ ∈ P ≤ ∈ P ⇒ ≤ − = 0, and w 0 σd (Hw) r1 − = 1/poly(dw). Therefore, (w) = SINGULAR( Hw ) and tw+1 ∈ P ⇒ w ≥ tw +1 P h i Hw poly-conditioned-SINGULAR, which implies poly-conditioned-SINGULAR is QUMAL1-hard. h i∈ Finally, poly-conditioned-SINGULAR QUMAL1 follows from using the quantum walk based Hamilto- ∈ nian simulation technique of Childs [7,11] to allow the phase estimation of [18, Lemma 19] to be carried out with one-sided error, in the style of [18, Proposition 32], we omit the straightforward details.

Lemma 36. RQUMAL = RQUL RQL coQUMAL1. ⊆ ⊆ Proof. Clearly, RQUL RQUMAL. By Lemma 34, RQUMAL RQUL, which implies RQUMAL = ⊆ ⊆ RQUL. Trivially, RQUL RQL By Lemma 33, poly-conditioned-vITMATPROD is coRQL-hard; thus, ⊆ by Lemmas 29 to 31, poly-conditioned-SINGULAR is coRQL-hard. Finally, by Lemma 35, we have poly-conditioned-SINGULAR QUMAL1, which implies coRQL QUMAL1; thus, RQL coQUMAL1. ∈ ⊆ ⊆ The main theorem stated at the beginning of this section now follows immediately.

Proof of Theorem 32. Follows from Lemma 36 and a padding argument analogous to Theorem 1.

5.2 NQSPACE vs. NQUSPACE vs. NQUSPACE We next consider variants of the well-conditioned problems of Definition 28, in which ǫ(n) = 0 n N ∀ ∈ and κ(n) = poly(n), which we denote by PreciseSINGULAR, vPreciseITMATPROD, etc. By arguments precisely analogous to those of Section 5.1, we obtain the following three lemmas; we omit the proofs. Lemma 37. poly-conditioned-vPreciseITMATPROD is coNQL-hard.

Lemma 38. NQUMAL NQUL ⊆ Lemma 39. PreciseSINGULAR is PreciseQUMAL1-complete. We then obtain the following relationships between the various one-sided unbounded-error classes.

Lemma 40. NQUMAL = NQUL = NQL = coPreciseQUMAL1 = coC=L.

Proof. Trivially, NQUL NQL and NQUL NQUMAL. By Lemma 38, NQUMAL NQUL, which im- ⊆ ⊆ ⊆ plies NQUMAL = NQUL. By Lemma 37, poly-conditioned-vPreciseITMATPROD is coNQL-hard; thus, by Lemmas 29 to 31, PreciseSINGULAR is coNQL-hard. By Lemma 39, poly-conditioned-SINGULAR ∈ PreciseQUMAL1, which implies NQL coPreciseQUMAL1. By [4, Theorem 14], PreciseSINGULAR is ⊆ C=L-complete, and by Lemma 39, PreciseSINGULAR is PreciseQUMAL1-complete; therefore, C=L = PreciseQUMAL1. Thus far, we have shown NQUMAL = NQUL NQL coPreciseQUMAL1 = coC L. ⊆ ⊆ = To complete the proof, note that, by [49, Theorem 4.14], NQUL = coC=L.

19 Theorem 41. For any space-constructible function s : N N, where s(n) = Ω(log n), we have →

NQUMASPACE(s)= NQUSPACE(s)= NQSPACE(s)= coPreciseQUMA1SPACE(s)= coC=SPACE(s).

Proof. Follows from Lemma 40 and a padding argument analogous to that of Theorem 1.

6 Discussion

We conclude by stating a few interesting open problems related to our work. In Theorem 1 we established the equivalence of unitary quantum space, general quantum space, and space-bounded quantum Merlin- Arthur proof systems, in the two-sided bounded-error case. We obtained an analogous equivalence for one-sided unbounded-error in Theorem 41. However, in the case of one-sided bounded-error, we only have the partial results of Theorem 32. In particular, specializing to the case of logspace, we have BQL = BQUL = QUMAL in the two-sided bounded-error case (Lemma 18), and we have RQUMAL = RQUL RQL coQUMAL1 in the one-sided bounded-error case (Lemma 36). It is naturally to ask if the ⊆ ⊆ analogues of results known to hold for two-sided bounded-error also hold for one-sided bounded-error.

Open Problem 1. Is RQUL = RQL? Is RQL = coQUMAL1?

By the well-known result of Zachos and F¨urer [55], MA = MA1; that is to say, it is possible to achieve perfect completeness for classical (polynomial time) Merlin-Arthur proof systems. On the other hand, the question of whether or not it is possible to achieve perfect completeness for quantum (polynomial time) Merlin-Arthur proof systems (i.e., is QMA = QMA1?) remains open (see, for instance, [1, 3, 9, 23] for previous discussion). We next consider the logspace analogue of this question.

Open Problem 2. Is QMAL = QMAL1?

A possible explanation for the difficulty of proving QMA = QMA1 (if these classes are indeed equal) was provided by Aaronson’s result [1] that there is a quantum oracle such that QMAU = QMA1U ; U 6 therefore, any proof of QMA = QMA1 must use a technique that is quantumly nonrelativizing. Note that the technique used by Zachos and F¨urer [55] to show MA = MA1 is (classically) relativizing. It is not hard to see that Aaronson’s argument can also be used to produce a quantum oracle such that QMALU = U 6 QMAL1U , and so any proof of QMAL = QMAL1 must also use quantumly nonrelativizing techniques. We emphasize that the techniques used in this paper to show our results concerning new inclusions between various complexity classes (i.e., the various reductions between linear-algebraic problems shown in this paper) are quantumly nonrelativizing. Moreover, it is known that it is possible to achieve perfect completeness in quantum Merlin-Arthur proof systems that have a classical witness; that is to say, QCMA = QCMA1 [23]. Note that, trivially, BQUL QCMAL QMAL. Thus, the known equality ⊆ ⊆ BQUL = QMAL immediately implies QCMAL = QMAL. Therefore, QMAL = QMAL1 QCMAL = ⇔ QMAL1 QCMAL = QCMAL1. ⇐ We conclude with a general question. Open Problem 3. What further relationships can be established between BQL and other natural logspace complexity classes (e.g., #L, GapL, L/poly, etc.)?

Acknowledgments

B.F. and Z.R acknowledge support from AFOSR (YIP number FA9550-18-1-0148 and FA9550-21-1-0008). B.F additionally acknowledges support from the National Science Foundation under Grant CCF-2044923 (CAREER). We would like to thank Dieter van Melkebeek, as well as the anonymous reviewers, for many helpful comments on a preliminary draft.

20 References

[1] Scott Aaronson. On perfect completeness for QMA. Quantum Information and Computation, 9(1):0081–0089, 2009. [2] Dorit Aharonov, Alexei Kitaev, and Noam Nisan. Quantum circuits with mixed states. In Proceedings of the thirtieth annual ACM symposium on Theory of computing, pages 20–30, 1998. [3] Dorit Aharonov and Tomer Naveh. Quantum NP-a survey. arXiv preprint quant-ph/0210077, 2002. [4] Eric Allender and Mitsunori Ogihara. Relationships among PL, #L, and the determinant. RAIRO- Theoretical Informatics and Applications, 30(1):1–21, 1996. [5] Charles H Bennett, Ethan Bernstein, Gilles Brassard, and Umesh Vazirani. Strengths and weaknesses of quantum computing. SIAM journal on Computing, 26(5):1510–1523, 1997. [6] Stuart J Berkowitz. On computing the determinant in small parallel time using a small number of processors. Information processing letters, 18(3):147–150, 1984. [7] Dominic W Berry, Andrew M Childs, Richard Cleve, Robin Kothari, and Rolando D Somma. Expo- nential improvement in precision for simulating sparse hamiltonians. In Proceedings of the forty-sixth annual ACM symposium on Theory of computing, pages 283–292, 2014. [8] Enric Boix-Adser`a, Lior Eldar, and Saeed Mehraban. Approximating the determinant of well- conditioned matrices by shallow circuits. arXiv preprint arXiv:1912.03824, 2019. [9] Sergey Bravyi. Efficient algorithm for a quantum analogue of 2-SAT. Contemporary Mathematics, 536:33–48, 2011. [10] Harry Buhrman, John Tromp, and Paul Vit´anyi. Time and space bounds for reversible simulation. In International Colloquium on Automata, Languages, and Programming, pages 1017–1027. Springer, 2001. [11] Andrew M Childs. On the relationship between continuous-and discrete-time quantum walk. Com- munications in Mathematical Physics, 294(2):581–603, 2010. [12] Stephen A Cook. A taxonomy of problems with fast parallel algorithms. Information and Control, 64(1-3):2–22, 1985. [13] C Damm. DET=L(#L). Fachbereich Informatik der Humboldt-Universitat zu, Berlin, 1991. [14] David P DiVincenzo. The physical implementation of quantum computation. Fortschritte der Physik: Progress of Physics, 48(9-11):771–783, 2000. [15] Dean Doron, Amir Sarid, and Amnon Ta-Shma. On approximating the eigenvalues of stochastic matrices in probabilistic logspace. computational complexity, 26(2):393–420, 2017. [16] Dean Doron and Amnon Ta-Shma. On the de-randomization of space-bounded approximate counting problems. Information Processing Letters, 115(10):750–753, 2015. [17] Bill Fefferman, Hirotada Kobayashi, Cedric Yen-Yu Lin, Tomoyuki Morimae, and Harumichi Nishimura. Space-efficient error reduction for unitary quantum computations. In 43rd International Colloquium on Automata, Languages, and Programming (ICALP 2016). Schloss Dagstuhl-Leibniz- Zentrum fuer Informatik, 2016. [18] Bill Fefferman and Cedric Yen-Yu Lin. A complete characterization of unitary quantum space. In 9th Innovations in Theoretical Computer Science Conference (ITCS 2018). Schloss Dagstuhl-Leibniz- Zentrum fuer Informatik, 2018. [19] Richard P Feynman. Simulating physics with computers. Int. J. Theor. Phys, 21(6/7), 1999. [20] Uma Girish, Ran Raz, and Wei Zhan. Quantum logspace algorithm for powering matrices with bounded norm. arXiv preprint arXiv:2006.04880, 2020. [21] Aram W Harrow, Avinatan Hassidim, and Seth Lloyd. Quantum algorithm for linear systems of equations. Physical review letters, 103(15):150502, 2009. [22] Mark Jerrum, Alistair Sinclair, and Eric Vigoda. A polynomial-time approximation algorithm for the permanent of a matrix with nonnegative entries. Journal of the ACM (JACM), 51(4):671–697, 2004.

21 [23] Stephen P Jordan, Hirotada Kobayashi, Daniel Nagaj, and Harumichi Nishimura. Achieving perfect completeness in classical-witness quantum Merlin-Arthur proof systems. Quantum Information & Computation, 12(5-6):461–471, 2012. [24] Richard Jozsa, Barbara Kraus, Akimasa Miyake, and John Watrous. Matchgate and space-bounded quantum computations are equivalent. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 466(2115):809–830, 2010. [25] Aleksei Yur’evich Kitaev. Quantum computations: algorithms and error correction. Uspekhi Matem- aticheskikh Nauk, 52(6):53–112, 1997. [26] Hirotada Kobayashi, Keiji Matsumoto, and Tomoyuki Yamakami. Quantum Merlin-Arthur proof systems: Are multiple Merlins more helpful to Arthur? In International Symposium on Algorithms and Computation, pages 189–198. Springer, 2003. [27] Rolf Landauer. Irreversibility and heat generation in the computing process. IBM journal of research and development, 5(3):183–191, 1961. [28] Klaus-J¨orn Lange, Pierre McKenzie, and Alain Tapp. Reversible space equals deterministic space. Journal of Computer and System Sciences, 60(2):354–367, 2000. [29] Seth Lloyd. Universal quantum simulators. Science, pages 1073–1078, 1996. [30] Meena Mahajan and V Vinay. Determinant: Combinatorics, algorithms, and complexity. Chicago Journal of Theoretical Computer Science, 1997. [31] Chris Marriott and John Watrous. Quantum Arthur–Merlin games. Computational Complexity, 14(2):122–152, 2005. [32] Dieter van Melkebeek and Thomas Watson. Time-space efficient simulations of quantum computa- tions. Theory of Computing, 8(1):1–51, 2012. [33] Daniel Nagaj, Pawel Wocjan, and Yong Zhang. Fast amplification of QMA. Quantum Information & Computation, 9(11):1053–1068, 2009. [34] Michael A Nielsen and Isaac Chuang. Quantum computation and quantum information, 2002. [35] Noam Nisan. Pseudorandom generators for space-bounded computation. Combinatorica, 12(4):449– 461, 1992. [36] Simon Perdrix and Philippe Jorrand. Classically controlled quantum computation. Mathematical Structures in Computer Science, 16(4):601–620, 2006. [37] Zachary Remscrim. The power of a single qubit: Two-way quantum finite automata and the word problem. In 47th International Colloquium on Automata, Languages, and Programming (ICALP 2020), volume 168 of Leibniz International Proceedings in Informatics (LIPIcs), pages 139:1–139:18, 2020. [38] Zachary Remscrim. Lower bounds on the running time of two-way quantum finite automata and sublogarithmic-space quantum turing machines. In 12th Innovations in Theoretical Computer Science Conference (ITCS 2021), 2021. [39] Wojciech Roga, Zbigniew Puchala, Lukasz Rudnicki, and Karol Zyczkowski. Entropic trade-off relations for quantum operations. Physical Review A, 87(3):032308, 2013. [40] Michael Saks. Randomization and derandomization in space-bounded computation. In Proceedings of Computational Complexity (Formerly Structure in Complexity Theory), pages 128–149. IEEE, 1996. [41] Michael Saks and Shiyu Zhou. BPhSPACE(s) in DSPACE(sˆ3/2). Journal of computer and system sciences, 58(2):376–403, 1999. [42] Miklos Santha and Sovanna Tan. Verifying the determinant in parallel. Computational Complexity, 7(2):128–151, 1998. [43] Peter W Shor. Algorithms for quantum computation: Discrete logarithms and factoring. In Pro- ceedings 35th annual symposium on foundations of computer science, pages 124–134. Ieee, 1994. [44] Peter W Shor and Stephen P Jordan. Estimating Jones polynomials is a complete problem for one clean qubit. Quantum Information & Computation, 8(8):681–714, 2008.

22 [45] Amnon Ta-Shma. Inverting well conditioned matrices in quantum logspace. In Proceedings of the forty-fifth annual ACM symposium on Theory of computing, pages 881–890, 2013. [46] Seinosuke Toda. Counting problems computationally equivalent to the determinant, 1991. [47] Leslie G Valiant. Why is Boolean complexity theory difficult. Boolean Function Complexity, 169:84– 94, 1992. [48] V Vinay. Counting auxiliary pushdown automata and semi-unbounded arithmetic circuits. In Pro- ceedings of the Sixth Annual Structure in Complexity Theory Conference, pages 270–284. IEEE, 1991. [49] John Watrous. Space-bounded quantum complexity. Journal of Computer and System Sciences, 59(2):281–326, 1999. [50] John Watrous. Quantum simulations of classical random walks and undirected graph connectivity. Journal of computer and system sciences, 62(2):376–391, 2001. [51] John Watrous. On the complexity of simulating space-bounded quantum computations. Computa- tional Complexity, 12(1-2):48–84, 2003. [52] John Watrous. Encyclopedia of complexity and system science, chapter quantum computational complexity, 2009. [53] John Watrous. Zero-knowledge against quantum attacks. SIAM Journal on Computing, 39(1):25–58, 2009. [54] John Watrous. The theory of quantum information. Cambridge University Press, 2018. [55] Stathis Zachos and Martin Furer. Probabilistic quantifiers vs. distrustful adversaries. In International Conference on Foundations of Software Technology and Theoretical Computer Science, pages 443– 455. Springer, 1987.

A A TM-based Proof of BPL BQUL=BQL ⊆ While, trivially, BPL BQL, it is not obvious, a priori, that BPL BQUL. To the best of our knowledge, ⊆ ⊆ the strongest partial result in this direction is the classic result of Watrous [49, Theorem 4.12], which showed that BPL is contained in a variant of BQUL in which there is no bound on the running time of the QTM. By Theorem 2, poly-conditioned-MATPOW BQUL. As we next observe, this implies ∈ BPL BQUL and, more strongly, BQL = BQUL. Of course, the statement BQL = BQUL immediately ⊆ implies BPL BQUL; nevertheless, we will first show, directly, that BPL BQUL. ⊆ ⊆ Proposition 42. BPL BQUL. ⊆ Proof. Suppose = ( , ) BPL. Then there is some probabilistic TM M that recognizes with P P1 P0 ∈ P two-sided error 1 within time t(n)= nO(1) and space s(n) = O(log n), for any input w of length ≤ 3 ∈ P n = w . Let M denote the size of the finite control of M, let Γ denote the work-tape alphabet of M, and | | | | let c(n)= M (n + 2)(s(n)) Γ s(n) = nO(1) denote the number of possible configurations of M on inputs of | | | | length n. It is well-known that, for input w , one may construct, in deterministic space O(log( w )) ∈ P t | | a stochastic matrix Aw Mat(c(n)) and values xw,yw [c(n)] such that Aw[xw,yw] is precisely the ∈ ∈ 2 probability that M accepts w within t steps [15, 35]; this implies MATPOW( Aw,xw,yw, 3 ) = (w). t t h O(1) i P Note that, as Aw is stochastic,d so is Aw, t N; this implies σ1(Aw) c(n) = n , which then 2 ∀ ∈ ≤ implies Aw,xw,yw, MATPOW . By Theorem 2, MATPOW BQUL, h 3 i ∈ c(n),t(n),√c(n),3 p c(n),t(n),√c(n),3 ∈ which implies BQUL. P ∈ By applying an analogous argument to general quantum Turing machines (where the stochastic matrix that describes a single step of the computation of a probabilistic TM is replaced by the quantum channel that describes a single step of the computation of a quantum TM), we may then show that BQL BQUL ⊆ (and, therefore, that BQL = BQUL). Here, BQL is defined in terms of a logspace quantum Turing machine

23 (QTM), as was the case in, for instance [24,32,36,45,49–52], rather than the equivalent model of a uniform family of general quantum circuits used in this paper. For concreteness, we use the classically controlled logspace (general) QTM defined by Watrous [51] (with the minor alteration that we require all transition amplitudes of the QTM to be computable in L); however, we note that our result would apply equally well to any “reasonable” logspace QTM model that is classically controlled (this includes all models considered in all of the papers cited above). In brief, such a QTM M consists of a (classical) finite control, an internal quantum register of constant size, a classical “measurement” register of constant size, and three tapes: (1) a read-only input tape that, on any input w, contains the string #Lw#R, where #L and #R are special symbols that serve as left and right end-markers, (2) a read/write classical work tape consisting of s( w ) = O(log w ) cells, each of | | | | which holds a symbol from some finite alphabet Γ, and (3) a read/write quantum work tape, consisting of s( w ) = O(log w ) qubits. Each of the tapes has a single bidirectional head. At the start of the | | | | computation, both work-tapes are “blank” (to be precise, each cell of the classical work tape contains some specified blank-symbol in Γ and each qubit of the quantum work tape is in the state 0 ); each | i qubit of the internal quantum register is also in the state 0 . Each step of the computation of M involves | i applying a selective quantum operation to the combined register consisting of the internal quantum register and the single qubit that is currently under the head of the quantum work tape; the particular choice of which selective quantum operation to perform may depend on the state of the finite control and the symbols currently under the heads of the input tape and classical work tape. The (classical) result of this quantum operation is stored in the measurement register. Then, depending on this result, as well as on the state of the finite control and the symbols currently under the heads of the input tape and classical work tape, the classical configuration of the machine evolves; to be precise, the state of the finite control is updated, a symbol is written on the classical work-tape, and the head of each work tape moves up to one cell in either direction. The machine accepts (resp.) rejects its input by entering a special (classical) accepting (resp. rejecting state). See [51] for a complete definition.

Proposition 43. BQL = BQUL.

Proof. Trivially, BQL BQUL. We next show BQL BQUL. Suppose = ( , ) BQL. By definition, ⊇ ⊆ P P1 P0 ∈ there is some QTM M such that the following conditions are satisfied: (1) on any input w of length ∈ P n = w , M runs in space at most s(n)= O(log n) (and hence time t(n) = 2O(s(n))), (2) if w , then | | ∈ P1 Pr[M accepts w] 2 , and (3) if w , then Pr[M accepts w] 1 . ≥ 3 ∈ P0 ≤ 3 Consider running M on some input of length n. At any particular point in time, the configuration of (a single probabilistic branch of) M consists of the current (classical) state of the finite control, the (quantum) contents of the internal quantum register, the (classical) contents of the measurement register, the (classical) positions of the heads on the read only input-tape and the classical and quantum work- tapes, the current (classical) contents of the classical work-tape, and the current (quantum) contents of the quantum work-tape. Let M denote the size of the finite control, let bm denote the number of bits of | | the measurement register, let bq denote the number of qubits of the internal quantum register, and let Γ denote the classical work-tape alphabet. Let Cn denote the set of all possible classical configurations of bm 2 s(n) O(1) M on inputs of length n, where Cn = M 2 (n + 2)s(n) Γ = n . Each classical configuration | | | | | | Cn c Cn corresponds to the element c in the natural orthonormal basis of the Hilbert space C . Let Qn ∈ s(n)+bq | iO(1) denote the set of Qn = 2 = n quantum basis states corresponding to the quantum work-tape | | and internal quantum register. The contents of the quantum work-tape and the internal quantum register is then described by some ψ CQn . Then each configuration of M on an input of length n corresponds | i∈ Cn Qn O(1) to an element c ψ of the Hilbert space M,n = C C . Let d(n) = dim( M,n)= Cn Qn = n . | i| i H ⊗ H | || | Consider some input w . Let n = w denote the length of w, let ΦM,w Chan( M,n) de- ∈ P | | ∈ H note the quantum channel that corresponds to a single step of the computation of M on w, and 2 let K(ΦM,w) Mat(d (n)) denote the natural representation of ΦM,w. For any t N, we have t ∈ t t O(1)∈ Φ Chan( M,n), which implies σ ((K(ΦM,w)) ) = σ (K(Φ )) d(n) = n [39, Theorem M,w ∈ H 1 1 M,w ≤ d p 24 n n n 1]. Let ψstart = cstart qstart M,n denote the starting configuration of M on an input of length | n i | i| i∈H n s(n)+bq Qn n, where c Cn is the classical part of the starting configuration, and q = 0 C is start ∈ | starti | i ∈ the quantum part. Without loss of generality we may, for convenience, assume that M “cleans-up” its workspace at the end of the computation, by returning both its classical and quantum work tapes to the “blank” configuration described above; in particular, this implies that M has a unique accepting config- n n n 2 uration ψaccept = caccept qstart M,n on any input of length n. Let Aw = K(ΦM,w) Mat(d (n)), | n i | n i| 2i∈H n n 2 t ∈ xw = vec( ψaccept ψaccept ) [d (n)], and yw = vec( ψstart ψstart ) [d (n)]. Then Aw[xw,yw] is pre- | ih | ∈ | ih | ∈ 2 cisely the probability that M accepts w within t steps. Thus, Aw,xw,yw, MATPOW d h 3 i∈ d2(n),t(n),√d(n),3 2 and MATPOW( Aw,xw,yw, ) = (w). Finally, by Theorem 2, MATPOW BQUL, h 3 i P d2(n),t(n),√d(n),3 ∈ which implies BQUL. P ∈ B Proof of Theorem 1

Proof of Theorem 1. Clearly, BQUSPACE(s(n)) BQSPACE(s(n)). The containment BQSPACE(s(n)) ⊆ ⊆ BQUSPACE(s(n)) follows from Lemma 18 and a standard padding argument, which we now state. Suppose = ( , ) BQSPACE(s(n)). By definition, there is some DSPACE(s(n))-uniform family of general P P1 P0 ∈ quantum circuits Φw = (Φw,1,..., Φw,tw ) : w , where Φw acts on hw = O(s( w )) qubits and has tw = O(s( w )) { ∈ P} 2 | | 2 | | gates, such that if w 1, then Pr[Φw accepts w] 3 , and if w 0, then Pr[Φw accepts w] 1 ∈ P ≥ ∈ P ≤ 3 . Let M denote a deterministic Turing machine (DTM) that produces this family of circuits within the stated space bound. Let Σ denote the finite alphabet over which is defined, and assume, without loss P of generality, that 0, 1 Σ. log { }⊆log log log 2s(|w|) We define = ( , ) Σ such that = w01 : w j , for j 0, 1 . We next P P1 P0 ⊆ ∗ Pj { ∈ P } ∈ { } log log log log show that BQL, by exhibiting a family of general quantum circuits Φx = (Φx,1,..., Φ log ) : P ∈ { x,tx x log , with the appropriate parameters, that recognizes log. Begin by noticing that, as s is space- ∈ P } P constructible, there is a DTM D that uses space O(log n) on all inputs of length n, where, on any input s(|w|) x Σ , D checks if x = w012 , for some w Σ . If x is of this form, then D marks the rightmost ∈ ∗ ∈ ∗ symbol of w; otherwise, D rejects. We then construct a DTM M ′ which, on input x Σ∗ produces log ∈ Φx , as follows. First, M ′ runs D. If D rejects, then M ′ outputs a trivial single-gate circuit, which 2s(|w|) acts on a single qubit and always rejects. Otherwise (i.e., when the input x is of the form w01 ), M ′ s( w ) simulates M on the prefix w, producing the circuit Φw; note that, in this case, x = w +1+2 | | , which s( w ) | | log | | log implies M ′ runs in space O(s( w )) = O(log(2 | | )) = O(log( x )), and that Φx acts on hx = hw = | | log O(s( w )) | |O(1) log log O(s( w )) = O(log( x )) qubits and has tx = tw = 2 = x gates. Therefore, Φx : x | | | | | | | | { ∈ P } is a L-uniform family of general quantum circuits, with the appropriate parameters, that recognizes log 1 P with two-sided bounded-error 3 . log log log Thus, by Lemma 18, BQUL. Let Qx : x denote a L-uniform family of (unitary) P ∈ log { ∈ P } 1 log quantum circuits that recognizes with two-sided bounded-error 3 , where Qx acts on O(log( x )) O(1) P | | qubits and has x gates, and let MU denote a logspace DTM that produces this circuit family. We | | 2s(|w|) then define a DTM MU′ , which, on input w Σ∗, simply simulates MU on x = w01 ; in particular, ∈ 2s(|w|) in order to keep track of the simulated head of MU when it is in the suffix 01 , M marks s( w ) + 1 U′ | | cells on its work tape (recall that s is space-constructible), which is then used as a classical counter that can count up to 2s( w )+1 1. By an analysis similar to that of the previous paragraph, we see that M | | − U′ runs in space O(s(n)) and that the circuit family Qw : w that it produces recognizes and has { ∈ P} P the correct parameters.

25 C Proof of Lemma 34

Proof of Lemma 34. Suppose = ( , ) RQUMAL. By definition, there is a L-uniform family of P P1 P0 ∈ (unitary) quantum circuits Vw : w , where Vw acts on mw + hw = O(log w ) qubits and has { ∈ P} | |1 tw = poly( w ) gates, such that w 1 ψ Ψmw , Pr[Vw accepts w, ψ ] c = 2 , and w 0 | | ∈ P ⇒ ∃| i ∈ | i ≥ hw 2∈ P ⇒ ψ Ψmw , Pr[Vw accepts w, ψ ]= k = 0, where Pr[Vw accepts w, ψ ]= Π1Vw( ψ 0 ) . ∀| i∈ | i hw | i k | i ⊗hw | i k mw As in the proof of [31, Theorem 3.8], let Aw = (I2mw 0 )Vw†Π1Vw(I2mw 0 ) Pos(2 ); 1 ⊗ hmw | ⊗ | i ∈ then w tr(Aw) c = and w tr(Aw) 2 k = 0 tr(Aw) = 0. Similar to the ∈ P1 ⇒ ≥ 2 ∈ P0 ⇒ ≤ ⇒ proof of [26, Theorem 14] (cf. [31, Theorem 3.10]), we define a L-uniform family of (unitary) quantum circuits Qw : w , where Qw acts on 2mw + hw = O(log w ) qubits and has tw + O(mw)= poly( w ) { ∈ P} 2mw +|hw | hw | | gates, such that, when Qw is applied to the state 0 , it simulates Vw on q 0 , where | mw i | i ⊗ | i q Ψmw is drawn uniformly at random from the 2 standard basis elements of Ψmw . We have | i ∈ mw mw Pr[Qw accepts w] = tr(Aw2− I2mw ) = 2− tr(Aw); thus,

mw (mw +1) w Pr[Qw accepts w] = 2− tr(Aw) 2− = 1/poly( w ), ∈ P1 ⇒ ≥ | | mw and w Pr[Qw accepts w] = 2− tr(Aw) = 0. ∈ P0 ⇒ Therefore, QUSPACE(log n) 1 ,0. By [50, Lemma 5.1] QUSPACE(log n) 1 ,0 = RQUL, which P ∈ poly(n) poly(n) implies RQUL. P ∈

26