Magnetic imaging based on nitrogen-vacancy (NV) centers in diamond has emerged as a powerful tool for probing magnetic phenomena in fields ranging from biology to physics. A key strength of NV sensing is its local-probe nature, enabling high-resolution spatial images of magnetic stray fields emanating from a sample. However, this local character can also form a drawback for analyzing the global properties of a system, such as a phase transition temperature. Here, we address this challenge by using statistical analyses of magnetic-field maps to characterize the first-order temperature-driven metamagnetic phase transition from the antiferromagnetic to the ferromagnetic state in FeRh. After imaging the phase transition and identifying the regimes of nucleation, growth, and coalescence of ferromagnetic domains, we statistically characterize the spatial magnetic-field maps to extract the transition temperature and thermal hysteresis width. By analyzing the spatial correlations of the maps in relation to the magnetocrystalline anisotropy and external magnetic field, we detect a reorientation of domain walls across the phase transition. The employed statistical approach can be extended to the study of other magnetic phenomena with NV magnetometry or other sensing techniques.
I. INTRODUCTION
Nitrogen-vacancy (NV) centers are point-like defects in the diamond lattice hosting an electron spin that can be used as a sensor of magnetic fields.1 In the last decade, NV centers have been developed into powerful tools for probing magnetic phenomena in both condensed-matter and biological systems.2,3 Key strengths of the technique are its nanoscale spatial resolution,4 high magnetic field sensitivity,5 and its operability under cryogenic conditions to above room temperature.6 However, its local-probe nature can also form a challenge for extracting quantities related to the macroscopic properties of a system, such as its phase transition temperature and hysteresis width. In addition, while real-space images provide a powerful visualization of spatial textures such as domain structures, extracting the temperature- or field-driven evolution of important parameters such as domain sizes requires defining suitable figures of merit. On the other hand, global techniques for probing phase transitions are typically less sensitive to a sample's microscopic structure. Being able to combine the acquisition of local information with a simultaneous monitoring of macroscopic sample properties would provide insight into how microscopic mechanisms underlie the global sample behavior.
In this work, we image the magnetic stray fields generated by an FeRh thin film using an ensemble of NV centers in a diamond chip [Fig. 1(a)] and employ statistical methods7 to characterize its temperature-driven metamagnetic phase transition (MMPT).8 By analyzing the spatial variations and correlations of measured stray fields as a function of temperature, we extract the transition temperature and hysteresis width of the phase transition. Furthermore, we identify a reorientation of ferromagnetic (FM) domain walls during the MMPT triggered by the application of a bias field along a magnetic hard axis. Our study of the MMPT in FeRh shows how combining real-space imaging with statistical figures of merit can enable a better understanding of how macroscopic properties arise from the local state of a system.
NV detection of the FeRh stray field. (a) Schematic of the experimental setup. The stray field of the FeRh film is detected by the NV sensing layer in a diamond chip. Scanning the laser allows us to spatially map the FeRh stray field. (b) Temperature dependence of the magnetic moment of the 20-nm-thick FeRh film measured by vibrating sample magnetometry under an in-plane bias field of 150 mT, parallel to the [100] FeRh crystalline direction (easy axis). Below the transition temperature Tt ≈ 370 K, the Fe spins are ordered in an AFM configuration and the Rh atoms carry no net magnetic moment (left inset). Above , the Rh atoms gain a finite moment and align ferromagnetically parallel to the Fe spins (right inset).8 (c) Simplified energy level diagram of an NV center. The NV is optically excited with a green laser and its spin state monitored via spin-dependent photoluminescence. Microwaves drive ESR transitions between the and spin states. The magnetic field is extracted by measuring the Zeeman-split ESR frequencies. (d) Feedback measurement of NV ESR frequencies. Top: at the first pixel, we measure the full ESR spectrum, obtained by sweeping the MW frequency while recording the NV photoluminescence. The center frequency is used as an estimate for the next pixel. Bottom: error function employed to extract the ESR frequency with a feedback algorithm ( when ). The error D is derived by modeling the ESR spectrum in the top panel as a Lorentzian and Taylor expanding about to first order. In the feedback protocol, only two MW pulses are applied with frequencies , symmetric around the estimate of the ESR frequency . The photoluminescence difference at these frequencies, denoted , is proportional to the error , which we use as feedback signal to adjust the MW pulse frequencies while scanning.
NV detection of the FeRh stray field. (a) Schematic of the experimental setup. The stray field of the FeRh film is detected by the NV sensing layer in a diamond chip. Scanning the laser allows us to spatially map the FeRh stray field. (b) Temperature dependence of the magnetic moment of the 20-nm-thick FeRh film measured by vibrating sample magnetometry under an in-plane bias field of 150 mT, parallel to the [100] FeRh crystalline direction (easy axis). Below the transition temperature Tt ≈ 370 K, the Fe spins are ordered in an AFM configuration and the Rh atoms carry no net magnetic moment (left inset). Above , the Rh atoms gain a finite moment and align ferromagnetically parallel to the Fe spins (right inset).8 (c) Simplified energy level diagram of an NV center. The NV is optically excited with a green laser and its spin state monitored via spin-dependent photoluminescence. Microwaves drive ESR transitions between the and spin states. The magnetic field is extracted by measuring the Zeeman-split ESR frequencies. (d) Feedback measurement of NV ESR frequencies. Top: at the first pixel, we measure the full ESR spectrum, obtained by sweeping the MW frequency while recording the NV photoluminescence. The center frequency is used as an estimate for the next pixel. Bottom: error function employed to extract the ESR frequency with a feedback algorithm ( when ). The error D is derived by modeling the ESR spectrum in the top panel as a Lorentzian and Taylor expanding about to first order. In the feedback protocol, only two MW pulses are applied with frequencies , symmetric around the estimate of the ESR frequency . The photoluminescence difference at these frequencies, denoted , is proportional to the error , which we use as feedback signal to adjust the MW pulse frequencies while scanning.
The alloy FeRh undergoes a first-order phase transition from an antiferromagnetic (AFM) to a FM state when increasing its temperature [Fig. 1(b)] above a transition temperature (Tt ≈ 370 K) that depends on the strain,9 bias field,10 and stoichiometry of the sample.11 This MMPT is accompanied by a volume expansion of and an abrupt decrease in the resistivity12 as well as an interplay between AFM and FM domains that was recently shown to lead to an intricate domain structure.13 As such, FeRh constitutes a platform that is well suited for investigating the interaction between magnetic, electronic, and structural degrees of freedom. The MMPT of FeRh is also of practical interest due to its potential for data storage technologies, such as AFM resistive memories,14 heat-assisted magnetic recording,15 and low-power spintronic devices.16
II. RESULTS
A. NV imaging of the MMPT in FeRh
Our sensing platform is based on an NV-containing diamond chip positioned on top of a 20-nm-thick epitaxial FeRh film that is grown on MgO [Fig. 1(a)] by DC magnetron sputtering.17 As shown by vibrating sample magnetometry, the transition temperature of the film is ∼370 K with a hysteresis width of approximately 20 K under an in-plane bias field of 150 mT [Fig. 1(b)]. The temperature-dependent changes of the FeRh magnetization cause variations of the stray magnetic field above the film, which, in turn, induce Zeeman shifts in the electron spin resonance (ESR) frequencies of the NV centers.1 We polarize the NV spins by optical pumping and detect ESR transitions between their and spin sublevels by applying a microwave (MW) field using a nearby bonding wire and monitoring the spin-dependent photoluminescence [Fig. 1(c)]. A DC bias field is applied along one of the four possible NV orientations (i.e., the directions of the diamond lattice) to select two ESR transitions among the eight possible ones and to magnetize the FeRh film. Specifically, the bias field is oriented at ∼35° out of plane and has an in-plane component that we orient alternatively along a magnetic easy or hard axis of FeRh. The out-of-plane magnetization of FeRh induced by the field is negligible since the shape anisotropy of the film favors in-plane magnetization and the bias fields used in this work are much smaller than the saturation magnetization (18). This, together with the magnetocrystalline anisotropy of FeRh, results in four in-plane easy axes.19
To determine the magnetic field, we measure the two ESR transition frequencies of the selected NV family [Fig. 1(d)], which yield the projection of the stray field onto the NV axis.1 Performing this measurement at each pixel by sweeping the MW frequency while detecting the photoluminescence takes several hours for images of 100 × 100 pixels. Instead, we employ a feedback scheme20 in which, at each pixel, the photoluminescence is only measured at two frequencies [Fig. 1(d)], thereby speeding up the data collection by about an order of magnitude.
Using this method, we map the stray field generated by the FeRh thin film across the MMPT, and in this way, we image the evolution of its magnetic order, when is applied along a hard [Figs. 2(a)–2(g)] or easy (see Fig. S1 in the supplementary material) axis. Below the phase transition temperature (Tt), we observe a mostly vanishing since AFM and nanometric FM domains generate negligible magnetic fields at the NV location. This is because the stray field of these features decays exponentially with the NV–FeRh distance,2 which is around 1 μm in our experiments. Thus, we cannot address the presence or absence of residual ferromagnetic domains of nanometric size at the FeRh/Pt interface reported in the literature.13,19 The appearance of regions of non-zero field at ∼368 K indicates the nucleation of FM domains, which grow and coalesce as the temperature is increased further. The magnetization direction results from a competition between the Zeeman energy and the anisotropy energy, the former favoring the alignment of spins with the bias field and the latter with the in-plane easy axes.
Imaging the meta-magnetic phase transition (MMPT) of FeRh with NV magnetometry. (a)–(g) Magnetic-field maps measured across the MMPT after subtraction of the bias field, in the heating (a)–(e) and cooling (e)–(g) branches of the experiment. The in-plane component of the bias field is parallel to the [110] FeRh direction. All maps in this work contain 100 × 100 pixels with a pixel size of 0.5 μm. Scale bar, 10 μm. B0 = 34.0 mT. (h) Temperature evolution of the normalized RMS deviation of the measured stray-field maps. The blue (red) line corresponds to the in-plane component of the bias field being oriented along an easy (hard) axis and B0 = 8.2 mT (B0 = 34.0 mT).
Imaging the meta-magnetic phase transition (MMPT) of FeRh with NV magnetometry. (a)–(g) Magnetic-field maps measured across the MMPT after subtraction of the bias field, in the heating (a)–(e) and cooling (e)–(g) branches of the experiment. The in-plane component of the bias field is parallel to the [110] FeRh direction. All maps in this work contain 100 × 100 pixels with a pixel size of 0.5 μm. Scale bar, 10 μm. B0 = 34.0 mT. (h) Temperature evolution of the normalized RMS deviation of the measured stray-field maps. The blue (red) line corresponds to the in-plane component of the bias field being oriented along an easy (hard) axis and B0 = 8.2 mT (B0 = 34.0 mT).
Upon decreasing the temperature, we observe thermal hysteresis [i.e., by comparing Figs. 2(a) and 2(g)]. This hysteretic behavior, together with the coexistence of different magnetic phases represented in Figs. 2(a) and 2(b), is in line with the well-known first-order character of this phase transition.8
B. Quantitative determination of Tt and hysteresis width
To quantitatively analyze the evolution of the stray field and the underlying changes in the magnetization of the FeRh film, we calculate the root-mean-square (RMS) deviation of the measured magnetic-field maps. This figure of merit, which gauges the spatial variations of the field, is computed as7
where is the field along the selected NV axis at pixel i, n is the total number of pixels, and is the average field over the region of interest. The temperature dependence of [Fig. 2(h)] exhibits an abrupt increase at , which gives a clear quantitative indication of the transition temperature, unlike the spatial magnetic-field maps discussed previously.
Below Tt, vanishes as there are no detectable FM domains within the AFM matrix.2 As the FM domains start to appear, the homogeneity of the stray field is reduced, resulting in an increase of between 368 and 388 K. With parallel to an easy axis (), the existing FM regions are expected to be magnetized along this direction and grow in size with increasing temperature, making the maps more uniform. The observed reduction of with further increasing temperatures is expected as a consequence of the magnetization decrease due to thermally excited magnons.
For , the anisotropy and in-plane bias fields point along different directions. The magnetization direction of the FM domains results from a balance between these two contributions, which evolve in a non-trivial way as function of the sample temperature, leading to a non-monotonous T dependence of above 388 K, which will be further investigated in Secs. II C and II D. The quantitative character of the applied statistical tools enables detecting small differences between the and measurements. It also provides a figure of merit for quantifying the hysteresis of the MMPT: upon cooling the sample, the extracted RMS deviation of the magnetic-field maps shows a similar behavior as along the heating branch but the curve is shifted ∼20 K lower. This value agrees well with the hysteresis width extracted from the temperature-dependent vibrating-sample magnetometry measurements [Fig. 1(b)].
C. Statistical analysis of the anisotropy
Recent numerical studies have concluded that the magnetocrystalline anisotropy (MCA) of FeRh thin films depends on epitaxial strain.21,22 Indeed, samples fabricated under different experimental conditions have been found to exhibit different degrees of MCA.22–24 We analyze the magnetocrystalline anisotropy of the sample using the two-dimensional autocorrelation function,
where we sum over each pixel, identified by its coordinates , and and are displacements in the and directions. This quantity gauges how similar the field at is to that at and is, therefore, a useful tool for quantifying the characteristic length scales of a magnetic-field map.
For a relatively low bias field (∼10 mT) and a temperature ∼20 K above [Figs. 3(a) and 3(b)], the measured maps display patterns with diagonal or vertical stripe-like features, when is aligned with a magnetic easy or hard axis of the material, respectively. These directional features are reflected in the corresponding autocorrelation maps [Figs. 3(e) and 3(f)]. Note that the vertical and diagonal stripes in Figs. 3(a) and 3(b) [and, equivalently, Figs. 3(e) and 3(f)] reflect a similarly oriented domain structure since the edges of the maps in Figs. 3(a) and 3(e) are parallel to the directions, while those of the maps in Figs. 3(b) and 3(f) are parallel to the directions.
Statistical characterization of the magnetocrystalline anisotropy of FeRh. (a)–(d) Stray-field maps for small bias field and temperature moderately above [(a) and (b)] and large bias field and temperature well above [(c) and (d)]. In (a), (c) the in-plane component of the bias field is parallel to an easy axis, while in (b), (d) it is parallel to a hard axis. Black arrows indicate crystalline directions of the FeRh lattice. Scale bar, 10 μm. (e)–(h) Normalized two-dimensional autocorrelation maps corresponding to the magnetic field distributions in (a)–(d), respectively. The scarlet dashed line in (h) indicates the FWHM of the central peak of the autocorrelation map, measured along [100]. Scale bar, 10 μm.
Statistical characterization of the magnetocrystalline anisotropy of FeRh. (a)–(d) Stray-field maps for small bias field and temperature moderately above [(a) and (b)] and large bias field and temperature well above [(c) and (d)]. In (a), (c) the in-plane component of the bias field is parallel to an easy axis, while in (b), (d) it is parallel to a hard axis. Black arrows indicate crystalline directions of the FeRh lattice. Scale bar, 10 μm. (e)–(h) Normalized two-dimensional autocorrelation maps corresponding to the magnetic field distributions in (a)–(d), respectively. The scarlet dashed line in (h) indicates the FWHM of the central peak of the autocorrelation map, measured along [100]. Scale bar, 10 μm.
For temperatures well above (∼40 K) and relatively high magnetic field (∼35 mT), the stray-field maps become nearly homogeneous when (easy axis), as FM domains start to occupy areas comparable to or larger than the imaged region [Fig. 3(c)]. This translates into a broad central peak in the associated autocorrelation map [Fig. 3(g)], representing the large uniformity of the stray field. On the other hand, when (hard axis), the measured field distributions also become smoother, but with well-defined diagonal features [Fig. 3(d)], which are manifested in the autocorrelation maps as sharp central peaks elongated along a magnetic easy axis [Fig. 3(h)]. This result agrees with the energy competition discussed in Sec. II B and highlights how the statistical approach strengthens the interpretation of real-space images.
D. Magnetic-field dependence of the MMPT
Next, we investigate the effect of the magnitude of the bias field on the magnetic configuration and show how the autocorrelation function enables a systematic study of the size and (re)orientation of FM domains. We find that while changing the magnitude of does not significantly affect the RMS deviation [Fig. 4(a)], it does alter the length scale of the spatial correlations [Fig. 4(b)]. We evaluate this length scale by considering the full width at half maximum FWHM[100] of the central peak of the autocorrelation maps taken along the [100] direction [dashed line in Fig. 3(h)]. Since FWHM[100] is a measure of the typical size of the features in the stray-field maps, it provides a figure of merit that is well suited to study the evolution of the size of the magnetic domains. Below , FWHM[100] is large because of the presence of extensive AFM regions. At the onset of the phase transition, FWHM[100] drops as small FM domains emerge and start producing highly granular stray-field configurations. This corresponds to the nucleation stage of the MMPT and is consistent with previous imaging studies of FeRh.19,24,25
Magnetic-field dependence of the metamagnetic phase transition of FeRh. (a) RMS deviation of the measured stray field distributions as a function of temperature for different values of the bias field along a hard axis. Each series of measurements is taken at a fixed bias field in the heating branch of the experiment. (b) Temperature dependence of the FWHM, measured along the [100] direction, of the central peak of the autocorrelation maps for the same values of the bias field as in (a). (c) Analysis of the rotation of domain walls in the magnetic texture of FeRh across the phase transition done by calculating the ratio of the FWHM of the central peak along [110] to the FWHM along [100] for the same bias field values of (a) and (b).
Magnetic-field dependence of the metamagnetic phase transition of FeRh. (a) RMS deviation of the measured stray field distributions as a function of temperature for different values of the bias field along a hard axis. Each series of measurements is taken at a fixed bias field in the heating branch of the experiment. (b) Temperature dependence of the FWHM, measured along the [100] direction, of the central peak of the autocorrelation maps for the same values of the bias field as in (a). (c) Analysis of the rotation of domain walls in the magnetic texture of FeRh across the phase transition done by calculating the ratio of the FWHM of the central peak along [110] to the FWHM along [100] for the same bias field values of (a) and (b).
For higher temperatures, the growth and coalescence of FM domains cause an increment of FWHM[100] that is larger for stronger bias fields. We interpret this as a result of the dominance of the Zeeman energy over the MCA energy in this temperature regime: as the bias field increases, FM domains with magnetization having a significant projection along the bias field start to expand to lower the Zeeman energy. These domains are predominantly elongated along [100] and, therefore, lead to higher FWHM[100] values. This interpretation could be corroborated by determining the magnetization direction of the FM domains via, e.g., scanning electron microscopy with polarization analysis24 or x-ray photoemission electron microscopy.19 We note that NV magnetometry does not allow an unambiguous reconstruction of the magnetization orientation from the measured stray field, as such reconstruction is an underconstrained inverse problem.2
Interestingly, we detect a reorientation of the domain walls across the MMPT when the bias field is applied along a hard axis [Fig. 4(c)]. This can be seen by analyzing the FWHM along different directions, which indicates the preferred direction of the spatial correlations in the stray-field maps. Specifically, by taking the ratio FWHM[110]/FWHM[100], we observe domain walls that align with a hard axis from the start of the MMPT up to T ≈ 388 K, as seen in Fig. 3(b). Above this temperature, domain walls parallel to an easy axis start to become more recurrent. When the phase transition is completed, the orientation parallel to [100] is dominant in the case of relatively high (∼35 mT), as illustrated in Fig. 3(d).
The domain-wall realignment is concomitant with the sudden decrease of the RMS deviation [Fig. 2(h)]. This decrease indicates a reorientation of the FM domains into a state that decreases the stray field. Thus, our results suggest that a reorientation of the FM domains is behind the domain-wall realignment. Such a rearrangement results from the changing balance between the anisotropy and Zeeman energies and could also be affected by the exchange coupling between FM and AFM regions that pins the FM domains in the first stages of the MMPT.13
Our analysis demonstrates how the autocorrelation function and its width in different directions provide figures of merit that are well suited for tracking the evolution and orientation of magnetic domain walls as a function of control parameters (here, the bias field strength and its direction).
III. CONCLUSIONS
Our results show how imaging the local state of a system and simultaneously quantifying the corresponding global behavior using statistical tools yield complementary insights into the temperature- and bias-field dependence of phase transitions in a magnetic material. In particular, we extracted the transition temperature and hysteresis width of the MMPT in an FeRh thin film by means of a statistical analysis of spatial stray-field images. Furthermore, we characterized the spatial correlations of the measured stray-field maps and proposed a simple way of gauging the alignment and reorientation of ferromagnetic domain walls based on quantifying the FWHM of the autocorrelation function.
The statistical methods employed here could be extended to characterize spatial correlations of stray fields generated by, e.g., coherent26 and incoherent spin-wave excitations.26–28 For maps of coherent spin waves, we anticipate that the spatial autocorrelation function could provide a useful figure of merit for assessing the predominant spin-wave directions and spatial periodicities. For incoherent spin waves, spatial maps of NV relaxation rates could provide insight into spatial variations of spin-wave densities. The methods could also be implemented in scanning-probe NV magnetometers to gain nanometric spatial resolution.29 This would enable studying spatial correlations at the nanoscale, paving the way for the imaging and characterization of phase transitions in other spatially correlated magnetic structures, such as Kagome lattices,30 spin glasses,31 and monolayer magnets.32 In such systems, the spatial autocorrelation function could, for instance, provide a figure of merit for assessing the spatial periodicity of the spin textures.
SUPPLEMENTARY MATERIAL
See the supplementary material for additional data obtained at bias magnetic fields of different magnitude and direction.
AUTHORS’ CONTRIBUTIONS
G.N.A. and I.B. contributed equally to this work.
ACKNOWLEDGMENTS
The authors thank Sheena K. K. Patel, Eric E. Fullerton, and Jan Aarts for their support and Ray Descoteaux for technical assistance. T.v.d.S. acknowledges funding from the Dutch Research Council (NWO) as part of the Frontiers of Nanoscience (NanoFront) program through NWO Projectruimte Grant No. 680.91.115. The work at CMRR, UCSD was funded by the DOE Grant No. DE-SC0003678.
DATA AVAILABILITY
All data contained in the figures are available on Zenodo.org at http://doi.org/10.5281/zenodo.4638723, Ref. 34. Additional data related to this paper are available from the corresponding author upon reasonable request.
APPENDIX: MATERIALS AND METHODS
1. Materials and methods
a. Sample fabrication
The diamond preparation procedure is described in Ref. 26. We use CVD-grown, electronic-grade type IIa diamonds (Element 6), which are laser-cut and polished down to 2 × 2 × 0.05-mm3 chips (Almax easylabs). These chips were cleaned with nitric acid, and the top ∼5 μm were removed using inductively coupled plasma (ICP) reactive-ion etching (30 min Ar/Cl, 20 min O2) to mitigate polishing damage. The chips were subsequently implanted with 15N ions at 6 keV with a dose of 1 × 1013 ions/cm2 (Innovion), tri-acid cleaned (mixture of nitric, sulfuric, and perchloric acid 1:1:1), annealed at 800 °C for 4 h at 10−6 mbar, and tri-acid cleaned again to remove possibly graphitized layers on the surface, resulting in an estimated density of NV centers of ∼1 × 1011 NV/cm2 at a depth of ∼10–20 nm.
The FeRh film is 20 nm thick, grown on an MgO substrate by DC magnetron sputtering at 450 °C and under an Ar pressure of 2 × 10−3 mbar.17 The sample was post-annealed at 800 °C and capped with 4 nm of Pt. Due to the mismatch between the lattice constants of FeRh and MgO, the [100] direction of MgO is parallel to the [110] direction of FeRh.
To attach an NV-containing diamond to the FeRh sample, a small droplet of isopropanol was deposited onto the FeRh, on top of which a diamond chip was placed with the NV-surface facing down. The diamond chip was gently pressed down until the IPA had evaporated. The typical resulting NV–FeRh distance is around 1–2 μm (limited by, e.g., dust particles) as reflected by the spatial resolution of our measurements.
b. Measurement setup
The optical setup used for all the measurements was a home-built confocal microscope. A 532 nm laser was used for optical excitation of the NV centers, focused to a diffraction limited spot by a 100×, NA = 0.95 objective. The NV luminescence was collected by the same objective, separated from the excitation light by a dichroic mirror and long-pass filter (633 nm cutoff), spatially filtered by a multi-mode optical fiber with a 50 μm diameter core and detected using a Si-PIN photodiode. The laser beam was scanned by a dual-axis galvanometer mirror. The microwave field was generated by a wire located ∼100 μm above the diamond.
c. NV magnetometry
The NV spins are initialized and read out using non-resonant optical excitation at 532 nm. A microwave magnetic field drives ESR transitions between the NV spin states ( and ). The NV spin state is read out by applying a laser pulse and measuring the spin-dependent photoluminescence that results from spin-selective non-radiative decay via a metastable singlet state. The ESR frequencies of the NV families in a magnetic field are determined by the NV spin Hamiltonian , where is the electron gyromagnetic ratio, D the zero-field splitting (2.87 GHz), and the Pauli spin matrices for spin 1.33 We apply the bias magnetic field using a small permanent magnet (diameter 1 cm, height 2 cm).
All magnetic images in Figs. 2–3 are composed of 100 × 100 pixels (pixel size: 0.5 μm). Both the and the ESR transitions are measured at each pixel, from which we extract the field components parallel () and orthogonal to the NV axis, using a feedback algorithm:20 At the first pixel, we measure a full ESR spectrum [Fig. 1(d), top panel], which we fit with a Lorentzian curve to extract its amplitude, width, and ESR frequency . This ESR frequency is then used as an estimate () for the ESR frequency at the next pixel. At this pixel, we measure the photoluminescence () at two frequencies () symmetric around the estimated value . We then calculate the error signal . The difference between the estimated value and the real ESR frequency is, to first order, proportional to this error signal. This allows us to calculate , which we then use to change the two measurements frequencies and when repeating the procedure on the following pixel.