Quantum annealing speedup of embedded problems via suppression of Griffiths singularities
Abstract
Optimal parameter setting for applications problems embedded into hardware graphs is key to practical quantum annealers (QA). Embedding chains typically crop up as harmful Griffiths phases, but can be used as a resource as we show here: to balance out singularities in the logical problem changing its universality class. Smart choice of embedding parameters reduces annealing times for random Ising chain from to . Dramatic reduction in time-to-solution for QA is confirmed by numerics, for which we developed a custom integrator to overcome convergence issues.
Implementation of quantum annealing Kadowaki and Nishimori (1998); Farhi et al. ; *farhi2001quantum; Das and Chakrabarti (2008); Albash and Lidar (2018) for optimization problems expressed as unconstrained quadratic forms of binary variables requires embedding Choi (2008); *choi2011minor; Hilton et al. (2019) the connectivity topology of the problem into that of the underlying hardware. This typically means representing logical qubits in terms of clusters of physical qubits designed to be ferromagnetically aligned at the completion of the annealing cycle. Performance suffers as a result: Not only does it lead to a decreased utilization of qubits, but since the effective two-level system for strongly coupled qubits is endowed with slower dynamics, it becomes more susceptible to harmful non-adiabatic excitations. Judicious choice of embedding parameters to minimize these effects has large practical utility and remains an active area of research. Most of the earlier work studied optimal parameter setting empirically by running experiments on D-Wave annealers as well as formulating educated guesses based on classical and quantum spectrum and intuition from the theory of phase transitions King and McGeoch ; Venturelli et al. (2015); Fang and Warburton ; Harris et al. (2018).
The adiabatic quantum computing protocol obtains a solution by evolving, in a finite time interval , a time-dependent Hamiltonian that interpolates between a “driver” term with easily obtainable ground state and the “classical” Hamiltonian which is diagonal in Z-basis and encodes the cost of underlying quadratic unconstrained binary optimization (QUBO) problem:
(1) |
The time-dependent Hamiltonian describes the annealing of Ising spins on a graph as the external uniform magnetic field (where ) is applied in the transverse direction and decreases to zero. Adiabatic theorem ensures that for sufficiently large the system remains close to its instantaneous ground state until the driver term that causes bit flips vanishes at the end of the annealing algorithm. Very recently it has been shown theoretically that even a simple driver such as the transverse field could in principle achieve a superpolynomial speedup against classical computing Hastings .
Known empirical evidence suggests that high probability of success is best achieved by performing many independent runs over optimally chosen annealing cycle time . The probability of error can be made arbitrarily small using large number of repeats (here is the success probability of a single run). The total computation time is expressed in terms of unambiguous time-to-solution metric that we adopt here:
(2) |
Although we restrict ourselves to a linear schedule with driver term and classical term prefactors and for the sake of simplicity, singularities at and dictate the scaling of only for very large . Using a sweet-spot value of ensures that our results remain qualitatively robust for a general non-linear interpolating schedule typically constrained by a specific hardware implementation.
The illustrative example that is the subject this letter is a simple model: a one-dimensional chain of ferromagnetically coupled Ising spins (qubits) with random interactions,
(3) |
(in zero longitudinal field, ) with the usual choice of a driver term that represents a transverse field, . The annealing bottleneck for this problem is related to a quantum critical point separating paramagnetic and ferromagnetic phases. Without randomness, i.e. if all , the energy gap that separates the ground state from excited states within the symmetric subspace is minimized at (). Notice that we disregard one half of the states (including the first excited state) that are never populated due to preserving a global symmetry which flips all bits: . The critical exponents that can be obtained either from an analytic solution via fermionization or from the renormalization group (RG) analysis predict that correlation length and the gap in the paramagnetic phase . This suggests a cutoff value of the gap as the correlation length reaches the system size , and, therefore, polynomial scaling for TTS metric . This scaling is intimately related to Kibble-Zureck mechanism of quench dynamics across the phase transition Zurek et al. (2005); Dziarmaga (2005).
By contrast, if couplings are randomly distributed and are not correlated, the RG flow is toward an infinite-randomness fixed point (IRFP) with the gap , i.e. the minimum gap scales with as a stretched exponential Fisher (1992); *fisher1995critical. This anomalous scaling is due to the presence of Griffiths-McCoy singularities Griffiths (1969); *mccoy1969incompleteness as different parts of the system are unable to reach criticality simultaneously as a result of strong disorder fluctuations.
To illustrate, consider uniform distribution of the couplings . The critical value of the transverse field is the geometric mean, i.e. the gap to the 2 excited state is minimized at (corresponding to ). If the chain is cut in two equal parts at criticality, the subchains will have where by central limit theorem. One part will be ferromagnetically ordered with gap . This only demonstrates stretched exponential scaling for the gap to the first excited state, which is not relevant to the transverse field parity-conserving dynamics. However, it is expected that entire low-energy spectrum has the same universal scaling form (see Appendix A for a rigorous discussion). In practice, the asymptotic scaling will not set in until becomes moderately large, whereas scaling for small system sizes may be indistinguishable from that of a non-disordered chain.
Embedding using block spins.
For this study we set out to explore strategies for setting parameters for embeddings in coherent quantum annealers, which replace logical qubits with blocks of ferromagnetically coupled physical qubits. This is done primarily to increase the connectivity of qubit interaction graph [to , where is the degree of connectivity graph of physical hardware]. The extreme example achieves all-to-all connectivity at the cost of quadratic reduction of the number of logical qubits [to ] as seen in Refs. Choi, 2008, 2011. Another important application is extending the range of Ising couplings, which is more relevant for the present study of a linear chain (). Lastly, using block spins has been suggested as a form of error-correction Pudenz et al. (2014); *pudenz2015quantum; Vinci et al. (2015); Matsuura et al. (2017).

As we introduce ancillary spins for each logical variable (see Fig. 1), the classical Hamiltonian reads
(4) | |||
For simplicity, the ferromagnetic couplings within a subchain are taken to be uniform but we allow variations from one logical qubit to another. To ensure that these ferromagnetic links are never broken in any local minimum we insist that
(5) |
Since the model retains its 1D character, existing analytical techniques are still applicable and numerical studies can explore a regime where annealing becomes intractable for large .
Specifically, we observe that for sufficiently small values of the transverse field we may perform the real-space renormalization procedure due to D. S. Fisher Fisher (1992); *fisher1995critical. Each subchain now behaves as a spin subjected to a transverse field with the renormalized value
(6) |
(In a reversal of notation used in Ref. Fisher, 1992; *fisher1995critical, we write to represent the bare value of the transverse field and reserve non-accented letters to denote the renormalized fields.) The effective model is still an Ising chain
(7) |
albeit with the local transverse field that can potentially have spatial variations.
The embedding procedure thus unlocks an important resource since many existing implementations either lack such local control entirely or have limited dynamic range. It allows us to restore the polynomial scaling of annealing complexity, balancing out disorder fluctuations to synchronize the phase transition across entire chain. We make the following ansatz for embedding parameters
(8) |
for some rescaling constant At the edges we can use, e.g., and .
With this choice, renormalized local fields in the bulk become so that fluctuations of the value of the critical field for large subchains now scale as .

In Fig. 2 we compare the median minimum gap for different parameter setting prescriptions, showing that the balanced choice in Eq. (8) recovers a polynomial gap. It is imperative to discuss how the parameters of our numerical study were chosen. The black solid line plots the estimate of the median value (taken over disorder distribution) of the minimum gap for strong disorder: are taken to be uniformly distributed in the interval [0;1]. The data clearly cannot be fit by any power law (which would have been a straight line on a log-log plot).
It is evident from Eq. (8) that allowing arbitrarily small values of would in turn lead to arbitrarily large values of . Moreover, small values of are not expected to appear naturally for Ising representations of practical problems Lucas (2014) and would make the problem particularly prone to misspecification errors in hardware annealers.
To mitigate this problem, we choose , where is the number of spins in a block. Fig. 2 uses colored dotted line to plot gaps of the logical problem for such disorder distributions. Dashed lines show the gaps for an embedded problem with a canonical choice of embedding parameters (). Balanced choice of embedding parameters from Eq. (8) with would have yielded values in a range . Current practice for existing hardware implementations of quantum annealing is to use largest possible values of couplings in order to minimize misspecification error, hence it is natural to assume that already represents the maximum programmable value. In order to accommodate the balanced parameter setting, all ferromagnetic couplings must be scaled down by a factor of , i.e. and . This rescaling step had been made for the data plotted in Fig. 2 using solid colored lines. The motivation for this peculiar choice of disorder distribution is that it maximizes the range of inter-chain couplings after the rescaling.
Rescaling of couplings parameters downward handicaps quantum annealing performance. Using rescaled we can show that . The scaling factor can be rewritten as , which is less than unity if . Numerical data for the gap is consistent with this qualitative behavior. More rigorous analysis of the low-energy spectrum along the lines described in Appendix A also predicts that the gap for canonical embedding is smaller than that of the logical problem with the same disorder by factor, also in agreement with the numerical data.
We encountered a problem specific to instances using balanced embedding, likely due to a quirk in its spectrum: numerical diagonalization could only performed for a smaller range of as the limits of machine precision were reached. It may be possible to overcome this obstacle using multiprecision arithmetic to find the roots of characteristic polynomial for the tridiagonal matrix. Fortunately, the median gap fits polynomial scaling perfectly (straight line on a log-log plot), which gives us sufficient confidence to extrapolate the data for large .
Time-to-solution analysis.
The one-dimensional Ising chain is the simplest example of an integrable quantum model. A rotation (, ) followed by a Jordan-Wigner transformation expresses the Hamiltonian as a quadratic form in fermionic operators. The solution of time-dependent Bogolyubov-de Gennes (BdG) equations is used to write these operators in Heisenberg representation (which is a linear combination of Schrödinger operators since is quadratic Dziarmaga (2006); Caneva et al. (2007)). For instance, using Majorana representation (see e.g. Ref. Fradkin, 2013) ( and ) we can write
(9) |
Here is special orthogonal matrix, whereas is skew-symmetric and also happens to be tridiagonal with the elements on the upper diagonal and . This special structure further aids numerics; on top of logarithmic reduction in complexity afforded by the free-fermion mapping.
Eigenvalues of (e.g. for ordering , with ) completely determine the spectrum of the instantaneous Hamiltonian as a sum of single-particle excitations: where . Specifically, the gap between the ground state and the second excited state (which is second lowest in energy among those in the symmetric subspace) is . This value enters the adiabatic condition used to estimate the runtime (see Appendix A).
To better quantify the performance we concentrate on a TTS metric of Eq. (2). The probability to find the system in its ground state at the end of the annealing cycle at is
(10) |
where and are fermionic quasiparticle operators in Dirac representation that diagonalize the final classical Hamiltonian . Expectation value can be computed at time provided that Heisenberg representation for and is used. The initial state satisfies where and are the Dirac fermion operators that diagonalize the transverse field Hamiltonian .
Numerical results.
Investigating the complexity using the TTS metric is somewhat challenging numerically. It entails integrating systems of differential equations of more than variables for multiple choices of annealing times (in excess of in dimensionless units). Numerical error accumulates proportionally to the evolution time, and is further amplified when we evaluate the determinant (11). After multiple tests, we implemented an integrator based on Cayley transform and Magnus expansion Blanes et al. (2000); *blanes2002high up to 8th order. However, we use Padé approximation of the exponential to obtain a straightforward mapping to Cayley transform and exploit the tridiagonal structure of matrix to attain best performance. Compared with traditional Runge-Kutta approaches used for these types of problems Mbeng et al. (2019), our method maintains orthogonality of at all update steps which significantly improves stability for long integration times (see Appendix C). For a given timestep our implementation outperforms comparable methods such as Dormand-Prince algorithms that are the method of choice in celestial mechanics Dormand and Prince (1980), but also maintains excellent precision for large step sizes .
Note that since optimal annealing time in Eq. (2) cannot be known in advance, it seems unfair to perform optimization of for each individual instance. We use ensemble-wide , which is determined through minimization, as a function of annealing time, of the median TTS, from a sample of random instances of the same size. This choice is similar to the practice of benchmarking of application problems.

We plot the median time-to-solution for random instances of increasing size in Fig. 3. As before, colored dotted lines refer to logical problem with , dashed lines correspond to canonical embedding parameters and solid lines present results for balanced embedding parameters. Finally, black solid line refers to a logical problem with strong disorder , where non-polynomial behavior is most pronounced. We observe that for the largest sizes balanced embedding clearly outperforms the canonical one ().
Conclusions
We have investigated quantum annealing of embeddings of a simple problem, where logical qubits were replaced by ferromagnetic chains of Ising spins. A novel ansatz for a balanced choice of coupling parameters based on renormalization group intuition results in an exponential improvement in annealing times. This is corroborated numerically, using time-to-solution metric of complexity. For large sizes the balanced choice significantly outperforms both canonical parameter setting and the quantum annealing of the logical problem using the same distribution of disorder (but with no embedding).
The protocol proposed in this letter succeeds because embedding parameters are set in such a fashion that spatially separate regions achieve criticality simultaneously. A situation were multiple domains oriented in random directions are created is thus avoided. Remarkably, this can be accomplished without local control of the transverse field. Complementary approaches described in literature rely on “growing” the domain and require significant modifications to quantum annealing protocol using time-dependent local control of the transverse field Rams et al. (2016).
An important venue of research is the generalization of this idea to higher-dimensional problems. Dearth of exactly solvable models suggests using approximate methods to find embedding parameters that achieve synchronization of local phase transitions. We expect to be able to suppress Griffiths singularities relieving the phase transition bottleneck of annealing complexity. However, Ising models in higher dimensions exhibit frustration, which dominates complexity for very large instances Knysh (2016) (crafted problems in 1D can also exhibit frustration bottleneck Roberts et al. (2020)). We are cautiously optimistic that this general technique can be useful for intermediate-range problems that could be implemented in highly coherent quantum annealers Novikov et al. (2018). Another research direction is the extension of this work to open systems where the annealing dynamics is incoherent, driven by coupling with an external reservoir Smelyanskiy et al. (2017); Mishra et al. (2018). This would open up the opportunity of testing the balanced embedding approach on D-Wave machines as well Bando et al. .
Acknowledgements.
S.K. was supported by AFRL NYSTEC Contract (FA8750-19-3-6101). E.P. and D.V. were supported by NASA Academic Mission Service contract NAMS (NNA16BD14C), and by the Office of the Director of National Intelligence (ODNI) and the Intelligence Advanced Research Projects Activity (IARPA), via IAA 145483. All authors acknowledge useful discussions with NASA QuAIL team members.References
- Kadowaki and Nishimori (1998) T. Kadowaki and H. Nishimori, Physical Review E 58, 5355 (1998).
- (2) E. Farhi, J. Goldstone, S. Gutmann, and M. Sipser, arXiv:quant-ph/0001106 .
- Farhi et al. (2001) E. Farhi, J. Goldstone, S. Gutmann, J. Lapan, A. Lundgren, and D. Preda, Science 292, 472 (2001).
- Das and Chakrabarti (2008) A. Das and B. K. Chakrabarti, Reviews of Modern Physics 80, 1061 (2008).
- Albash and Lidar (2018) T. Albash and D. A. Lidar, Reviews of Modern Physics 90, 015002 (2018).
- Choi (2008) V. Choi, Quantum Information Processing 7, 193 (2008).
- Choi (2011) V. Choi, Quantum Information Processing 10, 343 (2011).
- Hilton et al. (2019) J. P. Hilton, A. P. Roy, P. I. Bunyk, A. D. King, K. T. Boothby, R. G. Harris, and C. Deng, “Systems and methods for increasing analog processor connectivity,” US Patent 10,268,622 (2019).
- (9) A. D. King and C. C. McGeoch, arXiv:1410.2628 .
- Venturelli et al. (2015) D. Venturelli, S. Mandra, S. Knysh, B. O’Gorman, R. Biswas, and V. Smelyanskiy, Physical Review X 5, 031040 (2015).
- (11) Y.-L. Fang and P. Warburton, arXiv:1905.03291 .
- Harris et al. (2018) R. Harris, Y. Sato, A. Berkley, M. Reis, F. Altomare, M. Amin, K. Boothby, P. Bunyk, C. Deng, C. Enderud, et al., Science 361, 162 (2018).
- (13) M. B. Hastings, arXiv:2005.03791 .
- Zurek et al. (2005) W. H. Zurek, U. Dorner, and P. Zoller, Physical Review Letters 95, 105701 (2005).
- Dziarmaga (2005) J. Dziarmaga, Physical Review Letters 95, 245701 (2005).
- Fisher (1992) D. S. Fisher, Physical Review Letters 69, 534 (1992).
- Fisher (1995) D. S. Fisher, Physical Review B 51, 6411 (1995).
- Griffiths (1969) R. B. Griffiths, Physical Review Letters 23, 17 (1969).
- McCoy (1969) B. M. McCoy, Physical Review Letters 23, 383 (1969).
- Pudenz et al. (2014) K. L. Pudenz, T. Albash, and D. A. Lidar, Nature Communications 5, 1 (2014).
- Pudenz et al. (2015) K. L. Pudenz, T. Albash, and D. A. Lidar, Physical Review A 91, 042302 (2015).
- Vinci et al. (2015) W. Vinci, T. Albash, G. Paz-Silva, I. Hen, and D. A. Lidar, Physical Review A 92, 042310 (2015).
- Matsuura et al. (2017) S. Matsuura, H. Nishimori, W. Vinci, T. Albash, and D. A. Lidar, Physical Review A 95, 022308 (2017).
- Lucas (2014) A. Lucas, Frontiers in Physics 2, 5 (2014).
- Dziarmaga (2006) J. Dziarmaga, Physical Review B 74, 064416 (2006).
- Caneva et al. (2007) T. Caneva, R. Fazio, and G. E. Santoro, Physical Review B 76, 144427 (2007).
- Fradkin (2013) E. Fradkin, Field theories of condensed matter physics (Cambridge University Press, 2013).
- Blanes et al. (2000) S. Blanes, F. Casas, and J. Ros, BIT Numerical Mathematics 40, 434 (2000).
- Blanes et al. (2002) S. Blanes, F. Casas, and J. Ros, BIT Numerical Mathematics 42, 262 (2002).
- Mbeng et al. (2019) G. B. Mbeng, L. Privitera, L. Arceci, and G. E. Santoro, Physical Review B 99, 064201 (2019).
- Dormand and Prince (1980) J. R. Dormand and P. J. Prince, Journal of Computational and Applied Mathematics 6, 19 (1980).
- Rams et al. (2016) M. M. Rams, M. Mohseni, and A. del Campo, New Journal of Physics 18, 123034 (2016).
- Knysh (2016) S. Knysh, Nature Communications 7, 1 (2016).
- Roberts et al. (2020) D. Roberts, L. Cincio, A. Saxena, A. Petukhov, and S. Knysh, Physical Review A 101, 042317 (2020).
- Novikov et al. (2018) S. Novikov, R. Hinkey, S. Disseler, J. I. Basham, T. Albash, A. Risinger, D. Ferguson, D. A. Lidar, and K. M. Zick, in 2018 IEEE International Conference on Rebooting Computing (ICRC) (IEEE, 2018) pp. 1–7.
- Smelyanskiy et al. (2017) V. N. Smelyanskiy, D. Venturelli, A. Perdomo-Ortiz, S. Knysh, and M. I. Dykman, Physical Review Letters 118, 066802 (2017).
- Mishra et al. (2018) A. Mishra, T. Albash, and D. A. Lidar, Nature Communications 9, 1 (2018).
- (38) Y. Bando, Y. Susa, H. Oshiyama, N. Shibata, M. Ohzeki, F. J. Gómez-Ruiz, D. A. Lidar, A. del Campo, S. Suzuki, and H. Nishimori, arXiv:2001.11637 .
Appendix A Eigenspectrum
Diagonalization of one-dimensional Ising model is performed using Jordan-Wigner transformation. The Hamiltonian reads in spin representation as
(12) |
where we rotated the basis around -axis by . We introduce Majorana fermions defined via
(13) |
and obeying anti-commutation relations as can be straightforwardly verified. In terms of these, the Ising Hamiltonian can be rewritten as
(14) |
The Hamiltonian can be equivalently represented in terms of Dirac quasiparticles
(15) |
From this representation one obtains all energy levels:
(16) |
Using identities
(17) |
one obtains the single-fermion excitation energies and creation/annihilation operators from the spectrum of the tridiagonal matrix
(18) |
that appears Majorana representation of Eq. (14); that is where is a column vector of Majorana fermions .
To study the behavior of the gap we write the characteristic equation:
(19) |
Above we rearranged the rows and columns of (by grouping even-numbered and odd-numbered) in block-diagonal form. It is straightforward to verify that both blocks yield the same characteristic equation (the terms can be evaluated by computing minors via induction over ):
(20) |
Indeed, the roots of characteristic equation should be doubly degenerate corresponding to the pairs of eigenvalues of matrix : .
In the region of interest of the disordered problem we expect that and so on. With this in mind, it suffices to retain terms up to to estimate the gap to the second excited state: we approximate and by solutions to a quadratic equation (20). To illustrate this in more detail, Fig. 4 below presents plots of a function (defined for integer )
(21) |
for three different values of . On large scales describes a Wiener process (Brownian motion) so that it typically scales as . The partial products inside the sums in Eq. (20) may be expressed as for a term linear in or for a term quadratic in . Large exponent ensures that the sums are dominated by just a few terms. Using , , , and do denote the extremal values as depicted in Fig. 4 we can write Vieta’s formulae:
(22) |
where has been chose so that . From this we conclude that
(23) | |||||
(24) |

Changing applies a shear in vertical direction; while is monotonic as a function of , it is straightforward to see that increases as moves away from in either direction. Therefore is the approximate location of the minimum gap.
The level of detail presented above is not necessary to establish the stretched exponential scaling of the minimum gap , this picture is useful for investigating a crossover between polynomial and stretched exponential scaling. Since the stretched exponential scaling is the consequence of central limit theorem, weaker disorder (smaller ) means much larger sizes are needed to observe exponential complexity.
Appendix B Ground state probability
Observe that creation of all elementary excitations annihilate () all but the ground state . Therefore, the probability to find the system in its ground state at the end of the annealing algorithm can be expressed as
(25) |
Here and are Dirac quasiparticles at , which correspond to kinks (broken bonds between and ; non-zero occupation number for suggests odd number of kinks)
Since the Hamiltonian is quadratic in fermionic operators we can apply Wick’s theorem to write the success probability as a Pfaffian
(26) |
Forming a vector out of Nambu spinors we can express it a linear combination of Majorana operators
(27) |
Notice that we assumed antiperiodic boundary conditions in our definition of , in accordance with the fact that the number of fermions is always even.
Recalling the identity and exchanging the rows of the matrix (26) we rewrite in a compact form
(28) |
We need to subtract the matrix since annihilation operators should always appear before the creation operators in the expectation values, but and do not anticommute. This correction ensures that the ordering of operators is correct and the argument of the Pfaffian is an antisymmetric matrix.
It is convenient to use Majorana operators in Heisenberg representation. Corresponding equations of motion are linear,
(29) |
where the evolution matrix is obtained by integrating a system of linear differential equations. Then the expectation values are taken with respect to initial state, i.e. a vacuum,
(30) |
Dirac fermions at can be written as a linear combination of Majorana operators as follows
(31) |
Using vacuum expectation values and the identities we rearrange the terms in the argument of the determinant function to arrive at the expression used in the main text.
Appendix C Numerical procedure
To improve the stability of the integrator it is important to ensure that a solution to
(32) |
is an orthogonal matrix at all times. Runge-Kutta methods of -th order update the solution as
(33) |
where is chosen so that the approximation error is . As errors accumulate, orthogonality of is no longer assured.
Methods based on Cayley transform use updates of this form
(34) |
where is the identity matrix and is skew-symmetric. It is straightforward to verify that updates of this form preserve the orthogonality of . The matrix should be chosen so that the approximation error is .
Methods based on Magnus expansion use updates of the form
(35) |
(where is skew-symmetric), which similarly maintain orthogonality. Differential system for is a non-linear one, and leads to an expansion of in terms of nested commutators.
The expression is considerably simplified if we observe that is a linear interpolation between constant matrices , where we set without losing generality ( can be rescaled appropriately). The time-derivative is constant. Further simplification is possible by using a mid-point of the interval so that the evolution is written in a symmetric form
(36) |
The expansion of can be written in this form
(37) |
where . The approximation error for this method is , i.e. the method is 8th order.
The method based on Magnus expansion is impractical since matrix exponentiation is expensive. However, maintaining the same level of precision, we can express Padé approximant of the exponential as a sequence of Cayley transforms
(38) |
where are the roots of . Lower order methods are obtained by truncating the commutator series earlier and using lower-order polynomials.
Since is a tridiagonal matrix, the bandwidth of is where is the order of the method. Using band-diagonal representation the computational cost of a single step is only corresponding to sparse multiplication and band-diagonal solve.
We also use embarrassing parallelization to speed-up the computation. One approach is to evolve a subset of columns of independently. A complementary approach is to divide the time interval can into subintervals and independently integrate equations of motion using the identity matrix as the initial condition (). The reduction step multiplies the matrices together . The latter cost grows more rapidly with size, as but does not scale with , so parallelization is justified for longer evolution times.

Fig. 5 compares the relative errors for ground state probability of random instances with and as a function of step size, obtained using various integrators. Cayley-Magnus method achieves the best performance. Python code (version 3.5 or above, using NumPy and SciPy packages) implementing the integration method is presented on the next page.
Python reference implementation
import sys from numpy import * from scipy import sparse as sp, linalg as la # Banded matrix multiplication def bxb(A,B): d=(size(A,0)-1)//2 C=A*B[d,:] for s in r_[-d:0]: C[:s,-s:]+=A[-s:,:s]*B[d+s,-s:] for s in r_[:d]+1: C[s:,:-s]+=A[:-s,s:]*B[d+s,:-s] return C # Main routine def solve(G,J,t1,t2,T,p=4,dt=1.0): if (J[0]!=0): sys.exit(’Use open BCs’) if (p>4): sys.exit(’Use p<=4’) N=len(J) k=r_[:p]; s=roots(r_[1,cumprod(-(p+k+1)*(p-k)/(k+1))]) t1/=T; t2/=T; dt/=T; G*=T; J*=T dt=(t2-t1)/ceil((t2-t1)/dt) d=2*p-1 I=zeros((2*d+1,2*N)); I[d,:]=1 A=zeros((2*d+1,2*N)); A[d-1,1::2]=2*G; A[d+1,::2]=-2*G B=zeros((2*d+1,2*N)); B[d-1,2::2]=2*J[1:]; B[d+1,1:-1:2]=-2*J[1:] D=(B-A)*dt**2 C=(bxb(A,B)-bxb(B,A))*dt**3 S=eye(2*N); t=t1+dt/2 while t<t2: H=((1-t)*A+t*B)*dt W=H if p>=2: W+=-(1/12)*C if p>=3: DC=bxb(D,C)-bxb(C,D) HC=bxb(H,C)-bxb(C,H) HHC=bxb(H,HC)-bxb(HC,H) W+=-(1/240)*DC+(1/720)*HHC if p>=4: DDC=bxb(D,DC)-bxb(DC,D) HDC=bxb(H,DC)-bxb(DC,H) HHDC=bxb(H,HDC)-bxb(HDC,H) DHHC=bxb(D,HHC)-bxb(HHC,D) HHHC=bxb(H,HHC)-bxb(HHC,H) HHHHC=bxb(H,HHHC)-bxb(HHHC,H) W+=-(1/6720)*DDC-(1/30240)*HHDC+(1/7560)*DHHC-(1/30240)*HHHHC for sk in s: S=sp.spdiags(sk*I+W,r_[d:-d-1:-1],2*N,2*N)@S S=la.solve_banded((d,d),sk*I-W,S) S=real(S) t+=dt return U