Simultaneous wide-field imaging of phase and magnitude of AC magnetic signal using diamond quantum magnetometry

Spectroscopic analysis of AC magnetic signal using diamond quantum magnetometry is a promising technique for inductive imaging. Conventional dynamic decoupling like XY8 provides a high sensitivity of an oscillating magnetic signal with intricate dependence on magnitude and phase, complicating high throughput detection of each parameter. In this study, a simple measurement scheme for independent and simultaneous detection of magnitude and phase is demonstrated by a sequential measurement protocol. Wide-field imaging experiment was performed for an oscillating magnetic field with approximately \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$100\,\upmu \hbox {m}$$\end{document}100μm-squared observation area. Single pixel phase precision was \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2.1^{\circ }$$\end{document}2.1∘ for \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$0.76\,\upmu \hbox {T}$$\end{document}0.76μT AC magnetic signal. Our method enables potential applications including inductive inspection and impedance imaging.

A negatively charged nitrogen-vacancy (NV) center in diamond offers a promising material platform for quantum sensing 1,2 . Spin-state manipulation with a state-selective microwave (MW) pulse, combined with spin-dependent fluorescence has been utilized for spectroscopic measurement of magnetic field. Fabrication of a dense ensemble of NV centers [3][4][5][6] allows these measurements to be applied in wide-field imaging modality [7][8][9][10] , and local current characterizations using NV center have been achieved [11][12][13][14][15][16] . Wide-field imaging using NV center paves the way for inductive inspection 17,18 , which is still challenging with micron-scale resolution by established methods. Previous studies indicate that dynamical decoupling (DD) protocols like XY8 achieve magnetic field spectroscopy with high sensitivity for magnitude and phase of such a signa [19][20][21][22] . Measuring magnitude and phase of oscillating magnetic signal is at the heart of Eddy-current inspection based upon inductive and impedance sensing, enabling conductivity measurement 23,24 . Despite its high sensitivity, DD can only measure the output of fluorescence intensity with an intricate dependence on a magnitude and a phase of a signal. Therefore, a magnitude with a known phase or a phase with a known magnitude can only be measured with DD protocol 25 . Independent and simultaneous measurements of magnitude and phase for magnetic field spectroscopy in wide-field open up new diamond applications such an accurate inductive sensing.
In this study, we propose a stroboscopic measurement termed iQdyne 26 , a wide-field modality of Qdyne 27,28 enabled with lock-in detection, as a simple sensing scheme for magnitude b z and phase φ 0 of an oscillating magnetic field. The iQdyne provides an orthogonal measurement for magnitude and phase; it involves two input parameters (b z , φ 0 ) and time-series outputs I(b z )e iθ (φ 0 ) cos(2πft) . Fourier analysis easily extracts two resulting parameters, magnitude I(b z ) and phase θ(φ 0 ) , which are separated from each other and are readily interpretable.
We implemented this stroboscopic protocol on a wide-field microscope and demonstrated an imaging experiment of an oscillating magnetic field generated from a current pattern fabricated on a diamond substrate. An oscillating current generates an oscillating magnetic field due to Ampère's law. The wide-field observation area was approximately 100 × 100 µm 2 , and we estimated that single pixel precision for phase sensing was 2.1 • with 0.76 µT AC magnetic signal. This demonstration is a fundamental part of a local current investigation technique www.nature.com/scientificreports/ like local impedance microscopy and inductive testing method. Wide-field modality provides us an optically high spatial resolution and a wide observation area, leading to high throughputs for such measurements.

Principle
In this section, we describe our proposed scheme based on iQdyne and compare it with the conventional XY8 measurement. The XY8 sequence is a well-studied quantum sensing scheme, a sort of DD technique, providing excellent sensitivity for oscillating magnetic signals (Fig. 1a). The DD sequence generally consists of spin-flip pulses enabling to decouple the sensor spin from the environment and coupling to the environment selectively. The XY8 sequence consists of equally-spaced MW pulses, which detects an oscillating signal if the half of the oscillation period matches the pulse cycle. The iQdyne protocol is a quantum-classical hybrid measurement protocol comprising sequential measurements using DD with a precisely disciplined interval T L (Fig. 1a). Splicing the Fourier spectrum at the signal frequency and moving to the IQ diagram, the magnitude of the spectrum depends only on the signal magnitude, and the phase of spectrum directly accords with a signal phase (Fig. 1b). At first, we formulated the detection of an oscillating magnetic field using XY8 and pointed out inherent challenges. Let the magnetic field oscillation obey a cosine, and assuming the time at the origin t = 0 at the end of the former π half pulse, where b z , φ 0 , and f ac denote the magnitude, initial phase, and frequency of the oscillating field, respectively. Assuming that the interpulse spacing is half the reciprocal of the signal frequency and ignoring the finite length effect of the MW pulses, the electron spin phase acquired is expressed as after the XY8 sequence 25,29 , where γ e = 28.024 × 10 9 Hz · T −1 , N p , and κ represent the gyromagnetic ratio of the electron spin of the NV center, the number of π pulses in an XY8, and the proportional coefficient, respectively. The spin state is initialized along the x-axis of the Bloch sphere and read out by rotating around the x-axis, with the resulting fluorescence of XY8 given as (1) B ac (t) = b z cos 2πf ac t + φ 0 ,  www.nature.com/scientificreports/ where C 0 and C represent the average count and maximal fluorescence amplitude of the NV center, respectively. The resulting XY8 sequence signals intricately depend on the magnitude and phase of the oscillating magnetic field. In a working condition of φ 0 = 0 , it is completely insensitive for a phase shift but most sensitive for magnitude, and vice versa in φ 0 = π/2 . Therefore, XY8 requires a careful pre-adjustment of the working condition depending on the parameter of interest. Moreover, if the two parameters change simultaneously, distinguishing their effect becomes challenging. Next, we show that the dependence of the iQdyne signal on the parameters is simple. Assuming T L as an interval between sequential measurements, the oscillating signal phase advances with �φ = 2πf ac T L from one measurement to the next. Since the sampling interval T L is longer than the oscillation period 1/f ac , the resulting signal includes a low-frequency component due to Nyquist folding. Let f ac be the apparent frequency of the oscillation, another notation of the advancing phase is Then, an initial phase of the oscillating signal of the mth measurement is φ m = φ 0 + m�φ . The iQdyne result of the mth measurement is expressed as Using iQdyne protocol, the oscillating signal at f ac appears as several oscillating signals with the apparent frequencies given by f 2n+1 = (2n + 1)f ac , the magnitudes by I 2n+1 = 2C · |J 2n+1 (κb z )| , and the initial phases by is the first-kind Bessel function. These are directly observable using Fourier transform, and the derivation details are provided in the method.
Unlike XY8, the iQdyne protocol involves two output parameters, which the signal magnitude I 2n+1 depends only on the oscillation magnitude b z , and the phase θ 2n+1 depends only on the initial phase φ 0 , i.e., two parameters are orthogonal. The resulting phase θ 2n+1 corresponds linearly to the oscillating phase φ 0 , and its susceptibility is independent of the oscillation magnitude. The iQdyne protocol provides a simple and simultaneous measurement of magnitude and phase. Furthermore, this means that the iQdyne protocol does not need a pre-adjustment of the working condition, since the iQdyne measurement provides the magnitude and phase concurrently, ensuring interpretation is possible under any working condition.
We used an iQdyne protocol on a charge-coupled device (CCD) camera setup (Fig. 1c). Each DD measurement of iQdyne was N iter times iterated DD sequences and the CCD readout ( Fig. 1a), adjusting the iteration period T S to lock a multiple of the signal period. This modification enhances sensitivity like the lock-in amplifier and compensates the overhead due to the long readout time of the CCD, but the principle remains unchanged. We have reported details of this protocol and its frequency characteristics elsewhere 26 .

Result
Oscillating field measurement. In this section, demonstration of stroboscopic measurement using iQdyne on a wide-field microscope setup is described. The sensor involved a shallow and dense NV center ensemble on a IIa (100) diamond substrate (See Fig. 1c and sample #1 in the method). A 532 nm laser excitation via epi-and Köhler-illumination initializes and reads the spin states of the electrons, while a uniform MW radiation via a micro loop coil controls the electron spins. An oscillation signal as a sensing target at 1.908 MHz (oscillation period t ac = 524 ns ) was generated from a current path created on the surface by photolithography. Each DD protocol involved the N p = 64 pulsed XY8 sequence. The sensing conditions were as follows: measurement interval T S = 23.056 µs , number of iterations N iter = 100 , sampling interval T L = 7.314850 ms , and measurement length M = 1000 . Under these conditions, the target signal appears at f ac = 49.6 Hz.
The Qdyne response of the first peak magnitude against the applied field magnitude is displayed in Fig. 2a. The inset shows a typical spectrum measured with b z = 51 nT . The black dots represents the magnitude at the first peak. As derived earlier, this behavior is consistent with the Bessel function J 1 (κb z ) , assuming the oscillating field is proportional to an applied voltage (red curve). We swept the oscillation phase (Fig. 2b) at a working condition of b z = 51 nT ( κb z = 0.1 rad ). Since the proportional coefficient between the assigned initial and measured phases is exactly one, this also agrees with the theoretical description.
Wide-field imaging of an oscillating field along a current path. For stroboscopic imaging of the magnitude and phase of an oscillating magnetic field, we designed another wide-field microscope setup (Fig. 3a). The sensor was a shallow and dense NV center ensemble on a IIa (111) diamond substrate. The NV center was fabricated by 14 N + ion implantation with 6 keV acceleration and 2 × 10 13 cm −2 dose, creating an approximately 20 nm-thick layer (see sample #2 in the method). We created a situation with different magnitude and phase of the oscillating field ( f ac = 2.0 MHz ) in an approximately 100 × 100 µm 2 observation area. The oscillating field was generated from a meandering path deposited on the substrate by photolithography (center of Fig. 3a). The fluorescence of the NV center (right of Fig. 3a) corresponds to an intensity distribution of a green laser via a lens array. The thin sensor layer involved an NV ensemble oriented perpendicular to the substrate surface chosen by selective MW, so that measured signals represent a perpendicular component of the magnetic    www.nature.com/scientificreports/ independently. Higher magnitudes appear near the current path because the induced magnetic field obeys Ampère's law. Comparing the right and left sides of the current path, the measured phases are inverted due to Ampère's law. The inside of the meandering corner exhibits constructive interference of the magnetic field, with the zero-magnitude points (black arrows in Fig. 3c) corresponding to zero of the Bessel function. This zero line coincides with the boundary of phase inversion (white arrows in Fig. 3d) . Beyond the zero line, the phase is also inverted because the strength of the magnitude suffices for the Bessel function J(κb z ) to be minus.

Discussion
Considering its application for spectroscopy and testing, small phase shift detection by protocol is crucial. In this section, we discuss and define the noise floor for phase sensing, namely, precision of the phase shift. Figure 4a shows the typical iQdyne spectrum in Fig. 3b plotted on an IQ diagram. The red point represents the measured Fourier coefficient of the first peak while the semitransparent circles around the origin are Fourier coefficients except for this peak, corresponding to a noise floor. Assuming the noises contained in the measurements is Gaussian, its distribution on the IQ diagram is a two-dimensional (2D) Gaussian distribution with the origin as the mean. The probability distribution of the noise's magnitude is a Rayleigh distribution 30 , and one of the phases is the uniform distribution on the interval [0, 2π) . This forms a circle with radius as the standard deviation of the 2D Gaussian representing the precision of the data point. Then, we define the precision of the phase as a projected angle of this noise circle viewed from the data point (Fig. 4b). Through a geometric consideration, the precision δφ is formulated as where σ and r are the distance between the origin and the data point and the radius of the noise circle, respectively. This geometric definition is also justified through statistical estimation theory (see "Methods" section). For the data in Fig. 4a, the phase precision is 2.1 • , producing a measured phase of 62.3 ± 2.1 • , that was acquired at b z = 0.76 µT , κb z = 1.3 rad in T total ≃ 6 min within a 1.2 × 1.2 µm 2 active area corresponding to a single pixel. This phase precision means a noise floor of the out-of-phase magnetic field (imaginary part or I-axis) with b z sin δφ = 27 nT.
Moreover, we noted the robustness of phase sensing. The magnitude map (Fig. 3c) was affected by the intensity distribution of laser excitation (Fig. 3a, right), because the magnitude corresponded to the fluorescence intensity of NV centers. However, the phase map (Fig. 3d) indicated no effect from the excitation inhomogeneity. The reason is that the Fourier transform extracts the phase from the time-development of the fluorescence. This suggests an interesting approach; the phase sensing by our protocol composes a robust measurement with a signal-to-phase encoding translating some signal of interest as in the oscillation phase. Developing a concrete method for such encoding is a topic of future work.

Conclusions and outlook
We propose a new measurement protocol for an oscillating magnetic field based on iQdyne. The approach enables simultaneous detection of magnitude and phase in a wide-field setup without pre-adjusting the measurement condition. We verified that our protocol provides an orthogonal and readily interpretable measurement of magnitude and phase of the oscillation. Furthermore, we demonstrated an oscillating magnetic field imaging around a current path involving concurrent distribution of magnitude and phase with an approximately 100 µm wide-field observation area. We indicated that the single-pixel phase precision was 2.1 • , corresponding to a 1.2 µm-squared region.  www.nature.com/scientificreports/ The simultaneous measurement of the magnitude and phase of an oscillating magnetic field with high spatial resolution is useful, paving the way to localized current distribution microscopy. In particular, we note that the high spatial resolution of the NV center is suitable for a phenomenon that is zero in sum, but locally non-zero like a vortex 15 . Such a technique has significant applications for Eddy-current inspection, investigating materials or devices by high-frequency impedance imaging, current distribution on topological or 2D materials, and tiny scale inductive testing, which remain elusive with the existing methods.

Methods
Sample preparation. We fabricated two high-purity diamond samples named as sample #1 and #2. Both samples are single crystalline diamond substrates including natural abundance of 13 C atoms. Ensemble NV layers were produced by nitrogen ion implantation and subsequent annealing in vacuum, with uniform spatial distribution attributed to the larger ion beam relative to the substrate. The metal pattern on the surface is a 1 µm -thick Ti/Cu/Au fabricated by photolithography and electron beam deposition. The patterns were connected via gold wire bonding.
Sample #1 has a (100) top facet, with 14 N ions implanted at 6 keV energy and 2 × 10 13 cm −2 dose at 600 • C . Annealing was implemented at 800 • C for 2 h . The metal pattern includes -shaped MW loop antennas and linear patterns for MW and RF radiation. Sample #1 and MW antennas are the same as our previous work 26 . The bias magnetic field was around 8 mT.
Sample #2 has (111) top facet, with 15 N ions implanted at 6 keV energy and 2 × 10 13 cm −2 dose at 600 • C . Annealing was implemented at 800 • C for 2 h. The metal pattern includes meander and linear patterns for RF radiation. The MW control for the sample #2 experiment was applied via a planar resonator with the diamond substrate mounted. This antenna used is a modified version of that reported in our previous work 21 . The MW distribution is almost uniform, but the MW strength is slightly stronger at points close to the current path due to coupling between the current path and MW resonator. The bias magnetic field was around 2 mT.
Detail of experimental setup. The excitation light is generated from an optically pumped semiconductor laser (Coherent, Verdi G5) and chopped by an acousto-optic-modulator (Gooch & Housego, 35250-.2-.53-XQ). The laser illumination involves epi-and Köhler-illumination optics for initialization and readout of electron spins. The laser is focused onto the back focal plane of an objective lens to enlarge the excitation area. The lens array reduces the spatial coherence and mitigates the interference. The laser passes through an objective lens and fluorescence from the NV center is collected by the same objective and detected by the EMCCD camera (Andor, iXon3 860). Most of the sampling interval T L ≃ 7 ms accounts for the readout process (approximately 5 ms ) of CCD pixels, which is a main factor of the iQdyne bandwidth. The objectives are a 60 × air objective (Olympus, PlanApoN 60XO) for #1 and a 20 × oil objective (Olympus, MPLFLN20X) for #2. The MW pulses are generated by a signal generator with a quadrature (IQ) modulation (Keysight, N5182B), switched by Mini-Circuits, ZASWA-2-50DR+, and amplified by R&K, CGA701M602-4444R. The target signals are generated by a function generator (NF Corporation, WF1967). All timings are controlled by a data timing generator (Tektronix, DTG5274). For the Qdyne-type protocol, stabilizing the sampling interval is crucial. A frequency standard (Stanford Research Systems, FS725) disciplines clocks of all instruments.

Derivation of dependencies of XY8 and Qdyne on parameters.
In this section, we formulate the dependencies of each measurement protocol on the magnitude b z and initial phase φ 0 . Let C and C 0 be the average fluorescence intensity of an NV center and the amplitude of intensity, respectively, these are then expressed as where F |m S � is the fluorescence intensity when the spin state of the NV center is |m S � . We selected the readout axis to be the same direction as the initial superposition state, with the resulting intensity of the XY8 protocol given as where is the accumulated phase on the spin state 25 . Equally space dynamical decouplings including XY8 consist of interrogation time τ , π flip pulse, interrogation time, and their repetitions: (−τ − π − τ −) ×N p . Assuming a target field is an oscillating signal B ac (t) = b z cos 2πf ac t + φ 0 , XY8 provides high sensitivity when its interpulse spacing equals a half of the oscillation cycle ( τ = t ac /4 ). Every pulse makes a virtual flip of a signal which the electron is detecting. For example, the electron spin senses a magnetic field +B ac (t) in 0 ≤ t < t ac /4 and −B ac (t) in t ac /4 ≤ t < 2t ac /4 with a MW pulse at t = t ac /4 . The accumulation by N p -pulsed XY8 sequence is expressed as Here, we used the following relation The Qdyne signal is expressed as the sum of odd order components of the signal frequency. We can write the (2n + 1) th term using the magnitude I 2n+1 , phase θ 2n+1 , and frequency f 2n+1 as Since equivalent parameter sets like (I, f , θ) = (I, −f , −θ) exist, we impose constraints I 2n+1 ≥ 0 and f 2n+1 ≥ 0 . Therefore, the sign of the phase is determined by the magnetic field b z and the signal frequency f ac . Alternatively, the sign of θ 2n+1 is determined by two factors: the number of times that κb z crosses zero of the Bessel function and the number of times that the Nyquist folding occurs. Eventually, the Qdyne signal is given as follows So, we obtain I 2n+1 = |2CJ 2n+1 (κb z )| and |θ 2n+1 | = (2n + 1) · |φ 0 | . The resulting magnitude I 2n+1 depends only on the magnetic field b z , whereas the resulting phase θ 2n+1 relies only on the initial phase φ 0 , i.e., the Qdyne protocol achieves an orthogonalized measurement regarding the magnitude and phase of an oscillating signal. Finaly, each frequency component cos(2πf 2n+1 t m + θ 2n+1 ) appears as Nyquist-folded signal cos(2πf 2n+1 t m + θ 2n+1 ) since the sampling rate 1/T L is slower than the frequencies f 2n+1 (See the next section).
(23) (−1) n · 2J 2n+1 (κb z ) cos 2π · (2n + 1)f ac · t m + (2n + 1)φ 0 = I 2n+1 cos(2πf 2n+1 t m + θ 2n+1 ).  www.nature.com/scientificreports/ Nyquist folding and apparent frequency. In the undersampling condition when the sampling interval T L is longer than half of the target frequency, the oscillating signal with the frequency f s and initial phase φ 0 resemble another oscillating signal with an apparent frequency f s and an apparent phase φ 0 due to Nyquist folding. At first, the phase advancing is congruent with modulo 2π with the relationship expressed as: In the Fourier spectrum, the frequency axis spans (−1/2T L , 1/2T L ] , but the apparent frequency is in [0, 1/2T L ] . Considering the negative frequency, we obtain a modified phase advancing �φ ′′ given by where ⌊x⌋ is a floor function and x − ⌊x⌋ represents the fractional part of x. This produced the apparent frequency as Considering a case where the frequency f s increases from 0, Nyquist folding occurs under the condition that the product T L × f s is an integer or a half-integer. The apparent phase flips after each folding, and therefore, an apparent phase is obtained from the following Definition of phase precision. In the main text, we define phase precision by a geometric and intuitive illustration. In this section, we justify this definition through the statistical estimation theory. Our measurement scheme involves estimation of two parameters, radius r and angle θ from a complex observed value Z with noise. Let X 1 and X 2 be the real and imaginary parts, respectively. Assuming X i (i = 1, 2) obey a normal distribution with a variance σ 2 independently, the probability distribution functions are as follows: Then, a likelihood function L(r, θ) and Fisher information matrix I are obtained as: According to the Cramèr-Rao inequality, the standard deviation of any unbiased estimator θ of θ is bounded by the reciprocal of the square root of the Fisher information, expressed as: Meanwhile, in this situation, our definition of the phase precision δθ is: Therefore, our definition is above the Cramèr-Rao bound and equals the bound asymptotically with a small noise (σ ≪ r).

Data availability
The datasets generated during and/or analysed during the current study are available from the corresponding author on reasonable request.