Electrically driven spin resonance of 4f electrons in a single atom on a surface

A pivotal challenge in quantum technologies lies in reconciling long coherence times with efficient manipulation of the quantum states of a system. Lanthanide atoms, with their well-localized 4f electrons, emerge as a promising solution to this dilemma if provided with a rational design for manipulation and detection. Here we construct tailored spin structures to perform electron spin resonance on a single lanthanide atom using a scanning tunneling microscope. A magnetically coupled structure made of an erbium and a titanium atom enables us to both drive the erbium’s 4f electron spins and indirectly probe them through the titanium’s 3d electrons. The erbium spin states exhibit an extended spin relaxation time and a higher driving efficiency compared to 3d atoms with spin ½ in similarly coupled structures. Our work provides a new approach to accessing highly protected spin states, enabling their coherent control in an all-electric fashion.

Lanthanide atoms represent a promising pla orm to tackle this dilemma.Their well-localized 4f electrons show long spin relaxa on T1 2,3 and coherence mes T2 4,5 .In addi on, their strong hyperfine interac on facilitates the read-out of nuclear spins 6,7 .In bulk insulators, exceedingly long T1 and T2 have been demonstrated using op cal control and detec on [8][9][10][11] down to the single atom level 12,13 .While hybrid op cal-electrical approaches have been developed to access individual lanthanide atom's spins embedded in a silicon transistor 14 , it is s ll challenging to achieve efficient control of the quantum states using electrical transport methods.This necessitates the ra onal design of a quantum pla orm capable of tackling both control and detec on schemes, along with their interac ons with local environments.In this context, single crystal surfaces cons tute an advantageous framework both for building atomically engineered nanostructures and addressing individual spin centers, in par cular using probe techniques 15- 18 .However, coherent manipula on and detec on of surface-adsorbed lanthanide atoms have so far remained elusive.
In this work, we demonstrate the control and detec on of 4f electron spins by building atomic-scale structures on a surface using a scanning tunneling microscope (STM) with electron spin resonance (ESR) capabili es [19][20][21][22] .The atomic structures are composed of an erbium (Er) atom as the target spin system and a magne cally coupled tanium (Ti) atom as the sensor spin.This architecture allows us to drive ESR transi ons on the Er 4f electrons with a projected angular momentum of ½ 23 and to probe them indirectly through Ti.We observed an Er T1 of close to 1 μs, 5 mes longer than what was previously measured in 3d electrons with spin ½ on the same surface 18 .This novel pla orm allows for the ESR driving and read-out of the well-screened 4f electron spin states, paving the way to integrate lanthanide atoms in quantum architectures.

Sensing Er Spin States through a Ti Atom
Erbium atoms on a few monolayer-thick MgO(100) on Ag(100) present a 4f 11 configura on with no unpaired electrons in the 5d and 6s shells 23 .The atomic-like spin and orbital momenta are coupled through the large spin-orbit interac on into a total angular momentum  with magnitude of 15ħ/2 23 .When adsorbed on the oxygen site of MgO (Fig. 1a), the crystal field leads to a strong hard-axis magnetocrystalline anisotropy that stabilizes a doubly-degenerate ground state with an out-of-plane component of the angular momentum ±ħ/2 23 , which splits into two singlets when an external magne c field (B) is applied.
As found in a previous work 23 , the component of  along the magne c field direc on (z), defined as  , increases from ±ħ/2 to ±4ħ by rota ng B from the out-of-plane (ϑ = 0°) to the in-plane (ϑ = 90°) direc on (Fig. 1b), while retaining a large probability for spin dipole transi ons.Given these proper es, Er can be regarded as a highly tunable two-level system allowing for efficient ESR driving.To characterize the magne c states and anisotropy of Er, we u lized the dipole field sensing technique 24 with a Ti atom on the bridge binding site of MgO as a well-known spin sensor.On this binding site, Ti has a spin STi of magnitude ħ/2 and a rela vely weak g-factor anisotropy 25 with respect to the oxygen binding site 26 .
We deposited Er and Ti at cryogenic temperatures (~10 K) on 2 monolayers of MgO grown on Ag(100) (Methods and Fig. S1a).Their binding sites on the surface can be changed by atom manipula on (Supplementary Sec on 2). Figure 1c shows the ESR spectra obtained on Ti in an Er-Ti dimer with the atomic separa on of 0.928 nm (Fig. S2b).For ϑ = 8°, we observed one ESR peak at the resonance frequency of Ti which splits into two peaks separated by Δf = 334 ± 3 MHz when rota ng B close to the in-plane direc on (ϑ = 68°).The two ESR peaks stem from the magne c interac on with the Er spin fluctua ng between two states 24 during the measurement, with the rela ve peak intensity being propor onal to the me-averaged popula on of the Er states.The pronounced difference in the rela ve intensity of the ESR peaks indicates a large imbalance in the Er state occupa on even at B = 0.3 T and 1.3 K, which reflects the large Jz of Er at ϑ = 68° (Fig. 1b).The sign of this asymmetry depends on the character of the magne c interac ons between the two atoms.In Fig. 1c, the peak at the lower frequency is less intense than the one at the higher frequency and, hence, the interac on can be regarded as ferromagne c 27 .
The angle dependence of Δf (Fig. 1d) gives a direct measurement of the Er-Ti interac on energy and of its anisotropy 24,27 .To interpret it, we model the system through a spin-Hamiltonian including both the single atom Zeeman and anisotropy terms, as well as the interac on between the two spins: Here,  is the Bohr magneton,  ⟂ is the out-of-plane component of  ,  = 1.2 is the Er g-factor , and  is the Ti anisotropic g-tensor 25 .We use a magne c anisotropy parameter  = 2.4 meV to match the Er energy spli ng found in a previous study 23 .The magne c coupling consists of dipolar ( ) and Heisenberg exchange interac ons ( ): where  is the vacuum permi vity,  the separa on between the two atoms,  the unit vector connec ng them 24 , and  the exchange interac on energy expressed in terms of  28 .In our model,

𝐽
is the only free parameter for the fit.As shown in Fig. 1d, our model accurately reproduces the data for  /h = ─48 MHz, where the nega ve sign indicates an an ferromagne c coupling.This value is more than 20 mes smaller than that observed for a Ti-Ti dimer at the same distance (─1.16 GHz) 29 .We ascribe the smaller Er-Ti coupling to the localiza on of the 4f orbitals near the atom's core, which limits the overlap between Er and Ti orbitals when compared to the Ti-Ti case.
The strong angle dependence of Δf can be understood by considering the large magneto-crystalline anisotropy of  .At ϑ = 90°,  is largest (4ħ) and the angular momenta of both atoms are parallel to  (Fig. 1e), which maximizes the contribu on of the dipolar coupling with a posi ve sign (ferromagne c).
When rota ng B away from the in-plane direc on,  follows the direc on of B, while the anisotropy of Er preserves a large component of  mainly aligned along the in-plane direc on (Fig. 1f).This misalignment between the two angular momenta reduces the dipolar interac on.Finally, as B approaches the surface normal (Fig. 1g),  turns towards the out-of-plane direc on with a much smaller value of  = ħ/2.With the two momenta being perpendicular to  , the dipolar contribu on is minimal and nega ve (an ferromagne c).Conversely, the mutual projec on of  and  is the only factor modula ng the exchange interac on term, which remains nega ve (an ferromagne c) at all angles.The total interac on (solid purple line) calculated by the model Hamiltonian is composed of a dipolar contribu on (dashed blue line) and an exchange contribu on (dashed pink line).e─g, Schema c of the angular momenta of Er and Ti on MgO/Ag(100).The dipolar fields induced by Er are depicted as black curved arrows.When B is applied along the in-plane direc on (ϑ = 90°), the Jz is maximum and aligned with the spin of Ti giving the largest ferromagne c interac on.When B is rotated, the spin of Ti follows the direc on of B while the total angular momentum of Er is aligned preferen ally in-plane (f).In the out-of-plane direc on (ϑ = 0°), Jz is minimum and aligned with the spin of Ti (g) giving a small an ferromagne c interac on.

Spin Resonance of Er 4f Electrons
The direct drive of ESR in STM requires posi oning the p directly on top of the target atom 19 .However, we observed no ESR when posi oning the p over an Er atom (Fig. S3b), which we a ribute to the small polariza on of the 5d and 6s shells of Er and to the weak interac on between the 4f and tunneling electrons.These factors were found to limit the tunneling magnetoresistance at the STM junc on in other lanthanide atoms 30,31 , possibly hindering both the ESR drive and detec on 23 .
To overcome this limita on, we built a strongly interac ng Er-Ti dimer by posi oning Ti at 0.72 nm from Er through atom manipula on (Fig. 2a and Supplementary Sec on 2).Similar to the isolated atom, we observed no ESR peaks at the Er posi on in the dimer (yellow curve in Fig. 2b).However, when the p was posi oned on Ti, we observed up to 5 peaks (pink curve in Fig. 2b).The first two peaks below 10 GHz with Δf = 2.70 ± 0.01 GHz correspond to the ESR transi ons of Ti that were similarly found in the dimer with larger atomic separa ons (Fig. 1c).Hence, we label them as  and  , respec vely.In this dimer, we observed that  shows a higher intensity than  , indica ng an an ferromagne c exchange interac on 27 domina ng over the dipolar coupling at this atomic separa on.At higher frequencies, we further observed two peaks that are significantly blue-shi ed when rota ng B from ϑ = 52° (pink curve in Fig. 2b) to 97° (purple).The higher resonance frequencies and pronounced angle dependence indicate that those transi ons involve the large and anisotropic angular momentum of Er, and, thus, we label them as  and  .In addi on, their frequency separa on exactly matches the one between  and  , reflec ng the same Er-Ti interac on.On the other hand,  and  are approximately equal in intensity, indica ng that Ti fluctuates between two spin states with almost equal occupa ons.The comparable Ti states' occupa on stems from the sca ering with tunneling electrons and from the Zeeman spli ng of Ti (~7 GHz) being smaller than the thermal energy at the measurement temperature of 1.3 K (~27 GHz).With B at ϑ = 52°, we observed one more peak at even higher frequencies.Its frequency exactly matches the sum of  and  (or equivalently  and  ), which suggests an ESR transi on involving both Ti and Er spins.We label this peak as  .Remarkably, the sign of  ,  and  is opposite to that of  and  , indica ng a different detec on mechanism for the transi ons involving the Er spin, which will be discussed below.Finally, we observed an energy level crossing between Er and Ti transi ons at ϑ ~ 12°, with the Er resonance frequencies further shi ing below the Ti transi ons at ϑ ~ 0° (Fig. 2c and Fig. S4).This peculiar behavior is a consequence of the large difference in magne c anisotropy between Er and Ti 23 .
As shown in Fig. 2c, the angular dependence of the ESR frequencies is well reproduced by using Eq. 1 with /h = ─326 MHz.We observed small devia ons for  ,  and  , which we ascribe to different experimental condi ons and magne c interac on of Ti with the p, which is not included in our model.
Diagonalizing Eq. 1 allows us to analyze the quantum states of the Er-Ti dimer in terms of individual Er and Ti spin states.For an in-plane B = 0.3 T, the energy detuning between the Er and Ti spins (30 GHz) is much larger than the interac on energy (about 3 GHz).Therefore, the Er-Ti dimer can be modeled with the 4 Zeeman product states of the Er and Ti spins.Following this picture, we can support the assignment of  , as Ti spin transi ons occurring with no changes in the Er state, while  , correspond to Er spin transi ons without altering Ti.Finally, we a ribute  to a double-flip transi on involving both Er and Ti spins.Even though a |∆| > 1ħ process is generally forbidden to first order, anisotropic terms in the magne c interac on can give rise to higher order matrix elements connec ng states with Δm = ±2ħ 32 .
When the field is oriented at ϑ = 0°, both  and  show an expecta on value of ħ/2, but a detuning s ll occurs due to the difference between the g-factors, gEr = 1.2 and gTi = 1.989 25 .This detuning is comparable to their interac on energy and, thus, the two middle levels are no longer described by Zeeman product states (Fig. 2e).Finally, at the level crossing angle (ϑ ~ 12°), the two Er and Ti middle levels become singlet and triplet states 29 .However, measuring ESR spectra under these condi ons becomes challenging (Fig. S5), possibly due to the limita on in our detec on as discussed in the following.

Erbium ESR Detec on and Driving Mechanisms
The detec on of ESR peaks exclusively occurs when the p is posi oned on top of Ti.Moving the p from Ti to Er, the intensi es of  and  gradually decrease and eventually vanish at ~0.3 nm from the Ti center (Fig. S6).This behavior indicates that driving an ESR transi on on Er must induce a change in the Ti state occupa on, subsequently modifying the spin polariza on of the tunnel junc on.In addi on, Er ESR signals differ depending on specific p condi ons, i.e., different ps show posi ve or nega ve sign for  , (Fig. 3a).
To further delve into the driving and detec on mechanisms of the Er spin, we measured the intensi es of  and  as a func on of Vrf using a p that shows nega ve Er peaks (Fig. 3b).While  exhibits a con nuous increase in intensity with increasing Vrf,  reaches satura on at Vrf ~ 20 mV.The result for  aligns with previous measurements on Ti 29 , while the low-power satura on of Er is comparable to that of Fe, which might reflect a long T1 and/or a high Rabi rate (Ω) 33 .To understand this Vrf-dependence as well as the signs of ESR signals, we developed a rate equa on model (Supplementary Sec on 7) based on the four-level scheme depicted in Fig. 3c.When driving  , the popula ons of the ini al and final states involved in the transi on tend to equalize through a popula on transfer 34 .The changes in popula on are counteracted by the relaxa on rates of each state ( , and  , ), which tend to repopulate the depleted states.These rates are inversely propor onal to the T1 of the atom involved in the spin flip.
Since Ti located under the p is strongly influenced by tunneling electrons, relaxa on events occur on a much shorter mescale than for Er 35 , providing a more efficient pathway to a ain the steady state.In addi on, to account for the p-dependent sign and intensity of Er ESR signals, we included a spin-pumping term origina ng from the spin-polarized current that can shi the Ti spin occupa on (Fig. 3c for a nega vely polarized p) 17,36 .The proposed detec on scheme based on the change of Ti state popula on accurately describes the Vrf-dependence (Fig. 3b) and the p-dependent sign varia ons of the ESR signals (Fig. S7).
Finally, to iden fy the ESR driving source of the Er spin, we follow the rela ve peak intensity (ΔI/Idc) at different p heights, as controlled by Idc.As shown in Fig. 3d, ΔI/Idc of  increases with reducing the psample distance, indica ng that the main driving term for Ti arises from the exchange interac on with the spin-polarized p 37,38 .On the other hand, ΔI/Idc for  remains independent of Idc, which iden fies the modula on of the magne c interac on with Ti as the ESR driving source of Er 39 .The modula on of the magne c coupling 40 , in combina on with anisotropic interac on terms 32 , addi onally explains the drive of the double-flip transi on  .

Relaxa on Time Measurement through Electron-Electron Double Resonance
By applying an addi onal rf voltage (Vrf2), Ti and Er spins can be simultaneously driven in the so-called "electron-electron double resonance" scheme 41 .In a single-frequency ESR sweep, the rela ve intensi es of  and  (Fig. 4a) reflect the thermal popula on of the Er spin.Instead, in double resonance the rela ve intensi es of  and  are equalized when  is simultaneously driven (Fig. 4b).As shown in Fig. 4c, the intensity ra o of  and  (∆ /∆ ) increases with increasing Vrf only when Vrf2 is applied at the resonance frequency of  or  , enabling selec ve modula on of the Er states to an out-of-equilibrium configura on.
Taking advantage of this selec ve driving mechanism, we implemented an inversion recovery measurement to es mate the spin relaxa on me of Er ( ) in a pump-probe scheme (Fig. 4d).A er exci ng  with a pumping rf pulse of 200 ns dura on that equalized the Er popula on, we applied a probe pulse of 500 ns for  a er a delay me Δt.Using this sequence, we monitored the me evolu on of the intensity of f1 as a func on of Δt from the out-of-equilibrium to the thermal state (Fig. 4e).The fit to an exponen al func on (Fig. 4e) gives  = 0.818 ± 0.115 μs, which is five mes longer than what previously measured in Fe-Ti dimers in the absence of tunnel current 18 .We a ribute this enhancement to the efficient decoupling of 4f electrons from the environment, which reduces the relaxa on events arising from the sca ering with substrate electrons.
The large  measured through Ti indicates that the rapid spin fluctua ons of Ti occurring on the mescale of a few ns 35 do not significantly perturb the stability of the Er states.This property par ally originates from the large energy detuning between Er and Ti levels, which prevents the energy exchange required for spin-flip events.Using the experimentally obtained value of  in the rate equa on model, we extract a driving term W = Ω 2 T2/2 for Er that is two mes larger than for Ti in the same dimer (Supplementary Sec on 7).Despite the long spin life me and large driving term, a empts to drive Er Rabi oscilla ons through Ti do not yield a complete cycle (Fig. S8b), preven ng a direct measure of the Er T2.
This is most likely due to a rela vely low Rabi rate Ω provided by the moderate Er-Ti exchange coupling, which is about 2─3 mes smaller than in the Fe-Ti dimer 39 .In turn, a low value of Ω together with a large driving term W would imply much longer T2 for Er than previous 3d elements, highligh ng the poten al of 4f electrons to realize higher performance atomic-scale qubits.

Conclusions
demonstrated a new experimental approach to electrically drive ESR on the elusive 4f electrons in a surface-adsorbed lanthanide atom with long spin relaxa on me.Given the reduced sca ering with the substrate electrons, it is reasonable to an cipate an enhancement in the coherence me of Er in comparison to 3d elements.We expect that, by employing a similar approach in different atomic structures, the ESR driving on the 4f electrons can be amplified, enabling the use of lanthanide atoms as surface spin qubits with superior proper es compared to the rou nely adopted 3d elements.

STM measurements
Our experiment was performed in a home-built STM opera ng at the cryogenic temperature of ~1.3 K in an ultrahigh vacuum environment (< 1 x 10 ─9 Torr) 42 .Using a two-axis vector magnet (6 T in-plane/4 T outof-plane), the magne c fields were varied from 0.28 T to 0.9 T at different angles from the surface 42 .To allow atom deposi on on the sample kept in the STM stage, the sample is slightly lted from the axis of the magnet by ~7° as es mated from the fit to the data shown in Fig. 1d.Considering this misalignment, all our experimental ϑ were offset by that amount accordingly.The magne c ps used in our measurements were prepared by picking up ~4─9 Fe atoms from the MgO surface un l the ps presented good ESR signals on isolated Ti atoms.

ESR measurements
We used two different schemes to apply Vrf to the STM junc on: one through the p and one through an antenna (rf generators: Keysight E8257D and E8267D) 42 .In all our measurement involving a single rf sweep, we applied the Vrf using an antenna located near the STM p except for the data in Fig. 3b, where the Vrf was combined with the dc bias voltage Vdc using a diplexer at room temperature and then applied to the STM p.The data in Fig. 4a─c were acquired by applying Vrf1 to the p and simultaneously Vrf2 to the antenna.For the measurements reported in Fig. 4e and Fig. S8, the two rf voltages (Vrf1 and Vrf2) were combined through a power spli er (minicircuits ZC2PD-K0244+) and applied to the STM p.For these measurements, both rf generators were gated by an arbitrary waveform generator (Tektronix, AWG 70002B).

Sample prepara on
The surface of a Ag(100) substrate was cleaned by repeated cycles of Ar+ spu ering and annealing (700 K).
We grew atomically thin layers of MgO(100) on the Ag(100) following a procedure described in a previous work 43 .We deposited Fe, Ti and Er atoms (< 1% of monolayer) from high purity rods (>99%) using an ebeam evaporator.During the deposi on the sample was held at ~10 K in order to have well-isolated single atoms on the surface.

Analysis of ESR spectra
We fit the ESR spectra using a model given in 29 in order to extract the resonance frequency, peak intensity, and peak width for the data shown in Fig. 1d From the STM image in Fig. S1a, it is possible to dis nguish the MgO(100) patch from the Ag(100) substrate by the different apparent height.On top of the MgO patch different atoms are dis nguishable by their dis nct apparent heights: ~130 pm for Ti on the oxygen site (TiO), ~210 pm for Ti on the bridge site (TiB), ~210 pm for Er on the oxygen site (ErO), ~285 pm for Er on the bridge site (ErB), and ~170 pm for Fe on the oxygen site.The species are further iden fied by their dI/dV spectra (Fig. S1b─k).While most of the atoms are dis nguishable from the apparent heights and the spectral features, the ErO and TiB present a similar apparent height as well as no clear spectral features.To dis nguish these two species, we u lize the spinpolarized STM p.In contrast with ErO (Fig. S1h), the dI/dV spectrum on TiB measured using the spinpolarized STM p (Fig. S1g) presents a feature characteris c of a spin-flip excita on at around 0 mV (1) similarly to TiO (Fig. S1f).In the main text and in the following sec ons, we simply refer to TiB as Ti and ErO as Er.

2-Atom manipula on to construct Er-Ti dimers
The Er-Ti dimer used to acquire the data presented in Fig. 1c,d was built through atom manipula on.A er iden fying a Ti atom and an Er atom, we manipulated the Ti adsorp on site by the following procedure: 1) posi on the STM p 1 la ce site away from the Ti center (set point: Vdc = 100 mV, Idc = 20 pA), 2) switch off the STM feedback, 3) approach the p by 330 pm to the surface, 4) apply a voltage pulse of 330 mV, and 5) switch the feedback on.This procedure allows us to move the Ti atom by half la ce sites (from TiO to TiB and vice versa) in a controlled manner.We repeated this procedure un l we obtained the desired Er-Ti dimer with a distance of 0.928 nm (Fig. S2) with the Ti atom placed at the (-2, 2.5) la ce posi on from Er.We used a similar procedure to preapare the Er-Ti dimers with 0.72 nm separa on with the Ti atom placed at the (±2.5, 0) or (0, ±2.5) la ce posi on from Er.

3-Electron spin resonance on isolated Ti and Er
In order to perform ESR on an isolated Er atom, we confirmed whether the prepared spin-polarized p is suitable to perform ESR or not, by measuring the ESR signal on an isolated Ti atom (Fig. S3a).When posi oning the same p over an isolated Er atom, however, no ESR peak was detectable (Fig. S3b)  When we applied the magne c field close to the out-of-plane direc on (ϑ = 7°), we observed 4 ESR peaks (Fig. S4).As explained in the main text, when the magne c field is applied out-of-plane (ϑ = 0°) the expecta on value of  is ħ/2 similarly to  .However, the Er g-factor is 1.2, while Ti has a g-factor of 1.989 (3).The peaks at lower frequencies, thus, correspond to the Er ESR transi ons ( 3 and  4 ) due to the smaller Zeeman energy of Er than the one of Ti.To further clarify the iden fica on of ESR peaks, we measured the ESR speactra at different magnitudes of magne c fields at ϑ = 7° and followed the linear dependence of their resonance frequencies on the magne c field magnitudes.

5-Electron spin resonance spectra close to the level crossing
When the magne c field is applied at about 12° from the normal to the surface (ϑ ~12°), we expect Er and Ti to have similar Zeeman spli ngs.In this situa on, the intermediate energy levels of the Er-Ti dimer with 0.72 nm separa on must be regarded as singlet ( ) as explained in the main text.In Fig. S5, we show three ESR spectra acquired around the expected matching angle, i.e. ϑ = 14.5°, 17°, and 22°.When the ESR spectrum is acquired at ϑ = 22°, all four ESR transi ons from  1 to  4 are visible, with  3 and  4 observed at higher frequencies than  1 and  2 .In addi on, the different peak intensi es between  1 and  2 (with the intensity of  1 larger than  2 ) indicate an an ferromagne c coupling between Er and Ti (5).Conversely, for both ϑ = 17° and ϑ = 14.5° , it is not possible to iden fy the  3 and  4 peaks stemming from Er ESR transi ons.Nevertheless, for both spectra measured for ϑ ≤ 17°  1 and  2 , the asymmetry is reversed, sugges ng a change of the system configura on possibly due to the close match between the Er and Ti levels at around ϑ = 12°.As discussed in the main text, close to ϑ = 12° the energy levels of the system cannot be represented as Zeeman product states and for this reason the detec on mechanism for both the Ti and the Er peaks explained in the main text may not be valid in this range of ϑ.

6-Tip posi on dependence of ESR signals on the Er-Ti dimer
As men oned in the main text, when the p is posi oned above the Ti atom in the Er-Ti dimer with 0.72 nm separa on, we can resolve up to 5 ESR peaks.However when we move the p away from the Ti center, the peaks related to the Er ESR transi ons decrese in intensity (Fig. S6).When the p is about 0.3 nm from the Ti center the intensity of the peaks is too low to be resolved (spectrum 2).In a similar way, when the p is posi oned above Er no peaks are detectable (spectrum 1).), when the p is approached laterally to the Er atom, the Er ESR peaks,  and  , shi to lower frequencies due to the an ferromagne c interac on between the Er atom and the magne c p. The intensity of the peaks decreases with moving the p away from the Ti atom and no peaks are detectable at a distance of 0.3 nm from its center (spectrum 2).The spectra 2, 3, 4 and 5 were shi ed ver cally -100 fA, -200 fA, -300 fA and -400 fA respec vely for clarity.

7-Rate equa on model
To reproduce the different sign of the peaks of the Er's ESR transi ons shown in Fig. 3a, as well as the dependence of the peak intensity as a func on of the driving strength (Vrf) displayed in Fig. 3b of the main text, we developed a rate equa on model based on the four-level scheme picture of Fig. S7a Here,  is the popula on of the level ,  is the driving of the transi on , and  is the relaxa on rate of the levels connected by the transi on .The "+" and "-" superscripts in the relaxa on rates indicate if the relaxa on is towards a lower energy level (+) or a higher energy level (-), such that the total relaxa on can be wri en as  =  −  .We dis nguish the total relaxa on rates for Er and Ti by compu ng  = 1/ and  = 1/ .In addi on, we conserve the total popula on,  +  +  +  = 1.To obtain the steady state solu on we set the deriva ves equal to zero.By considering a specific driving  and solving the system of equa ons in the steady state, we obtain the popula on of each level.We included the spin pumping term (ζ) as a shi of the popula on of the levels given by the injec on of |↑⟩ states into Ti, as follows: We used the rate equa on model to fit the Vrf dependence of the peak intensity in Fig. 3b.We set  = 10 ns ( 7) and  = 818 ns.We used two different driving terms for Er and Ti transi ons:  =  =  =   and  =  =  =   , where  , is the respec ve scaling factor for the driving of Ti and Er ESR.The fi ng parameters are  ,  and the spin pump term.The fi ng yielded  = 14917,  = 29338 and a nega ve spin pump of ─0.94%.The driving term can be expressed as  =   /2 (8).The rabi rate  depends on the strength of the modula on provided by the p-atom or atomatom coupling and it is linear with Vrf and, thus, the scaling factor .As discussed in the main text and in the previous sec on, the Er-Ti coupling is 3─4 mes smaller than Fe-Ti dimers used for remote ESR of 3d electrons (6, 9).Therefore, we expect a lower Rabi rate for Er since its driving comes from the modula on of its magne c interac on with Ti.On the other hand, the fit yields a driving factor  larger than  , which suggests a much longer T2 of Er compared to other 3d elements, possibly due to the well protected 4f orbitals.
The spin pumping term ζ is required to account for the different sign of the Er peaks observed with different ESR ps, as shown in Fig. 3a in the main text.As discussed in the following, our model indicates that a nega ve ζ produces nega ve Er peaks while the opposite is true for a posi ve ζ.In Fig. S7b, we show the effect of ζ on  3 in the rate equa on model.In the absence of spin pumping, a small posi ve signal is predicted.This is due to the difference in energy between the ESR transi ons  1 and  2 which leads to an intrinsic difference between  and  .

8-Measurement of Rabi oscilla ons
To measure Rabi oscilla ons on Ti and Er atoms, we followed a procedure similar to the one used in (7).With the STM p posi oned on top of the Ti atom in the Er-Ti dimer with 0.72 nm separa on, we applied a series of Vrf pulses at the resonance frequency of f1 (Fig. S8a) and f3 (Fig. S8b) with increasing pulse widths.We subtracted a linear fit to the data in order to remove the rf rec fied current given by the nonlinearity of the I-V curve (10).When we apply rf pulses at the resonance frequency of f1 we can resolve Rabi oscilla ons in the Ti spin (Fig. S8a).The fit of the signal measured on a Ti atom with an exponen ally decaying sinusoidal func on yields a Rabi rate ΩTi of 435 MHz ± 41 MHz and a  of 9.9 ns ± 3.4 ns.On the other hand, when we apply rf pulses at the resonance frequency of f3, no Rabi oscilla on is observed.The monotonic decrease of the signal is due to the nega ve sign of the f3 peak, which reaches satura on for sufficiently long rf pulses.

9-Dimer with 167 Er
When measuring different Er-Ti dimers at the same separa ons (0.72 nm), we observed that a small frac on of them do not show any peak in the Er ESR transi on range (Fig. S9).We ascribe this observa on to the presence of 167 Er isotopes on the surface, which is the only observa onally stable isotope of Er with a non-zero nuclear spin, present with a 22.9% abundancy.This isotope presents a nuclear spin of 7ħ/2.When driving ESR transi ons on this atom, a single ESR peak is expected to split into 8 peaks due to its hyperfine interac on with the nuclear spin (11).However, as for this atom the intensity of the Er ESR transi on is also reduced by a factor of 8 and, the ESR signal becomes too small to be detected in the present detec on scheme.Nevertheless, this observa on further supports the interpreta on that f3 and f4 correspond to ESR transi ons in the Er 4f spins since these transi ons are the only ones that should be affected by the hyperfine interac on between the Er electron and nuclear spins.

Fig. 1 |
Fig. 1 | Probing Er 4f electron spins through a Ti spin sensor.a, Schema c of the experimental set-up for ESR-STM measurement of an Er-Ti dimer built on MgO/(100)/Ag(100).The Ti atom (purple) is posi oned close to the Er atom (orange) and located under a spin-polarized (SP) STM p.The external magne c field (B) defines the z-direc on and is applied at an angle ϑ from the out-ofplane direc on.A dc voltage Vdc is applied to the STM junc on while the radio-frequency (rf) voltage is applied to the p or to the antenna with an amplitude Vrf.b, The projected total angular momentum of Er (Jz) onto the B field direc on as a func on of ϑ.The strong magne c anisotropy favors an in-plane alignment of JEr.c, ESR spectra of the Ti atom placed 0.928 nm apart from the Er atom at different ϑ.At ϑ = 8°, a single ESR peak is visible (pink) while, at ϑ = 68° (purple), the two ESR peaks are separated due to the magne c interac ons between the Er and Ti (set-point: Vdc = 50 mV, Idc = 20 pA, Vrf = 12 mV, B = 0.3 T).The spectrum at ϑ = 8° (pink) was normalized at its maximum intensity while the spectrum at ϑ = 68° (purple) was normalized to the sum of the intensi es of its two peaks.The frequency detuning is defined with respect to 9.1 GHz (8.1 GHz) for the spectrum at ϑ = 8° (ϑ = 68°).d, ESR peak separa on, Δf, as a func on of ϑ.The experimental points (black dots) were acquired at different set-points (Vdc

Fig. 2 |
Fig. 2 | Measurement of Er ESR transi ons through a strongly coupled Ti atom.a, Constant-current STM image of the engineered Er-Ti dimer with the atomic separa on of 0.72 nm.The intersec on of grids represents the oxygen sites of MgO.The Er atom (circled in yellow) is adsorbed on the oxygen site of MgO, while the Ti atom (circled in purple) is adsorbed on the bridge site (setpoint: Vdc = 100 mV, Idc = 20 pA).b, ESR spectra of the dimer given in a.When the STM p is located on top of Er, no peaks are observed (yellow) (set-point: Vdc = 50 mV, Idc = 20 pA, Vrf = 20 mV, B = 0.28 T, ϑ = 97°).When the STM p is located on top of Ti, 5 ESR peaks are detected ( , ,  , and  ) with ϑ = 52° (pink), while 4 ESR peaks are detected ( , , and  , ) with ϑ = 97° (purple) (set-point: Vdc = 70, 60 mV, Idc = 30, 40 pA, Vrf = 20, 15 mV, B = 0.3 T).The spectra measured on Ti at ϑ = 52° and at ϑ = 97° were normalized at their respec ve maxima while the spectrum measured on top of Er was rescaled by the same amount used for the spectrum measured on Ti at ϑ = 97°.The spectra measured on Ti at ϑ = 52° and on Er are offset for clarity.c, ESR resonance frequencies as a func on of ϑ at B = 0.32 T. The ESR frequencies obtained from each measurement are given as black dots alongside the transi on energies predicted from the model Hamiltonian for  (blue line),  (light blue line),  (red line),  (orange line),  (green line) and flip-flop transi on (dashed gray line).The experimental points were obtained at different set-points (Vdc = 60─70 mV, Idc = 12─40 pA, Vrf = 15─25 mV, B = 0.28─0.8T); the resonance frequencies were rescaled by 0.32 T/B.d,e, Four-level schemes corresponding to the energies of the 4 spin states of the Er-Ti dimer and the corresponding transi ons depicted as colored arrows at B = 0.32 T with different ϑ (90° and 0°, respec vely).At ϑ = 90° (d) the spin states aregiven by the Zeeman products states, while at ϑ = 0° (e), a linear combina on of the Zeeman product states is needed to describe the levels.

Fig. 3 |
Fig. 3 | Detec on and driving mechanisms of Er ESR transi ons.a, ESR spectra showing  , for two different STM ps: nega ve peaks related to nega ve spin-pumping (yellow line) and posi ve peaks related to posi ve spin-pumping (orange line) (set-point: Idc = 12, 20 pA, Vdc = 70 mV, Vrf = 25 mV, B = 0.28, 0.32 T, ϑ = 67°).b, ESR peak intensi es as a func on of Vrf.The measured values for  and  are given by black dots while the intensi es predicted from the rate equa on model for  , and  , are given as blue, light blue, red solid lines and an orange dashed line, respec vely (set-point: Idc = 40 pA, Vdc = 70 mV, B = 0.28 T, ϑ = 97°).c, Four-level scheme explaining the rate equa on model while driving  (red arrow).The Ti's spin relaxa on rates  and  are depicted as purple arrows while the Er's spin relaxa on rates  and  are given as dashed yellow arrows.The nega ve spin pumping effect is represented as blue double arrows.d, Normalized ESR peak intensi es (ΔI/Idc) for  (blue circles) and for  (orange circles) at different p heights.Here, the p height is controlled by the set-point current Idc, (set-point: Vdc = 70 mV, Vrf = 10 mV, B = 0.28 T, ϑ = 97°).The blue and the orange lines serve as guides for the eye.The insets show two different p-Ti distances: larger for low Idc and smaller for higher Idc.

Fig. 4 |
Fig. 4 | Determina on of Er spin relaxa on me.a,b, Double resonance spectra in the frequency range covering Ti ESR transi ons  , (a) without and (b) with simultaneous driving of Er at the ESR frequency of  .The peak intensi es of  , are related to the rela ve popula on of the Er spin states (insets).The spectra were normalized to the sum of their peak intensity.c, ESR intensity ra os between ∆ and ∆ as a func on of the driving strength Vrf2 at different Er ESR transi on states (red, orange, and grey circles for  ,  , and off-resonance, respec vely).The solid curves show the correspondent simula on results by the rate equa on model for  (red line),  (orange and at an off-resonance frequency (grey line).Set-point: Idc = 15 pA, Vdc = 70 mV, Vrf = 30 mV, Vrf2 = 1, 30 mV, B = 0.28 T, ϑ = 97°.d, Schema cs of the inversion recovery measurement in a pump-probe pulse scheme to determine the Er spin relaxa on me  .Each sequence is composed of a pump pulse at the resonance frequency of  (red box) and a probe pulse at the resonance frequency of  (blue box).The probe pulse follows the pump pulse a er a delay me Δt.The popula on of the Er states a er the pump pulse relaxes back to the thermal state following its T1.e, The experimental data for the inversion recovery measurement (blue circles) show the intensity of the ESR signal at the probe pulse f1 as a func on of the delay me.The black line shows the fit using an exponen al func on with  of about 1 μs.Setpoint: Idc = 50 pA, Vdc = 70 mV, Vrf pump = 60 mV, Vrf probe = 100 mV, B = 0.28 T, ϑ = 97°.
, Fig. 2c, Fig. 3b,d and Fig. 4c.Table of contents 1-Experimental set-up and iden fica on of atomic species 2-Atom manipula on to construct Er-Ti dimers 3-Electron spin resonance on isolated Ti and Er 4-Tip posi on dependence of ESR signals on the Er-Ti dimer 5-Electron spin resonance spectra with out-of-plane magne c fields 6-Electron spin resonance spectra around the energy level crossing 7-Rate equa on model 8-Measurement of Rabi oscilla ons 9-Dimer with 167 Er 1-Experimental set-up and iden fica on of atomic species

Figure S1 |
Figure S1 | Characteriza on of the atomic species.a, Constant current STM image of the Ag(100) surface par ally covered by two-monolayers of MgO(100) (set point: Vdc = 100 mV, Idc 20 pA).The different atomic species can be dis nguished by their apparent heights and dI/dV features: (b) Ti on the oxygen site (TiO), (c) Ti on the bridge site (TiB), (d) Er on the oxygen site (ErO), (e) Er on the bridge site (ErB), Fe (k).(f) TiO and (g) TiB present a spin-flip excita on at around 0 mV when measured with a spin polarized p, while no excita on is present on ErO (h).

Figure S2 |
Figure S2 | Constant-current STM image of the Er-Ti dimer with 0.928 nm separa on (set point: Vdc = 100 mV, Idc = 20 pA).The intersec on of grids represents the oxygen site of MgO and the la ce vectors (a,b) are superimposed on the grid.

4 -
Figure S4 | Electron spin resonance at out-of-plane magne c fields.ESR spectra measured on the Er-Ti dimer with 0.72 nm separa on at different magne c fields close the out-of-plane direc on (ϑ = 7°): B = 0.65 T, 0.8 T, and 0.9 T (set point: Vdc = 70 mV, Idc = 20 pA, Vrf = 25 mV).The spectra at B = 0.8 T and 0.9 T were shi ed in ΔI by 300 fA and 500 fA, respec vely, for clarity.The inset on the top le corner shows a zoomed-in spectrum of the peaks f3 and f4.

Figure S6 |
Figure S6 | Electron spin resonance at different p loca ons on the Er-Ti dimer.a, STM image of the Er-Ti dimer with spacing of 0.72 nm (set point: Vdc = 100 mV, Idc = 20 pA) with a grid superimposed represen ng the MgO la ce.The different loca ons where the p was posi oned during the ESR measurement are depicted as black circles numbered from 1 to 5. b, ESR spectra at different p loca ons on the dimer (set point: Vdc = 70 mV, Idc = 12 pA, Vrf = 25 mV, B = 0.28 T, ϑ = 97°), when the p is approached laterally to the Er atom, the Er ESR peaks,  and  , shi to lower frequencies due to the an ferromagne c interac on between the Er atom and the magne c p. The intensity of the peaks decreases with moving the p away from the Ti atom and no peaks are detectable at a distance of 0.3 nm from its center (spectrum 2).The spectra 2, 3, 4 and 5 were shi ed ver cally -100 fA, -200 fA, -300 fA and -400 fA respec vely for clarity.

Figure S7 |
Figure S7 | Rate equa on model and spin pumping dependence of the signal.a, 4-level scheme rela ve to the rate equa on model repor ng the driving term (W), relaxa on rates (Γ) and a posi ve spin pump term ().b, Effect of the spin pump term for the  peak intensity (ΔI) as a func on of Vrf predicted by the rate equa on model.A nega ve  produces a nega ve ESR signal while a posi ve  produces a posi ve ESR signal.When the spin pumping is excluded from the model, a slightly posi ve ESR signal is predicted.

Figure S8 |
Figure S8 | Rabi measurements.a, Pulsed ESR measured with the STM p on the Ti atom of the Er-Ti dimer with 0.72 nm separa on.With the pulses applied at the resonance frequency of  , Rabi oscilla ons for the Ti spin are clearly observed (set point: Vdc = 20 mV, Idc = 10 pA, Vrf = 70 mV, B = 0.288 T, ϑ = 97°).black line is a fit using an exponen ally decaying sine func on.b, Pulsed ESR measured with the STM p on the Ti atom of the same dimer but with the pulses at the resonance frequency of  (set point: Vdc = 70 mV, Idc = 50 pA, Vrf = 90 mV, B = 0.288 T, ϑ = 97°).The black line is an exponen al fit as a guide for the eye.

Figure S9 |
Figure S9 | Electron spin resonance on dimer containing 167 Er.ESR spectra acquired with the same STM p on top of Ti in two different dimers: in the standard Ti-Er dimer (pink line, shi ed in ΔI by -1000 fA for readability) 5 peaks are detectable ( ,  ,  ,  and  ) while in the dimer containing 167 Er with nuclear spin 7ħ/2 (purple line), only  and  (related to Ti transi ons) are detectable (set point: Vdc = 60 mV, Idc = 20 pA, Vrf = 15 mV, B 0.3 T, ϑ = 52°).