Introduction

Spin squeezing and quantum entanglement play a critical role in quantum computing1,2,3, quantum information science4,5,6,7, and quantum metrology beyond the standard quantum limit8,9,10,11,12,13,14,15,16. During the past two decades, much effort has been devoted to realize spin squeezed and quantum entangled states in various physical systems, such as trapped ions17,18, and photonic systems19. However, these delicate quantum states are difficult to prepare and easy to lose their quantum coherence, due to the weak coupling to the environments.

A Bose-Einstein condensate (BEC) in ultracold atomic Bose gases shows another great potential in spin squeezing by utilizing the pseudospin or spin degrees of freedom, due to the fine tunability and controllability of the parameters and properties of the system. Recently, experimental realizations of spin squeezing beyond the standard quantum limit, through the one-axis twisting (OAT) which has a theoretical scaling of 1/N 2/3 for N particles20, were reported in two-component BECs14,15. However, the complete spin squeezed states in the Heisenberg limit, in particular for a large number of spins by two-axis twisting (TAT) method which has a scaling of 1/N for N particles20, have not been realized experimentally, because of the challenge to find a suitable system where the TAT method is directly applied.

In pursuing the perfect spin squeezed states in the Heisenberg limit, many theoretical proposals have been developed, including a wonderful theoretical proposal to dynamically generate the TAT Hamiltonian from the OAT one21,22,23. We refer this method as driven-OAT. Among many candidates for perfect spin squeezing, a more natural one is a dipolar spinor BEC with real atomic spin, such as 87Rb spin-1 condensates where the coherence time of these systems is extremely long in principle24. Although the stray magnetic fields in a practical experiment are believed to severely prevent the realization of the perfect spin squeezed states in such systems [Private communications with M. S. Chapman.], it has not been discussed how the noisy environments affect the spin squeezing dynamics and how to suppress their negative effects.

In this paper, we first briefly review the driven-OAT spin squeezing dynamics in a 87Rb ferromagnetic dipolar spin-1 BEC, where the magnetic dipolar interaction between atoms is employed to generate the driven-OAT Hamiltonian. We then investigate systematically the stray magnetic fields’ effect on the dynamics of the spin squeezing. Indeed, the stray magnetic fields in the order of microGauss completely destroy the spin squeezing. In order to suppress the effect of the noisy environments, we further propose to use the concatenated dynamical decoupling (CDD) pulse sequences with a bias magnetic field and faithfully rebuild the driven-OAT spin squeezing dynamics. Our results show that the dynamical decoupling method is experimentally practical to significantly suppress the noisy environments and effectively revives the spin squeezed state in a dipolar spin-1 BEC.

Spin squeezing dynamics in a dipolar spin-1 BEC

We consider a trapped dipolar spin-1 BEC whose Hamiltonian is24,25,26,27,28,29,30,

$$H={H}_{0}+{H}_{d}\mathrm{.}$$
(1)

where H d represents magnetic dipolar interaction between atoms and H 0 is the rest part. They are in the second quantized form

$$\begin{array}{rcl}{H}_{0} & = & \int d{\boldsymbol{r}}{\hat{{\rm{\Psi }}}}_{\alpha }^{\dagger }({\boldsymbol{r}})[(-\frac{{\hslash }^{2}{\nabla }^{2}}{2M}+{V}_{ext}({\boldsymbol{r}})){\delta }_{\alpha \beta }-{g}_{F}{\mu }_{B}{\boldsymbol{B}}\cdot {{\boldsymbol{F}}}_{\alpha \beta }]{\hat{{\rm{\Psi }}}}_{\beta }({\boldsymbol{r}})\\ & & +\frac{{c}_{0}}{2}\int d{\boldsymbol{r}}{\hat{\Psi }}_{\alpha }^{\dagger }({\boldsymbol{r}}){\hat{{\rm{\Psi }}}}_{\beta }^{\dagger }({\boldsymbol{r}}){\hat{{\rm{\Psi }}}}_{\alpha }({\boldsymbol{r}}){\hat{{\rm{\Psi }}}}_{\beta }({\boldsymbol{r}})\\ & & +\frac{{c}_{2}}{2}\int d{\boldsymbol{r}}{\hat{{\rm{\Psi }}}}_{\alpha }^{\dagger }({\boldsymbol{r}}){\hat{{\rm{\Psi }}}}_{\alpha \mathrm{^{\prime} }}^{\dagger }({\boldsymbol{r}}){{\boldsymbol{F}}}_{\alpha \beta }\cdot {{\boldsymbol{F}}}_{\alpha \mathrm{^{\prime} }\beta \mathrm{^{\prime} }}{\hat{{\rm{\Psi }}}}_{\beta }({\boldsymbol{r}}){\hat{{\rm{\Psi }}}}_{\beta \mathrm{^{\prime} }}({\boldsymbol{r}}),\\ {H}_{d} & = & \frac{{c}_{d}}{2}\int \frac{d{\boldsymbol{r}}d{\boldsymbol{r}}^{\prime} }{|{\boldsymbol{r}}-{\boldsymbol{r}}^{\prime} {|}^{3}}[{\hat{{\rm{\Psi }}}}_{\alpha }^{\dagger }({\boldsymbol{r}}){\hat{{\rm{\Psi }}}}_{\alpha \mathrm{^{\prime} }}^{\dagger }({\boldsymbol{r}}^{\prime} ){{\boldsymbol{F}}}_{\alpha \beta }\cdot {{\boldsymbol{F}}}_{\alpha \mathrm{^{\prime} }\beta \mathrm{^{\prime} }}{\hat{{\rm{\Psi }}}}_{\beta }({\boldsymbol{r}}){\hat{{\rm{\Psi }}}}_{\beta \mathrm{^{\prime} }}({\boldsymbol{r}}^{\prime} )\\ & & -3{\hat{\Psi }}_{\alpha }^{\dagger }({\boldsymbol{r}}){\hat{{\rm{\Psi }}}}_{\alpha \mathrm{^{\prime} }}^{\dagger }({\boldsymbol{r}}^{\prime} )({{\boldsymbol{F}}}_{\alpha \beta }\cdot {\boldsymbol{e}})({{\boldsymbol{F}}}_{\alpha \mathrm{^{\prime} }\beta \mathrm{^{\prime} }}\cdot {\boldsymbol{e}}){\hat{{\rm{\Psi }}}}_{\beta }({\boldsymbol{r}}){\hat{{\rm{\Psi }}}}_{\beta \mathrm{^{\prime} }}({\boldsymbol{r}}^{\prime} \mathrm{)].}\end{array}$$

where M is the mass of the atom, \({\hat{{\rm{\Psi }}}}_{\alpha }\) the field annihilation operator for spin component α = −1,0, + 1, e = ( rr ′)/| rr ′| the unit vector. The trapping potential is \({V}_{ext}({\boldsymbol{r}})=(M\mathrm{/2)(}{\omega }_{x}^{2}{x}^{2}+{\omega }_{y}^{2}{y}^{2}+{\omega }_{z}^{2}{z}^{2})\) with ω x,y,z being the trap angular frequencies. F = (F x , F y , F z ) with F x,y,z being spin-1 matrices. The collisional interaction parameters are c 0 = \(4\pi {\hslash }^{2}({a}_{0}+2{a}_{2})/3M\) and c 2 = \(4\pi {\hslash }^{2}({a}_{2}-{a}_{0})/3M\) with a 0(2) being the s-wave scattering length of two spin-1 atoms in the combined symmetric channel of total spin 0(2). The dipolar interaction parameter is \({c}_{d}={\mu }_{0}{g}_{F}^{2}{\mu }_{B}^{2}\mathrm{/4}\pi \) with μ 0 being the vacuum magnetic permeability, g F the Landé g-factor and μ B the Bohr magneton. The repeated indices are summed.

We consider a 87Rb ferromagnetic spin-1 condensate, where c 2 < 0, \({c}_{0}\gg |{c}_{2}|\) and c d ≤ 0.1|c 2|, and the single mode approximation is valid in a small or medium magnetic field31,32,33. Under this single mode approximation26,31, \({\hat{{\rm{\Psi }}}}_{\alpha }({\boldsymbol{r}})\simeq \varphi ({\boldsymbol{r}}){\hat{a}}_{\alpha }\) with ϕ(r) being a spin-independent spatial mode function and \({\hat{a}}_{\alpha }\) the annihilation operator of spin component α. In an axially symmetric trap, the Hamiltonian in Eq. (1) is remarkably simplified as28

$$H=({c}_{2}^{^{\prime} }-{c}_{d}^{^{\prime} }){{\boldsymbol{J}}}^{2}+3{c}_{d}^{^{\prime} }({J}_{z}^{2}+{\hat{n}}_{0})-{g}_{F}{\mu }_{B}{\boldsymbol{B}}\cdot {\boldsymbol{J}}\mathrm{.}$$
(2)

where \({\hat{n}}_{0}={\hat{a}}_{0}^{\dagger }{\hat{a}}_{0}\) and \({\boldsymbol{J}}={\sum }_{\alpha \beta }{\hat{a}}_{\alpha }^{\dagger }{{\boldsymbol{F}}}_{\alpha \beta }{\hat{a}}_{\beta }\) is the total spin operator of the dipolar spin-1 condensate. The rescaled interaction strengths are \({c}_{2}^{^{\prime} }=({c}_{2}/2){\int d{\boldsymbol{r}}|\varphi ({\boldsymbol{r}})|}^{4}\) and \({c}_{d}^{^{\prime} }=({c}_{d}\mathrm{/4)}\int d{\boldsymbol{r}}d{\boldsymbol{r}}^{\prime} {|\varphi ({\boldsymbol{r}})\varphi ({\boldsymbol{r}}^{\prime} )|}^{2}\mathrm{(1}-3\,\cos \,{}^{2}{{\boldsymbol{\theta }}}_{{\boldsymbol{e}}})/{|{\boldsymbol{r}}-{\boldsymbol{r}}^{\prime} |}^{3}\) where θ e is the polar angle of the vector rr .

For a typical spin-1 condensate, the number of atoms N is much larger than 1, \(N\gg 1\). Under this condition, the term with \({\hat{n}}_{0}\) is proportional to N while the terms with \({J}_{z}^{2}\) and J 2 are proportional to N 2. Thus, we may safely neglect the term with \({\hat{n}}_{0}\) 24,34 (We justify this approximation in the Supplemental Materials). Consequently, one finds that [J 2, H] = 0 which means the total angular momentum is a constant. Apart from the constant, the Hamiltonian in zero magnetic field becomes

$${H}_{OAT}=\chi {J}_{z}^{2}\mathrm{.}$$
(3)

where χ = \(3{c}_{d}^{^{\prime} }\) and hereafter we set \(\hslash \) = 1. Such a Hamiltonian is nothing but the famous OAT Hamiltonian which is used to generate spin squeezing.

Since the optimal squeezing direction is very complex to obtain and the optimal scaling of squeezing parameter is 1/N 2/3 for N particles under OAT, one expects to generate the perfect spin squeezed state with a fixed spin squeezing direction and with the Heisenberg limit by employing a TAT Hamiltonian20

$${H}_{TAT}=\frac{\chi }{3}({J}_{x}^{2}-{J}_{y}^{2}\mathrm{).}$$
(4)

This Hamiltonian is also known as double quantum Hamiltonian in nuclear magnetic resonance community35. The optimal spin squeezing occurs at t ≈ 3ln(8N)/(4N). The direction of the optimal spin squeezing is along the angle bisector of the x and y axes21. The TAT Hamiltonian is theoretically proposed to be effectively generated by periodically driving the OAT Hamiltonian21,22

$${H}_{D}=\chi {J}_{z}^{2}+\frac{\pi }{2}{J}_{y}\sum _{n=0}^{\infty }[\delta (t-n{T}_{c})-\delta (t-(n+\mathrm{1/3)}{T}_{c})-\delta (t-(n+\mathrm{2/3)}{T}_{c})]\mathrm{.}$$
(5)

where n belongs to integer and the term with J y describes the spin rotation around the ±y-axis with an angle π/2 in a form of hard pulse, as shown in Fig. 1(a). We refer hereafter this Hamiltonian as driven-OAT.

Figure 1
figure 1

(a) A pulse sequence used to effectively generate TAT from OAT at zero magnetic field. The red (green) bars with Y (\(\bar{Y}\)) represent a π/2 pulse around y (−y) axis. The system evolves freely between pulses. T c is the cycle period. (b) A CDD pulse sequence used to suppress the stray magnetic fields for driven-OAT. The purple (blue, black) bars with x (y, z) represent a π pulse around x (y, z) axis. (c) Spin squeezing for OAT (grey dashed line), TAT (grey solid line), and driven-OAT with χT c = 4 × 10−4 (green triangles), 2 × 10−4 (blue squares), and 1 × 10−4 (red circles). As T c decreases, the driven-OAT approaches to the TAT.

In this paper, we choose the number of 87Rb atoms N = 1250 in the spin-1 condensate. The coupling constant χ is evaluated for a typical optical trap with frequencies (ω x , ω y , ω z ) = 2π (150, 150, 1200) Hz. By searching for the ground state of the fully polarized condensate with imaginary time propagation method based on the three coupled Gross-Pitaevskii equations, the quantity for the interaction strength we numerically find χ ≈ 6.762 × 10−4 Hz [Due to strong repulsive interaction described by the term with c 0, the condensate density is much lower than the ideal gases’ density. Thus, the χ is also smaller than the value χ ≈ 2.324 × 10−3 Hz, obtained analytically by assuming a Gaussian ansatz in ref.29].

We prepare the condensate in a fully polarized initial spin state |J z = N〉 with the total spin J = N. We define the spin squeezing parameter among the triple of operator spanning the su(2) subalgebra36. Due to the fact that our initial state |J z = N〉 is defined with respect to the Bloch sphere of the {J x , J y , J z } operator, one can extend the definition of this parameter from the spin-1/2 ensemble to the spin-1 condensate20,24,37

$${\xi }^{2}=\frac{\mathrm{2(}{\rm{\Delta }}{J}_{\perp }{)}_{{\rm{\min }}}^{2}}{J}\mathrm{.}$$
(6)

Here, \({({\rm{\Delta }}{J}_{\perp })}_{{\rm{\min }}}^{2}\) represents the smallest variance perpendicular to the mean spin direction.

We numerically simulate the evolution of the dipolar spin-1 condensate from the prepared initial state under the OAT, TAT, and driven-OAT Hamiltonians. The results are presented in Fig. 1(c), similar to the previous results obtained by Liu et al.21. Clearly, the optimal spin squeezing parameter of the TAT is about an order of magnitude smaller than that of the OAT. More importantly, the spin squeezing parameter of the driven-OAT approaches that of the TAT if the cycle period T c is small enough. This condition is a reasonable results from the Magnus expansion,

$${[{e}^{-i\pi \mathrm{/2}{J}_{y}}{e}^{-i{T}_{c}\chi {J}_{z}^{2}\mathrm{/3}}{e}^{i\pi \mathrm{/2}{J}_{y}}{e}^{-i{T}_{c}\chi {J}_{z}^{2}\mathrm{/3}}{e}^{i\pi \mathrm{/2}{J}_{y}}{e}^{-i{T}_{c}\chi {J}_{z}^{2}\mathrm{/3}}{e}^{-i\pi \mathrm{/2}{J}_{y}}]}^{n}={e}^{-in{T}_{c}[{H}_{TAT}+O({J}^{4}{\chi }^{3}{({T}_{c}/3)}^{2})]}\mathrm{.}$$

if \({J}^{2}{(\chi {T}_{c})}^{2}\ll 1\). In Fig. 1(c) with χT c = 10−4, since \({J}^{2}{(\chi {T}_{c}\mathrm{/3)}}^{2}\sim 0.002\), the dynamical process of the driven-OAT coincides with the TAT’s results, which is consistent with the analysis based on the Magnus expansion.

Detrimental effect of noisy environments

In a practical spin squeezing experiment of a dipolar spin-1 BEC, there are inevitably noisy environments, e.g., the stray magnetic fields, originated from different sources. These fields are in the order of 1 mG in a common Lab and 0.1 mG in a magnetically shielded room38. The corresponding Lamor precession rates are about 70 Hz at 0.1 mG and 700 Hz at 1 mG for 87Rb, which are much larger than the dipolar interaction strength for each atom \(\sim \chi \,N\). Such a “strong” field certainly affects the spin squeezing dynamics and may eventually destroy the spin squeezed state.

In the following, we numerically examine the effect of the stray magnetic fields on the driven-OAT. We can safely neglect the quadratic Zeeman energy on the dynamical squeezing process since it is extremely small. For example, at a field B z = 4.83 mG, the quadratic Zeeman shift q = 1.681 × 10−3 Hz is much smaller than the linear one p = 3.381 × 103 Hz. In addition, the quadratic Zeeman energy is also much smaller than the dipolar interaction \((qN/\chi {N}^{2})\sim 2\times {10}^{-3}\). Thus, the Hamiltonian Eq. (5) in a stray magnetic field βg F μ B B becomes

$${H}_{D}=\chi {J}_{z}^{2}+{\boldsymbol{\beta }}\cdot {\boldsymbol{J}}+\frac{\pi }{2}{J}_{y}\sum _{n=0}^{\infty }[\delta (t-n{T}_{c})-\delta (t-(n+\mathrm{1/3)}{T}_{c})-\delta (t-(n+\mathrm{2/3)}{T}_{c})]\mathrm{.}$$
(7)

We assume that the stray magnetic fields are constant for each experimental shot but change randomly for different shots. The measured properties are actually averaged over many experimental shots. We mimic this quantum process by simulating the spin squeezing over 100 random magnetic fields, which obeys a uniform random distribution in the sphere |ββ m |, as illustrated in Fig. 2(a).

Figure 2
figure 2

(a) Samples of 100 random magnetic fields with the maximum magnitude β m = 5 × 106 χ (i.e., B m = 4.83 mG). Color scales the optimal spin squeezing parameter during a driven-OAT process with a given magnetic field. (b) Typical mean spin direction and error bars averaged over 100 samples with β m = 5 × 106 χ. The purple diamonds denote the polar angle θ. (c) Averaged evolution of spin squeezing parameter in stray magnetic fields with β m = 5 × 106 χ (labeled by C, up triangles), 5 × 102 χ (M, down triangles), and 0.1χ (H, right triangles). The driven-OAT cycle time T c = 1 × 10−4 χ −1. The solid grey curve represents the dynamics of TAT. (d) Optimal averaged spin squeezing parameter for different β m . The results shown in panel (c) are marked correspondingly with the same type triangles. Three regions are identified as Heisenberg, crossover, and classical, denoting the quantum Heisenberg limit, the crossover, and the classical limit, respectively. The vertical dashed lines with β H and β C mark the boundaries between the three regions. The blue and red horizontal dashed lines are the classical (\({\xi }_{m}^{2}\approx 0.6\)) and Heisenberg limit (\({\xi }_{m}^{2}\approx \mathrm{1/}N\)), respectively. The green dashed line depicts the analytic results of Eq. (11) in the crossover region.

The averaged evolution of the spin squeezing in stray magnetic fields with β m = 5 × 106 χ is plotted in Fig. 2(b) for the direction of the mean spin and in Fig. 2(c) for the spin squeezing parameter (up triangles). We find that (i) the mean spin direction is completely random; (ii) no spin squeezing compared to a classical coherent state, i.e., \({\xi }^{2}\sim 1\). Such results are reasonable since the environments are so noisy and destroy significantly the spin squeezing process. No spin squeezing occurs at all in the strong stray magnetic fields.As we decrease β m , the spin squeezing emerges gradually and approaches the ideal Heisenberg limit. The moment of the optimal spin squeezing parameter also extends to a longer time.

We investigate systematically the dependence of the optimal spin squeezing parameter on the β m and summarize the results in Fig. 2(d). We observe two plateaus in the weak and strong stray magnetic fields and a crossover in between. The weak field plateau is nothing but the Heisenberg limit from the TAT Hamiltonian, while the strong field plateau shows no-squeezing as the same as the classical coherent state. This plateau-crossover-plateau feature guides us to identify three regions: the Heisenberg region, the classical region, and the crossover. The boundaries are defined approximately as β H where \({\xi }^{2}=2{\xi }_{H}^{2}\) (i.e., 3 dB above the Heisenberg limit) with \({\xi }_{H}^{2}\approx \mathrm{1/}N\) the Heisenberg plateau value, and similarly β C where \({\xi }^{2}={\xi }_{C}^{2}\mathrm{/2}\) (i.e., −3 dB below the classical limit) with \({\xi }_{C}^{2}\approx 0.6\) the classical plateau value.

The appearance of the classical plateau is easily understood as one follows Law et al.’s derivation24,39. In a strong stray magnetic field, the effective Hamiltonian \({e}^{i\pi {J}_{y}/2}H{e}^{-i\pi {J}_{y}/2}\) in the first interval T c /3 is

$${H}_{eff}=\chi {J}_{x}^{2}-{\beta }_{z}{J}_{x}+{\beta }_{y}{J}_{y}+{\beta }_{x}{J}_{z}\mathrm{.}$$
(8)

The Heisenberg equations of motion for the condensate spin in the x and y directions are39

$$\begin{array}{rcl}{\dot{J}}_{x} & = & -{\beta }_{x}{J}_{y}+{\beta }_{y}{J}_{z},\\ {\dot{J}}_{y} & = & -\chi ({J}_{x}{J}_{z}+{J}_{z}{J}_{x})+{\beta }_{x}{J}_{x}+{\beta }_{z}{J}_{z}\mathrm{.}\end{array}$$

The solutions are

$$\begin{array}{rcl}{J}_{x}(t) & = & [{J}_{x}\mathrm{(0)}+\frac{{\beta }_{z}J}{{\beta }_{x}-2\chi J}]\,\cos (\omega t)-\frac{{\beta }_{x}}{\omega }[{J}_{y}\mathrm{(0)}-\frac{{\beta }_{y}J}{{\beta }_{x}}]\,\sin (\omega t)-\frac{{\beta }_{z}J}{{\beta }_{x}-2\chi J},\\ {J}_{y}(t) & = & [{J}_{y}\mathrm{(0)}-\frac{{\beta }_{y}J}{{\beta }_{x}}]\,\cos (\omega t)+\frac{\omega }{{\beta }_{x}}[{J}_{x}\mathrm{(0)}+\frac{{\beta }_{z}J}{{\beta }_{x}-2\chi J}]\,\sin (\omega t)+\frac{{\beta }_{y}J}{{\beta }_{x}}\mathrm{.}\end{array}$$

where we have adopted the approximation that J z J in the first interval T c /3 because the initial spin is along z direction and ω\(\sqrt{{({\beta }_{x})}^{2}-2{\beta }_{x}\chi J}\) is defined. The variance of the spin in x-y plane becomes

$$\begin{array}{ccc}\langle {({\rm{\Delta }}{J}_{\varphi })}^{2}\rangle & = & [{V}_{x}\,{\cos }^{2}(\omega t)+\frac{{({\beta }_{x})}^{2}}{{\omega }^{2}}{V}_{y}\,{\sin }^{2}(\omega t)]\,{\cos }^{2}\varphi \\ & & +[{V}_{y}\,{\cos }^{2}(\omega t)+\frac{{\omega }^{2}}{{({\beta }_{x})}^{2}}{V}_{x}\,{\sin }^{2}(\omega t)]\,{\sin }^{2}\varphi .\end{array}$$

where V x,y = 〈[J x,y (0)]2〉 and ϕ is the azimuthal angle. For the initial coherent state, V x,y = J/2 and consequently the spin squeezing parameter becomes

$${\xi }^{2}=\frac{\mathrm{2(}{\rm{\Delta }}{J}_{\perp }{)}_{{\rm{\min }}}^{2}}{J}\approx 1.$$
(9)

because |β x |/ω ≈ 1 (\(|{\beta }_{x}|\gg \chi J\)). Similar analysis is also applied at longer times. In the cases of extremely large magnetic fields β m T c /3 > 1, we split the time interval T c /3 into many smaller intervals \({T}_{c}^{^{\prime} }\) = T c /K and \({\beta }_{m}{T}_{c}^{^{\prime} }\mathrm{/3}\ll 1\). The above analysis is performed similarly for each smaller interval \({T}_{c}^{^{\prime} }/3\). Therefore, in a strong stray magnetic field, the spin squeezing parameter is independent of the field strength β m and is about the same as that for a coherent state. We call the strong field plateau, where the optimal squeezing parameter is approximately 0.6 [the blue dashed line in Fig. 2(d)], the classical region.

In the weak field limit, there exists another plateau, Heisenberg region, in Fig. 2(d). The optimal squeezing parameter of the plateau almost equals to ξ 2 = 1/N (the red dashed line)20, i.e., the stray magnetic fields do not affect the squeezing dynamics. However, we note that the field strength β H is about 5 nano-Gauss, which is impossible to be realized in current 87Rb spinor condensate experiments.

Between the classical and Heisenberg regions, there exists a crossover region where the optimal squeezing parameter increases monotonically with the increase of the stray magnetic fields β m . The feature in the crossover region can be understood by adopting the Magnus expansion, where the effective Hamiltonian in a period of T c is

$${H}_{eff}=\frac{1}{3}[\chi ({J}_{x}^{2}-{J}_{y}^{2})+{\beta }_{x}{J}_{x}+3{\beta }_{y}{J}_{y}+{\beta }_{z}{J}_{z})]\mathrm{.}$$
(10)

Similar to the classical region, the evolutions of the condensate spin in the x and y directions become

$$\begin{array}{rcl}{J}_{x}(t) & = & A+C,\\ {J}_{y}(t) & = & B+D\mathrm{.}\end{array}$$

where

$$\begin{array}{rcl}A & = & {J}_{x}\mathrm{(0)}\,\cosh (\tilde{\omega }t)-{J}_{y}\mathrm{(0)}\sqrt{\frac{{\omega }_{1}}{{\omega }_{2}}}\,\sinh (\tilde{\omega }t),\\ B & = & {J}_{y}\mathrm{(0)}\,\cosh (\tilde{\omega }t)-{J}_{x}\mathrm{(0)}\sqrt{\frac{{\omega }_{2}}{{\omega }_{1}}}\,\sinh (\tilde{\omega }t),\\ C & = & \frac{{\beta }_{x}J}{{\omega }_{2}}\,\cosh (\tilde{\omega }t)+\frac{{\beta }_{y}J}{\tilde{\omega }}\,\sinh (\tilde{\omega }t)-\frac{{\beta }_{x}J}{{\omega }_{2}},\\ D & = & -\frac{3{\beta }_{y}J}{{\omega }_{1}}\,\cosh (\tilde{\omega }t)-\frac{3{\beta }_{x}J}{\tilde{\omega }}\,\sinh (\tilde{\omega }t)+\frac{3{\beta }_{y}J}{{\omega }_{1}}\mathrm{.}\end{array}$$

with ω 1 = 2χJ + β z , ω 2 = 2χJβ z , and \(\tilde{\omega }=\sqrt{{\omega }_{1}{\omega }_{2}}\,\mathrm{/3}\). We have assumed J z J before the optimal squeezing time which is verified numerically. The variance of the spin in the x-y plane with an azimuthal angle ϕ is

$$\langle {({\rm{\Delta }}{J}_{\varphi })}^{2}\rangle =V(A)\,{\cos }^{2}(\varphi )+V(B)\,{\sin }^{2}(\varphi )+Cov(A,B)\,\sin \,\mathrm{(2}\varphi \mathrm{).}$$

where V(A), V(B) are the variances for A and B, respectively. Cov(A,B) is the covariance between A and B. The constants C and D contribute nothing to the variance 〈(ΔJ ϕ )2〉. Since the optimal spin squeezing direction in TAT at zero field is ϕ = π/4, we calculate the following squeezing parameter

$$\begin{array}{rcl}{\xi }^{2} & = & \frac{\mathrm{2(}{\rm{\Delta }}{J}_{\pi \mathrm{/4}}{)}^{2}}{J},\\ & \approx & {e}^{-r}+\frac{t\langle {\beta }_{z}^{2}\rangle }{6\chi J}\,{e}^{-r}+\frac{\langle {\beta }_{z}^{2}\rangle }{16{\chi }^{2}{J}^{2}}(3{e}^{-r}+{e}^{r}-4)\mathrm{.}\end{array}$$
(11)

with r = 4χJt/3. We have averaged the squeezing parameters over all stray magnetic fields samples so that \(\langle {\beta }_{z}^{2}\rangle ={\beta }_{m}^{2}\mathrm{/5}\). For a given β m , the optimal squeezing parameter \({\xi }_{m}^{2}\) is determined by finding the minimum value at different evolution times. Interestingly, the relation between \({\xi }_{m}^{2}\) and β m is in a simple square law. We plot the result of Eq. (11) with green dashed line in Fig. 2(d). The analytical results are in good agreement with the numerical results in the crossover region [The deviation of the analytical results from the numerical ones close to the classical region is due to the breakdown of the first order Magnus expansion Eq. (10).].

Rebuilding spin squeezing with dynamical decoupling

It is clear from Fig. 2 that a small stray magnetic field (β m β C = 5 × 104 χ, i.e., 50 μG) completely destroys the spin squeezing dynamics. To generate the squeezed spin state in such noisy environments, one has to suppress significantly the noise. The often employed approach is dynamical decoupling, borrowed from nuclear magnetic resonance community and quantum computing, including periodic dynamical decoupling, symmetrized dynamical decoupling, and CDD40,41,42. With numerical simulations, we find all these dynamical decoupling sequences with hard pulses suppress well the stray magnetic fields’ effect with a short enough pulse delay τ. However, in a real spin-1 condensate experiment, the pulse delay is lower bounded by the π-pulse width, which is in the order of 20 μs according to Eto et al.’s report43, and upper bounded by the the driven-OAT pulse delay T c /3. To satisfy the hard pulse approximation, we must choose τ as long as possible. Therefore, we set τ = τ m = T c /48, the upper bound in the CDD sequence. For a 87Rb condensate in a cylindrical trap with the previous given parameters, such a pulse delay τ is about 490 μs (i.e., T c = 23.52 ms), much longer than the π-pulse width. In our calculations, we approximate these π/2 and π pulses as hard pulses (i.e., δ function with zero width).

At zero bias field, all the dynamical decoupling sequences with τ = τ m unfortunately fail to suppress the stray fields’ effect [e.g., Fig. 3(d)]. The failures indicate that we have to apply a bias field h. The direction of the bias field must be along the z axis, due to the commutating requirement of the nonlinear squeezing term \(\chi {J}_{z}^{2}\). As to the strength of the bias field, one expects a possible small value in order to avoid its quadratic Zeeman effect. Among these DD sequences, the CDD depicted in Fig. 1(b) with a nonzero bias performs the best.

Figure 3
figure 3

Same as Fig. 2(a) and (b), except with the CDD pulse sequence and a large bias h/β m = 7. Inset shows the azimuthal angle of optimal squeezing direction in the x-y plane. (c) Averaged evolutions of spin squeezing parameter under the CDD sequence with the bias h/β m = 0 (circles), 2.5 (stars), 7 (squares). Each curve (with an error bar at optimal squeezing time) is over 100 realizations of stray magnetic fields. The solid grey curve represents the dynamics of TAT. (d) Dependence of the optimal (averaged) spin squeezing parameter \({\xi }_{m}^{2}\) (red asterisks with CDD, grey diamonds without CDD) on the bias h. The horizontal red dashed line denotes the Heisenberg limit, \({\xi }_{m}^{2}\mathrm{=1/}N\). The green curve represents the analytic result of Eq. (11). The vertical dashed line with h C marks a boundary where \({\xi }_{m}^{2}\mathrm{=2/}N\). Obviously, the CDD sequence with CDD and a large bias rebuilds the optimal spin squeezing perfectly while a bias alone can not. Inset shows the maximum of the effective stray magnetic fields β e,m in a CDD cycle.

We investigate systematically the CDD performance in various bias fields at τ = τ m ≈ 2 × 10−6 χ −1 and present our numerical results in Fig. 3. As shown in Fig. 3(a) and (b), the optimal spin squeezing parameters in each realization of a strong stray magnetic field are almost the same as the zero field case, indicating the significant suppression effect of the CDD sequence with h/β m = 7 and β m = 5 × 106 χ. Moreover, the polar θ of the spin direction and the azimuthal ϕ angle of the optimal squeezing direction are nearly the same as the theoretical prediction from the TAT model, i.e., θ = 0 and Φ= π/4. We present in Fig. 3(c) the spin squeezing dynamics for three typical biases. In the case of zero bias (h = 0, marked with ‘Z’ in the figure), the spin squeezing parameter changes little with time and the optimal value is about the same as that of a coherent state, indicating the failure of suppressing the stray magnetic fields. In the case of a small bias (h/β m = 2.5, marked with ‘S’), although we observe quite large spin squeezing, the optimal value is still above the Heisenberg limit. In the case of a large bias (h/β m = 7, marked with ‘L’), the spin squeezing dynamics is rebuilt almost perfectly, manifesting clearly the significant suppression of the stray magnetic fields by the CDD sequence. To understand more clearly about the bias field effect, we investigate systematically with numerical calculations and plot the dependence of the optimal squeezing parameter on the bias in Fig. 3(d). The three typical cases in Fig. 3(c) are also included and marked with the same letters. It is obvious that the stray magnetic fields effect is suppressed completely and the Heisenberg limit of the spin squeezing parameter is reached, if the bias field is large. While in a small magnetic field, the optimal spin squeezing parameter increases monotonically as the bias decreases. We may define a critical bias h c , which is the bias where \({\xi }_{m}^{2}\) is 2 times as large as (i.e., 3 dB above) the Heisenberg limit 1/N. For a 87Rb condensate in a cylindrical trap with the previous given parameters, the critical bias is about 20 mG, a value to safely neglect its quadratic Zeeman effect.

As shown in Fig. 3, the effect of the noisy environments is significantly suppressed by the CDD sequence in a large bias field. The spin squeezing dynamics of the driven-OAT is rebuilt perfectly. Such a good decoupling enables the condensate spin practically immune to the noisy environments. In the following, we calculate the effective stray magnetic fields to explain our numerical results in a bias magnetic field h. The time-modulated Hamiltonian is, in the laboratory reference frame,

$${H}_{DD}(t)={H}_{D}+h{J}_{z}+{H}_{CDD}(t\mathrm{).}$$
(12)

where

$$\begin{array}{rcl}{H}_{CDD}(t) & = & \pi \sum _{n\mathrm{=0}}^{\infty }\sum _{j\mathrm{=0}}^{2}[{J}_{x}\sum _{k\mathrm{=0}}^{7}\delta (t-(n+j\mathrm{/3)}{T}_{c}-\mathrm{(2}k+\mathrm{1)}\tau )+{J}_{y}\sum _{k\mathrm{=0}}^{3}\delta (t-(n+j\mathrm{/3)}{T}_{c}-\mathrm{(4}k+\mathrm{2)}\tau )\\ & & +{J}_{z}\sum _{k\mathrm{=0}}^{1}\delta (t-(n+j\mathrm{/3)}{T}_{c}-\mathrm{(8}k+\mathrm{4)}\tau )].\end{array}$$

denotes the CDD hard pulse sequence. The term H D in Eq. (8) includes the nonlinear interaction and the stray magnetic fields’ effect.

In the toggling frame defined by the CDD pulses44, the evolution operator becomes approximately (time ordered) \({U}_{CDD}={e}^{-i16\tau \chi {J}_{z}^{2}}\,T:{\prod }_{j\mathrm{=1}}^{16}{U}_{j}\), where U j = exp(−iτH j ) with

$$\begin{array}{rcl}{H}_{1} & = & {\beta }_{x}{J}_{x}+{\beta }_{y}{J}_{y}+h^{\prime} {J}_{z},\\ {H}_{2} & = & {\beta }_{x}{J}_{x}-{\beta }_{y}{J}_{y}-h^{\prime} {J}_{z},\\ {H}_{3} & = & -{\beta }_{x}{J}_{x}-{\beta }_{y}{J}_{y}+h^{\prime} {J}_{z},\\ {H}_{4} & = & -{\beta }_{x}{J}_{x}+{\beta }_{y}{J}_{y}-h^{\prime} {J}_{z},\\ {H}_{5} & = & {\beta }_{x}{J}_{x}-{\beta }_{y}{J}_{y}-h^{\prime} {J}_{z},\\ {H}_{6} & = & {\beta }_{x}{J}_{x}+{\beta }_{y}{J}_{y}+h^{\prime} {J}_{z},\\ {H}_{7} & = & -{\beta }_{x}{J}_{x}+{\beta }_{y}{J}_{y}-h^{\prime} {J}_{z},\\ {H}_{8} & = & -{\beta }_{x}{J}_{x}-{\beta }_{y}{J}_{y}+h^{\prime} {J}_{z}\end{array}$$

and H j = H 17−j for j = 9, 10, \(\cdots \), 16. Here, we have assumed \({J}_{z}^{2}\) a constant and introduced h′ = h + β z 39. To calculate the product of U j ’s, the usual average Hamiltonian theory is not applicable because \({\beta }_{x,y}\tau \lesssim 10\) and \(h^{\prime} \tau \lesssim 100\) beyond the convergence radius44,45,46,47. We employ, instead, a continuous rotation method developed by us previously48, by numerically calculating the effective magnetic field β e . The field β e generates the same rotation operator as the CDD one, i.e.,

$${e}^{-i16\tau {{\boldsymbol{\beta }}}_{e}\cdot {\boldsymbol{J}}}=T:\prod _{j\mathrm{=1}}^{16}{U}_{j}\mathrm{.}$$
(13)

The maximal magnitude of the numerically obtained effective stray magnetic fields β e is presented in the inset of Fig. 3(d). As shown in the figure, the maximum of the effective stray magnetic fields β e,m = max(|β e |) decreases as the bias h increases, except h/β e,m < 1 where β e,m equals its largest possible value π/(16τ). With these effective stray magnetic fields at hand, we further calculate the spin squeezing parameter by employing Eq. (11) and also present the results in Fig. 3(d). Note that the analytical Eq. (11) is invalid if β e,m < β H or t > t s where t s denotes the optimal spin squeezing moment, because the assumption of a constant J z is violated. Clearly, the analytical results agree quite well with numerical ones. Such a good agreement justifies the validity of the approximations we make.

Conclusion and outlook

With numerical and analytical methods, we explore the spin squeezing dynamics of a ferromagnetic dipolar spin-1 BEC in stray magnetic fields. We find the spin squeezing dynamics of the condensate through the driven-OAT is severely destroyed by the stray magnetic fields. However, by introducing the CDD pulse sequence and a bias magnetic field, the spin squeezing dynamics is recovered almost perfectly. Our results point out a practical way to realize the optimal spin squeezing in a dipolar spin-1 BEC and can be employed to find a way to reach the Heisenberg limit quantum metrology.

In our calculation, although the stray magnetic fields are randomly distributed in both strength and direction, they are static. To be more practical, one may consider further time-dependent stray fields, pulse duration, and pulse imperfection, which are worth exploring in the future.