## Abstract

The ability to sensitively image electric fields is important for understanding many nanoelectronic phenomena, including charge accumulation at surfaces^{1} and interfaces^{2} and field distributions in active electronic devices^{3}. A particularly exciting application is the visualization of domain patterns in ferroelectric and nanoferroic materials^{4,5}, owing to their potential in computing and data storage^{6,7,8}. Here, we use a scanning nitrogen-vacancy (NV) microscope, well known for its use in magnetometry^{9}, to image domain patterns in piezoelectric (Pb[Zr_{0.2}Ti_{0.8}]O_{3}) and improper ferroelectric (YMnO_{3}) materials through their electric fields. Electric field detection is enabled by measuring the Stark shift of the NV spin^{10,11} using a gradiometric detection scheme^{12}. Analysis of the electric field maps allows us to discriminate between different types of surface charge distributions, as well as to reconstruct maps of the three-dimensional electric field vector and charge density. The ability to measure both stray electric and magnetic fields^{9,13} under ambient conditions opens opportunities for the study of multiferroic and multifunctional materials and devices^{8,14}.

## Main

Real-space imaging of electric fields at the nanoscale is an important aim across many emerging fields, as near-surface fields are tied to the electrical polarization or charge distribution of the underlying system. Sensitive imaging of nanoscale electric phenomena has been demonstrated by a number of techniques, most prominently by electrostatic force microscopy^{15} and piezoresponse force microscopy (PFM)^{4}, along with the related techniques of Kelvin probe force microscopy^{16}, low-energy electron microscopy^{5} and emerging scanning quantum technologies^{1,17}. However, most of these techniques are limited to low temperatures or high-vacuum conditions, require thin-film samples and back electrodes and measure indirect quantities, such as piezoelectric coefficients or surface potentials. Nitrogen-vacancy (NV) centres in diamond^{9,13,18} provide a path to quantitatively image electric fields under ambient conditions, do not require back electrodes or applied voltages and measure a quantity directly proportional to the surface polarization.

In this work, we apply scanning NV microscopy to map static electric stray fields above surfaces with sub-100 nm resolution. Using mechanical oscillation of the tip^{12} to overcome the challenges of static screening^{19} and low coupling to electric fields^{10,11}, we reach an excellent sensitivity of 0.24 kV cm^{−1} Hz^{−1/2}, on a par with the sensitivities demonstrated for a.c. field detection in bulk diamond^{11}. We illustrate the impact of our approach by imaging patterned domains in application-relevant^{6} ferroelectric thin films and by mapping the natural domain configuration in a prototypical improper ferroelectric.

Electric field sensing with NV centres relies on a local electric Stark effect. The Stark effect causes a shift in the NV spin energy levels that is measured using optically detected magnetic resonance (ODMR)^{10,11}. The Stark effect is anisotropic and largest in the transverse plane of the NV centre, which sits perpendicular to the anisotropy axis (*z*_{NV} axis). This leads to an in-plane electric field coupling that is approximately 50× larger than the out-of-plane coupling^{11,13}. To maximize the in-plane electric field response and simultaneously suppress the response to magnetic fields, a small magnetic bias field is applied transverse to the NV anisotropy axis. Electric field detection in this configuration has previously been demonstrated in bulk diamond, where electric fields are created with external electrodes^{11,20,21}, charged scanning probes^{22,23}, surface band bending^{24} and intrinsic dopant charges^{25}.

In our experiment, the NV centre is embedded in the tip of a diamond scanning probe (Fig. 1a). The scanning probe arrangement allows us to extend electric field sensing to image general materials systems, including ferroelectrics. We mount the diamond probe on a quartz tuning fork oscillator providing force feedback for safe approach and scanning. Owing to the tip fabrication procedure, the NV anisotropy axis is ~35° away from the scan plane (Fig. 1b).

To enable electric field (*E*) detection, we accurately orient an external bias field of 5−12 mT transverse to *z*_{NV} (*θ*_{B} = 90°) with ~0.5° of uncertainty (Methods). In this bias field configuration, the spin transition frequencies *ω*_{±} are linearly sensitive to electric fields,

while correcting for magnetic fields up to second order^{11,13}. Here, \({\omega }_{\pm }^{(0)}\) are the spin resonance frequencies in the absence of the electric field (Supplementary Section 1), *k*_{⊥} = 16.5 Hz V^{−1} cm is the coupling constant^{21}, *E*_{⊥} is the magnitude of the in-plane **E** field vector and \({\varphi }_{B}=\arctan ({B}_{{y}_{{{{\rm{NV}}}}}}/{B}_{{x}_{{{{\rm{NV}}}}}})\) and \({\varphi }_{E}=\arctan ({E}_{{y}_{{{{\rm{NV}}}}}}/{E}_{{x}_{{{{\rm{NV}}}}}})\) are the in-plane angles of the magnetic bias field and electric field vectors, respectively (Fig. 1c). Equation (1) neglects strain interactions (Methods). The angular dependence on the bias field results in a maximal frequency shift when *φ*_{E} = −2*φ*_{B} (modulo π), defining the detection axis (Fig. 1c). To polarize, manipulate and detect the NV spin state we use a combination of laser and microwave pulses, together with a single-photon counting module (Fig. 1a,d and Methods).

An important concern with static field measurements is screening of electric fields by mobile charges on the diamond tip (Fig. 1b). This issue has hindered previous attempts at implementing a scanning NV electrometer^{19,26}. To overcome this screening, we oscillate the diamond sensor using the mechanical resonance (*f* ≈ 32 kHz) of the tuning fork and detect the resulting a.c. electric field (Fig. 1d). This a.c. electric signal is proportional to the electric field gradient in the oscillation direction^{12}. In addition to alleviating static screening, the a.c. detection also improves sensitivity by at least an order of magnitude^{11,12,18}. For the spin-echo pulse sequence shown in Fig. 1d, the field-induced coherent phase accumulation of the NV spin is \({\phi }_{\pm }=\pm 4{k}_{\perp }{E}_{{{{\rm{ac}}}}}\cos (2{\varphi }_{B}+{\varphi }_{{E}_{{{{\rm{ac}}}}}}){\sin }^{2}(\uppi f\tau /2)/f\) where \({E}_{{{{\rm{ac}}}}}={x}_{{{{\rm{osc}}}}}\sqrt{{({\partial }_{x}{E}_{{x}_{{{{\rm{NV}}}}}})}^{2}+{({\partial }_{x}{E}_{{y}_{{{{\rm{NV}}}}}})}^{2}}\) and \({\varphi }_{{E}_{{{{\rm{ac}}}}}}=\arctan ({\partial }_{x}{E}_{{y}_{{{{\rm{NV}}}}}}/{\partial }_{x}{E}_{{x}_{{{{\rm{NV}}}}}})\), *x*_{osc} is the oscillation amplitude along *x* and *τ* is the evolution time (Supplementary Section 1).

We demonstrate scanning electrometry by imaging the electric fields appearing above the surfaces of two ferroelectric materials. Our first sample is a 50-nm thick film of out-of-plane polarized lead zirconate titanate (Pb[Zr_{0.2}Ti_{0.8}]O_{3}, PZT) grown on top of a SrRuO_{3}-buffered (001)-oriented SrTiO_{3} substrate. PZT, the most technologically important ferroelectric, has a large polarization (*P* ≈ 75 μC cm^{−2}) that is ideal for an initial demonstration. To create recognizable structures, we write a series of ferroelectric domain patterns by locally inverting the polarization of the film using a conductive atomic force microscopy (AFM) tip. Figure 2a shows an image of the out-of-plane PFM contrast corresponding to one of these patterns.

Figure 2b presents an NV electrometry map taken above the same location. Owing to our gradiometric detection scheme, the signal is maximum near vertical edges of the pattern. This directionality reflects the horizontal oscillation direction of the sensor, and other oscillation directions (such as a tapping mode) may be used to acquire different spatial signatures^{12}. To verify that the signal is indeed due to electric fields, we purposely misalign the bias field to *θ*_{B} = 95° (Supplementary Fig. 1) and 180° (Fig. 2c). As expected, the signal disappears under the bias field misalignment as the NV centre becomes insensitive to electric fields. We additionally tried detecting the *E* field in a d.c. sensing mode and observed no signal (Extended Data Fig. 1). Thus, dynamic (a.c.) operation is essential for overcoming screening and enabling static electric field sensing. Detection at higher frequencies, and with multipulse measurement schemes, is shown in Extended Data Fig. 1 and Extended Data Fig. 2.

By rotating the in-plane angle *φ*_{B} of the bias field, we can rotate the in-plane detection axis (Fig. 1c)^{11}. In particular, by acquiring electric field maps shifted in *φ*_{B} by 45°, it becomes possible to map two orthogonal components of the *E* field signal. Figure 2d shows such orthogonal electric gradient maps from a square domain. The experimental maps are in good agreement with numerical simulations of a square domain with constant surface charge (Fig. 2e). By combining the orthogonal field components we are able to reconstruct the full three-dimensional electric field vector above the domain (Fig. 2f and Methods). In principle, field maps such as Fig. 2f could allow measurement of the domain wall width and of its possible chiral state^{27}. However, our spatial resolution (~100 nm; Extended Data Fig. 3) is not yet sufficient to resolve the structure of the <10 nm domain walls in PZT^{28}. Using reverse propagation of Coulomb’s law, we also compute the equivalent surface charge density *σ* (from the polarization **P**) at the top surface of the ferroelectric film (Fig. 2g and Methods), where *σ* = **P** ⋅ **n** and **n** is the surface normal. The reconstruction involves two charge sheets of opposite sign, since further analysis (below) reveals the presence of charges beneath the surface. Our result is in excellent agreement with the out-of-plane PFM image shown in Fig. 2h, where both a defect and the asymmetric shape of the domain are reproduced.

To further interpret our measurements we develop simple models of surface charge distributions and their associated electric field gradients (Fig. 3a–d). By comparing these to the experimental line scans (Fig. 3e), we can discriminate between different surface charge scenarios and extract quantitative information on the surface charge density *σ*. We find that our data are best fit by the model shown in Fig. 3a, which includes two layers of opposite charges on the top and bottom of the PZT sample. The other models (Fig. 3b–d) are inconsistent with the polarity or shape of the experimental line scans. In particular, the Lorentzian shape of the \({E}_{z}^{{{{\rm{lab}}}}}\) field gradient produced by a net surface charge (models in Fig. 3b,c) fails to reproduce the dips in the signal at either side of the domain. Additionally, the models in Fig. 3c,d would result in a polarity opposite to what is expected from the known polarization of our PZT sample. The ability to distinguish between different charge models and to quantify the screening efficiency of a back electrode will be useful for analysing charge dynamics and screening behaviour at ferroelectric domain walls, interfaces and surfaces^{29}, even once the materials are buried in a device architecture^{30}.

Fits to the line scans in Fig. 3e yield an effective surface charge density of approximately *σ* = (3.5 ± 0.3) × 10^{−3} μC cm^{−2}. The fits use the known bias field direction, NV centre orientation and stand-off distance (Methods and Supplementary Section 2). This surface charge density is about four orders of magnitude lower than the expected value for our PZT sample (75 μC cm^{−2}, ref. ^{31}). The large difference may be attributed to a number of screening mechanisms on both the sample and diamond tip. This includes surface screening from adsorbates^{32} or the formation of a charged, off-stoichiometric surface layer^{33} at the surface of the film. On the diamond tip, screening could be a result of the dielectric constant (*ϵ*_{r} = 5.7) as well as partial screening from an adsorbed water layer and mobile charges still present at ~32 kHz (ref. ^{19}). Calibration against a known electrode may allow disentangling tip and sample screening^{34}.

We further illustrate scanning electrometry by imaging the natural domain pattern of an improper ferroelectric, the hexagonal manganite YMnO_{3}. Hexagonal manganites are exciting benchmark materials because their surface polarization (*P* ~ 5.5 μC cm^{−2} for YMnO_{3}) is over an order of magnitude smaller than our PZT sample and typical for ferroelectric and multifunctional materials^{8,14}. In addition, hexagonal manganites are type I multiferroics and become antiferromagnetically ordered below *T*_{N} ~ 100 K (refs. ^{14,35}). While the antiferromagnetic domain pattern has been imaged with scanning NV magnetometry at cryogenic temperatures^{26}, here, we focus on the ferroelectric domain pattern accessible under ambient conditions.

Figure 4a shows an electrometry map recorded above a polished, bulk YMnO_{3} sample. Although the signal-to-noise ratio is lower compared to the PZT data, as expected from the smaller polarization, domains (including vortex domains) are clearly visible and resemble the pattern observed by PFM (Fig. 4b). The NV electrometry image also reveals long, straight line-like features and defects, which we interpret as charge accumulation near topographic features such as polishing marks. Correlative magnetic measurements over the same region show no magnetic signal (Supplementary Fig. 2).

In summary, we demonstrate nanoscale electric field imaging using a scanning NV microscope. Crucial to our experiment is the use of gradiometric detection^{12}, which both alleviates static field screening at the diamond surface and greatly improves the sensitivity compared to static sensing schemes. The electric field sensitivity of ~0.24 kV cm^{−1} Hz^{−1/2} demonstrated in our work (Extended Data Fig. 2) is similar to that shown in the bulk^{11}.

By imaging ferroelectric domains through their stray electric fields we demonstrate a complementary imaging method to existing scanning probe techniques. While the spatial resolution (~100 nm) demonstrated in our work is currently outmatched by these techniques^{4,15,16}, moving the tip closer to the sample surface is expected to lower this value to below 50 nm, and perhaps below 30 nm (ref. ^{36}). Moreover, the long measurement times of several seconds per pixel can be reduced through increased dynamical decoupling and excited-state spectroscopy at cryogenic temperatures^{37}. The benefits of NV electrometry lie in its non-perturbing aspect, as it can quantitatively measure an unknown electric dipole configuration (electrical polarization and buried charged planes) without the need of back electrodes or applied voltages, all without topographic cross-talk in the measurement signal.

Looking towards future applications, an intriguing prospect is the correlative imaging of magnetic and electric fields in multiferroic and multifunctional materials^{35,38}. Since the sensitivity to electric and magnetic fields can be adjusted by a simple re-orientation of the magnetic bias field, magnetic and electric field maps can be recorded from the same sample region without breaking experimental conditions. This will allow analysing multiple-order parameters in situ. Together, the multimodal capability opens exciting opportunities to study magneto-electric coupling and detail the formation and structure of domains and domain walls in these multifaceted and technologically relevant materials. Finally, the ability to probe buried charged surfaces may be instrumental in the pursuit of energy-efficient device concepts based on electric field control of magnetization^{39,40}.

*Note added in proof*: While finalizing this manuscript, we became aware of related work^{34} describing scanning NV electrometry using a similar gradiometry technique to image electric fields from electrodes.

## Methods

### Experimental set-up

Experiments were performed at room temperature with a custom-built scanning NV microscope. Micro-positioning was carried out by a closed-loop three-axis piezo stage (Physik Instrumente) and AFM feedback control was carried out by a lock-in amplifier (HF2LI, Zurich Instruments). Photoluminescence of the NV centres was measured with an avalanche photodiode (Excelitas) and data were collected by a data acquisition card (PCIe-6353, National Instruments). Microwave pulses and sequences were created with a signal generator (Quicksyn FSW-0020, National Instruments) and modulated with an IQ mixer (Marki) and an arbitrary waveform generator (HDAWG, Zurich Instruments). NV centres were illuminated at <100 μW by a custom-designed 520 nm pulsed diode laser. Scanning NV tips were purchased from QZabre AG. Two tips were used throughout this study. Tip no. 1 (Figs. 2 and 3) had a stand-off distance of *z* = 95 ± 1 nm and tip no. 2 (Fig. 4) had a stand-off distance of *z* = 61 ± 2 nm (not including the 20 nm retract distance used while imaging), determined with a magnetic stripe^{41}. Oscillation amplitudes were ~46 nm in Figs. 2b,d and 3e, ~92 nm in Fig. 2c and ~52 nm in Fig. 4a, determined via stroboscopic imaging^{12}. A movable permanent neodymium magnet (supermagnet) below the sample served as the bias field source. Field alignment was possible by applying a fitting algorithm, which used a numerical model of the field produced by the magnet and NV resonance frequencies as a function of magnet position. The drift stability of the microscope was <30 nm per day and no drift correction techniques were employed.

### Spin energy levels in a transverse magnetic field

With an off-axis field, the usual spin-state description (using *m*_{s}) of the NV centre is not ideal, as the magnetic quantum number *m*_{s} is no longer conserved. In this scenario the eigenstates, which we denote as \(\left\vert 0\right\rangle\), \(\left\vert -\right\rangle\) and \(\left\vert +\right\rangle\), are superpositions of the usual \(\left\vert {m}_{{{{\rm{s}}}}}\right\rangle\) states^{13,42}. Spin-state mixing results in a reduced photoluminescence and optical contrast, which worsened the overall measurement sensitivity. This effect, however, is manageable for relatively weak (<12 mT) bias fields^{43}. Bias fields <5 mT are also non-ideal, as ^{15}N hyperfine coupling effectively misaligns small bias fields.

### Alignment of the transverse magnetic field

The alignment algorithm of the bias field provided the ability to align with roughly 1° of uncertainty; however, we improved the alignment by additionally considering hyperfine interactions^{42}. In an off-axis bias field (*θ*_{B} = 90°) the \(\left\vert 0\right\rangle\) state splits into two states that differ by Δ = 2*a*_{hf}*γ*_{e}*B*/*D*, where *a*_{hf} = 3.65 MHz is the off-axis ^{15}N hyperfine coupling parameter, *γ*_{e} = 2π × 28 GHz T^{−1} is the gyromagnetic ratio of the electron, *B* is the applied magnetic field and *D* = 2.87 GHz is the zero-field splitting^{25}. When deviating from *θ*_{B} = 90°, the on-axis component splits each of the \(\left\vert -\right\rangle\) and \(\left\vert +\right\rangle\) states through ^{15}N hyperfine interaction resulting in eight total transitions (four for *ω*_{−} and four for *ω*_{+}). We swept the fitted polar angle a few degrees around 90° (with the same field magnitude) and tracked the *ω*_{−} hyperfine resonances. The best alignment was achieved when only two resonances were visible and when the resonance frequency was the largest (on-axis contributions decreased the resonance frequency).

### Influence of crystal strain

Internal strain in the diamond acts equivalently as a permanent d.c. *E* field via the piezocoupling coefficient^{44}. For in-plane strains much weaker than electric signals (which is assumed during our analysis) the effect of strain is unimportant. For large in-plane strains (relative to the electric signal), it is still possible to carry out scanning gradiometry without a loss in sensitivity. In this case, the detection axis is controlled by the strain direction (Supplementary Section 1). The angular dependence changes from \(\cos \left(2{\varphi }_{B}+{\varphi }_{{E}_{{{{\rm{ac}}}}}}\right)\) for small strains to \(\cos ({\varphi }_{\xi }-{\varphi }_{{E}_{{{{\rm{ac}}}}}})\cos \left(2{\varphi }_{B}+{\varphi }_{\xi }\right)\), where *φ*_{ξ} is the in-plane strain angle.

### Laboratory and NV centre frames of reference

To translate between the laboratory frame and NV centre frame a representation of the NV centre’s crystallographic coordinate system is determined in the laboratory frame. The laboratory frame is defined by the vectors \(\hat{x}=[1,0,0]\), \(\hat{y}=[0,1,0]\) and \(\hat{z}=[0,0,1]\). The unit vector along the symmetry axis of the NV centre (\({\hat{z}}_{{{{\rm{NV}}}}}\)) pointing from the nitrogen atom towards the vacancy site, is chosen as the [111] crystallographic direction. The *x* unit vector (\({\hat{x}}_{{{{\rm{NV}}}}}\)) is taken to be orthogonal to \({\hat{z}}_{{{{\rm{NV}}}}}\) and pointing from the vacancy site towards one of the three nearest carbon atoms (\([11\overline{2}]\) for example, although there are three possible choices)^{13,45}. Then \({\hat{y}}_{{{{\rm{NV}}}}}={\hat{z}}_{{{{\rm{NV}}}}}\times {\hat{x}}_{{{{\rm{NV}}}}}\) to preserve right-handedness. To translate between the crystallographic frame and the laboratory frame the bias field alignment algorithm and known (001) cut of the diamond tip is used. For example, with the NV centre angles of *θ*_{NV} = 55° and *φ*_{NV} = 0° (as shown in Fig. 1b), we get \({\hat{x}}_{{{{\rm{NV}}}}}=\frac{1}{\sqrt{3}}[1,0,-\sqrt{2}]\), \({\hat{y}}_{{{{\rm{NV}}}}}=[0,1,0]\) and \({\hat{z}}_{{{{\rm{NV}}}}}=\frac{1}{\sqrt{3}}[\sqrt{2},0,1]\). It is important to note that using a different NV centre reference frame definition can result in an incorrect computation of laboratory-frame electric fields (Supplementary Section 5).

### Gradiometry technique

A complete description of scanning gradiometry, including calibration procedures, can be found in ref. ^{12}. An ~2 μs laser pulse was used to polarize the NV centre into the *m*_{s} = 0 state, which for small off-axis bias fields corresponds to the \(\left\vert 0\right\rangle\) state. Next, a microwave π/2 pulse is applied to create a superposition between \(\left\vert 0\right\rangle\) and one of \(\left\vert \pm \right\rangle\). The quantum phase *ϕ* accumulated between the two states during the coherent precession is \({\phi }_{\pm }=\int\nolimits_{0}^{\tau }g(t){{\Delta }}{\omega }_{\pm }(t){\mathrm{d}}t\), where *g*(*t*) is the modulation function^{46}, \({{\Delta }}{\omega }_{\pm }(t)=\mp 2\uppi {k}_{\perp }{E}_{{{{\rm{ac}}}}}(t)\cos (2{\varphi }_{B}+{\varphi }_{{E}_{{{{\rm{ac}}}}}})\sin (2\uppi ft)\) is the detuning (see Supplementary Section 1) and *τ* is the evolution time. We used a four-phase cycling technique^{12,47} of the last π/2 pulse to measure *ϕ*_{±}. The readout of the NV centre’s spin state was performed by another ~2 μs laser pulse, during which the photons emitted from the NV centre were collected across a ~600 ns window.

### Samples

#### Lead zirconate titanate

The 50 nm thick Pb[Zr_{0.2}Ti_{0.8}]O_{3} film and the 10 nm thick SrRuO_{3} electrode were grown on (001)-oriented SrTiO_{3} (CrysTec) using pulsed-layer deposition with a KrF excimer laser at 248 nm (LPXpro, Coherent). SrRuO_{3} was grown at a substrate temperature of 700 °C with an O_{2} partial pressure of 0.1 mbar and a laser fluence of 0.95 J cm^{−2} at 4 Hz. Pb[Zr_{0.2}Ti_{0.8}]O_{3} was grown at 550 °C at 0.12 mbar O_{2} partial pressure and a laser fluence of 1.2 J cm^{−2} at 4 Hz. The film was subsequently cooled to room temperature under growth pressure. Layer thicknesses were measured using X-ray reflectivity with a four-cycle thin-film diffractometer (PANalytical X’Pert^{3} MRD, CuK*α*_{1}). Topography and PFM experiments were performed on a Bruker Multimode 8 atomic force microscope using Pt-coated Si tips (MikroMasch, *k* = 5.4 N m^{−1}).

#### Hexagonal yttrium manganite

The YMnO_{3} bulk crystal was grown by the floating-zone technique, pre-oriented using Laue diffraction and cut perpendicular to the crystal *z* axis with a diamond saw. The sample was flattened by lapping with Al_{2}O_{3} powder in water solution (9 μm particle size). Subsequently, the sample was chemomechanically polished using a colloidal silica slurry. To generate domains, the sample was pre-annealed and cooled through the Curie temperature *T*_{C} in an O_{2} atmosphere^{48}.

### Electric field vector reconstruction

To reconstruct the *E* field vector (Fig. 2f and Extended Data Fig. 4) the two images recorded with a 45° difference in *φ*_{B}, denoted as \({I}_{1}(x,y)={E}_{{{{\rm{ac}}}}}\cos (2{\varphi }_{B}+{\varphi }_{{E}_{{{{\rm{ac}}}}}})\) and \({I}_{2}(x,y)={E}_{{{{\rm{ac}}}}}\sin (2{\varphi }_{B}+{\varphi }_{{E}_{{{{\rm{ac}}}}}})\), are combined to yield the magnitude (*E*_{ac}(*x*, *y*)) and angle (\({\varphi }_{{E}_{{{{\rm{ac}}}}}}(x,y)\)) of the measured electric field signal

Since there are three possible choices for \({\hat{x}}_{{{{\rm{NV}}}}}\), owing to the *C*_{3ν} symmetry of the NV centre, *φ*_{B} and \({\varphi }_{{E}_{{{{\rm{ac}}}}}}(x,y)\) are only known up to a multiple of 2π/3. This propagates to the *E* field gradients along the *x* and *y* directions of the NV centre, which are calculated as

where *x*_{osc} is the tip oscillation amplitude and ∂_{r} is the directional derivative along the unit vector \(\hat{r}=\hat{x}\cos \alpha +\hat{y}\sin \alpha\) in the laboratory frame and *α* is the in-plane oscillation angle. With either of these images it is possible to reconstruct the laboratory components of the *E* field gradients in Fourier space. For example, with \({\hat{x}}_{{{{\rm{NV}}}}}\) the laboratory-frame *E* field gradient vector is

where \({{{\mathcal{F}}}}\) is the Fourier transform, **K** = [*i**k*_{x}, *i**k*_{y}, *K*] and \(K=\sqrt{{k}_{x}^{2}+{k}_{y}^{2}}\). The laboratory-frame vector components can be determined independent of the three possible \({\hat{x}}_{{{{\rm{NV}}}}}\) and \({\hat{y}}_{{{{\rm{NV}}}}}\) choices because the term in the denominator removes its influence. The last step is integration in Fourier space with a wavevector-dependent window function that cuts off high-frequency terms (using a Hann window filter)^{47}, and a line filter that removes the amplified noise perpendicular to the direction of integration^{12}. The *E* field vector is computed with

where \({k}_{r}={k}_{x}\cos (\alpha )+{k}_{y}\sin (\alpha )\) and *W*(*λ*, *α*) is the window function. We set the cut-off wavelength to the stand-off distance (*λ* = *z*, which produces a cut-off wavevector of *k* = 2π/*λ*) and the oscillation angle to match the *x* direction (*α* = 0°). We applied this procedure on both the \({\partial }_{x}{E}_{{x}_{{{{\rm{NV}}}}}}\) and \({\partial }_{x}{E}_{{y}_{{{{\rm{NV}}}}}}\) images and average the results.

### Surface charge density reconstruction

To reverse propagate our *E* field measurements into a surface charge density (Fig. 2g), we first treat Coulomb’s law for a two-dimensional surface charge density *σ*(*x*,*y*) as a convolution integral in Fourier space^{49}. With the transfer function *G*(*K*, *z*) = e^{−Kz}/(2*ϵ*_{0}*K*), where *ϵ*_{0} is the vacuum permittivity, the *E* field components from a single surface charge density become

For two surface charge densities of opposite polarity separated by a distance *t*, the Fourier transformed *E* field is \({{{\mathcal{F}}}}\{{{{{\bf{E}}}}}^{{{{\rm{total}}}}}\}={{{\mathcal{F}}}}\{{{{{\bf{E}}}}}^{{{{\rm{lab}}}}}\}(1-{\mathrm{e}}^{-Kt})\), where the −e^{−Kt} term comes from the bottom surface. The surface charge density can be computed for each of the three laboratory-frame vector components, and from our NV electrometry measurements the surface charge density is

where the three vector components have been averaged. We apply an additional window function, *W*(*λ*_{1}, *λ*_{2}, *α*), to equation (9) that cuts off both low-frequency (*λ*_{1} = 30*z*) and high-frequency (*λ*_{2} = *z*) components, and a line filter (*α* = 0°) to remove amplified noise from the deconvolution process.

### Electric field gradiometry line scan fitting

Fitting the line scans in Fig. 3e was accomplished by first determining a simplified form for different surface charge models (Supplementary Section 2). For a monopole domain wall located at *x* = *x*_{i} and propagating along *y*, the equations

are used. For the equivalent dipole domain wall the equations

are used. In both types of domain walls \({\partial }_{x}{E}_{y}^{{{{\rm{lab}}}}}=0\). Here, the stand-off *z*, surface charge density *σ* (or surface dipole density *σ**d*), domain wall locations (*x*_{1} and *x*_{2}) and sample thickness *t* (for the bottom layer) are used to create the different surface charge models. Next, the gradient components are projected onto the NV centre’s *x* and *y* unit vectors using \({\partial }_{x}{E}_{{x}_{{{{\rm{NV}}}}}}={\partial }_{x}{{{{\bf{E}}}}}^{{{{\rm{lab}}}}}\cdot {\hat{x}}_{{{{\rm{NV}}}}}\) and \({\partial }_{x}{E}_{{y}_{{{{\rm{NV}}}}}}={\partial }_{x}{{{{\bf{E}}}}}^{{{{\rm{lab}}}}}\cdot {\hat{y}}_{{{{\rm{NV}}}}}\). The unit vectors depend on the polar and azimuthal angles *θ*_{NV} and *φ*_{NV}. Then, the *E* field angle is computed as \({\varphi }_{{\mathrm{E}}_{{{{\rm{ac}}}}}}=\arctan ({\partial }_{x}{E}_{{y}_{{{{\rm{NV}}}}}}/{\partial }_{x}{E}_{{x}_{{{{\rm{NV}}}}}})\). Finally, the measured signal is modelled by \({E}_{{{{\rm{meas}}}}}={x}_{{{{\rm{osc}}}}}\sqrt{{\left({\partial }_{x}{E}_{{x}_{{{{\rm{NV}}}}}}\right)}^{2}+{\left({\partial }_{x}{E}_{{y}_{{{{\rm{NV}}}}}}\right)}^{2}}\cos (2{\varphi }_{B}+{\varphi }_{{E}_{{{{\rm{ac}}}}}})\). During the fitting process, the NV angles, magnetic bias field angle, sample thickness, stand-off distance and oscillation amplitude are kept constant, having been measured or determined previously. The surface charge density (or surface dipole density) and domain wall locations are fitted and the best model is determined by the shape, quality and polarity of the fit.

### Estimation of sensitivity

We estimated the sensitivity with two methods, first by error propagating the measurement counts used in the quantum phase computation, and second by taking line-by-line differences from two consecutive line scans and computing the standard deviation of the resulting trace^{47}. As shown in Supplementary Section 3, our best sensitivities were achieved by using multipulse sequences with quantum phase accumulation across multiple oscillation periods^{12}. The error propagated sensitivity was 0.24 kV cm^{−1} Hz^{−1/2} and the line-by-line sensitivity was 0.29 kV cm^{−1} Hz^{−1/2}.

## Data availability

The data that support the findings of this study are available from the corresponding author upon reasonable request.

## References

Yoo, M. J. et al. Scanning single-electron transistor microscopy: imaging individual charges.

*Science***276**, 579–582 (1997).Schoenherr, P. et al. Observation of uncompensated bound charges at improper ferroelectric domain walls.

*Nano Lett.***19**, 1659 (2019).Cao, Y., Pomeroy, J. W., Uren, M. J., Yang, F. & Kuball, M. Electric field mapping of wide-bandgap semiconductor devices at a submicrometre resolution.

*Nat. Electron.***4**, 478 (2021).Gruverman, A., Alexe, M. & Meier, D. Piezoresponse force microscopy and nanoferroic phenomena.

*Nat. Commun.***10**, 1661 (2019).Lachheb, M. et al. Surface and bulk ferroelectric phase transition in super-tetragonal BiFeO

_{3}thin films.*Phys. Rev. Mater.***5**, 024410 (2021).Martin, L. W. & Rappe, A. M. Thin-film ferroelectric materials and their applications.

*Nat. Rev. Mater.***2**, 16087 (2017).Sharma, P., Moise, T. S., Colombo, L. & Seidel, J. Roadmap for ferroelectric domain wall nanoelectronics.

*Adv. Funct. Mater.***32**, 2110263 (2021).Meier, D. & Selbach, S. M. Ferroelectric domain walls for nanotechnology.

*Nat. Rev. Mater.***7**, 157–173 (2021).Rondin, L. et al. Magnetometry with nitrogen-vacancy defects in diamond.

*Rep. Prog. Phys.***77**, 056503 (2014).Oort, E. V. & Glasbeek, M. Electric-field-induced modulation of spin echoes of N-V centers in diamond.

*Chem. Phys. Lett.***168**, 529–532 (1990).Dolde, F. et al. Electric-field sensing using single diamond spins.

*Nat. Phys.***7**, 459–463 (2011).Huxter, W. S. et al. Scanning gradiometry with a single spin quantum magnetometer.

*Nat. Commun.***13**, 3761 (2022).Doherty, M. W. et al. Theory of the ground-state spin of the NV

^{-}center in diamond.*Phys. Rev. B***85**, 205203 (2012).Fiebig, M., Lottermoser, T., Meier, D. & Trassin, M. The evolution of multiferroics.

*Nat. Rev. Mater.***1**, 16046 (2016).Saurenbach, F. & Terris, B. D. Imaging of ferroelectric domain walls by force microscopy.

*Appl. Phys. Lett.***56**, 1703–1705 (1990).Nonnenmacher, M., O’Boyle, M. P. & Wickramasinghe, H. K. Kelvin probe force microscopy.

*Appl. Phys. Lett.***58**, 2921–2923 (1991).Wagner, C. et al. Scanning quantum dot microscopy.

*Phys. Rev. Lett.***115**, 026101 (2015).Taylor, J. M. et al. High-sensitivity diamond magnetometer with nanoscale resolution.

*Nat. Phys.***4**, 810–816 (2008).Oberg, L. et al. Solution to electric field screening in diamond quantum electrometers.

*Phys. Rev. Appl.***14**, 014085 (2020).Iwasaki, T. et al. Direct nanoscale sensing of the internal electric field in operating semiconductor devices using single electron spins.

*ACS Nano***11**, 1238–1245 (2017).Michl, J. et al. Robust and accurate electric field sensing with solid state spin ensembles.

*Nano Lett.***19**, 4904–4910 (2019).Barson, M. S. J. et al. Nanoscale vector electric field imaging using a single electron spin.

*Nano Lett.***21**, 2962–2967 (2021).Bian, K. et al. Nanoscale electric-field imaging based on a quantum sensor and its charge-state control under ambient condition.

*Nat. Commun.***12**, 2457 (2021).Broadway, D. A. et al. Spatial mapping of band bending in semiconductor devices using in situ quantum sensors.

*Nat. Electron.***1**, 502–507 (2018).Dolde, F. et al. Nanoscale detection of a single fundamental charge in ambient conditions using the NV

^{−}center in diamond.*Phys. Rev. Lett.***112**, 097603 (2014).Lorenzelli, L.

*Development of a Scanning Nitrogen-Vacancy-Center Magnetometer for Variable Temperature Experiments*. PhD Thesis*,*ETH Zurich (2021).Tetienne, J. P. et al. The nature of domain walls in ultrathin ferromagnets revealed by scanning nanomagnetometry.

*Nat. Commun.***6**, 6733 (2015).Luca, G. D. et al. Domain wall architecture in tetragonal ferroelectric thin films.

*Adv. Mater.***29**, 1605145 (2016).Kalinin, S. V., Kim, Y., Fong, D. D. & Morozovska, A. N. Surface-screening mechanisms in ferroelectric thin films and their effect on polarization dynamics and domain structures.

*Rep. Prog. Phys.***81**, 036502 (2018).Strkalj, N. et al. Depolarizing-field effects in epitaxial capacitor heterostructures.

*Phys. Rev. Lett.***123**, 147601 (2019).Suleiman, M., Sarott, M. F., Trassin, M., Badarne, M. & Ivry, Y. Nonvolatile voltage-tunable ferroelectric-superconducting quantum interference memory devices.

*Appl. Phys. Lett.***119**, 112601 (2021).Segura, J. J., Domingo, N., Fraxedas, J. & Verdaguer, A. Surface screening of written ferroelectric domains in ambient conditions.

*J. Appl. Phys.***113**, 187213 (2013).Strkalj, N. et al. In-situ monitoring of interface proximity effects in ultrathin ferroelectrics.

*Nat. Commun.***11**, 5815 (2020).Qiu, Z., Hamo, A., Vool, U., Zhou, T. X. & Yacoby, A. Nanoscale electric field imaging with an ambient scanning quantum sensor microscope.

*npj Quantum Inf.***8**, 107 (2022).Lilienblum, M. et al. Ferroelectricity in the multiferroic hexagonal manganites.

*Nat. Phys.***11**, 1070–1073 (2015).Ariyaratne, A., Bluvstein, D., Myers, B. A. & Jayich, A. C. B. Nanoscale electrical conductivity imaging using a nitrogen-vacancy center in diamond.

*Nat. Commun.***9**, 2406 (2018).Block, M. et al. Optically enhanced electric field sensing using nitrogen-vacancy ensembles.

*Phys. Rev. Appl.***16**, 024024 (2021).Chauleau, J. et al. Electric and antiferromagnetic chiral textures at multiferroic domain walls.

*Nat. Mater.***19**, 386–390 (2020).Manipatruni, S. et al. Scalable energy-efficient magnetoelectric spin-orbit logic.

*Nature***565**, 35–42 (2019).Noel, P. et al. Non-volatile electric control of spin-charge conversion in a SrTiO

_{3}Rashba system.*Nature***580**, 483–486 (2020).Hingant, T. et al. Measuring the magnetic moment density in patterned ultrathin ferromagnets with submicrometer resolution.

*Phys. Rev. Appl.***4**, 014003 (2015).Dolde, F.

*The Nitrogen Vacancy Center in Internal and External Fields*. PhD Thesis, Univ. Stuttgart (2014). https://doi.org/10.18419/opus-5149Tetienne, J. et al. Magnetic-field-dependent photodynamics of single NV defects in diamond: an application to qualitative all-optical magnetic imaging.

*New J. Phys.***14**, 103033 (2012).Maze, J. R. et al. Properties of nitrogen-vacancy centers in diamond: the group theoretic approach.

*New J. Phys.***13**, 025025 (2011).Doherty, M. W. et al. Measuring the defect structure orientation of a single NV

^{−}centre in diamond.*New J. Phys.***16**, 063067 (2014).Degen, C., Reinhard, F. & Cappellaro, P. Quantum sensing.

*Rev. Mod. Phys.***89**, 035002 (2017).Palm, M. L. et al. Imaging of submicroampere currents in bilayer graphene using a scanning diamond magnetometer.

*Phys. Rev. Appl.***17**, 054008 (2022).Griffin, S. M. et al. Scaling behavior and beyond equilibrium in the hexagonal manganites.

*Phys. Rev. X***2**, 041022 (2012).Beardsley, I. A. Reconstruction of the magnetization in a thin film by a combination of Lorentz microscopy and external field measurements.

*IEEE Trans. Magn.***25**, 671–677 (1989).

## Acknowledgements

The authors thank M.L. Palm and P.J. Scheidegger for helpful comments on the manuscript, M.W. Doherty, S. Ernst, N. Prumbaum and P. Welter for useful discussions, L.M. Giraldo and M. Fiebig for providing the YMnO_{3} sample and QZabre AG for support in probe fabrication. C.L.D. acknowledges support by the European Research Council through ERC CoG 817720 (IMAGINE), the Swiss National Science Foundation (SNSF) through the NCCR QSIT, a National Centre of Competence in Research in Quantum Science and Technology, grant no. 51NF40-185902 and the Advancing Science and TEchnology thRough dIamond Quantum Sensing (ASTERIQS) program, grant no. 820394, of the European Commission. M.T. acknowledges the SNSF through project grant no. 200021-188414. M.T. and M.F.S. acknowledge the SNSF through Spark Grant CRSK-2_196061.

## Funding

Open access funding was provided by Swiss Federal Institute of Technology Zurich.

## Author information

### Authors and Affiliations

### Contributions

C.L.D. and W.S.H. conceived the experiment. W.S.H. carried out scanning NV experiments and performed the data analysis. M.F.S. and M.T. fabricated the PZT sample, wrote the domains and carried out PFM experiments on PZT and YMnO_{3}. W.S.H. and C.L.D. wrote the manuscript. M.F.S. and M.T. provided insights on electrically ordered materials. All authors discussed the results.

### Corresponding author

## Ethics declarations

### Competing interests

The authors declare no competing interests.

## Peer review information

### Peer review information

*Nature Physics* thanks Kasturi Saha, Jean-Philippe Tetienne and the other, anonymous, reviewer(s) for their contribution to the peer review of this work.

## Additional information

**Publisher’s note** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Extended data

### Extended Data Fig. 1 NV electrometry imaging modalities on PZT.

**a**, Out-of-plane PFM image over a patterned domain structure. **b**, Spin-echo gradiometry (one *π*-pulse) over the same area in **a**. **c**, CPMG-2 gradiometry (two *π*-pulses) over the same area in **a**. This measurement filters for a signal at 2*f*, which corresponds to a signal from the the second spatial derivative. **d**, XY8-3 gradiometry (24 *π*-pulses across 12 oscillation periods at ~ 196 kHz). The constant signal over domains, similar to Fig. 4 of the main text, may be attributed to tip oscillations that include a torsional component. Panels **b**-**d** have a pixel resolution of 60 nm. **e**, Pulsed OMDR taken over the inscribed area in **a** and no discernible electric field signal is observed. **f**, Spin-echo gradiometry over the same area in **e**. **g**, CPMG-2 gradiometry over the same area in **e**. Panels **d**-**f** have a pixel resolution of 25 nm. Panel **d**, was imaged with *φ*_{B} = 106^{∘} and all other NV electrometry images were with *φ*_{B} = 73^{∘}. Scale bars, 1 *μ*m.

### Extended Data Fig. 2 Analysis of NV electrometry sensitivity.

**a**, Six line scans taken over a ferroelectric domain on PZT acquired with the XY8-3 pulse sequence. The entire data set included 12 line scans, however only six are shown. Lines are offset by 1 kVcm^{−1} for clarity. **b**, Error propagated sensitivity estimates computed using the photon counts for the measurements in panel **a** fitted to a Gaussian distribution. **c**, Five line-by-line differences of the lines shown in panel **a**. **d**, Line-by-line difference sensitivity estimates from the data in panel **c** fitted to a Gaussian distribution. The data in panels **b** and **d** are normalized by the measurement time in order to estimate the sensitivity.

### Extended Data Fig. 3 Quantification of spatial resolution.

**a**, Surface charge density reconstruction (Fig. 2g of the main text) with highlighted region (dashed lines) and step edge (arrows) used for analysis in panels **b** and **c**. Scale bar, 1 *μ*m. **b**, Example of the 10% - 90% rise distance extraction method used to estimate the spatial resolution. The blue (red) shaded area denotes the range of data points used to define the lower (upper) value of the step edge. The dashed black lines denote the rise interval for the data trace (purple). The highlighted red datapoints were used in a linear fit (gray line), which was then used to extract a rise distance of 75 nm. **c**, Histogram binning of rise distances across the region denoted in panel **a** and Gaussian fit which yields a mean value of 95 nm.

### Extended Data Fig. 4 Electric field vector reconstruction.

**a**, Electric field gradient magnitude *E*_{ac} (left) and angle (right) \({\varphi }_{E_{\rm{ac}}}\), reconstructed from Fig. 2d of the main text. Note that due to the *C*_{3ν} symmetry of the NV center the spatial map of \({\varphi}_{E_{\rm{ac}}}\) is only known up to a multiple of 2*π*/3 radians (or 120^{∘}). **b**, Simulation of **a**. **c**, Electric field gradient projections onto the *x*_{NV} and *y*_{NV} directions in the reference frame of the NV center. **d**, Simulation of **c**. **e**, Lab frame electric field gradient components reconstructed from **c**. **f**, Simulation of **e**. **g**, Electric field gradient vector plot with ∂_{x}*E*_{x} and ∂_{x}*E*_{y} components as arrows and ∂_{x}*E*_{z} as the colour. **h**, Simulation of **g**. **i**, Integrated electric field gradient vector plot with *E*_{x} and *E*_{y} components as arrows and *E*_{z} as the colour. **j**, Simulation of **i**. Scale bar, 1 *μ*m.

## Supplementary information

### Supplementary Information

Supplementary Sections 1–6 and Figs. 1–4.

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.

## About this article

### Cite this article

Huxter, W.S., Sarott, M.F., Trassin, M. *et al.* Imaging ferroelectric domains with a single-spin scanning quantum sensor.
*Nat. Phys.* **19**, 644–648 (2023). https://doi.org/10.1038/s41567-022-01921-4

Received:

Accepted:

Published:

Issue Date:

DOI: https://doi.org/10.1038/s41567-022-01921-4