Precise control of magnetic fields is a frequent challenge encountered in experiments with atomic quantum gases. Here we present a simple method for performing *in situ* monitoring of magnetic fields that can readily be implemented in any quantum-gas apparatus in which a dedicated field-stabilization approach is not feasible. The method, which works by sampling several Rabi resonances between magnetically field sensitive internal states that are not otherwise used in a given experiment, can be integrated with standard measurement sequences at arbitrary fields. For a condensate of ^{87}Rb atoms, we demonstrate the reconstruction of Gauss-level bias fields with an accuracy of tens of microgauss and with millisecond time resolution. We test the performance of the method using measurements of slow resonant Rabi oscillations on a magnetic-field sensitive transition and give an example for its use in experiments with state-selective optical potentials.

## I. INTRODUCTION

Experiments with ultracold atomic quantum gases^{1} often call for the manipulation and control of the atoms’ spin degree of freedom, including work with spinor Bose-Einstein condensates (BECs)^{2} or homonuclear atomic mixtures in state-selective optical potentials^{3–10} where a control of the Zeeman energies to a fraction of the chemical potential (typically on the order of 1 kHz or 1 mG), may be required. With fluctuations and slow drifts of ambient laboratory magnetic fields on the order of several to tens of milligauss, achieving such a degree of control over an extended amount of time requires dedicated field-stabilization techniques. However, in a multi-purpose BEC machine, this may be challenging given geometric constraints that can interfere with shielding or with placing magnetic-field probes sufficiently close to an atomic cloud, which are often subject to short-range, drifting stray fields from nearby vacuum hardware or optomechanical mounts. To address this problem, we have developed a simple method for direct monitoring of the magnetic field at the exact position of the atomic cloud, by employing the cloud as its own field probe, in a way that does not interfere with its originally intended use. The idea is that hyperfine ground-state Zeeman sublevels that are not used in an experimental run can be employed for a rapid, concurrent sampling of Rabi resonances, in the same run, thus making it possible to record and “tag on” field information to standard absorption images, which can be used both for slow feedback control and for stable-field postselection. We emphasize that our pulsed, single-shot method, which features an accuracy of tens of microgauss and has an effective bandwidth of 1 kHz, is not meant to compete with state-of-the-art atomic magnetometers;^{11–16} rather, its distinguishing feature is that it can be implemented without additional hardware and independently of geometric constraints, while featuring a performance that is competitive with that of advanced techniques for field stabilization in a dedicated apparatus.^{17,18} It can, at least in principle, be used over a wide range of magnetic fields, starting in the tens of milligauss range.

This paper is structured as follows. Section II presents the principle and implementation of our method. Section III discusses the expected measurement accuracy as well as an experimental test based on a tagged measurement of slow Rabi oscillations on a magnetic-field sensitive transition. Section IV describes an application featuring the precise characterization of a state-selective optical lattice potential via microwave spectroscopy.^{8}

## II. METHOD AND IMPLEMENTATION

### A. Principle of operation

The principle of the method is illustrated in Fig. 1 for the *S*_{1/2}(*F* = 1, 2) hyperfine ground states of ^{87}Rb, which are split by 6.8 GHz. The atomic sample is located in an externally applied bias field *B*_{0} along *z* leading to a differential Zeeman shift *δ*_{z}/2*π* = 0.7 MHz/G × *B*_{0} between neighboring $|F,mF\u2009$ states. Starting with all atoms in the state $|a\u2009\u2261|F=1,mF=\u22121\u2009$, a sequence of microwave pulses *i* distributes population to $|2,0\u2009,|2,\u22121\u2009,|2,\u22122\u2009$ (*i* = 1, 2, 3), and then via $|2,0\u2009$ to $|1,1\u2009$ (*i* = 4) and further to $|2,1\u2009$ and $|2,2\u2009$ (*i* = 5, 6). To ensure isolated addressing of each transition, the detunings *δ*_{i} and Rabi couplings Ω_{i} are chosen to be small compared to *δ*_{z} (by three orders of magnitude in the example discussed later), and the ordering of the individual pulses is chosen to avoid spurious addressing of near-degenerate single-photon transitions: $|2,\u22121\u2009\u2194|1,0\u2009\u2248|2,0\u2009\u2194|1,\u22121\u2009$ and $|2,1\u2009\u2194|1,0\u2009\u2248|2,0\u2009\u2194|1,1\u2009$. Other transitions are near-degenerate, but magnetic-dipole forbidden, $\Delta mF>1$.

The pulse parameters are adjusted such that the final populations $PF=2,mF$ expected at *B*_{0} are comparable, and that their sensitivity to small deviations^{19} *δB* from *B*_{0} is maximal, cf. Fig. 1(d). Assuming all *δ*_{i} > 0 at *B*_{0}, the populations’ change away from the nominal field *B*_{0} is negative for *i* = 1, 2, 3 and positive for *i* = 4, 5, 6, with each transition shifted by a different amount. The change in the set of final populations then allows for an unequivocal and precise reconstruction of *B* = *B*_{0} + *δB*. In quantitative terms, the transition probabilities *p*_{i} for the individual pulses can be calculated from the relative final-state populations $PF,mF=N(F,mF)/N$ as

Each *p*_{i} is related to the magnitude of the magnetic field *B* via

where $\Omega \u0303i=(\Omega i2+\delta i2)1/2$ and *δ*_{i} = *δ*_{i}(*B*) is the modified detuning of the *i*th pulse from the *i*th addressed resonance. Assuming that the Rabi couplings Ω_{i} are known from an independent calibration, the magnetic field *B* can then be extracted by fitting $\u210f(\delta i+\omega i)=E(Fi,mFi;B)\u2212E(Fi\u2032,mFi\u2032;B)$, where *ω*_{i} is the microwave frequency for the *i*th pulse and

is the Breit-Rabi energy of the levels involved in the transition, where the +(−) sign holds for F = 2(1), *x* = (*g*_{I} − *g*_{s})*μ*_{B}*B*/Δ, with *g*_{s} the g-factor of the electron, Δ = 2*π* × 6.834 GHz and *g*_{I} = −9.951 × 10^{−4} for ^{87}Rb.^{20}

### B. Experimental implementation

Our experiments are performed in a magnetic transporter apparatus,^{21} with an optically trapped condensate of *N* ∼ 1 × 10^{5} atoms in the $|a\u2009\u2261|1,\u22121\u2009$ ground state. At the end of an experimental run (which usually contains steps for the manipulation of the motional and/or internal state of the atoms), the atoms are released, given about 1 ms to expand (to avoid interaction effects), then subjected to the magnetometry pulse sequence described earlier and subsequently detected using absorption imaging. For the determination of the state populations $PF,mF$, we use Stern-Gerlach separation. In addition, to distinguish the *F* = 1, 2 states with |*m*_{F}| = 1 (note that the *g*_{F} factors in ^{87}Rb have the same magnitude), absorption imaging of the *F* = 2 states is first performed using resonant *F* = 2 → *F*′ = 3 light, which disperses the F = 2 atoms while the *F* = 1 atoms continue their free fall. After optical pumping of the *F* = 1 atoms to *F* = 2 (using *F* = 1 → *F*′ = 2 light), these atoms are then imaged as well.

Several considerations determine the optimum choice of parameters for the magnetometry pulse sequence. Maximizing the magnetic-field sensitivity of the *p*_{i} [see Eq. (1)] for a fixed coupling Ω_{i} yields optimum detunings *δ*_{i} ≈ 0.58Ω_{i} (at *B*_{0}) and pulse durations $\tau i\u22481.24\pi \Omega i\u22121$ (the pulse area should be kept below 3*π*/2 in order to avoid side lobes as high as the main lobe in the Rabi spectrum). Additional minimization of the sensitivity to possible fluctuations of Ω_{i} (with microwave amplifiers typically specified only to within 1 dB) modifies these conditions to *δ*_{i} ≈ 0.82Ω_{i} and $\tau i\u22480.94\pi \Omega i\u22121$, respectively. Ideally, the chosen coupling strength Ω_{i} of each transition should be proportional to the differential magnetic moment $\Delta \mu i=\u2202BE(Fi,mFi;B)\u2212\u2202BE(Fi\u2032,mFi\u2032;B)$ of the two states involved in the transition. Furthermore, the expected range *δB* of fluctuations around *B*_{0} sets the optimum choice of Ω_{i} through *δB* ∼ *ℏ*Ω_{i}/*μ*_{B}, and in turn the accuracy of the measurement goes down with increasing Ω_{i}. In our experiment, we can comfortably realize kHz-range microwave couplings on all transitions (which are independently calibrated from sampling single Rabi resonances).

To demonstrate our method, we applied a bias field of 5.9 G using a pair of Helmholtz coils with 10 ppm current stabilization. Figure 2 shows the results of a typical short-time measurement of the magnetic field along the bias field direction, using an AC-line trigger to start the pulse sequence. The dominant contribution to field fluctuations around *B*_{0} is seen to be ambient AC-line noise with an amplitude around 1 mG, containing the first few harmonics of 60 Hz. From here on, we compensate for this by feeding forward the sign-reversed fit function onto an identical secondary coil of a single winding. The subtraction of the fit results in residual fluctuations up to ±0.4 mG, without apparent phase relationship with the AC-line.

## III. CHARACTERIZATION OF PERFORMANCE

### A. Slow Rabi cycling

We characterize the remaining fluctuations further and, in particular, determine whether they represent the actual magnetic field in a time interval close to the measurement. For this purpose, we implement slow Rabi cycling (at *B*_{0} = 9.045 G) on the maximally magnetic-field sensitive transition $|a\u2009\u2261|1,\u22121\u2009\u2194|b\u2009\u2261|2,\u22122\u2009$, with a differential magnetic moment of Δ*μ*_{3} = 2*π* × 2.1 kHz/mG. This measurement is performed by varying the coupling time of the oscillation and then recording the number of atoms in $|b\u2009$. To accommodate the Rabi cycling measurement, we choose a truncated pulse sequence in which the population in $|a\u2009$ is subsequently distributed over five transitions instead of six. We note that this experiment is an example for the mode of operation depicted in Fig. 1(a), in which a “measurement” (of the Rabi cycling) is followed by a magnetic field “tag.” Magnetic-field fluctuations will lead to a rapid dephasing of the Rabi oscillation. However, using the field tag, the effect of (slow) magnetic-field fluctuations on the oscillation can be eliminated.

For a well-resolved, single-cycle oscillation, the instability of the detuning should not exceed about one tenth of the Rabi frequency. Here we choose Ω = 2*π* × 0.61(3) kHz, at an average detuning of *δ* = 2*π* × 0.44(3) kHz.

We see that the raw data resulting from multiple repetitions of the Rabi oscillation experiment have large associated scatter due to the long term drifts and shot-to-shot jitter of the magnetic field. To demonstrate the effect of the field tag, we plot the oscillation both as a function of inferred detuning (at a fixed duration) and time (at a fixed detuning). The results are shown in Figs. 3(b) and 3(c). In addition, we also plot all data, as scaled population $p\Omega \u03032/\Omega 2$ vs. scaled time $t\Omega \u0303$. Clearly, the field tagging leads to a marked improvement of the oscillation contrast.

Section III B, will give the details of a simulation of the exact behavior of the field reconstruction. For the given example and for the parameters of the five-pulse sequence used, we expect the reconstructed fields to scatter around the true magnetic field value with a 55 *μ*G standard-deviation. The simulation and data agree very well, with a slight deviation at late times, potentially due to imperfect cancellation of the AC-line or higher-frequency noise that is uncorrelated with the AC-line.

In our measurements, the high degree of correlation between the transferred population and the detected magnetic field further confirms that the residual fluctuations occur on a scale that is long compared to the duration of the Rabi cycle preceding the field measurement (cf. Fig. 3). We note that on long time scales, the observed magnetic field drifts are typically on the order of one to several milligauss, over the course of one hour.

### B. Expected theoretical accuracy and operation range

For the Rabi-oscillation measurements described in Sec. III A, the parameters of the magnetometry pulse sequence *i* = (1, 2, 4, 5, 6) were Ω_{i}/2*π* = (2.3, 1.6, 2.6, 2.0, 2.7) kHz, *τ*_{i} = (150, 150, 150, 200, 120) *μ*s, and *δ*_{i}/2*π* = (1.8, 2.8, 2.0, 2.1, 3.4) kHz, which yielded an inferred accuracy of 55 *μ*G. To estimate the ultimate resolution and limits of our magnetometer for optimal parameters (see Sec. II B), we perform a Monte-Carlo simulation, using a six-transition sequence. We start with a set of fixed (true) fields *B*_{tr} drawn from a Gaussian distribution around *B*_{0} that are supposed to be reconstructed. The number of atoms transferred in the *i*th pulse at fixed *p*_{i} is drawn from a binomial distribution, while the transfer probabilities *p*_{i} themselves are subject to uniformly distributed fluctuations of *τ*_{i} (±2 *μ*s), Ω_{i} (±1 dB), *δ*_{i} (±2*π* × 7 Hz) and the instantaneous magnetic field during each individual pulse due to uncanceled residual fluctuations (±100 *μ*G). The Rabi frequencies are Ω_{i}/2*π* = (0.9, 1.9, 3.1, 1.2, 1.9, 3.1) kHz, and the optimized detunings and pulse areas are *δ*_{i} = 0.82Ω_{i} and *τ*_{i}Ω_{i} = 0.94*π* as mentioned earlier.

Results of the simulation are shown in Fig. 4. For the optimum pulse parameters, the reconstruction of *B*_{tr} is accurate to within a standard deviation of 25 *μ*G. A reconstruction is consistently possible within a ±500 *μ*G window around *B*_{0}, if outliers with large fit uncertainties are removed. For larger distances from *B*_{0}, the default detunings *δ*_{i} can be readjusted, or alternatively larger Rabi couplings can be used, at the (inversely proportional) expense of the accuracy of the field reconstruction. The results of the simulation confirm that most of the apparent remaining fluctuations in Fig. 2 are actual fluctuations of the ambient magnetic field, at least to within the reconstruction uncertainty (±100 *μ*G for the pulse parameters chosen in that experiment).

## IV. APPLICATION: SPECTROSCOPY OF STATE-SELECTIVE OPTICAL LATTICES

A number of experimental applications involve the use of homonuclear mixtures of alkali atoms in state-selective optical lattice potentials,^{3–9,22} which rely on the existence of a differential Zeeman shift between the states involved. In certain cases, a highly stable separation between a deeply lattice-bound state and a less deeply bound or free state may be desired, such as when the states are subject to coherent coupling,^{23–25} requiring precise control of both the lattice depth and the magnetic field.

Figure 5(a) shows an experimental configuration in which we prepared an “untrapped” ensemble of atoms in state $|b\u2009=|2,0\u2009$, coupled to a state $|r\u2009=|1,\u22121\u2009$ that is confined to the sites of a deep, blue-detuned lattice potential with a zero-point energy shift *hν*_{ho}/2 = *h* × 20(1) kHz, generated with circularly polarized light from a titanium-sapphire laser.

To stabilize the magnetic field, we utilize post-selection down to the 100 Hz level based on the magnetic-field tagging described earlier, using parameters similar to those in Fig. 4. The optical intensity *I* is stabilized to ∼1% using a photodiode and a proportional integral differential (PID) regulation circuit, yielding a transition frequency that should be stable to within about 100 Hz (since $\omega ho\u221dI$). However, this does not eliminate the possibility of slow drifts of the lattice depth (such as due to temperature-induced birefringence or small wavelength changes of the laser) in the course of an experiment, as can be seen in Fig. 5(b). To address these issues, the precise resonance condition can now be monitored throughout data taking, using our method. The range of the drift is several hundreds of Hz. We emphasize that the spectroscopic precision necessary for this kind of experiment would not be attainable without canceling AC-line induced magnetic field noise and compensating the shot-to-shot fluctuations using the magnetic field tag.

## V. CONCLUSIONS

In conclusion, we have demonstrated a simple method for *in situ* monitoring of magnetic fields in quantum gas experiments with alkali atoms, with a demonstrated accuracy of 55 *μ*G, an inferred accuracy of 25 *μ*G for optimized parameters, and a time resolution of 1 ms. As already seen for the examples earlier, the magnetometry pulse sequence can be tagged onto experiments that potentially involve several hyperfine states. In principle, the number of transitions used for magnetometry can be reduced down to two, as long as they move differently for a change of the magnetic field (this can be achieved by having two detunings of opposite sign or differential magnetic moments of opposite sign). For example, the method could work using only transitions 1 and 4 of Fig. 1(b). Using a smaller number of transitions generally degrades the accuracy (here by a factor $\u223c3$ when all pulse parameters are left constant, compared to using six transitions), but it increases the measurement bandwidth (here by a factor of 3), which could be an important independent consideration for certain applications.

Thus far, we have only described the use of this method as a scalar magnetometer (in order to be able to ignore fluctuations in perpendicular directions). It should also be possible to access fluctuations of the ambient field in more than one spatial direction, if the bias field is rotated during the magnetometry pulse sequence (with two transitions used per direction). This can become important if one wants to use this method for stable field post-selection at low fields.

Finally, for comparison to other magnetometry techniques, a sensitivity may be specified as^{26} $\eta =\Delta BminT$, i.e., as the minimum detectable change in field $\Delta Bmin=2ln\u20092\sigma \u223c$ 60 *μ*G multiplied by the square root of the cycle time. Since typical field fluctuations in laboratories usually stem from AC-mains or are very low frequency (such as fluctuations of Earth’s magnetic field), synchronizing the experiment to the AC-line can yield one measurement in the effective integration time of 1 ms. In this case, an effective sensitivity $\eta \u2009\u223c\u2009300\u2009pT/Hz$ (in a measurement volume of 10 *μ*m^{3}) can be reached.

## ACKNOWLEDGMENTS

We thank M. G. Cohen for discussions and a critical reading of the manuscript. This work was supported by NSF PHY-1205894 and PHY-1607633. M.S. was supported from a GAANN fellowship by the DoEd. A.P. acknowledges partial support from ESPOL-SENESCYT.

## REFERENCES

Note1, for *δB* ≪ *B*_{0}, fluctuations perpendicular to z can be neglected, since they are quadratically suppressed.