Optimal polynomial based quantum eigenstate filtering with application to solving quantum linear systems

We present a quantum eigenstate ﬁltering algorithm based on quantum signal processing (QSP) and minimax polynomials. The algorithm allows us to eﬃciently prepare a target eigenstate of a given Hamiltonian, if we have access to an initial state with non-trivial overlap with the target eigenstate and have a reasonable lower bound for the spectral gap. We apply this algorithm to the quantum linear system problem (QLSP), and present two algorithms based on quantum adiabatic computing (AQC) and quantum Zeno eﬀect respectively. Both algorithms prepare the ﬁnal solution as a pure state, and achieves the near optimal e O ( dκ log(1 /(cid:15) )) query complexity for a d -sparse matrix, where κ is the condition number, and (cid:15) is the desired precision. Neither algorithm uses phase estimation or amplitude ampliﬁcation.


Introduction
Eigenvalue problems have a wide range of applications in scientific and engineering computing. Finding ground states and excited states of quantum many-body Hamiltonian operators, Google's PageRank algorithm, and principle component analysis are just a few prominent examples. Some problems that are not apparently eigenvalue problems may benefit from a reformulation into eigenvalue problems. One noticeable example is the quantum linear systems problem (QLSP), which aims at preparing a state that is proportional to the solution of a given linear system, i.e. |x = A −1 |b / A −1 |b on a quantum computer ( · denotes the vector 2-norm). Here A ∈ C N ×N , and |b ∈ C N . We give a more detailed definition of the QLSP in Section 4. All QLSP solvers share the desirable property that the complexity with respect to the matrix dimension can be as low as O(polylog(N )), which is exponentially faster compared to known classical solvers. Due to the wide applications of linear systems, the efficient solution of QLSP has received significant attention in recent years [5,14,16,17,21,34,38,56,61,62]. By reformulating QLSP into an eigenvalue problem, recent developments have yielded near-optimal query-complexity with respect to κ (the condition number of A, defined as the ratio between the largest and the smallest singular value of A, or κ = A A −1 ) [5,56], which is so far difficult to achieve using alternative methods.
Consider a Hermitian matrix H ∈ C N ×N , which has a known interior eigenvalue λ separated from the rest of the spectrum by a gap (or a lower bound of the gap) denoted by ∆. Let P λ be the spectral projector associated with the eigenvalue λ. The goal of the quantum eigenstate filtering problem is to find a certain smooth function f (·), so where τ satisfies τ H < π. Ref. [30, Appendix B] contains a very detailed analysis of the complexities of using phase estimation together with amplitude amplification. From the analysis in Ref. [30], this approach requires O(1/(γ 2 ∆ )) times of queries for U sim , where is the target accuracy (the complexity is the same up to logarithmic factors if we use the block-encoding U H instead of its time-evolution as an oracle); the number of queries to the circuit U x 0 that prepares the initial trial state is O(1/γ); and the number of extra ancilla qubits is O(log(1/( ∆)). This is non-optimal with respect to both γ and .
Several variants of phase estimation are developed to achieve better dependence on the parameters γ and [30,48,49]. The filtering method developed by Poulin and Wocjan [48] (for a task related to eigenstate filtering) improves the query complexities of U sim and U x 0 with respect to γ from O(1/γ 2 ) to O(1/γ). Ge et al. [30,Appendix C] shows that the method by Poulin and Wocjan can be adapted to the ground state preparation problem so that the query complexity of U sim becomes O(1/(γ∆) log(1/ )), while the complexity of U x 0 remains O(1/γ). The number of extra ancilla qubits is O(log(1/( ∆)). Similar logarithmic dependence on the accuracy in the query complexity has also been achieved in Ref. [49].
Ge et al. [30] also proposed two eigenstate filtering algorithms using linear combination of unitaries (LCU) [11,21], which uses the Fourier basis and the Chebyshev polynomial basis, respectively. For both methods, the query complexities for U H and U x 0 are O(1/(γ∆) log(1/ )) and O(1/γ) respectively, and the number of extra ancilla qubits can be reduced to O(log log(1/ ) + log(1/∆)). The log log(1/ ) factor comes from the use of LCU. We remark that these methods were developed for finding the ground state, but can be adapted to compute interior eigenstates as well. Our filtering method has the same query complexity up to polylogarithmic factors. The number of extra ancilla qubits is significantly fewer and does not depend on either or ∆, due to the use of QSP. Our method also uses the optimal filtering polynomial, which solves a minimax problem as recorded in Lemma 2. There are several other hybrid quantum-classical algorithms to compute ground state energy and to prepare the ground state [47,55], whose computational complexities are not yet analyzed and therefore we do not make comparisons here.
For solving QLSP, the query complexity of the original Harrow, Hassidim, and Lloyd (HHL) algorithm [38] scales as O(κ 2 / ), where κ is the condition number of A, and is the target accuracy. Despite the exponential speedup with respect to the matrix dimension, the scaling with respect to κ and is significantly weaker compared to that in classical methods. For instance, for positive definite matrices, the complexity of steepest descent (SD) and conjugate gradient (CG) (with respect to both κ and ) are only O(κ log(1/ )) and O( √ κ log(1/ )), respectively [52]. In the past few years, there have been significant progresses towards reducing the preconstants for quantum linear solvers. In particular, the linear combination of unitary (LCU) [11,21] and quantum signal processing (QSP) or quantum singular value transformation (QSVT) [34,43] techniques can reduce the query complexity to O(κ 2 polylog(κ/ )). Therefore the algorithm is almost optimal with respect to , but is still suboptimal with respect to κ. The scaling with respect to κ can be reduced by the variable-time amplitude amplification (VTAA) [4] technique, and the resulting query complexity for solving QLSP is O(κ polylog(κ/ ))) [17,21]. However, VTAA requires considerable modification of the LCU or QSP algorithm, and has significant overhead itself. To the extent of our knowledge, the performance of VTAA for solving QLSP has not been quantitatively reported in the literature.
The recently developed randomization method (RM) [56] is the first algorithm that yields near-optimal scaling with respect to κ, without using techniques such as VTAA.
Eigenstate filtering+QZE (Theorem 11) O(κ log(1/ )) No need for any amplitude amplification. Does not rely on any complex subroutines.  [10,11,43,44,45]. The LCU method [21] and the gate-based implementation of the RM method [56] both assume oracles to access elements of A. However in both cases the oracles lead to a block-encoding A which can be used in the algorithms. The same can be said of the sparse-access input model in Ref. [17]. Time complexities and gate complexities are converted to query complexities with respect to the oracles in this paper. [32,Thereom 41] gives the implementation of the pseudoinverse using QSVT. This can be used to solve the QLSP by applying this pseudoinverse to the quantum state representing the right-hand side.
RM was inspired by adiabatic quantum computation (AQC) [2,28,39], but relies on the quantum Zeno effect. Both RM and AQC reformulate QLSP into an eigenvalue problem. The runtime complexity of RM is O(κ log(κ)/ ). The recently developed time-optimal AQC(p) and AQC(exp) approaches [5] reduces the runtime complexity to O(κ/ ) and O(κ polylog(κ/ )), respectively. In particular, AQC(exp) achieves the near-optimal complexity with respect to both κ and , without relying on any amplification procedure. We also remark that numerical observation indicate that the time complexity of the quantum approximate optimization algorithm (QAOA) [29] can be as low as O(κ polylog(1/ )) [5]. The direct analysis of the complexity of QAOA without relying on the complexity of adiabatic computing (such as AQC(exp)) remains an open question. We demonstrate that quantum eigenstate filtering provides a more versatile approach to obtain the near optimal complexity for solving QLSP. In particular, it can be used to reduce the complexity with respect to for both adiabatic computing and quantum Zeno effect based methods. In Table 1 we compare these aforementioned algorithms in terms of the number of queries to the block-encoding of A. We note that these algorithms rely on different input models but they can all be slightly modified to use the block-encoding assumed in this work. Recently quantum-inspired classical algorithms based on 2 -norm sampling assumptions [58,59] have been developed that are only up to polynomially slower than the corresponding quantum algorithms. Similar techniques have been applied to solve low-rank linear systems [19,31], which achieve exponential speedup in the dependence on the problem size compared to the traditional classical algorithms for the same problem. However, it is unclear whether the classical 2 -norm sampling can be done efficiently without access to a quantum computer in the setting of this work. The quantum-inspired classical algorithms also suffer from many practical issues making their application limited to highly specialized problems [8]. Most importantly, the assumption of low-rankness is crucial in these algorithms. Our work is based on the block-encoding model, which could be used to efficiently represent low-rank as well as full-rank matrices on a quantum computer.
Notations: In this paper we use the following asymptotic notations besides the usual O notation: We use · to denote vector or matrix 2-norm: when v is a vector we denote by v its 2-norm, and when A is matrix we denote by A its operator norm. For two quantum states |x and |y , we sometimes write |x, y to denote |x |y . We use fidelity to measure how close to each other two quantum states are. Note there are two common definitions for the fidelity between two pure states |φ and |ϕ : it is either | φ|ϕ | or | φ|ϕ | 2 . Throughout the paper we use the former definition.
Organization: The rest of the paper is organized as follows. In Section 2 we briefly review block-encoding and QSP, as well as using QSP to directly solve QLSP with a non-optimal complexity. In Section 3 we introduce the minimax polynomial we are using and our eigenstate filtering method based on it. In Section 4 we combine eigenstate filtering with AQC to solve the QLSP. In Section 5 we present another method to solve the QLSP using QZE and eigenstate filtering. In Section 6 we discuss some practical aspects of our algorithms and future work.
2 Block-encoding and quantum signal processing For simplicity we assume N = 2 n . An (m + n)-qubit unitary operator U is called an (α, m, )-block-encoding of an n-qubit operator A, if Another way to express Eq. (1) is √ /α)-block-encoding U of P (A/α) using queries of U , U † , and O((m + 1) ) other primitive quantum gates.
We remark that Theorem 1 does not meet all our needs because of the constraint |P (x)| ≤ 1/2. This requirement comes from decomposing the polynomial into the sum of an even and an odd polynomial and then summing them up. When P (x) naturally has a parity this requirement becomes redundant. This enables us to get rid of 1 ancilla qubit. Also for simplicity we assume the block-encoding of A is exact. Therefore we have the following theorem, which can be proved directly from [34, Theorem 2 and Corollary 11]. Compared to methods such as LCU, one distinct advantage of QSP is that the number of extra ancilla qubits needed is only 1 as shown in Theorem 1'. Hence QSP may be possibly carried out efficiently on intermediate-term devices. Furthermore, a polynomial can be expanded into different basis functions as P (x) = k=0 c k f k (x), where f k can be the monomial x k , the Chebyshev polynomial T k (x), or any other polynomial. The performance of LCU crucially depends on the 1-norm c 1 = k=0 |c k |, which can be very different depending on the expansion [21]. The block encoding U in QSP is independent of such a choice, and therefore provides a more intrinsic representation of matrix function. We also remark that in QSP, the construction of the block-encoding U involves a sequence of parameters called phase factors. For a given polynomial P (x), the computation of the phase factors can be efficiently performed on classical computers [32,37]. There are however difficulties in computing such phase factors, which will be discussed in Section 6. For simplicity we assume that the phase factors are given and computed without error.
As an example, we demonstrate how to use QSP to solve QLSP with a Hermitian coefficient matrix A, given by its (α, m, 0)-block-encoding U A . We assume that A, b are normalized as A = 1, b|b = 1.
We also assume A is Hermitian, and therefore all the eigenvalues of A are real. General matrices can be treated using the standard matrix dilation method (see Appendix D). Due to the normalization condition, the block-encoding factor satisfies α ≥ A = 1. Later we will keep using this notation D δ to denote sets of this type. We first find a polynomial P (x) satisfying |P (x)| ≤ 1 for any x ∈ [−1, 1], and |P (x) − 1/(cx)| ≤ on D 1/(ακ) for c = 4ακ/3. Note that is the accuracy of the polynomial approximation, so that the unnormalized state P (A/α) |b would differ from the desired (α/c)A −1 |b by . In order to obtain a normalized solution P (A/α) |b / P (A/α) |b that is -close to the normalized solution |x = A −1 |b / A −1 |b , we first note that A −1 |b ≥ 1. So the normalization would amplify the error by a factor of approximately c/(α A −1 |b ) ≤ 4κ/3. Therefore we may choose = 3 /4κ. Then we can find an odd polynomial of degree O(ακ log(κ/ )), where is the desired precision, satisfying this by [32,Corollary 69]. Then by Theorem 1' we have a circuit U satisfying where |φ is orthogonal to all states of the form |0 m+1 |ψ . Measuring the ancilla qubits, we obtain the a normalized quantum state P (A/α) |b / P (A/α) |b that is -close to the normalized solution |x with probability Θ α c A −1 |b 2 .
We observe that the quadratic scaling with respect to κ is very much attached to the procedure above: each application of QSP costs O(κ) queries of U, U † , and the other from that QSP needs to be performed for O(κ) times. The same argument applies to other techniques such as LCU. To reduce the κ complexity along this line, one must modify the procedure substantially to avoid the multiplication of the two κ factors, such as using the modified LCU based on VTAA [21].

Eigenstate filtering using a minimax polynomial
Now consider a Hermitian matrix H, with a known eigenvalue λ that is separated from other eigenvalues by a gap ∆. H is assumed to have an (α, m, 0)-block-encoding denoted by U H . We want to preserve the λ-eigenstate while filtering out all other eigenstates. Let P λ denote the projection operator into the λ-eigenspace of H. The basic idea is, suppose we have a polynomial P such that P (0) = 1 and |P (x)| is small for x ∈ D ∆/(2α) , where we use the notation D δ = [−1, −δ] ∪ [δ, 1] that has been introduced earlier, then P ((H − λI)/(α + |λ|)) ≈ P λ . This is the essence of the algorithm we are going to introduce below. The reason we need to introduce the factors 2α and α+|λ| is that the block-encoding of H − λI will involve a factor α + |λ|, and this is explained in detail in Appendix A. Since |λ| ≤ α by definition of the operator norm, we have α + |λ| ≤ 2α. Therefore when λ is separated from the rest of the spectrum of H by a gap ∆, 0 is separated from the rest of the spectrum of (H − λI)/(α + |λ|) by a gap ∆/(α + |λ|) ≥ ∆/(2α) = ∆.
We use the following 2 -degree polynomial where T (x) is the -th Chebysehv polynomial of the first kind. This polynomial is inspired by the shifted and rescaled Chebyshev polynomial discussed in [52,Theorem 6.25]. A plot of the polynomial is given in Fig. 1. R (x; ∆) has several nice properties: A proof of the above lemma is provided in Appendix E. If we apply this polynomial to H − λI, Lemma 2 (i) states that R achieves the best compression ratio of the unwanted components, among all polynomials of degrees up to 2 . To prepare a quantum circuit, we define H = (H −λI)/(α+|λ|). Then we can also construct a (1, m+1, 0)-block-encoding for H (see Appendix A). The gap separating 0 from other eigenvalues of H is lower bounded by ∆ = ∆/2α, as explained at the beginning of this section. Together with the fact that H ≤ 1, we find that the spectrum of H is contained in D ∆ ∪ {0}.
We then apply Lemma 2. Note that the requirement when ∆ > 1/ √ 12 might not be satisfied, we can always set ∆ = 1/ √ 12 and this does not affect the asymptotic complexity as ∆ → 0. Because of (ii) of Lemma 2, we have Also because of (iii), and the fact that R (x; ∆) is even, we may apply Theorem 1' to implement R ( H; ∆) using QSP. This gives the following theorem:

Theorem 3. (Eigenstate filtering): Let H be a Hermitian matrix and U H is an
If λ is an eigenvalue of H that is separated from the rest of the spectrum by a gap ∆, then we can construct a (1, m + 2, )-block-encoding of P λ , by O((α/∆) log(1/ )) applications of (controlled-) U H and U † H , and O((mα/∆) log(1/ )) other primitive quantum gates.
Suppose we can prepare a state |ψ = γ |ψ λ + |⊥ using an oracle O ψ , where |ψ λ is a λ-eigenvector and ψ λ | ⊥ = 0, for some 0 < γ ≤ 1. Theorem 3 states that we can get an -approximation to |ψ λ with O((α/∆) log(1/(γ ))) queries to U H , with a successful application of the block-encoding of P λ , denoted by U P λ . The fact we have 1/(γ ) instead of 1/ in the logarithm is due to the error amplification going from an unnormalized state to a normalized state, similar to that discussed in the application of QSP to QLSP in Section 2. The probability of applying this block-encoding successfully, i.e. getting all 0's when measuring ancilla qubits, is at least γ 2 . Therefore when |ψ can be repeatedly prepared by an oracle, we only need to run U P λ and the oracle on average O(1/γ 2 ) times to obtain |ψ λ successfully. With amplitude amplification we can reduce this number to O(1/γ). However this is not necessary when γ = Ω(1), when without using amplitude amplification we can already obtain |ψ λ by using the oracle for initial state and U P λ O(1) times.
We remark that the eigenstate filtering procedure can also be implemented by alternative methods such as LCU. The polynomial R (·, ∆) can be expanded exactly into a linear combination of the first 2 + 1 Chebyshev polynomials. The 1-norm of the expansion coefficients is upper bounded by 2 + 2 because |R (x, ∆)| ≤ 1. However, this comes at the expense of additional O(log ) qubits needed for the LCU expansion [21].
Besides the projection operator, we can use this filtering procedure to implement many other related operators. First we consider implementing the reflection operator about the target λ-eigenstate (or λ-eigenspace if there is degeneracy), 2P λ − I, which is useful in the amplitude amplification procedure [13,35]. This problem has been considered in Ref. [22].
For a given Hamiltonian H, with the same assumptions as in Theorem 3, and H = (H − λI)/(α + |λ|) as constructed above, we define where P λ is the projection operator into the λ-eigenspace of H. Using a polynomial S (x; ∆) constructed from R (x; ∆) as introduced in Appendix B, we can implement the reflection operator R λ through QSP. The cost is summarized as follows: For the proof see Appendix B. This reflection operator further enables us to construct a block-encoding of the θ-reflection operator.
This operator is useful in fixed-point amplitude amplification [36,63]. The cost is summarized as follows:

Corollary 5. Under the same assumption as Theorem 3, a (1, m + 3, )-block-encoding of
The proof can be found in Appendix B. In this paper we focus on obtaining the eigenstate corresponding to an eigenvalue that is known exactly. If instead of a single known eigenvalue, we want keep all eigenvalues in a certain interval, and filter out the rest, we can use a linear combination of polynomials used to approximate the sign function [34,Lemma 14], together with constant shift. The filtering polynomial for this kind of task can also be obtained numerically through Remez algorithm [51], followed by a optimization based procedure to efficiently identify the phase factors. For more details we refer readers to Ref. [23].

Remark 6.
In the special case where H = 1, the target eigenvalue is 1, and we have access to a (1, m, 0)-block-encoding of H, then a quadratically improved dependence on the gap can be achieved using polynomials such as [52,Eq. (6.113)]. This is useful for obtaining the stationary distribution of an ergodic and reversible Markov chain because the discriminant matrix [6,7,57] can be block-encoded efficiently in a reflection operator, and its 1-eigenstate is j √ π j |j where π = (π j ) is the stationary distribution.
4 Solving QLSP: eigenstate filtering with adiabatic quantum computing To define QLSP, we assume that a d-sparse matrix A can be accessed by oracles where j, k, l, z ∈ [N ], and ν(j, l) is the row index of the l-th nonzero element in the j-th column. The right hand side vector |b can be prepared with an oracle O B as This is the same as the assumption used in [21,56]. The oracles can be used to construct a (d, n + 2, 0)-block-encoding of A [11,21]. We assume the singular values of A are contained in [1/κ, 1] for some κ > 1. Therefore κ here is an upper bound for the condition number, which is defined as the ratio between the largest and the smallest singular values. It is thus guaranteed that when A is Hermitian its eigenvalues are contained in [21] it is assumed that that A = 1 and the condition number is exactly κ [21, Problem 1], which is slightly stronger than the assumption we are currently using.

Remark 7.
We can always assume without loss of generality that A is Hermitian. Because when A is not Hermitian we can solve an extended linear system as described in Appendix D, where the coefficient matrix is This is a Hermitian matrix, and when A is d-sparse, this matrix is d-sparse as well. If A has singular values {σ k }, then the dilated Hermitian matrix has real eigenvalues {±σ k }. Therefore the two matrices have the same condition number, and when the singular values of A are contained in [1/κ, 1] the spectrum of the above dilated matrix is contained in We will then apply the method we developed in the last section to QLSP. To do this we need to convert QLSP into an eigenvalue problem. For simplicity we assume A is Hermitian positive-definite. The indefinite case is addressed in Appendix D, which uses different Hamiltonians but only requires minor modifications. We define where Q b = I − |b b|. This Hamiltonian has been used in Refs. [5,56]. As discussed in Appendix A, we can construct a (d, n + 4, 0)-block-encoding of H 1 , denoted by U H 1 by We may readily verify that the 0-eigenspace, i.e. the null space, of H 1 is spanned by |0 |x = (x, 0) , where |x is the solution, i.e. A |x ∝ |b , and |1 |b = (0, b) , by considering the null space of H 2 1 . The rest of the spectrum is separated from 0 by a gap of 1/κ [5,56]. Therefore to apply the eigenstate filtering method, we only need an initial state 2 with non-vanishing overlap with the target eigenstate |0 |x that can be efficiently prepared. We will prepare this initial state using the time-optimal adiabatic quantum computing.

Choosing the eigenpath
To use adiabatic quantum computing we need to first specify the eigenpath we are going to follow. We define and where H 1 is defined in Eq. (4).
We will then evolve the system following the 0-eigenstates of each H(f ). These eigenstates form an eigenpath linking the initial state to the solution to the linear system. There are several important properties of the Hamiltonians H(f ) and of the eigenpath which we discuss below, though some of them we will only use in the algorithm based on the quantum Zeno effect.
The null space of H(f ) is two-dimensional, and we will pay special attention to this fact in our analysis. The non-zero eigenvalues of H(f ) appear in pairs. Let λ j (f ), j = 1, 2, . . . , N − 1 be all the positive eigenvalues of H(f ), and |z j (f ) be the corresponding eigenvectors, then we may readily check Therefore −λ j (f ) is also an eigenvalue of H(f ) with corresponding eigenvector (σ z ⊗ I) |z j (f ) , for j = 1, 2, . . . , N − 1. Thus we have obtained all the non-zero eigenvalues and corresponding eigenvectors.
The form of the matrices in Eqs. (4) and (5) is important for achieving O(κ) complexity in our algorithms because they ensure the gap between 0 and other eigenvalues for all f is lower bounded by A proof can be found in [5]. Now we are ready to specify the eigenpath. For any f , we let |x(f ) be some vector such that We can then see that the null space of H(f ) is spanned by |x(f ) = |0 |x(f ) and |1 |b . This requirement pins down the choice for |x(f ) up to a time-dependent global phase. By requiring the phase to be geometric, i.e.
the eigenpath {|x(f ) } becomes uniquely defined when we require |x(0) = |b . Note the above equation is slightly problematic in that we do not know beforehand that |x(f ) is differentiable. However this turns out not to be a problem because we can establish the differentiability in Appendix F. Furthermore, we have the estimate The derivation of the existence and uniqueness of the differentiable eigenpath, together with the estimate (9) are given in Appendix F. An important quantity we need to use in our analysis is the eigenpath length and by (9) we have We also define the eigenpath length L(a, b) between 0 < a < b < 1 and it is bounded by

Time-optimal adiabatic quantum computing
Here we briefly review the procedure of solving QLSP using the recently developed timeoptimal AQC [5] and the eigenpath described in the previous section that has been used in [5,56]. As noted before, the null space of H(f ) is two-dimensional, which contains an unwanted 0-eigenvector |1 |b = (0, b) . However this 0-eigenvector is not accessible in the AQC time-evolution for scheduling function f : [0, 1] → [0, 1], which is a strictly increasing mapping with f (0) = 0, f (1) = 1. We find that for all s ∈ [0, 1]. This is due to and ( 1| b|) |ψ T (0) = 0. This fact gets rid of the problem. The parameter T needed to reach a certain target accuracy is called the runtime complexity (or simply the time complexity). The simplest choice for the scheduling function is f (s) = s, which gives the "vanilla AQC". Besides |0 |x , all other eigenstates of H 1 that can be connected to |0 |b through an adiabatic evolution are separated from |0 |x by an energy gap of at least 1/κ [5,56]. The time complexity of vanilla AQC is at least T ∼ O(κ 2 / ) [2,5,24,39].
By properly choosing a scheduling function f (s), the time complexity of AQC can be significantly improved. There are two time-optimal scheduling functions proposed in [5]. The first method is called AQC(p). For 1 < p < 2, AQC(p) adopts the schedule This reduces the time complexity to O(κ/ ), which is optimal for κ, but the scaling with respect to is the same. The second method is called AQC(exp), which uses a different scheduling function to achieve time complexity O κ log 2 (κ) log 4 log κ . All AQC methods are time-dependent Hamiltonian simulation problem, which can be implemented using e.g. truncated Dyson series for simulating the time-dependent Hamiltonian [45]. Although AQC(exp) scales near-optimally with respect to κ and , numerical evidence indicates that the preconstant of AQC(exp) can be higher than AQC(p). Hence when a low accuracy ∼ O(1) is needed, AQC(p) can require a smaller runtime in practice. In the discussion below, we will consider AQC(p).
The details of the time-dependent Hamiltonian simulation for AQC are discussed in Appendix C, and the query complexity for implementing AQC(p) on a gate-based quantum computer is O(κ/ ).

Improved dependence on
We now use eigenstate filtering to accelerate AQC(p) and reduce the query complexity to log(1/ ). As mentioned before, once we have access to H 1 defined in (4), through the block-encoding U H 1 constructed in Appendix A we only need an initial state for eigenstate filtering (note that this is not the initial state of the AQC time-evolution): with |γ 0 | = Ω(1) and |⊥ orthogonal to the null space. The initial state | x 0 can be prepared using the time-optimal AQC procedure. Again we first assume A is Hermitian positive definite. To make |γ 0 | = Ω(1) we only need to run AQC(p) to constant precision, and thus the linear dependence on precision is no longer a problem. Therefore the time complexity of AQC(p) is O(κ). However we still need to implement AQC(p) on a quantum circuit. To do this we use the time-dependent Hamiltonian simulation introduced in [45], which gives a O(dκ log(dκ)/ log log(dκ)) query complexity to achieve O(1) precision, for a d-sparse matrix A. This procedure also needs to be repeated O(1) times. It should be noted that γ 1 in Eq. (13) comes entirely from the error of the Hamiltonian simulation, since AQC should ensure that the state is orthogonal to |1 |b for all t. Details on performing this time-dependent Hamiltonian simulation is given in Appendix C. Then we can run the eigenstate filtering algorithm described in Section 3 to precision to obtain R (H 1 /d; 1/(dκ)) | x 0 . The |⊥ component will be filtered out, while the |0 |x and |1 |b components remain. To further remove the |1 |b component, we measure the first qubit. Upon getting an outcome 0, the outcome state will just be |0 |x + O( ). The success probability of applying the eigenstate filtering is lower bounded by |γ 0 | 2 + |γ 1 | 2 , and the success probability of obtaining 0 in measurement is |γ 0 | 2 /(|γ 0 | 2 + |γ 1 | 2 ) + O( ). Thus the total success probability is Ω(1). Each single application of eigenstate filtering applies U H 1 , and therefore O A,1 , O A,2 , and O B , for O(dκ log(1/ )) times. It only needs to be repeated Ω(1) times so the total query complexity of eigenstate filtering is still O(dκ log(1/ )).
The number of qubits needed in the eigenstate filtering procedure using QSP is O(n) which mainly comes from the original size of the problem and block-encoding. Extra ancilla qubits introduced as a result of eigenstate filtering is only O(1). In the Hamiltonian simulation O(n+ log(dκ)) qubits are needed (see Appendix C). Therefore the total number of qubits needed is O(n + log(dκ)).
The procedure above can be generalized to Hermitian indefinite matrices, and general matrices that are not necessarily Hermitian (see Appendix D). As discussed in Remark 7, for general matrices we should assume the singular values instead of eigenvalues of A are contained in [1/κ, 1]. Therefore our QLSP solver can be summarized as When the gate complexity of O A,1 , O A,2 , and O B are poly(n) the total gate complexity, and therefore runtime, by the above theorem, will be O(poly(n)dκ log(1/ )).

Remark 9.
Although in total we need O(n + log(dκ)) ancilla qubits, only O(log(dκ)) comes sources other than the block-encoding of A. In other words, our method only adds O(log(dκ)) ancilla qubits to those that are unavoidable as long as we use this way of block-encoding of a sparse A. These extra ancilla qubits are mainly a result of using timedependent Hamiltonian simulation. Also, although in the theorem we assumed A is a sparse matrix, we have only used this fact to build its block-encoding. Given the block-encoding of a matrix A that is not necessarily sparse, the above procedure can still be carried out directly. This is also true for Theorem 11 which we are going to introduce later.
We present numerical results obtained on a classical computer in Fig. 2 to validate the complexity estimate. In the numerical test, we solve the linear system A |x ∝ |b , where A is formed by adding a randomly generated symmetric positive definite tridiagonal matrix B, whose smallest eigenvalue is very close to 0, to a scalar multiple of the identity matrix. After properly rescaling, the eigenvalues of A lie in [−1, 1]. This construction enables us to estimate condition number with reasonable accuracy without computing eigenvalues. The off-diagonal elements of B are drawn uniformly from [−1, 0] and the diagonal elements are the negative of sums of two adjacent elements on the same row. The (0, 0) and (N −1, N −1) elements of B are slightly larger so that B is positive definite. |b is drawn from the uniform distribution on the unit sphere.
With A and |b chosen, we first run the AQC time evolution for time O(κ) as described at the beginning of this section, and then apply eigenstate filtering using the polynomial R (x; 1/dκ) with degree 2 . Denoting the resulting quantum state by | x we then compute the fidelity η = | x| x |. Fig. 2 shows the relation between η, κ, and obtained in the numerical experiment. Right: the smallest needed to achieve fixed fidelity η grows linearly with respect to condition number κ. The initial state in eigenstate filtering is prepared by running AQC(p) for T = 0.2κ, with p = 1.5, which achieves an initial fidelity of about 0.6.

Solving QLSP: eigenstate filtering with quantum Zeno effect
Quantum Zeno effect (QZE) is the phenomenon that frequent measurements hinders a quantum system's transition from its initial state to other states [9,15,26,27,46]. A variant of QZE [12, Lemma 1] can be viewed as a particular way for implementing adiabatic quantum computing [41,50,54], and this is what we mean by QZE throughout this work unless stated otherwise. The basic idea of this variant of QZE is to follow an adiabatic path through repeated measurement, which acts as projection operators to the instantaneous eigenstate along the adiabatic path. This inspired the randomization method for performing computation based on QZE [12,56].
In the context of solving QLSP, again for simplicity we first assume A is Hermitian positive definite. Instead of running time-dependent Hamiltonian simulation to evolve from the 0-eigenstate of H 0 to the 0-eigenstate of H 1 , we consider applying a series of projections to traverse the eigenpath. Choosing 0 = f 0 < f 1 < . . . < f M = 1, for each j = 0, 1, . . . , M − 1, we start from the 0-eigenstate |0 |x(f j ) of H(f j ), where |x(f ) is defined in Eqs. (7) and (8), and project into the null space of H(f j+1 ). In the end we obtain the 0-eigenstate of H(1) = H 1 . This is essentially the same as performing projective measurement for each j [12,20,56]. If the projective measurements are done approximately using quantum phase estimation or phase randomization, there will be a linear dependence on 1/ in runtime, being the desired precision.
In this section we combine eigenstate filtering with Zeno-based computation to reduce the error dependence from O(1/ ) to O(log(1/ )), thanks to the possibility of performing approximate projections with high precision. However, several issues demand our attention in the procedure outlined at the beginning of this section. First, we need to specify the choice of {f j }, which plays an important role in the lower bound of M needed to ensure at least constant success probability. Second, the null space of each H(f j ) is 2-dimensional. Therefore the eigenpath is not unique, and we need to specify the eigenpath we are going to traverse, which has been done in Sec. 4.1, and to ensure the undesired part of the null space does not interfere with our computation.

The algorithm
As in Section 4, the goal is to produce a state close to the solution state |x of the QLSP with fidelity at least 1 − for some given 0 < < 1. In this section we describe the procedure of the Quantum Zeno effect state preparation. We need to choose a scheduling function and define f j = f (s j ) where s j = j/M . Without the scheduling we will end up with an unfavorable square dependence on the minimum spectral gap along the eigenpath [20]. This scheduling is chosen so that which implies we are dividing the interval [0, 1] of f into M segments of equal L * -length. Before we describe the algorithm we need to first introduce some notations and blockencodings we need to use. From the block-encoding of H 0 and H 1 described in Appendix A, we can construct (1 − f + f d, n + 6, 0)-block-encoding for each H(f ), denoted by U H (f ). This construction uses [34,Lemma 29], through We need to use H 1 /d instead of H 1 because there is a d factor involved in the blockencoding of H 1 (see Appendix A) , and the above equation shows we get a 1 − f + f d factor in the block-encoding of H(f ) because we need to normalize the coefficient vector |c . For a more detailed discussion see Appendix A. Applying the eigenstate filtering procedure in Section 3 to precision P gives us an (1, n + 7, P )-block-encoding of which we denote by U P 0 (f ). By Theorem 3 this uses U H (f ) and its inverse O( d ∆ * (f ) log( 1 P )) times. Note that one ancilla qubit introduced in Theorem 3 is redundant because we do not need to shift by a multiple of the identity matrix. By definition of block-encoding we have Here for clarity we use I r to denote the identity operator acting on r qubits. Note that we need access to which is the projection operator onto |x(f ) , instead ofP 0 (f ), which is the projection operator onto |0 |x(f ) . We now consider how to approximate P 0 (f ). Because of the fact Accepted in Quantum 2020-11-06, click title to verify. Published under CC-BY 4.0. 16 and P 0 (f ) approximates P 0 (f ) by the following inequalities: Therefore U P 0 (f ) is an (1, n + 8, P )-block-encoding of P 0 (f ).
As discussed in Section 4.1, the eigenpath we want to follow is {|0 |x(f ) }. However the approximate projection using eigenstate filtering only allows us to approximately follow this eigenpath. We denote the approximate states by | x(f j ) ≈ |x(f j ) , and will take into account the error of this approximation in our analysis.
With the block-encoding of P 0 (f ) we can describe the algorithm is as follows: 1. Given 0 < < 1 and κ > 1 as well as the oracles mentioned at the beginning of Section 4. Set M = 4 log 2 (κ) 3. Apply the (1, n+8, P )-block-encoding U P 0 (f j ) of P 0 (f j ), constructed using eigenstate filtering with a polynomial of sufficiently high degree constructed in Lemma 2, to 4. Measure the n + 8 ancilla qubits.
(a) If not all outputs are 0 then abort and return to Step 2.
(b) If all outputs are 0, and further j < M − 1, then let | x(f j ) be the state in the main register that has not been measured, let j ← j + 1, and go to Step 3. If all outputs are 0 and j = M − 1 then go to next step.
(a) If not all outputs are 0 then abort and return to Step 2.
(b) If all outputs are 0, then output | x(1) in the main register.
Here | x(f j ) are defined recursively in Steps 3 and 4 in the algorithm, starting with | x(0) = |b . We can write down the recursion more concisely: Going from | x(f j−1 ) to | x(f j ) has a success probability P 0 (f j ) | x(f j−1 ) 2 . We will show in the next section as well as in Appendix G that the the final success probability, which is the product of the success probabilities of these individual steps, does not go to 0. We emphasize that {| x(f ) } is defined only for f = f j rather than arbitrary f ∈ [0, 1].
We use this notation only to be consistent with the notation |x(f ) .

Remark 10 (Choice of precision parameters).
There are two precision parameters involved in the above discussion: and P . Here is the target accuracy specified as part of our task, while P is a parameter that is chosen by the algorithm according to Step

Success probability, fidelity, and complexities
In this section we discuss the success probability of the algorithm described in the previous section, prove the fidelity of the output state is lower bounded by 1 − for the given when P and M are chosen as in Step 1 of the algorithm, and finally estimate the query and gate complexities. We first give a lower bound for success probability assuming for simplicity each projection is done without error, i.e. P = 0. This is done so that we do not need to distinguish between eigenstates and approximate eigenstates produced using eigenstate filtering, thus making the derivation less technical. A rigorous lower bound, assuming a finite P > 0, will be given in Appendix G. Under this assumption we have we have where the we have used Eq. (15). This inequality holds for M ≥ 4 log 2 (κ) (1−1/κ) 2 as required in the previous section.
Therefore we have shown the success probability is lower bounded by 1/4. The success probability when taking into account errors in each approximate projection, or in other words when we choose P = 1/162M 2 according to our algorithm rather than setting it to 0, is still lower bounded by a constant, which is proved in Appendix G.
We then analyze the fidelity and complexities of our algorithm. Here we no longer assume P = 0, and the following discussion is therefore rigorous. In Appendix G it is shown that , which allows us to bound the error as, The derivation is similar to that of Eq. (A10), and we have used the fact that P 0 (f M ) − P 0 (f M ) ≤ /4 because in Step 5 our algorithm in the previous section sets the eigenstate filtering accuracy to be /4 instead of P . Therefore the state | x(1) prepared in this way has a fidelity at least 1 − .
We then estimate the computational costs. At each j we need to apply an (1, n+8, P )block-encoding U P 0 (f j ) of P 0 (f j ) to | x(f j−1 ) obtained form the last step. From the analysis in Appendix G we need P ≤ 1/162M 2 . Therefore we need to apply U H (f j ) and its inverse O 1−f j +df j ∆ * (f j ) log( 1 P ) times. In total for j = 1, 2, . . . , M −1 the number of queries to U H (f ) is of the order for a d-sparse matrix A and κ is the condition number of A. Then in the last step for j = M , which is Step 5 in the algorithm in Section 5.1, we need to achieve accuracy /4 for the eigenstate filtering. Therefore we need to apply the block-encoding U P 0 (1) with O(dκ log( 1 )) queries to U H (1). As M = O(log 2 (κ)), adding the query complexity of the last step to (23), and using the fact P = O(1/M 2 ), gives us the total query complexity of a single run O (dκ (log(κ) log log(κ) + log(1/ ))) .
Because the success probability is Ω(1), the procedure needs to be run for an expected O(1) times to be successful, and therefore the total complexity remains the same.
Since  24) is also the query complexity to these oracles.
Because the only thing we need to do in this method to solve QLSP is to repeatedly use QSP to do projection, no additional qubits are involved for time-dependent Hamiltonian simulation as in the previous AQC-based method. The total number of qubits is therefore O(n). The number of additional primitive gates required can be estimated similarly to the number of queries, which scales as O ndκ log(κ) log log(κ) + log( 1 ) .
For the case when A is indefinite, we use a different pair of H 0 and H 1 as discussed in Appendix D. The generalization to non-Hermitian matrices is the same as for Theorem 8, and it can be found in Appendix D as well. All other procedures are almost exactly the same. We summarize the results in the following theorem: The reason we put requirement on the singular values of A instead of its eigenvalues is stated in Remark 7. Just like in the case of AQC-based QLSP algorithm, here if we have O(poly(n)) gate complexity for the oracles O A,1 , O A,2 , and O B , then the total gate complexity will be O(poly(n)dκ log(1/ )). Although we use O(n) qubits in total, the extra ancilla qubits we introduce in this method is in fact only O(1). This is a further improvement from the O(log(dκ)) ancilla qubits in the AQC-based QLSP algorithm.
We remark that there is the possibility to further slightly improve by a log(κ) factor (ignoring log log terms) the asymptotic complexity of our QZE-based QLSP solver by using the fixed-point amplitude amplification to go from |x(f j ) to |x(f j+1 ) for each j, as discussed in [60,Corollary 1]. The bounds in this paper for many constant factors involved, particular those used in estimating the success probability of the QZE-based QLSP solver, are rather loose. However this does not concern us very much because we care mainly about the asymptotic complexity. Tighter estimates can be helpful for the actual implementation of our methods.

Discussion
In this paper, we have developed a quantum eigenstate filtering algorithm based on quantum signal processing (QSP). Our algorithm achieves the optimal query complexity among all polynomial-based eigenstate filtering methods, and uses a minimal amount of ancilla qubits. We demonstrate the usage of the eigenstate filtering method to solve quantum linear system problems (QLSP) with near-optimal complexity with respect to both the condition number κ and the accuracy . In the case when the precise value of κ is not known a priori, the knowledge of an upper bound of κ would suffice.
The problem of directly targeting at the solution A −1 |b is that a (β, m, ) blockencoding of A −1 requires at least β ≥ κ to make sure that A −1 /β ≤ 1. Therefore the probability of success in the worst case is already Ω(κ −2 ), and the number of rounds of amplitude amplification needed is already O(κ). Therefore to achieve near-optimal complexity, this approach can only query the block-encoding of A for O(polylog(κ)) times. To our best knowledge, there is no known method to achieve this for general matrices.
However this might be possible for matrices with special structures and will be studied in future work.
Motivated by the success of AQC, our algorithm views QLSP as an eigenvalue problem, which can be implemented via P | x 0 , where P is an approximate projection operator, and P | x 0 encodes the solution |x . The advantage of such a filtering procedure is that P is a projector and P = 1 . Hence its (β, m, ) block-encoding only requires β ∼ O(1). Therefore assuming O(1) overlap between | x 0 and the solution vector, which can be satisfied by running the time-optimal AQC to constant precision, the probability of success of the filtering procedure is already Ω(1) without any amplitude amplification procedure. This accelerates the query complexity of the recently developed time-optimal AQC from O(κ/ ) to O(κ log(1/ )). The efficient gate-based implementation of AQC still requires a time-dependent Hamiltonian simulation procedure (shown in Appendix C). We then demonstrate that the dependence on the time-dependent Hamiltonian simulation procedure can be removed, using an algorithm based on the quantum Zeno effect, and the complexity is O(κ log(1/ )). Both algorithms have constant probability of success, and can prepare the solution in terms of a pure state.
It is worth noting that the eigenstate filtering method developed in this paper works only for the case when the eigenvalue corresponding to the desired eigenstate is known exactly, which is satisfied in the eigenvalue formulation of QLSP. In order to implement the QSP-based eigenstate filtering procedure, one still needs to find the phase factors associated with the block encoding U . For a given polynomial R (·, ∆), the phase factors are obtained on a classical computer in time that is polynomial in the degree and the logarithm of precision [32,. However, this procedure requires solution of all roots of a high degree polynomial, which can be unstable for the range of polynomials ∼ 100 considered here. The stability of such procedure has recently been improved by Haah [37], though the number of bits of precision needed still scales as O( log( / )). Significant progress has been achieved recently, enabling robust computation of phase factors for polynomials of degrees ranging from thousands to tens of thousands [18,23]. We note that these phase factors in the eigenvalue filtering procedure only depend on ∆ and , and therefore can be reused for different matrices once they are obtained on a classical computer.

A Block-encoding
The technique of block-encoding has been recently discussed extensively [34,44]. Here we discuss how to construct block-encoding for H − λI which is used in eigenstate filtering, and Q b , H 0 , and H 1 which are used in QLSP and in particular the Hamiltonian simulation of AQC. We first introduce a simple technique we need to use repeatedly.
Now we construct a block-encoding of Q b = I − |b b| with |b = O B |0 . Let S 0 = I − 2 |0 n 0 n | be the reflection operator about the hyperplane orthogonal to |0 n . Then b| is the reflection about the hyperplane orthogonal to |b . Note that Q b = (S b +I)/2. Therefore we can use the technique illustrated in Fig. A1 to construct  a (1, 1, 0 we naturally obtain a (1, 1, 0)-block-encoding of H 0 . We denote the block-encoding as U H 0 .
For the block-encoding of H 1 , first note that From the block-encoding of Q b , we can construct the block-encoding of controlled-Q b by replacing all gates with their controlled counterparts. The block matrix in the middle is σ x ⊗ A. For a d-sparse matrix A, we have a (d, n + 2, 0)-block-encoding of A, and therefore we obtain a (d, n + 2, 0)-block-encoding of σ x ⊗ A. Then we can use the result for the product of block-encoded matrix [34,Lemma 30] to obtain a (d, n + 4, 0)-block-encoding of H 1 , denoted by U H 1 .
The block-encodings of H 0 and H 1 allow us to block-encode linear combinations of them as well. We need access to H(f ) = (1 − f )H 0 + f H 1 which is used extensively in Section 5. This is done through [34,Lemma 29]. When applying the lemma we need the state preparation pair (P L , P R ) such that The presence of the factor d is because H 1 is subnormalized by a factor of d in its blockencoding. By this lemma we obtain a (1 − f + f d, n + 6, 0)-block-encoding of H(f ).
Here 1 − f + f d comes from the normalizing factor in the state preparation pair, and n + 6 is the sum of the numbers of ancilla qubits used in the block-encodings of H 0 and H 1 , plus one additional qubit used for the state preparation pair.

B Implementing the reflection operator and θ-reflection operator
In this appendix we prove Theorem 4 and Corollary 5 by constructing the quantum circuits.
In both the theorem and the corollary we assume, as in Theorem 3, that H is a Hermitian matrix and U H is an (α, m, 0)-block-encoding of H. Also λ is an eigenvalue of H that is separated from the rest of the spectrum by a gap ∆.
We first prove Theorem 4 by constructing the circuit for the reflection operator where P λ is the projection operator into the λ-eigenspace of H. To do this we use the following polynomial The first thing we should notice about this polynomial is that it is even and therefore can be implemented via QSP by Theorem 1'.
and Therefore U R is an (1, m + 2, 4 )-block-encoding of R λ . Thus we have proved Theorem 4. We then prove Corollary 5 by constructing a block-encoding of the θ-reflection operator P λ + e iθ (I − P λ ).
One might be tempted to directly find a polynomial to approximate this matrix function. However such a polynomial would have complex coefficients, and we would need to apply QSP to the real and imaginary parts separately. This in turn needs an extra LCU step to add the two parts up, resulting in reduced success probability. Therefore instead of using a new polynomial, we use the block-encoding U R we have already constructed, and then apply a 1-bit phase estimation on it. This enables u s to distinguish between the λ-eigenspace and its orthogonal complement, since all the eigenvalues of R λ are either 1 or −1. We then apply the phase factor e iθ only to the correct subspace. Finally we uncompute the additional ancilla qubit. The circuit takes the following form, as shown in Figure A2: Figure A2: The quantum circuit for implementing the θ-reflection operator. H is the Hadamard gate and R(θ) = |0 0| + e iθ |1 1| is the phase-shift gate.
We introduced one additional ancilla qubit in the initial state |0 , and the second register in the above circuit is for the ancilla qubits in Theorem 4. The last register is the main register prepared in the state |ψ on which we want to apply the operator P λ + e iθ (I − P λ ). Thus we have proved Corollary 5.
C Gate-based implementation of time-optimal adiabatic quantum computing In Theorem 8 we used an adiabatic time evolution to prepare an initial state for eigenstate filtering. In this appendix we discuss how to implement this time evolution on a gate-based quantum computer. Consider the adiabatic evolution Where (5) and (4). It is proved in [5,56] that the gap between 0 and the rest of the eigenvalues of H(f ) is lower bounded by 1 − f + f /κ. With this bound the scheduling (12) in the AQC(p) scheme results in O(κ/ ) runtime complexity to solve QLSP. As mentioned before, the fact that the 0-eigenspace of H(f (s)) is two dimensional is not a problem because |ψ T (t) is orthogonal to |1 |b for all t.
In order to carry out AQC efficiently using a gate-based implementation, we use the recently developed time-dependent Hamiltonian simulation method based on truncated Dyson series introduced in [45]. In Hamiltonian simulation, several types of input models for the Hamiltonian are in use. Hamiltonians can be input as a linear combination of unitaries [10], using its sparsity structure [1,43], or using its block-encoding [44,45]. In the gate-based implementation of the time-optimal AQC, we construct HAM-T in Fig. A3. We need to use the block-encodings U H 0 and U H 1 introduced in Appendix A, which requires n 0 = 1 and n 1 = n + 4 ancilla qubits, respectively. Our construction of HAM-T satisfies for any s ∈ S = {j/2 l : j = 0, 1, . . . , 2 l − 1}.
|0 V 2 Figure A3: Quantum circuit for HAM-T. The registers from top to bottom are: (1) input register for s (2) register for storing f (s) (3) register for a control qubit (4) ancilla register for U H0 (5) main register for input state |φ (6) ancilla register for U H1 (7) register for changing normalizing factor from α(s) to d.
In this unitary HAM-T we also need the unitary to compute the scheduling function needed in the time-optimal AQC, and the unitaries where α(s) = 1−s+ds. Here V 1 is used for preparing the linear combination (1−f (s))U H 0 + f (s)U H 1 . Without V 2 the circuit would be a (α(s), l + n 0 + n 1 + 2, 0)-block-encoding of s |s s| ⊗ H(s), but with V 2 it becomes a (d, l + n 0 + n 1 + 2, 0)-block-encoding, so that the normalizing factor is time-independent, as is required for the input model in [45].
For the AQC with positive definite A we have n 0 = 1 and n 1 = n+4. For the Hermitian indefinite case we have n 0 = 2 and n 1 = n + 4. The increase of n 0 from 1 to 2 is due to the additional operation of linear combination of matrices. For H 1 we can perform one less matrix-matrix multiplication, and hence the value of n 1 remains unchanged (see Appendix D).
Following [45,Corollary 4], we may analyze the different components of costs in the Hamiltonian simulation of AQC. For time evolution from s = 0 to s = 1, HAM-T is a (dT, l + n 0 + n 1 + 2, 0)-block-encoding of s |s s| ⊗ T H(s). With the scheduling function given in [5]

D The matrix dilation method
In Theorem 8 and Theorem 11, in order to extend the time-optimal AQC method, and the QZE-based method to Hermitian indefinite matrices, we follow [5,Theorem 2], where H 0 and H 1 , as constructed in Ref. [56] are given by , Here σ ± = (σ x ± iσ y )/2 and Q +,b = I 2N − |+ |b +| b|. The dimension of the dilated matrices H 0 , H 1 is 4N . The lower bound for the gap of H(f ) then becomes (1 − f ) 2 + f 2 /κ 2 [56]. However in order to simplify our analysis we give a weaker lower bound which differs from the gap lower bound in (6) by a factor of √ 2. The initial state is |0 |− |b , where |− = 1 √ 2 (|0 − |1 ), and the goal is to obtain |0 |+ |x . In the AQCbased QLSP solver, after running the AQC we can remove the second qubit by measuring it with respect to the {|+ , |− } basis and accepting the result corresponding to |+ . The resulting query complexity remains unchanged. We remark that the matrix dilation here is only needed for AQC. The eigenstate filtering procedure can still be applied to the original matrix of dimension 2N . The same is true for the QZE-based method.
For a general matrix, we may first consider the extended linear system. Define an extended QLSP A |x = |b in dimension 2N where Here A is a Hermitian matrix of dimension 2N , with condition number κ and A = 1, and |x = |1, x solves the extended QLSP. Therefore the time-optimal AQC and the QZE procedure can be applied to the Hermitian matrix A to prepare an -approximation of x. The dimension of the corresponding H 0 , H 1 matrices is 8N . Again the matrix dilation method used in Eq. (A6) is not needed for the eigenstate filtering step.
Lemma 12 shows that for any y / ∈ D ∆ ,  To prove (ii) of Lemma 2, we need to use the following lemma, which directly follows from [52, Eq. (6.112)]:

F Properties of the eigenpath
In this section we construct a smooth one-parameter family of normalized quantum states {|x(f ) } satisfying Eqs. (7) and (8). {|0 |x(f ) } then gives an eigenpath of the oneparameter family of Hamiltonians {H(f )}. We also prove the inequality (9).
We This is a linear ODE and the right-hand side depends smoothly on f . Therefore the solution exists and is unique for f ∈ [0, 1]. It then follows that this construction of |x(f ) satisfies (7). Since we have