Dynamical decoupling of spin ensembles with strong anisotropic interactions

Ensembles of dopants have widespread applications in quantum technology. The miniaturization of corresponding devices is however hampered by dipolar interactions that reduce the coherence at increased dopant density. We theoretically and experimentally investigate this limitation. We find that dynamical decoupling can alleviate, but not fully eliminate, the decoherence in crystals with strong anisotropic spin-spin interactions. Our findings can be generalized to all quantum systems with anisotropic g-factor used for quantum sensing, microwave-to-optical conversion, and quantum memory.

Distributed quantum information processing and sensing requires long-lived and efficient quantum memories [1,2]. A promising solid-state platform for such memories are crystals with rare-earth dopants [3], in which outer shell electrons shield qubits encoded in 4f-levels from electric fields. Thus, exceptional coherence of both ground state [4,5] and optical transitions [6,7] can be obtained. However, the small oscillator strength of the optical transitions [3] typically requires a very large number of dopants. This hampers constructing small devices for efficient multiplexing and integration on a chip [8][9][10][11][12]: When increasing the dopant concentration, the onset of dipolar interactions between spins leads to a decrease of the achievable coherence time. While off-resonant spins can be decoupled by a series of spin-echo pulses [13], this does not work for spins with the same Larmor frequency. Here, applying resonant pulses will change the precession frequency of each spin by altering the magnetic field generated by its neighbors. This phenomenon, termed instantaneous diffusion (ID) [14], seems to pose a limit to the minimal size of all quantum memories and sensors based on spin ensembles.
In this work, we theoretically and experimentally investigate to which degree this limitation can be overcome by advanced dynamical decoupling (DD) protocols. DD has developed into a powerful technique to protect the coherence of spins in solids [13], enabling coherence time improvements by several orders of magnitude in dilute spin ensembles [15] and sensing with unprecedented resolution [16]. It has also been applied to rare-earth dopants, in particular non-Kramer's ions [17][18][19] that experience only weak interactions. Here, we instead focus on Kramer's dopants with strong spin-spin interactions. We describe their spin state in the eigenstate basis of the Zeeman Hamiltonian Here, B 0 is the external magnetic field, µ B the Bohr magneton, and S the spin vector. We assume an anisotropic g-tensor that is diagonal in the coordinate axes x, y, z. Then, the spins precede around an effective magnetic field that differs from B 0 [20]. Still, the pairwise interaction between dopants can be modeled by dipolar interactions. In the Zeeman eigenbasis, the corresponding Hamiltonian reads: Here, σ x,y,z are the Pauli matrices,σ ± = (σ x ± iσ y ) /2 the ladder operators, and we have dropped all nonsecular terms likeσ +σ+ andσ +σz . The coefficients J S and J I represent the strengths of flip-flop and spectral diffusion processes, respectively. To calculate the dephasing rate, we focus on J I that describes the energy shift for a pair of two spin-1/2 dopants at a distance r: Here, µ 0 is the magnetic permeability of free space, h is Planck's constant, and δ is the angle between the precession axis of the spins and the vector connecting them. γ eff is the effective gyromagnetic ratio and depends on the projections b i of the magnetic field vector on the g-tensor eigenaxes as follows: When spin-lattice relaxation is negligible, one can derive a Lorentzian broadening of the transition frequency by integrating over a random distribution of dopants in the dilute ensemble [21,22]. Its full-width-half-maximum (fwhm) linewidth is Here, n eff is the concentration of spins that are flipped by the spin echo pulse [23]. Eq. (5) implies an exponential decay of the coherence with decay constant T −1 SE = π∆ν, which poses a limitation on the coherence of spin ensembles with strong interactions. As an example, arXiv:2005.08822v2 [quant-ph] 25 May 2021 we now consider erbium-doped crystals, which exhibit particularly strong spin-spin interactions [20] caused by the large effective g-factor of the erbium spins [24].
Erbium-doped crystals have recently attracted considerable interest because they enable quantum memories in the main band of optical telecommunication, which is paramount for global quantum networks. First experiments in erbium-doped yttrium-orthosilicate (Er:YSO) have demonstrated storage of optical [26,27] or microwave photons [28] with good multiplexing capacity [27] and second-long hyperfine coherence at high magnetic fields, where the electronic spins are frozen to the ground state [5]. In this work, we instead study the electronic spin coherence in the low-field regime.
In Er:YSO, the Kramer's ion [29] erbium substitutes for yttrium in two crystallographic sites [6], each of which has two magnetically inequivalent classes. The similarity of the ionic radii of Y and Er lead to a moderate inhomogeneous broadening of the optical (few hundred MHz) and spin (few MHz) transitions. At cryogenic temperature, only the lowest crystal field level of each class is occupied. Its two-fold degeneracy is lifted in a magnetic field, and because the g-tensor is anisotropic, the effective g-factor depends on the magnetic field orientation, as depicted in Fig. 1a, bottom panel [24].
We consider crystals with a comparably low erbium concentration of 10 ppm, resulting in n = 4 ppm for the even isotopes in one site. Still, the ground state lifetime is limited by flip-flop interactions [26] (top panel, black dashed theory curve from [20]). Following eq. (5), also the spin-echo coherence time is limited by interactions (black solid line). It is shortest for the magnetic field directions that give a long lifetime. While the latter scales quadratically with n [20], the former exhibits only linear scaling. Thus, even in the purest Er:YSO samples investigated so far, with n 0.4 ppm [7,11], the coherence of a spin echo in the ground state will be limited to the sub-millisecond range -too short for many applications.
In the following, we therefore investigate if the coherence time can be increased by DD, where a sequence of control pulses drives the spins along a path in which the interaction Hamiltonian with the environment cancels to first order [30]. Typical sequences employed previously eliminate frequency shifts from magnetic field inhomogeneity and off-resonant spin baths [13,[17][18][19]31]. The decoupling of resonant spin baths has also been achieved in spectroscopy of isotropic spin-1/2 systems [32], and anisotropic interactions have been eliminated by rotating the sample in the magnetic field. However, this technique called magic angle spinning [33] is impractical for quantum memories that require a dedicated optical mode. In addition, it cannot be applied to ensembles with strong interactions, as the rotation frequency would have to be fast compared to the interaction timescale, i.e. many MHz. In such a setting, one is thus restricted to global spin (rather than sample) rotations. Then, com-plete decoupling of anisotropic interactions is not possible, as global spin rotations leave the isotropic ("Heisenberg") component of the interaction, αˆ σ ·ˆ σ, unchanged [25,34,35]. For dipolar interactions in dilute spin baths this component reads: Here,r i are the components of the unit vector connecting the spins. For an isotropic g-tensor with spin 1/2, the dipolar interactions between spins can be decoupled to first order as g x = g y = g z ≡ g and thus α ∝ g 2 (1 − |r| 2 ) = 0. In contrast, in systems with a spin larger than 1/2, or with an anisotropic g-tensor, α will be non-zero. Thus, for general input states there is always a part of the Hamiltonian which cannot be averaged out completely via DD in a static magnetic field [34].
In the following we will show that under certain conditions, some coherence improvement is still possible. To this end, we first calculate the evolution of the spins caused by the microwave pulse sequence to obtain the average Hamiltonian [30]. For all sequences that consist only of Clifford rotations (e.g. π/2 and π) [25,35], the average Hamiltonian keeps the form of eq. 2, but the coefficients change toJ S andJ I , from which we calculate the new dephasing time constant (see supplemental material). We first investigate recently proposed robust pulse sequences [25] designed to cancel interactions with both resonant and off-resonant spin baths. Such sequences have been successfully applied to ensembles of NV-centers with isotropic interactions [36]. Here, we instead study the case of anisotropic interactions. As shown in Fig. 1a (solid orange line), we find that a significant, but moderate improvement of the dephasing time is feasible for most magnetic field orientations, but comes at the price of a reduced flip-flop time (dashed orange line). Remarkably, the coherence becomes independent of the magnetic field angle. The reason is that the average interaction Hamiltonian for a sequence that rotates the spins in all directions for equal amounts of time reads H dd,iso = αˆ σ·ˆ σ, which seems to suggest that an isotropic average Hamiltonian minimizes dipolar interactions in the ensemble.
However, further improvement of the dephasing time while reducing the lifetime is possible by minimizing the componentJ Iσzσz . To this end, we keep the above pulse sequence, but adjust the free-evolution time periods between pulses. As detailed in the supplemental material, the weights of (σ xσx +σ yσy ) andσ zσz can be redistributed continuously [25,35], with the diffusion parameter ranging betweenJ I = J I (no effect) andJ I = J S (maximum effect). The latter case is shown as dashed blue line in Fig. 1 (a). For magnetic field directions with large effective gyromagnetic ratio, the coherence is enhanced by two orders of magnitude, approaching the life- show an angular dependence that follows the effective g-factor (bottom panel). When the interactions are symmetrized using dynamical decoupling (yellow), the coherence time can be increased for magnetic field configurations with a large effective g-factor, at the price of a reduced lifetime (yellow dashed). In systems with a prolate g-tensor (gz gx, gy) further suppression of ID is possible using asymmetric decoupling sequences (blue), approaching the lifetime limit (blue dashed) at the studied concentration. In contrast, for oblate tensors (gz gx, gy) only a marginal further improvement of the coherence is possible. (c) Disorder-Robust-Interaction-Decoupling (DROID-60) sequence used for DD [25]. It consists of π-and π/2-pulses (long and short bars) along the X (blue upward), Y (red upward), -X (blue downward) and -Y (red downward) axes of the rotating frame, separated by equal spacings (black and orange lines). In the asymmetric variant, the orange delays are left out. time limit T 2 ≤ 2 · T 1 at the studied concentration. However, the lifetime is strongly reduced when compared to the case without DD. While panel (a) shows the prolate g-tensor of YSO, which only has one large component, in (b) we instead investigate an oblate tensor, that of CaWO 4 . Here, it turns out that asymmetric decoupling sequences do not allow for considerable improvement as compared to symmetric ones. After theoretically studying the improvement possible by DD, we now turn to an experimental test. We use 0.5 mm thin YSO crystals with a nominal erbium dopant concentration of 10 ppm, mounted in a closed-cycle cryostat at 0.8 K. As detailed in [37], we have established techniques to initialize, coherently control and readout the spin state of a dense ensemble of erbium dopants in a magnetic field on the order of 0.02 T. In particular, we achieve a π-pulse fidelity of 98 % on the ground-state spin transition, measured at the center of their inhomogeneous frequency distribution with a fwhm linewidth of ∼ 9 MHz. When integrating over the entire line, the average flip probability is reduced by approximately one third (see supplemental material). Thus, the far-detuned parts of the ensemble will not be decoupled by our microwave pulses. As detailed in ref. [23], this reduces the effective concentration of resonant spins, but does not limit the effectiveness of DD sequences for the resonant sub-ensemble.
We first demonstrate that the quality of our microwave pulses is sufficient for DD when a robust pulse sequence is used. To this end, we apply the static magnetic field along the b axis of YSO [24], where the magnetic classes are aligned. The microwave field is applied along D2. With a narrowband optical pulse we initialize a small fraction (around 1 %) of the spin ensemble in the optically excited state | ↓ e (see Fig. 2a). We then use a microwave pulse to prepare and probe the coherence on the transition | ↓ e ↔ | ↑ e . As the effective g-factor g eff,e = 10 of the optically excited I 13/2 state differs from that of the I 15/2 ground state [24], the concentration of resonant spins is low in this case, such that ID is negligible. The coherence of the ensemble is instead limited by off-resonant interactions with the erbium dopants that remained in the ground state, and to a weaker extent (see supplemental material) by its interaction with the bath of Y nuclear spins [31].
As shown in Fig. 2b, already a spin echo increases the coherence from an exponential decay with 0.07(1) µs (Ramsey measurement, brown) to a Gaussian decay within 1.7(1) µs (black). Further improvement is obtained by XY−4 DD (other colors). The used sequence is composed of π-pulses of 86 ns duration, applied alternately along the X and Y axes. After every four pulses, the sequence is robust against pulse imperfections [13]. As shown in (c), the improvement of the coherence with the number of π-pulses, n π , is well fit by T 2 ∝ n π (2/3) , as predicted and previously observed for fluctuating spin baths with Lorentzian spectral noise density [38]. The maximally observed coherence is 48(3) µs at n π = 64. At such large pulse numbers, we observe a slight broadening of the prepared optical hole that we attribute to pulse-induced heating. In spite of this observation, the obtained coherence is promising for recently proposed quantum memory protocols in the optically excited state [39], provided the excited state population is kept low enough to avoid ID.
After demonstrating that in the absence of resonant interactions DD allows for an improvement of the coherence by almost three orders of magnitude, we now turn to the ground state transition | ↓ g ↔ | ↑ g . Here, the concentration of resonant spins is ∼ 100-fold higher. We start with a magnetic field orientation at ∼ 130 • from the D1 axis, slightly out of the D1-D2 plane, such that the magnetic classes are detuned. Here, the effective g-factor and thus the lifetime is the largest [20], but ID is also the strongest. In a Ramsey measurement, we find an exponential decay of the coherence with T * 2 = 0.056(9) µs, caused by the inhomogeneous linewidth of the ensemble (see supplemental material). The spin echo time is T SE = 0.78 (8) µs. Compared to the spin echo in the optically excited state, we now observe an exponential rather than a Gaussian decay, and the coherence enhancement is much smaller. In addition, also DD with XY-4 and XY-8 sequences does not lead to a significant improvement: T XY-4 = 0.9(1) µs and T XY-8 = 1.1(2) µs (see supplemental material). This observation is explained by the onset of ID via resonant spin-spin interactions. The observed values are in good agreement with our theoretical prediction, eq. 5, which gives T SE = 0.91 (7) µs. In this calculation, as explained above, we have used a reduced effective concentration n eff = 0.68(5) · n, to account for the effects of the measured inhomogeneous broadening and finite Rabi frequency (see supplemental material).
From this modeling, we expect that the spin echo time does not change significantly in the experimentally accessible regime of effective g-factors, where the lifetime of the spin is long enough for spin pumping [20,37]. To demonstrate this, we next change the magnetic field direction by 40 • , such that g eff,g = 10.5, similar to our previous measurements in the excited state. The field is now close to the D2 axis of YSO, but slightly tilted towards the b axis to detune the magnetic classes by 0.1 GHz. The spin inhomogeneous linewidth is unchanged, such that a Ramsey measurement gives 0.04(1) µs. Similarly, we again find an exponential decay of the spin echo with T SE = 0.89(6) µs, see Fig. 3 (black data and fit). This is in agreement with both our modeling and the above measurement, which proves that the dephasing is independent of the magnetic field direction over a large range.
To investigate the scaling of the decoherence with concentration, we now precisely align the magnetic field along D2, such that both magnetic classes [24] are degenerate and the density of resonant spins is increased by a factor of two. As expected, we observe a twofold decrease of the spin-echo time, finding 0.51(3) µs (grey data and fit).
The good agreement of all measurements with the theoretical prediction, the observed exponential decay and its scaling with concentration, and the ineffectiveness of XY4-DD as compared to our measurements in the optically excited state unambiguously prove that the coherence in the ground state is limited by spin-spin interactions rather than the coupling to nuclear spins or other off-resonant impurities. As explained above, these interactions cannot be eliminated by sequences that use only π-pulses. In contrast, some improvement can be expected by Disorder-Robust Interaction Decoupling, or "DROID-60" [25,36]. This sequence can decouple on-site disorder and isotropic interactions while being robust with respect to pulse imperfections, which is indispensable for DD experiments. On the ground-state transition (inset), more resonant spins contribute to ID, which limits the coherence. While the Ramsey measurement (brown dots and fit) gives a similar result as that in the excited state, the spin-echo decay is exponential rather than Gaussian (black diamonds and fit). Its decay constant reduces twofold when the concentration is doubled by aligning the magnetic sub-classes (grey). Application of "DROID-60" [25] (yellow rectangles and fit) significantly improves the coherence time up to the theoretical limit for symmetric sequences (red dashed line).
In our setup, we keep the magnetic field close to the D2 axis, which is the only configuration that allows for both spin initialization and fast-enough microwave Rabi frequency in our current setup [37]. As shown in Fig. 1c, we apply 48 π and composite π/2 pulses with a duration of 33 ns and 19 ns, respectively. When initializing and measuring the spins along the X-axis of the rotating frame and increasing the pulse separation, the coherence decays within 2.5(4) µs (yellow data and fit). The observed enhancement matches the theoretical limitation for a symmetric pulse sequence, which according to our above analysis is around 2.66 µs (red dashed theory curve).
In principle, with the prolate g-tensor of YSO, further improvement would be possible with an asymmetric variant of the DROID-60 sequence. However, as detailed in the supplemental material, at the achievable Rabi frequency in our experiment the duration of the pulses is not short enough, such that one expects only a marginal improvement as compared to the symmetric sequence studied above.
To summarize, we have investigated Er:YSO as a novel platform for the study of strongly interacting spin ensembles, with applications ranging from sensing [36] to the exploration of new phases of matter [40]. We find that the coherence of our system is limited by interactions, but can be enhanced by a suited DD sequence that is robust with respect to pulse imperfections. Further improvement requires an increase of the Rabi frequency, e.g. via an optimized resonator geometry. This would also allow us to study the effect of DD sequences in other magnetic field configurations with a reduced effective g-factor.
We expect that our findings will be important for the improvement and integration of quantum memories and sensors. In particular, the insight that DD sequences cannot fully eliminate anisotropic spin-spin interactions, a common situation for all rare-earth dopants, quantum dots [41], and several color centers [42], has several implications: First, it seems to enforce the use of nuclear rather than electronic spins for long-lived quantum memories [5]. Second, it might stimulate research into novel materials that provide higher oscillator strength, lower inhomogeneous broadening of the optical transition, or an isotropic g-tensor. Third, it may guide the optimization of magnetic fields for a given combination of dopant and host. Finally, enhancing the optical depth with resonators [7,8,11,[43][44][45] seems promising to increase the coherence of rare-earth-based quantum memories by reducing the dopant concentration without sacrificing efficiency.

Magnetic interactions in systems with anisotropic g-tensors
In this section, we will explain our mathematical modelling of the decoupling of spin-spin interactions in detail. To this end, we start with the Zeeman Hamiltonian of an effective spin-1/2 system with g-tensor g and a spin vector S: This Hamiltonian describes the precession of the spin vector in an effective magnetic field B eff = B b eff , implicitly defined by B · g = B eff g eff and g eff = | B · g|/B. An explicit expression for b eff and g eff can be derived in the g-tensor eigenbasis, where g is diagonal with eigenvalues g x , g y , g z . Let b x , b y , b z be the components of the magnetic field unit vector along the g-tensor eigenaxes. Then we can write which gives the effective g-factor: If the g-tensor is anisotropic, g x = g y = g z , the precession axis is not aligned with the external magnetic field, b eff ∦ B, and the effective g-value depends on the field direction.
To calculate the eigenstates of the Zeeman Hamiltonian, we express the effective magnetic field unit vector b eff and the spin vector S by its components along the eigenaxes of the g-tensor. We choose spherical coordinates Θ and Φ to represent the direction of the effective magnetic field, and express the spin operators by Pauli matrices acting on the two-dimensional spin Hilbert space {| + 1 2 , | − 1 2 }: Diagonalizing equation 10b yields the two Zeeman eigenstates with energies E Z = ± 1 2 µ B g eff B:

Magnetic interaction in the Zeeman eigenbasis
Above, we consider the g-tensor anisotropy as a tilt of the effective magnetic field axis around which the spins precede. However, this is not helpful when interacting spins are considered, because not the spins but their magnetic moments are the origin of both the Zeeman energy splitting and dipolar interactions. In systems with an anisotropic g-tensor, the spins are aligned with the tilted effective magnetic field axis, but their magnetic moments are not: they still precede around the untilted magnetic field axis as expected for any classical dipole. [46,47] A similar argument questions the meaning of spin operators in the context of qubit eigenstates | ↑ and | ↓ : since the Zeeman Hamiltonian and theŜ z operator do not commute, the spin z-component will continuously change, even though the system is in an eigenstate. To discuss processes like spin-flips and qubit rotations, it is therefore not beneficial to use the spin operatorsŜ x ,Ŝ y , S z as it was done above.
Instead, by a more elegant choice of basis operators we can write all interactions as rotations of the effective qubit, not the spin. Such a set of qubit operators is still provided by the Pauli matricesσ x ,σ y ,σ z , similar to the spin operators, only that they are now defined in the qubit basis [48,49]: Since these operators, together with the identity matrix, form a basis of operators in the two-dimensional Hilbert space, it is possible to write any magnetic moment as a linear combination of them: A representation of the directional vectors u x , u y , u z in the g-tensor eigenbasis can be found by calculating g·Ŝ first in theŜ z -basis and then making a basis transformation to the Zeeman eigenbasis via eq. 11a. One arrives at Note that because of the g-tensor anisotropy the directional vectors are not orthogonal to each other. But since they were constructed via the Zeeman eigenstates, they still fulfill B · u x,y = 0 and B · u z = g eff B, and therefore simplify the Zeeman Hamiltonian to

Dipolar interactions between resonant dopants in the Zeeman basis
The interaction between two magnetic dipoles m 1 and m 2 is given by where µ 0 is the magnetic constant,r the unit vector connecting the dipoles, and r their distance. For erbium dopants at the same site and class, we can express both magnetic moments by eq. 13 and rewrite the expression using ladder operatorsσ ± = (σ x ± iσ y )/2. Because in a typical experimental situation, the inhomogeneous linewidth of the spins ( 10 MHz) is much smaller than the Zeeman level splitting (∼ 3 GHz), we can make a secular approximation and ignore terms that cause transitions between Zeeman eigenlevels of different energy, likeσ +σz ,σ +σ+ , etc. [50]. We arrive at This is a Hamiltonian of the type where we can identify J S as flip-flop coefficient and J I as spectral diffusion coefficient that induces state-dependent frequency shifts, because and Dephasing caused by dipolar interactions Following previous work [22,49,51], we can derive the inhomogeneous linewidth ∆ν, which sets the coherence time limit T 2 ≤ (π ∆ν) −1 . To this end, we average J S over a random distribution of all resonant spin-pairs. This gives: To also determine the influence of off-resonant erbium electronic and yttrium nuclear spins, we conduct Monte Carlo simulations. Our model uses a thermal distribution of spins at the lattice positions of Y in YSO [52]. From this, we calculate the effective magnetic field induced by the spin bath and thus derive the resulting frequency shift for each dopant depending on the direction of the external magnetic field. Averaging over 2000 different bath configurations gives the blue and orange curves in Fig.  4. It turns out that in all studied configurations, the interaction with the bath of off-resonant erbium spins gives the strongest contribution to the dephasing. This broadening can be efficiently cancelled by a simple spinecho, as it is quasistatic (c.f. the flip-flop times in the main manuscript, or [20]) on the timescale of the experiments. In contrast, the nuclear spin bath will show a temporal evolution on the timescale of the nuclear Larmor precession. The bulk spins precede with 2.1 MHz/T, i.e. < 0.05 MHz at the studied fields. However, in the vicinity of the Erbium dopants, the superhyperfine interaction leads to a different precession axis and speed [53], with a few hundred kHz for the strongest coupled nuclei. This timescale sets a maximum pulse spacing of 0.3 µs required for effective DD [31].
In addition to dephasing, the coupling to the nuclear spins will also lead to a slight change of the eigenstates of the electronic spin [53]. However, as the admixture is small, we do not expect and did not observe that this has an effect on the electronic spin coherence.

Redistributing interaction terms by modified pulse spacings
Engineering the average Hamiltonian in order to enhance or suppress certain interaction terms can be achieved by modifying the pulse spacings of a sequence like WAHUHA or DROID-60 [25,54]; the resulting pulse train will inherit most robustness properties from the original decoupling sequence. For our purpose, we want to substitute the large J Iσzσz terms with smaller J Sσzσz ones that appear for rotated spins. To this end, we need to shorten the time intervals during which thê σ z component is aligned with the z-axis of the toggling frame.
Choi et al. [25] already suggest a modified WAHUHA+echo sequence in which theσ z component spends only a fractional time c τ aligned with the z-axis, compared with a time interval (1 − c)τ /2 spent along x and y, each. Similar modification can be made to the DROID-60 sequence; the resulting average Hamiltonian has the same form as eq. 18 but with new coefficients J S and J I in place of J S and J I [25]: with Here, the parameter c determines how the dipolar interaction is distributed on the spectral diffusion and the flip-flop term. For c = 1 we retrieve the original Hamiltonian without decoupling, and for c = 1/3 we reproduce the conventional DROID-60 sequence and the results for an isotropic Hamiltonian. Any other value of c will distort the original pulse spacings and requires a more asymmetric pulse pattern.
Remarkably, it has been shown that any DD sequence can be cast in the above form [34,35] as long as it consists of only Clifford operations (such as π/2 rotations around the x-or y-axis). Non-Clifford rotations could introduce other terms [35], for example interchanging (σ xσx −σ zσz ) with (σ xσz +σ zσx ). However, even such advanced sequences leave the isotropic part of the Hamiltonian unaffected, and we do not expect that they enable further improvement of the coherence. Top: Interaction-limited lifetime and coherence of Er:YSO ground state spins. By numerically averaging over random distributions of interacting spin pairs, we calculate the flip-flop time (dashed) and coherence time (solid) for a magnetic field in the D1-D2-plane and for various interaction asymmetry parameters c (c.f. eq. 22). Without decoupling (c = 1, black), dipolar interactions limit the coherence time to less than 1 µs. The improvement by symmetric decoupling sequences that yield an isotropic average Hamiltonian is only moderate (c = 0.33, yellow), while asymmetric sequences could potentially extend the coherence time by two orders of magnitude (c = 0, blue). However, because of a finite pulse length, the achievable asymmetry parameter was limited to c = 0.2 (green), which performs only slightly better than symmetric sequences. Bottom: effective g-factors.
The static magnetic field (here) determines the Zeeman level splitting, corresponding to an effective ground-state g-factor (solid red line), while the effect of a perpendicular microwave field (here for Bmw b) is described by a microwave g-factor (dotted).

Optimum decoupling sequence for Er:YSO
In YSO, for most magnetic field orientations the dipolar broadening can be reduced by substituting the large diffusion coefficient J I completely by the smaller flip-flop coefficient J S . This can be realized for a value of c = 0, resulting in an asymmetric sequence, in which several pulse spacings are contracted to zero. Such a maximally asymmetric interaction decoupling sequence produces the average Hamiltonian For this average Hamiltonian, we calculate the expected linewidth broadening and the corresponding maximum coherence time, and also the respective flip-flop rate. Fig. 1 of the main text shows this in the eigenbasis of the g-tensor. In contrast, Fig. 5 displays the situation in the D1-D2 plane, i.e. the polarization eigenbasis of the birefringent crystal, which is easier to determine experimentally. Note that when the large coefficient J I is shifted to the flip-flop terms (σ xσx +σ yσy ), the spin lifetime is decreased (blue dashed). At the studied concentration, for an orientation of the external magnetic field between ϕ = 90 • and 160 • the coherence time can even exceed the flip-flop limited spin lifetime.

Effects of finite Rabi frequency
The above considerations assumed instantaneous spin rotations, i.e. an infinite Rabi frequency. In a real experiment, however, very small asymmetry parameters are difficult to achieve. In our microwave resonator, we find c 0.2. This lower bound is calculated by taking into account the finite pulse widths of 33 ns, which is not negligible compared to a typical pulse spacing of about 100 ns.
As a result, the maximum coherence time extension by two orders of magnitude, expected for c = 0 (blue in Fig. 5), can not be achieved. With c = 0.2 (green), the expected coherence time improvement is moderate, around 1.5 times that expected for an isotropic Hamiltonian (yellow). The reason for this extreme sensitivity is again the high anisotropy of the g-tensor for erbium in YSO. While the interaction coefficients J S and J I are orders of magnitude apart, their mixing in the average Hamiltonian occurs only linearly, and the large J I term dominates for a wide range of parameters.
In addition to this effect, also higher-order corrections may pose a limitation to the potential coherence time improvement, which can be estimated by calculating the commutators between the Hamiltonians for the individual free-evolution periods. While the quantitative analysis is difficult because the coefficients of theσ iσi terms are now products of J S and J I and the correct order of averaging over time and over pairs of interacting spins is not trivial, one finds that the higher-order correction favors an isotropic average Hamiltonian.
For the mentioned reasons, the use of asymmetric se-quences to further enhance the coherence is not promising in our setup. It would require to drastically increase the Rabi frequency, which, however, may be possible in nanostructured samples [11].

Calculation of the pi-pulse flip probability
After initializing the spin state | ↑ g by laser irradiation on the optical spin-flip transition | ↓ g → | ↑ e and subsequent spontaneous emission, we can measure the ground state spin polarization by probing the absorption on the | ↑ spin-preserving transition. By comparing the amplitude of this spectral antihole before and after applying a microwave π-pulse, we can determine the fidelity of spin rotations. The measured spin-flip fidelity at the center of the transition reaches 0.98, in good agreement with the field inhomogeneity of the used MW resonator [7]. However, the average value for spins in the ensemble is lower because the finite Rabi frequency Ω leads to a decay of the flip efficiency with detuning ∆ν from the microwave frequency [23]: In this formula, we take into account a Lorentzian spectral distribution of dopants with inhomogeneous fwhm linewidth ∆ν and the excitation probability during a pulse of length t p . The achievable Rabi frequency depends on the orientation of the external magnetic field and is thus different for all studied configurations: When the field is aligned along the D2 axis of YSO, we obtained an ensemble linewidth of the spin transition of ∆ν ≈ 10(1) MHz in holeburning experiments and measured a Rabi frequency Ω = 2π · 14.9(1) MHz on resonance. With these values, we calculate an average πpulse fidelity of η ≈ 0.78(6) for a π-pulse length of 33 ns.
When we orient the static magnetic field at an angle ∼ 130 • with the D1-axis, the π-pulse fidelity drops to about 0.68 (5). Finally, for the presented experiments in the optically excited state, the static magnetic field was oriented along b and the microwave magnetic field along D2. In this case we measure a Rabi frequency of 2π · 6.2(2) MHz and calculate a π-pulse fidelity estimate of 0.65 (5).

XY-Decoupling on the ground state transition
In experiments on the optically excited state transition, we achieved a coherence time extension by almost three orders of magnitude when increasing the number of pulses in an XY-4 decoupling sequence. The observed value and Gaussian decay are in excellent agreement with the expectation from the coupling to a fluctuating bath of Yttrium nuclear spins [31].
In contrast, on the ground state spin transition, we observed exponential decays of the spin echo at all studied concentrations and magnetic field orientations, as described in the main paper. In figure 6 we show additional measurements, in which we investigate the coherence in DD experiments using XY-4 (grey) or XY-8 (red) sequences. As expected, we observe only a slight increase in the coherence time as compared to the spin echo (black), which we attribute to the finite bandwidth of the pulses that reduces the effective concentration, as detailed in Sec. . The shown measurements were performed at a magnetic field orientation of ϕ = 130 • from the D1-axis, where the microwave g-factor limits the maximum Rabi frequency to 2π · 6.4(5) MHz, which results in an effective flip probability of only 0.65(5) %. For the magnetic field oriented at ϕ = 130 • from the D1-axis, we measure a spin-echo time of 0.78 (8) µs (black data with exponential fit). As expected from our theoretical modeling, with XY-4 (grey) and XY-8 (red) decoupling sequences we achieve only a moderate coherence time extension to 0.9(1) µs and 1.1(2) µs, respectively, which proves that the coherence is limited by dipolar interactions with a resonant spin bath.