Nuclear spin assisted magnetic field angle sensing

Quantum sensing exploits the strong sensitivity of quantum systems to measure small external signals. The nitrogen-vacancy (NV) center in diamond is one of the most promising platforms for real-world quantum sensing applications, predominantly used as a magnetometer. However, its magnetic field sensitivity vanishes when a bias magnetic field acts perpendicular to the NV axis. Here, we introduce a different sensing strategy assisted by the nitrogen nuclear spin that uses the entanglement between the electron and nuclear spins to restore the magnetic field sensitivity. This, in turn, allows us to detect small changes in the magnetic field angle relative to the NV axis. Furthermore, based on the same underlying principle, we show that the NV coupling strength to magnetic noise, and hence its coherence time, exhibits a strong asymmetric angle dependence. This allows us to uncover the directional properties of the local magnetic environment and to realize maximal decoupling from anisotropic noise.

For the NV to act as a magnetometer, a bias magnetic field along the NV axis is generally required to put the electron spin (S = 1) in the m S ¼ 0; ±1 j ibasis, such that the energy levels are first-order sensitive to magnetic field perturbations 2 . However, this method fails when the bias field turns toward the direction perpendicular to the NV axis, where the Zeeman interaction no longer induces energy shifts between the levels. To unlock the full potential under this unfavored condition, we introduce an entirely different sensing approach assisted by the ancillary 15 N nuclear spin. The essential principle is based on the sensitivity of the hyperfine interaction (between the electron and nuclear spins) to small magnetic signals. By monitoring the entanglement between the two spins using spin-echo sequences, we detect small changes in the magnetic field angle. Furthermore, similar to the hyperfine interaction, we show that the coupling between the electron spin and magnetic noise also sensitively depends on the bias field angle, which can be further employed to distinguish and characterize anisotropic noise in the environment. Our exploration extends the capabilities of the versatile sensing toolkit of the NV center, and this sensing strategy based on the interaction between the main sensor and ancillary sensor can be implemented on other quantum sensing platforms as well.
Our experiments were done under ambient conditions, as schematically depicted in Fig. 1a, b. The single-crystal diamond chip contains individually resolvable 15 NVs. A metal stripline fabricated on the diamond surface delivers microwave currents to manipulate the NV spin states. A cylindrical permanent magnet exerts a magnetic field at the NV and provides a coarse control of the field angle (θ B ), while a small DC current flowing in the stripline fine-tunes θ B in the close vicinity of 90°. We defineẑ to be the NV axis andx to be the bias magnetic field direction when it is exactly perpendicular (Fig. 1a).
The paper is structured as follows. We begin by analyzing the NV electron energy eigenstates as the magnetic field angle θ B varies around 90°. In particular, we study how the angle modulates the electron spin operator expectation values 〈S〉 at each state, and consequently affects its interaction with the 15 N nuclear spin. Next, we demonstrate magnetic field angle sensing by using spinecho interferometry to measure the angle-dependent hyperfine interaction. Lastly, we show that the NV coherence exhibits an asymmetric angle dependence, which originates from anisotropic noise in the environment.

Electron spin eigenstate properties
The NV spin ground state Hamiltonian H gs can be written as: where H e and H n denote the Hamiltonians associated with the electron spin (S = 1) and 15 N nuclear spin (I ¼ 1 2 ), respectively. D gs ≈ 2.87 GHz is the zero-field splitting, γ B ≈ 2.87 MHz/G is the electron spin gyromagnetic ratio, γ N ≈ 0.4316 kHz/G is the 15 N nuclear spin gyromagnetic ratio, and A is the hyperfine tensor with only diagonal elements: A xx = A yy ≈ 3.65 MHz and A zz ≈ 3.03 MHz [36][37][38] . S x,y,z and I x,y,z are the spin-1 and spin- 1 2 Pauli matrices, respectively. We applied the bias field |B| > 60 G, such that H e always dominates over H n (at any θ B ). The electron eigenstates, denoted by 0; ± j i throughout the paper, are thus mainly determined by H e , and H n splits each state into two nuclear spin sublevels (see Supplementary Note 2B). Under a bias magnetic field alongẑ (θ B = 0), i.e., the conventional magnetometry condition, the electron eigenstates are m S ¼ 0; ±1 j i (Fig. 1c). As the bias field direction rotates (θ B ≠ 0), the eigenbasis changes. At θ B = 90°(B z = 0, B x > 0), the eigenstates are as follows: 0 Þare slightly hybridized in composing 0 j i and þ j i, hence the approximate equality in the above expressions. This hybridization results in finite 〈S x 〉 values for 0 j i and þ j i: hS iamplitudes are no longer equal. Due to the large zerofield splitting, the imbalance grows rapidly with the off-angle Δθ B ≡ θ B − 90°, and consequently, hS z i ± acquire finite values (Fig. 2a). On the other hand, 〈S x 〉 barely changes (Fig. 2b). The change in 〈S z 〉 dramatically affects the electron spin interaction with the nuclear spin, thus providing a way to sense Δθ B .
Angle-dependent hyperfine interaction A given electron state exerts effective hyperfine fields at the nuclear spin, determined by its spin operator expectation values. Specifically, the nuclear spin Hamiltonian is H n splits each electron state ( 0; ± j i) into two nuclear sublevels and the splitting energy (ћω) can be obtained by diagonalizing H n . Figure 2c plots ω as a function of θ B calculated under |B| = 65 G and Fig. 2d zooms in on a small angle range centered at 90°. The À j i state splitting (ω − ) is especially interesting: it grows linearly with Δθ B . The slope dωÀ dθB , as we will see soon, directly determines the angle sensitivity.  〈S y 〉 = 0 for all states, thus is not plotted. c, d Angle dependence of the nuclear spin sublevel splittings ω at each electron state. c zooms in on the red shaded area around 90°in (d). ω − , the orange curve in (d), sharply increases with the off-angle Δθ B , serving as the key to our angle sensing approach.
Nuclear spin assisted angle sensing We now demonstrate detection of small angle changes using the angle-sensitive hyperfine interaction. Either ω − or ω + can be used, as they both change with θ B . We choose to use ω − since its angle dependence is steeper. To measure this quantity, we performed electron spin-echo interferometry, where the spin-echo signal is dramatically affected by the hyperfine splitting due to the electron-spin-echo-envelope-modulation (ESEEM) effect [39][40][41][42] .
A typical spin-echo sequence is shown in Supplementary Fig. 3. The electron is first prepared in a superposition of 0 j i and À j i, and then accumulates phase during the free evolution time τ between the two π/2 pulses. The π refocusing pulse decouples the fields at frequencies other than 1/τ.
The ESEEM effect occurs when the nuclear spin undergoes Larmor precession, with the frequency (ω 0 or ω − ) conditioned on the electron state ( 0 j i or À j i). Consequently, the electron and nuclear spins are periodically entangled and disentangled at a rate  determined by ω 0 and ω − . The spin-echo amplitude measures the electron coherence, which is directly affected by its entanglement with the nuclear spin, hence exhibiting collapses and revivals. As ω − is highly sensitive to θ B , the spin-echo signal shows angledependent modulation patterns. A more detailed analysis is given in Supplementary Note 2C, where the spin-echo signal P obtains a simple expression: P ¼ 1 À jω 0 ω À j 2 sin 2 ω0τ 4 À Á sin 2 ωÀτ 4 À Á . We performed spin-echo experiments between 0 j i and À j i under |B| ≈ 65 G, as θ B varied between 89°and 91° (Fig. 3a). It shows good agreement with the above expression for P (Fig. 3b). At fixed τ = 2.2 μs, the spin-echo signal can sensitively detect small angle changes at the largest slope (red dashed line in Fig. 3c). The corresponding sensitivity is~13 mdeg ffiffiffiffi Hz p , provided the single NV fluorescence~100 kcps and optical contrast~15% in the experiment (see Supplementary Note 2D). To get an overall picture, Fig. 3d expands on Fig. 3b, showing the spin-echo signal P in broader θ B and τ ranges.
Taking the derivative of P with respect to θ B , we obtain an analytical expression of the angle sensitivity η (see Supplementary Note 2D): where F represents the NV fluorescence, C the optical contrast of different spin states, t ini the spin initialization time and T r the spin state readout time. γ θ dωÀ dθB denotes the slope of the angle-dependent hyperfine interaction (Fig. 2d). Note that γ θ is playing an analogous role as the gyromagnetic ratio in conventional magnetometry. The denominator in Eq. (1) causes modulation in τ, i.e. the angle sensitivity is periodically lost and regained at different τ times (Fig. 3d), and η * in Eq. (2) is the modulation envelope. To optimize the sensitivity, we need to pick τ that maximizes jsin 2 ω0τ As examples, sensitivities were evaluated at τ = 2.2 μs and 11 μs and plotted in Fig. 3e, represented by the blue and orange solid curves, respectively.
On the other hand, conventional magnetometry also detects magnetic field angle changes via the electron Zeeman interaction. Its angle sensitivity is proportional to the static magnetic field sensitivity alongẑ: η con ¼ η Bz jBj sin θB . With a parallel bias magnetic field, η Bz is typically between tens of nT ffiffiffiffi Hz p and a few μT ffiffiffiffi Hz p depending on experimental parameters 15,16 , and η Bz decreases as the bias field turns toward a perpendicular direction (see Supplementary Note 2E). Figure 3e plots η con as a function of θ B assuming η Bz is originally 300 or 800 nT ffiffiffiffi Hz p under a parallel bias field. As illustrated in Fig. 3e, our nuclear-assisted approach and conventional magnetometry work in complimentary regimes. The conventional method works well until θ B approaches 90° (Fig. 3e inset), when x Dgs \2γ B B z so the electron eigenbasis changes from m S ¼ 0; ±1 j i to 0; ± j i, and after that the nuclear-assisted approach takes over. The sensitivities of both methods are limited by low-frequency noise, up to different effective coupling constants (see Supplementary Note 2E). Fig. 4 Asymmetric angle dependence of the NV coherence time. a, b Spin-echo experiments between 0 j i and ∓ j i as θ B varies under |B| ≈ 93 G. Colorbar represents the fluorescence contrast. The asymmetry between θ B < 90°and θ B > 90°originates from local anisotropic magnetic field noise in the sample. c, d Simulated spin-echo signals with a magnetic field noise acting along a direction at −45°/+135°from the þx axis, as depicted in (e). The white dashed lines mark the optimal angles at which the noise coupling is maximally suppressed. Colorbar represents the spin-echo amplitude.
Z. Qiu et al.

Detection of anisotropic noise
The NV couples to magnetic field noise through its electron spin operators. Similar to the hyperfine interaction, the noise coupling strength, and hence the spin coherence, also exhibits strong angle dependence. We show that this provides a useful way to distinguish and characterize anisotropic noise.
Magnetic field noise δB(t) induces transition energy fluctuations: δE ±,0 (t) = δB(t) ⋅ (〈S〉 ± − 〈S〉 0 ), degrading the coherence between the states 0 j i and ± j i. It can be shown that the coherence is affected by the variance of the fluctuation 〈δE 2 〉 (see Supplementary Note 3A). Recalling 〈S z 〉 (〈S x 〉) in Fig. 2a, b, we get: The last terms in Eqs. (3) and (4) suggest the coherence is sensitive to the correlation between δB x and δB z , which is nonzero for anisotropic noise. Since hS z i ± is an odd function of Δθ B , while hS x i 0 an even function, depending on the sign of 〈δB x δB z 〉, the coherence is longer on one side than the other around θ B = 90°, and the states ± j i show opposite asymmetry. If the noise is isotropic, i.e., 〈δB x δB z 〉 = 0, the coherence is then symmetric around 90°. Therefore, by examining the angle dependence of the coherence time, we can distinguish the anisotropic noise and further characterize its direction based on the asymmetry. This directional information, on the other hand, cannot be obtained under a parallel bias magnetic field (θ B ≈ 0°), where the NV only couples to theẑ component of the noise.
The coherence asymmetry observed in our experiment (Fig. 4a, b) indicates that the noise coupled to the NV is anisotropic. We argue in Supplementary Note 3B that this is likely due to the dipolar interaction with a few nearby randomly-flipping spins (such as P1 centers or 13 C nuclear spins). To further illustrate this effect, we performed spin-echo simulation under a fully anisotropic noise, where the noise only fluctuates along a straight line at −45°/+135°r elative to þx (Fig. 4e), such that δB x (t) + δB z (t) = 0. Under this condition, there exist optimal angles at which the noise coupling is maximally suppressed (white dashed lines in Fig. 4c, d).

DISCUSSION
While conventional NV magnetometry fails when the bias magnetic field orients perpendicular to the NV axis, here we demonstrated a method which uses the electron eigenbasis change for sensing. The achieved sensitivity (η ≈ 13 mdeg ffiffiffiffi Hz p ) can be further improved by using cleaner diamond samples with less noise (e.g., by using 12 C enriched diamonds 43 or chemical termination to reduce surface spins 44 ), increasing photon collection efficiency (e.g. by fabricating microlens [45][46][47][48][49] or pillars 50-54 ) or using NV ensembles [55][56][57] . For example, as the sensitivity is improved by the square root of the number of NVs, a typical ensemble density of 10 12 /cm 2 can achieve η < 0.3 mdeg ffiffiffiffi Hz p . Our work expands the already remarkable sensing versatility of the NV center. One example of the use of angle sensing is to allow precise tuning of a perpendicular magnetic field to the NV axis for electric field sensing [21][22][23][24]27,28 .
Our sensing strategy relies on measuring the interaction with an ancillary sensor. Implementing this idea to other quantum sensing platforms requires two key ingredients. First, the angle-dependent hyperfine interaction is due to the NV eigenbasis change, which occurs when x Dgs $ γ B B z . At θ B ≈ 90°, this condition becomes Dgs $ γ B jBj sin Δθ B , i.e. Δθ B $ γ B jBj Dgs , indicating that the high angle sensitivity arises from the large zero-field splitting (D gs ). Second, the hyperfine interaction is the dominating term in the nuclear spin Hamiltonian, which directly affects its entanglement with the electron spin and therefore the spin-echo signal.
We also demonstrated a method to distinguish and characterize anisotropic noise in the XZ plane (i.e. δB x and δB z ) based on the asymmetric angle dependence of coherence time. By further rotating the bias field in the XY plane (perpendicular to the NV axis), we could obtain information along all directions, which can help locate noise sources at the nanoscale. Moreover, we showed that the anisotropic component of the noise can be maximally decoupled by applying a bias field at the optimal angle, which may allow a great improvement of the NV spin coherence.

Diamond sample
The diamond sample was an electronic-grade CVD diamond (Element Six), with a natural abundance (1.1%) of 13 C impurity spins. Negatively-charged NV centers were created by ion implantation (18 keV) followed by vacuum annealing at 800°C for 2 h. NV experiments were performed on a homebuilt confocal laser scanning microscope. A 532 nm green laser was used to initialize the NV spin to the m S = 0 state and generate spin-dependent photoluminescence for optical readout.

Spin dynamics simulation
The simulation of NV spin-echo decay was done using the QuTip (Quantum Toolbox in Python) software 58,59 . To simulate the coupling with the anisotropic magnetic noise, collapse operators were defined, and the time evolution was governed by the Lindblad master equation. More details are provided in Supplementary Note 4.

DATA AVAILABILITY
The data generated and analyzed during this study are available from the authors upon reasonable request.

CODE AVAILABILITY
The code used for simulation presented in this study is available from the authors upon reasonable request.