Main

Entanglement is a key resource for enabling quantum computation and advancing precision measurements towards fundamental limits. Crucial to these applications is the ability to controllably and scalably generate quantum correlations among many particles. A leading platform for achieving these ends are systems of cold atoms. Here, entangled states of over 20 atoms, such as cluster states with applications in quantum computation, have been generated by bottom-up approaches using local interactions1. Conversely, global interactions among 102 to 105 atoms have been applied to prepare collective entangled states, including squeezed states2,3,4,5,6,7 that enable enhanced precision in clocks5,6,8,9 and interferometers7,10. Such states, featuring symmetric correlations between all atom pairs, have been generated by collisions in Bose–Einstein condensates2,3 and by photon-mediated interactions in optical cavities5,6,7.

Atoms in cavities offer a particularly versatile platform for scalable generation of entanglement5,6,7,8,11,12, with a single mode of light serving as an interface for correlating the atoms across millimetre-scale distances. In this setting, entanglement between spatial modes of an atomic gas has been achieved by splitting a global squeezed state into distinct subensembles13, building on past work with optically dense ensembles in free space14 and with spinor condensates15,16,17,18,19. Combining such top-down generation of entanglement with advances in local control and detection20,21,22,23 provides the opportunity to engineer and probe richer spatial structures of entanglement, with applications in multimode quantum sensing24, multiparameter estimation25 and quantum computation26.

A paradigmatic class of multimode entangled states are graph states27, universal resources for quantum computation26 with broader applications in quantum metrology24 and in simulations of condensed-matter physics28. These states, also known as cluster states, derive their name from a graph that defines the entanglement structure, with edges representing correlations between nodes that may represent either individual qubits or continuous-variable degrees of freedom. Discrete-variable graph states have been generated with superconducting qubits29, trapped ions30 and Rydberg atoms1, while continuous-variable graph states have been prepared in photonic systems31,32. Hitherto unexplored are opportunities for combining the benefits of light and matter to engineer graph states with flexible connectivity and long-lived information storage in atomic states.

Here we report on the generation of programmable multimode entanglement in an array of four atomic ensembles coupled to an optical cavity. To control the structure of entanglement, we intersperse global interactions with local spin rotations. These two ingredients provide control over the strength of entanglement between subsystems and thereby enable a general protocol for preparing graph states. As a minimal instance, we prepare and characterize a two-mode graph state that exhibits Einstein–Podosky–Rosen (EPR) steering, a strong form of entanglement that is a resource for quantum teleportation and that has previously been demonstrated in Bose–Einstein condensates using collisional interactions15,16,17,19 and in photonic systems33. To illustrate the versatility of our protocol, we further construct a four-mode square graph state. Our work offers a blueprint for scalable generation of resource states for continuous-variable quantum computation and multimode quantum metrology.

As the mechanism for generating global entanglement, we implement cavity-mediated spin-nematic squeezing of spin-1 atoms34. When a drive field is applied to the cavity (Fig. 1a), photons mediate spin-exchange interactions35 and the system is governed by the Hamiltonian

$$H/\hslash =\frac{\chi }{2N}\left({F}^{\;x}{F}^{\;x}+{F}^{\;y}{F}^{\;y}\right)+\frac{q}{2}{Q}^{0}.$$
(1)

Here, F denotes the collective spin of all N atoms in the cavity, with spin length F ≤ N, and χ quantifies the collective interaction strength. In the second term, q parameterizes the quadratic Zeeman energy, proportional to the difference Q0 = N1 + N−1 − N0 between the populations Nm of atoms in the m = ±1 and m = 0 Zeeman states.

Fig. 1: Programmable entanglement in an array of four atomic ensembles within an optical cavity.
figure 1

a, Initializing all atoms in the m = 0 state and driving the cavity with light induces creation of correlated atom pairs in states m = ±1. b, The resulting spin-nematic squeezing is visualized on a spherical phase space spanned by the collective spin-1 observables {Fx, Qyz, Q0}. For short interaction times, the dynamics can be described on an effective two-dimensional phase space spanned by the conjugate observables {x, p}. c, Combining the global interactions with local spin rotations allows for engineering a variety of entanglement structures, such as entanglement localized to selected subsystems and graph states with up to four nodes.

We visualize the collective spin dynamics in a spherical phase space, analogous to the Bloch sphere, for spin-1 observables (Fig. 1b). We focus on a system initialized with all atoms in m = 0: that is, polarized along the Q0 axis. The effect of the cavity-mediated interactions is to twist the quasiprobability distribution of this initial state about the Fx axis, inducing squeezing36. Simultaneously, the quadratic Zeeman effect generates so-called spinor rotations about the Q0 axis, mapping states along Fx to polarized states of the quadrupole operator Qyz after a rotation of 90°. The early-time dynamics explored in our experiments are well described by approximating a patch of the sphere as a two-dimensional phase space spanned by the conjugate observables \(x={F}^{\;x}/\sqrt{CN}\) and \(p={Q}^{\;yz}/\sqrt{CN}\), which are normalized such that the Heisenberg uncertainty relation for x and p is \({{{\rm{Var}}}}\left(x\right){{{\rm{Var}}}}\left(p\right)\ge 1\). The contrast C, set by the commutator \(\left\vert \left\langle [{F}^{\;x},{Q}^{\;yz}]\right\rangle \right\vert =2CN\), accounts for imperfect polarization along the Q0 axis.

We engineer entanglement in an array of four atomic ensembles (Fig. 1a), each containing up to 5 × 103 Rubidium-87 atoms in the f = 1 hyperfine manifold. The ensembles are placed near the centre of a near-concentric optical cavity with a Rayleigh range of 0.9 mm and are spaced by 250 μm. Applying a drive field to the cavity for 50 μs generates spin-nematic squeezing in the symmetric mode that directly couples to the cavity. To read out each ensemble i in a specified quadrature \({x}_{i}\cos \phi -{p}_{i}\sin \phi\), we map this quadrature onto the spin component Fx via a spinor rotation by an angle ϕ. A subsequent spin rotation converts this signal into a population difference between Zeeman states, which we detect by fluorescence imaging.

To verify the generation of spin-nematic squeezing, we measure the variance \({\zeta }^{\;2}={{{\rm{Var}}}}\left(x\cos \phi -p\sin \phi \right)\) for the symmetric mode x+ = ∑ixi/2 of all four ensembles. As shown in Fig. 2a, we measure a minimum value ζ2 = 0.52 ± 0.07, limited primarily by technical noise (see Supplementary Information). We confirm the presence of entanglement by evaluating the Wineland squeezing parameter ξ2 = ζ2/C = 0.63 ± 0.08. Values below the standard quantum limit ξ2 = 1, shown by the dashed line at ζ2 = C, indicate enhanced metrological sensitivity compared to any unentangled state of N atoms10,37 (see Supplementary Information). We calibrate N from measurements of the atomic projection noise (Extended Data Fig. 1) and determine C from measured populations in the three Zeeman states (Methods, ‘Measurement of contrast C’).

Fig. 2: Global squeezing and entanglement between subsystems.
figure 2

a, Cavity-mediated interactions lead to squeezing of the symmetric mode (red circles) below the standard quantum limit (SQL, dashed line). The antisymmetric mode (blue squares) does not couple to the cavity and remains approximately in a coherent state. Multiplying values of the variance ζ2 for the squeezed quadrature \({x}_{+}^{{\prime} }\) of the symmetric mode and the orthogonal quadrature \({p}_{-}^{{\prime} }\) of the antisymmetric mode yields the entanglement witness W. Inset, green ellipse shows area \(\sqrt{W}\), smaller than dashed circular region representing minimum-uncertainty unentangled state. b, Analysing the left and right subsystems separately (yellow squares and purple circles) yields a degradation in squeezing, consistent with neglecting information contained in correlations between the subsystems. Error bars show 1 s.d. confidence intervals extracted via jackknife resampling. Shaded curves show the 1 s.d. confidence intervals of sinusoidal fits to the data.

Source data

To demonstrate that only the symmetric mode couples to the cavity, we also evaluate the variance ζ2 for the mode \({x}_{-}=({x}_{{\mathrm{L}}}-{x}_{{\mathrm{R}}})/\sqrt{2}\), which is antisymmetric under the exchange of the left two ensembles xL and the right two ensembles xR. As expected, the variance for the antisymmetric mode shows no statistically significant dependence on ϕ and has an average value ζ2 = 1.14 ± 0.04 near the quantum projection noise level.

We confirm the long-range character of the entanglement by evaluating a witness for entanglement38 between the left and right subsystems

$$W={{{\rm{Var}}}}\left({x}_{+}^{{\prime} }\right){{{\rm{Var}}}}\left(\;{p}_{-}^{{\prime} }\right).$$
(2)

Here, \({x}_{+}^{{\prime} }\) denotes the squeezed quadrature in the symmetric mode and \({p}_{-}^{{\prime} }\) is the corresponding conjugate observable in the antisymmetric mode. Generically, W can take on any value since \({x}_{+}^{{\prime} }\) and \({p}_{-}^{{\prime} }\) commute. However, in the absence of correlations between the left and right subsystems, their independent Heisenberg uncertainty relations impose the constraint W ≥ 1, such that values W < 1 imply entanglement. The uncertainty product from the data in Fig. 2a is W = 0.55 ± 0.10, witnessing entanglement between the left and right subsystems.

Consistent with the entanglement between subsystems, we observe a degradation in squeezing when measuring each subsystem individually, as shown in Fig. 2b. To further highlight that the left and right subsystems are in locally mixed states, we quantify the increase in phase space area due to the mutual information between them. For Gaussian states, the phase space area Am = ζminζmax for a mode m is the product of the standard deviations of the squeezed and antisqueezed quadratures. Local measurements that discard correlations between the left and right subsystems yield a total phase space volume ALAR = 3.7 ± 0.4, larger than the total phase space volume A+A = 2.2 ± 0.3 for global measurements of the symmetric and antisymmetric modes. This emphasizes the loss of information when ignoring correlations between the local subsystems.

To optimize squeezing within each subsystem—for example, for certain applications in spatially resolved sensing25—the correlations between subsystems should be removed while maintaining the entanglement internal to each subsystem. Combining the global spin-nematic squeezing with local rotations provides the requisite control of the entanglement structure. To disentangle the left and right subsystems, we perform a sequence akin to spin echo, as shown in Fig. 3a. Between two pulses of interactions, we rotate the spins of the right subsystem by 180° by optically imprinting a local vector a.c. Stark shift (Methods, ‘Global and local control over spin orientation’). The effect is to cancel out interactions between the two subsystems, leaving only local squeezing (Fig. 3c). The scheme can equivalently be viewed as squeezing both the symmetric and antisymmetric modes in the same quadrature (Fig. 3b).

Fig. 3: Tunable entanglement: from local squeezing to EPR correlations.
figure 3

a, Scheme for controlling the strength of entanglement between left (L) and right (R) subsystems of the four-site array. After squeezing the symmetric mode (red), we transfer the squeezing into the antisymmetric mode (blue) by applying a local 180° spin rotation (green) to the right subsystem. Next, a global spinor rotation (purple) adjusts the angle of the squeezed quadrature. Finally, a second interaction pulse produces squeezing in the symmetric mode. The relative angle Φ between the squeezed axes of the collective modes determines the form of entanglement. b, To disentangle the left and right subsystems, we choose a relative phase Φ = 0 between the squeezed axes of the symmetric (red circles) and antisymmetric (blue squares) modes. c, Entanglement internal to each subsystem manifests in variances ζ2 = 0.41 ± 0.06 and ζ2 = 0.38 ± 0.07 for the left and right subsystems (yellow squares and purple circles), respectively. d, To generate EPR entanglement between the left and right subsystems, we choose a relative angle Φ = 90° between squeezed quadratures of the collective modes. The variances ζ2 = 0.50 ± 0.07 and ζ2 = 0.46 ± 0.08 for orthogonal quadratures of the symmetric and antisymmetric modes yield an entanglement witness W = 0.23 ± 0.05 < 1. e, Representation of the resulting EPR entangled state as a graph state, corroborated by the reconstructed correlation matrix \({{{\rm{Corr}}}}\left({x}_{i},{p}_{j}\right)\).

Source data

More broadly, applying a sequence of squeezing operations in the basis of collective modes enables control over the spatial structure of entanglement via the relative orientations of the squeezed quadratures. Whereas a relative phase Φ = 0 between the squeezed quadratures of the symmetric and antisymmetric modes disentangles the left and right subsystems, the entanglement between subsystems can alternatively be maximized by introducing a relative phase Φ = 90° via a spinor rotation in the sequence shown in Fig. 3a. The 90° phase improves the entanglement witness W in equation (2) by producing simultaneous squeezing of both \({x}_{+}^{{\prime} }\) and \({p}_{-}^{{\prime} }\). The resulting variances, shown in Fig. 3d, yield an entanglement witness W = 0.23 ± 0.05. The presence of squeezing in both orthogonal quadratures is indicative of entanglement of the paradigmatic EPR type.

A notable feature of the EPR entangled state is its capacity for steering, in which measurements of one subsystem can predict measurements of both quadratures of the other subsystem to better than the local Heisenberg uncertainty product. Steering is a stricter condition than entanglement and enables teleportation of quantum information39. To witness the left subsystem steering the right, we use measurements of the left subsystem to estimate \({x}_{\text{R}}^{{\prime} }\) and \({p}_{\text{R}}^{{\prime} }\) and calculate the error of the inference after subtracting a small detection noise contribution (Methods, ‘Steering criterion’). The product of conditional variances \({{{\rm{Var}}}}\left({x}_{\text{R}}^{{\prime} }| {x}_{\text{L}}^{{\prime} }\right){{{\rm{Var}}}}\left({p}_{\text{R}}^{{\prime} }| {p}_{\text{L}}^{{\prime} }\right)=0.68\pm 0.18\) is less than one, the local Heisenberg uncertainty bound. The comparable witness for the right subsystem steering the left is 0.66 ± 0.18. We thus establish bidirectional steering at the 92% confidence level, which justifies identifying the state as a continuous-variable EPR state.

Our preparation of the EPR state constitutes a minimal instance of a scalable protocol for preparing graph states, in which the edges of the graph denote quantum correlations between conjugate observables on connected sites. Mathematically, this defining property of an ideal graph state can be expressed as

$${{{\rm{Var}}}}\left({p}_{i}-\mathop{\sum}\limits_{j}{A}_{ij}{x}_{j}\right)\to 0,$$
(3)

where the adjacency matrix A encodes the connectivity of the graph. As a general recipe for preparing a specified graph state, we diagonalize the adjacency matrix A to obtain a set of eigenvectors representing collective modes that should be squeezed. For each eigenmode m, the corresponding eigenvalue λm specifies the orientation \({\phi }_{m}={{{\rm{arccot}}}}\,{\lambda }_{m}\) of the squeezed quadrature.

The graph representing the two-mode EPR state is shown in Fig. 3e and corresponds to an adjacency matrix

$$A=\left[\begin{array}{cc}0&1\\ 1&0\end{array}\right].$$
(4)

Diagonalizing A yields a state-preparation protocol that matches the scheme of Fig. 3a: the eigenmodes of A are the symmetric and antisymmetric modes, while the eigenvalues λ± = ±1 indicate that the squeezed quadratures should be oriented at ϕ± = ±45°, consistent up to a global rotation with the squeezing curves in Fig. 3d. Henceforth we work in a globally rotated basis chosen to orient the squeezed quadratures at the angles ϕm. To visualize the equivalence of squeezing the collective modes with engineering the graph of entanglement, we use the data from Fig. 3d to reconstruct the correlations between conjugate variables in the two subsystems

$${{{\rm{Corr}}}}\left({x}_{i},{p}_{j}\right)=\frac{{{{\rm{Cov}}}}\left({x}_{i},{p}_{j}\right)}{\sqrt{{{{\rm{Var}}}}\left({x}_{i}\right){{{\rm{Var}}}}\left({p}_{j}\right)}},$$
(5)

where \({{{\rm{Cov}}}}\left(x_i,p_j\right)\) denotes the covariance (Methods, ‘Correlation matrix reconstruction’). These correlations, shown in Fig. 3e, agree with the adjacency matrix A.

We additionally directly probe the graph of the EPR state by measuring the variances of the nullifiers ni = pi − ∑j Aij xj in equation (3). As the ideal limit of zero variance requires infinitely strong squeezing, a practical definition of a graph state is that the variances of the nullifiers should approach zero in the limit of perfect squeezing. Defining normalized variances

$${v}_{i}=\frac{{\rm{Var}}\left({n}_{i}\right)}{1+\mathop{\sum}\limits_{j}{A}_{ij}^{2}}$$
(6)

such that vi = 1 for a coherent state, our state-preparation protocol theoretically produces variances vi = ζ2 assuming equal squeezing of all eigenmodes. Experimentally, we access each nullifier ni by performing a local 90° spinor rotation on subsystem i. For the two-mode EPR state, with nL = pL − xR and nR = pR − xL, we measure variances vL = 0.53 ± 0.11 and vR = 0.36 ± 0.09 (Extended Data Fig. 3), directly confirming the entanglement structure specified by the graph.

To illustrate the scaling to more complex graphs, we produce the square graph state shown in Fig. 4a, with adjacency matrix

$$A=\left[\begin{array}{cccc}0&1&0&1\\ 1&0&1&0\\ 0&1&0&1\\ 1&0&1&0\end{array}\right].$$
(7)

The eigenbasis of A is shown in Fig. 4b. The eigenvalues \({\lambda }_{m}=\left(2,0,0,-2\right)\) specify squeezing angles \({\phi }_{m}=\left(2{7}^{\circ },9{0}^{\circ },9{0}^{\circ },15{3}^{\circ }\right)\) for the four eigenmodes. We sequentially couple each eigenmode to the cavity with the aid of local spin rotations, analogously to the scheme in Fig. 3a, squeezing the desired quadrature of each mode via global cavity-mediated interactions followed by a global spinor rotation (Extended Data Fig. 2). The result is shown in Fig. 4b, where the orientation of the squeezed quadrature for each eigenmode is within 5° of the target squeezing angle ϕm. Reconstructing the correlations \({{{\rm{Corr}}}}\left({x}_{i},{p}_{j}\right)\) between sites from these measurements of the collective modes yields the matrix shown in Fig. 4c, which is consistent with the target adjacency matrix.

Fig. 4: Generation of a square graph state.
figure 4

a, Diagram of four-mode square graph state and theoretical correlation matrix \({{{\rm{Corr}}}}\left({x}_{i},{p}_{j}\right)\propto {A}_{ij}\). b, Left, schematic illustration of eigenmodes of the adjacency matrix A and the corresponding squeezing ellipses, with orientations specified by eigenvalues \({\lambda }_{m}=\cot {\phi }_{m}\). Right, measured variances ζ2 in the four eigenmodes, showing squeezing at the specified spinor phases ϕm (black dashed lines). Error bars show 1 s.d. confidence interval. c, Top, directly measured variances vi of the nullifiers, with schematics showing central node i (dark grey circle) and neighbours (black circles) contributing to each nullifier. Bottom, correlation matrix reconstructed from the measurement results in b.

Source data

We additionally directly measure the nullifiers ni for the square graph state. Their normalized variances vi, listed in Fig. 4c, have an average value 0.63 ± 0.07 consistent with the squeezing ζ2 of the collective modes. Each nullifier further satisfies a condition vi < 0.94, ruling out separability into the independent nodes of the graph (Methods, ‘Entanglement detection in graph states’), highlighting the presence of spatial entanglement between the four ensembles.

Our scheme for preparing graph states generalizes to any method of generating global entanglement that can be combined with local rotations. The approach is scalable to larger arrays, requiring only M squeezing operations to prepare arbitrary M-node graph states. For atoms in a cavity, the rate of each squeezing operation is collectively enhanced by the number of modes, such that the total interaction time required is independent of array size (see Supplementary Information). Similarly, the degree of squeezing per mode is fundamentally limited only by the collective cooperativity per ensemble. In practice, scaling to larger arrays will require addressing technical noise sources to which we become increasingly sensitive with increasing total atom number (see Supplementary Information).

Combining our approach with cavity-mediated generation of non-Gaussian states11,12,40 or atom counting41,42,43,44 opens prospects in continuous-variable quantum computation. Proposals for fault-tolerant measurement-based quantum computation with continuous-variable graph states assume initial squeezing of 15–20.5 dB (ref. 45), which has already been demonstrated with cavity-based spin squeezing8,46. The programmable multimode squeezing demonstrated here is additionally a resource for quantum-enhanced measurements24,25. Applications include optimal sensing of spatially correlated fields47 and simultaneous sensing of displacements in conjugate variables48 for use in vector magnetometry.

Our protocol can be extended to a variety of platforms where either bosonic modes or qubits form the nodes of the graph and a central ancilla mediates collective interactions. Opportunities include generating continuous-variable graph states in multimode optomechanical systems49 or in superconducting circuits featuring multiple microwave or acoustic modes coupled to a single qubit50,51; and discrete-variable graph states of individual atoms, superconducting qubits52 or ions53 with photon- or phonon-mediated interactions. Our approach offers the benefit of programmable connectivity and prospects for leveraging the central ancilla to perform quantum non-demolition measurements with applications in computation, error correction and continuous quantum sensing.

Methods

Definition of spin and quadrupole operators

While for spin-1/2 particles all single-particle spin operators can be written as a linear combination of the dipole moments fx, fy and fz, the space of spin-1 operators additionally includes quadrupole operators defined as \({q}^{\alpha \beta }={f}^{\;\alpha }{f}^{\;\beta }+{f}^{\;\beta }{f}^{\;\alpha }-\frac{4}{3}{\delta }_{\alpha \beta }\), where α, β {x, y, z} and δαβ is the Kronecker delta function3. For plotting the state on the generalized Bloch sphere, we use the operator \({q}^{0}={q}^{zz}+\frac{1}{3}\), which quantifies the population difference between the m = 0 state and the m = ±1 states. We additionally construct collective observables \({F}^{\alpha }=\mathop{\sum }\nolimits_{i}^{N}{f}_{i}^{\;\alpha }\) and \({Q}^{\alpha \beta }=\mathop{\sum }\nolimits_{i}^{N}{q}_{i}^{\alpha \beta }\) corresponding to each spin-1 operator in a system of N atoms.

State preparation

To prepare the array of four atomic ensembles in an optical cavity, we initially load 87Rb atoms from a magneto-optical trap into an array of optical dipole traps, each with a waist of 6 μm. After optically pumping the atoms into the \(\left\vert\;f=2,m=-2\right\rangle\) state, the ensembles are transferred into a 1,560 nm intracavity optical lattice. Further details of the trapping procedure are described in ref. 20. The atoms are then evaporatively cooled by decreasing the lattice depth from U0 = h × 14 MHz to U0 = h × 175 kHz in 200 ms. A series of composite microwave pulses54 is used to transfer the atoms from \(\left\vert 2,-2\right\rangle\) to \(\left\vert 1,0\right\rangle\). Any remaining population in the \(\left\vert 1,\pm 1\right\rangle\) states is removed by first transferring this population into the \(\left\vert\; f=2\right\rangle\) manifold using microwave pulses and then applying resonant light to push and heat the \(\left\vert\; f=2\right\rangle\) population out of the lattice. The lattice is then ramped up to a depth of U0 = h × 25 MHz to minimize atom loss and increase confinement during the interaction phase of the sequence, yielding a final temperature T = 80 μK in the lattice. During the interaction phase of the experiment, the ratio of the lattice depth to atomic temperature is U0/(kBT) = 15 for an ensemble at the centre of the cavity, where kB is the Boltzmann constant.

Interactions and cavity parameters

The spin-exchange interactions between atoms are mediated by a near-concentric Fabry–Perot cavity with length 2R − d, where R = 2.5 cm is the radius of curvature of the mirrors and d = 70 μm. The drive field is detuned from the \(\left\vert 5{S}_{1/2},f=1\right\rangle \to \left\vert 5{P}_{3/2}\right\rangle\) transition by Δ = −2π × 9.5 GHz, after accounting for the a.c. Stark shift of the excited state due to the 1,560 nm lattice. At the drive wavelength of 780 nm, the cavity mode has a Rayleigh range zR = 0.93 mm and waist w0 = 15 μm, resulting in a vacuum Rabi frequency 2g = 2π × 3.0 MHz. Comparing with the cavity linewidth κ = 2π × 250 kHz and atomic excited-state linewidth Γ = 2π × 6.1 MHz yields a single-atom cooperativity \({\eta }_{0}=4{g}^{2}/({\kappa \varGamma})=6.1\) for a maximally coupled atom at cavity centre.

We parameterize the dispersive atom-light coupling by the vector a.c. Stark shift per intracavity photon, which for a maximally coupled atom is \({\Omega }_{0}=-{g}^{2}/(6\Delta)=2\pi \times 41\) Hz. As the array of atomic ensembles spans a length of 750 μm along the cavity axis, centred at the focus of the cavity mode, the maximally coupled ensembles experience a 30% larger Stark shift than the two minimally coupled ensembles. In addition, thermal motion of the atoms in the lattice means that the average atom experiences a reduced single-photon Stark shift compared with an on-axis atom at an antinode, resulting in a thermally averaged single-photon Stark shift Ω = 2π × 27 Hz.

Our method of generating cavity-mediated interactions is described in refs. 35,55. The interactions are controlled by a drive field detuned from cavity resonance by an amount δc. This corresponds to detunings δ± = δcωz from two virtual Raman processes in which a collective spin flip is accompanied by emission of a photon into a cavity, where ωz is the Zeeman splitting. Rescattering of this photon into the drive mode is accompanied by a second collective spin flip, producing resonant spin-exchange processes of collective interaction strength

$${\chi }^{\pm }=N\overline{n}\frac{{\Omega }^{2}}{2}\frac{{\delta }_{\pm }}{{\delta }_{\pm }^{2}+{\left(\frac{\kappa }{2}\right)}^{2}},$$
(8)

where N is the total number of atoms and \(\overline{n}\) is the intracavity photon number55. We operate in a magnetic field of 4.1 G perpendicular to the cavity axis, corresponding to a Larmor frequency ωz = 2π × 2.9 MHz. The drive light is typically detuned by 2π × 4.2 MHz from the shifted cavity resonance so that δ = −2π × 1.3 MHz and δ+ = −2π × 7.1 MHz. We define a total interaction strength χ = χ + χ+. The drive light produces a typical intracavity photon number \(\overline{n}=800\). A representative atom number N = 1.5 × 104 yields a collective interaction strength χ = −2π × 4 kHz. Exact parameters for each data set are detailed in Extended Data Table 1. The parameters were selected to optimize squeezing, as discussed in Supplementary Information.

Global and local control over spin orientation

To access different quadratures of the squeezed states generated in our experiments and to adjust the relative squeezing angles of the collective modes, we apply global rotations about the Q0 axis by two different methods. In the first method we let the system evolve under the quadratic Zeeman shift q = 2π × 1.2 kHz. Alternatively, we apply a detuned 2π microwave pulse on the hyperfine clock transtion \(\left\vert\; f=1,m=0\right\rangle \leftrightarrow \left\vert\; f=2,m=0\right\rangle\). For a suitable choice of detuning δmw and microwave Rabi frequency Ωmw, the imparted phase is \(\phi =\pi (1-{\delta }_{{{{\rm{mw}}}}}/\sqrt{{\Omega }_{{{{\rm{mw}}}}}^{2}+{\delta }_{{{{\rm{mw}}}}}^{2}})\). This latter technique reduces the time required to rotate the orientation of the squeezed state before the final readout, since the Rabi frequency Ωmw = 2π × 7.5 kHz is much larger than the quadratic Zeeman shift. However, inhomogeneities in the microwave Rabi frequency on different ensembles can lead to unwanted population transfer from \(\left\vert 1,0\right\rangle\) to \(\left\vert 2,0\right\rangle\), which shifts the cavity resonance for subsequent interaction periods. Therefore, in sequences employing multiple drive field pulses to squeeze different collective modes, we use only the rotation under quadratic Zeeman shift to adjust the squeezing angle.

We apply local spin rotations around Fy to read out the observables x and p and rotations about Fz to transform between collective modes. For these rotations, we use circularly polarized light that is blue-detuned from the \(\left\vert 5{S}_{1/2},f=1\right\rangle \to \left\vert 5{P}_{3/2}\right\rangle\) transition by 120 GHz. The laser beam is perpendicular to the cavity axes and is focused to individually address a single atomic ensemble, which we select by controlling the position of the beam via an acousto-optical deflector. The angle between the magnetic field, which defines our quantization axis, and the propagation direction of the laser is chosen to be 70°. The circular component parallel to the magnetic field induces a vector a.c. Stark shift that acts as an artificial magnetic field, generating local rotations about Fz. Rotations by 180° about Fz flip the sign of both Fx and Qyz on selected ensembles. We thus utilize these rotations to transfer squeezing between orthogonal collective modes, as shown in Fig. 3a. For this transfer, we simultaneously address two ensembles and induce the required spin rotation in approximately 18 μs.

The same laser allows for driving Raman transitions within the f = 1 hyperfine manifold, as the circular polarization component orthogonal to the magnetic field acts as an effective transverse field. Specifically, we use an arbitrary waveform generator to modulate the drive amplitude of an acousto-optical modulator, and thus the power of the laser, at the Larmor frequency. This radio frequency modulation induces spin rotations about an axis in the Fx − Fy plane. Since there is no prior phase reference, we define the rotation to be around Fy so that a π/2 pulse maps Fx onto a population difference between Zeeman states.

To avoid differential evolution of the spinor phase ϕ, we typically perform global Raman rotations by simultaneously addressing all four ensembles (except for the direct measurement of the nullifiers described in ‘Direct nullifier measurements’). In this setting, we achieve a global Rabi frequency of ΩRaman = 2π × 12.5 kHz.

Readout and fluorescence imaging

We characterize the multimode entangled states in our experiment by state-sensitive fluorescence imaging. To read out a specified quadrature in the x–p plane (where xFx and pQyz), we first perform a global spinor rotation by a variable angle ϕ and subsequently perform a 90° spin rotation about Fy to convert Fx to Fz. The implementations of these rotations are described in ‘Global and local control over spin orientation’. To ensure that the rotation angle stays close to 90° during the whole duration of our experiments, we calibrate the frequency of the Rabi oscillation every hour.

For the data shown in Figs. 2 and 3, where each subsystem (left and right) consists of two atomic ensembles, we modify the readout to minimize the impact of global technical fluctuations. Specifically, we apply a local 180° rotation about one of the ensembles in each subsystem before the final spin rotation, thereby mapping the symmetric mode onto one that involves a differential measurement of Fz between ensembles. Similarly, the antisymmetric mode is mapped onto a mode that remains robust against technical noise.

To measure the atomic state populations, we collect a sequence of four images, with one detecting any population in the f = 2 hyperfine manifold and the remaining three images detecting the populations in the three magnetic substates m = 0, ±1 within the f = 1 manifold. For this portion of the experimental sequence, we lower the power of the 1,560 nm trapping laser to reduce the a.c. Stark shift of the electronically excited 5P3/2 state and reconfine the atoms in the microtraps. We apply two counterpropagating laser beams resonant with the \(f=2\to {f}^{\;{\prime} }=3\) transition of the D2 line and collect the resulting fluorescence signal on an electron-multiplying charge-coupled device (EMCCD) camera. To avoid interference of the two imaging beams, we switch them on one at a time for 3 μs each and alternate between the two beams for 126 μs per image. After this time, most of the atoms in f = 2 have escaped the trapping potential due to heating, and we switch on one of the imaging beams for 150 μs to remove any residual atoms in f = 2. To measure the atoms in the remaining states, we transfer the population in the desired state to the f = 2 manifold via microwave pulses and repeat the imaging sequence above. To reduce the sensitivity of this transfer to magnetic field noise and microwave power fluctuations, we use a composite pulse that involves a sequence of four microwave pulses with different relative phases54.

To calibrate the conversion from fluorescence signal to atom number, we employ a measurement of the atomic projection noise. We prepare N atoms in a superposition of m = ±1 by initializing all atoms in m = 0 and then rotating by 90° about Fy. To isolate the projection noise, we vary the atom number N = N+1 + N−1 and measure the variance of the population difference N+1 − N−1. Extended Data Fig. 1 shows these data in units of camera counts for each of the four collective modes. For each mode, we perform a polynomial fit

$${{{\rm{Var}}}}\left({c}_{+1}-{c}_{-1}\right)={a}_{0}+{a}_{1}\left\langle {c}_{+1}+{c}_{-1}\right\rangle +{a}_{2}{\left\langle {c}_{+1}+{c}_{-1}\right\rangle }^{2},$$
(9)

where cm denotes the signal from atoms in state m. The linear coefficient a1 = r + g includes the count-to-atom conversion factor r and an additional contribution gr from photon shot noise, augmented by the excess noise of the electron-multiplying charge-coupled device (EMCCD). From the fit value a1 = 415 ± 6 and an independent calibration of g = 20, we obtain the conversion factor r = 395 ± 6 counts per atom. This calibration is consistent with an independent measurement of the dispersive cavity shift δN = 4 due to N atoms.

The fit offset a0 and quadratic component a2 provide information, respectively, about the imaging noise floor and technical noise in the fluorescence readout. The quadratic component of the fits in Extended Data Fig. 1 determines the atom number N ≈ 1/a2 at which technical fluctuations become comparable to the projection noise. For the mode with the highest technical fluctuations, we find a quadratic component a2 = 5 × 10−5. We therefore limit the maximal atom number in the experiment to N 2 × 104 to ensure that projection noise dominates over technical fluctuations. For our typical atom numbers, the background noise a0 is small compared with the photon shot noise, the latter being equivalent to a fraction g/r ≈ 0.05 of the atomic projection noise. For the direct measurement of the nullifiers in Fig. 4 and the EPR steering, we subtract the photon shot noise contribution from the measured variances.

Measurement of contrast C

To compute the normalized variance \({\zeta }^{\,2}={{{\rm{Var}}}}\left({F}^{\,x}\right)/(CN\,)\), we extract the contrast C from the same data set as the variance of Fx. Specifically, in terms of the Zeeman state populations \({N}_{m}^{{\prime} }\) after the readout spin rotation, we measure both the spin component \({F}^{\,x}={N}_{+1}^{{\prime} }-{N}_{-1}^{{\prime} }\) and the quadrupole moment \({Q}^{\;xx}=2({N}_{+1}^{{\prime} }+{N}_{-1}^{{\prime} }-2{N}_{0}^{{\prime} })/3\). The quadrupole moment Qxx is directly proportional to the contrast C in our Larmor-invariant system.

In the most general case, the contrast C may be expressed exactly in terms of the collective quadrupole moments as

$$C=\frac{| \left\langle [{F}^{\;x},{Q}^{\;yz}]\right\rangle | }{2N}=\frac{| \left\langle {Q}^{\;zz}\right\rangle -\left\langle {Q}^{\;yy}\right\rangle | }{2N}.$$
(10)

The quantum states produced in our experiment are invariant under global Larmor rotations (see Supplementary Information), allowing us to equate the expectation values \(\left\langle {Q}^{\,xx}\right\rangle =\left\langle {Q}^{\,yy}\right\rangle\). Further, the three quadrupole moments sum to zero, Qxx + Qyy + Qzz = 0, as can be seen in ‘Definition of spin and quadrupole operators’.

We can thus re-express the contrast as

$$C=\frac{3\left\vert \left\langle {Q}^{\,xx}\right\rangle \right\vert }{2N}=\frac{{N}_{+1}^{{\prime} }+{N}_{-1}^{{\prime} }-2{N}_{0}^{{\prime} }}{N}.$$
(11)

We use this expression to normalize all variances reported in the main text.

Steering criterion

To confirm EPR steering, we show that a measurement on the right subsystem can be used to infer the measurement results in the left subsystem with a higher precision than permitted by the local Heisenberg uncertainty relation. To calculate the error of the inference of an observable O of the left subsystem conditioned on measurements of the right subsystem, we find weights gi that minimize the conditional variance

$${{{\rm{Var}}}}\left({O}_{{\mathrm{L}}}| {O}_{{\mathrm{R}}}\right)={{{\rm{Var}}}}\left({O}_{{\mathrm{L}}}-\mathop{\sum}\limits_{i\in R}{g}_{i}{O}_{i}\right),$$
(12)

where i indexes ensembles within the right subsystem and the weights gi capture inhomogeneities in coupling for different ensembles. For the EPR-steered state, these variances are minimized for the \({x}^{{\prime} }\) and \({p}^{{\prime} }\) observables. We measure EPR steering in both directions, requiring inferences in two directions and two quadratures. The values of all of the conditional variances, after subtracting a small photon shot noise contribution as calibrated in ‘Readout and fluorescence imaging’, are summarized in Extended Data Table 2. We also report the optimal values of gi for each inference. For most of the inferences, higher weight is given to the ensemble closest to the centre of the cavity, which we attribute to the difference in atom-light coupling for different ensembles.

Graph state generation

Our prescription for preparing graph states rests on diagonalizing the adjacency matrix A, with the resulting eigenvectors specifying collective modes to squeeze and the eigenvalues specifying the squeezed quadratures. Formally, the diagonal matrix Λ of eigenvalues λm is related to the adjacency matrix A by

$$A={V}^{-1}\varLambda V,$$
(13)

where the columns of V represent the eigenmodes. In terms of the quadrature operators x = (x1, …, xM) and p = (p1, …, pM) on the individual sites, each eigenmode is parameterized by collective quadrature operators \(\tilde{{{{\bf{x}}}}}=V{{{\bf{x}}}}\) and \(\tilde{{{{\bf{p}}}}}=V{{{\bf{p}}}}\). Re-expressing equation (3) in terms of these collective modes

$${{{\rm{Var}}}}\left(\tilde{{{{\bf{p}}}}}-\varLambda \tilde{{{{\bf{x}}}}}\right)\to 0$$
(14)

shows that the antisqueezed axis for each mode lies along the line \({\tilde{p}}_{m}={\lambda }_{m}{\tilde{x}}_{m}\). Thus, the squeezed quadrature is oriented at a spinor phase \({\phi }_{m}={{{\rm{arccot}}}}\,{\lambda }_{m}\).

The experimental sequence for preparing the square graph state is presented in Extended Data Fig. 2. For this graph,

$$V=\frac{1}{2}\left[\begin{array}{cccc}1&1&1&1\\ 1&1&-1&-1\\ 1&-1&-1&1\\ 1&-1&1&-1\\ \end{array}\right],$$
(15)

where the columns have eigenvalues λm = (2, 0, 0, −2) corresponding to the angles ϕm = (27°, 90°, 90°, 153°). We choose angles Φ1,2,3 for the global spinor rotations so that each mode is squeezed along the appropriate axis at the end of the sequence. Schematically, we incorporate the global spinor rotations that occur during the pair creation dynamics and Larmor rotations into these angles.

Our approach of squeezing the eigenmodes of the adjacency matrix allows for generating arbitrary graph states. In the most general case, the eigenmodes may have weighted couplings to the cavity, which could be controlled via the positions or populations of the array sites, or by driving the cavity from the side with a spatially patterned field. However, even with equally weighted couplings to the cavity, a wide variety of graphs are accessible by squeezing eigenmodes of the form \({V}_{jm}=\exp (i{\varphi }_{jm})/\sqrt{M}\). The phases φjm can be imprinted by local spin rotations, generalizing the 180° rotations applied in this work. For translation-invariant graphs, the eigenmodes are spin waves with φjm = j(2πm/M), and a magnetic field gradient suffices to transform between them.

Correlation matrix reconstruction

The definition of a graph state in equation (3) considers an ideal limit of infinite squeezing. In the following, we elaborate on the definition of the adjacency matrix for realistic states with finite squeezing and show that the square graph state generated in our experiment is consistent with this definition. The adjacency matrix that best describes a given state is the one that minimizes \({{{\rm{Var}}}}\left({{{\bf{p}}}}-A{{{\bf{x}}}}\right)\), which is given by

$${A}_{ij}={{{\rm{Cov}}}}\left({p}_{i},{x}_{j}\right)/{{{\rm{Var}}}}\left({x}_{j}\right).$$
(16)

Since A is necessarily symmetric, we also have \({A}_{ij}\propto {{{\rm{Cov}}}}\left({x}_{i},{p}_{j}\right)\). Thus, the correlations between sites in the x and p bases directly reveal the adjacency matrix.

To reconstruct the correlation matrices in Figs. 3e and 4c from measurements of the collective modes, we use a transformation of basis to express the covariance matrix in equation (5) as

$${{{\rm{Cov}}}}\left({x}_{i},{p}_{j}\right)={V}_{im}^{-1}\,{{{\rm{Cov}}}}\left({\tilde{x}}_{m},{\tilde{p}}_{{m}^{{\prime} }}\right){V}_{{m}^{{\prime} }j},$$
(17)

where we sum over the repeated indices m and \({m}^{{\prime} }\). The variances of x and p transform analogously.

In the case of equal couplings to the cavity and equal atom number in each ensemble, the eigenmodes are independent and \({{{\rm{Cov}}}}\left(\tilde{{{{\bf{x}}}}},\tilde{{{{\bf{x}}}}}\right),{{{\rm{Cov}}}}\left(\tilde{{{{\bf{p}}}}},\tilde{{{{\bf{p}}}}}\right)\) and \({{{\rm{Cov}}}}\left(\tilde{{{{\bf{x}}}}},\tilde{{{{\bf{p}}}}}\right)\) are all diagonal. We use this assumption to extract all relevant information about the state by measuring the covariance matrix

$${c}_{m}=\left(\begin{array}{cc}{{{\rm{Var}}}}\left({\tilde{x}}_{m}\right)&{{{\rm{Cov}}}}\left({\tilde{x}}_{m},{\tilde{p}}_{m}\right)\\ {{{\rm{Cov}}}}\left({\tilde{p}}_{m},{\tilde{x}}_{m}\right)&{{{\rm{Var}}}}\left({\tilde{p}}_{m}\right)\end{array}\right)$$
(18)

for each individual eigenmode. From the variances \({\zeta }_{\min ,m}^{2}\) and \({\zeta }_{\max ,m}^{2}\) in each collective mode and the orientation ϕm of the squeezed quadrature, we calculate the covariance matrix as

$${c}_{m}={R}^{T}({\phi }_{m})\left(\begin{array}{cc}{\zeta }_{\min ,m}^{2}&0\\ 0&{\zeta }_{\max ,m}^{2}\end{array}\right)R({\phi }_{m}),$$
(19)

where R is a 2 × 2 rotation matrix.

Direct nullifier measurements

To confirm the efficacy of our graph state generation method, we directly measure the nullifiers n = p − Ax and their variances. This measurement requires simultaneously measuring some sites in the p basis and others in the x basis. To perform this readout for the two-mode graph state, we first apply a variable spinor rotation ϕ to set the measurement basis globally and then apply a 90° readout rotation about Fy only to ensembles 1 and 2. This sequence maps the observable \({{{{\mathcal{Q}}}}}_{\text{L}}=-{x}_{\text{L}}\cos \phi +{p}_{\text{L}}\sin \phi\) onto a population difference between Zeeman states. Subsequent evolution under the quadratic Zeeman shift thus affects only the measurement basis in ensembles 3 and 4. After a 90° rotation about the Q0 axis, we apply a second Raman rotation to the remaining ensembles to enable readout of the observable \({{{{\mathcal{P}}}}}_{\text{R}}={x}_{\text{R}}\sin \phi +{p}_{\text{R}}\cos \phi\). The results are shown in Extended Data Fig. 3a, where the red/blue data points represent normalized variances of the sum/difference \({{{{\mathcal{N}}}}}_{\pm }={{{{\mathcal{Q}}}}}_{\text{L}}\pm {{{{\mathcal{P}}}}}_{\;\text{R}}\). The nullifiers are given by \({n}_{\text{R}}={p}_{\text{R}}-{x}_{\text{L}}={{{{\mathcal{N}}}}}_{+}({0}^{\circ })\) and \({n}_{\text{L}}={p}_{\text{L}}-{x}_{\text{R}}={{{{\mathcal{N}}}}}_{-}(9{0}^{\circ })\).

To extract the nullifiers for the square graph state, the procedure is the same except that we measure sites 1 and 3 in the x basis (at ϕ = 0) and apply the additional 90° rotation about Q0 to sites 2 and 4. Thus on sites 1 and 3 we read out \({{{{\mathcal{Q}}}}}_{1,3}=-{x}_{1,3}\cos \phi +{p}_{1,3}\sin \phi\), and on sites 2 and 4 we read out \({{{{\mathcal{P}}}}}_{2,4}={x}_{2,4}\sin \phi +{p}_{2,4}\cos \phi\). To extract the nullifiers, we construct the following four observables

$$\begin{array}{rcl}{{{{\mathcal{N}}}}}_{{{1}}}&=&{{{{\mathcal{Q}}}}}_{1}-{{{{\mathcal{P}}}}}_{2}-{{{{\mathcal{P}}}}}_{4}\\ {{{{\mathcal{N}}}}}_{{{2}}}&=&{{{{\mathcal{P}}}}}_{2}+{{{{\mathcal{Q}}}}}_{1}+{{{{\mathcal{Q}}}}}_{3}\\ {{{{\mathcal{N}}}}}_{{{3}}}&=&{{{{\mathcal{Q}}}}}_{3}-{{{{\mathcal{P}}}}}_{2}-{{{{\mathcal{P}}}}}_{4}\\ {{{{\mathcal{N}}}}}_{{{4}}}&=&{{{{\mathcal{P}}}}}_{4}+{{{{\mathcal{Q}}}}}_{1}+{{{{\mathcal{Q}}}}}_{3},\end{array}$$
(20)

such that \({n}_{1,3}={{{{\mathcal{N}}}}}_{{{\text{1,3}}}}(9{0}^{\circ })\) and \({n}_{2,4}={{{{\mathcal{N}}}}}_{{{\text{2,4}}}}({0}^{\circ })\). The measured normalized variances as a function of the initial spinor rotation are shown in Extended Data Fig. 3b. The nullifier variances reported in the main text are obtained from the data in Extended Data Fig. 3 by subtracting a small detection noise contribution, as described in ‘Readout and fluorescence imaging’.

Entanglement detection in graph states

We here derive the criterion for spatial entanglement in the square graph state, which uses the nullifier variances to prove that the state is not fully separable into the four individual nodes. Specifically, we show that all separable states are subject to a lower bound on the average value

$${{{\mathcal{V}}}}=\frac{1}{4}\mathop{\sum }\limits_{i=1}^{4}{v}_{i}$$
(21)

of the normalized variances

$${v}_{i}=\frac{{{{\rm{Var}}}}\left({n}_{i}\right)}{1+{\sum }_{j}{A}_{ij}^{2}}=\frac{{{{\rm{Var}}}}\left({n}_{i}\right)}{3}$$
(22)

of the four nullifiers ni = pi − ∑j Aij xj, where Aij is the adjacency matrix of the square graph state.

The density matrix for any separable state has the general form ρ = ∑αhαρα, where \({\rho }_{\alpha }{ = \bigotimes }_{i = 1}^{4}{\rho }_{i,\alpha }\) are product states of the four ensembles and hα are probabilities satisfying ∑hα = 1. The nullifier variances thus satisfy

$$\begin{array}{r}{{{\mathcal{V}}}}=\displaystyle\frac{1}{12}\mathop{\sum }\limits_{i=1}^{4}{{{\rm{Var}}}}{\left({n}_{i}\right)}_{\rho }\ge \frac{1}{12}\mathop{\sum}\limits_{\alpha }{h}_{\alpha }\mathop{\sum }\limits_{i=1}^{4}{{{\rm{Var}}}}{\left({n}_{i}\right)}_{{\rho }_{\alpha }},\end{array}$$
(23)

where the inequality is saturated in the absence of classical correlations between the nullifiers. For any product state ρα, there are no correlations between measurements on different sites. Thus, for the square graph state,

$$\begin{array}{rcl}\mathop{\sum }\limits_{i=1}^{4}{{{\rm{Var}}}}{\left({n}_{i}\right)}_{{\rho }_{\alpha }}&=&\mathop{\sum }\limits_{i=1}^{4}{{{\rm{Var}}}}{\left({p}_{i}\right)}_{{\rho }_{\alpha }}+\mathop{\sum}\limits_{i,\;j}{A}_{ij}^{2}{{{\rm{Var}}}}{\left({x}_{j}\right)}_{{\rho }_{\alpha }}\\ &=&\mathop{\sum }\limits_{i=1}^{4}{{{\rm{Var}}}}{\left({p}_{i}\right)}_{{\rho }_{\alpha }}+2\mathop{\sum }\limits_{i=1}^{4}{{{\rm{Var}}}}{\left({x}_{i}\right)}_{{\rho }_{\alpha }}\\ &\ge &8\sqrt{2}.\end{array}$$
(24)

In the final line, we use the local Heisenberg uncertainty relation \({{{\rm{Var}}}}\left({x}_{i}\right){{{\rm{Var}}}}\left(\;{p}_{i}\right)\ge 1\) to obtain a bound on the sum of variances. Substituting this bound into equation (23) yields \({{{\mathcal{V}}}}\ge 2\sqrt{2}/3\approx 0.94\) for all separable states.