Efficient quantum algorithm for solving structured problems via multi-step quantum computation

In classical computation, a problem can be solved in multiple steps where calculated results of each step can be copied and used repeatedly. While in quantum computation, it is difficult to realize a similar multi-step computation process because the no-cloning theorem forbids making copies of an unknown quantum state perfectly. We find a method based on quantum resonant transition to protect and reuse an unknown quantum state that encodes calculated results of an intermediate step without making copies of the state, and present a quantum algorithm that solves a problem via a multi-step quantum computation process. This algorithm can achieve an exponential speedup over classical algorithms in solving a type of structured search problems.


I. INTRODUCTION
Solving a problem on a quantum computer can be transformed to finding the ground state of a problem Hamiltonian that encodes the solution to the problem. The phase estimation algorithm (PEA) [1,2] projects an initial state onto the ground state of the problem Hamiltonian with probability proportional to the square of the overlap between them. However, it is difficult to find a good initial state for a complicated system. By using amplitude amplification, quantum algorithms can achieve quadratic speed-up over classical algorithms in preparing the ground state of a quantum many-body system [3]. In adiabatic quantum computing (AQC) [4], the system is evolved adiabatically from the ground state of an initial Hamiltonian to that of the problem Hamiltonian. The efficiency of AQC depends on the minimum energy gap between the ground and the first excited states of the adiabatic Hamiltonian, which is difficult to estimate in most cases. Quantum Zeno effect [5,6] can be used to keep a quantum computer near ground state of a smoothly varying Hamiltonian by performing frequent measurements, and has the same efficiency as AQC.
The structure of a problem is the key for whether it can be solved efficiently or not on a quantum computer. In Refs. [7,8], a nested search algorithm was proposed for problems that can be divided into two (or more) levels described by a set of primary and secondary variables, respectively. It works by nesting one quantum search within another, and performing quantum search at a selected level among partial solutions to narrow subsequent search over their descendants. The complete solution is constructed through a tree of partial solutions at different levels. This algorithm achieves quadratic speedup over the corresponding classical nesting algorithms, and can be faster than the usual Grover bound for unstructured search.
In general, the constraints of a problem contain variables that are coupled to each other, the variables may be divided into only a few sets, thus the search space is still exponentially large.
In the circuit model, a quantum computation is performed by first preparing qubits in an initial state, then applying a series of unitary operations, finally measuring the qubits to obtain calculation results. While in classical computation, a problem can be solved in multiple steps, where each step contains a computation procedure as shown in Fig. 1: with calculated results of the previous step as input, one performs a calculation, then checks if the results satisfy certain conditions; if the conditions are satisfied, then continue calculation of the next step, otherwise, repeat the procedure iteratively until the desired results are obtained. This process is easy to implement in classical computation since calculated results of each step can be copied and used repeatedly, the runtime is proportional to the number of computation steps. In quantum computation, however, it is difficult to realize a similar multi-step quantum computation process due to the restriction of the no-cloning theorem [9,10], which forbids making copies of an unknown quantum state perfectly. Calculated results encoded in an unknown quantum state cannot be used by making copies as in classical computation. Therefore in multi-step quantum computation, if one fails to obtain desired results of a step, one has to run the algorithm from beginning again. This leads to the result that the runtime scales exponentially with the number of steps of the algorithm.
We find a method to protect and reuse an unknown quantum state that encodes calculated results of an intermediate step without copying it. Using this method, we present a quantum algorithm for finding the ground state of a problem Hamiltonian via multi-step quantum computation. And apply it for efficiently solving a type of structured search problems that can be decomposed in a more general way than that of in Refs. [7,8], in which the search space of the problems is reduced in polynomial rate to the target state, while it is difficult to solve them through the usual quantum computation process.
The idea of the algorithm is as follows: we construct an evolution path from an initial Hamiltonian H 0 to a problem Hamiltonian H P by inserting between them a sequence of intermediate Hamiltonians {H l , l = 1, · · · , m − 1}, through which H 0 reaches H P as H 0 → H 1 → · · · → H m−1 → H P = H m . We start from the ground state |ϕ  [11,12].
For Hamiltonians that can be simulated efficiently on a quantum computer, the algorithm can be run efficiently if: i) overlaps between ground states of any two adjacent Hamiltonians and, ii) energy gap between the ground and the first excited states of each Hamiltonian, are not exponentially small. The conditions can be reduced to simpler form for problems with special structures.
Compared with the algorithm in Ref. [5], our algorithm is flexible in designing evolution paths. As we demonstrate later, our algorithm can solve a type of structured search problems efficiently through a path even when the usual AQC algorithm, which has the same efficiency as the algorithm in [5], fails following the same path.

II. THE ALGORITHM
We describe the algorithm by using one of its steps as example. By optimizing the algorithm in [11,12], one qubit is saved in this algorithm. It requires (n + 1) qubits with one probe qubit and an n-qubit register R representing a problem of dimension N = 2 n .
In the l-th step, given the Hamiltonians H l , H l−1 and its ground state |ϕ where H (l) I N is the N-dimensional identity operator, and σ x, z are the Pauli matrices. The first term in Eq. (1) is the Hamiltonian of the probe qubit, the second term contains the Hamiltonian of the register R and describes the interaction between the probe qubit and R, and the third term is a perturbation. The parameter α l is used to rescale energy levels of H l−1 , and the ground state energy of α l H l−1 is used as a reference point to the ground state eigenvalue of H l , and c ≪ 1. We estimate the range of the ground state eigenvalue E (l) 0 of H l and obtain the estimated transition frequency range [ω min , ω max ] between states |ϕ (l−1) 0 and |ϕ (l) 0 . Then discretize the frequency range into a number of grids and use them as detection frequency of the probe qubit. Procedures of the l-th step of the algorithm are as follows: i) Set the probe qubit in a frequency from the frequency set, and initialize it in its excited state |1 and the register R in state |ϕ iii) Read out the state of the probe qubit.
We repeat procedures ii)-iii) a number of times. If the measurement on the probe qubit results in state |1 , it indicates that register R remains in state |ϕ (l−1) 0 , then we run procedures ii)-iii) by setting the probe qubit in another frequency. Otherwise if the probe qubit decays to state |0 , it indicates a resonant transition from state |1 |ϕ 0 of H l can be obtained by locating resonant transition frequency of the probe qubit that satisfies E can be prepared by running the above procedure at the resonant transition frequency [11,12]. With As resonant transition occurs, the system is approximately in state 1 − p is the decay probability of the probe qubit of l-th step, and d is obtained on register R, then we run (l + 1)-th step of the algorithm. Otherwise if the probe is in state |1 , it means R remains in state |ϕ (l−1) 0 , we repeat procedures ii)-iii) by setting the probe in the resonant transition frequency until it decays to state |0 . By protecting calculated results of an intermediate step in this entangled state, we do not need to run the algorithm from beginning once it fails to obtain the desired state in a step of the algorithm.
We just repeat procedures of the step until the desired state is obtained. With this property, desired state of each step is obtained deterministically in polynomial time if the conditions of the algorithm are satisfied. Here "deterministically" means that by running the procedures of a step repeatedly, we know exactly when the desired state of the step is obtained from the outcome of measurement on the probe qubit. The number of times the procedures have to be repeated is proportional to 1/p (l) 0 . Therefore, runtime of the algorithm is proportional to m l=1 1/p (l) 0 , which scales linearly with the number of steps of the algorithm, provided p (l) 0 are not exponentially small.
There are various ways to construct evolution paths that satisfy conditions of the algorithm. Here we present two methods: i) for a system Hamiltonian H 0 + V , by writing 1]) and discretizing the parameter g, intermediate Hamiltonians ) can be constructed [6]. The parameters g l can be adjusted to make d (l) 0 finite; ii) the system Hamiltonian can be a Hamiltonian matrix, intermediate Hamiltonian matrices can be constructed by spanning the system Hamiltonian in a sequence of basis sets with increasing dimension, such that the matrix H l−1 is contained in a subspace of the following matrix H l . The dimension of the basis sets can be adjusted to make d (l) 0 to be finite. The path can also be constructed considering the structure of the problem as below.
In l-th step, the probability of the initial state being evolved to the state |0 |ϕ where (see Appendix A for details). If the energy gap E (l) 0 are not exponentially small, i.e., bounded by a polynomial function of the problem size, then a l is finite and the error in the l-th step is bounded by a 2 l c 2 . Considering errors accumulated in all steps, the success probability of the algorithm satisfies where a max is the maximum value of a l . The coefficient c can be set such that a max c < 1/ √ m, then P succ > 1/e in the asymptotic limit of m. The runtime of each step is proportional to π/(2cd (l) 0 ), therefore the runtime of the algorithm scales as O m l=1 We need to find the accurate ground state eigenvalues of the intermediate Hamiltonians, and do not need to know the accurate overlap d (l) 0 between the ground states of two adjacent Hamiltonians, the algorithm can be performed by using an estimated instead of the optimal runtime. These will cause extra cost, but the scaling is the same, which is proportional to the number of steps of the algorithm (see Appendix A).
The time evolution operators U(t) = exp −iH (l) t can be implemented efficiently using Hamiltonian simulation algorithms [13,14] for simulatable Hamiltonians. Our algorithm requires performing a single-qubit measurement and resetting the probe qubit to its excited state, such techniques have been realized in ion-trap experiment [15]. We now apply the algorithm for solving a type of structured search problems.

III. SEARCH PROBLEM WITH A SPECIAL STRUCTURE
The unstructured search problem is to find a marked item in an unsorted database of N items using an oracle that recognizes the marked item. The oracle is defined in terms of a problem Hamiltonian H P = −|q q|, where |q is the marked state associated with the marked item. The initial Hamiltonian is defined as We consider a structured search problem that can be decomposed by using m (in order of O (log N)) oracles to construct a sequence of intermediate Hamiltonians where and H m = H P and Π m only contains the target state |q , and Π 1 ⊃ · · · ⊃ Π m−1 ⊃ Π m with sizes N 1 , · · · , N m−1 , N m = 1, respectively. If N i /N i−1 (i = 1, 2, · · · , m) are not exponentially small, the problem can be solved efficiently in m steps by using our algorithm.
Eq. (4) can be written as where ξ = 1 − N i N and I N i +1 is the identity matrix of dimension N i + 1. The eigenvalues of the ground and the first excited states of H i are E (i) N is the energy gap between them and reaches minimum √ 11/3 √ 3 ≈ 0.638 at N i /N = 1/3. Let e = (1, · · · , 1) T and 0 = (0, · · · , 0) T be N i ×1 vectors, respectively, is orthogonal to e. These eigenstates are uncoupled from the ground and the first excited states of H i [18]. The condition for resonant transition between states |1 |V is satisfied by setting ω = 1 and After normalization, the overlap between the ground states of two adjacent intermediate Hamiltonians is The components x We find some problems have the structure described above [16], as an example, we apply our algorithm for solving the Deutsch-Jozsa problem (see Appendix B). Grover's algorithm cannot achieve the same efficiency as our algorithm in solving the structured search problem by using m oracles (see Appendix D). The unstructured search problem has one marked item and exponential unmarked items, the ratio 1/N is exponentially small. It cannot be divided further, and the conditions of our algorithm cannot be satisfied. Our algorithm has the same efficiency as Grover's algorithm [17] and AQC algorithm [18,19] in solving the unstructured search problem (see Appendix C).

IV. COMPARISON OF THE ALGORITHM WITH ADIABATIC QUANTUM COMPUTING
In AQC, a system evolves from the ground state of an initial Hamiltonian to that of the problem Hamiltonian under driving Hamiltonian varying adiabatically from the initial Hamiltonian to the problem Hamiltonian. In our algorithm, the ground state of the problem Hamiltonian is induced step by step through QRT following a path from the initial Hamiltonian to the problem Hamiltonian. The structured search problem is solved efficiently.
Applying AQC for this problem with adiabatic Hamiltonian H(s) = (1 − s)H 0 + sH P , s ∈ [0, 1], the minimum energy gap between the ground and the first excited states of H(s) What about applying AQC for this problem using the same path as our algorithm?
We set N i /N i−1 to be finite, thus the conditions of our algorithm are satisfied. Let the system evolve from the ground state of H i−1 to that of H i under adiabatic Hamiltonian Fig. 2, we draw the energy spectrum of H ′ i (s) vs. s where 0 < s < 1 by setting N i /N = 1/30, 1/50 and 1/150, respectively. As N i /N becomes small, the minimum energy gap between the ground and the first excited states decreases quickly as s → 0, and scales as O(1/N 2 ) at the asymptotic limit of N (see see Appendix E). Thus the usual AQC algorithm cannot solve this problem efficiently using the path of our algorithm. The reason for this may due to the structure coefficients N i of the problem are used in constructing the intermediate Hamiltonians. It has been found that for adiabatic path constructed in linear interpolation of two Hamiltonians, gaps can become super-exponentially small, the time for adiabatic evolution is longer than the time required for even a classical brute force search [20,21]. In see Appendix F, we summarize the performance of different algorithms for solving the structured search problems.

V. DISCUSSION
We present a quantum algorithm that solves a problem through a multi-step quantum computation process in which an unknown quantum state can be protected and reused without copying it. The runtime is proportional to the number of steps of the algorithm, provided the conditions of the algorithm are satisfied. We find a type of structured search problems can be solved efficiently by using our algorithm. Classically one has to check the items one by one to find the target item in solving these problems, the cost scales as the number of items O(N). Our algorithm achieves an exponential speedup over classical algorithms in solving these problems in time that scales O(log N).
In Ref. [20], a jagged adiabatic path approach was proposed for running AQC by using a sequence of Hamiltonians as stepping stones. This approach can have the same complexity as our algorithm by using the same intermediate Hamiltonians. It requires to project out the ground state of each Hamiltonian to form an adiabatic path. In comparison, our algorithm is much simpler, it needs only one ancilla qubit, and the implementation requires only Hamiltonian simulation for which there are optimal quantum algorithms [13,14] for simulatable Hamiltonians. Our algorithm of multi-step quantum computation can be used for universal quantum computing and developing new quantum algorithms for other problems. In the following appendix, we present the error analysis of the algorithm in the main text in Appendix A. In Appendix B, we apply our algorithm for solving the Deutsch-Jozsa problem; in Appendix C, we apply our algorithm for solving the unstructured search problem; in Appendix D, we apply Grover's algorithm for solving the search problem with a special structure by using a number of different oracles; in Appendix E, we study the application of the quantum adiabatic algorithm for solving the search problem with a special structure via the same evolution path as our algorithm; and in Appendix F, we summarize the performance of different algorithms for solving the search problem with a special structure.

Appendix A: Error analysis
In the l-th step of the algorithm, we are given Hamiltonians H l , H l−1 and its ground state |ϕ (l−1) 0 and the ground state eigenvalue E (l−1) 0 that have been obtained from the previous (l − 1)-th step, the goal is to prepare the ground state |ϕ (l) 0 and obtain its corresponding eigenvalue E (l) 0 of the Hamiltonian H l . This can be achieved via the quantum resonant transitions (QRT) method by optimizing the algorithm in Ref. [11,12]. The algorithm requires (n + 1) qubits with one probe qubit and an n-qubit quantum register R representing a Hamiltonian of dimension N = 2 n . The Hamiltonian for the l-th step of the algorithm is constructed as where H (l) and I N is the N-dimensional identity operator, σ x, z are the Pauli matrices. The first term in Eq. (A1) is the Hamiltonian of the probe qubit, the second term describes the interaction between the probe qubit and the register R, and the third term is a perturbation, where c ≪ 1 and α l is an adjustable parameter. The Hamiltonians H l−1 and H l have eigenstates , and H l |ϕ j , respectively, where j = 0, · · · , N − 1. For some problems, e.g. the search problem with a special structure in the main text 0 . This will add extra finite cost of the algorithm. Now we describe how to obtain the ground state eigenvalue E (l) 0 accurately. In order to obtain the accurate E (l) 0 , we need to locate the accurate resonant transition frequency that corresponds to the maximum transition probability of the probe qubit for a given estimated runtime t. In searching for the resonant transition frequency, we discritize an estimated probe frequency range into a number of grids to form a frequency set. The width of the grids should be smaller than the width of the transition peaks of the probe qubit, which is given by max cd (l) 0 , 1/t [22]. We set the probe qubit in a frequency, and run the procedures of the algorithm for a number of times. If a resonant transition is not observed, we try the next frequency and run the algorithm. The cost of this process is proportional to the number of frequency points in the discretized frequency set. Here we note that in general, the transition frequency ω of a qubit in a digital quantum computer is fixed. While in our algorithm, variation of the transition frequency ω of the probe qubit can be realized equivalently by adjusting the parameter α l , e.g. for the probe qubit frequency to be varied in frequency range [ω min , ω max ], this can be equivalently realized by setting the parameter In order to obtain the accurate value of E (l) 0 , we need to locate the accurate resonant transition frequency corresponding to the maximum transition probability of the probe qubit for a given estimated runtime t. We may not obtain it in one step, most likely we have to try a number of times back and forth around the accurate resonant transition frequency.
Suppose we are trying the frequencies of the probe qubit from small to large values, if we pass the accurate value, we need to go back and try another frequency. This can be done by modifying the Hamiltonian in Eq. (A2) to switch the adjacent Hamiltonians H l−1 and H l : In the following, we estimate errors introduced when running the algorithm by using the accurate value of E (l) 0 and the optimal runtime t. Let and where j = 0, 1, · · · , N − 1. In the l-th step of the algorithm, the system is initialized in state |1 |ϕ as: here we have denoted d j0 = ϕ is: by using the Rabi's formula [23]. Therefore considering the resonant transition condition = ω, the upper bound of the transition probabilities from the initial state to the excited states |0 |ϕ (l) j (j = 1, · · · , N − 1) can be estimated as We obtain the upper bound of the error introduced by transition from the initial state to the excited states of the target Hamiltonian of the l-th step H l .
We denote a 2 l = 0 ≫ c is not exponentially small, i.e., bounded by a polynomial function of the problem size, then a l is a finite number and the error in the l-th step is bounded by a 2 l c 2 . Considering errors accumulated in all steps of the algorithm, the success probability of the algorithm for obtaining the ground state of the problem Hamiltonian satisfies where a max is the maximum value of a l for l = 1, . . . , m. The coefficient c can be set such that a max c < 1/ √ m, then P succ > 1/e in the asymptotic limit of m.
Now we consider the cost when there is deviation ǫ of the probe frequency from the resonant transition frequency. By ignoring the off-resonant transition, the transition probability from the state |1 |ϕ 0 . The number of times that this procedure needs to be repeated scales as O(1/ǫ 2 ), and the cost is finite as long as d Our algorithm can also be applied for solving this problem efficiently. In the case where f is balanced, the total number of N = 2 n states can be divided into two sets by using an oracle f . The set with eigenvalue −1 has N 1 = 2 n−1 items, thus the ratio N 1 /N = 1/2.
To apply our algorithm, we set the initial state of the problem to be |ψ 0 = 1 j=0 |j , the overlap between the initial state and the target state |ψ 1 = 1 therefore our algorithm can determine whether the function is a balanced function in time t = π/( √ 2c), when observing decay of the probe qubit with probability one. On the other hand, if the resonant transition is not observed with probability one at time t = π/( √ 2c), we know the function is constant. In this case, if the constant is 0, there will be no resonant transition; if the constant is −1, then the resonant transition probability reaches one at runtime t = π/(2c). These cases can be easily distinguished in our algorithm, therefore we can find out whether the function f is constant or balanced.
Appendix C: Application of the algorithm for the unstructured search problem The unstructured search problem is to find a marked item in an unsorted database of N items using an oracle that recognizes the marked item. The oracle is defined in terms of a problem Hamiltonian where |q is the marked state associated with the marked item. The initial Hamiltonian is defined as where |ψ 0 = 1 √ N N −1 j=0 |j . We can solve the unstructured search problem by using the QRT method [11,12] directly.
We set the Hamiltonian of the algorithm as where and the coupling coefficient c ≪ 1. We set the initial state of the circuit as |1 |ψ 0 , which is the eigenstate of H R with eigenvalue −2. The transition frequency of the probe qubit is set as ω = 1, such that the resonant transition condition between states |1 |ψ 0 and |0 |q is satisfied. The overlap between the initial state |ψ 0 and the target state |q is d 0 = 1 √ N . By applying the QRT method, the decay probability of the probe qubit is p 0 = sin 2 (ctd 0 ), which reaches its maximum 1 at t = π 2cd 0 . Therefore the system can evolve to the target state in runtime scales as O( √ N). In the case of multiple marked items in a database, the problem Hamiltonian is defined as H P = − q j ∈Π |q j q j |, where Π is a set of marked states associated with the marked items of size N q . The overlap between the initial state |ψ 0 and the target state 1 √ Nq q j ∈Π |q j |q j is N q /N. By applying the QRT method, the system can evolve to the target state in runtime scales as O( N/N q ). In both cases, the runtime of our algorithm is the same as that of Grover's algorithm [17] and the adiabatic quantum computing (AQC) algorithm [18,19].
Appendix D: Solving the search problem with a special structure via Grover's algorithm In the main manuscript, we have shown that the search problem with a special structure can be solved efficiently by using the QRT method in m steps, where the problem can be decomposed by m different oracles and m scales in order of O (log N). We have also shown in the above section that by using one oracle, the unstructured search problem can be solved by the QRT method with the same efficiency as that of the Grover's algorithm. Then a natural question is: can the structured search problem be solved efficiently by using the Grover's algorithm with m different oracles? We analyze this problem as follows: The structured search problem can be decomposed by m different oracles that are defined in terms of m Hamiltonians and H Pm = H P = −|q q|, where |q is the marked state associated with the marked item, and the set Π m only contains the target state |q , and Π 1 ⊃ · · · ⊃ Π m−1 ⊃ Π m , with size N 1 , · · · , N m−1 , N m = 1, respectively. Here N j are known and N j /N j−1 (j = 1, 2, · · · , m) are not exponentially small. The corresponding oracles are O 1 , · · · , O m , respectively. The initial Hamiltonian is defined as |k . Since N j are already known, the fixed-point search can be performed by using Grover's algorithm. In the first iteration, the Grover operator is constructed as:  Based on the above analysis, we can see that Grover's algorithm cannot achieve the same efficiency as our algorithm in solving the structured search problem by using m oracles.
We can see that in applying Grover's algorithm for solving the problem, only one quantum computation process is applied. While in our algorithm, we apply a multi-step quantum computation process. In our algorithm, an oracle is used in only one step of the algorithm to obtain the desired state of the step. By using techniques of QRT, post-selection and measurement on the probe qubit, the desired state of the step is obtained deterministically.
The desired state is protected through quantum entanglement and can be used repeatedly for the next step of the algorithm. These properties of the algorithm make it achieve better efficiency than that of Grover's algorithm in solving the structured search problem.
Appendix E: Solving the search problem with a special structure via quantum adiabatic evolution In the unstructured search problem, the problem Hamiltonian is H P = −|q q|, where |q is the marked state associated with the marked item, and the initial Hamiltonian is given |j . The initial Hamiltonian H 0 has two energy levels: −1 with corresponding eigenstate |ψ 0 and 0 with (N − 1) eigenstates |ψ ⊥ 0 that are orthogonal to |ψ 0 . For a search problem with a special structure that it can be decomposed by using a number of different oracles and allows us to construct a sequence of intermediate and where Π 1 ⊃ · · · ⊃ Π m−1 , the sizes of Π 1 , · · · , Π m−1 are N 1 , · · · , N m−1 , respectively, and N 1 > · · · > N m−1 , and inserted between the initial Hamiltonian H 0 and the problem Hamiltonian H P (see Fig. 3). Let H m = H P and the set Π m only contains the target state |q with size N m = 1, and Π m−1 ⊃ Π m . We demonstrate in the main text that as long as the ratio N j /N j−1 (j = 1, 2, · · · , m) are not exponentially small, the problem can be solved efficiently by our algorithm step by step through the evolution path H 0 → H 1 → · · · → H m = H P as constructed above. We start from the ground state |ϕ of H P in m steps. An interesting question is: will this problem be solved efficiently through quantum adiabatic evolution using the same evolution path of our algorithm? In the following, we study the quantum adiabatic evolution from the ground state of the initial Hamiltonian H 0 to that of the problem Hamiltonian H P through the evolution path of our algorithm step by step. In each step, the system is evolved adiabatically from the ground state of the Hamiltonian H j−1 to that of its next neighbor H j , finally reach the ground state of the problem Hamiltonian H P . Note that here we apply the usual quantum adiabatic evolution Hamiltonian H ′ j (s) = (1 − s) H j−1 + sH j , s ∈ [0, 1] in each step.

Eigen-problem of the intermediate Hamiltonians
Then in the basis {|q j } q j ∈Π j , |q ⊥ j we have and then H 0 can be written as and where I n is the (N j + 1)-dimensional identity operator. Thus . Please note that, with a bit abuse of notation, in the following we will reuse the notations e, e n , α, β and γ, and their dimensions and values can be determined easily from the context.
Defineẽ as the N j × 1 vector of all ones, and we can rewrite H j as (i) Define the vector space V = {e, e n } of dimension 2. Then from Eq. (E11), ∀x ∈ V ⊥ , (ii) The vector space of V can be spanned by vectors It is easy to check that Then we can verify that Solving the eigen-problem of the above matrix, we can obtain the eigenvalues: Besides these N j + 1 eigenvalues above, there are also N − (N j + 1) degenerate eigenstates with eigenvalue 0, and they are orthogonal to both the vector space V = {e, e n } and the vector space V ⊥ of dimension N j − 1.

Quantum adiabatic evolution in the first step
In the first step, the system evolves adiabatically from the ground state |ψ 0 of H 0 to the ground state of where Then in the basis and Then The adiabatic evolution Hamiltonian from H 0 to H 1 is defined as follows: then H 0 can be written as

Meanwhile, we have
where I is the (N 1 + 1)-dimensional identity operator. Thus, The adiabatic evolution Hamiltonian can be written as whereẽ is an N 1 × 1 vector of all ones. Besides the N − (N 1 + 1) degenerate eigenstates with trivial eigenvalue 0, the other N 1 + 1 eigenvalues are given as follows.
Then we have Then Solving the eigen-problem of the above matrix, we can obtain the eigenvalues and eigenstates of H (s): The energy gap reaches its minimum N 1 /N at s = N 2(N −N 1 ) . Since N 1 /N is finite, the first step can be run efficiently.

Quantum adiabatic evolution in a middle step
In the following, we study the evolution of the system from the ground state of an intermediate Hamiltonian H j−1 to that of its next neighbor H j . In the basis the state |ψ 0 can be written as We have and The above three matrices in Eqs (E27), (E28) and (E29) have dimension (N j−1 + 1) × (N j−1 + 1). In the matrix H P j , the top-left matrix is an identity matrix with dimension of N j × N j . Then H j−1 and H j matrices can be written as and then H 0 can be written as and we have where I n is the identity matrix of dimension N j−1 + 1, and e k (k = N j + 1, · · · , N j−1 ) are (N j−1 + 1)-dimensional vectors with the k-th element being 1 and other elements 0, forming the basis for the subspace associated with the set Π j−1 \ Π j , that is Thus, and For the last step j = m, we set N j /N to be 0, then H j above reduces to H m . The adiabatic evolution Hamiltonian from H j−1 to H j can be written as It is easy to check that there are N − (N j−1 + 1) degenerate eigenstates with eigenvalue 0. The other N j−1 + 1 nontrivial eigenvalues associated with Eq. (E39) are given in the following three parts.
(iii) The vector space V is spanned by U and the following three vectors Then we have Therefore, Note that for s = 0 we have N j−1 − l = N j .
For s = 0, and the matrix in the formula Eq. (E40) reduces to a 2 × 2 matrix as given in Eq. (E12).
For s = 1, and the matrix in the formula Eq. (E40) is similar to Obviously, there is an eigenvalue zero, and the other two eigenvalues are given as In the main text, we set N j /N j−1 = 1/10, thus the conditions for our algorithm are satisfied. The matrix in Eq. (E40) becomes We solve the eigenvalues of the above matrix for f = 1/30, 1/50, 1/150, respectively, and draw the energy spectrum vs. s in the main text. We check one more case by setting In Fig. 4, we draw the energy spectrum of the above matrix as a function of s by setting f = 1/15, 1/25, and 1/100, respectively. From the figures we can see that as f becomes small, the minimum energy gap between the ground and the first excited states of the adiabatic evolution Hamiltonians decreases quickly as s → 0. Comparing with Fig. 2 in the main text, we can see that as N j /N j−1 becomes larger, the minimum energy gap decreases faster as s → 0. The energy gap between the ground and the first excited states for the case where N j /N j−1 = 1/5 is in the form We expand the energy gap at f → 0, that is, the asymptotic limit of N, and find that it scales as O(f 2 ) = O(1/N 2 ). Therefore, the usual quantum adiabatic algorithm cannot be run efficiently by using the same evolution path of our algorithm. Our algorithm O (log N ) Ratio N j /N j−1 , which are not exponentially small.
Here N j represents the number of marked states of j-th step. path as our algorithm. The term N represents the dimension of the search space. The performance of the method in [5] is the same as that of the AQC algorithm.
runtime of the algorithm is the same as that of solving the unstructured search problem.
The phase estimation algorithm (PEA) is a projective method for obtaining the ground state of a problem Hamiltonian, it projects an initial state onto the ground state of the problem Hamiltonian with probability proportional to the square of the overlap between them. By using the state |ψ 0 = 1 √ N N −1 j=0 |j , which is an uniform superposition of all the computational basis states, as an initial guess state, the success probability of the PEA for finding the ground state of the structured search problem is 1/N. Therefore the runtime of the PEA for solving the structured search problem scales as O(N). The runtime of our algorithm for solving the structured search problem is proportional to the number of steps m which scales as O (log N), and in each step, the runtime depends on the ratio N j /N j−1 .
The algorithm is efficient as long as N j /N j−1 are not exponentially small. In table I, we summarize the performance of the above algorithms for solving the search problem with a special structure.
These algorithms can also be applied for the general case of preparing the ground state of a system. The runtime of the AQC algorithm scales as O(1/∆E min ), where ∆E min is the minimum energy gap between the ground and the first excited states of the adiabatic evolution Hamiltonian. By using the amplitude amplification technique developed from the Grover's algorithm, quantum algorithm can achieve quadratic speed-up over classical algorithms in preparing the ground state of a system [3]. The success probability of the PEA depends on the overlap between an initial guess state and the ground state of the system. Our algorithm requires to construct a Hamiltonian evolution path to reach the system Hamiltonian in order to prepare the ground state of the system, the runtime of the algorithm is proportional to summation of the evolution time of each step, which is