The negatively charged NV center in diamond provides convenient spin-state optical initialization and readout1, long spin coherence times2 and controllable proximity near the diamond surface3, all in a robust solid under ambient conditions. It has been successfully applied to sensitive nanoscale measurements of magnetic fields4,5,6,7,8 at the level of a single electron spin9 or a small ensemble of nuclear spins10,11. These measurements typically employ periodic modulation of the target magnetic field in synchronization with control of the sensor NV spin4. However, such modulation is not possible when studying fluctuating magnetic fields found in many biological and physical systems. A method for detecting fluctuating fields that monitors the changes in coherence of the NV spin has been theoretically proposed12,13,14, numerically simulated15 and experimentally implemented to study the surrounding spin bath in the same piece of the diamond16,17,18,19. In particular, efforts to study external spins so far have focused on detecting diffusing spins in solution20. Here we image fluctuating magnetic fields from spin ensembles on a diamond surface by monitoring changes in the coherence of a separate scanning NV spin. Taking advantage of the scanning capability, we control the distance between the NV magnetometer and the sample, from which we obtain the spatial and temporal properties of the sample fluctuating fields.

The fluctuating magnetic fields originating from electron surface states are thought to strongly reduce the coherence of near-surface quantum systems. There is broad interest in characterizing such surface states as they play a key role in the demanding challenge of placing a quantum system close to a surface without compromising its coherence. This is regarded as one of the most important technical problems in a range of systems, including superconducting qubits21, donor spins in silicon22 and NV centers in diamond3,23,24. For example, to achieve high sensitivity in magnetic sensing using NV centers, it is desirable to engineer NV spins within a few nanometers to the surface25. However, very shallow NV spins have coherence times of only a few microseconds3, much shorter than those deeply embedded in the bulk2 due to electron spin ensembles on the diamond surface23,24. To further understand the issue of surface-induced decoherence for NV spins, we image the fluctuating magnetic fields from a nearby diamond surface and obtain the density and fluctuation spectrum of the electron spin ensembles.

We perform decoherence imaging at room temperature using a home-built scanning system that combines a confocal and an atomic force microscope (AFM) as described in ref. 26. The sensor (fabrication details discussed in ref. 27) is a single NV center artificially created through ion implantation residing few tens of nanometers from the end of a diamond scanning nanopillar 200 nm in diameter (Fig. 1a). The NV spin state is optically initialized and read out via spin-dependent fluorescence1 and controlled by on-resonant microwave (MW) magnetic fields. The sample we study is a separate piece of single crystalline diamond, on which we pattern mesas that are 50 nm in height and 200 nm in diameter and leave the surface oxygen-terminated after the fabrication process (detailed in sample preparation section of the methods).

Figure 1
figure 1

Detecting surface electron spin ensembles using a scanning magnetometer composed of a single nitrogen-vacancy (NV) spin.

(a): Schematic of the experiment. The NV spin resides in a nanopillar fabricated on a diamond scanning platform, with distance d from the sample surface. The angle between the normal direction of the surface and the quantization axis of the NV spin θ is imposed by crystallographic directions. The NV spin is optically initialized and read out from above. A nearby antenna is used to apply microwave pulses to manipulate the NV spin state coherently. The diamond sample contains a mesa that is 200 nm in diameter and 50 nm in height, with paramagnetic impurities on the surface. The NV spin is decohered by both the surface spins on the nanopillar and on the sample. (b): Hahn-echo experimental protocol (with evolution time t = 2τ). (c): Measurements of the NV spin state (ms = 0) in the scanning nanopillar after application of the experimental protocol in b, showing strong reduction of NV spin coherence when the nanopillar is in contact with the sample compared with it retracted 4 μm from the surface of the sample27. The blue solid line shows the stretched exponential fit with Gaussian shaped peaks for the collapses and revivals from nearby 13C nuclear spins. The blue dotted dash line and the green solid line show the fits to the spin bath model as described in the text.


Prior to imaging the fluctuating magnetic fields from electron spin ensembles on the diamond surface, we obtain the “bare” coherence time T2 of the scanning NV spin by running a Hahn-echo sequence with the scanning tip fully retracted from (and thus unaffected by) the sample (Fig. 1c). We observe a decay of the NV spin coherence with evolution time t, in addition to coherence oscillations induced by coherent coupling to nearby 13C nuclear spins28. We fit the curve with a stretched exponential envelope multiplied by a periodic Gaussian function , where C(t) is the coherence of the NV spin, the revival period is determined by the 13C nuclear Larmor frequency in the applied DC magnetic field and τdev is the revival peak width. From the fit we extract p = 1.6 ± 0.1, T2 = 78 ± 2 μs and τdev = 8.0 ± 0.4 μs. In contrast, T2 is strongly reduced to roughly 15 μs when we bring the nanopillar into contact with the sample. This reduction of T2 occurs when the nanopillar-to-sample vertical separation is smaller than 15 nm, suggesting that the increased decoherence emerges from the fluctuating fields on the sample surface, which is strongly suppressed with increasing tip-sample distance.

We find that we are able to prolong the NV spin coherence in contact with the sample by using dynamical decoupling (DD) sequences. As shown in Fig. 2, the measured T2 scales with the number of π pulses n as when XY4, XY8 and 64–π- pulse XY8 sequences29,30,31 are applied. (We use the same fitting function as described above to extract the value of T2, which is discussed in more details in the supplementary information.) This scaling suggests that the additional decoherence source has slower dynamics than the bare T2, consistent with it originating from a surface spin bath dipolar coupled32 to the scanning NV center.

Figure 2
figure 2

Measured and modeled coherence of the NV spin under dynamical decoupling (DD) sequences when the scanning nanopillar is in contact with the sample.

(a): Optical and MW pulses used in DD measurements with total evolution time t = 2, where n is the number of π-pulses in the Hahn-echo and XY sequences. (b–e): Measurements of the NV spin state as a function of t running DD sequences as labeled. The solid lines show the calculated coherence using the model and parameters described in the main text. In the calculation we account for revivals induced by 13C nuclear spins by the Gaussian function and parameters as applied in Fig. 1c. (f): Coherence time T2 determined from measurements as a function of n. The solid line shows the power-law fit .

To further study NV spin decoherence induced by the surface spins, we scan the AFM tip in contact with the sample across a mesa 50 nm in height and 200 nm in diameter. The mesa is designed to induce changes in the NV-spin-sample distance when the AFM is running in contact mode. As the scanning nanopillar follows the topography and climbs onto the mesa, the NV spin, which is roughly centered on the nanopillar axis, is lifted to the height of the mesa and thus suspended 50 nm above the surface off the mesa (illustrated in Fig. 3a). The mesa topology thereby provides a controlled way to vary the distance between the NV center and the surface electron spins for a detailed distance-dependent study of the surface-induced decoherence.

Figure 3
figure 3

NV spin decoherence images indicating effect of surface paramagnetic impurities.

(a): Two-dimensional decoherence image as the nanopillar scans over the sample mesa while running the Hahn-echo sequence with t = 40 μs averaging 2.1 s per pixel. The measured coherence diminishes when the NV spin is in close proximity to the sample surface, giving the dark inner circle and the dark outer region in the image. Also shown are sketches illustrating the relative position of the NV spin to the sample at different regions as marked in the image. (b): One-dimensional scan along the dashed line in a averaging 40 s per pixel while running the Hahn-echo sequence with t = 40 μs. The scanning nanopillar is in contact with the sample mesa for the entire scan. The NV spin coherence is high when the NV center is suspended above the surface and has a sharp transition to zero (P(ms = 0) = 0.5) when it reaches the mesa. The solid line is the fit described in the main text, from which we obtain d = 29.7 ± 5.8 nm and τc = 2.5 ± 1.0 μs. In the fit, the NV spin is set to align with the sample mesa edges at x = 120 nm and x = 320 nm.

Fig. 3a shows a two-dimensional image of P(ms = 0), the probability of the NV spin being in ms = 0 after a Hahn-echo evolution of t = 40 μs, where each pixel is averaged for 2.1 s through multiple scans. We observe a halo structure in the variation of the NV spin decoherence with NV-spin-sample distance. The dark background (marked as region 1 in Fig. 3a) and the dark central circle (region 3) correspond to strong decoherence when the NV-spin-sample distance is minimized; the bright ring (region 2) corresponds to strong reduction of decoherence when the NV is suspended on the ridge, i.e., lifted about 50 nm above from the sample surface. We observe spatially homogenous decoherence, within our detection sensitivity, in regions 1 and 3, indicating that the surface spins have uniform density to within the imaging sensitivity of our experiment.

To study the distance dependence of NV spin decoherence in more detail, we record a line scan cutting through the middle of the field of view in Fig. 3a, with a signal acquisition time of 40 s per pixel. As shown in Fig. 3b, we obtain a sharp onset of decoherence as the tip scans across the sample mesa: P(ms = 0) drops to 0.5 (indicating lost coherence) with a transition width of 35 nm (90% change).


Spectral properties of the surface electron spins can be extracted from such NV-spin decoherence images. The coherence of the NV spin is lost over time due to the magnetic environment following the general expression33

where S(ω) is the spectral function of the fluctuating magnetic fields and Ft(ω) is a filter function corresponding to the resonant MW pulse sequences applied on the NV spin, with Ft(ω) = 8 sin4(ωt/4) for a Hahn-echo sequence34.

In the present experiment, NV spin decoherence arises primarily from two surface electron spin baths: on the scanning nanopillar and on the sample. We model both spin baths as a fixed density of randomly oriented electron spins with uncorrelated flip-flops. In this case, the spectrum of each spin bath can be characterized by a Lorentzian with two parameters33,34

where τC is the correlation time among spins in the bath and Δ is the average coupling strength of the spin bath to the NV center, which depends on the distance to the NV center as well as the spin density on the surface. The subscripts t and s refer to the nanopillar spin bath and sample spin bath respectively.

When the nanopillar is retracted away from the sample, the NV center is not affected by the sample spins. Thus we obtain the nanopillar spin bath parameters Δt and by fitting the out-of-contact spin-echo measurement using equations (1), (2) and S(ω) = St(ω). Fig. 1b shows the fit with resulting values: Δt = 0.059 ± 0.002 MHz and .

When the nanopillar approaches the sample surface, Δs increases and NV spin decoherence induced by spins on the sample surface becomes significant. To estimate Δs, we sum over the magnetic dipole coupling between and the NV center and individual electron spins on the sample surface:

where is the magnetic moment of the NV, θ ≈ 54.70 is the angle of the NV axis to the surface normal direction, is the Planck constant, γ = 2π × 28 GHz/T is the electron gyromagnetic ratio and ri is the displacement from the ith surface spin to the NV spin. We assume the surface spins have the same gyromagnetic ratio as the NV spin so that the magnetic moment of the surface spin mi = m0. For a flat infinite surface with uniform spin density σA, we obtain:

where d is the distance between the NV spin and the sample surface.

We fit the in-contact echo measurement in Fig. 1b using equations (1) and (2) with S(ω) = St(ω) + Ss(ω), Δt and as determined above and Δs and as fit parameters. We obtain Δs = 0.31 ± 0.04 MHz and (70% confidence intervals). We note that , suggesting higher spin density on the sample surface than on the tip surface. This is consistent with the additional cleaning and scraping of the nanopillar surface that we performed right before every measurement, which may remove any water or dust layer that accumulates over time in ambient conditions.

A precise determination of and d can be obtained by fitting the distance dependence of the measured NV spin decoherence, e.g., as illustrated for one line-cut in Fig. 3b. In the fit we numerically calculate the decoherence using equation (1)(3) as a function of the nanopillar position x over a 2 μm × 2 μm area and a grid size of (4 nm)2 with d and as fit parameters. In the calculation we account for the decoherence originating from the nanopillar spin bath as previously determined and for the sample spin bath we assume the same σA both on and off the mesa as inferred from the in-contact echo measurement. We obtain d = 29.7 ± 5.8 nm and (95% confidence intervals). We note that d agrees well with the value deduced from other measurements on the same device9. We obtain σA = 0.28 μB/nm2 from the above value of d and Δs. Both and σA are consistent with other measurements on diamond surface spins3,23,24.

As a further consistency check for our approach, we apply the model described above to calculate the NV spin decoherence for the tip in contact with the sample and the NV spin interrogated with DD sequences, using equation (1) and (2) and filter function Ft(ω) = 8 sin4(ωt/4n)sin2(ωt/2)/cos4(ωt/2n) for n-π-pulse XY sequences34. The resulting good agreement between the calculation and the data, as shown in Fig. 2 b–e, supports our conclusions about the properties of the diamond sample's surface electron spin bath, as extracted from the NV decoherence images.

The extended NV spin coherence under application of DD sequences suggests that decoherence magnetometery, as demonstrated here, is a complimentary technique to NV-based AC magnetometry4,5,6,7,8,9,10. Both techniques can be applied using the same NV-diamond magnetometer to study both controllable and randomly fluctuating fields. Moreover, the electron surface spins on the scanning nanopillar will not affect AC magnetometry as long as the NV spin coherence can be prolonged by DD sequences.

In the measurements presented and analyzed here, we detect about σA·πd2 ≈ 790 μB surface paramagnetic spins on the diamond sample, with SNR = 4.0 for 2.1 s integration time. The sensitivity can be greatly improved with shallower NV centers in the nanopillar as indicated by equation (4), where For example, at d = 15 nm we estimate a sensitivity of 50 μB with the same SNR. The spatial resolution can also be improved by reducing d. In future work, NV-diamond decoherence magnetometry and our high-resolution scanning imaging technique could be applied to studying the fluctuating magnetic fields from interesting nanoscale biological and physical systems such as ion channels in cell membranes14, quantum fluctuations in spin liquids35 and quantized spin-carrying surface states in topological insulators36,37. Decoherence magnetometry may also be implemented in other atomic-scale two-level systems such as phosphorous donors in Si38.


Artificial creation of NV centers

The NV centers were artificially created from a high-purity, single-crystalline diamond by nitrogen ion implantation at an energy of 6 keV and density of 3 × 1011 cm−2, followed by annealing at 800oC for 2 hours. This procedure yielded a shallow layer of NV centers with a density of about 20 NVs/μm2 and a depth of about 20 nm. A single NV center was then isolated in a scanning nanopillar by reactive ion etching with ebeam lithography defined masks as detailed in ref. 27.

Sample preparation

The sample we study is a (100)-oriented single-crystalline electronic-grade diamond. Isolated mesas 50 nm high and 200 nm in diameter were created by reactive ion etching with ebeam lithography defined masks. Before measurement the sample was cleaned in boiling acid mixture of 1:1:1 sulfuric, nitric and perchloric acid and then thoroughly rinsed in distilled water. This procedure removes residues from the fabrication and leaves an oxygen-terminated surface.