Delayed entanglement echo for individual control of a large number of nuclear spins

Methods to selectively detect and manipulate nuclear spins by single electrons of solid-state defects play a central role for quantum information processing and nanoscale nuclear magnetic resonance (NMR). However, with standard techniques, no more than eight nuclear spins have been resolved by a single defect centre. Here we develop a method that improves significantly the ability to detect, address and manipulate nuclear spins unambiguously and individually in a broad frequency band by using a nitrogen-vacancy (NV) centre as model system. On the basis of delayed entanglement control, a technique combining microwave and radio frequency fields, our method allows to selectively perform robust high-fidelity entangling gates between hardly resolved nuclear spins and the NV electron. Long-lived qubit memories can be naturally incorporated to our method for improved performance. The application of our ideas will increase the number of useful register qubits accessible to a defect centre and improve the signal of nanoscale NMR.

N uclear spins are natural quantum bits with long coherence times for quantum information tasks 1 and they encode information about the structure of molecules and materials in a form that is accessible to nuclear magnetic resonance (NMR) techniques 2 or electron-nuclear double resonance (ENDOR) 3 . However, because of the weak magnetic moments of nuclear spins and their similar precession frequencies, it is challenging to detect and control nuclear spins individually. The nitrogen-vacancy (NV) centre in diamond represents a promising nanoscale platform for detection and coherent control of such nuclear spins [4][5][6] . In type IIa diamonds, the decoherence of the NV electron spin is dominated by the presence of 13 C nuclei. However, when properly controlled, the 13 C nuclei in the vicinity of an NV centre become useful resources [7][8][9] for quantum computing purposes. Furthermore, shallow implanted NV centres can be used to detect the signal of nuclear spins on the surface 10,11 , which opens opportunities for both quantum simulation 12 and single molecule NMR 11 .
Using magnetic resonance techniques originally developed in NMR, nuclear spins have successfully been detected by single NV centres 6,10,11,[13][14][15][16][17][18][19] . Among them, dynamical decoupling (DD) techniques 2,20 provide remarkable advantages, including significant extension of qubit coherence times and, more importantly, the ability of addressing single nuclear spins [13][14][15]21,22 . Nevertheless, standard DD techniques can only be used to address a few nuclear spins because of a number of drawbacks such as low spectral resolution 23 , resonance ambiguities 24,25 and perturbations from the electron-nuclear coupling 21 . In this respect ENDOR techniques are applied to improve the spectral resolution by measuring the NV signal over long evolution times 23,26,27 , but without the abilities of individual spin addressing and control. The main reason of the lack of selective addressing comes from the unfiltered coupling to undesired nuclear spins such as those in the spin bath. Moreover, in spin detection the presence of undesired coupling unavoidably produces noise on the sensor electron and reduces the sensitivity. For example, the signals from the target nuclear spins which has weaker coupling can be damaged by those with stronger coupling, regardless of the potential high spectral resolution. As a consequence reported results using the ENDOR techniques 18,23,26,27 provide high spectral resolution but do not demonstrate any increase in the number of detectable nuclear spins by sensor electrons comparing with the achieved numbers by standard DD techniques 6,14 . Note that individual addressing of nuclear spins and the implementation of quantum gates on them are more demanding than nuclear-spin detection, but essential in quantum information processing and thorough characterization of nuclear spins.
Our method overcomes these difficulties to selectively address specific nuclear spins by applying radio frequency (RF) fields in a delay window, while the entanglement with the electron spin sensor is preserved by a subsequent Hahn echo operation 2 . In this manner highly selective entangling gates between the electron spin and different target nuclear spins can be achieved via selective double resonance. We demonstrate that with our method one can address, control, and identify nuclear spins and spin clusters that are not detectable by standard DD techniques. Additionally, our protocol provides the ability to identify the number of nuclear spins sharing an unresolvable signal dip in the resonance spectrum. Furthermore, we show how one can individually address nuclear spins to perform high-fidelity two-qubit quantum gates between the NV electron qubit and the addressed nuclear qubit in a robust way, even when they are hardly resolved in spectrum. We also show how the efficiency of our method can be enhanced by using a nuclear memory, which has coherence times much larger than the life time of the electron spin of the sensor.

Results
Working principle. Now we describe the details of our method. A magnetic field B zẑ parallel to the NV symmetry axis splits the spin triplet of the orbital ground electronic state of the NV centre. We use two of the three levels m s ¼ 0, ±1 to define an NV electron spin qubit 4 . Under a strong magnetic field such that the nuclear Zeeman energies exceed the perpendicular components, A ? j , of the hyperfine field A j at the locations of nuclear spins, see Fig. 1a, the interaction between the NV electron spin and its surrounding nuclear spins is described by (Supplementary Note 1) with s z ¼j" e i " e h jÀ # e j i # e h j. Here we use " e j i¼ m s ¼ þ 1 j ias one of the qubit states while the second qubit state may be # e j i¼ m s ¼0 j i, when Z ¼ 1/2, or # e j i¼ À 1 j i with Z ¼ 1. For each nuclear spin, A jj j denotes the component of A j parallel to the nuclear spin quantization axes (see Fig. 1a,b). The nuclear precession frequencies are shifted by A jj j , which can be used to address individually nuclear spins of the same species (homonuclear spins).
An initial superposition state of the electron spin c e j i¼c " " e j iþ c # # e j i loses its coherence because of the electronnuclear coupling H int . This effect can be removed by a Hahn echo. In our case, a microwave p pulse exchanges the states " e j i $ # e j i and effectively reverses H int -À H int . When the evolutions before and after the p pulse have the same duration t, entanglement from all the nuclear spins is erased, preserving the electron spin coherence. In this manner, the nuclei are effectively decoupled from the electron. However, no nuclear spins can be addressed in this way.
To preserve the coupling with a target spin while eliminating the influence of the rest on our sensor, we apply RF driving at the precession frequency of the target spin during the delay window. By flipping the target spin j by an angle y rf ¼ p, we selectively rephase its interaction with the electron spin and realize a quantum gate with U AE ¼ expð Ç i 1 2 f g I z j Þ and f g ¼4ZtA jj j , up to single-spin rotations. Note that, by choosing a proper rotating frame, this is equivalent to write U þ ¼ I and U À ¼ expðif g I z j Þ. Hence, we can generate entanglement between the NV centre and selected nuclear spins which forms a key ingredient of our method (see Fig. 1c,d). Note that it is not essential that y rf ¼ p as almost any choice of y rf a2mp (m being an integer number) will create entanglement with the target and lead to a coherence dip in the electron spin spectrum. In addition, more than one nuclear spin can be addressed in the same delay window by using RF driving with different frequencies. Now, we describe two strategies to achieve selective nuclear spin control in the delay window.
Spin addressing and high-fidelity quantum gate. The first procedure corresponds to use DD techniques to suppress electron-nuclear interactions and to protect the NV coherence during the delay window, while the RF driving is applied to achieve selective rotations on the target nuclei (Fig. 1e). In nuclear spin sensing protocols, the electron qubit is initialized in an equally weighted superposition state c e j i and its population signal at the end of the protocol P ¼ (1 þ L)/2 is directly related to the observable of NV electron coherence 15  being the reduced density matrix of electron qubit. Figure 2a,b shows the obtained spectrum when scanning the frequency of the RF driving applied at the delay window, for a diamond sample of natural abundance (1.1%) with 736 13 C spins. The NV coherence at the delay window is protected by the Carr-Purcell (CP) sequence 2 . Note that we can also use modified versions 21,28,29 of CP sequence by changing the phases of pulses to provide improved robustness at the present of control errors. When the RF frequency o rf matches one of the nuclear precession frequencies that, under strong magnetic fields, read o j ¼o13 C À A jj j =2 (with o13 C denoting the bare Larmor frequency of 13 C) we observe the coherence contributed by the corresponding spin under on-resonant RF driving (see Methods) which lies in the range cos y rf LðA jj j ; y rf Þ 1. For the case of y rf ¼ p we have a maximum signal LðA jj j ; y rf Þ¼ cosð2ZA jj j tÞ. When there are a number p of nuclear spins with indistinguishable precession frequencies o j Eo rf the coherence signal becomes L¼½LðA jj j ; y rf Þ p . The one-to-one correspondence between L and o j (see the brown dashed lines on Fig. 2 for p ¼ 1 and the cyan dashed lines for p ¼ 2, and compare the brown dashed lines with the signals of C1 and C3, as well as the cyan dashed lines with the dip of C2) and the coherence patterns in Fig. 2c,d easily identify the number of nuclear spins in a dip, even when they are not resolved in the spectrum. Because of the relation between the interaction strength and the spectral position of a signal dip, we know the electron-nuclear interactions when we set the RF driving at the frequency of the signal dip. In this manner, we can selectively control the nuclear spins creating the signal dip.
Our method works well even when the perpendicular components of hyperfine field A ? j ¼ 0 (see Fig. 1a,b). Note that standard methods [13][14][15]21,22,30,31 on spin detection based on DD techniques require both A ? j and A jj j to be different from zero. In this respect, Fig. 2a shows the signal obtained with standard DD 13-15 by scanning the pulse interval t CP ¼p=o DD of the CP sequences. The coherence signal L % cos½A ?
j for a sequence duration t s , when the k DD -th harmonic branch matches the precession 22 . Therefore, nuclear spins with A ? j ¼ 0 (for example, C2 and C3 in Fig. 2a) are not detected by standard DD techniques. Furthermore, in Fig. 2a the signal obtained by DD is weak when compared with our method for the same number of 100 p pulses. See Supplementary Note 2 for a discussion of standard DD methods, a more detailed comparison with our technique, and other shortcomings of standard DD techniques.
In addition, our protocol allows to enhance the interaction and, therefore, the obtained signal by transferring the electronic state # e j i¼ 0 j i to # e j i¼ À 1 j i for the interaction windows (t 1 , t 2 ) and (t 5 , t 6 ) in Fig. 1, with the results shown in Fig. 2b. In contrast, homonuclear spins can not be distinguished by the standard DD methods [13][14][15] when the qubit states m s ¼ ± 1 are used, because the averaged nuclear precession frequencies are not shifted by the hyperfine field (Supplementary Note 2) and are not resolvable in spectrum. Figure 2b also shows that a change in the rotation angle y rf due to, for example, intensity fluctuations in the RF driving field does not affect the locations of signal dips, demonstrating an intrinsic robustness of our method for nuclear spin detection. The fringes that appear around y rf ¼ 2p are caused by the side excitation of the rectangular RF driving with a finite length t rf . The RF driving with a frequency detuning D rf,j o rf À o j turns the nuclear spin around an axis out of thex Àŷ plane with a tilting angle a j arctan(D rf,j t rf /y rf ) and an effective rotation anglẽ . For example, for y rf ¼ 2p there is a spin flip ðỹ rf ;j ¼3pÞ around the tilting axis if the detuning is AE ffiffi ffi 5 p p=t rf , giving the side fringe signal shown in Fig. 2b. This single-spin contribution can be completely eliminated whenỹ rf ;j is an integer multiple of 2p, even o j is not far detuned from the RF frequency. For example, for y rf ¼ p a spin with a frequency detuning D rf ;j ¼ AE ffiffi ffi 3 p p=t rf is rotated by the  rectangular RF driving by an angle 2p. Hence, the NV centre and the nuclear spin remain disentangled and a coherence dip is not produced (for example, see the red arrow near the main C1 coherence dip in Fig. 2a).
To investigate the effect of control errors from DD pulses used in our method, in Fig. 3 we consider a sample with two spectrally close 13 C spins (G1 and G2). Figure 3a shows the population signals obtained by our method; during the delay window we apply ideal instantaneous decoupling control on the NV centre in the form of CP sequences (red solid lines), while the blue circles correspond to the signal when errors in the external control are present. In the latter case we modify the phases of corresponding CP pulses to the ones of adaptive XY-8 (AXY-8) sequences 21 because AXY-8 sequences have good robustness against control errors. As shown in Fig. 3a, the case with errors fits well with the ideal signal even when we introduce a 10% of amplitude error on   the DD pulses, and a microwave detuning error of B2.2 MHz caused by uncertain spin states of the strongly coupled 14 N spin. As discussed above when we tune the RF-driving length to t rf ¼ ffiffi ffi 3 p p= o G1 À o G2 j j , the spin G2 does not perturb the dynamics of the NV electron and G1 spins. This is a situation that can be confirmed by changing the time t of the interaction window and observing that the population change of the spin G1 follows the one of a single spin (see the pattens in Fig. 2c and compare the panels of Fig. 3a). With this value of t rf , we can perform high-fidelity quantum gate on only one of the spins, even through the two spins G1 and G2 are not well separated in spectrum (see Fig. 3a). In Fig. 3b, we address the spin G1 by using the RF control o rf ¼ o G1 and y rf ¼ p. The RF driving implements a p rotation gate R G1 ¼ exp À ipI x G1 À Á around thex direction, unconditional on the NV electron qubit state. If t40, the entanglement echo subsequently implement an entangling gate U ent ðf g Þ (see equation (2)) on G1. Figure 3b shows the fidelity (see Supplementary Note 5 for the definition) of the implemented maximally entangling gate U ent (p)R G1 , achieving a combined gate fidelity of 0.992 even for a 10% amplitude and B2p Â 2.2 MHz detuning errors on the p pulses in the delay window.
Enhanced performance via a quantum memory. An alternative strategy to achieve selective nuclear spin control in the delay window is to store the electron spin state in a long-lived nuclear spin (see Fig. 1f). In Fig. 4a, we show the NV electron spin population signal when it addresses an isolated 13 C spin, by using an initially polarized nuclear memory qubit. The memory qubit can be initialized by swapping a polarized NV electron state to the memory spin or by using dynamical nuclear polarization 16 . Because after a swap operation (Supplementary Note 3) between the NV electron and memory qubits the electron spin gets polarized to the m s ¼ þ 1 state during the delay window, it is not necessary to protect electron coherence. In addition, the shifts of the nuclear spin precession frequencies (now o j ¼o13 C À A jj j under strong magnetic fields) are larger than those achieved by the method using DD or by standard DD techniques [13][14][15]21,22 .
The electron spin relaxation creates magnetic noise on the nuclear spins and can reduce the signal contrast 32 . However, at low temperatures, the relaxation time T 1 of NV electron spin can reach minutes 33 . When T 1 ) t rf the effects of electron spin relaxation can be neglected. In addition, we can protect the memory qubit against the electron-relaxation noise for example by strong driving 32 . The coherence times of memory qubits (for example, a 13 C or a 14 N in Fig. 4a) are determined by the electron-relaxation time T 1 when their hyperfine fields are sufficiently larger than 1/T 1 (Supplementary Note 3) 32 . Therefore, the signal contrasts in Fig. 4a are similar for both memory qubits and we may use a more strongly coupled 13 C spin as a quantum memory. Note that the use of unpolarized memory qubit still gives large signal contrast, showing that in the application of spin detection our method is insensitive to initialization error of the qubit memory (see Fig. 4a).
Structural information of coupled spin clusters can also be observed by our method. The dynamics of two coupled homonuclear spins under a strong magnetic field is characterized by the dipolar coupling strength d j,k (see Methods) and the difference  14 N memory qubit during the delay windows, for t rf ¼ 100 ms, t ¼ 100 ms, and various low-temperature electron spin relaxation times T 1 and initial populations P m of the memory qubit state " j i. (b) Population modulation (solid line) caused by two interacting 13 C nuclei in a C-C bond B1.5 nm away from the NV centre with t ¼ 200 ms and a 14 N memory. Application of LG decoupling suppresses nuclear dipolar coupling and hence the modulation (circles). (c) Signal patterns from two uncoupled distant 13 C spins (2.2 and 2.3 nm away from the NV centre) when using a 14 N memory qubit and DD to protect the interaction windows of duration t ¼ 500 ms. The cross-sectional plots show the signals in the two-dimensional plot (dashed lines) when the initial RF phases f rf match the azimuthal angles of addressed nuclear spins. (d) Roomtemperature signal of one proton spin placed 4 nm away from the NV centre using a 13 C memory qubit and optical illumination during the delay window (Supplementary Note 5). With the RF driving of t rf E10T 1 , the line-width of the signal is well beyond the limit set by electron spin relaxation time 1/T 1 . One major reason of the reduction of signal contrast is the leakage out from the electron qubit to another electron spin triplet level. (e) Log-log plot of the average number of individual 13 C register qubits with A jj j =ð2pÞ44 kHz and A jj j =ð2pÞ different from other spins by amounts larger than the spectral resolution, by averaging over 1000 samples. A magnetic field is used for the bare Larmor frequency o 13 C ¼ 2p Â 5 MHz. In a,d,c, y rf ¼ p, and y rf ¼ 0 in b. In a,b, the electron qubit state # e j i¼ 0 j i is transferred to # e j i¼ À1 j i during the interaction windows.  34 . A spin pair close to the NV centre with d j,k and d j,k the same order of strengths can modulate the NV coherence 34,35 , in the absence of RF control as shown in Fig. 4b. Spin pairs with d j;k ) d j;k (we call this as type-h) or d j;k ( d j;k (called type-d) could be useful quantum resources. But these two types of spin pair were regarded as unobservable, because they form stable pseudo-spins which have negligible effects on electron coherence 34 . However by using our method, we can detect, identify and control these spin pairs close to the NV centre. After the delayed entanglement echo with on-resonant RF driving, the population signal (see Methods) of a type-h or a type-d spin pair P¼1=2 þ ½1 þ cosð2ZA jj j tÞ=4 ! 1=2 is different from the case of single spin, as shown in Fig. 5. The type-h and type-d spin pairs can be distinguished. For type-h pair the on-resonant RF field flips a 13 C spin by y rf ¼ p, while for type-d pair the onresonant RF field drive the triplet state with a Rabi frequency ffiffi ffi 2 p times as the one for single nuclear spins (compare Fig. 5a,b and see Methods).
To address and control nuclear spins individually in a coupled cluster the internuclear dipolar coupling needs to be suppressed. Internuclear interactions also reduce the Hahn-echo electron coherence times and, hence, the achievable interaction times t (available values 36,37 t $ 0:5 ms for natural abundance of 13 C and can be increased using lower abundance, see Supplementary  Fig. 7). To solve the problem of spin interactions, we use the Lee-Goldburg (LG) off-resonance decoupling 2,12,22 . The LG decoupling field can remain turned on for the entire duration of our protocol, including NV electron spin initialization and readout, because the frequency of RF decoupling field is far offresonance to the transition frequencies of the NV electron spin. This allows for the RF decoupling field to be applied by external coils and resonators to avoid possible heating on the diamond sample. When the LG decoupling field is tuned such that ffiffi ffi 2 p D LG ) d j;k , the dipole-dipole interactions between nuclear spins are suppressed 12,22 , giving rise to the effective Hamiltonian H int % Z P j A jj j cos g j s zĨ z j = ffiffi ffi 3 p withĨ z j the nuclear spin operators projected along effective rotating axes (see Supplementary Note 1). Figure 4b demonstrates the effect of LG decoupling with D LG ¼ 2p Â 20 kHz, which can be achieved by a RF field with the amplitude much smaller than the values of B0.1 T in the control fields reported in refs 38,39. The suppression of the internuclear interactions allows us to achieve longer interaction times t and RF-driving lengths t rf for single-spin addressing. The improved spectral resolution $ 1=t rf leads to an increase of the number of individually addressable spins (see Fig. 4e).
In the case that there are other significant decoherence sources that are acting on the NV electron spin, our method can be combined with DD to further protect the NV coherence. Applying a CP sequence (or its modified versions 21,28,29 for better control robustness) with an inter p-pulse interval p/o DD and the sequence duration t at each of the interaction windows, noise with frequencies slower than o DD is suppressed, and at the same time the electron spin couples to nuclear spins through the interactions 2Z= k DD p ð ÞA ? j s z I j j j when the k DD -th harmonic branch matches the precession frequency o j up to a frequency uncertainty of $ 1=t (refs 14,21,22). The nuclear spin operators I j j j ¼I x j cos j j þ I y j sin j j depend on the azimuthal angles j j of nuclear spins relative to the magnetic field direction. Nuclear spins unresolvable by the CP sequences may nevertheless have different precession rates. To ensure the same effective Hamiltonian at the two interaction windows, we apply a twopulse CP sequence on the nuclear spins during the delay window to remove this inhomogeneity. Then adding a weak RF drive during the delay window allows us to address the target spins with high spectral resolutions.
In addition, our scheme allows to measure the spin directions j j , as detailed in the following. The azimuthal directional angle f rf of RF control fields is controlled by the RF phase in the rotating frame of nuclear spin precession. When the RF driven rotation does not commute with the effective interaction Hamiltonian, it breaks the erasing process of delayed entanglement echo on the target spins, and thereby, we address the nuclear spins in a highly selective way. On the other hand, when the RF rotation axis is parallel to the azimuthal angle of a target nuclear spin (f rf ¼ j j or j j þ p), the RF driving commutes with the interaction window and the electron-nuclear entanglement is removed after the echo, giving vanishing signal dips. By measuring the RF phases f rf which cause vanishing signal dips, we obtain the relative locational directions of nuclear spins (see Fig. 4c). Note that we can combine LG decoupling with DD using recently proposed protocols 22,40 .
Our method allows to improve the spectral resolution beyond the limit set by the room-temperature electron T 1 when we decouple the nuclear memory from the electron spin at the delay window. The decoupling technique that uses optical illumination has been demonstrated to prolong the room-temperature coherence time of nuclear spin memory over one second (B267 times of T 1 ) 32 , because the optically induced NV ionization decouples the nuclear spins from the NV centre by a mechanism related to the motional averaging effect in NMR 32,41 . In Fig. 4d, we simulate the application of optical illumination and RF driving during the delay window to detect a proton spin placed 4 nm away from the NV centre with the interaction time t ¼ 100 ms (Supplementary Note 5). A delay time t rf E80 ms already provide enough frequency resolution to detect a chemical shift of B1 p.p.m. for the applied magnetic field B z E0.467 T. Using a higher magnetic field can further improve the chemical shift detection. We can apply LG decoupling when there are more target spins and internuclear interactions. In addition, we can use DD to protect the interaction windows from noise for extending the interaction time t. Electron spin coherence time of shallow NV centre has reported values of B1 ms using continuous DD (spin lock) 11 .

Discussion
In summary, we have proposed a method to address and control nuclear spins which were regarded as undetectable or unresolvable. High-fidelity quantum gates on these nuclear spins can be achieved by our method even when the external control has relative large errors and the nuclear spins present a dense resonance spectrum. Therefore, by our method more nuclear spins become useful and robust quantum resources. For example, with more reliable nuclear spins it is expected an improvement in quantum metrology assisted by quantum error correction 42 . The ability to address and control nuclear spins individually is also vital in the development of a solid-state quantum information processor that uses host electron spins and surrounding nuclear spins 40 as well as for large-scale quantum simulators in diamond 12 . Our method provides a substantial advancement over the ENDOR techniques 3,18,23,26,27 which do not individually address nuclear spins because of inefficient elimination of the noise from other bath spins (see Supplementary Note 4 for a discussion on the ENDOR sequences utilizing both microwave and RF control fields). As a consequence, our work is expected to find applications as well in traditional fields of NMR and ENDOR, for example, in analysis of chemical shifts. Finally, the method has a general character being equally applicable to other electron-nuclear spin systems 43,44 .

Methods
Signals of delayed entanglement echo. During the sensing protocol, the NV dynamics can be calculated by the methods in refs 37,45. Given the initial electron spin state c e j i¼ " e j iþ # e j i ð Þ = ffiffi ffi 2 p , the population left in the original equal superposition state is P ¼ (1 þ L)/2 and the NV coherence L¼ Q c L c can be expressed by the contributions L c of spin clusters c when the interactions between different spin clusters can be neglected 37,45 . Because k B /:E2p Â 21 GHz K À 1 , the thermal energies are much larger than the Zeeman energies of nuclear spins at relevant temperatures. Therefore the thermal state of nuclear spins is approximately described by the identity operator up to a normalization factor. The quantity L c reads where U c; þ ¼ " e h jU c " e j i, U c; À ¼ # e h jU c # e j i, N c the dimension of the spin cluster c, and U c the NV-cluster evolution 37,45 .
Single spins. Single-spin dynamics dominate the effect on the NV electron spin 37 . The signal from single nuclear spins (a spin cluster c ¼ j with one spin j) is calculated as follows. The evolution of a single nuclear spin after an interaction window with time t is e À iZA jj j tszI z j , where Z is determined by the qubit manifold used in the interaction window. During the delay window, we apply a RF driving field that rotates the nuclear spins with the evolution R j . For resonant RF driving (that is, the RF frequency o rf ¼ o j matching the nuclear precession frequency o j ), the nuclear spin is rotated by an angle y rf and R j ¼e À iI x j yrf (assuming rotation around thex direction). For the rectangular RF-driving with a duration t rf and a frequency detuning D rf,j ¼ o rf À o j , we obtain the spin rotation at the delay window R j ¼ exp½ À it rf ð yrf trf I x j þ D rf ;j I z j Þ exp½ À iỹ rf ;j ðcos a j I x j þ sin a j I z j Þ. Following by another interaction window with time t between two p pulses on the electron spin (the last p pulse is optional, but we keep it for simplicity), we have the coupled evolution between the NV electron spin and a single nuclear spin U j ¼e iZA jj j tszI z j R j e À iZA jj j tszI z j , which gives the coherence signal by using equation (4). The contribution of a single spin-1 2 after the delayed entanglement echo with onresonant RF driving is given by equation (3).
Coupled spin pairs. Strongly coupled nuclear spin pair (a spin cluster c ¼ {j, k} with two spins j and k) can modulate the NV electron spin dynamics. Under a strong magnetic field the dipolar coupling reads d j;k ¼ m 0 4p g j g k jrj;kj 3 ½1 À 3ẑ Á r j;k = r j;k À Á 2 , where r j,k is the relative position of the coupled j and k spins and g j(k) the gyromagnetic ratios. The coupled dynamics between the NV electron spin and the spin pairs of type-h d j;k ) d j;k À Á and type-d d j;k ) d j;k À Á under a strong magnetic field is shown as follows.
For type-h pairs, homonuclear spin flip processes are suppressed and therefore the precession frequency of each nuclear spin is split by d j,k by the internuclear interaction H dip ¼d j;k I z j I z k . The nuclear spin flip by the RF driving at the delay window is conditional to the state of the other spin in the nuclear spin pair. Similar to the calculation of single spin, the evolution after the delayed entanglement echo is U fj;kg; AE ¼e À iyrf I x j " j i " h j e Ç i2ZA jj j tI z j " j i " h j , after an on-resonant RF driving y rf ¼ p to flip the nuclear spin j conditioned on the state " j i of spin k. Different from the case of single spins, the dimension of the spin pair is N j N k , and the corresponding population signal for two 13 C is P¼1=2 þ ½1 þ cosð2ZA jj j tÞ=4 ! 1=2 when applying y rf ¼ p on resonant to the spin j.
For type-d pair of homonuclear spins, the interaction takes the form H dip ¼d j;k ð3I z j I z k À I j Á I k Þ=2 under a strong magnetic field. For the nuclear spins with spin I ¼ 1/2, the composited spin cluster has a singlet state with a composited spin J ¼ 0, s n j i¼ "# j iÀ #" j i ð Þ ffiffi ffi 2 p . The triplet states with J ¼ 1 are 1 n j i¼ "" j i, 0 n j i¼ "# j iþ #" j i ð Þ = ffiffi ffi 2 p , and À 1 n j i¼## j i. A radio frequency control H rf ¼g n B x cos o rf t ð ÞðI x j þ I x k Þ can be written as H rf ¼ ffiffi ffi 2 p g n B x cos o rf t ð Þ 1 n j iþ ð À 1 n j iÞ 0 n h jþ h:c:. Scanning the RF frequency o rf to the splitting between 0 n j i and AE 1 n j i, the nuclear spins are rotated. The nuclear state 0 n j i has an energy of À d j,k /2 (because A jj k % A jj j ¼A jj ), while the energies for AE 1 n j iare ±o n þ d j,k /4, where o n is the nuclear precession frequency shifted by the hyperfine field. Therefore, the transition frequencies between 0 n j i and AE 1 n j iare o n ± 3d j,k /4, shifted by the dipolar coupling. Different from the case of single spins that a spin flip requires a RF driving time 2p/(g n B x ), here the Rabi frequency is increased and transitions between 0 n j i and AE 1 n j ican be finished in a time of ffiffi ffi 2 p p/(g n B x ). This time difference is a signature to distinguish the signals from that of single spins and of a type-h spin pair. Before a spin flip of the nuclear spin pair, the interaction Hamiltonian with the NV electronic spin reads H¼Zs z ðA jj j I z j þ A jj k I z k Þ, that is, H¼Zs z A jj þ 1 n j i þ 1 n h jÀ À1 n j i À 1 n h j ð Þ . After a time t, we flip the electron spin and the nuclear triplet state, for example, with a transition 0 n j i $ þ1 n j iin a delay window, giving an effective interaction H¼Zs z A jj À 0 n j i 0 n h jþ À1 n j i À 1 n h j ð Þ after the delay window for a time t. The join evolution up to single qubit operations reads U¼ exp À iZs z A jj t þ 1 n j i þ1 n h jÀ 0 n j i 0 n h j ð Þ Â Ã and the corresponding population signal P¼1=2 þ cos 2ZA jj t À Á þ 1 Â Ã =4.
Data availability. The data files used to prepare the figures shown in the manuscript are available from the first corresponding author upon request.