1 Introduction

Quantum technologies have advanced dramatically in recent years, both in theory and experiment. Building a programmable quantum computer involves multiple layers: algorithms, programming languages, quantum compilers, efficient decomposition of unitary operators into elementary gates, the control interface and the physical quantum qubits. The aforementioned requires much research effort for optimization, across and within the layers. From a quantum algorithm perspective, even optimistically assuming the middle layers are perfect, it remains extremely challenging to use quantum algorithms to solve real-life-size hard problems due to size limit and errors arising from issues such as precision, random noise and de-coherence in the quantum devices. Hybrid, short shallow circuit algorithms, such as Variational Quantum Eigensolver (VQE) [1] and Quantum Approximate Optimization Algorithm (QAOA) [2], are two near-term answers. From theoretical and implementation aspects, this work aims at investigating two computation frameworks: Grover search and QAOA.

From a perspective of universal computational models, Quantum Walks (QWs) have become a prominent model of quantum computation due to their direct relationship to the physics of the quantum system [3, 4]. It has been shown that the QW computational framework is universal for quantum computation [5, 6], and many algorithms now are presented directly in the quantum walk formulation rather than through a circuit model or other abstracted method [3, 7]. There are multiple quantum computation models, including the quantum circuit model [8,9,10], topological quantum computation [11], adiabatic quantum computation [12], resonant transition based quantum computation [13] and measurement based quantum computation [14,15,16,17]. Notable successes of quantum computation include Shor’s factoring algorithm [18] and Grover’s search algorithm [19], which manifest indisputable improvements over the best possible classical algorithms designed for the same purpose. QWs can be formulated in discrete-time (DTQW) [20] and continuous-time (CTQW) [3] versions. It is known that Grover search is a special type of DTQW. Since both (QAOA and QW) are universal computational frameworks [5, 6, 21], there should exist some relationship between those models. One can extend the techniques from one framework to another by exploring the connections between the computational models. As the connections are established, one can further investigate if performance-boosting techniques, such as spectral gap amplification [22] and catalyst Hamiltonians [23], can be applied from one framework to the other to provide additional algorithmic improvement.

The structure of this work is as follows. The background on AGS, AQC, QAOA is provided in Sect. 2. The mapping of Grover to AQC is summarized in Sect. 3 and the Trotterization of the schedule dependent AGS to QAOA is given in Sect. 4. We give our the error analysis in Sect. 5. Finally our conclusion is given in Sect. 6.

2 Background

2.1 Adiabatic quantum computing

In the AQC model, \(H_0\) is the initial Hamiltonian, \(H_f\) is the final Hamiltonian where the evolution path for the time-dependent Hamiltonian is

$$\begin{aligned} H(s) = (1-s)H_0 + sH_f{{,}} \end{aligned}$$
(1)

where \(0 \le s \le 1\) is a schedule function of time t. The schedule is \(s =s(t)\) and t goes from 0 to the total run-time \(T_a\). The variable s increases at a slow rate such that the initial ground state evolves and the system state remains as the ground state throughout the adiabatic process. More specifically, the Hamiltonian at time t

$$\begin{aligned} H(s(t)){|{\lambda _{k,t}}\rangle } = \lambda _{k,t}{|{\lambda _{k,t}}\rangle }{{,}} \end{aligned}$$
(2)

where \(\lambda _{k,t}\) is the corresponding eigenvalue for the k eigenstate \({|{\lambda _{k,t}}\rangle }\) at time t. For instance, \({|{\lambda _{0,t}}\rangle }\) is the ground state at time t. The minimal eigenvalue gap is defined as

$$\begin{aligned} g = \min _{0 \le t \le Ta}(\lambda _{1, t} - \lambda _{0,t}){{,}} \end{aligned}$$
(3)

where \(T_a\) is the total evolution time of the AQC. It is known that \(T_a \propto \frac{1}{g^2}\). Let \({|{\psi (T_a)}\rangle }\) be the state of the system at time \(T_a\) evolving under the Hamiltonian H(s(t)) from the ground state \({|{\lambda _{0,0}}\rangle }\) at time \(t=0\). The adiabatic theorem [24, 25] states that the final state \({|{\psi (T_a)}\rangle }\) is \(\epsilon _1\)-close to the real ground state \({|{\lambda _{0,T_a}}\rangle }\) as

$$\begin{aligned} |{\langle {\lambda _{0, T_a}}\rangle }{\psi (T_a)}|^2 \le 1 - \epsilon _1^2, \end{aligned}$$
(4)

provided that

$$\begin{aligned} \frac{|{\langle {\lambda _{1,t}}|}\frac{dH}{dt}{|{\lambda _{0,t}}\rangle }|}{g^2} \le \epsilon _1. \end{aligned}$$
(5)

2.2 Quantum approximate optimization algorithm

QAOA is a promising approach for programming a near-term gate-based hybrid quantum computer to find good approximate solutions of hard combinatorial problems. In the near future, the number of reliable quantum gates will be limited due to noise, de-coherence and scalability. Due to this fact, hybrid quantum-classical algorithms have been proposed to make the best of available quantum resources and integrate them with classical routines. Technically, QAOA [2] is a variational ansatz that uses p sets of alternating non-commuting (Z-basis associated with parameter \(\gamma \) and then X-basis associated with parameter \(\beta \)) operations on an initial \({|{+}\rangle }^{\otimes n}\) state. With each of the p steps, the state evolves with two unitaries,

$$\begin{aligned} U_t=exp(-i \gamma _t H_c) \text { and } V_t= exp(-i\beta _tH_0){{,}} \end{aligned}$$
(6)

where \(H_c\) is the cost Hamiltonian of the given optimization (or search) problem in the computational basis while \(H_0 = \sum _i \sigma _i^x\) with \( \sigma _i^x\) being the Pauli X matrix for the i qubit. In the Noisy Intermediate Scale Quantum (NISQ) computing era [26], it is desirable to use shallow circuits to obtain solutions with high accuracy. Hence, p invocations of the QAOA operator would be

$$\begin{aligned} U_{qaoa} = \prod _{t=1}^p V_t U_t{{,}} \end{aligned}$$
(7)

and p is expected to be some small number to avoid unnecessary decoherence. QAOA aims at solving optimization problems with a short circuit and provides acceptable approximate solutions. Numerous studies have been conducted to find optimal \(\beta , \gamma \) for each of the step for a shorter circuit and benchmark the performance of QAOA [27,28,29,30]. In practice, in order to find the optimal values of \(\beta _i\) and \(\gamma _i\) parameters, several iterations of optimization are required as illustrated in Fig. 1 [31]. The final state is measured to obtain expectation value with respect to the objective function \(H_c\). Then the result is fed to the classical optimizer. Based on the condition one sets in the machine learning process, the process for obtaining the variational parameter values for the next iteration stops when no more improvement can be found or the improvement is negligible. However, the post-processing of optimization to find proper values of \(\beta _{i+1}\) and \(\gamma _{i+1}\) from the i iteration using machine learning might be costly.

Fig. 1
figure 1

QAOA with classical optimizer to find the optimal parameters of \(\{\gamma _i, \beta _i\}\) as \(\{\overrightarrow{\gamma }, \overrightarrow{\beta }\}\). [31]

In the following sections we explore the connection between QAOA and AGS. Here AGS refers to applying the AQC time-dependent Hamiltonian approach to Grover’s problem searching for a marked element in the unstructured database. An unstructured search problem of size \(N = 2^n\) where the adjacency matrix A has ones everywhere except all zeros on the diagonal. Let \({|{\omega }\rangle }\) be the target state while \({|{s}\rangle } = {|{+}\rangle }^{\otimes n}\) be the initial uniform superposition state. Our initial investigations on the process of mapping CTQW and AGS to QAOA via AQC can be can be viewed as Fig. 2. The Grover inspired approach AGS was first introduced in [32]. There are two paths as shown in Fig. 2, one is CTQW-AQC-QAOA while the other is AGS-AQC-QAOA. This work is mainly for the AGS-AQC-QAOA path. The AGS based path does not cause irreconcilabilities but the CTQW based path did [33]. A more detailed explanation regarding the irreconcilability and potential solutions is at the appendix A for the CTQW-AQC-QAOA path.

Fig. 2
figure 2

The process of translation from QW based framework to QAOA to obtain the values of variational parameters in QAOA. One path is CTQW-AQC-QAOA while the other is AGS-AQC-QAOA

3 Mapping: Grover search to AQC

The time-dependent Hamiltonian approach [32] was applied to the Grover’s search, searching a marked item in an unstructured database. Grover’s algorithm was originally presented as a discrete sequence of unitary logic gates. In [32] it turns to another type of quantum computation where the state of the quantum register evolves continuously under the influence of some driving Hamiltonian. By adjusting the evolution rate of the Hamiltonian so as to keep the evolution adiabatic on each infinitesimal time interval, the total running time is of order \(\sqrt{N}\) where N is the number of items in the database.

Let the time-dependent Hamiltonian as defined in Eq. (1) with the initial Hamiltonian \(H_0\) and the final Hamiltonian \(H_f\) being

$$\begin{aligned} H_0 = I - |{\psi _0}\rangle \! \langle {\psi _0}|, \quad H_f =I - |{\omega }\rangle \! \langle {\omega }|. \end{aligned}$$
(8)

By such a setting, the initial uniform superposition state \({|{\psi _0}\rangle }\) is the ground state for \(H_0\) and the target state \({|{\omega }\rangle }\) is the ground state for \(H_f\). The system state evolves in the \(\{{|{\omega }\rangle }, {|{r}\rangle }\}\) basis with the Hamiltonian as [33]

$$\begin{aligned} H(s) = \begin{pmatrix} (1-s)\frac{N-1}{N} &{} -(1-s)\frac{\sqrt{N-1}}{N} \\ -(1-s)\frac{\sqrt{N-1}}{N} &{} 1 - (1-s)\frac{N-1}{N} \\ \end{pmatrix}. \end{aligned}$$
(9)

Following the adiabatic theorem, at any time t during the evolution,

$$\begin{aligned} \left\langle { - | - } \right\rangle E_{0} (t)^{{\prime \prime }} - \psi _{0} (t)^{{\prime \prime 2}} \ge 1 - \in _{1}^{2} , \end{aligned}$$
(10)

where \(E_0(t)\) is the true ground state and \(\psi _0(t)\) is the system state following the adiabatic evolution. Instead of using a linear evolution of s(t), in [32] it adapts the evolution ds/dt to the local adiabaticity condition. It is therefore

$$\begin{aligned} |\frac{ds}{dt}| = \epsilon _1 g^2(t){{,}} \end{aligned}$$
(11)

where g(t) is the energy gap of the system at time t. The running time t is a function of the interpolation schedule s such that

$$\begin{aligned} t =&\frac{N}{2\epsilon _1 \sqrt{N-1}}\Big \{\arctan (\sqrt{N-1}(2s-1)) \nonumber \\&+ \arctan (\sqrt{N-1})\Big \}{{,}} \end{aligned}$$
(12)

and the schedule satisfies the adiabatic theorem. It is further shown that the running time is optimal as \(T = O(\sqrt{N})\) when \(s=1\) [32]. By the trigonometry formula \(\arctan (x) + \arctan (y) = \arctan \left( {\frac{x+y}{1-xy}}\right) \) mod \(\pi \) and the approximation \(N \simeq N-1\) when N is large, we know that the angle for the tangent function is bounded as

$$\begin{aligned} 0 \le \frac{2t\epsilon _1 \sqrt{N-1}}{N} \le \pi \end{aligned}$$
(13)

which echoes the fact that \(0 \le t \le T \) when \(\epsilon _1\) is some negligible constant. The interpolate schedule s with respect to time t is

$$\begin{aligned} s&= \frac{\sqrt{N} \tan \left( \frac{2t\epsilon _1}{\sqrt{N}}\right) }{2\left( \sqrt{N} \tan \left( \frac{2t\epsilon _1}{\sqrt{N}}\right) +1\right) }. \end{aligned}$$
(14)

4 Connection: AGS to QAOA via AQC

For simplicity, let us define the time-dependent Hamiltonian H(s) in Eq. (9) as

$$\begin{aligned} H(s) = A(s)H_0 + C(s) H_f. \end{aligned}$$
(15)

To reflect Eq. (15) in AGS, one can decompose the evolution operator into some large R steps using Suzuki-Trotter formula, the state evolution of the system is

$$\begin{aligned} U(T)&= exp\left[ -i \int _{{{0}}}^{{{T}}} H(t) dt\right] . \end{aligned}$$
(16)

The Suzuki-Trotter decomposition states \(e^{A+B} = \lim _{R \rightarrow \infty } (e^{A/R}e^{B/R})^R\) and let us choose \(\tau = T/R\). Since the system Hamiltonian evolves based on the schedule s, we can further write

$$\begin{aligned} U(T)&\simeq \prod _{l=1}^R exp [-iH(s_l)\tau ] \nonumber \\&= \prod _{l=1}^R exp[-i\big (A(s_l)H_0 + C(s_l)H_f\big )\tau ] \nonumber \\&= \prod _{l=1}^R \big (e^{-i\tau A(s_l)H_0/2}e^{-i\tau C(s_l)H_f}e^{-i\tau A(s_l)H_0/2}\big ){{,}} \end{aligned}$$
(17)

by using the second order Trotter method where \(s_l\) is obtained using Eq. (14)

$$\begin{aligned} s_l = \frac{\sqrt{N} \tan \left( \frac{\pi l}{R}\right) }{2\left( \sqrt{N} \tan \left( \frac{\pi l }{R}\right) +1\right) }{{,}} \end{aligned}$$
(18)

and \(t = \frac{lT}{R}\) and \(T \simeq O(\frac{\pi \sqrt{N}}{2\epsilon _1})\). To map to QAOA \(U_{qaoa}\) operator with p steps where

$$\begin{aligned} U_{qaoa} = \prod _{l=1}^p V_l U_l = \prod _{l=1}^p (e^{-i \beta _l H_0}e^{-i\gamma _l H_f}), \end{aligned}$$
(19)

one can neglect \(e^{-i\tau A(s_1)H_o/2}\) because its action on \({|{+}\rangle }^{\otimes N}\) yields only a global phase factor. By matching Eq. (17), one sets \(p=R\) and obtains

$$\begin{aligned} \gamma _{l\in \{1, 2, \cdots , R\}}&= \tau C(s_l){{,}} \end{aligned}$$
(20)
$$\begin{aligned} \beta _{l \in \{1, 2, \cdots , R-1\}}&= \tau (A(s_l) + A(s_{l+1}))/2 {{,}}\end{aligned}$$
(21)
$$\begin{aligned} \beta _R&= \tau A(s_R)/2 {{.}} \end{aligned}$$
(22)

For AGS, the schedule follows Eq. (1) as

$$\begin{aligned} A(s) = (1-s), \quad C(s) = s {{,}} \end{aligned}$$
(23)

and we will obtain

$$\begin{aligned} \gamma _{l\in \{1, 2, \cdots , R\}}&= \tau s_l {{,}}\end{aligned}$$
(24)
$$\begin{aligned} \beta _{l \in \{1, 2, \cdots , R-1\}}&= (\tau /2)\big (2- (s_l + s_{l+1})\big ) {{,}}\end{aligned}$$
(25)
$$\begin{aligned} \beta _R&= (\tau /2)(1-s_R). \end{aligned}$$
(26)

5 Errors

The approximation error from the translation between models is two-fold: one comes from the AQC simulation error \(\epsilon _1\) as indicated in Eq. (4) and the other source of error, \(\epsilon _{2k}\), is from the Hamiltonian simulation via Trotterization. Let the approximated unitary be \({\tilde{U}}\) and the expected total error be bounded from above by \(\epsilon \), we have

$$\begin{aligned} \left\| U - {\tilde{U}} \right\| = \epsilon _{2k} + \epsilon _1 = \epsilon . \end{aligned}$$
(27)

Now we need to investigate the value of Trotterization steps R to obey the desired \(\epsilon \) error in the simulation. For even higher-order, let us denote it as 2k-th order for \(k>0\), the formula can be constructed recursively and \(U_{2k}(t)\) is of the form [34]

$$\begin{aligned}&[U_{2k-2}(s_kt)]^2U_{2k-2}((1-4s_k)t)[U_{2k-2}(s_kt)]^2 \nonumber \\&= e^{-iHt} + O((Mt)^{2k+1}/R^{2k}), \end{aligned}$$
(28)

where \(H =\sum _{j=1}^M H_j\) and \(s_k = 1/(4-4^{1/(2k-1)})\). In general, via the above form, arbitrary high-order formulas can be constructed. But in practice the fourth order (\(2k=4\)) is preferred for most practical problems as the cost from constructing more complex higher-order operators would offset the benefits of Trotterization. To confine the simulation error stated in Eq. (27), we must satisfy the condition that \(\epsilon _{2k} \le \epsilon - \epsilon _1\). This immediately shows that R should be chosen accordingly, as listed in Table 1.

Table 1 The Hamiltonian simulation error \(\epsilon _{2k}\) and corresponding discrete-time steps R

Recalling that AGS has the optimal run-time \(O(\sqrt{N})\), we have to set \(t = O(\sqrt{N})\). When using Trotterization for Hamiltonian simulation, if \(\epsilon _{2k}\) is some small constant, we can conclude that at \(k=1\), the required discrete-time step is sub-optimal as \(R \simeq O(N^{3/4})\). As k increases, R approaches \(O(\sqrt{N})\). In our case for variational variable values based on the second order (\(k=1\)) approximation, the corresponding QAOA should obtain an \(\epsilon \)-close solution with the sub-optimal running time \(R=O(N^{3/4})\).

6 Conclusion and future work

In this work, we explore ways to let QAOA simulate the behavior of optimal search by AGS. The motivation is to find the values of variational parameters from a theoretical approach, instead of heuristic approaches. We discover the values of the variational parameters by letting QAOA simulate AGS via AQC. The AGS obeys the conventional AQC and the mapping is straightforward. Finally, from an error control perspective, to achieve the same degree of accuracy \(\epsilon \), both mappings indicate they have the same number of Trotterization steps in the big O notation.

For future investigation, we consider the connection between CTQW and QAOA to be another interesting direction. There are several variations of AQC to improve the performance. The variations are based on modifying the initial Hamiltonian and the final Hamiltonian [23, 35] or adding a catalyst Hamiltonian \(H_e\) [23]. The catalyst vanishes at the initial and the final times but is present at intermediate times. For instance, a conventional catalyst assisted AQC is expressed as

$$\begin{aligned} H(s) = (1-s)H_0 + s(1-s)H_e + sH_f. \end{aligned}$$
(29)

The form of \(H_e\) is important but even a randomly chosen catalyst can help in improving run time [23, 36]. The use of catalyst Hamiltonian also suggests an additional variational parameter \(\alpha \) is needed when Totterizing to QAOA as shown in Fig. 2.