<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Sampling-based Sublinear Low-rank Matrix Arithmetic Framework for Dequantizing Quantum Machine Learning</title></titleStmt>
			<publicationStmt>
				<publisher>ACM</publisher>
				<date>10/31/2022</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10483039</idno>
					<idno type="doi">10.1145/3549524</idno>
					<title level='j'>Journal of the ACM</title>
<idno>0004-5411</idno>
<biblScope unit="volume">69</biblScope>
<biblScope unit="issue">5</biblScope>					

					<author>Nai-Hui Chia</author><author>András Pal Gilyén</author><author>Tongyang Li</author><author>Han-Hsuan Lin</author><author>Ewin Tang</author><author>Chunhao Wang</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[<p>We present an algorithmic framework for quantum-inspired classical algorithms on close-to-low-rank matrices, generalizing the series of results started by Tang’s breakthrough quantum-inspired algorithm for recommendation systems [STOC’19]. Motivated by quantum linear algebra algorithms and the quantum singular value transformation (SVT) framework of Gilyén etal.[STOC’19], we develop classical algorithms for SVT that run in time independent of input dimension, under suitable quantum-inspired sampling assumptions. Our results give compelling evidence that in the corresponding QRAM data structure input model, quantum SVT does not yield exponential quantum speedups. Since the quantum SVT framework generalizes essentially all known techniques for quantum linear algebra, our results, combined with sampling lemmas from previous work, suffice to generalize all prior results about dequantizing quantum machine learning algorithms. In particular, our classical SVT framework recovers and often improves the dequantization results on recommendation systems, principal component analysis, supervised clustering, support vector machines, low-rank regression, and semidefinite program solving. We also give additional dequantization results on low-rank Hamiltonian simulation and discriminant analysis. Our improvements come from identifying the key feature of the quantum-inspired input model that is at the core of all prior quantum-inspired results: ℓ<sup>2</sup>-norm sampling can approximate matrix products in time independent of their dimension. We reduce all our main results to this fact, making our exposition concise, self-contained, and intuitive.</p>]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction 1.Motivation</head><p>Quantum machine learning (QML) is a field of study with a rapidly growing number of proposals for how quantum computers could significantly speed up machine learning tasks [DW20, CHI + 18]. If any of these proposals yield substantial practical speedups, it could be the killer application motivating the development of scalable quantum computers <ref type="bibr">[Pre18]</ref>. At first glance, many applications of QML seem to admit exponential speedups. However, these exponential speedups are less likely to manifest in practice compared to, say, Shor's algorithm for factoring <ref type="bibr">[Sho97]</ref>, because unlike their classical counterparts, QML algorithms must make strong input assumptions and learn relatively little from their output <ref type="bibr">[Aar15]</ref>. These caveats arise because both loading input data into a quantum computer and extracting amplitude data from an output quantum state are hard in their most generic forms.</p><p>A recent line of research analyzes the speedups of QML algorithms by developing classical counterparts that carefully exploit these restrictive input and output assumptions. This began with a breakthrough 2018 paper by Tang <ref type="bibr">[Tan19]</ref> showing that the quantum recommendation systems algorithm <ref type="bibr">[KP17]</ref>, previously believed to be one of the strongest candidates for a practical exponential speedup in QML, does not give an exponential speedup. Specifically, Tang describes a "dequantized" algorithm that solves the same problem as the quantum algorithm and only suffers a polynomial slowdown. Tang's algorithm crucially exploits the input data structure assumed by the quantum algorithm, which is used for efficiently preparing states. Subsequent work relies on similar techniques to dequantize a wide range of QML algorithms, including those for principal component analysis and supervised clustering <ref type="bibr">[Tan21]</ref>, low-rank linear system solving [CGL + 20], low-rank semidefinite program solving <ref type="bibr">[CLLW20]</ref>, support vector machines <ref type="bibr">[DBH21]</ref>, nonnegative matrix factorization [CLS + 19], and minimal conical hull <ref type="bibr">[DHLT20]</ref>. These results show that the advertised exponential speedups of many QML algorithms disappear when compared to classical algorithms with input assumptions analogous to the state preparation assumptions of the quantum algorithms, drastically changing our understanding of the landscape of potential QML algorithm speedups.</p><p>A recent line of work in quantum algorithms has worked to unify many quantum algorithms ranging from quantum walks to QML, under a quantum linear algebra framework called quantum singular value transformation (QSVT) <ref type="bibr">[LC17,</ref><ref type="bibr">CGJ19,</ref><ref type="bibr">GSLW19]</ref>. Since this framework captures essentially all known linear algebraic QML techniques <ref type="bibr">[MRTC21]</ref>, including all prior dequantized QML algorithms (up to minor technical details), a natural question is whether this framework can be dequantized. One cannot hope to dequantize all of QSVT, because with sparse block-encodings of input data, QSVT can simulate Harrow, Hassidim, and Lloyd's pioneering poly-logarithmic time algorithm (HHL) for the BQP-complete problem of sampling from the solution of a sparse system of linear equations <ref type="bibr">[HHL09]</ref>. However, one could hope to dequantize QSVT provided that the input data comes in the state preparation data structure used commonly for quantum linear algebra. This data structure allows for efficient QML when the input is close-to-low-rank, but as dequantized algorithms show, it also gives significant power to classical algorithms. Prior work [Tan21, CGL + 20] has made similar speculations that these techniques could feasibly dequantize wide swathes of quantum linear algebra. In this work, we give evidence for these hopes by presenting a classical analogue of the QSVT framework and applying it to dequantize QML algorithms.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.2">Results</head><p>We describe a simple framework for quantum-inspired classical algorithms with wide applicability, grasping the capabilities and limitations of these techniques. We use this framework to dequantize many quantum linear algebra algorithms. We also prove QSVT-like extensibility properties of our framework, giving evidence that it can dequantize any QSVT algorithms in the QRAM input model.</p><p>Input model: Oversampling and query access. Our framework assumes a specific input model called oversampling and query access, which can be thought of as a classical analogue to quantum state preparation assumptions, i.e., the ability to prepare a quantum state |v&#10217; proportional to some input vector v. Our conceptual contribution is to define this generalization of sampling and query access, because it has better closure properties.</p><p>We have sampling and query access to a vector v &#8712; C n , denoted SQ(v), if we can efficiently make the following kinds of queries (Definition 3.2): (1) given an index i &#8712; [n], output the corresponding entry v(i); (2) sample an index j &#8712; [n] with probability |v(j)| 2 /&#8741;v&#8741; 2 ; and (3) output the vector's &#8467; 2 -norm &#8741;v&#8741;. We have sampling and query access to a matrix A &#8712; C m&#215;n , denoted SQ(A), if we have SQ(A(i, &#8226;)) for all rows of A, A(i, &#8226;), and also SQ(a) for a the vector of row norms (i.e., a(i) := &#8741;A(i, &#8226;)&#8741;). We have &#981;-oversampling and query access to a vector v, denoted SQ &#981; (v), if (1) we can query for entries of v and (2) we have sampling and query access to an "entry-wise upper bound" vector v &#732;satisfying &#8741;v &#732;&#8741;2 = &#981;&#8741;v&#8741; 2 and |v &#732;(i)| &#8805; |v(i)| for all indices i; the definition for a matrix is analogous (Definition 3.4).</p><p>The parameter &#981; should be seen as a form of overhead that comes out in the runtime of algorithms: through rejection sampling, SQ &#981; (v) can do approximate versions of all the queries of SQ(v) with a factor &#981; of overhead (Lemma 3.5). In this paper, we most often think of &#981; as being independent of input size.</p><p>To motivate this definition, we make the following observations about this input model. First, as far as we know, if input data is given classically,<ref type="foot">foot_0</ref> classical algorithms in the sampling and query model can be run whenever the corresponding algorithms in the quantum model can (Remark 3.11). For example, if input is loaded in the QRAM data structure, as commonly assumed in QML in order to satisfy state preparation assumptions [Pra14, CHI + 18], then we have log-time sampling and query access to it. So, a fast classical algorithm for a problem in this classical model implies lack of quantum speedup for the problem, at least in the usual settings explored in the QML literature. In particular, a polynomial-time classical algorithm in this model implies lack of exponential quantum speedup. Second, oversampling and query access has many similarities to the notion of quantum block-encodings in quantum singular value transformation <ref type="bibr">[GSLW19]</ref>. The commonly used datastructures that enable oversampling and query access to a matrix A also enable implementing an efficient quantum circuit whose unitary is a block-encoding of A. Further, in both input models one can perform efficient matrix arithmetic.</p><p>Matrix arithmetic. The thrust of our main results is to demonstrate that oversampling and query access is approximately closed under arithmetic operations. We argue that the essential power of quantum-inspired algorithms lies in their ability to leverage sampling and query access of the input matrices to provide oversampling and query access to complex arithmetic expressions as output (possibly with some approximation error), without paying the (at least) linear time necessary to compute such expressions in conventional ways. While the proven closure properties are important from a complexity theoretic point of view, some of them don't explicitly come into play in the demonstrated applications of our framework for dequantizing QML, since they often come with undesirable polynomial overhead. This is in contrast with quantum block-encodings, which generally compose with minimal overhead.</p><p>We now list the closure properties that we show, along with the corresponding closure properties proven for block-encodings in <ref type="bibr">[GSLW19]</ref>. For all of these, the query time for access to the output is just polynomial in the query times for access to the input, so in particular, these procedures run in time independent of input dimension. More specifically, we will compare what we call (sub)normalization "overhead" between the two, which is the value &#981; in the classical setting and what <ref type="bibr">[GSLW19]</ref> denotes as &#945; in the quantum setting. The two quantities are analogous, and roughly correspond to overheads in rejection sampling and post-selection, inducing a multiplicative factor in sampling times for both.</p><p>&#8226; Given access to a constant number of vectors v 1 , . . . , v &#964; , we have access to linear combinations &#8721;&#65025; &#964; t=1 &#955; t v t , and analogously with linear combinations of matrices (Lemmas 3.6 and 3.9). This is a classical analogue to the "linear combinations of unitaries" technique for block-encodings [GSLW19, Lemma 52]. In the quantum setting, there is less overhead, 2 allowing for efficient block encodings for linear combinations of arbitrarily many matrices in certain settings.</p><p>&#8226; Given access to two matrices A, B with Frobenius norm at most one, we have access to a matrix Z &#949;-close to the product A &#8224; B in Frobenius norm (Lemma 4.6 and Remark 4.7). In the quantum setting, closure of block-encodings under products is almost immediate [GSLW19, Lemma 53] and is not approximate. In both cases the individual input overheads of A and B are multiplied. With the same overheads one can also form Kronecker products A &#8855; B exactly-this is immediate both in the classical and quantum case <ref type="bibr">[CVB20]</ref>. In particular, given access to two vectors u and v, we have access to their outer product uv &#8224; (Lemma 3.8).</p><p>&#8226; Given access to a matrix A with Frobenius norm at most one and a Lipschitz function f , we have access to a matrix Z &#949;-close to f (A &#8224; A) in Frobenius norm (Theorem 5.1) 3 . In the quantum setting, block-encodings are closed under even and odd polynomial singular value transformations [GSLW19, Lemmas 8, 10] without approximation, provided the polynomial is low-degree and bounded. This block-encoding closure property can be viewed as a corollary of the above two properties, but can also be achieved directly with some more efficient technical machinery.</p><p>An even polynomial singular value transformation of A is precisely f (A &#8224; A) for f a low-degree polynomial (which means f is Lipschitz), and odd polynomials can be decomposed into a product of an even polynomial with A, so our closure property is as strong as the quantum one. The full details are derived in Section 6.1.</p><p>To summarize, every arithmetic operation of matrices with block-encodings in <ref type="bibr">[GSLW19]</ref> (with the possible exception of long linear combinations) can be mimicked by matrices with oversampling and query access, up to Frobenius norm error, provided that an input matrix in a block-encoding corresponds to having 4 SQ(A) and SQ(A &#8224; ). The "linear combinations of vectors" and "outer products" classical closure properties have been used in prior work [Tan19, CGL + 20]. However, without our new definition of oversampling and query access, it was not clear that these algorithms could be chained indefinitely as we show with these closure properties.</p><p>2 In fact, already &#8730; &#981; &#8805; &#945;/ &#8422; &#8422; &#8721;&#65025; &#964; t=1 &#955;tvt &#8422; &#8422; which can be seen using that the root mean-square is at least the average. 3 For a Hermitian matrix H and a function f : R &#8614; &#8594; C, f (H) denotes applying f to the eigenvalues of H. That is, f (H) := &#8721;&#65025; n i=1 f (&#955;i)viv &#8224; i , for &#955;i and vi the eigenvalues and eigenvectors of H. 4 We take some care here to distinguish whether we have oversampling and query access to A or A &#8224; . We don't need to: we show that having either one of them implies having the other, up to approximation (Remark 6.4). However, the accesses assumed in our closure properties are in some sense the most natural choices and require the least overhead.</p><p>Implications for quantum singular value transformation. Our results give compelling evidence that there is indeed no exponential speedup for QRAM-based QSVT, and show that oversampling and query access can be thought of as a classical analogue to block-encodings in the bounded Frobenius norm regime. Nevertheless, we do not rule out the possibility for large polynomial speedups, as the classical runtimes tend to have impractically large polynomial exponents. To elaborate more on this connection, we now recall the QSVT framework in more detail.</p><p>The QSVT framework of Gily&#233;n, Su, Low, and Wiebe <ref type="bibr">[GSLW19]</ref> assumes that the input matrix A is given by a block-encoding, which is a quantum circuit implementing a unitary transformation whose top-left block contains (up to scaling) A itself <ref type="bibr">[LC17]</ref>. Given a block-encoding of A, one can apply it to a quantum state or form block-encodings of other expressions using the closure properties mentioned above. One can get a block-encoding of an input matrix A through various methods. If A is s-sparse with efficiently computable elements and &#8741;A&#8741; &#8804; 1, then one can directly get a block-encoding of A/s [GSLW19, <ref type="bibr">Lemma 48</ref>]. If A is in the QRAM data structure (used for efficient state preparation for QML algorithms <ref type="bibr">[Pra14]</ref>), one can directly get a block-encoding of A/&#8741;A&#8741; F [GSLW19, Lemma 50]. We will use the term QRAM-based QSVT to refer to the family of quantum algorithms possible in the QSVT framework when all input matrices &amp; vectors are given in the QRAM data structure.</p><p>The normalization in QRAM-based QSVT means that it has an implicit dependence on the Frobenius norm &#8741;A&#8741; F . Since &#8741;A&#8741; F is also the key parameter in the complexity of our corresponding classical algorithms, this suggests that QRAM-based QSVT does not give inherent exponential quantum speedups (though, if input preparation/output analysis protocols have no classical analogues, they can act as a subroutine in an algorithm that does give an exponential quantum speedup). Our closure results confirm this: if input matrices and vectors are given in QRAM data structure, then on one (quantum) hand we can construct block-encodings of these matrices normalized to have Frobenius norm one and on the other (classical) hand we have sampling and query access to the input. The conclusion is that, up to some controllable approximation error, an algorithm using the block-encoding framework has a classical analogue in the oversampling and query access model. The classical algorithm's runtime is only polynomially slower than the corresponding quantum algorithm, except in the &#949; parameter. <ref type="foot">5</ref> One can argue similarly that there should be no exponential speedup for QSVT for block-encodings derived from (purifications of) density operators [GSLW19, Lemma 45] that come from some well-structured classical data (see Section 6.1). This stands in contrast to, for example, block-encodings that come from sparsity assumptions <ref type="bibr">[GSLW19,</ref><ref type="bibr">Lemma 48]</ref>, where the matrix in the block-encoding can have Frobenius norm as large as &#8730; sn (where we take A to be n &#215; n), and so the classical techniques cannot be applied without incurring dependence on n in the runtime.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.3">Technical overview</head><p>We now illustrate the flavor of the algorithmic ideas underlying our main results, by showing why the "oversampling" input model is closed under approximate matrix products. Suppose we are given sampling and query access to two matrices A &#8712; C m&#215;n and B &#8712; C m&#215;p , and desire (over)sampling and query access to A &#8224; B. A &#8224; B is a sum of outer products of rows of A with rows of B (that is,</p><p>, so a natural idea is to use the outer product closure property to get access to each outer product individually, and then use the linear combination closure property to get access to their sum, which is A &#8224; B as desired. However, there are m terms in the sum, which is too large: we can't even compute entries of A &#8224; B in time independent of m. So, we use sampling to approximate this sum of m terms by a linear combination over far fewer terms, allowing us to get access to Z for Z &#8776; A &#8224; B. This type of matrix product approximation is well-known in the classical literature <ref type="bibr">[DKM06]</ref>. Given SQ(A), we can pull samples i 1 , . . . , i s according to the row norms of A, a distribution we will denote p (so p(i) = &#8741;A(i, &#8226;)&#8741; 2 /&#8741;A&#8741; 2 F ). Consider Z := 1 s &#8721;&#65025; s k=1 1</p><p>Further, the variance of this estimator is small. In the following computation, we consider s = 1, because the variance for general s decreases as 1/s.</p><p>By Chebyshev's inequality, we can choose</p><p>)&#65025; to get that &#8741;Z -A &#8224; B&#8741; F &lt; &#949;&#8741;A&#8741; F &#8741;B&#8741; F with probability 0.99. Since Z is a linear combination of s outer products, this gives us oversampling and query access to Z as desired. In our applications we would keep Z as an outer product A &#8242; &#8224; B &#8242; for convenience. We have just sketched the proof of our key lemma: an approximate matrix product protocol.</p><p>Key lemma <ref type="bibr">[DKM06]</ref> (informal version of Lemma 4.6). Suppose we are given SQ(X) &#8712; C m&#215;n and SQ(Y ) &#8712; C m&#215;p . Then we can find normalized submatrices of X and Y ,</p><p>We subsequently have O(s)-time SQ(X &#8242; ), SQ(X &#8242; &#8224; ), SQ(Y &#8242; ), SQ(Y &#8242; &#8224; ).</p><p>Prior quantum-inspired algorithms [Tan19, Tan21, CLW18, CLLW20] indirectly used this lemma by using <ref type="bibr">[FKV04]</ref>, which finds a low-rank approximation to the input matrix in the form of an approximate low-rank SVD and relies heavily on this lemma in the analysis.</p><p>One of our main results, mentioned earlier as our singular value transformation closure property, is that, given SQ(A) &#8712; C m&#215;n , in time independent of m and n, we can access an approximation of f (A &#8224; A) for a Lipschitz-function f that, without loss of generality, satisfies f (0) = 0 (Theorem 5.1). One could use <ref type="bibr">[FKV04]</ref> to give a classical algorithm for SVT, but a more efficient approach is to directly apply the key lemma twice to get an approximate decomposition of f (A &#8224; A):</p><p>r&#215;n is a subset of rows of the input matrix and U is a matrix with size independent of input dimension (R corresponds to the 'R' of the RUR decomposition, and f &#175;(CC &#8224; ) &#8712; C r&#215;r corresponds to the 'U'). In other words, an RUR decomposition expresses a desired matrix as a linear combination of r 2 outer products of rows of the input matrix ( &#8721;&#65025; i,j [f &#175;(CC &#8224; )](i, j)R(i, &#8226;) &#8224; R(j, &#8226;), for example). <ref type="foot">6</ref> We want our output in the form of an RUR decomposition, since we can describe such a decomposition implicitly just as a list of row indices and some additional coefficients, which avoids picking up a dependence on m or n in our runtimes. Further, having SQ(A) gives us SQ &#981; (R &#8224; U R) via closure properties, enabling efficient access to matrix-vector expressions like R &#8224; U Rb. More general results follow as corollaries of our main result on even SVT (Theorems 7.1 and 7.2). However, using only our main theorem about even SVT, we can directly recover most existing quantum-inspired machine learning algorithms without using these general results, yielding faster dequantization for QML algorithms. We now outline our results recovering such applications.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.4">Applications: dequantizing QML &amp; more</head><p>We use the results above to recover existing quantum-inspired algorithms for recommendation systems <ref type="bibr">[Tan19]</ref>, principal component analysis <ref type="bibr">[Tan21]</ref>, supervised clustering <ref type="bibr">[Tan21]</ref>, support vector machines <ref type="bibr">[DBH21]</ref>, low-rank matrix inversion [CGL + 20], and semidefinite program solving <ref type="bibr">[CLLW20]</ref>. We also propose new quantum-inspired algorithms for low-rank Hamiltonian simulation and discriminant analysis (dequantizing the quantum algorithm of Cong &amp; Duan <ref type="bibr">[CD16]</ref>).</p><p>Fig. <ref type="figure">1</ref> has a summary of our results, along with a comparison of runtimes to the corresponding quantum algorithms and prior quantum-inspired work, where it exists. All our results match or improve on prior dequantized algorithms apart from that for matrix inversion, where prior work gives an incomparable runtime that only holds for strictly low-rank matrices of rank k. Our results for matrix inversion and semidefinite program solving solve the problem in greater generality than prior work, without the restriction that the input matrices are strictly rank-k. <ref type="foot">7</ref>We do not claim any meaningful breakthroughs for these problems in the classical literature: the problems that these QML algorithms solve differ substantially from their usual classical counterparts. For example, the quantum recommendation systems algorithm of Kerenidis and Prakash <ref type="bibr">[KP17]</ref> performs sampling from a low-rank approximation of the input instead of low-rank matrix completion, which is the typical formalization of the recommendation systems problem <ref type="bibr">[Tan19]</ref>. Evaluating these quantum algorithms' justifications for their versions of problems is outside the scope of this work: instead, we argue that these algorithms would likely not give exponential speedups when implemented, regardless of whether such implementations would be useful. The goal of our framework is to demonstrate what can be done classically and establish a classical frontier for quantum algorithms to push past.</p><p>The proofs for these dequantization results follow the same general structure: consider the quantum algorithm and formulate the problem that this algorithm solves, and in particular, the linear algebra expression that the quantum algorithm computes. From there, repeatedly use the SVT result and key lemma to approximate this expression by something like an RUR decomposition. Finally, use closure properties to gain oversampling and query access to that output decomposition. This procedure is relatively straightfoward and flexible. Also, unlike previous work [CGL + 20, CLLW20], our results need not assume that the input is strictly low-rank. Instead, following [Tan19, GSLW19], our algorithms work on close-to-low-rank matrices by doing SVTs that smoothly threshold to effectively only operate on large-enough singular values.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.5">Related work</head><p>Quantum-inspired algorithms. Our approach and analysis is much simpler than that of Frieze, Kannan, and Vempala <ref type="bibr">[FKV04]</ref>, while it also gives improved results in our applications, and has several other advantages. For example, the reduction to <ref type="bibr">[FKV04]</ref> first given by Tang to get an quantum algorithm prior work this work simple QSVT [GSLW19], &#167;6.1</p><p>discriminant analysis <ref type="bibr">[CD16]</ref>, &#167;6.9</p><p>Figure <ref type="figure">1</ref>: The time complexity for our algorithms, the quantum algorithms they are based on, and prior quantum-inspired algorithms (where they exist). We assume our sampling and query accesses to the input takes O(1) time. There are data structures that can support such queries (Remark 3.11), and if the input is in QRAM, the runtime only increases by at most a factor of log of input size.</p><p>We list the runtime of the algorithm, not including the time it takes to access the output (denoted with &#732;&#65026; sq). The runtimes as listed ignore polylog terms, particularly those in error parameters (&#949; and &#948;) and dimension parameters (m and n). The matrices and vectors referenced in these runtimes are always the input, &#963; refers to a singular value threshold of the input matrices, &#955; refers to an eigenvalue threshold (which can be thought of here as &#963; 2 ), and &#951; &gt; &#949; is a (dimensionless) gap parameter.</p><p>(&#9827;) indicates that the error analyses of the corresponding results are incomplete; we list the runtime they achieve for completeness.</p><p>(&#9826;) indicates that the corresponding results only hold in the restricted setting where the input matrices are strictly rank k. For the quantum algorithms with this tag, they allow for general matrices, but only have an informal error analysis arguing that singular values outside the range considered don't affect the final result.</p><p>SVT-based low-rank approximation bound from the standard notion of low-rank approximation [Tan19, Theorem 4.7] induces a quadratic loss in precision, which appears to be only an artifact of the analysis. Also, <ref type="bibr">[FKV04]</ref> gives Frobenius norm error bounds, though for applications we often only need spectral norm bounds; our main theorem can get improved runtimes by taking advantage of the weaker spectral norm bounds. Finally, we take a reduced number of rows compared to columns, whereas <ref type="bibr">[FKV04]</ref> approximates the input by taking the same number of rows and columns.</p><p>Randomized numerical linear algebra. All of the results presented here are more or less randomized linear algebra algorithms <ref type="bibr">[Mah11,</ref><ref type="bibr">Woo14]</ref>. The kind of sampling we get from sampling and query access is called importance sampling or length-square sampling in that body of work: see the survey by Kannan and Vempala <ref type="bibr">[KV17]</ref> for more on importance sampling. Importance sampling, and specifically, its approximate matrix product property, is the core primitive of this work. In addition to the low-rank approximation algorithms <ref type="bibr">[FKV04]</ref> used in the quantum-inspired literature, others have used importance sampling for, e.g., orthogonal tensor decomposition [DM07, MMD08, SWZ16] (generalizing low-rank approximation <ref type="bibr">[FKV04]</ref>) and support vector machines <ref type="bibr">[HKS11]</ref>.</p><p>The fundamental difference between quantum-inspired algorithms and traditional sketching algorithms is that we assume "we can perform quantum measurements" of states corresponding to input in time independent of input dimension (that is, we have efficient sampling and query access to input), and in exchange want algorithms that run in time independent of dimension and provide only (over)sampling and query access to the output. This quantum-inspired model is weaker than the standard sketching algorithm model (Remark 3.11): an algorithm taking T time in the quantum-inspired model for an input matrix A can be converted to a standard algorithm that runs in time O(nnz(A) + T ), where nnz(A) is the number of nonzero entries of A. So, we can also think about an O(T )-time quantum-inspired algorithm as an O(nnz(A) + T )-time sketching algorithm, where the nnz(A) portion of the runtime can only be used to facilitate importance sampling. <ref type="foot">8</ref> This restriction makes for algorithms that may perform worse in generic sketching settings, but work in more settings, and so demonstrate lack of exponential quantum speedup for a wider range of problems.</p><p>A natural question is whether more modern sketching techniques can be used in our model. After all, importance sampling is only one of many sketching techniques studied in the large literature on sketching algorithms. Notably, though, other types of sketches seem to fail in the input regimes where quantum machine learning succeeds: assuming sampling and query access to input, importance sampling takes time independent of dimension, whereas other randomized linear algebra methods such as Count-Sketch and Johnson-Lindenstrauss still take time linear in input-sparsity.</p><p>Subsequent work by Chepurko, Clarkson, Horesh, Lin, and Woodruff [CCH + 22] notes that importance sampling oversamples leverage score sampling, so usual analyses for leverage score sampling also hold for importance sampling, up to some small overhead. It is reasonable to suspect that this connection could lead to significant improvements over the results presented here. However, exploiting this connection for improved runtimes seems nontrivial, since most approaches using leverage score sampling requires performing O(nnz(A))-time pre-processing operations, even if one has SQ(A). As a simple example, for low-rank approximation of an input matrix A, if we wish to adapt the algorithm of Clarkson and Woodruff <ref type="bibr">[CW17,</ref><ref type="bibr">Woo14]</ref>, importance sampling of A can replace CountSketch for one of the sketches [Woo14, Lemma 4.2], but importance sampling of SA cannot replace the other <ref type="bibr">[Woo14,</ref><ref type="bibr">Theorem 4.3]</ref>. Versions of importance sampling may work for the second sketch (for example, sampling from a low-rank approximation of SA), but we are aware of none that can be obtained easily from SQ(A). This may be a manifestation of the difficulty of achieving relative-error estimates to quantities like leverage scores and residuals in this model.</p><p>An alternative approach is to use a projection-cost preserving sketch (PCP) like ridge leverage score sampling to sketch A on both sides <ref type="bibr">[CMM17]</ref>. The importance sampling from SQ(A) &#955;/2oversamples ridge leverage score sampling, where &#955; := &#8741;A&#8741; 2 F /&#8741;A -A k &#8741; 2 F &#8805; &#8741;A&#8741; 2 F /&#963; 2 k+1 , so using importance sampling in place of ridge leverage score sampling can give algorithms. This is how [CCH + 22] gets their algorithms for low-rank sampling (recommendation systems) and quantuminspired linear regression. This does appear to be a promising approach, with possibility to extend to dequantizing all of QSVT, but to the authors' knowledge, it is still an open question how to improve the algorithms presented in this work, with the exception of [CCH + 22] improving over our recommendation systems algorithm. Their use of PCPs significantly improves the runtime for this low-rank sampling task down below &#8741;A&#8741; 6 F &#963; 6 &#949; 6 , but getting a similarly good runtime for all functions seems nontrivial. For example, their linear regression algorithm requires that the input matrix is strictly rank-k (or is regularized).</p><p>The quantum-like closure properties of importance sampling shown here may be useful in the context of classical sketching algorithms. This insight unlocks surprising power in importance sampling. For example, it reveals that Frieze, Kannan, and Vempala's low-rank approximation algorithm <ref type="bibr">[FKV04]</ref>, which, as stated, requires O(kmn) time to output the desired matrix, actually can produce useful results (samples and entries) in time independent of input dimension. To use the language in <ref type="bibr">[FKV04]</ref>, if Assumptions 1 and 2 hold for the input matrix, they also hold for the output matrix! Classical algorithms for quantum problems. We are aware of two important prior results from before Tang's first paper <ref type="bibr">[Tan19]</ref> that connect quantum algorithms to randomized numerical linear algebra. The first is Van den Nest's work on using probabilistic methods for quantum simulation <ref type="bibr">[VdN11]</ref>, which defines a notion of "computationally tractable" (CT) state equivalent to our notion of sampling and query access and then uses it to simulate restricted classes of quantum circuits. We share some essential ideas with this work, such as the simple sampling lemmas Lemmas 3.6 and 4.12, but also differ greatly since we focus on low-rank matrices relevant for QML, whereas <ref type="bibr">[VdN11]</ref> focuses on simulating potentially large quantum circuits that correspond to high-rank matrices. The second is a paper by Rudi, Wossnig, Ciliberto, Rocchetto, Pontil, and Severini [RWC + 20] that uses the Nystr&#246;m method to simulate a sparse Hamiltonian H on a sparse input state in time poly-logarithmic in dimension and polynomial in &#8741;H&#8741; F , assuming sampling and query access to H. Our Hamiltonian simulation results do not require a sparsity assumption and still achieve a dimension-independent runtime, but get slightly larger exponents in exchange.</p><p>Practical implementation. A work by Arrazola, Delgado, Bardhan, and Lloyd <ref type="bibr">[ADBL20]</ref> implements and benchmarks quantum-inspired algorithms for regression and recommendation systems. The aforementioned paper of Chepurko, Clarkson, Horesh, Lin, and Woodruff [CCH + 22] does the same for the quantum-inspired algorithms they introduce. The former work makes various conclusions, including that the &#949; 2 scaling in the number of rows/columns taken in our recommendation systems algorithm is inherent and that the quantum-inspired algorithms performed slower and worse than direct computation for practical datasets. The latter work finds that their algorithms perform faster than direct algorithms, with an accompanying increase in error comparable to that of other sketching algorithms <ref type="bibr">[DKW18]</ref>. This improvement appears to come from both a better-performing implementation as well as an algorithm with better asymptotic runtime. Nevertheless, it is difficult to draw definitive conclusions about the practicality of quantum-inspired algorithms as a whole from these experimental results. Since quantum-inspired algorithms are a restricted, weaker form of computation than classical randomized numerical linear algebra algorithms (see the comparison made above), it seems possible that they perform worse than standard sketching algorithms, despite seemingly having exponentially improved runtime in theory.</p><p>Modern sketching algorithms use similar techniques to quantum-inspired algorithms, but are more natural to run on a classical computer and are likely to be faster. For example, Dahiya, Konomis, and Woodruff <ref type="bibr">[DKW18]</ref> conducted an empirical study of sketching algorithms for lowrank approximation on both synthetic datasets and the movielens dataset, reporting that their implementation "finds a solution with cost at most 10 times the optimal one . . . but does so 10 times faster." Sketching algorithms like those in <ref type="bibr">[DKW18]</ref> may become a relevant point of reference for benchmarking quantum linear algebra, when the implementation of these quantum algorithms on actual quantum hardware becomes possible. In a sense, our work shows using asymptotic runtime bounds that in many scenarios sketching and sampling techniques give similar computational power to quantum linear algebra, which is a counterintuitive point since the former typically leads to linear runtimes and the latter leads to poly-logarithmic ones.</p><p>Quantum machine learning. Our work has major implications for the landscape of quantum machine learning. Since we have presented many dequantized versions of QML algorithms, the question remains of what QML algorithms don't have such versions. In other words, what algorithms still have the potential to give exponential speedups?</p><p>There are two general paradigms for employing quantum linear algebra techniques in quantum machine learning: the low-rank approach and the high-rank approach. In both, we need to turn classical input data vectors to quantum states (via what's called an amplitude encoding), perform linear algebra operations on those vectors, and extract information about the output via sampling <ref type="bibr">[Aar15]</ref>. Since preparing generic quantum states require a number of quantum gates that is proportional to the dimension of the vectors, we need some state preparation assumptions (like having QRAM with an appropriate data structure, etc., cf. Remark 3.11) in order to achieve sublinear runtimes. The main difference between the two paradigms is how the input matrices are given: in the low-rank approach, they are also given in QRAM, and so must be rescaled to have Frobenius norm one. QSVT with block-encodings coming from the QRAM data structure<ref type="foot">foot_5</ref> or density operators is an example framework in this vein. The restrictions of this block-encoding method means that the rank needs to be small, but assuming the hardware needed for QRAM can be realized, this is still a flexible setting, one that QML researchers find interesting. In the high-rank approach, which is used in the HHL algorithm <ref type="bibr">[HHL09]</ref> and its derivatives, the matrix needs to be represented by a concise quantum circuit and have a small (poly-logarithmic in input dimension) condition number in order to gain an exponential speedup over classical algorithms. This doesn't happen in typical datasets. The collection of these demanding requirements hamstrings most attempts to find applications of HHL <ref type="bibr">[HHL09]</ref> with the potential for practical super-polynomial speedups.</p><p>Our results give evidence for the lack of exponential speedup for the former, low-rank approach. It is important to note however, that our results do not rule out the possibility of large polynomial quantum speedups. In order to assess the potential usefulness of QML algorithms in this regime it is important to improve on classical upper and lower bounds for these problems, which we leave as an open question. On the other hand, high-rank block-encodings, such as those coming from sparsity assumptions in the original HHL algorithm <ref type="bibr">[HHL09]</ref>, remain impervious to our techniques. This suggests that the most promising way to get exponential quantum speedups for QML algorithms is by assuming sparse matrices as input, or utilizing other efficiently implementable high-rank quantum operation such as the Quantum Fourier Transform.</p><p>Works from Zhao, Fitzsimons, and Fitzsimons on Gaussian process regression <ref type="bibr">[ZFF19]</ref>; from Lloyd, Garnerone, and Zanardi on topological data analysis <ref type="bibr">[LGZ16,</ref><ref type="bibr">GCD20]</ref>; and from Yamasaki, Subramanian, Sonoda, and Koashi <ref type="bibr">[YSSK20]</ref> on learning random features attempt to address these issues to get a super-polynomial quantum speedup. Though these works avoid the dequantization barrier to large quantum speedups, it remains to be seen how broad will be their impact on QML and whether these speedups manifest for data seen in practice.</p><p>Related independent work. Independently from our work, Jethwani, Le Gall, and Singh simultaneously derived similar results <ref type="bibr">[JLGS20]</ref>. They implicitly derive a version of our even SVT result, and use it to achieve generic SVT (approximate SQ(b &#8224; f (SV) (A)) for a vector b) by writing</p><p>x and then using sampling subroutines to get the solution from the resulting expression b &#8224; AR &#8224; U R. It is difficult to directly compare the main SVT results, because the parameters that appear in their runtime bounds are somewhat non-standard, but one can see that for typical choices of f , their results require a strictly low-rank A. In comparison our results apply to general A, and we also demonstrate how to apply them to (re)derive dequantized algorithms.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.6">Open questions</head><p>Our framework recovers recent dequantization results, and we hope that it will be used for dequantizing more quantum algorithms. In the meantime, our work leaves several natural open questions:</p><p>(a) Is there an approach to QML that does not go through HHL (whose demanding assumptions make exponential speedups difficult to demonstrate even in theory) or a low-rank assumption (which, as we demonstrate, makes the tasks "easy" for classical computers) and yields a provable superpolynomial speedup for a practically relevant ML problem? (b) Our algorithms still have significant slowdown as compared to their quantum counterparts.</p><p>Can we shave condition number factors to get runtimes of the form &#732;&#65025; O (&#65026;</p><p>(for the recommendation systems application, for instance), without introducing additional assumptions? Can we get even better runtimes by somehow avoiding SVD computation? (c) Do the matrix arithmetic closure properties we showed for &#8467; 2 -norm importance sampling hold for other kinds of sampling and sketching distributions, like leverage score or &#8467; p -norm sampling?</p><p>(d) In the quantum setting, linear algebra algorithms <ref type="bibr">[GSLW19]</ref> can achieve logarithmic dependence on the precision &#949;. Can classical algorithms also achieve such exponentially improved dependence, when the goal is restricted to sampling from the output (i.e., without the requirement to query elements of the output)? If not, is there a mildly stronger classical model that can achieve this? Can one prove that this exponential advantage for sampling problems cannot be conferred to estimation/decision problems?</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.7">Organization</head><p>The paper proceeds as follows. Section 3 introduces the notion of (over)sampling and query access and some of its closure properties. Section 4 gives the fundamental idea of using sampling and query access to sketch matrices used for the approximation results in Section 4.1 and singular value transformation results in Section 5. These results form the framework that is used to dequantize QSVT in Section 6.1 and recover all the quantum-inspired results in Section 6. These applications of our framework contain various tricks and patterns that we consider to be "best practice" for coercing problems into our framework, since they have given us the best complexities and generality. More general results of SVT are shown in Section 7.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">Preliminaries</head><p>To begin with, we define notation to be used throughout this paper. For n &#8712; N, [n] := {1, . . . , n}.</p><p>For z &#8712; C, its absolute value is |z| = &#8730; z * z, where z * is the complex conjugate of z. f &#8818; g denotes the ordering f = O(g) (and respectively for &#8819; and &#8770;). &#732;&#65025; O(g) is shorthand for O(g poly(log g)). log refers to the natural logarithm. Finally, we assume that arithmetic operations (e.g., addition and multiplication of real numbers) and function evaluation oracles (computing f (x) from x) take unit time, and that queries to oracles (like the queries to input discussed in Section 3) are at least unit time cost.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1">Linear algebra</head><p>In this paper, we consider complex matrices A &#8712; C m&#215;n for m, n &#8712; N. For i &#8712; [m], j &#8712; [n], we let A(i, &#8226;) denote the i-th row of A, A(&#8226;, j) denote the j-th column of A, and A(i, j) denote the (i, j)-th element of A. (A | B) denotes the concatenation of matrices A and B and vec(A) &#8712; C mn denotes the vector formed by concatenating the rows of A. For vectors v &#8712; C n , &#8741;v&#8741; denotes standard Euclidean norm (so &#8741;v&#8741; := (</p><p>and the spectral norm of A is &#8741;A&#8741; := &#8741;A&#8741; Op := sup x&#8712;C n ,&#8741;x&#8741;=1 &#8741;Ax&#8741;. We say that U is an isometry if &#8741;U x&#8741; = &#8741;x&#8741; for all x, or equivalently, if U is a subset of columns of a unitary.</p><p>A singular value decomposition (SVD) of A is a representation A = U DV &#8224; , where for N := min(m, n), U &#8712; C m&#215;N and V &#8712; C n&#215;N are isometries and D &#8712; R N &#215;N is diagonal with &#963; i := D(i, i) and &#963; 1 &#8805; &#963; 2 &#8805; &#8226; &#8226; &#8226; &#8805; &#963; N &#8805; 0. We can also write this decomposition as A = &#8721;&#65025; N i=1 &#963; i u i v &#8224; i , where u i := U (&#8226;, i) and v i := V (&#8226;, i). For Hermitian A, an (unitary) eigendecomposition of A is a singular value decomposition where U = V , except the entries of D are allowed to be negative.</p><p>Using SVD, we can define the rank-k approximation of A to be</p><p>We now formally define singular value transformation:</p><p>Definition 2.1. For a function f : [0, &#8734;) &#8594; C such that f (0) = 0 and a matrix A &#8712; C m&#215;n , we define the singular value transform of A via a singular value decomposition A = &#8721;&#65025; min(m,n)</p><p>The requirement that f (0) = 0 ensures that the definition is independent of the (not necessarily unique) choice of SVD.</p><p>Definition 2.2. For a function f : R &#8594; C and a Hermitian matrix A &#8712; C n&#215;n , we define the eigenvalue transform of A via a unitary eigendecomposition</p><p>Since we only consider eigenvalue transformations of Hermitian matrices, where singular vectors/values and eigenvectors/values (roughly) coincide, the key difference between singular value transformation and eigenvalue transformation is that the latter can distinguish eigenvalue sign. As eigenvalue transformation is the standard notion of a matrix function, we will usually drop the superscript in notation: f (A) := f (EV) (A).</p><p>We will use the following standard definition of a Lipschitz function.</p><p>Definition 2.3. We say f :</p><p>We define approximate isometry as follows:</p><p>If V is an &#945;-approximate isometry, among other things, it implies that |&#8741;V &#8741; 2 -1| &#8804; &#945; and that there exists an isometry U &#8712; C m&#215;n with im(U ) = im(V ) such that &#8741;U -V &#8741; &#8804; &#945;. We show this and other basic facts in the following lemma, whose proof is deferred to Appendix B.</p><p>Lemma 2.5. If X &#710;&#8712; C m&#215;n is an &#945;-approximate isometry, then there is an exact isometry X &#8712; C m&#215;n with the same columnspace as X &#710;such that &#8741;X &#710;-X&#8741; &#8804; &#945;. Furthermore, for any matrix</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">Sampling and query access oracles</head><p>Since we want our algorithms to run in time sublinear in input size, we must carefully define our access model. The sampling and query oracle we present below is unconventional, being designed as a reasonable classical analogue for the input model of some quantum algorithms. It will also be used heavily to move between intermediate steps of these quantum-inspired algorithms. First, as a warmup, we define a simple query oracle: Definition 3.1 (Query access). For a vector v &#8712; C n , we have Q(v), query access to v, if for all i &#8712; [n], we can query for v(i). Likewise, for a matrix A &#8712; C m&#215;n , we have Q(A) if for all (i, j) &#8712; [m] &#215; [n], we can query for A(i, j). Let q(v) (respectively q(A)) denote the (time) cost of such a query. For example, in the typical RAM access model, we are given our input v &#8712; C n as Q(v) with q(v) = 1. For brevity, we will sometimes abuse this notation (and other access notations) and, for example, abbreviate "Q(A) for A &#8712; C m&#215;n " as "Q(A) &#8712; C m&#215;n ". We will also sometimes abuse complexity notation like q to refer to known bounds on the complexity, instead of the complexity itself.</p><p>Definition 3.2 (Sampling and query access to a vector). For a vector v &#8712; C n , we have SQ(v), sampling and query access to v, if we can:</p><p>1. query for entries of v as in Q(v); 2. obtain independent samples i &#8712; [n] following the distribution D v &#8712; R n , where D v (i) := |v(i)| 2 /&#8741;v&#8741; 2 ; 3. query for &#8741;v&#8741;.</p><p>Let q(v), s(v), and n(v) denote the cost of querying entries, sampling indices, and querying the norm respectively. Further define sq(v) := max(q(v), s(v), n(v)).</p><p>We will refer to these samples as importance samples from v, though one can view them as measurements of the quantum state |v&#10217; := 1 &#8741;v&#8741; &#8721;&#65025; v i |i&#10217; in the computational basis. Quantum-inspired algorithms typically don't give exact sampling and query access to the output vector. Instead, we get a more general version of sampling and query access, which assumes we can only access a sampling distribution that oversamples the correct distribution.<ref type="foot">foot_7</ref> Definition 3.3. For p, q &#8712; R n &#8805;0 that are distributions, meaning</p><p>The motivation for this definition is the following: if p &#981;-oversamples q, then we can convert a sample from p to a sample from q with probability 1/&#981; using rejection sampling: sample an i distributed as p, then accept the sample with probability q(i)/(&#981;p(i)) (which is &#8804; 1 by definition). Definition 3.4 (Oversampling and query access). For v &#8712; C n and &#981; &#8805; 1, we have SQ &#981; (v), &#981;oversampling and query access to v, if we have Q(v) and SQ(v &#732;) for v &#732;&#8712; C n a vector satisfying &#8741;v &#732;&#8741;2 = &#981;&#8741;v&#8741; 2 and |v &#732;(i)| 2 &#8805; |v(i)| 2 for all i &#8712; [n]. Denote s &#981; (v) := s(v &#732;), q &#981; (v) := q(v &#732;), n &#981; (v) := n(v &#732;), and sq &#981; (v) := max(s &#981; (v), q &#981; (v), q(v), n &#981; (v)).</p><p>The distribution D v &#732;&#981;-oversamples D v , since for all i &#8712; [n],</p><p>For this reason, we call D v &#732;a &#981;-oversampled importance sampling distribution of v. SQ(v) is the same as SQ 1 (v), by taking v &#732;= v. Note that we do not assume knowledge of &#981; (though it can be estimated, (though it can be estimated as shown in Lemma 3.5). However, we do need to know &#8741;v &#732;&#8741; (even if &#8741;v&#8741; is known), as it cannot be deduced from a small number of queries, samples, or probability computations. So, we will be choosing v &#732;(and, correspondingly, &#981;) such that &#8741;v &#732;&#8741;2 remains computable, even if potentially some cv &#732;satisfies all our other requirements for some c &lt; 1 (giving a smaller value of &#981;).</p><p>Intuitively speaking, estimators that use D v can also use D v &#732;via rejection sampling at the expense of a factor &#981; increase in the number of utilized samples. From this observation we can prove that oversampling access implies an approximate version of the usual sampling access: Lemma 3.5. Suppose we are given SQ &#981; (v) and some &#948; &#8712; (0, 1]. Denote &#732;&#65026; sq(v) := &#981; sq &#981; (v) log 1 &#948; . We can sample from D v with probability &#8805; 1 -&#948; in O(&#732;&#65026; sq(v)) time. We can also estimate &#8741;v&#8741; to &#957; multiplicative error for &#957; &#8712; (0, 1] with probability</p><p>Proof. Consider the following rejection sampling algorithm to generate samples: sample an index i from v &#732;, and output it as the desired sample with probability r(i)</p><p>)&#65025; time and r(i) &#8804; 1 since v &#732;bounds v. The probability of accepting a sample in a round is</p><p>and, conditioned on a sample being accepted, the probability of it being i is |v(i)| 2 /&#8741;v&#8741; 2 , so the output distribution is D v as desired. So, to get a sample with &#8805; 1 -&#948; probability, run rejection sampling for at most 2&#981; log 1 &#948; rounds. To estimate &#8741;v&#8741; 2 , notice that we know &#8741;v &#732;&#8741;2 , so it suffices to estimate &#8741;v&#8741; 2 /&#8741;v &#732;&#8741;2 which is &#981; -1 . The probability of accepting the rejection sampling routine is &#981; -1 , so we run 3&#957; -2 &#981; log 2 &#948; rounds of it for estimating &#981; -1 . Let Z denote the fraction of them which end in acceptance. Then, by a Chernoff bound we have</p><p>so Z&#8741;v &#732;&#8741;2 is a good multiplicative approximation to &#8741;v&#8741; 2 with probability &#8805; 1 -&#948;.</p><p>Generally, compared to a quantum algorithm that can output (and measure) a desired vector |v&#10217;, our algorithms will output SQ &#981; (u) such that &#8741;u -v&#8741; is small. So, &#732;&#65026; sq(u) is the relevant complexity measure that we will analyze and bound: if we wish to mimic samples from the output of the quantum algorithm we dequantize, we will pay a one-time cost to run our quantum-inspired algorithm for "obtaining" SQ &#981; (u), and then pay &#732;&#65026; sq(u) cost per additional measurement. As for error, bounds on &#8741;u -v&#8741; imply that measurements from u and v follow distributions that are close in total variation distance [Tan19, Lemma 4.1]. Now, we show that oversampling and query access of vectors is closed under taking small linear combinations.</p><p>) one-time pre-processing cost to query for norms).</p><p>Proof. Denote u := &#8721;&#65025; &#955; t v t . To compute u(s) for some s &#8712; [n], we just need to query v t (s) for all t &#8712; [&#964; ], paying O( &#8721;&#65025; q(v t )) cost. So, it suffices to get SQ(u &#732;) for an appropriate bound u &#732;. We choose</p><p>We have SQ(u &#732;): we can compute &#8741;u &#732;&#8741;2 by querying for all norms &#8741;v &#732;t&#8741;, compute u &#732;(s) by querying v &#732;t(s) for all t &#8712; [&#964; ]. We can sample from u &#732;by first sampling t &#8712; [&#964; ] with probability &#8741;&#955;tv &#732;t&#8741; 2 &#8721;&#65025; &#8467; &#8741;&#955; &#8467; v &#732;&#8467;&#8741; 2 , and then taking our sample to be j &#8712; [n] from v &#732;t. The probability of sampling j &#8712; [n] is correct:</p><p>If we pre-process by querying all the norms &#8741;v &#732;&#8467;&#8741; in advance, we can sample from the distribution over i's in O(1) time, using an alias sampling data structure for the distribution (Remark 3.11), and we can sample from v &#732;t using our assumed access to it, SQ &#966;t (v t ).</p><p>So, our general goal will be to express our output vector as a linear combination of a small number of input vectors that we have sampling and query access to. Then, we can get an approximate SQ access to our output using Lemma 3.5, where we pay an additional "cancellation constant" factor of &#981; = &#964; &#8721;&#65025; &#966;t&#8741;&#955;tvt&#8741; 2 &#8741; &#8721;&#65025; &#955;tvt&#8741; 2 . This factor is only large when the linear combination has significantly smaller norm than the components v t in the sum suggest. Usually, in our applications, we can intuitively think about this overhead being small when the desired output vector mostly lies in a subspace spanned by singular vectors with large singular values in our low-rank input. Quantum algorithms also have the same kind of overhead. Namely, the QSVT framework encodes this in the subnormalization constant &#945; of block-encodings, and the overhead from the subnormalization appears during post-selection <ref type="bibr">[GSLW19]</ref>. When this cancellation is not too large, the resulting overhead typically does not affect too badly the runtime of our applications.</p><p>We also define oversampling and query access for a matrix. The same model (under an alternative definition) is also discussed in prior work <ref type="bibr">[FKV04,</ref><ref type="bibr">DKR02]</ref> and is the right notion for the sampling procedures we will use. Definition 3.7 (Oversampling and query access to a matrix). For a matrix A &#8712; C m&#215;n , we have SQ(A) if we have SQ(A(i, &#8226;)) for all i &#8712; [m] and SQ(a) for a &#8712; R m the vector of row norms (a(i) := &#8741;A(i, &#8226;)&#8741;).</p><p>We have SQ &#981; (A) if we have Q(A) and SQ(A &#732;) for</p><p>The complexity of (over)sampling and querying from the matrix A is denoted by</p><p>, and n &#981; (A) := n(a &#732;) respectively. We also denote sq &#981; (A) := max(s &#981; (A), q &#981; (A), q(A), n &#981; (A)). We omit subscripts if &#981; = 1.</p><p>Observe that access to a matrix, SQ &#981; (A), implies access to its vectorized version, SQ &#981; (vec(A)):</p><p>we can take &#732;&#65026; vec(A) = vec(A &#732;), and the distribution for vec(A &#732;) is sampled by sampling i from D a &#732;, and then sampling j from D A &#732;(i,&#8226;) . This gives the output (i, j) with probability |A &#732;(i, j)| 2 /&#8741;A &#732;&#8741;2 F . Therefore, one can think of SQ &#981; (A) as SQ &#981; (vec(A)), with the addition of having access to samples (i, j) from vec(A), conditioned on fixing a particular row i and also knowing the probabilities of these conditional samples. Now we prove that oversampling and query access is closed under taking outer products. The same idea also extends to taking Kronecker products of matrices.</p><p>Proof. We can query an entry A(i, j) = u(i)v(j) &#8224; by querying once from u and v. Our choice of upper bound is A &#732;= u &#732;v &#732; &#8224;. Clearly, this is an upper bound on uv &#8224; and &#8741;A &#732;&#8741;2</p><p>after querying for u &#732;(i), and a &#732;= &#8741;v &#732;&#8741;2 u &#732;, so we have SQ(a &#732;) from SQ(u &#732;) after querying for &#8741;v &#732;&#8741;.</p><p>Using the same ideas as in Lemma 3.6, we can extend sampling and query access of input matrices to linear combinations of those matrices.</p><p>)&#65025; cost. So, it suffices to get SQ(A &#732;) for an appropriate bound A &#732;. We choose</p><p>That |A &#732;(i, j)| &#8805; |A(i, j)| follows from Cauchy-Schwarz, and we get the desired value of &#981;:</p><p>We have SQ(A &#732;): we can compute &#8741;A &#732;&#8741;F by querying for all norms &#8741;A </p><p>)&#65026; time.</p><p>Remark 3.10. With the lemmas we've introduced, we can already get oversampling and query access to some modest expressions. For example, consider RUR decompositions, which show up frequently in our results: suppose we have SQ(A) for A &#8712; C m&#215;n , R &#8712; C r&#215;n a (possibly normalized) subset of rows of A, and a matrix U &#8712; C r&#215;r . Then</p><p>which is a linear combination of r 2 outer products involving rows of A. So, by Lemma 3.8 and Lemma 3.9, we have SQ &#981; (R &#8224; U R).</p><p>For us, the most interesting scenario is when our sampling and query oracles take poly-logarithmic time, since this corresponds to the scenarios where quantum state preparation procedures can run in time polylog(n). In these scenarios, quantum machine learning have the potential to achieve exponential speedups. We can provide such classical access in various ways.</p><p>Remark 3.11. Below, we list settings where we have sampling and query access to input matrices and vectors, and whenever relevant, we compare the resulting runtimes to the time to prepare analogous quantum states. Note that because we do not analyze classical algorithms in the bit model, i.e., we do not count each operation bitwise, their runtimes may be missing log factors that should be counted for a fair comparison between classical and quantum. If the input vector (resp. matrix) is given as a list of nnz(v) (resp. nnz(A)) of its non-zero entries, then the pre-processing time is linear in that number of entries. Therefore, the quantum-inspired setting can be directly translated to a basic randomized numerical linear algebra algorithm. More precisely, with this data structure, a fast quantum-inspired algorithm (say, one running in time O(T sq(A)) for T independent of input size) implies an algorithm in the standard computational model (running in O(nnz(A) + T ) time).</p><p>(b) (Dynamic data structure) QML algorithms often assume that their input is in a data structure with a certain kind of quantum access [Pra14, KP20, GLM08, WZP18, RSW + 19, CGJ19]. They argue that, since this data structure allows for circuits preparing input states with linear gate count but polylog depth, hardware called QRAM might be able to parallelize these circuits enough so that they run in effectively polylog time. In the interest of considering the best of all possible worlds for QML, we will treat circuit depth as runtime for QRAM and ignore technicalities.</p><p>This data structure (see Fig. <ref type="figure">2</ref>) admits sampling and query access to the data it stores with just-as-good runtimes: specifically, for a matrix A &#8712; C m&#215;n , we get SQ(A) with q(A) = O(1), s(A) = O(log mn), and n(A) = O(1). So, quantum-inspired algorithms can be used whenever QML algorithms assume this form of input.</p><p>Further, unlike the alias method stated above, this data structure supports updating entries in O(log mn) time, which is used in applications of QML where data accumulates over time <ref type="bibr">[KP17]</ref>. , simply by using the uniform distribution over non-zero entries for the oversampling and query oracles. For example, for SQ(a &#732;) we can set a &#732;(i) := c &#8730; s, and for A &#732;(i, &#8226;) we use the vector with entries c at the non-zeros of A(i, &#8226;) (potentially adding some "dummy" zero locations to have exactly s non-zeroes).</p><p>Note that similar sparse-access assumptions are often seen in the QML and Hamiltonian simulation literature <ref type="bibr">[HHL09]</ref>. Also, if A is not much smaller than we expect, then &#981; can be independent of dimension. For example, if A has exactly s non-zero entries per row and</p><p>(f) (CT states) In 2009, Van den Nest defined the notion of a "computationally tractable" (CT) state <ref type="bibr">[VdN11]</ref>. Using our notation, |&#968;&#10217; &#8712; C n is a CT state if we have SQ(&#968;) with sq(&#968;) = polylog(n). Van den Nest's paper identifies several classes of CT states, including product states, quantum Fourier transforms of product states, matrix product states of polynomial bond dimension, stabilizer states, and states from matchgate circuits. For more details on how can one get efficient sampling and query access to such vectors we direct the reader to <ref type="bibr">[VdN11]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Matrix sketches</head><p>We now introduce the workhorse of our algorithms: the matrix sketch. Using sampling and query access, we can generate these sketches efficiently, and these allow one to reduce the dimensionality of a problem, up to some approximation. Most of the results presented in this section are known in the classical sketching literature: we present them here for completeness, and to restate them in the context of sampling and query access.</p><p>Definition 4.1. For a distribution p &#8712; R m , we say that a matrix S &#8712; R s&#215;m is sampled according to p if each row of S is independently chosen to be e i / &#8730;&#65025; s &#8226; p(i) with probability p(i), where e i is the vector that is one in the ith position and zero elsewhere. If p is an &#8467; 2 -norm sampling distribution D v as defined in Definition 3.2, then we also say S is sampled according to v.</p><p>We call S an importance sampling sketch for A &#8712; C m&#215;n if it is sampled according to A's row norms a, and we call S a &#981;-oversampled importance sampling sketch if it is sampled according to the bounding row norms from SQ &#981; (A), a &#732;(or, more generally, from a &#981;-oversampled importance sampling distribution of a).</p><p>One should think of S as a description of how to sketch A down to SA. The following lemma shows that &#8741;SA&#8741; F approximates &#8741;A&#8741; F , giving a simple example of the phenomenon that SA approximates A in certain senses: it shows that &#8741;SA&#8741; F = &#920;(&#8741;A&#8741; F ) with probability &#8805; 0.9 when S has &#8486;( 1 &#981; 2 ) rows. We show later (Lemma 4.8) that a similar statement holds for spectral norm: &#8741;SA&#8741; = &#920;(&#8741;A&#8741;) with probability &#8805; 0.9 when S has &#8486; &#732;(&#981; 2 &#8741;A&#8741; 2 F /&#8741;A&#8741; 2 ) rows.</p><p>Lemma 4.2 (Frobenius norm bounds for matrix sketches). Let S &#8712; C r&#215;m be a &#981;-oversampled importance sampling sketch of A &#8712; C m&#215;n . Then &#8741;[SA](i, &#8226;)&#8741; &#8804; &#8730;&#65025; &#981;/r&#8741;A&#8741; F for all i &#8712; [r], so &#8741;SA&#8741; 2 F &#8804; &#981;&#8741;A&#8741; 2 F (unconditionally). Equality holds when &#981; = 1. Further,</p><p>Proof. Let p be the distribution used to create S, and let s i be the sample from p used for row i of S. Then &#8741;SA&#8741; 2 F is the sum of the row norms &#8741;[SA](i, &#8226;)&#8741; 2 over all i &#8712; [r], and</p><p>The first equation shows the unconditional bounds on &#8741;SA&#8741; F . When &#981; = 1, p(i) = &#8741;A(i, &#8226;)&#8741; 2 /&#8741;A&#8741; 2 F so the inequality becomes an equality. By the second equation, &#8741;SA&#8741; 2 F -&#8741;A&#8741; 2 F has expected value zero and is the sum of independent random variables bounded in [-&#8741;A&#8741; 2 F , (&#981; -1)&#8741;A&#8741; 2 F ], so the probabilistic bound follows immediately from Hoeffding's inequality.</p><p>In the standard algorithm setting, computing an importance sampling sketch requires reading all of A, since we need to sample from D a . If we have SQ &#981; (A), though, we can efficiently create a</p><p>)&#65025; time: for each row of S, we pull a sample from p, and then compute &#8730;&#65025; p(i). After finding this sketch S, we have an implicit description of SA: it is a normalized multiset of rows of A, so we can describe it with the row indices and corresponding normalization, (i 1 , c 1 ), . . . , (i s , c s ).</p><p>SA can be used to approximate matrix expressions involving A. Further, we can chain sketches using the lemma below, which shows that from SQ &#981; (A), we have SQ &#8804;2&#981; ((SA) &#8224; ), under a mild assumption on the size of the sketch S. This can be used to find a sketch T &#8224; of (SA) &#8224; . The resulting expression SAT is small enough that we can compute functions of it in time independent of dimension, and so will be used extensively. When we discuss sketching A down to SAT , we are referring to the below lemma for the method of sampling T . Lemma 4.3. Consider SQ &#966; (A) &#8712; C m&#215;n and S &#8712; R r&#215;m sampled according to a &#732;, described as pairs (i 1 , c 1 ), . . . , (i r , c r ). If r &#8805; 2&#966; 2 log 2 &#948; , then with probability &#8805; 1-&#948;, we have SQ &#981; (SA) and SQ &#981; ((SA) &#8224; ) for some &#981; satisfying &#981; &#8804; 2&#966;. If &#966; = 1, then for all r, we have SQ(SA) and SQ((SA) &#8224; ).</p><p>The runtimes for SQ &#981; (SA) are q(SA) = q(A), s &#981; (SA) = s &#966; (A), q &#981; (SA) = q &#966; (A), and</p><p>Proof. By Lemma 4.2, &#8741;SA&#8741; 2 F &#8805; &#8741;A&#8741; 2 F /2 with probability &#8805; 1 -&#948;. Suppose this bound holds. To get SQ &#981; (SA), we take &#732;&#65026; SA = SA &#732;, which bounds SA by inspection. Further, &#8741;SA &#732;&#8741;2</p><p>Analogously, (SA &#732;) &#8224; works as a bound for SQ &#981; ((SA) &#8224; ). We can query an entry of SA by querying the corresponding entry of A, so all that suffices is to show that we have SQ(SA &#732;) and SQ((SA &#732;) &#8224; ) from SQ(A &#732;). (When &#966; = 1, we can ignore the above argument: the rest of the proof will show that we have SQ(SA) and SQ((SA) &#8224; ) from SQ(A).)</p><p>We have SQ(SA &#732;). Because the rows of SA &#732;are rescaled rows of A &#732;, we have SQ access to them from SQ access to A &#732;. Because &#8741;SA &#732;&#8741;2</p><p>&#8741;A &#732;&#8741;2 F , we have SQ access to the vector of row norms of SA &#732;(pulling samples simply by pulling samples from the uniform distribution).</p><p>We have SQ((SA &#732;) &#8224; ). (This proof is similar to one from <ref type="bibr">[FKV04]</ref>.) Since the rows of (SA &#732;) &#8224; are length r, we can respond to SQ queries to them by reading all entries of the row and performing some linear-time computation. &#8741;(SA &#732;) &#8224; &#8741; 2 F = &#8741;A &#732;&#8741;2 F , so we can respond to a norm query by querying the norm of A &#732;. Finally, we can sample according to the row norms of (SA &#732;) &#8224; by first querying an index i &#8712; [r] uniformly at random, then outputting the index j &#8712; [n] sampled from [SA &#732;](i, &#8226;) (which we can sample from because it is a row of A &#732;). The distribution of the samples output by this procedure is correct: the probability of outputting j is</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1">Approximation results</head><p>Here, we present approximation results on sketched matrices that we will use heavily throughout our results. We begin with a fundamental observation: given sampling and query access to a matrix A, we can approximate the matrix product A &#8224; B by a sum of rank-one outer products. We formalize this with two variance bounds, which we can use together with Chebyshev's inequality. Consider X &#8712; C m&#215;n , Y &#8712; C m&#215;p , and take S &#8712; R r&#215;m to be sampled according to p &#8712; R m a &#981;-oversampled importance sampling distribution from X or Y . Then,</p><p>Proof. To show the first equation, we use that</p><p>] is a sum of variances, one for each entry (i, j), since E[X &#8224; S &#8224; SY -XY ] is zero in every entry. Furthermore, for every entry (i, j), the matrix expression is the sum of r independent, mean-zero terms, one for each row of S:</p><p>So, we can use standard properties of variances<ref type="foot">foot_8</ref> to conclude that</p><p>The second other inequality follows by the same computation:</p><p>The above result shows that, given SQ(X), X &#8224; Y can be approximated by a sketch with constant failure probability. If we have SQ(X) and SQ(Y ), we can make the failure probability exponential small. To show this tighter error bound, we use an argument of Drineas, Kannan, and Mahoney for approximating matrix multiplication. We state their result in a slightly stronger form, which is actually proved in their paper. For completeness, a proof of this statement is in the appendix. Lemma 4.5 (Matrix multiplication by subsampling [DKM06, Theorem 1]). Suppose we are given X &#8712; C n&#215;m , Y &#8712; C n&#215;p , r &#8712; N and a distribution p &#8712; R n satisfying the oversampling condition that, for some &#981; &#8805; 1,</p><p>Let S &#8712; R r&#215;n be sampled according to p. Then X &#8224; S &#8224; SY is an unbiased estimator for X &#8224; Y and</p><p>From a simple application of Lemma 4.5, we get a key lemma used frequently in Section 6.</p><p>Lemma 4.6 (Approximating matrix multiplication to Frobenius norm error; corollary of [DKM06, Theorem 1]). Consider X &#8712; C m&#215;n , Y &#8712; C m&#215;p , and take S &#8712; R r&#215;m to be sampled according to q := q 1 +q 2 2 , where q 1 , q 2 &#8712; R m are &#981; 1 , &#981; 2 -oversampled importance sampling distributions from x, y, the vector of row norms for X, Y , respectively. Then S is a 2&#981; 1 , 2&#981; 2 -oversampled importance sampling sketch of X, Y , respectively. Further,</p><p>Proof. First, notice that 2q(i) &#8805; q 1 (i) and 2q(i) &#8805; q 2 (i), so q oversamples the importance sampling distributions for X and Y with constants 2&#981; 1 and 2&#981; 2 , respectively. We get the bound by using Lemma 4.5; q satisfies the oversampling condition with &#981; = &#8730; &#981; 1 &#981; 2 &#8741;X&#8741; F &#8741;Y &#8741; F &#8721;&#65025; &#8467; &#8741;X(&#8467;,&#8226;)&#8741;&#8741;Y (&#8467;,&#8226;)&#8741; , using the inequality of arithmetic and geometric means:</p><p>Remark 4.7. Lemma 4.6 implies that, given SQ &#981; 1 (X) and SQ &#981; 2 (Y ), we can get SQ &#981; (M ) for M a sufficiently good approximation to</p><p>. This is an approximate closure property for oversampling and query access under matrix products.</p><p>Given the above types of accesses, we can compute the sketch S necessary for Lemma 4.6 by taking p = D x &#732;and q = D y &#732;), thereby finding a desired M := X &#8224; S &#8224; SY . We can compute entries of M with only r queries each to X and Y , so all we need is to get SQ(M &#732;) for M &#732;the appropriate bound. We choose</p><p>showing that we have SQ(M ) follows from the proofs of Lemmas 3.8 and 3.9, since M is simply a linear combination of outer products of rows of X &#732;with rows of Y &#732;. Finally, this bound has the appropriate norm. Notating the rows sampled by the sketch as s 1 , . . . , s r , we have</p><p>If X = Y , we can get an improved spectral norm bound: instead of depending on &#8741;X&#8741; 2 F , error depends on &#8741;X&#8741;&#8741;X&#8741; F . Lemma 4.8 (Approximating matrix multiplication to spectral norm error [RV07, Theorem 3.1]). Suppose we are given A &#8712; R m&#215;n , &#949; &gt; 0, &#948; &#8712; [0, 1], and S &#8712; R r&#215;n a &#981;-oversampled importance sampling sketch of A. Then</p><p>The above results can be used to approximate singular values, simply by directly translating the bounds on matrix product error to bounds on singular value error. Lemma 4.9 (Approximating singular values). Given SQ &#981; (A) &#8712; C m&#215;n and &#949; &#8712; (0, 1], we can form importance sampling sketches S &#8712; R r&#215;m and</p><p>)&#65025; time satisfying the following property. Take r, c &#8805; s for some sufficiently large</p><p>. Then, if &#963; i and &#963; &#710;i are the singular values of A and SAT , respectively (where &#963; &#710;i = 0 for i &gt; min(r, c)), we have with probability</p><p>If we additionally assume that &#949; &#8818; &#8741;A&#8741;/&#8741;A&#8741; F , we can conclude</p><p>This result follows from results bounding the error between singular values by errors of matrix products. For notation, let &#963; i (M ) be the ith largest singular value of M . We will use the following inequalities relating norm error of matrices to error in their singular values:</p><p>When A, B are Hermitian, the same bound holds for their eigenvalues. <ref type="foot">13</ref>Proof of Lemma 4.9. We use known theorems, plugging in the values of r and c. Using Lemma 4.6 for the sketch S, we know that</p><p>by Lemma 4.3, T &#8224; is an &#8804; 2&#981;-oversampled importance sampling sketch of (SA) &#8224; , so by Lemma 4.6 for</p><p>By rescaling &#948; and union bounding, we can have all events happen with probability &#8805; 1 -&#948;. Then, from triangle inequality followed by Lemma 4.10,</p><p>The analogous result holds for spectral norm via Lemma 4.8 and Lemma 4.11; the only additional complication is that we need to assert that &#8741;SA&#8741; &#8818; &#8741;A&#8741;. We use the following argument, using the upper bound on &#949;:</p><p>Finally, if we wish to approximate a vector inner product u &#8224; v, a special case of matrix product, we can do so with only sampling and query access to one of the vectors while still getting log 1 &#948; dependence on failure probability. The proof of this statement is in Appendix B.</p><p>Lemma 4.12 (Inner product estimation, [Tan19, Proposition 4.2]).</p><p>)&#65025; .</p><p>Remark 4.13. Lemma 4.12 also applies to higher-order tensor inner products:</p><p>(a) (Trace inner products, [GLT18, Lemma 11]) Given SQ &#981; (A) &#8712; C n&#215;n and Q(B) &#8712; C n&#215;n , we can estimate Tr[AB &#8224; ] to additive error &#949; with probability at least 1 -&#948; by using</p><p>time. To do this, note that SQ &#981; (A) and Q(B) imply SQ &#981; (vec(A)) and Q(vec(B)). Tr[AB] = &#10216;vec(B), vec(A)&#10217;, so we can just apply Lemma 4.12 to conclude.</p><p>time. To do this, observe that x &#8224; Ay = Tr(x &#8224; Ay) = Tr(Ayx &#8224; ) and that Q(yx &#8224; ) can be simulated with Q(x), Q(y). So, we just apply the trace inner product procedure.</p><p>Finally, we observe a simple technique to convert importance sampling sketches into approximate isometries, by inserting the appropriate pseudoinverse. This will be used in some of the more involved applications.</p><p>Lemma 4.14. Given A &#8712; C m&#215;n , S &#8712; C r&#215;m sampled from a &#981;-oversampled importance sampling distribution of A, and T &#8224; &#8712; C n&#215;c sampled from an &#8804; &#981;-oversampled importance sampling distribution of (SA) &#8224; , let R := SA and C := SAT . Let &#963; k be the kth singular value of A. If, for &#945; &#8712; (0, 1],</p><p>Proof. The following occurs with probability &#8805; 1 -&#948;. By Lemma 4.9,</p><p>. By Lemma 4.8,</p><p>We get the computation for the &#945;-approximate isometry by restricting attention to the span of U :</p><p>One can also observe that, for a sufficiently good sketch C, R &#8776; C k (C k ) + R in spectral norm, giving a generic way to approximate a sketch R by a product of a small matrix with an approximate projective isometry. We do not need it in our proofs, so this computation is not included.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Singular value transformation</head><p>Our main result is that, given SQ &#981; (A) and a smooth function f , we can approximate f (A &#8224; A) by a decomposition R &#8224; U R + f (0)I. This primitive is based on the even singular value transformation used by Gily&#233;n, Su, Low, and Wiebe <ref type="bibr">[GSLW19]</ref>.</p><p>Theorem 5.1 (Even singular value transformation). Let A &#8712; C m&#215;n and f : R + &#8594; C be such that f (x) and f &#175;(x) := (f (x)-f (0))/x are L-Lipschitz and L &#175;-Lipschitz, respectively, on</p><p>i +d] for some d &gt; 0. Take parameters &#949; and &#948; such that 0 &lt; &#949; &#8818; min(L&#8741;A&#8741; 2 * , L &#175;&#8741;A&#8741; 2 * &#8741;A&#8741; 2 ) and &#948; &#8712; (0, 1]. Choose a norm * &#8712; {F, Op}.</p><p>Suppose we have SQ &#981; (A). Consider the importance sampling sketch S &#8712; R r&#215;m corresponding to SQ &#981; (A) and the importance sampling sketch T &#8224; &#8712; R c&#215;n corresponding to SQ &#8804;2&#981; ((SA) &#8224; ) (which we have by Lemma 4.3). Then, for R := SA and C := SAT , we can achieve the bound</p><p>First, we make some technical remarks. The assumption that &#949; &#8818; L&#8741;A&#8741; 2 * is for non-degeneracy: if &#949; &#8805; L&#8741;A&#8741; 2 , then the naive approximation f (0)I of f (A &#8224; A) would suffice, since &#8741;f (0)I -f (A &#8224; A)&#8741; &#8804; L&#8741;A&#8741; 2 &#8804; &#949; as desired. 14 The parameter d (or, rather, the parameter &#949; &#175;) specifies the domain where 14 The choice f (0)I assumes that f is Lipschitz on {0, &#8741;A&#8741; 2 }. More generally, we can choose f (x)I for any</p><p>in order to get a sufficiently good naive approximation.</p><p>f (x) and f &#175;(x) should be smooth: the condition in the theorem is that they should be Lipschitz on the spectrum of A &#8224; A, with &#949; &#175;room for approximation. This will not come into play often, though, since we can often design our singular value transforms such that we can take d = &#8734;. For example, if our desired transform f becomes non-smooth outside the relevant interval [0, &#8741;A&#8741; 2 ], we can apply Theorem 5.1 with d = &#8734; and the function g such that g(x) = g(&#8741;A&#8741; 2 ) for x &#8805; &#8741;A&#8741; 2 and g(x) = f (x) otherwise. Then g(A &#8224; A) = f (A &#8224; A) and g is smooth everywhere, so we do not need to worry about the d parameter. Finally, we note that no additional log terms are necessary (i.e., &#8486; &#732;becomes &#8486;) when the Frobenius norm is used.</p><p>By our discussion in Section 4, finding the sketches S and T for Theorem 5.1 takes time</p><p>, querying for all of the entries of C takes additional time O(rc q(A)), and computing f &#175;(CC &#8224; ) takes additional time O (&#65025; min(r 2 c, rc 2 ) )&#65025; (if done naively). For our applications, this final matrix function computation will dominate the runtime, and the rest of the cost we will treat as O (&#65025; rc sq &#981; (A) )&#65025; . For some intuition on error bounds and time complexity, we consider how the parameters in our main theorem behave in a restricted setting: suppose we have SQ(A) with minimum singular value &#963; and such that &#8741;A&#8741; F /&#963; is dimension-independent. <ref type="foot">15</ref> This condition simultaneously bounds the rank and condition number of A. Further suppose<ref type="foot">foot_11</ref> that f is L-Lipschitz on the interval [0, &#8741;A&#8741; 2 ] and satisfies L&#8741;A&#8741; 2 &lt; &#915;D where</p><p>for some dimension-independent &#915;. &#915; must be at least one, so we can think about such an f as being at most &#915; times "steeper" compared to the least possible "steepness". Under these assumptions, we can get a decomposition satisfying</p><p>The time to compute the decomposition is</p><p>These quantities are all dimensionless. Dependence on &#963; arises because we bound L &#175;&#8804; L/&#963; 2 : our algorithm's dependence on L &#175;implicitly enforces a low-rank constraint in this case. All of our analyses give qualitatively similar results to this, albeit in more general settings allowing approximately low-rank input.</p><p>To perform error analyses, we will need bounds on the norms of the matrices in our decomposition. The following lemma gives the bounds we need for Section 6.</p><p>Lemma 5.2 (Norm bounds for even singular value transformation). Suppose the assumptions from Theorem 5.1 hold. Then with probability at least 1 -&#948;, the event in Eq. (3) occurs (that is,</p><p>and moreover, the following bounds also hold:</p><p>Eq. ( <ref type="formula">7</ref>) is typically a better bound than combining Eqs. ( <ref type="formula">5</ref>) and (6). For intuition, notice this is true if &#949;, &#949; &#175;= 0: the left-hand and right-hand sides of the following inequality are the two ways to bound &#8741;R &#8224; &#8730;&#65025; f &#175;(CC &#8224; )&#8741; 2 , up to constant factors (&#963; below runs over the singular values of A):</p><p>The rest of this section will be devoted to proving Theorem 5.1 and Lemma 5. </p><p>Proof of Theorem 5.1 and Lemma 5.2. Since g(A &#8224; A) = f (A &#8224; A) + g(0)I for f (x) := g(x) -g(0), we can assume without loss of generality that f (0) = 0. As a reminder, in the statement of Theorem 5.1 we take</p><p>These values are chosen such that the following holds with probability &#8805; 1 -&#948; simultaneously.</p><p>1. The ith singular value of CC &#8224; does not differ from the ith singular value of A &#8224; A by more than &#949; &#175;. This follows from Lemma 4.9 with error parameter &#949;&#8741;A&#8741; -1</p><p>). This immediately implies Eq. (6).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">&#8741;R&#8741;</head><p>. This is the spectral norm bound in Eq. (5) (the Frobenius norm bound follows from Lemma 4.2). We use Lemma 4.8:</p><p>We need the polylog factors in our number of samples to deal with the log r that arises from Lemma 5.4 in the spectral norm case.</p><p>(plugging in value for r)</p><p>. This follows similarly to the above point.</p><p>When all of the above bounds hold, we can conclude:</p><p>This gives Eq. (3) after rescaling &#949; by an appropriate constant factor. When * = Op, we also have Eq. ( <ref type="formula">7</ref>), since</p><p>We remark here that the log term in Lemma 5.4 unfortunately cannot be removed (because some Lipschitz functions are not operator Lipschitz). However, several bounds hold under various mild assumptions, and for particular functions, the log term can be improved to log log or completely removed. For example, the QSVT literature <ref type="bibr">[GSLW19]</ref> cites the following result: </p><p>.</p><p>Though we will not use it, we can extend these results on eigenvalue transformation of Hermitian matrices to singular value transformation of general matrices via the reduction from [GSLW19, Corollary 21]. For example, Lemma 5.4 implies the following: Lemma 5.6. Let A, B &#8712; C m&#215;n be matrices and let f : [0, &#8734;) &#8594; C be L-Lipschitz continuous on the singular values of A and B such that f (0) = 0. Then</p><p>In Section 7, we prove results on generic singular value transformation and eigenvalue transformation by bootstrapping Theorem 5.1. Since these are slower, though, we will use primarily the even singular value transformation results that we just proved to recover "dequantized QML" results. This will be the focus of next section.</p><p>6 Applying the framework to dequantizing QML algorithms Now, with our framework, we can recover previous dequantization results: recommendation systems (Section 6.2), supervised clustering (Section 6.3), principal component analysis (Section 6.4), lowrank matrix inversion (Section 6.5), support-vector machines (Section 6.6), and low-rank semidefinite programs (Section 6.8). We also propose new quantum-inspired algorithm for other applications, including QSVT (Section 6.1), Hamiltonian simulation (Section 6.7), and discriminant analysis (Section 6.9). We give applications in roughly chronological order; this also happens to be a rough difficulty curve, with applications that follow more easily from our main results being first.</p><p>Everywhere it occurs, K := &#8741;A&#8741; 2 F /&#963; 2 , where A is the input matrix. &#954; := &#8741;A&#8741; 2 2 /&#963; 2 . For simplicity, we will often describe our runtimes as if we know spectral norms of input matrices (so, for example, we know &#954;). If we do not know the spectral norm, we can run Lemma 4.9 repeatedly with multiplicatively decreasing &#949; until we find a constant factor upper bound on the spectral norm, which suffices for our purposes. Alternatively, we can bound the spectral norm by the Frobenius norm, which we know from sampling and query access to input.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.1">Dequantizing QSVT</head><p>We begin by dequantizing the quantum singular value transformation described by Gily&#233;n, Su, Low, and Wiebe <ref type="bibr">[GSLW19]</ref> for close-to-low-rank matrices. Definition 6.1. For a matrix A &#8712; C m&#215;n and p(x) &#8712; C[x] degree-d polynomial of parity-d (i.e., even if d is even and odd if d is odd), we define the notation p (QV) (A) in the following way:</p><p>1. If p is even, meaning that we can express p(x) = q(x 2 ) for some polynomial q(x), then</p><p>2. If p is odd, meaning that we can express p(x) = x &#8226; q(x 2 ) for some polynomial q(x), then Then with probability &#8805; 1 -&#948;, for &#949; a sufficiently small constant, we can get</p><p>)&#65026; time. Specifically, for p even, the runtime is</p><p>and for p odd, the runtime is</p><p>.</p><p>From this result it follows that QSVT, as described in [GSLW19, Theorem 17], has no exponential speedup when the block-encoding of A comes from a quantum-accessible "QRAM" data structure as in [GSLW19, Lemma 50]. In the setting of QSVT, given A and b in QRAM, one can prepare |b&#10217; and construct a block-encoding for A/&#8741;A&#8741; F = A in polylog(mn) time. Then one can apply (quantum) SVT by a degree-d polynomial on A and apply the resulting map to |b&#10217; with d&#8226;polylog(mn) gates and finally project down to get the state |p (QV) (A)b&#10217; with probability &#8805; 1 -&#948; after &#920; (&#65025; &#8741;p (QV) (A)b&#8741; , and log(mn). We are exponentially slower in &#949; and &#948; (these errors are conflated for the quantum algorithm). However, this exponential advantage vanishes if the desired output is not a quantum state but some fixed value (or an estimate of one). In that case, the quantum algorithm must also pay 1 &#949; during the sampling or tomography procedures and the classical algorithm can boost a constant success probability to &#8805; 1 -&#948;, only paying a log 1 &#948; factor. Note that, unlike in the quantum output, we can query entries of the output, which a quantum algorithm cannot do without paying at least a 1 &#949; factor. Theorem 6.2 also dequantizes QSVT for block-encodings of density operators when the density operator comes from some well-structured classical data. Indeed, [GSLW19, Lemma 45] assumes we can efficiently prepare a purification of the density operator &#961;. The rough classical analogue is the assumption that we have sampling and query access to some A &#8712; C m&#215;n with &#961; = A &#8224; A. Since Tr(&#961;) = 1, we have &#8741;A&#8741; F = 1. Then, p (QV) (&#961;) = r (QV) (A) for r(x) = p(x 2 ) and &#8741;&#961;&#8741; = &#8741;A&#8741; 2 , so we can repeat the above argument to show the lack of exponential speedup for this input model too.</p><p>We can mimic the quantum algorithm with our techniques because low-degree polynomials are smooth, in the sense that we formalize with the following lemma (proven in Appendix B).</p><p>These bounds are tight for Chebyshev polynomials. In general, these bounds can be loose, so for any particular QML application we recommend using our main results for faster algorithms.</p><p>Proof of Theorem 6.2. Consider the even case: take p(x) = q(x 2 ) for q a degree-d/2 polynomial, so p (QV) (A) = q(A &#8224; A), and we have the correct form to apply Theorem 5.1. q is uncontrolled outside of [-1, 1], so we instead apply the singular value transformation which is constant outside of [-1, 1]:</p><p>We can do this because the singular values of A lie in [0, 1], so q(A &#8224; A) = f (A &#8224; A). Then, by Lemma 6.3, f and f &#175;are Lipschitz with</p><p>(We will later rescale &#949;; note that &#949;&#8741;p (QV) (A)b&#8741; &#8818; L&#8741;A&#8741; 2 &#8741;b&#8741;, so &#949; is small enough for the theorem assumption.) This reduces the problem to approximating</p><p>, using that &#8741;R&#8741; F &#8818; &#8741;A&#8741; F (Eq. ( <ref type="formula">5</ref>)) and sq(R &#8224; ) = O(r sq(A)) (Lemma 4.3). This suffices to maintain the error bound because (using Eqs. ( <ref type="formula">6</ref>) and ( <ref type="formula">7</ref>) and Lemma 6.3),</p><p>In the last step, we use that &#949; &#8818; &#8741;p (QV) (A)b&#8741;; if we do not have that assumption, &#732;&#65026; sq(v) &#8818; r 2 d 4 &#8741;v&#8741; 2 log(mn) log 1 &#948; . We rescale &#949; &#8592; &#949;&#8741;p (QV) (A)b&#8741; to get the desired bound. The runtime is dominated by finding</p><p>We also need to compute the matrix-vector product f &#175;(CC &#8224; )u, but this can be done in O(rc) time by instead multiplying through with the expression</p><p>where U &#8712; C r&#215;c comes from the SVD of C. Now for the odd case: we could use Theorem 7.1 here, but we will continue to use Theorem 5.1 here. Similarly to the even case, we take g(x) to be q(x) in [-1, 1] and held constant ouside it, so p (QV) (A) = A &#8226; g(A &#8224; A). Then, by plugging in the smoothness parameters from Lemma 6.3, we get R, C such that &#8741;R &#8224; g &#175;(CC &#8224; )R + g(0)I -g(A &#8224; A)&#8741; &lt; &#949; &#8741;A&#8741; with probability &#8805; 1 -&#948; where</p><p>We now use the approximating matrix product lemmas Lemmas 4.4 and 4.6 three times.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">We use Lemma 4.4 to approximate AR</head><p>. We can do this since we have SQ(A &#8224; ) (by assumption) and SQ</p><p>samples, with each sample costing O(r log(mn)) time (by Lemma 4.3). Then using Lemma 5.2 and the bounds on |q(x)| and |q &#175;(x)| in Lemma 6.3,</p><p>2. We use Lemma 4.6 to approximate Rb &#8776; u such that &#8741;Rb -u&#8741; &#8804; &#949; d 2 &#8741;A&#8741; , where we use</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Using SQ(b) and Lemma 4.4, we approximate</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>So, we have shown that</head><p>Above, we used that &#949; &#8818; &#8741;p (QV) (A)b&#8741; &#8804; &#8741;A&#8741;&#8741;q(A &#8224; A)&#8741;&#8741;b&#8741; &#8804; d&#8741;A&#8741;. Now, we rescale &#949; &#8592; &#949;&#8741;p (QV) (A)b&#8741; to get the desired statement. The runtime is dominated by the sampling for C in O(rc log(mn)) time, the computation of g &#175;(CC &#8224; ) in O (&#65025; r 2 c )&#65025; time, and the approximation of</p><p>Remark 6.4. Here, we make a brief remark about a technical detail we previously elided. Technically, QSVT can use A &#8224; in QRAM instead of A (cf. [GSLW19, Lemma 50]), leaving open the possibility that there is a quantum algorithm that does not give an exponential speedup when A is in QRAM, but does when A &#8224; is in QRAM. We sketch an argument why this is impossible by showing that, given SQ(A), we can simulate SQ &#981; (B) (and SQ &#981; (B &#8224; )) for B such that &#8741;B -A &#8224; &#8741; &#8804; &#949;&#8741;A&#8741; with probability &#8805; 1 -&#948;. Unfortunately, this argument is fairly involved, so we defer it to Appendix A.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.2">Recommendation systems</head><p>Our framework gives a simpler and faster variant of Tang's dequantization <ref type="bibr">[Tan19]</ref> of Kerenidis and Prakash's quantum recommendation systems [KP17]. Tang's result is notable for being the first result in this line of work and for dequantizing what was previously believed to be the strongest candidate for practical exponential quantum speedups for a machine learning problem <ref type="bibr">[Pre18]</ref>.</p><p>We want to find a product j &#8712; [n] that is a good recommendation for a particular user i &#8712; [m], given incomplete data on user-product preferences. If we store this data in a matrix A &#8712; R m&#215;n with sampling and query access, in the strong model described by Kerenidis and Prakash <ref type="bibr">[KP17]</ref>, finding good recommendations reduces to the following: Problem 6.5. For a matrix A &#8712; R m&#215;n , given SQ(A) and a row index i &#8712; [m], sample from A &#710;(i, &#8226;) up to &#948; error in total variation distance, where &#8741;A &#710;-A &#963;,&#951; &#8741; F &#8804; &#949;&#8741;A&#8741; F .</p><p>Here, A &#963;,&#951; is a certain type of low-rank approximation to A. The standard notion of low-rank approximation is that of</p><p>, which is the rank-r matrix closest to A in spectral and Frobenius norms. Using singular value transformation, we define an analogous notion thresholding singular values instead of rank. Definition 6.6 (A &#963;,&#951; ). We define A &#963;,&#951; as a singular value transform of A satisfying:</p><p>Note that P &#963;,&#951; is not fully specified in the range [&#963;(1 -&#951;), &#963;(1 + &#951;)), so A &#963;,&#951; is any of a family of matrices with error &#951;.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>For intuition, P (SV)</head><p>&#963;,&#951; (A) is A for (right) singular vectors with value &#8805; &#963;(1 + &#951;), zero for those with value &lt; &#963;(1 -&#951;), and something in between for the rest. Our analysis simplifies the original algorithm, which passes through the low-rank approximation guarantee of Frieze, Kannan, and Vempala <ref type="bibr">[FKV04]</ref>.</p><p>Our algorithm uses that we can rewrite our target low-rank approximation as A &#8226; t(A &#8224; A), where t is a smoothened projector. So, we can use our main theorem, Theorem 5.1, to approximate t(A &#8224; A) by some R &#8224; U R. Then, the i th row of our low-rank approximation is A(i, &#8226;)R &#8224; U R, which is a product of a vector with an RUR decomposition. Thus, using the sampling techniques described in Section 4.1, we have SQ &#981; (A(i, &#8226;)R &#8224; U R), so we can get the sample from this row as desired.</p><p>Corollary 6.7. Suppose 0 &lt; &#949; &#8818; &#8741;A&#8741;/&#8741;A&#8741; F and &#951; &#8804; 0.99. A classical algorithm can solve Problem 6.5 in time</p><p>The assumption on &#949; is a weak non-degeneracy condition in the low-rank regime. For reference, &#951; = 1/6 in the application of this algorithm to recommendation systems. So, supposing the first term of the runtime dominates, the runtime is &#732;&#65025; O (&#65026; &#8741;A&#8741; 6 F &#8741;A&#8741; 10 &#963; 16 &#949; 6 Proof. Note that A &#963;,&#951; = A &#8226; t(A &#8224; A), where t is the thresholding function shown below.</p><p>We will apply Theorem 5.1 with error parameter &#949; to get matrices R, C such that</p><p>Since t(x) is (4&#951;&#963; 2 ) -1 -Lipschitz and t(x)/x is (4&#951;(1 -&#951;) 2 &#963; 4 ) -1 -Lipschitz, the sizes of r and c are</p><p>So, it suffices to compute the SVD of an r &#215; c matrix, which has a runtime of</p><p>Next, we want to approximate AR &#8224; &#8776; A &#8242; R &#8242; &#8224; . If we had SQ(A &#8224; ) (in particular, if we could compute column norms &#8741;A(&#8226;, j)&#8741;), we could do this via Lemma 4.6, and if we were okay with paying factors of 1 &#948; , we could do this via Lemma 4.4. Here, we will instead implicitly define an approximation by approximating each row [AR &#8224; ](i, &#8226;) = A(i, &#8226;)R &#8224; via Lemma 4.6, since we then have SQ(A(i, &#8226;) &#8224; ) and SQ(R &#8224; ). With this proposition, we can estimate [AR &#8224; ](i,</p><p>Using this and the observation that max x t &#175;(x) = (1 + &#951;) -2 &#963; -2 &#8804; &#963; -2 , we can bound the quality of our final approximation as</p><p>by Lemma 5.2 and Eq. ( <ref type="formula">9</ref>)</p><p>We can sample from A &#710;(i,</p><p>taking O(r &#8242; r + rc) time. Then, we use Lemmas 3.5 and 3.6 to get a sample from xR with probability</p><p>, where sq &#981; (xR) = O(r) and</p><p>Then, using previously established bounds and bounds from Lemma 5.2, we have</p><p>This sampling procedure and the SVD dominate the runtime. Since the sampling is exact, the only error in total variation distance is the probability of failure.</p><p>Remark 6.8. This algorithm implicitly assumes that the important singular values are &#8805; &#963;.</p><p>Without such an assumption, we can take &#963; = &#949;&#8741;A&#8741; F and &#951; = 1/2, and have meaningful bounds on the output matrix A &#710;. Observe that, for p(x) = x(t( &#8730; x) -1),</p><p>So, our low-rank approximation output A &#710;satisfies &#8741;A &#710;-A&#8741; &#8818; &#949;&#8741;A&#8741; F , with no assumptions on A,</p><p>This can be subsequently used to get SQ &#981; (A &#710;(i, &#8226;)) = SQ &#981; (e i A &#710;) where</p><p>in a myopic sense, solving the same problem as Problem 6.5), or more generally, any product of A &#710;with a vector, in time independent of dimension.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.3">Supervised clustering</head><p>The 2013 paper of Lloyd, Mohseni, and Rebentrost <ref type="bibr">[LMR13]</ref> gives two algorithms for the machine learning problem of clustering. The first algorithm is a simple swap test procedure that was dequantized by Tang <ref type="bibr">[Tan21]</ref> (the second is an application of the quantum adiabatic algorithm with no proven runtime guarantees). We will reproduce the algorithm from <ref type="bibr">[Tan21]</ref> here: since the dequantization just uses the inner product protocol, so it rather trivially fits into our framework.</p><p>We have a dataset of points in R d grouped into clusters, and we wish to classify a new data point by assigning it to the cluster with the nearest average, aka centroid. We do this by estimating the distance between the new point p &#8712; R d to the centroid of a cluster of points q 1 , . . . , q n-1 &#8712; R d , namely, &#8741;p -1 n-1 (q 1 + &#8226; &#8226; &#8226; + q n-1 )&#8741; 2 . This is equal to &#8741;wM &#8741; 2 , where</p><p>. . .</p><p>Because the quantum algorithm assumes input in quantum states, we can assume sampling and query access to the data points, giving the problem Problem 6.9. Given SQ(M ) &#8712; R n&#215;d , Q(w) &#8712; R n , approximate (wM )(wM ) T to additive &#949; error with probability at least 1 -&#948;.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Corollary 6.10 ([Tan21, Theorem 4]).</head><p>There is a classical algorithm to solve Problem 6.9 in</p><p>Note that &#8741;M &#8741; 2 F = 2 and &#8741;w&#8741; 2 = &#8741;p&#8741; 2 + 1 n-1</p><p>&#8721;&#65025; n-1 i=1 &#8741;q i &#8741; 2 . The quantum algorithm has a quadratically faster runtime of O</p><p>Proof. Recall our notation for the vector of row norms m := [&#8741;M (1, &#8226;)&#8741;, . . . , &#8741;M (n, &#8226;)&#8741;] coming from Definition 3.7. We can rewrite (wM )(wM ) T as an inner product &#10216;u, v&#10217; where</p><p>where u and v are three-dimension tensors. By flattening u and v, we can represent them as two vectors in R (n&#8226;d&#8226;n)&#215;1 . We clearly have Q(v) from queries to M and w. As for getting SQ(u) from SQ(M ): to sample, we first sample i according to m, sample j according to M (i, &#8226;), and sample k according to m; to query, compute u i,j,k = M (i, j)m(k). Finally, we can apply Lemma 4.12 to estimate &#10216;u, v&#10217;. &#8741;u&#8741; = &#8741;M &#8741; 2 F and &#8741;v&#8741; = &#8741;w&#8741; 2 , so estimating &#10216;u, v&#10217; to &#949; additive error with probability at least 1 -&#948; requires O(&#8741;M &#8741; 4 F &#8741;w&#8741; 4 &#949; -2 log 1 &#948; ) samples.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.4">Principal component analysis</head><p>Principal component analysis (PCA) is an important data analysis tool, first proposed to be feasible via quantum computation by Lloyd, Mohseni, and Rebentrost <ref type="bibr">[LMR14]</ref>. Given copies of states with density matrix &#961; = X &#8224; X, the quantum PCA algorithm can prepare the state &#8721;&#65025; &#955; i |v i &#10217;&#10216;v i | &#8855; |&#955; &#710;i&#10217;&#10216;&#955; &#710;i|, where &#955; i and v i are the eigenvalues and eigenvectors of X &#8224; X, and &#955; &#710;i are eigenvalue estimates (up to additive error). See Prakash's PhD thesis [Pra14, Section 3.2] for a full analysis and Chakraborty, Gily&#233;n, and Jeffery for a faster version of this algorithm in the block-encoding model <ref type="bibr">[CGJ19]</ref>. Directly measuring the eigenvalue register is called spectral sampling, but such sampling is not directly useful for machine learning applications.</p><p>Though we do not know how to dequantize this protocol exactly, we can dequantize it in the low-rank setting, which is the only useful poly-logarithmic time application that Lloyd, Mohseni, and Rebentrost <ref type="bibr">[LMR14]</ref> suggests for quantum PCA. Problem 6.11 (PCA for low-rank matrices). Given a matrix SQ(X) &#8712; C m&#215;n such that X &#8224; X has top k eigenvalues {&#955; i } k i=1 and eigenvectors {v i } k i=1 , with probability &#8805; 1 -&#948;, compute eigenvalue estimates {&#955; &#710;i} k i=1 such that</p><p>Note that we should think of &#955; i as &#963; 2 i , where &#963; i is the ith largest singular value of X. To robustly avoid degeneracy conditions, our runtime must depend on parameters for condition number and spectral gap:</p><p>We also denote &#954; := &#8741;X&#8741; 2 /&#955; k . Dependence on K and &#951; are necessary to reduce Problem 6.11 to spectral sampling. If K = poly(n), then &#955; k = Tr(X &#8224; X)/ poly(n), so distinguishing &#955; k from &#955; k+1 necessarily takes poly(n) samples, and even sampling &#955; k once takes poly(n) samples. As a result, learning v k is also impossible. A straightforward coupon collector argument (given e.g. by Tang <ref type="bibr">[Tan21]</ref>) shows that Problem 6.11 can be solved by a quantum algorithm performing spectral sampling<ref type="foot">foot_13</ref> , with runtime depending polynomially on K and 1 &#951; . We omit this argument for brevity.</p><p>Classically, we can solve this PCA problem with quantum-inspired techniques, as first noted in <ref type="bibr">[Tan21]</ref>.</p><p>Corollary 6.12. For 0 &lt; &#949; &#8818; &#951;&#8741;X&#8741; 2 /&#8741;X&#8741; 2 F , we can solve Problem 6.11 in &#732;&#65025; O (&#65026;</p><p>This improves significantly over prior work <ref type="bibr">[Tan21,</ref><ref type="bibr">Theorem 8]</ref>, which achieves the runtime of</p><p>. 19 The best quantum algorithm for this problem runs in &#732;&#65025; O (&#65026;</p><p>We approach the problem as follows. First, we use that an importance-sampled submatrix of X has approximately the same singular values as X itself (Lemma 4.9) to get our estimates {&#955; &#710;i} k i=1 . With these estimates, we can define smoothened step functions</p><p>We can then use our main theorem to find an RUR decomposition for f i (X &#8224; X). We use additional properties of the RUR description to argue that it is indeed a rank-1 outer product v &#710; &#8224; i v &#710;i, which is our desired approximation for the eigenvector. We have sampling and query access to v &#710;i because it is R &#8224; x for some vector x. Our runtime is quite good because these piecewise linear step functions have relatively tame derivatives, as opposed to the thresholded inverse function, whose Lipschitz constants must incur quadratic and cubic overheads in terms of condition number.</p><p>Proof. We will assume that we know &#955; k and &#951;. If both are unknown, then we can estimate them with the singular value estimation procedure described below (Lemma 4.9).</p><p>Notice that &#951;&#8741;X&#8741; 2 &#8804; &#955; k follows from our definition of &#951;. The algorithm will proceed as follows: first, consider C := SXT &#8712; C c&#215;r as described in Theorem 5.1, with parameters</p><p>Consider computing the eigenvalues of CC &#8224; ; denote the i th eigenvalue &#955; &#710;i. Since r, c = &#8486;(</p><p>, by Lemma 4.9 with error parameter &#949;</p><p>These &#955; &#710;i's for i &#8712; [k] have the desired property for eigenvalue estimates:</p><p>19 This runtime comes from taking &#949;&#963; = &#949;v = &#949; and changing the normalization of the gap parameter &#951; = &#951;&#8741;X&#8741; 2 /&#8741;X&#8741; 2 F to correspond to the problem as formulated here. 20 Given X in QRAM, this follows from applying Theorem 27 to a quantum state with density matrix of X &#8224; X with &#945; = &#8741;X&#8741;F and &#8710; = &#949;&#8741;X&#8741; 2 F &#8741;X&#8741; &#8818; &#951;&#8741;X&#8741; &#8741;X&#8741; F . The output is some estimate of &#8730; &#955;i to &#8710; error, which when squared is an estimate of &#955;i to &#8710;&#8741;X&#8741; = &#949;&#8741;X&#8741; 2 F error as desired. Then, the density matrix is a probability distribution over eigenvectors with their corresponding eigenvalue estimate (which is enough to identify the eigenvector). The coupon collector argument mentioned above gives us access to all the top k eigenvalues and eigenvectors by running this algorithm &#8741;X&#8741; 2 F /&#955; k times <ref type="bibr">[Tan21]</ref>.</p><p>This bound also implies that, for all i, |&#955; &#710;i -</p><p>This is a function that is one when |x-&#955; &#710;i| &#8804; 1 8 &#951;&#8741;X&#8741; 2 , zero when |x-&#955; &#710;i| &#8805; 1 4 &#951;&#8741;X&#8741; 2 , and interpolates between them otherwise. From the eigenvalue gap and the aforementioned bound</p><p>i exactly. Further, by Theorem 5.1, we can conclude that</p><p>i , with C, R the exact approximations used to estimate singular values. The conditions of Theorem 5.1 are satisfied because &#949; &#8818; 8 &#8804; 8 &#951; = L&#8741;X&#8741; 2 for L the Lipschitz constant of f i . The values of r, c are chosen so that</p><p>Further, f i is chosen with respect to &#955; &#710;i such that R &#8224; f &#175;i(CC &#8224; )R is rank one, since CC &#8224; has one eigenvalue between &#955; &#710;i -1 4 &#951;&#8741;X&#8741; 2 and &#955; &#710;i + 1 4 &#951;&#8741;X&#8741; 2 . Thus, this approximation is an outer product, R &#8224; f &#175;i(CC &#8224; )R = v &#710;iv &#710; &#8224; i , and we take the corresponding vector to be our eigenvector estimate:</p><p>which is the desired bound. By choosing failure probability &#948;/k, the bound can hold true for all k with probability &#8805; 1 -&#948;. Finally, we can get access to</p><p>i , using Lemmas 3.5 and 3.6, we have SQ &#981; (v &#710;i) with</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.5">Matrix inversion and principal component regression</head><p>The low-rank matrix inversion algorithms given by Gily&#233;n, Lloyd, and Tang <ref type="bibr">[GLT18]</ref> and Chia, Lin, and Wang <ref type="bibr">[CLW18]</ref> dequantize Harrow, Hassidim, and Lloyd's quantum matrix inversion algorithm (HHL) <ref type="bibr">[HHL09]</ref> in the regime where the input matrix is low-rank instead of sparse. The corresponding quantum algorithm in this regime is given by Chakraborty, Gily&#233;n, and Jeffery <ref type="bibr">[CGJ19]</ref>, among others. Since sparse matrix inversion is BQP-complete, it is unlikely that one can efficiently dequantize it. However, the variant of low-rank (non-sparse) matrix inversion appears often in quantum machine learning [Pra14, WZP18, RML14, CD16, RL18], making it an influential primitive in its own right.</p><p>Using our framework, we can elegantly derive the low-rank matrix inversion algorithm in a manner similar to prior quantum-inspired work <ref type="bibr">[GLT18,</ref><ref type="bibr">CLW18]</ref>. Moreover, we can also handle the approximately low-rank regime and only invert the matrix on a well-conditioned subspace, solving principal component regression-for more discussion see <ref type="bibr">[GSLW19]</ref>. Namely, we can find a thresholded pseudoinverse of an input matrix: Definition 6. <ref type="figure">13 (A +</ref> &#963;,&#951; ). We define A + &#963;,&#951; to be any singular value transform of A satisfying:</p><p>This definition is analogous to A &#963;,&#951; in Section 6.2: it is A + for singular vectors with value &#8805; &#963;, zero for singular vectors with value &#8804; &#963;(1 -&#951;), and a linear interpolation between the two in between.</p><p>Problem 6.14. Given SQ &#966; (A) &#8712; C m&#215;n , Q(b) &#8712; C m , with probability &#8805; 1 -&#948;, get SQ &#981; (x &#710;) such that &#8741;x &#710;-x * &#8741; &#8804; &#949;&#8741;A&#8741; -1 &#8741;b&#8741;, where x * := A + &#963;,&#951; b.</p><p>Corollary 6.15. For 0 &lt; &#949; &#8818; &#8741;A&#8741; 2 &#963; 2 and &#951; &#8804; 0.99, we can solve Problem 6.14 in &#732;&#65025; O (&#65026;</p><p>This should be compared to <ref type="bibr">[GLT18]</ref>, which applies only to strictly rank-k A with &#966; = 1 and gets the incomparable runtime of &#732;&#65025; O (&#65026;</p><p>. The corresponding quantum algorithm using block-encodings takes O(&#8741;A&#8741; F /&#963;) time, up to polylog(m, n) factors, to get this result for constant &#951; [GSLW19, Theorem 41].</p><p>If we further assume that &#949; &lt; 0.99 and b is in the image of A, then &#732;&#65026; sq &#981; (x &#710;) can be simplified,</p><p>However, this algorithm also works for larger &#949;; namely, if we only require that &#8741;x &#710;-x * &#8741; &#8804; &#949;&#963; -1 &#8741;b&#8741; (a "worst-case" error bound), then this algorithm works with runtime smaller by a factor of &#954; 3 (and &#732;&#65026; sq &#981; (x &#710;) smaller by a factor of &#954;). The algorithm comes from rewriting A + &#963;,&#951; b = &#953;(A &#8224; A)A &#8224; b for &#953; a function encoding a thresholded inverse. Namely, &#953;(x) = 1/x for x &#8805; &#963; 2 , &#953;(x) = 0 for x &#8804; (1 -&#951;) 2 &#963; 2 , and is a linear interpolation between the endpoints for x &#8712; [(1 -&#951;) 2 &#963; 2 , &#963; 2 ]. By our main theorem, we can find an RUR decomposition for &#953;(A &#8224; A), from which we can then get SQ(R &#8224; U RA &#8224; b) via sampling techniques.</p><p>Proof. We will solve our problem for</p><p>By Theorem 5.1 with L = 1 (2&#951;-&#951; 2 )&#963; 4 and L &#175;= 1 (1-&#951;) 2 (2&#951;-&#951; 2 )&#963; 6 , we can find such R and C with</p><p>Computing the SVD of a matrix of this size dominates the runtime, giving the complexity in the theorem statement. Next, we would like to further approximate R &#8224; &#953; &#175;(CC &#8224; )RA &#8224; b. We will do this by estimating RA &#8224; b by some vector u to &#949;&#963; 3 &#8741;A&#8741; -1 &#8741;b&#8741; = &#949;&#8741;A&#8741; 2 F &#8741;b&#8741;K -1 &#954; -1 2 error, since then, using the bounds from Lemma 5.2,</p><p>We use Remark 4.13 to estimate</p><p>samples for each of the r entries. This implies that x &#710;:= R &#8224; &#953; &#175;(CC &#8224; )u has the desired error and failure probability. Finally, we can use Lemmas 3.5 and 3.6 with matrix R &#8224; and vector &#953; &#175;(CC &#8224; )u to get SQ &#981; (x &#710;) for</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.6">Support vector machines</head><p>In this section, we use our framework to dequantize Rebentrost, Mohseni, and Lloyd's quantum support vector machine <ref type="bibr">[RML14]</ref>, which was previously noted to be possible by Ding, Bao, and</p><p>Huang <ref type="bibr">[DBH21]</ref>. Mathematically, the support vector machine is a simple machine learning model attempting to label points in R m as +1 or -1. Given input data points x 1 , . . . , x m &#8712; R n and their corresponding labels y &#8712; {&#177;1} m . Let w &#8712; R n and b &#8712; R be the specification of hyperplanes separating these points. It is possible that no such hyperplane satisfies all the constraints. To resolve this, we add a slack vector e &#8712; R m such that e(j) &#8805; 0 for j &#8712; [m]. We want to minimize the squared norm of the residuals:</p><p>The dual of this problem is to maximize over the Karush-Kuhn-Tucker multipliers of a Lagrange function, taking partial derivatives of which yields the linear system</p><p>where 1 &#8407; is the all-ones vector and X = {x 1 , . . . , x m } &#8712; C m&#215;n . Call the above m + 1 &#215; m + 1 matrix F , and F &#710;:= F/ Tr(F ).</p><p>The quantum algorithm, given X and y in QRAM, outputs a quantum state |F &#710;+ &#955;,0.01</p><p>)&#65025; time. The quantum-inspired analogue is as follows.</p><p>Problem 6.16. Given SQ(X) &#8712; R m&#215;n and SQ(y</p><p>Note that we must assume &#8741;F &#710;&#8741; &#8804; 1; the quantum algorithm makes the same assumption<ref type="foot">foot_14</ref> . Another dequantization was reported in <ref type="bibr">[DBH21]</ref>, which, assuming X is strictly low-rank (with minimum singular value &#963;), outputs a description of (XX T ) + y that can be used to classify points. This can be done neatly in our framework: express (XX T ) + (or, more generally, (XX T ) + &#963;,&#951; ) as Xf (X T X)X T for the appropriate choice of f . Then, use Theorem 5.1 to approximate f (X T X) &#8776; R T ZR and use Lemma 4.4 to approximate XR T &#8776; CW T . This gives an approximate "CUC" decomposition of the desired matrix, since Xf (X T X)X T &#8776; XR T ZRX T &#8776; CW T ZW C T , which we can use for whatever purpose we like.</p><p>For our solution to Problem 6.16, though, we simply reduce to matrix inversion as described in Section 6.5: we first get SQ &#981; (F &#710;), and then we apply Corollary 6.15 to complete. Section VI.C of <ref type="bibr">[DBH21]</ref> claims to dequantize this version, but gives no correctness bounds<ref type="foot">foot_15</ref> or runtime bounds (beyond arguing it is polynomial in the desired parameters). Corollary 6.17. For 0 &lt; &#949; &#8818; 1 and &#951; &#8804; 0.99, we can solve Problem 6.16 in</p><p>time, where we get</p><p>)&#65025; .</p><p>The runtimes in the statement are not particularly tight, but we chose the form to mirror the runtime of the QSVM algorithm, which similarly depends polynomially on 1 &#955; and 1 &#951; .</p><p>Proof. Consider constructing SQ &#966; (K) &#8712; C m&#215;m as follows. To query an entry K(i, j), we estimate X(i, &#8226;)X(j, &#8226;) T to &#949;&#8741;X(i, &#8226;)&#8741;&#8741;X(j, &#8226;)&#8741; error. We define K(i, j) to be this estimate. Using Lemma 4.12, we can do this in O (&#65025; 1 &#949; 2 log q &#948; )&#65025; time. q here refers to the number of times the query oracle is used, so in total the subsequent algorithm will only have an errant query with probability &#8805; 1 -&#948;. (q will not appear in the runtime because it's folded into a polylog term.) Then, we can take K &#732;:= xx T , where x &#8712; R m is the vector of row norms of X, since by Cauchy-Schwarz,</p><p>Since we have SQ(x) from SQ(X), we have SQ(K &#732;) with sq(K &#732;) = O(1) by Lemma 3.8. &#8741;K &#732;&#8741;2</p><p>. We can trivially get SQ(L) for L := [&#65025; 0 1</p><p>with sq(L) = O(1). Our approximation to F &#710;is</p><p>Using Lemma 3.9, we have SQ &#966; &#8242; (M ) with</p><p>where the last inequality uses that Tr(F ) &#8805; &#8730; m, which follows from &#8741;F &#710;&#8741; &#8804; 1:</p><p>.</p><p>Note that we can compute Tr(F ) given SQ(X). So, applying Corollary 6.15, we can get the desired SQ &#981; (v) in runtime</p><p>Here, we used that &#8741;M &#8741; &#8804; &#8741;M &#8741; F &#8818; 1, which we know since &#966; &#8242; &#8805; 1 (by our definition of oversampling and query access). That Q</p><p>does not affect the runtime, since the dominating cost is still the SVD. On the other hand, this does come into play for the runtime for sampling:</p><p>We take q = m to guarantee that all future queries will be correct with probability &#8805; 1 -&#948;.</p><p>The normalization used by the quantum and quantum-inspired SVM algorithms means that these algorithms fail when X has too small Frobenius norm, since then the singular values from XX T are all filtered out. In Appendix B, we describe an alternative method that relies less on normalization assumptions, instead simply computing F + . This is possible if we depend on &#8741;X&#8741; 2 F &#947; in the runtime. Recall from Eq. ( <ref type="formula">12</ref>) that we regularize by adding &#947; -1 I, so &#947; -1 acts as a singular value lower bound and &#8741;X&#8741; 2 F &#947; implicitly constrains. Corollary 6.18. Given SQ(X T ) and SQ(y), with probability &#8805; 1 -&#948;, we can output a real number b &#710;such that |b -b &#710;| &#8804; &#949;(1 + b) and SQ &#981; (&#945; &#710;) such that &#8741;&#945; &#710;-&#945;&#8741; &#8804; &#949;&#947;&#8741;y&#8741;, where &#945; and b come from Eq. (12). Our algorithm runs in &#732;&#65025;</p><p>. Note that when &#947; -1/2 is chosen to be sufficiently large (e.g. O(&#8741;X&#8741; F )) and &#8741;&#945;&#8741; = &#8486;(&#947;&#8741;y&#8741;), this runtime is dimension-independent.</p><p>Notice that &#949;&#947;&#8741;y&#8741; is the right notion, since &#947; is an upper bound on the spectral norm of the inverse of the matrix in Eq. ( <ref type="formula">12</ref>). We assume SQ(X T ) instead of SQ(X) for convenience, though both are possible via the observation that f (XX T ) = Xf &#175;(X T X)X T .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.7">Hamiltonian simulation</head><p>The problem of simulating the dynamics of quantum systems was the original motivation for quantum computers proposed by Feynman <ref type="bibr">[Fey82]</ref>. Specifically, given a Hamiltonian H, a quantum state |&#968;&#10217;, a time t &gt; 0, and a desired error &#949; &gt; 0, we ask to prepare a quantum state |&#968; t &#10217; such that</p><p>This problem, known as Hamiltonian simulation, sees wide application, including in quantum physics and quantum chemistry. A rich literature has developed on quantum algorithms for Hamiltonian simulation [Llo96, ATS03, BCK15], with an optimal quantum algorithm for simulating sparse Hamiltonians given in <ref type="bibr">[LC17]</ref>. In this subsection, we apply our framework to develop classical algorithms for Hamiltonian simulation. Specifically, we ask: Problem 6.19. Consider a Hermitian matrix H &#8712; C n&#215;n , a unit vector b &#8712; C n , and error parameters &#949;, &#948; &gt; 0. Given SQ(H) and SQ(b), output SQ &#981; (b &#710;) with probability &#8805; 1 -&#948; for some b &#710;&#8712; C n satisfying &#8741;b &#710;e iH b&#8741; &#8804; &#949;.</p><p>We give two algorithms that are fundamentally the same, but operate in different regimes: the first works for low-rank H, and the second for arbitrary H. Corollary 6.20. Suppose H has minimum singular value &#963; and &#949; &lt; min(0.5, &#963;). We can solve Problem 6.19 in &#732;&#65025; O (&#65026;</p><p>This runtime is dimensionless in a certain sense. The natural error bound to require is that &#8741;b &#710;e iH b&#8741; &#8804; &#949;&#8741;H&#8741;, since</p><p>, which is dimensionless. The runtime of the algorithm in the following corollary does not have this property, so its scaling with &#8741;H&#8741; is worse, despite being faster for, say, &#8741;H&#8741; = 1. Corollary 6.21. For &#949; &lt; min(0.5, &#8741;H&#8741; 3 ), we can solve Problem 6.19 in &#732;&#65025; O (&#65025;</p><p>Our strategy proceeds as follows: consider a generic function f (x) and Hermitian H. We can write f (x) as a sum of an even function a(x) := 1 2 (f (x) + f (-x)) and an odd function b(x) := 1 2 (f (x) -f (-x)). For the even function, we can use Theorem 5.1 to approximate it via the function f a (x) := a( &#8730; x); the odd function can be written as H times an even function, which we approximate using Theorem 5.1 for</p><p>the Lipschitz constants don't blow up by splitting f into even and odd parts. Now, we specialize to Hamiltonian simulation. We first rewrite the problem, using the function sinc(x) := sin(x)/x.</p><p>where f cos (&#955;) := cos( &#8730; &#955;) and f sinc (&#955;) := i &#8226; sinc( &#8730; &#955;). When applying Theorem 5.1 on f cos and f sinc , we will use the following bounds on the smoothness of f cos and f sinc .</p><p>We separate these bounds into the case where x &#8805; 1, which we use when we assume H has a minimum singular value, and the case where x &lt; 1, which we use for arbitrary H.</p><p>Proof of Corollary 6.21. Using the Lipschitz bounds above with Theorem 5.1, we can find</p><p>where, using that our Lipschitz constants are all bounded by constants,</p><p>As a consequence,</p><p>Note that, by Lemma 5.2, &#8741;R cos &#8741; &#8818; &#8741;H&#8741;, &#8741;f &#175;cos (C cos C &#8224; cos )&#8741; &#8818; 1, and &#8741;R &#8224; cos &#8730;&#65026; f &#175;cos (C cos C &#8224; cos )&#8741; &#8818; 1; the same bounds hold for the sinc analogues. We now approximate using Lemma 4.6 four times.</p><p>4. We approximate Hb &#8776; R &#8224; w to &#949;&#8741;b&#8741; accuracy, requiring r</p><p>Our output will be b</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Now, we have expressed b</head><p>&#710;as a linear combination of a small number of vectors, all of which we have sampling and query access to. We can complete using Lemmas 3.5 and 3.6, where the matrix is the concatenation</p><p>, and the vector is the concatenation</p><p>. The length of this vector is r cos + 1 + r sinc + r &#8818; r sinc . We get SQ &#981; (b &#710;) where</p><p>In the second inequality, we use the same bounds for proving &#8741;b &#710;e iH b&#8741; &#8804; &#949;, repurposed to argue that all approximations are sufficiently close to the values they are estimating, up to relative error.</p><p>Proof of Corollary 6.20. Our approach is the same, though with different parameters. For Theorem 5.1, we use that in the interval [&#963; 2 /2, &#8734;), f cos has Lipschitz constants of L = O(1/&#963;) and L &#175;= O(1/&#963; 3 ) and f sinc has L = O(1/&#963; 2 ) and L &#175;= O(1/&#963; 4 ). So, if we take</p><p>all the conditions of Theorem 5.1 are satisfied: in particular, &#963; 2 /2 &gt; &#949; &#175;in both cases, up to rescaling &#949; by a constant factor:</p><p>Here, we used our initial assumption that &#949; &#8804; &#963;. So, the bounds Eqs. ( <ref type="formula">13</ref>) and ( <ref type="formula">14</ref>) hold. Note that, by Lemma 5.2, &#8741;R cos &#8741; &#8818; &#8741;H&#8741;, &#8741;f &#175;cos (C cos C &#8224; cos )&#8741; &#8818; &#963; -2 , and &#8741;R &#8224; cos &#8730;&#65026; f &#175;cos (C cos C &#8224; cos )&#8741; &#8804; 1; the same bounds hold for the sinc analogues. We now approximate using Lemma 4.6 four times.</p><p>4. We approximate Hb &#8776; R &#8224; w to &#949;&#8741;b&#8741; accuracy, requiring r</p><p>Our output will be</p><p>which is close to e iH b by the argument</p><p>Now, we have expressed b &#710;as a linear combination of a small number of vectors, all of which we have sampling and query access to. We can complete using Lemmas 3.5 and 3.6, where the matrix is the concatenation</p><p>, and the vector is the concatenation</p><p>. The length of this vector is r cos + 1 + r sinc + r &#8818; r sinc . We get SQ &#981; (b &#710;) where</p><p>. Since &#949; &lt; &#963;, the r 2 sinc term dominates.</p><p>Remark 6.22. In the case where H is not low-rank, we could still run a modified version of Corollary 6.20 to compute a modified "exp &#963;,&#951; (iH)" where singular values below &#963; are smoothly thresholded away. Following the same logic as Definition 6.13, we could redefine f cos such that f cos (x) = 1 for x &lt; &#963; 2 (1 -&#951;), f cos (x) = cos( &#8730; &#955;) for x &#8805; &#963; 2 , and is a linear interpolation between the endpoints for the x in between (and f sinc similarly). These functions have the same Lipschitz constants as their originals, up to factors of 1 &#951; , and give the desired behavior of "smoothing away" small singular values (though we do keep the 0th and 1st order terms of the exponential). Remark 6.23. Our result generalizes those of Ref. [RWC + 20], which achieves essentially the same result only in the much easier regime where H and b are sparse. They achieve a significant speedup due to these assumptions: note that when H is sparse, and a subsample of rows R is taken, RR &#8224; can be computed in time independent of dimension; so, we only need to take a subsample of rows, and not of columns. More corners can be cut from our algorithm in this fashion. In summary, though our algorithm is significantly slower, their sparsity assumptions are essential for their fast runtime, and our framework can identify where these tradeoffs occur.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.8">Semidefinite program solving</head><p>A recent line of inquiry in quantum computing [BS17, vAGGdW20, BKL + 19, vAG19] focuses on finding quantum speedups for semidefinite programs (SDPs), a central topic in the theory of convex optimization with applications in algorithms design, operations research, and approximation algorithms. Chia, Li, Lin, and Wang <ref type="bibr">[CLLW20]</ref> first noticed that quantum-inspired algorithms could dequantize these quantum algorithms in certain regimes. We improve on their result, giving an algorithm which is as general as the quantum algorithms, if the input is given classically (e.g., in a data-structure in RAM). Our goal is to solve the &#949;-feasibility problem; solving an SDP reduces by binary search to solving log(1/&#949;) instances of this feasibility problem. Problem 6.24 (SDP &#949;-feasibility). Given an &#949; &gt; 0, m real numbers b 1 , . . . , b m &#8712; R, and Hermitian n &#215; n matrices SQ(A (1) ), . . . , SQ(A (m) ) such that -I &#10927; A (i) &#10927; I for all i &#8712; [m], we define S &#949; as the set of all X satisfying<ref type="foot">foot_16</ref> </p><p>If S &#949; = &#8709;, output "infeasible". If S 0 &#824; = &#8709;, output an X &#8712; S &#949; . (If neither condition holds, either output is acceptable.) Corollary 6.25. Let F &#8805; max j&#8712;[m] (&#8741;A (j) &#8741; F ), and suppose<ref type="foot">foot_17</ref> F = &#8486;(1). Then we can solve Problem 6.24 with success probability &#8805; 1 -&#948; in cost</p><p>providing sampling and query access to a solution.</p><p>. For the same feasibility problem, the previous quantum-inspired SDP solver <ref type="bibr">[CLLW20]</ref> proved a complexity bound</p><p>, assuming that the constraint matrices have rank at most r. Since the rank constraint implies that</p><p>, under this assumption our algorithm has complexity</p><p>. So, our new algorithm both solves a more general problem and also greatly improves the runtime. The paper with the current best runtime for SDP solving does not discuss this precise model, but if we use the runtime they achieve in quantum state input model, making reasonable substitutions of &#947; &#8594; 1 &#949; and B &#8594; F 2 , the corresponding quantum runtime is &#732;&#65025; O (&#65026;</p><p>)&#65026; , up to polylog(n) factors. Like prior work on quantum algorithms for SDP-solving, we use the matrix multiplicative weights (MMW) framework <ref type="bibr">[AK16,</ref><ref type="bibr">Kal07]</ref> to solve Problem 6.24. Corollary 6.25 immediately follows from running the algorithm this framework admits (Algorithm 1), where we solve an instance of the problem described in Lemma 6.26 with precision &#952; = &#949;/4 in each of the O (&#65025; log(n)/&#949; 2 )&#65025; iterations. MMW works as a zero-sum game with two players, where the first player wants to provide an X &#8712; S &#949; , and the second player wants to find a violation for any proposed X, i.e., a j &#8712; [m] such that Tr[A (j) X] &gt; b j + &#949;. At the t th round of the game, if the second player points out a violation j t for the current solution X t , the first player proposes a new solution Our task is to execute Lines 3 and 4 of Algorithm 1, for an implicitly defined matrix with the form given in Line 6.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Solutions of this form are also known as</head><p>Algorithm 1: MMW based feasibility testing algorithm for SDPs 1 Set X 1 := In n , and the number of iterations T := 16 log n &#949; 2 ; 2 for t = 1, . . . , T do</p><p>else conclude that X t &#8712; S &#949; 8 return X t 9 end 10 If no solution found, conclude that the SDP is infeasible and terminate the algorithm Lemma 6.26 ("Efficient" trace estimation). Consider the setting described in Corollary 6.25. Given &#952; &#8712; (0, 1], t &#8804; log(n)</p><p>where sq(A) = max j&#8712;[m] sq(A (j) ), and s(A), q(A), n(A) are defined analogously.</p><p>To estimate Tr[A (i) H], we first notice that we have SQ &#981; (&#952; &#8721;&#65025; t i=1 A (j i ) ), since it is a linear combination of matrices that we have sampling and query access to (Lemma 3.9). Then, we can find approximations of the Gibbs state by applying eigenvalue transformation (Theorem 7.2) according to the exponential function to get exp[-&#952; &#8721;&#65025; t i=1 A (j i ) ] as an RUR decomposition. Then the estimation of Tr[A (i) H] can be performed by usual techniques (namely, Remark 4.13).</p><p>In order to understand how precisely we need to approximate the matrix in Line 6 we prove the following lemmas. Our first lemma will show that, to estimate Tr(A (i) H)/ Tr(H) to &#952; precision, it suffices to estimate both Tr(A (i) H) and Tr(H) to 1 3 &#952; Tr(H) precision.</p><p>Lemma 6.27. Suppose that &#952; &#8712; [0, 1] and a, a &#732;, Z, Z &#732;are such that |a| &#8804; Z, |a -a &#732;| &#8804; &#952; 3 Z, and</p><p>Next, we will prove that the approximations we will use to Tr(A (i) H) and Tr(H) suffice. We introduce some useful properties of matrix norms. For a matrix A &#8712; C m&#215;n and p &#8712; [1, &#8734;], we denote by &#8741;A&#8741; p the Schatten p-norm, which is the &#8467; p -norm of the singular values ( &#8721;&#65025; i &#963; p i (A)) 1/p . In particular, &#8741;A&#8741; F = &#8741;A&#8741; 2 and &#8741;A&#8741; Op = &#8741;A&#8741; &#8734; . We recall some useful inequalities [Bha97, Section IV.2]. H&#246;lder's inequality states that for all B &#8712; C n&#215;k and r, p, q &#8712; (0, &#8734;] such that 1 p + 1 q = 1 r , we have &#8741;AB&#8741; r &#8804; &#8741;A&#8741; p &#8741;B&#8741; q . The trace-norm inequality states that if n = m, then |Tr(A)| &#8804; &#8741;A&#8741; 1 . Proof. First, recall that, by Lemma 2.5, there is unitary U such that &#8741; &#732;&#65025; U -U &#8741; &#8804; &#948;. Consequently, also using facts from Lemma 2.5, along with bounds on &#948;, Now we are ready to devise our upper bound on the trace estimation subroutine.</p><p>Proof of Lemma 6.26. By Lemma 6.27, it suffices to find estimates of Tr(e H ) and Tr(Ae H ) for all A = A (i) , to &#952; 3 Tr(e H ) additive precision. Recall from the statement that H := -&#952; &#8721;&#65025; t i=1 A (j i ) . By triangle inequality, &#8741;H&#8741; F &#8804; F &#952; log(n). Because H is a linear combination of matrices, by Lemma 3.9, after paying log(n) &#952; 2 n(A) cost, we can obtain SQ &#981; (H) for &#981; &#8804; F 2 log 2 (n)</p><p>&#952; 2 q(A) and s &#981; (H) = s(A).  </p><p>&#8730; n, so Tr(A (i) e H )/ Tr(e H ) &#8804; e 2 F/ &#8730; n &#8804; &#952;, and outputting 0 as estimates is acceptable. We use Theorem 7.2 (with f (x) = x, so that L = 1, and choosing &#949; := &#920;(&#952;)) to find a diagonal matrix</p><p>together with an approximate isome-</p><p>If every diagonal element is less than 3/4, then we conclude that &#8741;H&#8741; &#8804; 1, and return 0. Otherwise we have &#8741;H&#8741; &#8805; 1/2 and thus by Theorem 7.2 we have  Tr(e H )). Note that by Lemma 6.29 and Eq. (15) we have</p><p>and since s = &#732;&#65025; O (&#65025; F 6 &#952; -12 log 6 (n) log(1/&#948;) )&#65025; and q(H) &#8804; log(n) &#952; 2 q(A), we also have</p><p>Therefore, Remark 4.13 tells us that given SQ(A), a ( &#952; 9 Tr(e H ))-approximation of Tr(A &#732;&#65025; U &#8224; (e D -I) &#732;&#65025; U ) can be computed with success probability at least 1 -&#948; 2m in time</p><p>)&#65027; .</p><p>Since we do this for all i &#8712; [m], the overall complexity of obtaining the desired estimates Tr(A (i) e H ) with success probability at least 1 -&#948; 2 is m times</p><p>)&#65027; .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.9">Discriminant analysis</head><p>Discriminant analysis is used for dimensionality reduction and classification over large data sets.</p><p>Cong and Duan introduced a quantum algorithm to perform both with Fisher's linear discriminant analysis <ref type="bibr">[CD16]</ref>, a generalization of principal component analysis to data separated into classes. The problem is as follows: given classified data, we wish to project our data onto a subspace that best explains between-class variance, while minimizing within-class variance. Suppose there are M input data points {x i &#8712; R N : 1 &#8804; i &#8804; M } each belonging to one of k classes. Let &#181; c denote the centroid (mean) of class c &#8712; [k], and x &#175;denote the centroid of all data points. Following the notation of <ref type="bibr">[CD16]</ref>, let</p><p>denote the between-class and within-class scatter matrices of the dataset respectively. The original goal is to solve the generalized eigenvalue problem S B v i = &#955; i S W v i and output the top eigenvalues and eigenvectors; for dimensionality reduction using linear discriminant analysis, we would project onto these top eigenvectors. If S W would be full-rank, this problem would be equivalent to finding the eigenvalues of S -1 W S B . However, this does not happen in general, and therefore various relaxations are considered in the literature <ref type="bibr">[BHK97,</ref><ref type="bibr">Wel09]</ref>. For example, Welling <ref type="bibr">[Wel09]</ref> considers the eigenvalue problem of</p><p>Cong and Duan further relax the problem, as they ignore small eigenvalues of S W and S B , and only compute approximate eigenvalues of Eq. (19) (after truncating eigenvalues), leading to inexact eigenvectors. We construct a classical analogue of their quantum algorithm. <ref type="foot">26</ref> Cong and Duan also describe a quantum algorithm for discriminant analysis classification; this algorithm does a matrix inversion procedure very similar to those described in Section 6.5 and Section 6.6, so for brevity we will skip dequantizing this algorithm.</p><p>To formally analyze this algorithm, we could, as in Section 6.4, assume the existence of an eigenvalue gap, so the eigenvectors are well-conditioned. However, let us instead use a different convention: if we can find diagonal D and an approximate isometry U such that S</p><p>B U &#8776; U D, then we say we have found approximate eigenvalues and eigenvectors of S + W S B . Problem 6.30 (Linear discriminant analysis). Consider the functions </p><p>We prove this by using Theorem 5.1 to approximate sqrt( </p><p>Finding eigenvectors from an RUR decomposition follows from an observation (Lemma 4.14): for a matrix C W formed by sampling columns from R W (using SQ(W )), and [C W ] k the rank-k approximation to C W (which can be computed because C W has size independent of dimension), (([C W ] k ) + R W ) &#8224; has singular values either close to zero or close to one. This roughly formalizes the intuition of C W preserving the left singular vectors and singular values of R W . We can rewrite</p><p>which holds by choosing k sufficiently large and choosing C to be the same sketch used for U . Then, we can compute the eigendecomposition of the center</p><p>V is an approximate isometry, so we choose its columns to be our eigenvectors, and our eigenvalues are the diagonal entries of D. We show that this has the approximation properties analogous to the quantum algorithm.</p><p>. These approximations suffice for us:</p><p>each of which is bounded by &#949;&#8741;B&#8741; 2 /&#963; 2 . Next, we approximate</p><p>and so</p><p>By Lemma 4.14, ([</p><p>&#8224; is an &#949;&#963;/&#8741;B&#8741;-approximate projective isometry 28 onto the image of</p><p>(where we use that &#949; &lt; &#963;/&#8741;B&#8741;). To turn this approximate projective isometry into an isometry, we compute the eigendecomposition</p><p>-and thus is an &#949;&#963;/&#8741;B&#8741;-approximate isometry. So, our eigenvectors are U and our eigenvalues are D := &#931;. This satisfies the desired bounds because</p><p>28 We get more than we need here: an &#949;-approximate projective isometry would suffice for the subsequent arguments.</p><p>The eigenvalues are correct because, by the approximate isometry condition, &#8741;U -U &#732;&#8741; &#8818; &#949; &#963; &#8741;B&#8741; for U &#227;n isometry, and so we can use Lemma 2.5 to conclude</p><p>U &#732;DU &#732; &#8224; is an eigendecomposition. Furthermore, this is an approximation of a Hermitian PSD matrices, where singular value error bounds align with eigenvalue error bounds. So, Weyl's inequality (Lemma 4.11) implies the desired bound |D ii -&#955; i | &#8818; &#949; &#8741;B&#8741; 2 &#963; 2 for &#955; i the true eigenvalues. We have SQ &#981; (U (&#8226;, i)) by Lemmas 3.5 and 3.6, since U (</p><p>This gives the stated runtime.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7">More singular value transformation</head><p>In this section, we present more general versions of our algorithm for even SVT to get results for generic SVT (Theorem 7.1) and eigenvalue transformation (Theorem 7.2). In applications we mainly use even SVT to allow for more fine-tuned control over runtime, but we do use eigenvalue transformation in Section 6.8. For generic SVT: consider a matrix A &#8712; C m&#215;n and a function f : [0, &#8734;) &#8594; C satisfying f (0) = 0 (so the singular value transformation f (SV) (A) is well-defined as in Definition 2.1). Given SQ(A) and SQ(A &#8224; ), we give an algorithm to output a CUR decomposition approximating f (SV) (A).</p><p>Theorem 7.1 (Generic singular value transformation). Let A &#8712; C m&#215;n be given with both SQ &#981; (A) and SQ &#981; (A &#8224; ) and let f : [0, &#8734;) &#8594; C be a function such that f (0) = 0, g(x) := f ( &#8730; x)/ &#8730; x is L-Lipschitz, and g &#175;(x) := (g(x) -g(0))/x is L &#175;-Lipschitz. Then, for 0 &lt; &#949; &#8804; min(L&#8741;A&#8741; 3 , L &#175;&#8741;A&#8741; 5 ), we can output sketches R := SA &#8712; C r&#215;n and C := AT &#8712; C m&#215;c , along with M &#8712; C r&#215;c such that</p><p>. Finding S, M , and T takes time</p><p>If we only wish to assume SQ &#981; (A), we can do so by using Lemma 4.4 instead of Lemma 4.6 in our proof, paying an additional factor of 1 &#948; . Note that if sq &#981; (A), sq &#981; (A &#8224; ) = O(1), then this runtime is dominated by the last term. Moreover, if A is strictly low-rank, with minimum singular value &#963;, or essentially equivalently, if f (x) = 0 for x &#8804; &#963; and so g(x) = 0 for x &#8804; &#963; 2 , then L &#8804; &#8467;/&#963; 2 and L &#175;= 2&#8467;/&#963; 4 for &#8467; the Lipschitz constant of f . In this case the complexity is</p><p>)&#65026;(&#65026; &#8467;&#8741;A&#8741; &#949;</p><p>Importantly, when &#949; = O(&#8467;&#8741;A&#8741;) (that is, if we want relative error), this runtime is independent of dimension. If one desires greater generality, where we only need to depend on the Lipschitz constant of f , we can use a simple trick: as we aim for a spectral norm bound, we can essentially treat A as if it had strictly low rank. Consider the variant of f , f &#8805;&#963; , which is zero below &#963;/2, f above &#963;, and is a linear interpolation in between.</p><p>Further, the Lipschitz constant of f &#8805;&#949;/&#8467; is at most 2&#8467;: the slope of the linear interpolation is 2f (&#963;)/&#963; &#8804; 2&#8467;&#963;/&#963;. So, we can run our algorithm for arbitrary &#8467;-Lipschitz f in the time given by Eq. ( <ref type="formula">20</ref>), with &#963; = &#949;/&#8467;.</p><p>Our proof strategy is to apply our main result Theorem 5.1 to g(A &#8224; A), for g(x) := f ( &#8730; x)/ &#8730; x, and subsequently approximate matrix products with Lemma 4.6 to get an approximation of the form A &#8242; R &#8242; &#8224; U R + g(0)A:</p><p>Here, A &#8242; R &#8242; &#8224; U R is a CUR decomposition as desired, since A &#8242; is a normalized subset of columns of A. One could further approximate g(0)A by a CUR decomposition if necessary (e.g. by adapting the eigenvalue transformation result below).</p><p>We do not use this theorem in our applications. Sometimes we implicitly use a similar strategy (e.g. in Section 6.5), but because we apply our matrix to a vector (f (A &#8224; )b) we can use Lemma 4.12 instead of Lemma 4.6 when approximating. This allows for the algorithm to work with only SQ &#981; (A) and still achieve a poly-logarithmic dependence on 1 &#948; .</p><p>Proof. If we want to compute f &#710;(SV) (A), we can work with f (x) := f &#710;(x) -g(0)x, so that g(0) = 0 without loss of generality. Notice that f &#710;(SV) (A) = f (SV) (A)+g(0)A, so if we get a CUR decomposition for f (SV) (A) we can add g(0)A after to get the decomposition in the theorem statement. Consider the SVT g(x)</p><p>Second, use Lemma 4.6 to get a sketch T &#8242; &#8224; &#8712; C c &#8242; &#215;n such that, with probability &#8805; 1 -&#948;/4,</p><p>The choices of parameters necessary are as follows (using that &#8741;SA&#8741; F = O(&#8741;A&#8741; F ) by Eq. ( <ref type="formula">5</ref>) and we have a 2&#981;-oversampled distribution for (SA) &#8224; by Lemma 4.3):</p><p>This implies the desired bound through the following sequence of approximations:</p><p>This gives us a CUR decomposition of f (SV) (A). These two approximations only incur O(&#949;) error in spectral norm; for the first, notice that</p><p>(by ( <ref type="formula">21</ref>))</p><p>For the second approximation observe that |g(x)| &#8804; L|x| (and, by corollary, g &#175;(x) &#8804; L) due to g being L-Lipschitz and g(0) = 0, therefore</p><p>The time complexity of this procedure is</p><p>which comes from producing sketches, querying all the relevant entries of SAT and SAT &#8242; , the singular value transformation of SAT , and the matrix multiplication in M . We get r factors in the latter two terms because we can separate g &#175;((SAT )(SAT )</p><p>As for eigenvalue transformation, consider a function f : R &#8594; C and a Hermitian matrix</p><p>, so we can use Theorem 5.1 to compute the eigenvalue transform f (A). For non-even f , we cannot use this result, and present the following algorithm to compute it. Theorem 7.2 (Eigenvalue transformation). Suppose we are given a Hermitian SQ &#981; (A) &#8712; C n&#215;n with eigenvalues &#955;</p><p>L , and some &#949; &#8712; (0, L&#8741;A&#8741;/2]. Then we can output matrices S &#8712; C r&#215;n , N &#8712; C s&#215;r , and</p><p>Moreover, this decomposition satisfies the following two properties. First, N SA is an approximate isometry:</p><p>Under the reasonable assumptions<ref type="foot">foot_21</ref> that sq(A) and &#981; are small (O(1), say) and &#949; &#8804; L&#8741;A&#8741; &#8741;A&#8741; &#8741;A&#8741; F , the complexity of this theorem is &#732;&#65025; O (&#65025; L 22 &#949; -22 &#8741;A&#8741; 16 &#8741;A&#8741; 6 F log 3 1 &#948; )&#65025; . We now outline our proof. Our strategy is similar to the one used for quantum-inspired semidefinite programming [CLLW20]: first we find the eigenvectors and eigenvalues of A and then apply f to the eigenvalues. Let &#960;(x) be a (smoothened) step function designed so it can zeroes out small eigenvalues of A (in particular, eigenvalues smaller than &#949;/ &#8730; 2L). Then</p><p>Here, C &#963; is the low-rank approximation of C formed by transforming C according to the "filter" function on x that is 0 for x &lt; &#963; and x otherwise. U &#710;:= C + &#963; R &#8712; C c&#215;n is an approximate isometry by Lemma 4.14. We are nearly done now: since the rest of the matrix expression,</p><p>consists of submatrices of A of size independent of n, we can directly compute its unitary eigendecomposition U DU &#8224; . This gives the approximate decomposition A &#8776; (U &#710;U )D(U &#710;U ) &#8224; , with U &#710;U and D acting as approximate eigenvectors and eigenvalues of A, respectively. An application of Lemma 5.4 shows that f (A) &#8776; (U &#710;U )f (D)(U &#710;U ) &#8224; in the desired sense. Therefore, our output approximation of f (A) comes in the form of an RUR decomposition that can be rewritten in the form of an approximate eigendecomposition. The only major difference between this proof sketch and the proof below is that we perform our manipulations on the SVD of C &#963; , to save on computation time: note that the SVD can be made small in dimension, using that the rank of C &#963; is bounded by &#8741;C&#8741; 2 F /&#963; 2 .</p><p>Proof. Throughout this proof &#949; is not dimensionless; if choices of parameters are confusing, try replacing &#949; with &#949;&#8741;A&#8741;. We will take f (0) = 0 without loss of generality. First, consider the "smooth projection" singular value transformation</p><p>Since &#960; is a projector onto the large eigenvectors of A, we can add these projectors to our expression without incurring too much spectral norm error.</p><p>The necessary sizes for these bounds to hold are as follows (Lipschitz constants for &#960; are 2L 2 /&#949; 2 and 4L 4 /&#949; 4 , &#8741;SA&#8741; F = O(&#8741;A&#8741; F ) by Eq. ( <ref type="formula">5</ref>), and we have a 2&#981;-oversampled distribution for (SA) &#8224; by Lemma 4.3):</p><p>This approximation does not incur too much error:</p><p>Third, apply Remark 4.13(b) r 2 times to approximate each entry of RAR &#8224; : pull t samples from SQ &#981; (A) for t</p><p>)&#65026; such that, given some Q(x), Q(y), with probability &#8805; 1 -&#948; r 2 , one can output an estimate of x &#8224; Ay up to &#949; 3 &#8741;x&#8741;&#8741;y&#8741; L 3 &#8741;A&#8741; 2 F additive error with no additional queries to SQ &#981; (A). Then, by union bound, with probability &#8805; 1 -&#948;, using the same t samples from A each time, one can output an estimate of R(i, &#8226;)AR(j, &#8226;) &#8224; up to &#949; 3 &#8741;R(i,&#8226;)&#8741;&#8741;R(j,&#8226;)&#8741; L 3 &#8741;A&#8741; 2 F error for all i, j &#8712; [r] such that i &#8804; j. Let M be the matrix of these estimates. Then, using that &#8741;R&#8741; F = O(&#8741;A&#8741; F ) from Eq. (5),</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>&#8741;M -RAR</head><p>From Eqs. ( <ref type="formula">6</ref>) and (7),</p><p>So far, we have shown that we can find an RUR approximation to A, with</p><p>However, if we wish to apply an eigenvalue transformation to A, we need to access the eigenvalues of A as well. To do this, we will express this decomposition as an approximate unitary eigendecomposition.</p><p>Using that &#960; &#175;zeroes out singular values that are smaller than &#949; 2 2L 2 , we can write our expression as U &#710;D &#710;U &#710; &#8224;, for U &#710;&#8712; C n&#215;s and D &#710;&#8712; C s&#215;s :</p><p>Here, we are using an SVD of C truncated to ignore singular values smaller than &#949; &#8730; 2L , where </p><p>approximate isometry; we rescale &#949; until this is at most 1 2 . The rest of this error analysis will show that, since U &#710;is an approximate isometry, f (A) &#8776; U &#710;f (D &#710;)U &#710; &#8224; in the senses required for the theorem statement. Though D &#710;is not diagonal, since it is s&#215;s, we can compute its unitary eigendecomposition U (D &#710;)D (D &#710;)(U (D &#710;)) &#8224; ; so, we can take</p><p>) &#8224; to get the decomposition in the theorem statement. (Including the isometry (U (D &#710;)) &#8224; in our expression for U &#710;does not change the value of &#945;).</p><p>First, consider the eigenvalues of D &#710;. Note that &#8741;U &#710; &#8224;U &#710;-I&#8741; &#8804; &#945; since U &#710;is an &#945;-approximate isometry, and by Lemma 2.5, there exists an isometry U such that &#8741;U -U &#710;&#8741; &#8804; &#945;. We first observe that, using Lemma 2.5 and our bound on &#945;,</p><p>Consequently, by Weyl's inequality (Lemma 4.11), the eigenvalues of</p><p>and by assumption, f is L-Lipschitz on the spectrums of A and U D &#710;U . From this, we can conclude that we can compute estimates for the eigenvalues of f (A), since the eigenvalues of U D &#710;U &#8224; are the eigenvalues of D &#710;(padded with zero eigenvalues) which we know from our eigendecomposition of D &#710;Further, our estimates f (&#955; &#710;i) satisfy the desired bound |f (&#955; &#710;i) -f (&#955; i )| &#8804; &#949;. Finally, since f is Lipschitz on our spectrums of concern, the desired error bound for our approximation holds by the following computation (which uses Lemma 2.5 extensively): The complexity analysis takes some care: we want to compute our matrix expressions in the correct order. First, we will sample to get S and T , and then compute the truncated singular value decomposition of C := SAT , which we have denoted</p><p>&#8712; C c&#215;s . Then, we will perform the inner product estimation protocol r 2 times to get our estimate M &#8712; C r&#215;r , and compute the eigendecomposition of</p><p>) 2 )(U</p><p>) 2 )D ) + (U</p><p>By evaluating the expression for D &#710;from left-to-right, we only need to perform matrix multiplications that (naively) take s 3 or sr 2 time. The only cost of c we incur is in computing the SVD of C. The runtime is O (&#65025; (r + c + t)(s &#981; (A) + q &#981; (A)) + (rc + r 2 t) q(A) + s 3 + r 2 s + r 2 c + n &#981; (A) )&#65025; .</p><p>and has the same columnspace as X &#710;, and </p><p>, and consequently Let S &#8712; R r&#215;n be sampled according to p. Then X &#8224; S &#8224; SY is an unbiased estimator for X &#8224; Y and</p><p>Proof. Using that the rows of S are selected independently, we can conclude the following:</p><p>To prove concentration, we use McDiarmid's "independent bounded difference inequality" <ref type="bibr">[McD89]</ref>. )&#65026; .</p><p>To use Lemma B.1, we think about this expression as a function of the indices that are randomly chosen from p. That is, let f be the function [n] r &#8594; R defined to be</p><p>Then, by Jensen's inequality, we have</p><p>Now suppose that the index sequences i &#8407; and i &#8407; &#8242; only differ at the s-th position. Then by the triangle inequality, So, with probability &#8805; 1 -&#948;,  So, we just need to boost the quality of this random variable. Consider taking Z &#175;to be the mean of x := 8&#981;&#8741;u&#8741; 2 &#8741;v&#8741; 2 1 &#949; 2 independent copies of Z. Then, by Chebyshev's inequality (stated here for complex-valued random variables),</p><p>Next, we take the (component-wise) median of y := 8 log 1 &#948; independent copies of Z &#175;, which we call Z &#732;, to decrease failure probability. Consider the median of the real parts of Z &#175;. The key observation is that if &#8476;(Z &#732;-E[Z]) &#8805; &#949;/ &#8730; 2, then at least half of the Z &#175;'s satisfy &#8476;(Z &#175;-</p><p>2) be the characteristic function for this event for a particular mean. The above argument implies that Pr[E i ] &#8804; 1 4 . So, by Hoeffding's inequality, Pr</p><p>]&#65028; &#8804; exp(-q/8) &#8804; &#948; 2 .</p><p>With this combined with our key observation, we can conclude that Pr[&#8476;(Z &#732;-&#10216;u, v&#10217;) &#8805; &#949;/ &#8730; 2] &#8804; &#948;/2. From a union bound together with the analogous argument for the imaginary component, we have Pr[|Z &#732;-&#10216;u, v&#10217;| &#8805; &#949;] &#8804; &#948; as desired. The time complexity is the number of samples multiplied by the time to create one instance of the random variable Z, which is O(sq(u) + q(v)). Lemma 6.3. Consider p(x) a degree-d polynomial of parity-d such that |p(x)| &#8804; 1 for x &#8712; [-1, 1]. Recall that, for a function f : C &#8594; C, we define f &#175;(x) := (f (x) -f (0))/x (and f &#175;(0) = f &#8242; (0) when f is differentiable at zero).</p><p>&#8226; If p is even, then max </p><p>where &#8818; hides a constant depending on k. Note that by replacing x in the above equation with 2y -1, we get that max y&#8712;[0,1] |p (k) (y)| &#8818; d 2k max y&#8712;[0,1] |p(y)| (paying an additional 2 k constant factor). We make a couple observations about r &#175;(x) using Taylor expansions, where r(x) is any degree-d polynomial. . Note that when &#947; -1/2 is chosen to be sufficiently large (e.g. O(&#8741;X&#8741; F )) and &#8741;&#945;&#8741; = &#8486;(&#947;&#8741;y&#8741;), this runtime is dimension-independent.</p><p>Proof. Denote &#963; 2 := &#947; -1 , and redefine X &#8592; X T (so we have SQ(X) instead of SQ(X T )). By the block matrix inversion formula<ref type="foot">foot_23</ref> we know that</p><p>So, we have reduced the problem of inverting the modified matrix to just inverting M -1 where M = X T X + &#963; -2 I. M is invertible because M &#10928; &#963; 2 I. Note that M -1 = f (X T X), where</p><p>So, by Theorem 5.1, we can find R &#8224; f &#175;(CC &#8224; )R such that &#8741;R &#8224; f &#175;(CC &#8224; )R + 1 &#963; 2 I -f (X T X)&#8741; &#8804; &#949;&#963; -2 , where (because L = &#963; -4 , L &#175;= &#963; -6 )</p><p>So, the runtime for estimating this is &#732;&#65025; O (&#65026;</p><p>. We further approximate using Lemma 4.6:</p><p>we find r 1 &#8776; R &#8224; 1 &#8407; , r y &#8776; R &#8224; y &#8407;, and &#947; &#8776; 1 &#8407; &#8224; y in O(r K &#949; 2 log 1 &#948; ) time (for the first two) and O( 1 &#949; 2 log 1 &#948; ) time (for the last one) such that the following bounds hold:</p><p>Via Lemma 5.2, we observe the following additional bounds:</p><p>Now, we compute what the subsequent errors are for replacing M -1 with N := R &#8224; ZR + 1 &#963; 2 I, With these bounds, we can conclude that (continuing to use Eqs. ( <ref type="formula">25</ref>) and ( <ref type="formula">26</ref>))</p><p>by Eq. ( <ref type="formula">27</ref>)</p><p>So, by rescaling &#949; down by &#8741;X&#8741; &#963; , it suffices to sample from &#945; &#710;:= R &#8224; Z (&#65026; r y -r &#8224; 1 Zr y + &#963; -2 &#947; r &#8224;</p><p>1 Zr 1 + &#963; -2 m r 1 )&#65026; -&#963; -2 (&#65026; y -r &#8224; 1 Zr y + &#963; -2 &#947; r &#8224;</p><p>1 Zr 1 + &#963; -2 m 1 &#8407; )&#65026; .</p><p>To gain sampling and query access to the output, we consider this as a matrix-vector product, where the matrix is (R &#8224; | y | 1 &#8407; ) and the vector is the corresponding coefficients in the linear combination. Then, by Lemmas 3.5 and 3.6, we can get SQ &#981; (&#945; &#710;) for &#981; = (r + 2) </p><p>Now we consider z(t) := g I (t) = Tr (&#65025; e H+t(H &#732;-H) )&#65025; . From Eq. ( <ref type="formula">29</ref>) we have z &#8242; (t) &#8804; &#8741;H &#732;-H&#8741;z(t). Using Gr&#246;nwall's differential inequality, we can conclude that z(t) &#8804; z(0)e t&#8741;H &#732;-H&#8741; for every t &#8712; [0, &#8734;).</p><p>Finally, we use the fact that there exists a matrix A of operator norm at most 1 such that &#8422; &#8422; e H &#732;e H &#8422; &#8422; 1 = Tr(A(e H &#732;e H )) (take, e.g., sgn(e H &#732;e H )). We finish the proof by observing that for such an A, </p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>This assumption is important. When input data is quantum (say, it is coming directly from a quantum system), a classical computer has little hope of performing linear algebra on it efficiently, see for example<ref type="bibr">[ACQ22,</ref><ref type="bibr">HKP21]</ref>.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="5" xml:id="foot_1"><p>The QML algorithms we discuss generally only incur polylog( 1 &#949; ) terms, but need to eventually pay poly(1/&#949;) to extract information from output quantum states. So, we believe this exponential speedup is artificial. See the open questions section for more discussion of this error parameter.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="6" xml:id="foot_2"><p>This is the relevant variant of the notion of a CUR decomposition from the randomized numerical linear algebra and theoretical computer science communities<ref type="bibr">[DMM08]</ref>.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="7" xml:id="foot_3"><p>For semidefinite program solving, &#8741;A (&#8226;) &#8741;F &#8804; &#8730; k, which makes the runtimes comparable.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="8" xml:id="foot_4"><p>The same holds for quantum algorithms using the QRAM data structure input model: the data structure itself can be built during an O(nnz(A))-time (classical) preprocessing phase.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="9" xml:id="foot_5"><p>The QRAM data structure used here has alternatives which in some sense vary the "norm" in which one stores the input matrix [KP20, Theorem IV.4], [CGJ19, Lemma 25]. We do not expect that these alternatives would give sampling and query access to the matrix they store or could be otherwise dequantized, since these datastructures generalize and strengthen the sparse-access input model, which is known to be BQP-complete<ref type="bibr">[HHL09]</ref>.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="10" xml:id="foot_6"><p>This is the notion of approximate orthonormality as given by the first arXiv version of<ref type="bibr">[Tan19]</ref>.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="11" xml:id="foot_7"><p>Oversampling turns out to be the "natural" form of approximation in this setting; other forms of error do not propagate through quantum-inspired algorithms well.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="12" xml:id="foot_8"><p>See the proof of Lemma 4.5 in Appendix B for this kind of computation done with more detail.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="13" xml:id="foot_9"><p>[Bha97, Corollary III.2.2] actually proves the Hermitian version. The result about singular values is an easy consequence, see for example the blog of Terence Tao [Tao10, Exercise 22(iv)].</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="15" xml:id="foot_10"><p>By a dimension-independent or dimensionless quantity, we mean a quantity that is both independent of the size of the input matrix and is scale-invariant, i.e., does not change under scaling A &#8592; &#945;A.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="16" xml:id="foot_11"><p>This criterion is fairly reasonable. For example, the polynomials used in QSVT satisfy it.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="17" xml:id="foot_12"><p>Formally, to get a true approximation AR &#8776; A &#8242; R, we need to union bound the failure probability for each row, paying a log m factor in runtime. However, we will ignore this consideration: our goal is to sample from one row, so we only need to succeed in our particular row.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="18" xml:id="foot_13"><p>The quantum analogue to SQ(X) is efficient state preparation of X, a purification of &#961;.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="21" xml:id="foot_14"><p>The algorithm as written in<ref type="bibr">[RML14]</ref> assumes that &#8741;F &#8741; &#8804; 1; we confirmed with an author that this is a typo.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="22" xml:id="foot_15"><p>The correctness of this dequantization is unclear, since the approximations performed in this section incur significant errors.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="23" xml:id="foot_16"><p>For simplicity, we assume here that X is normalized to have trace 1. This can be relaxed; for an example, see<ref type="bibr">[vAGGdW20]</ref>.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="24" xml:id="foot_17"><p>Because of the normalization assumption that &#8741;A (&#8226;) &#8741; &#8804; 1, F is effectively a dimensionless "stable rank"-type constant, normalized by maxi &#8741;A (i) &#8741;.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="25" xml:id="foot_18"><p>In case applying Theorem 7.2 would result in s &gt; n, we instead directly diagonalize H ensuring s &#8804; n.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="26" xml:id="foot_19"><p>Analyzing whether or not the particular relaxation used in this and other quantum machine learning papers provides a meaningful output is unfortunately beyond the scope of our paper.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="27" xml:id="foot_20"><p>This is the runtime of Step 2 of Algorithm 1. The normalization factor of max(&#8741;B&#8741;F, &#8741;S&#8741;F) is implicit there,&#954; ef f corresponds to max(&#8741;B&#8741; F ,&#8741;S&#8741; F ) &#963; 2, and the error bound the algorithm achieves is the one we describe here, since the authors must implicitly rescale the inverse and square root function by a cumulative factor of &#8741;B&#8741; 2 /&#963; 2 to apply their Theorem 1.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="29" xml:id="foot_21"><p>The correct way to think about &#949; is as some constant fraction of L&#8741;A&#8741;. If &#949; &gt; L&#8741;A&#8741; then f (0)I is a satisfactory approximation. The bound we give says that we want an at least &#8741;A&#8741;F/&#8741;A&#8741; improvement over trivial, which is modest in the close-to-low-rank regime that we care about. Similar assumptions appear in Section 6.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="30" xml:id="foot_22"><p>The constraint on the size of &#949; from Theorem 5.1 here is &#949;(L&#8741;A&#8741;) -1 &#8818; min(L 2 &#8741;A&#8741; 2 /&#949; 2 , L 4 &#8741;A&#8741; 4 /&#949; 4 ), which is true since &#949; &#8804; L&#8741;A&#8741;/2.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="31" xml:id="foot_23"><p>In a more general setting, we would use the Sherman-Morrison inversion formula, or the analogous formula for functions of matrices subject to rank-one perturbations.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="32" xml:id="foot_24"><p>Note that in case A = I, by the cyclicity of trace, this equation implies that d dt Tr(e H(t) ) = Tr(e H(t) d dt H(t)).</p></note>
		</body>
		</text>
</TEI>
