Introduction

Recent advances in quantum control of surface spin systems have shown that this platform can be used to design quantum-coherent systems by tailoring the interaction of individual spins using the scanning tunneling microscope (STM) and atom manipulation1,2. In such a system, quantum coherent control of single and multiple spins has been achieved by electron spin resonance (ESR), which is facilitated by resonant electric fields in the STM3,4,5,6,7,8. When combining the atomic manipulation aspect and quantum coherent control, one can envision that this platform can be used to implement a reconfigurable quantum simulator in hardware using only a few atoms and an ESR-STM. By utilizing up to three titanium (Ti) atomic spins, some of us have demonstrated fundamental quantum gate operations such as controlled-NOT (CNOT) and controlled-controlled-NOT (CCNOT) gates on two layers of magnesium oxide (MgO)9. The next logical step is to certify entanglement in this atomic qubit platform, which is a strong prerequisite for studying quantum-coherent phenomena beyond individual quantum gate operations10,11. This, however, is not straightforward in the ESR-STM since it only allows for time-averaged single spin read-out with long measurement times (ms or kHz)12, compared to the typical time-scale for coherence time (T2) of only several hundred nanoseconds4,13. Previous works14 have suggested to use the magnetic susceptibility as entanglement witness; however, no experimental realization of this idea has yet been shown. Alternatively, one could exploit the fact that states that are not eigenstates of the system undergo a time evolution that can be probed by the time-averaging measurement of the STM as previously shown for the free time-evolution of spins initialized by bias voltage pulses in a system tuned to singlet-triplet eigenstates15. In a similar manner one can use radio-frequency (RF) pulses in an ESR-STM to create entangled states that are no longer eigenstates in the Zeeman basis of the constituent spins, and therefore will undergo a time evolution that is distinctively different from the evolution of non-entangled states. This approach, also called phase reversal tomography16, has been previously applied to phosphorous donor semiconductor qubits17. Here, we present how to adapt and optimize this method for ESR-STM, which relies on the fact that ESR-STM has highly sensitive population read-out6. By using open quantum systems simulations and parameters compatible with typical experiments, we demonstrate that surface spins can be entangled with high fidelity at sufficiently low temperatures.

Results

Creating and measuring entanglement

It has been established that ESR-STM provides a universal gate set based on single-spin (or qubit) phase control18 and controlled-NOT gates9. In the following, we will discuss how to create entanglement in a surface spin system and subsequently measure it. We start from two weakly interacting spins, which can be realized in the experiment by using two Ti atoms2,6. We require that the interaction between these spins is sufficiently weak so that their combined eigenstates can be written in good approximation as Zeeman product states, e.g. \({\left\vert\! \uparrow \right\rangle }_{A}\otimes {\left\vert \uparrow \right\rangle }_{B}=\left\vert\! \uparrow \uparrow \right\rangle\), where () denotes the ground (excited) state of each spin, the subscripts A, B label the two spins, and denotes the tensor product. As shown in Fig. 1a, two spins \(\left\vert\! \uparrow \uparrow \right\rangle\) can be entangled by a Hadamard gate H followed by a negative controlled-NOT gate (CNOT=\(\left\vert\! \uparrow \right\rangle \left\langle \uparrow \right\vert \otimes {\mathbb{1}}+\left\vert\! \downarrow \right\rangle \left\langle \downarrow \right\vert \otimes {\sigma }_{x}\)), resulting in an entangled state \(\left\vert\! \uparrow \downarrow \right\rangle +\left\vert \downarrow\! \uparrow \right\rangle\). In order to detect this entanglement, we can now exploit the fact that the entangled state is not an eigenstate of the Zeeman product basis and thus undergoes a free evolution15. During this evolution the state picks up a phase at a rate that is proportional to the energy splitting between \(\left\vert\! \uparrow \downarrow \right\rangle\) and \(\left\vert\! \downarrow \uparrow \right\rangle\) (Fig. 1b). The accumulated phase is distinct from the free evolution of any other non-entangled state and thus allows to uniquely witness the state as entangled. In particular, states that are maximally correlated but not entangled have no accumulated phase. We can measure the phase through a Bell state disentanglement measurement, realized by a CNOT followed by a Hadamard, which projects the phase onto one of the two spins followed by read-out of that spin. To be more precise the \(\left\vert\! \uparrow \downarrow \right\rangle +\left\vert\! \downarrow \uparrow \right\rangle\) is projected upon \(\left\vert\! \uparrow \downarrow \right\rangle\) whereas \(\left\vert\! \uparrow \downarrow \right\rangle -\left\vert\! \downarrow \uparrow \right\rangle\), which has a phase of π, is projected upon \(\left\vert\! \uparrow \uparrow \right\rangle\). The full protocol is illustrated in Fig. 1a. By repeating the scheme with increasing delay times between the entanglement and disentanglement sequences we can probe the full phase accumulation during free evolution. For the maximally entangled state it shows up as a slow (relative to the Larmor frequencies of the individual spins) variation of 〈Sz〉 as shown in Fig. 1c obtained from an analytical solution of the 4 × 4 density matrix shown in the inset. This variation can be read-out through the sensor-spin, where 〈Sz ΔIESR, i.e. the change in the tunneling current at spin resonance in the ESR-STM experiment6. In contrast, the maximally correlated state will result in a flat signal (Fig. 1d). To directly and unambiguously evidence entanglement, one has to ensure that the measurement shows an oscillation of spin A whereas spin B stays constant. In a practical implementation, probing free evolution might be slightly disadvantageous when the evolution time is either very short and approaches the typical rise and fall times of the signal generator, or very long and rivals the coherence times T2. Fortunately, the effect of free evolution can also be captured by adjusting the phase ϕ on the second CNOT gate \(X\left(\phi \right)\) such that ϕ = τ/ΔE. In the following, we will use such as phase-sweep instead of a delay-time sweep.

Fig. 1: Sequence of quantum logic gates to demonstrate entanglement in ESR-STM.
figure 1

a shows the pulse scheme using a quantum gate notation. From left to right this scheme applies a Hadamard gate to spin A, a negative CNOT gate, a pulse delay (or phase-sweep) gate, and a disentangling gate scheme. Finally, both states can be measured to determine their respective populations. b Bloch sphere shows the time-evolution of the entangled state on the equator. c Expected measurement signal for spin A and spin B when entangled and, in contrast, (d) the same measurement for two spins that are not entangled as emphasized by the density matrix in the inset.

Implementation

We will now discuss some details of the implementation. All simulations were carried out using the QuTiP package in the Lindblad formalism using collapse operators parameterized by T1 and Tϕ for energy relaxation and pure dephasing of each spin, respectively (see Methods)19. The total system consists of three spin 1/2 (labeled A, B, and R in Fig. 2a), which are exchanged coupled to one another sufficiently weakly so that the state diagram can be written to a good approximations as Zeeman product states (details of the system can be found in the methods section). We emphasize that only spins A and B will be the target of this entanglement scheme while spin R acts as sensor for the read-out. The Fe atoms are added in the experiment to provide the local field gradients for driving ESR of the remote spins (A and B)6,9.

Fig. 2: Two-spin entanglement scheme using sensor spin read-out.
figure 2

a Two relatively long-lived spins (A, B) are entangled while a third, short-lived sensor spin (R) is used for the read-out. Each pair of titanium and iron (Fe) atom serves as a qubit in the ESR-STM experiment. b Energy level diagram showing CNOT (red), Hadamard (blue) spin control and read-out (purple). c Actual pulse scheme as implemented in the simulations as well as expectation values along x, y, z for each spin involved in case of ϕ = π. The top panel shows the implemented pulse scheme where X and Y represent the rotation axes and the subscript indicates the rotation angle. The next two panels show the time-evolution of spins A and B under driving, followed by the concurrence \(\mathcal{C}\) which serves as direct measure of entanglement in the simulation. The last panel shows the time evolution of the sensor spin when reading out spin A as well as the corresponding time-averaged entanglement witness \({{\mathcal{W}}}_{R}({t}_{{\rm{meas}}})\). The entanglement witness reaches the steady state within the first ≈ 40 ns of the measurement time. Idealized parameters were used for clarity: T = 10 mK, Ω = 0.04 GHz, \({T}_{1}^{R}\) = 20 ns, no relaxation for A and B, and Larmor frequencies and exchange couplings are in GHz as indicated in (a).

To achieve the desired gate sequence for entanglement, we first combine two rotations (labeled as \({X}_{\frac{\pi }{2}},{Y}_{\pi }\), where X and Y denote the rotation axes and the subscript specifies the rotation angle) to perform a Hadamard gate and then a single-frequency pulse Xπ to perform a CNOT (Fig. 2b). Note that in general in this system a single driving frequency always performs a conditional operation while an unconditional NOT gate requires multi-frequency driving9. We found that at low enough temperatures single-frequency driving can be used for all gates due to negligible population in the excited states (Fig. 2b). This no longer holds true at elevated temperatures, where excited states can have non-negligible populations. In such a case, the Hadamard gate results in an admixture of entangled states reflecting the excited state population. To avoid this, we also use single frequency driving for the Hadamard gate, which ensures that only the targeted fraction of population will be entangled, at the loss of overall signal amplitude. We have confirmed that this maximizes the read-out of the sensor spin in our scheme and does not influence the outcome of the entanglement.

We drive all spins on resonance using a control field of the form \(\Omega \cos ({\omega }_{RF}t+\phi )\hat{{\sigma }_{x}}\), with Ω the Rabi rate, ωRF the angular radio-frequency resonant with a desired transition, ϕ an adjustable phase and \({\hat{\sigma }}_{x}\) the Pauli matrix. It was previously shown that this approach leads to efficient ESR in excellent agreement with the experiment6. For disentanglement we use the same gate sequence but in opposite order while matching the initial phase of each subsequent pulse to the phase of the previous pulse. The upper 3 panels of Fig. 2c show the expectation values for the spin operator 〈S〉 under these driving fields. We note that the appearance of filled areas is due to crosstalk of the driving frequencies of the pulses and the very fast Larmor precession (10–20 GHz) of each individual spin (see inset), due to the choice that we implemented the simulation in a lab frame of reference. ϕ of the second CNOT was chosen to be π, so that it mimics half a free evolution in the entangled state resulting in a spin flip of A at the end of the scheme whereas spin B remains unchanged. At the point where the spin should be entangled the expectation value of 〈Sz〉 for A and B are 0, indicating that the spins lie at the equator of their Bloch spheres. To further confirm entanglement we also plot the concurrence \({\mathcal{C}}\), which is bounded between 0 for non-entangled and 1 for maximally entangled states20. For a bipartite qubit density matrix ρAB, \({\mathcal{C}}\) is straightforward to calculate and at the point of entanglement the concurrence approaches 1 for the chosen parameter set.

Read-out of the final target spin states is achieved by a long RF pulse on R conditioned on the spin state to be read out. In this part of the sequence quantum properties like the phase of the pulse play a lesser role, as the coherence of spin R is known to be limited by the conduction electrons6. Figure 2b shows the transition that is driven for read-out of spin A. In the ESR-STM experiment a long DC voltage pulse could be used to measure the resulting oscillation as a change in the tunneling current ΔIESR. We set a fast decay time (T1 = 20 ns) for R mimicking this DC pulse and make sure the measurement pulse is relatively long (tmeas = 100 ns) such that R quickly reaches the steady state and the signal becomes only dependent on the spin which is read out. Note that we consider this relaxation only during the read-out since for the other parts of the scheme the DC pulse would not be present. The bottom panel of Fig. 2c shows the evolution of the sensor spin during read-out of spin A. The oscillation of A as a function of ϕ serves as a witness of entanglement and in Fig. 2c ϕ = π so that this oscillation is at its maximum. We refer to the maximum variation of the sensor spin as the measurement contrast \({{\mathcal{W}}}_{R}\). Due to the nature of the steady state it is at most half the amplitude of 〈Sz〉 of A. We see that in the present case the integrated signal of 〈Sz〉 of R approaches 0.5 within the measurement time. This shows that when the concurrence is 1 the read-out scheme gives the correct output for \({{\mathcal{W}}}_{R}\). A detailed discussion of the direct relation between \({{\mathcal{W}}}_{R}\) and \({\mathcal{C}}\) can be found in supplementary information I.

The results in Fig. 3 demonstrate the concept in two ways: Fig. 3a shows the entire entanglement protocol while Fig. 3b contrasts the results for non-entangled spins. We will first consider results without any relaxation of spins A and B and at a very low temperature of 10 mK. Larmor frequencies, exchange couplings, and Rabi rates must be chosen such that we stay in the weakly coupled regime while limiting crosstalk, i.e. unwanted driving of other transitions depending on the realistic resonance line widths in the experiment. In addition, we want the Larmor frequencies to be as high as possible to ensure most of the population is in the ground state. Here, we limited the frequency range to 10 − 20 GHz which is routinely achieved for single Ti spins on MgO surfaces (S = 1/2) in ESR-STM setups4,21,22. The system parameters are the same as in Fig. 2a. In Fig. 3c–f we show two resulting quantities: first, the variation of each target spin as directly obtained from the density matrix, which is evidence of the entanglement but is not accessible with the ESR-STM. Second, we show the expected read-out signal \({{\mathcal{W}}}_{R}\), which is a direct observable of the experiment since for the sensor spin 〈Sz ΔIESR. Contrasting both shows that while \({{\mathcal{W}}}_{R}\) is reduced, clearly the signal on the sensor spin directly reflects the spin dynamics in the measurement scheme. We note that in this scheme the phase of the second Hadamard is swept by the equal amount of the free time-evolution, such that ϕ = ωτ, where ω is the angular frequency associated with the entangled state. While the pulse sequence in Fig. 3a can be directly implemented, a real ESR-STM measurement also requires an empty cycle (B-cycle), which can be implemented as shown in Fig. 3b. In this cycle, the background current of the experiment can be measured by simply not entangling the states, which is achieved by removing the Hadamard gate during the entanglement step. We note that the choice of the B-cycle gate sequence is not unique and several different B-cycles are used in ESR-STM experiments (see also supplementary information VI). Finally, in Fig. 3e we show that the method is not limited to the (\(\left\vert\! \downarrow \uparrow \right\rangle ,\left\vert\! \uparrow \downarrow \right\rangle\)) subspace. Here, we initialize the system in \(\left\vert\! \uparrow \downarrow \right\rangle\) such that the H and CNOT gate bring the overall target state to \(\left\vert\! \uparrow \uparrow \right\rangle +\left\vert\! \downarrow \downarrow \right\rangle\). Note that here we drive \(\left\vert\! \uparrow \downarrow \right\rangle\) to \(\left\vert\! \downarrow \downarrow \right\rangle\) for H. The major difference in Fig. 3e when compared to Fig. 3c is that now the oscillation appears in the read-out of \(\left\vert {\uparrow }_{A}{\downarrow }_{B}\right\rangle\) instead of \(\left\vert {\downarrow }_{A}{\uparrow }_{B}\right\rangle\). This in turn allows to identify all the different Bell states in this system.

Fig. 3: Simulations of two-qubit entanglement in ESR-STM showing expected measurement outcomes, where we compare the expectation values 〈Sz〉 of each spin (inaccessible in the experiment) as well as the indirect read-out \({{\mathcal{W}}}_{R}\) of these values through the sensor spin.
figure 3

From top to bottom (a, c, e) we compare the entangled subspace for different initial states (\(\left\vert\! \uparrow \uparrow \right\rangle ,\left\vert\! \uparrow \downarrow \right\rangle\)). The (b, d, f) on the right side shows simulations for the same system but for not entangled states (achieved by removing the Hadamard gate), which could serve as empty cycle for the lock-in detection in the ESR-STM experiment. The system parameters are as shown in Fig. 2a, T = 10 mK, no relaxation for spins A, B, and T1 = 20 ns for the sensor spin during read-out.

Discussion

We now turn to the effect of finite lifetime T1 and elevated temperatures relevant to typical ESR-STM experiments. Previous works have shown that the coherence of Ti spins on two monolayers of MgO on Ag is lifetime limited such that T2 = 2T1, which allows us to discuss the first results without considering additional pure dephasing6,9,18. As can be seen in Fig. 4a the T2 time of the two entangled spins (taken here to be identical) has a rather modest influence in the experimentally relevant range of T2 > 300 ns. This is illustrated as well by Fig. 4b, which shows a slice at T = 0.1 K. Such low temperatures are typically achieved by using a dilution refrigerator equipped ESR-STM which can reach base-temperatures close to 20 mK23,24. Clearly, in all cases a T2 of around 300 ns allows for efficient entanglement detection. Temperature is a more critical parameter since the system is initialized purely by temperature. Temperatures that are high compared to the energy splitting of the eigenstates cause excited energy states to be populated. The effect of this is twofold: i) the system is not fully initialized to the ground state which reduces \({\mathcal{C}}\) and \({{\mathcal{W}}}_{R}\). ii) parts of the population that are in excited states additionally reduce \({\mathcal{C}}\), but do not participate in \({{\mathcal{W}}}_{R}\). Though this effect is in general small at elevated temperatures it is non-negligible. This becomes apparent in Fig. 4c where we show another slice of Fig. 4a but now for T2 = 300 ns. Above 300 mK the concurrence as well as \({{\mathcal{W}}}_{R}\) drastically drop and the concurrences reaches 0 at 700 mK. At the same time, \({{\mathcal{W}}}_{R}\) seems to have a non-zero value, indicating entanglement in a not-entangled system. For \({{\mathcal{W}}}_{R}\) to stay an appropriate witness of entanglement we need to subtract an offset with upper bound \(O=\sqrt{{p}_{\uparrow \uparrow \downarrow }{p}_{\downarrow \uparrow \uparrow }}\) where p are the eigenstate populations in thermal equilibrium (see supplementary information IV). This offset upper bound can be calculated straightforwardly from the initial populations and is defined such that \({{\mathcal{W}}}_{R}-O\) cannot be negative, resulting in a reliable witness of entanglement for all temperatures. This is why for all simulations, including Fig. 4a, b we report \({{\mathcal{W}}}_{R}-O\).

Fig. 4: Influence of finite lifetime and temperature on the entanglement.
figure 4

a shows \({{\mathcal{W}}}_{R}-O\) as function of temperature and decoherence time T2 (where T2 = 2 T1). (b) slice of (a) showing \({{\mathcal{W}}}_{R}-O\) together with the concurrence \({\mathcal{C}}\) for T = 0.1 K as achievable by dilution refrigerators. (c) slice of (a) showing \({{\mathcal{W}}}_{R}-O\) together with \({\mathcal{C}}\) for T2 = 300 ns. Clearly, temperature is a critical factor and the concurrence drops drastically above 0.3 K. We also plot \({{\mathcal{W}}}_{R}\) such that the difference of subtracting O becomes apparent. d Relation of \({\mathcal{C}}\) and \({{\mathcal{W}}}_{R}-O\) for three different T2. Solid lines are linear fits. The dashed line represents the analytical limit for T2 (e) relation of \({\mathcal{C}}\) and \({{\mathcal{W}}}_{R}-O\) for four different temperatures. Solid lines are logarithmic weighted power law fits. The dashed line represents the analytical limit for T → 0 The system parameters are as shown in Fig. 2a.

The same physical principles apply to all systems purely initialized by temperature. To avoid these limitations, alternative systems where the initialization is achieved by e.g. pumping and independent of system temperature should be used.

We now investigate the relation between \({\mathcal{C}}\) and \({{\mathcal{W}}}_{R}-O\) in Fig. 4d where we plot \({{\mathcal{W}}}_{R}-O\) against \({\mathcal{C}}\) for T sweeps at various T2. The underlying relation is linear as in the ideal zero temperature limit (see supplementary information I, III and V). The solid lines in Fig. 4d are the linear dependencies that best match the data (details are in Table 1). The dashed line is the analytic solution in the limit of infinite T2 (see supplementary information III). Finally, in Fig. 4e we plot \({{\mathcal{W}}}_{R}-O\) against \({\mathcal{C}}\) for T2 sweeps at various temperatures. We see here that the dependence can best be fitted with a logarithmic scaled power law, which reflects that for lower T2 there is more decay of the read-out than of the concurrence (see supplementary information II and V). Solid lines in Fig. 4e represent fits of the form \({{\mathcal{W}}}_{{\mathcal{R}}}-O=\frac{{{\mathcal{C}}}^{2}}{2a\ln {\mathcal{C}}}({{\mathcal{C}}}^{a}-1)\) (details are in Table 2). The dashed line is the analytic solution in the limit of zero T (see supplementary information II). Deviations from the fits can be attributed to missing terms in O (see supplementary information IV), additional remaining cross-talk in the driving pulse scheme and exchange mixing terms between spin eigenstates causing a more complicated relation between driving strengths and Rabi times.

Table 1 Fitting results of \({{\mathcal{W}}}_{{\mathcal{R}}}-O=a+b{\mathcal{C}}\), for the data shown in Fig. 4e
Table 2 Fitting results of \({{\mathcal{W}}}_{{\mathcal{R}}}-O=\frac{{{\mathcal{C}}}^{2}}{2a\ln {\mathcal{C}}}({{\mathcal{C}}}^{a}-1)\), for the data shown in Fig. 4e

Finally, we address the influence of noise on the entanglement detection. First, we consider the influence of quantum noise causing pure dephasing, such that the coherence time is no longer lifetime limited but reduced by additional processes leading to an effective coherence time of \(1/{T}_{2}^{* }=1/{T}_{2}+1/{T}_{\phi }\). Tϕ is the time constant of the pure dephasing process. In the following, T2 = 2T1 = 300 ns as typical for the experiments9. As shown in Fig. 5a and b, even fast dephasing processes with a dephasing time around \({T}_{2}^{* }=75\) ns still allow for sufficient concurrence and \({{\mathcal{W}}}_{R}-O\). It is not surprising that longer \({T}_{2}^{* }\) times are desirable as this is generally the case in quantum coherent systems, but it is encouraging that in the typical experimental range of \({T}_{2}^{* }\,\approx\, 300\) ns6,9,18 concurrence and \({{\mathcal{W}}}_{R}-O\) are still relatively high. Second, we consider the influence of classical noise. Experiments have indicated that despite the excellent mechanical stability of STM systems, slow variation of the tip height can occur during the measurement. In our setup, such a variation would change the local magnetic field of the sensor and thereby the resonance frequency f0 of the sensor6,25. We employ a simple noise model by imposing a Gaussian distribution (μ = f0, σ = 30 MHz) on the sensor and perform 100 calculations. We analyzed the resulting variation of \({{\mathcal{W}}}_{R}-O\) shown in Fig. 5c for three representative cases: The best case scenario (T = 0.01 K, T2 = for the target spins) gives the highest contrast and detection should be easy and reliable. In the intermediate case (T = 0.1 K, T2 = 300 ns) \({{\mathcal{W}}}_{R}-O\) is narrowly peaked around 0.28, which should still give a very reliable read-out. In the case of high temperature and short T2 (T = 0.4 K, T2 = 300 ns) \({{\mathcal{W}}}_{R}-O\) is small (≈ 0.045), it is, however, still very narrowly distributed which indicates that with appropriate care in the measurement this could still be measurable.

Fig. 5: Influence of noise on the entanglement.
figure 5

a shows the achievable concurrence and read-out contrast \({{\mathcal{W}}}_{R}-O\) as function of pure dephasing time Tϕ. b shows \(\mathcal{C}\) and \({{\mathcal{W}}}_{R}-O\) as function of T2 for a fixed T2 = 300 ns for the two spins and T = 0.1 K. c \({{\mathcal{W}}}_{R}-O\) as function of Gaussian magnetic field noise causing fluctuations of the resonance frequency of the sensor spin with σ = 30 MHz for three representative cases characterized by T and T2.

Summarizing, we have shown by open quantum systems simulations that two exchange coupled and relatively long-lived spins can be entangled and that the entanglement can be directly measured by ESR-STM using a third, weakly coupled sensor spin. Our simulations indicate that temperature is critical to achieve high degree of entanglement and \({{\mathcal{W}}}_{R}\), due to the fact that the populations are initialized into thermal equilibrium. Systems that can be initialized more independently from temperature as usually done in optical qubits in trapped ion systems for example, could overcome the strict temperature requirement. For physical spins on surface systems available today, such as the widely studied Ti on MgO/Ag(001), entanglement should be achievable and in principle measurable with T2 = 300 ns for the quantum spins and T1 ≈ 20 ns for the sensor spin at temperatures up to 400 mK. High degrees of entanglement \({\mathcal{C}}\,\approx\, 0.8\) and corresponding read-out can be reached when using a dilution refrigerator at T ≈ 100 mK.

Methods

All calculations were performed using a converged time step depending on the pulse scheme but such that it was always smaller than 8 ps. Following previous works6, we modeled each spin as a Zeeman energy term 2πfL,iSz,i with fL,i the i-th Larmor frequency, and pairwise isotropic exchange coupling terms \({J}_{i,j}{\overrightarrow{S}}_{i}{\overrightarrow{S}}_{j}\). ESR driving is achieved by applying the necessary single-frequency driving terms \({\Omega }_{k}\cos ({\omega }_{k}(t-{t}_{k}^{{\rm{start}}})+{\phi }_{k}){\sigma }_{x,i}({t}_{k}^{{\rm{start}}}\, <\, t\, <\, {t}_{k}^{{\rm{end}}})\), with ωk the frequency of the pulse matching the desired energy transition, \({t}_{k}^{{\rm{start}}}\) and \({t}_{k}^{{\rm{end}}}\) the start and end times of the pulse and ϕk is an adjustable phase. Ωk is the on-resonance Rabi rate, k = 1…N the index of driving frequency terms. The maximum number of driving terms in our simulation was N≤7. The total system Hamiltonian can be written as follows:

System Hamiltonian:

$$\begin{array}{l}{H}_{tot}=\mathop{\sum }\limits_{i=1}^{3}2\pi {f}_{L,i}{S}_{z,i}+\mathop{\sum }\limits_{i=1}^{3}\mathop{\sum }\limits_{j > i}^{3}{J}_{i,j}{\overrightarrow{S}}_{i}{\overrightarrow{S}}_{j}+\sum _{k}\mathop{\sum }\limits_{i=1}^{3}{\Omega }_{k}\\\qquad\,\times\,\cos \left({\omega }_{k}\left(t-{t}_{k}^{{\rm{start}}}\right)+{\phi }_{k}\right){\sigma }_{x,i}\left({t}_{k}^{{\rm{start}}}\, <\, t\, <\, {t}_{k}^{{\rm{end}}}\right)\end{array}$$
(1)

Lindblad equation: We solved a Lindblad equation for the reduced density matrix ρ of the following form

$$\frac{{\rm{d}}\rho }{{\rm{d}}t}=-\frac{i}{\hslash }[{H}_{tot},\rho ]+\sum _{l}\left({{\mathcal{L}}}_{l}\rho {{\mathcal{L}}}_{l}^{\dagger }-\frac{1}{2}{{\mathcal{L}}}_{l}^{\dagger }{{\mathcal{L}}}_{l}\rho -\frac{1}{2}\rho {{\mathcal{L}}}_{l}^{\dagger }{{\mathcal{L}}}_{l}\right)$$
(2)

The last term on the right-hand side are the collapse operators for our system. We used two sets of collapse operators \({{\mathcal{L}}}^{{\rm{Kondo}}}+{{\mathcal{L}}}^{\phi }\) to model spin energy relaxation as well as pure dephasing.

Collapse operators: The first set of collapse operators was defined acting on the coupled three-spin system in order to model Kondo spin relaxation, known to be the main source of decoherence for these systems4,26,27. We arrive at these terms by writing the known rate equation (see for example Eq. (4) of supplementary of ref. 28) in Lindblad form. The operator acting between energy level m and n of the system is

$${{\mathcal{L}}}_{m,n}^{{\rm{Kondo}}}=\sqrt{\sum _{l}\big\vert {J}_{l}\sum _{{s}_{i},{s}_{f}}\big\langle m,{s}_{i}\big\vert \overrightarrow{s}\otimes \overrightarrow{{S}_{l}}\big\vert n,{s}_{f}\big\rangle {\vert }^{2}\frac{{\epsilon }_{mn}}{{e}^{{\epsilon }_{mn}/{k}_{B}T}-1}}\vert m\rangle \langle n\vert.$$
(3)

Here the first sum is over the l different atomic spins and the second sum is over the initial (si) and final (sf) state of the itinerant electron spin interacting with these spins. \(\overrightarrow{S}\) and \(\overrightarrow{s}\) are the respective spin operators. ϵmn is the energy difference between m and n of the three-spin system. Finally, Jl is the strength of the interaction with each atomic spin. In low temperature approximation it relates to the isolated l-th spin relaxation time T1,l and energy of its Larmor frequency ϵl as (see Eq. 69 of ref. 27)

$${J}_{l}=\sqrt{\frac{1}{{\epsilon }_{l}{T}_{1,l}}}.$$
(4)

The second set of operators is for pure dephasing. Here, the standard operators are used relating the pure dephasing rate to the pure dephasing time Tϕ,l via the Pauli-z matrix for the l-th spin, i.e. \({\sigma }_{z,l}={\mathbb{1}}{\otimes }_{1}{\mathbb{1}}\ldots {\mathbb{1}}{\otimes }_{l}{\sigma }_{z}{\otimes }_{l+1}{\mathbb{1}}\ldots \,\)

$${{\mathcal{L}}}_{l}^{\phi }=\sqrt{\frac{1}{2{T}_{\phi ,l}}}{\sigma }_{z,l}.$$
(5)

Read-out: For read-out long pulses were sent resonant with transitions of SR. The expectation value of SR was averaged in 16000 time steps for a time of 100 ns. In order to have a converged expectation value a Rabi strength was used double the other strengths used in the scheme.

Fitting results: The relations between \({{\mathcal{W}}}_{R}-O\) and \({\mathcal{C}}\) in Fig. 4d were fit using \({{\mathcal{W}}}_{{\mathcal{R}}}-{\mathcal{O}}=a+b{\mathcal{C}}\) reflecting the up to first order linear dependence as derived in supplementary information III and IV. The fitting results are reported in Table 1. The relations between \({{\mathcal{W}}}_{R}\) and \({\mathcal{C}}\) in Fig. 4e were best fit using a logarithmic weighted power law function of the form \({{\mathcal{W}}}_{{\mathcal{R}}}-O=\frac{{{\mathcal{C}}}^{2}}{2a\ln {\mathcal{C}}}({{\mathcal{C}}}^{a}-1)\). The fitting results are reported in Table 2. Derivations are in supplementary information II and IV.

Concurrence: For concurrence calculation first the partial trace over SR was taken leaving the reduced matrix in the target spin basis. Then for each entanglement scheme the maximum was reported.