1 Introduction

Quantum computation is expected to outstrip its classical counterpart in certain mathematical algorithms such as integer factorisation [1], in data searches [2], and also in large scale optimisation [3], especially if the target function corresponds directly to the quantum-mechanical description of the system, e.g., ground state [4] or correlation structure [5]. Hence, should a challenging combinatorial problem be mapped onto a quantum system, a quantum simulator may indirectly solve the original problem in reasonable time.

A prototypical and suitable physical system is an Ising spin system, which suits experimental realisation, and all details of the hypothetical problem (e.g., the travelling salesman problem [6]) are encoded in the interaction strengths between spins, \(J_{ij}\). By finding the ground state, for given \(J_{ij}\), one solves the original problem [714]. Of course, finding the ground state is itself an NP-hard problem for a large Ising system [15], in general. However, a potentially feasible strategy is to let Nature find the solution in a quick experimental protocol.

One approach–exploiting Kato’s theorem [16]– is to prepare the system in the ground state of a simple Hamiltonian, and tune this Hamiltonian to the one whose ground state we are actually seeking. Kato’s adiabatic theorem states that if a self-adjoint operator has an isolated eigenvalue with a potentially degenerate eigenspace and this eigenvalue does not split under a smooth self-adjoint perturbation, then there is a unitary transformation which transforms the unperturbed eigenspace to the corresponding perturbed eigenspace. In other words this theorem guarantees that a ground state of an unperturbed Hamiltonian can be evolved into the ground state of another Hamiltonian as long as the change of Hamiltonians happens smoothly enough.

One may apply a strong magnetic field in the x-direction to align all spins initially, then turning off the field slowly, and eventually measuring the spins in the z-directions. Unfortunately, in this process the energy levels of the instantaneous Hamiltonian usually become very close, and hence the driving must slow down to remain adiabatic (viz. critical slowing down [1721]). Alternatively, proceeding in a finite time elevates the probability of the system being excited. As real quantum systems always interact with their environment, one may make a virtue of necessity, and allow the spins to couple to the thermal or quantum fluctuations of this external bath [2225]. Repeating the experiment a number of times yields an ensemble of final states from which we can pick the lowest energy configuration since calculating the energy for a given configuration is simple. In this approach, the likelihood of ‘not finding the true ground state’ diminishes exponentially with the number of trials [26].

Engineering the interaction with the environment can improve quantum annealing [2734], and such active design, perhaps individually to each qubit, forms the heart of this paper. Inspired by energy transport optimisation through site-dependent coupling to the environment in photosynthetic systems [35, 36], or individually addressable qubits on silicon [3739], we propose the use of site-specific dissipation. We investigate this approach by evolving an Ising system via the Bloch-Redfield master equation. Within its approximations quantum annealing can achieve high efficiency [4046]. We show that online learning and adjustment of the individual coupling of each qubit to the environment indeed increases the probability of success, and that the annealing time is also an important factor in the protocol.

2 Model

Let us consider a collection of N identical, interacting qubits arranged at the vertices of an undirected graph, G, as depicted in Fig. 1:

$$ H_{G} = - m_{0}^{ \phantom{z} }\sigma _{0}^{z} -\frac{1}{2} \sum _{\substack{i, j=0}}^{N} {J_{ij}^{ \phantom{z} } \sigma _{i}^{z} \sigma _{j}^{z}} $$

with ferromagnetic couplings. A small field, \(m_{0} = 8 \times 10^{-2}\), is pinning a single qubit, \(\sigma _{0}\), in order to resolve the degeneracy of the ground state. The system is controlled by time-dependent external magnetic field

$$ H_{\text{ext}} = - m e^{-t/\tau} \sum_{i=0}^{N} \sigma _{i}^{x}, $$

where τ is the annealing time, and \(m=\mu B_{0}\) is chosen to overwhelm all other terms at the start of the experiment, i.e., \(B_{0} \gg \max{\! (J_{ij})}\). Here μ is the magnetic moment of a single qubit, and it is considered to be unity in the simulation, while the maximal magnetic field is chosen to be \(B_{0}=4\).

Figure 1
figure 1

Schematics of 7 qubits (black dots) interacting with each other with strengths \(J_{ij}\) (olive solid lines) and with a Markovian bath (red springs) with couplings \(\kappa _{i}\)

We consider two cases: (a) uniform coupling (\(J_{ij} = J\)), and (b) random couplings, where every \(J_{ij}\) are drawn from a normal distribution \(\mathcal{N}(2, 0.1)\). We distinguish three classes of graphs: random non-complete graphs, a linear graph and a complete graph. The latter two are unique by their adjacency structure and form the extremes of connected graphs: a linear graph has the least, while the fully connected graph the most edges while being connected. In experiments we envisage a system somewhere in between these cases. In order to investigate these ‘more typical’ non-complete graphs, we sampled connected graphs for which half of all possible edges were missing. An exhaustive simulation could explore random connected graphs with k edges, but uniformly sampling this set of graphs is not a trivial task [47].

The Ising system is brought into contact with an infinitely large bath in thermal equilibrium modelled as

$$ H_{\text{bath}} = \sum_{\lambda} {\hbar \omega _{\lambda} b_{\lambda}^{\dagger} b_{\lambda}}. $$

The summation runs over the oscillator modes, while \(b_{\lambda}^{\dagger}\) and \(b_{\lambda}\) are the bosonic creation and annihilation operators for mode λ. Finally, the qubit-environment interaction is

$$ H_{\text{int}} = \sum_{i} A_{i} \otimes B, $$

where we opted for \(A_{i} = \kappa _{i} (\sigma _{i}^{+} +\sigma _{i}^{-})\) with site-specific coupling \(\kappa _{i}\), and \(B = \sum_{\lambda} (b_{\lambda}^{\dagger} + b_{\lambda})\) as operators of the quantum system and of the environment, respectively. For the sake of simplicity, although unphysical, we assume \(\kappa _{i}\) being independent of energy, i.e., a qubit is coupled to all bath modes equally.

We mention an alternative approach for regulate the system on a site-dependent basis, in which each qubit is controlled by its own transverse field [48], rather than an individually controlled interaction strength. Within a mean-field-like model Susa et al. showed that with such a spatio-temporal inhomogeneous control-field the detrimental first-order phase transition, present in a uniform system, can be avoided, hence the performance of the quantum annealing protocol can be improved.

The Hamiltonian, \(H = H_{G} + H_{\text{ext}} + H_{\text{bath}} + H_{\text{int}}\), governs the time evolution \(\dot{\rho}_{\text{total}} = -i {}[ H_{\text{int}}, \rho _{ \text{total}} ] \) in the interaction picture. As we are interested in the dynamics of the qubits, we trace over the bath states and obtain

$$ \dot{\rho}(t) = - \int _{0}^{t} ds \,\operatorname{Tr}_{\text{bath}} {} \bigl[ H_{ \text{int}}(t), {}\bigl[ H_{\text{int}}(s), \rho _{\text{total}}(s) \bigr] \bigr] . $$
(1)

In solving Eq. (1) we make the three standard assumptions and follow Refs. [4951]. The qubit-bath coupling is weak (Born approximation). The bath is initially uncorrelated. The density matrix can be factorised (i.e., no appreciable correlation between system and bath) which is kept throughout the evolution, hence \(\rho _{\text{total}}(t) \approx \rho (t) \otimes \rho _{\text{bath}}\), where \(\rho _{\text{bath}} \propto \exp{\! (-\beta H_{\text{bath}} )}\) is the canonical density matrix at inverse temperature β. Finally, the bath is assumed to be Markovian, which allows us to change the integration limit in Eq. (1) from t to ∞ leading to

$$ \dot{\rho}(t) = \sum_{j k} \int _{0}^{\infty} ds \,\bigl[ A_{j}(t); A_{k}(s) \rho (s) \bigr] C_{\text{bath}} + \text{h.c.} $$
(2)

Here \(C_{\text{bath}} = \operatorname{Tr}_{\text{bath}}(B(t) B(t') \rho _{\text{bath}})\) is the bath time-correlation function. Using the energy eigenbasis of \(H_{\text{sys}} = H_{G} + H_{\text{ext}}\), e.g., \(\langle{a}| A(t) |{b}\rangle = A_{ab} e^{i\omega _{ab} t}\), we transform Eq. (2) into a matrix equation

$$ \dot{\rho}_{ab} \cong -i \omega _{ab} \rho _{ab} - \sum_{cd}{R_{abcd} \rho _{cd}}. $$
(3)

where \(\omega _{ab} = \omega _{b}-\omega _{a}\), and \(\omega _{a}\), \(\omega _{b}\) are the eigenfrequencies corresponding the eigenstates \(\rvert a \rangle \) and \(\rvert b \rangle \), respectively. We discard fast oscillatory terms and keep only those terms in the summation for which \(\vert \omega _{ab} - \omega _{cd} \vert ^{-1} \ll \tau _{ \text{relax}}\). For clarity, we introduced the Bloch-Redfield tensor \(R_{abcd} = -\frac{1}{2} \sum_{jk}{\! ( \delta _{bd}^{ \phantom{\beta} } r_{ac}^{jk} + \delta _{ac}^{ \phantom{\beta} } r_{db}^{jk} )}\) with \(r_{ac}^{jk}=\sum_{n}{A_{an}^{j} A_{nc}^{k} S(\omega _{cn}) - A_{ac}^{j} A_{db}^{k} S(\omega _{ca})} \) and \(r_{db}^{jk} = \sum_{n}{A_{dn}^{j} A_{nb}^{k} S(\omega _{dn}) - A_{ac}^{j} A_{db}^{k} S(\omega _{db})}\). Here \(S (\omega )= \int _{-\infty}^{\infty} d\tau e^{i\omega t} C(t) \cong 2\pi J(\omega ) (1 + \overline{n} (\omega ))\) is the noise power-spectrum of the bath. The function \(J(\omega )= \eta \omega e^{-\omega /\omega _{c}}\) is the Ohmic spectral density function with a cut-off frequency \(\omega _{c}\) and a dimensionless parameter η [52], while \(\overline{n}(\omega ) =(e^{\beta \hbar \omega}-1)^{-1}\) is the mean oscillator number in mode ω at inverse temperature β. In the following we use \(\kappa (\omega ) = \eta /4\pi \omega e^{-\omega /\omega _{c}}(1+ \overline{n}(\omega ))\), thus the system couples differently to different modes of the bath. The aim of annealing is finding the ground state of a known Hamiltonian, hence in the following we report that value of κ (or \(\overline{\kappa} = \text{mean}(\lbrace \kappa _{i} \rbrace )\)) which it had at the moment when the probability of being in the instantaneous ground state stopped decreasing after the initial decline (see later in Figs. 2 and 3). Usually, for cold enough baths the relaxation rate is considered to be Ohmic [53], and, alternatively, an ensemble of coherent two-level systems can also reproduce Ohmic excitation spectrum [54, 55].

Figure 2
figure 2

The time dependence of P is plotted for an isolated 7-qubit chain (\(J_{ij}=1\)) for different τ (solid lines). The dashed line is the logarithm of the energy gap, Δ, as a function of scaled time

Figure 3
figure 3

(Top) Probability of being in the ground state (solid lines) over time for isolated (\(\kappa =0\)) and open system (\(\kappa _{i} \equiv \kappa = 0.001\)) for 7 qubits placed on an incomplete graph, where not all of them interacting with each other. The instantaneous energy (dashed lines) of both systems approaching the target energy. (Bottom) Populations of all 27 energy eigenstates at the end of the experiment for both systems

We emphasise: the bath correlation time, \(\tau _{\text{bath}}\), must be short enough, such that

$$ \tau _{\text{bath}} \ll \tau _{\text{relax}}. $$
(4)

In other words, the fast oscillating quantities average out, and the terms with frequency \(\omega _{ab} - \omega _{cd}\) will not give any significant contribution to the system evolution by \(t'\) such that \(\vert \omega _{ab} - \omega _{cd} \vert ^{-1} \ll t' \ll \tau _{\text{relax}}\). This condition also sets a limit on the time-scale of the simulation [51, 56], as beyond \(\tau _{\text{relax}}\) the observables do not change any more.

As a crude approximation \(\tau _{\text{relax}} \propto \kappa ^{-2}\) [57, 58] while \(\tau _{\text{bath}} \cong \max{ ( \frac{2\pi}{\omega _{c}}, \beta )}\). Hence as long as \(\tau _{\text{bath}} \ll \tau _{\text{relax}}\) is fulfilled, Eq. (3) should be an adequate description. The suitable β also depends on the graph and we use \(\beta =22\) for the linear graph, 30 for the random non-complete graph, and 40 for the complete graph. These β values lead to \(\kappa _{i} \lesssim 0.007\).

3 Results

Fidelity is a central measure in quantum computation and an upper bound can be calculated as [59, 60]

$$ F(\rho _{1}, \rho _{2}) \leq \operatorname{Tr}{( \rho _{1} \rho _{2})} + \sqrt{1 - \operatorname{Tr}{\bigl(\rho _{1}^{2}\bigr)}}\, \sqrt{1-\operatorname{Tr}{\bigl(\rho _{2}^{2}\bigr)}}, $$
(5)

where \({\rho}_{1}\) and \(\rho _{2}\) are any two density operators. In the following \(\rho _{1}\) is fixed by the instantaneous ground state, while \(\rho _{2} = \rho (t)\) is the instantaneous density operator. We also follow the time evolution of the instantaneous energy of the system, \(\varepsilon (t) = \operatorname{Tr}( \rho H_{\text{sys}}(t) )\), compared to \(\operatorname{Tr}( \rho H_{\text{sys}}(t=\infty ) )\).

As a benchmark, we prepare the 7-qubit chain in its ground state with constant \(J_{ij}=1\), and anneal with different τ without coupling to the environment. The probability of being in the instantaneous ground state, P, together with the logarithm of the gap between the ground state and the first excited state (dashed line), \(\log (\Delta )\), are shown in the Fig. 2. The gap initially diminishes rapidly, reaches its minimal value around \(t/\tau \approx 0.5\), and then levels off at a value on the order of unity. Not surprisingly, around the \(\min{\!(\Delta )}\) fidelity drops as different states start mixing. However, for slower annealing (\(\tau =2\), 4) scattering into the excited states is less, and higher P values are maintained, as expected from earlier studies [30, 6165], hence τ plays an important role [57]. Although short annealing time reduces probability of being in the ground state, we do aim to anneal fast, and hope that coupling to the environment helps the system to release its surplus energy and regain some of its lost population in the ground state.

Let us compare the population of the ground state for open and closed systems with fixed \(\tau = \frac {1}{2}\) and uniform coupling to the environment. Figure 3 shows \(\varepsilon (t)\) and P for closed (\(\kappa =0\)) and open (\(\kappa _{i} \equiv \kappa = 0.001\) for all i) systems. The open system coupled uniformly and weakly to the environment ends up in the instantaneous ground state with higher probability, and simultaneously the instantaneous energy, \(\varepsilon (t)\) approaches the target energy. The bottom panel of Fig. 3, compares population of states of each system: the ground state population remains much higher for a weakly coupled system than for the isolated system. Concluding, weak coupling to the environment may help the system to evolve into its ground state with higher probability.

Figure 4 shows \(P_{\text{fin}}\) for fixed non-optimal coupling and for \(\kappa _{i}^{\text{opt}}\). It is apparent that \(P_{\text{fin}} < P_{\text{optimised}}\) for a non-optimal κ, and also the final energy of the optimised case is closer to the target energy (the true ground state energy) than for the non-optimised system.

Figure 4
figure 4

(Top) The probability of being in the instantaneous ground state at the end of the simulation, \(P_{\text{fin}}\), is shown as a function of the average coupling strength κ̅. The graph contains \(N=6\) qubits, and it is a non-complete graph as described in the text. The graph is fixed for all simulations. The maximal value of \(P_{\text{fin}}\) is reached around \(\overline{\kappa} = 0.025\). The red and blue dashed lines depict \(\epsilon _{\text{fin}}\) for the optimised and non-optimised cases, respectively. The gray dashed line shows the target energy. Here \(\epsilon _{\text{fin}}\) is calculated from the state when the annealing was stopped. (Bottom) The histograms illustrate the populations of states for the optimised and non-optimised (fixed κ) cases. The more pronounced bunching around the ground state, as expected, is visible for the optimised coupling strengths

Next we vary \(\kappa _{i}\) to maximise the population of the ground state at the end of the simulation, \(P_{\text{fin}}\). First, we consider a uniform coupling, \(\kappa _{i} = \kappa ^{\text{opt}}\), while later we allow for site-dependence, \(\kappa _{i} = \kappa _{i}^{\text{opt}}\). The evolution of \(P_{\text{fin}}\) and the average coupling strengths, κ̅, are depicted in Fig. 5. We pick \(\lbrace \kappa _{i} \rbrace \) corresponding to the highest \(P_{\text{fin}}\). Each simulation consists of two parts: one solves the Bloch-Redfield master equation and measure the fidelity between two given states, and the other optimises the target function \(y = 1 - \max{\!( \text{fidelity} )}^{2}\) with the constraint \(0 < \kappa \). We rely on the python3 module scipy.optimize implementing the Nelder-Mead algorithm [66]. A run starts with an initial guess for κ, measures F as in Eq. (5), and then y is evaluated.

Figure 5
figure 5

The probability of being in the ground state at the end of the simulation for a non-complete graph for random \(J_{ij} \sim \mathcal{N}(2,0.1)\). The coupling to the bath is either kept constant or it is optimised. The histograms show the populations of each energy eigenstates at the end of the evolution. Other parameters: \(N=6\), \(\beta = 30\), and \(\omega _{c} = 30\)

One may ponder upon the stability of the ground state population above some κ. We have simulated the time evolution for both non-optimised and optimised system-bath couplings. Figure 6 shows the results for a non-complete graph with 5 nodes coupled to a bath at inverse temperature β with \(0.001 \le \kappa _{i} \le 0.007\). If the annealing is stopped at \(t \sim 3.2\), one attains the highest \(\chi = F^{2}(\rho _{\text{gs}}, \rho (t))\) which we interpret as the probability of being in the instantaneous ground state. If the process continues, the system ends up with a smaller population in the ground state than expected from Boltzmann’s distribution. While the optimised system undergoes a qualitatively similar evolution, χ reaches a higher value even though there is a period (see \(1.5 \lesssim t \lesssim 2.7\)) when other couplings temporarily achieve higher χ values.

Figure 6
figure 6

Time evolution of χ for a non-complete random graph for 5 qubits and fixed \(\tau =0.5\). All five qubits are coupled to the environment with the same strength, hence all \(\kappa _{i}\) are equal to κ. The gray dashed line shows the probability expected for the final ground state in thermal equilibrium. The coloured solid lines are for non-optimized open systems with \(0.001 \le \kappa \le 0.007\). The top solid black line is for the optimised system while the bottom solid black line corresponds to an isolated system

We have also analysed whether annealing is better compared to suddenly turning \(m(t)\) off at the very beginning of the time evolution after preparing the initial state. We chose a non-complete graph with 5 nodes, fixed \(J_{ij}\) values, and varied τ from 0 to 2. The experiments are repeated for two coupling strengths \(\kappa =0.003\) and 0.02. The results are plotted in Fig. 7 by line-triplets using the same colour for corresponding systems. One may draw three conclusions. First, all open annealed systems achieves higher χ values than the ‘no-annealing’ protocol, although for strong environmental coupling the excess probability is small. Secondly, a slow protocol (\(\tau =2\)) may outperform asymptotically all quicker quenches and optimisation does not improve χ appreciably. Finally, for all \(\tau >0\) the time evolution of χ starts flat (\(\frac {d}{dt} \chi \approx 0\)), contrary to the ‘no-annealing’ protocol which starts increasing immediately. Let us now focus on the coupling of medium strength, \(\kappa =0.003\) (top panel of Fig. 7). Comparing lines with identical colours, one may observe that their order changes as τ varies. For a quick protocol, \(\tau = \frac {1}{2}\), the closed system performs the worst, an open system can improve on χ around \(t \approx 3\), while optimising κ further increases χ. For an intermediate value, \(\tau = 1\), the closed system outperforms the open system for long enough experiments, but it is still worse than the optimised system. Driving the magnetic field even slower (\(\tau =2\)) the closed system and the optimised system performs identically, i.e., optimisation does not improve the outcome. However, in reality no isolated system can be prepared, hence the conclusion remains: optimisation improves χ and may worth the effort.

Figure 7
figure 7

Comparison of annealing and non-annealing processes by varying the annealing time, τ. The solid lines are for open systems with \(\kappa =0.003\) (top) and 0.02 (bottom). The dash-dotted lines correspond to optimized κ, while the dashed lines are for an isolated system

The bottom panel of Fig. 7 corroborates our remarks. It is worth making two further comments. First, ‘no-annealing’ protocol seems to reach its asymptotic value very quickly for stronger couplings, hence repeating it twice or thrice, instead of any smooth quenches, may be a better approach. Second, the maxima of χ for open systems with annealing protocols are significantly reduced and they perform only slightly better than the ‘no-annealing’ protocol.

For both optimised and non-optimised cases we calculate the cumulative probability, \(P_{\text{c}}\), of ‘not finding the true ground state in n consecutive experiments’ as

$$ P_{\text{c}}(n) = \prod_{i=1}^{n}(1-P_{i}), $$

where \(P_{i}\) is the probability of ending up in the ground state in the ith experiment. In experiments, where the system-bath coupling is not optimised for, \(P_{i}\) remains constant throughout, hence \(P_{\text{c}}(n) = (1-P_{1})^{n}\). However, with optimisation \(P_{i}\) changes in each iteration and one may achieve a faster decrease than in the non-optimised case. Figure 8 demonstrates the difference between these approaches: in the optimised case the probability of missing the ground state tends to zero faster than the non-optimised case. As we learn better \(\kappa _{i}\) values after each iteration, the probability of finding the ground state is higher than in the non-optimised case. We note that, since the submission of our manuscript, some recent studies reached similar conclusion to ours, for example in terms of greedy optimisation of interaction parameters [67] or via genetic optimization of the annealing schedule [68].

Figure 8
figure 8

The cumulative probability, \(P_{\text{c}}\), is shown for four runs, with random initial couplings. In two runs (red) these initial couplings are frozen and kept constant, while in the other runs κ is optimized (blue) in each step. Even for the ‘bad’ initial guesses the curves decrease faster. (Inset) Same data with logarithmic ordinate

4 Conclusion

We have studied the annealing of an archetypal transverse Ising spin (qubit) system coupled to an infinite heat bath with which it exchanges energy. We focused upon the probability of finding the ground state by the end of an experiment in finite time, if repeated runs are permitted. While these repetitions may extend the overall run-time of the annealing procedure, the probability of missing the true ground state in all experiments diminishes exponentially. We have also analysed the role of the annealing time, τ, and that of the site-dependent qubit-bath coupling strengths. However, it is left for future research to investigate the effects of graph theoretical quantities, such as adjacency structure, centrality, in-betweenness, etc, on the annealing procedure.

Focusing on a single experiment, we identified parameter ranges in which the environment can assist and improve the performance of the annealing. We have shown that the quench parameter, τ, and the system-environment couplings, \(\lbrace \kappa _{i} \rbrace \), can be optimised to improve the annealing process and keep the state of the quantum system close to the instantaneous ground state throughout the entire experiment.

Finally, repeating the simulation multiple times, the system ground state can be identified quicker if the system-bath coupling strength is varied in a supervised way at each iteration, compared to if one repeats the simulation with the system-bath coupling strength maintained constant.