## 4 Stray Fields Compensation
The characteristic parameters of each pair of coils, i.e., the inductance, the resistance and the Gauss per ampere coefficient, are determined experimentally [27] and are shown in Table 1.  
With our circuit, we are able to generate magnetic fields up to \(\pm\)5.5 G along the \(z\)-axis. Along the remaining axes, we can easily exceed 13 G. These fields are sufficiently strong and are able to cancel most of the typical laboratory stray fields, including the Earth's magnetic field. The magnetic field \(\vec{B}\) generated by the set of three coils, each controlled by an analog voltage \(U_{x,y,z}\), can be expressed as  
\[\vec{B}= \begin{bmatrix}B_{x}\\ B_{y}\\ B_{z}\end{bmatrix} =a \begin{bmatrix}\eta_{x}U_{x}\\ \eta_{y}U_{y}\\ \eta_{z}U_{z}\end{bmatrix} , \tag{2}\]  
where \(a=1.81\) A/V is the gain coefficient of the circuit and \(\eta_{x,y,z}\) are the conversion coefficients between the current flowing through each pair of coils and the field the pair produces (see Table 1.)  
For compensation of stray fields, we rely on measurements of the cloud width \(\sigma(t_{\text{TOF}})\) after a fixed expansion time \(t_{\text{TOF}}\) (typically around 8 ms). This can be treated as a proxy for the cloud's temperature due to the relation between the expansion time and the cloud's size, \(\sigma^{2}(t_{\text{TOF}})=\sigma_{0}^{2}+k_{\text{B}}T/m\cdot t_{\text{TOF}}^ {2}\), where \(\sigma_{0}\) is the initial cloud size (here, at the end of gray molasses), \(k_{\text{B}}\) is the Boltzmann constant, \(m\) is the mass of the atom, and \(T\) is the temperature of the cloud. For the determination of the temperature, we perform a proper time-of-flight measurement, where the cloud width is measured for various expansion times \(t_{\text{TOF}}\). Immediately before the gray molasses stage, the cloud has a temperature of \(\sim\)400 \(\mu\)K. We note that for uncompensated stray fields present in our laboratory, the two-photon condition that provides the best cooling (here, down to 32 \(\mu\)K) is at the detuning of \(-1.6\) MHz with respect to the compensated case (black diamonds in Figure 3a). With stray magnetic fields present, at the \"zero magnetic field\" two-photon condition, we are able to cool atoms to 70 \(\mu\)K. When the stray fields are compensated, we reach 8 \(\mu\)K. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**axis** & \(\mathbf{L(\text{mH})}\) & \(\mathbf{R(\Omega)}\) & \(\mathbf{\eta(\text{G/A})}\) & \(\mathbf{w,h,s}\) \\ \hline \(x\) & 4.2 & 2.3 & 3.3 & 11, 26, 15 \\ \(y\) & 2.9 & 2.1 & 4.4 & 15, 26, 11 \\ \(z\) & 3.6 & 1.9 & 1.4 & 11, 15, 26 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Characteristic parameters of each pair of rectangular coils used for generating a magnetic field vector \(\vec{B}\) at the location of atoms. The last column shows the width \(w\), the height \(h\), and the separation \(s\) between coils in each pair, given in cm. \(L\)—inductance, \(\Omega\)—resistance, and \(\eta\)—the conversion coefficient relating the magnetic field to the current flowing through each pair of coils. We begin stray field compensation by setting the frequencies of the cooling and the repumping laser such that they fulfill the two-photon condition at 0 G, with both beams detuned by 10 MHz to the blue from \(|F=1\rangle(|F=2\rangle){\rightarrow}\)\(|F^{\prime}=2\rangle\) transitions. Next, we generate a set of analog control voltages for the bipolar sources that create a magnetic field vector \(|\vec{B}|=0.42\) G but with different tilt angles \(\phi\in\langle 0,360\rangle\) and \(\theta\in\langle 0,180\rangle\). The magnitude of the initially applied magnetic field is chosen based on the measurement of the stray fields with a smartphone located near the vacuum chamber. The actual value is irrelevant for our method. The angles are uniformly distributed and initially chosen such that the number of measurements is not too large.