1 Introduction

Optimization problems have increasing importance in many fields [1], which is driven by several factors, including the demand for competitiveness, better use of resources, and the increasing complexity and interconnectivity in the contemporary world. However, many problems of practical relevance are computationally hard [2] [3]. Quantum computational devices offer a promising perspective in handling such difficulties [4]. These include quantum annealers, such as the D-Wave machines [5]. In principle, such machines could solve a variety of (hard) optimization problems “naturally” by finding low energy eigenstates encoding the solution [6, 7]. Therefore, the development of quantum technology has the potential to efficiently solve complicated discrete optimization problems by encoding them into the energy of a physical system, consequently, offering the optimal solution as one of the ground states (since there exist Ising formulations of NP-hard problems [8]). Indeed, during adiabatic evolution [9], such a system reaches a ground state “naturally.” Therefore, in principle, an optimal solution of the encoded problem can be read out from the state deterministically.

Quantum annealers such as the D-Wave machine are approximate physical realizations of an adiabatic quantum computer, i.e., they are based on a real physical system. They realize a fixed topology of couplings, e.g., the Chimera or Pegasus graphs. Thus, the optimization problem must be embedded into this topology either as an induced subgraph or in a redundant manner using multiple physical quantum bits to represent a logical one. This procedure is called minor embedding and even though it is often doable relatively simply, finding an optimal embedding is a hard computational problem itself.

No real quantum system can be entirely separated from its environment: the phenomena such as the heat exchange [10] or decoherence [11] cannot be wholly neglected in the case of a physical quantum annealer. This leads to a noisy version of the adiabatic evolution [12]. Moreover, the measurements performed at the last stage of computations are not perfect either. As the dimensionality of the underlying Hilbert space grows exponentially with the number of qubits [13], the aforementioned issues affect the results to an even greater extent. To tackle these problems in a quantum annealing device, the adiabatic evolution is run repeatedly, each run followed by a readout. The results form a statistical sample of configurations and objective values, possibly containing optimal solutions, i.e., the minimum energy states. The quantum annealer implements probabilistic heuristics, which are still potentially valuable for addressing specific hard computational problems.

The setting of the annealing procedure is challenging, even in the case of an ideal system. The parameters of the process depend on the minimum gap between the instantaneous ground state and the rest of the spectrum during the evolution, which in general, cannot be determined [14]. Therefore, in the observed result, which is the output from a physical quantum annealer, the elements of the output sample can have significantly higher energy than the ground states. Thus, whether any ground state has been sampled is an essential question in practical applications. In many cases, only the ground state is useful in physical applications, while in optimization problems, low-energy excited states are often also valuable. Therefore, obtaining states close to the ground state in the sample also bears significant relevance.

The estimation of the success probability of having a ground state (or states close to it in energy) in the sample has also been addressed in the benchmarking literature, see, e.g., [15,16,17]. In the state-of-the-art benchmark scenarios, the addressed optimization problems are specifically designed, i.e., the ground state is usually known in advance, and the size of a problem is typically small. The success probability is then empirically investigated based on solving various benchmark problems and comparing the result with known solutions. Our idea is different: We propose the complementary method of estimating the ground-state energy and testing the quality of the solution against containing any ground state solely using statistical analysis of the output of the Ising machine. We build on certain generic assumptions coming from the statistical description of the system, and therefore, our method is more suitable for larger problems. This is in line with our intention to use it in application-driven scenarios. We will, however, use the minimum energy known from other calculations to validate our method.

Our goal is to use the entire sample resulting from a quantum annealer (or a similar device) to estimate the likelihood of having a ground state or at least states from the low-energy part of the spectrum in the sample. We remark here that as quadratic binary optimization problems are NP-hard, polynomial-time bounds on the optimal solution constitute important results in the classical literature on the problem, see, e.g., the works of Nesterov [18] or Ye [19]. Those results also provide hints to find the distance between a particular solution and the optimal one. In a similar spirit, we can consider probabilistic solvers.

In [20], it has been proposed that in future quantum annealer designs to improve the convergence of solutions into the ground state with the increase in the number of spins, the temperature needs to be scaled down. For high enough temperatures, [20] assumes power-law scaling of the heat capacity with temperature. Such scaling is typically a near-phase-transition behavior, similar to that described by critical exponents. In [20], the relation between the first three cumulants of the Ising energy output and the heat capacity has been calculated using the Boltzmann distribution and the fluctuation-dissipation theorem. We will use this relation to estimate the ground-state energy from the spectrum.

Our research is tied to Extreme Value Theory [21] where limits for low values are estimated from a particular probabilistic model of the sample. However, instead of estimating the extreme-value distribution, we assume its form from the underlying Ising model and use it to estimate the minimal values.

The paper is organized as follows. In Sect. 2, a theoretical introduction of our model is presented. In Sect. 3, the results of our experiments using data both from simulators and real D-Wave machines are discussed. In Sect. 4, the results are summarised and conclusions are drawn. Appendix 1 contains more details on performing the Metropolis-Hastings simulations.

2 Theoretical model

Quantum annealers are based on the Ising model defined by the following Hamiltonian:

$$\begin{aligned} H = \sum _{(i.j) \in {\mathcal {E}}} J_{i,j} s_i s_j + \sum _{i \in {\mathcal {V}}} h_i s_i, \end{aligned}$$
(1)

where \({\mathcal {V}}\) is a set of spins (vertices), and \({\mathcal {E}}\) describes the topology of the processor. Furthermore, \(s_i \in \{-1, 1\}\) is the spin value at the i’th vertex of \({\mathcal {E}}\), \(J_{i,j}\) is the coupling between spin at vertex i and spin at vertex j, and \(h_i\) is the local field acting on spin at vertex i.

In certain cases, it is more convenient to deal with quadratic unconstrained binary optimization problems (QUBOs):

$$\begin{aligned} \min _{{\mathbf {x}}} {\mathbf {x}}^\top Q {\mathbf {x}} \, , \end{aligned}$$
(2)

where \({\mathbf {x}}\) is a binary vector of decision variables, and Q is an arbitrary matrix which can be, without loss of generality, symmetric or upper triangular. There is a one-to-one relation [22] between Ising problems of finding the ground state of the Hamiltonian in Eq. (1) and the QUBO problems in Eq. (2), as their objective function’s values depend linearly on each other. The physical quantum annealers are expected to reach a ground state of the classical Ising model, so even for a QUBO model, the energy samples will reflect Ising spectra. Therefore, our results will also apply to the output of the QUBO formulations.

2.1 Background

Let us now briefly recapitulate the considerations in [20], where the authors, using the techniques of statistical physics, analyze the energy spectrum of the Ising model under the assumption of the Boltzmann distribution. Concerning the effect of finite temperature, the analysis concludes that the probability of sampling the ground state goes to zero exponentially with the number of spins N. Thus, scaling down the temperature can help in regaining the success probability.

In the considerations of [20], there are two types of scaling of the specific heat with the temperature assumed: power-law for low values of \(\beta = \frac{1}{T}\) and exponential for high values (albeit it is claimed as a general assumption that the system is not tuned to a phase transition point). We focus on the lower range, i.e., relatively high temperatures, as we expect our D-Wave samples to fall into this region. Hence, we will adopt the assumption that specific heat behaves as

$$\begin{aligned} c(\beta ) = - A \beta ^{-\alpha -2}, \end{aligned}$$
(3)

where A is the coefficient of the particular instance, and \(\alpha \) is a parameter of the model. The spread of energies is measured as a standard deviation of the sample of energies

$$\begin{aligned} \sigma (H) = \sqrt{-N c(\beta )}. \end{aligned}$$
(4)

Following [20], the mean of the energy distribution of the Ising system can be expressed as

$$\begin{aligned} \langle H \rangle = E_0 -N \int _{\beta }^{\infty } c(\beta ') d \beta ' , \end{aligned}$$
(5)

where \(E_0\) is the ground-state energy. Following [20], asymmetry can be written as

$$\begin{aligned} \eta (H) = \frac{1}{\sqrt{N}} \frac{1}{-c(\beta )^{3/2}} \frac{d c(\beta )}{d \beta }. \end{aligned}$$
(6)

Our model is based on assumptions expressed in Eqs. (3), (4), (5), and (6). Eq. (3) describes the scaling, which is independent from the underlying distribution. Remaining assumptions stem from our assumption of the Boltzmann distribution. In the case when a different distribution is assumed (as quantum annealer may also operate in the non-equilibrium region or even in the coherent one [23]), these assumptions should be tested separately. In this way, a different model version can be obtained, which may outperform the original one if the assumed distribution is closer to the real one. The exact distribution is, however, unknown. Therefore, we assume the Boltzmann distribution, and as shown later, with this assumption, the performance of our method is acceptable.

2.2 Results

From the assumptions presented in Sect. 2.1, we can derive relations, which will be used to asses validity of the Ising-based output. Using Eq. (4) (see also [20]), we are given the formula for the variance:

$$\begin{aligned} \sigma ^2(H) = N A \beta ^{-\alpha -2}. \end{aligned}$$
(7)

Next, with the use of Eq. (7) and solving Eq. (5), we obtain:

$$\begin{aligned} \langle H \rangle = E_0 + N \frac{A}{\alpha + 1} \beta ^{-\alpha - 1} = E_0 + \frac{\sigma ^2(H) \beta }{\alpha + 1}. \end{aligned}$$
(8)

Analogously, by solving Eq. (6), we get

$$\begin{aligned} \eta (H) = \frac{1}{\sqrt{N A}} (\alpha + 2) \beta ^{\alpha / 2} = \frac{\alpha + 2}{\sigma (H) \beta }. \end{aligned}$$
(9)

Finally, combining Eqs. (8) and (9), we obtain the formula for the ground-state energy, which can be used as an estimator

$$\begin{aligned} E_0 = \langle H \rangle - \frac{\alpha + 2}{\alpha + 1} \frac{\sigma (H)}{\eta (H)}. \end{aligned}$$
(10)

In the similar manner, the parameter \(\beta \) can be estimated

$$\begin{aligned} \beta = \frac{E_0 - \langle H \rangle }{\sigma (H) \eta (H) (E_0 - \langle H \rangle ) + \sigma ^2(H)}. \end{aligned}$$
(11)

The energy of the ground state and the parameter \(\beta \), under our assumptions, can be expressed as a function of cumulants \(\sigma \), \(\eta \) and \(\langle H \rangle \), which will be later estimated from samples. Both in Eq. (10) and Eq. (11), the asymmetry \(\eta (H)\) can be computed as normalised 3rd cumulant \(c_3\) of the sample of energies, i.e.:

$$\begin{aligned} \eta (H) = \frac{c_3(H)}{\sigma (H)^3}. \end{aligned}$$
(12)

2.3 Estimation error analysis

The output of the quantum annealer (or its simulator) is an n-sample of energies and configurations. Our method uses only the energies as input. The goal is to estimate the ground-state energy using methods of moments, i.e., via cumulants computed from the data. Next, we will compare the estimate with the minimum value from the sample in order to assess the likelihood of the event that the sample contains the ground-state energy.

To construct the distribution of estimated ground-state energies \(E_0\) in order to obtain a significance threshold, we use Bootstrap resampling [24]. In details, let \(H_1, H_2, \ldots , H_n\) be a sample, and \(E_0(H_1, H_2, \ldots , H_n)\) be the estimate of the ground-state energy via Eq. (10). Then, from \(H_1, H_2, \ldots , H_n\), we sample n items with replacements, i.e., repeating some of the elements optionally. Let us denote the resulting samples by \(H_1^{(j)}, H_2^{(j)}, \ldots , H_n^{(j)}\). For each such sample, we compute \(E_0^{(j)}\). Repeating this procedure S times, we obtain the desired estimated distribution of \(E_0\)-s.

To validate the Bootstrap approach, we compute the standard deviation of \(E_0\) by k-statistics approximation and standard error calculus. In order to do so, it is convenient to combine Eq. (10) with Eq. (12), then:

$$\begin{aligned} E_0 = \langle H \rangle - \frac{\alpha + 2}{\alpha + 1} \frac{\sigma (H)^4}{c_3(H)}. \end{aligned}$$
(13)

Let \(c_k\) be the non-normalised kth order cumulant; we will omit the argument H of all cumulants in what follows. The estimation error of \(\langle H \rangle \) can be neglected in comparison with the estimation error of \(\sigma ^2\) and \(c_3\), as the estimation error of moments (and cumulants) tends to increase with their degree. To estimate the standard deviation of cumulants’ estimation, we approximate the cumulants with k-statistics, which is valid for large n [25]. The standard deviation of the cumulants in the argument is

$$\begin{aligned} \delta c_3 \approx \sqrt{\frac{c_6 + 9 \sigma ^2 c_4+ 9 c_3^2 + 6 \sigma ^6}{n}}, \end{aligned}$$
(14)

and

$$\begin{aligned} \delta \sigma ^2 \approx \sqrt{\frac{c_4 + 2 \sigma ^4}{n}}. \end{aligned}$$
(15)

The contributions of the particular cumulants to the standard errors of \(E_0\) are

$$\begin{aligned} \delta E_0(c_3) \approx \left| \frac{\partial E_0 }{\partial c_3}\right| \delta c_3, \ \ \delta E_0(\sigma ^2) \approx \left| \frac{\partial E_0 }{\partial \sigma ^2}\right| \delta \sigma ^2. \end{aligned}$$
(16)

Finally, assuming that estimators are independent, the standard deviation of \(E_0\) can be estimated as

$$\begin{aligned} \delta E_0 \approx \sqrt{(\delta E_0(c_3))^2 + (\delta E_0(\sigma ^2))^2}. \end{aligned}$$
(17)

2.4 Physical assessment of validity

The results in [20] serving as the basis for our considerations were obtained by considering and analyzing D-Wave solutions for the random instance with couplings \(J = \pm 1\) as well as 3-regular 3-XORSAT instances and planted (droplet) instances on the Chimera graph. In this context, the assumption in Eq. (3) results from the scaling \(c(\beta ) \sim T^{\alpha }\) which is appropriate for \(\beta \ne \beta _c\) (such a scaling is a phase-transition-like behavior in \(\beta \)), recall also that \(\beta = 1/T\). Here, \(\beta _c\) is the quasi-phase transition point. An actual phase transition would take place in a system of infinite volume. However, as discussed in [26], for finite volume, a phase-transition-like behavior occurs instead. The larger the system size, the sharper the dependence of \(c(\beta )\) on \(\beta \) [27, 28]. We expect a real annealer to be in the \(\beta < \beta _c\) regime as the thermal noise significantly impacts the machine’s output.

Consider a general probabilistic approach to the Ising model with couplings \(J_{i,j}\)-s and local fields \(h_i\)-s. However, a phase-transition-like behavior can also be expected under such circumstances, in a less rigorous form. A simple model of variable coupling can be [29]

$$\begin{aligned} J_{i,j} = J_0 + \epsilon _{i,j}, \end{aligned}$$
(18)

where \(\epsilon \)’s are drawn randomly according to a chosen probability distribution. In [29], authors show that the presence of the disturbance, in such a form, indeed results in a flattening of the exponential scaling. One can claim that for small systems and high variation of couplings, \(c(\beta )\) depends weekly on \(\beta \). Such a phenomenon can possibly affect, for example, the parameter \(\alpha \), making it more instance-dependent in such a case.

Let us also remark that the heat capacity per node depends strongly on the number of connections of the node. In [20], authors assumed that the number of couplings scales linearly with N, and also, there were additional assumptions on the coupling strength. These do not necessarily hold for our problem instances. As both \(\alpha \) and \(\beta _c\) may vary with the degree of connectivity of the graph, the model may behave worse for a problem graph with a highly variable degree of connectivity.

The more detailed analysis of the parameter \(\alpha \) will be a subject of further research: A more thorough investigation should include \(\alpha \) parameter fitting for a particular type of instance and consider \(\alpha \)’s estimation error. Here, for demonstration, we will use the \(\alpha = 0.19\)—0.38 parameter values, already proposed in [20], as well as some lower value of \(\alpha \) for wider sensitivity analysis.

3 Experiments

In what follows, we demonstrate the procedure introduced in the previous section on particular examples. The inputs will be Ising annealer samples, and we shall test whether they contain the ground-state energy.

The described method leads to the following algorithm:

Input:

  • Parameter \(\alpha \).

  • A sample of energies \({\mathbb {H}}= (H_1, H_2, \ldots , H_n)\) originating from n independent runs of the Ising annealer.

Processing:

  • Step 1 (Initialization).

    • Define \(H_{\min } = \min (H_1, H_2, \ldots , H_n)\);

  • Step 2 (Bootstrapping).

    Sample with replacements from \({\mathbb {H}}\) to obtain S Bootstrap samples

    $$\begin{aligned} {\mathbb {H}}^{(j)} = (H^{(j)}_1, H^{(j)}_2, \ldots , H^{(j)}_n), \end{aligned}$$

    where \(j = 1, \dots , S\);

  • Step 3 (Estimation of the conditional minimum).

    For each \({\mathbb {H}}^{(j)}\), estimate the minimal value \(E_0^{(j)}\) from the first three momenta using Eq. (10) with the given value of the parameter \(\alpha \);

  • Step 4 (Estimation of the conditional distribution).

    Define a conditional probability measure \(\mu ^{({\mathbb {H}})}\) as an empirical distribution of the data \(\left\{ E_0^{(j)} \right\} _{j=1}^S\);

  • Step 5 (Conditional likelihood).

    Calculate p value, i.e.,

    $$\begin{aligned} p_{\mathrm {val}} = P_{\mu ^{({\mathbb {H}})}}(X > H_{\min }) = 1 - P_{\mu ^{({\mathbb {H}})}}(X \le H_{\min }), \end{aligned}$$

    where X is a random variable with the distribution \(\mu ^{({\mathbb {H}})}\);

Output:

  • \(p_{\mathrm {val}}\)

The above procedure provides an estimate of the probability of having a ground state in the sample. A higher parameter value also implies probabilistically that at least a lower part of the energy spectrum has been sampled. The estimation in Step 3 assumes the theoretical model from Sect. 2 and depends on the original sample (\({\mathbb {H}}\)) and on the result of the draw from Step 2. This estimated probability \(p_{\mathrm {val}}\) of having sampled a ground state will be referred to as the “p value” in what follows. The algorithm was implemented in Julia programming language, and the source code is publicly available [30].

3.1 Artificial data

Our first experiments were performed on a problem instance of 198 logical bits from the field of railway operations research, described in detail as a case 1 example in [31] (consult Sect. IV A therein for a problem description and Sect. III C for its QUBO formulation).

The samples have been generated using the Metropolis-Hastings algorithm. We refer to these data as artificial as they do not come from a physical solver. The Metropolis-Hastings algorithm has \(\beta _{\text {MH}}\) as a parameter playing a similar role as the \(\beta \) in our model in the range of model validity. It is tied to the temperature of the simulated system and thus affects the quality of the solution. We expect \(\beta _{\text {MH}} \approx \beta \); the latter estimated in the way described in Sect. 3.3. The results on \(\beta \) estimation and the scaling of \(\eta (H)\) vs. \(\beta _{MH}\), see Eq. (9), are presented in Fig. 1. As it was expected in Sect. 2.4, we have a limit on \(\beta _{\text {MH}}\), below which scaling \(\eta \propto \beta _{\text {MH}}^{\alpha /2}\) and Eq. (3) hold. To find the threshold, we can analyze the scaling of \(\eta (H)\) and determine the threshold value of \(\beta _{MH}\) above which it stops following the model in Eq. (9). It has been done manually in the case of Fig. 1 (left panel), but it could be done automatically.

Fig. 1
figure 1

Output of Metropolis-Hastings sampling with \(n = 1000\) samples. The asymmetry \(\eta (H)\) (left panel) and the estimated \(\beta \) (right panel), both are functions of the parameter \(\beta _{\text {MH}}\) of the Metropolis-Hastings algorithm. In left panel, the following fitting model has been used: \(\eta \propto \beta _{\text {MH}}^{\alpha /2}\), see Eq. (9); fitting has been performed up to the threshold \(\beta _{MH} = 1.375\), termed as the model limit. The limit has been determined by the visual analysis of \(\eta (H)\) fitting it to the plot. (Recall that the limit can be case dependent). Observe that \(\beta _{MH} \approx \beta \) within model validity, while accounting for the error margin. This validates our model

In the case of this problem instance, the optimum is known. Hence, we can plot both the difference of the minimum energy state in the sample \(H_{\min }\) from the ground state \(E_0\) and also the p value as a function of \(\beta _{\text {MH}}\). To assess the quality of solutions, we use the relative difference between the best solution \(H_{\min }\) and the ground state \(E_0\):

$$\begin{aligned} \Delta H = \frac{H_{\min } - E_0}{| E_0 |}, \end{aligned}$$
(19)

which is equal to zero only if the ground-state energy value is in the sample. (The division by \(|E_0|\) can be omitted if it is more convenient to check the absolute differences.) Fig. 2 clearly demonstrates that for \(\beta _{\text {MH}}\)-s within the model validity region, the p value can be used to distinguish between better and worse solutions. Finally, in Fig. 3, we have compared the means and the standard deviations of the Bootstrap histograms and found them to coincide with those obtained by the direct calculation (with no bootstrapping) via Eqs. (10) and (17).

Fig. 2
figure 2

The minimal energy and the p value for the problem instance addressed in Sect. 3.1. We have used \(S = 1000\) for bootstrapping. In the model validity region \(\beta _{MH} < 1.375\), we can observe nine solutions that are far from the ground state; those have an almost zero p value and one solution that is near the ground state with the p value of \(\approx 0.3\). This is as expected. The choice of the \(\alpha \) values is discussed at the end of Sect. 2.4. Observe that the particular choice of the value of parameter \(\alpha \) does not significantly affect the results. Note also that there was no minor embedding in this case. We have used \(n = 1000\) samples from the Metropolis-Hastings algorithm’s output

Fig. 3
figure 3

The comparison of \(E_0\) obtained using Eq. (10) and \(\sigma (E_0)\) from  Eq. (17), with mean and standard deviation of \(\{E_0^{(j)}\}_{j = 1}^S\) for the Bootstrap sample, with \(\alpha = 0.19\). In both cases, the series are similar, validating the Bootstrap approach for the analyzed data

3.2 Analysis on D-Wave data

We have tested our algorithm on energy spectra returned by a D-Wave quantum annealer. The addressed optimization problems were the aforementioned set of practical instances as well as the a set of droplet instances. As an additional set of examples, we present results on randomly generated exact set cover problems which we will be described later.

The first set contains instances from the field of railway operations research [31], see Sect. IV therein for a more detailed description. The second set contains droplet instances characterized by artificially “planted” ground states [32], designed to be difficult for an annealer. Droplets are specially designed to benchmark various annealers; they are not motivated by other optimization problems. Note that, the two types of instances differ in the sense of the variability of couplings and local fields (this issue is important as discussed in Sect. 2.4). In the case of practical instances, there are many couplings with the same value reflecting a particular set of constraints in the actual problem, which does not hold for the droplet instances.

Data sets are returned by two D-Wave quantum annealers: the D-Wave 2000Q (Chimera based); see Figs. 4a, b, Tables. 1a, b, and 2a, b and the D-Wave 5000 “Advantage System” (Pegasus based); see Fig. 5. In all the experiments, we have used \(S = 1000\) for bootstrapping. The quality of the samples depends on the annealing time, hence, it is important to decide whether it was chosen appropriately.

In the case of the practical instances coming from [31], we, therefore, plot our p values along with the difference of the energy from the true ground state, see Eq. (19), as a function of the annealing time. This is done in order to demonstrate the potential usefulness of the p value in the estimation of whether the right annealing time had been chosen. (We will return to the estimation of the \(\beta \) parameter later.) The figures Fig. 4a, b, and Fig. 5 all confirm that the p value has the expected behavior: In most cases, it reflects whether the best solution from the sample is close to the ground-state energy, as it can be expected from a probabilistic discriminator. The useful solutions: those near the ground state (i.e., whose energy is within \(10 \%\) reach of the minimum, see Fig. 4b) give high p values (i.e., above 0.5), whereas solutions far from the ground state yield low p values. For the set of our practical instances solved on D-Wave, the usefulness of the method has thus been demonstrated.

Fig. 4
figure 4

The p value validation of the D-Wave (QPU: DW_2000Q_6) solutions of the Chimera practical instances from [31] (Section IV C therein). The dependence of the p value and \(\Delta H\), the relative difference between the best D-Wave solution and the actual minimum (c.f. Eq. (19)) is plotted against the annealing time. The problem sizes are left panel: 198 logical bits, right panel: 48 logical bits. Chimera minor embedding was used, as described in [31], with coupling strength \(css = 2\); \(n = 1000\) D-Wave samples were involved. In most cases, the higher p value reflects the lower \(\Delta H\)

Fig. 5
figure 5

The p value validation of D-Wave (QPU: Advantage_system1.1) Pegasus instance from [31] with 594 logical bits: The dependence of the p value and the relative difference \(\Delta H\) in Eq. (19) is plotted against the annealing time. Pegasus embedding and \(n = 25 000\) D-Wave samples were used. The results’ high \(\Delta H\) is reflected in the zero p values

The results for the droplet instances of 2048 physical quantum bits are presented in Table 1a, b, the results for small droplet instances of 128 physical quantum bits are presented in Table 2a, b. As one can observe, for some droplet instances and experimental settings, the model works well (black numbers), and for some of them (red numbers), it does not. In Table 1a, there are points where p value-based test concludes positively: The high value suggests that the ground state should have been sampled, even though it is not the case. Therefore, we consider these as “false positives.” In Table 2a, we have “false negatives”, these are points where p value-based test falsely gives a negative results; it incorrectly indicates the absence of the ground state from the sample. It will be shown in Sect. 3.3 that most of the false (red) results can be filtered out by analyzing the estimated temperature of the annealer, as such an estimate will not be physical for most of problematic data.

Table 1 The p value evaluation of solutions for a droplet instance of 2048 physical quantum bits (\(\alpha = 0.19\))
Table 2 The p value valuation of solutions for a droplet instance of 128 physical quantum bits (\(\alpha = 0.19\))

From the above results, one can conclude that, in general, if the output is far from the ground state (e.g., see the worst results on each figure or table), we have almost zero p value. Hence, a high p value can be a valid indicator indicating that the solution is in the low energy part of the spectrum. (Recall, however, that in the case of droplet instances, we are interested only in the ground state, whereas low excited states can also be of interest in some other problems.) We can consider such a procedure as a primary valuation of the solution.

As we have seen in the examples, our discriminator will yield both false positives and false negatives. Their presence can be due to various reasons, including the deviation from the Boltzmann distribution, failure of the scaling in Eq. (3) for some instances, the error of the estimation of the third-order momenta, the use of inappropriate \(\alpha \) parameter. Also, as most problems need to be embedded in the annealer’s graph, our method could be best applied to the embedded problem’s raw data. The minimal postprocessing to get the solutions to the original problem from the embedded data (including also the fixing of chain breaks with majority voting) can also affect the accuracy of our method. As in practice, one would prefer working with the original (and not the embedded) problems, we have tested our method in this way, and it appears to work also in this setting.

As an additional test, we have addressed set partitioning problems. Set partitioning and cover problems constitute a relevant class of hard optimization problems, with significant application in staff scheduling problems [33]. Their large instances require specialised algorithms (see [34] for a recent study). Even though the small ones can be solved using a linear constrained 0-1 program formulation easily, they have been used to benchmark quantum annealers recently [16], as they are well-known and controllable problems. We have generated random exact cover problems of small sizes and have solved them in the linear 0-1 problem formulation. Then, we have converted them into a QUBO form using penalties as described, e.g., in [22], choosing a large enough penalty coefficient. This procedure resembles a typical practical application. We have solved the so arising QUBO using its standard linearization [35], resulting in a relatively large mixed-integer program that we have solved with GLPK [36]. This way, we were aware of the minimum of the QUBO. We have verified that the solution of the QUBO coincides with the classical solution, so our choice of the penalty was correct. From this point on, we are only interested in analysing QUBOs: if the minimum will get actually sampled when solved on a physical annealer.

We have solved the problem instances on the D-Wave Advantage4.1 quantum computer. To keep ourselves in a situation similar to practice, we have used the default settings of autoscaling, embedding, and minimal postprocessing. We have applied our method to the so-obtained samples. The results are presented in Fig. 6. The true minimum was sampled only in the case of the smallest instance, and we are getting farther in the case of the bigger problem instances. This illustrates further that our method can be useful, at least to some extent, even though, in the case of these calculations, our original assumptions on the distribution do not probably hold exactly because of the use of QUBO formulation, the embedding, and the auto-scaling and minimal postprocessing.

Fig. 6
figure 6

Exact cover problem instances. The dependence of the p value and the relative difference \(\Delta H\) in Eq. (19) is plotted against the problem size, i.e., the number of binary decision variables. We have obtained \(n = 3~996\) D-Wave samples at \(250 \mu s\) of annealing time, with auto-scaling, embedding, and the default (minimal) postprocessing. The p value analysis provides valuable information in most cases, despite the possible departures from its base assumption

3.3 Beta estimation

If the ground-state energy is known with certainty (e.g., from some other consideration), we can estimate the parameter \(\beta \) by means of Eq. (11). This calculation of \(\beta \) can be used to validate the effectiveness of our method on a particular set of instances. The \(\beta \) calculation requires the ground-state energy for a few instances within the set of problems calculated under the same circumstances. To demonstrate such an approach conceptually, we compare \(\beta \) computed for droplet instances and practical instances. Alternatively, Eq. (11) can be reformulated to express \(\beta \) in terms of \(\alpha \) rather than \(E_0\), as a result, more instance-wise validation will be possible.

The \(\beta \) parameter reflects the effective temperature of the Ising system realised by the annealer. Therefore, this parameter carries information about the extent of noisiness to expect: The higher the \(\beta \), the closer the annealer is to an ideal adiabatic quantum computer. (Meanwhile, as seen in Fig. 1, the estimation of \(\beta \) facilitates the comparison with the Metropolis-Hastings approach.)

The results of the \(\beta \) computation are presented in Tables 3 and 4 (droplet) and Fig. 7 (practical instances). There is a large spread in \(\beta \) estimation for the droplet instances. Furthermore, some values of \(\beta \) are non-physical (i.e., negative). The observed behavior can be caused by the fact that droplets are complicated instances with highly variable couplings. Hence, our model may not work correctly for some (especially smaller) droplet instances. For such smaller instances, the physical validity of the model may be weaker, see Sect. 2.4). Here, however, a very important conclusion appears. If we have a series of instances (e.g., droplets), and we know the ground state exactly for a few, we can check if the \(\beta \) values are physical for these few. Based on this, we can conclude whether the method works well or not for the whole series.

In the case of practical instances, where the instance itself is less complicated, estimated \(\beta \) values appear to be physical for all data, see Fig. 7. Furthermore, for the particular Chimera chip, \(\beta \) oscillates in the range 0.2 - 0.65. In contrast, for the particular Pegasus chip, it is closer to 0.2, which may suggest a slightly higher temperature on the Pegasus chip.

Table 3 \(\beta \) estimation from droplet data, 2048 physical quantum bits, for various anneling times
Table 4 \(\beta \) estimation from droplet data, 128 physical quantum bits, for various annealing times
Fig. 7
figure 7

\(\beta \) estimation from practical instances on the D-Wave Chimera and Pegasus (specifics as in Figs. 4 and  5). Observe that the \(\beta \) values appear to be physical (i.e., positive) for all experimental points. However, in these cases, the temperature was computed from the QUBO energy spectrum (not Ising one), and the auto-scale was on. Hence, it is re-scaled in comparison with the actual annealer temperature

4 Conclusions

In this paper, we have introduced an easily implementable method that uses univariate cumulants of order 1–3 to assess the quality of the annealer’s output. The method results in a parameter, the p value, which under assumptions about the physical model, indicates that a lower part of the energy spectrum has been sampled.

The model depends on the scaling parameter \(\alpha \). We use an ad hoc value which is plausible according to results in the literature for demonstration. Our sensitivity analysis suggests that the model can be moderately sensitive to \(\alpha \) in some cases. Yet, its accurate estimation for the given instance (or set of instances) could improve it. We have applied Bootstrap resampling, a heuristic method to compute the significance interval. The method could also be further improved, e.g., by rescaling the significance interval to fit the variance from the error calculus. We have demonstrated the potential of statistical analysis in estimating the quality of Ising annealers’ output on particular examples. At least based on the particular examples of annealer outputs we have studied so far, we argue that the introduced analysis can serve as a useful tool in evaluating the solution. To make a stronger statement, the limitations of our model have to be studied further, both analytically (by elaborating, e.g., on the more precise determination of \(\alpha \)) and empirically by applying the method to many samples. We plan to use it for additional problems in the field of logistics and operations research, similarly to those in [37, 38].

As for the possible further steps of this research, recall that in the case of non-Gaussian distributions (like that of the Ising annealer output), information about a probabilistic model can also appear in cumulants of order higher than 3. Hence, applying such cumulants may improve our model. Further, as the annealer output is multivariate (containing energy and spin configurations), the multivariate cumulant analysis can give a further clue in analyzing, qualifying, and perhaps correcting the annealer’s output. As of the further research, one can also perform quantum annealing with anneal_schedule option of D-Wave, c.f. [39]. Another interesting question is the systematic study of the effect of the distribution. Systematic testing using artificial data generated assuming non-Boltzmann distribution and assessing the performance of the method would enable the testing of the assumptions in Sect. 2.1 as well as the characterization of the exact limitations. This will be the subject of further research.