Quantum Algorithm Zoo

This is a comprehensive catalog of quantum algorithms. If you notice any errors or omissions, please email me at stephen.jordan@microsoft.com. (Alternatively, you may submit a pull request to the repository on github.) Your help is appreciated and will be acknowledged.

Algebraic and Number Theoretic Algorithms

Oracular Algorithms

Approximation and Simulation Algorithms

Optimization, Numerics, and Machine Learning

Acknowledgments

References

FactoringSuperpolynomialGiven an-bit integer, find the prime factorization. The quantum algorithm of Peter Shor solves this in \( \widetilde{O} (n^3) \) time [ 82 125 ]. The fastest known classical algorithm for integer factorization is the general number field sieve, which is believed to run in time \( 2^{\widetilde{O}(n^{1/3})} \). The best rigorously proven upper bound on the classical complexity of factoring is \( O(2^{n/4+o(1)}) \) via the Pollard-Strassen algorithm [ 252 362 ]. Shor's factoring algorithm breaks RSA public-key encryption and the closely related quantum algorithms for discrete logarithms break the DSA and ECDSA digital signature schemes and the Diffie-Hellman key-exchange protocol. A quantum algorithm even faster than Shor's for the special case of factoring “semiprimes”, which are widely used in cryptography, is given in [ 271 ]. If small factors exist, Shor's algorithm can be beaten by a quantum algorithm using Grover search to speed up the elliptic curve factorization method [ 366 ]. Additional optimized versions of Shor's algorithm are given in [ 384 386 ]. There are proposed classical public-key cryptosystems not believed to be broken by quantum algorithms, 248 ]. At the core of Shor's factoring algorithm is order finding, which can be reduced to the Abelian hidden subgroup problem , which is solved using the quantum Fourier transform. A number of other problems are known to reduce to integer factorization including the membership problem for matrix groups over fields of odd order [ 253 ], and certain diophantine problems relevant to the synthesis of quantum circuits [ 254 ].Discrete-logSuperpolynomialWe are given three-bit numbers, and, with the promise that \( b = a^s \mod N \) for some. The task is to find. As shown by Shor [ 82 ], this can be achieved on a quantum computer in poly() time. The fastest known classical algorithm requires time superpolynomial in. By similar techniques to those in [ 82 ], quantum computers can solve the discrete logarithm problem on elliptic curves, thereby breaking elliptic curve cryptography [ 109 14 ]. A further optimization to Shor's algorithm is given in [ 385 ]. The superpolynomial quantum speedup has also been extended to the discrete logarithm problem on semigroups [ 203 204 ]. See also Abelian hidden subgroup Pell's EquationSuperpolynomialGiven a positive nonsquare integer, Pell's equation is \( x^2 - d y^2 = 1 \). For any suchthere are infinitely many pairs of integers () solving this equation. Let \( (x_1,y_1) \) be the pair that minimizes \( x+y\sqrt{d} \). Ifis an-bit integer (\( 0 \leq d \lt 2^n \) ), \( (x_1,y_1) \) may in general require exponentially many bits to write down. Thus it is in general impossible to find \( (x_1,y_1) \) in polynomial time. Let \( R = \log(x_1+y_1 \sqrt{d}) \). \( \lfloor R \rceil \) uniquely identifies \( (x_1,y_1) \). As shown by Hallgren [ 49 ], given a-bit number, a quantum computer can find \( \lfloor R \rceil \) in poly() time. No polynomial time classical algorithm for this problem is known. Factoring reduces to this problem. This algorithm breaks the Buchman-Williams cryptosystem. See also Abelian hidden subgroup Principal IdealSuperpolynomialWe are given an-bit integerand an invertible idealof the ring \( \mathbb{Z}[\sqrt{d}] \).is a principal ideal if there exists \( \alpha \in \mathbb{Q}(\sqrt{d}) \) such that \( I = \alpha \mathbb{Z}[\sqrt{d}] \). \( \alpha \) may be exponentially large in. Therefore \( \alpha \) cannot in general even be written down in polynomial time. However, \( \lfloor \log \alpha \rceil \) uniquely identifies \( \alpha \). The task is to determine whetheris principal and if so find \( \lfloor \log \alpha \rceil \). As shown by Hallgren, this can be done in polynomial time on a quantum computer [ 49 ]. A modified quantum algorithm for this problem using fewer qubits was given in [ 131 ]. A quantum algorithm solving the principal ideal problem in number fields of arbitrary degree (scaling polynomially in the degree) was subsequently given in [ 329 ]. Factoring reduces to solving Pell's equation, which reduces to the principal ideal problem. Thus the principal ideal problem is at least as hard as factoring and therefore is probably not in P. See also Abelian hidden subgroup Unit GroupSuperpolynomialThe number field \( \mathbb{Q}(\theta) \) is said to be of degreeif the lowest degree polynomial of which \( \theta \) is a root has degree. The set \( \mathcal{O} \) of elements of \( \mathbb{Q}(\theta) \) which are roots of monic polynomials in \( \mathbb{Z}[x] \) forms a ring, called the ring of integers of \( \mathbb{Q}(\theta) \). The set of units (invertible elements) of the ring \( \mathcal{O} \) form a group denoted \( \mathcal{O}^* \). As shown by Hallgren [ 50 ], and independently by Schmidt and Vollmer [ 116 ], for any \( \mathbb{Q}(\theta) \) of fixed degree, a quantum computer can find in polynomial time a set of generators for \( \mathcal{O}^* \) given a description of \( \theta \). No polynomial time classical algorithm for this problem is known. Hallgren and collaborators subsequently discovered how to achieve polynomial scaling in the degree [ 213 ]. See also [ 329 ]. The algorithms rely on solving Abelian hidden subgroup problems over the additive group of real numbers.Class GroupSuperpolynomialThe number field \( \mathbb{Q}(\theta) \) is said to be of degreeif the lowest degree polynomial of which \( \theta \) is a root has degree. The set \( \mathcal{O} \) of elements of \( \mathbb{Q}(\theta) \) which are roots of monic polynomials in \( \mathbb{Z}[x] \) forms a ring, called the ring of integers of \( \mathbb{Q}(\theta) \), which is a Dedekind domain. For a Dedekind domain, the nonzero fractional ideals modulo the nonzero principal ideals form a group called the class group. As shown by Hallgren [ 50 ], a quantum computer can find a set of generators for the class group of the ring of integers of any constant degree number field, given a description of \( \theta \), in time poly(log(\( | \mathcal{O} | \))). An improved quantum algorithm, whose runtime is also polynomial inwas subsequently given in [ 329 ]. No polynomial time classical algorithm for these problems are known. See also Abelian hidden subgroup Gauss SumsSuperpolynomialLet \( \mathbb{F}_q \) be a finite field. The elements other than zero of \( \mathbb{F}_q \) form a group \( \mathbb{F}_q^\times \) under multiplication, and the elements of \( \mathbb{F}_q \) form an (Abelian but not necessarily cyclic) group \( \mathbb{F}_q^+ \) under addition. We can choose some character \( \chi^\times \) of \( \mathbb{F}_q^\times \) and some character \( \chi^+ \) of \( \mathbb{F}_q^+ \). The corresponding Gauss sum is the inner product of these characters: \( \sum_{x

eq 0 \in \mathbb{F}_q} \chi^+(x) \chi^\times(x) \) As shown by van Dam and Seroussi [ 90 ], Gauss sums can be estimated to polynomial precision on a quantum computer in polynomial time. Although a finite ring does not form a group under multiplication, its set of units does. Choosing a representation for the additive group of the ring, and choosing a representation for the multiplicative group of its units, one can obtain a Gauss sum over the units of a finite ring. These can also be estimated to polynomial precision on a quantum computer in polynomial time [ 90 ]. No polynomial time classical algorithm for estimating Gauss sums is known. Discrete log reduces to Gauss sum estimation [ 90 ]. Certain partition functions of the Potts model can be computed by a polynomial-time quantum algorithm related to Gauss sum estimation [ 47 ].Primality ProvingPolynomialGiven an-bit number, return a proof of its primality. The fastest classical algorithms are AKS, the best versions of which [ 393 394 ] have essentially-quartic complexity, and ECPP, where the heuristic complexity of the fastest version [ 395 ] is also essentially quartic. The fastest known quantum algorithm for this problem is the method of Donis-Vela and Garcia-Escartin [ 396 ], with complexity \( O(n^2 (\log \ n)^3 \log \ \log \ n) \). This improves upon a prior factoring-based quantum algorithm for primality proving [ 397 ] that has complexity \( O(n^3 \log \ n \ \log \ \log \ n) \). A recent result of Harvey and Van Der Hoeven [ 398 ] can be used to improve the complexity of the factoring-based quantum algorithm for primality proving to \( O(n^3 \log n) \) and it may be possible to similarly reduce the complexity of the Donis-Vela-Garcia-Escartin algorithm to \( O(n^2 (\log \ n)^3) \) [ 399 ].Solving Exponential CongruencesPolynomialWe are given \( a,b,c,f,g \in \mathbb{F}_q \). We must find integers \(x,y\) such that \( a f^x + b g^y = c \). As shown in [ 111 ], quantum computers can solve this problem in \( \widetilde{O}(q^{3/8}) \) time whereas the best classical algorithm requires \( \widetilde{O}(q^{9/8}) \) time. The quantum algorithm of [ 111 ] is based on the quantum algorithms for discrete logarithms and searching.Matrix Elements of Group RepresentationsSuperpolynomialAll representations of finite groups and compact linear groups can be expressed as unitary matrices given an appropriate choice of basis. Conjugating the regular representation of a group by the quantum Fourier transform circuit over that group yields a direct sum of the group's irreducible representations. Thus, the efficient quantum Fourier transform over the symmetric group [ 196 ], together with the Hadamard test, yields a fast quantum algorithm for additively approximating individual matrix elements of the arbitrary irreducible representations of \( S_n \). Similarly, using the quantum Schur transform [ 197 ], one can efficiently approximate matrix elements of the irreducible representations of SU(n) that have polynomial weight. Direct implementations of individual irreducible representations for the groups U(n), SU(n), SO(n), and \( A_n \) by efficient quantum circuits are given in [ 106 ]. Instances that appear to be exponentially hard for known classical algorithms are also identified in [ 106 ].Verifying Matrix ProductsPolynomialGiven three \( n \times n \) matrices,, and, the matrix product verification problem is to decide whether. Classically, the best known algorithm achieves this in time \( O(n^2) \), whereas the best known classical algorithm for matrix multiplication runs in time \( O(n^{2.373}) \). Ambainisdiscovered a quantum algorithm for this problem with runtime \( O(n^{7/4}) \) [ 6 ]. Subsequently, Buhrman and Špalek improved upon this, obtaining a quantum algorithm for this problem with runtime \( O(n^{5/3}) \) [ 19 ]. This latter algorithm is based on results regarding quantum walks that were proven in [ 85 ].Subset-sumPolynomialGiven a list of integers \( x_1,\ldots,x_n \), and a target integer, the subset-sum problem is to determine whether the sum of any subset of the given integers adds up to. This problem is NP-complete, and therefore is unlikely to be solvable by classical or quantum algorithms with polynomial worst-case complexity. In the hard instances the given integers are of order \( 2^n \) and much research on subset sum focuses on average case instances in this regime. In [ 178 ], a quantum algorithm is given that solves such instances in time \( 2^{0.241n} \), up to polynomial factors. This quantum algorithm works by applying a variant of Ambainis's quantum walk algorithm for element-distinctness [ 7 ] to speed up a sophisticated classical algorithm for this problem due to Howgrave-Graham and Joux. The fastest known classical algorithm for such instances of subset-sum runs in time \( 2^{0.291n} \), up to polynomial factors [ 404 ].DecodingVariesClassical error correcting codes allow the detection and correction of bit-flips by storing data reduntantly. Maximum-likelihood decoding for arbitrary linear codes is NP-complete in the worst case, but for structured codes or bounded error efficient decoding algorithms are known. Quantum algorithms have been formulated to speed up the decoding of convolutional codes [ 238 ] and simplex codes [ 239 ].Quantum CryptanalysisVariousIt is well-known that Shor's algorithms for factoring and discrete logarithms [ 82 125 ] completely break the RSA and Diffie-Hellman cryptosystems, as well as their elliptic-curve-based variants [ 109 14 ]. (A number of "post-quantum" public-key cryptosystems have been proposed to replace these primitives, which are not known to be broken by quantum attacks.) Beyond Shor's algorithm, there is a growing body of work on quantum algorithms specifically designed to attack cryptosystems. These generally fall into three categories. The first is quantum algorithms providing polynomial or sub-exponential time attacks on cryptosystems under standard assumptions. In particular, the algorithm of Childs, Jao, and Soukharev for finding isogenies of elliptic curves breaks certain elliptic curve based cryptosystems in subexponential time that were not already broken by Shor's algorithm [ 283 ]. The second category is quantum algorithms achieving polynomial improvement over known classical cryptanalytic attacks by speeding up parts of these classical algorithms using Grover search, quantum collision finding, etc. Such attacks on private-key [ 284 316 ] and public-key [ 262 287 ] primitives, do not preclude the use of the associated cryptosystems but may influence choice of key size. The third category is attacks that make use of quantum superposition queries to block ciphers. These attacks in many cases completely break the cryptographic primitives [ 286 292 ]. However, in most practical situations such superposition queries are unlikely to be feasible.SearchingPolynomialWe are given an oracle withallowed inputs. For one input("the winner") the corresponding output is 1, and for all other inputs the corresponding output is 0. The task is to find. On a classical computer this requires \( \Omega(N) \) queries. The quantum algorithm of Lov Grover achieves this using \( O(\sqrt{N}) \) queries [ 48 ], which is optimal [ 216 ]. This has algorithm has subsequently been generalized to search in the presence of multiple "winners" [ 15 ], evaluate the sum of an arbitrary function [ 15 73 ], find the global minimum of an arbitrary function [ 35 255 ], take advantage of alternative initial states [ 100 ] or nonuniform probabilistic priors [ 123 ], work with oracles whose runtime varies between inputs [ 138 ], approximate definite integrals [ 77 ], and converge to a fixed-point [ 208 209 ]. Considerations on optimizing the depth of quantum search circuits are given in [ 405 ]. The generalization of Grover's algorithm known as amplitude estimation [ 17 ] is now an important primitive in quantum algorithms. Amplitude estimation forms the core of most known quantum algorithms related to collision finding and graph properties. One of the natural applications for Grover search is speeding up the solution to NP-complete problems such as 3-SAT. Doing so is nontrivial, because the best classical algorithm for 3-SAT is not quite a brute force search. Nevertheless, amplitude amplification enables a quadratic quantum speedup over the best classical 3-SAT algorithm, as shown in [ 133 ]. Quadratic speedups for other constraint satisfaction problems are obtained in [ 134 ]. For further examples of application of Grover search and amplitude amplification see [ 261 262 ]. A problem closely related to, but harder than, Grover search, is spatial search, in which database queries are limited by some graph structure. On sufficiently well-connected graphs, \(O(\sqrt{n})\) quantum query complexity is still achievable [ 274 330 ].Abelian Hidden SubgroupSuperpolynomialLetbe a finitely generated Abelian group, and letbe some subgroup ofsuch thatis finite. Letbe a function onsuch that for any \( g_1,g_2 \in G \), \( f(g_1) = f(g_2) \) if and only if \( g_1 \) and \( g_2 \) are in the same coset of. The task is to findfind a set of generators for) by making queries to. This is solvable on a quantum computer using \( O(\log \vert G\vert) \) queries, whereas classically \( \Omega(|G|) \) are required. This algorithm was first formulated in full generality by Boneh and Lipton in [ 14 ]. However, proper attribution of this algorithm is difficult because, as described in chapter 5 of [ 76 ], it subsumes many historically important quantum algorithms as special cases, including Simon's algorithm [ 108 ], which was the inspiration for Shor's period finding algorithm, which forms the core of his factoring and discrete-log algorithms. The Abelian hidden subgroup algorithm is also at the core of the Pell's equation, principal ideal, unit group, and class group algorithms. In certain instances, the Abelian hidden subgroup problem can be solved using a single query rather than order \( \log(\vert G\vert) \), as shown in [ 30 ]. It is normally assumed in period finding that the function \(f(x)

eq f(y) \) unless \( x-y = s \), where \( s \) is the period. A quantum algorithm which applies even when this restiction is relaxed is given in [ 388 ]. Period finding has been generalized to apply to oracles which provide only the few most significant bits about the underlying function in [ 389 ].Non-Abelian Hidden SubgroupSuperpolynomialLetbe a finitely generated group, and letbe some subgroup ofthat has finitely many left cosets. Letbe a function onsuch that for any \( g_1, g_2 \), \( f(g_1) = f(g_2) \) if and only if \( g_1 \) and \( g_2 \) are in the same left coset of. The task is to findfind a set of generators for) by making queries to. This is solvable on a quantum computer using \( O(\log(|G|) \) queries, whereas classically \( \Omega(|G|) \) are required [ 37 51 ]. However, this does not qualify as an efficient quantum algorithm because in general, it may take exponential time to process the quantum states obtained from these queries. Efficient quantum algorithms for the hidden subgroup problem are known for certain specific non-Abelian groups [ 81 273 ]. A slightly outdated survey is given in [ 69 ]. Of particular interest are the symmetric group and the dihedral group. A solution for the symmetric group would solve graph isomorphism. A solution for the dihedral group would solve certain lattice problems [ 78 ]. Despite much effort, no polynomial-time solution for these groups is known, except in special cases [ 312 ]. However, Kuperberg [ 66 ] found a time \( 2^{O( \sqrt{\log N})}) \) algorithm for finding a hidden subgroup of the dihedral group \( D_N \). Regev subsequently improved this algorithm so that it uses not only subexponential time but also polynomial space [ 79 ]. A further improvement in the asymptotic scaling of the required number of qubits is obtained in [ 218 ]. Quantum query speedups (though not necessarily efficient quantum algorithms in terms of gate count) for somewhat more general problems of testing for isomorphisms of functions under sets of permutations are given in [ 311 Bernstein-VaziraniPolynomial Directly, Superpolynomial RecursivelyWe are given an oracle whose input isbits and whose output is one bit. Given input \( x \in \{0,1\}^n \), the output is \( x \odot h \), whereis the "hidden" string ofbits, and \( \odot \) denotes the bitwise inner product modulo 2. The task is to find. On a classical computer this requiresqueries. As shown by Bernstein and Vazirani [ 11 ], this can be achieved on a quantum computer using a single query. Furthermore, one can construct recursive versions of this problem, called recursive Fourier sampling, such that quantum computers require exponentially fewer queries than classical computers [ 11 ]. See [ 256 257 ] for related work on the ubiquity of quantum speedups from generic quantum circuits and [ 258 270 ] for related work on a quantum query speedup for detecting correlations between the an oracle function and the Fourier transform of another.Deutsch-JozsaExponential over P, none over BPPWe are given an oracle whose input isbits and whose output is one bit. We are promised that out of the \( 2^n \) possible inputs, either all of them, none of them, or half of them yield output 1. The task is to distinguish the balanced case (half of all inputs yield output 1) from the constant case (all or none of the inputs yield output 1). It was shown by Deutsch [ 32 ] that for, this can be solved on a quantum computer using one query, whereas any deterministic classical algorithm requires two. This was historically the first well-defined quantum algorithm achieving a speedup over classical computation. (A related, more recent, pedagogical example is given in [ 259 ].) A single-query quantum algorithm for arbitrarywas developed by Deutsch and Jozsa in [ 33 ]. Although probabilistically easy to solve withqueries, the Deutsch-Jozsa problem has exponential worst case deterministic query complexity classically.Formula EvaluationPolynomialA Boolean expression is called a formula if each variable is used only once. A formula corresponds to a circuit with no fanout, which consequently has the topology of a tree. By Reichardt's span-program formalism, it is now known [ 158 ] that the quantum query complexity of any formula of(1) fanin onvariables is \( \Theta(\sqrt{N}) \). This result culminates from a long line of work [ 27 160 ], which started with the discovery by Farhi 38 ] that NAND trees on \( 2^n \) variables can be evaluated on quantum computers in time \( O(2^{0.5n}) \) using a continuous-time quantum walk, whereas classical computers require \( \Omega(2^{0.753n}) \) queries. In many cases, the quantum formula-evaluation algorithms are efficient not only in query complexity but also in time-complexity. The span-program formalism also yields quantum query complexity lower bounds [ 149 ]. Although originally discovered from a different point of view, Grover's algorithm can be regarded as a special case of formula evaluation in which every gate is OR. The quantum complexity of evaluating non-boolean formulas has also been studied [ 29 ], but is not as fully understood. Childshave generalized to the case in which input variables may be repeated (the first layer of the circuit may include fanout) [ 101 ]. They obtained a quantum algorithm using \( O(\min \{N,\sqrt{S},N^{1/2} G^{1/4} \}) \) queries, whereis the number of input variables not including multiplicities,is the number of inputs counting multiplicities, andis the number of gates in the formula. References [ 164 ], [ 165 ], and [ 269 ] consider special cases of the NAND tree problem in which the number of NAND gates taking unequal inputs is limited. Some of these cases yield superpolynomial separation between quantum and classical query complexity.Hidden ShiftSuperpolynomialWe are given oracle access to some functionon \( \mathbb{Z}_N \). We know thatwhereis a known function andis an unknown shift. The hidden shift problem is to find. By reduction from Grover's problem it is clear that at least \( \sqrt{N} \) queries are necessary to solve hidden shift in general. However, certain special cases of the hidden shift problem are solvable on quantum computers usingqueries. In particular, van Damshowed that this can be done ifis a multiplicative character of a finite ring or field [ 89 ]. The previously discovered shifted Legendre symbol algorithm [ 88 86 ] is subsumed as a special case of this, because the Legendre symbol \( \left(\frac{x}{p} \right) \) is a multiplicative character of \( \mathbb{F}_p \). No classical algorithm running in time(polylog()) is known for these problems. Furthermore, the quantum algorithm for the shifted Legendre symbol problem would break a certain cryptographic pseudorandom generator given the ability to make quantum queries to the generator [ 89 ]. A quantum speedup for hidden shift problems of difference sets is given in [ 312 ], and this also subsumes the Legendre symbol problem as a special case. Roetteler has found exponential quantum speedups for finding hidden shifts of certain nonlinear Boolean functions [ 105 130 ]. Building on this work, Gavinsky, Roetteler, and Roland have shown [ 142 ] that the hidden shift problem on random boolean functions \( f:\mathbb{Z}_2^n \to \mathbb{Z}_2 \) hasaverage case quantum complexity, whereas the classical query complexity is \( \Omega(2^{n/2}) \). The results in [ 143 ], though they are phrased in terms of the hidden subgroup problem for the dihedral group, imply that the quantumcomplexity of the hidden shift problem for an injective function on \( \mathbb{Z}_N \) is(log), whereas the classical query complexity is \( \Theta(\sqrt{N}) \). However, the best known quantumcomplexity for injective hidden shift on \( \mathbb{Z}_N \) is \( O(2^{C \sqrt{\log N}}) \), achieved by Kuperberg's sieve algorithm [ 66 ]. A recent result, building upon [ 408 43 ], achieves exponential quantum speedups for some generalizations of the Hidden shift problem including the, in which one has query access to \(f_s(x) = f(x-hs) \) over some allowed range ofand one wishes to infer 407 ].Polynomial interpolationVariesLet \( p(x) = a_d x^d + \ldots + a_1 x + a_0 \) be a polynomial over the finite field \( \mathrm{GF}(q) \). One is given access to an oracle that, given \( x \in \mathrm{GF}(q) \), returns \( p(x) \). The polynomial reconstruction problem is, by making queries to the oracle, to determine the coefficients \( a_d,\ldots,a_0 \). Classically, \( d + 1 \) queries are necessary and sufficient. (In some sources use the term reconstruction instead of interpolation for this problem.) Quantumly, \( d/2 + 1/2 \) queries are necessary and \( d/2 + 1 \) queries are sufficient [ 360 361 ]. For multivariate polynomials of degreeinvariables the interpolation problem has classical query complexity \( \binom{n+d}{d} \). As shown in [ 387 ], the quantum query complexity is \( O \left( \frac{1}{n+1} \binom{n+d}{d} \right) \) over \( \mathbb{R} \) and \( \mathbb{C} \) and it is \( O \left( \frac{d}{n+d} \binom{n+d}{d} \right) \) over \( \mathbb{F}_q \) for sufficiently large. Quantum algorithms have also been discovered for the case that the oracle returns \( \chi(f(x)) \) where \( \chi \) is a quadratic character of \( \mathrm{GF}(q) \) [ 390 ], and the case where the oracle returns \( f(x)^e \) [ 392 ]. These generalize the hidden shift algorithm of [ 89 ] and achieve an exponential speedup over classical computation. A quantum algorithm for reconstructing rational functions over finite fields given noisy and incomplete oracle access to the function values is given in [ 391 ].Pattern matchingSuperpolynomialGiven stringsof lengthandof length, both from some finite alphabet, the pattern matching problem is to find an occurrence ofas a substring ofor to report thatis not a substring of. More generally,andcould be-dimensional arrays rather than one-dimensional arrays (strings). Then, the pattern matching problem is to return the location ofas a \(m \times m \times \ldots \times m\) block within the \(n \times n \times \ldots \times n\) arrayor report that no such location exists. The \( \Omega(\sqrt{N}) \) query lower bound for unstructured search [ 216 ] implies that the worst-case quantum query complexity of this problem is \( \Omega ( \sqrt{n} + \sqrt{m} ) \). A quantum algorithm achieving this, up to logarithmic factors, was obtained in [ 217 ]. This quantum algorithm works through the use of Grover's algorithm together with a classical method called deterministic sampling. More recently, Montanaro showed that superpolynomial quantum speedup can be achieved on average case instances of pattern matching, provided thatis greater than logarithmic in. Specifically, the quantum algorithm given in [ 215 ] solves average case pattern matching in \( \widetilde{O}((n/m)^{d/2} 2^{O(d^{3/2} \sqrt{\log m})})\) time. This quantum algorithm is constructed by generalizing Kuperberg's quantum sieve algorithm [ 66 ] for dihedral hidden subgroup and hidden shift problems so that it can operate indimensions and accomodate small amounts of noise, and then classically reducing the pattern matching problem to this noisy-dimensional version of hidden shift.Ordered SearchConstant factorWe are given oracle access to a list ofnumbers in order from least to greatest. Given a number, the task is to find out where in the list it would fit. Classically, the best possible algorithm is binary search which takes \( \log_2 N \) queries. Farhishowed that a quantum computer can achieve this using 0.53 \( \log_2 N \) queries [ 39 ]. Currently, the best known deterministic quantum algorithm for this problem uses 0.433 \( \log_2 N \) queries [ 103 ]. A lower bound of \( \frac{\ln 2}{\pi} \log_2 N \) quantum queries has been proven for this problem [ 219 24 ]. In [ 10 ], a randomized quantum algorithm is given whose expected query complexity is less than \( \frac{1}{3} \log_2 N \).Graph Properties in the Adjacency Matrix ModelPolynomialLetbe a graph ofvertices. We are given access to an oracle, which given a pair of integers in {1,2,...,} tells us whether the corresponding vertices are connected by an edge. Building on previous work [ 35 36 ], Dürr 34 ] show that the quantum query complexity of finding a minimum spanning tree of weighted graphs, and deciding connectivity for directed and undirected graphs have \( \Theta(n^{3/2}) \) quantum query complexity, and that finding lowest weight paths has \( O(n^{3/2}\log^2 n) \) quantum query complexity. Deciding whether a graph is bipartite, detecting cycles, and deciding whether a given vertex can be reached from another (st-connectivity) can all be achieved using a number of queries and quantum gates that both scale as \( \widetilde{O}(n^{3/2}) \), and only logarithmically many qubits, as shown in [ 317 ], building upon [ 13 318 ]. A span-program-based quantum algorithm for detecting trees of a given size as minors in \( \widetilde{O}(n) \) time is given in [ 240 ]. A graph property is sparse if there exists a constantsuch that every graph with the property has a ratio of edges to vertices at most. Childs and Kothari have shown that all sparse graph properties have query complexity \( \Theta(n^{2/3}) \) if they cannot be characterized by a list of forbidden subgraphs and \( o(n^{2/3}) \) ( little-o ) if they can [ 140 ]. The former algorithm is based on Grover search, the latter on the quantum walk formalism of [ 141 ]. By Mader's theorem, sparse graph properties include all nontrivial minor-closed properties. These include planarity, being a forest, and not containing a path of given length. According to the widely-believed Aanderaa-Karp-Rosenberg conjecture, all of the above problems have \( \Omega(n^2) \) classical query complexity. Another interesting computational problem is finding a subgraphin a given graph. The simplest case of this finding the triangle, that is, the clique of size three. The fastest known quantum algorithm for this finds a triangle in \( O(n^{5/4}) \) quantum queries [ 319 ], improving upon [ 276 21 ]. Stronger quantum query complexity upper bounds are known when the graphs are sufficiently sparse [ 319 320 ]. Classically, triangle finding requires \( \Omega(n^2) \) queries [ 21 ]. More generally, a quantum computer can find an arbitrary subgraph ofvertices using \( O(n^{2-2/k-t}) \) queries where \( t=(2k-d-3)/(k(d+1)(m+2)) \) andandare such thathas a vertex of degreeandedges [ 153 ]. This improves on the previous algorithm of [ 70 ]. In some cases, this query complexity is beaten by the quantum algorithm of [ 140 ], which findsusing \( \widetilde{O}\left( n^{\frac{3}{2}-\frac{1}{\mathrm{vc}(H)+1}} \right) \) queries, providedis sparse, where vc() is the size of the minimal vertex cover of. A quantum algorithm for finding constant-sized sub-hypergraphs over 3-uniform hypergraphs in \( O(n^{1.883}) \) queries is given in [ 241 ].Graph Properties in the Adjacency List ModelPolynomialLetbe a graph ofvertices,edges, and degree. We are given access to an oracle which, when queried with the label of a vertex and \( j \in \{1,2,\ldots,d\} \) outputs theth neighbor of the vertex or null if the vertex has degree less than. Suppose we are given the promise thatis either bipartite or is far from bipartite in the sense that a constant fraction of the edges would need to be removed to achieve bipartiteness. Then, as shown in [ 144 ], the quantum complexity of deciding bipartiteness is \( \widetilde{O}(N^{1/3}) \). Also in [ 144 ], it is shown that distinguishing expander graphs from graphs that are far from being expanders has quantum complexity \( \widetilde{O}(N^{1/3}) \) and \( \widetilde{\Omega}(N^{1/4}) \), whereas the classical complexity is \( \widetilde{\Theta}(\sqrt{N}) \). The key quantum algorithmic tool is Ambainis' algorithm for element distinctness. In [ 34 ], it is shown that finding a minimal spanning tree has quantum query complexity \( \Theta(\sqrt{NM}) \), deciding graph connectivity has quantum query complexity \( \Theta(N) \) in the undirected case, and \( \widetilde{\Theta}(\sqrt{NM}) \) in the directed case, and computing the lowest weight path from a given source to all other vertices on a weighted graph has quantum query complexity \( \widetilde{\Theta}(\sqrt{NM}) \). In [ 317 ] quantum algorithms are given for st-connectivity, deciding bipartiteness, and deciding whether a graph is a forest, which run in \( \widetilde{O}(N \sqrt{d}) \) time and use only logarithmically many qubits.Welded TreeSuperpolynomialSome computational problems can be phrased in terms of the query complexity of finding one's way through a maze. That is, there is some graphto which one is given oracle access. When queried with the label of a given node, the oracle returns a list of the labels of all adjacent nodes. The task is, starting from some source node (its label), to find the label of a certain marked destination node. As shown by Childs 26 ], quantum computers can exponentially outperform classical computers at this task for at least some graphs. Specifically, consider the graph obtained by joining together two depth-binary trees by a random "weld" such that all nodes but the two roots have degree three. Starting from one root, a quantum computer can find the other root using poly() queries, whereas this is provably impossible using classical queries.Collision Finding and Element DistinctnessPolynomialSuppose we are given oracle access to a two to one functionon a domain of size. The collision problem is to find a pair \( x,y \in \{1,2,\ldots,N\} \) such that. The classical randomized query complexity of this problem is \( \Theta(\sqrt{N}) \), whereas, as shown by Brassard, a quantum computer can achieve this using \(O(N^{1/3}) \) queries [ 18 ]. (See also [ 315 ].) Removing the promise thatis two-to-one yields a problem called element distinctness, which has \( \Theta(N) \) classical query complexity. Improving upon [ 21 ], Ambainis gives a quantum algorithm with query complexity of \( O(N^{2/3}) \) for element distinctness, which is optimal [ 7 374 ]. The problem of deciding whether any-fold collisions exist is called-distinctness. Improving upon [ 7 154 ], the best quantum query complexity for-distinctness is \( O(n^{3/4 - 1/(4(2^k-1))}) \) [ 172 173 ]. For=2,3 this is also the time-complexity, up to logarithmic factors, by [ 7 ]. For \( k > 3\) the fastest known quantum algorithm has time complexity \( O(n^{(k-1)/k}) \) [ 363 ]. Given two functionsand, on domains of sizeand, respectively a claw is a pairsuch that. In the case that, the algorithm of [ 7 ] solves claw-finding in \( O(N^{2/3}) \) queries, improving on the previous \( O(N^{3/4} \log N) \) quantum algorithm of [ 21 ]. Further work gives improved query complexity for various parameter regimes in which \(N

eq M\) [ 364 365 ]. More generally, a related problem to element distinctness, is, given oracle access to a sequence, to estimate the \(k^{\mathrm{th}}\) frequency moment \(F_k = \sum_j n_j^k \), where \(n_j\) is the number of times thatoccurs in the sequence. An approximately quadratic speedup for this problem is obtained in [ 277 ]. See also graph collision Graph CollisionPolynomialWe are given an undirected graph ofvertices and oracle access to a labelling of the vertices by 1 and 0. The graph collision problem is, by querying this oracle, to decide whether there exist a pair of vertices, connected by an edge, both of which are labelled 1. One can embed Grover's unstructured search problem as an instance of graph collision by choosing the star graph, labelling the center 1, and labelling the remaining vertices by the database entries. Hence, this problem has quantum query complexity \( \Omega(\sqrt{n}) \) and classical query complexity \( \Theta (n) \). In [ 70 ], Magniez, Nayak, and Szegedy gave a \( O(N^{2/3}) \)-query quantum algorithm for graph collision on general graphs. This remains the best upper bound on quantum query complexity for this problem on general graphs. However, stronger upper bounds have been obtained for several special classes of graphs. Specifically, the quantum query complexity on a graphis \( \widetilde{O}(\sqrt{n} + \sqrt{l}) \) whereis the number of non-edges in 161 ], \(O(\sqrt{n} \alpha^{1/6}) \) where \(\alpha\) is the size of the largest independent set of 172 ], \(O(\sqrt{n} + \sqrt{\alpha^*})\) where \( \alpha^* \) is the maximum total degree of any independent set of 200 ], and \(O(\sqrt{n} t^{1/6}) \) whereis the treewidth of 201 ]. Furthermore, the quantum query complexity is \( \widetilde{O}(\sqrt{n}) \) with high probability for random graphs in which the presence or absence of an edge between each pair of vertices is chosen independently with fixed probability, (Erdős-Rényi graphs) [ 200 ]. See [ 201 ] for a summary of these results as well as new upper bounds for two additional classes of graph that are too complicated to describe here.Matrix CommutativityPolynomialWe are given oracle access tomatrices, each of which are \( n \times n \). Given integers \( i,j \in \{1,2,\ldots,n\} \), and \( x \in \{1,2,\ldots,k\} \) the oracle returns thematrix element of the \( x^{\mathrm{th}} \) matrix. The task is to decide whether all of thesematrices commute. As shown by Itakura [ 54 ], this can be achieved on a quantum computer using \( O(k^{4/5}n^{9/5}) \) queries, whereas classically this requires \( \Omega( k n^2 ) \) queries.Group CommutativityPolynomialWe are given a list ofgenerators for a groupand access to a blackbox implementing group multiplication. By querying this blackbox we wish to determine whether the group is commutative. The best known classical algorithm is due to Pak and requiresqueries. Magniez and Nayak have shown that the quantum query complexity of this task is \( \widetilde{\Theta}(k^{2/3}) \) [ 139 ].Hidden Nonlinear StructuresSuperpolynomialAny Abelian groupcan be visualized as a lattice. A subgroupofis a sublattice, and the cosets ofare all the shifts of that sublattice. The Abelian hidden subgroup problem is normally solved by obtaining superposition over a random coset of the Hidden subgroup, and then taking the Fourier transform so as to sample from the dual lattice. Rather than generalizing to non-Abelian groups (see non-Abelian hidden subgroup ), one can instead generalize to the problem of identifying hidden subsets other than lattices. As shown by Childs 23 ] this problem is efficiently solvable on quantum computers for certain subsets defined by polynomials, such as spheres. Deckershowed how to efficiently solve some related problems in [ 31 212 ].Center of Radial FunctionPolynomialWe are given an oracle that evaluates a functionfrom \( \mathbb{R}^d \) to some arbitrary set, whereis spherically symmetric. We wish to locate the center of symmetry, up to some precision. (For simplicity, let the precision be fixed.) In [ 110 ], Liu gives a quantum algorithm, based on a curvelet transform, that solves this problem using a constant number of quantum queries independent of. This constitutes a polynomial speedup over the classical lower bound, which is \( \Omega(d) \) queries. The algorithm works when the functionfluctuates on sufficiently small scales,, when the level sets ofare sufficiently thin spherical shells. The quantum algorithm is shown to work in an idealized continuous model, and nonrigorous arguments suggest that discretization effects should be small.Group Order and MembershipSuperpolynomialSuppose a finite groupis given oracularly in the following way. To every element in, one assigns a corresponding label. Given an ordered pair of labels of group elements, the oracle returns the label of their product. There are several classically hard problems regarding such groups. One is to find the group's order, given the labels of a set of generators. Another task is, given a bitstring, to decide whether it corresponds to a group element. The constructive version of this membership problem requires, in the yes case, a decomposition of the given element as a product of group generators. Classically, these problems cannot be solved using polylog(||) queries even ifis Abelian. For Abelian groups, quantum computers can solve these problems using polylog(||) queries by reduction to the Abelian hidden subgroup problem, as shown by Mosca [ 74 ]. Furthermore, as shown by Watrous [ 91 ], quantum computers can solve these problems using polylog(||) queries for any solvable group. For groups given as matrices over a finite field rather than oracularly, the order finding and constructive membership problems can be solved in polynomial time by using the quantum algorithms for discrete log and factoring [ 124 ]. See also group isomorphism Group IsomorphismSuperpolynomialLetbe a finite group. To every element ofis assigned an arbitrary label (bit string). Given an ordered pair of labels of group elements, the group oracle returns the label of their product. Given access to the group oracles for two groupsand, and a list of generators for each group, we must decide whetherandare isomorphic. For Abelian groups, we can solve this problem using poly(log ||, log ||) queries to the oracle by applying the quantum algorithm of [ 127 ], which decomposes any Abelian group into a canonical direct product of cyclic groups. The quantum algorithm of [ 128 ] solves the group isomorphism problem using poly(log ||, log ||) queries for a certain class of non-Abelian groups. Specifically, a groupis in this class ifhas a normal Abelian subgroupand an elementof order coprime to || such that G =. Zatloukal has recently given an exponential quantum speedup for some instances of a problem closely related to group isomorphism, namely testing equivalence of group extensions [ 202 ].Statistical DifferencePolynomialSuppose we are given two black boxesandwhose domain is the integers 1 throughand whose range is the integers 1 through. By choosing uniformly at random among allowed inputs we obtain a probability distribution over the possible outputs. We wish to approximate to constant precision the L1 distance between the probability distributions determined byand. Classically the number of necessary queries scales essentially linearly with N. As shown in [ 117 ], a quantum computer can achieve this using \( O(\sqrt{N}) \) queries. Approximate uniformity and orthogonality of probability distributions can also be decided on a quantum computer using \( O(N^{1/3}) \) queries. The main tool is the quantum counting algorithm of [ 16 ]. A further improved quantum algorithm for this task is obtained in [ 265 ].Finite Rings and IdealsSuperpolynomialSuppose we are given black boxes implementing the addition and multiplication operations on a finite ring, not necessarily commutative, along with a set of generators for. With respect to addition,forms a finite Abelian group (,+). As shown in [ 119 ], on a quantum computer one can find in poly(log ||) time a set of additive generators \( \{h_1,\ldots,h_m\} \subset R \) such that \( (R,+) \simeq \langle h_1 \rangle \times \ldots \times \langle h_M \rangle\) andis polylogarithmic in ||. This allows efficient computation of a multiplication tensor for. As shown in [ 118 ], one can similarly find an additive generating set for any ideal in. This allows one to find the intersection of two ideals, find their quotient, prove whether a given ring element belongs to a given ideal, prove whether a given element is a unit and if so find its inverse, find the additive and multiplicative identities, compute the order of an ideal, solve linear equations over rings, decide whether an ideal is maximal, find annihilators, and test the injectivity and surjectivity of ring homomorphisms. As shown in [ 120 ], one can also use a quantum computer to efficiently decide whether a given polynomial is identically zero on a given finite black box ring. Known classical algorithms for these problems scale as poly(||).Counterfeit CoinsPolynomialSuppose we are givencoins,of which are counterfeit. The real coins are all of equal weight, and the counterfeit coins are all of some other equal weight. We have a pan balance and can compare the weight of any pair of subsets of the coins. Classically, we need \( \Omega(k \log(N/k)) \) weighings to identify all of the counterfeit coins. We can introduce an oracle such that given a pair of subsets of the coins of equal cardinality, it outputs one bit indicating balanced or unbalanced. Building on previous work by Terhal and Smolin [ 137 ], Iwamahave shown [ 136 ] that on a quantum computer, one can identify all of the counterfeit coins using \( O(k^{1/4}) \) queries. The core techniques behind the quantum speedup are amplitude amplification and the Bernstein-Vazirani algorithm.Matrix RankPolynomialSuppose we are given oracle access to the (integer) entries of an \( n \times m \) matrix. We wish to determine the rank of the matrix. Classically this requires orderqueries. Building on [ 149 ], Belovs [ 150 ] gives a quantum algorithm that can use fewer queries given a promise that the rank of the matrix is at least. Specifically, Belovs' algorithm uses \( O(\sqrt{r(n-r+1)}LT) \) queries, whereis the root-mean-square of the reciprocals of thelargest singular values ofandis a factor that depends on the sparsity of the matrix. For general, \( T = O(\sqrt{nm}) \). Ifhas at mostnonzero entries in any row or column then \( T = O(k \log(n+m)) \). (To achieve the corresponding query complexity in the-sparse case, the oracle must take a column index as input, and provide a list of the nonzero matrix elements from that column as output.) As an important special case, one can use these quantum algorithms for the problem of determining whether a square matrix is singular, which is sometimes referred to as the determinant problem. For generalthe quantum query complexity of the determinant problem is no lower than the classical query complexity [ 151 ]. However, [ 151 ] does not rule out a quantum speedup given a promise on, such as sparseness or lack of small singular values.Matrix Multiplication over SemiringsPolynomialA semiring is a set endowed with addition and multiplication operations that obey all the axioms of a ring except the existence additive inverses. Matrix multiplication over various semirings has many applications to graph problems. Matrix multiplication over semirings can be sped up by straightforward Grover improvements upon schoolbook multiplication, yielding a quantum algorithm that multiplies a pair of \(n \times n\) matrices in \( \widetilde{O}(n^{5/2}) \) time. For some semirings this algorithm outperforms the fastest known classical algorithms and for some semirings it does not [ 206 ]. A case of particular interest is the Boolean semiring, in which OR serves as addition and AND serves as multiplication. No quantum algorithm is known for Boolean semiring matrix multiplication in the general case that beats the best classical algorithm, which has complexity \( n^{2.373} \). However, for sparse input our output, quantum speedups are known. Specifically, letbebyBoolean matrices. Let, and letbe the number of entries ofthat are equal to 1 (i.e. TRUE). Improving upon [ 19 157 ], the best known upper bound on quantum query complexity is \(\widetilde{O}(n \sqrt{l}) \), as shown in [ 161 ]. If instead the input matrices are sparse, a quantum speedup over the fastest known classical algorithm also has been found in a certain regime [ 206 ]. For detailed comparison to classical algorithms, see [ 155 206 ]. Quantum algorithms have been found to perform matrix multiplication over the (max,min) semiring in \(\widetilde{O}(n^{2.473})\) time and over the distance dominance semiring in \(\widetilde{O}(n^{2.458})\) time [ 206 ]. The fastest known classical algorithm for both of these problems has \(\widetilde{O}(n^{2.687})\) complexity.Subset findingPolynomialWe are oracle access to a function \( f:D \to R \) whereandare finite sets. Some property \( P \subset (D \times R)^k \) is specified, for example as an explicit list. Our task is to find a size-subset ofsatisfying\( ((x_1,f(x_1)),\ldots,(x_k,f(x_k))) \in P \), or reject if none exists. As usual, we wish to do this with the minimum number of queries to. Generalizing the result of [ 7 ], it was shown in [ 162 ] that this can be achieved using \(O(|D|^{k/(k+1)}) \) quantum queries. As an noteworthy special case, this algorithm solves the-subset-sum problem of findingnumbers from a list with some desired sum. A matching lower bound for the quantum query complexity is proven in [ 163 ].Search with WildcardsPolynomialThe search with wildcards problem is to identify a hidden-bit stringby making queries to an oracle. Given \( S \subseteq \{1,2,\ldots,n\} \) and \( y \in \{0,1\}^{|S|} \),returns one if the substring ofspecified byis equal to, and returns zero otherwise. Classically, this problem has query complexity \(\Theta(n)\). As shown in [ 167 ], the quantum query complexity of this problem is \( \Theta(\sqrt{n}) \). Interestingly, this quadratic speedup is achieved not through amplitude amplification or quantum walks, but rather through use of the so-called Pretty Good Measurement. The paper [ 167 ] also gives a quantum speedup for the related problem of combinatorial group testing. This result and subsequent faster quantum algorithms for group testing are discussed in the entry on Junta Testing and Group Testing.Network flowsPolynomialA network is a directed graph whose edges are labeled with numbers indicating their carrying capacities, and two of whose vertices are designated as the source and the sink. A flow on a network is an assignment of flows to the edges such that no flow exceeds that edge's capacity, and for each vertex other than the source and sink, the total inflow is equal to the total outflow. The network flow problem is, given a network, to find the flow that maximizes the total flow going from source to sink. For a network withvertices,edges, and integer capacities of maximum magnitude, [ 168 ] gives a quantum algorithm to find the maximal flow in time \( O(\min \{n^{7/6} \sqrt{m} \ U^{1/3}, \sqrt{nU}m\} \times \log n) \). The network flow problem is closely related to the problem of finding a maximal matching of a graph, that is, a maximal-size subset of edges that connects each vertex to at most one other vertex. The paper [ 168 ] gives algorithms for finding maximal matchings that run in time \( O(n \sqrt{m+n} \log n) \) if the graph is bipartite, and \( O(n^2 ( \sqrt{m/n} + \log n) \log n) \) in the general case. The core of these algorithms is Grover search. The known upper bounds on classical complexity of the network flow and matching problems are complicated to state because different classical algorithms are preferable in different parameter regimes. However, in certain regimes, the above quantum algorithms beat all known classical algorithms. (See [ 168 ] for details.)Electrical ResistanceExponentialWe are given oracle access to a weighted graph ofvertices and maximum degreewhose edge weights are to be interpreted as electrical resistances. Our task is to compute the resistance between a chosen pair of vertices. Wang gave two quantum algorithms in [ 210 ] for this task that run in time \(\mathrm{poly}( \log n, d, 1/\phi, 1/\epsilon) \), where \( \phi \) is the expansion of the graph, and the answer is to be given to within a factor of \( 1+\epsilon \). Known classical algorithms for this problem are polynomial inrather than \( \log n \). One of Wang's algorithms is based on a novel use of quantum walks. The other is based on the quantum algorithm of [ 104 ] for solving linear systems of equations. The first quantum query complexity upper bounds for the electrical resistance problem in the adjacency query model are given in [ 280 ] using approximate span programs.Junta Testing and Group TestingPolynomialA function \(f:\{0,1\}^n \to \{0,1\}\) is a-junta if it depends on at mostof its input bits. The-junta testing problem is to decide whether a given function is a-junta or is \( \epsilon \)-far from any-junta. Althoug it is not obvious, this problem is closely related to group testing. A group testing problem is defined by a function \(f:\{1,2,\ldots,n\} \to \{0,1\}\). One is given oracle access to, which takes as input subsets of \( \{1,2,\ldots,n\} \).) = 1 if there exists \(x \in S \) such that) = 1 and) = 0 otherwise. In [ 266 ] a quantum algorithm is given solving the-junta problem using \( \widetilde{O}(\sqrt{k/\epsilon}) \) queries and \( \widetilde{O}(n \sqrt{k/\epsilon}) \) time. This is a quadratic speedup over the classical complexity, and improves upon a previous quantum algorithm for-junta testing given in [ 267 ]. A polynomial speedup for a gapped (approximation) version of group testing is also given in [ 266 ], improving upon the earlier results of [ 167 268 ].Quantum SimulationSuperpolynomialIt is believed that for any physically realistic Hamiltonianondegrees of freedom, the corresponding time evolution operator \( e^{-i H t} \) can be implemented using poly() gates. Unless BPP=BQP, this problem is not solvable in general on a classical computer in polynomial time. Many techniques for quantum simulation have been developed for general classes of Hamiltonians [ 25 382 ], chemical dynamics [ 63 375 ], condensed matter physics [ 1 145 ], relativistic quantum mechanics (the Dirac and Klein-Gordon equations) [ 367 371 ], open quantum systems [ 376 379 ], and quantum field theory [ 107 368 ]. The exponential complexity of classically simulating quantum systems led Feynman to first propose that quantum computers might outperform classical computers on certain tasks [ 40 ]. Although the problem of finding ground energies of local Hamiltonians is QMA-complete and therefore probably requires exponential time on a quantum computer in the worst case, quantum algorithms have been developed to approximate ground [ 102 381 ] and thermal [ 132 307 ] states for some classes of Hamiltonians. Efficient quantum algorithms have been also obtained for preparing certain classes of tensor network states [ 323 328 ].Knot InvariantsSuperpolynomialAs shown by Freedman [ 42 41 ],, finding a certain additive approximation to the Jones polynomial of the plat closure of a braid at \( e^{i 2 \pi/5} \) is a BQP-complete problem. This result was reformulated and extended to \( e^{i 2 \pi/k} \) for arbitraryby Aharonov 2 ]. Wocjan and Yard further generalized this, obtaining a quantum algorithm to estimate the HOMFLY polynomial [ 93 ], of which the Jones polynomial is a special case. Aharonovsubsequently showed that quantum computers can in polynomial time estimate a certain additive approximation to the even more general Tutte polynomial for planar graphs [ 3 ]. It is not fully understood for what range of parameters the approximation obtained in [ 3 ] is BQP-hard. (See also partition functions .) Polynomial-time quantum algorithms have also been discovered for additively approximating link invariants arising from quantum doubles of finite groups [ 174 ]. (This problem is not known to be BQP-hard.) As shown in [ 83 ], the problem of finding a certain additive approximation to the Jones polynomial of the trace closure of a braid at \( e^{i 2 \pi/5} \) is DQC1-complete.Three-manifold InvariantsSuperpolynomialThe Turaev-Viro invariant is a function that takes three-dimensional manifolds as input and produces a real number as output. Homeomorphic manifolds yield the same number. Given a three-manifold specified by a Heegaard splitting, a quantum computer can efficiently find a certain additive approximation to its Turaev-Viro invariant, and this approximation is BQP-complete [ 129 ]. Earlier, in [ 114 ], a polynomial-time quantum algorithm was given to additively approximate the Witten-Reshitikhin-Turaev (WRT) invariant of a manifold given by a surgery presentation. Squaring the WRT invariant yields the Turaev-Viro invariant. However, it is unknown whether the approximation achieved in [ 114 ] is BQP-complete. A suggestion of a possible link between quantum computation and three-manifold invariants was also given in [ 115 ].Partition FunctionsSuperpolynomialFor a classical system with a finite set of statesthe partition function is \( Z = \sum_{s \in S} e^{-E(s)/kT} \), whereis the temperature andis Boltzmann's constant. Essentially every thermodynamic quantity can be calculated by taking an appropriate partial derivative of the partition function. The partition function of the Potts model is a special case of the Tutte polynomial. A quantum algorithm for approximating the Tutte polynomial is given in [ 3 ]. Some connections between these approaches are discussed in [ 67 ]. Additional algorithms for estimating partition functions on quantum computers are given in [ 112 47 ]. A BQP-completeness result (where the "energies" are allowed to be complex) is also given in [ 113 ]. A method for approximating partition functions by simulating thermalization processes is given in [ 121 ]. A quadratic speedup for the approximation of general partition functions is given in [ 122 ]. A method based on quantum walks, achieving polynomial speedup for evaluating partition functions is given in [ 265 ].Quantum Approximate OptimizationSuperpolynomialFor many combinatorial optimization problems, finding the exact optimal solution is NP-complete. There are also hardness-of-approximation results proving that finding an approximation with sufficiently small error bound is NP-complete. For certain problems there is a gap between the best error bound achieved by a polynomial-time classical approximation algorithm and the error bound proven to be NP-hard. In this regime there is potential for exponential speedup by quantum computation. In [ 242 ] a new quantum algorithmic technique called the Quantum Approximate Optimization Algorithm (QAOA) was proposed for finding approximate solutions to combinatorial optimization problems. In [ 243 ] it was subsequently shown that QAOA solves a combinatorial optimization problem called Max E3LIN2 with a better approximation ratio than any polynomial-time classical algorithm known at the time. However, an efficient classical algorithm achieving an even better approximation ratio (in fact, the approximation ratio saturating the limit set by hardness-of-approximation) was subsequently discovered [ 260 ]. Presently, the power of QAOA relative to classical computing is an active area of research [ 300 314 ].Semidefinite ProgrammingSuperpolynomialGiven a list of+ 1 Hermitian \(n \times n \) matrices \(C, A_1, A_2, \ldots, A_m\) andnumbers \(b_1, \ldots, b_m \), the problem of semidefinite programming is to find the positive semidefinite \( n \times n \) matrixthat maximizes tr() subject to the constraints \( \mathrm{tr} (A_j X) \leq b_j \) for \( j = 1,2,\ldots, m \). Semidefinite programming has many applications in operations research, combinatorial optimization, and quantum information, and it includes linear programming as a special case. Improving upon [ 313 ], a quantum algorithm is given in [ 383 ] that approximately solves semidefinite programs to within \( \pm \epsilon \) in time \( O (\sqrt{m} \log m \cdot \mathrm{poly}(\log n, r, \epsilon^{-1})) \), whereis the rank of the semidefinite program. This constitutes a quadratic speedup over the fastest classical algorithms whenis small compared to. The quantum algorithm is based on amplitude amplification and quantum Gibbs sampling [ 121 307 ].Zeta FunctionsSuperpolynomialLet) be a degree-polynomial over a finite field \( \mathbb{F}_p \). Let \( N_r \) be the number of projective solutions to= 0 over the extension field \( \mathbb{F}_{p^r} \). The zeta function foris defined to be \( Z_f(T) = \exp \left( \sum_{r=1}^\infty \frac{N_r}{r} T^r \right) \). Remarkably, \( Z_f(T) \) always has the form \( Z_f(T) = \frac{Q_f(T)}{(1-pT)(1-T)} \) where \( Q_f(T) \) is a polynomial of degree 2and \(g = \frac{1}{2} (d-1)(d-2) \) is called the genus of. Given \( Z_f(T) \) one can easily compute the number of zeros ofover any extension field \( \mathbb{F}_{p^r} \). One can similarly define the zeta function when the original field over whichis defined does not have prime order. As shown by Kedlaya [ 64 ], quantum computers can determine the zeta function of a genuscurve over a finite field \( \mathbb{F}_{p^r} \) in \( \mathrm{poly}(\log p, r, g) \) time. The fastest known classical algorithms are all exponential in either log() or. In a diffent, but somewhat related contex, van Dam has conjectured that due to a connection between the zeros of Riemann zeta functions and the eigenvalues of certain quantum operators, quantum computers might be able to efficiently approximate the number of solutions to equations over finite fields [ 87 ].Weight EnumeratorsSuperpolynomialLetbe a code onbits,a subset of \( \mathbb{Z}_2^n \). The weight enumerator ofis \( S_C(x,y) = \sum_{c \in C} x^{|c|} y^{n-|c|} \) where || denotes the Hamming weight of. Weight enumerators have many uses in the study of classical codes. Ifis a linear code, it can be defined by \( C = \{c: Ac = 0\} \) whereis a matrix over \( \mathbb{Z}_2 \) In this case \( S_C(x,y) = \sum_{c:Ac=0} x^{|c|} y^{n-|c|} \). Quadratically signed weight enumerators (QWGTs) are a generalization of this: \( S(A,B,x,y) = \sum_{c:Ac=0} (-1)^{c^T B c} x^{|c|} y^{n-|c|} \). Now consider the following special case. Letbe an \( n \times n \) matrix over \( \mathbb{Z}_2 \) such that diag()=I. Let lwtr() be the lower triangular matrix resulting from setting all entries above the diagonal into zero. Letbe positive integers. Given the promise that \( |S(A,\mathrm{lwtr}(A),k,l)| \geq \frac{1}{2} (k^2+l^2)^{n/2} \) the problem of determining the sign of \( S(A,\mathrm{lwtr}(A),k,l) \) is BQP-complete, as shown by Knill and Laflamme in [ 65 ]. The evaluation of QWGTs is also closely related to the evaluation of Ising and Potts model partition functions [ 67 46 ].Simulated AnnealingPolynomialIn simulated annealing, one has a series of Markov chains defined by stochastic matrices \( M_1, M_2,\ldots,M_n \). These are slowly varying in the sense that their limiting distributions \( pi_1, \pi_2, \ldots, \pi_n \) satisfy \( |\pi_{t+1} -\pi_t| \lt \epsilon \) for some small \( \epsilon \). These distributions can often be thought of as thermal distributions at successively lower temperatures. If \( \pi_1 \) can be easily prepared, then by applying this series of Markov chains one can sample from \( \pi_n \). Typically, one wishes for \( \pi_n \) to be a distribution over good solutions to some optimization problem. Let \( \delta_i \) be the gap between the largest and second largest eigenvalues of \( M_i \). Let \( \delta = \min_i \delta_i \). The run time of this classical algorithm is proportional to \( 1/\delta \). Building upon results of Szegedy [ 135 85 ], Sommahave shown [ 84 177 ] that quantum computers can sample from \( \pi_n \) with a runtime proportional to \( 1/\sqrt{\delta} \). Additional methods by which classical Markov chain Monte Carlo algorithms can be sped up using quantum walks are given in [ 265 ].String RewritingSuperpolynomialString rewriting is a fairly general model of computation. String rewriting systems (sometimes called grammars) are specified by a list of rules by which certain substrings are allowed to be replaced by certain other substrings. For example, context free grammars, are equivalent to the pushdown automata. In [ 59 ], Janzing and Wocjan showed that a certain string rewriting problem is PromiseBQP-complete. Thus quantum computers can solve it in polynomial time, but classical computers probably cannot. Given three strings, and a set of string rewriting rules satisfying certain promises, the problem is to find a certain approximation to the difference between the number of ways of obtainingfromand the number of ways of obtainingfrom. Similarly, certain problems of approximating the difference in number of paths between pairs of vertices in a graph, and difference in transition probabilities between pairs of states in a random walk are also BQP-complete [ 58 ].Matrix PowersSuperpolynomialQuantum computers have an exponential advantage in approximating matrix elements of powers of exponentially large sparse matrices. Suppose we are have an \( N \times N \) symmetric matrixsuch that there are at most polylog() nonzero entries in each row, and given a row index, the set of nonzero entries can be efficiently computed. The task is, for any 1 60 ]. Thus, quantum computers can solve it in polynomial time, but classical computers probably cannot.Constraint SatisfactionPolynomialConstraint satisfaction problems, many of which are NP-hard, are ubiquitous in computer science, a canonical example being 3-SAT. If one wishes to satisfy as many constraints as possible rather than all of them, these become combinatorial optimization problems. (See also adiabatic algorithms .) The brute force solution to constraint satisfaction problems can be quadratically sped up using Grover's algorithm. However, most constaint satisfaction problems are solvable by classical algorithms that (although still exponential-time) run more than quadratically faster than brute force checking of all possible solutions. Nevertheless, a polynomial quantum speedup over the fastest known classical algorithm for 3-SAT is given in [ 133 ], and polynomial quantum speedups for some other constraint satisfaction problems are given in [ 134 298 ]. A commonly used classical algorithm for constraint satisfaction is backtracking, and for some problems this algorithm is the fastest known. A general quantum speedup for backtracking algorithms is given in [ 264 ].Adiabatic AlgorithmsUnknownIn adiabatic quantum computation one starts with an initial Hamiltonian whose ground state is easy to prepare, and slowly varies the Hamiltonian to one whose ground state encodes the solution to some computational problem. By the adiabatic theorem, the system will track the instantaneous ground state provided the variation of the Hamiltonian is sufficiently slow. The runtime of an adiabatic algorithm scales at worst as \(1/ \gamma^3 \) where \( \gamma \) is the minimum eigenvalue gap between the ground state and the first excited state [ 185 ]. If the Hamiltonian is varied sufficiently smoothly, one can improve this to \( \widetilde{O}(1/\gamma^2) \) [ 247 ]. Adiabatic quantum computation was first proposed by Farhias a method for solving NP-complete combinatorial optimization problems [ 96 186 ]. Adiabatic quantum algorithms for optimization problems typically use "stoquastic" Hamiltonians, which do not suffer from the sign problem. Such algorithms are sometimes referred to as quantum annealing. Adiabatic quantum computation with non-stoquastic Hamiltonians is as powerful as the quantum circuit model [ 97 ]. Adiabatic algorithms using stoquastic Hamiltonians are probably less powerful [ 183 ], but may be nevertheless more powerful than classical computation. The asymptotic runtime of adiabatic optimization algorithms is notoriously difficult to analyze, but some progress has been achieved [ 179 226 ]. (Also relevant is an earlier literature on quantum annealing, which originally referred to a classical optimization algorithm that works by simulating a quantum process, much as simulated annealing is a classical optimization algorithm that works by simulating a thermal process. See e.g. [ 199 198 ].) Adiabatic quantum computers can perform a process somewhat analogous to Grover search in \( O(\sqrt{N}) \) time [ 98 ]. Adiabatic quantum algorithms achieving quadratic speedup for a more general class of problems are constructed in [ 184 ] by adapting techniques from [ 85 ]. Adiabatic quantum algorithms have been proposed for several specific problems, including PageRank [ 176 ], machine learning [ 192 195 ], finding Hadamard matrices [ 406 ], and graph problems [ 193 194 ]. Some quantum simulation algorithms also use adiabatic state preparation.Gradients, Structured Search, and Learning PolynomialsPolynomialSuppose we are given a oracle for computing some smooth function \( f:\mathbb{R}^d \to \mathbb{R} \). The inputs and outputs toare given to the oracle with finitely many bits of precision. The task is to estimate \(

abla f \) at some specified point \( \mathbf{x}_0 \in \mathbb{R}^d \). As shown in [ 61 ], a quantum computer can achieve this using one query, whereas a classical computer needs at leastqueries. In [ 20 ], Bulger suggested potential applications for optimization problems. As shown in appendix D of [ 62 ], a quantum computer can use the gradient algorithm to find the minimum of a quadratic form indimensions usingqueries, whereas, as shown in [ 94 ], a classical computer needs at least \( \Omega(d^2) \) queries. Single query quantum algorithms for finding the minima of basins based on Hamming distance were given in [ 147 223 ]. The quantum algorithm of [ 62 ] can also extract all \( d^2 \) matrix elements of the quadratic form usingqueries, and more generally, all \( d^n \)th derivatives of a smooth function ofvariables in \( O(d^{n-1}) \) queries. Remarkably general results in [ 418 420 ] give quantum speedups for convex optimization and volume estimation of convex bodies, as well as query complexity lower bounds. Roughly speaking these results show that for convex optimization and volume estimation indimensions one gets a quadratic speedup injust as was found earlier for the special case of minimizing quadratic forms. As shown in [ 130 146 ], quadratic forms and multilinear polynomials invariables over a finite field may be extracted with a factor offewer quantum queries than are required classically.Linear SystemsSuperpolynomialWe are given oracle access to an \( n \times n \) matrixand some description of a vector. We wish to find some property offor some efficiently computable function. Supposeis a Hermitian matrix with(polylog) nonzero entries in each row and condition number. As shown in [ 104 ], a quantum computer can in \( O(k^2 \log n) \) time compute to polynomial precision various expectation values of operators with respect to the vector(provided that a quantum state proportional tois efficiently constructable). For certain functions, such as, this procedure can be extended to non-Hermitian and even non-square. The runtime of this algorithm was subsequently improved to \( O(k \log^3 k \log n) \) in [ 138 ]. Exponentially improved scaling of runtime with precision was obtained in [ 263 ]. Some methods to extend this algorithm to apply to non-sparse matrices have been proposed [ 309 402 ], although these require certain partial sums of the matrix elements to be pre-computed. Extensions of this quantum algorithm have been applied to problems of estimating electromagnetic scattering crossections [ 249 ] (see also [ 369 ] for a different approach), solving linear differential equations [ 156 296 ], estimating electrical resistance of networks [ 210 ], least-squares curve-fitting [ 169 ], solving Toeplitz systems [ 297 ], and machine learning [ 214 309 ]. However, the linear-systems-based quantum algorithms for recommendation systems [ 309 ] and principal component analysis [ 250 ] were subsequently "dequantized" by Tang [ 400 401 ]. That is, Tang obtained polynomial time classical randomized algorithms for these problems, thus proving that the proposed quantum algorithms for these tasks do not achieve exponential speedup. Some limitations of the quantum machine learning algorithms based on linear systems are nicely summarized in [ 246 ]. In [ 220 ] it was shown that quantum computers can invert well-conditioned \( n \times n \) matrices using only \( O( \log n ) \) qubits, whereas the best classical algorithm uses order \( \log^2 n \) bits. Subsequent improvements to this quantum algorithm are given in [ 279 ].Machine LearningVariesMaching learning encompasses a wide variety of computational problems and can be attacked by a wide variety of algorithmic techniques. This entry summarizes quantum algorithmic techniques for improved machine learning. Many of the quantum algorithms here are cross-listed under other headings. In [ 214 403 ], quantum algorithms for solving linear systems [ 104 ] are applied to speed up cluster-finding, principal component analysis, binary classification, training of neural networks, and various forms of regression, provided the data satisfies certain conditions. However, a number of quantum machine learning algorithms based on linear systems have subsequently been "dequantized". Specifically, Tang showed in [ 400 401 ] that the problems of recommendation systems and principal component analysis solved by the quantum algorithms of [ 251 309 ] can in fact also be solved in polynomial time randomized classical algorithms. A cluster-finding method not based on the linear systems algorithm of [ 104 ] is given in [ 336 ]. The papers [ 192 348 ] explore the use of adiabatic optimization techniques to speed up the training of classifiers. In [ 221 ], a method is proposed for training Boltzmann machines by manipulating coherent quantum states with amplitudes proportional to the Boltzmann weights. Polynomial speedups can be obtained by applying Grover search and related techniques such as amplitude amplification to amenable subroutines of state of the art classical machine learning algorithms. See, for example [ 358 343 ]. Other quantum machine learning algorithms not falling into one of the above categories include [ 337 349 ]. Some limitations of quantum machine learning algorithms are nicely summarized in [ 246 ]. Many other quantum query algorithms that extract hidden structure of the black-box function could be cast as machine learning algorithms. See for example [ 146 212 ]. Query algorithms for learning the majority and "battleship" functions are given in [ 224 ]. Large quantum advantages for learning from noisy oracles are given in [ 236 237 ]. Several recent review articles [ 299 333 ] and a book [ 331 ] are available which summarize the state of the field. There is a related body of work, not strictly within the standard setting of quantum algorithms, regarding quantum learning in the case that the data itself is quantum coherent. See 357 ].Solving Differential EquationsSuperpolynomialConsider linear first order differential equation \( \frac{d}{dt} \mathbf{x} = A(t) \mathbf{x} + \mathbf{b}(t) \), where \( \mathbf{x} \) and \( \mathbf{b} \) are-dimensional vectors andis an \(N \times N\) matrix. Given an initial condition \( \mathbf{x}(0) \) one wishes to compute the solution \( \mathbf{x}(t) \) at some later timeto some precision \( \epsilon \) in the sense that the normalized vector \( x(t)/\|x(t)\| \) produced has distance at most \( \epsilon \) from the exact solution. In [ 156 ], Berry gives a quantum algorithm for this problem that runs in time \( O(t^2 \mathrm{poly}(1/\epsilon) \mathrm{poly log} N) \), whereas the fastest classical algorithms run in time \( O ( t \mathrm{poly} N ) \). The final result is produced in the form of a quantum superposition state on \( O(log N) \) qubits whose amplitudes contain the components of \( \mathbf{x}(t) \). The algorithm works by reducing the problem to linear algebra via a high-order finite difference method and applying the quantum linear algebra primitive of [ 104 ]. In [ 410 ] an improved quantum algorithm for this problem was given which brings the epsilon dependence down to \( \mathrm{poly log}(1/\epsilon) \). A quantum algorithm for solving nonlinear differential equations (again in the sense of obtaining a solution encoded in the amplitudes) is described in [ 411 ]. Partial differential equations can be reduced to ordinary differential equations through discretization, and higher order differential equations can be reduced to first order through additiona of auxiliary variables. Consequently, these more general problems can be solved through the methods of [ 156 104 ]. However, quantum algorithms designed to solve these problems directly may be more efficient (and for specific problems one may analyze the complexity of tasks that are unspecified in a more general formulation such as preparation of relevant initial states). In [ 249 ] a quantum algorithm is given which solves the wave equation by applying finite-element methods to reduce it to linear algebra and then applying the quantum linear algebra algorithm of [ 104 ] with preconditioning. In [ 369 ] a quantum algorithm is given for solving the wave equation by discretizing it with finite differences and massaging it into the form of a Schrodinger equation which is then simulated using the method of [ 245 ]. The problem solved by [ 369 ] is not equivalent to that solved by [ 249 ] because in [ 249 ] the problem is reduced to a time-indepent one through assuming sinusoidal time dependence and applying separation of variables, whereas [ 369 ] solves the time-dependent problem. The quantum speedup achieved over classical methods for solving the wave equation in-dimensiona is polynomial for fixedbut expontial in. Concrete resource estimates for quantum algorithms to solve differential equations are given in [ 412 414 ]. A quantum algorithm for solving linear partial differential equations using continuous-variable quantum computing is given in [ 415 ]. In [ 296 ] quantum finite element methods are analyzed in a general setting. A quantum spectral method for solving differential equations is given in [ 416 ]. A quantum algorithm for solving the Vlasov equation is given in [ 417 ].Quantum Dynamic ProgrammingPolynomialIn [ 409 ] the authors introduce a problem called path-in-the-hypercube. In this problem, one given a subgraph of the hypercube and asked whether there is a path along this subgraph that starts from the all zeros vertex, ends at the all ones vertex, and makes only Hamming weight increasing moves. (The vertices of the hypercube graph correspond to bit strings of lengthand the hypercube graph joins vertices of Hamming distance one.) Many NP-complete problems for which the best classical algorithm is dynamic programming can be modeled as instances of path-in-the-hypercube. By combining Grover search with dynamic programming methods, a quantum algorithm can solve path-in-the-hypercube in time \( O^*(1.817^n) \), where the notation \( O^* \) indicates that polynomial factors are being omitted. The fastest known classical algorithm for this problem runs in time \( O^*(2^n) \). Using this primitive quantum algorithms can be constructed that solve vertex ordering problems in \( O^*(1.817^n) \) vs. \( O^* (2^n) \) classically, graph bandwidth in \( O^*(2.946^n) \) vs. \( O^*(4.383^n) \) classically, travelling salesman and feedback arc set in \( O^*(1.729^n) \) vs. \( O^*(2^n) \) classically, and minimum set cover in \( O( \mathrm{poly}(m,n) 1.728^n ) \) vs. \( O(nm2^n) \) classically.I thank the following people for contributing their expertise (in chronological order).