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 novel 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.


INTRODUCTION
Quantum sensing harnesses the coherence of well-controlled quantum systems to detect small signals with high sensitivity [1][2][3]. Typically, an external signal directly leads to a shift of the quantum sensor's energy levels. Ancillary sensors, which do not interact with the signal directly, can assist the main sensor by, for example, acting as a long-lived quantum memory [4][5][6][7][8] or providing error correction [9][10][11][12][13][14]. Solid state spins are promising platforms for quantum sensing techniques and applications, among which nitrogen-vacancy (NV) centers in diamond have received the most attention [2,[15][16][17]. The electron spin associated with the negatively-charged NV center has long coherence time even at room temperature and is capable of detecting a variety of signals with high sensitivity and nanoscale resolution.
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 basis, 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 new 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 spin-echo 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 [34][35][36]. 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, ± throughout the paper, are thus mainly determined by H e , and H n splits each state into two nuclear spin sublevels (see Under a bias magnetic field alongẑ (θ B = 0), i.e. the conventional magnetometry condition, the electron eigenstates are |m S = 0, ±1 (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: , and the states |± split in energy by ≈ γ 2 B B 2 x Dgs (Fig. 1c). Under large B x , |m S = 0 and 1 √ 2 (|m S = +1 + |m S = −1 ) are slightly hybridized in composing |0 and |+ , hence the approximate equality in the above expressions. This hybridization results in finite S x values for |0 and |+ : S x 0 < 0, S x + > 0 (see Supplementary Information).
However, as θ B deviates from 90 • , the |m S = ±1 amplitudes are no longer equal. Due to the large zero-field splitting, the imbalance grows rapidly with the off-angle ∆θ B ≡ θ B − 90 • , and consequently, S z ± 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 unique 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 = where |ψ e = |0, ± . H n splits each electron state (|0, ± ) into two nuclear sublevels and the splitting energy ( ω) can be obtained by diagonalizing H n . Fig. 2c plots ω as a function of θ B calculated under |B| = 65 G and is especially interesting: it grows linearly with ∆θ B . The slope dω − dθ B , as we will see soon, directly determines the angle sensitivity.

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 [37][38][39][40].
A typical spin-echo sequence is shown in Supplementary Information Fig. 3. The electron is first prepared in a superposition of |0 and |− , 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 or |− ). 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 angle-dependent modulation patterns. A more detailed analysis is given in Supplementary Information, where the spinecho signal P obtains a simple expression: We performed spin-echo experiments between |0 and |− 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 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 η * is the modulation envelope. To optimize the sensitivity, we need to pick τ that maximizes | sin 2 ω 0 τ 4 · sin ω − τ  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 |B| sin θ B . With a parallel bias magnetic field, η Bz is typically between tens of nT √ Hz and a few µT √ Hz depending on experimental parameters [15,16], and η Bz decreases as the bias field turns toward a perpendicular direction (see Supplementary Information). Fig. 3e plots η con as a function of θ B assuming η Bz is originally 300 or 800 nT √ Hz 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 to |0, ± , 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

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.
When the NV is in a superposition of |0 and |± , magnetic field noise δB(t) induces fluctuations of the transition energy: δE ±,0 (t) = δB(t) · ( S ± − S 0 ). It can be shown that the coherence is affected by the variance of the fluctuation δE 2 (see Supplementary Fig. 2a (b), we get: The last terms in Eqs. (3,4) suggest the coherence is sensitive to the correlation between δB x and δB z , which is non-zero for anisotropic noise. Since S z ± is an odd function of ∆θ B , while S x 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 |± show opposite asymmetry.
If the noise is isotropic, i.e. δB x δB z = 0, the coherence is then symmetric around 90 • . The coherence asymmetry observed in our experiment (Fig. 4a, b) indicates that the noise coupled to the NV is anisotropic. We argue (see Supplementary Information) 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 • relative to +x (Fig. 4e), such that δB x (t) + δB z (t) = 0. Under this condition, there exist critical 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 new strategy which uses the electron eigenbasis change for sensing based on the hyperfine interaction with the nuclear spin. The achieved sensitivity (η ≈ 13 mdeg √ Hz ) can be further improved by using cleaner diamond samples with less noise (e.g. by using 12 C enriched diamonds [41] or chemical termination to reduce surface spins [42]), increasing photon collection efficiency (e.g. by fabricating microlens [43][44][45][46][47] or pillars [48][49][50][51][52]) or using NV ensembles [53,54]. 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 √ Hz . Our work expands the already remarkable sensing versatility of the NV center. Note that the NV is also a sensitive electrometer under a perpendicular magnetic field [21][22][23][24]. In addition, this general idea of sensing by measuring the interaction with an ancillary sensor may be extended to other quantum sensing platforms.
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 critical angle, which may allow a great improvement of the NV spin coherence.

METHODS
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 two hours. NV experiments were performed on a home-built confocal laser scanning microscope. A 532 nm green laser was used to initialize the NV spin to the m S = 0 state and generate spindependent photoluminescence for optical readout.
The spin-echo simulation was done using the QuTip (Quantum Toolbox in Python) software [55,56]. To simulate the coupling with the anisotropic magnetic noise, collapse oper-

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

ACKNOWLEDGMENTS
We gratefully thank Norman Y. Yao for valuable discussions and advice. Z. Q. also thanks Matthew Turner for diamond annealing assistance. This work was primarily supported by  Our experiment was performed on a type IIa diamond, with 1.1% naturally abundant 13 C and of 2 * 2 * 0.05 mm 3 in dimension, grown by chemical vapor deposition by Element Six. NV centers were created by 15 N ion implantation (INNOViON) at 18 keV with a density of 30 /µm 2 , and subsequent vacuum annealing for ∼2 hours at 800 • C. The NV depth is estimated to be < ∼ 40 nm below the surface. The NV used in the experiment was first characterized in the presence of a bias magnetic field oriented parallel to the NV axis, B || ≈ 36 G. The measured dephasing time T * 2,Ramsey < ∼ 800 ns and decoherence time T 2,Spin−echo < ∼ 1 µs. The short coherence is attributed to various paramagnetic impurities in the environment, e.g. P1 center electron spins, 13 C nuclear spins and surface dangling bond spins. Multiple fabrication processes have been done on this sample before, which produce surface noise and degrade NV coherence. Employing dynamical decoupling techniques (such as Carr-Purcell-Meiboom-Gill sequences) with multiple equally spaced π pulses can extend T 2 [1][2][3]. For example, with 128 π pulses, T 2 can be extended to > ∼ 15 µs, which indicates a finite correlation time of the noise. The NV was then characterized under a perpendicular magnetic field, B ⊥ ≈ 93 G. The original spin states |m S = 0, ±1 , are hybridized into new eigenstates |0, ± , which are less sensitive to magnetic noise due to the reduced expectation values of electron spin operators S x,y,z . Consequently, the coherence time (between |0 and |± ) increases. For the state |− , measured T * 2,Ramsey,|− ≈ T 2,Spin−echo,|− ≈ 5 µs, and for |+ , T * 2,Ramsey,|+ ≈ T 2,Spin−echo,|+ ≈ 2 µs (see Fig. 4a-b of the main text). Note that the state |− coherence time is longer. The reason is that S x − ≈ 0 while S x + > 0 under a perpendicular magnetic field (Fig. 2b of the main text), hence |− is less coupled to magnetic noise than |+ .

B. Experimental setup and control
A coplanar waveguide (CPW, made of Ti/Au 20 nm/200 nm) was fabricated directly on the diamond surface, patterned by electron-beam lithography. The central line is of ∼ 5 µm in width and the NV is at a distance of < 10 µm away from its edge. The diamond was placed on a glass coverslip and NVs were optically addressed with an NA=1.25 oil-immersion objective from beneath, as depicted in Fig. 1b of the main text. 532 nm laser of power ∼ 1.1 mW, pulsed by an acoustic-optical modulator (AOM), was used to initialize and readout the NV spin states. The NV fluorescence was collected by an avalanche photodiode (APD). Pulsed microwave currents (generated from the source Agilent N9310A or Rhode&Schwarz SMB100A) were delivered to the CPW to drive resonant transitions between different electron states. Pulse sequences were controlled by a TTL Pulse Generator (SpinCore PulseBlasterESR-PRO).
A cylindrical NdFeB permanent magnet (6.35 mm in diameter and 12.7 mm in height), together with a small DC current (< 40 mA) flowing in the central line (from a function generator Agilent 33120A), exerts a magnetic field at the site of NV. The magnet is mounted on stacked XYZ translation stages (Thorlabs TDC001 DC Servo Drive), which coarsely control the field magnitude and angle, and the DC current provides a fine angle control.

A. NV electron energy eigenstates under a perpendicular magnetic field
The NV electron spin Hamiltonian is dominated by the zero-field splitting and electron Zeeman interaction terms. Since the Hamiltonian is invariant under rotation about the NV symmetry axis, we defineẑ to be along the NV axis and XZ the plane in which the external bias magnetic field lies.
When the bias field is exactly perpendicular to the NV axis, the NV spin ground state Hamiltonian is H e = D gs S 2 z + γ B B x S x , where D gs ≈ 2.87 GHz is the zero-field splitting (ZFS) due to spin-spin interaction and γ B ≈ 2.8 MHz/G is the electron spin gyromagnetic ratio. Diagonalizing H e gives the eigenstates and eigenenergies (Fig. 1a). As mentioned in the main text, the eigenstates, represented by |0, ± , are superpositions of |m S = 0, ±1 : Eq. (1) and (3) indicate that |m S = 0 and 1 √ 2 (|m S = +1 + |m S = −1 ) are slightly hybridized in composing |0 and |+ . As shown in Fig. 1b and their magnitudes increase with B x as well (Fig. 1c).

B. Hyperfine interaction
The hyperfine interaction with the 15 N nuclear spin (I=1/2) splits each electron state |0, ± into two sublevels (Fig.  2a), and the splitting energy is sensitive to the magnetic field angle (Fig. 2c of the main text). Here we study the angle dependence of the nuclear spin quantization axis direction at each electron state, which affects the selection rules between different sublevels.
At a given electron state, the nuclear spin Hamiltonian is determined by the corresponding electron spin operator expectation values: where S y = 0 is omitted, A is the hyperfine tensor and γ N ≈ 0.4316 kHz/G the 15 N is the nuclear spin gyromagnetic ratio. Diagonalizing H n gives the nuclear spin states and quantization axes (ζ). In the following, θ I denotes the angle between ζ andx, defined as θ I ≡ arctan Iz Ix . At the electron state |0 , S x 0 < 0 and S z 0 = 0 (Fig. 2 of the main text), the first term A || I x S x 0 dominates. As the magnetic field angle (θ B ) varies, S x 0 barely changes, therefore the splitting energy ω 0 ≈ A || | S x 0 | is almost constant, and the quantization axis ζ 0 always points alongx (the blue line in Fig. 2b).
The electron state |− is particularly interesting. S x − ≈ 0 regardless of angle (Fig. 2b of the main text), while S z − starts from 0 and grows rapidly with the off-angle ∆θ B (Fig. 2a of the main text). Consequently, the splitting energy ω − increases with ∆θ B , which forms the basis of our angle sensing experiment presented in the main text, and the quantization axis ζ − exhibits a very sharp angle dependence. At precisely θ B = 90 • , i.e. B z = 0 and B x = 0, the hyperfine interaction is almost zero so the nuclear Zeeman term becomes non-negligible. ζ − points along the external bias field directionx. However, as θ B is slightly off from 90 • , S z − increases rapidly and hence ζ − immediately turns towardẑ (the orange curve in Fig. 2b). The insets of Fig. 2b illustrate that a small magnetic field angle change results in a complete flip of the nuclear spin. At the electron state |+ , S x + and S z + together determine the nuclear state. At θ B = 90 • , S z + = 0, thus the splitting energy ω + is determined by S x + . As θ B is off from 90 • , S z − increases, giving rise to the angle dependence of ω + . The competition between A || I x S x + and A ⊥ I z S z + results in an angle-dependent quantization axis direction ζ + (the green curve in Fig. 2b), but it is less sharp as compared to the state |− . Based on the above analysis, we can see that at a given magnetic field angle θ B , the nuclear spin quantization axis depends on the electron spin state, which affects the selection rules of the transitions between different electron spin states. For example, at θ B slightly < 90 • , ζ 0 points alongx while ζ − almost alongẑ, hence all the four sublevel transitions between |0 and |− are allowed. More specifically, the driving efficiency of a transition is ∝ | f |H |i | 2 (H is the coupling to the microwave fields, |i and |f are the initial and final states), as calculated and plotted in Fig.  3d-f as θ B varies. The allowed transitions are experimentally measured by performing Fourier transform on Ramsey measurements between the electron states |0 and |± (Fig. 3c-e).

C. Electron spin-echo envelope modulation (ESEEM)
Our angle sensing approach presented in the main text is based on the angle-sensitive hyperfine interaction, measured by spin-echo sequences between |0 and |− (Fig. 3). The essential point is that the electron spin-echo signal is dramatically affected by the hyperfine interaction due to the ESEEM effect, which is a well-studied phenomenon in NMR spectroscopy.
A detailed theoretical analysis of the ESEEM effect was first given by [4], and recently people have studied it in NV centers due to various nuclear species [5][6][7]. Based on these former works, here presents a derivation aiming to obtain an analytical expression of the spin-echo signal.
Given the initial electron and nuclear spin states (|ψ e and ρ N ), the full density matrix is where ρ N = 0.5 0 0 0.5 represents the mixed nuclear spin state. The evolution operatorÛ τ for a spin-echo sequence of free evolution time τ (Fig. 3) is: where R π represents the π pulse andÛ (τ /2) the free evolution operator for a duration of τ /2. The electron spin-echo signal P measures the overlap between the final and initial states: where P ψ0 = |ψ 0 ψ 0 | is the projection operator. The Hamiltonian H in the frame with respect to the electron spin states is H = I · A · S + γ N B · I. Plugging Eqs. (5), (6) into Eq. (7), we get: U 0 andÛ − are the nuclear spin evolution operators corresponding to the electron spin states |0 and |− respectively: whereω 0 andω − are the unit vectors pointing along the corresponding nuclear spin quantization axes ζ 0 and ζ − (section II-B). Plugging Eqs. (9), (10) into Eq. (8), we finally get: whereω 0 andω − are unit vectors along the quantization axes ζ 0 and ζ − .

D. Angle sensitivity analysis
We detect small angle changes by measuring the spin-echo signal P at a fixed τ , hence the angle sensitivity η is proportional to the derivative of P with respect to θ B : The effective angle coupling constant γ θ ≡ dω− dθ B corresponds to the slope of the hyperfine energy as a function of θ B (Fig. 4). In Eq. (11),ω 0 (ζ 0 ) always points alongx (the blue line in Fig. 3c).ω − (ζ − ) is roughly alongẑ but sharply turns towardx at θ B = 90 • (the orange curve in Fig. 3c). This sharp transition, however, occurs in a very narrow angle range, exactly where dω− dθ B almost diminishes at the minimum of ω − , thus it is not important to angle sensing. For the relevant angle range, we can therefore take |ω 0 ×ω − | 2 ≈ 1. From Eq. (11), we have: Next, we discuss how to connect ∂P ∂θ B to the angle sensitivity η by a proportionality constant determined by experimental parameters, including the NV fluorescence count rate F , the optical contrast C between the states |0 and |− , the APD readout window T r and the initialization time t ini (Fig. 3). As our experiment was using a short τ (≈ 2 µs), comparable to the initialization time t ini , we consider this measurement overhead. Suppose an angle signal = ∆θ, we expect to collect on average N photon number of photons per spin-echo sequence: Each sequence is of length = t ini + τ , and it is repeated for N avg = 1 /(tini+τ) times within an integration time of 1 second. The expected total number of photons corresponding to the signal ∆θ is: The photon shot noise is Thus we obtain the signal-to-noise ratio (SNR) within 1 sec integration time: The angle sensitivity η is defined as the minimal angle ∆θ that can be detected with SNR = 1 within 1 sec, hence Putting together Eqs. (12) , (13), (18), we get: As seen, η is inversely proportional to the effective angle coupling constant γ θ . The term

E. Angle sensing with conventional NV magnetometry
In this section, we discuss using the conventional NV magnetometry based on the electron Zeeman interaction to detect magnetic field angle changes.
When the external bias field is parallel to the NV axis (ẑ), the electron spin is in the basis of |m S = 0, ±1 , hence the energy levels are sensitive to magnetic field signals alongẑ (∆B z ) with the coupling constant γ Bz = γ B (electron gyromagnetic ratio) = 2.8 MHz/G. The sensitivity η Bz is given by [8]: As the bias field gradually turns toward a direction perpendicular to the NV axis, the electron basis changes and the energy levels become less sensitive to the signal ∆B z . That is, the B z coupling constant γ Bz ∝ S z decreases as θ B approaches 90 • (Fig. 6 red curve). Since B z = |B| cos θ B , δB z = −|B| sin θ B · δθ B , the angle sensitivity can be written as γ θ,con. is the effective angle coupling constant. As θ B approaches 90 • , γ θ,con. initially increases due to sin θ B , but eventually decreases to zero because γ Bz ∝ S z diminishes (Fig. 6b blue curves). In terms of the sensitivity η θ B ,con. , as θ B increases from 0 to 90 • , η θ B ,con. first decreases until γ 2 B B 2 x /D gs ∼ γ B B z , at which the electron eigenbasis significantly changes, and after that η θ B ,con. increases and the nuclear-assisted angle sensing approach takes over (see Fig. 3e of the main text). Comparing Eq. (20) and (21), we can see that the sensitivities of the two approaches take the same form, but differ by the effective angle coupling constant and proportionality factor.

III. DETECTION AND ORIGIN OF ANISOTROPIC NOISE
Here we discuss in more detail why the NV coherence time under a nearly perpendicular magnetic field is sensitive to anisotropic magnetic noise, in other words the correlation between the noises along different directions, and how randomly-flipping spins can give rise to such anisotropic noise.

A. Asymmetric angle dependence of coherence time
When the NV electron spin is in a superposition of |0 and |± , the coherence is affected by the transition energy fluctuation δE ±,0 between the two states: Define the off-angle ∆θ ≡ θ B − 90 • . Recalling Fig. 2a, b of the main text, we can write S z − ≡ k∆θ, S z + ≡ −k∆θ, S x + ≈ C and S x 0 ≈ −C, where k > 0 and C > 0 are constants. Therefore, The energy fluctuations cause random phase accumulation and hence decoherence. Suppose ∆φ is the phase accumulated during the free-evolution time τ , then the measured spin-echo signal ∝ cos(∆φ). The time-averaged signal is cos(∆φ) . Assume ∆φ follows normal distribution centered at zero, by Taylor expansion we have cos(∆φ) = exp(− ∆φ 2 /2), therefore the averaged spin-echo signal is determined by the variance of the phase. At a certain τ , ∆φ 2 ∼ δE 2 .
The last terms in Eqs. (27), (28) indicate that coherence is sensitive to the correlation between δB x and δB z noise, δB x δB z . For the anisotropic noise δB x δB z = 0, there exists an optimal ∆θ opt = 0 which minimizes the decoherence (recalling the white dashed lines in Fig. 4c-d of the main text). The sign of ∆θ opt depends on the sign of δB x δB z and is opposite for |± . Hence we expect to see the coherence time exhibits asymmetric angle dependence and |± show different asymmetries.

B. Origin of anisotropic noise in diamond
In diamond, magnetic noise is mainly caused by nearby randomly-flipping spins in the local environment. We first explain how a single spin can give rise to such an anisotropic noise at the NV. The coupling between two magnetic dipoles is: where B 2 (r) is the dipolar field generated by the dipole moment m 2 . Decomposing all the terms into x, y and z components, we can write the magnetic field δB due to a nearby noise spin at r relative to the NV position ( Fig. 7): Here (u x , u y , u z ) is the unit vector connecting the NV and the noise spin.Ŝ x ,Ŝ y andŜ z denote the spin operators of the noise spin. Next, we calculate δB 2 x,y,z using Ŝ x 2 = Ŝ y 2 = Ŝ z 2 = S 2 , Ŝ iŜj = 0 for i = j, and u 2 x + u 2 y + u 2 z = 1. It follows that δB 2 z = D 2 S 2 (3u 2 z + 1) According to Eq. (36), δB x and δB z are correlated as long as u x = 0 and u z = 0. Recalling Eqs. (27), (28), we expect to see the NV coherence shows angle asymmetry. The above is the result from a single noise spin. On the other hand, for a large ensemble of randomly distributed noise spins, the sum of their individual terms δB x δB z is likely be close to zero and the noise then becomes isotropic.
The asymmetry observed in our experiment indicates that the NV magnetic noise is dominated by one or a few spins nearby, and the summed effect is anisotropic.
Finally, we point out the difference between the real noise generated by randomly-flipping spins in diamond and a fully anisotropic noise fluctuating perfectly along a straight line, such that δB x and δB z are proportional to each other: δB x = tδB z (t = 0). In the latter case, we have Plugging Eq. (37) into Eqs. (27), (28), there exists an optimal ∆θ opt , at which the noise is completely suppressed, i.e. δE 2 ±0 = 0 (see Fig. 4c-d of the main text). However, for real noise from randomly-flipping spins (Eqs. (31) -(33)), at the optimal ∆θ opt , the noise coupling is maximally reduced but not zero.

IV. SIMULATION DETAILS
We simulated the NV spin-echo measurement using the QuTip package (Quantum Toolbox in Python) [9,10]. We first describe setting up the simulation in the rotating frame, and then incorporating noise into the system.
where S x and S z are the spin operators transformed to the rotating frame. However, if the noise is isotropic, such that thex andẑ components are uncorrelated, we need to define a list of two separate collapse operators: [ √ ΓS x , √ ΓS z ]. Fig. 4c-d of the main text visualize the simulation results in the presence of such noise.
Here we point out two differences between the simulation and experiment. Firstly, the simulated noise in QuTip is Markovian noise (white noise), which has infinitely short correlation time. However, the real noise in our experiment has specific noise spectrum and finite correlation time (recalling that dynamical decoupling can successfully extend the coherence). This inconsistency can cause an incorrect estimate of the coherence time and the exact shape of the coherence decay as a function of τ . Secondly, we only included a fully anisotropic noise in the simulation, however in real experiments, multiple noise sources coexist in the sample and the summed effect is partially anisotropic. In addition to magnetic field noise, there also exist electric field noise, temperature fluctuations, etc. which were not taken into account. (a)(b) Asymmetric angle dependence of the NV coherence time as the noise direction rotates in the XZ plane. Spin-echo simulation is done at a fixed free evolution time τ = 6.25 µs under the bias field |B| = 93 G. Colorbar represents the spin-echo amplitude. θnoise is the angle between the noise andx. (c) Schematics of the noise direction (black lines) relative to the NV axis and the bias magnetic field direction projected in the XZ plane.
To better illustrate that this provides a way to characterize the noise direction, we performed spin-echo simulations at fixed τ = 6.25 µs as a function of the noise direction. As shown in Fig. 8, the angle asymmetry significantly changes as the noise direction rotates in the XZ plane.