Magneto-optical imaging of thin magnetic films using spins in diamond

Imaging the fields of magnetic materials provides crucial insight into the physical and chemical processes surrounding magnetism, and has been a key ingredient in the spectacular development of magnetic data storage. Existing approaches using the magneto-optic Kerr effect, x-ray and electron microscopy have limitations that constrain further development, and there is increasing demand for imaging and characterisation of magnetic phenomena in real time with high spatial resolution. Here we show how the magneto-optical response of an array of negatively-charged nitrogen-vacancy spins in diamond can be used to image and map the sub-micron stray magnetic field patterns from thin ferromagnetic films. Using optically detected magnetic resonance, we demonstrate wide-field magnetic imaging over 100 × 100 μm2 with sub-micron spatial resolution at video frame rates, under ambient conditions. We demonstrate an all-optical spin relaxation contrast imaging approach which can image magnetic structures in the absence of an applied microwave field. Straightforward extensions promise imaging with sub-μT sensitivity and sub-optical spatial and millisecond temporal resolution. This work establishes practical diamond-based wide-field microscopy for rapid high-sensitivity characterisation and imaging of magnetic samples, with the capability for investigating magnetic phenomena such as domain wall and skyrmion dynamics and the spin Hall effect in metals.

Magnetic imaging techniques 1 are generally characterized by their spatial and temporal resolution, but criteria such as sensitivity, field disturbance, sample damage, field of view, cost, and ease of use, are critical for broad applicability which ultimately drives future development of our understanding of magnetism in advanced materials and applications. Electron and x-ray microscopy can provide high spatial resolution down to a few nanometres 2-4 , but are time-consuming, and require expensive complex apparatus, careful sample preparation, and a high vacuum environment. Magnetic force microscopy (MFM) 5,6 is commonly used to characterise magnetic devices, but is inherently slow and not suited to imaging fragile magnetisation states due to its invasive magnetic tip. Magneto-optical Kerr Effect microscopy (MOKE) 7,8 on the other hand, is a non-invasive optical technique which has been used to great effect in furthering our understanding of the spin Hall effect 9 and more recently the formation of magnetic skyrmion bubbles under ambient conditions 8 . The main limitation of MOKE is that it applies to materials which exhibit a strong Kerr response. Active MOKE layers have been applied to some material types to induce a MOKE response 10 , however this invasive approach may affect the magnetic properties of the device under study.
Solid state spin systems offer a new approach for magnetic imaging, based on the sensitivity of quantum spin states to external magnetic fields. In particular, the negatively charged nitrogen-vacancy (NV) centre in diamond 11 has demonstrated competitive magnetic sensitivity in ambient room temperature environments 12 . Diamond-based imaging techniques have been developed for biological cells 13,14 , current-carrying wires 15,16 , paramagnetic molecules 17 and solid state phenomena [18][19][20] . Here we introduce a new non-invasive approach for imaging solid state magnetic devices.
More specifically, we use the magnetic sensitivity of NV centres in diamond to image the stray magnetic fields in thin ferromagnetic films, with commercial recording media as an example. We demonstrate temporal and spatial resolution of 20 ms and 440 nm, respectively. Our technique is applicable to any magnetic material with a stray magnetic field and can be operated with high throughput by simply placing the material in contact with the diamond imaging chip under ambient conditions. The apparatus consists of a conventional commercial wide-field fluorescence microscope with a diamond imaging chip onto which the magnetic sample is mounted. The magnetic contrast is obtained from the fluorescence signal emitted by NV defect centres engineered beneath the diamond surface. We present three distinct imaging modalities which can be used independently or in combination. In the first, we use the optically detected magnetic resonance (ODMR) of the NV spins to resolve the iso-magnetic field lines from the magnetic bits in the absence of an applied magnetic field. In the second example, we describe an imaging protocol with an applied magnetic field to quantitatively map the stray magnetic field from each individual bit over the entire field of view and compare the results to theoretical simulations of the recording media. Finally, we demonstrate a new all-optical imaging modality based on NV spin relaxation contrast, particularly useful for imaging strong off-axis magnetic fields.
All three imaging modalities were performed on the same wide-field magnetic imaging microscope, see Fig. 1a. The magnetic sample of interest requires no special treatment and is simply placed in contact with a 2 × 2 mm 2 diamond imaging chip. A two-dimensional array of near-surface NV centres was engineered in the diamond by nitrogen ion implantation and subsequent annealing. The implantation energy of 20 keV resulted in a mean NV depth of approximately 30 nm. The NV array is illuminated by a 532 nm green laser and the resulting red fluorescence (650-750 nm) is imaged onto an sCMOS camera, see Fig. 1b. Using a Nikon × 40, 1.2 NA oil objective lens, we obtain a field of view of 100 × 100 μm 2 , and operate with an optical power density of 30 W/ mm 2 . Microwave (MW) excitation is provided by a resonator lithographically patterned onto a glass coverslip placed below the diamond imaging chip for acquisition of the ODMR spectrum from the NV spins in the array. Figure 1c shows a typical ODMR spectrum obtained from the integrated signal over the entire field of view with and without an external magnetic field. The ground state electron spin sublevels m s = ± 1 of each NV centre are Zeeman split in the presence of a local magnetic field, resulting in a frequency shift in the spin levels of γ π where γ e is the electron gyromagnetic ratio and B NV is the magnetic field projection along the NV symmetry axis 21 . The NV centres are randomly oriented along the four 111 crystallographic axes of diamond with average separation of 20 nm, assuming 1% conversion efficiency of [N] to [NV]. The ODMR spectrum therefore exhibits four pairs of resonance lines corresponding to the B NV,i =1.4 magnetic field projections. The ODMR sensitivity to local magnetic fields provides a contrast mechanism which we use to provide imaging of the stray magnetic field associated with the sample, in this case commercial recording media. (c) ODMR spectra of the NV array integrated over the entire field of view with (upper) and without (lower) applied magnetic field. The applied field (13.4 mT) was aligned along one particular NV axis with the other three NV axes experiencing the same magnetic field projection. This results in a pair of ODMR lines for the aligned NV centres (NV aligned ) and a second set of ODMR lines for the misaligned NV centres.

Results
Wide-field imaging of iso-magnetic field lines in thin ferromagnetic films. A thin ferromagnetic film sample was obtained by cutting a segment of recording media from a commercial magnetic hard disk drive. The magnetic film was encoded with random magnetic data on bits 14 μm × 1.5 μm determined independently by MFM (see Supplementary Information). The magnetic bits are magnetised in-plane, parallel to the tracks, with random sign. The magnetic sample (5 × 5 mm 2 ) was simply placed face down on the diamond imaging chip. Due to surface imperfections, a distance between the magnetic film and the NV array is observed. This stand-off distance is shown to be of the order the resolution of the microscope, which has negligible impact on the spatial resolution but reduces the measured stray magnetic field strength. For improved distance control, the magnetic device could be directly fabricated on the diamond surface or on top of a well-defined spacing layer, but this would likely not be required in many applications, thus allowing high throughput and characterisation of a range of magnetic materials.
To image the iso-magnetic field lines, a single microwave frequency f is applied to the imaging array which is resonant with a spin transition of the NV centre only when the local magnetic field B NV satisfies the condition: , where f D is the resonance frequency in zero field. At resonance, the microwave field induces a decrease of up to 10% in the NV fluorescence intensity (Fig. 1c). The recorded fluorescence image then reveals iso-magnetic field contours corresponding to a given value of B NV as lines of low intensity. To reduce the effect of illumination inhomogeneity (see Fig. 1b), we divide images with and without MW excitation. Typical iso-magnetic field images are shown in Fig. 2a,b, where a MW frequency of 2.79 GHz and 2.87 GHz was applied, corresponding to a field projection of B NV = ± 2.9 mT and 0 mT, respectively. Since each pixel contains the signal from a large number of NV centres located in four distinct orientations, see Fig. 1a, the method produces magnetic field contrast whenever the stray magnetic field projection is resonant with the probe MW frequency along each NV axis.
The individual bits are clearly observed over the entire field of view. The acquisition time for the images shown in Fig. 2a,b was 48 seconds. Integration over this time period reduces the shot noise in the fluorescence measurement, resulting in clearly resolved iso-magnetic field lines. A typical line cut through a single iso-magnetic field line is shown in Fig. 2c demonstrating a magnetic imaging resolution of 440 ± 20 nm, consistent with the diffraction limit of our wide-field 1.2 NA microscope operating at λ = 650 − 750 nm: (1.22λ/(2NA) = 380 nm at 750 nm. The spatial resolution of the microscope is constrained by the stand-off distance between the sample and imaging chip; careful control and manipulation of the sample will result in a reduced stand-off and diffraction limited performance equivalent to other optical based magnetic imaging techniques such as MOKE.
To probe the temporal response of the system, the integration time per image was reduced until the magnetic bits could no longer be resolved (Fig. 2d-f). For this experiment, a MW frequency of 2.87 GHz corresponding to a projection B NV = 0 mT was applied, so that all NV centres contribute to the signal in the regions of zero magnetic field, thereby maximizing the contrast of the resulting image. Figure 2f shows a magnetic image of the iso-magnetic field lines acquired in 20 ms. This temporal resolution is several orders of magnitude faster than MFM, and comparable to that of wide-field MOKE microscopy 8 .
Another important characteristic of the microscope is its sensitivity, which limits the smallest number of Bohr magnetons in the sample that can be detected for a given integration time. The magnetic field sensitivity of the imaging chip is dictated by the width and contrast of the Lorentzian ODMR peaks, with the optimal sensitivity given by equation (1) 22 : Where δ = 6 MHz is the full width at half maximum of the ODMR peak, and the ESR contrast R = 0.1. The number of photons per detection volume (4 × 4 pixels, 275 × 275 nm) is = . × − n 1 2 10 s 6 1 giving a magnetic sensitivity of 1.5 μT/ Hz per detection volume, consistent with the DC sensitivity reported elsewhere in similar ensemble samples 15,16,23 . If we compare this with MOKE imaging which offers a typical sensitivity to a magnetic moment of μ ~1 × 10 −13 emu 24 , this equates to a stray magnetic field strength of ≃1 mT at a standoff distance of 300 nm. Therefore the diamond imaging chip is three orders of magnitude more sensitive for typical acquisition times of 1 second. It should be noted that with modest diamond material improvements the projected field sensitivity can be significantly enhanced. For example, in instances where the stray magnetic field decays over length scales of microns, much deeper and more uniform NVs can be engineered with much higher [N] to [NV] conversion efficiencies >10% 16,25 . In this case, the n improvement along with the reduction in the ODMR line width can result in projected DC sensitivity of order nT/ Hz 26 . In most solid state magnetic device imaging applications the magnetic fields are of order tens of μT, therefore we expect resolution of sub-micron magnetic structures on millisecond timescales.
Quantitative stray magnetic field mapping. To quantify the stray field from the array of magnetic bits, a matrix of ODMR spectra was acquired by recording fluorescence images while sweeping the MW frequency. The ODMR spectrum exhibits in general four pairs of resonance lines with Zeeman splitting corresponding to the field projection along each of the four NV axes. In principle, the vector magnetic field can be reconstructed from the ODMR matrix 15 . The procedure is time consuming and challenging for small (< mT) magnetic fields when the four line pairs cannot be readily resolved. An alternate approach is to apply an external magnetic field along one particular NV axis to separate the four orientations (Fig. 1c), allowing measurement of the stray field projected along a particular NV axis (B NV ). Both the sign and magnitude of B NV with respect to the background field can be obtained without assumptions regarding the source of the magnetic field. Figure 3a shows a quantitative magnetic field map of the magnetic bits. In the top part of the image, the measured field periodically oscillates between + 0.5 and − 0.5 mT along the data tracks, with a period of 1.47 μm (Fig. 3b). This period closely matches the bit spacing obtained from MFM (1.44 μm), indicating that in this region of the sample the bits are magnetised according to a regular sequence 010101. The white regions of the image highlight the zero magnetic field regions between each bit and along the data tracks. Note that the full vector stray field from the magnetic sample could be formed by repeating the measurement with the external magnetic field aligned along each of the other three NV axes 13 . For more rapid determination of the strength and direction of the stray magnetic field, one can also probe two microwave frequencies either side of the single ODMR peak 27 .
To assess the imaging performance of our microscope we compare the experimental data to a micromagnetic model of the device. Our model calculates the stray magnetic field from an array of uniformly magnetised rectangular elements 28 which is then projected along the NV axis used in the experiment (see Methods). The only unknown parameter in the simulation is the stand-off distance of the NV array with respect to the magnetic sample. The simulation best reproduces the amplitude of the field in the experimental data (0.5 mT) for a stand-off distance of 1 μm. The resulting image (Fig. 3c) and detailed field profile (Fig. 3b) are in excellent agreement with the experimental data.
All-optical spin relaxation contrast imaging. Finally, we demonstrate a new all-optical magnetic imaging technique based on the NV spin relaxation contrast. In the presence of off-axis magnetic fields (> 5 mT), the efficiency of the NV spin polarisation in the imaging modalities described above is significantly reduced because the natural quantisation axis for the NV centre is then defined by the background magnetic field rather than by the intrinsic crystal field, and the spin sublevels m s = 0 and ±1 are no longer eigenstates of the unperturbed NV system. In this case, mixing of the spin state populations causes a reduction in the spin polarisation efficiency, and thereby the fluorescence intensity under optical pumping 29 . This spin mixing hampers ODMR-based imaging protocols at high magnetic field strengths, but also provides an alternate approach to magnetic imaging via the optical response of the NV centre.
Previous all-optical nanoscale magnetic imaging has been achieved with single NV centres in nanodiamonds attached to scanning atomic force microscope tips, with magnetic contrast being derived from the change in fluorescence from a single NV centre due to spin mixing in the excited states 28  NV ensembles for wide-field imaging, it becomes increasingly difficult to characterise small variations in the fluorescence, since the NV distribution and pump excitation are not uniform over the large field of view. To overcome this issue, we developed a new imaging protocol based on the fluorescence contrast of the spin relaxation time (T 1 ) of the imaging array. T 1 relaxation imaging has been proposed 30 and recently demonstrated as an approach to image weak fluctuating magnetic fields 17,31 , probing Johnson noise in metals 32 and to characterise spin noise in ferromagnetic materials 20 . However, in the presence of high off-axis magnetic fields, the reduced spin polarisation caused by spin mixing also reduces the measurement contrast of the T 1 relaxation time. We describe here a technique which takes advantage of the spin mixing effect and shows that the contrast of the T 1 relaxation curve can be used to quantify regions of high off-axis magnetic fields.
To illustrate the relaxation contrast imaging approach we first implement the traditional spin relaxation time protocol shown in Fig. 4a, where the T 1 relaxation curve is mapped at each pixel. Figure 4b shows two typical T 1 relaxation curves denoted as S x1y1 (τ ) and S x2y2 (τ ) corresponding to two distinct pixel regions of low and high off-axis magnetic fields, respectively. Figure 4c shows the corresponding ODMR-based magnetic image with the contrast highlighting areas of low magnetic field. The presence of high off-axis magnetic fields increases the amount of spin mixing and reduces the spin relaxation contrast as seen from the T 1 relaxation curve for S x2y2 (τ ). For highly stable magnetic medium such as the hard drive imaged here, we do not observe variations in the T 1 time induced from magnetic fluctuations (see Supplementary Information). Therefore we can apply a two-point measurement in order to quantify the change in spin relaxation contrast. By probing the fluorescence signal at two distinct spin relaxation times, S xy (τ 1 ) and S xy (τ 2 ), the spin relaxation contrast can be obtained over the entire imaging area by summing the normalised fluorescence signal from each measurement cycle τ τ ∑ = S S ( )/ ( ) i n xy xy 0 1 2 . The spin relaxation contrast sequence is shown in Fig. 4a. The two relaxation time points used in this example were τ 1 = 10 μs and τ 2 = 860 μs as shown in Fig. 4b and the magnetic image was formed after integrating for 2 × 10 6 cycles, 30 mins. Figure 4d shows the all-optical spin relaxation contrast image of the magnetic recording media, where white contours correspond to high off-axis magnetic fields.
Calculations of the NV spin dynamics show a contrast change of a few % corresponds to off-axis magnetic field strengths ≥ 5 mT 29 . The relaxation contrast image is in excellent agreement with the corresponding low magnetic field image obtained using the ODMR-based protocol shown in Fig. 4c. The comparison illustrates the complementarity between the two methods: ODMR reveals the low-field regions, while spin relaxation contrast imaging shows the high off-axis magnetic fields. It should be noted that the magnetic sample used in this study provides modest off-axis magnetic fields of order 5 mT providing ∼ 2% relaxation contrast. In cases where the off-axis stray magnetic fields are considerably larger > 20 mT the spin contrast will increase up to 20% 29 which will allow for much faster acquisition rates of order seconds. This would enable dynamic imaging of high magnetic fields using the optical response of the NV spins.

Discussion
In this work we have shown that NV defects in diamond provide the basis of a sensitive optical wide-field magnetic microscope for the characterisation of magnetic materials with high spatial resolution and video frame rates. The magnetic sensitivity to DC fields is 1.5 μT/ Hz and is capable of imaging the stray magnetic field from thin ferromagnetic films in 20 ms under ambient conditions. The method would allow magnetic imaging of a single isolated magnetic skyrmion (20 nm in diameter) in an ultrathin ferromagnet, at a stand-off distance of 300 nm or less 33 , which corresponds to 10 4 μ B with a 1 second acquisition time. Larger skyrmions (up to 1 μm in diameter) 8 with 10 9 μ B could be imaged within the 20 ms temporal resolution limit of our existing instrument.
The high resolution magnetic imaging demonstrated here is achieved over a large field of view (100 × 100 μm 2 ), in the absence of any external magnetic field which may impact the magnetisation of the sample under investigation. The spin relaxation contrast from NV centres in diamond also enables a new all-optical imaging approach suitable for magnetic structures that exhibit large off-axis magnetic fields, for example super-conducting vortices 34 , again over wide fields of view. Since our imaging magnetometer relies on mapping the stray magnetic field rather than on a direct interaction with the sample magnetisation, it is applicable to all samples regardless of their shape (thickness, surface roughness) and composition. This is in contrast to existing techniques which impose constraints on the type of sample that can be imaged, particularly for non-magnetic metals, where direct imaging of spin injection or the spin Hall effect have not been possible 35 .
The minimal requirements on sample and instrument preparation will allow high throughput characterisation of magnetic samples or devices. A number of improvements can be anticipated. Both the temporal resolution and sensitivity can be improved by increasing the fluorescence intensity per detection volume, by increasing the density of NV centres and by optimising the photon collection efficiency with anti-reflection coatings 36 and optical antenna approaches 37 . With an [N] to [NV] conversion efficiency improvement from 1 to 10% 38 , millisecond temporal resolution and magnetic sensitivity of sub-μT will be possible. Improved spatial resolution may also be possible by implementing super-resolution schemes such as stimulated emission depletion 39 or ground state depletion microscopy 40 , although at the expense of longer acquisition times. There are many important applications, for example dynamic magnetic phenomena such as the motion of magnetic domain walls and skyrmions under current, magnetic field or thermal fluctuations 8,19,41 and exploration of new materials, particularly metallic and non-magnetic materials, where existing magnetic imaging techniques are lacking. Diamond-based wide-field microscopy thus provides a new pathway to study these technologically important magnetic phenomena.

Methods
Materials. The imaging sensor used in this work is engineered from electronic grade Type IIa diamond (Element 6). The diamonds were thinned and repolished to a 4 × 4 × 0.1 mm 3 crystal (DDK, USA) and then lasercut into 2 × 2 mm 2 sensors. The single crystal diamond was then implanted with 15 N atoms at 20 keV to a dose of 1 × 10 13 ions/cm 2 . The implanted sample was annealed at 1000 °C for three hours and acid treated to remove any unwanted surface contamination. The density of NV centres post annealing was 1 × 10 11 NV/cm 2 , estimated by comparing the intensity from a single NV centre in diamond with that obtained from the NV ensemble.
Imaging. The wide-field imaging was performed on a modified Nikon inverted microscope (Ti-U). Optical excitation from a 532 nm Verdi laser was focused (f = 300 mm) onto an acousto-optic modulator (Crystal Technologies Model 3520-220) and then expanded and collimated (Thorlabs beam expander GBE05-A) to a beam diameter of 10 mm. The collimated beam was focused using a wide-field lens (f = 300 mm) to the back aperture of the Nikon x40 (1.2 NA) oil immersion objective via a Semrock dichroic mirror (Di02-R561-25 × 36). The NV fluorescence was filtered using two bandpass filters before being imaged using a tube lens (f = 300 mm) onto a sCMOS camera (Neo, Andor). Microwave excitation was provided by an Agilent microwave generator (N5182A) and switched using a Miniciruits RF switch (ZASWA-2-50DR+ ). The microwaves were amplified (Amplifier Research 20S1G4) before being sent to the microwave resonator. A Spincore Pulseblaster (ESR-PRO 500 MHz) was used to control the timing sequences of the excitation laser, microwaves and sCMOS camera and the images where obtained and analysed using custom LabVIEW code. The excitation power density used for imaging was 30 W/mm 2 and all images were taken in an ambient environment at room temperature. The magnetic sample used for imaging was cut from a commercial Western Digital 1 GB magnetic hard drive.
Stray magnetic field simulations. The sample is modelled as an array of bits where each bit is a parallelepiped with uniform magnetisation. The size of the bits is 14 μm × 1.5 μm × 15 nm, and the pitch of the data tracks is 17 μm, which means that there is a gap of 3 μm between bits of adjacent tracks. These parameters were taken directly from the MFM images. The thickness of the magnetic film is taken from 42 to be 15 nm. The magnetisation of each bit is assumed to lie in the plane of the magnetic film, mainly parallel to the direction of the data tracks. A tilt of 25° with respect to this main direction is added to account for the effect of the applied background magnetic field. The saturation magnetisation is taken to be 0.5 × 10 6 A/m. Using analytical formulae of the field generated by one bit 28 , one can sum over the array to obtain the vector field map at a given distance d from the sample. The field is then projected onto the NV axis used in the experiment, which gives the map of B NV . Finally, a convolution with a Gaussian lineshape of 440 nm full width at half maximum is applied to account for the optical response of the microscope. The stand-off distance d was varied in order to find the best match with the experiment.