1 Introduction

Quantum technology based on trapped-ion quantum bits has seen steady progress in the past decades. Quantum algorithms and simulations of increasing complexity have been recently demonstrated [13]. A crucial prerequisite is a sufficiently slow decay of qubit coherence. Widely employed optical or spin qubits based e.g., on \(^{40}\)Ca\(^+\) or \(^{88}\)Sr\(^+\) feature a qubit frequency which is linearly dependent on the ambient magnetic field, such that field fluctuations lead to dephasing, and thus, the stability of the magnetic field becomes crucial. Moreover, it has been shown that entangled states may exhibit an increased sensitivity to magnetic field fluctuations, scaling with the squared number of constituent qubits in the worst case [4]. Using various technical measures such as \(\mu\)-metal shielding, active magnetic field stabilization, synchronization to the ac mains and improved current drivers for supply of coils for generation of a quantizing magnetic field lead to typical coherence times of 10–40 ms [5, 6].

By contrast, ion species with hyperfine structure such as \(^9\)Be\(^+\) [7], \(^{43}\)Ca\(^+\) [8, 9] or \(^{171}\)Yb\(^+\) [10, 11] allow for encoding quantum information in magnetic field insensitive transitions, which feature a vanishing first-order Zeeman shift. Utilizing these species leads to additional challenges: a more complex level structure can lead to increased sophistication of qubit operation. Furthermore, such transitions require a specific magic magnetic field, which can restrict the range of possible applications. Some species require large magnetic fields, yielding Zeeman splittings larger than the natural linewidths of cycling or repump transitions. This in turn leads to increased complexity of e.g., Doppler cooling and qubit state preparation and readout. Moreover, some hyperfine species require laser fields at wavelengths in the UV range which are less convenient to generate and manipulate. While all these challenges have been successfully addressed, see e.g., [9], operating hyperfine qubits still leads to a resource overhead and increased complexity.

Fig. 1
figure 1

Ion trap setup with magnetic shielding enclosure, shown with one top part removed. The figure does not show the laser focusing optics inside the enclosure. Electrical signals and optical single-mode fibers are supplied via the holes with cylindrical sleeves. The inset shows one of the Al frames bearing the permanent magnets, which are coaxially placed near the coils

A second option to avoid magnetic-field-induced decoherence is to employ qubits which are encoded in decoherence-free subspaces of several physical qubits, e.g., Bell states of the type \(|01\rangle \pm |10\rangle\) for two constituent qubits. While persisting coherence at wait times of more than 20 s has been demonstrated [1214], the number of required qubit ions is increased, as well as the complexity of computational gates [15, 16]. Another technique for the suppression of slow qubit frequency drifts is dynamical decoupling [17, 18], which comes at the cost of increased control overhead, particularly for scalable architectures.

Fig. 2
figure 2

Measured qubit coherences versus wait time. a Data from spin-echo measurements, b data from Ramsey measurements. For each panel, the data shown in blue are measured with permanent magnets, whereas the data shown in red pertain to magnetic field generation via coils. In a, the open squares correspond to the permanent magnet data with applied readout error compensation. A Gaussian fit to the permanent magnet spin-echo data without readout compensation reveals a \(1/\sqrt{e}\) time of 2.1(1) s. For each data point, the qubit is measured along X and Y direction \({\times }300\) each, and the coherence was inferred via maximum likelihood estimation (see text). The respective measurement sequences are depicted on top of each panel

2 Experimental setup

In this work, we demonstrate long qubit coherence times by suppression of ambient magnetic field fluctuations. We trap \(^{40}\)Ca\(^+\) ions in a microstructured segmented Paul trap [19] and encode quantum information in the Zeeman-split sublevels of the ground state \(|4^2\text {S}_{1/2},m_J=+1/2\rangle \equiv |{\uparrow}\rangle\) and \(|4^2\text {S}_{1/2},m_J=-1/2\rangle \equiv |{\downarrow} \rangle\). The qubit is manipulated via stimulated Raman transitions and read out via electron shelving and subsequent detection of state-dependent fluorescence [20]. The trap setup, comprised of vacuum vessel, laser focusing optics, trap rf drive resonator and non-evaporable getter pump, is contained within an enclosure of outer dimensions 510 mm (height) \(\times\) 625 mm \(\times\) 625 mm, see Fig. 1. A similar design is reported in [21]. The enclosure [22] consists of two layers of \(\mu\)-metal (an alloy of 80 Ni and 20 % Fe with a permeability of about 80,000), each with 2 mm thickness and separated by a 6 mm Al layer. The enclosure consists of one bottom part and two removable top parts, where overlapping \(\mu\)-metal lids ensure that the shielding efficiency is not compromised by the gaps between the parts. With a pickup coil inside the enclosure, and sending coils outside, we measured attenuation factors in the range between 20 and 30 dB for signal frequencies between 50 Hz and 100 kHz. All required laser beams are supplied to the trap setup via single-mode fibers. The focusing optics for each beam is remote-adjustable via piezo-controlled mirror holders. All single-mode fibers and electrical signals, as well as the free-space photon collection optics, are fed into the enclosure through circular holes with diameters of up to 100 mm. The holes feature cylindrical \(\mu\)-metal sleeves of 100 mm length outside the enclosure in order to retain shielding efficiency.

The quantizing magnetic field is generated by 80 individual Sm\(_2\)Co\(_{17}\) cylindrical magnets with 6 mm diameter and 4 mm length [23], see Fig. 1. This material has a remanence of \({>}\)1 T with a temperature dependence of about −0.03 %/K—the lowest value known to us for common materials for permanent magnets. The magnets are glued at constant spacing into two round Al frames with an inner diameter of 108 mm and an outer diameter of 128 mm. The two frames are arranged in a coaxial geometry, each at a distance of 285 mm from the ion location. Given the geometry, we have inferred the number of required magnets for generating a quantizing magnetic field B yielding a groundstate Zeeman splitting of \(\Delta _Z=g_S \mu _B B/\hbar \approx 2\pi \times 10\,\hbox {MHz}\). For this, we assume each magnet to generate a dipolar field corresponding to a magnetic dipole moment, resulting from the magnets volume and the remanence of about 1 T. The resulting 80 magnets generate a magnetic field of about 0.37 mT at the ion position, leading to a qubit frequency, i.e., Zeeman splitting between \(|{\uparrow}\rangle\) and \(|{\downarrow} \rangle\) of about \(\Delta _Z=2\pi \times 10.5\,\hbox {MHz}\). This is sufficient to avoid spectral crowding on the S\(_{1/2}\leftrightarrow\)D\(_{5/2}\) quadrupole transition, which is utilized for qubit readout. On the other hand, it is smaller than the natural linewidth of the S\(_{1/2}\leftrightarrow\)P\(_{1/2}\) cycling transition, which facilitates Doppler cooling and detection. Eight additional magnets are placed to compensate for the magnetic field gradient at the ion position. This is done by measuring the Zeeman splitting at different locations along the trap axis [24], where we find a parabolic variation of the magnetic field. We added eight additional magnets, uniformly distributed along one of the aluminum frames, to coarsely adjust the minimum of the parabola inside the trap. We then iteratively moved the frame until the minimum coincided with the laser interaction region, where laser-driven gates are carried out and a magnetic field gradient would represent an error source. This results in a spatial variation of the Zeeman splitting of less than \(2\pi \times 1\,\hbox {kHz}\) in a position range of \({\pm }1\,\hbox {mm}\) around the laser interaction region. Saturation of the \(\mu\)-metal, which would compromise the shielding, occurs at field strengths in the 1 T regimen. As the closest distance of a magnet to a \(\mu\)-metal wall is about 20 cm, we can safely assume saturation to be irrelevant.

A quantizing magnetic field of the same magnitude can alternatively be generated by driving currents of 3360 mA through coils with an inner diameter of 75 mm and 170 windings, placed around viewports of the vacuum window and spaced by about 310 mm from the ion location. As the current source, we have employed a specially designed unit [25], supplied by an Agilent E3633A power supply in voltage control mode, which has current fluctuations on the order of \(\Delta I/I\approx 10^{-5}\) [26, p. 33]. A disadvantage of the current-driven coils with respect to the permanent magnets is the additional heat load within the enclosure, which is about 15 W in our case. This compromises the temperature stability—and therefore the stability of the laser focusing optics—inside the enclosure.

3 Measurement method

We characterize the qubit coherence via Ramsey-type measurements. Rather than recording complete Ramsey fringes, we measure expectation values of X and Y operators of the electron spin, i.e., we probe the Ramsey signal for two analysis phases at \(\pi /2\) difference. While this is sufficient to infer the coherence and phase of a superposition state, it keeps the measurement effort at a minimum, which is particularly relevant for long wait times. Coherent rotations are driven by a pair of co-propagating laser beams near 397 nm, detuned by \(2\pi \times 250\,\hbox {GHz}\) from the S\(_{1/2}\leftrightarrow\)P\(_{1/2}\) transition. Each beam is individually modulated and switched by a single-pass acousto-optical modulator. The beams are superimposed and jointly supplied to the trap via an optical single-mode fiber. Each measurement sequence starts with a coherent \(\pi /2\)-rotation on a single Doppler cooled ion initialized in \(|{\uparrow}\rangle\), which results in the superposition state \(\tfrac{1}{\sqrt{2}}\left( |{\uparrow}\rangle +|{\downarrow} \rangle \right)\). During a wait time \(\tau\), the superposition accumulates a phase, yielding the state \(\tfrac{1}{\sqrt{2}}\left( |{\uparrow}\rangle +\hbox {e}^{i\phi }|{\downarrow} \rangle \right)\). A concluding \(\pi /2\) qubit rotation with (without) \(\pi /2\) phase w.r.t the first pulse corresponds to qubit readout in the X (Y) basis upon projective measurement along Z. For the results presented in Sect. 4, each operator was measured \(300{\times }\) for a given wait time. During the wait time, the ion is shuttled [27] away from the laser interaction region in order to avoid residual scattering of photons on the cooling transition due to imperfect switch-off of the laser near 397 nm driving the S\(_{1/2}\leftrightarrow\)P\(_{1/2}\) cycling transition.

We assume the qubit state prior to the concluding \(\pi /2\) pulse to be characterized by the density matrix

$$\begin{aligned} \rho =\frac{1}{2} \left( \begin{array}{cc} 1 & \quad c \hbox {e}^{-i\phi } \\ c \hbox {e}^{i\phi } & \quad 1 \end{array}\right) , \end{aligned}$$
(1)

i.e., the population is equally distributed between \(|{\uparrow}\rangle\) and \(|{\downarrow} \rangle\), which is justified because the spin qubit exhibits a virtually infinite \(T_1\) time, and extrinsic depolarizing processes such as photon scattering do not play a significant role. The coherence \(c=2\cdot \vert \rho _{12}\vert\), i.e., the modulus of the off-diagonal element of the density operator, characterizes the dephasing induced by magnetic field fluctuations. We obtain estimates for this parameter from maximum likelihood evaluation of the measurement results. For this, we note that the respective probabilities to detect the qubit in \(|{\uparrow}\rangle\) for the X/Y measurements are given by

$$\begin{aligned} p_X&=\tfrac{1}{2}\left( 1-c \cos \phi \right) \nonumber \\ p_Y&=\tfrac{1}{2}\left( 1+c \sin \phi \right) \end{aligned}$$
(2)

Probing each operator N times, the probability to jointly detect \(N_X\) times \(|{\uparrow}\rangle\) for the X measurement and \(N_Y\) times \(|{\uparrow}\rangle\) for the Y measurement is governed by the binomial statistics of the dichotomic readout:

$$\begin{aligned} p\left( N_X,N_Y\vert c,\phi ;N\right)&\propto p_X^{N_X} \left( 1-p_X\right) ^{N-N_X} \nonumber \\&\quad \times \,p_Y^{N_Y} (1-p_Y)^{N-N_Y}. \end{aligned}$$
(3)

Interpreting this as a likelihood function for the parameter c for given measurement results \(N_X, N_Y\), we numerically maximize the log likelihood in order to obtain an estimate. The confidence intervals are obtained by computing the values at which the likelihood drops to \(1/\sqrt{e}\) of its maximum value. Note that the maximum likelihood estimation of the superposition coherence is subject to a bias for the cases with near-unity coherence and superposition phases that are not an integer multiple of \(\pi /2\). This leads to unfavorable readout probabilities neither close to zero nor to one for both X and Y measurements, such that shot noise is increased. Thus, for these cases the maximum likelihood estimation of \(C(\tau )\) yields reduced values with increased error bars.

Fig. 3
figure 3

Measured qubit coherence versus wait time without triggering to the ac line, for closed shielding and permanent magnets. The data show results from spin-echo measurements, and the solid line is a fit to Eq. 6. The periodic contrast loss is caused by increased phase accumulation from magnetic fields oscillating at the ac line frequency, enhanced by the refocusing pulse at half the line period. The inferred qubit frequency modulation depth is \(\Delta _{\mathrm{ac}}=2\pi \times 25.0(5)\,\hbox {Hz}\). The data are taken with the same method and parameters as shown in Fig. 2 (see text)

4 Measurement results

4.1 Permanent magnet results

For each of these measurements, we trigger the sequence on the 50 Hz ac line, and we perform either a Ramsey measurement, or a spin-echo measurement with an additional refocusing \(\pi\)-pulse at half the wait time. The latter allows for suppression of fluctuations on a timescale slower than the respective wait time. The resulting coherences for the different measurement types are shown in Fig. 2. For the case with refocusing, the contrast exhibits a Gaussian decay \(C(\tau )=\exp {\left( -\tau ^2/2\tau _d^2\right) }\) until wait times \(\tau\) of up to 4.5 s, at a dephasing time constant of \(\tau _d=2.1(1)\,\hbox {s}\). The coherence decay exhibits a Gaussian shape, and thus, according to Ref. [26, Appendix A], the correlation time of the fluctuations is larger than the maximum measured phase accumulation time. In this limit, the decay time constant corresponds to an rms amplitude of the effective magnetic field fluctuations of about \(\sqrt{\langle \Delta B^2\rangle }=\hbar /(2\mu _B\tau _d)=2.7\,\hbox {pT}\). The data pertaining to the case without refocusing pulse exhibit a more rapid decay \(\tau _d^*=300(50)\,\hbox {ms}\) due to slow fluctuations on the timescale of a contrast measurement \(t_{\text {meas}}\approx 2N\tau _d^*\), where both X and Y operators are measured N times. These fluctuations are sufficiently fast to cause a phase spread among different measurement shots, but slow enough to be considered as static during a single shot. Thus, these fluctuations can be suppressed by rephasing pulses.

4.2 Coil results

We compare these results to the situation where the quantizing magnetic field is generated with coils. Even with the magnetic shielding enclosure closed, we found only a small increase in spin-echo coherence times to about 45(3) ms, as compared to 11(2) ms with both top segments of the enclosure removed. The corresponding measurement data are shown in Fig. 2 (red dots). We conclude that in typical laboratory environment, the impact of ambient magnetic field noise is on the same order of magnitude as the noise generated by low-noise current supplies, such that a substantial enhancement of coherence times requires both magnetic shielding and permanent magnets.

4.3 Residual ac-line field

Spin-echo measurements with one or more refocusing pulses allow for measurement of spectral components of magnetic field noise [28]. For the setting with permanent magnets and closed shielding enclosure, we quantify the residual field fluctuations at the 50 Hz ac-line frequency by performing spin-echo measurements without triggering to the ac line. As shown in Fig. 3, periodic loss and revival of coherence are observed at a period corresponding to the ac-line frequency. This occurs because refocusing at half the line period leads to the adverse effect of increase rather than cancelation of the accumulated phase. Assuming sinusoidal modulation of the qubit frequency at a line frequency of \(\omega _{{\mathrm{ac}}}=2\pi \times 50\,\hbox {Hz}\), at a frequency deviation \(\Delta _{{\mathrm{ac}}}\) and a random phase at sequence start \(\chi _{{\mathrm{ac}}}\), the qubit accumulates a phase

$$\begin{aligned} \phi _{{\mathrm{ac}}}\left( \tau ,\chi _{{\mathrm{ac}}}\right) =\left( \int _{0}^{\tau /2}\hbox {d}t-\int _{\tau /2}^{\tau }\hbox {d}t\right) \Delta _{{\mathrm{ac}}}\sin \left( \omega _{{\mathrm{ac}}}t+\chi _{{\mathrm{ac}}}\right) . \end{aligned}$$
(4)

Here, we take into account the inversion of the phase accumulation rate after the refocusing \(\pi\)-pulse. We assume a uniform distribution of the phase \(\chi _{{\mathrm{ac}}}\) of the sequence start w.r.t. the ac line, which is justified if the repetition rate is not commensurate with the line frequency. The resulting coherence is then given by averaging over \(\phi _{{\mathrm{ac}}}\) with respect to \(\chi _{{\mathrm{ac}}}\):

$$\begin{aligned} C(\tau ) = \frac{1}{2\pi }\int _0^{2\pi }\hbox {d}\chi _{{\mathrm{ac}}} \exp (i\phi _{{\mathrm{ac}}}(\tau ,\chi _{{\mathrm{ac}}}))\end{aligned}$$
(5)
$$= _{0}F_1\left( 1,-\left( \frac{\pi \Delta _{{\mathrm{ac}}}^2\sin ^2(\omega _{{\mathrm{ac}}}\tau /4)}{\omega _{{\mathrm{ac}}}^2}\right) ^2\right),$$
(6)

where \(_0F_1\left( a,z\right)\) is the regularized confluent hypergeometric function. Fitting the measured coherence versus wait time to Eq. 6 reveals a residual ac-line-induced frequency deviation of \(\Delta _{{\mathrm{ac}}}=2\pi \times 25.0(5)\,\hbox {Hz}\). For the situation with the magnetic field generated by coils, the frequency deviation was about \(\Delta _{{\mathrm{ac}}}=2\pi \times 300\,\hbox {Hz}\), while the permanent magnets without shielding enclosure yield \(\Delta _{{\mathrm{ac}}}=2\pi \times 1.5\,\hbox {kHz}\). Note that for these cases, the frequency deviations were measured by performing Ramsey measurements with short wait times \({<}\)2 ms for fixed phases \(\chi _{{\mathrm{ac}}}\) w.r.t. the ac line, which provides a direct measurement of the variation of the qubit frequency during an ac-line cycle. For comparison, the coherence times and ac-line modulation depths for various settings are summarized in Table 1.

Table 1 Summary of coherence times and ac-line-induced frequency deviations for different experimental settings
Fig. 4
figure 4

Qubit frequency drift: the shift of the qubit frequency for the case with permanent magnets and closed shielding enclosure is tracked over a time of more than 10 h by a Ramsey measurement at 15 ms wait time. The measurement is started in the evening, and overnight settling can be clearly recognized. The measurement is performed similarly to the measurements presented in Fig. 2 (see text)

4.4 Long-term stability

Furthermore, we characterize the long-term drift of the qubit frequency by performing an ac-line-triggered Ramsey measurement with \(\tau =15\,\hbox {ms}\). The qubit frequency is inferred from the extracted phase, and the results are shown in Fig. 4. We observe a maximum drift rate of about \(2\pi \times 0.05\,\hbox {Hz}/\hbox {s}\), and a total frequency change of about \(2\pi \times 700\,\hbox {Hz}\) over 10 h. The settling behavior suggests thermal drifts to be responsible for the qubit frequency drift. With the dependence of the remanence of Sm\(_2\)Co\(_{17}\) of −0.03 %/K mentioned above, this would correspond to a temperature change of about −0.2 K within 10 h.

5 Decoherence sources

The longest coherence times are obtained for the setting with closed shielding enclosure, spin-echo and ac-line triggering. In the following, we discuss the mechanisms which can cause the remaining decoherence:

  • Limited shielding efficiency of the \(\mu\)-metal enclosure: for the case with permanent magnets and ac-line triggering, we compare the measured spin-echo coherence times for the closed enclosure (2.1 s) and the opened enclosure (\({\gtrsim }\)0.03 s). The respective dephasing rates are proportional to the rms magnetic field fluctuation amplitude. The ratio of these is roughly consistent with the shielding specification of the enclosure of −30 dB at low frequencies. Thus, residual penetration of fluctuating ambient magnetic fields is most likely the dominating source of decoherence.

  • Fluctuations of the 50 Hz ac mains frequency: we observe shifts of several milliseconds of the ac mains phase at a delay of 2 s w.r.t. an initial trigger flank during an observation time of about 10 min. This is consistent with 0.05 Hz frequency fluctuations of the ac mains frequency. Together with the peak-to-peak phase modulation depth of about \(1{\pi }\) for a spin-echo sequence, this leads to significant dephasing within the maximum measured wait time of 4 s.

  • Thermal drifts of the permanent magnets which affect their magnetization: while the long-term drift of the quantizing magnetic field has been characterized, see Fig. 4, noise from the magnets on short timescales has not been quantitatively characterized, and therefore, this could possibly contribute to the observed decoherence.

  • Drifts of the trapped-ion position in conjunction with the magnetic field inhomogeneity: by performing Ramsey measurements in combination with ion shuttling [24], we observed a gradient of the Zeeman splitting of about \(2\pi \times 8\times 10^6\,\hbox {Hz}/\hbox {m}\). Thus, positions drifts from uncontrolled charging of the trap or its thermal expansion might also contribute.

  • Drifts of the relative optical phase between the two beams driving the qubit via the stimulated Raman transition: for a similar setup, we have observed phase drifts of the relative optical phase of about \(3{\pi }\) within 10 min [29]. However, as the interferometer area in the present fiber-coupled setup is much smaller and the phase drifts within 4 s are negligible, this mechanism can be excluded.

  • Deterioration of qubit readout fidelity: we determined a loss of readout fidelity of about 20 % at a wait time of 4 s, induced by heating of the ion, and thus, this is excluded to be a limiting mechanism. Coherences corrected for readout efficiency deterioration are also shown in Fig. 2.

6 Conclusion

In conclusion, we have realized an environment for AMO physics experiments at variable, intermediate magnetic fields with short-term fluctuations of \(\sqrt{\langle \Delta B^2\rangle } \le 2.7\times 10^{-12}\,\hbox {T}\). We compare our setup to other experimental environments with low magnetic field noise: for high fields of a few T strength, specially arranged superconducting solenoids [30] yield sub-nT rms magnetic field noise in the frequency range of 10–200 Hz [31], while for fully shielded large facilities operating at null field, rms field fluctuations in the femto-Tesla range are attained [32]. We have demonstrated to our knowledge unprecedented coherence times of first-order magnetic-field-sensitive atomic qubits. The coherence times become competitive with magnetic-field-insensitive atomic qubits, or systems such as nitrogen-vacancy centers [18], or ensembles of Cs atoms in a \(^4\)He matrix [33]. In typical laboratory environments, residual current fluctuations in field coils seem to have a similar impact as ambient magnetic field fluctuations, and thus, long coherence times may be reached using permanent magnets in conjunction with proper shielding.

Our results might have influence on the choice of the employed ion species and experimental setups for future trapped-ion experiments. Also, for ion or neutral atom species with clock states, the detrimental impact of higher-order Zeeman shifts on the operation of atomic frequency standards or precision measurements could be mitigated. For high-fidelity quantum information purposes, our \(1/\sqrt{e}\) dephasing time of 2.1 s enables on the order of \(10^5\) gate operations [34, 35], paving the way for scalable implementations of e.g., topological error correction [36] or quantum algorithms [1].