Enhancing associative memory recall and storage capacity using confocal cavity QED

Brendan P. Marsh,1, 2 Yudan Guo,2, 3 Ronen M. Kroeze,2, 3 Sarang Gopalakrishnan,4 Surya Ganguli,1 Jonathan Keeling,5 and Benjamin L. Lev1, 2, 3 1Department of Applied , , Stanford CA 94305, USA 2E. L. Ginzton Laboratory, Stanford University, Stanford, CA 94305, USA 3Department of Physics, Stanford University, Stanford CA 94305, USA 4Department of Engineering Science and Physics, CUNY College of Staten Island, Staten Island, NY 10314, USA 5SUPA, School of Physics and Astronomy, University of St. Andrews, St. Andrews KY16 9SS, United Kingdom (Dated: September 3, 2020) We introduce a near-term experimental platform for realizing an associative memory. It can simultaneously store many memories by using spinful bosons coupled to a degenerate multimode optical cavity. The associative memory is realized by a confocal cavity QED neural network, with the cavity modes serving as the synapses, connecting a network of superradiant atomic spin ensembles, which serve as the neurons. Memories are encoded in the connectivity matrix between the spins, and can be accessed through the input and output of patterns of light. Each aspect of the scheme is based on recently demonstrated technology using a confocal cavity and Bose-condensed atoms. Our scheme has two conceptually novel elements. First, it introduces a new form of random spin system that interpolates between a ferromagnetic and a spin-glass regime as a physical parameter is tuned—the positions of ensembles within the cavity. Second, and more importantly, the spins relax via deterministic steepest-descent dynamics, rather than Glauber dynamics. We show that this nonequilibrium quantum-optical scheme has significant advantages for associative memory over Glauber dynamics: These dynamics can enhance the network’s ability to store and recall memories beyond that of the standard Hopfield model. Surprisingly, the cavity QED dynamics can retrieve memories even when the system is in the spin glass phase. Thus, the experimental platform provides a novel physical instantiation of associative memories and spin glasses as well as provides an unusual form of relaxational dynamics that is conducive to memory recall even in regimes where it was thought to be impossible.

I. INTRODUCTION nonequilibrium dynamics of the cavity QED system en- hances its ability to store and recall multiple memory patterns, even in a spin glass phase. Five hundred million years of vertebrate brain evolu- Despite the biologically inspired name, artificial neural tion have produced biological information-processing ar- networks can refer to any network of nonlinear elements chitectures so powerful that simply emulating them, in (e.g., spins) whose state depends on signals (e.g., mag- the form of artificial neural networks, has lead to break- netic fields) received from other elements [7–9]. They throughs in classical computing [1,2]. Indeed, neuro- provide a distributed computational architecture alter- morphic computation currently achieves state-of-the-art native to the sequential gate-based von Neumann model performance in image and speech recognition, machine of computing widely used in everyday devices [10] and translation, and even out-performs the best humans in employed in traditional quantum computing schemes [4]. ancient games like Go [3]. Meanwhile, a revolution in Rather than being programmed as a sequence of opera- our ability to control and harness the quantum world is tions, the neural network connectivity encodes the prob- promising technological breakthroughs for quantum in- lem to be solved as a cost function, and the solution cor- formation processing [4,5] and sensing [6]. Thus, com- responds to the final steady-state configuration obtained

arXiv:2009.01227v1 [quant-ph] 2 Sep 2020 bining the algorithmic principles of robust parallel neu- by minimizing this cost function through a nonlinear dy- ral computation, discovered by biological evolution, with namical evolution of the individual elements. Specifically, the nontrivial quantum dynamics of interacting light and the random, frustrated Ising spin glass is an archetypal matter naturally offered to us by the physical world, mathematical setting for exploring neural networks [7]. may open up a new design space of quantum-optics- Finding the ground state of an Ising spin glass is known to based neural networks. Such networks could potentially be an NP-hard problem [11, 12] and so different choices of achieve computational feats beyond anything biological the spin connectivity may therefore encode many differ- or silicon-based machines could do alone. ent combinatorial optimization problems of broad tech- We present an initial step along this path by theoret- nological relevance [13, 14]. Much of the excitement in ically showing how a network composed of atomic spins modern technological and scientific computing revolves coupled by photons in a multimode cavity can naturally around developing faster, more efficient ‘heuristic’ op- realize associative memory, which is a prototypical func- timization solvers that provide ‘good-enough’ solutions. tion of neural networks. Moreover, we find that including Physical systems capable of realizing an Ising spin glass the effects of drive and dissipation, the naturally arising may play such a role. In this spirit, we present a thor- 2 ough theoretical investigation of a quantum-optics-based heuristic neural-network optimization solver in the con- text of the associative memory problem. Using notions from statistical mechanics, Hopfield showed how a spin glass of randomly connected Ising spins can be capable of associative memory, a prototyp- ical brain-like neural network function [15]. Associative memory is able to store multiple patterns (memories) as local minima of an energy landscape. Moreover, recall of any individual memory is possible even if mistakes are made when addressing the memory to be recalled: if the network is initialized by an external stimulus in a state that is not too different from the stored memory, then the network dynamics will flow towards an inter- FIG. 1. Sketch of the confocal cavity QED system with nal representation of the original stored memory, using atomic spin ensembles confined by optical tweezers. Shown an energy minimizing process called pattern completion are the cavity mirrors (gray), superpositions of the cavity that corrects errors in the initial state. Such networks ex- modes (blue), BECs (red), optical tweezer beams (green), transverse pump beam (red), and interference on a CCD cam- hibit a trade-off between capacity (number of memories era for holographic imaging of spin states. stored) and robustness (the size of the basins of attrac- tion of each memory under pattern completion). Once too many memories are stored, the basins of attraction have similarly to a Hopfield neural network. All physical cease to be extensive, and the model transitions to a spin- resources invoked in this treatment have been demon- glass regime with exponentially many spurious memories strated in recent experiments [31–37]. Specifically, we (with subextensive basins of attraction) that are nowhere show that suitable network connectivity is provided by near the desired memories [16]. optical photons in the confocal cavity, a type of degen- From a hardware perspective, most modern neural net- erate multimode resonator [38]. The photons are scat- works are implemented in CMOS devices based on elec- tered into the cavity from atoms pumped by a coherent tronic von-Neumann architectures. In contrast, early field oriented transverse to the cavity axis, as illustrated work aiming to use classical, optics-based spin represen- in Fig.1. The atoms undergo a transition to a super- tations sought to take advantage of the natural paral- radiant state above a threshold in pump strength. In lelism of light propagation [17–19]; such work continues this state, the spins effectively realize a system of rigid in the context of silicon photonic integrated circuits and (easy-axis) Ising spins with rapid spin evolution, ensur- other coupled classical oscillator systems [20, 21]. The ing that memory retrieval can take place before heating use of atomic spins coupled via light promises additional by spontaneous emission can play a detrimental role. We advantages: atom-photon interactions can be strong even moreover find the cavity QED system naturally leads to a on the single-photon level [22], providing the ability to discrete analog of “steepest descent” dynamics, which we process small signals and exploit manifestly quantum ef- show provides an enhanced memory capacity compared fects and dynamics. to standard Glauber dynamics [39]. Finally, the spin Previous theoretical work has sketched how a spin glass configuration can be read-out by holographic imaging of and neural network may be realized using ultracold atoms the emitted cavity light, as recently demonstrated [35]. strongly coupled via photons confined within a multi- That is, the degenerate cavity provides high-numerical- mode optical cavity [23, 24]. The cavity modes serve aperture spatial resolving capability, and may be con- as the synaptic connections of the network, mediating strued as an active quantum gas microscope, in analogy Ising couplings between atomic spins. The arrangement to apparatuses employing high-NA lenses near optically of atoms within the cavity determines the specific connec- trapped atoms [40]. tion strengths of the network, which in turn determine Our main results are as follows: the stored patterns. The atoms may be reproducibly trapped in a given connectivity configuration using op- 1. Superradiant scattering of photons by ensembles of tical tweezer arrays [25, 26]. Subsequent studies have atomic spins plus cavity dissipation naturally re- provided additional theory support to the notion that alizes a form of zero-temperature dynamics in a related quantum-optical systems can implement neural physical setting: discrete steepest descent (SD) dy- networks [27–30]. However, all these works, including namics. This is because the bath structure dic- Refs. [23, 24], left significant aspects of implementation tates that large energy-lowering spin flips occur and capability unexplored. most rapidly. This is distinct from the typical zero In the present theoretical study, we introduce the temperature limit of Glauber [39] or Zero Tem- first practicable scheme for a quantum-optical associa- perature Metropolis-Hastings [41, 42] (0TMH) dy- tive memory by explicitly treating photonic dissipation namics typically considered in Hopfield neural net- and ensuring that the physical system does indeed be- works [43]. 3

2. The confocal cavity can naturally provide a dense a transversely pumped confocal cavity above the super- (all-to-all) spin-spin connectivity that is tunable radiant transition threshold. SectionVI discusses how between (1) a ferromagnetic regime, (2) a regime SD dynamics enhances associative memory capacity and with many large basins of attraction suitable for robustness. A learning rule that maps free-space light associative memory, and (3) a regime in which the patterns into stored memory is presented in Sec.VII. connectivity describes a Sherrington–Kirkpatrick Last, in Sec.VIII, we conclude and frame our work in (SK) spin glass. This sequence of regimes is char- a wider context. In this discussion, we speculate about acteristic of Hopfield model behavior. how the quantum dynamics of the superradiant tran- sition might enhance solution finding. This is in con- 3. Surprisingly, standard limits on memory capacity trast to all the rest of this paper, where we consider and robustness are exceeded under SD dynamics. a semiclassical regime well above any quantum critical This enhancement is because SD dynamics enlarge dynamics at the transition itself. Embedding neural net- the basins of attraction—i.e., 0TMH can lead to er- works in systems employing ion traps, optical lattices and rant fixed points in regimes where SD always leads optical-parametric-oscillators has been explored [44–47], to the correct one. This is true not just of the cavity and comparisons of the latter to our scheme is discussed QED system, but also for the basic Hopfield model here also. This section also provides concluding remarks with Hebbian and other learning rules. Moreover, regarding how the study of this physical system may pro- the enhancement persists into the SK spin glass vide new perspectives on the problem of how memory regime, wherein basins of metastable states expand arises in biological systems [48]. from zero size under 0TMH dynamics to an exten- AppendicesA–F present the following:A, the Raman sively scaling size under SD. coupling scheme and effective Hamiltonian;B, the con- volution of the confocal connectivity with the finite spa- 2 4. While simulating the SD dynamics requires O(N ) tial extent of the spin ensembles;C, the derivation of numerical operations to determine the optimal the confocal connectivity probability distribution;D, the energy-lowering spin flip, the physical cavity QED spin-flip dynamics in the presence of a classical bath with system naturally flips the optimal spin due to the ohmic noise spectrum;E, the derivation of the spin-flip different rates experienced by different spins. Thus, rate and dynamics in the presence of a quantum bath; the real dynamics drives the spins to converge to a andF, the derivation of the mean-field ensemble dynam- fixed point configuration (memory) more efficiently ics. than numerical SD or 0TMH dynamics, assuming similar spin-flip rates. II. CONFOCAL CAVITY QED 5. We introduce a pattern storage method that allows one to program associative memories in the cavity QED system. The memory capacity of the cavity As illustrated in Fig.1, we consider a configuration of under this scheme can be as large as N patterns. N spatially separated BECs placed in a confocal cavity. Encoding states requires only a linear transforma- In a confocal cavity, the cavity length L is equal to the tion and a threshold operation on the input and radius of the curvature of the mirrors R, which leads to output fields, which can be implemented in an opti- degenerate optical modes [38]. More specifically, modes cal setting via spatial light modulators. While the form degenerate families, where each family consists of a standard Hopfield model does not require encod- complete set of transverse electromagnetic TEMlm modes ing, it cannot naturally be realized in a multimode with l + m either of even or odd parity. Recent exper- cavity QED system. Thus, the physical cavity iments have demonstrated coupling between compactly QED system enjoys roughly an order-of-magnitude confined Bose-Einstein condensates (BECs) of ultracold 87 greater memory capacity at the expense of an en- Rb atoms and a high-finesse, multimode (confocal) op- coder. tical cavity with L = R = 1 cm [31–36]. The coupling between the BECs and the cavity occurs 6. Overall, our storage and recall scheme points to a via a double Raman pumping scheme illustrated in Fig.2. novel paradigm for memory systems in which new The |F, mF i = |1, −1i and |2, −2i states are coupled stimuli are remembered by translating them into via two-photon processes, involving pump lasers oriented already intrinsically stable emergent patterns of the transverse to the cavity axis and the cavity fields [49]. native network dynamics. The motion of atoms may be suppressed by introduc- ing a deep 3D optical lattice into the cavity [50]. When The remainder of this paper is organized as follows. We atoms are thus trapped, each BEC can be described as an first describe the physical confocal cavity QED (CCQED) ensemble of pseudospin-1/2 particles—corresponding to system in Sec.II, before introducing the Hopfield model the two states discussed above—with no motional degrees in Sec.III. Next, we analyze the regimes of spin-spin of freedom. The system then realizes a nonequilibrium connectivity provided by the confocal cavity in Sec.IV. Hepp–Lieb–Dicke model [51], exhibiting a superradiant We then discuss in Sec.V the SD dynamics manifest in phase transition [32, 33] when the pump laser intensity 4

Improvements to cavity technology can allow the size of the spin ensembles to shrink further, ultimately reach- ing the single-atom level. Moreover, Raman cooling [55] within the tight tweezer traps can help mitigate heating effects, allowing atoms to be confined for up to 10 s, lim- ited only by the background gas collisions in the vacuum chamber. By shrinking the size of the ensembles, it may be possible for quantum entanglement among the nodes to then persist deep into the superradiant regime—we return to this possibility in our concluding discussion in Sec.VIII. The confocal cavity realizes a photon-mediated inter- action among the spin ensembles. This interaction is de- FIG. 2. Double Raman atomic coupling. The scheme provides scribed by a matrix Jij, denoting the coupling between a two-level system, corresponding to the two hyperfine states ensembles i and j. As derived in Sec.V, this interaction of 87Rb. Two transversely oriented pump beams are used involves a sum over all relevant cavity modes, m, and P 2 2 to generate cavity-assisted two-photon processes coupling the takes a form Jij = − m ∆mgimgjm/(∆m + κ ). Here, states |F, mF i = |2, −2i ≡ |↑i and |F, mF i = |1, −1i ≡ |↓i. gim is the coupling between cavity mode m and ensem- ble i—which depends on the positions of atoms and spa- tial profiles of modes—while ∆m is the detuning of the is sufficiently large. pump laser from cavity mode m. For simplicity in writ- In the following, we will assume parameter values sim- ing this equation, we will restrict the BEC positions ri ilar to those realized in the CCQED experiments of to lie within the transverse plane at the center of the Refs. [31–36]: Specifically, we take a single-atom–to– cavity. Following refs. [33, 35, 36], in the confocal limit ∆m = ∆C , the interaction then takes the form: cavity coupling rate of g0 = 2π × 1.5 MHz [52], a cavity field decay rate of κ = 2π × 150 kHz, a pump-cavity de- 2    −g˜0∆C ri · rj tuning of ∆C = −2π × 3 MHz, and a detuning from the Jij = 2 2 βδij + cos 2 2 . (1) π(∆C + κ ) w0 atomic transition of ∆A = −2π × 100 GHz. The spon- 2 2 taneous emission rate is approximately ΓΩ /∆A, where Here,g ˜0 = Ωg0/∆A denotes an effective coupling Γ = 2π × 6.065(9) MHz is the linewidth of the D2 tran- strength in terms of the transverse pump strength Ω, 87 2 sition in Rb and Ω is proportional to the intensity of single-atom–to–cavity coupling g0 and atomic detuning the transverse pump laser. A large ∆A ensures that the ∆A. The length scale w0 is the width (radius) of the spontaneous emission rate is far slower than the inverse Gaussian TEM00 mode. The term β is a geometric fac- lifetime Γ of the Rb excited state. A typical value of Ω2 is tor determined by the shape of the BEC. For a Gaus- set by the pump strength required to enter the superra- sian atomic profile of width σA in the transverse plane, diant regime; with 107 atoms [53], Ω2 can be low enough 2 2 β = w0/8σA, which is typically ∼10. to achieve a spontaneous decay timescale on the order of The first term βδij is a local interaction that is present 100 ms. Hereafter, we will not explicitly include sponta- only for spins within the same ensemble. This term arises neous emission, but will consider it to set an upper time from the light in a confocal cavity being perfectly re- limit on the duration of experiments. focused after two round trips. The effect of this term To control the position of the BECs, one may use is to align spins within the same ensemble, or in other optical tweezer arrays [25, 26]. Experiments have al- words, to induce the superradiant phase transition of ready demonstrated the simultaneous trapping of sev- that ensemble. In practice, imperfect mode degeneracy eral ensembles in the confocal cavity using such an ap- broadens the refocussing into a local interaction of finite proach [33]. Extending to hundreds of ensembles is range; Refs. [33, 35, 36] discuss this effect. The range within the capabilities of tweezer array technology [26]. of this interaction is controlled by the ratio between the As we discuss in Sec.VC, collective enhancement of the pump-cavity detuning ∆C and the spread of the cavity dynamical spin flip rate occurs, depending on the number mode frequencies. At sufficiently large ∆C , the inter- of atoms in each ensemble. This enhancement is needed action range can become much smaller than the spacing so that the pseudospin dynamics is faster than the spon- between BECs. Because a confocal cavity resonance con- taneous emission timescale. Only a few thousand atoms tains only odd or even modes, there is also refocussing at per ensemble are needed to reach this limit, while the the mirror image position; we can ignore this by assuming maximum number of ultracold atoms in the cavity can all BECs are in the same half-plane [33, 35, 36]. reach 107. Thus, current laser cooling and cavity QED The nonlocal second term arises from the propagation technology provides the ability to support roughly 103 of light in between the refocussing points. Intuitively, this network nodes and have them evolve for a few decades interaction arises from the fact that each confocal cavity in timescale. This number of nodes is similar to state-of- images the Fourier transform of objects in the central the-art classical spin glass numerical simulation [54]. plane back onto the objects in that same plane. Thus, 5

FIG. 3. (a) All-to-all, sign-changing connectivity between spin ensembles is achieved via photons propagating in superpositions of cavity modes. Blue and red indicate ferromagnetic versus antiferromagnetic Jij links. Only four nodes are depicted. Individual spins align within an ensemble due to superradiance, while ensembles organize with respect to each other due to Jij coupling. Cavity emission allows for holographic reconstruction of the spin state: red and blue fields are π out of phase, allowing discrimination between up and down spin ensembles. (b) The spin ensembles realize a Hopfield neural network: a single layer network of binary neurons si = ±1 that are recurrently fed back then subjected to a linear transform J and threshold operation at each neuron. (c) The Hopfield model exhibits an energy landscape with many metastable states. Each local minimum encodes a memory spin configuration (pattern) surrounded by a larger basin of attraction of similar spin states. Energy minimizing dynamics drive sufficiently similar spin configurations to the stored local minimum. There is a phase transition from the associative memory to a spin glass once there are too many memories; i.e., when so many minima exist that basins of attraction vanish. (d) Schematic of the associative memory problem. Multiple stored patterns (e.g., images of element symbols) may be recalled by pattern completion of distorted input images. photons scattered by atoms in local wavepackets are re- to the discrete time dynamics flected back onto the atoms as delocalized wavepackets with cosine modulation—the Fourier transform of a spot.   X Formally, it arises due to Gouy phase shifts between the si(t + 1) = sgn  Jijsj(t) − hi , (2) different degenerate modes, see Refs. [33, 35, 36] for a j6=i derivation and experimental demonstrations. This inter- action is both nonlocal and nontranslation invariant. It where Jij is a real valued number that can be thought of can generate frustration between spin ensembles due to as the strength of a synaptic connection from neuron j its sign-changing nature, as discussed in Sec.IV below. to neuron i. Intuitively, this dynamics computes a total eff P The structure of the matrix Jij is quite different from input hi = j6=i Jijsj(t) to each neuron i and compares those appearing traditionally in Hopfield models, either it to a threshold hi. If the total input is greater (less) under Hebbian or pseudoinverse coupling rules, as dis- than this threshold, then neuron i at the next timestep cussed in Sec.IV. We note that while the finite spatial is active (inactive). One could implement this dynamics extent of the BEC is important for rendering the local in parallel, in which case Eq. (2) is applied to all N neu- interaction finite, we show in AppendixB that it does rons simultaneously. Alternatively, for reasons discussed not significantly modify the nonlocal interaction in the below, it is common to implement a serial version of this experimental regime discussed here. dynamics in which a neuron i is selected at random, and then Eq. (2) is applied to that neuron alone, before an- other neuron is chosen at random to update. III. HOPFIELD MODEL OF ASSOCIATIVE The nature of the dynamics in Eq. (2) depends cru- MEMORY cially on the structure of the synaptic connectivity ma- trix Jij. For arbitrary Jij, and large system sizes N, the long-time asymptotic behavior of si(t) could exhibit The Hopfield associative memory is a model neural net- three possibilities: (1) flow to a fixed point; (2) flow to a work that can store memories in the form of distributed limit cycle; or (3) exhibit chaotic evolution. On the other patterns of neural activity [43, 56, 57]. In the simplest hand, with a symmetry constraint in which Jij = Jji, the instantiation of this class of networks, each neuron i has serial version of the dynamics in Eq. (2) monotonically an activity level si that can take one of two values: +1, decreases an energy function corresponding to an active neuron, or −1, correspond- ing to an inactive one. The entire state of a network of N N N X X N neurons is then specified by one of 2 possible dis- H = − Jijsisj + hisi. (3) tributed activity patterns. This state evolves according i,j=1 i=1 6

In particular, under the update in Eq. (2) for a single We may note that in the magnetism literature, such spin, it is straightforward to see that H(t+1) ≤ H(t) with a model is known as the multicomponent Mattis equality if and only if si(t + 1) = si(t). Indeed, the serial model [58]. The properties of the energy landscape as- version of the update in Eq. (2) corresponds exactly to sociated with the dynamics in Eq. (2) under this con- Zero Temperature Metropolis–Hastings (0TMH) [41, 42] nectivity have been analyzed extensively in the thermo- < or Glauber dynamics [39] applied to the energy function dynamic limit N → ∞ [59, 60]. When P ∼ 0.05N the in (3). The existence of a monotonically decreasing en- lowest energy minima are in one to one correspondence < < ergy function rules out the possibility of limit cycles, and with the P desired memories. For 0.05 ∼ P/N ∼ 0.138, every neural activity pattern thus flows to a fixed point, the P memories correspond to metastable local minima. which corresponds to a local minimum of the energy func- However, pattern completion is still possible; an initial tion. A local minimum is by definition a neural activ- pattern corresponding to a corrupted memory, with a ity pattern in which flipping any neuron’s activity state small but extensive number of errors proportional to N, would increase the energy. will still flow towards the desired memory. However, at One of Hopfield’s key insights was that we could think larger P , the network undergoes a spin-glass transition of neural memories as fixed points or local minima in in which there can be exponentially many energy min- an energy landscape over the space of neural activity ima with small basins of attraction, none of which are patterns; these are also sometimes known as metastable close to the desired memories. Thus, pattern completion states or attractors of the dynamics. Each such fixed is not possible: an initial pattern corresponding to a cor- point has a basin of attraction, corresponding to the set rupted memory, with even a small but extensive number of neural activity patterns that flow under Eq. (2) to that of errors proportional to N, is not guaranteed to flow fixed point. The process of successful memory retrieval towards the desired memory. This spin glass transition can then be thought of in terms of a pattern completion occurs because the large number of memories start to in- process. In particular, an external stimulus may initialize terfere with each other. In essence, the addition of each the neural network with a neural activity pattern corre- new memory modifies the existing local minima associ- sponding to a corrupted or partial version of the fixed ated with previous memories. When too many memories point memory. Then, as long as this corrupted version are stored, it is not possible, under the Hebbian rule in still lies within the basin of attraction of the fixed point, Eq. (4) and the dynamics of Eq. (2), to ensure the ex- the flow towards the fixed point completes or cleans up istence of local minima, with large basins, close to any the initial corrupted pattern, triggering full memory re- desired memory. call. This is an example of content addressable associa- Thus, we have noted the Hopfield model undergoes tive memory, where partial content of the desired mem- a spin glass transition above a critical pattern loading ory can trigger recall of all facts associated with that P/N ≈ 0.138. In the exposition below, it will be useful partial content. A classic example might be recalling a to also consider a prototypical example of a spin glass, friend who has gotten a haircut. Figure3 illustrates this namely the Sherrington–Kirkpatrick (SK) model [61]. In pattern completion based memory retrieval process. the SK model, the matrix elements of the symmetric ma- In this framework, the set of stored memories, or fixed trix JSK are chosen i.i.d. from a zero mean Gaussian points, are encoded entirely in the connectivity matrix distribution with variance σ2/N. At low temperature, Jij; for simplicity, we set the thresholds hi = 0. There- such a model also has a spin-glass phase with exponen- fore, if we wish to store a prescribed set of P memory tially many energy minima, and as we shall see below, µ µ µ patterns ξ = (ξ1 , . . . , ξN ) for µ = 1,...,P , where each our CCQED system exhibits a transition from a mem- µ ξi = ±1, we need a learning rule for converting a set ory retrieval phase to an SK-like spin-glass phase as the µ P of given memories {ξ }µ=1 into a connectivity matrix J. positions of spin ensembles spread out within the cavity. Ideally, this connectivity matrix should instantiate fixed Numerous improvements to the Hebbian learning rule points under the dynamics in Eq. (2) that are close to have been introduced [62, 63] that sacrifice the simple the desired memories ξµ, with large basins of attraction, outer product structure of the Hebbian connectivity in enabling robust pattern completion of partial, corrupted Eq. (4) for improved capacity. Notable among them is inputs. Of course, in any learning rule, one should ex- the pseudoinverse rule, in which P may be as large as N. pect a trade-off between capacity (the number of mem- This large capacity comes at the cost of being a nonlo- ories that can be stored) and robustness (the size of the cal learning rule: updating any of the weights requires basin of attraction of each memory, which is related to full knowledge of all existing Jij weights, unlike the Heb- the fraction of errors that can be reliability corrected in bian learning rule. The Jij matrix for the pseudoinverse a pattern completion process). learning rule is given by: When the desired memories ξµ are unstructured and P random, a common choice is the Hopfield connectivity, 1 X J = ξµC−1(ξν )T , (5) which corresponds to a Hebbian learning rule [43, 57]: Pseudo N µ,ν=1 P 1 X µ µ T 1 µ ν J = ξ (ξ ) . (4) where the matrix Cµν = ξ · ξ stores the inner prod- Hebbian N N µ=1 ucts of the patterns. This learning rule ensures that the 7 desired memories ξν become eigenvectors of the learned tribution in the cavity transverse midplane. Specifically, connectivity matrix JPseudo with eigenvalue 1, thereby we choose a distribution of positions with zero mean (i.e., ensuring that each desired memory corresponds to a fixed centered about the cavity axis) and tunable standard de- point, or equivalently a local energy minimum, under the viation w. As the interaction in Eq. (1) is symmetric dynamics in Eq. (2). While the pseudoinverse rule does under ri → −ri, the distribution may also be restricted guarantee each desired memory will be a local energy to a single half plane to avoid the mirror interaction with minimum, further analysis is required to check whether no adverse affect to local and nonlocal interactions. such minima have large basins. The basin size will gener- In the limit w → 0, so that all ri = 0, all off-diagonal ically depend on the structure of Cµν , with potentially elements of the confocal connectivity matrix Jij become small basins arising for pairs of memories that are very identical and positive. This describes a ferromagnetic similar to each other. Finally, we note that the Hebbian coupling. As the width increases, some elements of Jij learning rule in Eq. (4) is in fact a special case of the become negative, as illustrated in Fig.4. This can lead pseudoinverse learning rule in Eq. (5) when the patterns to frustration in the network of coupled spins, where the µ ξ are all mutually orthogonal, with Cµν = δµν . We in- product of couplings around a closed loop is negative, i.e., clude the pseudoinverse rule in our comparisons below to where JijJjkJki < 0 for spins i, j, and k. In such cases, demonstrate the generality of results we present, and to it is not possible to minimize the energy of all pairwise apply them to something known to surpass the original interactions simultaneously. Such frustration can in prin- Hebbian scheme. ciple lead to a proliferation of metastable states, a key While the simple Hebbian rule and the more power- prerequisite for the construction of an associative mem- ful pseudoinverse rule are hard to directly realize in a ory. As we shall see, tuning the width w allows one to confocal cavity, we show in Sec.IV that the connectivity tune the degree of frustration, and thus the number of naturally provided by the confocal cavity is sufficiently metastable states in the confocal cavity. In the remain- high rank to support a multitude of local minima. We der of this section, we will consider only the normalized ˜ 2 further analyze the dynamics of the cavity in Sec.V, and nonlocal couplings Jij = cos 2ri · rj/w0 ∈ [−1, 1]. The demonstrate that this dynamics endows this multitude of local part of the interaction plays no role in the properties local minima with large basins of attraction in Sec.VI. we discuss in this section, but does affect the dynamics Thus, the confocal cavity provides a physical substrate as discussed in Sec.V. for high capacity, robust memory retrieval. Of course, To characterize the statistical properties of the ran- the desired memories we wish to store may not coincide dom matrix Jij, and its dependence on w, we begin by with the naturally occurring emergent local minima of considering the marginal probability distribution for in- the confocal cavity. However, any such mismatch can be dividual matrix elements Jij. Details of the derivation of solved by mapping the desired memories we wish to store this distribution are given in AppendixC; the result is into the patterns that are naturally stored by the cavity " # csch π/(2w ˜2) π − arccos J˜ (and vice-versa). We will show in Sec.VII that such a p(J˜ ; w) = cosh ij , (6) ij q 2 mapping is possible, and further, that it is practicable 2w ˜2 1 − J˜2 2w ˜ using optical devices. ij Taken together, the next few sections demonstrate that wherew ˜ ≡ w/w0. Figure4(a–c) illustrates the evolu- the CCQED system possesses three critical desiderata of tion of this marginal distribution for increasing width. an associative memory: (1) high memory capacity due to For smallw ˜, the distribution is tightly peaked around the presence of many local energy minima (Sec.IV); (2) J˜ij = +1, corresponding to an unfrustrated all-to-all fer- robust memory retrieval with pattern completion of an romagnetic model, with only a single global minimum extensive number of initial errors (Sec.V andVI); and (3) (up to Z2 symmetry). Asw ˜ increases, negative (antifer- programmability or content addressability of any desired romagnet) elements of J˜ become increasingly probable. memory patterns (Sec.VII). ij Also plotted in Fig.4(d) are the fractions of Jij links that are antiferromagnetic as well as the fraction that realize frustrated triples of spin connectivity, JijJjkJki < 0. The IV. CONNECTIVITY REGIMES IN A probability of antiferromagnetic coupling is analytically CONFOCAL CAVITY calculated in AppendixC, while the probability of frus- trated triples is evaluated numerically. As noted at the end of Sec.II, the form of connectivity If the different matrix elements Jij were uncorrelated, Jij in Eq. (1), which arises naturally for the confocal cav- then one could anticipate that, as in the SK model, frus- ity, is quite different from both the forms arising in the tration would occur once the probability of negative Jij Hebbian (Eq. (4)) and pseudoinverse (Eq. (5)) learning becomes sufficiently large. However, when correlations rules discussed in the previous section. Therefore, in this exist, the presence of many negative elements is not suf- section we analyze the statistical properties and energy ficient to guarantee significant levels of frustration and landscape of the novel random connectivity matrix aris- the consequent proliferation of metastable local energy ing from the confocal connectivity, taking the ensemble minima. For example, the rank 1 connectivity Jij = ξiξj, positions ri to be randomly chosen from a Gaussian dis- for a random vector ξ, can have have an equal fraction of 8

Jjk should be correlated, as they both depend on the common position rj. As discussed in App.C, this corre- lation can be computed analytically as a function of the width: 1 hJ J i = , (7) ij jk r 1 + 8w ˜4

where h·ir denotes an average over realizations of the ran- dom placement of spin ensembles. Although correlations exist, we see from this expression that they decay like 1/w˜4, so that at largew ˜, the correlations are weak; see Figure4(d). Of course, even weak correlations in a large number of O(N 2) off-diagonal elements can, in princi- ple, dramatically modify important emergent properties of the random matrix, such as the induced multiplicity of metastable states and the statistical structure of the eigenvalue spectrum. Thus, we examine the properties of the actual correlated random matrix ensemble arising from the confocal cavity rather than adopt known results. Figure5 shows a numerical estimation of the num- ber of metastable states as a function of the width w. This number is estimated by initializing a large number of random initial states and allowing those states to re- lax via 0TMH dynamics until a metastable local energy minimum is found. This routine is performed for many realizations of the connectivity Jij, then averaged over realizations to produce the number plotted in Fig.5. We regard configurations which are related by an overall spin flip as equivalent. A single metastable state is found at smallw ˜, as expected for ferromagnetic coupling. A tran- sition to multiple metastable states occurs asw ˜ increases; this transition becomes increasingly sharp at larger sys- tem sizes. Finite size scaling analysis of the transition yields a critical point of wAM ≈ 0.67w0. Only one minima exists below this value, while multiple minima emerge above. The number of metastable states, shown in Fig.5(b), increases rapidly for w > wAM. In particu- lar, in the range of w and N that we explored,√ we find that the following fits the simulations: N = 1 + AeBx, FIG. 4. Confocal cavity connectivities. Distribution of nor- 1/ν where x = N (w −wAM)/w0 is the rescaled width, and malized Jij couplings shown for widths (a) w = w0/2, (b) A = 0.33, B = 3.4, and ν = 2.4 are the fit parameters. w = w0, and (c) w = 4w0. Representative Jij connectivity graphs are shown to the right, with red (blue) links indicating Thus, the number of metastable states scales with N and wN 0.4 ferromagnetic Jij > 0 (antiferromagnetic Jij < 0) coupling. w as O(e ) just above wAM. At still larger w, the nu- The radius w0 is the Gaussian width of the TEM00 mode merical estimation of this number becomes less reliable in the transverse plane and is indicated by the dashed cir- due to the increasing prevalence of metastable states with cle. (The modes of a multimode cavity extend far beyond the small basins of attraction under 0TMH dynamics [64]. characteristic length scale w0.) (d) Statistical properties of The existence of multiple (metastable) local energy the Jij versus w. The correlation function in Eq. (7) between minima is a critical prerequisite for associative mem- different Jij (black line) shows that they become uncorrelated ory storage. An additional requirement, as discussed in at large w. The probability of generating frustration between Sec.III, is that these local energy minima should pos- three randomly chosen spins (red line) and the probability of generating an antiferromagnetic coupling between two ran- sess large enough basins of attraction to enable robust domly chosen spins (blue line) are also plotted. The dashed pattern completion of partial or corrupted initial states, lines correspond to the widths used in panels (a) through (c). through the intrinsic dynamics of the CCQED system. As of yet, we have made no statement about the basins of attraction of the metastable states we have found; we will examine this issue in the next two sections which positive and negative elements while remaining unfrus- will focus on the CCQED dynamics. For now, we simply trated [58]. In general, we expect the couplings Jij and note that at a fixed width ofw ˜ an O(1) amount above 9

ity density for the Jij given in Eq. (6) takes the limiting ˜ ˜2 −1/2 form p(Jij) = (1 − Jij) /π. This functional form dif- fers from the SK spin glass model in which the probability density of the couplings is Gaussian, with only the first two moments nonzero. However, it is known [65] that the SK model free energy depends on only the first two moments of the marginal distribution in the thermody- namic limit, as long as the third-order cumulant of the distribution is bounded. This is also true for the CC- QED connectivity. Moreover, these first two moments in the CCQED connectivity can be computed analytically. The mean µJ and standard deviation σJ as a function of width are 1 4w ˜4 r(5 + 8w ˜4) µ = , σ = . (8) J 1 + 4w ˜4 J 1 + 4w ˜4 1 + 16w ˜4 Thus, at large width, the mean is negligible compared to the standard deviation, which is required for a spin glass (as opposed to ferromagnetic state). However, a key difference between the CCQED connec- tivity and the SK connectivity is the presence of corre- lations between different matrix elements. The former’s correlation strength decreases with width, see Eq. (7) and Fig.4(d). We can obtain insights into how large the width must be in order to suppress these correlations, thereby crossing into an SK-like spin glass phase, by com- FIG. 5. (a) Number of metastable states versus distribution paring the statistical structure of the CCQED connec- width for various system sizes N, as indicated. The aver- tivity eigenvalue distribution to that of the SK model age number of metastable states increases with N above the connectivity. In particular, the eigenvalue distribution ferromagnetic–to–associative memory transition at w = AM √obeys the same Wigner’s semicircular law fWigner(x) = 0.67(1)w0. (b) Scaling collapse of the above in the region 4 − x2/2π as does the SK connectivity with zero mean 0.5w0 < w < 0.8w0, with denser sampling. The x-axis i.i.d. Gaussian elements of variance 1/N [66, 67]. More- is rescaled as N 1/ν (w − w )/w , while the y-axis is un- AM 0 over, the distribution of spacings s between adjacent changed. The parameters ν and wAM are determined√ by fit- Bx eigenvalues (normalized by the mean distance) in both ting the collapsed data to an exponential form 1 + Ae , 2 1/ν πs −πs /4 where x = N (w − wAM)/w0. The uncertainties are one obey Wigner’s surmise pWigner(s) = 2 e , reflect- standard error. ing repulsion between adjacent eigenvalues [68]. Fig- ure6(a,b) plots the eigenvalue distribution fw(x) and level-spacing distribution pw(s) for several widths w for the transition, the number of metastable states N grows the CCQED connectivity. Both distributions approach N 0.4 with system size N as O(e ), while the total config- those of the SK model for widths beyond a few w0. As N uration space grows with exponential scaling 2 . Given we discuss next, the required ratio w/w0 to reach the SK that every configuration must flow to one of these en- regime depends on the system size N. ergy minima, it seems reasonable to expect that any en- Figure6(c) plots the difference between the confocal ergy minimizing dynamics should endow these minima eigenvalue distribution, denoted by fw, and the Wigner with sufficiently large basins of attraction to enable ro- semicircular law fWigner in terms of the Hellinger dis- bust pattern completion, assuming these basins are all tance, which is defined for arbitrary probability dis- p approximately similar in size. tributions p(x) and q(x) as H2(p, q) = R dx( p(x) − At fixed N, the growth in the number of energy min- pq(x))2/2. The distance metric equals 1 for completely ima as a function ofw ˜, depicted in Fig.5, suggests the non-overlapping distributions and 0 for identical distribu- possibility of a spin glass phase wherein exponentially tions. We find that the Hellinger distance follows a uni- many metastable local energy minima emerge. Based on versal (N independent) curve as a function ofwN ˜ −1/4. the analysis of the marginal Eq. (6) and pairwise Eq. (7) The structure of this curve demonstrates that as long as 1/4 statistics of the matrix elements, we expect that the spin w > wSK = αN w0, where α is a constant of order glass phase should be like that of an SK model at largew ˜. unity, then the spectrum of the confocal cavity connec- To determine if such a state exists, we further analyze the tivity assumes Wigner’s semicircular law, just like that connectivity in this largew ˜ regime by comparing proper- of the SK model connectivity. At this large value of w, ties of the CCQED connectivity to those of the SK spin the strength of correlations between different matrix ele- glass connectivity. In the limit of largew ˜, the probabil- ments in the confocal cavity, given by Eq. (7), is O(1/N). 10

FIG. 7. Regimes of CCQED connectivity behavior versus width w and system size N. The three shaded regions corre- spond to ferromagnetic (F), associative memory, and SK-like spin glass (SG) regimes, as discussed in the text. Note that associative memories can still be encoded even in the spin glass regime due to SD dynamics; see Secs.V andVII.

Such weak correlations, combined with an O(1) variance and a negligible mean of the matrix elements, endow the CCQED connectivity with similar spectral properties to that of the SK connectivity. Given these similarities, we thus expect that the CCQED model possesses an SK-like spin glass phase at widths w > wSK . While the Hellinger distance in Fig.6(c) falls to zero, it does so smoothly as N 1/4; whether a phase transition or crossover occurs be- tween the associative memory and spin glass behaviors is unclear and warrants future investigation. Figure7 summarizes the three regimes of the CCQED connectivity matrix. The evolution from ferromagnetic, to associative memory, to spin glass versus w is analogous to the behavior exhibited by the Hopfield model as the ratio P/N of the number of memory patterns to neurons FIG. 6. Eigenvalue spectrum of the CCQED connectivity, increases in the Hebbian connectivity. Having demon- demonstrating random matrix statistics. (a) The eigenvalue strated that a significant number of metastable states distribution fw and (b) level-spacing spectrum for the non- 2 exist in the cavity QED system, Sec.V will now discuss local interaction matrix Jij = cos 2ri · rj /w0 . N = 1000 the natural dynamics of the cavity. We will show that spins are averaged over 50 realizations of Jij matrices. The distributions are shown for w = 2w (red), w = 3w (green), these differ from standard 0TMH or Glauber dynamics. 0 0 As mentioned, changing the dynamics changes the basins and w = 12w0 (blue). Each distribution is normalized to have unit variance. The solid black lines show the Wigner of attraction associated with each metastable state. Re- semicircle eigenvalue distribution (panel a) and the Wigner markably, as we will show in Sec.VI, the CCQED dynam- surmise for the level spacing distribution of Gaussian orthog- ics leads to a dramatic increase in the robustness of the onal ensemble random matrices (panel b). Panel (c) shows associative memory by ensuring that many metastable the Hellinger distance between the averaged CCQED connec- states with sufficiently large basins for robust pattern tivity eigenvalue distribution fw (shown in panel a), and the completion exist, even at largew ˜. Wigner semicircle distribution fWigner. The distance is plot- 1/ν ted as a function of the rescaled width N w/w0 for different power laws ν = −3, −4, −5 corresponding to different colors, V. SPIN DYNAMICS OF THE as indicated. Lines of varying intensity correspond to different SUPERRADIANT CAVITY QED SYSTEM N ranging from N = 100 (faintest) to N = 1000 (darkest). The traces overlap well for the ν = −4 scaling. We now discuss the spin dynamics arising intrinsically for atoms pumped within an optical cavity. To do this, we start from a full model of coupled photons and spins, and 11 show how both the connectivity matrix discussed above the Pauli operators for the individual spins within the and the natural dynamics emerge. Aspects of these have ith localized ensemble, which contains M spins. The z been presented in earlier work; e.g., the idea of deriv- term ωzSi describes the bare level splitting between the ing an associative memory model from coupled spins and atomic spin states. The coupling between photons and photons was discussed in Refs. [23, 24], with spin dy- spins is denoted gim = Ξm(ri)Ωg0 cos(φm)/∆A. This namics discussed in Ref. [30]. Because—as we discuss in expression involves the transverse profile Ξm(r) of the Sec.VI—the precise form of the open-system dynamics mth cavity mode and the effect from the Gouy phase is crucial to the possibility of memory recovery, we in- cos(φm); see AppendixA. For a confocal cavity, these clude a full discussion of those dynamics here to make are Hermite-Gaussian modes; their properties are exten- this paper self contained. sively discussed elsewhere [33, 35, 36, 38]. Our discussion of the spin dynamics proceeds in sev- The final term in Eq. (10) introduces a classical noise eral steps. Here, we start from a model of atomic spins source χ(t). In AppendixD, we show this coupling gen- coupled to cavity photon modes; this is derived in Ap- erates dephasing in the Sx subspace so as to restrict the pendixA. We then discuss how to adiabatically eliminate dynamics to classical states, simplifying the dynamics. the cavity modes in the regime of strong pumping and in Such noise may arise naturally from noise in the Raman the presence of dephasing, leading to a master equation lasers. In addition, such a term can also be deliberately for only the atomic spins. This equation describes rates enhanced either through increasing such noise, or by in- of processes in which a single atomic spin flips, and these troducing a microwave noise source oscillating around ωz. rates include a superradiant enhancement, dependent on We choose to consider the dynamics with such a noise the state of other spins in the same ensemble. Such dy- term to enable us to draw comparisons to other classical namics can be simulated stochastically. Finally, we show associative memories. Without such a term, understand- how, for large enough ensembles, a deterministic equa- ing the spin-flip dynamics would be far more complicated, tion for the average magnetization of the ensemble can as it would require a much larger state space, with arbi- be derived. This equation is shown to describe a discrete trary quantum states of the spins. Exploring this quan- form of steepest descent dynamics. tum dynamics, when this noise is suppressed, is a topic The system dynamics is given by the master equation: for future work, as we discuss in Sec.VIII. X This multimode, multi-ensemble generalization of the ρ˙ = −i[H, ρ] + κ L[am], (9) open Dicke model exhibits a normal–to–superradiant m phase transition, similar to that known for the single- mode Dicke model. The effects of multiple cavity where am is the annihilation operator for the mth cav- ity mode and the Lindblad superoperator is L[X] = modes have been considered for a smooth distribution 2XρX† − {X†X, ρ}. The dissipative terms describe cav- of atoms [74, 75], where it was shown that beyond- ity loss at a rate κ [69]. This is the only dissipative mean-field physics can change the nature of the tran- process we consider, as we assume the pump laser is suf- sition. In contrast, in Eq. (10) we consider ensembles ficiently far detuned from the atomic excited state that that are small compared to the length scale associated we may ignore spontaneous emission. As noted earlier, with the cavity field resolving power [76], so all atoms spontaneous emission would lead to heating, which sets a in an ensemble act identically. As such, in the absence maximum duration of the experiment. As derived in Ap- of inter-ensemble coupling, the normal–to–superradiant pendixA, the Hamiltonian takes the form of a multimode phase transition occurs independently for each ensemble generalization of the Hepp–Lieb–Dicke model [70–73]: of M atoms at the mean-field point gi,eff = gc, where 2 2 2 4Mgc = ωz(∆C + κ )/∆C , and gi,eff is the effective cou- N pling for ensemble i to a cavity supermode (a superpo- X † †  X z sition of modes coupled by the dielectric response of the H = − ∆mamam + ϕm(am + am) + ωz Si m i=1 localized atomic ensemble) [32]. The normal phase is x N N characterized by hS i = 0 and a rate ∝ M of coherent X X X + g Sx(a† + a ) + χ(t) Sx. (10) scattering of pump photons into the cavity modes. In the im i m m i superradiant phase, hSxi 6= 0, and the atoms coherently i=1 m i=1 scatter the pump field at an enhanced rate ∝ M 2. This The first two terms describe the cavity alone. We work in is experimentally observable via a macroscopic emission the rotating frame of the transverse pump: ∆m denotes of photons from the cavity and a Z2 symmetry breaking the detuning of the transverse pump from the mth cavity reflected in the phase of the light (0 or π)[31, 37, 77]. mode. We will assume that the transverse pump is red In the absence of coupling, each ensemble would in- detuned, and so ∆m < 0. We also include a longitudinal dependently choose how to break the Z2 symmetry, i.e., pumping term, written in the transverse mode basis as whether to point up or down. Photon exchange among ϕm. Such a pump allows one to input memory patterns the ensembles couples their relative spin orientation and (possibly corrupted) into the cavity QED system. modifies the threshold. When all N ensembles are phase- To describe the atomic ensembles, we introduce col- locked in this way, the coherent photon scattering into the α PM α α 2 lective spin operators Si = 1/2 j=1 σj , where σj are cavity in the superradiant phase becomes ∝ (NM) , in 12 contrast to ∝ NM in the normal phase. Throughout this In the above expression, Heff is an effective Hamilto- paper, our focus will be on understanding the effects of nian including both HHopfield and a Lamb shift contri- photon exchange, when the system is pumped with suf- bution [80], Ki(δ) is a rate function discussed below, + − ficient strength that all the ensembles are already deep and δi (δi ) are the changes in energy of HHopfield af- into the superradiant regime. The behavior near thresh- ter increasing (decreasing) the x component of collective old, and shifts to the threshold due to inter-ensemble spin in the ith ensemble. Note that although this expres- interactions, are discussed again in Sec.VIII. We now sion involves ensemble raising and lowering operations, describe how to consider the collective spin ensemble dy- the master equation describes processes where the spin namics deep in the superradiant regime. increases or decreases by one unit at a time. For brevity, To obtain an atom-only description deep in the su- we refer to these processes as spin flips below. Because perradiant regime, it is useful to displace the photon these are collective spin operators, there will be a “super- operators by their mean-field expectations for a given radiant enhancement” of these rates, as we discuss below P x spin state: am → am + (ϕm + i gimSi )/(∆m + iκ). in Sec.VB. This can be done via a Lang–Firsov polaron transforma- As mentioned above, classical noise dephases the quan- tion [78, 79], as defined by the unitary operator: tum state into the Sx subspace in which each ensemble x exists in an Si eigenstate. By doing so, the state may be  N  †   x x x x X X x am described by the vector (s1 , s2 , ··· , s3 ), where si is the U = exp (ϕm + gimSi ) − H.c. . x ∆m + iκ Si eigenvalue of the ith spin ensemble. Since Heff com- i=1 m mutes with Sx, it generates no dynamics in this subspace. (11) The dynamics thus arises solely through the dissipative Note that this remains a unitary transformation even Lindblad terms, corresponding to incoherent Sx spin-flip with the inclusion of cavity loss κ. The polaron transform events. changes both the Hamiltonian and the Lindblad parts of The energy difference, upon changing the spin of the the master equation, redistributing terms between them. P ith ensemble by one unit ±1, can be explicitly written as The transformed dissipation term remains κ m L[am], while the transformed Hamiltonian is: N X δ± = −J ∓ 2 J sx. (17) ˜ X † i ii ij j H = − ∆mamam + HHopfield j=1 m N N For the terms with j 6= i, these represent the usual ωz X −  X x + iDF,iSi + H.c. + χ(t) Si . (12) spin-flip energy in a Hopfield model. An additional self- 2 x i=1 i=1 interaction term Jii(∓2si +1) arises from the energy cost of changing the overall spin of the ith ensemble. The We define polaron displacement operators as self-interaction Jii thus provides a cost for the ith spin " # to deviate from sx = ±S , where S = M/2 is the mod- X  a†  i i i D = exp g m − H.c. , (13) ulus of spin of ensemble i. As written in Eq. (1), J F,i im ∆ + iκ ii m m is enhanced by a term β, dependent on the size of the

± y z atomic ensembles. If sufficiently large, this could freeze and Si = Si ± iSi are the (ensemble) raising and lower- x all ensembles in place, by making any configuration with ing operators in the S basis. The Hopfield Hamiltonian all sx = ±S a local minimum. However, the strength emerges naturally from this transform: i i of Jii can be reduced by tuning slightly away from con- N N focality, which smears-out the local interaction [33]. We X x x X x will see below that for the realistic parameters employed HHopfield = − JijSi Sj − hiSi , (14) i,j=1 i=1 in Sec.II, no such freezing is observed. It is important to note that the largest self-interaction energy cost occurs with the connectivity and longitudinal field given by: at the first spin-flip of a given ensemble—i.e., subsequent spin flips become easier not harder. One may also note X ∆mgimgjm X ϕm∆mgim J = − , h = −2 . that as the size of ensemble M increases, the interaction ij ∆2 + κ2 i ∆2 + κ2 m m m m strength ratio of the self-interaction to the interaction (15) from other ensembles is not affected; Eq. (17) shows all With the Hamiltonian in the form of Eq. (12), we can terms increase linearly with ensemble size. now adiabatically eliminate the cavity modes by treat- As derived in AppendixD, the functions that then de- ing the term proportional to ωz perturbatively via the termine the rates of spin transitions take the form: Bloch-Redfield procedure. As derived in AppendixD, this yields the atomic spin-only master equation 2 Z ∞ ωz h Ki(δ) = Re dτ exp − iδτ − C(τ) N   8 0 X + + − − 2 ρ˙ = −i[Heff , ρ] + Ki(δi )L[Si ] + Ki(δi )L[Si ] . X g i − im 1 − e−(κ−i∆m)τ  , (18) i=1 (∆2 + κ2) (16) m m 13 where the function C(τ) depends on the correlations of the classical noise source χ(t). It does so via Jc(ω), the Fourier transform of hχ(t)χ(0)i, using Z ∞ dω Jc(ω) 2 ωτ  C(τ) = 2 sin . (19) 0 2π ω 2 Details of the derivation of this expression are given in AppendixD, along with explicit calculations for an ohmic noise source.

A. Spin-flip rates in a far-detuned confocal cavity

We now show how the expressions for the spin-flip rate K(δ) simplify for a degenerate, far-detuned confo- cal cavity. In an ideal confocal cavity, degenerate families of modes exist with all modes in a given family having the same parity. Considering a pump near to resonance with one such family, we may restrict the mode summa- tion to that family, and take ∆m = ∆C for all modes m. In this case, the sum over modes in Eq. (18) simplifies, and becomes proportional to Jii. If we further assume ∆C  Jii—the far-detuned regime—we can Taylor ex- pand the exponential in Eq. (18) to obtain the simpler spin-flip rate function

−Jii/|∆C | 2 e Jiiωz κ Ki(δ) = h(δ) + 2 2 , (20) 8|∆C |[(δ − ∆C ) + κ ] where h(δ) is a sharply peaked function centered on δ = 0. Its precise form depends on the spectral den- FIG. 8. (a) The spin-flip rate function K(δ) in the con- sity of the noise source and is given explicitly in Ap- focal limit (solid line) versus spin-flip energy δ. Units pendixD. Classical noise broadens h(δ) into a finite- are in terms of the pump–cavity detuning |∆C |. Rates for Metropolis-Hastings (dashed line) and Glauber (dotted line) width peak. Considering experimentally realistic param- dynamics are also shown. (b) Ratio of energy-decreasing to eters, this width is at least an order–of–magnitude nar- energy-increasing spin-flip rates K(±δ) versus spin-flip en- rower than the range of typical spin-flip energies. As a ergy (solid line). Comparing finite-temperature Metropolis result, its presence does not significantly affect the dy- Hastings dynamics (dashed line) to the actual cavity dynam- namics. The main contribution to the spin-flip rate thus ics allows one to identify a low-energy effective temperature 2 2 comes from the second term, a Lorentzian centered at Teff = (∆C + κ )/4|∆C | [73, 81, 82]. δ = ∆C . Figure8(a) plots the spin-flip rate of Eq. (20). By choosing negative ∆C —i.e., red detuning—the negative offset of the Lorentzian peak from δ = 0 ensures that the system is hot (cold) when the ratio Teff /δ is much energy-lowering spin-flips occur at a higher rate than greater (less) than unity. The ratio of spin flip rates energy-raising spin-flips, thereby generating cooling dy- is shown in Fig.8(b), along with the Boltzmann factor namics. We can further define an effective tempera- using Teff defined in Eq. (21). The rate ratio shows a ture for the dynamics for spin-flip energies sufficiently small kink close to |δ| = 0 arising from the noise term, small in magnitude. To show this, we inspect the ra- but otherwise closely matches the exponential decay up tio of energy-lowering to energy-raising spin-flip rates until |δ| ' |∆C |. We may ensure the spin-flip energies K(δ)/K(−δ). To obey detailed balance—as would oc- √ are ≤ |∆C | by choosing a pump strength Ω ∝ ∆C / M. cur if coupling to a thermal bath—this ratio must be of The spin dynamics drive the system toward a thermal- the form exp(−δ/T ), where T is the temperature of the like state in this regime. bath. For small |δ|, this means one should compare the rate ratio to a linear fit: Despite the presence of an effective thermal bath, the 2 2 dynamics arising from the confocal cavity are rather Ki(δ) δ ∆ + κ ≈ 1 − ,T = C . (21) different from those of the standard finite-temperature K (−δ) T eff 4|∆ | i eff C Glauber or Metropolis-Hastings dynamics. This can be To determine whether this temperature is large or small, seen by comparing the functions K(δ) that would corre- it should be compared to a typical spin-flip energy δ: spond to these dynamics. Glauber dynamics implements 14 a rate function of the form equation: stochastic unraveling into quantum trajecto- ries [83, 84]. In this method, the unitary Hamiltonian exp(−δ/T ) dynamics are punctuated by stochastic jumps due to the KGlauber(δ) ∝ , (22) 1 + exp(−δ/T ) Lindblad operators. For our time-local master equation, the dynamics realizes a Markov chain. That is, the evolu- while for Metropolis-Hastings, tion of the state depends solely on the current spin con- ( figuration and the transition probabilities described by 1 δ ≤ 0 the spin-flip rates. Moreover, the transition probabilities K (δ) ∝ . (23) MH exp(−δ/T ) δ > 0 are the same for all spins within a given ensemble. A stochastic unraveling proceeds as follows. An initial x x x The zero temperature limits of both these functions are state is provided as a vector s = (s1 , s2 , ··· , sN ). The step functions; e.g., K0TMH ∝ Θ(−δ). These functions Lindblad terms in the master equation Eq. (16) describe plotted in Fig.8(a), taking T = Teff with an arbitrary the total rates at which spin flips occur. However, the overall rescaling to match the low-energy rate of the total spin-flip rates additionally experience a superradi- ± cavity QED dynamics. The cavity QED dynamics ex- ant enhancement from the matrix elements of Si . The hibits an enhancement in the energy-lowering spin-flip collective spin-flip rates within an ensemble are thus rates peaked at ∆ . By contrast, the rate function for C [S (S + 1) − sx(sx ± 1)] K (δ±), (24) Metropolis-Hastings dynamics is constant for all energy i i i i i i lowering spin-flips. It is nearly constant at low temper- where the upper (lower) sign indicates the up (down) flip atures for Glauber dynamics. In comparison, the cavity rate. As such, the rate of transitions within a given en- QED dynamics specifically favors those spin flips that semble increases as that ensemble begins to flip, reaching dissipate more energy—the cavity allows these spins to x a maximum when si = 0 and then decreases as the en- flip at a higher rate. As we will see in Sec.VI, this semble completes its orientation switch. The ensemble “greedy” approach to steady state significantly changes spin-flip rates are computed for each ensemble at every the basins of attraction of the fixed points. time step. To determine which spin is flipped, waiting The magnitude of Teff is a potential problem if we were times are sampled from an exponential distribution using to consider single atoms rather than ensembles of atoms. the total spin-flip up and down rate for each ensemble. 2 2 2 2 2 In such a case, Jij/Teff ' g ∆C /(∆C + κ ) . Since typi- The ensemble with the shortest sampled waiting time is cal parameters satisfy g  ∆C , κ [31], this ratio implies chosen to undergo a single spin flip. The time in the sim- that the system lies within a high-temperature regime. ulation then advances by the waiting time for that spin However, this need not be the case because we can em- flip. The process then repeats. This requires the total ploy ensembles of identical spins as our nodal element in rates to be recomputed at every time step for the dura- the network. As seen from Eq. (17), if all other ensem- tion of the simulation. Results of such an approach are x bles are assumed to have si = ±M/2, then the relevant shown in Fig.9(a). energy scale for a spin flip δi is enhanced by the num- ber of spins in the ensemble. This allows one to reach δi/Teff ∝ M  1—i.e., a low-temperature regime by C. Deterministic dynamics for large spin ensembles increasing M, the number of atoms per ensemble. The assumption that all ensembles are fully polarized is well A full microscopic description of the atomic spin states founded: As noted earlier, the on-site interactions Jii becomes unwieldy when considering large numbers of drive the spins within an ensemble to align as if the sys- atoms per ensemble. Fortunately, the large number of tem were composed of rigid (easy-axis) Ising spins. More- atoms also means the full microscopic dynamics becomes over, the spin ensemble spin-flip rates are superradiantly unnecessary for describing the experimentally observable enhanced, meaning that the time duration of any ensem- quantities. The relevant quantity describing an ensemble ble flip is short and ∝ 1/M. As described below, the is not the multitude of microscopic spin states for each superradiant enhancement also reduces the timescale re- atom, but the net macroscopic spin state of the ensem- quired to reach equilibrium. As we discuss in Sec.VIII, ble. We can therefore build upon the above treatment to to reach the quantum regime would require us to con- produce a deterministic macroscopic description of the sider M ' 1, which in turn requires enhancements of the dynamics: Our approach is to construct a mean-field de- single-atom cooperativity so that the low-temperature scription that is individually applied to each ensemble. regime may be reached at the level of single atoms per This description becomes exact in the thermodynamic node. limit Si → ∞ and faithfully captures the physics of en- sembles with ≥ 103 atoms under realistic experimental parameters. B. Stochastic unravelling of the master equation We begin by defining the macroscopic variables we use to describe the system. These are the normalized mag- x To directly simulate Eq. (16), we make use of a stan- netizations of the spin ensembles mi ≡ hSi i/Si ∈ [−1, 1] dard method for studying the time evolution of a master that depend on the constituent atoms via only their sum. 15

The mi remain of O(1) independent of Si, while fluctua- tions due to the random√ flipping of spins within the en- semble scale ∝ 1/ Si. The fluctuations about the mean- field value thus become negligible at large Si, and the mi follow deterministic equations of motion. Following the derivation in AppendixF (see also [30]), we find that the mi follow the coupled differential equations

d + − 2 mi = sgn(`i)Si Ki(δ ) − Ki(δ ) (1 − m ) dt i i i + − + Ki(δi )(1 − mi) − Ki(δi )(1 + mi), (25) P where `i = j JijSjmj is the local field experienced by the ith ensemble, given the configuration of the other en- sembles. The equations are coupled because, as defined ± P above, each δi = −Jii ∓ 2 j JijSjmj depends on all the other mj. Note that the self-interaction cost to flip- ping an atomic spin is largest for the first spin that flips within a given ensemble. The term proportional to Si in Eq. (25) describes the superradiant enhancement in the spin-flip rate. This x term would be zero if Si = 1/2, since mi = si /Si = ±1 in that case. For large ensembles this term acts to rapidly align the ensemble with the local field when |mi| < 1. FIG. 9. (a) Simulation of a system of N = 100 ensembles. All The other terms act to provide the initial kick away from are initialized in a local minimum state except five ensembles the magnetized |mi| = 1 states, but receive no super- that are flipped in the wrong orientation. Each ensemble is radiant enhancement in the spin-flip rate. A separation composed of M = 2S = 105 spins. A comparison is made be- of time scales emerges between the rapid rate at which tween dynamics derived from the equations of motion in the an ensemble flips itself to align with the local field, de- thermodynamic limit (dashed lines) and a full stochastic un- scribed by the superradiant term, and the slower rate at raveling of the master equation (solid lines). The five traces which an ensemble can initiate a flip driven by the other show relaxation of those five spin ensembles to the local min- terms. The dynamics that emerge correspond to periods imum state. The other N − 3 spin ensembles remain magne- tized at ±1 and are plotted in black. Data from the stochastic of nearly constant magnetizations |mi| = 1, punctuated master equation simulation lie close to that of the equation by rapid ensemble-flipping events mi → −mi. of motion. The timescale associated with spontaneous decay To gain analytical insight into the equations of motion, (and thus heating) is marked by a dotted vertical line; the we make use of the separation of timescales that emerges system reaches steady state beforehand. All parameters are in the large Si limit. When the ensembles are not un- as listed in Sec.II and ωz = 1 MHz. (b) The total energy ver- dergoing a spin-flip event, they are in nearly magnetized sus time, in units of S|∆C |. As expected of discrete steepest states |mi| ≈ 1 and can be approximated as constants. descent dynamics, steps are clearly visible and they occur in ± order of the energy removed per spin flip. The spin-flip energies δi and rates Ki(δ) then become constant as well. This enables one to decouple the equa- tions of motion Eqs. (25) to consider the flip process of a single ensemble. This in turn provides a simple analytical will not flip in the future unless the local field changes. solution for the time evolution of the flipping magnetiza- On the other hand, ensembles not aligned with the local tion, i field have a t0 > 0 and will flip. The ensemble with the i  + − i  smallest t > 0 will flip first. This leads to a discrete ver- mi(t) = sgn(`i) tanh Si Ki(δ ) − Ki(δ ) t − t , 0 i i 0 sion of steepest descent dynamics, since Eq. (27) implies (26) i i that the smallest t0 corresponds to the largest energy where the constants t0 are determined from the initial change |δi|. One may approximate all mi as constant conditions to be i up until the vicinity of the first t0, at which point the sgn(` m ) log(8S ) ith spin flips and alters the local fields. The approxima- ti = − i i i (27) 0 + − tion then holds again for the new local fields until the 8Si Ki(δi ) − Ki(δi ) next spin-flip event occurs. This process continues un- These approximate solutions to the equations of mo- til convergence is achieved once all ensembles align with tion accurately predict that ensembles will flip to align their local field. Overall, the mean-field dynamics takes a i with their local field, and the ordering of the t0 predicts simple form: at every step, the system determines which the order in which the ensembles will flip. Ensembles that ensemble would lower the energy the most by realigning i are already aligned with the local field have a t0 < 0 and itself, then realigns that ensemble in a collective spin- 16

flip, continuing until all δi > 0. The final configuration is probabilistic, and so fixed points can be expected to is a (meta)stable state corresponding to the minimum be more robust under SD. We also note that natural SD (or local minimum) of the energy landscape described by dynamics, such as that exhibited by the pumped cavity HHopfield. QED system, is more efficient than simulated SD dynam- Figure9(a) shows a typical instance of the dynamics ics (given an equal effective time step duration). This is described by the equations of motion in Eqs. (25) and because numerically checking all possible spin flips to de- compares it to a stochastic unraveling of the master equa- termine which provides the greatest descent is an O(N 2) tion in Eq. (16). The 107 spins are divided into 100 en- operation. Thus, interestingly, the natural steepest de- sembles, each representing an S = 105/2 collective spin. scent dynamics effectively yields an O(N 2) speed-up over We use a Jij matrix constructed from the CCQED con- simulations, by effectively computing a maximum opera- nectivity with spin distribution width w = 1.5w0. The tion over N local fields (each of which is computed via a ensemble magnetizations are initialized close to a local sum over N spins) in O(1) time. minimum configuration. Specifically, five ensembles are chosen at random and misaligned with their local field while the rest are aligned with their local field to specify A. Enhancing the robustness of classical the initial condition. We see that the five initially mis- associative memories through steepest descent aligned ensembles realign themselves to their local fields. Their convergence to the local minimum state described While the locations in configuration space of the lo- by the Jij matrix occurs before the timescale set by spon- cal energy minima of Eq. (3), or equivalently the fixed taneous emission. We also see that the mean-field equa- point attractor states of Eq. (2), are entirely determined tions of motion closely match the stochastic unraveling. by the connectivity Jij, the basins of attraction that flow We confirm that these dynamics are consistent with to these minima depend on the specific form of the en- steepest descent (SD) by considering the evolution of en- ergy minimizing dynamics. To quantify the size of these ergy, as shown in Fig.9(b). The total energy of the spin basins, we require a measure of distance between states. ensembles monotonically decreases, with clearly visible A natural distance measure is the Hamming distance, steps corresponding to spin-flip events. These steps oc- defined as follows. Consider two spin states s and s0 cur in order of largest decrease in energy. The effect of corresponding to N-dimensional binary vectors with ele- SD dynamics on the robustness of stored memories, and 0 ments si = ±1. The Hamming distance between s and s more generally on the nature of basins of attraction in PN 0 is defined as d = i=1 |si − si|/2. Thus, the Hamming associative memory networks, has remained unexplored distance between an attractor memory state and another to date. We address this question in the next section. initial state simply counts the number of spin-flip errors in the initial state relative to the attractor. This notion of Hamming distance enables us to determine a mem- VI. IMPLICATIONS OF STEEPEST DECENT ory recall curve for any given attractor state under any DYNAMICS FOR ASSOCIATIVE MEMORY particular energy minimizing dynamics. We first pick a random initial state at a given Hamming distance d In the previous section, we found that for large-spin from the attractor state, by randomly flipping d spins. ensembles, the cavity-induced dynamics is of a discrete We then check whether it flows back to the original at- “steepest descent” form; i.e., at each time-step the next tractor state under the given dynamical scheme. If so, spin-flip event of an ensemble is that which lowers the a successful pattern completion, or memory recall event, energy the most. (This is in contrast to 0TMH dynamics has occurred. We compute the probability of recall by where spins are flipped randomly provided that the spin- computing the fraction of times we recover the original flip lowers the energy.) We now explore how changing attractor state over random choices of d spin flips from from 0TMH to SD dynamics affects associative memories. the initial state. This yields a memory recall probability To understand the specific effects of the dynamics, in curve as a function of d. We define the size of the basin this section we consider both “standard” Hopfield neural of attraction under the dynamics to be the maximal d at networks with connectivity matrices Jij drawn from Heb- which this recall curve remains above 0.95. bian and pseudoinverse learning rules and Sherrington– Figure 10(a) shows memory recall curves, basin sizes, Kirkpatrick (SK) spin glasses. We find that SD not only and their dependence on the form of the energy minimiz- improves the robustness and memory capacity of Hop- ing dynamics for a Hopfield network trained using the field networks, but also gives rise to extensive basins of pseudoinverse learning rule; see Eq. (5). Three different attraction even in the spin glass regime. An introduction forms of dynamics are shown: 0TMH, SD, and the CC- to Hopfield neural networks was given in SectionIII. QED dynamics of Eqs. (25). As expected, the CCQED We will compare 0TMH dynamics, where any spin flip dynamics closely match the SD dynamics. The basin size that lowers the energy of the current spin configuration is depends on dynamics: SD and CCQED dynamics lead to equally probable versus SD dynamics, where the spin flip a larger basin of attraction than 0TMH. Indeed, the en- that lowers the energy the most always occurs. Steepest tire memory recall curve is higher for SD than 0TMH. descent is a deterministic form of dynamics, while 0TMH This increase in the robustness of the memory, at least 17

for small d, leads directly to an increase in basin size. To understand this, consider the following argument. Imag- N ine the Hamming surface of 2( d ) configurations a dis- tance d from a fixed point at the center of the surface. The recall curve p(d) is the probability the dynamics returns to the fixed point at the center of the surface when starting from a random point on the surface. Un- der 0TMH, due to the stochasticity of the random choice of spin flip that the lowers energy, many individual con- figurations on the Hamming ball could flow to multiple different fixed points, thereby lowering the probability p(d) for returning to the specific fixed point at the center of the Hamming surface. However, under the determin- istic SD dynamics, each point on the Hamming surface must flow to one and only one fixed point. Of course, many points on the Hamming surface could, in princi- ple, flow under SD to a different fixed point other than the fixed point at the center. But, as verified in simula- tions (not shown), for small enough d, more points on the Hamming surface flow under SD to the central fixed point than under 0TMH. As such, recall probability increases for small d, as indeed shown in Fig. 10(a). This deter- ministic capture of many of the states on the Hamming surface by the central fixed point effectively enhances the robustness of the memory. We can study how the SD and 0TMH dynamics affect the dependence of basin size on the number of patterns stored, and hence the memory capacity. We separately consider the two traditional learning rules, Hebbian and pseudoinverse. In both cases, we expect a trade-off be- tween the number of patterns P stored and the basin size, with the latter shrinking as the former increases. Figures 10(b,c) demonstrate this trade-off for both learn- ing rules. However, in both cases, switching from 0TMH FIG. 10. (a) Recall probability as a function of the input to SD ameliorates this trade-off; at any level of memory error applied, quantified by Hamming distance between the load, the average basin size increases under SD versus input and pattern state. This is plotted for three forms of dy- 0TMH. namics: 0TMH (red), SD (blue), and CCQED (orange). The To calculate each point, we generate P random desired µ latter is given by Eq. (25). This illustrates how the dynam- memory patterns ξ in order to construct the Jij matrix ics affects recall probability, and thus basin size (defined by according to the learning rule under consideration. For the point where the recall curve drops below 95%). We use each pattern, we determine its associated attractor state a connectivity matrix Jij corresponding to a pseudoinverse sµ. In the case of the pseudoinverse learning rule, the Hopfield model with N = 100 spins and P = 0.6N patterns attractor state associated with a desired memory ξµ is stored. We choose this learning rule because it illustrates simply identical to the desired memory. However, in the a large difference between the two dynamics. (b) Average Hebbian rule, the associated attractor state sµ is merely basin size of attractors for connectivity of a Hebbian learning µ rule. The intensity of the trace increases with system size, close to the desired memory ξ . We find this attractor µ N = 200, 400, 800, while color indicates the form of dynam- state s by initializing the network at the desired memory µ ics. The critical ratio αc ≈ 0.138 marks the known pattern ξ and flowing to the first fixed point under 0TMH. The −1 P µ µ loading threshold where Hebbian learning fails in the thermo- inset in Fig. 10(b) plots the overlap N i ξi si as a dynamic limit [16]. Inset: overlap between the attractor of function of the pattern loading α = P/N of the Hebbian µ µ the dynamics s and the bare memory ξ , as discussed in the model. This overlap is close to 1 for α < αc ≈ 0.138 and text. (c) Average basin size for the pseudoinverse learning drops beyond that, indicating that beyond capacity, the rule versus the ratio of patterns stored to number of nodes, Hebbian rule cannot program fixed points close to the P/N. Steepest descent dynamics outperforms 0TMH in all > desired memories. cases, yielding larger basin sizes for P/N ∼ 0.1, and thus, µ greater memory capacity. We focus specifically on the fixed points s to dissoci- ate the issue of programming the locations of fixed points sµ close to the desired memories ξµ from those of ex- amining the basin size of existing fixed points and the 18 dependence of this basin size on the dynamics. To de- termine the basin size for these fixed points, we compute the maximal input error for which the recall probability remains above 95%. This is performed for both learn- ing rules under both 0TMH and SD dynamics. We then average the recovered basin size over the P patterns. Figure 10(b) presents the results for Hebbian learning, and SD dynamics appears to increase the basin size for pattern-loading ratios P/N > 0.1. Note that the basin size under 0TMH is not extensive in the system size N be- yond the capacity limit P/N = αc ≈ 0.138N. However, remarkably, under SD the basin size of the fixed points sµ are extensive in N, despite the fact that the Hopfield model is in a spin glass phase at this point. Thus, the SD dynamics can dramatically enlarge basin sizes com- pared to 0TMH, even in a glassy phase. However, this enlargement of basin size does not by itself constitute a solution to the problem of limited associative memory ca- pacity, because it does not address the programmability issue; above capacity, the fixed points sµ are not close to the desired memories ξµ; see Fig. 10(b) inset. Steepest descent can only enlarge basins, not change their loca- tions. As such, for Hebbian learning, the memory capac- ity C ≈ 0.138N cannot be enhanced under any choice of energy minimizing dynamics unless an additional pro- gramming step is implemented. In contrast to Hebbian learning, the pseudoinverse learning rule does not have a programmability problem by construction. The connectivity possesses a fixed point sµ identical to each desired memory ξµ. Figure 10(c) FIG. 11. (a) Average basin size of randomly found local min- ima for the SK model using 0TMH (red) or SD (blue). The shows that SD confers a significant increase in basin size shaded region corresponds to ±1 standard deviation in the for pseudoinverse learning as well. At large P/N, the basin sizes. For each N, the basin size is averaged over 50 basin sizes under SD are more than twice as large as un- realizations of Jij matrices, with 500 random initial states der 0TMH dynamics. per Jij realization. (b) Histogram of basin sizes using 0TMH (red) and SD (blue) for the N = 1000 data plotted in (a). The mean basin size for SD is marked by the vertical dashed B. Endowing conventional spin glasses with line. associative memory-like properties

Basin sizes do not typically scale extensively with N ture. Rather than compute a uniform average over all under 0TMH dynamics. This is because the number of metastable states of the Jij matrix—a task that is nu- metastable states grows exponentially (in the system size merically intractable for large system sizes—we instead N) in both the Hopfield model (with Hebbian connectiv- sample metastable states by initializing random initial ity for P/N  0.138) and in the SK spin-glass model [85]. states and letting those states evolve under 0TMH dy- However, we now present numerical evidence that SD namics. Once a metastable state is reached, the basin dynamics endows these same energy minima with basin of attraction is measured under both 0TMH and SD dy- sizes that exhibit extensive scaling with N, even in a namics as discussed above. pure SK spin glass model. Thus, we find that the SK Figure 11(a) plots the average basin size as a func- spin glass, under the SD dynamics, behaves like an as- tion of the system size N, averaging both over realiza- sociative memory with an exponentially large number of tions of Jij matrices and over the random initial states. memory states with extensive basins. (A programming Under 0TMH dynamics, the mean basin size decreases step would be required; see Sec.VIIB.) with increasing N, approaching zero at large N. This More quantitatively, we numerically compute the size shows that for 0TMH dynamics, metastable states of of basins present in an SK spin glass using both kinds the spin glass become very fragile, as expected from a of dynamics; see Fig. 11. Connectivity matrices Jij traditional understanding of metastable states in a spin are initialized with each element drawn, i.i.d., as Gaus- glass. In contrast, for SD dynamics, the average basin sian random variables of mean zero and variance 1; nor- size scales extensively with system size in a roughly lin- malization of the variance is arbitrary at zero tempera- ear fashion. A phenomenological fit results in scaling of 19

0.0135(1)N + 0.91(7). problem, which involves converting the patterns we wish These results help reveal the structure of the energy to store into the patterns that naturally arise as local en- landscape. Vanishing basin size under 0TMH implies ergy minima with large basins of attraction. Our pattern that a single spin-flip perturbation is sufficient to open storage scheme is applicable to any connectivity matrix new pathways of energy descent to different local minima. Jij. We verify its performance for the CCQED connec- As soon as such pathways exist, 0TMH will find them, tivity matrix both in the associative memory regime and leading to vanishing basin size. For SD, we however see the in SK spin glass regime. that the steepest path of energy descent is almost al- ways the one leading back to the original local minimum that was perturbed, as long as the number of spin flips A. Basins of attraction with confocal cavity QED is less than about 0.0135N. This picture explains how connectivity metastable states are stable against small perturbations under SD, but unstable under 0TMH. We now examine the basin size of the metastable states The extensive scaling of basin sizes found for SD dy- found in Sec.IV by tuning the width w of the distribu- namics not only means that metastable states with a tion of ensemble positions. We measure the basin size of finite basin of attraction exist, but in fact suggest the metastable states just as we did in Fig. 10 for Hopfield number of such states is exponential in system size, far models and Fig. 11 for the SK model—by the relaxation greater than the capacity of any typical associative mem- of random perturbations. In particular, a random CC- ory. While sampling metastable states via relaxation of QED connectivity matrix J is realized by sampling the random initial states under the standard 0TMH dynam- spin ensemble positions from a 2D Gaussian distribution ics does not yield a uniform sampling, Fig. 11(b) shows of fixed width w. A large number of random initial states that nearly all such discovered metastable states have a are then prepared and allowed to relax via the native finite basin of attraction under SD dynamics. The distri- SD dynamics to a metastable state. The basin size of bution is peaked away from zero basin size, whereas with that metastable state is then found by initializing nearby 0TMH the distribution is strongly peaked around zero. random states and estimating the probability that these This suggests that extensive basin sizes under SD dynam- perturbed states evolve back to the metastable state as ics may be a property of almost all metastable states in a function of the Hamming distance of the perturbation. the SK spin-glass. Figure 12 shows how the basin size evolves with w for We conclude that the SK spin glass enhanced with SD the CCQED connectivity. For each width w, the mea- dynamics operates, remarkably, like an associative mem- sured basin sizes are averaged over many realizations of ory, with exponentially many spurious memories. These the CCQED matrices J, with 200 random initial states memories are random and non-programmable via any ex- per matrix. The number of realizations of J required for isting learning rule, but have extensive basins of attrac- convergence varies with N, ranging from 1,600 realiza- tion, tolerating up to 0.0135N input errors on average tions for N = 3 spins to 32 realizations for N = 800 while maintaining a 95% probability of recall. While this spins. This is due to self-averaging at large system size. basin size is small compared to that of stored patterns in Figure 12(a) presents the average basin size as a function standard associative memories—cf. Fig. 10—it is never- of w, using both the native SD dynamics and 0TMH for theless extensive and there are exponentially more such comparison. A sharp decrease in basin size occurs near memories than in standard Hopfield networks. the ferromagnetic–to–associative memory transition at wAM ≈ 0.67w0. For 0TMH dynamics, the mean basin size per spin quickly falls to zero after crossing wAM. VII. ASSOCIATIVE MEMORY IN PUMPED Remarkably, however, steepest descent dynamics yields CONFOCAL CAVITIES larger basins beyond wAM. These are extensive in size. Thus, just as in the case of the Hopfield model beyond ca- We have thus far shown in Sec.IV that CCQED sup- pacity and in the SK spin-glass, switching from 0TMH to ports a large number of metastable states, and in Sec.V SD dramatically expands the size of basins from nonex- 0.4 that the natural cavity QED dynamics produces a dis- tensive to extensive. Moreover, there exist O(eN ) crete steepest descent (SD) dynamics in energy. In metastable states in this regime, which is less than the Sec.VI, we showed that SD dynamics can enhance the O(eN ) expected of a spin glass; see Fig.5. Overall, this robustness of memory when applied to traditional Hop- demonstrates that a confocal cavity in this intermediate field models, and moreover, can endow the SK spin-glass width regime functions as a high-capacity, robust associa- with associative memory-like properties. tive memory with many metastable states with extensive In this Section, we pull these key elements together to basin sizes, albeit with random non-programmable mem- demonstrate how robust associative memory can be cre- ories. For larger widths, the average basin size asymp- ated in a transversely pumped confocal cavity. We begin totically reduces to that exhibited in the SK model. This by showing that metastable states in such systems in- observation, when combined with the analysis of Sec.IV, deed possess large basins of attraction. We then develop provides further evidence that the confocal cavity con- a method to solve the addressing, or programmability nectivity yields an SK spin glass at large width. 20

connectivity. In contrast, for the Hopfield model with the Hebbian connectivity of Eq. (4), we can place en- ergy minima close to up to 0.138N desired points ξµ in configuration space, as long as these points are random and uncorrelated. Also, the more complex pseudoinverse rule of Eq. (5) enables us to place local energy minima at N arbitrary points (though there is no guarantee of any minimal basin size if some points are close to each other). We now show how to effectively program the CCQED system to store any desired patterns using an encoder that translates the desired patterns to be stored into the non-programmable patterns that are naturally stabilized by the intrinsic cavity dynamics. While the pattern stor- age scheme we present here is designed with the physics of CCQED in mind, we note that the method is also appli- cable to any Hopfield or spin-glass like network connec- tivity with non-programmable energy minima with ex- tensive basin sizes. The basic idea behind the encoder is to find a linear transformation that maps any set of desired patterns, as FIG. 12. (a) The average basin size in the CCQED system represented by light-fields, into metastable spin config- versus width of the spin ensemble distribution w. Metastable urations of the cavity. Once found, this transformation states are found by relaxing random initial seeds. Basin sizes is then applied to any input state (i.e., light field) be- for both 0TMH dynamics (red) and the (native) SD dynam- fore allowing the confocal cavity network to dynamically ics (blue) are shown. System sizes ranging from N = 3 to N = 800 are considered, with darker traces corresponding to evolve to a metastable state. The (optical) output can larger sizes. We extrapolate to the limit N → ∞ by fitting a then undergo an inverse transform, back into the original linear function of 1/N to the finite N data. The intercept at basis. In this way, we harness the dynamics of the CC- 1/N = 0 yields the thermodynamic limit (dashed lines). The QED spin network to store general patterns, and recall ferromagnetic–to–associative memory phase transition, indi- them through pattern completion, without ever needing cating the onset of multiple metastable states, is marked by a to change the CCQED connectivity matrix. vertical black dashed line at wAM. The green line shows the To formally define the properties required of the trans- typical basin size under SD dynamics for the SK connectivity, formation, M, we consider a set of patterns that we wish 0.0135(1)N, as extracted from Fig. 11. (b) Histogram of the to store, {Ξp} for p = 1 to P . We require that there are basin sizes found for widths w = 1.5w and w = 4w . 0 0 at least P metastable states of the Hopfield energy land- scape {Φ˜ p} that need to be found and cataloged. These Figure 12(b) shows examples of the distribution of may be found by, e.g., allowing random initial states to basin sizes under SD dynamics for widths 1.5w and 4w . relax—note that there may be more than P such states. 0 0 For an arbitrary input state x, the network operates as For w = 1.5w0, the variance in basin sizes is large despite a small mean size of ∼0.05N. Pattern completion is ro- follows: bust in this regime for a large percentage of basins since 1. The input state x is transformed to an encoded many exceed 0.1N in size. For w = 4w0, the basin size state x˜ = M(x). The transformation should distribution is narrower, but still peaked away from zero. smoothly map the desired pattern states onto However, nearly all basins sizes are less than 0.1N, as metastable states of the Hopfield network: we thus expected in the spin glass regime; see Fig.4(c). require M(Ξp) = Φ˜ p for all p.

2. The Hopfield network is initialized in the encoded B. Solving the programmability problem: a scheme state x˜ and allowed to evolve to a metastable state for memory storage y˜.

We have demonstrated the presence of many 3. The evolved state y˜ is then subject to an inverse metastable states with large basins of attraction (of ex- transformation M−1. The final output is y = tensive size) in the transversely pumped CCQED sys- M−1(y˜). The transformation M−1 should map the tem. Such a system evidently manifests a robust recall metastable states of the energy landscape back onto phase with a large number of random memories. How- the pattern states so that M−1(Φ˜ p) = Ξp. Note ever, these memories are not directly programmable, in that M−1(M(Ξp)) = Ξp, so that M and M−1 act the sense that we cannot place the local energy minima as inverse transformations when acting on pattern wherever we wish in configuration space by tuning the states. 21

We now discuss how to find the smooth transforma- tions M and M−1 obeying the properties above. The simplest option is a linear transformation, for which we should define M(x) = M · x, where M is the matrix that minimizes the error function

P 2 X p ˜ p 2 E = M · Ξ − Φ + λ||M|| . (28) p=1

Here, || · || is the Hilbert-Schmidt norm. The terms in the sum ensure that the patterns are mapped to the metastable states of the cavity QED system. However, this requirement under-constrains M for P < N. To remedy this, we add the term λ||M||2 to penalize large el- ements of M; λ is a regularization hyperparameter. This least-squares problem can be solved analytically, yield- FIG. 13. Average basin size of patterns stored in a CCQED ing: system as a function of P/N using the linear transformation encoding scheme (yellow). Results are shown for N = 800, however similar results are found for system sizes of N = 50– P P −1  X ˜ p pT  X p pT  800. For comparison, the average basin sizes are plotted for M = Φ Ξ λ1 + Ξ Ξ . (29) the Hebbian (red) and pseudoinverse (blue) learning methods. p=1 p=1 In each case, we show the results of both SD (solid) and 0TMH (dashed) dynamics; w = 1.5w0. While this solves the linear transform problem, the linear encoding itself has a problem that we must address. Spin configurations x˜ should correspond to vectors whose ele- ments are ±1, corresponding to the magnetization of the We numerically benchmark the encoded pattern stor- Sx components of the spin ensembles. We require that age method with the CCQED connectivity and SD dy- the output of the transformation takes this form. Thus, namics that are present in the cavity. Fixing the sys- we must modify the encoding so that the full transforma- tem size N, we generate P random patterns to store in tion for an arbitrary input state is M(x) = sgn(M · x), the cavity. Because the CCQED connectivity hosts a where the sign function is understood to be applied large number of metastable states with large basins in the element-wise. regime 0.7w0 ≤ w ≤ 2w0, we set the width w to 1.5w0 The encoder matrix defined in Eq. (29) will not be and construct a connectivity matrix. Metastable states invertible, in general. However, by simply reversing the are cataloged by relaxing P random initial seeds using roles of the patterns and cavity minima in constructing SD. (Note that this procedure is biased toward selecting the encoder matrix, we can construct a corresponding metastable states with the largest basins of attraction; decoder matrix that maps the metastable states back to these are preferable for our scheme.) This is then fol- the desired patterns: lowed by construction of the encoder and decoder using Eqs. (29) and (30). The basin sizes of the pattern states P P are determined by applying increasing amounts of input  X  X −1 M−1 = ΞpΦ˜ pT λ1 + Φ˜ pΦ˜ pT . (30) error to the patterns until the probability of recall drops p=1 p=1 below 95%. Figure 13 compares the performance of encoding mem- The memory capacity of an associative memory is typ- ories onto the metastable states of the CCQED connec- ically defined as the maximum number of patterns that tivity against the results of Hebbian and pseudoinverse can be stored as metastable states of the energy land- learning. The average basin size of our CCQED scheme scape. Under this standard definition, at most N to- is larger than Hebbian learning. The results do not de- tal patterns can be mapped exactly onto attractor states pend strongly on system size. For the CCQED scheme, of the CCQED connectivity because the transformation extensive basin sizes are indeed observed up to the max- map is linear. This means that the maximum memory imum P = N stored patterns. This memory capacity capacity of the encoded confocal cavity is N, which is the represents roughly an order–of–magnitude improvement same as that of the pseudoinverse learning method, but over the standard Hebbian learning model (0.138N) and significantly outperforms Hebbian learning with its ca- coincides with the pseudoinverse learning rule. The basin pacity of ∼0.138N. However, a more practical definition sizes in CCQED are not as large as pseudoinverse learn- of capacity would depend also on the size of the basins ing, though they are more physically realizable. Note of attraction, and hence the robustness of the stored pat- that for the Hebbian learning, we measure recall as the terns. We now verify the memory capacity of N account- probability of recovering the desired memory. As such, ing for basin size. the drift of local minima from the desired patterns con- 22 tributes to the collapse of basin size at P/N = 0.138. Remarkably, we find that for memory loading ratios P/N ≤ 0.4, the average basin size with the encoding and decoding transformation significantly exceeds 0.1N. This is notable because earlier we found that the average basin sizes are less than 0.1N at this width, w = 1.5w0; see Fig. 12. It seems that the encoding and decoding transformations significantly enhance the robustness of the associative memory. Inspection of the form of the linear transformation reveals that it focuses the P < N input states onto a subset of the metastable states and vice-versa for the decoder matrix. This effectively gives it a head start by reducing the Hamming distance between perturbed input states and the nearest metastable state. The pattern storage scheme also works in the SK spin glass regime, either as applied to the CCQED connec- tivity at large w or to the actual SK model. In both cases, N memories may be stored. The linear transfor- mation scheme is thus quite flexible: it is applicable to any model with extensively scaling basins of attraction. An interesting challenge for future work would be to see if it is possible to extend the current scheme to nonlinear mappings between pattern states and attractors in order to achieve a superextensive scaling of the memory capac- ity with system size N. This would provide a physically FIG. 14. The effect of weight chaos in experimental parameter realizable fully programmable associative memory with regimes,√ using an ensemble placement uncertainty of 1 µm and capacity well beyond the P = N pattern limit. In this 1/ M fluctuations in atom number. The drift of metastable case, the fact the SK spin glass possesses an exponential states between different realizations of noise weights is plotted number of metastable states with extensive basin sizes in (a) as a function of the width w of the ensemble distribution under SD dynamics could become particularly relevant and for different system sizes N (see legend in panel b). The 0 for associative memory applications. states s and s refer to metastable states of two realizations J and J0, as described in the text. b) The direct change in the J connectivity matrix is plotted as a function of the width.

C. Weight chaos and the robustness of memory patterns sures of weight chaos and its effect, as a function of the ensemble distribution width w. First, we quantify how Considering the practical implementation of the asso- metastable states drift between realizations. To do so, we ciative memory, an important question is that of ‘weight- take a particular J matrix and find a metastable state s chaos’ [86–89]. This is the problem that, for standard by allowing a random initial state to relax via SD. We Hopfield learning rules, flipping the sign of a few (or even then realize a weight matrix J0 that is nominally the same one) Jij matrix element can result in a model with a as J but has added to it a particular realization of posi- completely different set of metastable states. This arises tion and atom number noise. The state s is then allowed due to the chaotic nature of glassy systems. In our case, to again relax via SD to a potentially new state s0 to see weight chaos can arise from two sources. Imprecision if it has drifted. The overlap s · s0/N quantifies this drift in the placement of spin ensembles leads to fluctuations and is shown in Fig. 14(a) for many realizations. In the in the positions ri and thus in the nonlocal interaction second measure, we directly quantify the change in the 2 Jij ∼ cos 2ri · rj/w0 . Additionally, atom number fluc- weights as a percentage of their original values via the tuations per spin ensemble can occur between experi- quantity J − J0 / J , where · denotes the Hilbert- mental realizations,√ leading to fluctuations in Jij pro- Schmidt norm of the matrix. portional to 1/ M. Neither of these can change the sign Figure 14 demonstrates that metastable states are ro- of large Jij elements, thereby avoiding the most severe, bust against drift for widths less than approximately w0, randomizing repercussions of weight chaos. which includes the ferromagnetic and associative memory The effect of weight chaos is numerically explored in regimes of the confocal connectivity. Greater than 98% Fig. 14 under experimentally realistic parameters. We overlap between experimental realizations are expected. consider an uncertainty of 1 µm in the placement of spin The overlap begins to drop for widths beyond w0 as the ensembles and fix the total number of atoms in the cav- connectivity transitions to a spin glass, because the non- PN 6 ity at i=1 M = 10 independent of the number of en- local connectivity becomes increasingly sensitive to posi- sembles considered. We then present two different mea- tion at larger radii. The overlap decreases with increasing 23 system sizes in this regime up to the maximum N = 400 model. Nevertheless, we find a straightforward pattern ensembles probed in simulations. Atom number fluctua- storage scheme for encoding memories in this physical tions set a floor on weight chaos that is independent of system that allows N memories to be stored with a ro- w. This is visible in Fig. 14(b) for small w. The noise bust pattern completion process that tolerates an exten- floor rises with increasing N since M must decrease in sive number of initial errors. Remarkably, the emergent order to fix the total atom number. A few percent devi- SD dynamics of the physical system extend the effective ation in Jij is acceptable for heuristic solvers, replacing basins of attraction to enable robust recall. In terms of one ‘good-enough’ solution with another. Position uncer- memory capacity, the system significantly outperforms tainty will likely be smaller than 1 µm, so these results Hebbian learning. present a conservative picture. The multimode cavity QED platform is distinctive among annealing-based optimization schemes for its nonequilibrium dynamics. In “traditional” annealing ap- D. Experimental implementation proaches, the system either undergoes classical equilib- rium dynamics in a potential landscape [91], or uni- We now present practical details of how the CCQED tary quantum dynamics remaining close to the ground associative memory can be initialized in a particular (dis- state [92]. In the CCQED system, the optimization oc- torted) memory state. One may initialize the spin en- curs by the intrinsic dynamics of a driven-dissipative sys- sembles via longitudinal pumping to an arbitrary (en- tem. By contrast, in equilibrium contexts, any coupling coded) x˜, wherex ˜i = ±1 is the magnetization of the ith to the outside world disrupts the system: dissipation ensemble. As seen in Eq. (14), the spins can be sub- must be overcome in these approaches, not embraced as jected to a field hi created by longitudinally pumping in the present scheme. the cavity. Physically, this is possible because in a con- Confocal cavity QED can be compared to other focal cavity, resonant light with any transverse profile gain-based optimization schemes. These include weak- (up to the resolving capability of the cavity mirrors) is coupling, optics-based “coherent Ising machines.” These supported due to the degeneracy of all TEMlm modes of have explored the notion that optimization problems good parity. If the longitudinal pumping is sufficiently can be heuristically solved using the dissipative cou- strong, i.e., ϕi > Jij, then the energy of spin flips δi will pling between multiple optical parametric oscillators be dominated by this field. By choosing sgn(ϕi) =x ˜i, (OPOs) [45, 46, 93, 94]. The steady-state pattern of the SD dynamics will evolve the spin ensembles into state x. oscillator phases that develops at threshold manifests the The fact that only the pattern of signs matter for large solution to this problem. This occurs because the cou- fields presents a natural implementation of the threshold pling of OPOs is chosen so that the pattern of oscilla- operation employed in the encoding M(x). The longitu- tion with lowest threshold corresponds to the solution dinal pump is turned off once the state has been ini- of the optimization problem. As such, as one increases tialized, thereby allowing the system to evolve to the the pumping, this lowest threshold solution appears first. nearby metastable state determined by the connectivity Similar ideas have also been explored in coupled polari- Jij alone. ton condensates [47] and lasers [95]. Many schemes would suffice for implementing the en- There are, however, crucial limitations to these weakly coding and decoding transformations mentioned above. coupled optical gain-based optimizers: the output spin The transformation can be accomplished most simply states correspond to coherent photon states, which only electronically. In this scheme, a new longitudinal field is emerge as one crosses the threshold. This means that optically constructed based on the electronically trans- near threshold, the spins are “soft,” allowing defects to formed state. Similarly, after imaging the cavity light, form [96]. In addition, because photon number is not con- the decoder matrix would be applied electronically to served, photon intensity in each node can change, leading yield the final output state from the experiment. Alter- to dynamic changes in the Jij weights defining the prob- natively, an all optical implementation can be achieved lem [97]. This requires the addition of classical feedback using spatial light modulators or other methods [90] if to control these populations [98, 99][100]. By contrast, coherence in the field must be preserved. the multimode cavity QED system has a nearly constant number of atoms per ensemble, so the connectivity ma- trix Jij remains stable. The spin variables are well de- VIII. DISCUSSION fined far above the superradiant threshold: the superra- diant enhancement of the dynamics forces ensembles to We presented a practicable quantum-optical system flip as one collective spin. We also point out that while that can serve as a neural network for associative mem- the fully quantum limit of the CCQED system consists ory. It does so by exploiting the natural spin coupling and of a single strongly coupled atom at each position and so superradiant dynamics provided by a CCQED system. the state space becomes that of spin 1/2 particles, in con- The physical system lacks the direct correspondence be- trast, the photonic or polaritonic coherent Ising machines tween memories and the connectivity matrix that makes possess (continuous) bosonic Hilbert spaces. simple the learning of patterns in the idealized Hopfield An important challenge for future work is to extend 24 the present treatment into the fully quantum realm. This external stimuli to natively occurring internally gener- could be done by suppressing the dephasing we used to ated patterns. Further exploitation of these glassy states favor classical states, tuning pump strength near to the through nonlinear encoders remains an intriguing direc- superradiant phase transition, and by considering few tion for future work. spins per ensemble. As noted earlier, currently we re- Interestingly, in biological neural systems, multiple quire a large number of atoms per ensemble to overcome brain regions, like the hippocampus and the cerebellum, heating; an alternative would be to design a configura- that are thought to implement associative memories, are tion with enhanced single-atom cooperativity. While the synaptically downstream of other brain regions that are 87 cooperativity of a single Rb atom coupled to TEM00 thought to recode sensory representations before memory 2 mode is C = g0/2κγ = 2.5 [31], our system should al- storage; see, e.g., [103] for a review. Such brain regions ready benefit from an enhanced cooperativity for an atom could play the role of an encoder that learns to trans- coupled to many degenerate modes with nonzero field late sensory stimuli into natively occurring memory pat- amplitude at its location. The single-atom cooperativity terns, in analogy to our storage framework. Moreover, is enhanced by the number of degenerate modes, due to there has been some neurobiological evidence that na- the formation of a ‘supermode’ with larger electric field at tively occurring neural activity patterns observed before the atom’s position [32, 33]. The confocal cooperativity an experience are themselves used to encode that new is therefore far greater than unity; preliminary measure- experience [104, 105], though there is debate about the ments suggest it is approximately 50 [33]. If achieved, prevalence of this observation [106]. Of course, if neu- this would allow quantum entanglement to play a role in robiological memory encoding does indeed select one of the dynamics [101], enabling the exploration of the be- a large number of latent, preexisting stable activity pat- havior of a fully quantum nonequilibrium neural network. terns in order to encode a novel stimulus, it may be very Whether and how entanglement and quantum critical difficult to experimentally observe such a stable activity dynamics at the superradiant phase transition provide pattern before presentation of the stimulus, due to lim- superior heuristic solution-finding capability remains un- ited availability of recording time. Thus, our work sug- clear. Specific questions of interest include how entangle- gests it may be worth explorations beyond the Hopfield ment might affect memory capacity or retrieval fidelity. framework for memory storage, in which the internal rep- We leave these questions for future exploration. Beyond resentations of memories are determined not only by the quantum neuromorphic computing, such systems might nature of sensory stimuli themselves, but also by the very be able to address quantum many-body problems [102]. the nature of natively occurring potential stable memory states that exist, but are not necessarily expressed, before Finally, we note that our pattern storage and recall the onset of the stimulus. scheme provides a novel shift in paradigm from the tra- Thus overall, by combining the biological principles of ditional Hopfield framework of memory storage. Indeed neural computation with the intrinsic physical dynamics in this traditional framework, desired memories, as de- of a CCQED system, our work leads to enhanced associa- termined by network states driven by external stimuli tive memories with higher capacity and robustness, opens (i.e., the patterns ξµ in Sec.III) are assumed to be di- up a novel design space for exploring the computational rectly stabilized by a particular choice of connectivity capabilities of quantum-optical neural networks, and em- matrix J. For example, the Hebbian rule (Eq. (4)) and powers the exploration of a novel paradigm for memory the pseudoinverse rule (Eq. (5)) are two traditional pre- storage and recall, with implications both for how we scriptions for translating desired memories ξµ into con- might computationally harness the energy landscapes of nection patterns J that engineer energy minima at or glassy systems, as well as explore novel theoretical frame- near the desired memories. In contrast, the steepest de- works for the neurobiological underpinnings of memory scent dynamics in our system reveals that random choices formation. of connectivity J, whether originating from the CCQED system, a glassy Hopfield model beyond capacity, or re- markably, even the canonical SK spin glass, yield Ising systems possessing exponentially many local energy min- ACKNOWLEDGMENTS ima with extensive basin size. Indeed, our storage scheme exploits this intrinsically occurring multiplicity of robust We thank Daniel Fisher and Hideo Mabuchi for stimu- minima simply by mapping external stimuli ξµ to them, lating conversations and acknowledge the Army Research rather than creating new minima close to the external Office for funding support. The authors wish to thank stimuli. To date, this computational exploitation of the NTT Research for their financial support. We would also exponential multiplicity of local energy minima in glassy like to thank the Stanford Research Computing Center systems has not been possible because of their subexten- for providing computational resources, especially access sive basin size under traditional 0TMH or Glauber dy- to the Sherlock cluster. Y.G. and B.M. acknowledge namics. By contrast, the intrinsic physical dynamics we funding from the Stanford Q-FARM Graduate Student have discovered in the CCQED system directly enables Fellowship and the NSF Graduate Research Fellowship, us to computationally harness the exponential multista- respectively. J.K. acknowledges support from the Lev- bility of glassy phases, by using an encoder to translate erhulme Trust (IAF-2014-025), and S.G. acknowledges 25 funding from the James S. McDonnell and Simons Foun- for a multimode cavity can be obtained by summing up dations and an NSF Career Award. the contributions from the transverse modes. In the appropriate rotating frame [34], the total Hamiltonian H = H↑ + H↓ + Hcavity + HRaman is given by Appendix A: Raman coupling scheme and effective Hamiltonian Z h pˆ2 i H = d3xψˆ†(x) + V (x) + ω ψˆ (x) ↑ ↑ 2m trap z ↑ The effective multimode Dicke model in Eq. 10 may be Z 2 engineered by coupling two internal states of 87Rb to the 3 ˆ† h pˆ i ˆ H↓ = d xψ (x) + Vtrap(x) ψ↓(x) cavity fields as proposed in Ref. [51]; see Fig.2. The ↓ 2m scheme has been demonstrated in the dispersive limit X † Hcavity = − ∆mamam (yielding an effective Ising model) using a cavity capa- m ble of multimode (confocal) operation [34]. The states Z X 3 h − ˆ† ˆ † |F = 2, mF = −2i ≡ |↑i and |F = 1, mF = −1i ≡ |↓i are HRaman = d x ηm(x)ψ↑(x)ψ↓(x)am coupled through two cavity-assisted two-photon Raman m processes depicted in Fig.2. The two states |↑i and |↓i + ˆ† ˆ † i + ηm(x)ψ↓(x)ψ↑(x)am + h.c. , (A5) are separated in energy by ωHF due to hyperfine split- ting and Zeeman shifts in the presence of a transversely oriented magnetic field. Typical experiments employ a where ψˆ† are the spinor wavefunction for the atomic magnetic field of ∼2.8 G. The hyperfine level splitting is ↑,↓ states, Vtrap is the trapping potential, and the cavity as- ωHF ≈ 6.8 GHz. The cavity resonance frequency ωC is sisted Raman coupling strength has spatial dependence detuned from the atomic excited state 52P by ∆ and 3/2 + given by the cavity mode profile Φm and the standing- ∆−, respectively, for states |↑i and |↓i. Two standing- wave pump along the x-direction wave transverse pump beams with Rabi frequencies Ω± realize the two cavity-assisted Raman processes. The op- √ 3g0Ω± tical frequencies of the pump beams ω± are given by ± ηm(x) = Φm(r, z) cos(kx). (A6) 12∆± 1 (ω+ − ω−) = ωHF − ωz 2 The two Raman processes can be balanced by controlling 1 (ω + ω ) = ω + ∆ , (A1) the pump beam power such that 2 + − C C √ √ where ω is the two-photon Raman detuning and ∆ is 3g Ω 3g Ω z C 0 + = 0 − ≡ η. (A7) the detuning of the mean frequency of the pumps from 12∆+ 12∆− the cavity resonance. To derive the model in Eq. (10), we extend the results To remove the kinetic energy dependence and the spa- and experimental setup in Ref. [34] to the present case of tial oscillation of the Raman coupling strength, we pro- a multimode cavity of confocal configuration. The field pose the following trapping scheme for Vtrap(x): first profile of a single cavity transverse mode with mode index introduce optical tweezers to tightly confine atoms in m = (l, m) in a cavity of length L is given by separate ensembles in different locations ri in the cav-   r2   ity transverse plane but at the midpoint of the cavity Φm = Ξm(r) cos k z + − θm(z) , (A2) axis z = 0; then superimpose on the optical tweezers a 2R(z) deep 2D optical lattice with periodicity of 780 nm along with both the pump and cavity direction to add a potential 2 2 Vlattice ∝ cos (kx/2) + cos (kz/2). Under the combined θm(z) = ψ(z) + nm [ψ(L/2) + ψ(z)] − ξ trapping potential, the spinor wavefunction can be ex- panded as as sum of individual ensembles  z  ψ(z) = arctan (A3) z R ˆ X p 2 ψ↑↓(x) = Z(z) ρ(r − ri)× zR R(z) = z + . (A4) i,ν z i p ˆ [1 + cos(kx)][1 + cos(kz)]ψ↑↓,ν , (A8) Here, ξ is a phase offset fixed by the boundary con- i dition that the light field vanishes at the two mirrors where Z(z) and ρ(r) describe the spatial confinement of z = L/2, nm ≡ l + m is the sum of the two trans- an ensemble by the optical tweezers trap, νi indexes indi- verse indices, k = 2π/λ780 nm is the wavevector of the vidual spins inside an ensemble indexed with i, and ψˆ pump and cavity light, and zR = L/2 is the Rayleigh ↑↓,νi range of a confocal cavity. Under the Raman cou- is the spin operator for a single atom νi. pling scheme, the light-matter interaction Hamiltonian For each ensemble with M atoms, we define collective 26 spin operators convolution of the nonlocal interaction, proportional to 2 cos 2ri · rj/w0 , with the ensemble density profiles ρi(x): M X † † z ˆ ˆ ˆ ˆ 2   Si = (ψ↑,ν ψ↑,νi − ψ↓,ν ψ↓,νi )/2 −g˜ ∆ Z x · y i i J = 0 C dxdyρ (x)ρ (y) cos 2 . νi=1 ij 2 2 i j 2 π(∆C + κ ) w0 M X (B1) Sx = (ψˆ† ψˆ + ψˆ† ψˆ )/2. (A9) i ↑,νi ↓,νi ↓,νi ↑,νi The ensemble densities may be approximated by Gaus- ν =1 i sian profiles centered at positions ri of width σA. We then find the effective nonlocal interaction Taking the assumption that the width σA of the atom profile Z(z) and ρ(r) satisfies the condition λ  780 nm −g˜2∆  w2r · r  σ  z , we can perform the spatial integral along z and 0 C 0 i j A R Jij = 2 2 cos 2 4 4 drop the oscillatory terms along x. The Raman coupling π(∆C + κ ) w0 + 4σA term becomes w4 −2σ2 (|r |2 + |r |2) × 0 exp A i j . (B2) (w4 + 4σ4 ) w4 + 4σ4 N 0 A 0 A X X x † HRaman = gimSi (am + am), (A10) The effect of this convolution is to rescale the term inside m i=1 the cosine and dampen the amplitude of Jij for ensembles where the coupling strength between the ith ensemble located far from the cavity center. The unconvolved non- local interaction is recovered in the limit of small σA/w0. and mth cavity mode gim is given by In current experiments, σA is at least an order of magni- η Z tude smaller than w0, thus we consider the unconvolved g = d2r Ξ (r)ρ(r − r ) cos(n π/4), (A11) im 2 m i m nonlocal interaction in this work. and we assume that different ensembles are separated in space with negligible overlap. Appendix C: Derivation of confocal cavity QED Putting this together, the CCQED system can be mod- connectivity probability distribution elled by a master equation: We now derive the probability distribution and cor- X ∂tρ = −i[HCCQED, ρ] + κL[amρ]. (A12) relations of the Jij matrices for the CCQED system m with a Gaussian distribution of atomic positions. We re- call that the photon-mediated interaction takes the form 2 Here, we account for cavity field loss at rate κ by Lind- Jij ∝ cos 2ri · rj/w0 , where w0 is the width of the † † blad superoperators L[X] = XρX − {X X, ρ}/2, where TEM00 mode. We consider spin ensemble positions ri am is the annihilation operator for the mth cavity mode. to be randomly distributed according to a 2D isotropic The Hamiltonian of the CCQED system HCCQED is Gaussian distribution, centered at the origin of the cav- given by ity transverse plane and with a standard deviation w. T Explicitly, ri = (ri,x, ri,y) , where ri,k is a Gaussian ran- X  † †  dom variable with mean 0 and variance w2. To find the HCCQED = − ∆mamam + ϕm(am + am) m probability distribution of Jij, we proceed by first finding N N the probability distribution for ri · rj = ri,xrj,x + ri,yrj,y, X z X X x † the dot product of 2D Gaussian random variables. We + ωz Si + gimSi (am + am). (A13) i=1 i=1 m start by writing the terms in the dot product as  2  2 We will always choose transverse pump to be red detuned ri,x + rj,x ri,x − rj,x ri,xrj,x = − . (C1) from the cavity modes so that ∆m < 0. The mode-space 2 2 representation of a longitudinal pump term is ϕm. We will discuss the effects of additional classical and Since the variances of ri,x and rj,x are equal, their sum quantum noise terms in the Hamiltonian in appendicesD and difference are independent random variables with andE. each of variance 2w2. This implies that

N (0, 2w2)2 N (0, 2w2)2 r r ∼ − Appendix B: Convolution of the nonlocal interaction i,x j,x 2 2 with the finite extent of the spin ensemble w2 ∼ N (0, 1)2 − N (0, 1)2 , (C2) 2 We now discuss how the finite spatial extent of the spin ensembles affects the connectivity. The effective nonlo- where, as above, ∼ indicates equality in distribution, and cal interaction between two ensembles is given by the each N (µ, σ2) denotes an independent Gaussian random 27 variable with mean µ and variance σ2. Thus, the full dot Substituting in the derivative, we find product ri · rj is distributed as

2 pcos(x) = w h 2 2 2 2i r · r ∼ N (0, 1) − N (0, 1) + N (0, 1) − N (0, 1) 2 ∞ i j w  2  2 0 X w0 √ exp − 2 | arccos(x) + 2πk| . w2 h i 2w2 1 − x2 2w ∼ χ2 − χ2 , (C3) k=−∞ 2 2 2 (C11) where χ2 is a chi-square random variable with ν degrees ν Using the fact that | arccos(x)| ≤ π, the infinite sum can of freedom. The difference of χ2 random variables pro- ν be rearranged as a geometric series, duces a variance-gamma distribution. To see this, note that the moment generating function for the difference of " 2 w2  w2 arccos(x) χν distributions is 0 0 pcos(x) = √ exp − 2w2 1 − x2 2w2 M 2 2 (t) = M 2 (t)M 2 (−t) χν −χν χν χν  2  ∞ # −ν/2 −ν/2 w0 arccos(x) X −πkw2/w2 = (1 − 2t) (1 + 2t) + 2 cosh e 0 . (C12) 2w2  1/4 ν/2 k=1 = , (C4) 1/4 − t2 Evaluating the geometric series and rewriting in terms of while the moment generating function for the variance- hyperbolic functions finally results in gamma distribution with parameters µ, α, β, λ is  2  2 πw0 w0csch 2w2  2  λ w0  2 2  pcos(x) = √ cosh (π − arccos x) . µt α − β 2 2 2 MVG(t) = e . (C5) 2w 1 − x 2w α2 − (β + t)2 (C13) Thus, the moment generating functions coincide for µ = This probability density is the main result of this Ap- β = 0, α = 1/2, and λ = ν/2 = 1. The random vari- pendix. We now present a number of quantities related to the able ri · rj is distributed like a variance-gamma random variable with the above parameters. Denoting the prob- distribution of couplings. First, the mean of the proba- bility distribution can be computed in the usual way, ability density of ri · rj as pri·rj (x), we find r Z 1 1 1 2|x| 2 µJ = xpcos(x)dx = , (C14) pr ·r (x) = K 1 |x|/w , (C6) w 4 i j 3 2 −1 1 + 4 2w π w0 where Kν (x) is a modified Bessel function of the second as well as the variance: kind. The Bessel function simplifies for ν = 1/2 to the p −x Z 1 form K1/2(x) = π/2x e , yielding the simplified ex- 2 2 σJ = dx(x − µJ ) pcos(x) pression −1 8 h 4i 1 −|x| 16 w  5 + 8 w  p (x) = exp . (C7) w0 w0 ri·rj 2w2 w2 = . (C15) h 4i2 h 4i 1 + 4 w  1 + 16 w  w0 w0 We now wish to find the probability density pcos(x) for 2 the cosine of the random variable 2ri · rj/w0. Applying We may also find the correlation between couplings the general formula [107] for taking functions of random as a function of w. This is important, for instance, in variables allows us to write comparing the connectivity to that of an SK spin glass

h 2 i d 2 in which the couplings are uncorrelated. We first use a X w0 −1 w0 −1 pcos(x) = pri·rj cos (x) cos (x) , 2 k,± dx 2 k trigonometric identity to write k,± (C8)  r · r   r · r  where by cos−1 (x) we denote the infinite number of pos- i j j k k,± JijJjk = cos 2 2 cos 2 2 sible inverses of cosine; more precisely, w0 w0 1   2   2  −1 = cos r · (r + r ) + cos r · (r − r ) . cosk,±(x) = ± arccos(x) + 2πk, k ∈ Z, (C9) 2 j i k 2 j i k 2 w0 w0 where arccos(x) ∈ [0, π] is the principal inverse of cosine. (C16) The derivative of cos−1 (x) with respect to x appearing k,± Since r and r are both Gaussian random variables with above is independent of k, i k equal variances, their sum and difference are uncorrelated d ∓1 Gaussian random variables with twice the original vari- cos−1 (x) = √ . (C10) dx k,± 1 − x2 ance. Thus, the two terms have the same expected value, 28 and we find 1. Decay of coherences   2  hJ J i = cos r · (r + r ) ij jk 2 j i k To pinpoint the effect of the noise on coherences, we w0 will rotate into the interaction picture with respect to   2  2 2 2 2 H . The time evolution in the interaction picture is = cos 2 N (0, w ) ·N (0, 2w ) , (C17) N w0 −i R t dtχ(t) P Sx i R t dtχ(t) P Sx where h·i denotes an expectation over the random ρ(t) = e 0 i i ρ0(t)e 0 i i , (D1) variables, and N 2(µ, σ2) denotes an isotropic two- −iHCCQED t iHCCQED t dimensional Gaussian random variable with mean µ and where ρ0(t) = e ρ0e . To analyze the variance σ2. We can rewrite this in the symmetric form time dependence of specific elements in the density ma- trix, we denote total Sx states of the full system by vec-   √ √  2 2 2 2 2 x x x x x tors s = (s1 , s2 , ··· , sN ), where si denotes the S eigen- hJijJjki = cos 2 N (0, 2w ) ·N (0, 2w ) . w0 value of the ith spin ensemble. The density matrix ele- x (C18) ments may then be indexed as ρss0 for two S states s and This expression now matches the expression for the ex- s0. As a notational tool, we denote the total difference in pected value of the original p (x) distribution, but with x 0 P x 0x √ cos S eigenvalues between s and s as ∆s = i(si −s i ). If w2 rescaled by 2. Thus, we have already computed this the noise correlations are faster than the spin dynamics quantity and can extract due to the transverse field ωz, then the time evolution for 1 a general matrix element ρss0 is found by averaging over hJijJjki = 4 , (C19) realizations of the stochastic noise source: 1 + 8(w/w0)   t  exhibiting full correlation at w = 0 and vanishing corre- Z ρss0 (t) = exp dt i∆s χ(t) (ρ0(t))ss0 . (D2) lation at w → ∞. 0 χ(t) Finally, to determine the probability of generating neg- ative couplings as a function of w, we integrate the prob- The average may be performed using the cumulant ex- ability density to yield the cumulative distribution func- pansion of the noise source. We assume that χ(t) is a tion zero-mean, Gaussian signal such that only the second cu-  2   2  mulant is nonzero. The noise-averaged term appearing in πw0 w0 pcos

Raman pumping lasers, and can also be deliberately en- ∂ ρss0 (t) 2 2 −α(∆s)2/2π = (1 + t ωc ) . (D6) hanced to ensure one remains in the classical limit. ∂t ρss0 (0) 29

This is close to a power law in form. We can now extract the timescale over which the coherences decay. The above function is unity at t = 0 and decays to half of its initial value at time

1 p 2π/α(∆s)2 t1/2 = 2 − 1. (D7) ωc Thus, if one considers a coherent superposition of two states that have a difference ∆s between their eigenvalues of Sx, the rate at which that coherence decays increases with ∆s. As such, coherence decays faster for ensembles with larger numbers of atoms. The classical limit is valid if ωzt1/2  1. This is readily attainable in an experi- mentally relevant parameter regime, in which ∆C is on the order of MHz, ωc is on the order of kHz, and α is on FIG. 15. The spin-flip rate function for an ohmic noise source. the order of 10. The Lorentzian peak centered at ∆C = −2 MHz has a width set by κ = 150 kHz and provides cooling, while the peak at zero causes heating if the noise source broadens it too much. 2. Spin-flip rate in presence of an ohmic bath Plotted is the spin-flip rate function with no noise source (solid line), in which the central peak is a zero-width delta function, and with a classical ohmic noise sufficient to com- We now examine the form of the spin-flip rate function pletely suppress superpositions of Sx states of up to M = 104 that arises when coupled to an ohmic noise source. In spins per ensemble (dashed line). The rate functions overlap Eq. (18), we gave the general expression for the spin-flip away from the point of zero spin-flip energy. The central peak rate in terms of the noise correlation function. Using an is broadened, but still remains small compared to the typical < ohmic spectral density, this becomes spin-flip energy ∼ ∆C ; as such, it does not interfere with the cooling dynamics.

Ki(δ) = h(δ) 2 ∞ n ω X (Jii/|∆C |) nκ + z e−Jii/|∆C | , Sec.VB, we verified that such a peak is sufficiently nar- 8 n! (δ − n∆ )2 + n2κ2 n=1 C row so as not to interfere with the SD dynamics that arise (D8) naturally in the cavity. Thus, ohmic noise can be em- ployed to fully suppress coherence while preserving cavity where h(δ) is a symmetric peaked function. In the ab- dynamics. sence of noise, h(δ) = δ(δ), reflecting the fact that per- fectly degenerate spin flips occur at a fast rate because they do not need to trade energy with cavity modes. Re- alistically, this delta function is broadened to a finite peak Appendix E: Spin-flip rates with a quantum bath in the presence of even a small amount of noise. As the peak is symmetric, it induces heating since it encourages This section provides an alternative derivation of spin- energy lowering and raising spin-flips at equal rates: we flip rates, where we consider dephasing to arise from a should tune the noise strength to keep the width of this quantum bath instead of the classical bath discussed in function smaller than ∆C . We now compute the form of AppendixD; see also Ref. [30]. We start from a model this function in the presence of ohmic noise to leading 2 2 H = HCCQED +Hγ , where Hγ is a quantum noise source: order in αωc /∆C . This is well-justified in the parameter regime stated above. The expression is X h x † † i √ Hγ = σi ξk(Bik + Bik) + νkBikBik . (E1) 2 −Jii/|∆C |  α   2πωz e |δ| |δ| i,k h(δ) = K 1 , αp α− 2 8Γ(α)2 ωc|δ| ωc ωc (D9) Here, Bik is a bosonic annihilation operator for the kth where K 1 (x) is the modified Bessel function of the bath mode coupled to the ensemble at site i. We assume α− 2 second kind, which has exponentially decaying tails. independent but identical baths for each site i, so the Figure 15 plots the spin-flip rate function both for the behavior of this source is fully determined by its spectral P 2 zero noise case and for noise strong enough to fully sup- function JQ(ω) = k ξkδ(ω − νk). We will discuss below press superpositions in ensembles of up to M = 104 spins. how the result of this model connects to that of classical In the latter case, we use α = 20 and ωc = 2π × 4 kHz. noise by considering a high-temperature limit. The symmetric peak broadens, but remains significantly As before, we will consider the transverse field term smaller than the typical spin-flip energy scale ∆C . In perturbatively. It will be useful to define longitudinal 30 and transverse parts of the Hamiltonian: Now that H˜0 = H˜L +H˜γ is diagonal in the transformed frame, we may implement the standard Bloch-Redfield N ˜ X z procedure in which the (transformed) term HT is treated HT = ωz Si ,HL = HCCQED − HT . (E2) perturbatively. We first determine the form of H˜T = i=1 † U HT U. Working in the interaction picture of H˜0, we We derive a spin-only master equation containing the find spin-flip rates by treating the term HT perturbatively ωz X H˜ (t) = iS−(t)D (t)D (t) + H.c. . (E10) using the Bloch-Redfield approach [108]. Crucial to this T 2 i F,i γ,i i procedure is the observation that H0 = HL + Hγ can be diagonalized by a unitary transformation that we will We now examine the factors that appear in this expres- write in two parts as U = UF Uγ , where UF and Uγ are sion. First, note the raising and lowering operators take chosen to diagonalize HL and Hγ , respectively. The for- the unusual form S± = Sy ± iSz because the Sx spin mer is written states are the eigenstates of H0. The interaction picture "  † # time dependence of these operators is X am UF = exp Fm − H.c. , (E3) ∆ + iκ ± −iHHopfieldt ± −iHHopfieldt m m Si (t) = e Si e . (E11) P x This operator takes a simple form in the Sx subspace be- where we defined Fm = ϕm + i gimSi . This transfor- x cause H is diagonal in this subspace. Specifically, mation commutes with Si , and thus with Hγ . As dis- Hopfield x x x x cussed in Sec.V, this transform leads to the replacement consider S states denoted |si = |s1 , s2 , ··· , sN i, where x x am → am +Fm/(∆m +iκ), which also modifies the Lind- si denotes the Si eigenvalue for the ith spin ensemble. blad dissipation term describing cavity loss. Generically, The time dependence of the matrix elements is then

 ∗ †  0 ± i(Es0 −Es)t 0 ± κL[am + α] = κL[am] + κ α am − αam, ρ , (E4) hs | Si (t) |si = e hs | Si |si , (E12) with the second term shifting the Hamiltonian. Incor- where Es is the energy eigenvalue of the state |si of porating this contribution of the Lindblad term into the HHopfield. The difference in energy appearing in the ex- transformed H˜L, we find ponential, which results from flipping a single spin in the ith ensemble, can be written  2  X ∆mF H˜ = − ∆ a† a − m . (E5) L m m m ∆2 + κ2 N m m ± X x δi = Es0 − Es = −Jii ∓ 2 Jijsj . (E13) This expression is now diagonal, with eigenstates defined i=1 x by classical states of Si and photon number states. We The time dependence of the raising and lowering opera- ± ± ± note that the second term is the Hopfield model in a iδi t tors therefore takes the simple form Si (t) = e Si . longitudinal field: The other factors in Eq. (E10) are polaronic operators 2 describing how the spins are dressed by the photons X ∆mF H = m Hopfield 2 2 " # ∆m + κ  †  m X am am N N DF,i = exp gim − , (E14) ∆m + iκ ∆m − iκ X x x X x m = − JijSi Sj − hiSi , (E6) " # i,j=1 i=1 X ξk † Dγ,i = exp − (Bik − Bik) . (E15) νk with connectivity and longitudinal fields: k Their time-dependent forms involve the interaction- X ∆mgimgjm X ϕmgim∆m Jij = − 2 2 , hi = −2 2 2 . picture time dependence of am,Bik. ∆m + κ ∆m + κ m m With the full forms of H˜0 and H˜T (t) now specified, (E7) the standard Bloch-Redfield procedure (in the Markovian The term Hγ may be similarly diagonalized by the trans- approximation) begins by writing: formation Z t " # 0 h ˜ h ˜ 0 ii X x ξk † ∂tρ˜ = − dt Trbath HT (t), HT (t ), ρ(t) . (E16) Uγ = exp − Si (Bik − Bik) . (E8) νk ik We include both the cavity modes and noise operators This commutes with HL and transforms Hγ to Bik in tracing over the “bath” degrees of freedom above, yielding a master equation for the spin degrees of freedom ˜ X † only. Note that tracing out the cavity modes at this Hγ = νkBikBik. (E9) i,k stage preserves the vital physics describing the spin-flip 31 dynamics, as the diagonalized Hamiltonian H0 includes can be calculated exactly in the zero-temperature bath the full cavity-mediated interaction between spins. From limit: this point on, we assume the confocal limit, ∆m = ∆C . αQ The Bloch-Redfield procedure eventually yields an ex- CQ(τ) = ln(1 + iωcτ). (E23) pression that may be written in the interaction picture 4 as The integrals in the spin-flip rate can then be evaluated to give the exact expression ∂tρ = −i[HLamb, ρ] X  − − + +  2 ( αQ−1 + Ki(δi )L[Si ] + Ki(δi )L[Si ] , (E17) ω θ(−δ)π −|δ| |δ| z −Jii/|∆C | i Ki(δ) = e exp 8 Γ(αQ)ωc ωc ωc where the spin-flip rates are Ki(δ) = Re[Γi(δ)] and ∞ n ) X (Jii/|∆C |) h 1 i + Im φ αQ, (δ − n∆C − inκ) , n! ωc 2 Z ∞ " n=1 ωz Γi(δ) = dτ exp − iδτ − C(τ) (E24) 8 0 # J where we have introduced the function φ(s, z) = ii −(κ−i∆C )τ  − 1 − e . (E18) zs−1ezΓ(1 − s, z). Here, Γ(s, z) is the upper incomplete ∆ C gamma function and θ(x) denotes the Heaviside step function. The function φ(s, z) asymptotically approaches The Lamb shift H term is Lamb 1/z for large |z|. Thus, we can explicitly calculate the X + − rate to be HLamb = 2 [Li(δi) + Li(−δi)] Si Si , (E19) i ω2 z −Jii/|∆C | Ki(δ) = e where Li(δ) = Im[Γi(δ)]. 8 + − x Since S S is diagonal in the S basis, HLamb gener- ∞ n ! i i X (Jii/|∆C |) nκ ates no spin-flip dynamics. For the quantum bath, C(τ) h (δ) + Q n! (δ − n∆ )2 + n2κ2 takes the form n=1 C (E25)

CQ(τ) = Z in the large detuning limit defined by |∆C |  δ, ωc. The JQ(ω) dω [coth (βω/2) (1 − cos(ωτ)) + i sin(ωτ)] , bath-dependent term hQ(δ) is given by ω2 (E20) θ(−δ)π −|δ| |δ|αQ−1 hQ(δ) = exp . (E26) where JQ(ω) is the spectral density of the quantum bath. Γ(αQ)ωc ωc ωc We can recover the results of AppendixD for a classi- cal bath by taking the limit β → 0 while rescaling the The function hQ(δ) dominates the rate function for δ < spectral density to keep the integrand finite. This cor- 0, but vanishes for δ > 0. The cavity parameters ∆C and responds to suppressing quantum noise while maintain- κ drop out of the bath term, showing that the dynamics ing a finite level of thermal (classical) noise. Formally, are predominantly determined by the bath structure. we keep JC (ω) = JQ(ω) coth(βω/2) ' JQ(ω)(2kBT/ω) Figure 16 plots Ki(δ) for several values of the bath finite while JQ(ω) → 0. This effectively removes the coupling strength αQ. The expression has the property imaginary term from C(τ), giving that for αQ > 1 and negative δ, hQ(δ) approaches zero at |δ| = 0, attains a maximum at |δ| = (α − 1)ω , and Z Q c dω JC (ω) 2 ωτ  then falls off exponentially for larger |δ|. This means CC (τ) = 2 sin . (E21) 2π ω 2 that for energy lowering processes with |δ| < (αQ −1)ωc, spin flips that lower the energy by a greater amount have We conclude this section by presenting the case in a higher spin-flip rate; this is like SD. For αQ ≈ 1, the which JQ(ω) describes an ohmic quantum bath, spin-flip rate function is nearly flat while δ < 0 and yields 0TMH-like dynamics. Last, h (δ) diverges at αQ Q J (ω) = ωe−ω/ωc . (E22) Q 4 δ = 0 for αQ < 1. This results in the spins prefer- ring to perform trivial spin flips that lower the energy by We use a slightly different normalization than in the clas- only small amounts rather than making substantial en- sical case for algebraic convenience. Note also, following ergy lowering flips. Such dynamics would allow the spins the previous paragraph, that the high-temperature clas- to fluctuate as much as possible before settling to a local sical limit of this bath would be classical white noise, minimum in the long-time limit and is undesirable for rather than classical ohmic noise. The function CQ(τ) associative memory. 32

Appendix F: Derivation of mean-field dynamics

The deterministic ensemble dynamics of Sec.VC are now derived from the stochastic spin dynamics of Sec.VB. This is a specific example of deriving mean-field equations from a continuous time Markov chain [109]. As such, we first formalize the structure of the Markov chain. Each individual spin can either be in the up or down state, and so we define the occupancy vector xi,j to denote the current state of the ith spin in ensemble j, where xi,j = (1, 0) for the up state and xi,j = (0, 1) for the down state. These define the microscopic degrees–of– freedom in the Markov chain. We average over the micro- scopic degrees–of–freedom to produce a macroscopic de- PM scription, xj = i=1 xi,j/M. The ensemble occupancy FIG. 16. The spin-flip rate versus energy for an ohmic quan- + − + − vectors can be written as xj = (xj , xj ), where xj (xj ) tum bath for various bath coupling strengths αQ. Three regimes of dynamics are apparent. The spin-flip rate diverges is the fraction of spins in the jth ensemble that are up (down). for αQ < 1 near δ = 0, giving rise to dynamics that perform the smallest energy-lowering spin flips possible. For αQ ' 1, To obtain the mean-field equations of motion, we con- the spin-flip rate is roughly flat for negative δ, matching struct the generator matrix describing the transition 0TMH dynamics. Finally, for αQ > 1, the spin-flip rate rises rates between different occupancy states. We must spec- sharply as δ approaches zero. This describes dynamics akin ify the spin-flip rate experienced per spin rather than the to SD, in which the most energy-lowering spin flip has the total ensemble rate. We thus normalize by the number highest spin-flip rate. of spins that are available to flip in the given direction, ± ± Mxi = 2Sxi , in terms of the ensemble populations. After normalization, the generator matrix is

 x x x x  S(S + 1) − si (si − 1) − S(S + 1) − si (si − 1) − − Ki(δ ) Ki(δ ) 1  x+ i x+ i  Q =  i i  , (F1) i 2S  x x x x   S(S + 1) − si (si + 1) + S(S + 1) − si (si + 1) +  − Ki(δi ) − − Ki(δi ) xi xi

x + − where S = M/2 and the variable si = S(xi −xi ) is the average spin state of ensemble i. The entries of the generator matrix are defined such that the off-diagonal elements give the transition rates for the up → down and down → up transitions, while the two diagonal elements give the total rate at which the spins exit the up or down state. The mean-field limit, exact for S → ∞, describes the time evolution of the ensemble occupancy vectors in terms of a differential equation involving the generator matrix. Explicitly, under the only constraint that the rate functions be Lipschitz continuous, the limit differential equation for the ensemble occupancy vectors is

 T −K (δ−)S(S + 1) − sx(sx − 1) + K (δ+)S(S + 1) − sx(sx + 1) d 1  i i i i i i i i  lim xi = xi · Qi =   . (F2) S→∞ dt 2S  −  x x  +  x x   Ki(δi ) S(S + 1) − si (si − 1) − Ki(δi ) S(S + 1) − si (si + 1)

+ − We may rewrite this equation as an ordinary differential Noting that the sign of Ki(δi ) − Ki(δi ) depends equation in terms of the ensemble magnetizations mi = on whether the ensemble is aligned with its local field + − x P x xi − xi = si /S. This is `i = j Jijsj , we arrive at the expression for the large ensemble equation of motion Eq. (25) presented in the d  + −  2 main text. Referring back to Fig.9, the mean-field equa- lim mi = S Ki(δi ) − Ki(δi ) (1 − mi ) S→∞ dt tions match the full stochastic unraveling quite well for + − the chosen parameters. + (1 − mi)Ki(δi ) − (1 + mi)Ki(δi ). (F3) 33

[1] Y. LeCun, Y. Bengio, and G. Hinton, “Deep learning,” puting: A review and perspective,” Appl. Phys. Rev. 7, Nature 521, 436 (2015). 011302 (2020). [2] Y. Bahri, J. Kadmon, J. Pennington, S. S. Schoen- [22] H. J. Kimble, “Strong interactions of single atoms and holz, J. Sohl-Dickstein, and S. Ganguli, “Statistical me- photons in cavity QED,” Phys. Scr. 76, 127 (1998). chanics of deep learning,” Annu. Rev. Condens. Matter [23] S. Gopalakrishnan, B. L. Lev, and P. M. Goldbart, Phys. 11, 501 (2020). “Frustration and Glassiness in Spin Models with Cavity- [3] D. Silver et al., “Mastering the game of Go with deep Mediated Interactions,” Phys. Rev. Lett. 107, 277201 neural networks and tree search,” Nature 529, 484 (2011). (2016). [24] S. Gopalakrishnan, B. L. Lev, and P. M. Goldbart, “Ex- [4] M. A. Nielsen and I. Chuang, Quantum computation ploring models of associative memory via cavity quan- and quantum information (Cambridge University Press, tum electrodynamics,” Philos. Mag. 92, 353 (2012). Cambridge, 2002). [25] M. Endres, H. Bernien, A. Keesling, H. Levine, E. R. [5] F. Arute, K. Arya, R. Babbush, D. Bacon, J. C. Anschuetz, A. Krajenbrink, C. Senko, V. Vuleti´c, Bardin, R. Barends, R. Biswas, S. Boixo, F. G. Bran- M. Greiner, and M. D. Lukin, “Atom-by-atom assembly dao, D. A. Buell, et al., “Quantum supremacy using a of defect-free one-dimensional cold atom arrays,” Sci- programmable superconducting processor,” Nature 574, ence 354, 1024 (2016). 505 (2019). [26] D. O. de Mello, D. Sch¨affner, J. Werkmann, [6] C. L. Degen, F. Reinhard, and P. Cappellaro, “Quan- T. Preuschoff, L. Kohfahl, M. Schlosser, and G. Birkl, tum sensing,” Rev. Mod. Phys. 89, 035002 (2017). “Defect-Free Assembly of 2D Clusters of More Than 100 [7] D. L. Stein and C. M. Newman, Spin glasses and com- Single-Atom Quantum Systems,” Phys. Rev. Lett. 122, plexity, Vol. 4 (Princeton University Press, Princeton, 203601 (2019). 2013). [27] P. Rotondo, M. C. Lagomarsino, and G. Viola, “Dicke [8] J. A. Hertz, A. S. Krogh, and R. G. Palmer, In- Simulators with Emergent Collective Quantum Compu- troduction To The Theory Of Neural Computation, tational Abilities,” Phys. Rev. Lett. 114, 143601 (2015). Addison-Wesley Computation and Neural Systems Se- [28] P. Rotondo, M. Marcuzzi, J. P. Garrahan, I. Lesanovsky, ries (Avalon Publishing, 1991). and M. M¨uller, “Open quantum generalisation of hop- [9] K. H. Fischer and J. A. Hertz, Spin Glasses (Cambridge field neural networks,” J. Phys. A: Math. Theor. 51, University Press, Cambridge, 1991). 115301 (2018). [10] H. Sompolinsky, “Statistical Mechanics of Neural Net- [29] V. Torggler, S. Kr¨amer, and H. Ritsch, “Quantum an- works,” Phys. Today 41, 70 (1988). nealing with ultracold atoms in a multimode optical res- [11] F. Barahona, “On the computational complexity of Ising onator,” Phys. Rev. A 95, 032310 (2017). spin glass models,” J. Phys. A: Math. Gen. 15, 3241 [30] E. Fiorelli, M. Marcuzzi, P. Rotondo, F. Carollo, and (1982). I. Lesanovsky, “Signatures of Associative Memory Be- [12] A. Lucas, “Ising formulations of many NP problems,” havior in a Multimode Dicke Model,” Phys. Rev. Lett. Front. Phys. 2, 1 (2014). 125, 070604 (2020). [13] C. Moore and S. Mertens, The Nature of Computation [31] A. J. Koll´ar,A. T. Papageorge, K. Baumann, M. A. (OUP Oxford, 2011). Armen, and B. L. Lev, “An adjustable-length cavity [14] P. Mehta, M. Bukov, C.-H. Wang, A. G. Day, and Bose-Einstein condensate apparatus for multimode C. Richardson, C. K. Fisher, and D. J. Schwab, “A cavity QED,” New J. Phys. (2015). high-bias, low-variance introduction to machine learn- [32] A. J. Koll´ar,A. T. Papageorge, V. D. Vaidya, Y. Guo, ing for physicists,” Phys. Rep. 810, 1 (2019). J. Keeling, and B. L. Lev, “Supermode-density-wave- [15] J. J. Hopfield and D. W. Tank, “Computing with neural polariton condensation with a Bose-Einstein condensate circuits: a model,” Science 233, 625 (1986). in a multimode cavity,” Nat. Commun. 8, 14386 (2017). [16] D. J. Amit, H. Gutfreund, and H. Sompolinsky, “Stor- [33] V. D. Vaidya, Y. Guo, R. M. Kroeze, K. E. Ballan- ing infinite numbers of patterns in a spin-glass model of tine, A. J. Koll´ar,J. Keeling, and B. L. Lev, “Tunable- neural networks,” Phys. Rev. Lett. 55, 1530 (1985). Range, Photon-Mediated Atomic Interactions in Multi- [17] D. Psaltis, D. Brady, X. G. Gu, and S. Lin, “Holography mode Cavity QED,” Phys. Rev. X 8, 011002 (2018). in artificial neural networks,” Nature 343, 325 (1990). [34] R. M. Kroeze, Y. Guo, V. D. Vaidya, J. Keeling, and [18] D. Z. Anderson, G. Zhou, and G. Montemezzani, “Self- B. L. Lev, “Spinor self-ordering of a quantum gas in a organized learning of purely temporal information in a cavity,” Phys. Rev. Lett. 121, 163601 (2018). photorefractive optical resonator,” Opt. Lett. 19, 2012 [35] Y. Guo, R. M. Kroeze, V. D. Vaidya, J. Keeling, and (1994). B. L. Lev, “Sign-changing photon-mediated atom inter- [19] D. Psaltis, K. Buse, and A. Adibi, “Non-volatile holo- actions in multimode cavity quantum electrodynamics,” graphic storage in doubly doped lithium niobate crys- Phys. Rev. Lett. 122, 193601 (2019). tals,” Nature 393, 665 (1998). [36] Y. Guo, V. D. Vaidya, R. M. Kroeze, R. A. Lunney, [20] Y. Shen, N. C. Harris, S. Skirlo, M. Prabhu, T. Baehr- B. L. Lev, and J. Keeling, “Emergent and broken sym- Jones, M. Hochberg, X. Sun, S. Zhao, H. Larochelle, metries of atomic self-organization arising from Gouy D. Englund, and M. Soljaˇci´c, “Deep learning with co- phase shifts in multimode cavity QED,” Phys. Rev. A herent nanophotonic circuits,” Nat. Photonics 11, 441 99, 53818 (2019). (2017). [37] R. M. Kroeze, Y. Guo, and B. L. Lev, “Dynamical [21] G. Csaba and W. Porod, “Coupled oscillators for com- Spin-Orbit Coupling of a Quantum Gas,” Phys. Rev. 34

Lett. 123, 160404 (2019). [56] W. A. Little, “The existence of persistent states in the [38] A. E. Siegman, Lasers (University Science Books, 1986). brain,” Math. Biosci. 19.1-2, 101 (1974). [39] R. J. Glauber, “Time-dependent statistics of the Ising [57] H. Nishimori, Statistical Physics of Spin Glasses and model,” J. Math. Phys. 4, 294 (1963). Information Processing: An Introduction (Clarendon [40] W. S. Bakr, J. I. Gillen, A. Peng, S. F¨olling, and Press, 2001). M. Greiner, “A quantum gas microscope for detecting [58] D. C. Mattis, “Solvable spin systems with random inter- single atoms in a Hubbard-regime optical lattice,” Na- actions,” Phys. Lett. A 56, 421 (1976). ture 462, 74 (2009). [59] D. J. Amit, H. Gutfreund, and H. Sompolinsky, “Sta- [41] N. Metropolis, A. W. Rosenbluth, M. N. Rosenbluth, tistical mechanics of neural networks near saturation,” A. H. Teller, and E. Teller, “Equation of state calcula- Ann. Phys. 173.1, 30 (1987). tions by fast computing machines,” J. Chem. Phys. 21, [60] D. J. Amit, Modeling brain function: The world of at- 1087 (1953). tractor neural networks (Cambridge University Press, [42] W. K. Hastings, “Monte Carlo sampling methods using 1992). Markov chains and their applications,” Biometrika 57, [61] D. Sherrington and S. Kirkpatrick, “Solvable model of a 97 (1970). spin-glass,” Phys. Rev. Lett. 35, 1792 (1975). [43] J. J. Hopfield, “Neural networks and physical systems [62] A. Storkey, in Artificial Neural Networks – ICANN’97. with emergent collective computational abilities,” Proc. Lecture Notes in Computer Science, Vol. 1327 (Springer Natl. Acad. Sci. 79, 2554 (1982). Verlag, 1997) pp. 451–456. [44] M. Nixon, E. Ronen, A. A. Friesem, and N. Davidson, [63] A. J. Storkey and R. Valabregue, “The basins of attrac- “Observing Geometric Frustration with Thousands of tion of a new Hopfield learning rule,” Neural Netw. 12, Coupled Lasers,” Phys. Rev. Lett. 110, 184102 (2013). 869 (1999). [45] T. Inagaki, Y. Haribara, K. Igarashi, T. Sonobe, S. Ta- [64] One might expect this could be overcome by a “capture– mate, T. Honjo, A. Marandi, P. L. McMahon, T. Umeki, recapture” approach to estimate the true number of K. Enbutsu, O. Tadanaga, H. Takenouchi, K. Aihara, metastable states by determining how often each state K.-i. Kawarabayashi, K. Inoue, S. Utsunomiya, and is found. However, as the distribution of basin sizes is H. Takesue, “A coherent Ising machine for 2000-node non-uniform, a naive application of this approach would optimization problems,” Science 354, 603 (2016). be biased toward underestimating the true number of [46] P. L. McMahon, A. Marandi, Y. Haribara, R. Hamerly, metastable states. C. Langrock, S. Tamate, T. Inagaki, H. Takesue, [65] D. Panchenko, The Sherrington-Kirkpatrick model S. Utsunomiya, K. Aihara, R. L. Byer, M. M. Fejer, (Springer Science & Business Media, 2013). H. Mabuchi, and Y. Yamamoto, “A fully-programmable [66] E. P. Wigner, “Characteristic vectors of bordered ma- 100-spin coherent Ising machine with all-to-all connec- trces with infinite dimensions,” Ann. Math. 62, 548 tions,” Science 354, 614 (2016). (1955). [47] N. G. Berloff, M. Silva, K. Kalinin, A. Askitopoulos, [67] E. P. Wigner, “On the distribution of the roots of certain J. D. T¨opfer,P. Cilibrizzi, W. Langbein, and P. G. symmetric matrices,” Ann. Math. 67, 325 (1958). Lagoudakis, “Realizing the classical XY Hamiltonian in [68] E. P. Wigner, in Conference on Neutron Physics by polariton simulators,” Nat. Mater. 16, 1120 (2017). Time of Flight, Gatlinburg, Tennesse (1956). [48] D. Krotov and J. Hopfield, “Large Associative Mem- [69] We assume that all modes considered decay at the same ory Problem in Neurobiology and Machine Learning,” rate κ, which seems consistent with experimental obser- (2020), arXiv:2008.06996. vations up to at least mode indices of 50 [31, 33]. [49] Spin-changing collisions in 87Rb are negligible on the [70] R. H. Dicke, “Coherence in spontaneous radiation pro- timescale of the experiment, and so contact interactions cesses,” Phys. Rev. 93, 99 (1954). play little role within each spin ensemble. [71] K. Hepp and E. H. Lieb, “On the superradiant phase [50] Three-dimensional (static) optical lattices inside single transition for molecules in a quantized radiation field: mode cavities have been demonstrated [110, 111]. Ul- the Dicke maser model,” Ann. Phys. 76, 360 (1973). tracold thermal atoms may serve as well, provided their [72] B. M. Garraway, “The Dicke model in quantum optics: temperature is far below the lattice trap depth. Dicke model revisited,” Philos. Trans. R. Soc. London, [51] F. Dimer, B. Estienne, A. S. Parkins, and H. J. Ser. A 369, 1137 (2011). Carmichael, “Proposed realization of the Dicke-model [73] P. Kirton, M. M. Roses, J. Keeling, and E. G. quantum phase transition in an optical cavity QED sys- Dalla Torre, “Introduction to the Dicke Model: From tem,” Phys. Rev. A 75, 013804 (2007). Equilibrium to Nonequilibrium, and Vice Versa,” Adv. [52] This is the coupling rate to the maximum field of the Quantum Technol. 2, 1800043 (2019). TEM00 mode. [74] S. Gopalakrishnan, B. L. Lev, and P. M. Gold- [53] While BECs in the CCQED system are more on the or- bart, “Emergent crystallinity and frustration with bose– der of 106 atoms in population, ultracold, but thermal, einstein condensates in multimode cavities,” Nat. Phys. gases of 107 atoms may be used since atomic coherence 5, 845 (2009). plays little role. [75] S. Gopalakrishnan, B. L. Lev, and P. M. Goldbart, [54] A. Barzegar, C. Pattison, W. Wang, and H. G. Katz- “Atom-light crystallization of Bose-Einstein conden- graber, “Optimization of population annealing Monte sates in multimode cavities: Nonequilibrium classical Carlo for large-scale spin-glass simulations,” Phys. Rev. and quantum phase transitions, emergent lattices, su- E 98, 053308 (2018). persolidity, and frustration,” Phys. Rev. A 82, 043612 [55] A. M. Kaufman, B. J. Lester, and C. A. Regal, “Cooling (2010). a Single Atom in an Optical Tweezer to Its Quantum [76] In other words, small with respect to the local interac- Ground State,” Phys. Rev. X 2, 041014 (2012). tion length scale, around a micron [33]. 35

[77] K. Baumann, R. Mottl, F. Brennecke, and T. Esslinger, mamoto, and H. Mabuchi, “Topological defect forma- “Exploring Symmetry Breaking at the Dicke Quan- tion in 1d and 2d spin chains realized by network of op- tum Phase Transition,” Phys. Rev. Lett. 107, 140402 tical parametric oscillators,” Int. J. Mod. Phys. B 30, (2011). 1630014 (2016). [78] I. G. Lang and Y. A. Firsov, “Kinetic theory of semicon- [97] K. P. Kalinin and N. G. Berloff, “Simulating Ising and ductors with low mobility,” Sov. Phys. JETP 16, 1301 n-state planar Potts models and external fields with (1963). nonequilibrium condensates,” Phys. Rev. Lett. 121, [79] I. G. Lang and Y. A. Firsov, “Mobility of small-radius 235302 (2018). polarons at low temperatures,” Sov. Phys. JETP 18, 262 [98] K. P. Kalinin and N. G. Berloff, “Networks of non- (1964). equilibrium condensates for global optimization,” New [80] By which we mean, the energy shifts due to the coupling J. Phys. 20, 113023 (2018). of the spins to the continuum of modes in the bath [108]. [99] T. Leleu, Y. Yamamoto, P. L. McMahon, and K. Ai- [81] E. G. D. Torre, S. Diehl, M. D. Lukin, S. Sachdev, and hara, “Destabilization of Local Minima in Analog Spin P. Strack, “Keldysh approach for nonequilibrium phase Systems by Correction of Amplitude Heterogeneity,” transitions in quantum optics: Beyond the Dicke model Phys. Rev. Lett. 122, 040607 (2019). in optical cavities,” Phys. Rev. A 87, 023831 (2013). [100] Other, more complicated entanglement-preserving feed- [82] M. F. Maghrebi and A. V. Gorshkov, “Nonequilibrium back schemes have been proposed [113]. many-body steady states via Keldysh formalism,” Phys. [101] M. J. Kastoryano, F. Reiter, and A. S. Sørensen, “Dis- Rev. B 93, 014307 (2016). sipative preparation of entanglement in optical cavities,” [83] C. Gardiner, P. Zoller, and P. Zoller, Quantum noise: Phys. Rev. Lett. 106, 090502 (2011). a handbook of Markovian and non-Markovian quantum [102] G. Carleo and M. Troyer, “Solving the quantum many- stochastic methods with applications to quantum optics body problem with artificial neural networks,” Science (Springer, Berlin, 2004). 355, 602 (2017). [84] A. J. Daley, “Quantum trajectories and open many-body [103] S. Ganguli and H. Sompolinsky, “Compressed sensing, quantum systems,” Adv. Phys. 63, 77 (2014). sparsity, and dimensionality in neuronal information [85] For example, the total number of local minima in the processing and data analysis,” Annu. Rev. Neurosci. 35, SK model is estimated to be O(eαN ), where α = 485 (2012). 0.201(2) [112]. [104] G. Dragoi and S. Tonegawa, “Preplay of future place cell [86] A. J. Bray and M. A. Moore, “Chaotic nature of the sequences by hippocampal cellular assemblies,” Nature spin-glass phase,” Phys. Rev. Lett. 58, 57 (1987). 469, 397 (2011). [87] Z. Zhu, A. J. Ochoa, S. Schnabel, F. Hamze, and H. G. [105] G. Dragoi and S. Tonegawa, “Distinct preplay of mul- Katzgraber, “Best-case performance of quantum anneal- tiple novel spatial experiences in the rat,” Proc. Natl. ers on native spin-glass benchmarks: How chaos can Acad. Sci. (U.S.A.) 110, 9100 (2013). affect success probabilities,” Phys. Rev. A 93, 012317 [106] D. Silva, T. Feng, and D. J. Foster, “Trajectory events (2016). across hippocampal place cells require previous experi- [88] T. Albash, V. Martin-Mayor, and I. Hen, “Analog ence,” Nat. Neurosci. 18, 1772 (2015). errors in Ising machines,” Quantum Sci. Technol. 4, [107] K. F. Riley, M. P. Hobson, S. J. Bence, and M. Hob- 02LT03 (2019). son, Mathematical Methods for Physics and Engineer- [89] A. Pearson, A. Mishra, I. Hen, and D. A. Lidar, “Ana- ing: A Comprehensive Guide (Cambridge University log errors in quantum annealing: doom and hope,” npj Press, 2002). Quantum Inf. 5, 1 (2019). [108] H.-P. Breuer and F. Petruccione, The Theory of Open [90] D. A. B. Miller, “Sorting out light,” Science 347, 1423 Quantum Systems (Oxford University Press, Oxford, (2015). 2002). [91] E. Aarts and J. Korst, Simulated annealing and Boltz- [109] A. Kolesnichenko, V. Senni, A. Pourranjabar, and mann machines (Wiley, New York, 1988). A. Remke, “Applying mean-field approximation to [92] P. Hauke, H. G. Katzgraber, W. Lechner, H. Nishimori, continuous time markov chains,” in Stochastic Model and W. D. Oliver, “Perspectives of quantum annealing: Checking. Rigorous Dependability Analysis Using Model methods and implementations,” Rep. Progr. Phys. 83, Checking Techniques for Stochastic Systems, edited by 054401 (2020). A. Remke and M. Stoelinga (Springer Berlin Heidelberg, [93] Y. Yamamoto, K. Aihara, T. Leleu, K.-i. Berlin, Heidelberg, 2014) pp. 242–280. Kawarabayashi, S. Kako, M. Fejer, K. Inoue, and [110] J. Klinder, H. Keßler, M. R. Bakhtiari, M. Thorwart, H. Takesue, “Coherent Ising machines Optical neural and A. Hemmerich, “Observation of a superradiant Mott networks operating at the quantum limit,” npj Quantum insulator in the Dicke-Hubbard model,” Phys. Rev. Lett. Inf. 3, 49 (2017). 115, 230403 (2015). [94] R. Hamerly, T. Inagaki, P. L. McMahon, D. Venturelli, [111] R. Landig, L. Hruby, N. Dogra, M. Landini, R. Mottl, A. Marandi, T. Onodera, E. Ng, C. Langrock, K. Inaba, T. Donner, and T. Esslinger, “Quantum phases from T. Honjo, et al., “Experimental investigation of perfor- competing short- and long-range interactions in an op- mance differences between coherent Ising machines and tical lattice,” Nature 532, 476 (2016). a quantum annealer,” Sci. Adv. 5, eaau0823 (2019). [112] K. Nemoto, “Metastable states of the SK spin glass [95] V. Pal, C. Tradonsky, R. Chriki, A. A. Friesem, and model,” J. Phys. A: Math. Gen. 21, L287 (1988). N. Davidson, “Observing dissipative topological defects [113] R. Yanagimoto, P. L. McMahon, E. Ng, T. Onodera, with coupled lasers,” Phys. Rev. Lett. 119, 013902 and H. Mabuchi, “Embedding entanglement genera- (2017). tion within a measurement-feedback coherent Ising ma- [96] R. Hamerly, K. Inaba, T. Inagaki, H. Takesue, Y. Ya- chine,” (2019), arXiv:1906.04902.