Analytical Scaling Laws for Radiofrequency Based Pulse Compression in Ultrafast Electron Diffraction Beamlines

In this paper, we use an envelope equation-based approach to obtain analytical scaling laws for the shortest pulse length achievable using radiofrequency (RF) based bunch compression. The derived formulas elucidate the dependencies on the electron beam energy and beam charge and reveal how to obtain bunches containing 1 million electrons with single-digit fs pulse lengths; relativistic energies are strongly desirable. The effect of the non-linearities associated with the RF curvature and the beam propagation in a drift is shown to strongly limit the attainability of extreme compression ratios. Using an additional higher frequency RF cavity is proposed as a method to linearize the bunch compression and enable the generation of ultrashort beams in the sub-femtosecond regime.


I. INTRODUCTION
Ultrafast electron scattering requires the generation of very short electron bunches to capture the fastest physical processes [1,2].Due to the repulsive effect of spacecharge forces, one critical challenge in this field is related to packing as many electrons as possible in a short bunch [3].In ultrafast electron diffraction (UED), pushing the electron energy to relativistic levels has helped in minimizing the space-charge effects, while at the same time bringing other advantages such as longer penetration depths, reduced group velocity mismatch, and suppressed inelastic scattering background [4][5][6][7].Over recent years, UED beamlines have seen continuous improvement in the achievable temporal resolution thanks to the introduction of techniques borrowed from accelerator physics based on the use of time-dependent radiofrequency (RF) electric field to compress the electron bunch during its propagation in the beamline [8].RF compression using 3 GHz resonant cavities has been applied to both nonrelativistic and relativistic electron beamlines for UED [9][10][11], yielding bunch lengths down to the single-digit fs in the latter case.
As we focus the discussion on the electron bunch length, one should also recognize that there are many factors other than the temporal duration of the probe pulse that contribute to the actual temporal resolution limit in a specific UED setup such as temporal jitter, group velocity mismatch, laser pulse length.For example, to counteract the additional temporal jitter introduced by RF-based compression, naturally synchronized laser-generated higher frequency waves have been used to impart an energy chirp on the beam in more complex coupling structures and drive the compression dynamics [12,13].
In any case, though, to push the boundary of the UED technique, it is important to fully understand the lim-its in beam compression and how the various beamline parameters such as charge, energy, cavity voltage, and frequency affect the shortest bunch duration achievable.The minimum bunch length at the sample is the result of a complex interplay between the details of the bunching dynamics and the longitudinal space-charge forces in the beam so that typically UED practitioners have resolved to particle tracking simulation codes to design the beamline and predict the beam dynamics.The agreement with experimental results has been excellent [14], but particle simulations only deal with specific beamline setups, typically lack generality, and might not offer an immediate answer to the question of how to improve the compression in a given configuration.
It would be extremely useful to have a unified formalism for the treatment of the beam dynamics in RFcompression UED beamlines.This is the scope of this paper, which makes use of the longitudinal envelope equation formalism to include both the effects of longitudinal emittance and space-charge forces on the pulse evolution.The important contribution of the non-linearities in the beam compression is taken into account as an additional term in the longitudinal beam emittance.The result is an elegant analytical formulation for the minimum bunch length at the longitudinal waist which can be used to guide the simulation optimization, to compare parameter choices at different facilities, and more importantly to evaluate mechanisms for further improving the bunch length.
The simple cartoon in Fig. 1 is used to illustrate the dynamics under study.Essentially, a finite length electron beam is set to arrive inside an RF buncher cavity where electromagnetic fields oscillate with angular frequency ω = kc at the zero-crossing phase.Ideally, the input bunch length satisfies kσ z << 1 so only a small phase window of the wave is sampled by the beam and the chirp imparted on the beam is predominantly linear.However, in our discussion, we will keep the higher-order terms in the energy modulation expansion to elucidate the role they play in the final bunch length.In the propagation region after the buncher, due to the strong energy FIG. 1. Illustration of RF ballistic bunching scheme.A velocity chirp is imparted on an electron using an RF cavity so that the tail of the beam has higher energy than the head.During the following drift the particles in the tail catch up with the particles in the head resulting in strong longitudinal compression chirp, the tail of the beam begins to catch up, while the head of the beam slows down.At some location downstream of the buncher, ideally arranged to be the sample plane or the interaction point of the UED experiment, the minimum bunch length is reached when the phase space distribution is vertically aligned.We will strive to keep all the formulas in the paper as general as possible (for example, not assuming β = 1) so that they could be applied to general RF compression setups (non-relativistic, MeV UED beamlines, as well as higher frequency compression schemes) once the parameters are scaled accordingly.For this reason, we will use two different example cases, loosely based on the UED beamlines at the UCLA Pegasus laboratory [10], to benchmark the agreement between the analytical framework and particle tracking simulations.The reference parameters used for this study are reported in Table I.
The main goal of this work is to provide simple and general expressions that can be used to evaluate the minimum achievable bunch length in a given beamline.In practice, we will first introduce the envelope equation formalism to describe the evolution of the bunch duration through the system.In the approximation that the buncher can be represented as a thin lens, we will then compute the leading contribution to emittance growth and analyze the ballistic dynamics in the drift in the absence of space-charge.We will then include the space-charge repulsion term in the envelope equation first assuming a Gaussian temporal profile for the beam and show how this sets the ultimate limit to the minimum achievable bunch length.Finally, we will expand the formalism to describe different current profiles and discuss the possibility of non-linearities compensation through the use of an additional higher frequency RF cavity to reach sub-fs bunch lengths as first proposed in Floettmann [15] II.LONGITUDINAL ENVELOPE EQUATION A. Envelope equation Among many possible choices for defining bunch duration (full width half maximum FWHM, full width containing 50 % of the charge FW50, etc.), in our discussion, we select the second-order moment of the longitudinal profile or root mean square (RMS) bunch length as the main quantity to follow the evolution of in the RF compression beamline.This is defined as: where z is the longitudinal particle coordinate relative to the center of the bunch.... represents an expectation value over the beam distribution function f (z, z ), and z is the relative velocity deviation from the average beam velocity.All the other definitions (FWHM, FW50, etc.) are simply proportional to the RMS bunch length using a proper order-of-unity pre-factor which depends on the beam distribution.The RMS beam size evolves along the beamline coordinate s according to the equation [16]: where the quantity 2 z,z is the square of the RMS longitudinal trace space emittance, explicitly written in terms of the distribution moments as: It is well known that this quantity is conserved during transport if the forces acting on the particles are linear in the (z, z ) coordinates [17].
Ideally, the longitudinal equation of motion is uncoupled from the transverse coordinates.On the other hand, the force acting on the particles might have a transverse dependence (i.e.z = F(z, r, s)) and in general the first term on the right side of Eq. 2 will be proportional to zF(z, r, s) .Heuristically, we separate the contributions to the longitudinal force into a term associated with the external RF fields and a term proportional to the beam current which encodes the effect of the space-charge force i.e.F = F RF + F sc .The latter, after averaging over the beam transverse distribution, will bear a dependency on the RMS transverse size σ r , effectively coupling the longitudinal and transverse envelope equations.
In most practical cases we can model the RF buncher as a thin lens and F RF (z) simply provides an impulse force proportional to δ(s).In this case, the only effect of the RF buncher is to modify the initial conditions for the envelope equation through the application of a negative energy modulation to the phase space which causes the beam to begin the bunching process (i.e.σ z0 < 0).If the applied energy chirp is non-linear (which is the most common case), particular care has to be applied in evaluating the longitudinal emittance and the initial conditions at the exit of the buncher.
Meanwhile, the space-charge term zF sc (s, σ z , σ r ) will act over the whole time of flight in the drift following the buncher.To first order, this term is related to the Taylor expansion of the space-charge-induced longitudinal electric field near the center of the bunch.We will discuss this in detail at a later section of the paper, but to orient this initial discussion we can anticipate some of the results derived below.Typically this term can be evaluated analytically for simple longitudinal distributions and simply written as where K l ∝ gN r c /β 2 γ 5 is the longitudinal perveance, which is comprised of the classical electron radius, r c , the number of electrons in the bunch N , and g is a geometry factor which depends on the beam aspect ratio.
In what follows, we will assume a constant transverse RMS spot size for the beam and simplify the s and σ r dependencies in K l , which allows solving the longitudinal envelope equation independently from the transverse dynamics.Somewhat surprisingly, this crude approximation works fairly well since if the initial bunch length in the beam rest frame is sufficiently long, the space-charge term is only weakly affecting the dynamics and can be neglected.However, the space-charge effects eventually begin to matter as we close in on the optimal bunching conditions.In addition, it is important to note that whenever the charge density is sufficiently high, the nonlinearities in the bunch self-fields will cause emittance growth during the propagation.This is the situation where our approach of solving the envelope equation assuming a constant longitudinal trace space emittance falters.In this case, one will need to resort to a kinetic approach where each particle trajectory is self-consistently tracked in the field generated by the charge distribution.Nevertheless, this situation should be avoided at all costs if ultrashort bunch lengths are desired, and the effects of space-charge must be kept relatively small.Therefore the analytical model where only the first-order linear spacecharge contribution is taken into account does provide an excellent approximation for the shortest bunch lengths achievable with RF compression.

B. Solution in a drift
Let us start the discussion from the simplest and physically relevant case in which the propagation occurs in a drift and space-charge forces can be neglected, i.e.F = 0.The shortest bunch length along the line can then be found recasting Eq. 2 as: which can be integrated exactly: The waist position is a local minimum for σ z , thus we can set σ zf = 0.If the RF buncher imparts an initial condition σ z0 ≈ − σz0 f so that the longitudinal waist is reached after a propagation distance f , we have where we neglected the term

C. Single particle dynamics and non-linear phase-space correlations in the RF buncher
Let us now look more closely at the details of the negative energy chirp imparted by the RF buncher on the beam distribution.The main assumption here will be that the cavity fields act on the electrons by adding a sinusoidal energy chirp which depends on the particle position within the bunch: where α = eV 0 /mc 2 and eV 0 is the cavity voltage or maximum energy gain seen by an ideally phased particle, and k = k 0 /β is the RF angular wave number divided by the normalized longitudinal velocity.The phase of the cavity is tuned so that the center of the bunch experiences no net energy gain and a predominantly linear energy chirp is imprinted on the bunch.Particles at the tail gain energy, while particles at the head of the bunch lose energy resulting in the compression dynamics in the following drift.
There are two distinct sources of non linearities in the trace space dynamics resulting from the applied energy change to the particles.Firstly, for finite duration input bunches, the curvature of the RF wave will cause significant non linear effects in the trace space.In addition, the relativistic relation between normalized velocity and beam energy β = 1 − 1/γ 2 adds an important degree of non linearity to the transport as pointed out in Zeitler et al. [18].Taylor-expanding the relative velocity deviation ∆β β in terms of the energy deviation we can write where η m are proportional to the mth-derivatives d m dγ m β and in particular where γ and β are the mean values of the normalized energy and velocity distributions respectively.The coefficients η m scale as γ −(m+2) so that at high relativistic energies the higher order non linear terms in the transport can be neglected.
If we are interested in the lowest order dynamics, we can simply replace sin(kz) with kz − (kz) 3 6 , and truncate the series after the first three terms to obtain the correlation of the velocity deviation with the initial particle position which can be written as: ) where z 0 is the input particle longitudinal coordinate.We verify this expression at high energy (4.6 MeV) and low energy (150 keV) by considering a particle tracking simulation of the buncher configuration listed in Table I with an initial bunch length of 195 µm and 1.87 mm respectively.The buncher was modeled by a standing wave cylindrically symmetric TM010 cavity with an amplitude adjusted to reach a longitudinal focus 1.88m and 1m downstream respectively for the high and low energy cases.Since the cavity length is less than 0.05 m, it is reasonable to approximate it as a thin lens.The longitudinal phase spaces from GPT at the exit of the buncher are shown in Fig. 2(a) and 2(c) for the high and low energy case respectively with subtracted linear correlations.The quality of the agreement between GPT and our analytical framework can be assessed by comparing the distributions with the lines corresponding to Eq. 11 which are also shown.The parameters chosen for these examples highlight the different possibilities for the dominant non-linearity in the system.In the high-energy case, the relativistic effects are responsible for the parabolic shape seen in the simulation.While in the low energy case, the injected bunch length is longer and the third-order nonlinearity associated with the sinusoidal RF fields is the main effect in the beam distribution shape.
The convenience of working in the trace space is the linearity of the dynamics in the drift which fully preserves the phase space area.Explicitly, in the drift after the buncher, the longitudinal particle position can be written as The initial coordinate z 0 is expressed in terms of the induced energy modulation ∆γ by inverting Eq. 8. Then ∆γ is Taylor expanded in terms of ∆β/β.Substituting into Eq.12, keeping only terms up to third order, we can write: The longitudinal waist occurs where the linear chirp is cancelled at distance s = 1 η1αk along the beamline allowing us to define the buncher longitudinal focal length: which indicates that very high voltage cavities are needed to obtain short focal lengths with relativistic electrons.It is also useful to note the k-dependence of this expression which suggests the use of very high frequencies for this application.
At the focal plane, the residual correlation is quadratic or cubic in ∆β depending on the relative importance of the non-linearity in the drift propagation concerning the RF curvature.As discussed above, lower beam energies and longer input bunches tend to show higher third-order non-linearities, while relativistic energies typically have dominant second-order contributions.The predictions from Eq. 13 can be again verified by comparing to the phase spaces at the temporal waist plane from the same GPT simulation, as shown in Fig. 2

(b) and (d).
D. Emittance growth mechanisms and the relationship between different longitudinal phase space definitions.

(z, z ) trace space emittance
Since the drift dynamics in the trace space are entirely linear, and the emittance growth is all accrued in the buncher, the envelope equation formalism is a convenient choice to follow the RMS bunch length evolution.To evaluate the RMS emittance growth induced by the RF compressor, we start from an initial longitudinal phase space with RMS emittance z0,z 0 .After the energy chirp is applied, then the single-particle velocity variation maps as z 0 → z 0 + ∆β/β, where ∆β/β represents the velocity variation imparted by the buncher, which is correlated with particle position.In the thin lens approximation, the particles do not change position as the beam goes through the cavity.
The moments of the new distribution can be calculated and the relation between initial and final emittance after the buncher written as Note that each respective expectation value needed to calculate the emittance, with the exception of z 2 0 = σ 2 z0 , requires integrating sin m (kz) or z sin m (kz) over the beam distribution.Assuming an initial gaussian current profile, these integrals have closed-form expression up to arbitrary order of m, but the leading contributions to the emittance growth can be obtained simply expanding sin(kz) ≈ kz and using the second-order term in the expansion of ∆β The result is: In most cases, this expression is much larger than the initial longitudinal emittance because the buncher is fundamentally inducing a large velocity spread (with correspondingly large non-linear contributions) to achieve compression.As long as the space-charge forces are negligible in the drift, RF is also equal to the final emittance and can be used to calculate the limit for the shortest bunch length at the focus in Eq. 7. The emittance growth in the buncher and its preservation in the drift can be seen in Fig. 3, where the trace space RMS emittance evolution calculated from GPT is plotted along the beamline.The final emittance after the short buncher cavity at the origin is well approximated by the analytical formula 15 which is represented by the black dotted line.
FIG. 3. Comparison between analytical estimates (dashed lines) and GPT simulations (solid lines) for an initial bunch length of 0.65 ps.The trace space emittance after the buncher is shown in blue, and emittance growth in (z, δ) phase space in orange.

(z, δ) phase space
It is important to note at this point that if instead, we had utilized the more common choices of defining the longitudinal trace space in terms of the relative energy spread δ = ∆γ γ or momentum spread ∆p z /p z , the drift dynamics would become highly non-linear especially for mildly relativistic particles.
Initially, the trace space emittance z,z is related to the (z, δ) emittance by the following relationship: z0,δ = γ 2 β 2 z0,z 0 (16) This relationship holds because z ≈ η 1 ∆γ and explains the order of magnitude difference in absolute emittance values in Fig. 3.It is then fairly common to see in the literature the envelope equation written in terms of the (z, δ) emittance: Nevertheless, in a drift, the particle positions evolve according to Eq. 12 where the transport is inherently nonlinear, especially for mildly relativistic particles, causing emittance growth and limiting the usefulness of the envelope equation approach.Ultimately, for large enough initial energy spreads, the higher-order terms proportional to η m lead to significant (z, δ) emittance growth which can be estimated using the same techniques as in the previous section where z0,δ0 is the emittance at the beginning of the drift.For a small initial emittance, this expression predicts a nearly linear growth with propagation distance.This is shown in Fig. 3 where we also show the (z, δ) phase space evolution from GPT and compare it with Eq. 18 with the inclusion of the initial emittance as well.
The seemingly counterintuitive behavior of the longitudinal emittance (which grows linearly in the drift) is the main reason for us to adopt the (z, z ) trace space emittance in the calculation of the final bunch length when using the envelope equation formalism.Finally, for completeness, we observe that if the un-normalized momentum (z, ∆p z /p z ) was used as a trace space variable, all expressions could be simply modified substituting z = 1 γ 2 0 ∆p z /p z .Nevertheless, due to the relativistic non-linear relation between momentum and velocity, even in this case, one would have significant emittance growth in the drift propagation.

E. Bunch length limit in absence of space-charge effects
We are now in a position to discuss how the minimum achievable bunch duration scales with the main beamline parameters.Inserting the trace space longitudinal emittance estimate (Eq.18) into the envelope-equation formalism (Eq.7), we get an expression written as the quadrature sum of the different contributions to the final emittance between i) the initial uncorrelated relative energy spread σ δ , ii) the non-linearities introduced by the relativistic correction to the transport or iii) the RFinduced emittance.
Note that for practical reasons (related to the requirements of the sample chamber, pumping geometry, transverse optics), the focal length of an RF buncher is typically 1 m long or less in most setups.Therefore, in order to facilitate comparison between beamlines of different energies, we can rewrite the terms as a function of the focal length of the buncher.Assuming that one term in the sum is much larger than the others, we can synthesize this result as: Note that the full quadrature sum of these three expressions should be used in those cases where two or more contributing terms have similar magnitude.
In the absence of non-linearities in the transport, the final bunch length would be simply proportional to the initial relative velocity spread σ z0 .Note that for the same uncorrelated relative energy spread σ δ , a MeV energy system has a clear advantage in this case in the ability to achieve ultrashort bunch lengths.
At the same time, as the energy increases, it is most likely that the non-linearities due to the relativistic dynamics in the drift would become the dominant contribution to the final emittance and bunch length.In this regime, after approximating η 2 /η 2 1 ≈ 3/2γ 2 and use the definition of the focal length (Eq.14) the final bunch duration scales as the square of the beam energy.For longer initial bunch lengths, the curvature of the RF dominates the shape of the final phase space and sets the limit for the shortest bunch duration achievable.This contribution is important for both relativistic and non-relativistic energies and it strongly favors the use of lower RF frequencies.In all THz compression experiments carried out so far this term has been the main limit to the final bunch length.
The analytical formulas summarized in Eq. 19 were found in excellent agreement with GPT in both the relativistic and non-relativistic regimes.The results are shown in Fig. 4 top and bottom for the 4.6 MeV and 150 keV cases respectively.In the low energy case, the cubic non-linearity due to the RF curvature dominates for longer initial bunch lengths.
In the absence of space-charge, the shortest bunch durations are obtained by minimizing the emittance growth in the temporal lens which can be done by using very short input beams.At the same time, as we will see, decreasing the initial bunch length also increases the initial peak current so that the space-charge effects in the longitudinal envelope equation can no longer be neglected.At a certain point, space-charge effects begin to take over and prevent further bunch compression.Thus, there must be an optimum initial bunch length to inject which exactly balances the RF and space-charge emittance growth.We address this in the following section.

III. SPACE-CHARGE LIMITS TO COMPRESSION A. An example of geometry factor calculation: Gaussian distribution case
To add in the envelope equation formalism the effect of the space-charge on the bunch length evolution, we need to compute a reasonable representation for the zF sc (z, σ z , σ r ) term.For a first-order estimate, it will suffice to retain the linear term in the longitudinal electric field felt by an on-axis particle in the bunch core.As space-charge effects become more important, the emittance growth caused by the higher-order terms in the profile of the electric field makes the envelope equation approach less useful for describing the bunch evolution and one would need to go back to self-consistent particle tracking simulations.To validate all of the estimates made in what follows, we simulate the bunching process utilizing GPT's spacecharge3Dmesh algorithm using the nominal beam parameters shown in Table I and a beam charge of 16 fC (10 5 electrons).
For simplicity, we will start deriving the self-field of a cylindrically symmetric Gaussian beam assuming that the distribution function retains a Gaussian profile throughout the system.Admittedly this approximation is especially poor at the waist where the linear chirp is removed and what remains is a non-linear distribution in trace space with a characteristic current spike and a temporal profile strongly asymmetric and far from a regular Gaussian.Nonetheless, the linear force obtained below can at the very least be used to estimate the turning point in the system to understand when space-charge effects can no longer be neglected.The charge density in the beam rest-frame can be written as: In order to obtain the linear components of the electric field, we Fourier transform the charge density and write the potential as ) where ρ is the Fourier transform of the charge density which has also gaussian shape.
We can then expand the exponential to second order in (k • r).After dropping the constant term which is immaterial for the field profile, we also note that the first term vanishes by symmetry of ρ.The second order term yields the uncorrelated linear electric field components for a gaussian bunch distribution which, after performing a series a gaussian integrals, can be written as: where A = σ r /σ z is the beam aspect ratio (in its rest frame).The predicted field gradients are found in very good agreement with core field gradients extracted from GPT simulation as shown in the example in Fig. 5(a).The geometry factors (plotted for reference in Fig. 5b) are given by: where To take advantage of this result, we must first express the longitudinal electric field just calculated in the beam rest frame, in terms of laboratory frame quantities, which can be done by rescaling the longitudinal coordinate and RMS moments by γ, i.e, E z (γz, γσ z , σ r ) .The generalized force term is then determined noting that z = γ /γ 3 β 2 and then γ = eE (1) z /mc 2 .Putting all together, the space-charge term in the envelope equation can be written as: where g(A) = 2/πv(A) is an order of unity factor which takes into account the geometry effects, r c is the classical electron radius and N the number of electrons in the bunch and we have defined the longitudinal perveance K L as anticipated in the first section.
As anticipated, the dependence of the geometry factor g(A) on the beam aspect ratio requires to self consistently solve the transverse and longitudinal envelope equations as a coupled system.Since we are mainly interested in longitudinal dynamics, in this paper we will greatly simplify the transverse evolution and simply assume a slowly varying transverse RMS spot size along the beamline.To take into account the evolution of the aspect ratio during the compression, we are then left with two choices: i) either include in the longitudinal perveance term the entire dependence on the aspect ratio (which is evolving as the beam is compressing) and resort to numerical integration, ii) or pick a reasonable value for g and assume it constant for most of the beamline which allows a direct integration for the bunch length evolution.This approximation turns out to be quite acceptable as for much of the bunching process, the space-charge effects are negligible and will only turn on near the waist when the beam density reaches a maximum.To this end, we can evaluate g at the mean aspect ratio over the beam propagation distance neglecting space-charge i.e.

Ā(σ
where we highlight the dependence on the initial bunch length.We can then utilize g( Ā) to integrate analytically the envelope equation.Assuming a transverse RMS waist σ r at the buncher and an RMS divergence σ θ , the aspect ratio as a function of drift distance can then be written as: where σ 2 z0 , σ zz and σ 2 z are the longitudinal beam matrix element at the exit of the buncher.Although the space-FIG.6.Comparison of aspect ratio from theory and GPT.
charge fields are going to ultimately change the mean value of the aspect ratio, the difference is not significant when space-charge is only mildly influencing the dynamics (as we will see this is the case close to the optimum), as shown in Fig. 6, where Eq. 27 is compared with GPT using an initial bunch length of 67.5µm.There is some disagreement between the location of the peak and the maximum value due to the space-charge, nonetheless, the mean values are within 3% of each other.

B. Effect of the longitudinal space-charge force on the minimum bunch length
Using these results, the longitudinal envelope equation in presence of space-charge can be written as: where K L is the longitudinal perveance as defined in Eq. 25.
Following the same steps that led to Eq. 7 we can directly integrate to calculate the bunch length at the waist, obtaining: where we have once again assumed that the initial bunch length is much larger than the final one.
In the limit of K L very small, Eq. 29 yields back the zero space-charge solution discussed in the previous section.Conversely, if space-charge dominates the bunch length evolution one can expand the formula for large K L to get which is linear in the bunch charge, but most importantly decreases as σ 2 z0 driving the initial bunch length towards larger values.Note that if by some clever scheme (for example by pre-compensating using an X-band RF cavity as discussed in the last section of the paper) the RF emittance growth in the buncher is eliminated, a longer initial bunch length could be used, reducing space-charge effects and potentially allowing to reach very short bunch lengths.
The optimal initial conditions are thus found as a compromise between the tendency to minimize the emittance growth in the buncher and to reduce the space-charge effects lowering the initial peak current.An estimate for the ideal initial bunch length can be obtained by equating the asymptotic dependencies of the waist size in the space-charge dominated regime and the emittance dominated regime respectively.The color-coding of the particles is a function of the radial coordinate (blue corresponds to on-axis particles).c) Evolution of the emittance along the line.The growth observed in GPT is due to the non-linearities of the space-charge field.d) Final emittance in GPT as a function of initial bunch length.The relative importance of the space-charge contribution to the emittance can be inferred by subtracting the expected emittance growth due to the buncher dynamics non-linearities.The cross-over point (where space-charge becomes the dominant effect) can be used to estimate the optimal injection condition and hence the minimum final bunch length achievable for a given setup.
For example in the case where the RF emittance is dominated by the quadratic non linearity, we can set Eq. 30 equal to the second expression in Eq. 19, and the optimum initial bunch size is given by the solution of the implicit equation: This result can be substituted into Eq.29 yielding for the minimum bunch duration at the temporal waist: In the high energy limit (γ 0 1) In Fig. 7(a) we show the final waist as a function of the injected bunch length obtained from GPT, and overlay Eq. 29 for the case when the total charge is Q = 10 5 e = 16 fC.The dashed black line is the estimate obtained from Eq. 32, which predicts an RMS size of 0.7µm, in excellent agreement with the GPT prediction at 0.6 µm.In Fig. 7(b) the phase space at the waist for the optimal injection case is shown.The quadratic correlation in phase space is still visible, but an imprint of the space-charge field begins to show up as well.spacecharge effects are essentially negligible for large enough initial bunch length.When the initial bunch length is smaller than the optimum, i.e. in the space-charge dominated regime, the size at the waist begins to grow significantly, and unaccounted non-linear space-charge effects begin to play a role.
Thus far, we have completely neglected the non-linear space-charge field contributions to the envelope evolution.Eventually, these terms will become significant as we consider initially shorter bunches leading to large emittance growth thus disrupting the applicability of the analytical result which has been obtained assuming a constant emittance in the drift.This is elucidated in Fig. 7(c) and (d), where we show the trace space emittance evolution for the optimum compression case, and the final emittance as a function of input bunch length respectively.In (c), it can be seen that the emittance first increases to the predicted value after the buncher due to the RF non-linearities.After the buncher, the emittance keeps growing in the drift due to space-charge effects.In (d), the emittance calculated from the theory (Eq.15) is shown along with the final emittance at the waist.The emittance growth induced by space-charge is estimated by subtracting in quadrature the theory from the GPT results.Therein, it can be seen that the optimum input bunch length (60 µm in this case) occurs at the onset of emittance growth from space-charge.Eventually, as the initial bunch length is further decreased, the emittance growth is dominated by space-charge.
In Fig. 8(a), we show a comparison of Eq. 32 with GPT simulations performed while setting the initial bunch length to Eq. 31 as the charge is varied from 10 5 e → 10 6 e.Again, the agreement is excellent.In Fig. 8(b), we utilize Eq. 32, to visualize the dependence on energy and charge when the focal length of the bunching system is set to 2 m.Note that due to the energy dependence intrinsic in the focal length, as we increase the beam energy, keeping the focal length constant becomes a technological feat involving considerations of the breakdown limit in RF cavities as well as available power sources at higher frequencies.
To go beyond these limits, one would need to reduce the space-charge effects (working to either minimize the geometry factor g in the longitudinal perveance, and/or utilize a charge distribution with more linear self-fields) or minimize the emittance growth in the buncher, for example, pre-compensating for the non-linearities in the input phase space.Both options are in principle feasible and are the subjects of the last two sections of this paper.

IV. BUNCH COMPRESSION LIMITS FOR DIFFERENT CHARGE DISTRIBUTIONS.
So far we have been assuming a Gaussian temporal profile for the input electron bunch.It is worth investigating the prospect of a more ideal phase space such as the uniformly filled ellipsoid with transverse and longitudinal dimensions a and z m respectively.An analytic derivation of the bunch length limit can be performed in this case as well.For this, we will adopt the notation of [16].The line charge density for this distribution can be written as: where z m is related to the RMS size of the beam as z m = √ 5σ z , and likewise a = √ 5σ r .Repeating the calculation from section II D 1 to calculate the induced RF emittance at the exit of the buncher with this line charge density yields: similar to what was previously calculated but smaller by a factor 4  7 .This is because, for the same RMS bunch size, the parabolic current profile extends over a smaller interval of RF phases than the long-tailed gaussian distribution, thus reducing the associated RMS emittance growth.
The perveance and geometry parameter of the longitudinal field evolution have been derived for this distribution as well.The geometry parameter is twice the one obtained for the gaussian distribution, i.e., v u (A) = 2v(A).The longitudinal field is given by: Then the generalized longitudinal force derived from this field yields the perveance: where now, g u (A) = 3v(A)/5 √ 5. Note, that for the same aspect ratio as the gaussian, the ratio g u /g ≈ 0.33, indicative of enhanced compression performances.Both the prefactors of the RF emittance growth and the perveance are smaller than those obtained for the Gaussian, so using this distribution, substantial improvements are expected.To this end, we can use this perveance factor and by equating Eq. 30 to Eq. 7, while only keeping Eq. 35 as the leading contribution to the emittance, we can again obtain an estimate of the optimum initial bunch length.
We repeated for this case the benchmarking simulation study by initializing in GPT a uniformly filled ellipsoidal distribution with optimal input bunch length and comparing the results with the analytical predictions as a function of beam charge.The results of the scan are shown in Fig. 8 (a).Compared to the gaussian current profile, this distribution allows nearly an overall factor of two improvements in optimum bunch length, consistent with the expectations.

V. X-BAND CAVITY COMPENSATION
Another option that we consider to obtain even shorter bunch lengths is the utilization of a second higher frequency cavity to compensate for the curvature imparted on the longitudinal phase space by the RF buncher fields and minimize the emittance growth.
Before analyzing this case in detail, we note that our discussion so far has assumed an initially flat and uncorrelated longitudinal phase space.In a realistic system, the beam out of the gun would typically present already some correlations (often of non-linear nature) between energy and time along the bunch.Here we use a simulation starting from the cathode to allow a detailed study of the compensation with a realistic input longitudinal phase space.
For this section, the setup is closely mimicking the configuration of the UCLA Pegasus beamline [19] consisting of a 1.6 Cell S-band (2.856 GHz) gun, followed by an Xband (9.6 GHz) cavity situated at 1.1 m from the cathode for longitudinal emittance compensation, then following that is an S-band (2.856 GHz) 11 cell linac operating as a buncher.The buncher entrance is 1.4m downstream of the cathode.An illustration of the beamline is shown in Fig. 9(a).
In practice, the optimization begins by initially finding the amplitude and phase of the X-band compensation cavity to cancel the quadratic curvature at the exit of the RF gun.We then further increase the amplitude past that point to also pre-compensate the quadratic nonlinearity associated with the relativistic transport, which in the relativistic case is the leading contribution to the emittance growth in the (z, z ) trace space.
In Table .II, the nominal parameters at the optimal point are given, namely amplitudes, lengths, and phases of the respective cavities, along with initial beam parameters.The initial pulse profile has a quadratic shape.A cartoon of the phase space evolution in successive drifts is shown as well, illustrating the behavior of the predicted behavior of the curvature at each stage of the scheme.In Fig. 9(b-d), the phase spaces after the gun, X-band, and at the longitudinal waist plane are shown respectively.Note the reversal of concavity of the longitudinal phase space from Fig. 9(b) to Fig. 9(c) caused by the deceleration in the X-band cavity.The concavity of the phase space before the buncher is set to pre-cancel the additional curvature imparted by the relativistic energyvelocity relation.
To understand the quality of this numerical optimization in the context of the analytical formulas discussed earlier in the paper, we extract the uncorrelated energy spread at the exit of the buncher by calculating the RMS of the distribution after subtracting the linear chirp.If the non-linear emittance growth is compensated, we can expect a bunch length limited only by the uncorrelated energy spread.Equation 19 evaluated with an RMS uncorrelated energy spread of 10 −5 , final beam energy   9(d) where the waist size is 183nm or 600 as.Looking at the phase space distribution we can see that the bunch length at the waist is mainly limited by uncorrelated energy spread.Color coding the particle with their radial position indicates that a significant contribution in this energy spread is the residual transverse correlations.In principle removing those would allow even shorter bunch lengths.
This scheme does provide a direct path to sub-fs bunch length, but the synchronization of the drive signals for two different resonant frequency RF cavities is a significant technological challenge that has to be addressed before moving forward to implement this in a user-facility UED beamline.The case is discussed here mainly as an example of the insights offered by the analytical framework that we developed, which suggests that properly shaping the drive laser and compensating the emittance growth does provide a path towards much shorter bunch lengths.

VI. CONCLUSION
In conclusion, in this paper, we have developed an analytical framework that yields a simple estimate for the minimum bunch length achievable in an RF compression beamline.Besides UED, the formulas in this paper might be useful in the optimization of RF compression for other ultrashort electron beam applications including radiation generation and injection into very high-frequency THzdriven [20] and laser-driven accelerators [21].
The formalism of the envelope equation allows us to include in the analysis various competing effects in the dynamics, including the longitudinal emittance growth due to the RF curvature, the relativistic beam transport, and the space-charge forces.The results indicate an optimum initial bunch length condition (which can be satisfied by adjusting the laser pulse length on the cathode for example) exists which compromises the RF-induced emittance growth and the effects of the longitudinal selffields.The simplicity of the reported expressions mainly stems from the fact that we approximated the effect of the interplay of the transverse and longitudinal dynamics with a simple constant order-of-unity geometry factor in the longitudinal perveance.We have also limited the expansion yielding the non-linear terms in the emittance growth to second and third-order, but in principle, all the higher-order terms can be calculated (and compensated if enough independent knobs are added/available on the beamline).While the initial conditions assumed in the derivations are an initially unchirped longitudinal phase space and realistic beams out of photoinjectors do typically present more complex phase-space distributions, the results obtained here provide useful estimates of the compression limits in a given configuration which can be used as a starting point for numerical optimizations.The scaling laws will be helpful to guide parameter choices in the design of new setups.Most importantly, these results highlight the main contributions to the final bunch length and suggest possible paths to follow to fur-ther improve the compression and achieve sub-fs bunch lengths.

FIG. 2 .
FIG.2.Left) Trace spaces of the beam at the exit of the prebuncher after the linear chirp has been subtracted from the distribution for high energy (top) and low energy (bottom) cases, compared with the analytical predictions from Eq. 11 (green curves).Right) Longitudinal trace spaces at the temporal waist for the high energy (top) and low energy (bottom) cases compared with the predictions from Eq. 13 (green curves).The current profiles at the focus are also shown in black.

FIG. 4 .
FIG. 4. Final bunch length as a function of the input bunch length for the case of (a) high energy, and (b) low energy.The analytical curves are also shown and are found to be in excellent agreement with the simulations.

FIG. 5 .
FIG. 5. (a) Longitudinal field of the bunch compared with the linear field component of the 3D Gaussian field.The total charge in the bunch in this simulation is Q = 10 5 e.(b) Geometry factors for the transverse (red) and longitudinal (blue) field plotted as a function of the rest frame aspect ratio.

FIG. 7 .
FIG. 7. (a)Final waist size plotted with respect to initial bunch length compared with GPT.The green and blue lines show the asymptotic behavior in the regimes where space-charge and emittance growth respectively are dominating the dynamics.The red line is the analytical expression which takes into account all effects discussed in this paper (b) The optimum phase space found from the scan in (a) for an input bunch length of 67.5 µm.Various measures of the bunch length are reported.The color-coding of the particles is a function of the radial coordinate (blue corresponds to on-axis particles).c) Evolution of the emittance along the line.The growth observed in GPT is due to the non-linearities of the space-charge field.d) Final emittance in GPT as a function of initial bunch length.The relative importance of the space-charge contribution to the emittance can be inferred by subtracting the expected emittance growth due to the buncher dynamics non-linearities.The cross-over point (where space-charge becomes the dominant effect) can be used to estimate the optimal injection condition and hence the minimum final bunch length achievable for a given setup.

FIG. 8 .
FIG. 8. (a) Minimum bunch length analytical estimates compared with GPT simulation points as the the number of electrons in the beam is varied for the gaussian (blue) and uniformly filled ellipsoidal (orange) distributions (b) Minimum bunch length versus γ and N for the Gaussian distribution assuming a constant focal length f = 2 m.

FIG. 9 .
FIG. 9. (a) Illustration of beamline setup for the RF emittance growth compensation.A short x-band linearizer is used to compensate for the curvature in (z, z ) space imparted by the S-band linac and gun.(b, c, and d) GPT simulation of phase space at the exit of the S-band gun, the exit of the X-band linearizer, and at the longitudinal focus.The temporal current profiles (note the change in the x-axis) are shown in black.The particles are color-coded with their transverse radial coordinate, to highlight that to further improve the bunch compression, the full interplay of transverse and longitudinal dynamics should be considered.

TABLE I .
Simulation beam parameters

TABLE II .
Parameters of simluation.