Abstract
We realize a twoqubit sensor designed for achieving highspectral resolution in quantum sensing experiments. Our sensor consists of an active “sensing qubit” and a longlived “memory qubit”, implemented by the electronic and the nitrogen15 nuclear spins of a nitrogenvacancy center in diamond, respectively. Using state storage times of up to 45 ms, we demonstrate spectroscopy of external ac signals with a line width of 19 Hz (∼2.9 ppm) and of carbon13 nuclear magnetic resonance signals with a line width of 190 Hz (∼74 ppm). This represents an up to 100fold improvement in spectral resolution compared to measurements without nuclear memory.
Introduction
Quantum sensors based on nitrogenvacancy (NV) centers in diamond show promise for a number of fascinating applications in condensed matter physics, materials science, and biology.^{1, 2} By embedding them in a variety of nanostructures, such as tips,^{3,4,5,6} nanocrystals,^{7} or surface layers,^{7, 8} local properties of samples can be investigated with high sensitivity and spatial resolution. In particular, diamond chips with nearsurface NV centers have enabled pioneering experiments in nanoscale detection of nuclear magnetic resonance (NMR), potentially enabling structural analysis of individual molecules with atomic resolution.^{9,10,11}
A key feature of many quantum sensing experiments is the ability to record timedependent signals and to reconstruct their frequency spectra. The canonical approach uses dynamical decoupling sequences, which are sensitive to frequencies commensurate with the pulse spacing while efficiently rejecting most other frequencies.^{12,13,14,15,16} The spectral resolution of dynamical decoupling spectroscopy, however, is Fourierlimited by decoherence to ~(πT _{2})^{−1} ∼ 10–100 kHz for shallow NV centers,^{17} where T _{2} is the electronic decoherence time. It has recently been recognized that by correlating two consecutive decoupling sequences, separated by a variable waiting time t, the spectral resolution can be extended to the inverse state life time T _{1}, which can be 10–100× longer than T _{2} (refs. 18, 19). Correlation spectroscopy has been applied to both generic ac magnetic fields and to nuclear spin detection, and spectral resolutions of a few 100 Hz have been demonstrated.^{20,21,22}
Despite these impressive advances, there is a strong motivation to further extend the spectral resolution. For example, many proposed nanoscale NMR experiments^{9,10,11} require discrimination of fine spectral features, often in the fewHz range. In addition, atomicscale mapping of nuclear spin positions strongly relies on precise measurements of NMR frequencies and hyperfine coupling constants.^{22} Therefore, methods to acquire frequency spectra with even higher spectral resolution are highly desirable.
In this study, we implement a twoqubit sensor designed to further refine the spectral resolution by a factor of 10–100×. Our twoqubit sensor consists of an active sensing qubit and an auxiliary memory qubit, formed by the electronic spin and the ^{15}N nuclear spin of the NV center in diamond. By intermittently storing the state information in the nuclear—rather than electronic—spin qubit, we extend the maximum waiting time t from T _{1} ~ 1 ms to the nuclear T _{1,n} > 50 ms, with a corresponding gain in spectral resolution. In addition, we use the nuclear memory to enhance sensor readout efficiency through repeated readout,^{23, 24} which would otherwise result in untenably long acquisition times. The presented twoqubit system is particularly useful because it is intrinsic to the NV center, with no need for additional sensor engineering.
The advantages of one or more “auxiliary” qubits have been recognized in several different contexts, including the quantum logic clock for enhanced atomic clock performance^{25,26,27} and resettable auxiliary qubit(s) for emulating the environment in quantum simulation.^{28, 29} Multiqubit probes may also assist the detection of crosscorrelations in environmental noise^{30} or the study of nonclassical dynamics.^{31} In recent experiments with spin qubits in diamond, auxiliary nuclear spins have been used to increase the effective coherence time of an electronic sensor spin by quantum error correction,^{32} quantum feedback,^{33, 34} or by exploiting doublequantum coherence.^{35} Moreover, ancillary nuclei have been used to enhance the readout efficiency.^{23, 24} In our study we utilize the auxiliary nuclear spin as a longlived memory for the electron qubit’s state.
Results
Implementation of the nuclear spin memory
Our twoqubit sensor exploits the fourlevel system formed by the m _{ S } ∈ {0, −1} subspace of the S = 1 electronic spin and the two m _{ I } ∈ {−1/2, +1/2} states of the I = 1/2 nuclear spin. This pair has four allowed spinflip transitions (Fig. 1). Due to the hyperfine interaction (a _{} = 2π × 3.05 MHz), all four transitions are spectrally resolved and can be addressed individually using frequencyselective microwave (MW) or rf pulses. Driving a selective \(R_X^\pi\) rotation on either of theses transitions leads to a conditional inversion, depending on the state of the other spin. This realizes controlledNOT gates on the electronic and nuclear spins, respectively, which we denote by cNOT_{e} and cNOT_{n}. The specific transitions used in our study are indicated in Fig. 1b.
To implement the “store” and “retrieve” operations, we combine a cNOT_{e} gate and cNOT_{n} gate (dashed boxes in Fig. 2). Assuming the electronic spin is initially in the \(\left {{0_{\rm{e}}}} \right\rangle\) state and the nuclear spin in an idle (unspecified) state \(\left {{\alpha _{\rm{n}}}} \right\rangle\), the effect of the two gates is \(\left {{0_{\rm{e}}}} \right\rangle \left {{\alpha _{\rm{n}}}} \right\rangle \mathop{\longrightarrow}\limits^{{{\rm{c}}  {\rm{NO}}{{\rm{T}}_{\rm{e}}}}}{\left\langle {0{\rm{}}\alpha } \right\rangle _{\rm{n}}}\left {{1_{\rm{e}}}} \right\rangle \left {{0_{\rm{n}}}} \right\rangle\) + \({\left\langle {1{\rm{}}\alpha } \right\rangle _{\rm{n}}}\left {{0_{\rm{e}}}} \right\rangle \left {{1_{\rm{n}}}} \right\rangle \mathop{\longrightarrow}\limits^{{{\rm{c}}  {\rm{NO}}{{\rm{T}}_{\rm{n}}}}}{\left\langle {0{\rm{}}\alpha } \right\rangle _{\rm{n}}}\left {{1_{\rm{e}}}} \right\rangle \left {{0_{\rm{n}}}} \right\rangle\) + \({\left\langle {1{\rm{}}\alpha } \right\rangle _{\rm{n}}}\left {{0_{\rm{e}}}} \right\rangle \left {{0_{\rm{n}}}} \right\rangle = \left {\alpha _{\rm{e}}^\prime } \right\rangle \left {{0_{\rm{n}}}} \right\rangle\), where \(\left {{0_{\rm{e}}}} \right\rangle \left {{\alpha _{\rm{n}}}} \right\rangle\) etc. denote product states. Likewise, if the electronic spin is initially in the \(\left {{1_{\rm{e}}}} \right\rangle\) state, \(\left {{1_{\rm{e}}}} \right\rangle \left {{\alpha _{\rm{n}}}} \right\rangle \mathop{\longrightarrow}\limits^{{{\rm{c}}  {\rm{NO}}{{\rm{T}}_{\rm{n}}}}\ {{\rm{c}}  {\rm{NO}}{{\rm{T}}_{\rm{e}}}}}\left {\alpha _{\rm{e}}^\prime } \right\rangle \left {{1_{\rm{n}}}} \right\rangle\). As a result, the state of the electronic spin is stored in the state of the nuclear spin. To retrieve the state, the order of the cNOT gates simply needs to be reversed (Fig. 2). Alternatively, the state can also be retrieved by initializing the electronic spin followed by a single cNOT_{e} gate (dotted box in Fig. 2). Advantages of the singlegate retrieval are that it is fast (because no cNOT_{n} is involved) and that it can be repeated many times.^{23, 24, 36} A disadvantage is a reduced contrast due to NV charge state conversion^{37} (Supplementary Fig. S1). In the implementation of the quantum spectrum analyzer discussed below, we therefore use a twogate retrieval during the signal correlation period t and a singlegate retrieval for improving readout efficiency.
We assess the performance of the nuclear spin memory under a set of store, retrieve, and hold operations. To characterize the efficiency of the store and retrieve operations, we perform selective Rabi rotations on all four spinflip transitions, and find efficiencies >90% for cNOT_{e} and 60–80% for cNOT_{n}, respectively (Supplementary Fig. S1). The memory access time is between 20 and 50 μs for the double cNOT implementation, limited by the duration of the rf pulse, and ~2 μs for the single cNOT implementation. We further test the complete memory by performing an electronic Rabi oscillation, storing the result in the nuclear memory, clearing the electronic qubit by an initialization step, and retrieving the Rabi signal (Supplementary Fig. S2). Lastly, we assess the memory hold time—given by the nuclear T _{1,n}—in the absence and presence of laser illumination, with typical values of T _{1,n} ≈ 52 ms (no laser) and T _{1,n} ≈ 1.2 ms (under periodic readout) at a bias field of 320 mT. This bias field supports n ~ 1000 nondestructive readouts of the memory (dotted box in Fig. 2) before the nuclear spin becomes repolarized^{36} (Supplementary Fig. S3).
Implementation of the quantum spectrum analyzer
We compose the full spectroscopy protocol from a correlation sequence^{19, 22} and several storage and retrieval operations (Fig. 2). In a first step, we initialize the electronic sensor spin into the \(\left {{0_{\rm{e}}}} \right\rangle\) state. An initial phase measurement is then performed using a multipulse sensing sequence approximately tuned to the frequency f _{ac} of the ac field (Fig. 2b). During the multipulse sequence, the ac signal \(V(t) = {V_0}\,{\rm{cos}}\left( {2\pi {f_{{\rm{ac}}}}t} \right)\) imprints a phase Φ_{1} ∝ V(t _{A}) on the electronic qubit, leaving it in a superposition \(\left {{\psi _{\rm{e}}}} \right\rangle\) of states \(\left {{0_{\rm{e}}}} \right\rangle\) and \(\left {{1_{\rm{e}}}} \right\rangle\) with a probability amplitude \({\left\langle {0{\rm{}}\psi } \right\rangle _{\rm{e}}} = {\textstyle{1 \over 2}}\left( {1 + {\rm{sin}}\,{\Phi _1}} \right)\). Next, we store \(\left {{\psi _{\rm{e}}}} \right\rangle\) in the nuclear memory, wait for a variable delay time t (which can be longer than the electronic T _{1} time), and read it back. A secondphase measurement is then used to acquire a further phase Φ_{2} ∝ V(t _{C}). In a last step, we read out the final state of the electronic qubit via storing it in the nuclear memory and performing n periodic readouts. By averaging the protocol over many repetitions, the probability p = 〈0ψ〉_{e}^{2} of finding the sensor in the initial state \(\left {{0_{\rm{e}}}} \right\rangle\) can be precisely estimated.
Because Φ_{1} and Φ_{2} depend on the relative phase of the ac signal V(t), the total phase acquired by the qubit oscillates with f _{ac}. As detailed in the Methods section, the resulting state probability p(t) then also oscillates with f _{ac},
where we assume that the ac signal is not synchronized with the acquisition. Equation (2) is for small signals where \({\rm{sin}}\,{\Phi _1} \approx {\Phi _1}\) and \({\rm{sin}}\,{\Phi _2} \approx {\Phi _2}\), resulting in an oscillation amplitude \({p_0} \approx 2\gamma _{\rm{e}}^2V_0^2t_{{\rm{meas}}}^{\rm{2}}{\rm{/}}{\pi ^2},\) where t _{meas} = t _{B} − t _{A} = t _{D} − t _{C} (Fig. 2). In order to obtain a frequency spectrum of V(t), we can therefore simply measure p(t) for a series of t values followed by a Fourier transform. Crucially, the spectral resolution is only limited by the duration t of the correlation measurement, which can now be as long as the nuclear memory time T _{1,n}. Since the nuclear memory time typically far exceeds both the electronic decoherence time T _{2} and relaxation time T _{1}, a much finer spectral resolution can be expected compared to dynamical decoupling or standard correlation spectroscopy.
Highresolution spectroscopy of ac signals
We demonstrate the performance of the memoryenhanced spectrometer for two experimental scenarios. In a first experiment, we expose the sensor to an external ac test signal with a nominal frequency of f _{ac} = 6.626070 MHz and an amplitude of V _{0} ≈ 90 μT. The test signal is produced on an auxiliary function generator not synchronized with the acquisition, and coupled into the same waveguide structure used for spin control. Two measurements are carried out: in a first acquisition (Fig. 3a) we perform a regular spectroscopy measurement without the nuclear memory. We can clearly observe an oscillation in the time trace due to the ac signal. The signal decays on a time scale of ~0.5 ms, limited by the electronic T _{1} of this NV center. In Fig. 3b we repeat the measurement, now making use of the nuclear memory. The oscillation persists beyond t = 45 ms, overcoming the limitation due to the electronic T _{1} by almost two orders of magnitude.
Fourier spectra of the two time signals (Fig. 3c) show that the peak width reduces from 1.3 kHz (200 ppm) without memory to 20 Hz (3.0 ppm) with memory. This corresponds to an improvement in spectral resolution by ~×65. Figure 3d shows a second example of nuclear memoryassisted spectroscopy, where two ac test signals separated by about 0.2 kHz are applied. Both peaks can be clearly distinguished, demonstrating that the method is effective in precisely resolving spectral features. A narrow line width of only 19 Hz (~2.9 ppm) is observed, and peak positions are defined with eight digits of precision. The absolute accuracy of the frequency measurement is governed by the internal clock of the MW pulse generator.
The spectral resolution in Fig. 3c, d is limited by the memory hold time given by the nuclear T _{1,n}, here ~52 ms. Since the nuclear relaxation is dominated by a flipflop process with the NV center’s electron spin and slows down for higher bias fields,^{36} there is scope for an additional improvement in spectral resolution at Tesla bias fields.^{38}
Highresolution ^{13}C NMR spectroscopy
We further apply the twoqubit sensor to detect NMR spectra from nearby ^{13}C nuclear spins that are naturally present at ~1% in the diamond chip. This experiment represents an important test case toward the detection of more complex NMR spectra, such as those from molecules deposited on the chip.^{17, 39, 40} The detection of NMR signals is considerably more involved compared to external ac signals, because the sensor can affect the ^{13}C nuclear spin precession during t via the hyperfine interaction. In addition, NMR spectroscopy is known to be very sensitive to drifts in the external bias field.
Figure 4 shows a set of four NMR spectra recorded from the same ^{13}C nuclear spin using the memoryassisted spectroscopy protocol. The four panels represent increasing refinements in spectrum acquisition. Figure 4a shows an initial ^{13}C spectrum that displays features over a wide frequency range of several kHz (~1000 ppm). We find these features to be linked to small changes in the bias field, probably caused by temperatureinduced drifts in the magnetization of the permanent magnet in our set up. By carefully tracking the electron spin resonance during the experiment and using postcorrection, these drifts can be eliminated (Fig. 4b). Further details are given in the Methods section and Supplementary Fig. S5.
The remaining line width of the ^{13}C resonance is ~220 Hz, which corresponds to a dephasing time of \(T_{{{2,}^{{\rm{13}}}}{\rm{C}}}^ * \approx 1{\rm{/}}\left( {\pi \times 220\,{\rm{Hz}}} \right) \approx 1.4\,{\kern 1pt} {\rm{ms}}\). Because the dephasing time is very similar to the relaxation time T _{1} ~ 1.4 ms of this NV center, the ^{13}C dephasing is most likely dominated by the hyperfine interaction with the electronic spin. Thus, even if our spectrometer is technically capable of achieving a ×10 better spectral resolution, this improvement does not carry over to the ^{13}C spectrum because of dephasing.
In an attempt to extend the ^{13}C dephasing time and further reduce the ^{13}C NMR line width, we have explored several decoupling protocols, neither of which turned out to be effective. A first protocol (Fig. 4b) includes a series of π pulses that are applied to the m _{ S } = 0 ↔ −1 transition during the free evolution time t. This protocol suppresses the hyperfine interaction with the electronic m _{ S } = −1 state. However, this protocol does not decouple the interaction with the m _{ S } = +1 state, and only a marginal improvement can be expected. Indeed, no significant change is observed in the ^{13}C line width without and with dynamical decoupling even when using many hundred decoupling pulses (Fig. 4c). A more effective approach would be to simultaneously decouple both the m _{ S } = 0 ↔ −1 and m _{ S } = 0 ↔ +1 transitions using doublefrequency irradiation,^{41} but this control is not currently supported by our hardware. Instead, we use a series of laser pulses to periodically repolarize the NV center into the m _{ S } = 0 state (Fig. 4d) or the m _{ S } = −1 state (data not shown). No narrowing of the ^{13}C resonance is observed with either protocol. There are two possible explanations for the observations made in Fig. 4b–d: Either the decoupling is ineffective due to the relatively strong hyperfine coupling, and the \(T_{{{2,}^{{13}}}{\rm{C}}}^ *\) dephasing is still dominated by the hyperfine interaction. This hypothesis is supported by a numerical simulation (Supplementary Fig. S6). Alternatively, the measured \(T_{{{2,}^{{\rm{13}}}}{\rm{C}}}^ *\) dephasing time represents the intrinsic ^{13}C decoherence time due to nuclear dipole–dipole interactions within the ^{13}C bath. This scenario is less likely because the expected decoherence time is of order ~10 ms (Supplementary Fig. S7).
Discussion
In summary, we implemented a twoqubit quantum sensor based on the electronic and ^{15}N nuclear spins in diamond. By operating the nuclear spin as a longlived memory qubit, we achieve exceptionally highspectral resolution, with a best effort of 19 Hz or 2.9 ppm. The ^{15}N spin forms a particularly suitable memory qubit because the nucleus is a natural part of the NV center, and because long storage times are possible combined with rapid memory access. Looking forward, we note that the implemented spectroscopy protocol entails several interesting opportunities for further refinements, especially toward application in nanoscale NMR and for realizing larger quantum registers. Active manipulation of both nuclei during the waiting time could, for example, be used to individually address a large number of weakly coupled ^{13}C spins.^{42} Advanced NMR concepts, such as multidimensional spectroscopy^{22, 43} or spectral editing could be used to study interactions between nuclei.^{44} These concepts will likely require compressed sensing methods^{11, 45} and efficient NV readout^{23, 46} to accelerate data collection. Implementation of these techniques will be the key for performing structural analysis of single molecules, especially if larger biomolecules are to be targeted.
Note added
Recently, we became aware of related work describing quantum sensing with a nuclear memory qubit.^{35, 38, 42, 47} The work of refs. 35, 47 use the nuclear memory in a coherent state. This approach has the advantage of conserving the full phase information, but is limited by the T _{2,n} time (rather than the T _{1,n}) of a ^{15}N nuclear memory and requires NMR pulses on the target ^{13}C nuclei. By contrast, our approach is limited by T _{1,n} and does not require ^{13}C NMR pulses. The work of ref. 38 describes both T _{2,n} and T _{1,n} storage but also requires NMR pulses. The works of ref. 42 and also ref. 19 describe a nuclear memory that is similar to our implementation, but use different schemes for the state SWAP and target ^{13}C manipulation during coherent evolution, and no memoryassisted electron spin readout.
Methods
Diamond chips
Two different singlecrystal diamond chips were used in the study. Sample A was an electronicgrade, natural abundance (1.1% ^{13}C) plate with a shallow NV layer created by 5 keV ^{15}N^{+} ion implantation and an 800 °C annealing step. The average NV center depth was 8 nm according to SRIM simulations. Sample B was an electronicgrade, isotopically pure (<0.01% ^{13}C) plate with a similar NV layer as sample A. Except for providing proximal ^{13}C nuclei for the NMR experiments, the higher ^{13}C concentration of sample A compared to sample B played no role in any of the measurements. In particular, the ^{13}C concentration had no influence on the electronic and ^{14}N spin relaxation times relevant for our study. To further reduce the NVcentertosurface distance, sample B was subjected to an oxygen etch at ~550 °C (ref. 17). The average NV center depth was 3−5 nm. Both samples were baked at 465 °C in air before experiments to clean the surface.
Measurement apparatus
The measurement apparatus consists of a homebuilt confocal microscope with 532 nm laser excitation and 630–800 nm fluorescence detection using a single photon counter module. The confocal microscope is equipped with a patterned, 50−100 μmwide coplanar waveguide transmission line for producing MW and radio frequency magnetic control pulses at the sample location. Timing of experiments is controlled by the digital marker channels of a Tektronix AWG 5002 arbitrary waveform generator. Photons are analyzed by time tagging arrival times and correlating them with the timing of the pulse sequence. In addition, the microscope is equipped with a permanent NdFeB magnet to produce bias fields of up to ~400 mT. The direction of the vector magnetic field is aligned via a mechanical xyz stage.
To control the electronic and nuclear spin transitions of the NV center, separate MW and radio frequency channels are used, respectively. MW pulses are generated on the arbitrary waveform generator at a 100 MHz carrier and upconverted to the desired GHz frequency using a local oscillator (Quicksyn FSW0020) and a singlesideband mixer (Marki MW IQ1545). For the radio frequency pulses, a National Instruments NI PCI 5421 arbitrary waveform generator is used, which directly synthesizes the desired pulses without a mixing step. The two signals are amplified separately and then combined using a biasT (Meca) before being connected to the MW transmission line. The output of the transmission line is terminated in a 50 Ω load. With this arrangement, typical Rabi frequencies of 20−30 MHz for the electron spin and 10−30 kHz for the ^{15}N nuclear spin could be achieved. We observed that the Rabi frequency of the ^{15}N nuclear spin was significantly enhanced by the hyperfine interaction.^{48}
Store and retrieve operations
Storage and retrieval operations are implemented by selective pulses on one of the two resolved hyperfine lines. Squareshaped pulses are used for both electronic and nuclear spin manipulations. Selective MW pulses have a typical duration of 700 ns corresponding to a Rabi frequency of ~0.7 MHz. Selective rf pulses have a duration between 20 and 50 μs depending on the set up and NV center. A delay of 1−2 μs is added after every radio frequency pulse due to amplifier ringing. Rabi oscillations used to calibrate the selective pulses are provided in Supplementary Fig. S1.
Correlation spectroscopy
Correlation spectroscopy^{18,19,20,21,22} correlates the outcomes of two subsequent sensing periods to obtain highresolution spectra of timedependent signals. In the present experiment, the method is implemented by subdividing a multipulse sequence into two equal periods of duration t _{meas} = t _{B} − t _{A} = t _{D} − t _{C} that are separated by an incremented free evolution period t (Fig. 2). Since the multipulse sequence is phase sensitive, constructive or destructive phase buildup occurs between the two sequences depending on whether the free evolution period t is a half multiple or full multiple of the ac signal period T _{ac} = 1/f _{ac}. The final transition probability p oscillates with t as
where Φ_{1} and Φ_{2} are the phases accumulated by the electronic spin during the first and second measurement period, respectively. The approximation is for weak signals where \({\rm{sin}}\left( {{\Phi _1}} \right) \approx {\Phi _1}\) and \({\rm{sin}}\left( {{\Phi _2}} \right) \approx {\Phi _2}\). For strong signals, higher harmonics appear in the correlation spectrum and the amplitude of the correlation signal does not directly reflect the amplitude of the ac signal any longer.^{49}
For an ac signal \(V(t) = {V_0}\,{\rm{cos}}\left( {2\pi {f_{{\rm{ac}}}}t + \phi } \right)\) whose period T _{ac} = 2τ is commensurate with the pulse spacing τ of the multipulse sequence, the phase Φ_{1} is given by
where y(t′) = (−1)^{[t′/τ]} is the modulation function^{50, 51} of the sequence and N = t _{meas}/τ is the number of pulses. This integral evaluates to
$${\Phi _1} = \frac{{2{\gamma _{\rm{e}}}N\tau }}{\pi }{V_0}\,{\rm{cos}}\left( {2\pi {f_{{\rm{ac}}}}{t_{\rm{A}}} + \phi } \right) = \frac{{2{\gamma _{\rm{e}}}{t_{{\rm{meas}}}}}}{\pi }V\left( {{t_{\rm{A}}}} \right).$$Likewise, the phase Φ_{2} evaluates to
In our experiments, the ac signal is not synchronized with the detection sequence, such that the phase ϕ is arbitrary. Therefore, the observed correlation signal p(t) is an average over ϕ = 0...2π. For the small signal approximation this leads to
where we have set t _{A} = 0 in the third step and used that \({\rm{cos}}\left( {2\pi {f_{{\rm{ac}}}}{t_{\rm{C}}}} \right) = {\rm{cos}}\left( {2\pi {f_{{\rm{ac}}}}\left[ {{t_{\rm{A}}} + {t_{{\rm{meas}}}} + t} \right]} \right) = {\rm{cos}}\left( {2\pi {f_{{\rm{ac}}}}t} \right)\). Here, \({p_0} = 2\gamma _{\rm{e}}^2V_0^2t_{{\rm{meas}}}^2{\rm{/}}{\pi ^2}\) is the amplitude of the correlation signal.
Tracking and postcorrection of spectral drift
When performing NMR experiments, we noticed considerable drifts, often several kHz, in the ^{13}C nuclear transition frequency. Such frequency drifts are a wellknown problem in highresolution NMR spectroscopy, as they lead to unwanted line broadening. Frequency drifts are typically caused by drifts in the static magnetic field; in our case, this is likely due to a temperaturerelated change of the magnetization of the permanent magnet.
We have implemented a tracking and postcorrection scheme to eliminate the frequency drifts. To follow the drift in magnetic field, we track the electron paramagnetic resonance (EPR) resonance of the NV center during longterm measurements as shown in Supplementary Fig. S2. The difference between measured EPR frequency ω _{e} and reference EPR frequency ω _{e,0} corresponds to a drift in field by ΔB = (ω _{e} − ω _{e,0})/γ _{e} where γ _{e} = 2π × 28 GHz/T is the electron gyromagnetic ratio. Measured data sets p(t) are separately saved in intervals of 5−20 min with a specific ΔB tag for each data set.
To correct for frequency drift, we multiply each data set p(t) by e ^{−iΔωt}, where Δω = γ _{n}ΔB is the expected shift in the ^{13}C nuclear resonance due to the drift in magnetic field. γ _{n} = 2π × 10.7 MHz/T is the ^{13}C gyromagnetic ratio and T is the maximum t time. The corrected data sets p(t) are then Fourier transformed and averaged. Alternatively, the averaged NMR spectrum can also be obtained by performing a Fourier transform of the uncorrected p(t) and shifting the frequency scale for each spectrum before averaging.
Data availability
The data sets generated during and/or analyzed during the current study are available from the corresponding author on reasonable request.
Additional information
Publisher’s note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
References
 1.
Schirhagl, R., Chang, K., Loretz, M. & Degen, C. L. Nitrogenvacancy centers in diamond: nanoscale sensors for physics and biology. Annu. Rev. Phys. Chem. 65, 83 (2014).
 2.
Rondin, L. et al. Magnetometry with nitrogenvacancy defects in diamond. Rep. Prog. Phys. 77, 056503 (2014).
 3.
Degen, C. L. Scanning magnetic field microscope with a diamond singlespin sensor. Appl. Phys. Lett. 92, 243111 (2008).
 4.
Balasubramanian, G. et al. Nanoscale imaging magnetometry with diamond spins under ambient conditions. Nature 455, 648 (2008).
 5.
Rondin, L. et al. Nanoscale magnetic field mapping with a single spin scanning probe magnetometer. Appl. Phys. Lett. 100, 153118 (2012).
 6.
Maletinsky, P. et al. A robust scanning diamond sensor for nanoscale imaging with single nitrogenvacancy centres. Nat. Nanotechnol. 7, 320–324 (2012).
 7.
Dussaux, A. et al. Local dynamics of topological magnetic defects in the itinerant helimagnet fege. Nat. Commun. 7, 12430 (2016).
 8.
Kolkowitz, S. et al. Probing johnson noise and ballistic transport in normal metals with a singlespin qubit. Science 347, 1129 (2015).
 9.
Ajoy, A., Bissbort, U., Lukin, M. D., Walsworth, R. L. & Cappellaro, P. Atomicscale nuclear spin imaging using quantumassisted sensors in diamond. Phys. Rev. X 5, 011001 (2015).
 10.
Lazariev, A. & Balasubramanian, G. A nitrogenvacancy spin based molecular structure microscope using multiplexed projection reconstruction. Sci. Rep. 5, 14130 (2015).
 11.
Kost, M., Cai, J. & Plenio, M. B. Resolving single molecule structures with nitrogenvacancy centers in diamond. Sci. Rep. 5, 11007 (2015).
 12.
Cywinski, L., Lutchyn, R. M., Nave, C. P. & Sarma, S. D. How to enhance dephasing time in superconducting qubits. Phys. Rev. B 77, 174509 (2008).
 13.
Alvarez, G. A. & Suter, D. Measuring the spectrum of colored noise by dynamical decoupling. Phys. Rev. Lett. 107, 230501 (2011).
 14.
Lange, G. D., Riste, D., Dobrovitski, V. V. & Hanson, R. Singlespin magnetometry with multipulse sensing sequences. Phys. Rev. Lett. 106, 080802 (2011).
 15.
Kotler, S., Akerman, N., Glickman, Y., Keselman, A. & Ozeri, R. Singleion quantum lockin amplifier. Nature 473, 61–65 (2011).
 16.
Loretz, M. et al. Spurious harmonic response of multipulse quantum sensing sequences. Phys. Rev. X 5, 21009 (2015).
 17.
Loretz, M., Pezzagna, S., Meijer, J. & Degen, C. L. Nanoscale nuclear magnetic resonance with a 1.9nmdeep nitrogenvacancy sensor. Appl. Phys. Lett. 104, 33102 (2014).
 18.
Laraoui, A., Hodges, J. S., Ryan, C. A. & Meriles, C. A. Diamond nitrogenvacancy center as a probe of random fluctuations in a nuclear spin ensemble. Phys. Rev. B 84, 104301 (2011).
 19.
Laraoui, A. et al. Highresolution correlation spectroscopy of c13 spins near a nitrogenvacancy centre in diamond. Nat. Commun. 4, 1651 (2013).
 20.
Staudacher, T. et al. Probing molecular dynamics at the nanoscale via an individual paramagnetic centre. Nat. Commun. 6, 8527 (2015).
 21.
Kong, X., Stark, A., Du, J., McGuinness, L. P. & Jelezko, F. Towards chemical structure resolution with nanoscale nuclear magnetic resonance spectroscopy. Phys. Rev. Appl. 4, 024004 (2015).
 22.
Boss, J. M. et al. One and twodimensional nuclear magnetic resonance spectroscopy with a diamond quantum sensor. Phys. Rev. Lett. 116, 197601 (2016).
 23.
Jiang, L. et al. Repetitive readout of a single electronic spin via quantum logic with nuclear spin ancillae. Science 326, 267–272 (2009).
 24.
Lovchinsky, I. et al. Nuclear magnetic resonance detection and spectroscopy of single proteins using quantum logic. Science 351, 836 (2016).
 25.
Schmidt, P. O. et al. Spectroscopy using quantum logic. Science 309, 749–752 (2005).
 26.
Hume, D. B., Rosenband, T. & Wineland, D. J. Highfidelity adaptive qubit detection through repetitive quantum nondemolition measurements. Phys. Rev. Lett. 99, 120502 (2007).
 27.
Rosenband, T. et al. Frequency ratio of al+ and hg+ singleion optical clocks; metrology at the 17th decimal place. Science 319, 1808–1812 (2008).
 28.
Lloyd, S. & Viola, L. Engineering quantum dynamics. Phys. Rev. A 65, 010101 (2001).
 29.
Barreiro, J. T. et al. An opensystem quantum simulator with trapped ions. Nature 470, 486–491 (2011).
 30.
Szankowski, P., Trippenbach, M. & Cywinski, L. Spectroscopy of cross correlations of environmental noises with two qubits. Phys. Rev. A 94, 012109 (2016).
 31.
PazSilva, G. A., Norris, L. M. & Viola, L. Multiqubit spectroscopy of gaussian quantum noise. Phys. Rev. A 95, 022121 (2017).
 32.
Unden, T. et al. Quantum metrology enhanced by repetitive quantum error correction. Phys. Rev. Lett. 116, 230502 (2016).
 33.
Ticozzi, F. & Viola, L. Singlebit feedback and quantumdynamical decoupling. Phys. Rev. A 74, 052328 (2006).
 34.
Hirose, M. & Cappellaro, P. Coherent feedback control of a single qubit in diamond. Nature 532, 77 (2016).
 35.
Zaiser, S. et al. Enhancing quantum sensing sensitivity by a quantum memory. Nat. Commun. 7, 12279 (2016).
 36.
Neumann, P. et al. Singleshot readout of a single nuclear spin. Science 329, 542–544 (2010).
 37.
Aslam, N., Waldherr, G., Neumann, P., Jelezko, F. & Wrachtrup, J. Photoinduced ionization dynamics of the nitrogen vacancy defect in diamond investigated by singleshot charge state detection. New. J. Phys. 15, 013064 (2013).
 38.
Pfender, M. et al. Nonvolatile quantum memory enables sensor unlimited nanoscale spectroscopy of finite quantum systems. arXiv:1610.05675. Available at: https://arxiv.org/abs/1610.05675 (2016).
 39.
Mamin, H. J. et al. Nanoscale nuclear magnetic resonance with a nitrogenvacancy spin sensor. Science 339, 557–560 (2013).
 40.
Staudacher, T. et al. Nuclear magnetic resonance spectroscopy on a (5nanometer)(3) sample. Science 339, 561–563 (2013).
 41.
Mamin, H. et al. Multipulse doublequantum magnetometry with nearsurface nitrogenvacancy centers. Phys. Rev. Lett. 113, 030803 (2014).
 42.
Wang, Z. Y., Casanova, J. & Plenio, M. B. Delayed entanglement echo for individual control of a large number of nuclear spins. Nat. Commun. 8, 14660 (2017).
 43.
Ma, W. & Liu, R. Proposal for quantum sensing based on twodimensional dynamical decoupling: NMR correlation spectroscopy of single molecules. Phys. Rev. Appl. 6, 054012 (2016).
 44.
Shi, F. et al. Sensing and atomicscale structure analysis of single nuclearspin clusters in diamond. Nat. Phys. 10, 21–25 (2014).
 45.
Holland, D. J., Bostock, M. J., Gladden, L. F. & Nietlispach, D. Fast multidimensional NMR spectroscopy using compressed sensing. Angew. Chem. Int. Ed. 50, 6548–6551 (2011).
 46.
Momenzadeh, S. A. et al. Nanoengineered diamond waveguide as a robust bright platform for nanomagnetometry using shallow nitrogen vacancy centers. Nano. Lett. 15, 165–169 (2015).
 47.
Matsuzaki, Y. et al. Hybrid quantum magneticfield sensor with an electron spin and a nuclear spin in diamond. Phys. Rev. A 94, 052330 (2016).
 48.
Chen, M., Hirose, M. & Cappellaro, P. Measurement of transverse hyperfine interaction by forbidden transitions. Phys. Rev. B 92, 020101 (2015).
 49.
Kotler, S., Akerman, N., Glickman, Y. & Ozeri, R. Nonlinear singlespin spectrum analyzer. Phys. Rev. Lett. 110, 110503 (2013).
 50.
Rosskopf, T. et al. Investigation of surface magnetic noise by shallow spins in diamond. Phys. Rev. Lett. 112, 147602 (2014).
 51.
Degen, C. L., Reinhard, F. & Cappellaro, P. Quantum sensing. Rev. Mod. Phys. 89, 035002 (2017).
 52.
Gullion, T., Baker, D. B. & Conradi, M. S. New, compensated carrpurcell sequences. J. Magn. Res 89, 479–484 (1990).
Acknowledgements
We thank Kristian Cujia, Jan Meijer, Sebastien Pezzagna, Nicole Raatz, and Lorenza Viola for insightful comments and for help with sample preparation. This work was supported by Swiss NSF Project Grant 200021_137520, the NCCR QSIT, and the DIADEMS programme 611143 of the European Commission.
Author information
Affiliations
Department of Physics, ETH Zurich, Otto Stern Weg 1, 8093, Zurich, Switzerland
 Tobias Rosskopf
 , Jonathan Zopes
 , Jens M. Boss
 & Christian L. Degen
Authors
Search for Tobias Rosskopf in:
Search for Jonathan Zopes in:
Search for Jens M. Boss in:
Search for Christian L. Degen in:
Contributions
C.L.D. conceived the project. T.R. set up the experiment, carried out the measurements, and performed the analysis with help from J.Z., J.M.B., and C.L.D. T.R., and C.L.D. wrote the manuscript. All authors commented on the paper.
Competing interests
The authors declare no competing financial interests.
Corresponding author
Correspondence to Christian L. Degen.
Electronic supplementary material
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Further reading

Robust quantum sensing with strongly interacting probe systems
npj Quantum Information (2018)

Quantum technologies with optically interfaced solidstate spins
Nature Photonics (2018)

Onesecond coherence for a single electron spin coupled to a multiqubit nuclearspin environment
Nature Communications (2018)

Highresolution magnetic resonance spectroscopy using a solidstate spin sensor
Nature (2018)

Probing condensed matter physics with magnetometry based on nitrogenvacancy centres in diamond
Nature Reviews Materials (2018)