Quantum annealing for the number-partitioning problem using a tunable spin glass of ions

<jats:title>Abstract</jats:title><jats:p>Exploiting quantum properties to outperform classical ways of information processing is an outstanding goal of modern physics. A promising route is quantum simulation, which aims at implementing relevant and computationally hard problems in controllable quantum systems. Here we demonstrate that in a trapped ion setup, with present day technology, it is possible to realize a spin model of the Mattis-type that exhibits spin glass phases. Our method produces the glassy behaviour without the need for any disorder potential, just by controlling the detuning of the spin-phonon coupling. Applying a transverse field, the system can be used to benchmark quantum annealing strategies which aim at reaching the ground state of the spin glass starting from the paramagnetic phase. In the vicinity of a phonon resonance, the problem maps onto number partitioning, and instances which are difficult to address classically can be implemented.</jats:p>

section_content: pin models are paradigms of multidisciplinary science: They find several applications in various fields of physics, from condensed matter to high-energy physics, but also beyond the physical sciences. In neuroscience, the famous Hopfield model describes brain functions such as associative memory by an interacting spin system 1. This directly relates to computer and information sciences, where pattern recognition or error-free coding can be achieved using spin models 2. Importantly, many optimization problems, like number partitioning or the travelling salesman problem, belonging to the class of NP-hard problems, can be mapped onto the problem of finding the ground state of a specific spin model 3, 4. This implies that solving spin models is a task for which no general efficient classical algorithm is known to exist. In physics, analytic replica methods have been developed in the context of spin glasses 5, 6. A controversial development, supposed to provide also an exact numerical understanding of spin glasses, regards the D-Wave machine. Recently introduced in the market, this device solves classical spin glass models, but the underlying mechanisms are not clear, and it remains an open question whether it provides a speed-up over the best classical algorithms [7] [8] [9]. 

This triggers interest in alternative quantum systems designed to solve the general spin models via quantum simulation. A noteworthy physical system for this goal are trapped ions: Nowadays, spin systems of trapped ions are available in many laboratories [10] [11] [12] [13] [14] [15], and adiabatic state preparation, similar to quantum annealing, is experimental state-of-art. Moreover, such system can exhibit long-range spin-spin interactions 16 mediated by phonon modes, leading to a highly connected spin model. Here we demonstrate how to profit from these properties, using trapped ions as a quantum annealer of a classical spin glass model. 

We consider a setup described by a time-dependent Dicke-like model:

with a m annihilating a phonon in mode m with frequency o m and characterized by the normalized collective coordinates x im. The second term in H 0 couples the motion of the ions to an internal degree of freedom (spin) through a Raman beam which induces a spin flip on site i, described by s i x, and (de)excites a phonon in mode m. Here, O i is the Rabi frequency, :o recoil the recoil energy, and o L the beatnote frequency of the Raman lasers. Before also studying the full model, we consider a much simpler effective Hamiltonian, derived from equation (1) by integrating out the phonons [16] [17] [18] [19]. The model then reduces to a time-independent Ising-type spin Hamiltonian

Each phonon mode contributes to the effective coupling J ij in a factorizable way, proportional to x im x jm, and weighted by the inverse of the detuning from the mode D m ¼ o m À o L :

The x im imprint a pattern to the spin configuration, similar to the associative memory in a neural network 1, 20. The connection between multi-mode Dicke models with random couplings, the Hopfield model, and spin glass physics has been the subject of recent research [21] [22] [23], and the possibility of addressing number partitioning was mentioned in this context 23. 

Before proceeding, we remind the reader that the concept of a spin glass used in the literature may have different and controversial meanings (cf., refs 24-27): (i) long-range spin glass models 5 and neural networks 28, 29, believed to be captured by the Parisi picture 30, 31 and replica symmetry breaking. These lead to hierarchical organization of the exponentially degenerated free-energy landscape, breakdown of ergodicity and aging, slow dynamics due to a continuous splitting of the metastable states with decreasing temperatures (cf., ref. 32). (ii) Short-range spin glass models believed to be captured by the Fisher-Huse 33, 34 droplet/scaling model with a single ground state (up to a total spin flip), but a complex structure of the domain walls. For these models, aging, rejuvenation and memory, if any, have different nature and occurrence 32, 35 ; (iii) Mattis glasses 36, where the huge ground-state degeneracy becomes an exponential quasi-degeneracy, for which finding the ground state becomes computationally hard 37 (see the subsection 'Increasing complexity' in the 'Results' section). Note that exponential (quasi)degeneracy of the ground states (or the free-energy minima) characterizes also other interesting states: certain kinds of spin liquids or spin ice, and so on. 

Here we analyse the trapped ion setup. Even without explicit randomness (O i ¼ O ¼ const. ), the coupling to a large number of phonon modes suggests the presence of glassy behaviour. This intuition comes from the fact that the associative memory of the related Hopfield model works correctly if the number of patterns is at most 0. 138N, where N is the number of spins 28. For a larger number of patterns, the Hopfield model exhibits glassy behaviour since many patterns have similar energy and the dynamics gets stuck in local minima. However, it is not clear a priori how the weighting of each pattern, present in equation ( 3 ), modifies the behaviour of the spin model. In certain regimes the detuning suggests to neglect the contributions from all but one mode, leading to a Mattis-type model with factorizable couplings 36, J ij px im x jm. The possibility of negative detuning, that is, antiferromagnetic coupling to a pattern, drives such system into a glassy phase, characterized by a huge low-energy Hilbert space. The antiferromagnetic Mattis model is directly connected to the potentially NP-hard task of number partitioning 37, 38. Its solution can then be found via quantum annealing, that is, via adiabatic ramping down of a transverse magnetic field, see also the proposal of ref. 39 for a frustrated ion chain. 

We start by giving analytical arguments to demonstrate the glassy behaviour in the classical spin chains. Using exact numerics, we then focus on the quantum Mattis model. By calculating the magnetic susceptibility, and an Edward-Anderson-like order parameter, we distinguish between glassy, paramagnetic and ferromagnetic regimes. The annealing dynamics is investigated using exact numerics and a semi-classical approximation. We demonstrate the feasibility of annealing for glassy instances. Finally, we show that the memory in the quantum Hopfield model is real-valued rather than binary. This property might be useful for various applications of quantum neural networks such as pattern-recognition schemes.
section_name: S

section_content: Tunable spin-spin interactions. We start our analysis by inspecting the phonon modes. For a sufficiently anisotropic trapping potential, the ions self-arrange in a line along the z-axis 40, 41. The phonon Hamiltonian H ph is obtained by a second-order expansion of Coulomb and trap potentials around these equilibrium positions z i :

with q i the displacement of the ith ion from equilibrium. For the transverse phonon branch, V ij is given by 16

Our exact numerical simulations have been performed for six 40 Ca þ ions in a trap of frequency o > ¼ 2p Â 2. 655 MHz, as used in a recent experiment 14. To maximize the bandwidth of the phonon spectrum and thereby facilitate the annealing process, we choose the radial trap frequency o z as large as allowed to avoid zig-zag transitions, o z t1. 37o > Á N À 0. 86. Diagonalizing the matrix V ij leads to the previously introduced mode vectors n m ¼ (x 1m, y, x Nm ), which are normalized to one, and ordered according to their frequency o m :

The mode n N with largest frequency, o N ¼ o >, is the centre-ofmass mode, x iN ¼ N À 1/2. Parity symmetry of V ij is reflected by the modes,

, and even ( þ ) and odd ( À ) modes alternate in the phonon spectrum. We focus on even N, for which all components x im are non-zero. Except for the centre-of-mass mode, all modes fulfil P i x im ¼ 0. Previous experiments [10] [11] [12] [13] [14] have mostly been performed with a beatnote frequency o L several kHz above o N, leading to an antiferromagnetic coupling J ij o0 with power-law decay, see Fig. 1a. Despite the presence of many modes, the couplings J ij then take an ordered structure. This work, in contrast, focuses on the regime o L oo N, where modes with both positive and negative x im contribute, and ferro and antiferromagnetic couplings coexist, see Fig. 1b. This reminds of the disordered scenario of common spin glass models like the Sherrington-Kirkpatrick model 5. In the following we study the properties of the time-independent effective spin model, before considering the full time-depedent problem involving spin-phonon coupling. 

Classical Mattis model. Close to a resonance with one phonon mode, simple arguments allow for deducing the spin configurations of the ground states. In this limit, we can neglect the other modes, leading to a Mattis model. A single pattern n m then determines the coupling, J ij px im x jm. The sign of J ij depends on the sign of the detuning: Below the resonance, we have sign(J ij ) ¼ sign(x im x jm ), and accordingly the energy À ' J ij s i x s j x is minimized if s i x and s j x are either both aligned or both antialigned with x im and x jm. Thus, we have a twofold degenerate ground state given by the patterns ±[sign(x 1m ), y, sign(x Nm )]. We refer to this scenario as the ferromagnetic side of a resonance. 

Crossing the resonance, the overall sign of the Hamiltonian changes. Naively, one might assume that this should not qualitatively affect the physics, since we have

that is, there is an equal balance between positive and negative J ij. This expectation, however, turns out to be false. Recalling the relation between the Mattis model and number partitioning 4, 37, 38, the antiferromagnetic model maps onto an optimization problem in which the task is to find the optimal bi-partition of a given sequence of numbers (x i ) i, such that the cost function E¼ð P i2" x i À P j2# x j Þ 2 is minimized. Here, the two partitions are denoted by m and k. For a Hamiltonian of the form H¼

x are Hamiltonian eigenstates with an energy precisely given by the cost function E. Thus, in the limit of just one antiferromagnetic resonance, the ground state of H is exactly the configuration that minimizes the cost function. 

With this insight, the ground states of the spin model are easily found exploiting the system's parity symmetry: For even modes,

, and we simply have to choose

x to minimize the cost function. For odd modes,

, and we must choose

In both cases, this implies that we can choose half of the spins arbitrarily, leading to at least 2 N/2 ground states. 

The important observation is that an exponentially large number of ground states exists in the limit of being arbitrarily close above a resonance. This is a characteristic feature of spin glasses, yet it does not lead to computational hardness. In fact, as pointed out in ref. 38, the number-partitioning problem with exponentially many perfect partitions belongs to the 'easy phase'. How to reach hard instances will be explained in the section below. 

Pushing our arguments further we consider the influence of a second resonance: In between two resonances, the exponential degeneracy of the antiferromagnetic coupling on one side is lifted by the influence of the ferromagnetically coupled mode on the other side. Interestingly, this does not lead to frustration, since even-and odd-parity modes alternate in the phonon spectrum, and the pattern favoured by the ferromagnetic coupling is always contained in the ground state manifold of the antiferromagnetic coupling. Accordingly, between two modes the ground-state pattern is uniquely defined by the upper mode. 

Beyond this two-mode approximation, we rely on numerical results. Taking into account all modes, exact diagonalization of a small system (Nr10) shows that the two-mode model captures the behaviour correctly: At any detuning, the degeneracy due to the nearest antiferromagnetic coupling is lifted in favour of the pattern of the next ferromagnetic coupling. In Fig. 2a, we plot the cumulative density of states r cum (E), that is, the number of states with an energy below E. laser detuning is chosen on the antiferromagnetic side of a phonon resonance. In contrast, a low density of states characterizes the system on the ferromagnetic side of a resonance. In intermediate regimes, as shown for d ¼ 2p Â 199 kHz, the spectrum is symmetric. 

A breakdown of the two-mode approximation is expected for large numbers of spins: Since the distance between neighbouring resonances approximately scales with 1/N (at fixed trap frequencies), the influence of additional modes grows with the system size. The combined contribution of all antiferromagnetically coupled modes tries to select the fully polarized configurations as the true ground state, while all ferromagnetically coupled modes, except for the centre-of-mass mode, favour fully unpolarized configurations. As a consequence, it is a priori unclear which pattern will be selected in the presence of many modes. 

This observation is crucial from the point of view of a complexity theory. In the presence of parity symmetry neither the one-mode problem (that is, the number-partitioning problem), nor the two-mode approximation are hard problems, as they can be solved by simple analytic arguments. However, when many modes lift the degeneracy of the exponentially large low-energy manifold in an a priori unknown way, one faces the situation where a true but unknown ground state is separated only by a very small gap. Identifying this state then usually requires scanning an exponentially large number of low-energy states, and classical annealing algorithms can easily get stuck in a wrong minimum. Below, we discuss how a transverse magnetic field opens up a way of finding the ground state via quantum annealing. Moreover, we will discuss strategies to make also the one-mode model, that is, the number-partitioning problem, computationally complex. 

Increasing complexity. As discussed above, the instances of the number-partitioning problem realized in the ion chain are simple to solve due to parity symmetry. This is a convenient feature when testing the correct functioning of the quantum simulation, but our goal is the implementation of computationally complex and selectable instances of the problem in the device. One strategy is the use of microtraps to hold the ions 42. The equilibrium positions of the ions can then be chosen at will, opening up the possibility to control the values of the x im. The computational complexity of the number-partitioning problem then depends on the precision with which the x im can be tuned. If the number of digits can be scaled with the number of spins, one enters the regime where number partitioning is proven to be NP-hard 38. Thus, the number of digits must at least be of order log 10 N, which poses no problem for realistic systems involving tens of ions. 

Another way of enhancing complexity even within a parity-symmetric trap would be to 'deactivate' some spins by a fast pump laser. For example, if all spins on the left half of the chain are forced to oscillate, s j x ! s j x e io pump t, the part of the Hamiltonian which remains time-independent poses a number-partitioning problem of N/2 different numbers. 

Another promising approach was recently suggested in ref. 43: operating on the antiferromagnetic side of the centre-of-mass resonance, single-site addressing allows one to use the Rabi frequency for defining the instance of the number-partitioning problem. This could indeed be the step to turn the trapped ions setup into a universal number-partitioning solver, where arbitrary user-defined instances can be implemented. 

If one is not interested in the number-partitioning problem itself, one might also increase the system's complexity via resonant coupling to more than one mode. Equipping the Raman laser with several beatnote frequencies

i, it is possible to engineer couplings of the form 44 :

With an appropriate choice of Rabi frequencies and detunings, this allows for realizing the Hopfield model, J ij / P m max m¼1 x im m x jm m, where each coupling m is assumed to be in resonance with one mode m m. For ferromagnetic couplings, the low-energy states again are determined by the signs of the x imm, but in general the different low-energy patterns are not degenerate, and a glassy regime is expected for large m max (ref. 28). Quantum phases. So far, we have considered classical spin chains lacking any non-commuting terms in the Hamiltonian. Quantum properties come into play if we either add an additional coupling P ij s i y s j y, or a transverse magnetic field:

The latter has been realized in several experiments 10, 12, 14, and is convenient for our purposes, as the field strength B, if decaying with time, provides an annealing parameter: For large B, all spins are polarized along the z-direction, whereas for vanishing B one obtains the ground state of the classical Ising chain. As argued above, the latter exhibits spin glass phases with an exponentially large low-energy subspace. Even in those cases where the true ground state is known theoretically, finding it experimentally remains a difficult task. Our system hence provides an ideal test ground for experimenting with different annealing strategies. Before presenting results for the simulated quantum annealing, let us first discuss the different phases expected for the effective Hamiltonian

x. The last term is a bias introduced to break the Z 2 symmetry. Our distinction between phases is based on certain quantities which combine thermal and quantum averages

with l j i denoting the Hamiltonian eigenstates at energy E l. For a ¼ 1, Á h i a h i T reduces to the normal thermal average. We will use low, but non-zero temperatures T of the order of the coupling constant, accounting in this way for the huge quasi-degeneracy in the glassy regime. The thermal average Á h i T plays a role somewhat similar to the disorder average, as it averages over various quasiground states (pure thermodynamic phases). We therefore expect s i

x T to go to zero in the glassy phase. In contrast, a non-zero average s i x T detects the ferromagnetic phase of the Mattis model, while it vanishes in the paramagnetic state. Taking its square to get rid of the sign, we obtain a global ferromagnetic order parameter by summing over all spins:

On the other hand, in the spirit of an Edwards-Anderson-like parameter, we consider thermal averages of squared quantum averages, that is,

At a sufficiently low temperature this average would still be zero for a paramagnetic system, but now it remains non-zero for both ferromagnetic and glassy systems. Accordingly, a parameter which is 'large' only for glassy systems is given by the ratio n SG ¼ nEA n FM, used in Fig. 3 to detect the glassy regions. Thermal averages are difficult to measure, but the contained information is also present in linear response functions at zero temperature. Therefore, we have calculated the longitudinal magnetic susceptibility w, that is, the response of the system to a small local magnetic field h j x along the s x direction (in units J rms À 2 ):

Due to the (quasi)degeneracy in the glass, one expects a huge response even from a weak field, and thus a divergent susceptibility. 

We have calculated n FM, n SG and w, for N ¼ 6 between 0r2p Â dr8 MHz, and 0rBr4J rms. For the thermal averaging, we have chosen a temperature k B T ¼ J rms. The results are summarized in Fig. 3, indicating the regions where these quantities take larger values than their configurational averages n FM, n SG and w, defined

In this way, we identify and distinguish ferromagnetic behaviour below, and glassy behaviour above each resonance. Regions of large susceptibility w overlap with regions of large n SG, attaining numerical values which are three orders of magnitude larger than the corresponding averages. For sufficiently strong field B, in contrast, none of these parameters is large, indicating paramagnetic behaviour. 

Note that the existence of the purported glassy phase in the quantum case is an open problem. We provide here the evidence only for small systems, since it is numerically feasible and corresponds directly to current or near-future experiments. If we increase the complexity of our system by resonant coupling to many phonon modes, as discussed in the last paragraph of the previous subsection, the glassy behaviour will result from the interplay of contributions of many modes similarly as in the Hopfield model with Hebbian rule and random memory patterns. Here the beautiful results by Strack and Sachdev 21 -the quantum analogue of the Amit et al. 29 machinery-can be applied directly to obtain the phase diagram for large N. If, however, we increase the complexity by random positioning of the ion traps, then the resonance condition will pick up the contribution from one dominant (random) mode, and the Hebbian picture will apply. Simulated quantum annealing. We will now turn to the more realistic description of the system in terms of a time-dependent Dicke model, described by the Hamiltonian H 0 (t) in equation ( 1 ) with an additional transverse field H B (t) from equation (7). We assume an exponential annealing protocol B t ð Þ¼B max exp À t=t ð Þ. Again we apply a bias field h bias ¼' Es 1

x, lifting the Z 2 degeneracy of the classical ground state. We study the exact time evolution under the Hamiltonian x (with E¼ À J rms ). 

Krylov subspace method 45, and truncating the phonon number to a maximum of two phonons per mode. Initially, the system is cooled to the motional ground state, and spins are polarized along s z. Choosing B max ) E; J rms, this configuration is close to the ground state of the effective model

If the decay of B(t) is slow enough, and if the entanglement between spins and phonons remains sufficiently low, the system stays close to the ground state for all times, and finally reaches the ground state of H J. 

We have simulated this process for N ¼ 6 ions, as shown in Fig. 4. As a result of the annealing, we are not interested in the final quantum state, but only in the signs of s i x, which fully determine the system in the classical configuration. This provides some robustness. We find that for a successful annealing procedure, yielding the correct sign for all i, the number of phonons produced during the evolution should not be larger than 1. At fixed detuning, we can reduce the number of phonons by decreasing the Rabi frequency, at the expense of increasing time scales. As a realistic choice 14, 15, we demand that annealing is achieved within tens of miliseconds. 

Figure 4a shows that one can operate at a detuning d ¼ 2p Â 239 kHz, that is, at the onset of a glassy phase according to Fig. 3. The mode vector which selects the ground state is n 5 ¼ (0. 61, 0. 34, 0. 11, À 0. 11, À 0. 34, À 0. 61), and the corresponding pattern can be read out after an annealing time tZ15 ms. On the other hand, even for long times, s i¼4

x saturates only at À 0. 15, which is far from the classical value À 1. As shown in Fig. 4b, a slower annealing protocol leads to more robust results s i x 40:52 8 i À Á. In Fig. 4c, a much simpler instance in the ferromagnetic regime is considered. Good results s i x 40:36 8 i À Á can then be obtained within only a few ms. In addition, dephasing due to instabilities of applied fields and spontaneous emission processes disturb the dynamics of the spins. In ref. 43 a master equation was derived that takes into account such noisy environment. To study the evolution of the system in this open scenario we have applied the Monte Carlo wave-function method 46. As quantum jump operators are hermitean, s i x for dephasing and s i z for spontaneous emission, the evolution remains unitary, but is randomly interrupted by quantum jumps. Each jump has equal probability G, and the average number of jumps within the annealing time T is given by n jumps ¼2NGT, which we chose close to 1. 

Since a faithful description requires statistics over many runs, we restrict ourselves to a small system, N ¼ 4, with short annealing times. In a sample of 100 runs, we noted 94 jumps (42 s x and 52 s z jumps). In 39 runs, no jump occured. Among the 61 runs in which at least one jump occured, 26 runs still produced the correct sign for all spin averages s i x

. The full time evolution, averaged over all runs, is shown in Fig. 5. On average, the final result is (0. 65, 0. 50, À 0. 41, À 0. 68), that is, our annealing with noise still produces the correct answer, but with lower fidelity. 

Whether an individual jump harms the evolution crucially depends on the time at which it occurs: While a spin flip (s z noise) is harmless in the beginning of the annealing, a dephasing event (s x noise) at an early stage of the evolution leads to wrong results. Oppositely, at the end of the annealing procedure, dephasing becomes harmless while spontaneous emission falsifies the result. An optimal annealing protocol has to balance the effect of different noise sources against nonadiabatic effects in the unitary evolution. 

Scalability. Above we have demonstrated the feasibility of the proposed quantum annealing scheme in small systems. The usefulness of the approach, however, depends crucially on its behaviour on increasing the system size. While the exact treatment of the dynamics becomes intractable for longer chains, an efficient description can be derived from the Heisenberg equations: Figure 4 | Simulated quantum annealing in the closed system. Unitary time evolution of the full system (N ¼ 6) for different laser detunings d between the fourth and fifth resonance. Thick lines show the result of the exact evolution, while the thin lines have been obtained from the semi-classical approximation. In all cases, the desired pattern ( þ þ þ À À À ) can be read out after sufficiently long annealing times. While in a,b we operate at the onset of glassiness, d ¼ 2p Â 239 kHz, c considers a ferromagnetic instance, d ¼ 2p Â 143 kHz. The annealing protocol in a is defined by B max ¼ 50J rms and t¼3 ms. In b the same instance is solved with higher fidelity by choosing B max ¼ 80 J rms and t¼6 ms. Fast annealing, with B max ¼ 50 J rms and t¼ 1 ms, is possible in the ferromagnetic instance in (c). In all simulations, we have chosen O ¼ 2p Â 50 kHz, o recoil ¼ 2p Â 15 kHz, and E¼ À 10 kHz. 

with

To solve this set of 5N first-order differential equations, we make a semi-classical approximation a m s i x % a m h i s i

x, and then proceed numerically using a fourthorder Runge-Kutta algorithm. The semi-classical approximation is justified as long as the system remains close to the phonon vacuum. A direct comparison with exact results for six ions (see Fig. 4 ) shows that the semi-classical approach, while slightly overestimating fidelities, accurately reproduces all relevant time scales. 

This approach allows us to extend our simulations up to N ¼ 22 ions, at trap frequency o z ¼ 2p Â 270 kHz. We operate between the first and second resonance where the level spacing is largest, at a beatnote frequency o

, that is with a fixed relative detuning between the two modes. This choice corresponds to d ¼ 2p Â 1. 2 MHz in Fig. 3, characterized as a glassy instance of the system. 

Our aim is to find the relation of annealing time, measured by the decay parameter t, and system size while the fidelity F is kept constant. For a practical definition we demand that F is zero when the annealing fails, that is when the sign of the spin averages s i x does not agree with the classical target state for all i. If the annealing finds the correct signs, the robustness still depends on the absolute values of the spin averages. The fidelity is then defined as the smallest absolute value, F¼ min i s i x

. Our results are summarized in Fig. 6 : First, this figure shows that for all sizes Nr20 large fidelities FZ0. 5 can be produced within experimentally feasible time scales, t 30 ms. Second, the time scale t needed for a fidelity F ¼ 0. 5 fits well to a fourth-order polynomial in N (with subleading terms of the order exp(1/N)):

with t 0 and g being free fit parameters. Although the sample of 22 ions is too small to draw strong conclusions, it is noteworthy that the polynomial fit is more accurate than an exponential one. This suggests that the proposed quantum simulation is indeed an efficient way of solving a complex computational problem. One should also keep in mind that our estimates, based on a semi-classical approximation, neglect certain quantum fluctuations which could further speed-up the annealing process. 

To study the scaling of dissipative effects, we have extendend the Monte Carlo wave-function approach to larger systems, which is feasible if the phonon dynamics is neglected. The unitary part of the evolution is then described by the effective Ising Hamiltonian

The dissipative part consists of random quantum jumps described by s i

x and s i z. The results for a glassy instance (d ¼ 2p Â 198 kHz at o z ¼ 2p Â 700 kHz) are summarized in Table 1 for N ¼ 4, 6, 8. The noise rate is chosen such that on average one quantum jump occurs in the system with four ions, while accordingly the system with eight ions suffers on average from two such events. In all cases, the annealing produces the correct pattern, F40. As expected, F decreases for larger systems, but fortunately rather slowly (from F ¼ 0. 25 at N ¼ 4 to F ¼ 0. 16 at N ¼ 8). If the total amount of noise is kept constant, that is, Gp1/N, the annealing is found to profit from larger system sizes, since a quantum jump at spin i is unlikely to affect the sign of hs j x i for jai. We note that the spin values produced by the Monte Carlo wave-function method cannot be described by a normal distribution. Importantly, the peak of each distribution, roughly coinciding with its median, is barely affected by the noise. Thus, larger fidelities can be obtained from the median rather than from the arithmetic mean of hs i x i. We solve the equations of motion, equation ( 12 ), for a glassy instance at different system sizes N, and plot the fidelity of the outcome as a function of the annealing time t. In the inset, we investigate the scaling behaviour by plotting (in double-logarithmic scale) the value of t which is needed for a fidelity F ¼ 0. 5 as a function of N. A fourth-order polynomial fit agrees very well with the data (black dashed line). The fit parameters, as defined by equation ( 13 ), are t 0 ¼ 90 AE 40 ð Þms and g ¼ 12. 0 ± 1. 2. For all calculations, we have chosen a beatnote frequency between the two lowest resonances, o L ¼ 0. 8o 1 þ 0. 2o 2, a trap frequency o z ¼ 2p Â 270 kHz, and a bias potential E¼ À 1 kHz. The initial value of the transverse field was B max ¼ 10 kHz.
section_name: Results

section_content: information which is encoded in the quantum, but not in the classical model. Therefore, we focus on the ferromagnetic Mattis model, which in the classical case keeps a binary memory of a spin pattern, that is, of N bits. Our considerations can also be generalized to the Hopfield model 1, which memorizes multiple patterns. We will show how quantum effects can increase the amount of information encoded by these models. 

Recall that in the classical case, the spin pattern was defined by a resonant mode in terms of the sign of each component. In the quantum case, however, one cannot simply replace classical spins by quantum averages, sign s i x À Á. Even in a weak transverse field B, this quantity vanishes due to the Z 2 symmetry, s x -À s x. Instead, the pattern is reflected by l i ¼ C 1 h js i x C 2 j i, where C 1 j i and C 2 j i are the ground and first excited state. For small B, we find numerically sign(l i ) ¼ sign(x im ). For large B, the stronger relation l i ¼ x im holds approximately, see Fig. 7. Thus, the former binary memory has become real-valued. 

To show this behaviour, we note that for strong B, the ground state |C 1 i is fully polarized along z, and the first excited state |C 2 i is restricted to the N-dimensional subspace with one spin flipped, that is, S z ¼ P i s i z ¼N À 2. Within this subspace the Hamiltonian H J is given by an N Â N matrix approximately proportional to Jij ¼ À x im x jm for iaj, and Jii ¼ constant. Here we neglect all but the m-th mode close to resonance. 

It is easy to see that the vector n m is a ground state of the matrix À x im x jm, which differs from Jij only by the diagonal elements, which approach unity for large N. Thus, the first excited state reads C 2 j i¼ P N i¼1 x im i j i, where i j i denotes the state in which spin i is flipped relatively to all others (in the s z basis). This shows that l i Ex im, and the small deviations decrease quickly with N. 

Measuring l i experimentally is possible by full state tomography. The absolute value of l i can be obtained via a simple s i z measurement. In the limit of strong B-fields we have l

Many applications are known for the classical spin system with couplings defined by spin patterns, reaching from pattern recognition and associative memory in the Hopfield model 1 to noise-free coding 2, 47. Our analysis suggests that patterns given by real numbers could replace patterns of binary variables by exploiting the quantum character of the spins.
section_name: Spin pattern in the quantum

section_content: In summary, our work demonstrates the occurrence of Mattis glass behaviour in spin chains of trapped ions, if the detuning of the spin-phonon coupling is chosen between two resonances. In these regimes, the effective spin system has an exponentially large number of low-energy states, and finding its ground state corresponds to solving a number-partitioning problem. This establishes a direct connection between the properties of a physical system and the solution of a potentially NP-hard problem of computer science. Given the state-of-art in experiments with trapped ions, the physical implementation is feasible: In comparison with the previous experiments with trapped ions [10] [11] [12] [13] [14], only the detuning of the spin-phonon coupling needs to be adjusted. Differently from other approaches to spin glass physics, our scheme does not require any disorder. In its most natural implementation, parity symmetry allows one to analytically determine the ground state. Different ways to break this symmetry can be implemented to increase the complexity of the problem. 

The ion chain then becomes an ideal test ground for applying quantum simulation strategies to solve computationally complex problems. By applying a transverse field to the ions, quantum annealing from a paramagnet to the glassy ground state is possible. The ionic system may be used to benchmark quantum annealing, which has become a subject of very lively and controversial debate since the launch of the D-Wave computers 7, 8. Exact calculations for small systems (N ¼ 6) and approximative calculations for larger system (N ¼ 22) demonstrate the feasibility of the proposed quantum annealing, and suggest a polynomial scaling of the annealing time. Accordingly, this approach may offer the sought-after quantum speed-up. In view of sizes of 30 and more ions already trapped in recent experiments (cf., ref. 48), a realization of our proposal Closed system (1. 0, 0. 97, À 0. 39, À 0. 42) N ¼ 4

Open system, mean values (0. 79, 0. 70, À 0. 25, À 0. 32) Open system, median values (1. 0, 0. 97, À 0. 39, À 0. 42)

Closed system (1. 0, 0. 99, 0. 76, À 0. 40, À 0. 64, À 0. 66) N ¼ 6

Open system, mean values (0. 82, 0. 68, 0. 55, À 0. 23, À 0. 43, À 0. 46) Open system, median values (1. 0, 0. 98, 0. 76, À 0. 39, À 0. 64, À 0. 66)

Closed system (1. 0, 0. 99, 0. 96, 0. 58, À 0. 31, À 0. 70, À 0. 75, À 0. 77) N ¼ 8

Open system, mean values (0. 83, 0. 69, 0. 69, 0. 40, À 0. 16, À 0. 43, À 0. 55, À 0. 53) Open system, median values (1. 0, 0. 98, 0. 94, 0. 58, À 0. 30, À 0. 69, À 0. 75, À 0. 76)

We perform quantum annealing (t ¼ 3 ms and T ¼ 30 ms) for a glassy instance (d ¼ 2p Â 198 kHz at o z ¼ 2p Â 700 kHz, E¼ À 1 kHz) at different system sizes N, using an effective spin model description. 

The results s 1

x ;. . . ; s N x À Á, are shown for the closed-system dynamics and for a noisy system, with mean and median over a sample of 2,000 runs. The average number of noisy event scales with the system size, and is adjusted to 4/N. In all cases, the signs of hs i x i reproduce correctly the mode pattern, and the fidelity decreases with the system size. In contrast to the arithmetic mean values, the median values in the noisy sample are barely affected by the noise. could not only confirm our semi-classical results, but also go beyond the sizes considered here. 

Finally, resonant coupling to multiple modes opens an avenue to neural network models, where a finite number of patterns is memorized by couplings to different phonon modes. Quantum features can increase the memory of such networks from binary to real-valued numbers. It will be subject of future studies to work out the possible benefits which quantum neural networks may establish for information processing purposes.
section_name: Discussion

section_name: Acknowledgements

section_content: We thank A. Acı ´n, R. Augusiak, A. Bermudez, J. Tura, P. Rotondo, L. Santos and P. Wittek for discussions. We acknowledge financial support from EU grants OSYRIS ( ERC-2013-AdG Grant No. 339106 ), SIQS ( FP7-ICT-2011-9 No. 600645 ), QUIC ( H2020-FETPROACT-2014 No. 641122 ), EQuaM (FP7/2007-2013 Grant No. 323714 ), Spanish MINECO grants ( FOQUS FIS2013-46768-P, FIS2014-54672-P ), Severo Ochoa grant ( SEV-2015-0522 ), Generalitat de Catalunya ( 2014 SGR 401, 2014 SGR 874 and SGR 875 ), the Maria de Maeztu grant ( MDM-2014-0369 ) and Fundacio ´Cellex. B. J. -D. is supported by the Ramon y Cajal program, and C. G. by MPQ-ICFO, ICFOnest þ ( FP7-PEOPLE-2013-COFUND ) and by the European Union 's Marie Sklodowska-Curie Individual Fellowships (IF-EF) programme ( GA 700140 ).
section_name: Acknowledgements

section_name: Author contributions

section_content: All authors contributed to the conceptual design of the quantum simulation, discussion and interpretation of results, and the writing of the manuscript. Exact numerical calculations were performed by T. G. Semi-classical calculations were done by B. J. -D. and D. R.
section_name: Author contributions

section_content: Competing financial interests: The authors declare no competing financial interests. 

Reprints and permission information is available online at http://npg. nature. com/ reprintsandpermissions/
section_name: Additional information