Introduction

Over the last decade, kilometre-long hard X-ray Free-Electron Lasers (FELs)1,2,3,4 and its follow-up in-depth researches5,6,7,8 have opened an era for examining ultrafast structural dynamics associated with the diffraction of phase transformations, the making and breaking of bonds in solids, chemical reactions, and rapid biological processes. Recent researches on a semiconductor-based photocathodes9,10,11 have pushed the thermal emittance of electron beams down to few nanometer-radian at femtocoulomb bunch charges, resulting in MeV-class electrons produced by a gun having the transverse coherency close to the hard X-rays. Particularly, the strong scattering power of electrons12 enables observation of atomic and molecular structures at a low intensity that can be covered by a cost-effective and compact ultrafast electron diffraction (UED) facility. The MeV-class beam energy not only suppresses background noise from inelastic scattering and velocity mismatch efficiently but also increases penetration depth in a matter and accomplishes sufficient bunch charges at a short bunch length13. For instance, a few hundreds of electrons can be packed at a keV energy with a bunch length of 100 fs14 which is not enough to produce a diffraction pattern by a single-shot. However, MeV-class electrons effectively overcome this constraint, so up to \(10^6\) electrons can be filled in a bunch at the same length. This feature grants the utilization of a pump-probe technique that aims to image the structural changes happening in a sample after an interaction with photons (pump pulse) with a fine scanning of the structure at different time steps attained by adjusting the time-delay between pump and probe pulses. The MeV-UED accelerators have served numerous experiments in condensed media such as phase transitions15,16, electron-phonon coupling17 and thin film lattice dynamics18 for example with pico- and even femtosecond time scales. In the last years, progress has been made regarding the development of various UED techniques for the study of gas phase molecules19 and liquid phase samples20,21 as well.

One of the confronting challenges that MeV-class UED accelerators still face is the generation of extremely short bunches with consummately reliable stability in terms of transverse emittances and beam arrival time for achieving a high temporal resolution as well as sufficient lateral coherency. For obtaining a bunch length of sub-100 fs at a bunch charge of at least 100 fC, various schemes have been devised22,23 and experimentally demonstrated24. The fluctuation of elapsed time between pump and probe pulses so-called timing jitter \(\tau _{jitter}\), however, overwhelms the temporal distribution of electrons in a bunch, so it determines the temporal resolution of the whole system25,26 (see “Methods” for more details). Therefore, in modern UED facilities, the challenge tackled is to achieve an optimum temporal resolution by compromising both contributions as defined by Renkai Li et al.27. The existing facilities employ the method in which the phase of radio-frequency (RF) fields in a gun is adjusted to a slight off-crest value for obtaining the minimum bunch length, pushing the performance limit of the timing distribution system28,29. However, this approach is still fundamentally limited due to the enhancement of the jitter by setting the off-crest phase and an ultrashort laser pulse is required at the cathode. In the last years, several approaches have been developed to improve the time resolution in MeV UED facilities by compensating the Time-of-Flight (ToF) error using a sophisticated magnetic lattice. Two very recent studies30,31 proposed to use a RF gun in combination with a double bend achromatic optic to vanish the ToF jitter and they have demonstrated experimentally a time resolution of sub-50 fs (full-width-at-half-maximum, corresponding to 21.2 fs root-mean-square). In addition, a further study on multiple RF cavities in a beamline was presented by Franssen et al.32 for minimizing the arrival time and bunch compression at an initial beam energy of 100 keV. However, this model does not consider the electron beam dynamics in the electron gun, i.e. the emission of low-energy electrons from the cathode, the effects of RF to laser mismatch and the field fluctuations. Furthermore, the space-charge forces, which play a major role in low-energy beams, are neither included, making it difficult to apply in photoinjectors. Here we propose a new methodology to ameliorate the temporal resolution further by implementing additional cavities downstream while also including the complete acceleration process starting from the gun emission together with space charge effects. This scheme allows to free the gun cavity from the burden of a bunch compression and choose the best emission phase for suppressing the mismatch between the laser and RF fields. This shows that the gun itself can reduce the ToF jitter of electrons by a factor of more than 2 respect to initial timing mismatch in the cathode. The subsequent cavities downstream of the gun can increase the efficiency of the compensation by a factor of up to 6. In addition, multiple cavities permit the manipulation of electron distribution in longitudinal phase-space using linearization method based on the stretcher mode33. It can reduce bunch length further by compensating for a nonlinear distortion caused by space charge forces. We have obtained a bunch compression factor larger than 40, which corresponds to a bunch length of 22 fs for an initial drive laser pulse length of 1 ps, being this the minimum achievable laser pulse duration in the Sealab facility (see “Methods”). Since the injectors of energy recovery linear accelerators (ERLs) demonstrators (see “Methods”) produce intense electron beams of superior quality in 6-D phase space at an equivalent layout to our idea, this approach offers special scientific opportunities for these facilities (see “Methods” for more details). Our method applies to accelerator facilities with any type of cavities. However, given the capacity of superconducting injectors to operate with one bunch per RF cycle, the utilization of this method in accelerator facilities that involve superconducting cavities not only enables MHz repetition rate UED experiments for highly reversible processes in solids, such as electron plasma dynamics34, or even irreversible processes in gas and liquid phase targets, greatly increasing the signal-to-noise ratio, but also enhances the temporal resolution due to the stability provided by the SRF nature. Furthermore, the application of the method can be an important step towards enabling novel technologies that demand ultra-short and stable bunches with a high repetition rate e.g. external injector for plasma-wakefield accelerators35.

Results

Time-of-Flight Jitter

In UED facilities, the time delay between laser pump and electron probe pulses at a sample is defined by not only the relative arrival timing between two pulses but also fluctuations of the laser arrival time and the Time-of-Flight (ToF) of an electron bunch that are given by \(ToF = t_g + t_1\), where \(t_g\) denotes the time that electrons need to exit the gun as a function of emission phase and field gradient and \(t_1\) is the flight time in a subsequent space. The beam energy which is determined by an amplitude of electric field \(E_g\) and phase \(\phi _g\) of the gun governs \(t_1\). By sharing a laser on the cathode with the pump pulse on a sample, two events of electron ejection from the cathode and laser pulse on the sample become entangled naturally, resulting in the timing jitter \(\tau _{jitter}\) being determined solely by the uncertainty of ToF, i.e. \(\tau _{jitter} = \sigma _{ToF}\)36. Fluctuations of the amplitude and phase of RF fields cause beam energy changes that leads to a ToF variation which is inversely proportional to \(\gamma ^{3}\), where gamma denotes the Lorentz factor. Taking account of fluctuations of laser arrival time on a cathode \(\sigma _L\) and amplitude \(\sigma _{A_g}\) and phase \(\sigma _{\phi _g}\) of the RF field, the total mismatch \(\sigma _{RL}\) can be described by \(\sigma _{RL} = \sqrt{\sigma _L^2 + \left( \sigma _{\phi _g}/\omega \right) ^2}\). In the subsequent drift, the electron bunch ToF is governed by the energy \(E_g\), which is affected by the fluctuation of gun parameters, and the bunch accumulates a further ToF deviation with respect to the design value. The total jitter from the cathode to the end of the drift \(L_1\) is given by

$$\begin{aligned} \begin{aligned} \sigma _{ToF}^2&= \left( \frac{\partial ToF}{\partial A_g}\right) ^2 \sigma _{A_g}^2 + \left( \frac{\partial ToF}{\partial \phi _g}\right) ^2 \left( \omega \sigma _{RL}\right) ^2 \\&= \left( \frac{\partial t_g}{\partial A_g} - \frac{L_1}{m_0 c^3(\gamma _g^2-1)^{3/2}}\left( \frac{\partial E_g}{\partial A_g} \right) \right) ^2 \sigma _{A_g}^2 + \left( \frac{\partial t_g}{\partial \phi _g} - \frac{L_1}{m_0 c^3(\gamma _g^2-1)^{3/2}}\left( \frac{\partial E_g}{\partial \phi _g} \right) \right) ^2 \left( \omega \sigma _{RL}\right) ^2 , \end{aligned} \end{aligned}$$
(1)

where \(m_0\) is the rest mass of the electron and c is the speed of light. Using Eq. (1), the optimum phase and amplitude of a gun can be investigated. To calculate the partial derivatives \(\frac{\partial \Delta t}{\partial A_g}\), \(\frac{\partial \Delta t_g}{\partial \phi _g}\), \(\frac{\partial E_g}{\partial A_g}\) and \(\frac{\partial E_g}{\partial \phi _g}\), numerical simulations are carried out using Astra37. The ToF jitter normalized by the initial error \(\sigma _{RL}\) at the target position as functions of the phase and field gradient of a gun within achievable parameters for superconducting technology is shown in Fig. 1.

Figure 1
figure 1

Normalized ToF jitter at the target position as functions of the phase and field gradient of a gun. The 0.0 deg in \(x-\)axis represents the maximum energy gain in the gun. It is the same convention that is used for the electron emission phase from a cathode in Astra code. The parameter space is determined by achievable parameters for superconducting technology. It is calculated by using Eq. (1) with the partial derivatives \(\frac{\partial \Delta t}{\partial A_g}\), \(\frac{\partial \Delta t_g}{\partial \phi _g}\), \(\frac{\partial E_g}{\partial A_g}\) and \(\frac{\partial E_g}{\partial \phi _g}\) that have been emanated by numerical simulations using Astra code.

The result highlights three important aspects: firstly, the jitter can be minimized obviously by adjusting emission angles close to the on-crest phase, as it minimizes the bunch energy variation caused by the laser to RF mismatch. Secondly, it is more sensitive to the variation of the phase than the field gradient. Lastly, the higher the gradient, the better for decreasing jitter. For instance, an initial jitter \(\sigma _{RL}\) of 318.5 fs can be suppressed down to 138.2 fs with the optimum phase for a field gradient of 20 MV/m. However, for a ballistic bunching scheme that has a phase of − 12.31\(^\circ\) to compress the bunch length at about 7 meters downstream, the jitter rises slightly to 452 fs, which is consistent with the previous work27 and experimental results at UED facilities28,30. This has proven explicitly that extra cavities yield further suppression of the jitter below the minimum value by setting the RF phase to its optimum which is not feasible for a typical UED set-up with an electron gun only. This motivates the investigation of the effect of the cavities for the jitter compensation. The ToF jitter of a beamline composed of a gun and n-subsequent cavities with the corresponding drift spaces can be expressed as (see “Methods” for the derivation)

$$\begin{aligned} \sigma _{ToF}^2 = \left( \frac{\partial ToF}{\partial A_g}\right) ^2 \sigma _{A_g}^2 + \left( \frac{\partial ToF}{\partial \phi _g}\right) ^2 \left( \omega \sigma _{RL}\right) ^2 + \sum _{i=1}^{n} \left( \left( \frac{\partial ToF}{\partial \phi _i}\right) ^2 \sigma _{\phi _i}^2 + \left( \frac{\partial ToF}{\partial A_i}\right) ^2\sigma _{A_i}^2\right) , \end{aligned}$$
(2)

where the \(\sigma _{\phi _i}\) and \(\sigma _{A_i}\) are the phase and amplitude uncertainties of the i-th cavity, respectively. The partial derivatives of the ToF can be calculated respect to the amplitudes and phases of the cavities in a beamline.

The minimum jitters are investigated for the different numbers of cavities numerically and analytically with feasible layout based on Sealab parameters (see “Methods” for more details). The results are listed in Table 1 and shown in Fig. 2. For cases of a gradient of a superconducting electron gun of 20 MV/m and 25 MV/m, the optimum phases and amplitudes of the three successive cavities, as well as the gun, are calculated by using a basin-hopping algorithm38.

Table 1 Machine parameters for the minimization of ToF jitter in Fig. 2 with an initial jitter of \(\sigma _{RL} = {318.5} fs\), cavity phase stability of \(\sigma _{\phi } = 0.05^{\circ }\) and amplitude stability of \(\sigma _{A} = 1 \times 10^{-4}\, A\).
Figure 2
figure 2

Minimum achievable ToF jitter at the target position with extra cavities downstream of a gun. The calculations are performed with field gradients in the gun of 20 MV/m (red) and 25 MV/m (blue). The solid lines represent the values calculated by using Eq. (2) and the dashed lines represent the simulation results with error bars estimated by analyzing multiple iterations of the tracking simulation and one standard deviation from the result.

The results evidence that the three extra cavities, \(\mathrm {\left( n = 3 \right) }\), can push the limit of the jitter defined by the synchronization between the laser and RF field reduced by a factor of 5.7. This scheme is widely used in a photoinjector of ERL demonstrators which has a booster module downstream of the gun. The analytical formula in Eq. (2) quantitatively agrees well with the numerical results. As shown in Table 1, the emission phase in the gun has the optimum point close to the on-crest phase to minimize the laser to RF jitter influence in the ToF of the electrons. At the working points that lead to the minimum values, the final arrival time fluctuation is almost immune to \(\sigma _{RL}\) and is governed by the amplitude and phase fluctuations in the additional cavities. The compensation by increasing the field gradient in the gun is still effective for the case of none or one cavity available, but the difference diminishes when more cavities are involved.

Bunch compression with space charge effects

The time resolution in UED machines is not only determined by the ToF jitter but also depends on the temporal distribution of electron beams at a sample (see “Methods” for more details). This does call for the manipulation of electron distribution in longitudinal phase space to achieve a short bunch length at a sample by sacrificing the optimum phase calculated in the above section. Particularly, for the bunch length down to its limit, it is necessary to rectify a nonlinear distortion of the particle distribution in longitudinal phase space which is caused by space charge (SC) forces. The distortion is formed in the first meter after the gun since the transverse phase space of the beam is necessary to be tailored by a collimator with an opening of in the order of a few tens micrometres to acquire its desired transverse emittance, as the minimum achievable emittance without collimation is limited by the minimum laser pulse spot-size of 0.5 mm rms at the cathode39. The transverse emittances can be down to suitable value for obtaining a high-quality diffraction pattern, \(\epsilon _{x,y} \sim\) 30 nm rad, by selecting a fraction of the electron beams generated by a gun with a bunch charge of a few pC. The SC effect is investigated for the different initial bunch charges and the result is shown in Fig. 3.

Figure 3
figure 3

Particle distributions in longitudinal phase-space at the collimator position for various initial bunch charges. The electrons are emitted at on-crest emission phase with a maximum gradient of 20 MV/m, resulting in a kinetic energy of 1.61 MeV. The space-charge induced curvature contribution is added to the RF chirp imprinted in the gun which is clearly visible for the case without space charge. For the higher bunch charges, the split of two distinct cores in the phase space is observed, resulting in the increment of the energy spread and bunch length.

After the collimator, the bunch charge in the range of 50 fC with the MeV beam energy allows us to ignore the space charge effects downstream. Therefore, the nonlinear distortion only occurs in the section between the cathode and the collimator. The extra cavities downstream can be used to mitigate the effect of the distortion in the bunch compression. The normalized transverse emittance remains almost constant regardless of longitudinal bunch compression. Then, the cavities can contribute not only to reducing the jitter as explained in above section but also to giving adjustable parameters for the longitudinal phase space manipulation. A linearization method is adopted33 for rectifying the nonlinear distortion. The main advantage of the method is that the phase-space curvature caused by SC fields can be taken into account in the compensation of the distortion up to the third order. In addition, the linearization allows to use the on-crest emission from the gun to minimize the effect of \(\sigma _{RL}\) in the jitter and compress the bunch at the same time. With a linearization method, for the maximum bunch compression with on-crest gun emission, a minimum length of 22 fs at the interaction point can be achieved with an initial laser pulse length of 1 ps, providing a compression factor over 40. This clearly improves the compression that can be achieved with a single buncher cavity under the same emission conditions in the gun. The evolution of the bunch length for the three different schemes can be seen in Fig. 4. The bunch lengths at the target position together with the working points of the RF cavities for each case are shown in Table 2. Moving the target closer to the last cavity would improve the minimum achievable bunch length, but higher gradients are necessary for obtaining the high bunch compression factor. This would also increase the contribution to the ToF jitter given by the amplitude fluctuations. In any case, even if the target is located closer downstream from the last cavity, the shortest bunch length achieved with the buncher mode under the same initial conditions is still a factor 3 longer than the one achieved using the linearization method shown in Fig. 4.

Figure 4
figure 4

(LHS) Bunch length evolution of an electron bunch with SC forces. The collimator and target positions are indicated with vertical dashed lines. The grey shadowed areas represent the position of the cavities. The initial bunch charge is 3 pC and it is reduced to 50 fC after the collimator. The bunch length for different configurations is shown, always for a gun gradient of 20 MV/m. The red line shows the evolution of the bunch length for only gun, the minimum value at the target is achieved with \(\phi _g = -12.3^{\circ }\) for the given initial charge. The green line corresponds to the beamline with one additional cavity in which the emission from the gun happens in on-crest phase. Finally, the blue line shows the bunch length evolution for one of the linearization solutions with three extra cavities, using the same cavity amplitudes and gun phase that minimize the ToF jitter in Table 1. The zoomed image shows the difference between the bunch length at the target for the last two. The final energy is 2.22 MeV for the first two cases and 2.15 MeV for the linearization case. The increase in the rms bunch length at the aperture is given by the radial dependence of the longitudinal particle distribution caused by space charge fields. The outermost particles are collimated, leaving only the closer to on-axis particles which have a larger rms spread. (RHS) On the top side, the phase space of the electron bunch at the aperture position is shown colored according to the particle density for the two cases with shortest bunch length. On the bottom side the longitudinal particle distribution for the two cases is shown. For the linearized solution the maximum compression is limited by the higher order nonlinear distortions.

Table 2 Working point for the bunch length evolutions in Fig. 4.

The cavity parameters for the longitudinal phase-space curvature compensation, however, are not the same as the optimal working point of the ToF jitter minimization. The linearized bunch configuration results in a ToF jitter of 296.7 fs. It is dominated solely by the field instabilities in the cavities because the effect of \(\sigma _{RL}\) has been mitigated by the close to on-crest emission from the gun. Hence, reducing the instabilities directly reduces the ToF jitter. Overall, the correlation between bunch length and ToF jitter presented in27 for the only gun case can not be applied for our study since the addition of RF cavities along the beamline makes the analytical description of the bunch compression very challenging. To obtain the optimum time-resolution in UED experiments, compromised solutions are computed using the numerical simulations based on multi-objective genetic algorithm. For the different cases, the pareto-fronts which represent the set of non-dominated solutions, where each objective are considered as equally good are estimated and shown in Fig. 5. The trade-off between compression and jitter can be observed from the result.

Figure 5
figure 5

Compromised solutions calculated by multi-objective genetic algorithm40 for the optimization of the time resolution in UED accelerators. The red dots represent the pareto-dominant solutions for the beamline with only gun, the green dots represent the solutions for a single additional cavity and the blue dots represent the solutions for the beamline with the three additional cavities. The insert plot shows the zoom of the latest. The dashed lines represent the distance from origin to the closest point for each case, which gives the maximum time-resolution according to Eq. (3). The constrains for the optimization are that the initial laser pulse length at the cathode has to be longer than 1 ps, the initial rms laser spot size larger than 0.5 mm and that the electron bunch at the target must have a charge of at least 50 fC. The pareto fronts show that there is indeed a correlation between bunch compression and ToF jitter, both cannot be minimized simultaneously. For each magnitude the individually achievable minimum values are shown by the asymptotic behaviours of the ends of the pareto fronts, while the curve in between both ends represents the trade-off between them when both are minimized at the same time (better seen in the zoomed-in plot).

For instance, the optimum working point that minimizes the time-resolution while keeping an acceptable lateral coherence length with a final bunch charge of at least 50 fC leads to with a lateral coherence length of 3 nm (for a bunch spot size of 300 mm at the target) and a time resolution of 103 fs (being the last cavity field fluctuations the main contribution with 72 fs) with an initial laser to RF mismatch of 318.5 fs and laser duration of 1.0 ps. The resulting solution is a nearly linearized bunch at the target, with an on-crest emission from the gun. Hence, the scheme with the three cavities reduces the jitter by a factor of about 4 and compresses the bunch in time by a factor slightly above 10 at the same time, while the gun on its own is only able to reduce the bunch length by half without any gain for the jitter compensation. The effect of adding the extra cavities in the beamline improves the time resolution clearly.

Conclusion

In this study, we have proposed and demonstrated the new approach for improving the time resolution in UED experiments by implementing three additional cavities downstream of a gun, which is widely adopted in an SRF photoinjector of ERL demonstrators. This offers a new strategy to push the limit of the time resolution that has been constrained by state-of-the-art technologies for the ultrashort electron bunch generation from the photocathode and the synchronization between laser and RF cavity. Hence, synchronization between laser and RF fields is no longer the limiting factor in the arrival time jitter and short laser pulses at the cathode in the tens of fs are not required. The compensation of nonlinear distortion caused by space charge effects as well as time-of-flight jitters can be achieved by mastering the phase and gradient of the additional cavities. These milestones are achieved while keeping a large lateral coherence length at a sample for obtaining clear diffraction patterns with a bunch charge of about 100 fC by tailoring the transverse phase-space distribution of a few pC bunches using a collimator with a diameter of a few tens of micrometres. The initial conditions taken into account in the estimations are conservatively assumed, for instance, the maximum gradients on the cavities have been limited to values which are considered easily reachable (see “Methods”), but the real values are expected to be at least 50% higher. The time resolution in the studied method is limited by the field stability of the cavities. The LLRF control is expected to at least match the phase and amplitude instability values used here (see “Methods”), any improvement in the value of the fluctuations would automatically lead to smaller ToF jitter for every studied working point. As an example, reducing the cavity field fluctuations by a factor 2 from \(0.05^{\circ }\) to \(0.025^{\circ }\) would directly reduce the ToF jitter of the maximum time resolution working point from 91.21 to 43.45 fs, which would improve time resolution from 103 to 63 fs. Reducing the phase instability in the additional cavities even further would directly obviate the need of looking for a trade off between compression and jitter, as the on-crest emission combined with the linearization would directly provide the best achievable time-resolution. The latest LLRF control techniques have already proven cavity phase stability values as low as \(0.008^{\circ }\)41 for a normal conducting 1.3 GHz CW buncher cavity and \(<0.01^{\circ }\) for the 1.3 GHz superconducting linac42. The application of these values to the additional cavities in the beamline, while keeping the gun phase stability at \(0.05^{\circ }\), would increase the time resolution from the linearization solution in Fig. 4 to values below 60 fs. In this scheme, the last cavity contributes mainly to the time resolution with a jitter of 42 fs that can be improved by utilizing an isochronous optics. Further improvements in the phase stability would bring the time resolution to lower values, where the amplitude fluctuations in the cavity fields and the minimum bunch length given by the linearization would become the limiting factors. This highlights the advantage of the approach in this work, the capacity that the additional cavities provide to improve time resolution without the need of improving laser to RF synchronization or reducing the longitudinal electron bunch profile at the cathode. Furthermore, this opens a new opportunity for existing ERL photoinjectors as a new scientific case without significant modifications.

Methods

ERL demonstrators

Energy Recovery Linac (ERL) demonstrators are test facilities that aim to verify various physical and technical challenges in the generation, acceleration, transport and energy recovery of high brightness and high average current electron beams in a superconducting radio-frequency (SRF) linear accelerator. During the past decades, several ERL demonstrators have been built in the world43,44,45 and one of them, bERLinPro, is being currently commissioned in Helmholtz-Zentrum Berlin46. The layout of the ERL demonstrators follows a common design similar to the bERLinPro shown in Fig. 6. It consists of an injector with a photocathode gun and booster, the main linac, and the recirculator.

Figure 6
figure 6

Sketch of the ERL demonstrator in Helmholtz-Zentrum Berlin.

These demonstrators have completed the verification of core technologies and the scientific applications of such accelerators are being currently studied47. Besides working as test facilities, given the high brilliance and short bunch length that can be achieved, it could be used for Compton back-scattering experiments, THz radiation sources or, as in this case, time-resolved pump-probe experiments.

Sealab and the SRF photoinjector

Superconducting Electron Accelerator Laboratory (Sealab) in Helmholtz-Zentrum Berlin is a test bench for beam dynamics, control and instrumentation R &D of high average current, ultrashort and high brightness beams. The main beamline within the Sealab facility is an ERL demonstrator injector. A simplified sketch of the SRF Photoinjector beamline with the UED components can be seen in Fig. 7. The laser system provides green light between 510 and 540 nm and a Gaussian shaped longitudinal profile with rms pulse length in the ps range at the photocathode. The repetition rate of the laser system goes up to 1.3 GHz. The laser spot size at the photocathode is limited in the lower side to 0.5 mm rms radius top-hat distribution. It has a minimum pulse length of 1.0 ps and a Gaussian longitudinal shape. The semiconductor \(\mathrm {K_2CsSb}\) photocathode, which operates nominally with an incident wavelength of 520 nm, is located at the back-wall of a superconducting L-band (1.3 GHz) electron gun. The SRF gun operates in continuous wave mode and is designed for a maximum field gradient of 30 MV/m, but the measurements in a test-stand confirm that a gradient of up to 42 MV/m can be achieved in controlled environments. The main beamline elements following the way of the particles downstream the gun are a superconducting solenoid magnet (solenoid A); an aperture plate; three L-band superconducting booster cavities (field gradient up to 20 MV/m); a normal conducting solenoid (solenoid B); a target station for UED samples, located at \(\mathrm {z = {7.64}\,{m}}\); and a scintillation-based detector to record the resulting diffraction patterns. For this work, the maximum field gradients in the gun and the additional RF cavities have been conservatively determined to 20 MV/m and 10 MV/m, respectively, to make sure that the used values can be achieved in a beam operation.

Figure 7
figure 7

Sketch of the SRF photoinjector beamline with UED related components.

The working point of each RF cavity used in the beamline is subjected to fluctuations in amplitude and phase with respect to a reference signal given by a master oscillator. The fluctuations can be controlled by the feedback system of the LLRF control up to a certain point. The superconducting gun cavity has a phase stability \(\sigma _{\phi _g} = 0.05^{\circ }\) and an amplitude stability \(\sigma _{A_g} = 1 \times 10^{-4}\) A. The added cavities along the beamline have been measured in the test stand to have an improved phase stability of \(\sigma _{\phi } = 0.02^{\circ }\). However, for this work, the largest value \(\sigma _{\phi } = 0.05^{\circ }\) is adopted for all of them in principle. Furthermore, the laser timing jitter is of 300 fs, which together with the phase instability of the gun results in \(\sigma _{RL}={318.5}\) fs.

Time resolution

The time resolution \(R_t\) in a UED experiment defines the capability of discerning minimum temporal extension of the structural dynamics. This quantity can be expressed by a square root of the sum of the quadrature of the different contributions,

$$\begin{aligned} R_t^2 = \sigma _{pump}^2 + \sigma _{probe}^2 + \tau _{jitter}^2 + \tau _{vm}^2, \end{aligned}$$
(3)

where \(\sigma _{pump}\) and \(\sigma _{probe}\) stand for the rms length of the laser and electron pulses at a sample, respectively, \(\tau _{jitter}\) refers to the fluctuation in elapsed time between the arrival of two pulses, and \(\tau _{vm}\) represents the velocity mismatch. Typically, the pump pulse originates from the same laser that illuminates the photocathode to produce electrons. Thus, even if the properties of the laser pulse at two distinct positions are very different, they are inherently synchronized in time. The pump pulse can be converted to a different wavelength via a high harmonic generator and is guided through a delay stage to control the delay between two pulses. Commercially available laser systems can provide a pump pulse length as short as 10 fs. The velocity mismatch \(\tau _{vm}\) is given by the time difference originated by the different velocities of photons and electrons in the target material that need to reach the same depths. The quantity causes the elapsed time between the interaction with the photons and with the electrons to differ depending on the depth in the sample. MeV electron beam energies make this contribution to the temporal resolution neglectable compared to lower energy electron beams, in which the velocity mismatch can be the limiting factor48.

ToF jitter in a beamline with multiple RF cavities

Departing from Eq. (1), the effects of further cavities along the beamline can be modeled using the single-particle approximation. This approximation assumes that the electrons in one bunch receive the same energy acceleration in the cavity, but that, at the same time, their relative position inside the bunch does not change. This approximation is more precise for the high energy bunch. The energy gain in a cavity under this approximation can be interpreted as

$$\begin{aligned} \Delta E = A \cos (\phi ) = A \cos (\phi _{0} + \omega \Delta t), \end{aligned}$$
(4)

where A and \(\phi\) represent the amplitude and phase of the cavity respectively. The phase is defined with respect to the phase for the maximum energy gain at the moment in which the electron bunch crosses the cavity. This phase can be related to the ToF of the electron from the cathode to the cavity by the constant \(\mathrm {\omega = 2\pi f}\) and the phase \(\phi _{0}\) of the RF field at the time \(\mathrm {t={0.0}s}\). Figure 8 shows the sketch of the beamline between gun and target with an additional RF cavity in between.

Figure 8
figure 8

Sketch of the beamline with the elements that affect the time of flight jitter for the case in which only one RF cavity is used between gun and target.

Using the notation in Fig. 8, the total ToF of the electrons is the addition of time needed for the electrons to travel each drift section between the cavities. The beam energy at a given section is determined by all the cavity parameters upstream as

$$\begin{aligned} \begin{aligned} E_1&= E_g + A_1 \cos (\phi _{1,0} + \omega \left( \Delta t_g + \Delta t_1 \right) ) \\&= E_g + A_1 \cos \left( \phi _{1,0} + \omega \left( \Delta t_g + \frac{L_1 E_g}{c\left( E_g^2 -m_0 c^2 \right) }\right) \right) . \end{aligned} \end{aligned}$$
(5)

Considering that \(E_g = E_g(\phi _{g}, A_g)\) and \(\Delta t_g = \Delta t_g (\phi _{g}, A_g)\) are extracted from simulations, one can then calculate the ToF jitter as a function of the fluctuation in the cavity parameters \(\phi _g, E_g, \phi _{1,0}, E_1\) by error propagation:

$$\begin{aligned} \sigma _{ToF}^2 = \left( \frac{\partial ToF}{\partial A_g}\right) ^2 \sigma _{A_g}^2 + \left( \frac{\partial ToF}{\partial \phi _g}\right) ^2 \left( \omega \sigma _{RL}\right) ^2 + \left( \frac{\partial ToF}{\partial \phi _1}\right) ^2 \sigma _{\phi _1}^2 + \left( \frac{\partial ToF}{\partial A_1}\right) ^2\sigma _{A_1}^2 . \end{aligned}$$
(6)

The rms error of the cavity parameters are considered to be equal to the gun as they share the same LLRF control system. This same sketch can be directly extended to an arbitrary number of subsequent cavities. The energy after the n-th cavity is given by

$$\begin{aligned} E_i = E_g + \sum _{i=1}^{n} A_i \cos \left( \phi _{i,0} + \omega \left( \Delta t_g + \sum _{j=1}^{i}\Delta t_j\right) \right) . \end{aligned}$$
(7)

The time the electrons need to reach the end of the beamline is \(\mathrm {ToF = \Delta t_g + \sum _{n=1}^{i+1} \Delta t_n}\). The advantage of this approach is that analytical derivatives of the time of flight respect to the resonant cavity parameters can be calculated by deriving Eq. (7). One only needs the initial phases \(\phi _{i,0}\) and amplitudes of all the involved cavities together with the simulation results for the ToF and electron bunch energy at the exit of the gun. The final ToF jitter expression for n-cavities along the beamline is given in Eq. (2).

Lateral coherence length

The quality of a diffraction pattern is a combination of sample properties and instrumental factors. The study of favorable sample properties is beyond the scope of this work. The instrumental factors enclose the quality of the electron beam and that of the detection system. The quality of an electron beam for diffraction can be described by its coherence length. The lateral coherence length is a measure of the spatial coherence and is usually defined as:

$$\begin{aligned} L_{\perp } = \frac{\lambda }{2\pi \sigma _{\theta }} = \frac{\hslash }{mc} \frac{\sigma _{\perp }}{\epsilon _{n,\perp }}, \end{aligned}$$
(8)

where \(\lambda = h / \gamma \beta m c\) is the De Broglie wavelength of the electron, \(\sigma _{\theta } = \epsilon _{n,\perp } / \gamma \beta \sigma _{\perp }\) is the uncorrelated angular spread, \(\sigma _{\perp }\) represents the beam spot size in the transverse directions (x or y) and \(\epsilon _{n,\perp }\) is the normalized transverse emittance in the same direction. The lateral coherence length indicate the maximum distance between atoms/molecules in matter that can produce a diffraction pattern coherently. A criterion for generating a high-quality diffraction pattern in UED accelerators is \(L_{\perp } > d_{100}\), i.e. the transverse coherence length should be larger than the largest lattice spacing \(d_{100}\) of the sample.

Numerical simulation

The simulations shown in this work are performed using the Astra37 code that can compute macro-particle tracking numerically through user-defined electromagnetic fields with space-charge forces. The initial temporal and spatial distribution is a replica of an incident laser-pulse on a photocathode. The latest response-time measurement of semiconductor photocathodes49 shows almost an order of magnitude smaller values than a laser pulse length in SRF Photoinjectors, so this effect is ignored in our calculation. The transverse momentum distribution is chosen so that the normalized transverse emittance of the initial bunch matches the intrinsic emittance of measured for \(\mathrm {K_2CsSb}\) photocathodes39. The electrons are propagated along the beamline with the simulated field patterns for RF cavities and solenoids. The initial number of macro-particles in the electron bunch is set in order to ensure that at least \(1 \times 10^{4}\) macro-particles are still alive after the collimation to mitigate statistical errors. Simulations of Time-of-Flight jitter are performed tracking a reference particle from the cathode to the target with sufficient iterations (\(1 \times 10^{4}\)). This procedure is repeated for each working point and the rms spread of the time of flight is calculated accordingly. The fluctuations of the field phases and amplitudes in the cavities follows pre-defined Gaussian statistics. For the linearization of the longitudinal phase space using additional cavities, the non-linearity of the collimated beam collimation by using an aperture is estimated by fitting a third order polynomial. The analytical solution for the linearization is found by solving the equations in33 with the fitted polynomial. Once an analytical solution is found for the linearization, a particle tracking simulation is conducted to evaluate the space-charge effects. The analytical solution gives an initial working point for an optimizer. Then, numerical optimizations are used to search for the minimum achievable bunch length near the initial condition.