A Quantum Klystron -- Controlling Quantum Systems with Modulated Electron Beams

Coherent control of quantum transitions -- indispensable in quantum technology -- generally relies on the interaction of quantum systems with electromagnetic radiation. Here, we theoretically demonstrate that the non-radiative electromagnetic near-field of a temporally modulated free-space electron beam can be utilized for coherent control of quantum systems. We show that such manipulation can be performed with only classical control over the electron beam itself, and is readily realizable with current technology. This approach may provide a pathway towards spectrally selective quantum control with nano-scale spatial resolution, harnessing the small de Broglie wavelength of electrons.


INTRODUCTION
Coherent manipulation of quantum systems with precisely controlled electromagnetic (EM) fields, such as laser or microwave pulses, is a ubiquitous tool of quantum science from the search for new physics [1, 2] to quantum information processing [3,4]. Here, we demonstrate that the EM near-field of a temporally modulated electron beam provides an alternative route to coherent manipulation of quantum systems. Electromagnetically addressable transitions can be driven by the oscillating EM field surrounding the modulated beam. Due to the small de Broglie wavelength of the electron beam [5], this mechanism of interaction potentially allows for the addressing of individual quantum systems with nano-scale resolution, similarly to the incoherent electron-based spectroscopy methods relying on the same electromagnetic interaction [6-10]. The interaction of a temporally modulated electron beam with a quantum system is reminiscent of an RF amplifier type known as the klystron [11], wherein the electron beam's velocity is modulated by a periodic seed field, resulting in a current modulation downstream of the interaction region. The kinetic energy of the modulated electron beam is then converted into electromagnetic excitation of an RF cavity (Fig. 1a). Here, we propose a quantum counterpart of the klystron, where the kinetic energy of a modulated electron beam is converted into the coherent excitation of a quantum system or an ensemble of such systems, as shown in Fig. 1b. We restrict our considerations to magnetic dipole transitions. Electric dipole transitions and higher multipole transitions can be treated in a similar manner. While it has been suggested [12-15] that quantum systems can coherently interact with a stream of electrons with a temporally shaped wave function [16][17][18][19], we the-FIG. 1. a) Schematic view of the conventional klystron: an electron beam is velocity modulated by the electric field of a microwave (MW) cavity, the "buncher cavity", at angular frequency ω0. Through the drift space, the velocity modulation causes a current modulation, which induces amplified microwaves at the "catcher cavity". The amplified MW radiation is used, for example, to drive atomic transitions coherently and with high fidelity. b) Schematic view of the quantum klystron: the electromagnetic near field of the currentmodulated electron beam at the position of the catcher cavity is used directly to drive transitions of quantum systems without the detour of generating electromagnetic radiation. w is the electron beam waist, λ0 is the modulation wavelength, which is much larger than the single electron wave function width ∆z, and d is the distance from the quantum system to the beam center.
oretically demonstrate that electron-mediated manipulation of quantum systems can be achieved when the longitudinal extent of the individual electron wave packets is much shorter than the wavelength of modulation. Such 'classical' modulation of the electron beam current den- The numerical result agrees with the analytical result by one percent or less for distances larger than 10∆r ⊥ . Right axis: overlap of the initial and scattered electron states as a function of the distance between the electron and the quantum system (red dots). For distances ≥ 6∆r ⊥ , the overlap can be considered to be one for the purpose of this article. The drop in overlap between these states corresponds to the regime where the wavefunction of the passing electron significantly overlaps with that of the quantum system at the point of closest approach, where we can no longer apply the picture of driving with the near-field of an electron beam. The plots were obtained with ∆r ⊥ = 5 nm, ∆z0 = 100 nm, ω0/2π = 2.87 GHz and an initial kinetic energy of the electron of 2 keV (details about the model can be found in Appendix A).
sity is readily achievable in the microwave (MW) frequency range, as it is an integral part of widely used electronic technologies from microwave heaters to radars.

BACK-ACTION AND THE SEMI-CLASSICAL REGIME
A necessary condition for coherent driving of a quantum system is that no information about its state is transferred to the environment. In particular, electron scattering due to quantum back-action causes entanglement between the electron and the quantum system, which disrupts coherent driving. Given the overlap Λ between an incoming electron state and its scattered state, the probability to find the electron scattered into a state that is orthogonal to the incoming state is (1−|Λ| 2 )P e↔g , where P e↔g (excited state e and ground state g, see Fig. 2) is the probability of the transition of the quantum system induced by a single electron. The transition rate for coherent transitions, the Rabi frequency, is ∼ |Λ| P e↔g I ω0 /e, where I ω0 is the resonant Fourier component of the modulated beam current (see Eq. A74 in the Appendix), where e is the elementary charge. Thus even a small overlap is sufficient to preserve coherent driving, in principle, as long as |Λ| P e↔g , while an overlap approaching unity is desirable to maximize the driving rate.
We calculate the overlap integral using a QED model of the interaction of a single electron with a two-level quantum system via its magnetic transition dipole moment (relevant to our two examples), see Appendix A. We consider a situation where the quantum system's dimensions are much smaller than both its distance to the electrons in the beam and the modulation wave length λ 0 . We describe the electron field as a Dirac field, and consider an initial spin-unpolarized Gaussian matter-wave packet of transverse width ∆r ⊥ with a propagation axis offset by |r 0,⊥ | (impact parameter). We numerically evaluate the spin-averaged overlap between an incoming electron state and its scattered state given that a transition occurred. The results of the simulation are shown in Fig. 2. For instance, for distances |r 0,⊥ | 6∆r ⊥ , the overlap is 98% or larger. In the examples below, we have |r 0,⊥ | 6∆r ⊥ , and therefore the overlap factor is close to unity and quantum back-action on the electrons can be neglected. We note that the quantum system's transition energy transferred to the electron leads to a momentum shift δp ∼ ω 0 /v = 2π /λ 0 , where is the reduced Planck constant, v is the velocity of the electrons and ω 0 is the angular transition frequency. For the scattered state overlap to be close to one, this momentum shift must be negligible in comparison to the electron wave packet's longitudinal momentum spread ∆p z = /(2∆z 0 ). We assume an initial longitudinal wave packet width ∆z 0 of the order of 100 nm (which is about the size of the coherence length of typical sources [5,20]) and consider MW transition frequencies corresponding to modulation wavelengths (see Fig. 1) of λ 0 1 mm. Accordingly, δp ∆p z , which is consistent with the large overlap in Fig. 2. The QED transition probability P e↔g is compared with the transition probability induced by the magnetic field of a classical electron (see Appendix A) in Fig. 2. The two probabilities converge for distances 4∆r ⊥ . In the following, we consider parameter regimes where this condition is satisfied, which allows us to use the classical description of the electrons' magnetic field. At the same time, electrons from conventional sources can be assumed to be uncorrelated [21], which allows us to treat the beam as an ensemble of classical Poisson distributed point-like charged particles.

EXAMPLE APPLICATIONS
To illustrate the practical feasibility of quantum klystrons, we consider two example applications of this approach. In the following, we consider an ensemble of electrons with a transverse Gaussian distribution. The electrons are longitudinally velocity modulated which, through propagation, leads to bunching further along the beam. This situation corresponds, for example, to that created in a klystron (see Fig. 1). The base frequency of the current modulation is tuned on resonance with the transition a) Numerical simulation of the magnetic field strength By of a current-modulated electron beam with an initial Poissonian distribution of electrons in time and a Gaussian distribution of electrons in the transverse dimensions as could be created in a klystron (see Appendix C) with bunching parameter r b ≈ 0.5. The waist radius is w = 50 µm and the distance to the center of the beam is d = 250 µm. The plots show the cases of currents of 200 nA (blue plot and right axis, corresponding to about ∼ 5 000 electrons per period) and 100 µA (black plot purple and left axis, corresponding to ∼ 2 500 000 electrons per period). The electrons possess a kinetic energy of 18 keV and the base frequency of the modulated electron beam is 254 MHz. It can be seen that the relative strength of shot noise is decreased significantly for the 100 µA beam in comparison to the weaker 200 nA beam. b) Fourier limited linewidth: discrete Fourier transform (DFT) of the magnetic field strength By with the same parameters as in (a); 200 nA (blue plot) and 100 µA (black plot) evaluated for 10 3 periods. It can be seen that a decrease in current leads to a decrease in the signal-to-noise ratio but does not affect the linewidth of the modulation. of the quantum system. In addition to negligible back-action, coherent driving requires dephasing due to noise in the magnetic field of the beam to be limited. The spectral linewidth δω of klystrons is mainly limited by technical noise [22]; as a conservative estimate, we consider δω 0 /ω 0 = 10 −7 .

Driving hyperfine transitions of alkali atoms
As the first example, we consider driving ground state hyperfine transitions in alkali atoms. Alkali atoms, for example Li, K, and Rb, are especially well suited for a first demonstration of the quantum klystron. This is due to the hydrogen-like level structure with two stable and easily detectable ground state hyperfine levels separated by a transition in the microwave range. We consider the transition F = 1, m F = 0 ↔ F = 2, m F = 0 of optically trapped 41 K atoms as a specific example, where F is the total angular momentum and m F denotes the Zeeman sublevels. This transition has a frequency of ∼ 254 MHz and is therefore easily accessible with lowfrequency MW electronics. 41 K atoms can be optically cooled and trapped, and could be controlled on the subµm scale using similar techniques as used for example for 40 K in [23] or for 87 Rb in [24]. The results of a numerical simulation of the electron beam's magnetic field for this example are shown in Fig. 3 (see Appendix D). The effect of shot noise (analyzed in detail in Appendix E and Appendix F) appears as a homogeneous noise floor in the Fourier transform and does not modify the linewidth of coherent oscillations of the magnetic field (see Fig. 3b). We consider an electron beam waist of w = 50 µm, kinetic energy of 18 keV and an average current I 0 = 100 µA. We consider a bunching parameter r b = 0.5 experimentally attainable at a drift distance of ∼ 1m such that ∆z ∼ 7 µm λ 0 ∼ 0.3 m in the interaction region. This value of r b corresponds to a resonant current modulation at the base frequency ω 0 /2π of amplitude I ω0 = 2I 0 J 1 (r b ) ∼ 50 µA (where J 1 is the Bessel function of the first kind), and we assume d = 250 µm between the atom and the beam center. In the case under consideration, δω/ω 0 = 10 −7 leads to a beam modulation spectral line width of about 25 Hz. The change of the internal state of the atom will be accompanied by a recoil equivalent in absolute value to the momentum transfer to the electron. We obtain a conservative upper bound for the Lamb Dicke parameter of 4×10 −4 for a trap frequency of ∼ 300 kHz (as realized e.g. in [23]) which implies that the recoil is negligible (see Appendix A).
In this example, the fluctuations (e.g. shot noise, modulation phase noise) of the modulated current are small relative to the mean (see Fig. 3). The effect of the mean field can be calculated using the rotating wave approximation. In this case, the evolution equations for the quantum system become the optical Bloch equations with constant coefficient matrix (see Appendix H) and Rabi frequency Ω ≈ g S µ B B y,ω0 /2 , where g S is the electron's gyromagnetic ratio, µ B is the Bohr magneton and B y,ω0 is the amplitude of the Fourier component of the electron beam's magnetic field at the transition frequency (see [25] and Appendix I). Since the distance between the electron beam and the quantum system is larger than 2w, the magnetic field of the electron beam at the position of the quantum system is approximately that of an infinitesimally thin beam, which implies Ω ≈ r e I ω0 /(d e) = P e↔g I ω0 /e (see Appendix I), where r e = µ 0 e 2 /(4πm e ) is the classical electron radius, µ 0 is the vacuum permeability and m e is the electron mass.
The finite spectral linewidth δω of the driving electromagnetic field, represented by phase fluctuations, results where ρee and ρgg are the diagonal components of the quantum system's density matrix (g for ground state, e for excited state), for the transition F = 1, mF = 0 ↔ F = 2, mF = 0 for 41 K at a distance d = 250 µm from the center of an electron beam of waist w = 50 µm, current 100 µA, bunching parameter r b = 0.5, E kin = 18 keV, FWHM linewidth of the electron beam modulation δω0/2π = 25 Hz and Γ1 = 2Γ2 δω0. b) The time-evolution of the inversion for the transition ms = 0 ↔ ms = 1 in the 3 A2-state of an NV − center at a distance of d = 70 nm from a beam of waist w = 10 nm, current 50 nA, E kin = 2 keV (average distance between electrons ∼ 100 µm) and bunching parameter r b ≈ 0.5. We set 1/Γ1 = T1 = 6 ms, 1/Γ2 = T2 = 3 ms and the FWHM linewidth of the electron beam modulation δω0/2π = 300 Hz.
in an increase of the decoherence rate by b = δω/2 (see Appendix H). Furthermore, the shot noise of the electron beam is a source of amplitude noise of the driving field, which leads to a dephasing rate P e↔g I 0 /e, where I 0 is the average current. However, this rate is much smaller than the Rabi frequency Ω provided that d 2r e I 0 /I ω0 (see Appendix K). Since r e ∼ 10 −15 m, this condition is always fulfilled in practice. A plot of the hyperfine state response due to a resonantly modulated electron beam based on numerical evaluation of the optical Bloch equations (see Appendix L) can be found in Fig. 4a. Several Rabi oscillations of the hyperfine states are clearly visible, showing that coherent driving with an electron beam is indeed possible. The largest contributor to the decay of coherence is the beam modulation spectral line width; for an analysis of other effects such as incoherent scattering (both elastic and due to other transitions) and beam electron velocity spread, see the Appendix.
Addressing NV − centers in nano-diamond In the second example, we consider negatively charged nitrogen vacancy (NV − ) centers in nano-diamonds, which could be embedded, for example, in a free-standing nanostructure [26]. We focus on the transition between the 3 A 2 ground state magnetic sublevels m s = 0 and m s = 1, which are split by ∼ 2.87 GHz. The m s = −1 sublevel is well separated from the m s = 1 sublevel by at least ∼ 4 MHz such that the transition m s = 0 ↔ m s = 1 can be individually addressed and easily optically detected [27]. This transition exhibits a coherence time T 2 of up to 600 ms [28].
To achieve a sufficiently narrowly focused beam, the electron source could for example be a field emission electron gun with a slightly modulated acceleration voltage. We consider a modulated electron beam current generating a beam waist of w = 10 nm at 2 keV, a beam current of 50 nA (∼ 100 electrons per modulation period) directed at a distance of d = 70 nm next to the NV − center. These electron beam parameters can be achieved in a standard scanning electron microscope. We assume a bunching parameter r b = 0.5 that would be experimentally attainable at a drift distance of ∼ 3 cm such that ∆z ∼ 400 nm λ 0 ∼ 9 mm. In this situation, the magnetic near field of the electron beam consists of distinct spikes due to the well separated electrons. Therefore, we cannot use the mean magnetic field in the optical Bloch equations. Instead, we simulate the effect of the electron beam on the state of the quantum system on the single electron level. Electrons are randomly generated, their kinetic energy is modulated and their propagation over the drift distance l is calculated to obtain the modulated current. For consecutively passing groups of electrons, the optical Bloch equations with time-dependent coefficients are solved iteratively. Details can be found in Appendix M.
A simulation of the expected system evolution is presented in Fig. 4b. Several Rabi oscillations are clearly visible for this example, damped due to the combined effect of the spectral line width of the beam modulation (as a conservative upper bound, we chose δω 0 ∼ 10 −7 ω 0 as before leading to a damping rate δω 0 /2 ∼ 1 kHz; see Appendix M) and the intrinsic decay rates Γ 2 = 1/T 2 ∼ 0.3 kHz and Γ 1 = 1/T 1 ∼ 0.2 kHz. Other effects can largely be ignored; the various contributions of these are again discussed in Appendix M. Even though this case is outside of the regime of small fluctuations of the magnetic field, we do not find any notable additional decay due to electron shot noise.

POTENTIAL PATHWAY TO NANO-SCALE RESOLUTION
The spatial resolution of coherent control utilizing electromagnetic radiation is generally limited by diffraction to centimeters for microwaves, and to hundreds of nanometers for optical frequencies. The need to selectively address individual quantum systems beyond the diffraction limit has been partially met by strategies such as utilizing sub-wavelength antennas [29,30], tunable resonance frequencies [31,32] or coupling strengths [33], and utilizing multi-photon transitions at a shorter wavelength [34]. The quantum klystron may provide an alternative pathway towards spectrally selective quantum control with nano-scale spatial resolution as we will argue in the following. While a temporally modulated beam produces an EM field that scales as d −1 with distance, a stronger localization of the field in the vicinity of the beam can be achieved by employing oscillations of the beam position to generate a driving signal. Then the oscillating nearfield of a moving beam at the first harmonic and the second harmonic (twice the modulation frequency) scale effectively as d −2 and d −3 , respectively. Based on this faster decrease of the field, for example, at a distance of d = 15 nm to a 1-dimensional array of NV centers, adjacent NV centers with a distance of ∼ 30 nm could be individually controlled, in principle (the spatial dependence of the Rabi frequency shows peaks of width ∼ 40 nm (FWHM)), plots can be found in Appendix M). A full Rabi flop may be performed on an NV center without incurring significant decoherence by employing lowenergetic electron beams (e.g. 200 eV, see Appendix M). Based on the picometer beam widths achievable in scanning electron microscopy [35], the quantum klystron scheme allows for the creation of spatially structured oscillating electromagnetic near-fields in two dimensions on the atomic scale (by choosing an electron impact parameter d of severalÅngström) which, in principle, could be employed for coherent control of systems that are sufficiently robust against electric field noise such as nuclear spins [31].

CONCLUSIONS
In summary, our results show that the electromagnetic near-field of a classically modulated electron beam can be used to coherently drive quantum systems and potentially provides a pathway to nano-scale resolution.
The quantum klystron could be combined with a scanning electron microscope [36] to perform coherent spectroscopic investigations by directing a modulated electron beam next to a sample to selectively drive a quantum transition of interest. This can be realized in a setup similar to aloof Electron Energy Loss Spectroscopy (EELS) [7,37], where the electron beam is directed at a distance of tens of nanometer from the sample to reduce radiation damage.
In the MW frequency range, the excitation levels at every beam position could be read out by an optical channel [38], or microwave sensors [31]. This is particularly interesting as the MW range is inaccessible to the incoherent conventional methods, where the spectral resolution is determined by the energy spread of a monochromated electron beam [7,8]. For electric dipole transitions in the far infrared frequency range, the read-out of the sample's excitation could also be performed with an additional monochromated electron beam applying the aloof EELS method. The coherent control provided by the quantum klystron would potentially enable increased spectral resolution by employing the method of Ramsey spectroscopy [39], which is widely used in spectroscopic applications from NMR [31] to time-keeping [40]. An appealing feature of the general approach to electron spectroscopy described above is that the coherencepreserving scattering investigated in this article leads to a coherent addition of excitation levels from individual electrons [41]. This results in a quadratic dependence of the excitation level on the number of electrons close to ρ ee − ρ gg = ±1 (demonstrated e.g. in Fig. 4 by the quadratic decrease/increase of the transition probability with time). It also leads to an increase of the transition rate per electron by orders of magnitude in comparison to incoherent scattering [42]. This scheme could be, for example, utilized to investigate specimens with reduced electron dose. Finally, we note that the electron-based control of quantum systems can be extended to electric and magnetic multipole transitions. Such transitions are driven by the corresponding spatial derivatives of the electric and magnetic fields. Due to the strong dependence on the beam's near field on d, at nanometer-scale distances from the beam, the multipole transition rates are enhanced by orders of magnitude compared to addressing the same transitions by free-space EM fields. This property can be used to study e.g. quadrupole vibrational transitions in homonuclear diatomic molecules [43], or to directly address the quadrupole transitions serving as the basis of optical clocks [40]. If the change of state of the electron due to back-action is in principle detectable, decoherence occurs in the reduced state of the quantum system. Here, we analyze this effect.
Transition probability due to a classical electron The transition probability of the excited quantum system due to the magnetic field of a passing point-like classical electron can be calculated with the interaction Hamiltonian H int = −μ · B. We obtain the out-state to first order For an electron moving with a velocity v parallel to the z-axis with a displacement of r ⊥ = (x, y), whose trajectory pierces the z = 0 plane at time t j , the magnetic field is (equation 11.152 of [45], translated and rotated) where r ⊥ = | r ⊥ | is the minimal distance between the single electron and the quantum system (impact parameter) and γ = (1 − v 2 /c 2 ) −1/2 is the Lorentz factor. For the transition probability, we find where µ x ge and µ y ge are the components of the transition dipole moment. For the plot in Fig.2 of the main text, we consider x = 0, y = r ⊥ and the magnetic dipole moment oriented in the x-direction. The same results are obtained for the inverse process g → e, implying that P g→e = P e→g for the purposes of this article.

QED model for back-action
We consider the transition from the excited to the ground state first and obtain the opposite case by the replacement ω 0 → −ω 0 . We assume that the quantum system's dimensions are much smaller than its distance to the center of the electron beam d and the modulation wave length λ 0 = 2πv/ω 0 , where v is the average velocity of the electrons and ω 0 is the radian frequency of both the modulation and the transition of the quantum system. Thus, we can consider the quantum system as point-like. Furthermore, we consider an initial Gaussian matter-wave packet of longitudinal size much smaller than λ 0 , such that the beam modulation is not on the level of the single electron wave function but corresponds to correlations between electrons. The transversal width of the Gaussian matter-wave packet is bound from above by the focal width of the beam as ∆r ⊥ < w/2. We describe the electron field as a Dirac field normalized with the charge such that Q(ψ p,s , ψ p ,s ) = (2π ) 3 δ (3) ( p − p )δ ss . Furthermore, we define the momentum eigenstates as where ω p = c | p| 2 + m 2 c 2 / , σ = (σ 1 , σ 2 , σ 3 ) is the vector of Pauli matrices and χ s are the two-spinors χ + = (1, 0) and χ − = (0, 1). We restrict our considerations to the particle solutions of positive energy. In the following, we will also use the momentum eigenstates in the bra-ket notation | p, s that are defined such that ψ p,s ( r) = r| p, s and p, s| p , s = (2π ) 3 δ (3) ( p − p )δ ss . We assume that the electromagnetic field stays in the vacuum throughout the process (no spontaneous emission) and that the quantum system is initially in the excited state |e . For the electrons, we consider an initial state that is un-polarized where φ in ( p) is the polarization-independent single electron wave function in the momentum representation. For explicit calculations, we will use the z-axis as the spin quantization direction later. However, we note that the initial state is independent of the choice of spin basis. We consider an initial wave function φ in ( p) in the interaction region at r = 0 that factorizes into a transversal Gaussian wave packet with width ∆p ⊥ and a longitudinal Gaussian wave packet with width ∆p z , that is where l tot /v is the time for the propagation of the wave packet from the source and we decomposed p = p z + p ⊥ , where p z and p ⊥ are parallel and perpendicular to the z-axis, respectively. For the longitudinal direction, we consider the Gaussian wave packet where the phase e ipzltot/ incorporates the propagation from the source at z = −l tot to the interaction region. We assume that the initial transversal state of the electron in real space is a Gaussian wave packet displaced by r 0,⊥ , that is andψ e in,⊥ reaches its minimal extension at t 0 at the position of the quantum system at z = 0. In momentum space, the displacement leads to a factor e −i p ⊥ · r 0,⊥ / . The transversal momentum spread is small enough to consider the transversal dispersion non-relativistically. In particular, the energy can be approximated as which implies the following form of the transversal wave function in momentum space where the last factor has been added to cancel the transversal dispersion terms induced by the time evolution at t = t 0 . The full in-state can be written as where the state vectors |in s el are defined as To lowest order, after the electron and quantum system interact, the full state will be where [46] |out s = 1 − P e→g (s)|e ⊗ |in s el + P e→g (s) |g ⊗ |scatt s el .
P e→g (s) is the probability for the transition from the excited to the ground state for a fixed initial electron spin s defined as where S( p, s; p , s ) = g, p , s , vac|Ŝ (2) |e, p, s, vac is the scattering matrix element for the transition from momentum p and spin s to p and s in second order perturbation theory. Furthermore, we define the normalized scattered state of the electron where The driving process can only be coherent if the reduced density matrix of the quantum system (with the partial trace taken over the electron Hilbert space) is close to that of a pure state. We find to second order in P e→g (s). We will find later that 2|P e→g (+1/2) − P e→g (−1/2)|/|P e→g (+1/2) + P e→g (−1/2)| is at most of the order of 10 −9 in the case that we consider here. So in the following, we assume that P e→g (+1/2) = P e→g (−1/2) = P e→g . Furthermore, we find that P e→g = P g→e . Since P e→g P e→g , the change of the reduced density matrix in equation (A21) is dominated by the off-diagonal terms. Therefore, for coherent driving to be possible in principle, we need The scattering matrix element For the S-matrix, we have (see Chapter VIII of [47] or §104 of [48] for details) where T denotes time ordering,Ĵ µ contains all of the currents of charged particles andÂ µ is the electromagnetic 4-potential operator. The lowest order interaction term for our process occurs at the second order, for which we find For the process under consideration, the electromagnetic field stays in the vacuum state and we use is the Feynman propagator of the electromagnetic field. We are considering a regime where the quantum system only changes its internal state and the free electrons remain free, that is, we are neglecting any violent effects such as ionization. Then, the charged current operator can be split into the current operator of the free electron and that of the quantum system aŝ and we obtain where J el p,s→p ,s (x) is the transition current of the free electron and J qs e→g (x ) is the transition current of the quantum system. We consider the Feynman propagator in a specific gauge where only the spatial components do not vanish: (the real space version of the expressions given in [49] equation (A.7b) and [47] §76). Therefore, we can restrict our considerations to the spatial components of the transition currents. We describe the free electron as a charged spin-1/2 field with the current (using α = γ 0 (γ 1 , γ 2 , γ 3 ) and γ µ the Dirac matrices) We remark that the quantization volume is omitted throughout the calculations, so J el p→p has the dimensions of a current instead of a current density. To describe the schemes proposed in this work, we restrict our considerations to magnetic dipole transitions of the quantum system (we also consider the effect of electric dipole transitions in Appendix B). Furthermore, we assume that the quantum system is much heavier than the electrons (e.g. m e /m 41 K ∼ 10 −5 for our first example and much smaller for the NV-center in diamond) such that we can ignore the momentum recoil on the quantum system for this calculation. In this case, the spatial wave function of the quantum system is always unchanged to a good approximation. Then, the transition current of the quantum system can be approximated as that of a point-like magnetic dipole (see page 79 of [50]) where µ is the magnetic transition dipole moment. Partial integration and execution of the Fourier transforms leads to Since ω p /ω 0 = c | p| 2 + m 2 c 2 / ω 0 10 10 1, energy conservation implies and κ p,p ≈ 1, which leads to where the limit has been taken trivially since ω 0 /c = | p − p| due to the energy conservation condition ω p − ω p − ω 0 .

The scattered state
For the scattered state, we find where σ l ss = χ † s σ l χ s . Note that we have definedφ scatt,s ( p, s) as the unnormalised scattered wave function for notational convenience, i.e.φ scatt,s ( p, s) = P e→g φ scatt,s ( p, s). We define Energy conservation implies p z = p z,sol ( p ⊥ , p ) and we obtain and for the scattered statē where We assume that the magnetic dipole moment µ of the transition under consideration is pointing into the x-direction.
If we take into account that we have chosen the spin-quantization direction along the z-axis, for the spin preserving case we find and for the spin-flip transition, In terms of the un-normalized scattered wave functions, the transition probability is Taking P e→g (+1/2) = P e→g (−1/2) = P e→g for granted, the spin averaged overlap becomes where the spin term has canceled out.

Numerical treatment
We consider a Gaussian envelope for the input wavefunction φ in given in equations (A11) and (A8). We rewrite the above equations in terms of dimensionless quantities As above, the transversal dispersion can be treated perturbatively. In particular, we have to zeroth order and first order in ξ 2 π 2 ⊥ /π 2 z,0 , respectively. Then to first order in ξ 2 π 2 ⊥ /π 2 z,0 , we find for the sum of the dispersion phases which is independent of π 2 ⊥ and can be pulled out of the integral. Then, the transversal dispersion of the wave packet over the drift distance is canceled by the phases we introduced when we defined the initial state just for this purpose since we consider the electron beam to be focused in the interaction region. The final dispersion phase cancels in the probability integral. It only appears in the overlap integral. We define the dispersion free scattered state functions Then, the probability is obtained as Using the semi-classical transition probability found in equation (A3) above implies Performing the same approximations as above for the initial state, we find Then, the spin-averaged overlap is Under the integral, the remaining relative phase between in-state and scattered state can be approximated as Then, we define the un-dispersed wave packet and calculate the spin-averaged overlap as For the numerical evaluation, we set τ 0 = 0. Due to the Gaussian shape of the initial state, the momentum distribution can be restricted to the intervals given by −n π z − π z,0 n and −n | π ⊥ | n. We chose n = 5, which implies that contributions smaller than e −25 are neglected. The corresponding initial range of significant electron energies is − n π z,0 Ω πz,0 Ω π − Ω πz,0 2nπ z,0 + n 2 (1 + ξ 2 ) 2Ω πz,0 .
where Ω πz,0 = π 2 z,0 + M 2 and we used the fact that π z,0 ξn. Due to energy conservation, it follows that the integration of the final wave function can be restricted to and if π 2 z,0 + 2Ω πz,0 Ω 0 − π 2 z − 2nπ z,0 > 0, where we have taken into account that Ω 0 Ω πz,0 . Plots of the results are given in Fig. 5 for the parameters used for the second explicit example presented in this article; an NV center in diamond driven by an electron beam on the nano-scale. Similar plots are obtained for the parameters considered for the first example. We unsurprisingly find no visible effect of the initial spin on the transition probability. Furthermore, for distances of about 10∆r ⊥ , the states. This plot shows fluctuations that are due to numerical noise. We can conclude that the relative difference is at most of the order of 10 −9 and potentially even lower. Therefore, probabilities can be considered as equal for the purpose of this article. Lower left plot: the quotient of the numerically calculated transition probability and the semi-classical result above in equation (A3). The numerical result agrees with the analytical result by one percent or less for distances larger than 10∆r ⊥ . Lower right plot: the overlap of the initial electron state and the final electron state. For distances ≥ 6∆r ⊥ , the overlap can be considered to be one for the purpose of this article. The plots were obtained for ∆r ⊥ = 5 nm, ∆z0 = 100 nm, ω0 = 2π × 2.87 × 10 9 rad/s, an initial kinetic energy of the electron of 2 keV and a total propagation distance from the electron source ltot = 1 m. For r 0,⊥ we considered (0, r 0,⊥ ), that is the quantum system and the center of the electron wave packet lie in the y-z-plane.
numerical result for the transition probability approaches the result of the semi-classical calculation found in equation (A3), a result which can be assumed to continue for even larger distances. The condition on the overlap of in-state and out-state in equation (A22) is fulfilled for all distances in the plot. This behavior can also be expected to continue for larger distances. Our numerical result shows that, for τ 0 = 0, the overlap is purely imaginary (the real part cannot be distinguished from numerical noise). For the transition from the ground to the excited state, we must perform the replacement ω 0 → −ω 0 in all equations above. Performing the numerical analysis as before leads to the conclusion that where we defined |scatt s e→g as the scattered state of the electron after inducing a transition from the ground state to the excited state and analogously |scatt s g→e . Furthermore, we obtain that the overlap is imaginary for τ 0 = 0 and positive as for the transition e → g. This implies General initial state In this section, we investigate the effect on the quantum system starting from a general separable pure state From our results above, we conclude that the spin of the electron can be neglected and that P e→g = P e←g and we will write P for both in the following. After the scattering, the state becomes Taking into account equation (A67) with spin-independent overlaps and defining iΛ 1 = el in|scatt el,e→g = − el in|scatt * el,g→e and Λ 2 = el,e→g scatt|scatt el,g→e , we find for the reduced density matrix The change of the reduced density matrix due to the scattering event can be written in terms of the vector of components of the density matrix (in the co-rotating frame as we started in the interaction picture) (ρ eg ,ρ ge ,ρ ee ,ρ gg ) = (αβ * , α * β, |α| 2 , |β| 2 ) as There are two extremal situations; when the electron state is either unchanged to a good approximation (|Λ 1 | = |Λ 2 | = 1, corresponding to the case we obtain here) or so strongly affected so as to be in an almost orthogonal state (|Λ 1 | = |Λ 2 | = 0), so that the reduced state of the quantum system remains approximately in a pure state (coherence preserving scattering) or becomes a mixed state (decohering scattering), respectively. If the electron state changes substantially, that is Λ 1 √ P , we obtain the case of incoherent scattering where the quantum system is driven by a stochastic force into a steady state of vanishing inversion ρ ee − ρ gg = 0 and vanishing off-diagonal components which is a maximally mixed state. When the state change of the electron is negligible up to a phase, we find where we have defined el in|scatt el,e→g = − el in|scatt * el,g→e = ie iφ , and therefore, Λ 2 = el,e→g scatt|scatt el,g→e = e −2iφ . Note that the phase φ encodes the arrival time of the center of the wave packet, that is φ = ω 0 t. Considering consecutive interactions with single electrons with arrival times that are equivalent modulo 2π/ω 0 , we obtain oscillating dynamics, Rabi oscillations, of the quantum system's state inversion ρ ee − ρ gg . The appearance of Rabi oscillations can be seen also analytically by an approximate continuum treatment: considering consecutive interactions with single electrons of a current I(t) with fixed temporal distance between electrons ∆t and taking the limit ∆ρ qs /∆t → dρ qs /dt while keeping √ P /∆t finite, equation (A71) leads to where we assumed Λ 1 = |Λ 1 |e iω0t . This is equivalent to the optical Bloch equations without damping (see Sec.H). The rotating wave approximation reveals a Rabi frequency that depends on the overlap as Ω = √ P | el in|scatt el,e→g |I ω0 /e, where I ω0 is the resonant Fourier component of the electron current.
From the vanishing diagonal blocks in the continuum limit (A74), we also conclude that the terms in the diagonal blocks in equation (A71) can be associated with the discreteness of the beam electrons. Using the parameterization of the complex parameters of the initial state α = cos ϕ , β = e iρ sin ϕ , the change of inversion for the two extremal cases is which shows that the inversion change due to coherence preserving scattering reaches its maximum of 2 √ P at ϕ = π/4, whereρ ee −ρ gg = 0, while the inversion change due to decohering scattering has maximums of 2P when ϕ reaches multiples of π/2, whereρ ee −ρ gg = ±1. In particular, the maximal effect of coherence-preserving scattering on the quantum system's state inversion is larger by a factor 1/ √ P than the maximal effect of decohering scattering, which is usually several order of magnitude (11 orders of magnitude in our first example).

Recoil of the quantum system
The change of the internal state of the quantum system will be accompanied by a recoil equivalent in absolute value to the momentum transfer to the electron. We can give a bound on the momentum transfer to the electron based on the numerical overlap between the electron in-state and the scattered state. For the overlap to be close to one, the transversal momentum change has to be much smaller than the transversal momentum spread of the initial wave packet. From our simulations, we find an overlap of more than 0.99 even for a wave packet width of ∆r ⊥ = 50 µm leading to a bound on the transversal momentum transfer to the quantum system δp ⊥ 2×10 −30 kg m/s. For trapped atoms with a trap frequency ∼ 300 kHz, this is much smaller than the momentum difference between the motional ground and excited state of the potassium atoms. Explicitly, the Lamb Dicke parameter is δp ⊥ / 2m ω trap 4×10 −4 . Hence, for a setup as described in [23], we can conclude that the atoms will stay in the motional ground state during the interaction time.

Appendix B: Other inelastic scattering processes
We can estimate the total electron scattering probability using the total scattering cross section (comprising ionization, elastic and inelastic scattering [51]). For potassium atoms exposed to an 18 keV electron beam, we find σ tot ≈ 1.5 · 10 −17 cm 2 , extrapolated from [52]. The current density j of a Gaussian beam at 5w would theoretically lead to a negligible scattering rate σ tot j/e, where e is the elementary charge. Therefore, all short range interactions can be neglected. To reduce unwanted effects due to electrons scattering on the diamond structure of an NV center [53] to a negligible level, the electron beam intensity at the position of the NV center should be reduced by a factor of 10 −6 compared to its maximum. At this intensity, the number of electrons scattering within a radius of 1 nm around the NV center per period of the Rabi oscillation is less than one. This can be achieved for a Gaussian beam at a distance of five waists or more, which is fulfilled for the parameters considered here.

Electric dipole transitions
In addition to the transition we consider, there are electric dipole transitions that can lead to an effective loss of the quantum system. Since these processes are incoherent, the probability for these transitions can be estimated using the transition probability for a single scattering event. Nearly all electrons in the beam are further away from the quantum system than the transversal width of their wave packets. Therefore, we model the interaction of the electron with the quantum system as that of a point-like charged particle, as above. For electric dipole transitions, we start from the interaction Hamiltonian H int = −d · E to obtain the atomic out-state to first order; in the interaction picture. For the transition probability, we find for a transition from the ground state |g to an "other" state |o . The electric field of the electron moving parallel to the z-axis in the y-z-plane is where γ is the Lorentz factor. Then, is the Fourier transform of the electric field due to a single point-like electron. For the transition probability, we find where λ e is the electron Compton wavelength and a 0 is the Bohr radius. For the parameters used in example 1 to generate Fig. 4a, we obtain r ⊥ /(γv) ∼ 10 −12 . Therefore, electric dipole transitions of potassium atoms are exponentially suppressed and can be neglected. The transition energy of the electric dipole transition from the NV − center 3 A 2 ground state to the next excited state (the zero phonon line) has the transition energy 1.945 eV. This leads to exponential suppression and P d g−>o ∼ 10 −13 for the parameters used to generate the results presented in Fig. 4b. These parameters correspond to ∼ 10 8 electrons passing the quantum system per Rabi cycle leading to a total electric transition probability per Rabi cycle on the order of P d g−>o ∼ 10 −5 , which can be neglected.

Full QED calculation for electric dipole transitions
The derivation of the scattering matrix elements and the scattered state in full QED works along the same lines as for magnetic dipole transitions above. We assume that the transition of the quantum system is due to a state change of an electron of the quantum system. Then, the transition current can be expressed as Partial integration and execution of the Fourier transforms leads to We assume that the quantum system is strongly localized in comparison to the distance between the electron and the quantum system and we neglect recoil on the quantum system. Furthermore, we assume that the transition of the quantum systems is between different energy states of an electron of the quantum system and that the Hamiltonian defining the electronic level structure of the quantum system contains the momentum operator −i ∇ only in the kinetic term − 2 ∇ 2 /2m. For example, the Hamiltonian modeling the electronic structure of NV-centers is of this form [54]. Then, we find We employ the dipole approximation as We obtain the scattering matrix element Since ω p /ω eg = c | p| 2 + m 2 c 2 / ω eg 10 10 1, energy conservation implies and likewise for κ p,p , which leads to We used the energy conservation condition ω p − ω p − ω eg , that ω p ω eg and mc 2 ω eg , and With the z-direction as the quantization direction, we obtain the un-normalized scattered state without a spin flip and the scattered state with a spin flip The plots were obtained for ∆r ⊥ = 5 nm, r ⊥,0 = 70 nm, ∆z0 = 100 nm, | Deg| = 2.27ea0 (corresponding to the electric dipole moment of the 3 A2 to 3 E transition (zero phonon line or ZPL) of a NV − center at 1.945 eV [55]) and an initial kinetic energy of the electron of 2 keV. For r 0,⊥ we considered (0, r 0,⊥ ), that is the quantum system and the center of the electron wave packet lie in the y-z-plane. We find that the two results agree up to the plateau beyond PHz frequencies which is due to the numerical noise floor of our algorithm. We note the strong suppression of the scattering probability for angular frequencies above 10 15 rad/s.

Appendix C: Electron beam of a klystron
In the following, we will give some details on the current-modulated electron beam in a klystron based on the article [56] by Webster. The electron beam modulation of a klystron is achieved by modulating the kinetic energy, or, effectively, the velocity of electrons in the buncher. This can be done, for example, with a microwave field in a resonator (the buncher cavity) that leads to an electric field in the beam propagation direction [57]. Under the assumption of monochromatic oscillations of the kinetic energy modulation in the buncher and approximating the buncher as infinitesimally short, for the velocity of an electron passing the buncher at time t 1 , we can approximate When the amplitude of the kinetic energy modulation δE kin is small in comparison to the average kinetic energy, we have v 1 ≈ δE kin /(γ 3 m e v 0 ). The arrival time of the electron at the target (e.g. an atom) is where l is the distance to the buncher. Charge conservation can be written as I(t 1 , z 1 )dt 1 = I(t 2 , z 2 )dt 2 and leads to where I 0 is the un-modulated stationary current and is the bunching parameter. Writing the distance to the buncher as a coordinate l = z − z 0 , where z 0 is the position of the buncher, we obtain where θ(t) is the solution of the equation It has been shown that the current in equation (C5) can be expressed as a Fourier series with the coefficients [56] I(z, t) where I nω0 (z) = 2I 0 J n (n r b (z)) and J n are the Bessel functions of the first kind. The Fourier coefficients as a function of the bunching parameter are plotted in Fig. 7. The beam current as a function of the distance from the buncher cavity is plotted in Fig. 8.

The effect of the electron velocity distribution
The finite width of the electron velocity distribution affects the beam modulation because the bunching of the beam depends on the initial velocity. We consider a kinetic energy distribution with a width ∆E kin of about 1 eV. Approximately, we have ∆E kin = γ 3 mv 0 ∆v 0 . This leads to a distribution in the bunching parameter ∆r b = 2lω 0 v 1 ∆E kin /(γ 3 mv 4 0 ) and ∆r b /r b = 2∆E kin /(γ 3 mv 2 0 ). This ratio decreases for increasing kinetic energies. For E kin = 18 keV, we have v 0 /c ∼ 1/4 and we can find ∆r b /r b = ∆E kin /E kin ∼ 10 −4 . We find a minor correction to the bunching parameters which implies a minor correction to the amplitudes of the Fourier components corresponding to the distinct lines in the modulation spectrum. It is also important to note that this effect will not broaden the spectral linewidth of the modulated near field affecting the quantum system.

Appendix D: Single particle beam simulation
To analyze systematic effects due to shot noise, we model the electron beam as a collection of single electrons generated in a homogeneous Poisson process. Electrons are generated after waiting times that are exponentially distributed [58] with the mean given by the inverse of the rate σ of electron creation at the cathode. We simulate the beam of a Klystron by modulating the kinetic energy of the particles and propagating them over a drift distance l to obtain the current modulation. The modulation of the kinetic energy is sinusoidal: E kin (t) = E kin,0 + δE kin sin(ω 0 t). We wrote a numerical algorithm using Python that generates a set of electron positions representing the beam. For an electron moving at r ⊥ = (x, y) parallel to the z-axis and arriving at z = 0 at time t j , the only non-vanishing component of the magnetic field strength at the origin becomes (take equation 11.152 from [45] and shift and rotate) where γ = (1 − v 2 /c 2 ) −1/2 is the Lorentz factor and r ⊥ = | r ⊥ |. These contributions to the total magnetic field strength are summed for all electron positions. We simulated the beam over a length of L ∼ 100d centered at z = 0 to limit the numerical effort. This approximation is well justified as electrons in the beam affect the quantum system significantly only in an interaction region on the length scale of several d/γ centered at z = 0. For larger z, the effect on the quantum system decays as |z| −3 . The electrons have an initial kinetic energy of 18 keV. The initial transversal position of electrons is modeled as a normal distribution, where the variance σ = w/2 is given by the waist radius w of the beam. To restrict the beam to a finite radius ∆r ⊥,0 and to avoid numerical singularities, the transversal distribution is generated from a uniform distribution by mapping values of y between 0 and 1 with the function r ⊥ (y) = 2 −1/2 w ln((1 − y(1 − exp(−2∆r 2 ⊥,0 /w 2 )) −1 ) to a radius and generating the azimuthal distribution with another uniform distribution. Furthermore, we note that the magnetic field of each electron effectively acts on a length scale |v(t−t j )| ∼ r ⊥ /γ as can be seen from equation (D1). Therefore, the beam divergence, specified by the divergence angle θ, can be neglected if the change of beam width is on the length scale of the interaction region θr ⊥ /γ w. Later, we will consider d = 5w, and the above condition is fulfilled for almost all electrons in the beam if θ γ/5. For a strongly focused Gaussian electron beam, θ is given by the wave properties of electrons as θ = λ dB /(πw), where the de Broglie wavelength is λ dB = 2π /(γm e v). We obtain a condition for the waist w 10 /(m e γ 2 v). The right hand side decreases monotonously with increasing v, and, therefore, with increasing kinetic energy. For a velocity c/4 (corresponding to 18 keV), the right hand side becomes approximately 40 /(m e c) ∼ 10 −11 m, and the condition on w will be always fulfilled in the context of our proposal. For a wide beam with a given transversal kinetic energy spread of about ∆E kin or less, we obtain the corresponding transversal velocity spread of ∆v ≈ 2∆E kin /m e and the divergence angle θ = ∆v/v. For v = c/4 and ∆E kin ∼ 1 eV, we find θ ∼ 10 −2 1/5 which falls within standard parameters for electron microscopes [5, 8], and the above condition is fulfilled. The results are shown in Fig. 9. To generate the data for the plots, the simulation was run for 10 3 periods of the modulation. The Fourier transform of the magnetic field due to the electron beam can also be calculated directly from the Fourier transform of a single electron's magnetic field. The minimal distance (impact parameter) between the electrons and the origin is r ⊥ := (x 2 + y 2 ) 1/2 . At time t and position r = 0, the magnetic field caused by an electron moving with velocity v j and arriving at z = 0 at time t j is The temporal Fourier transform of the magnetic field of a single electron is We note that the Fourier transform of the single electron decays exponentially for r ⊥ ω/(γ j v j ) 1 due to the properties of the Bessel function. For angular frequencies ω such that r ⊥ ω/γ j v j 1, we can approximate K 1 (x) as 1/x and find This means that the magnetic field of a single electron appears like a delta-peak when seen on time scales much larger than r ⊥ /(γ j v j ). In particular, we can conclude that the magnetic field is directly proportional to the current for these time scales.
The single electron Fourier transform can be used to obtain the discrete Fourier transform of the total magnetic field directly from our numerical model above. A plot is given in Fig. 10. To derive the expectation value of the Fourier transform of the magnetic field due to the total beam, we use the probability for an electron to pass the z = 0 plane at t = t j , given as P(t). We assume that the beam has a duration T and that P(t) is normalized on the interval [−T /2, T /2] and vanishes outside of it. Furthermore, we assume that the probability has a Fourier spectrum with distinct lines evenly spaced by ω 0 . We restrict our considerations to a one-dimensional model for the beam and set r ⊥ = d. We write the Fourier decomposition as where Θ [− 1 2 , 1 2 ] is the characteristic function for the interval [− 1 2 , 1 2 ] which takes the value one in the interval and vanishes outside of it. In particular, P(t) is periodic with a base frequency of ω 0 /2π. Using the Poissonian distribution of the electron number in the interval p N =N N e −N /N ! whereN = E[N ] is the expected value [59], we find where the integrals are taken over the whole sum at the end of the equation. For small bunching parameters r b < 1, electrons do not overtake each other and there is a one to one correspondence of the arrival time of an electron and its velocity, which implies v k = v(t k ) and γ k = γ(t k ). The temporally periodic modulation of the electron velocity means that v(t k ) and γ(t k ) must be periodic as well. The period is given by the base frequency ω 0 /2π. We find Due to the Bessel function K 1 decaying exponentially for arguments larger than one and γ(t) and v(t) only varying slightly in time, the spectrum of the beam will not contain frequencies much larger than γ 0 v 0 /d, where v 0 and γ 0 are the average quantities. The integral in equation (E6) is the Fourier transform of a 2π/ω 0 -periodic function which implies that E [F t [B y ( r = 0, t)]] consists of distinct Fourier-limited spikes at multiples of ω 0 . More precisely, there exist coefficients b n such that The coefficients can in principle be directly calculated from equation (E5). If d ω/(γ 0 v 0 ) 1, we can approximate the Bessel function and find which is proportional to the spectrum of the probability function P(t) that is given by the beam bunching. The average magnetic field becomes where I(t) = I 0 T P(t), which is the magnetic field of a slowly modulated one-dimensional current.
Appendix F: Auto-covariance and noise In this section, we derive the covariance matrix of the magnetic field of a one-dimensional modulated beam which contains all of the information about the noise spectrum of the Gaussian random process B y . Again, we consider a beam of N electrons with arrival times at the z = 0 plane that are randomly distributed over an interval T with the probability distribution P(t). We find Again for bunching parameters r b < 1, we can write Subtracting the square of the expectation value of the spectrum, we obtain This implies that the variance of the spectrum (for T 1/ω 0 ) is (F5) In particular, is the power spectral density. Our result shows that the average spectrum is not changed by the fluctuation, but that there is just a noise floor that is homogeneous for frequencies ω γv/d and falls off quickly for ω γv/d. For ω γv/d, we find We can calculate the temporal auto covariance with the two point Fourier transform of (F4), with which we find Cov(B y (t), B y (t )) = eµ 0 2πd We find that we are dealing with delta correlated noise. Introducing a frequency cut-off such that δ(t − t ) → ∆f , we find This implies Var(B y (t))/E[B y (t)] 2 = e∆f /I(t) which is the signature of shot-noise. Equating 1/∆f with the time scale of the interaction of electron and quantum system d/γv, we find that the noise-to-signal ratio Var The condition in equation (F11) must be fulfilled to obtain a continuous driving signal with small noise. The factor d/γv can be identified as the inverse auto-correlation time τ c as it is the inverse of the frequency scale on which the auto-covariance in equation (F4) decays. Thus, the condition in equation (F11) simplifies to I min τ c /e 1, where I min is the minimal value of the modulated current. This implies that a continuous signal with small noise is ensured if there are many electrons passing the quantum system per auto-correlation time. Assuming a kinetic energy of 18 keV and a minimal current of I min = 20 µA, we obtain a required distance of the quantum system to the center of the beamline of d 600 nm. Note that this condition is not a general limit of the mechanism we propose but only of the applicability of the approximation of a continuous driving signal with small noise. If the condition is not fulfilled, then a different model must to be chosen. In the case of quantum systems being driven by the magnetic field of single well separated electrons, we simulate the time evolution of the state of the quantum system for each electron separately; details can be found below in section M.
In the following section, we assume that the distance of the quantum system to the center of the beam d is much smaller than the wavelength of the beam modulation λ 0 = 2πv/ω 0 and that the waist w of the beam is much smaller than d. Based on the magnetic field due to a single electron in equation (D1), the magnetic field induced by an infinitesimal segment of a one-dimensional beam can be written as Then, for the whole beam, we write The integrand is localized to a region of length r ⊥ /γ. If I(z, t) does not change significantly on this length scale, we can approximate For the current of the specific case of the Klystron beam, we have the Fourier decomposition where I nω0 (z) = 2I 0 J n (n r b (z)) was defined above. Restricting our considerations to the Fourier component at the base frequency ω 0 /2π, from the condition that I(z, t) does not change significantly on the length scale r ⊥ /γ, we obtain the conditions r ⊥ γλ 0 = 2πγv 0 /ω 0 and For the bunching parameter r b (z) ≤ 1, we have J 1 (r b )/J 1 (r b ) ∼ r b and the second condition becomes r ⊥ γl. Therefore, we consider a non-divergent beam with a Gaussian profile j e ( r, t) =ẑ2I(t) exp(−2| r ⊥ − r ⊥,0 | 2 /w 2 )/(πw 2 ). j e ( r) is normalized such that I(t) is the average current obtained by integrating the charge density over the x-y plane, and r ⊥,0 is the position of the beam's center, i.e. | r ⊥,0 | = d. The parameter w is the waist radius of the beam such that the beam has a 1/e 2 -diameter of 2w. Under the conditions above, we obtain Equation (G6) gives the general result for distances to the beam d λ. If additionally d > 2w holds, one can easily verify that the magnetic field strength of a Gaussian beam can be well approximated by that of an infinitely thin beam A plot demonstrating this is shown in Fig. 11.

Appendix H: The optical Bloch equations
To derive the description of the quantum system, we start from the interaction Hamiltonian in the Coulomb gaugê where B(t) = (B x (t), B y (t), B z (t)) and µ = µ L + µ S + µ I , where µ L = −µ B g L L/ , µ S = −µ B g S S/ and µ I = µ N g I I/ . µ B = e /(2m e ) is the Bohr magneton, g L = 1 − m e /m n ≈ 1 is the orbital gyromagnetic ratio, g S ≈ 2 is the spin gyromagnetic ratio, µ N = e /(2m p ) is the nuclear magneton and g I is the total nuclear gyromagnetic ratio.
The quantum system is considered as a two level system with the free Hamiltonian H 0 = ω 0 σ z /2. For the time evolution of the density matrix ρ, we consider the Lindblad equation with the Lindblad operatorL = |g e| representing the spontaneous emission into the radiation field corresponding to the natural linewidth of the transition. We obtain  where T ge = g|H int |e is the time dependent transition moment from the excited to the ground state. With the transformationρ eg = ρ eg e iω0t ,ρ ge = ρ ge e −iω0t ,ρ ee = ρ ee andρ gg = ρ gg , we find This equation corresponds to the case that the coherence time is given as T 2 = 2T 1 = 2/Γ which can be seen by the term Γ/2 appearing in the components of the matrix operator governing the decay of the off-diagonal elements of the density matrix. The generalization to general T 2 becomes (see Sec.4 of [60] and set γ a = Γ 1 , γ b = 0 and γ ph = Γ 2 − Γ 1 /2 and taking into account that the upper level decays into the lower level leading to equation (4.31)) where Γ j = 1/T j and j ∈ {1, 2}. With B i (t) = n B i,nω0 cos(nω 0 t + φ M ), we can consider on-resonance driving, and use the rotating wave approximation to find where we define the Rabi frequency as where B ω0 = (B x,ω0 , B y,ω0 , B z,ω0 ). The finite spectral linewidth of the electromagnetic near-field created by the electron beam will influence the evolution of the quantum system. For the interaction of atoms with laser light, this has been investigated in [61][62][63][64][65]. For the case of a modulated current with small fluctuations relative to the mean (e.g. shot noise, modulation phase noise), the result can be applied immediately due to the equivalence of the interaction Hamiltonian. With the resonance condition, the rotating wave approximation leads to the modified optical Bloch equations forρ k ij (t) := ρ ij (t) exp(ikφ(t)) ph , which are the components of the quantum system's density matrix averaged over the phase noise φ(t), representing the finite spectral linewidth. The decoherence rate b in equation (H8) (which is assumed to be much smaller than Ω) is related to the Full Width at Half Maximum (FWHM) linewidth δω of the modulation as b = δω/2 as we will show in the following.

FWHM linewidth and coherence length
In [61], the inverse coherence length b is defined via exp(iφ(t)) exp(−iφ(t )) = exp(−b|t − t |). The magnetic field is given by its Fourier transform as Therefore, the cross correlation becomes If a Lorentzian line shape is given, and where δω is the FHWM linewidth in rad/s, we find This implies that the inverse coherence length is b = δω/2. smaller than all time scales under consideration, such that we can approximate the average field as equation (E10) and its covariance as equation (F10). Here, we only consider the example of the potassium atoms as this corresponds to small fluctuations around the mean. Then, from equation (I5), we have T ge / = −eB y /(2m e ) and E[T ge ]/ = −eµ 0 I(t)/(4πm e r ⊥ ) = −r e I(t)/(er ⊥ ). We can write equation (K1) asu where u = (ρ eg (t), ρ ge (t), ρ ee (t), ρ gg (t)) and α is a parameter estimating the magnitude of fluctuations, which in our case implies With equation (F10) and the frequency scale ∆f ∼ γv/d, this equation implies In the following, we will derive an ordinary linear differential equation for the expectation value of the vector of components of the density matrix u given in [67]. To this end, we must assume that ατ c 1, where τ c is the auto-correlation time of the magnetic field. If this condition is fulfilled, then the ensemble average of u fulfills the integro-differential equation (see Sec.12 of [67]) where K 0 = B 0 , where we consider times much larger than the correlation time τ c , and the matrix Y(t, t ) is the time-evolution operator for the differential equation ... denotes the cumulant, and therefore On the time scale of ω 0 , the driving T ge can be assumed to be delta-correlated. In particular, for 1/ω 0 τ c , we can set Cov (T ge (t), T ge (t )) = 2 aI(t)I −1 0 δ(t − t ) based on equation (F9), where a = (e 2 µ 0 ) 2 I 0 /((4πm e d) 2 e) = P I 0 /e for the case of potassium atoms. As Y(t|t) = I, we obtain and Taking into account that I(t) has a spectrum with distinct lines and a large spacing between spectral lines ω 0 , the transformation to the rotating frame, the rotating wave approximation (RWA) and averaging the damping lead to where the Rabi frequency Ω = r e I ω0 /(ed) as defined in equation (I6), and I nω0 = 2I 0 J n (nr b (z)) is the Fourier coefficient of the modulation at the base frequency (see equation (C7)). We find that shot noise leads to additional decoherence terms and an additional damping term proportional to a in the optical Bloch equations. Since r e ∼ 10 −15 m, the above condition is always fulfilled in the context of this article. For the method we used above to be applicable, we had to assume that ατ c 1, where we identified τ c ∼ d/(γv). We obtain from which we find the condition for the distance For a kinetic energy of 18 keV and an average current of I 0 = 100 µA, we find the right hand side of this condition to be on the order of 10 −22 m. Therefore, this condition can be fulfilled for the situation that we consider. Since a larger current leads to a reduced noise to signal ratio of the magnetic field, it seems counter-intuitive that the minimal distance between beam line and quantum system grows with the current. However, the above condition only applies to the method presented in [67].
FIG. 12. The blue curve shows the time-evolution of the inversion ρee − ρgg. The center of the Gaussian electron beam of waist radius w = 50 µm is at a distance of 5w from the atom. We consider an average current I0 = 100 µA and bunching parameter r b = 0.5 corresponding to a resonant current modulation at the base frequency ω0/2π of amplitude 2I0J1(r b ) ∼ 50 µA. The resulting Rabi frequency is Ω ≈ 2π × 540 Hz. The decay of coherence is due to the assumed FWHM linewidth of the electron beam modulation of 25 Hz. We calculated (orange line) the ratio of atoms nrem whose state is altered by incoherent scattering of single electrons assuming a remaining current density of 0.1% of the peak value at the position of the atoms as a conservative estimate. After 20ms, less than 1% of the atoms undergo an incoherent scattering interaction with the electrons.
to m s = 1 can be individually addressed. We consider the z-direction as the quantization direction, with the magnetic field oriented in the x-direction. Then, we find for the transition matrix elements T 0,1 = g S µ B B x / √ 2 (see Appendix J). This transition exhibits coherence times T 2 from 600 µs [68] up to 600 ms ( [28] using a dynamical decoupling pulse sequence), which is the main decay channel for the Rabi oscillations of the NV − center. We set T 1 = 6 ms, T 2 = 3 ms here following [28]. As the electron beam source, we consider a standard scanning electron microscope generating a beam waist of w = 10 nm, beam energy of 2 keV, a probe current of 50 nA (corresponding to ∼ 100 electrons per modulation period) and a bunching parameter r b ≈ 0.5 (l ∼ 3cm and δE kin /E kin = 1/20) directed next to an NV − center at a distance of d = 7w = 70 nm, for example embedded in a free standing nanostructure [26]. We assume that the beam is modulated by velocity modulation and bunching with a spectral modulation linewidth of 10 −7 ω 0 /(2π) ∼ 300 Hz. Note that, for the above parameters, the wave packet is much smaller than λ 0 in the interaction region if the initial size of the wave packet is much larger than 2m e vλ 0 /( l) ∼ 6 × 10 −12 m. The result of a simulation of the expected level response is given in Fig. 13. To reduce unwanted systematic effects due to electron scattering on the diamond structure [53] we need to ensure that the electron beam intensity at the position of the NV center is reduced by a factor of 10 −6 compared to its maximum. At this intensity, which is easily fulfilled for a Gaussian beam at 5w, on average less than one electron scatters within a radius of 1 nm next to the NV center every inverse Rabi frequency.
To produce the data for Fig. 13, electrons are generated consecutively by a random process. We modulate the kinetic energy of the particles and calculate the propagation over the drift distance l to obtain the current modulation. The modulation of kinetic energy is sinusoidal E kin (t) = E kin,0 + ∆E kin sin(ω 0 t + φ(ξ, t)), where φ(ξ, t) is a random process incorporating the finite linewidth of the driving. In particular, dφ(ξ, t)/dt = F (ξ, t), where E[F (ξ, t), F (ξ, t )] = 2bδ(t − t ) which implies that for each temporal interval [a, b], we have Var(φ(ξ, a) − φ(ξ, b)) = 2b|a − b| .
Based on this variance and a vanishing average, the phase noise was implemented as a random Gaussian process. An interaction region of length 5d/(γv) was associated with each electron. Then, the optical Bloch equations in the rotating frame were solved consecutively for each interaction of electrons with the NV − -center over the interaction period using the Python ODE solver solve ivp. For electrons with overlapping interaction regions (a rare case for these parameters), the optical Bloch equations were solved together. Between the interaction regions, the analytical solution for the free time evolution was applied. Finally, the results of 12 runs were averaged to obtain an average over different realizations of phase noise.

Possible path to nano-scale resolution
Electric dipole transitions from the 3 A 2 ground state of the NV − center have a transition energy ≥ 1.945 eV. To ensure a coherent evolution of the quantum system, we want to keep the probability for such transitions during the time needed for one Rabi transition suppressed. At the same time, we want to approach the NV center as closely as possible to maximize the spatial resolution. One option to approach both requirements is to decrease the kinetic energy of the beam electrons while keeping the current constant (see Appendix B for details). Assuming a kinetic energy of 200 eV and a beam waist radius of w=5 nm (corresponding to ∼ 6 nm beam diameter FWHM) [69,70], a distance of d = 15 nm to the NV − could be achievable. This value for the kinetic energy implies an average velocity of the beam electrons of v ∼ 8.4 × 10 6 m/s which is more than one order below the speed of light in diamond at optical frequencies (n ∼ 2.4 for the refractive index of diamond in the optical regime). Due to the distance dependence of electron energy loss to the diamond ∝ K 0 (2ωr ⊥ /v) [10], we find that the energy transfer to the diamond is strongly suppressed for all transition frequencies near and above the fundamental absorption edge of diamond (at ∼ 5 eV) for distances to the diamond surface r ⊥ 5 nm [71].
FIG. 14. a) Electron beam (red arrow) close to a 1d arrangement of NV − centers (blue diamonds) which could be created from nm-sized diamonds with single NV centers [72], e.g., deposited on a graphene sheet (black rectangle). b) Rabi frequency per beam current as a function of position along a the 1d arrangement of NV − centers for a temporally modulated beam with bunching parameter r b = 0.5 (blue curve) and two beams whose distance to the 1d arrangement varies with the resonance frequency, transversely to the 1-d arrangement as (x, y) = (d[3 + 2 cos(ω0t)], 0) (orange curve) and on a circle section as (x, y) = (d[1 + sin 2 (ω0t)/2], 2d sin(ω0t)) (green). The minimal distance to the arrangement is d = 15 nm. We assumed w = 5 nm and a kinetic energy of 200 eV. c) Probability for the electron beam not to excite the NV − center at the electric-dipole transition line of 1.945 eV during one Rabi flop for the three different beam configurations. The effect was averaged over the Gaussian profile of the electron beam.
Due to the non-relativistic velocity of the electrons and the negligibly small imaginary part for the dielectric function of diamond in the optical regime [71], we approximate the relation between the external electric field and the effective matter-assisted electric field in the diamond by using the relation for the case of a static charge in front of a dielectric [45] E int = 2E ext /(n 2 + 1) ∼ E ext /3 [73]. The probability for an incoherent transition of the electric dipole moment will be reduced accordingly by the factor (2/(n 2 + 1)) 2 in comparison to the probability for a transition with the same electric dipole moment of a quantum system located in vacuum. We find that the probability to excite the energetically lowest electric dipole transition at 1.945 eV during one Rabi transition would be less than 2% for a position-modulated beam (see Fig. 14c). The transition probability decays exponentially with increasing transition energy in this regime and higher energetic transitions would be even stronger suppressed. Then, the distance dependence of the Rabi frequency provides a pathway towards nano-scale spatial resolution as in aloof EELS [37]. While a temporal modulation of the beam leads to a decay as d −1 , a much stronger decay can be achieved by employing oscillations of the beam position to generate a driving signal. Then the oscillating near-field of a moving beam at the first harmonic and the second harmonic (twice the modulation frequency) scale effectively as d −2 and d −3 , respectively. At a distance of d = 15 nm to a 1-dimensional array of NV − centers (see Fig. 14a), adjacent NV − centers with a distance of ∼ 30 nm could be resolved, in principle (the spatial dependence of the Rabi frequency shows peaks of width ∼ 40 nm (FWHM)), see Fig. 14b).