Main

Magnetic field gradients allow spins in ensembles to be spatially distinguished, as fields locally modify the spins’ resonance frequencies. Spatially separated spins can therefore be addressed selectively, allowing for MRI, which has revolutionized medical and biological sciences by yielding few-micrometre resolution in nuclear-spin imaging9,10. Carrying out MRI on single spins with high spatial resolution is attractive both for determining structure on the molecular scale and for achieving individual-spin quantum control in ensemble systems. With conventional MRI techniques, however, it is difficult to improve the spatial resolution to the nanoscale owing to insufficient readout sensitivity and inadequate magnetic field gradients11. Recently, magnetic field gradients introduced using scanning probe techniques have enabled single-spin detection with few-nanometre resolution12,13; however, control and characterization of individual spins in nanoscale clusters has not been demonstrated thus far.

Here we carry out scanning-field-gradient MRI on proximal electron spins in nanoscale ensembles and demonstrate a spatial resolution <10 nm under ambient conditions. We show that scanning-field-gradient microscopy not only allows for imaging but further provides quantum spin control for characterization and manipulation of individual spins on the nanoscale. By pushing the spatial resolution to few-nanometre length scales, our results illustrate that quantum control of individual spins can be maintained in dense ensembles of spins (with spins separated by a few tens of nanometres), where the mutual coupling between adjacent spins can exceed their decoherence rates14 (1/T2). Thus, scanning-field-gradient MRI will help facilitate the creation of entangled spin states with applications for quantum information processing and sensitive, nanoscale magnetometry. Although our approach is applicable to any spin system in which spins can be initialized and read out, we focus here on the electronic spins associated with NV centres in diamond, in which spin initialization and readout can be carried out optically15. In addition, NV spins are attractive for carrying out quantum information processing14,16 and sensitive magnetometry13,17,18,19. Individual-NV-spin control in a nanoscale ensemble is a key advance towards the implementation of these applications.

Our scanning-field-gradient MRI system (Fig. 1a) comprises an atomic force microscope (AFM) with a magnetic tip and is integrated into an optical confocal microscope (Supplementary Fig. S1), all operating under ambient conditions. Small ensembles of shallowly implanted NV centres, nominally 10 nm below the surface of a diamond sample, are placed in the confocal spot (volume <1 μm3) where an excitation laser at 532 nm is used to initialize and read out the NV centres’ spin states. As a result of the NV centres’ spin-dependent fluorescence (≈630–750 nm), optically detected electron spin resonance (ESR) can be observed by sweeping the frequency of a driving radiofrequency field through the spin resonance and measuring the corresponding variation in fluorescence15 (Fig. 1b), in this case on a single NV centre. As has been demonstrated13, a magnetic tip in proximity to an NV centre shifts the energy of the NV spins, particularly for fields along the NV axis. By selectively detuning the applied radiofrequency field and scanning the magnetic tip over a single NV centre, a magnetic field map corresponding to the applied detuning can be acquired (Fig. 1c).

Figure 1: MRI of a single NV centre using the scanning-field-gradient MRI microscope.
figure 1

a, A magnetic tip is scanned by an AFM over a diamond sample containing multiple shallow NV centres. Each NV centre experiences a different magnetic field from the tip, allowing for its individual spin transitions to be resolved by tuning the frequency of an applied radiofrequency field. A confocal microscope provides NV spin-state preparation through optical pumping, and detection using spin-state-dependent fluorescence. b, Optical fluorescence measurement of the ESR of a single NV centre in the absence of the magnetic tip. The NV-spin-dependent fluorescence rate leads to a drop in emitted photons when the external radiofrequency source is swept onto the NV spin resonance (here at 2.47 GHz because of an applied uniform magnetic field). c, Magnetic resonance image of a single NV centre, created by scanning the magnetic tip across the surface with the radiofrequency fixed off resonance from the NV ESR transition (see arrow in b). A reduction of fluorescence intensity is observed for positions of the magnetic tip that put the NV spin on-resonance with the radiofrequency field, creating a dark ‘resonance ring’. The plotted fluorescence intensity is normalized to the radiofrequency-independent NV fluorescence intensity (Supplementary Fig. S2).

We first demonstrate how this technique can be used for imaging proximal NV spins. The magnetic response shown in Fig. 1c provides a direct means for determining the relative location of proximal NV centres. For NVs with an identical orientation, the indistinguishable nature of their spins leads to an identical but spatially shifted magnetic field map for each NV spin. Thus, magnetic resonance images of single spins (such as in Fig. 1c) can serve as the point spread function for multi-spin imaging. To demonstrate the performance of this technique, we executed scanning-field-gradient imaging on three closely spaced NV centres (Fig. 2). As the magnetic tip is scanned laterally across the sample, a magnetic field contour is observed for each centre. Here, we selected an NV ensemble in which all three NV spins have a common quantization axis orientation, so that every spin responds in the same way to the presence of the magnetic tip. Thus, the relative distances between NV spins can be obtained by quantifying the spatial shift between the observed resonance rings through a deconvolution procedure (Supplementary Discussion). The resulting image (Fig. 2a) indicates the relative positions of the NV centres, which we find are spaced by 50 nm and 75 nm with respect to NV II. A spatial resolution of 9 nm can be extracted from the width of the resonance ring along the vector connecting NV centres II and III; a precision of 0.2 nm can be determined from a two-dimensional Gaussian fit to the deconvolved peak. This estimate of precision accounts only for variance induced by random noise (in this case, photon shot noise or random drifts in tip-to-sample distance) and does not include systematic deviations such as scanner nonlinearity or deviations from the peak shape to the Gaussian fit, which probably limit location determination precision on subnanometre length scales.

Figure 2: Three-dimensional MRI of proximal NV spins.
figure 2

a, Scanning the magnetic tip over a cluster of three NV centres with the same crystallographic orientation yields multiple dark-resonance rings in the observed fluorescence, one for each NV centre (top, left image). The relative locations of the NV centres are extracted from the magnetic resonance image through a deconvolution process (see Supplementary Discussion for details on the deconvolution), yielding adjacent NV–NV distances of 50 nm and 70 nm (bottom, left image, which plots the normalized deconvolved signal). ESR spectral linecuts (top, right) give a spatial resolution of roughly 9 nm and fits to the deconvolved peak yield (bottom, right) a precision of 0.2 nm. b, The relative depths of the NV centres below the diamond surface are determined by taking magnetic resonance images for different magnetic tip heights above the sample surface. Comparing the evolution of the three NV resonance rings as a function of tip-to-sample distance, we determine that NV I lies roughly 15 nm below NV II and NV III (stack of images on left). A vertical cut further resolves NV II and NV III, showing that they are 3 nm apart in depth (right image).

Our single-spin MRI technique can be extended to three dimensions by carrying out magnetic tomography, where the magnetic tip is retracted from the surface in few-nanometre steps and scanned laterally (Fig. 2b). The size of the resonance rings evolves quickly as a function of z distance as the magnetic field from the tip becomes too weak to bring the spin transitions into magnetic resonance with the detuned radiofrequency driving field. The height differences between the NV centres can be seen here as NV I vanishes roughly 15 nm before the other two, which indicates that NV I lies roughly 15 nm further below the surface than both NV II and III. A vertical scan across NVs II and III shows the z resolution of this measurement to be 10 nm, which is extracted from the width of the resonance line in the z direction. As the lateral separation of these two NV centres is larger than our spatial resolution, we can determine the relative height of the two spins, which we find to be 3 nm.

The NV centres in our demonstration experiments were created through implantation of nitrogen ions forming a layer ≈10 nm below the diamond surface. Modelling of this implantation procedure20 predicts a spatial variation of ±3 nm; however, we observe a larger variation in the distribution of NV depths (>10 nm) using our scanning-field-gradient MRI technique. This discrepancy may arise from ion channelling or surface effects. Nanoscale precision in measuring the distance between proximal NV spins also allows for the determination of the mutual dipole coupling between adjacent spins (Supplementary Fig. S3), which is a key component for creating entangled spin states.

Scanning-field-gradient MRI provides not only a method for nanoscale mapping of the spatial locations of proximal spins but also allows for individual spin transitions to be resolved in frequency space with high precision. In the absence of magnetic field gradients, identical spins sharing a quantization axis are indistinguishable, making selective control over proximal spins impossible. Carrying out scanning-field-gradient MRI on proximal spins differentiates their transition frequencies, allowing for coherent manipulation and characterization of individual spins in the ensemble. This can be done simultaneously on several NV spins while preserving independent control of each spin. Such selective control over proximal spins can be maintained as long as the magnetic field gradient separates the transition frequencies of neighbouring spins by more than their resonance linewidth, which is the same condition that determines the spatial resolution in MRI. Therefore, spins separated by more than the achieved MRI spatial resolution (≈9 nm for the NV spin experiments reported here) can be addressed independently using our technique.

To demonstrate such selective nanoscale characterization and control of proximal spins, we examined a pair of proximal NV centres (NV IV and NV V, separated by 135 nm, see Supplementary Fig. S4), which share the same NV axis orientation. In the absence of the magnetic tip, we carried out a continuous-wave ESR measurement on both NV spins simultaneously (Fig. 3a, left panel), finding no difference in their spectra, as expected. After tuning the radiofrequency to the pair of NV spins, we drove Rabi oscillations and observed the free-induction decay of the two NV spins using a Ramsey sequence (Fig. 3a, middle and right panels). The measured Ramsey fringes show a pronounced beating pattern due to the hyperfine structure of the NV spin transitions and are damped owing to inhomogeneous dephasing of the two NV centres. However, information distinguishing the individual coherence properties of the proximal NV centres cannot be extracted from these measurements. In contrast, when the magnetic tip is brought in close proximity to the NV spins, it splits their resonance frequencies owing to the differing magnetic fields applied to each NV, allowing each NV spin to be addressed and characterized individually and coherently (Fig. 3b) without modifying the spin of the neighbouring NV.

Figure 3: Individual quantum control and characterization of proximal NV centres.
figure 3

a, With the magnetic tip pulled far away from the sample, two NV centres (IV and V) separated by 135 nm (Supplementary Fig. S4) and sharing the same spin-quantization axis cannot be resolved by their ESR spectra ( transition of the NV triplet ground state, observed by spin-state-dependent fluorescence), as they experience the same static magnetic field (left panel). By driving both NVs at once, Rabi oscillations (middle panel) and the NV spins’ collective free-induction decay (right panel) can be observed using the indicated Rabi and Ramsey radiofrequency pulse sequences. b, With the magnetic tip in close proximity to the sample, the two NV spin resonances are spectrally distinguishable by their differing Zeeman shifts (left panel; ≈30 MHz splitting), allowing each NV to be addressed independently, so that Rabi oscillations (middle panel) and Ramsey free-induction decay (right panel) of each NV spin can be individually measured (NV IV in red and NV V in green). For these measurements, the probability of the spin being in the mS=0 state is plotted.

Such coherent individual-spin control was realized by tuning the radiofrequency to the ESR resonance of the target NV centre. Pulsing the radiofrequency with a variable duration induced coherent Rabi oscillations of either NV IV or NV V, depending on the tuning of the radiofrequency. Similarly, characterization of individual-spin coherence properties was achieved by measuring the spin’s free-induction decay using a Ramsey sequence with the appropriate radiofrequency for the target NV spin. We observed that NV IV has a faster free-induction decay rate than NV V, indicating that the two spins have different inhomogeneous dephasing times, T2*. The measured free-induction decay rates for NV V with and without the magnetic tip are comparable, indicating that additional decoherence induced by the tip is small when compared with that spin’s ambient dephasing rate, 1/T2*. To prevent tip-induced spin decoherence, we employed a three-dimensional spatial feedback scheme, which ensured that variations in the applied tip field were smaller than the intrinsic NV inhomogeneous dephasing rates (Supplementary Fig. S5). Thus, the applied magnetic field gradient can be used to characterize individual-spin coherence properties, which is a direct consequence of achieving single-spin control.

Under the influence of the tip’s magnetic field gradient, manipulating one NV spin does not perturb the state of a neighbouring NV spin. To experimentally verify this selective, independent spin control, we simultaneously drove Rabi oscillations on NV IV while measuring the ESR spectrum of NV V (Fig. 4a) by applying two separate radiofrequency fields (RF 1 and RF 2), each used to drive one NV spin resonance. To illustrate the independence of the two measurements, we carried out a two-dimensional sweep over the RF 1 pulse duration (τRF1) and the frequency of RF 2 (ωRF1; Fig. 4b). We then subtracted out the mean of each row or column to show that the two measurements are independent. Rows or columns were summed to reconstruct the resulting Rabi oscillations of NV IV or the ESR curve of NV V, respectively. The only deviations from simultaneous, independent NV spin measurements are observed when ωRF2 is swept close to the resonance of NV IV, yielding a slight damping in the Rabi oscillations. These deviations do not persist through the ESR transition of NV V, which shows that both NVs can be manipulated independently when they are driven on resonance.

Figure 4: Selective, independent radiofrequency control of proximal NV spins in the presence of the tip magnetic field gradient.
figure 4

a, Fluorescence measurements were carried out on the two proximal NV centres in Fig. 3, while undergoing simultaneous, near-resonant driving by fields RF 1 and RF 2, and with the tip magnetic field gradient inducing a large (≈30 MHz) Zeeman frequency shift between the ESR frequencies of the two NV spins. The frequency of RF 1 was set on resonance with NV IV and was pulsed with varying duration (τRF1) to induce Rabi oscillations. Simultaneously, RF 2 was continuously applied while its frequency (ωRF2) was swept through the spin resonance of NV V to measure its ESR spectrum. b, Two-dimensional fluorescence data set sweeping over τRF1 and ωRF2 for the two NV spins (base of cube). Individual-spin behaviour is extracted by subtracting the mean measured fluorescence for each row (that is, fixed value of ωRF2) from the data for that row; and similarly for each column (fixed value of τRF1). The resulting extracted data sets (shown in the sides of the cube) are found to be independent of row or column number, showing that varying the Rabi pulse duration τRF1 for NV IV does not influence the results of sweeping ωRF1 through the spin resonance of NV V, and vice versa. Summing up the measurements for all rows and columns yields the resulting averaged Rabi oscillation measurement for NV IV (top of left wall) and ESR spectrum from NV V (top of right wall), respectively.

Scanning-field-gradient MRI of spins yields precise determination of their relative locations with nanometric spatial resolution, which will be crucial for optimizing the performance of spin-based magnetometers and the functionality of spin-based quantum bit ensembles. Once suitable spin ensembles are identified and spatially mapped, individual-spin control both allows for the determination of individual-spin properties and—when combined with magnetic dipole coupling between adjacent spins—provides a method for achieving complete control of the quantum state of spin ensembles. For our demonstrated spatial resolution (9 nm) in resolving nearby spins, coupling rates between proximal spins can be as strong as 36 kHz for optimally oriented spins. Thus, so long as spin coherence times exceed 28 μs, such spins can be entangled. As NV spin coherence times up to 1.8 ms have been demonstrated21, our scanning-field-gradient MRI is immediately applicable to the creation of entangled spin states. Such states have intriguing potential applications ranging from sensitive nanoscale magnetometers to scalable quantum information processors22.

The spatial resolution of our scanning technique is extendable to the atomic scale by using stronger magnetic field gradients23 and narrower ESR linewidths21. For NV spins, the present experimental barrier to improving this spatial resolution is overcoming the reduction in ESR contrast due to a strong off-axis magnetic field created by the tip24; however, this can be prevented by either applying a strong bias field along the NV axis or by tailoring the domain structure of the magnetic tip to produce high gradients but only moderate total fields.

The control and manipulation of individual spins using magnetic field gradients is independent of the method used for spin readout. For optically addressable spins, such as NV spins, integrating far-field, subdiffraction schemes—such as stimulated emission depletion25 and reversible saturable optical linear fluorescence26—with a scanning magnetic field gradient would allow for both robust individual-spin control and readout with nanometric resolutions. In addition, selective optical control of such systems is possible through the incorporation of an electric field gradient to the scanning tip27, which would allow both spin and electronic degrees of freedom to be addressed individually. Alternatively, using demonstrated single-shot electrical readout of individual spins7,28 would allow for MRI to be carried out rapidly and efficiently, as acquisition times would not be limited by the readout integration time.

Methods

NV centre samples. NV centres were created through implantation of 15N ions29 into ultrapure diamond (Element Six, electronic grade diamond, <5 ppb nitrogen). The implantation was done at 6 keV to give a nominal nitrogen depth of 10 nm (ref. 20). To form NV centres, the sample was annealed in vacuum at 750 °C, where existing vacancies are mobile and can pair with the implanted nitrogen atoms. The resulting density of NV centres corresponds to one centre every 50–100 nm, forming a layer roughly 10 nm from the surface. To isolate small NV clusters (that is, a few proximal NV centres), we selectively etched30 away most of the shallow diamond surface layer, leaving proximal NV-containing nanostructures. This was done using electron-beam lithography to define an etch mask from a flowable oxide31 (Dow Corning, XR-1541). A reactive-ion etch then removed any exposed diamond surfaces, resulting in shallow diamond nanostructures (100–800 nm across) containing ensembles of proximal NV spins.

Magnetic tips. Magnetic tips were created by evaporating a magnetic layer onto quartz tips of roughly 80 nm in diameter, which were fabricated using a commercial laser-pulling system (Sutter Instrument, P-2000). Using a thermal evaporator, a 25 nm layer of cobalt–iron was deposited on the side of the pulled quartz tip. A 5 nm chrome layer was then evaporated, which serves as a capping layer to prevent oxidation of the magnetic material. These tips result in magnetic field gradients of roughly 1 G nm−1 at distances of roughly 100 nm.

Magnetic tip positioning with an AFM. To achieve high spatial resolution in NV imaging and manipulation, it is necessary to control precisely the relative distance between the magnetic tip and the addressed NV centres. Such nanoscale control can be challenging under ambient conditions (standard temperature and pressure); for example, temperature drifts of a small fraction of a degree can induce few-nanometre drifts between the magnetic tip and the diamond sample, which would inhibit local spin control.

To overcome this problem, we used an AFM, operating in non-contact mode, to position the magnetic tip in three dimensions with precisions of a fraction of a nanometre in z and a few nanometres in both x and y. Height control was achieved through normal AFM operation in which a feedback loop modulates the height of the tip to keep the sample–tip interaction constant. Lateral positioning was achieved through intermittently locating topographic features on the sample to ensure that the tip’s relative distance to the sample is fixed during any measurements (Supplementary Fig. S5).

Ramsey free-induction decay measurements. The Ramsey free-induction decay measurements in Fig. 3 are taken with the radiofrequency driving field detuned by 5 MHz from the target NV centre’s nominal ESR frequency in the presence of the magnetic tip; the observed oscillations are due to beating of this detuning with the 15N hyperfine splitting (3.1 MHz). The measured Ramsey data are fitted to the sum of two exponentially damped sinusoids, whose phases are fixed by the relative strength between the net detuning (the radiofrequency field detuning plus or minus half the hyperfine splitting) and the Rabi frequency (5.5 MHz), governed by the strength of the applied radiofrequency field.