Detection of Molecular Transitions with Nitrogen-Vacancy Centers and Electron-Spin Labels

We present a protocol that detects molecular conformational changes with two nitroxide electron-spin labels and a nitrogen-vacancy (NV) center in diamond. More specifically, we demonstrate that the NV can detect energy shifts induced by the coupling between electron-spin labels. The protocol relies on the judicious application of microwave and radiofrequency pulses in a range of parameters that ensures stable nitroxide resonances. Furthermore, we demonstrate that our scheme is optimized by using nitroxides with distinct nitrogen isotopes. We use detailed numerical simulations and Bayesian inference techniques to demonstrate that our method enables the detection of conformational changes under realistic conditions including strong NV dephasing rates as a consequence of the diamond surface proximity and nitroxide thermalization mechanisms. Finally, we show that random molecular tumbling can be exploited to extract the inter-label distance.


INTRODUCTION
A precise knowledge of molecular structure and dynamics would shed new light on the mechanisms by which, e.g., proteins interact with their environment [1].This finds important applications in distinct fields such as biochemistry and biology, since macromolecular conformational changes underlie numerous biological processes.In this regard, different techniques have been proposed to study molecular structure and dynamics [2][3][4].In particular, methods based on nuclear magnetic resonance (NMR) [5,6] and on electron-spin resonance (ESR) [7,8] stand out as they are central to investigate a wide variety of molecules, with ESR being more sensitive due to the much larger gyromagnetic ratio of electrons [9].One commonly used ESR method is the Double Electron-Electron Resonance (DEER) in which synchronized and/or delayed pulses are delivered to, e.g., estimate average distances among free radicals in molecular ensembles [10].However, traditional ESR based on inductive detection with macroscopic coils requires macroscopic samples with a high chemical purity to produce a detectable response.This rules out ESR investigations of static and dynamic properties of individual molecules.
Detectors based on NV centers in diamond [11,12] are promising candidates to overcome the limitations of inductive detection.Indeed, such detectors enable ESR and NMR detection of molecular samples down to the micron-and nanoscale and even down to the level of single molecules.The potential of NV centers in diamond originates from a number of appealing properties and early demonstrations.They can be initialized and read out using laser light in the visible spectrum, thereby removing thermal fluctuations from the measurement process [13][14][15].Moreover, NV hyperfine states can be manipulated with microwave radiation in such a way that the NV couples coherently to nearby nuclear and electron spins while at the same time being decoupled from environmental fluctuations [16][17][18][19][20].These concepts have enabled shallowly implanted NV centers to detect electron spins [21] and even nuclear spins [22,23] above the diamond surface with single-spin sensitivity.Detection protocols have also been developed allowing for nanoscale NMR [24][25][26][27] and ESR detection [28][29][30] with spectral resolution approaching that of macroscopic ESR and NMR based on inductive detection.Fluctuating electron spins of biological samples [31][32][33][34] and small groups of statistically polarized nuclear spins in a target protein [35] have been detected.Finally and particularly relevant to the present work, an NV center has also been used to detect a single nitroxide electron-spin label [36] attached to a protein.The use of nitroxide spin labels is particularly attractive because it enables the study of non-paramagnetic molecules [37].In particular, Ref. [38] reported the detection of an effective inter-label coupling in molecular ensembles using advanced multi-frequency spectroscopy techniques.Attaching several nitroxides to a single target protein could enable the study of its internal dynamics at room temperature with an NV center.However, this approach is challenging because spin labels have resonance frequencies and interaction strengths that strongly depend on their orientation with respect to the external magnetic field [39].Therefore, the identification of these parameters is complicated by the unavoidable molecular motion and environmental noise affecting the NV and the electron-spin labels.
In this work, we show how even a simple pulse sequence applied to a single pair of electron-spin labels and a shallow NV [see Fig. 1(a)] can detect single-molecule conformational transitions at room temperature.Our carefully engineered DEER sequence asymmetrically delivers microwave (radiofrequency) pulses to electron spins of the NV center (nitroxide spin labels) to resolve small energy shifts in the NV spectrum owing to the coupling between labels.Crucially, we find an energy-transition branch of the labels that presents an excellent robustness against unavoidable tumbling motion in ambient conditions.In addition, we show that this branch is especially robust when each nitroxide label contains a distinct nitrogen isotope.Finally, we develop a simple but accurate model which enables us to estimate not only the coupling but also the distance between labels using Bayesian inference.In particular, we counter-intuitively show that the small residual effect of tumbling, instead of being detrimental, enables the extraction of the distance between labels.

The System
The Hamiltonian of the NV, the two nitroxide electron-spin labels, and the microwave (MW) and radiofrequency (RF) driving fields reads Here, σ z is the Pauli z operator for the NV two-level system and J i are spin-1/2 operators for each label (i = 1, 2).The Hamiltonian of the ith nitroxide label is H n i and the coupling of each label to the NV is mediated by the vectors a i .Moreover, J ± i = J x i ± iJ y i are electron-spin ladder operators and g 12 is the coupling constant between labels.The last line in Eq. ( 1) describes a MW field resonant with the NV, leading to the term Ω MW 2 σ x in a suitable interaction picture.In addition, an RF field of frequency ω RF and Rabi frequency Ω RF excites the electronic resonances of the nitroxide labels.Equation (1) is derived in the Supplemental Material [40] and a sketch of the system is presented in Fig. 1(a).
The term H n i models each nitroxide label as [39,41] H where µ B is the Bohr magneton, B z is a magnetic field applied along the z axis, γ N is the nuclear gyromagnetic ratio equal to 2π × 3.077 kHz/mT for 14 N and to 2π × −4.316 kHz/mT for 15 N, I i is the nuclear spin operator for the ith nitroxide label, and G i , Q i , and A i are respectively the Landé, quadrupolar, and electron-nucleus interaction tensors [41].We note that I i is a spin-1 (spin-1/2) operator when describing a 14 N ( 15 N) nuclear spin.The components of the G i , Q i , and A i tensors in a general reference frame depend on the frame's relative orientation with respect to the principal axes of the nitroxide [see Fig. 1(b)].In the principal frame, G i , Q i , and A i are diagonal [41].In particular, the Landé tensor in the principal frame is G (P) i = diag (G x , G y , G z ), with G x ≈ G y ≈ 2.007 ≡ G ⊥ and G z ≈ 2.002 ≡ G .The quadrupolar tensor for 14 N is 26 MHz, Q y ≈ 2π × 0.53 MHz, and Q z ≈ 2π × −1.79 MHz.The quadrupolar tensor vanishes for 15 N. Finally, the tensor that mediates electron-nucleus interactions in each nitroxide is A (P)  i = diag (A x , A y , A z ), where A x ≈ A y ≈ 2π × 14.7 MHz ≡ A ⊥ and A z ≈ 2π × 101.4 MHz ≡ A for 14 N, while A x ≈ A y ≈ 2π × 27 MHz ≡ A ⊥ and A z ≈ 2π × 141 MHz ≡ A for 15 N [41].< l a t e x i t s h a 1 _ b a s e 6 4 = " M I t 0 X E q 0 e M N l F E O h 5 G V X t p + m i f 8 = " > A A A B 7 H i c b V D L S s N A F J 3 U V 6 2 v q k s 3 g 0 V w V Z I q 6 L K g i M s q 9 g F p K J P p T T t 0 M h N m J k I J / Q t d i b r z a / w B / 8 Z J z U J b z + r c e 8 6 F c 2 6 Y c K a N 6 3 4 5 p Z X V t f W N 8 m Z l a 3 t n d 6 We obtain approximate nitroxide transition frequencies via a perturbative treatment of the nuclear degrees of freedom in Eq. ( 2) [40].For a nitroxide hosting 14 N, we find The three energy-transition branches exhibit transition energies given by E i 2  and Here, θ i is the azimuth angle between the applied magnetic field and the principal z axis of the nitroxide [see Fig. 1 and | 1 i , | 0 i , and | − 1 i are the states of the ith nitroxide nucleus dressed by the hyperfine interaction with the nitroxide electron [40].Similarly, for a nitroxide hosting 15 N, we find ) There are now two energy-transition branches with transition energies given by E i  3) and (4) (dashed lines) with numerical diagonalization of Eq. (2) (solid lines).Note that since we will target the E i 0 branch for label detection, we have further developed its functional form to include second-order corrections in the electron-nitrogen coupling [40].Fig. 2(a) focuses on a single nitroxide (the index i = 1 is removed for clarity) and shows that our expression for E 0 is in excellent agreement with numerical diagonalization.
The inter-label coupling leads to an additional splitting ∝ g 12 of the energy-transition branches in Eqs.(3,4).This term typically simplifies as 1 J z 2 , since labels with different orientations have different resonance frequencies, thus eliminating the flip-flop contribution.Note that while this simplification is frequently (but not always) valid when using two 14 N, it is guaranteed to be valid when using nitroxides hosting different nitrogen isotopes since E 0 (for 14 N) differs from E 1/2,−1/2 (for 15 N) for any value of the azimuth [see Fig. 2(a)].For 14 N, the available resonances of, e.g., the first label are then determined by the modified nitroxide Hamiltonian ( That is, any energy-transition branch E 1 q (corresponding to the | q nuclear state of the first nitroxide) splits as depending on the electronic state |e , |g of the second nitroxide.Ref.
[40] includes a complete energy diagram of an electron spin in a nitroxide.

The Protocol
Our DEER protocol simultaneously delivers MW and RF pulses to detect energy shifts in the NV spectrum due to interlabel coupling.The sequence contains two free-evolution stages of duration τ free separated by a driving stage [see Fig. 1(c)].The NV is prepared in the +1 eigenstate of σ x and the nitroxides are assumed to be in a fully thermalized state.During free evolution, the NV accumulates a phase due to the term σ z a 1 • J 1 + a 2 • J 2 in Eq. ( 1).This term can be approximated as σ z a z 1 J z 1 + a z 2 J z 2 in the rotating-wave approximation (RWA) since the J x,y i contributions are suppressed by the large electronic precession frequencies of the nitroxides.Indeed, the energies E i 1,0,−1 reach several hundreds of MHz even for moderate values of B z (we use B z = 30 mT in our simulations).By contrast, the NV-label coupling takes values of hundreds of kHz for typical NV-label distances of several nanometers.During MW/RF irradiation, the NV undergoes an overall flip σ z → −σ z via 2N + 1 contiguous πpulses arising from the same continuous MW drive.At the same time, a single weaker RF π-pulse on the labels induces J z i → −J z i if it is near-resonant with an electronic transition (i.e., with E i 1,0,−1 for 14 N or with E i 1/2,−1/2 for 15 N).The simultaneous flipping of the NV and spin label ensures a constructive and coherent accumulation of the NV phase during free evolution.Meanwhile, the use of 2N + 1 π-pulses on the NV ensures that the Rabi frequencies of the two drives are well separated, which effectively averages out spurious NVlabel interactions during irradiation.Consequently, scanning the RF frequency near nitroxide transitions yields clean resonance peaks in the NV response.As long as Ω RF < g 12 , l 0 7 T T P B h P 5 J Y D w F P 5 9 / e l A i l x i I w n u w 7 N a t l y / + 0 b q L 7 Z 1 7 K w j j R E F J j M V o / 4 V h H O C s F 9 5 g E q v n Y E E I l M 1 9 i O i S S U G 2 q K 5 n 4 z m z Y e d K q V Z 3 j a u 3 6 p F K / y I s o o j 2 0 j 4 6 Q g 0 5 R H V 2 i B m o i i h 7 R M 3 p D 7 9 a D 9 W S 9 W K 8 / 1 o K V 3 + y i P 7 A + v g G 0 S 5 p t < / l a t e x i t > < l a t e x i t s h a 1 _ b a s e 6 4 = " n a q 3 B 6 d h G r j 0 t 9 c 8 h P a 6 c m v P T H P E p S g x G z E e u F q S A m J t P e p M c V M i N G F i h T 3 G 5 J 2 I A q y o y 9 T s 7 W 9 x b L L k P j r O S d l 8 q 3 5 U L l a n 6 I L B z B M R T B g w u o Q B V q U A c G E p 7 h D d 4 d 4 T w 5 L 8 7 r T z T j z P 8 c w h 8 5 H 9 9 x U Y 0 t < / l a t e x i t > (MHz) < l a t e x i t s h a 1 _ b a s e 6 4 = " B 9 K a 6 9 D 4 0 c M K Z P E t w f N n x j y 6 m m g = " 2. (a) Energy-transition branches of an electron spin label at B z = 30 mT for 14 N ( 15 N).Solid black (grey) lines show the transition energies as a function of the azimuth θ obtained via numerical diagonalization of Eq. ( 2).Dashed black (grey) lines correspond to E 1,0,−1 in Eq. ( 3) [E 1/2,−1/2 in Eq. ( 4)].The vertical line highlights the case θ i = 30 • , with red dots indicating the transition energies relevant in the following plots.(b) NV spectrum σ x NV as a function of the RF frequency applied near E 1 0 .The spectrum was obtained by unitary propagation of Eq. ( 1) with H n i given by Eq. (2) (black line) and by E i 0 J z i (grey circles).The first nitroxide has azimuth θ 1 = 30 • while the second nitroxide has azimuth θ 2 = 91.7 • .The splitting of the peaks is induced by the inter-label coupling g 12 ≈ 2π × 1 MHz.The positions of the resonances are indicated by the dashed red lines.In (c, d), shaded areas show the average NV spectra σ x NV in the presence of tumbling of the first (near-resonant) nitroxide.Tumbling was mimicked by averaging over a random azimuth following a Gaussian distribution centered at the equilibrium value θ 1,eq = 30 • .The orientation of the other nitroxide was kept fixed for simplicity.The standard deviation was chosen to be σ θ = 6.25 • .In (c), we observe that tumbling leads to a loss of contrast and to signal broadening near E 1 0 .Nevertheless, the spectrum still shows two clearly separated peaks.For comparison, the case without tumbling in (b) is superimposed (black line).(d) Average NV spectrum σ x NV near E 1 1 .Here, the energy splitting cannot be resolved due to nitroxide tumbling.Also note that tumbling severely reduces contrast.For that reason, the spectrum in the absence of tumbling has much higher contrast and is not shown.1) with H n i given by Eq. ( 2), while grey circles were obtained assuming the simplified H n i in Eq. ( 3).The two spectra are in excellent agreement.Simulations in Fig. 2(b) assume B z = 30 mT, which is in the range of values that ensure the stability of the E i 0 energy-transition branch discussed below [40].Moreover, the parameters of the pulse sequence are τ free = 1.3 µs, Ω RF = 2π × 250 kHz, and Ω MW = 31 × Ω RF , for a total sequence time of 4.6 µs.In addition, the labels are separated from the NV by the distances d 1 ≈ 6.9 nm and d 2 ≈ 7.3 nm, leading to a 1 ≈ 2π × (128, −132, −223) kHz and a 2 ≈ 2π × (−22, −16, −264) kHz, while the distance between labels is d 12 ≈ 3.297 nm.
The expressions for the energy-transition branches in Eqs.(3,4) reveal a dependence on the azimuth angle, i.e., E i q ≡ E i q (θ i ).Consequently, unavoidable protein motion during the irradiation stage leads to a distortion in the spectrum and to a difficult interpretation of the signal.However, it is important to note the distinct nature of the E i 0 branch, which shows a much weaker dependence on θ i than E i 1,−1 .This makes the E i 0 branch particularly well suited for robust detection of the energy splitting [see Figs.2(c,d)].To maximize the robustness, we chose the magnetic field to be large enough to energetically suppress the effect of the anisotropic hyperfine interaction, but small enough that the anisotropy of the Landé tensor does not become significant [40].

Numerical simulations
We now illustrate our method in realistic ambient conditions including decoherence leading to NV dephasing with decoherence time T 2 = 20 µs (for a 4 nm NV depth [36]), electron-spin label relaxation with T 1 = 4 µs [36], and molecular tumbling.The dissipative model used in this section is described in Ref. [40] and captures the main decoherence mechanisms identified in Ref. [36].Note that for the specific protocol considered here, decoherence mainly manifests as a reduced line contrast and not as an increased linewidth.This is because we keep the sequence duration fixed and sweep ω RF to find the resonances, as opposed to varying the sequence length at fixed ω RF to observe an echo signal.The molecular tumbling is modelled as a random rigid rotation of both nitroxides around an axis parallel to the laboratory x axis [40].Our simulations use a rotation angle δ that is Gaussian-distributed with standard deviation σ δ = 6.25 • .This is somewhat smaller but comparable to the fluctuations observed in Ref. [36].Note that immobilizing proteins in more rigid matrices [42,43] or attaching them to the diamond surface [35] through multiple rigid covalent bonds could further reduce tumbling.The resulting tumbling-averaged spectra σ x NV are shown in Fig. 3.In Figs.3(a,b,c), the parameters τ free , Ω MW , Ω RF , and a i are the same as in Fig. 2. The details of the equilibrium nitroxide configurations are given in Ref. [40].In Fig. 3(a), the labels are separated by d 12 ≈ 3.297 nm and the inter-label coupling is g 12 ≈ 2π × 1 MHz.When the frequency of the RF field is set close to E 1 0 , we clearly identify two resonance peaks in spite of tumbling.We have verified that the two resonances are still visible even if we choose σ δ to be four times larger.Since g 12 ∝ d − 3  12 , a change in the relative position of the labels significantly modifies the observed spectrum.This is shown in Fig. 3(b) where the second label was displaced such that d 12 ≈ 4.03 nm, leading to the disappearance of the splitting.This change in the spectrum certifies a change in the relative position between labels and, by extension, a conformational change in the host molecule.
So far, all simulations were performed for nitroxides host-   (nm) NV for overlapping label resonances with two 14 N isotopes (blue shaded area) and with distinct 14 N and 15 N isotopes (grey shaded area).(d) Marginal distribution L(d 12 |X) of the inter-label distance for simulated data acquisition using the spectrum shown in (a).The "true" value of the distance and its posterior expectation, 3.297 nm and 3.54 (25) nm, are indicated with vertical lines.The error is the standard deviation of the marginal posterior.
ing 14 N and having distinct transition energies.If both nitroxides have similar transition energies (e.g., due to similar azimuths), the spectra of the two nitroxides overlap and the inter-label flip-flop terms cannot be neglected.This complicates the interpretation of the spectrum.As shown in Fig. 3(c), this problem is avoided by using distinct 14 N and 15 N isotopes in each nitroxide.In this case, the E 0 branch of the 14 N nitroxide never overlaps with the branches of the 15 N nitroxide and flip-flop terms can be safely neglected.As a result, the interpretation of the spectrum is much simpler.We emphasize that the purpose of using such "orthogonal labels" is not merely to resolve their distinct spectral signatures [44]: rather, it is to simplify the form of the inter-label interaction itself for all label orientations.

Bayesian inference
Finally, we show how to infer the inter-label distance d 12 under realistic ambient conditions.We first simulate the experimental acquisition of σ x NV .The simulated dataset has the form X = {X 1 , . . ., X M }, where X j is an experimental estimate of the probability of measuring σ x = +1 after N m measurements at RF frequency ω RF, j .Second, we use a simplified model to efficiently extract information from X.The model captures the relevant features of the tumbling-averaged spectrum S(ω RF ).More precisely, we derive the approximate expression for a specific nitroxide azimuth θ and a specific angle β between the magnetic field and the line joining the nitroxides.Here, Ω 2 ± (ω RF , θ, β) = Ω 2  RF + ω RF − E 0 (θ) ± g 12 (β)/2 2 and S 0 and C ± are parameters that adjust the baseline and contrast, respectively [40].Moreover, E 0 (θ) is the 14  12 (1 − 3 cos 2 β) cannot give independent access to the distance d 12 and the angle β.This is because β is unknown a priori.However, light tumbling fluctuations allow the NV to probe different geometric configurations of the nitroxides.This results in a small distortion of the line shape that yields information beyond that contained in the splitting g 12 .This in turn enables the independent extraction of the distance d 12 and of the angle β.With the help of our model, we can therefore obtain the posterior probability of the parameters V using Markov Chain Monte Carlo sampling [45].Assuming a uniform prior for V, the posterior probability for V is Here, the noise variance σ 2 m ≈ 1 − σ x 2 NV /4N m is assumed to be approximately constant and known.In Fig. 3(d) we show the resulting marginal L(d 12 |X) of d 12 for a dataset X simulated from the spectrum shown in Fig. 3(a).Here, X was obtained by taking N m = 2 × 10 4 ideal measurements for each of M = 25 frequencies ranging from ω RF /2π = 839 to 843 MHz (we estimate that the same accuracy is achieved with N m ≈ 5 × 10 5 for imperfect NV detection efficiency [40,46]).The expectation of the marginal posterior is d 12 = 3.54 (25) nm, close to the "real" value 3.297 nm [see Fig. 3(d)].

DISCUSSION
Our results open many interesting avenues for future investigation.In particular, it would be of great interest to extend our scheme to molecules with more than two attached spin labels.This would yield a stronger NV response, leading to a more detailed observation of conformational changes as well as to an enhancement in the range of inter-label distances to be estimated.The scheme could also be improved through the use of multiple NVs to better triangulate the label positions.In addition, our analytical understanding of the NV response could enable fast Bayesian inference of molecular dynamical properties.Our results pave the way for the observation of conformational dynamics of individual proteins using tools from magnetic resonance.
Supplemental Material: Detection of Molecular Changes with Nitrogen-Vacancy Centers and Electron-Spin Labels

I. NV-LABELS HAMILTONIAN
In the following, we derive Eq. ( 1) of the main text.We start with the Hamiltonian for a driven NV center interacting with two driven nitroxide electron-spin labels.The full Hamiltonian is Here, D = 2π × 2.87 GHz is the zero-field splitting of the NV center, |γ e | = 2π × 28 MHz/mT is the electron gyromagnetic ratio, is the dipolar interaction between the NV and the ith label electron, and is the dipolar interaction between label electrons.In these equations, r i is the vector joining the NV with the ith label, r 12 = r 1 − r 2 is the relative vector that connects the two labels, d i = | r i |, and d 12 = | r 12 |.The last two terms on the right hand side of Eq. (S1) are the MW and RF driving terms, respectively.We move to the interaction picture with respect to In addition, we set the MW field on resonance with the 0 ↔ 1 NV transition (ω MW = ω + ).In the interaction picture, the Hamiltonian takes the form . This is justifiable since the strength of the interaction between the NV and labels is much smaller than the transition energies of the NV.Therefore, the terms proportional to S x,y can be neglected in the RWA.
We initialize the NV in the m s = 1, 0 manifold.Moreover, the Hamiltonian does not contain terms that can significantly populate the m s = −1 subspace.Consequently, we can project the Hamiltonian on the m s = 1, 0 manifold and treat the NV as a two-level system.The resulting Hamiltonian is where The next approximation consists in removing the counter-rotating terms in H ee .These are terms of the form J + 1 J + 2 and J − 1 J − 2 that precess under the externally applied magnetic field B z .They can be neglected in the RWA since the strength of the coupling between label electrons is much smaller than their Zeeman energy.Under this assumption, H ee simplifies to with . Combining the above approximations leads to Eq. ( 1) of the main text.

II. SIMPLIFIED DYNAMICS OF THE NITROXIDE LABELS
In this section, we develop a simplified model of electron-nucleus dynamics within each nitroxide label.Our approach is based on a perturbative treatment of the nitroxide nuclear degrees of freedom that are orthogonal to the z direction, i.e., the direction of the external magnetic field.We first introduce the rotation matrices used to relate the laboratory axes and the nitroxide principal axes, namely, The two frames are related via the combined rotation R(θ, ϕ) = R z (ϕ)R y (θ).In particular, a tensor O (P) defined with respect to the nitroxide principal axes takes the form O = R(θ, ϕ)O (P) R(θ, ϕ) in the laboratory frame.For instance, consider the nitroxide Hamiltonians [Eq.( 2) of the main text].In the present analysis, we ignore the quadrupolar and nuclear Larmor terms since they are small and do not contribute significantly to the dynamics.The validity of this last assumption was confirmed by our detailed numerical simulations.With this assumption, the nitroxide Hamiltonians expressed in the laboratory frame become Due to the symmetry of the G (P) i and A (P) i tensors (G x ≈ G y ≈ 2.007 and A x ≈ A y ≈ 2π × 14 MHz) we can set ϕ i = 0 without loss of generality.We find (S7) A. Simplified dynamics of a nitroxide label hosting 14 N As a first approximation, we keep only the terms proportional to J z i in Eq. (S7) .This is a reasonable first approximation since the hyperfine interaction is typically smaller than the electronic Zeeman energy.The resulting Hamiltonian is where To find the shifts on J z i associated to specific nuclear spin states, we diagonalize the term Since 14 N is a spin-1 particle, diagonalization leads to three nuclear eigenstates | 0 , | 1 , and | − 1 .The states have eigenenergies (S10) Thus, our leading approximation for the nitroxide Hamiltonian is where The above expressions reveal the existence of three energy-transition branches.There is one central branch with energy µ B B z G(θ i ).The other two branches are shifted from the central branch by < l a t e x i t s h a 1 _ b a s e 6 4 = " c e 9 m V f u i d 6 M j p y j W 7 Landé Coupling with the Nitrogen Electron-electron coupling | 1i|ei < l a t e x i t s h a 1 _ b a s e 6 4 = " r D W n e C V X t 6 9 q z 1 l v R d q 2 v + x u < l a t e x i t s h a 1 _ b a s e 6 4 = " T Z e r q d g / c D n e u D v e y L q W < l a t e x i t s h a 1 _ b a s e 6 4 = " y j V I 3 N S T t s k x y 5 N f D r q y k 4 9 u z Y e d J u 1 a 1 j 6 u 1 6 5 N y / T w v o g j 2 w A G o A B u c g j q 4 A k 3 Q A h g 8 g m f w B t 6 N B + P J e D F e f 6 w F I / + z C / 7 A + P g G A y a V / g = = < / l a t e x i t > FIG.S1.Energy diagram of a nitroxide label hosting a 14 N.A magnetic field B z is applied along the laboratory z axis, leading to a Landé splitting of the electronic states (blue panel).The hyperfine coupling between the label electron and the nitrogen then splits the energy levels (green panel).Finally, each level is further split in two by the coupling between label electrons (yellow panel).The red arrows in the yellow panel indicate the transitions targeted by our protocol.
A full energy diagram is given in Fig. S1.Note that for moderate magnetic fields, E i 0 depends much more weakly than E i 1,−1 on the nitroxide azimuth θ i since the Landé tensor is almost isotropic, G G ⊥ , while the hyperfine tensor is strongly anisotropic, A A ⊥ .Thus, the central branch is particularly important since it can be robust against molecular tumbling (i.e., robust against changes in θ i ).Note, however, that the dependence of E i 0 on θ i due to the small anistropy of the Landé tensor can become significant if the magnetic field becomes too large.At low magnetic fields, the above approximation starts to break down.We now investigate the leading correction to the central branch E i 0 due to the hyperfine interaction in that regime.This correction arises from the nondiagonal terms in Eq. (S7), i.e., the terms proportional to J x,y i .We first rewrite the nondiagonal terms in Eq. (S7) as where We find the second-order correction due to V by performing operator perturbation theory.More precisely, we move to a rotating frame with respect to µ B B z G(θ i )J z i and find the effective contribution of V by keeping time-independent terms in its Dyson series (expanded up to second order).This leads to an effective interaction (α i −iβ i )(α i +iβ i ) 2µ B B z G(θ i ) J z i .Projecting this expression onto the | 0 subspace gives the leading correction to E i 0 , This expression shows that the anisotropy of the hyperfine tensor can lead to a strong dependence of E i 0 on θ i when the magnetic field becomes small enough to be comparable to the hyperfine coupling.From the above arguments, we therefore expect that there exists an optimum magnetic field strength where the central branch is most robust to variations in the azimuth θ i .This is illustrated in Fig. S2.
In summary, we write the nitroxide Hamiltonian as          (Bottom panels) Numerical simulation of the average NV spectrum σ x NV for the same magnetic fields as in the top panels.All simulations are performed by unitary propagation of Eq. ( 1) of the main text and using the full nitroxide Hamiltonian, Eq. ( 2).We show the spectrum for an equilibrium azimuth θ eq = 30 • (black lines) and the spectra averaged over a Gaussian distribution of angles centered at θ eq and with standard deviation σ θ = 6.25 • (shaded areas).At intermediate magnetic fields, the spectrum is resilient to tumbling due to a weak dependence of the central branch E 0 on θ. with 2(A ⊥ A ) 2 + (A ⊥ ) 4 − (A ⊥ A ) 2 sin 2 (θ i ) (A ⊥ ) 2 sin 2 (θ i ) + (A ) 2 cos 2 (θ i ) , Γ(n + 1) (S19) The above model was previously used to accurately describe the experimental results of Ref. [S36].

C. Inference model
In this section, we motivate the expression used for Bayesian parameter inference in the main text.We make the following simplifying assumptions: 1.The system is simplified to a single NV interacting with a single target nitroxide ( 14 N) with orientation (θ, ϕ).The only role of the other nitroxide is to introduce an energy shift ±g 12 (β)/2 on the target nitroxide depending on its state.Here, g 12 (β) ∝ d −3 12 (1 − 3 cos 2 β) is the dipole-dipole coupling and β is the angle between the magnetic field and the vector r 12 joining the nitroxides.
2. The longitudinal coupling a z between the NV and target nitroxide stays approximately constant during molecular tumbling.This is a reasonable approximation for small molecular tumbling angles.
3. The driving frequency ω RF is close to resonance with the E 0 (θ) energy-transition branch of the target nitroxide and far off resonance with the other branches.Therefore, non-trivial evolution of the target nitroxide occurs only for nuclear eigenstate | 0 .4. The π-pulse on the NV is simply described by the action of the operator −iσ x , i.e., the interaction between the NV and label electrons during irradiation can be neglected.
With these assumptions, the Hamiltonian of the target nitroxide during free evolution is H free,± = E 0 (θ) − ω RF ± g 12 (β) 2 J z + a z 2 σ z J z ⊗ | 0 0| .Similarly, the Hamiltonian of the target nitroxide during irradiation is H pulse,± = E 0 (θ) − ω RF ± g 12 (β) 2 J z + Ω RF J x ⊗ | 0 0|.In these expressions, the index ± labels the states of the other nitroxide electron.For coherent dynamics, these Hamiltonians yield the propagator U ± = e −iH free,± τ free e −iH pulse,± π Ω RF (−iσ x )e −iH free,± τ free .We assume an initial state ρ = |+ +| ⊗ I 2 ⊗ I 3 , i.e., the target nitroxide is in a fully mixed state.We also assume that the other nitroxide is in a fully mixed state so that the evolutions U ± have equal probability.With these initial conditions, we find that the spectrum S(ω RF , θ, β) = σ where Ω 2 ± (ω RF , θ, β) = Ω 2 RF + ω RF − E 0 (θ) ± g 12 (β)/2 2 , S 0 = 1, and C s = 1 6 sin 2 a z τ free 2 .For a fixed value of τ free , we expect the main effect of dissipation to be two-fold.First, NV decoherence can modify the baseline NV response S 0 when the drive is off-resonant.Second, NV decoherence and relaxation of the nitroxide electrons can reduce the contrast C s in a way that may depend on s = ±.Therefore, we leave S 0 , C + , and C − as adjustable parameters for the dissipative model.In the presence of molecular tumbling, the average spectrum S(ω RF ) is obtained by averaging Eq. (S20) over a suitable distribution of the tumbling angle δ, with the angles θ and β both depending on δ.For tumbling by an angle δ around an axis parallel to the laboratory x axis (see Fig. S3), the azimuth angle θ of the target nitroxide is related to δ by θ(δ) = arccos cos(δ) cos(θ eq ) + sin(δ) sin(θ eq ) sin(ϕ eq ) , (S21) where (θ eq , ϕ eq ) is the equilibrium orientation of the target nitroxide.Moreover, the dependence of the angle β on the tumbling angle δ is described by the expression cos 2 [β(δ)] = A 2 β cos 2 (δ + φ β ), where A β and φ β are parameters capturing the orientation of r 12 in the x − y plane.Using these relations, the average spectrum S(ω RF ) is obtained by numerically averaging S[ω RF , θ(δ), β(δ)] over δ assuming that δ is Gaussian-distributed with unknown standard deviation σ δ .When trying to infer d 12 , there are nine adjustable parameters in total.We assume that S 0 is calibrated and known.The remaining eight adjustable parameters are V = {C + , C − , θ eq , ϕ eq , A β , φ β , d 12 , σ δ }.

D. Inference of the distance between nitroxide electron-spin labels
We now describe how to infer system parameters from the simplified model discussed in Sec.III C. We first simulate the acquisition of experimental data from a spectrum obtained numerically using Eq.(S19).Here, we use the spectrum of Fig. 3(a) in the main text.The data has the form X = {X 1 , . . ., X M }, where X j is an estimate of the probability P + = 1 + σ x NV /2 of the NV occupying the +1 eigenstate of σ x when the target nitroxide is driven at frequency ω RF, j .Assuming ideal NV measurements, t e x i t s h a 1 _ b a s e 6 4 = " F e N S S 6 9 R 0 S g Y T o w b m W C w 4 W 9 + y I Q = " > A A A B 6 n i c b Z D N S g M x F I X v 1 L 9 a / 6 o u 3 Q S L 4 K r M q K j L o h s 3 Q g X 7 I + 1 Q M u m d N j S Z G Z K M U I a + h K 5 E 3 f k 4 v o B v Y 1 p n o a 1 n 9 e W e E 7 j n B o n g 2 r j u l 1 N Y W l 5 Z X S u u l z Y 2 t 7 Z 3 y r t 7 T R 2 n i m G D x S J W 7 Y B q F D z C h u F G Y D t R S G U g s B W M r q d + 6 x G V 5 n F 0 b 8 Y J + p I O I h 5 y R o 0 d P W R d J c l t a 0 J 6 5 Y p b d W c i i + D l U I F c 9 V 7 5 s 9 u P W S o x M k x Q r T u e m x g / o 8 p w J n B S 6 q Y a E 8 p G d I A d i x G V q P 1 s t v C E H I W x I m a I Z P b + n c 2 o 1 H o s A 5 u R 1 A z 1 v D c d / u d 1 U h N e + h m P k t R g x G z E e m E q i I n J t D f p c 4 X M i L E F y h S 3 W x I 2 p I o y Y 6 9 T s v W 9 + b K L 0 D y p e u f V 0 7 u z S u 0 q P 0 Q R D u A Q j s G D C 6 j B D d S h A Q w k P M M b v D v C e X J e n N e f a M H J / + z D H z k f 3 / x F j Y g = < / l a t e x i t > MW RF FIG. 1.(a) A protein with two attached labels is near a diamond surface that contains a shallow NV.(b) Nitroxide molecule including the electron spin (yellow).The principal axes are shown in red, while the laboratory frame is shown in black.The azimuth θ (the angle between the z principal axis and the z laboratory axis) determines the energy-transition branches of the label.(c) MW and RF driving scheme.This includes initialization and readout with laser and microwave pulses, two free evolution stages of duration τ free , 2N + 1 MW π-pulses on the NV, and a simultaneous RF π-pulse on the labels.

1 < l a t e x i t s h a 1 _ b a s e 6 4 =
o m u g C l e 6 r o 8 5 3 l Y 1 e h 2 2 w 4 Z 4 3 m 3 X m t d V 0 U U Y Z j O I F T c O A C W n A L b e g A h U d 4 h j d 4 N 6 b G k / F i v P 5 E S 0 b x 5 w j + y P j 4 B m x I k S w = < / l a t e x i t > E " 7 r G 8 C / z w o m u g C l e 6 r o 8 5 3 l Y 1 e h 2 2 w 4 Z 4 3 m 3 X m t d V 0 U U Y Z j O I F T c O A C W n A L b e g A h U d 4 h j d 4 N 6 b G k / F i v P 5 E S 0 b x 5 w j + y P j 4 B m 3 U k S 0 = < / l a t the resonance peaks are split by g 12 .Fig.2(b) shows the NV spectrum (the expectation value of σ x ) associated with the transitions |0g |g ↔ |0e |g and |0g |e ↔ |0e |e .The resonances are split by ∼ g 12 as expected.The solid black line in Fig. 2(b) was obtained by numerically propagating Eq. ( FIG. 3. (a) Simulated average NV spectrum σ x NV .Two resonance peaks due to g 12 are observed.(b) Similar to (a) but with lower g 12 .(c) Simulated average spectrum σ xNV for overlapping label resonances with two14 N isotopes (blue shaded area) and with distinct 14 N and15 N isotopes (grey shaded area).(d) Marginal distribution L(d 12 |X) of the inter-label distance for simulated data acquisition using the spectrum shown in (a).The "true" value of the distance and its posterior expectation, 3.297 nm and 3.54(25) nm, are indicated with vertical lines.The error is the standard deviation of the marginal posterior.
N energy-transition branch, while g 12 (β) ∝ d −3 12 (1 − 3 cos 2 β) is the inter-label coupling.Both θ and β depend on the tumbling angle δ [40].Averaging S[ω RF , θ(δ), β(δ)] over a Gaussian distribution for δ gives the tumbling-averaged spectrum S(ω RF ).Assuming that the baseline S 0 is known, our model contains eight free parameters denoted by V [40].These include d 12 and the unknown standard deviation σ δ of the tumbling.It must be emphasized that the light tumbling dependence of the E 0 branch enables the determination of the inter-label distance.Indeed, a simple measurement of the line splitting g 12 ∝ d −3

< l a t e x i t s h a 1 _
b a s e 6 4 = " M b t 5 t E A / d D i 9 d a R U M s F + U + 0 o j 5 k = " > A A A B 6 n i c b Z D N T g I x F I X v 4 B / i H + r S T S M x c U V m D F G X R D c u M Z E f A x P S K X e g o Z 2 Z t B 0 T M v I S u j L q z s f x B Xw b C 8 5 C w b P 6 e s 9 p c s 8 N E s G 1 c d 0 v p 7 C y u r a + U d w s b W 3 v 7 O 6 V 9 w 9 a O k 4 V w y a L R a w 6 A d U o e I R N w 4 3 A T / l a t e x i t > |ei < l a t e x i t s h a 1 _ b a s e 6 4 = " 5 e s g k km E R h c S 0 g 3 X N Q / 4 h S B 3 S j 8 = " > A A A B 6 n i c b Z D N T g I x F I X v 4 B / i H + r S T S M x c U V m D F G X R D c u M Z E f A x P S K X e G h n Z m 0 n Z M C P I S u j L q z s f x B Xw b C 8 5 C w b P 6 e s 9 p c s 8 N U s G 1 c d 0 v p 7 C y u r a + U d w s b W 3 v 7 O 6 V 9 w 9 a O s k U w y Z L R K I 6 A d U o e I x N w 4 3 A T q q 5 9 X a b a 1 S v 8 o P U Y Q j O I Z T 8 O A C 6 n A D D W g C A w n P 8 A b v j n C e n B f n 9 S d a c P I / h / B H z s c 3 7 k S O K g = = < / l a t e x i t > |gi < l a t e x i t s h a 1 _ b a s e 6 4 = " a 2 3 C A L o q 2 r 6 a K 5 z S W 2 3 n 1

g 12 / 2 <
g Y a O p e 0 H R M y 4 S F 0 Z d S d r + M L + D Y W n I W C / + r r + f 8 m 5 z 9 + I o U 2 j v N F C m v r G 5 t b x e 3 S z u 7 e / k H 5 8K i t 4 1 R x b P F Y x q r r M 4 1 S R N g y w k j s J g p Z 6 E v s + J P b u d 9 5 R K V F H D 2 Y a Y J e y E a R C A R n x o 6 6 o 0 H m 1 m Y X t U G 5 4 l S d h e g q u D l U I F d z U P 7 s D 2 O e h h g Z L p n W P d d J j J c x Z Q S X O C v 1 U 4 0 J 4 x M 2 w p 7 F i I W o v W y x 7 4 y e B b G i Z o x 0 8 f 6 d z V i o 9 T T 0 b S Z k Z q y X v f n w P 6 + X m u D a y 0 S U p A Y j b i P W C 1 J J T U z n t e l Q K O R G T i 0 w r o T d k v I x U 4 w b e 5 y S r e 8 u l 1 2 F d q 3 q X l b r 9 / V K 4 y Y / R B F O 4 B T O w Y U r a M A d N K E F H C Q 8 w x u 8 k w l 5 I i / k 9 S d a I P m f Y / g j 8 v E N 9 Y C M 6 g = = < / l a t e x i t > l a t e x i t s h a 1 _ b a s e 6 4 = " D 6 Z U i N w o Y T z C M C y F h 1 b e v I a u G C 8 = " > A A A B 6 X i c b Z D L T g I x F I Z P 8 Y Z 4 Q 1 2 6 a S Q m r n C G E H V J d O M S E 7 k k M C G d c g Y a O p e 0 H R M y 4 S F 0 Z d S d r + M L + D Y W n I W C / + r r + f 8 m 5 z 9 + I o U 2 j v N F C m v r G 5 t b x e 3 S z u 7 e / k H 5 8 K i t 4 1 R x b P F Y x q r r M 4 1 S R N g y w k j s J g p Z 6 E v s + J P b u d 9 5 R K V F H D 2 Y a Y J e y E a R C A R n x o 6 6 o 0 H m 1 m Y X t U G 5 4 l S d h e g q u D l U I F d z U P 7 s D 2 O e h h g Z L p n W P d d J j J c x Z Q S X O C v 1 U 4 0 J 4 x M 2 w p 7 F i I W o v W y x 7 4 y e B b G i Z o x 0 8 f 6 d z V i o 9 T T 0 b S Z k Z q y X v f n w P 6 + X m u D a y 0 S U p A Y j b i P W C 1 J J T U z n t e l Q K O R G T i 0 w r o T d k v I x U4 w b e 5 y S r e 8 u l 1 2 F d q 3 q X l b r 9 / V K 4 y Y / R B F O 4 B T O w Y U r a M A d N K E F H C Q 8 w x u 8 k w l 5 I i / k 9 S d a I P m f Y / g j 8 v E N 9 Y C M 6 g = = < / l a t e x i t > g 12 /2 t e x i t s h a 1 _ b a s e 6 4 = " N c N 1 z 30 Q w K H 7 I W w 5 O N i b E 3 b + y c I = " > A A A B + X i c b V D L S s N A F J 3 4 r P U V F d y 4 G S x C 3 Z S k C r o s u u l G q G A f 0 J Q y m d 6 0 Q 2 e S M D M R a u z H 6 Er U n b / h D / g 3 T m o W 2 n p W 5 9 5 z L p x 7 / J g z p R 3 n y 1 p a X l l d W y 9 s F D e 3 t n d 2 7 b 3 9 l o o S S a F J I x 7 J j k 8 U c B Z C U z P N o R N L I M L n 0 P b H 1 5 n e v g e p W B T e 6 U k M n t E b e r d S 6 8 l 6 s V 5 / r E t W f n O A / s D 6 + A Y d z p M + < / l a t e x i t > ✓ ( ) < l a t e x i t s h a 1 _ b a s e 6 4 = " Z Q 0 N g U V 6 s 1 o 2 Y c t F + 5 l I i X 4 z o u 4 = " > A A A B 8 3 i c b 5 r A Y A z P 8 A b v V m Y 9 W S / W 6 4 + 1 Y O U 3 x / A H 1 s c 3 U r 6 Q f g = = < / l a t e x i t > t e x i t s h a 1 _ b a s e 6 4 = " N c N 1 z 3 0 Q w K H 7 I W w 5 O N i b E 3 b + y c I = " > A A A B + X i c b V D L S s N A F J 3 4 r P U V F d y 4 G S x C 3 Z S k C r o s u u l G q G A f 0 J Q y m d 6 0 Q 2 e S M D M R a u z H 6 Er U n b / h D / g 3 T m o W 2 n p W 5 9 5 z L p x 7 / J g z p R 3 n y 1 p a X l l d W y 9 s F D e 3 t n d 2 7 b 3 9 l o o S S a F J I x 7 J j k 8 U c B Z C U z P N o R N L I M L n 0 P b H 1 5 n e v g e p W B T e 6 U k M n t E b e r d S 6 8 l 6 s V 5 / r E t W f n O A / s D 6 + A Y d z p M + < / l a t e x i t > ✓ ( ) < l a t e x i t s h a 1 _ b a s e 6 4 = " Z Q 0 N g U V 6 s 1 o 2 Y c t F + 5 l I i X 4 z o u 4 = " > A A A B 8 3 i c b 5 r A Y A z P 8 A b v V m Y 9 W S / W 6 4 + 1 Y O U 3 x / A H 1 s c 3 U r 6 Q f g = = < / l a t e x i t > t e x i t s h a 1 _ b a s e 6 4 = " Z Q 0 N g U V 6 s 1 o 2 Y c t F + 5 l I i X 4 z o u 4 = " > A A A B 8 3 i c b MHz)< l a t e x i t s h a 1 _ b a s e 6 4 = " N c N 1 z 30 Q w K H 7 I W w 5 O N i b E 3 b + y c I = " > A A A B + X i c b V D L S s N A F J 3 4 r P U V F d y 4 G S x C 3 Z S k C r o s u u l G q G A f 0 J Q y m d 6 0 Q 2 e S M D M R a u z H 6 Er U n b / h D / g 3 T m o W 2 n p W 5 9 5 z L p x 7 / J g z p R 3 n y 1 p a X l l d W y 9 s F D e 3 t n d 2 7 b 3 9 l o o S S a F J I x 7 J j k 8 U c B Z C U z P N o R N L I M L n 0 P b H 1 5 n e v g e p W B T e 6 U k M

S18) Here, T 2 =
20 µs is the NV coherence time for an NV depth of 4 nm [S36], Γ ≈ 2π × 2.68 Hz is the relaxation rate of the label electrons, and n = 1/ exp ( γ e B z /k B T ) − 1 is the thermal occupation of a bosonic thermal bath of temperature T that generates electronic transitions.For the magnetic field B z = 30 mT and the temperature T = 300 K used in our simulations, this corresponds to an electronic relaxation timeT 1 = 1/ [(2n + 1)Γ] ≈ 4 µs [S36].The coherent part of the evolution in the presence of driving is described by the Hamiltonian FIG.S3.Starting from an initial configuration (left), the molecule is slightly rotated around an axis parallel to the laboratory x axis (right).In the right panel, the transparent image shows the initial configuration for better comparison.
x NV has the form S(ω RF , θ, β) ≈ r d S 6 8 l 6 s V 5 / r E t W f n O A / s D 6 + A Y d z p M + < / l a t e x i t > FIG.S2. (Top panels) Energy-transition branches of a nitroxide as a function of its azimuth angle θ for B = 3, 30 and 300 mT (left to right).Solid black (grey) lines correspond to a nitroxide hosting 14 N ( 15 N).All branches are obtained by diagonalizing Eq. (2) of the main text.