## 4 Stray Fields Compensation
For each combination of angles \(\phi\) and \(\theta\), we use fluorescence imaging to obtain the width of the cloud of atoms after 8 ms ballistic expansion following a period of gray molasses cooling on the D1-line. The extent of the expanded cloud directly relates to the cloud's initial size (i.e., before sub-Doppler cooling) and can be treated as a proxy of its temperature. With 400 measurements overall, we can obtain the map shown in Figure 3b, which illustrates how the horizontal extension of the cloud changes with the tilt angles of the applied magnetic field vector. It should be emphasized that for each pair of angles shown in Figure 3b, the atoms see a different  
Figure 3: The horizontal width of the \({}^{39}\)K cloud extracted from fitting a gaussian distribution is used as a proxy of the temperature—the narrower the cloud, the colder it is. **(a)** The width normalized to the off-resonance value after gray molasses cooling for variable Raman detuning. Red dots show the initial measurements before any compensation of stray fields. The most efficient cooling (down to 32 \(\mu\)K) is obtained when the repumper frequency is detuned by \(-1.6\) MHz with respect to the “zero gauss” two-photon condition, which is used in our compensation method. Black diamonds show an analogous measurement after stray field compensation. **(b)** The width of the cloud for various tilt angles of the magnetic field vector, measured with the amplitude of the applied magnetic field fixed at \(B=0.42\) G. **(c)** The width of the cloud for various magnitudes of the _applied magnetic field_ vector for \(\phi_{\text{min}}=256^{\circ}\) and \(\theta_{\text{min}}=96^{\circ}\). Inset: data verifying the quadratic dependence of temperature on the _net magnetic field_ for small magnetic fields. **(d)** The predicted increase in the cloud’s temperature for the same conditions as used in **(b)** as a function of tilt angles. The plot is in qualitative agreements with observations shown in **(b)**. The color scale in **(b,c)** is normalized such that 0 and 1 correspond the minimum and maximum widths of the cloud, respectively. magnetic field, which is a vector sum of the stray field and the applied external field. The data allow us to identify approximate values of angles \(\phi_{\rm min}=256^{\circ}\) and \(\theta_{\rm min}=96^{\circ}\) for which the cloud becomes the smallest (i.e., the coldest). For these angles, the applied field is approximately anti-aligned with the stray field (the net field is the smallest), which improves sub-Doppler cooling. Figure 3b also shows an additional feature: increased heating for \(\theta_{\rm max}=\pi-\theta_{\rm min}\) and \(\phi_{\rm max}=\phi_{\rm min}-\pi\), i.e., when the applied field is aligned with the stray field (the net field is the largest). We minimize the net field by repeating the procedure devised for varying angles, but this time, the length of the vector \(|\vec{B}|\) is varied, while its orientation is fixed at angles \(\phi_{\rm min}\) and \(\theta_{\rm min}\). The width of the cloud as a function of \(|\vec{B}|\) has a minimum (Figure 3c), which we use for a second iteration of measurements, this time with angles \(\phi\) and \(\theta\) distributed in the range of \(\pm 20^{\circ}\) around the identified approximate values. Once new, more precise angles \(\phi_{\rm min}=256^{\circ}\) and \(\theta_{\rm min}=92^{\circ}\) are found with uncertainty of about \(\pm 2^{\circ}\), the length of the applied magnetic field vector is scanned again. Here, we want to probe the temperature increase near 0 G where it is not very sensitive to the magnetic field changes. To improve the quality of compensation, we extend the gray molasses stage to 1 s and monitor the total atom number vs. applied magnetic field. The further we are from the optimal cooling conditions, the more the atoms are heated, and they are eventually lost from the region of interest that we use to calculate the atom number.