Precise high-fidelity electron-nuclear spin entangling gates in NV centers via hybrid dynamical decoupling sequences

Color centers in solids, such as the NV center in diamond, offer well-protected and well-controlled localized electron spins that can be employed in various quantum technologies. Moreover, the long coherence time of the surrounding spinful nuclei can enable a robust quantum register controlled through the color center. We design pulse sequence protocols that drive the electron spin to generate robust entangling gates with these nuclear memory qubits. We find that compared to using CPMG alone, Uhrig's decoupling sequence and hybrid protocols composed of CPMG and Uhrig sequences improve these entangling gates in terms of fidelity, spin control range, and spin selectivity. We provide analytical expressions for the sequence protocols and also show numerically the efficacy of our method on nitrogen-vacancy centers in diamond. Our results are broadly applicable to color centers weakly coupled to a small number nuclear spin qubits.

Even though the long coherence time of the nuclear spins makes them promising candidates for a quantum memory [21], entanglement purification [46,47], and quantum nodes [48] in quantum computing and communication, one of the main challenges is that the interactions between the electronic spin and the nuclear spin memory qubits are always-on. As a result, controlling the system is not straightforward and moreover the electron spin coherence is hampered by the spinful isotopic nuclei in the host crystal. In this regard, the Delft group has introduced and successfully demonstrated a clever way to address both these issues: they have shown that appropriately chosen Carr-Purcell-Meiboom-Gill-like (CPMGlike) dynamical decoupling pulses [49,50] applied on the electron spin not only protect it from the nuclear spin bath but also allow it to selectively control target nuclear spins via the hyperfine interaction [26,30,51]. This novel use of CPMG-like sequences to implement twoqubit gates along with the vast repertoire of alternative dynamical decoupling sequences [52][53][54][55], opens the question of whether there are even better nuclear spin control protocols through always-on interactions with and drive * dongwz@vt.edu † f.calderon@vt.edu ‡ economou@vt.edu of the electron spin.
In this paper, we introduce new, advantageous ways of selective, fast, and high fidelity electron-nuclear spin entangling gates through pulse sequences acting on the electronic spin. We specifically focus on Uhrig's dynamical decoupling (UDD) sequences [54] and on hybrid protocols based on a combination of CPMG-like [49,50] and UDD sequences. Our approach yields precise nuclear spin manipulation and good electron spin coherence protection. We find that, for a wide range of magnetic fields, the hybrid sequences provide fast electron-nuclear twoqubit gates with higher fidelity than what would be obtained by only using CPMG or UDD alone. Moreover, in contrast to other sequences, UDD provides high spin selectivity without significantly increasing the overall gate time. This facilitates the precise control of nuclear spins with similar hyperfine interaction strengths. Interestingly, and contrary to what one may conclude based on prior literature, we find that UDD provides better electron spin coherence protection compared to CPMG in the parameter regime that accomplishes high spin selectivity. We test our sequences numerically on an NV center in diamond, using system parameters from experiment [51]. Our protocol is general, and can thus be applied to similar platforms (e.g. divacancy centers in SiC) after straightforward modifications.
The remainder of this paper is organized as follows. In Sec. II, we present the system's Hamiltonian. In Sec. III, we review the use of CPMG-like sequences to control weakly coupled nuclear spins in NV centers. In Sec. IV, we introduce Uhrig's dynamical decoupling sequence and investigate its performance in terms of fidelity, selectivity, and electron spin coherence protection. In Sec. V, we present our new hybrid sequences for electron-nuclear spin entangling gates in NV centers, showing their versatility and overall performance. We conclude in Sec. VI.

II. MODELING THE SYSTEM HAMILTONIAN
The geometric structure of the NV center, a nitrogen substitute and a neighboring carbon vacancy, is illustrated in Fig.1. The system under consideration is formed by the central electron spin and several weakly coupled spinful nuclear spins (carbon isotope 13 C, with natural abundance of 1.1%) that we aim to control. In the presence of an external magnetic field (B field) applied along the z-axis, the total Hamiltonian of the system is: where H E is the Hamiltonian for the S = 1 electron spin, H int is the hyperfine interaction between the central electron spin and all the nuclear spins in the system, each with spin I = 1/2, and H bath is the nuclear spin bath Hamiltonian. Note that we assume that the nuclear spins do not mutually interact, and thus H bath is reduced to the sum of the nuclear spins' Zeeman energies (see Appendix B for more details on the total Hamiltonian). The strength of the magnetic field is chosen such that the electron spin is far from the ground state level anti-crossings and the electron-nuclear flip-flop processes are suppressed due to a large energy mismatch. Consequently, the transverse components of the electron spin are eliminated and only the S z term remains [51,56]. It is convenient to start the analysis with the simplest case where the electron spin is only interacting with a single nuclear spin. Accordingly, their Hamiltonian in the interaction picture given by H E is simply: where ω L is the nuclear spin's Larmor frequency, I i is the cartesian component (i = x, y, z) of the nuclear spin operator, and m s is the electron's magnetic spin quantum number, which can be equal to -1, 0, or 1. Regarding the latter, due to a non-negligible energy gap between the spin transitions in the presence of a bias magnetic field, we can choose two out of the three spin levels and treat them as an effective two-level system. We follow the notation of Ref. [51] and define |m s = −1 = |1 and |m s = 0 = |0 to encode the qubit and introduce the z-component of the pseudo-spin operator S z = 0 |0 0| − |1 1|, where, for the sake of simplicity, we set = 1. Note that due to the diagonal form of the electron spin operator, the elements of the hyperfine interaction tensor, A j,i , are nonzero only for j = z and i = x, y, z (see Appendix B). Moreover, the hyperfine interaction elements can be reduced to parallel and perpendicular components with respect to the z-axis, i.e. A and A ⊥ , respectively, by rotating the x − y plane. Therefore, Eq. (2) can be expressed as: where h 0 = ω L I z and h 1 = (ω L −A )I z −A ⊥ I x . Similarly, for multiple nuclear spins the total Hamiltonian can be written as: where n is the number of nuclear spins and h ) is a multi-nuclear operator consisting of the tensor product of h 0 (h 1 ), which acts on the i-th nuclear spin, and the identity operator acting on the remaining nuclear spins.

III. REVIEW OF CPMG-LIKE QUANTUM GATES
To manipulate nuclear spins surrounding the central electron spin, Taminiau et al. used CMPG-like dynamical decoupling sequences, namely the XY8 sequence [49][50][51]. This sequence is applied on the central electron spin to decouple it from the surrounding nuclear/electron spin bath, thus extending its coherence time. At the same time, Ref. [51] has shown that it is possible to induce conditional rotations on a target nuclear spin by tuning the sequence's inter-pulse delay time to satisfy a resonance condition determined by the hyperfine interaction between the electron spin and the target nuclear spin. This control scheme, hereinafter referred to as simply CPMG sequence, consists of a train of pulses with the basic decoupling unit being (τ − π − 2τ − π − τ ) N , where π-pulses (π rotations about the x-axis and y-axis in an alternating fashion) are applied to the electron spin, separated by a 2τ delay time, and N is the total number of basic decoupling units in the sequence. In the following analysis we use the total time t ≡ 4τ of the basic decoupling unit instead of the inter-pulse distance 2τ to derive the resonance condition, as it is more convenient for comparing it to other types of dynamical decoupling sequences. Now, if we apply a single basic CPMG unit (N = 1) to the system formed by the central electron spin and n nuclear spins, Eq. (4), the evolution operator would be: where the electron-spin-state-dependent evolution operators acting on the k−th nuclear spin are V The full CPMG sequence contains N copies of the basic unit, and thus the total evolution operator is U N . Taminiau et al. [51] demonstrated that in a strong magnetic field and for a weakly coupled nuclear spin (ω L A ⊥ , A ), whenever the total basic unit time t (or similarly the inter-pulse distance 2τ ) satisfies a resonance condition the electron and target nuclear spins get coupled and the latter is rotated conditionally on the electron spin state. Alternatively, when the basic unit time t is not on resonance with any target nuclear spin, the nuclear spins are decoupled from the electron spin and they just unconditionally rotate about an axis and rotation angle determined by how far from resonance t is for each nuclear spin.
To characterize the two-qubit gates emerging from the CPMG sequences acting on the electron spin, let's consider the simple case of a single nuclear spin interacting with the central electron spin. Following Ref. [51], we can express the conditional evolution operators V 0 and V 1 , Eq. (4), as V 0 = exp −iφ( I · n 0 ) and V 1 = exp −iφ( I · n 1 ) , respectively. Here φ is the rotation angle, n |ms| is the rotation axis that depends on the electron's initial state m s = 0 or m s = −1 , and I is the nuclear spin operator. As shown in Fig. 2, the inner product of the rotation axes n 0 · n 1 indicates whether the nuclear spin rotation induced by the CPMG sequence is conditional ( n 0 · n 1 = −1) or unconditional ( n 0 · n 1 = 1). The conditional rotations are controlled-R ±X (φ) (CR X (φ)), i.e. x-rotations by an angle φ with a direction that depends on the electron spin state, and the unconditional ones are simply nuclear spin rotations about the x-axis, z-axis, or an axis in between the previous two, that does not depend on the electron spin state.
In order to generate a CR X (φ) gate, the CPMG unit time t must satisfy a resonance condition determined by Sequence unit time t ( *+) FIG. 2. CPMG control of a single nuclear spin. (a) The axes of nuclear spin rotation conditional on the electronic spin, their dot product, and the angle of rotation as functions of the sequence time t. The red curve represents the rotation axes' dot product n0 · n1 of the electron spin state-dependent evolution operators V0 and V1, where the periodic dips ( n0 · n1 = −1) indicate the conditional rotations with opposite rotational axes and the flat portions of the curve ( n0 · n1 = 1) indicate unconditional rotations. The green curve shows the rotation angle. At the resonant points the rotation angles plotted here are close to 2π, which indicates effective small rotation angles. The blue (orange) curve represents the xdirection projection (⊥) of the rotation axis n0 (n1). The peaks/dips in the blue/orange curve indicate x rotations, of which the ones that are synchronous with the red curve dips correspond to conditional x rotations (CRX ) and the rest denote unconditional x rotations (RX ). At any other values of t, the nuclear spin rotates along the z-axis unconditionally. In these simulations we used A /2π = 30.6kHz, A ⊥ /2π = 25.7kHz and ωL/2π = 314kHz. (b) Qualitative illustration of conditional x and unconditional z rotations.
the nuclear spin's Larmor frequency and the hyperfine interaction between the target nuclear spin and the electron spin. Accordingly, at resonance, the CPMG unit time t CPMG and the nuclear spin rotation angle φ CPMG are [51]: where k is a non-negative integer. On the other hand, when t is in the middle of two neighboring resonance values, 1 2 (t CPMG k +t CPMG k+1 ), the uncoupled nuclear spin rotates unconditionally about the x-axis through an anglẽ φ CPMG , R X (φ). The CPMG unit time and rotation angle for the unconditional R X (φ) gate are: Note that the rotation angleφ CPMG does depend on k, in contrast to the resonance rotation angle φ CPMG in Eq. (6). These analytical expressions for the rotation angles as well as the analytical expressions for both t CPMG k andt CPMG k are approximations [51] and their accuracy is inversely proportional to k. Moreover, the integer term k in Eqs. (6,7) is chosen to be as small as possible to avoid unnecessarily long sequences that may negatively affect the coherence protection of the electron spin. Note also that the relatively sharper peaks and dips corresponding to the x projection of the unconditional rotation axis plot in Fig. 2 imply that the experimental timing precision required to implement an unconditional rotation is higher than the one required to implement a conditional rotation. That also suggests that the analytical approximation fort k CPMG must be numerically optimized to increase its accuracy, and thus improve the resulting singlequbit gate fidelity. Finally, the rest of the off-resonance values for t gives unconditional rotations gates about axes on the x-z plane that are close to the z-axis (R Z (θ)) with varying rotation angles. It is evident that the CPMG sequences allow selective and precise control of nuclear spins as long as the perpendicular component of the hyperfine interaction between the electron and target nuclear spin is nonzero. By setting the CPMG unit time t to be equal to the target nuclear spin's resonance condition, Eq. (6), and recursively applying the CPMG unit N times, one can implement a two-qubit gate CR X (φ) that conditionally rotates the target nuclear spin about the x-axis by a desired angle N φ. Note that the two-qubit gate CR X ( π 2 ) is equivalent to a cnot gate up to local operations (see Appendix A for further discussion). Similarly, by choosing an offresonance time t one can apply single-qubit gates to the nuclear spins qubits, where the type of gate (e.g. R x (φ) or R z (θ)) is determined by the CPMG unit time t, and the angle of rotation depends on the total number N of applied CPMG units. It is wort noting that, in general, it is preferable that the angle φ CPMG k (orφ k CPMG ) be either somewhat small or close to 2π. The reason is that it allows, by appropriately choosing N , to have a total rotation angle N φ CPMG k (or Nφ CPMG k ) that is close to any target rotation angle, which increases the overall gate fidelity F. However, a rotation angle φ CPMG k (orφ CPMG k ) that is extremely small or extremely close to 2π would not be as desirable since it would result in a larger gate time T = N t, and thus it would reduce the fidelity of the gate.
Despite the many advantages of CPMG-based spin control, there are also drawbacks. One is that the angle of rotation φ CPMG in Eq. (6) does not depend on k, and thus higher resonance orders cannot be used or combined in a clever way to get as close as desired to the target rotation and improve the resulting gate fidelity. Another disadvantage is that the use of large magnetic field strengths to improve two-qubit gate fidelities would also negatively affect the selective control of different target nuclear spins with similar hyperfine interaction parameters. In other words, two or more nuclear spins with comparable hyperfine interaction parameters under a high magnetic field would also have similar resonance conditions, in which case setting the value of the CPMG unit time t to couple the electron spin to the target nuclear spin would also undesirably couple it to the other nuclear spins, hence hindering the spin selectivity. It is in view of these limitations that we explore other types of dynamical decoupling sequences in the following section.

IV. CONTROLLING NUCLEAR SPINS WITH UDD SEQUENCES
Uhrig dynamical decoupling (UDD) sequences [54] are a series of π pulses (π rotations around the x-and/or yaxes) which, in contrast to CPMG, are not equidistantly spaced. Instead, their fractional locations are given by for an n number of pulses (UDDn) and unit sequence time t (total time of a single UDDn sequence). Note that for n = 2 (UDD2) the sequence is exactly equal to the building block of CPMG. Moreover, with each additional pulse, the UDD sequence successively cancels higher orders of a time expansion for any decoherence model [57,58]. However, for decoherence due to baths with soft high-frequency cutoff, which is the type of bath found in NV centers [49], the simpler sequences (small n) are preferable to higher order ones [59]. Similarly to CPMG, the single unit of a general UDDn can be iterated N times to form a long train of pulses, i.e. (UDDn) N . We numerically calculate the dynamics under UDD applied on the electron spin and find that the nuclear spin evolution satisfies the periodic resonance conditions in a way similar to CPMG. However, its rotation angle and resonance protocol time behave differently from CPMG. Following an approach similar to the one used in Ref. [51], we find analytical expressions for the conditional and unconditional rotation angles and their respective unit times for UDD3 and UDD4 (see Appendix C). For UDD3 the resonance unit time and rotation angle are given by Similarly to the CPMG case, when t is in the middle of two neighboring resonance values, 1 2 (t UDD3 k + t UDD3 k+1 ), the uncoupled nuclear spin rotates unconditionally about the x-axis by an angleφ UDD3 . The analytical expressions of these variables arẽ (10) Note that for UDD3 and, in general, for any UDDn with odd n, the electron spin does not return back to the initial state after a single unit sequence as required, and thus the number of iterations N of the single unit sequence must be an even number or otherwise the effect on the nuclear spins is naught. Consequently, the analytical expressions for the rotation angles in Eqs. (9) and (10) correspond to a pair of single UDD3 sequences, i.e. (UDD3) 2 , each with unit sequence time t UDD3 k (ort UDD3 k ). In contrast to CPMG and UDD3, UDD4 presents two different analytical expressions for the resonance time, each giving different rotation angles. The first set of analytical expressions for the resonance time and rotation angle is where the resonance time coincides with the CPMG one and the magnitude of the rotation angle at any order k is much smaller than those generated by the CPMG sequence, Eq. (6). On the other hand, the second set of analytical expressions, which does not coincide with the CPMG resonance time, iŝ where the angle of rotationsφ UDD4 k are larger than φ UDD4 k . In fact, with the resonance timet UDD4 k UDD4 performs almost on a par with CPMG in both gate fidelity and total sequence time. Another difference between UDD4 and CPMG (and UDD3 too) is that unconditional rotations about the x-axis do not occur every time t is in the middle between any two sequential resonance times t UDD4 k (ort UDD4 k ), they only happen at certain times given bỹ In general, for both CPMG and any UDDn, the sequence unit timest k that generate unconditional rotations about the x-axis are more sensitive to timing imprecision. As discussed before, the timing sensitivity is connected to the sharpness of the dips and peaks of the rotation axes' x projection as shown in Fig. 2 (see also Appendix C). As a result, the analytical expressions for the sequence unit time that generates unconditional rotations, and the corresponding rotation angles, are less precise approximations in comparison to the analytical expressions for the conditional rotations, and thus they should be used as initial inputs of a numerical optimization algorithm that would give more exacts values.  We do not provide analytical expressions for the resonance times (or corresponding rotation angles) for UDDn with n ≥ 5 due to the increased complexity in the expressions. Instead, the numerical comparison between UDDn and CPMG is shown in Fig. 3, where the rotation angles and resonance times of the target nuclear spin are shown for both cases. Again, since the general UDD is not equidistantly spaced, we use the basic sequence time t as the unit time instead of the variable inter-pulse time τ . The first resonance time t 1 (first dip of the solid curves within the gray region in Fig. 3(a)) for CPMG, UDD4, and UDD6 is the same. On the other hand, as shown in Fig. 3(b), the rotation angle φ and spin selectivity (full width at half minimum of the curve for the dot product of the rotation axes, n 0 · n 1 ) vary for different UDDn sequences. Among the pulse sequences in Fig. 3, the CPMG sequence yields the fastest rotation gate due to its relatively large rotation angle φ. Alternatively, for UDDn sequences, the larger the order n, the smaller the rotation angle it creates [60], which can be used to get a total gate with higher fidelity. In order to have overall short gate times, hereafter we will use the first resonance time t 1 to implement the coupling gate for nuclear spins under both CPMG and UDD sequences, unless stated otherwise. Moreover, since for UDDn the rotation angle gets smaller with larger n, we will only consider UDDn sequences with n ≤ 6 in order to avoid unnecessarily long sequences and also to keep the sequence's efficacy in protecting the electron spin from noise with soft highfrequency cutoff [59].
A. Nuclear spin selectivity enhancement using UDD A good nuclear spin selectivity, in the context of the techniques discussed in this work, implies the successful coupling of the electron spin with a target nuclear spin and the simultaneous decoupling from the rest of the nuclear spin bath. However, when two or more nuclear spins surrounding the central electron spin have similar hyperfine parameter values, it becomes challenging to couple the electron spin to one of those nuclear spins without coupling to the other. In the case of CPMG, the spin selectivity can be improved by using a higher resonance order k [51], Eq. (6), i.e. larger unit sequence time t k . However, a larger minimum pulse interval implies a reduction in the 'dynamical decoupling limit' [61,62], this is the highest-frequency component of the noise's power spectral density that can be successfully suppressed by dynamical decoupling. As a result, a CPMG sequence with larger t k will unavoidably underperform (see Sec. IV B for further discussion). Alternatively, given that the spin selectivity (full width at half maximum of the curve for the target nuclear spin's n 0 · n 1 , see Fig. 3(b)) varies for different UDDn sequences, UDD-based control is versatile enough to individually control a target nuclear spin while decoupling the electron spin from the rest of the spin bath, without the use of higher resonance orders.
As an example of UDD's finer spin selectivity, we simulate the interaction of two 13 C nuclear spins with the central electron spin of an NV center under dynamical decoupling sequences and calculate the couplingdecoupling rate of the electron spin using the system's coherence function [56] L(t) = Tr [ρ(t)S + ] / Tr [ρ(0)S + ], where S + = S x +iS y is a spin ladder operator, and ρ(t) is the density matrix of the system comprising the electron spin and two nuclear spins at time t. For the numerical calculations we set the nuclear Larmor frequency equal to ω L /2π=314 kHz, and we take the hyperfine interaction parameters (A /2π, A ⊥ 2π) from Ref. [51]: (15.3, 12,9) kHz and (30.6, 25.7) kHz for the first and second nuclear spins, respectively. Assuming an inter-nuclear distance such that the nuclear-nuclear interaction is much weaker than the electron-nuclear interaction, we neglect the former in our calculations. Consequently, if we assume that the system is initialized in a product state with the electron's state being |x = (|m s = 0 +|m s = −1 )/ √ 2, then the probability P x of preserving the initial electron state at time t is given by P x = (1 + L(t))/2. In Fig. 4 we plot the electron's probability P x after CPMG (Figs. 4(a,b)) and UDD4 (Figs. 4(c,d)) sequences with N iterations of their respective basic unit sequences. Evidently, a probability P x equal to 1 indicates that the electron is decoupled from the nuclear spins, and that is true for most values of the unit sequence time t in Fig. 4. However, for certain values of t the sequence is in resonance with one of the nuclear spins, which corresponds to a sharp dip in P x as shown in Fig. 4. At those resonance values of t, Eqs. (6,11), the rotation axes n 0 and n 1 for the target nuclear spin are approximately antiparallel ( n 0 · n 1 = −1,which corresponds to P x ≈ 0.5), and thus the resulting conditional rotation entangles the target nuclear spin with the electron spin. In order to improve the spin selectivity of CPMG we use a higher resonance order k = 2. Moreover, the number of iterations, N i with i ∈ {CPMG,UDD}, are chosen such that the electron spin is maximally entangled with one of the nuclear spins (P x → 0.5), see Fig. 4. Note that, in contrast to the CPMG case (Figs. 4(a,b)), when the signal of the target nuclear spin, which is at resonance with the UDD4 sequence (Figs.4(c,d)), is near P x = 0.5, the signal of the nuclear spin is effectively at P x = 1. This means that the nuclear spins can be individually controlled without affecting each other in the process. Moreover, the total sequence time T of UDD4 is only slightly larger than that of CPMG, making it overall more appealing.

B. Decoupling power of UDD versus CPMG in the spin selectivity enhancing case
It has been shown in the literature that in the presence of noise with a soft high-frequency cutoff CPMG outperforms UDD [59,[62][63][64]. However, as mentioned in the previous section, in the particular case of spin selectivity enhancement it is necessary to use a higher resonance order k for CPMG (larger interpulse period) which can negatively affect its decoupling performance. This becomes evident when we consider the electron spin decoherence under pulse sequences. Accordingly, we quantify the electron spin (qubit) coherence following the formulation for The CPMG (UDD4) sequence is formed by NCPMG (NUDD) iterations of its basic unit sequence. The hyperfine interaction parameters (A /2π, A ⊥ /2π) of the two nuclear spins interacting with the electron spin are extracted from Ref. [51] and are: (15.3, 12.9) kHz for spin-1 (blue curve), and (30.6, 25.7) kHz for spin-2 (red curve). The calculation assumes a relatively strong external magnetic field, ωL/2π = 314 kHz. Each panel shows the type of pulse sequence used in the numerical simulation and the total sequence time T . The probability Px is also calculated for the case where both nuclear spins interact simultaneously with the electron spin. This is plotted using black dashed curves and shows that treating two nuclear spins separately (blue and red curves) is a good approximation. The and • markers indicate synchronous points in the Px curves corresponding to the resonance time at which the electron spin is maximally entangled with the target nuclear spin (at Px ≈ 0.5). The number of iterations, N measuring coherence under a dephasing Hamiltonian introduced in Refs. [54,59,63]. In general, an initial qubit state along the x-axis of the Bloch sphere accumulates a random phase due to its interaction with the environment. The state's coherence after a time T is given by | L(t)| = e −χ(T ) , where | . . . | is the ensemble average and L(t) is the previously defined coherence function. As shown in Refs. [54,59,63], the function in the exponent of the coherence function is where S(ω) is the power spectral density of the noise, and F (ωT ) is known as the 'filter function' and describes the influence of the pulse sequence on the qubit decoherence. Therefore, to characterize the coherence-preserving power of any pulse sequence with total time T , it suffices to calculate its filter function F (ωT ).
For a general sequence of n π pulses which are applied at the instants of time δ j T with j ∈ {1, 2, . . . , n}, so that the total sequence time T is divided into n + 1 subintervals, the filter function is [54,59] F (ωT ) = 1 + (−1) n+1 e iωT + 2 Here we are assuming instantaneous pulses, which is a good approximation as long as the duration of each pulse is smaller than the smallest interval between pulses [63]. This is the case for NV centers, where π-pulses can be implemented in less than 10 ns and with a fidelity above 99% [49,65]. Now, for an n-pulse CPMG sequence the fractional pulse locations are δ j = (j − 1/2)/n. However, given that in this work we consider the number of iterations N of a basic sequence unit (τ −π−2τ −π−τ ) instead of the total number of pulses, the fractional pulse locations for N iterations of the basic CPMG unit (CPMG N ) would be δ j = (j − 1/2)/(2N ). Therefore, after some algebra, the filter function for a CPMG N sequence is Alternatively, for a UDD sequence with n pulses (UDDn) the fractional pulse locations are δ j = sin 2 [πj/(2n + 2)]. But then again, in this work we consider N iterations of a basic sequence unit UDDn, and thus the fractional pulse locations are given by δ ln+j = l/N + sin 2 [πj/(2n + 2)]/N . The filter function for a (UDDn) N sequence then is With the above expressions we proceed to compare the filter functions of the pulse sequences used in Figs. 4(a,c), which is shown in Fig. 5 (the filter functions of the pulse sequences used in Figs. 4(b,d) gave similar results). The vertical black and red dashed lines in Figs. 5(a,b) mark the frequency interval ∼[150,600] kHz where the CPMG filter function is greater than or equal to 1, i.e. CPMG fails to decouple the electron spin from the spin bath. In that same region, with non-negligible noise spectral weight, UDD4 clearly outperforms CPMG. This shows that, in this type of scenario, UDD4 not only provides better spin selectivity, but also better noise-suppression compared to CPMG.

C. Robustness under pulse timing errors in strong magnetic fields
There are scenarios where the use of very strong magnetic fields is advantageous, e.g. in order to suppress undesired transverse couplings. In those cases, the use of dynamical decoupling sequences to conditionally control nuclear spins becomes more sensitive to pulse timing errors due to shorter time intervals between pulses that can get close to the hardware temporal resolution limit. However, considering that whenever the inner product of the target nuclear spin rotation axes ( n 0 · n 1 ) is equal to -1, the nuclear spin rotation is conditional, then it is possible to make the sequence more resistant to pulse timing error by requiring that the gradient around the point where n 0 · n 1 = −1 be as small as possible. In other words, since the spin selectivity depends on the full width at half minimum of the aforementioned curve, we slightly relinquish the spin selectivity in order to obtain a sequence that is more resistant to pulse timing error.
To illustrate the previous point, Fig. 6 shows the inner product of the rotation axes, n 0 · n 1 , of a nuclear spin being controlled via CPMG and UDD4 sequences under a strong magnetic field (corresponding to a nuclear Larmor frequency of ω L /2π = 20MHz). For UDD4 we use the second set's first order resonance timet UDD4 1 (see Eq. (12)) and for CPMG we use its first order resonance time t CPMG 1 . Evidently, the CPMG sequence produces a sharp deep, which doesn't change regardless of the order of the chosen resonance time, whereas UDD4 gives a wider dip that corresponds to a control sequence less sensitive to pulse timing error. Note thatt UDD4 1 = 2t CPMG 1 , meaning UDD4 requires longer time to guarantee its superior robustness against timing error. The quotient between the numerical values of UDD4 and CPMG. A quotient equal to 1 indicates equal filter functions, a quotient less than 1 (light blue shading) corresponds to UDD4 outperforming CPMG and vice versa for a quotient greater than 1 (magenta shading). In the frequency interval ∼ [60,250] kHz (between the vertical black and red dashed lines) the CPMG filter function is, on average, equal or greater than 1, thus losing its error-suppressing capability. In that same frequency interval UDD4 clearly outperforms CPMG. For higher frequencies (to the right of the red dashed line ∼250 kHz) CPMG outperforms UDD4 for certain sporadic intervals, however, the noise spectral weight in such intervals is comparatively much smaller.

V. HYBRID SEQUENCES: CPMG+UDD FOR HIGH FIDELITY GATES AND WIDER SPIN CONTROL RANGE
Givent that CPMG offers fast yet non ideal large angle rotations and UDD offers slow but desirable small angle rotations, the combination of both CPMG and UDD sequences is an attractive solution to construct fast and high fidelity gates. We refer to such combinations of CPMG and UDD as hybrid sequences. These are based on several iterations of basic CPMG units to form rota- of CPMG (blue curve), UDD4 (red curve) sequences, respectively. The times are shifted to the origin for comparison purposes. In the numerical calculations we use a strong external magnetic field (corresponding to a nuclear Larmor frequency of ωL/2π = 20MHz) and hyperfine parameters A /2π = A ⊥ /2π = 100kHz. The wider dip given by the UDD4 sequence allows for somewhat larger degree of error in the pulse timing.
tions close to the desired gate, followed by few iterations of single basic UDD units to get as close as possible to the target gate. The resulting rotation angle Θ is given by where θ CPMG(UDD) and N CPMG(UDD) are the rotation angle and integer number of iterations of the CPMG (UDD) sequence, respectively. The recipe for choosing N CPMG and N UDD4 is to start with the value for N CPMG that makes the resulting gate as close to the target gate as possible. Then we perform a simple numerical optimization where we perturb the value for N CPMG previously found and add a variable number of iterations of the UDD4 sequences (constrained to N UDD4 ≤ 6) in such a way that the resulting gate fidelity is maximum. These hybrid sequences take advantage of CPMG's large rotation speed and UDD's small and more precise rotation angles, giving an overall fast and high-fidelity two-qubit gate. Fig. 7 shows the gate infidelity and gate time for a two-qubit CR X ( π 2 ) obtained with the CPMG sequence and with the hybrid CPMG+UDD4 sequence. The gate infidelity is defined as [66] where n is the Hilbert space dimension, U is the generated gate, and U 0 is the desired gate. The infidelity and gate time are sampled on a range of hyperfine parameter values and for relatively weak and strong magnetic field strengths. The CPMG-based CR X ( π 2 ) gate has lower fidelity when the external magnetic field is relatively weak (Fig. 7(c)). In contrast, the CPMG+UDD4-based CR X ( π 2 ) gives relatively high gate fidelity under weak magnetic field strength, above 99% as shown in Fig. 7(d). Moreover, as shown in Figs. 7(b,d), the high fidelity of the hybrid CPMG+UDD4 sequence persists for a broad hyperfine parameter range, and the landscape is smoother. Figs. 7(e-h) show the gate times for CR X ( π 2 ) obtained with both type of sequences. The CPMG+UDD4-based CR X ( π 2 ) has only a slightly longer gate time than the CPMG-based one, confirming that the combination of CPMG and UDD sequences gives an overall fast and high-fidelity CR X ( π 2 ) gate. In general, the CR X (φ) fidelity is directly proportional to the external magnetic field strength and, therefore, it is inversely proportional to the rotation angle φ k in both CPMG and UDDn sequences, which, seeing that in general φ k φ k (see Eqs. (6)(7)(8)(9)(10)(11)(12)(13)), implies that a higher-fidelity CR X (φ) would result in an undesirably long R x (φ) gate time. Having excessively slow singlequbit gates would hamper any further development that involves nuclear spins in defects as quantum registers or processors. However, the use of weaker external magnetic fields not only improves the nuclear spin selectivity but it also lowers the gate time of the single-qubit x-rotation caused by a dynamical decoupling sequence with an offresonance unit time t. Fig. 9 shows the fidelity and gate time for the CPMG-based single-qubit rotation R x ( π 2 ), which are calculated for a range of hyperfine parameter values and different magnetic field strengths. We choose to use only the CPMG sequence for the calculations presented in Fig. 9 because the other sequences (UDD and CPMG+UDD) give similar fidelities but worse gate times. As shown in Fig. 9(c,d), a lower magnetic field strength reduces the overall single-qubit x-rotation gate time; notwithstanding, a weak magnetic field also reduces the gate fidelity ( Fig. 9(a,b)). Nevertheless, the gate fidelity is still above 98% in most of the parameter space under weak magnetic fields.
We next test the spin selectivity of the hybrid protocol. In Fig. 8, we compare the spin selectivity of CPMG and CMPG+UDD4 hybrid protocols for two nuclear spins with parameters taken from Ref. [51]. We set the nuclear Larmor frequency equal to ω L /2π=314 kHz, which is the setup in Fig. 4. We choose to use k = 3, the third resonance, for all CPMG pulse sequences, wherein two spin resonance times are more separated to achieve better spin selectivity. In the totally entangling process of two nuclear spin respectively, we find that the hybrid protocol and the CPMG protocol have the same gate times (T = τ (N CPMG + N UDD4 )), which are only determined by their sequence iteration numbers N : (a) N CPMG = 9, (c) N CPMG = 8, N UDD4 = 1; (b) N CPMG = 18, (d) N CPMG = 17, N UDD4 = 1. The two protocols show similar spin selectivity, which is not surprising, given that the hybrid protocol generally consists a long sequence of CMPG pulses, followed by a short sequence of UDD4 pulses. Now we turn our focus toward the coherencepreserving power of the hybrid sequence CPMG+UDD. The filter function for the hybrid sequence    ), where (a,c,e,g) were obtained with the CPMG sequence and (b,d,f,h) were produced by the CPMG+UDD4 hybrid sequences. The contour plots axes correspond to the the parallel and perpendicular components of the hyperfine interaction strength A /2π (x-axis) and A ⊥ /2π (y-axis), in the range from 0 MHz to 0.8 MHz, for different Larmor frequencies (ωL/2π = 8.0 MHz and ωL/2π = 2.0 MHz correspond to strong and weak magnetic fields, respectively). For each point of the contour plots we have calculated the necessary number of iterations Ni (i ∈ {CPMG, UDD4}) for each type of sequence such that the resulting gate is a CRX ( π 2 ) with the best fidelity and shortest gate time possible attainable with the corresponding set of parameters (see Appendix D for the values of Ni). (a,c) The CPMG-based CRX ( π 2 ) gate infidelity is considerably increased when the magnetic field is weak, especially for nuclear spins with stronger hyperfine parameters. (c,d) The CPMG+UDD4-based CRX ( π 2 ) gate infidelity is less affected by the lower magnetic field due to UDD4's smaller rotation angle. Under the same magnetic field, the hybrid sequence CPMG+UDD4 allows more robust control in a broader hyperfine coupling parameter range. (e,g) CPMG-based and (f,h) CPMG+UDD4-based CRX ( π 2 ) gate times. The hybrid sequence CPMG+UDD4 is always slightly longer than the CPMG sequence alone.
(CPMG) NCPMG +(UDDn) NUDD is a combination of Eqs. (15,16) and is given by where δ CPMG j = (j − 1/2)/[(2(N CPMG + N UDD )) and δ UDD ln+j = (l + N CPMG )/(N CPMG + N UDD ) + sin 2 [πj/(2n + 2)]/(N CPMG +N UDD ). In Eq. (18) we assume that the order of the full sequence, from left to right, is CPMG first followed by UDD. For alternative orders the fractional pulse locations must be slightly modified. We compare the CPMG+UDD4 and CPMG filter functions in Fig. 10. These pulse sequences, with parameters {N CP M G = 21, N U DD = 2, T = 12.01 µs} for CPMG+UDD4 and {N = 21, T = 10.97 µs} for CPMG, induce a high-fidelity CR x ( π 2 ) gate between the electron and a target nuclear spin with hyperfine parameters {A ⊥ /2π = 70 kHz, A /2π = 170 kHz}. The pulse sequences and hyperfine parameters were extracted from Figs. 7(c,d), in which the sequence parameters are optimized to generate high-fidelity CR X ( π 2 ) gates in the shortest time possible. Figure. 10(a) shows, apart from the CPMG+UDD4 and CPMG filter functions, the filter function for a free-induction decay (FID) process given by [59,63] F FID (ωT ) = sin 2 (ωT /2). In this process the electron spin state is allowed to freely precess for certain time T (T = 12.01 µs in Fig. 10(a)) under the effect of a dephasing Hamiltonian which, in an ensemble average, produces a decay in coherence. The filter functions of both pulse sequences are, as expected, much smaller than the FID's filter function for low-frequency noise but they get closer to each other with increasing noise frequency until they become equal to or greater than 1 (horizontal dashed black line). The vertical dashed black lines in both Figs. 10(a) and (b) mark the minimum frequency ω 1 /2π ≈ 1 MHz at which both filter functions are equal to 1. Therefore, for noise frequencies equal to or greater than ω 1 , both pulse sequences do not effectively suppress the noise and can even amplify the decoherence. In the same vein, Fig. 10(b) shows that for noise frequencies less than ω 1 both filter functions perform equivalently (the quotient between filter functions is equal to 1) except for noise frequencies close to ω 1 , where CPMG slightly outperforms CPMG+UDD4 (quotient greater than 1). However, the noise spectral density near ω 1 /2π ≈ 1 MHz is already considerably small [49]. Therefore, the hybrid CPMG and UDD pulse sequences, in comparison to CPMG alone, do not appreciably lower the ability to extend the electron spin's coherence time.

VI. CONCLUSIONS
In this work we have introduced a new way of conditionally controlling nuclear spins via UDD and hybrid dynamical decoupling sequences acting on the central electron spin in NV centers. The Uhrig sequences provide flexibility in terms of enhancing nuclear spin selectivity, without increasing gate times. Surprisingly, in  Decreasing the field strength to lower the gate time unavoidably lowers the overall gate fidelity as well. Nevertheless, the gate fidelity is still above 98% in most of the parameter space. this case UDD performs better than CPMG in terms of electron spin coherence protection too. The hybrid approach combines CPMG and Uhrig's dynamical decoupling sequences, and in some sense gives the best of both worlds: it produces fast entangling two-qubit gates between the electron and target nuclear spins with higher fidelity than what would be obtained with only using Uhrig's or CPMG sequences alone. Moreover, the hybrid sequence retains most of CPMG's noise-suppression as shown by its filter function. In addition, in contrast to other sequences, the hybrid protocol is less restrictive regarding the strength of the external magnetic field, allowing the use of weaker magnetic fields without significantly increasing the overall gate time and, at the same time, giving better spin selectivity. It also allows the use of very strong magnetic fields while reducing the sequence sensitivity to pulse timing error.
Our results are applicable not only to NV centers but also to similar defect platforms such as the SiV in diamond [67] and divacancy centers in SiC. The latter is particular interesting since it has two types of nuclear spins, 13 C and 29 Si, which can be treated as two independent nuclear spin baths due their negligible interference [68]. Overall, our work presents a more versatile way to control Both pulse sequences induce a high-fidelity CRx( π 2 ) gate between the electron and target nuclear spin when the latter has the following hyperfine interaction parameters {A ⊥ /2π = 70 kHz, A /2π = 170 kHz}. The pulse sequence and hyperfine parameters were extracted from Figs. 7(c,d). For the freeinduction decay (FID) process, the electron spin state freely evolves for 12.01 µs.(a) Numerically calculated filter functions for CPMG+UDD4, CPMG, and free-induction decay (FID). The horizontal dashed black line indicates F (ω) = 1. (b) The quotient between the numerical values of CPMG+UDD4 and CPMG. A quotient equal to 1 indicates equal filter functions, a quotient less than 1 corresponds to CPMG+UDD4 outperforming CPMG and vice versa for a quotient greater than 1 (magenta shading). Vertical dashed black lines in both plots mark the frequency value ω1/2π ≈ 1 MHz below which noise is effectively suppressed by both pulse sequences. weakly coupled nuclear spins via a central electron spin, and thus it is immediately relevant to experiments with existing capabilities in NV centers and similar systems.

ACKNOWLEDGMENTS
We thank T. Taminiau for helpful discussions. This work was supported by the NSF, award number 183897. Here we explain that the CNOT gate (CNOT= |0 0|⊗ I + |1 1| ⊗ X) could only be effectively achieved as CR X ( π 2 ), which differs the original CNOT in single-qubit gates. To see the reason behind this, we start from a nuclear spin coupled to central electronic spin and the full evolution operator is where U 0 and U 1 are rotations along ±x axis by same rotation angle once unit sequence time t satisfies resonance condition. Without the loss of generality, say we choose N such that U 0 = R X π 2 = e −i π 4 σ X and U 1 = R −X ( π 2 ) = e i π 4 σ X . In this way, we have U −1 0 U 1 = iX and the full evolution operator U is simply: (A2) It is clear from the expression that the realistic gate, referred to as CR X ( π 2 ), is equivalent to the proper CNOT gate, up to a single qubit global drift gate U 0 (regardless of the electronic state) on nuclear spin and an effective R (E) z π 2 gate on the electron spin (we ignore the trivial phase).
CNOT, to restore the proper CNOT gate one should apply corresponding unconditional nuclear gates and proper electronic spin gate to counteract the R electron-nuclear hyperfine tensor, which contains 9 components for i, j ∈ {x, y, z}. Now we use the dipole-dipole interaction to analyze the H int , which is a good description as long as the spinful nucleus is not too close to the electron (in that case the Fermi contact formula should be used instead). The electron-nuclear spin dipole-dipole interaction is: where the r denotes the displacement vector from the electron to the nucleus. When we eliminate the transverse components (or bit flipping terms) of the electron spin, as explained in the main text, we have: A proper rotation of the x − y plane can reduce the directions down to ⊥ and components w.r.t the z-axis.
In this way, the second term in Eq. (2) can be obtained.
Appendix C: Derivation of the analytical expressions for the rotation angles and resonance times for UDDn We consider the system formed by the electron spin interacting with a single nuclear spin, whose Hamiltonian is given by Eq. (4). In the main text, we used the coherence function L(t) of the whole system to find the probability of preserving the electron's initial state (|x = (|0 + |1 )/ √ 2) after a decoupling sequence, which is P x = (1 + L(t))/2. An alternative way to find P x is using the evolution operator of the nuclear spin alone conditioned to the electron spin input states |0 and |1 , U 0 and U 1 respectively. This is the same approach used in Ref. 51. Accordingly, the probability of finding the electron in the initial |x state after the decoupling sequence is P x = (1 + M )/2, with M = Re Tr U 0 U † 1 /2. The nuclear spin evolution operators after a single UDDn decoupling sequence, with n being an even integer, are: where ∆ j (n) is defined as with ∆ 0 (n) = ∆ n (n) = 1. The Hamiltonian h (1+(−1) j+1 )/2 (h (1+(−1) j )/2 ) is either equal to h 0 = ω L I z or h 1 = (ω L − A )I z − A ⊥ I x (see Eq. (3) in the main text). Here A ≡ ω h cos(θ) and A ⊥ ≡ ω h sin(θ), where ω h is the magnitude of the hyperfine interaction and θ is the angle between the axes of rotation ω L and ω h . In the absence of hyperfine coupling, the nuclear spin would precess about the axis ω L with frequency ω L (Larmor frequency). Similarly, in the absence of an external magnetic field, the nuclear spin would precess about the axis ω h with frequency ω h . . Rotation angle φ and unit axes' perpendicular components, n 0,⊥ and n 1,⊥ , vs the unit sequence time t for different UDDn sequences with even n. The values for the system parameters used to make the plots are ωL/2π = 2 MHz and A /2π = A ⊥ /2π = 0.1 MHz. Note that whenever a peak(dip) of n 0,⊥ coincides with the dip(peak) of n 1,⊥ the nuclear spin undergoes a conditional rotation.
Note that for odd n the operators U 0 and U 1 do not start and end with the same single evolution operator as is the case for even n, a required symmetry that implies that the electron spin returns to its initial state after the decoupling sequence. Therefore, as stated in the main text, for UUDn with odd n the basic unit sequence must be a combination of two single UDDn sequences, giving Rotation angle φ and unit axes' perpendicular components, n 0,⊥ and n 1,⊥ , vs the unit sequence time t for different UDDn sequences with odd n. We use the same values for the system parameters used in Fig. 11. The regions where a peak, nor a dip, is observed but one would otherwise expect to do so, e.g. the region under the first peak of the rotation angle, is due to very sharp processes (and, therefore, quite sensitive to timing imprecision) that were not picked up by the numerical calculations or simply due to the absence of conditional or unconditional X-rotations.
the following nuclear spin evolution operators U 0 = j=n odd j=0 exp −ih (1+(−1) j+1 )/2 ∆ j (n)τ × j=n odd j=0 exp −ih (1+(−1) j )/2 ∆ j (n)τ , Given that the operators U 0 and U 1 belong to the SU(2) group, they can be expressed as rotations by an angle φ around a unit axis n i , this is where σ is the Pauli vector. Note that the angle of ro-tation φ is independent of the electron spin input state because Tr(U 0 )/2 = Tr(U 1 )/2 = cos[φ/2]. Using the expressions in Eq. (C4) we obtain [51] M = 1 − (1 − n 0 · n 1 ) sin[φ/2] 2 , which implies that the probability P x that the initial electron spin state |x is preserved after the decoupling sequence is equal to 1 if the unit axes n 0 and n 1 are parallel, i.e. n 0 · n 1 = 1. Whereas for antiparallel axes (n 0 · n 1 = −1) P x is effectively the furthest from 1 (the exact value would depend on the magnitude of φ), and thus the electron spin is coupled to the nuclear spin. Note that the electron and nuclear spins are maximally entangled when n 0 · n 1 = −1 and φ = π/2 (or φ = 3π/2), and thus P x = 0.5. Approximate analytical expressions for the resonance time t and angle of rotation φ can be found for any UDDn sequence (including CPMG, i.e. UDD2) using Eq. (C5) and cos[φ/2] = Tr(U 0 )/2 = Tr(U 1 )/2. First, assuming a high external magnetic field such that ω L ω h , we perform a Taylor series expansion in terms of ω h /ω L on both Eq. (C5) and cos[φ/2] = Tr(U 0 )/2. We only need to keep terms up to first order to find the approximate analytical expression for the resonance time t. We do so by first finding an approximate expression up to first order for the angle φ using equation cos[φ/2] = Tr(U 0 )/2. And then plugging it in Eq. (C5), where M reduces to 1 in this first-order approximation and n 0 · n 1 is set to -1 to get the interval time τ needed to implement conditional rotations on the nuclear spin. After obtaining an expression for τ , the unit sequence time t for any UDDn sequence with even or odd n is given by Finally the approximate analytical expression for the rotation angle φ can be obtained by plugging the previously found interval time τ into the Taylor series expansion of cos[φ/2] = Tr(U 0 )/2 but now we keep terms up to second order. We follow a similar procedure for timet and rotation angleφ corresponding to unconditional rotations. Analytical expressions for the resonance times and rotation angles for UDDn sequences with n ≥ 5 are not simple enough to report them here. Moreover, as shown in Figs. 11 and 12, it is not trivial to find a pattern that identifies the t values that produce unconditional rotations in UDD5 and beyond.  used in the fidelity plots of Fig. 7(b). The Larmor frequency is set equal to ωL/2π = 8 MHz.