Second-scale rotational coherence and dipolar interactions in a gas of ultracold polar molecules

Ultracold polar molecules uniquely combine a rich structure of long-lived internal states with access to controllable long-range, anisotropic dipole-dipole interactions. In particular, the rotational states of polar molecules confined in optical tweezers or optical lattices may be used to encode interacting qubits for quantum computation or pseudo-spins for simulating quantum magnetism. As with all quantum platforms, the engineering of robust coherent superpositions of states is vital. However, for optically trapped molecules, the coherence time between rotational states is typically limited by inhomogeneous light shifts. Here we demonstrate a rotationally-magic optical trap for RbCs molecules that supports a Ramsey coherence time of 0.78(4) seconds in the absence of dipole-dipole interactions. This extends to>1.4 seconds at the 95% confidence level using a single spin-echo pulse. In our magic trap, dipolar interactions become the dominant mechanism by which Ramsey contrast is lost for superpositions that generate oscillating dipoles. By changing the states forming the superposition, we tune the effective dipole moment and show that the coherence time is inversely proportional to the strength of the dipolar interaction. Our work unlocks the full potential of the rotational degree of freedom in molecules for quantum computation and quantum simulation.

'Magic-wavelength' traps have been an invaluable tool in engineering atomic [30] and molecular [31,32] clocks that are insensitive to light shifts.The general method being to choose a trap wavelength such that the polarisability of the target states are the same.However, achieving long coherence for rotational states in ultracold molecules has proved difficult, due to the anisotropic interaction with the trap light.The resulting differential light shifts lead to unwanted shifts in the frequency of the rotational transition across the trap.The only implementation of a magic-wavelength trap for rotational transitions has been in fermionic 23 Na 40 K molecules [33].In this case, coherence was limited to ∼ 1 ms by inhomogeneities in the dc electric field that was also required as part of the scheme.Recent experiments us-ing 23 Na 87 Rb molecules in a near-magic optical lattice reported single-particle rotational coherence times of 56(2) ms [29].Other attempts to produce rotationallymagic traps have sought to match polarisabilities by tuning either the polarisation [25,[34][35][36][37][38] or intensity [39] of the trap light.Here however, residual differential light shifts may still occur due to hyperfine couplings that are quadratic in intensity [40].Microwave pulse sequences can be designed to minimise the effects of single-particle dephasing resulting from small residual light shifts or electric field inhomogeneity, for example.Most notably spin-echo [24,25] or XY8 [26,28] sequences have been used.To date, the longest rotational coherence time reported without rephasing is 93 (7) ms for single CaF molecules confined to optical tweezers with the polarisation set to a magic angle; this was extended to 470 (40) ms using a spin-echo sequence [36].
In this article, we report second-scale rotational coherence times in a dilute gas of optically-trapped 87 Rb 133 Cs molecules (hereafter RbCs).We engineer a magicwavelength trap by tuning the frequency of the trap light in the vicinity of a nominally forbidden molecular transition.We observe a Ramsey coherence time of 0.78 (4) s that is limited primarily by the stability of the trap laser frequency in a state configuration without dipole-dipole interactions.Introducing a single spin-echo pulse, we observe no loss of rotational coherence over 0.7 s and estimate a minimum coherence time of > 1.4 s at the 95% confidence level.We show that under these conditions, dipolar interactions become the dominant source of decoherence for superpositions that generate oscillating dipoles.We control the strength of these interactions by changing the states forming the superposition.We demonstrate that the coherence time is inversely proportional to the strength of the resonant dipole-dipole interactions.
We start by preparing a thermal gas of ultracold RbCs molecules in their lowest rotational state in an optical trap (see Methods).We typically produce around ∼ 2400 molecules at a temperature of 1.5 µK, and estimated peak density of 6 × 10 10 cm −3 .We use resonant microwave fields that couple to the molecule-frame dipole moment d 0 = 1.23 D [41] to coherently transfer the molecules between the rotational states shown in Fig. 1(a).We label the states used in this work by |0⟩ ≡ (N = 0, Here, N describes the rotational angular momentum, and M N denotes the dominant projection along the quantisation axis.All these states have the same dominant nuclear spin projections of m Rb = 3/2 and m Cs = 7/2 (see Supplementary Section I).
Optical trapping relies upon light with intensity I interacting with the dynamic polarisability of the molecule α, such that there is a perturbation in energy −αI/(2ϵ 0 c) where ϵ 0 is the permittivity of free space and c is the speed of light.Because diatomic molecules are not spherically symmetric, the polarisability along the internuclear axis, α ∥ , is different from that perpendicular to the axis, α ⊥ , with the two polarisabilities arising from electronic transitions in the molecule with different symmetries [42,43].This results in a molecular polarisability that depends on the orientation of the molecule and can be separated into an isotropic α (0) and anisotropic α (2) component such that α(θ) = α (0) + α (2) (3 cos 2 θ − 1)/2.Here, θ is the angle of the laser polarisation with respect to the internuclear axis, α (0) = (α ∥ + 2α ⊥ )/3 and α (2) = 2(α ∥ − α ⊥ )/3.The presence of the anisotropic component leads to a polarisability and therefore light shifts that are dependent on the rotational angular momentum N , the projection along the quantisation axis M N , and the angle between the trap laser polarisation and the quantisation axis [44].
To produce a rotationally magic trap we tune the value of α (2) to be zero.This is achieved by trapping with light at a wavelength of 1145 nm following a scheme proposed by Guan et al. [45].We tune the laser frequency to be between transitions to the v ′ = 0 and v ′ = 1 vibrational states of the mixed b 3 Π potential, as indicated in Fig. 1(b).Transitions to this potential are nominally forbidden from the X 1 Σ + ground state, but may be driven due to weak mixing of b 3 Π with the nearby A 1 Σ + potential.Coupling to A 1 Σ + components allows α ∥ to be tuned by varying the frequency of the trapping light, with poles in the polarisability occurring for each vibrational state in the b 3 Π potential, as shown in Fig. 1(c).Meanwhile, α ⊥ remains nearly constant as the light is reddetuned by ∼ 100 THz from the bottom of the nearest 1 Π potential.By setting α ∥ = α ⊥ with the laser frequency, the polarisability of the molecule becomes isotropic such that α (2) = 0 and α (0) = α ⊥ .In Fig. 1(d,e) we show the effect of tuning the laser frequency on the optical poten-tials experienced by molecules in states |0⟩ and |1⟩.The magic condition where the polarisability, and therefore the optical potential, is the same for molecules in either state occurs at a laser detuning of ∼ 186 GHz from the transition to the v ′ = 0 state.
To identify the magic detuning experimentally, we perform Ramsey interferometry as shown schematically in Fig. 2(a).For a given pair of states, we fix the Ramsey time and measure the contrast of a Ramsey fringe as a function of the laser detuning (see Methods).We observe a peak in the fringe contrast when the trap light is tuned to be magic as shown in Fig. 2(b,c), indicating that the coherence time for that particular combination of states has been maximised.There is a small ∼ 1 GHz variation in the magic detuning that depends upon the states chosen and the polarisation of the trap light; this is due to the light coupling to different rotational levels of the excited vibrational states [2,45].The width of the feature we observe depends on the sensitivity of the differential light shift to the laser frequency, and is inversely proportional to the Ramsey time used.
Tuning close to a molecular transition to access a magic wavelength could potentially lead to loss of molecules due to photon scattering.However, we find that our method is compatible with long trap lifetimes.To estimate the scattering rate due to the 1145 nm light we examine loss of molecules prepared in |0⟩ from the trap.We begin our measurement after a hold time in the trap of 0.4 s such that the density of molecules is relatively low and collisional losses [47,48] are therefore reduced.We compare the loss from the magic-wavelength trap with loss observed when the wavelength of the trap light is changed to 1064 nm, with the intensity set such that the molecules experience the same trap frequencies.The results of both measurements are shown in Fig. 3(a), with fits from a model assuming exponential decay (see Supplementary Section II).We observe similar loss rates, corresponding to lifetimes on the order of ∼ 1 s in both traps.Assuming the photon scattering rate in the 1064 nm trap is negligible, we estimate an upper limit on the photon scattering rate in the 1145 nm trap of < 0.23 s −1 at the 95% confidence level.In other work [2], we have characterised the linewidths of the relevant transitions, with the closest having linewidths Γ v ′ =0 = 3.7(4) kHz and Γ v ′ =1 = 2.4(3) kHz.Therefore, the trap light is effectively far detuned, with the ratio of the laser detuning to the linewidth of the nearest transition ∆/Γ v ′ =0 ≈ 5×10 7 .It follows that loss due to photon scattering is not an issue for our magic-wavelength trap.
When molecules are prepared in superpositions of rotational states that are connected by dipole-allowed transitions, they exhibit an oscillating dipole moment in the lab frame.The resultant dipole-dipole interactions can significantly affect the rate of collisional loss of molecules from the trap [47].In Fig. 3 is 2.5× greater than for molecules prepared in a single rotational state.The interrogation time available for dipolar samples of molecules is therefore significantly shorter than for non-interacting samples.We first measure the coherence time for a noninteracting sample of molecules by examining the coherence between |0⟩ and | 2⟩; these are two rotational states not linked by an electric dipole-allowed transition.To perform Ramsey interferometry on this transition, we use a pulse sequence composed of one-photon π/2 and π pulses on the electric dipole-allowed transitions |0⟩ ↔ | 1⟩ and | 1⟩ ↔ | 2⟩ (see Supplementary Section III).We measure the contrast of the Ramsey fringes as a function of time, shown by the empty circles in Fig. 4(a).We fit the results with a Gaussian model for decoherence [36], where the fringe contrast , to extract the 1/e coherence time.From this, we find a coherence time T * 2 = 0.78(4) s.The coherence time we measure is currently limited by residual differential ac Stark shifts in the trap as a result of the light being slightly detuned from the magic wavelength.We estimate the stability of the trap laser frequency to be ±0.76MHz (±1σ) over the duration of a typical Ramsey fringe measurement (approximately 30 minutes).This results in a variation of the transition frequency across each fringe measurement of ±0.46 Hz, with a corresponding theoretical limit on the observed coherence time of 1.1 s.There are additional smaller contributions to decoherence arising from the uncertainty in the magic laser frequency extracted from the optimisation curve in Fig. 2(b) with T = 175 ms (limit of 4.3 s), and from a 10 MHz frequency difference between the two beams used to produce the crossed trap (limit of 8.3 s).Details of how these limits are calculated are given in Supplementary Section IV.In addition, there is a small differential magnetic moment between the states of 0.0124 µ N that adds an additional limit on the coherence time of 10.6 s associated with noise in the magnetic field (∼ 10 mG).Combining all contributions provides an expected limit on the coherence time of 0.74 s, in excellent agreement with the measured value.Up to an order of magnitude improvement in the coherence time may be achieved by using a better method of laser frequency stabilisation; for example, referencing the light to a high finesse optical cavity would result in a frequency stability of below 100 kHz [49].
We remove most of the effects of these residual differential light shifts by introducing a single spin-echo pulse in the middle of the Ramsey time; this is an effective π pulse between |0⟩ and | 2⟩ that reverses the direction of precession around the Bloch sphere, thereby cancelling out contributions to single particle dephasing from static inhomogeneities.The result is shown by the filled circles in Fig. 4(a).We now observe no loss of fringe contrast over the measurement time of 0.7 s.We do not measure Ramsey fringes for times longer than this due to loss of molecules from the trap diminishing the signal-tonoise ratio.There is a shift in the phase of the Ramsey fringe as a function of Ramsey time that is quadratic (see Supplementary Section V).This may be explained by a small imperfection in the spin-echo rephasing, but does not lead to any appreciable loss of coherence.Fitting to the results using the Gaussian model for decoherence, we estimate a minimum coherence time consistent with our results to be T 2 > 1.4 s at the 95% confidence level.This result represents the elimination of all decoherence at the detectable precision of our current experiment.
For superpositions of rotational states that lead to oscillating molecular dipoles, dipolar interactions also cause dynamics of Ramsey contrast, and therefore introduce an additional source of decoherence.The dipole-dipole interactions in the system are described by the Hamiltonian [15,16,50 where d0 , d1 , d −1 are spherical components of the dipole operator, Θ ij is the angle between the vector connecting two molecules and the quantisation axis, and r ij is the inter-molecular distance.The local spatial configuration of molecules varies across the sample.Moreover as the molecules are not pinned by an optical lattice, their configuration is time dependent due to motion of the molecules around the trap.
We examine the coherence between the states |0⟩ and | 1⟩ which are connected via a dipole-allowed transition.An equal superposition of these states produces a dipole that rotates around the quantisation axis with magnitude given by the transition dipole moment d 0 / √ 3.However, due to the factor of 2 in the denominator of the final term of Eq. 1, this contributes an effective dipole d = d 0 / √ 6 = 0.5 D in the lab frame.At the peak densities in our experiments, this corresponds to a typical interaction strength of ∼ h × 2 Hz.The Ramsey fringe contrast measured as a function of time is shown in Fig. 4(a) by the blue squares, with (filled) and without (empty) a spin-echo pulse.We see a dramatic reduction in the coherence time measured using either pulse sequence when compared to the non-interacting case.Moreover, the results are no longer well described by the Gaussian model for decoherence.Instead, we fit the results assuming an exponential decay of fringe ).We find a 1/e coherence time of 89(5) ms without the spin-echo pulse and T DDI 2 =157(14) ms using the spin-echo sequence.Note that the residual ac Stark shifts that affect the results without spin echo vary depending on the combination of states; we expect that the uncertainty in the magic detuning is the dominant source of dephasing for this combination as collisional losses and dipolar decoherence force us to use a shorter Ramsey time in the optimisation of the trap laser frequency.However, the difference in coherence time between dipolar and non-interacting samples that is observed with the spin-echo pulse can be attributed to the effect of dipole-dipole interactions alone.
We tune the strength of the dipole-dipole interactions in the sample by using different combinations of states.In Fig. 4(b) we show the 1/e coherence time measured with spin echo for three different combinations of states as a function of their effective lab-frame dipole moments.Here, the dipole moment is varied from 0.31 D to 0.65 D, calculated using the full state compositions given in Supplementary Section I.The laser frequency is set to maximise the coherence time for each state combination.As expected, we see in the inset to Fig. 4(b) that the coherence time is inversely proportional to the magnitude of the interaction strength U ij ∝ d 2 , which confirms that dipolar interactions are the dominant source of decoherence.Moreover, this result demonstrates application of our magic-wavelength trap to molecules in a range of rotational and hyperfine states, allowing control and tunability of the strength of the dipolar interactions.
We compare the decay of fringe contrast observed in the experiment to that calculated using the Moving-Average Cluster Expansion (MACE) method [51] for molecules fixed in space (see Methods).Losses are included in the theory by assuming molecules are lost at a constant rate independent of other molecules.We use the 1/e loss time of 0.14(5) s determined from an exponential fit to the experimental results in Fig. 3(b); we measure similar loss rates for all three of the dipolar combinations investigated.Decreases in density from loss noticeably slow down the dynamics, as shown in Supplementary Fig. 1(a).Without fitting, using only the measured loss rates, densities, and trap parameters, the MACE calculations reproduce the timescale for the decay in the Ramsey fringe contrast, as well as the dependence on the choice of state-pair, and the overall monotonic decrease; the result for 1 √ 2 (|0⟩ + | 1⟩) is shown in Fig. 4(a).Some details differ, most noticeably that the MACE results predict modestly but systematically shorter timescales and a more concave dependence on time than the experimental results.The theory contrast is between the measured echo and no-echo contrast, and differs from the echo results by roughly the same factor for all state-pair choices, suggesting a common underlying cause.Molecule motion during the dynamics is a likely source.The reasonably good agreement of MACE calculations and experiment for the overall timescale of contrast decay, and the dependence of this timescale on the strength of the dipole-dipole interactions, supports the conclusion that dipole-dipole interactions are the main cause of the contrast decay for state combinations that generate oscillating molecular dipoles.
In conclusion, we have demonstrated a rotationallymagic trap for RbCs molecules, where the effects of all experimentally relevant sources of decoherence may be suppressed, resulting in a coherence time in excess of 1.4 s for non-interacting rotational superpositions.Crucially, the magic wavelength is sufficiently far detuned from neighbouring transitions that we observe negligible photon scattering rates and hence long trap lifetimes.We have shown that this provides unparalleled access to controllable dipole-dipole interactions between molecules.Our approach of trapping using light detuned from the nominally forbidden X 1 Σ(v = 0) → b 3 Π(v ′ = 0) transition is applicable to other bialkali molecules [33,45].
Our work enables the construction of low-decoherence networks of rotational states, which are the foundation for many future applications of ultracold molecules from quantum computation [1][2][3][4][5][6][7]10] and simulation [11][12][13][14][15][16][17][18][19][20][21][22][23], to precision measurement of fundamental constants [52].The next step for experiments will be to construct molecular arrays using light at this magic wavelength.For molecules in optical tweezer arrays, this will enable highfidelity quantum gates using resonant dipolar exchange, either directly between molecules [26,27] or mediated via Rydberg atoms [7,8,53].For molecules in optical lattices, long rotational coherence times can be combined with long lifetimes.For a lattice depth of 20 recoil energies, we predict a one-photon scattering rate of 0.006 s −1 , corresponding to a lifetime in excess of 100 s.For molecules in the magic-wavelength lattice, nearest neighbours will be separated by r = 573 nm, and will experience an interaction strength of h × 343 Hz for the largest effective dipoles explored here (and Θ = π/2).This corresponds to a timescale for dipolar spin exchange dynamics of 2.9 ms, far shorter than both the coherence time and the lifetime.Techniques for the production of ordered lattice arrays of ground state RbCs molecules have already been demonstrated [54,55], and are compatible with a magic-wavelength lattice.Our work therefore unlocks the potential of ultracold molecules in optical lattices for simulating quantum magnetism.

A. Production of ground state molecules
We produce ultracold RbCs molecules from a precooled mixture of Rb and Cs atoms.The atomic mixture is confined to a crossed optical dipole trap using light with a wavelength of 1550 nm, with a magnetic field gradient applied to cancel the force due to gravity [56].To form molecules, we sweep the magnetic field down across an interspecies Feshbach resonance at 197 G [57].We then remove the remaining atoms from the trap by increasing the magnetic field gradient to over-levitate the atoms, following which the magnetic field gradient is removed.With the exception of the measurements shown in Fig. 3(a), at this point the molecules are transferred to the magic trap by ramping the power in the 1145 nm light on over 30 ms, and then the power in the 1550 nm trap off over a further 5 ms.Finally, we transfer the molecules to the X 1 Σ ground state |0⟩ using stimulated Raman adiabatic passage [41,58].This final step is performed with the trap light briefly turned off to avoid spatially varying ac Stark shifts of the transitions.For the measurements in Fig. 3(a), we increase the power in the 1550 nm trap after the removal of atoms and transfer to the magic trap following the ground state transfer.Throughout all of the measurements shown, the molecules are subject to a fixed 181.5 G magnetic field, and there is no electric field.To detect molecules in |0⟩, we reverse the association process, breaking the molecules back apart into their constituent atoms, which we detect using absorption imaging.

B. Details of the magic trap
The magic trap is formed from two beams, each with a waist of 50 µm, crossing at an angle of 20 • .The beams propagate and are polarised in the plane orthogonal to the applied magnetic field that defines the quantisation axis.Both beams are derived from the same laser (Vexlum VECSEL), so to avoid interference effects, we set a 10 MHz difference in frequency between the beams.The laser detuning reported in Fig. 2(b,c) is the average detuning of the two beams.The intensities of the beams are not actively stabilised, but are monitored to ensure they are passively stable to < 5% variation over the course of each measurement.The typical trap frequencies experienced by ground state molecules at the magic detuning are [ω x , ω y , ω z ] = [29(1), 144(5), 147 (5)] Hz.After 15 ms in the magic trap, we measure the temperature of the ground-state molecules to be 1.5(2) µK using timeof-flight expansion of the cloud over 6 ms.
The frequency of the 1145 nm laser is stabilised using a scanning transfer cavity lock [59], that is referenced to a 977 nm laser that is in turn locked to a high finesse cavity with an ultra-low expansion glass spacer [49].The lock makes corrections to the laser frequency at a rate of ∼ 100 Hz.This slow feedback rate, together with the relatively low finesse of the transfer cavity ∼ 400, limits the frequency stability of the laser in the current experiments.

C. Coherent state control
We use coherent one-photon microwave pulses to perform the Ramsey interferometry, during which the trap light is turned off.The microwave sources are referenced to a 10 MHz GPS clock.We set the microwaves on resonance with the desired transition and calibrate the duration of the pulses using one-photon spectroscopy as described in [60].The pulse sequences used in this work are shown schematically in Supplementary Section II.

D. Analysis of Ramsey fringes
We observe Ramsey fringes as a variation in the molecule number N mol detected in state |0⟩ as a function of the phase difference Φ between the initialisation and read-out microwave pulses.We fit each measurement with the function where N tot mol is the total number of molecules in the sample, Φ 0 is the phase offset in the Ramsey fringe, and C is the contrast.
We use a bootstrap fitting algorithm to estimate the uncertainty in the fringe contrast.For a given fringe measurement, we randomly sample the measured N mol for each value of Φ to build up a new dataset that is the same size as the original.We fit to this randomly resampled data to extract a coherence time.This process is repeated 1000 times to build up a distribution of fitted coherence times, from which we calculate a standard deviation that represents the uncertainty in the true value.

E. MACE
We calculate the dynamics of our system using the Moving-Average Cluster Expansion (MACE) method [51].Particle locations are randomly sampled from the thermal distribution based on the measured trap parameters, temperature, and particle number, and are assumed to be fixed for all times at their initial positions.We calculate the dynamics starting from all molecules in the |→⟩ state, which is the state (ideally) prepared by the initial π/2 pulse in the Ramsey spectroscopy sequence.We simulate the time evolution of the Hamiltonian in Eq. 1 projected onto the relevant state pair, which is a spin-1/2 dipolar XX model [15,16] where ⃗ r ij = ⃗ r i − ⃗ r j is the distance between molecules i and j, θ ij is the angle between the quantization axis and ⃗ r ij , S ± i are raising/lowering operators, and 26Hz where ρ is the estimated peak density (6 × 10 10 cm −3 ).Each simulation is performed to a time just before the second π/2 pulse and then the expectation of S x = i S x i is calculated, which is the same as the Ramsey contrast after the pulse.The MACE method constructs a cluster for each S x i from molecule i and the N c − 1 other molecules with the strongest interactions with atom i, where N c is a convergence parameter of the method.We exactly calculate ⟨S x i (t)⟩ of each resulting cluster.To assess convergence, we have compared the dynamics for N c = 2, 4, 6, 8, and 10 as shown in Supplementary Fig. 1(b).The results converge quickly with N c for the simulation times of interest, and N c = 6 is used for the results in Fig. 4. The contrast is expected to be converged within widths of the plotted lines over most of the time regime shown.
The dynamics of the Ramsey contrast is already roughly captured if one ignores particle loss, but the loss has non-negligible quantitative effects, which we include in our calculations shown in the main text.Molecules leaving the trap decrease the density, which causes the contrast to decay more slowly.To include this loss in the MACE calculations, we assume that molecules are independently lost from the trap at a constant rate, consistent with the measured time-dependence of the particle number.We take the loss rate to be 0.14 (5) s, as determined experimentally.MACE clusters are built based on the particle distribution at time t = 0 and do not change over time.For each cluster, whenever a molecule is lost we set the interactions between the lost molecule and the remaining molecules to zero.To propagate the dynamics after this event, we re-diagonalize the Hamiltonian.This modestly increases the computational difficulty, but only by a factor of N c in the worst case (when all molecules are lost during the timescale under consideration).To obtain good statistics, we average together 10 loss trajectories of ∼ 2400 molecules each to obtain a stable result.This reduces the statistical error between runs to a maximum of 2% over the time scales we are working with.
The error bars on the theoretical calculations presented in the main text show the result of the experimental uncertainty in the number of molecules, loss rate, and temperature.For particle number uncertainty, we computed the Ramsey contrast decay for the ±1 σ measured particle numbers, and did the same for loss rate uncertainty and temperature uncertainty.These uncertainties were added together in quadrature to obtain the error bounds in Fig. 4.Each of these errors are much larger than the statistical or MACE convergence errors.

SUPPLEMENTARY INFORMATION: SECOND-SCALE ROTATIONAL COHERENCE AND DIPOLAR INTERACTIONS IN A GAS OF ULTRACOLD POLAR MOLECULES I. STATE COMPOSITION
Composition of the states used in this work, given in the uncoupled basis (N, M N , m Rb , m Cs ), are 2 ⟩ Here, each of the coefficients are given to 3 decimal places, and the dominant contribution in each case has its coefficient highlighted in bold.The energies and compositions of the rotational and hyperfine states are calculated with Diatomic-Py [1].

II. LIFETIME MEASUREMENTS IN FIG. 3(A)
We fit the results in Fig. 3(a) with the exponential function N mol (t) = N init mol e −kt .Here, N init mol is the number of molecules present at time t = 0 and k characterises the rate of loss of molecules from the trap.We extract a loss rate of k 1145 = 0.61(5) s −1 with 1145 nm light, and k 1064 = 0.56(7) s −1 with 1064 nm light.This is consistent a rate of loss that is not dependent on the wavelength.To estimate the upper limit to the photon scattering rate that is given in the main text, we calculate the difference in these scattering rates k 1145 − k 1064 = 0.05(9) s −1 , assuming no correlation in the uncertainty of the two measurements.At the 95% confidence level, this indicates that the difference in loss rate must be below 0.23 s −1 .This is broadly consistent with the expected single photon scattering rate which we calculate to be 0.4(1) s −1 from the known linewidths of the transitions [2] and peak laser intensity in our optical trap (20 kW cm −2 ).

III. PULSE SEQUENCES
We use various pulse sequences to perform Ramsey interferometry depending on the combination of states targeted.These are shown schematically below.
At the start of the sequence the molecules are always prepared in N = 0.The solid line with red fill indicates microwave transitions driven between N = 0 and 1 rotational states, and the dotted line with blue fill indicates transitions driven between N = 1 and 2. Sequences are used for the combinations (i) In each case the top (bottom) sequence shows the sequence without (with) a spin-echo pulse.To measure a Ramsey fringe, the phase of the last π/2 pulse is varied.

IV. RESIDUAL LIGHT SHIFT CONTRIBUTIONS TO DECOHERENCE
In the absence of dipole-dipole interactions, the coherence time T * 2 is limited by variation ∆E in the energy difference between two states where h is the Planck constant.In Fig. 4(a), we observe decoherence without interactions which is suppressed by a spin-echo pulse.Here we discuss possible sources of this decoherence, specifically for the superposition 1 √ 2 (|0⟩ + | 2⟩).For our calculations, we assume ∆E is the 2σ variation in the transition energy.

A. Instability in the trap laser frequency
The trap laser frequency is stabilised by a scanning transfer cavity lock, and we estimate the standard deviation in the laser frequency to be 0.76 MHz.For a 2σ change in the laser frequency, the differential polarisability between |0⟩ and |2⟩ changes by h × 2.9 × 10 −5 Hz W −1 cm 2 .Moreover, we have directly measured the coefficient relating the light shift to the change in laser frequency to be 6.0(2) × 10 −7 in our trap.The 2σ variation in the laser frequency therefore corresponds to 2 × (6 × 10 −7 ) × 0.76 MHz = 0.92 Hz which we assume equal to ∆E/h, yielding a limit on T * 2 of 1.1 s.

B. Uncertainty in optimisation of magic detuning
We measure the magic detuning for a given state combination as shown in Fig. 2(b).For the states |0⟩ and | 2⟩, our most precise measurement of the magic detuning is found using a Ramsey time of T = 175 ms, which has 1σ uncertainty of 3 MHz.A systematic detuning of 3 MHz leads to an average light shift experienced by the molecules of (6 × 10 −7 ) × 3 MHz = 1.8 Hz.
Spatial variation in this light shift causes decoherence.We estimate this variation from the known geometry of the trap beam and assuming a thermal cloud of molecules at equilibrium.From this, the 2σ variation in the light shift experienced will be 13% of the average, i.e. there is spatial variation in the light shift of 0.13×1.8= 0.234 Hz.This puts a limit on T * 2 of 4.3 s.

C. 10 MHz frequency difference between beams
There is a 10 MHz frequency difference between the two beams that form the magic trap in order to eliminate interference effects.When set symmetrically about the magic frequency, there will be a light shift of (6 × 10 −7 ) × ±5 MHz = ±3 Hz.The effects from each beam are broadly cancelled as the intensities are set to be the same.However, variation in the relative intensities of the beams will vary as molecules move around the trap.We estimate from the known geometry of the trap beams and assuming a cloud of molecules at equilibrium that the 2σ variation in the beam balance is only 2%.This leads to variation in the light shift 0.12 Hz that corresponds to a limit on T * 2 of 8.3 s.

V. PHASE SHIFT AS A FUNCTION OF RAMSEY TIME
We observed a phase shift in the Ramsey fringe as a function of the Ramsey time for non-interacting states with the spin-echo pulse, as discussed in the main text.This phase shift is shown in the graph below, with a quadratic fitted to guide the eye.

1 √ 2 (
(b)  we compare the loss from the magic trap as a function of time for molecules prepared in either |0⟩, |1⟩ or the superposition |0⟩ + | 1⟩).For the dipolar superposition, we observe a loss rate that

FIG. 1 .
FIG. 1.A rotationally-magic trap for ultracold molecules.(a) Relevant rotational states in this work labelled by (N, MN ).Wavefunctions for each state are shown with phase information for the states used in this work represented by the color.(b) Electronic structure of RbCs, with the energy corresponding to the 1145 nm wavelength of the trap laser indicated by the vertical black arrow.(c) By tuning the laser frequency between the transitions to v ′ = 0 and v ′ = 1 vibrational levels of the b 3 Π potential we vary only the component of the polarisability parallel to the internuclear axis of the molecule α ∥ whilst keeping the perpendicular component α ⊥ constant.(d) Polarisability for states |0⟩ and |1⟩ as a function of laser detuning from the transition to b 3 Π(v ′ = 0).At a detuning of 0.186 THz the trap is rotationally magic and the polarisability for both states is the same.(e) Schematic of the relative trap potential for laser detunings such that (i) α |0⟩ < α |1⟩ , (ii) α |0⟩ = α |1⟩ , (iii) α |0⟩ > α |1⟩ .

FIG. 2 . 1 √ 2 ( 1 √ 2 ( 1 √ 2 ( 1 √ 2 ( 1 √ 2 (
FIG. 2. Optimising coherence time in the magic trap.(a) Bloch sphere representation of the Ramsey interferometry sequence.For each step the dotted and solid red arrows represent the initial and final Bloch vector respectively.Solid black arrows indicate the axis about which the Bloch vector is rotated using coherent π/2 pulses performed on microwave transitions between the neighbouring rotational states.In the example shown, a π/2 pulse first prepares the molecules in an equal superposition of states 1 √ 2 (|0⟩ + |1⟩).This is then allowed to freely evolve for a time, T .Finally a second π/2 pulse with variable phase Φ is used to project back onto the state |0⟩ for detection.Ramsey fringes are observed as a variation in molecule number N mol in state |0⟩ as a function of Φ.(b) Fringe contrast as a function of trap laser detuning from the transition to b 3 Π(v ′ = 0) for state combinations and Ramsey times (i) 1 √ 2 (|0⟩ + |1⟩), T = 20 ms; (ii) 1 √ 2 (|0⟩ + | 1⟩), T = 30 ms; (iii) 1 √ 2 (|1⟩ + | 2⟩), T = 30 ms. Results for the combination (iv) 1 √ 2 (|0⟩ + | 2⟩) are shown for Ramsey times of T = 40 ms (empty circles) and T = 175 ms (filled circles).The lines show Gaussian fits to each of the results to identify the magic detuning.(c) Example Ramsey fringes for case (i); the molecule number detected in state |0⟩ is plotted as a fraction of the total number N tot mol .

FIG. 3 . 1 √ 2 (
FIG. 3. Collisional loss of molecules from the trap.(a) Comparison of molecule loss in the magic trap (filled squares) compared to an equivalent trap using light with wavelength of 1064 nm (empty stars).(b) Comparison of loss from the trap for molecules prepared in either |0⟩ or | 1⟩ with the superposition 1 √ 2 (|0⟩ + | 1⟩).Exponential fits are shown to all results.

FIG. 4 . 1 √ 2 ( 1 √ 2 ( 1 √ 2 ( 1 √ 2 ( 1 √ 2 (
FIG. 4. Rotational coherence and dipolar interactions in the magic trap.(a) Fringe contrast as a function of the Ramsey time for non-interacting 1 √ 2 (|0⟩ + | 2⟩) (black circles) and dipolar 1 √ 2 (|0⟩ + | 1⟩) (blue squares) superpositions.Empty markers indicate measurements using a standard Ramsey sequence, and filled markers indicate measurements performed with the addition of a single spin-echo pulse.The non-interacting results are fitted using a Gaussian model for decoherence, and the dipolar-results fitted assuming an exponential decay in fringe contrast.The blue lines indicate the decay in fringe contrast from MACE simulations as described in the main text.Uncertainties in the fits and simulations are shown by the shaded regions.The fringes observed for 1 √ 2 (|0⟩+| 2⟩) with spin echo at T = 0.7 s are shown inset.Also shown inset is the wavefunction for the dipolar superposition 1 √ 2 (|0⟩ + | 1⟩) as a function of time (phase, ϕ).The resultant dipole (white arrow) rotates around the quantisation axis (vertical black line) at a frequency proportional to the difference in energy δE between the states.(b) Coherence time in the presence of dipole-dipole interactions.We plot the 1/e coherence time measured with spin echo as a function of the effective lab-frame dipole moment, tuned by changing the states used in the spin-echo sequence.The combinations used are (i) 1 √ 2 (|1⟩ + | 2⟩); (ii) 1 √ 2 (|0⟩ + | 1⟩); (iii) 1 √ 2 (|0⟩ + |1⟩).The fringe contrast as a function of time for each state combination is shown in the top right inset.The wavefunctions are illustrated with (i) and (ii) yielding dipoles rotating around the quantisation axis, and (iii) resulting in a dipole that oscillates up and down.The bottom left inset shows the coherence time plotted as a function of the dipole-dipole interaction strength ∝ 1/d 2 .