Quantum Annealing Enhanced Markov-Chain Monte Carlo Shunta Arai, Tadashi Kadowaki Abstract In this study, we propose quantum annealing-enhanced Markov Chain Monte Carlo (QAEMCMC), where QA is integrated into the MCMC subroutine. QA efficiently explores low-energy configurations and overcomes local minima, enabling the generation of proposal states with a high acceptance probability. We benchmark QAEMCMC for the Sherrington-Kirkpatrick model and demonstrate its superior performance over the classical MCMC method. Our results reveal larger spectral gaps, faster convergence of energy observables, and reduced total variation distance between the empirical and target distributions. QAEMCMC accelerates MCMC and provides an efficient method for complex systems, paving the way for scalable quantum-assisted sampling strategies. Introduction Sampling from a Gibbs-Boltzmann distribution has numerous practical applications across various fields, such as combinatorial optimization [ 1 ] , biology [ 2 ] , and machine learning [ 3 ] . A widely used approach is the Markov-Chain Monte Carlo (MCMC) method [ 4 ] with the Metropolis-Hastings (M-H) acceptance probability [ 5 ] . In this scheme, we generate a proposal state from any probability distribution and decide whether the proposal state is accepted or not, based on the M-H acceptance probability. This process is repeated until the samples can be considered to come from a stationary distribution. Many iterations are needed to reach the stationary distribution for complex energy landscapes like spin glass [ 6 ] . Therefore, faster convergence of MCMC is a crucial problem. To achieve faster convergence of MCMC, a well-known approach is the cluster update [ 7 , 8 ] , which involves updating multiple spins at once and is more efficient than local update. Cluster update is a technique primarily developed in pure systems. However, they are ineffective in spin glass due to frustration, which yields many local minima in the energy landscape [ 9 ] . They cannot overcome the slow relaxation in low temperature. For this reason, the extended ensemble methods such as exchange Monte Carlo [ 10 ] and parallel tempering [ 11 ] and the efficient sequential Monte Carlo algorithm like population annealing [ 12 ] have been proposed to evade the slow relaxation for spin glass. Acceleration of the dynamics of MCMC for spin glass is a challenging task. In a previous study, machine learning has been applied to accelerate the dynamics of MCMC. One of the pioneering research is the self-learning Monte Carlo (SLMC) method [ 13 , 14 ] . In SLMC, the effective model trained from training data has been introduced to accelerate the dynamics of MCMC. The proposal from the effective model has yielded the global update and brought about faster convergence of MCMC. This pioneering research has led to the development of Neural MCMC (NMCMC) algorithm [ 15 , 16 , 17 , 18 , 19 ] . In NMCMC, an autoregressive neural network, which has a high representation power and whose probability can be computed easily without evaluating the partition function, has often been applied as the effective model. Although NMCMC could provide a computational speed-up over the MCMC with a local update for the ferromagnetic Ising model and two-dimensional (2d)-Edward Anderson model, NMCMC has not worked in the antiferromagnetic Potts model on a random graph, which is the representative example of the hard problem with random first-order phase transition [ 20 ] . To accelerate the dynamics of MCMC, an alternative approach has been proposed called the quantum-enhanced MCMC (QEMCMC) [ 21 ] . In QEMCMC, gate-based quantum computers generate new proposal states using quantum time evolution. The classical computer subsequently determines whether the proposal state is accepted or not. The previous study numerically has demonstrated that this hybrid quantum and classical algorithm converged faster than the classical MCMC method with uniform and local updates for the small spin systems [ 21 ] . The proposal states had energy similar to the current state with a larger Hamming distance than the local update. This characteristic of samples obtained from QEMCMC led to faster convergence of MCMC. Moreover, QEMCMC has been extended to a coarse-grained approach for larger size problems than the size of the quantum computer [ 22 ] , variational methods for adjusting hyperparameters [ 23 ] , and continuous systems [ 24 ] . In the recent theoretical analysis, QEMCMC has not yielded a quantum speed-up over classical sampling on the masked item sampling problem [ 25 ] . A bottleneck analysis has indicated the region where quantum improvement may exist [ 26 ] . In addition to the gate-based quantum computer, quantum time evolution can be realized in a quantum annealer [ 27 , 28 , 29 , 30 , 31 ] . The quantum annealer is the physical implementation of quantum annealing (QA), which is the metaheuristic for combinatorial optimization problems [ 32 , 33 , 34 , 35 , 36 , 37 ] . The primary usage of the quantum annealer is divided into optimization and sampling . For the optimization task, the quantum annealer has been applied to various combinatorial optimization problems [ 38 , 39 ] . For the sampling task, the quantum annealer is used to generate samples from the approximated Gibbs-Boltzmann distribution governed at a hardware-specific effective temperature [ 40 , 41 , 42 ] . Recently, the quantum annealer has been applied to various quantum simulations at a finite temperature such as three-dimensional spin glass [ 43 ] , fully frustrated square-octagonal lattice [ 44 ] , and spin ice [ 45 ] . Hardware development of the quantum annealer enables the operation in a coherent regime [ 46 , 47 ] . The examples presented above utilize the outputs from the quantum annealer directly. In this paper, we propose the usage of QA in the MCMC subroutine. We focus on the features that QA can yield low-energy configurations and escape local minima efficiently. Inspired by QEMCMC [ 21 ] , we generate the proposal state by QA. The classical computer accepts or rejects the proposal state with the M-H acceptance probability. Because the resultant Markov chain is satisfied with the detailed balance condition, the stationary distribution obtained by QAEMCMC matches the target distribution. In the previous study [ 48 ] , the quantum annealer has been utilized for a sampler of the training data for NMCMC. The NMCMC sampler, which mimics the output distribution of the quantum annealer, has been used as the proposal distribution. In this study, we focus on the potential of the direct output distribution obtained by QA in the MCMC subroutine. We investigate how the advantage of quantum fluctuations at low temperatures affects the sampling with the MCMC procedure. Following the previous study [ 21 ] , we consider the Sherrington-Kirkpatrick (SK) model [ 49 ] as a benchmark problem. We show the analysis of the absolute spectral gap and the behaviors of observables. We demonstrate that QAEMCMC yields significant spectral gaps and faster convergence of the Markov chain than the classical updates. This paper is organized as follows. In the next section, we explain the classical MCMC method and QAEMCMC. In the following section, we present the numerical simulations of QAEMCMC for the SK model. The final section is dedicated to discussing and summarizing the results. Methods In this section, we explain the mathematical formulation of MCMC and the proposed method. Markov-Chain Monte Carlo MCMC starts from a trivial spin configuration \bm{\sigma} and constructs a sequence of states, which is called a Markov chain, by updating the current state with the transition probability P(\bm{\sigma}^{\prime}|\bm{\sigma}) . The transition probability is designed so that the stationary distribution corresponds to the target distribution \mu(\bm{\sigma}) . Then, the resultant Markov chain can be regarded as samples from the target distribution if MCMC iterates sufficiently. The sufficient condition to converge the Markov chain to the target distribution is to satisfy the detailed balance condition : P(\bm{\sigma}^{\prime}|\bm{\sigma})\mu(\bm{\sigma})=P(\bm{\sigma}|\bm{\sigma}^{\prime})\mu(\bm{\sigma}^{\prime}), (1) for all \bm{\sigma}\neq\bm{\sigma}^{\prime} . The popular approach to construct P(\bm{\sigma}^{\prime}|\bm{\sigma}) is the M-H method [ 5 ] . The M-H method decomposes P(\bm{\sigma}^{\prime}|\bm{\sigma}) into the acceptance probability A(\bm{\sigma}^{\prime}|\bm{\sigma}) and the proposed probability Q(\bm{\sigma}^{\prime}|\bm{\sigma}) as P(\bm{\sigma}^{\prime}|\bm{\sigma})=A(\bm{\sigma}^{\prime}|\bm{\sigma})Q(\bm{\sigma}^{\prime}|\bm{\sigma}) . At first, we sample the proposal state \bm{\sigma}^{\prime} from Q(\bm{\sigma}^{\prime}|\bm{\sigma}) . Next, we decide whether the current proposal is accepted or rejected with the M-H probability as A(\bm{\sigma}^{\prime}|\bm{\sigma})=\mathrm{min}\left(1,\frac{\mu(\bm{\sigma}^{\prime})}{\mu(\bm{\sigma})}\frac{Q(\bm{\sigma}|\bm{\sigma}^{\prime})}{Q(\bm{\sigma}^{\prime}|\bm{\sigma})}\right). (2) For a binary system \bm{\sigma}\in\{1,-1\}^{N} where N is the system size, the local update is often applied. This involves choosing a random spin index i\in[1,N] of the current spin configuration and flipping it as \sigma_{i}^{\prime}\leftarrow-\sigma_{i} . The mathematical representation of Q(\bm{\sigma}^{\prime}|\bm{\sigma}) for the local update can be described as Q_{\mathrm{local}}(\bm{\sigma}^{\prime}|\bm{\sigma})=\begin{cases}\frac{1}{N}\quad&(d(\bm{\sigma}^{\prime},\bm{\sigma})=1)\\ 0\quad\quad&(otherwise)\end{cases}, (3) where d(\bm{\sigma}^{\prime},\bm{\sigma})=\sum_{i=1}^{N}|\sigma_{i}^{\prime}-\sigma_{i}| is the Hamming distance between the current and proposed states. In the local update, Eq. ( 2 ) is easily calculated since the ratio of the Boltzmann factor \mu(\bm{\sigma})/\mu(\bm{\sigma}^{\prime}) can be efficiently computed. It is noted that the local update often fails to escape local minima, and the resultant acceptance probability is very low in low-temperature regions [ 4 ] . Another common approach is the uniform update, which employs uniform sampling from Q_{\mathrm{uniform}}(\bm{\sigma})=\frac{1}{2^{N}}. (4) In the case that the proposed state is independent of the current state, the M-H acceptance probability can be extended as A(\bm{\sigma}^{\prime}|\bm{\sigma})=\mathrm{min}\left(1,\frac{\mu(\bm{\sigma}^{\prime})}{\mu(\bm{\sigma})}\frac{Q(\bm{\sigma})}{Q(\bm{\sigma}^{\prime})}\right), (5) which is called as Metoplized independent sampling [ 50 ] . It is noted that a simple calculation confirms the detailed balance condition with Eq. ( 5 ). While the uniform update may give rise to the proposal states with a large Hamming distance and lead to escape from the local minima, the acceptance probability becomes low. As a result, the small acceptance probability deteriorates the convergence rate of the Markov chain. Mixing time \tau_{\epsilon} is utilized to quantify the convergence rate of the Markov chain. It is defined as the minimum number of iterations needed for the probability distribution obtained by the Markov chain to get within \epsilon>0 of \mu(\bm{\sigma}) in total variation distance for any initial distribution as (1-\delta^{-1})\ln 2\epsilon\leq\tau_{\epsilon}\leq-\delta^{-1}\ln\left(\epsilon\mathrm{min}_{\bm{\sigma}}\mu(\bm{\sigma})\right) (6) where \delta is the absolute spectral gap as \delta=1-\mathrm{max}_{\lambda\neq 1}\lambda and \lambda is the eigenvalues of P(\bm{\sigma}^{\prime}|\bm{\sigma}) [ 4 ] . Equation. ( 6 ) shows that the mixing time is bounded by the absolute spectral gap, and a larger spectral gap results in a shorter mixing time. The absolute spectral gap depends on the choice of Q(\bm{\sigma}^{\prime}|\bm{\sigma}) in the M-H method. Choosing a proposal probability that increases the absolute spectral gap leads to faster convergence of MCMC. QA-enhanced MCMC In QA, the Hamiltonian can be constructed as \hat{H}=\mathcal{A}(s(t))\hat{H}_{0}(\bm{\hat{\sigma}}^{z})-\mathcal{B}(s(t))\sum_{i=1}^{N}\hat{\sigma}_{i}^{x} (7) where \hat{\sigma}_{i}^{z} and \hat{\sigma}_{i}^{x} are the Pauli operators acting on the site i , and \hat{H}_{0}(\bm{\hat{\sigma}}^{z}) is the target Hamiltonian whose eigenvalues correspond to the energy of the Gibbs-Boltzmann distribution \mu(\bm{\sigma})=\frac{1}{Z}\bra{\bm{\sigma}}\exp(-\beta\hat{H}_{0}(\bm{\hat{\sigma}}^{z}))\ket{\bm{\sigma}}. (8) The partition function is defined as Z=\sum_{\bm{\sigma}}\bra{\bm{\sigma}}\exp(-\beta\hat{H}_{0}(\bm{\hat{\sigma}}^{z}))\ket{\bm{\sigma}} and \beta=1/T is the inverse temperature. The annealing schedule function \mathcal{A}(s(t)) and \mathcal{B}(s(t)) interpolate two Hamiltonians as a function of annealing parameter s(t) . We adopt the linear schedule as \mathcal{A}(s(t))=s(t) and \mathcal{B}(s(t))=1-s(t) . In the vanilla QA, the initial state is the superposition state, which is the ground state of the second term in Eq. ( 7 ), and evolves following the Schrödinger dynamics. The annealing parameter s(t) increases monotonically from s(t=0)=0 to s(t=\tau)=1 . The annealing time \tau determines the period of total time evolution. If the dynamics evolves adiabatically, the final state concentrates on the ground state of \hat{H}_{0}(\bm{\hat{\sigma}}^{z}) in the limit of \tau\rightarrow\infty . In the short or intermediate annealing time, the final states deviate from the ground state, and various eigenstates can be found. The classical spin configuration samples from the final state of the wavefunction \ket{\psi} with the probability Q_{\mathrm{QA}}(\bm{\sigma})=|\braket{\bm{\sigma}|\psi}|^{2}. (9) For the large but not infinite annealing time, the probability concentrates around the ground state of the target Hamiltonian, and we can find the low-energy configurations. We utilize this diabatic effect of QA to generate the proposal state in the MCMC subroutine. According to the standard protocol of the M-H method, the proposed state is sampled from Eq. ( 9 ) and decided whether the proposed state is accepted or not. This QA update and acceptance or rejection steps are iterated. We refer to the above procedure as QA-ehnhanced MCMC (QAEMCMC). The schematic diagram of the QAEMCMC protocol is plotted in Fig. 1 . Results In this section, we show the results of the SK model as \hat{H}_{0}(\hat{\bm{\sigma}}^{z})=\sum_{i0.1 , which is difficult to sample efficiently. Each line represents the averaged values computed from the independent 100 MCMC runs. The shaded region represents the standard deviation. The result obtained by the QA update converges the exact equilibrium energy \bar{E}_{\mathrm{ex}}=\sum_{\bm{\sigma}}\mu(\bm{\sigma})\bra{\bm{\sigma}}\hat{H}_{0}(\bm{\hat{\sigma}}^{z})\ket{\bm{\sigma}} faster than those by other updates. Figure 4 (b) shows the absolute error between the averaged energy and the exact equilibrium energy as |\ \bar{E}-\bar{E}_{\mathrm{ex}}| . The horizontal line denotes |\ \bar{E}-\bar{E}_{\mathrm{ex}}|=0.1 . The QA update achieves |\ \bar{E}-\bar{E}_{\mathrm{ex}}|=0.1 at \tau_{\mathrm{MCS}}\simeq 618 . The uniform and local updates reach at \tau_{\mathrm{MCS}}\simeq 21232 and \tau_{\mathrm{MCS}}\simeq 7920 respectively. The QA update gives a better estimator, at least more than about twelve times faster than the classical updates. Therefore, the QA update can realize efficient sampling of the low-energy states dominated by the Gibbs-Boltzmann distribution. Figure 4: (a): The dynamics of the averaged energy obtained at T=1 from MCMC. The horizontal axes represent the number of MCS. The horizontal line denotes the exact equilibrium energy. (b): The absolute error between the exact equilibrium energy and the empirical averages. The horizontal line represents \Delta E=0.1 . Figure 5: (a): The Monte Carlo step dependence of the total variation distance between the Gibbs-Boltzmann distribution and the empirical probability distribution with fixed T=1 and N=10 . (b): the system size dependence of the total variation distance with fixed T=1 and \tau_{\mathrm{MCS}}=10^{5} . In addition to the efficacy of the sampling of the low-energy states, whether the empirical distribution Q_{\mathrm{emp}}(\bm{\sigma}) obtained by MCMC converges to the target distribution P_{\mathrm{ex}} is also important in MCMC. We compute the total variation distance between P_{\mathrm{ex}}(\bm{\sigma}) and Q_{\mathrm{emp}}(\bm{\sigma}) as TV(P_{\mathrm{ex}},Q_{\mathrm{emp}})=\frac{1}{2}\sum_{\bm{\sigma}}|P_{\mathrm{ex}}(\bm{\sigma})-Q_{\mathrm{emp}}(\bm{\sigma})|_{1}. (11) The experimental settings are the same as those in Fig. 4 . Figure 5 (a) demonstrates the dependence of TV(P_{\mathrm{ex}},Q_{\mathrm{emp}}) on \tau_{\mathrm{MCS}} . The scaling of TV(P_{\mathrm{ex}},Q_{\mathrm{emp}}) follows the power law decay as a function of \tau_{\mathrm{MCS}} shown in Table 2 . The QA update gives larger exponents than the local updates. Even though the difference in the exponents between the QA update and the uniform update for \tau_{\mathrm{MCS}} is small, the constant gap exists. Therefore, the QA update converges to the target distribution faster than other updates. Figure 5 (b) exhibits the dependence of TV(P_{\mathrm{ex}},Q_{\mathrm{emp}}) on N with \tau_{\mathrm{MCS}}=10^{5} . The scaling exponents fitted by 2^{\gamma N} are shown in Table 2 . The QA update yields smaller exponents than the classical updates. The difference between the QA and other updates increases as we increase N . For the large N , the QA update is effective. The acceleration of the MCMC convergence by the QA update can be seen from the dynamical simulations. Table 2: The scaling exponents of the total variation distance for the data in Fig. 5 . update TV(P_{\mathrm{ex}},Q_{\mathrm{emp}})\sim\tau_{\mathrm{MCS}}^{-\alpha} TV(P_{\mathrm{ex}},Q_{\mathrm{emp}})\sim 2^{\gamma N} uniform \alpha=0.939\pm 0.017 \gamma=0.526\pm 0.017 local \alpha=0.855\pm 0.013 \gamma=0.494\pm 0.057 QA \alpha=0.254\pm 0.005 \gamma=0.226\pm 0.017 Figure 6: The dependence of the cumulative probability distribution on (a): the Hamming distance and (b): the difference of the absolute energy between the current configurations and the proposed ones for the fixed N=10 and T=1 . Each symbols represent the different update schemes. (c): the acceptance probability for each update. The error bar represents the standard deviation. Finally, we investigate the features of samples obtained from different updates with the cumulative probability of the observables \mathcal{O}(\bm{\sigma},\bm{\sigma}^{\prime}) . For each Markov chain, we compute \mathcal{O}(\bm{\sigma},\bm{\sigma}^{\prime}) with the current spin configuration \bm{\sigma} and proposed one \bm{\sigma}^{\prime} . We focus on the cumulative probability of Hamming distance between two spin configurations and the absolute energy difference |\Delta E|(\bm{\sigma},\bm{\sigma}^{\prime})=|\bra{\bm{\sigma}}\hat{H}_{0}\ket{\bm{\sigma}}-\bra{\bm{\sigma}^{\prime}}\hat{H}_{0}\ket{\bm{\sigma}^{\prime}}| . The cumulative probability is calculated from n_{\mathrm{all}}=10^{5} spin configurations as \displaystyle P_{\mathrm{cum}}(d) \displaystyle=\sum_{x=0}^{d}P_{\mathrm{ham}}(x),\hskip 2.84526ptP_{\mathrm{ham}}(x)=\frac{\#d(\bm{\sigma},\bm{\sigma}^{\prime})=x}{n_{\mathrm{all}}}, (12) \displaystyle P_{\mathrm{cum}}(|\Delta E|) \displaystyle=\int_{0}^{|\Delta E|}P_{|\Delta E|}(x)dx,\hskip 2.84526ptP_{|\Delta E|}(x)=\frac{\#|\Delta E|(\bm{\sigma},\bm{\sigma}^{\prime})=x}{n_{\mathrm{all}}}, (13) where \#\mathcal{O}(\bm{\sigma},\bm{\sigma}^{\prime})=x denotes the number of samples satisfied with \mathcal{O}(\bm{\sigma},\bm{\sigma}^{\prime})=x . For the uniform and QA updates, we utilize the data with \tau_{\mathrm{MCS}}=10^{5} in Fig. 5 . Figure 6 (a) shows the dependence of P_{\mathrm{cum}}(d) on Hamming distance. Each marker denotes the average over 100 different instances used in Figs. 2 and 5 . The error bar and the shaded region denote the standard deviation. As defined, the local update proposes the next state with d=1 , while the proposal distribution of the uniform update concentrates around d=5 , which is the highest number of states. This result is consistent with the result presented in the previous study [ 21 ] . The QA update gives the samples with a smaller Hamming distance than the uniform update. The main feature of the QA update is that we can obtain the samples with a large Hamming distance, which is far from the current state. Figure 6 (b) exhibits the dependence on the absolute difference of the energy between the current and proposed states represented as |\Delta E| . Each curve denotes the results for different instances. In many instances, the QA update gives samples with a smaller |\Delta E| than the uniform and local updates. As shown in Fig. 6 (c), the small |\Delta E| leads to a high acceptance probability. Therefore, the QA update can yield the samples with large d and small |\Delta E| . We can interpret the QA update, which enables us to transition to the different local minima. Discussion and Conclusion In this paper, we proposed QAEMCMC, where QA was utilized to generate proposal states in the MCMC subroutine. We investigated the performance of QAEMCMC compared to the classical MCMC in the SK model. We exhibited that QAEMCMC yielded a larger spectral gap than the classical updates. The QA update mitigated the difficulty of sampling in the low-temperature regime. More than doubled quantum enhancement existed from the exponents of the spectral gap. We also showed the dynamical simulation of the averaged energy and the total variation distance between the empirical distribution and target distribution. We obtained a better estimation of observables and the distribution statistics faster than the classical MCMC by QAEMCMC. The sample characteristics obtained by QAEMCMC demonstrated that QA could explore broader regions of the configuration with low energy and overcome trapping in local minima. Our results exhibited that the proposal distribution obtained by QA was effective in the sampling tasks for complex systems. They may be useful to verify the validity of the usage of QA data in NMCMC [ 48 ] . It is noted that QA cannot find the degenerated ground states with equal probability [ 54 , 55 ] . The probability of the isolated ground state is suppressed in the large annealing time region due to the bias generated from the transverse field term. The higher-order driver term mitigates this unfair sampling of QA. In the intermediate annealing time region, the probability of the isolated ground state remains a finite value. If we choose the proper annealing time, the unfair sampling problem can be relieved. This unfair sampling problem does not preclude QA applications from being included in the MCMC subroutine. In a recent study [ 56 ] , time-dependent Hamiltonian evolution like reverse annealing [ 57 ] has been applied to QEMCMC. Our approach is similar to this approach. The reverse annealing leads to exploring the region around the initial spin configuration. The QA update can yield a global update irrespective of the current spin configuration, which creates a large spectral gap in the low-temperature region. A detailed study is needed since the large gap between the two approaches exists for the spectral gap in low-temperature regions. Our simulation was limited to the small system size, and whether QAEMCMC is effective for large-size problems is an open question. As conducted in the previous study [ 56 ] , tensor networks are useful for validating the efficacy of QAEMCMC for large-scale problems. This is an interesting future research topic. Author contributions statement S.A. designed this study and conducted the numerical experiments. T.K. contributed to managing this project. All authors discussed the results and commented on the manuscript. Competing Interests The author(s) declare no competing interests. Data Availability The datasets used in our study are available from the corresponding author upon reasonable request.