Recently, atomic spins have stood out as basic building blocks to construct nanoscale devices with spin functionalities1,2. Understanding and controlling their magnetic properties are of fundamental importance in quantum nanoscience and spintronics3,4. On surfaces, scanning tunneling microscopy (STM) is an outstanding tool to fabricate5 and study atomic-scale tailored spin systems6,7,8,9. STM equipped with electron spin resonance (ESR) further allows measurement of the quantum states of individual spins with a sub-microelectronvolt energy resolution10. Subsequent achievements highlighted the potential of this technique in studying magnetic adsorbates on insulating layers, such as transition-metal atoms11,12,13,14,15,16, magnetic molecules17, and alkali electron donors18. Moreover, unlike most STM-only works, in which individual spins were treated as classical bits, ESR-STM has enabled coherent control of individual electron-spin qubits19,20 in the tunnel junction, whose quantum state was coherently rotated about a single axis by using radio-frequency (RF) pulses of a fixed-phase. However, qubit rotations with a well-defined phase are necessary to generate arbitrary superposition states and gate operations21, which are essential steps toward realizing quantum logic gates with atomic or molecular spin qubits on surfaces.

In this work, we implement a two-axis quantum control scheme22 to ESR-STM, where RF signals with well-defined phases enable us to coherently rotate the qubit state about an arbitrary axis, determined by the phase shift between two consecutive RF pulses. We first demonstrate the detection of all three Cartesian components of a qubit’s quantum state by introducing a “projection” pulse with different phases. Second, we create arbitrary superposition states by sweeping the phase difference between two RF pulses with varying initializations. These results highlight the potential of this technique in quantum tomography and gate operations of atomic spin qubits on surfaces. Finally, we perform dynamical decoupling on a spin qubit and implement phase control to improve its robustness against errors.

Experiments were carried out using a commercial STM (USM1300, Unisoku) operating at 0.4 K. An external magnetic field of ~0.6 T was applied parallel to the sample surface. In this work, we focus on single hydrogenated Ti atoms (S = 1/2) (in the following simply referred to as Ti atoms) adsorbed on oxygen sites of a bilayer MgO film grown on Ag(100)23. ESR of Ti is driven by the combination between the applied RF electric field and the magnetic interaction between STM tip apex and surface spin11,24,25,26. Phase-controlled RF pulses with various durations τ were generated by gating a vector signal generator using an arbitrary waveform generator (AWG). These RF pulses were transferred into the STM through semi-rigid coaxial cables27,28 and applied to the tunnel junction, as shown in Fig. 1a. With AWG outputs of \(I={{\cos }}\varphi \,{\rm{and}}\,Q={{\sin }}\varphi\), the RF output is given by \({V}_{{\rm{RF}}}{{\cos }}(2{{\pi }}{ft}+\varphi )\), where the phase \(\varphi ={{{\tan }}}^{-1}\left(Q/I\right)\) can be tuned via the input signals to the IQ-mixer in the vector signal generator. When this \({V}_{{\rm{RF}}}{{\cos }}(2{{\pi }}{ft}+\varphi )\) is applied to a single spin qubit, its initial quantum state \(\left|{\rm{\psi }}\left(0\right)\right\rangle\) at t = 0 undergoes a time evolution

$$\left|{\rm{\psi }}\left(t\right)\right\rangle ={U}_{\varphi }\left(t\right)\left|{\rm{\psi }}\left(0\right)\right\rangle ,$$

where \({U}_{\varphi }\left(t\right)={{\exp }}\left[-{\rm{i}}\left(\varOmega t/2\right){{\bf{n}}}_{\varphi }\,\cdot\, {\boldsymbol{\sigma }}\right]\) is the time evolution operator, and Ω, σ, \({{\bf{n}}}_{\varphi }\) are the Rabi frequency, Pauli spin vector, and unit vector of axis for the rotation, respectively. In our experiment, the spin qubit is initialized to a thermal equilibrium state (population of 85% in |0〉 at 0.4 K with a magnetic field of 0.6 T) and further affected by the spin-polarized tunnel current29,30. In the following, we treat \(\left|{\rm{\psi }}\left(0\right)\right\rangle\) as a pure state |0〉 for simplicity, but our discussion holds for the mixed state as well. Figure 1b illustrates a general rotation of a qubit with a phase control on the Bloch sphere in the rotating frame. The dotted purple arrow indicates that \({V}_{{\rm{RF}}}{{\cos }}(2{{\pi }}{ft}+\varphi )\) with a duration τ generates a qubit rotation \({{\bf{R}}}_{\varphi }(\varOmega \tau )\), in which the qubit’s state is rotated by \(\theta =\varOmega \tau\) about the axis defined by the angle φ to the x-axis in the x-y plane. In prior works, single spins on surfaces have been coherently rotated between |0〉 and |1〉 by RF pulses with a fixed phase φ, corresponding to rotations about a single axis (by convention called the x-axis; φ = 0)19,20.

Fig. 1: Experimental setup and coherent control of a spin qubit.
figure 1

a Experimental setup. A vector RF generator is gated by an AWG, and the phase-controlled RF signal is fed into the STM. An external magnetic field ~0.6 T is applied along the sample in-plane direction. Single titanium (Ti) atoms (with an attached H atom) at oxygen sites of bilayer MgO (S = 1/2) are studied in this work, as shown in the STM image of a size 3 × 3 nm2 (tunneling conditions: VDC = 100 mV, IDC = 10 pA). b Schematic illustrating a single-qubit rotation \({{\bf{R}}}_{\varphi }(\theta )\) of \(\theta =\varOmega \tau\) about an axis of angle φ from the x-axis. On the Bloch sphere, the north and south poles represent the qubit’s \(\left|0\right\rangle\) (ground) and \(\left|1\right\rangle\) (excited) states, respectively. The angle φ is determined by the phase difference φ of two consecutive RF pulses in the following experiments. Ω and τ are the Rabi rate and duration of the RF pulse, respectively. c ESR spectrum of a Ti atom (VDC = 50 mV, IDC = 4 pA, VRF = 60 mV). Solid curve is a Lorentzian fit which yields a resonance frequency f0 = 15.25 GHz. d Rabi oscillations measured with increasing pulse duration τ at f0 (VDC = 50 mV, IDC = 4 pA, VRF = 90 mV).

Results and discussion

Single-axis qubit rotations

We begin by determining the resonance frequency of a Ti spin and characterize its Rabi oscillations. Here we performed coherent rotation of a spin qubit about the x-axis (I = 1, Q = 0; \(\varphi ={{{\tan }}}^{-1}(Q/I)=0\)) by applying RF pulses at 15.25 GHz, as determined from the resonance of the ESR spectrum shown in Fig. 1c. Resonant pulses with an increasing duration τ coherently rotated the qubit between its states |0〉 and |1〉, resulting in Rabi oscillations (Fig. 1d). During these measurements, the DC bias voltage VDC was always turned on at a constant value. We additionally measured the Rabi oscillations with different pulse schemes, which verified that our signal \(\Delta I\) is mainly contributed by DC detection (Supplementary Fig. 1), in contrast to previous works19. Under DC detection, \(\Delta I\) is proportional to the expectation value of the z-component 〈Z〉 of the state vector, which for an arbitrary qubit state, cos(θ⁄2)|0〉 + eiφsin(θ⁄2)|1〉, is

$$\Delta I\propto {\left|{{\cos }}(\theta /2)\right|}^{2}-{\left|{{\rm{e}}}^{{\rm{i}}\varphi }{{\sin }}(\theta /2)\right|}^{2}={{\cos }}\theta ,$$

in good agreement with the measured Rabi curve in Fig. 1d. In addition, the Rabi frequency \(\varOmega /2{\rm{\pi }}\) shows a linear dependence on the amplitude of the RF voltage at a constant tip conductance (Supplementary Fig. 2). It should be noted that signals read by magnetic tip correspond to the spin projection along the magnetization axis of the tip, which is not exactly along the quantization axis of Ti spin16 (details are provided in Methods).

Two-axis qubit rotations

Coherent rotations with a single RF pulse will always result in Rabi oscillations of the same phase under DC detection, a trivial result due to the arbitrariness of φ in a single wave, see Eq. (2). For the demonstration of phase-controlled measurements, two consecutive RF pulses with a well-defined phase difference are required22,31. In the following, we utilize a sequence composed of two consecutive pulses, where the first one rotates the qubit about the x-axis with a duration τ: \({{\bf{R}}}_{x}(\varOmega \tau )\), followed by a second one that rotates the qubit about the axis defined by the angle φ to the x-axis with a duration of \({\rm{\pi }}/2\varOmega\): \({{\bf{R}}}_{\varphi }({\rm{\pi }}/2)\). The angle φ is determined by the phase difference between the two consecutive RF pulses used here and this two-axis control leads to the time evolution of the state vector into a final state

$$\left|{{{\psi }}}_{{\rm{fin}}}\right\rangle ={U}_{\varphi }({{\pi }}/2\varOmega ){U}_{x}(\tau ){{|}}0{{\rangle }},$$

where \({U}_{x}\left(\tau \right)={{\exp }}\left[-{\rm{i}}\varOmega \tau {\sigma }_{x}/2\right]\) and \({U}_{\varphi }({{\pi }}/2\varOmega )={{\exp }}\left[-{\rm{i}}{{\pi }}{{\bf{n}}}_{\varphi }\,\cdot\, {\boldsymbol{\sigma }}/4\right]\) are the qubit rotations corresponding to the two RF pulses.

Using this two-axis control scheme, we first demonstrate the detection of the three Cartesian components of a Bloch vector, as shown in Fig. 2. The first pulse (red in the pulse schemes in Fig. 2a, c) rotates the qubit to the state |ψ(τ)〉 = Ux(τ)|0〉 = cos(Ωτ⁄2)|0〉-isin(Ωτ⁄2)|1〉, whose expectation values 〈X〉 and 〈Y〉 are 0 and \({\rm{\sin }}(\varOmega \tau )\), respectively, as depicted by the red arrows on the Bloch spheres. Without the second pulse, the measured signal ∆I shows Rabi oscillations (the upper curves in Fig. 2b, d) that correspond to a measurement of \(\left\langle Z\right\rangle\). When applying the second pulse along a parallel direction (φ = 0 or φ = π), it performed a qubit rotation \({U}_{x}(\pm {\rm{\pi }}/2\varOmega )\) to \(\left|{\rm{\psi }}\left(\tau \right)\right\rangle\), resulting in a final state |ψfin〉 =\(\left[{{\cos }}(\varOmega \tau /2)\mp {{\sin }}(\varOmega \tau /2)\right]\) |0〉\(+{\rm{i}}\left[\mp {{\cos }}\left(\varOmega \tau /2\right)-{{\sin }}(\varOmega \tau /2)\right]\)|1〉 (purple arrows). As a consequence, the measured signal \(\Delta I\) is proportional to \(\mp {{\sin }}\varOmega \tau\), corresponding to the \(\pm \left\langle Y\right\rangle\) component of \(\left|{\rm{\psi }}\left(\tau \right)\right\rangle\). This behavior can be clearly seen by the phase shift \(\Delta \alpha =\pm {\rm{\pi }}/2\) in the Rabi oscillations shown in Fig. 2b.

Fig. 2: Detecting the x- and y-components of a spin qubit.
figure 2

a Upper: Pulse sequence composed of a Rabi rotation \(\theta =\varOmega \tau\) about the x-axis (“initialization”; red), followed by a \({\rm{\pi }}/2\) pulse (“projection”; purple) with a phase \(\varphi =0\) (+X pulse) or \(\varphi ={\rm{\pi }}\) (−X pulse). Lower: Corresponding two-step rotations of a Bloch vector on the Bloch sphere. b Rabi measurements without (‘none’) and with the projection pulse (‘+X’ or ‘−X’) (VDC = 50 mV, IDC = 4 pA, VRF = 120 mV), with fits to an exponentially decaying sinusoidal function (red solid curves). \(\varDelta \alpha\) and black solid lines indicate the shifts of Rabi signals induced by different projection pulses. c Pulse sequence similar to a but with the projection pulse of a phase \(\varphi ={\rm{\pi }}/2\) (+Y pulse) or \(\varphi =3{\rm{\pi }}/2\) (−Y pulse), resulting in the Bloch vector in the x-y plane (purple arrows). d Rabi measurements without and with the projection pulse in c (VDC = 50 mV, IDC = 4 pA, VRF = 120 mV), with fits to an exponentially decaying sinusoidal function (red solid curve). Blue solid lines indicate the vertical offsets added to each spectrum. Duration of the \({\rm{\pi }}/2\) pulses is ~ 9 ns.

We then investigated the same behavior but by applying the second pulse along a perpendicular direction (\(\varphi ={\rm{\pi }}/2\) or \(\varphi =3{\rm{\pi }}/2\)). The second pulse in Fig. 2c corresponds to a qubit rotation \({U}_{y}(\pm {\rm{\pi }}/2\varOmega )\) applied to \(\left|{\rm{\psi }}\left(\tau \right)\right\rangle\), resulting in |ψfin〉 = [cos(Ωτ⁄2) ± isin(Ωτ⁄2)]|0〉 + [±cos(Ωτ⁄2) − isin(Ωτ⁄2)]|1〉 (purple arrows). Thus, the signal \(\Delta I\), which corresponds to the 〈X〉 component of \(\left|{\rm{\psi }}\left(\tau \right)\right\rangle\), should be 0. Again, this behavior is seen by the absence of oscillations in the Rabi signals shown in Fig. 2d (Supplementary Discussion 1). In these demonstrations, the second pulse in Fig. 2a (2c) leads to a \({\rm{\pi }}/2\) rotation \({U}_{x}\) (\({U}_{y}\)), which plays the role of projecting the y- (x-) component of a Bloch vector to the z-axis (measurement axis). This can be intuitively understood using rotations of a spin vector on the Bloch spheres. Since the first rotation generates a Bloch vector in the y-z plane, the subsequent \(\pm {\rm{\pi }}/2\) rotation about the y-axis always sends the vector into the x-y plane, leading to τ-independent \(\left\langle Z\right\rangle\) (hence, \(\Delta I=0\)). Therefore, all the three components of a Bloch vector are detectable in such phase-controlled ESR-STM measurements, which is an essential step towards single-spin quantum state tomography.

Next, we performed two-axis control with variable phase difference to demonstrate the preparation of arbitrary superposition states on the Bloch sphere, as shown in Fig. 3a. Here we applied a similar two-pulse sequence as in Fig. 2, with two control parameters: duration τ [0, π]/Ω of the first pulse and the phase φ [0, 2π] of the second pulse. To illustrate this sequence, we show the simulated trajectories of the qubit’s final state (with respect to φ) under the two-axis control for Ωτ = 0 or π, \(0.3{\rm{\pi }}\), \(0.5{\rm{\pi }}\) and \(0.7{\rm{\pi }}\). A series of spectra measured using the pulse scheme illustrated in Fig. 3a are shown in Fig. 3b. Each of them was measured with different durations of the first pulse as labeled. In this measurement, the first pulse generates a rotation \(\theta =\varOmega \tau\) in the y-z plane and the second pulse induces a φ-dependent value of \(\left\langle Z\right\rangle\) for the final quantum state. Spectra are fitted by \(\varDelta I(\varphi )=-{I}_{0}{\rm{\cos }}\varphi\) (solid curves), showing excellent agreement with our model (Supplementary Discussion 2) and previous works22,31,32. In addition, the height \(2{I}_{0}=\left|\varDelta I\left({\rm{\pi }}\right)-\varDelta I\left(0\right)\right|\) of each curve, as illustrated in Fig. 3b, varies with the duration τ of the first pulse. The maximum height is observed when \(\varOmega \tau =0.5{\rm{\pi }}\), in which \(\varDelta I\left({\rm{\pi }}\right)\) and \(\varDelta I\left(0\right)\) correspond to the signals of \(\left|0\right\rangle\) and \(\left|1\right\rangle\) states, respectively. From the simulated results in Fig. 3a, once \(\varOmega \tau\) is deviated from 0.5π, the quantum states of φ = π and φ = 0 get closer to the x-y plane, thus inducing smaller \(2{I}_{0}\). Moreover, the results for \(\varOmega \tau\) and \(({\rm{\pi }}-\varOmega \tau )\) are equivalent to each other for the \(\left\langle Z\right\rangle\) readout, which can for example be seen at \(\varOmega \tau =0.7{\rm{\pi }}\) and 0.3π (Fig. 3a, b).

Fig. 3: Two-axis control with varying initializations.
figure 3

a Pulse sequence for two-axis control of a spin qubit where the phase φ of the second pulse (purple) is swept between 0 and 2π. Four simulated trajectories of the qubit’s final state (with respect to φ) are illustrated on the Bloch sphere, corresponding to different specific choices of the rotation Ωτ of the first pulse (red). b ESR signals measured with the sequence in a for 7 different Ωτ (labeled at right side) (VDC = 50 mV, IDC = 4 pA, VRF = 120 mV). Solid curves are cosine functions \(\Delta I={-I}_{0}{\rm{\cos }}\varphi\). Both data and fits are vertically shifted for clarity. c \({I}_{0}\) as a function of \(\varOmega \tau\), extracted from the fits of 13 curves (including those in b, complete data set is shown in Supplementary Fig. 8). Error bars denote the 95% confidence intervals of the cosine fits. Solid curve is a sinusoidal fit. Duration of the \({\rm{\pi }}/2\) pulses is ~ 6 ns.

Amplitudes \({I}_{0}\) extracted from 13 curves (including those in Fig. 3b, complete data set is shown in Supplementary Fig. 8) are plotted against \(\varOmega \tau\) in Fig. 3c, which show a clear \({\rm{\sin }}\varOmega \tau\) dependence (red curve) as predicted from the simulations (Supplementary Discussion 2). Apparently, varying the two control parameters τ and φ can lead to any quantum state on the Bloch sphere32. These results demonstrate the ability to generate arbitrary single-qubit superposition states, enabling the use of universal single-qubit gates on atomic spin qubits on a surface.

Dynamical decoupling

One use of phase-controlled operations is in dynamical decoupling schemes that enhance the quantum coherence of a qubit. We implemented two-axis control in dynamical decoupling measurements with larger number N (N = 1 corresponds to spin-echo) of refocusing π pulses. The dynamical decoupling schemes, CP and CPMG, are distinguished by the axis of the refocusing π pulses (CP: \({{\rm{\pi }}}_{x}\); CPMG: \({{\rm{\pi }}}_{y}\), illustrated in Fig. 4a) relative to the initial coherence-generating \({\rm{\pi }}/2\) pulse along the x-axis. In a solid-state environment, both sequences have been reported to yield longer coherence time when increasing N. Moreover, CPMG becomes better than CP as N is increased because its y-axis refocusing is more robust against errors while CP suffers from accumulation of systematic rotation angle errors33,34. From the results in Fig. 4b, c, we indeed observe an improvement of the coherence time \({T}_{2}\) by the CP scheme with N up to 4, but CPMG shows no clear improvement over CP at N = 4 (~5 % in \({T}_{2}\)). We note that both CP-4 and CPMG-4 result in a coherence time \({T}_{2}\) ~ 280 ns that is close to the theoretical limit (\(2{T}_{1}\)) with the \({T}_{1}\) measured for Ti on the oxygen binding site of bilayer MgO23, suggesting that both sequences with N = 4 effectively eliminate decoherence from additional sources, such as magnetic noise from the tip. The fact that CP-4 and CPMG-4 yield such similar results demonstrates that the fidelity of our refocusing π pulses is high. The qubit properties are limited principally by \({T}_{1}\), arising from coupling to substrate excitations and DC tunneling electrons20,23 (see Supplementary Fig. 4).

Fig. 4: One- and two-axis dynamical decoupling.
figure 4

a Pulse sequences of CP (upper) and CPMG (lower) with four refocusing pulses. X and Y pulses are labeled in red and green, respectively. b Signals measured with the three CP (N = 1, 2, and 4) and one CPMG (N = 4) sequences. (VDC = 50 mV, IDC = 4 pA, VRF = 120 mV). Solid curves are exponential fits, where the red (green) color stands for CP (CPMG) sequence. c Coherence time \({T}_{2}\) extracted from the data in b. Note that measurements with larger N yield significantly longer \({T}_{2}\), whereas CP-4 and CPMG-4 result in similar coherence times of 277 ± 20 and 292 ± 23 ns, respectively. Error bars denote the 95% confidence intervals of the exponential fits. Duration of the \({\rm{\pi }}/2\) pulses is ~13 ns.

In conclusion, we have demonstrated two-axis coherent manipulation of a single electron-spin qubit on a surface. We show that an ESR-STM is in principle able to read all the three components of a spin Bloch vector, making an important step towards quantum state tomography of single spins on a surface. The demonstration of single-qubit rotations about an axis of well-defined phase angle creates the ability to perform arbitrary single-qubit gate operations on an atomic spin qubit. Together with the recent demonstration of multi-qubit control in ESR-STM35, this enables the implementation of quantum algorithms with spin qubits on surfaces.


Experimental setup

An atomically clean Ag(100) substrate was prepared by alternating Ar+ sputtering and annealing cycles. MgO films were grown on the Ag substrate at 700 K by evaporating Mg in an O2 atmosphere of 1.1 × 10−6 Torr. Fe and Ti atoms were deposited on a pre-cooled MgO sample.

Experiments were performed with a commercial STM (Unisoku, USM1300) operating at 0.4 K. A vector radio-frequency (RF) generator (Agilent E8267D) was added to the DC bias voltage VDC through a diplexer at room temperature and then applied to the STM tip. The RF generator was gated by an arbitrary waveform generator (AWG, Tektronix 5000). Two analog output channels of the AWG were connecting to the generator’s in-phase and quadrature (I and Q) ports in order to control the phase of the RF pulses. The tunnel current was sensed by a room-temperature electrometer (Femto DLPCA-200). During ESR measurements, RF signals were chopped at 95 Hz and sent to a lock-in amplifier (Stanford Research Systems SR860) and recorded by a DAQ-Box (National Instruments 6363). The bias voltage VDC refers to the sample voltage relative to the tip.

Measurement schemes and data processing

Each data point in the figures corresponds to a data acquisition time of 2 s (Figs. 24, Supplementary Figs. 3 and 8) or 3 s (Fig. 1d; Supplementary Figs. 1, 2 and 4), during which the pulse sequence and the number of pulses in a lock-in cycle were unchanged. The pulse sequence length ts (see Supplementary Figs. 1 and 3) was constant during one type of measurement and set to be sufficiently long (1.2–2.0 μs for Fig. 4, Supplementary Figs. 3 and 4; 0.8 μs for Fig. 2; 0.6 μs for Fig. 3 and Supplementary Fig. 8; 0.8–1.2 μs for all the other measurements) to allow spin relaxation before the next sequence. All pulsed ESR measurements included 3-4 averages, each of which took 4–8 min and started with an atom lock sequence. The pulse sequences used in A cycles are illustrated in the figures27. All measurements were carried out by using Scheme 1 (unless stated otherwise), in which feedback loop was set to a low gain and RF pulses were absent in lock-in B cycles.

Linear backgrounds appeared in the raw data (see Supplementary Fig. 1b) when the RF pulse duration was swept (Figs. 1 and 2, Supplementary Fig. 1 and 2), because of the change of the RF rectified current IRF. We subtracted these linear backgrounds before fitting data to exponentially decaying sinusoidal functions. On the other hand, when measuring with a constant RF pulse duration (Figs. 3 and 4; Supplementary Figs. 3, 4 and 8), the raw data only contained a vertical offset induced by a constant IRF.

STM tips used for data acquisition

In this work, magnetic tips used for measurements were all made by picking up 4–6 Fe atoms from the MgO surface until the tips yielded good ESR signals on Ti atoms. Data shown in this article were taken with four different tips. Tip-1 was used to collect the data in Fig. 1, Supplementary Figs. 1, 2 and 4; tip-2 was used to collect the data in Fig. 2; tip-3 was used to collect the data in Fig. 3 and Supplementary Fig. 8; tip-4 was used to collect the data in Fig. 4 and Supplementary Fig. 3. ESR spectra measured by all the four tips are shown in Supplementary Fig. 7.

The actual signal read in the experiment is the spin projection along the magnetization axis of the STM tip. Besides, x- and y-components of the state vector can also contribute through homodyne detection16, which is minor in this work (Scheme 4 in Supplementary Fig. 1). The residual signal in the +Y measurement in Fig. 2d is potentially induced by the slight tip polarization in the x-direction, which introduces x-component signal through homodyne detection. Our simulation (see Supplementary Figs. 5 and 6) suggests that tip-2 yields 10% x-component signal and tip-3 yields almost 100% z-component signal.