# An analytical backtracking method for electron beam longitudinal phase space
shaping

N. Sudar and Y. Ding  SLAC National Accelerator Laboratory, Menlo Park,
California 94025, USA

###### Abstract

Many applications of high brightness, highly relativistic electron beams carry
strict requirements on longitudinal phase space quality. To meet these
requirements, accelerator systems typically utilize dispersive elements to
manipulate the correlated energy spread acquired during acceleration or via
collective effects. The many free variables in these systems make finding an
optimal configuration difficult. We present here an analytical method for
tracking a desired final longitudinal phase space backwards through an
accelerator section composed of an acceleration or drift section followed by a
dispersive section, including analytical models of pertinent collective
effects. This backtracking can serve as a fast and accurate tool for
optimization and study of the longitudinal phase space dynamics of an
accelerator system. Here, we consider the LCLS-II accelerator as an example
case, using this method to find an accelerator configuration and longitudinal
phase space at the injector exit that lead to a significant increase in peak
current while maintaining a narrow energy spread at the accelerator exit. The
validity of this method is tested by comparison with Elegant simulations,
showing good agreement.

††preprint: APS/123-QED

##  I Introduction

The ability to produce high quality, high brightness electron beams has become
essential to a wide array of scientific applications. In the study of ultra-
fast science, the X-ray Free Electron Laser (FEL) has become an important
tool, requiring a high peak current electron beam with narrow energy spread
for succesful operation [1, 2, 3, 4, 5, 6, 7, 8, 9]. More exotic
configurations of the FEL rely on further manipulation of the e-beam current
profile [10, 11, 12, 13, 14, 15, 16, 17]. For the study of high energy physics
phenomena, linear colliders require high average power beams with low
transverse emittance [18, 19, 20, 21, 22]. Furthermore, many advanced
accelerator schemes require high current, high charge drivers and can benefit
from specific current profiles [23, 24, 25, 26], potentially serving as
building blocks for the next generation of linear colliders and radiation
sources [27, 28, 29, 30].

A common design feature of these accelerator configurations is multi-stage
bunch compression, integrating several magnetic bunch compressors between
accelerating sections in order to produce the desired current profile and
energy spread, while reducing deleterious collective effects [31]. However,
the final beam quality is still limited by correlated non-linearities in the
electron beam longitudinal phase space produced by RF curvature[32], higher
order compression, and collective effects such as linac cavity wakefields,
resistive wall wakefields [33, 34], coherent synchrotron radiation (CSR) [35,
36], and longitudinal space charge (LSC)[37]. These non-linearities can be
amplified by compression, potentially creating high current spikes where the
head and tail of the beam is over or under compressed respectively [38, 39].
These current horns lead to reduction of the longitudinal and transverse phase
space quality through projected emittance growth and correlated energy spread
from the aforementioned collective effects.

There have been many proposed methods to control these correlations [40, 41,
42, 43, 44, 45, 46]. To adjust second order non-linear compression the second
order energy chirp is typically adjusted with harmonic RF cavities [47] . It
was shown in [48, 49, 50], that additional higher order non-linear compression
can be adjusted by inserting octupoles into the bunch compressors. However,
the above methods can still be limited in their ability to shape the final
longitudinal phase space and current profile by constraints such as beam
losses, available RF power and beamline apertures, as well as the phase space
properties of the electron beam coming out of the injector.

In the design process of the accelerator configuration, the injector section,
where space charge dominates, is typically optimized first for a desired
transverse emmitance and current. This injector output is then used as a
starting point for downstream optimization. Adjustment of the incoming
longitudinal phase space can be achieved by phase space linearization [51],
collimation [52], and shaping of the photo-cathode laser envelope [53, 54,
55]. However, the optimal injector longitudinal phase space is unknown and
finding a configuration that leads to the desired final beam properties can be
an arduous task due to the many free variables throughout the accelerator and
the computational time associated with the fidelity needed to simulate
collective effects in particle based codes.

Here we propose a method to simplify this problem, developing an analytical
framework for tracking the longitudinal phase space and current profile at the
exit of the accelerator backwards through multiple stages of bunch
compression, following a similar approach to [48, 56, 57, 58]. For this
backtracking approach, we consider the limit of negligible uncorrelated energy
spread, describing the longitudnal phase space and current profile at the
accelerator exit as $N^{th}$ order polynomials. This simplification allows us
to track the transformation of the polynomial coefficients through each stage
of bunch compression including analytical expressions for pertinent collective
effects as the current profile evolves. Our goal here is to use the
backtracking approach to develop a fast method to find an accelerator
configuration and target longitudinal beam parameters at the injector exit
that lead to a desired final longitudinal phase space and current profile,
considering terms to arbitrary order.

In Section II we derive the transformation of the longitudinal phase space and
current profile, backtracking through a single bunch compressor. Discussion on
the inclusion of collective effects is given in Section III. In Section IV we
apply the method outlined in Section II and III to the LCLS-II superconducting
linac, finding an accelerator configuration and longitudinal distribution at
the injector exit that gives a 2 kA peak current beam with $0.1\%$ energy
spread at the undulator entrance. Here we include comparison with forward
tracking in Elegant [59], demonstrating the viability of the backtracking
approach. A second LCLS-II example case is given in Appendix A, reaching a 4
kA peak current and $0.1\%$ energy spread at the undulator entrance in Elegant
simulations, while highlighting some limitations of the proposed method.
Further discussion of the CSR wake derivation is given in Appendix B.

##  II Backtracking through a single bunch compressor

We start out with a given longitudinal phase space at the exit of the
accelerator described by the bunch coordinate, $s_{f}$ and the energy
detuning, $\eta_{f}=\frac{\gamma-\gamma_{0}}{\gamma_{0}}$ where $\gamma_{0}$
is the energy at $s_{f}=0$. We assume a delta function uncorrelated energy
distribution with correlated energy chirp given by the Nth order polynomial:

$\displaystyle\eta_{F}(s_{f})=h_{f1}s_{f}+h_{f2}{s_{f}}^{2}+h_{f3}{s_{f}}^{3}+\ldots+h_{fN}{s_{f}}^{N}$
(1)

We also describe the current profile as an Nth order polynomial distribution
with the bunch head at $s_{f}=S_{1}$ and tail at $s_{f}=S_{2}$:

$\displaystyle I_{f}(s_{f})=I_{f0}(1+I_{f1}s_{f}+I_{f2}{s_{f}}^{2}+$ (2)
$\displaystyle I_{f3}{s_{f}}^{3}+\ldots+I_{fN}{s_{f}}^{N})\quad
S_{1}<s_{f}<S_{2}$ $\displaystyle I_{f}(s_{f})=0\quad s_{f}<S_{1}\quad\&\quad
s_{f}>S_{2}$

Figure 1: Diagram of the backtracking scheme, showing example polynomials,
$\eta_{F}(s_{f})$ and $I_{f}(s_{f})$ with endpoints $S_{1}$ and $S_{2}$.

Here we consider a section of the accelerator composed of a dispersive section
(i.e. a bunch compressor) followed by an acceleration section or drift in the
forward direction, Fig. 1. Our aim is to find how the current profile and
chirp at the entrance of the dispersive section depends on the polynomial
coefficients of the chirp and current profile at the exit of the
acceleration/drift section.

We first track backwards from the exit of the acceleration/drift section to
the exit of the dispersive section:

$\displaystyle s_{F}=s_{f}$ (3)
$\displaystyle\eta_{F}=h_{f1}s_{f}+h_{f2}{s_{f}}^{2}+h_{f3}{s_{f}}^{3}+\ldots+h_{fN}{s_{f}}^{N}$
$\displaystyle s_{2}=s_{F}$
$\displaystyle\eta_{2}=\frac{1}{R_{66}}\bigg{[}\eta_{F}-H_{1}s_{F}-H_{2}{s_{F}}^{2}-H_{3}{s_{F}}^{3}-\ldots-
H_{N}{s_{F}}^{N}\bigg{]}$

Here, $H_{n}$ describes the chirp acquired by the beam in the
acceleration/drift section from RF curvature, collective effects or both. The
change in central energy is given by, $R_{66}=\frac{\gamma_{i}}{\gamma_{f}}$.
We assume the current profile does not evolve in this section. Now, tracking
backwards from the exit to the entrance of the dispersive section gives:

$\displaystyle
s_{I}=s_{2}-D_{1}\eta_{2}-D_{2}{\eta_{2}}^{2}-D_{3}{\eta_{2}}^{3}-\ldots-
D_{N}{\eta_{2}}^{N}$ (4) $\displaystyle\eta_{I}=\eta_{2}$

Here, $D_{n}$, are the polynomial coefficients describing the longitudinal
dispersion in the section. The above transformation gives the chirp at the
entrance of the bunch compressor in terms of $s_{f}$. In order to write the
chirp at the dispersive section entrance, $\eta_{I}(s_{i})$, we must first
find $s_{f}(s_{i})$. For non-trivial polynomial order, the equation
$s_{I}(s_{f})=s_{i}$ can not be inverted in general. In order to approximate
this inversion we can track forwards from the entrance of the dispersive
section to the accelerator/drift section exit, writing the chirp at the
entrance of the dispersive section in terms of some unknown polynomial
coefficients, $h_{In}$:

$\displaystyle\bar{s}_{I}=s_{i}$ (5)
$\displaystyle\bar{\eta}_{I}=h_{I1}s_{i}+h_{I2}{s_{i}}^{2}+h_{I3}{s_{i}}^{3}+\ldots+h_{IN}{s_{i}}^{N}$
$\displaystyle\bar{s}_{2}=s_{I}+D_{1}\bar{\eta}_{I}+D_{2}{\bar{\eta}_{I}}^{2}+D_{3}{\bar{\eta}_{I}}^{3}+\ldots+D_{N}{\bar{\eta}_{I}}^{N}$
$\displaystyle\bar{\eta}_{2}=\bar{\eta}_{I}$
$\displaystyle\bar{s}_{F}=\bar{s}_{2}$
$\displaystyle\bar{\eta}_{F}=R_{66}\bar{\eta}_{2}+H_{1}\bar{s}_{2}+H_{2}{\bar{s}_{2}}^{2}+H_{3}{\bar{s}_{2}}^{3}+\ldots+H_{N}{\bar{s}_{2}}^{N}$

Here the $\bar{X}$ notation is simply to differentiate between forward and
backtracking. Inserting $\bar{s}_{F}(s_{i})$ from forward tracking into
$\eta_{I}(s_{f})$ from backtracking, we obtain an expression for the chirp at
the bunch compressor entrance, $\eta_{I}(s_{i})$, in terms of the unknown
initial chirp coefficients, $h_{In}$. In order to solve for these chirp
coefficients in terms of the accelerator parameters and final chirp
coefficients, we equate $h_{In}$ to the $n^{th}$ order polynomial coefficient
of $\eta_{I}(s_{i})$.

In order to write down the solution to this system of equations, it is useful
to define the chirp at the dispersive section exit, $Y_{n}$, the decompression
factors, $d_{n}$, and the scaled decompression factors, $\bar{d}_{n}$:

$\displaystyle Y_{0}=0$ (6) $\displaystyle
Y_{n}=\frac{1}{R_{66}}(h_{fn}-H_{n})$ $\displaystyle
d_{n}=\frac{1}{n!}\frac{\partial^{(n)}}{\partial{s_{f}}^{n}}s_{i}(s_{f})\bigg{|}_{s_{f}=0}=\delta_{n,1}-D_{1}Y_{n}-\sum_{j=2}^{n}D_{j}Q_{n,j}$
$\displaystyle Q_{n,j}=$
$\displaystyle\sum_{x_{1}=0}^{n-1}\sum_{x_{2}=0}^{x_{1}-1}\cdots\sum_{x_{j-1}=0}^{x_{j-2}-1}Y_{n-x_{1}}Y_{x_{1}-x_{2}}\cdots
Y_{x_{j-2}-x_{j-1}}Y_{x_{j-1}}$
$\displaystyle\bar{d}_{1}=\frac{1}{d_{1}}\quad\quad\bar{d}_{n}=-{(\bar{d}_{1})}^{n}d_{n}$

Here $\delta_{n,m}$ is the Kronecker delta function. Making use of the above
definitions, the initial chirp coefficients can be written in a somewhat
compact form:

$\displaystyle
h_{I(n)}=Y_{n}T_{n,1,0}+\sum_{m=2}^{n}\sum_{j=1}^{m-1}Y_{n-m+1}T_{n-m+1,m,j}$
(7) $\displaystyle T_{n,1,0}={(\bar{d}_{1})}^{n}$ $\displaystyle T_{n,m,j}=$
$\displaystyle\frac{n}{j!}\frac{(m-2+j+n)!}{(m-1+n)!}{(\bar{d}_{1})}^{n}\sum_{x_{1}=2}^{N_{1}-1}\cdots\sum_{x_{j-1}=2}^{N_{j-1}-1}\bar{d}_{x_{1}}\cdots\bar{d}_{x_{j-1}}\bar{d}_{N_{j}}$
$\displaystyle N_{l}=m+l-1-\sum_{k=1}^{l-1}x_{k}$

Inserting these expressions into Eq. 5 we obtain $\bar{s}_{F}(s_{i})$ in terms
of the free variables of the accelerator and the chirp at the accelerator
exit.

In the limit of negligble uncorrelated energy spread the transformation of the
distribution function of the beam is given in terms of the transformation of
the longitudinal phase space coordinates,
$I_{f}[s_{F}]\delta[\eta_{F}]\rightarrow
I_{f}[\bar{s}_{F}(s_{i},\eta_{i})]\delta[\bar{\eta}_{F}(s_{i},\eta_{i})]$,
where $\delta[x]$ is the dirac delta function. The current profile at the
entrance of the bunch compressor is then given by:

$I_{i}(s_{i})=\int_{-\infty}^{\infty}d\eta_{i}I_{f}[\bar{s}_{F}(s_{i},\eta_{i})]\delta[\bar{\eta}_{F}(s_{i},\eta_{i})]$
(8)

It was shown in appendix A of [50] that the above integral can be written as:

$I_{i}(s_{i})=\sum_{j}\frac{I_{f}[s_{f}]}{|\frac{ds_{I}}{ds_{f}}|}\bigg{|}_{s_{f}=s_{f(j)}(s_{i})}$
(9)

Where $s_{f(j)}(s_{i})$ are given by the roots of $\bar{s}_{F}(s_{i})=s_{f}$.
Here we consider solutions that give only one positive root, implying that the
longitudinal phase space is piece wise continuous throughout, i.e. no current
horns. In this case, $s_{f(j)}(s_{i})=\bar{s}_{F}(s_{i})$ and we can drop the
sum and absolute value. The current profile is then defined in the region,
$s_{I}(S_{1})<s_{i}<s_{I}(S_{2})$ by:

$\displaystyle
I_{i}(s_{i})=\frac{I_{f}[\bar{s}_{F}(s_{i})]}{\frac{ds_{I}}{ds_{f}}[\bar{s}_{F}(s_{i})]}\equiv\frac{\sum_{n=0}^{N}\bar{I}_{f(n)}{s_{i}}^{n}}{\sum_{n=0}^{N-1}\bar{ds}_{(n)}{s_{i}}^{n}}$
(10)

Where we have defined the numerator and denominator in terms of the polynomial
coefficients, $\bar{I}_{f(n)}$ and $\bar{ds}_{(n)}$. Expanding Eq. 10 gives
the transformed current profile as a polynomial distribution. In order to
write out this expansion, we first define the compression factors, $C_{n}$:

$\displaystyle
C_{n}=\frac{1}{n!}\frac{\partial^{(n)}}{\partial{s_{i}}^{n}}s_{f}(s_{i})\bigg{|}_{s_{i}=0}=\delta_{n,1}+D_{1}h_{I(n)}+\sum_{j=2}^{n}D_{j}q_{n,j}$
(11) $\displaystyle q_{n,j}=$ $\displaystyle
D_{j}\sum_{x_{1}=0}^{n-1}\sum_{x_{2}=0}^{x_{1}-1}\cdots\sum_{x_{j-1}=0}^{x_{j-2}-1}h_{I(n-x_{1})}h_{I(x_{1}-x_{2})}\cdots
h_{I(x_{j-2}-x_{j-1})}$

Substituting the expression for $h_{I(n)}$ from Eq. 7 into the above
expression, the polynomial coefficients in Eq. 10 can be written in terms of
the compression and decompression factors as:

$\displaystyle\bar{ds}_{(0)}=d_{1}\quad\quad\bar{ds}_{(n)}=\sum_{m=2}^{n+1}md_{m}P_{n,m-1}$
(12)
$\displaystyle\bar{I}_{f(0)}=I_{f0}\quad\quad\bar{I}_{f(n)}=\sum_{m=1}^{n}I_{f0}I_{f(m)}P_{n,m}$
$\displaystyle P_{n,1}=C_{n}$ $\displaystyle P_{n,m}=$
$\displaystyle\sum_{x_{1}=1}^{n-1}\sum_{x_{2}=1}^{x_{1}-1}\cdots\sum_{x_{m-1}=1}^{x_{m-2}-1}C_{n-x_{1}}C_{x_{1}-x_{2}}\cdots
C_{x_{m-2}-x_{m-1}}C_{x_{m-1}}$

Making use of the expressions in Eq. 11 and 12, we now expand the denominator
of Eq. 10:

$\displaystyle\bigg{[}\frac{1}{n!}\frac{\partial^{(n)}}{\partial{s_{i}}^{n}}\bigg{(}\frac{1}{\frac{ds_{i}}{ds_{f}}[s_{f}(s_{i})]}\bigg{)}\bigg{]}\bigg{|}_{s_{i}=0}\equiv\frac{1}{d1}\delta_{n,1}+\sum_{m=1}^{n}\frac{{V}_{n,m}}{d_{1}}$
(13) $\displaystyle{V}_{n,1}=-\frac{\bar{ds}_{n}}{d_{1}}$
$\displaystyle{V}_{n,m}=(-1)^{m}\bigg{(}\frac{1}{d_{1}}\bigg{)}^{m}\times$
$\displaystyle\sum_{x_{1}=1}^{n-1}\sum_{x_{2}=1}^{x_{1}-1}\cdots\sum_{x_{m-1}=1}^{x_{m-2}-1}\bar{ds}_{n-x_{1}}\bar{ds}_{x_{1}-x_{2}}\cdots\bar{ds}_{x_{m-2}-x_{m-1}}\bar{ds}_{x_{m-1}}$

Finally, combining the results from Eq. 11-13, the polynomial coefficients of
the current profile can be written in a compact form as:

$\displaystyle I_{i}(s)\equiv
I_{i0}\big{(}1+I_{i1}s_{i}+I_{i2}{s_{i}}^{2}+\ldots+I_{iN}{s_{i}}^{N}\big{)}$
(14) $\displaystyle I_{i(0)}=\frac{I_{f0}}{d_{1}}$ $\displaystyle
I_{i(n)}=\sum_{m=1}^{n}V_{n,m}+\sum_{m=1}^{n}I_{f(m)}P_{n,m}$
$\displaystyle+\sum_{k=1}^{n-1}\bigg{(}\sum_{m=1}^{n-k}I_{f(m)}P_{n-k,m}\bigg{)}\bigg{(}\sum_{j=1}^{k}V_{k,j}\bigg{)}$
$\displaystyle I_{i(N)}=\sum_{m=1}^{N}I_{f(m)}P_{N,m}$
$\displaystyle+\sum_{k=1}^{N-1}\bigg{(}\sum_{m=1}^{N-k}I_{f(m)}P_{N-k,m}\bigg{)}\bigg{(}\sum_{j=1}^{k}V_{k,j}\bigg{)}$

The endpoints of the transformed current distribution are given by
transforming the endpoints, $S_{1}$ and $S_{2}$ according to Eq. 6:

$\displaystyle S_{1i}=\sum_{n=1}^{N}d_{n}{S_{1}}^{n}\quad\quad
S_{2i}=\sum_{n=1}^{N}d_{n}{S_{2}}^{n}$ (15)

In the case of multi-stage bunch compression, we can repeat the steps given by
equations 1-15 to find the chirp and current profile at the entrance of the
upstream bunch compressor, with $\eta_{I}(s_{i})$ taking the place of
$\eta_{f}(s_{f})$, and $I_{i}(s_{i})$ taking the place of $I_{f}(s_{f})$,
using the new current profile to calculate pertinent collective effects.

The above method can be adapted for forward tracking simply by replacing the
decompression factors in Eq. 6 and 7 with the compression factors, defining
the scaled compression factors in the same fashion and swapping the
compression and decompression factors in Eq. 11-13.

##  III Chirps and collective effects

In the previous section, we considered the transport through an acceleration
section and/or drift, describing the chirp acquired by the beam with the
polynomial coefficients, $H_{n}$. Here we describe the calculation of this
chirp in terms of the parameters of the accelerator and the coefficients of
the final current profile.

###  III.1 Chirp from RF curvature

For an acceleration section the chirp is given by the expansion of:

$\displaystyle\Delta\eta_{a}(s)=\frac{eVN_{c}}{mc^{2}\gamma_{f}}\cos{(ks+\phi)}$
(16)

Where m is the electron mass, e is the magnitude of the electron charge, c is
the speed of light, $N_{c}$ is the number of cavities in the accelerator
section, V is the voltage in each cavity, k is the RF frequency and $\phi$ is
the acceleration phase, and
$\gamma_{f}=\gamma_{i}+\frac{eVN_{c}}{mc^{2}\gamma_{f}}\cos{(\phi)}$ is the
central energy of the electron beam at the exit of the accelerator section
[32].

The chirp coefficients $H_{a(n)}$ are then given by:

$\displaystyle
H_{a(n)}=\frac{eVN_{c}}{mc^{2}\gamma_{f}}\frac{k^{n}}{n!}\cos{(\phi+n\frac{\pi}{2})}$
(17)

###  III.2 Chirp from cavity wakefields

We next consider the chirp coming from longitudinal wakefields from the
cavities or from the resistive walls of the beam pipe. The chirp here is given
by the convolution of the beam current distribution with the wake kernel
associated with the cavity or beam pipe:

$\displaystyle\Delta\eta_{w}(s)=-\frac{eL}{mc^{3}\gamma_{f}}\int_{-S_{1}}^{s}ds^{\prime}I(s^{\prime})w(s-s^{\prime})$
(18)
$\displaystyle=-\frac{eL}{mc^{3}\gamma_{f}}\int_{-S_{1}}^{s}ds^{\prime}I_{0}\bigg{(}1+I_{1}s^{\prime}+I_{2}{s^{\prime}}^{2}$
$\displaystyle+\ldots+I_{N}{s^{\prime}}^{N}\bigg{)}w(s-s^{\prime})$

Where L is the length of the acceleration section or drift.

Following [60, 34], for an RF cavity we consider an expansion of an
approximation of the wake kernel of the form:

$\displaystyle w(s-s^{\prime})=\alpha e^{-\beta\sqrt{s}}$ (19) $\displaystyle
w(s-s^{\prime})\sim\alpha\sum_{j=0}^{M}\frac{(-1)^{j}\beta^{j}}{j!}(s-s^{\prime})^{j/2}$

Here $\alpha$ and $\beta$ are determined by the geometry of the cavity and $M$
can be chosen such that the expansion converges over the bunch length. The
chirp is then given by:

$\displaystyle\Delta\eta_{w}(s)=-\frac{eL_{c}N_{c}}{mc^{3}\gamma_{f}}\alpha\times$
(20)
$\displaystyle\sum_{j=0}^{M}\frac{(-1)^{j}\beta^{j}}{j!}\sum_{k=0}^{N}\int_{S_{1}}^{s}ds^{\prime}\chi_{k}{s^{\prime}}^{k}(s-s^{\prime})^{j/2}$

Where $L_{c}$ is the length of each cavity, $N_{c}$ is the number of cavities
in the acceleration section, and $\chi_{0}\equiv I_{0}$ and $\chi_{j>0}\equiv
I_{0}I_{j}$. This expression can be expanded about $s=0$ up to Nth order to
get the polynomial chirp coefficients from the accelerator cavity wakefields,
$H_{w(n)}$.

$\displaystyle
H_{w(n)}=-\frac{eL_{c}N_{c}\alpha}{mc^{3}\gamma_{f}}\sum_{k=0}^{N}\sum_{j=0}^{M}\sum_{l=0}^{k}\frac{2(-1)^{j+l}k!\beta^{j}\chi_{k}}{j!l!(k-l)!(2l+j+2)}\times$
(21)
$\displaystyle\frac{(1+\frac{j}{2}+l)!}{(n+l-k)!(1+\frac{j}{2}+k-n)!}(-S1)^{1+\frac{j}{2}+k-n}$

###  III.3 chirp from resistive wall wakefields

For the resistive wall wake we consider the AC wake kernel from a round pipe
given by:

$w(s-s^{\prime})=\frac{Z_{0}c}{\pi
r^{2}}e^{-\frac{k_{r}}{2Q_{r}}(s-s^{\prime})}\cos{[k_{r}(s-s^{\prime})]}$ (22)

Here $k_{r}$ and $Q_{r}$ are fitting parameters as discussed in [61], and $r$
is the radius of the beam pipe. The chirp is given by:

$\displaystyle\Delta\eta_{rw}(s)=-\frac{eL}{mc^{3}\gamma_{f}}\frac{Z_{0}c}{\pi
r^{2}}\times$ (23)
$\displaystyle\sum_{k=0}^{N}\int_{S_{1}}^{s}ds^{\prime}\chi_{k}{s^{\prime}}^{k}e^{-\frac{k_{r}}{Q_{r}}(s-s^{\prime})}\cos{[k_{r}(s-s^{\prime})]}$

Again this expression can be expanded about $s=0$ up to Nth order to get the
polynomial chirp coefficients from the resistive wall wakefields, $H_{rw(n)}$.

$\displaystyle
F_{j}=\sum_{k=0}^{j}\frac{(-1)^{k}(j-1)!}{(2k)!(j-2k-1)!(2k+1)}{Q_{r}}^{2k}\quad
j>0\quad\quad F_{j}=(1+{Q_{r}}^{2})^{j}F_{|j|}\quad j<0\quad\quad F_{0}=0$
(24) $\displaystyle
G_{j}=\sum_{k=0}^{j}\frac{(-1)^{k}j!}{(2k)!(j-2k)!}{Q_{r}}^{2k}\quad j\geq
0\quad\quad G_{j}=(1+{Q_{r}}^{2})^{j}G_{|j|}\quad j<0$ $\displaystyle
H_{rw(n)}=-\frac{eL}{mc^{3}\gamma_{f}}\frac{Z_{0}c}{\pi
r^{2}}\frac{1}{n!{k_{r}}^{N-n+1}{Q_{r}}^{n-1}(1+{Q_{r}}^{2})^{N-n+1}}\bigg{(}e^{k_{r}S_{1}/Q_{r}}\sum_{k=0}^{N}\sum_{j=0}^{k}\big{[}\sin{(k_{r}S_{1})Q_{r}(k-n-j+1)F_{n-k+j-1}}+$
$\displaystyle\cos{(k_{r}S_{1})}G_{n-k+j-1}\big{]}(-1)^{n+k+j+1}\frac{k!}{j!}{k_{r}}^{N-k+j}{Q_{r}}^{k-j}(1+{Q_{r}}^{2})^{N-n+1}{S_{1}}^{j}\chi_{k}$
$\displaystyle+\sum_{j=0}^{N-n}(-1)^{j}(n+j)!{k_{r}}^{N-n-j}{Q_{r}}^{j+n}(1+{Q_{r}}^{2})^{N-n-j}G_{j+1}\chi_{n+j}\bigg{)}$

###  III.4 Chirp from longitudinal space charge

The chirp from longitudinal space charge (LSC) can be found considering the
LSC impedance in free space [62, 63]:

$\displaystyle Z_{LSC}(k)=\frac{ikZ_{0}}{\pi\gamma^{2}}\frac{1-\zeta
K_{1}(\zeta)}{\zeta^{2}}$ (25) $\displaystyle
Z_{LSC}(k)\sim\frac{ikZ_{0}}{4\pi\gamma^{2}}[1.232-2\log(\zeta)]$

Where $Z_{0}$ is the impedance of free space, $\zeta=\frac{k\sigma}{\gamma}$,
$\sigma$ is the transverse radius of the beam, $K_{1}(x)$ is the modified
bessel function of the second kind, and we have expanded the impedance to
first order in $\zeta$. The instantaneous change in the beam energy is then
given by:

$\displaystyle
d\gamma_{LSC}(k)=\frac{4\pi}{I_{A}}\tilde{I}(k)\frac{Z_{LSC}}{Z_{0}}$ (26)
$\displaystyle=\frac{ik\tilde{I}(k)}{I_{A}\gamma^{2}}[1.232+2\log(\frac{\gamma}{k\sigma})]dz$

Here $dz$ is an infinitesimal distance along the accelerator, $\tilde{I}(k)$
is the Fourier transform of the current profile and $I_{A}$ is the Alfven
current. In order to avoid needing to take the Fourier transform of the
current distribution and the inverse Fourier transform of the above
expression, we approximate that the logarithmic dependence on, $k$, can be
described by an effective wave number, $k_{c}$ related to the length of the
electron bunch. Defining, $k_{c}=\frac{4\pi I_{0}}{Qc}$ we obtain:

$\displaystyle
d\gamma_{LSC}(s)=\frac{1}{I_{A}\gamma^{2}}[1.232+2\log(\frac{\gamma}{k_{c}\sigma})]\int_{-\infty}^{\infty}dke^{iks}ik\tilde{I}(k)$
(27) $\displaystyle
d\gamma_{LSC}(s)=\frac{1}{I_{A}\gamma^{2}}[1.232+2\log(\frac{\gamma}{k_{c}\sigma})]\frac{\partial
I(s)}{\partial s}dz$

The chirp from LSC is given by,
$\Delta\eta_{LSC}(s)=\frac{1}{I_{A}{\gamma_{f}}}\frac{\partial I(s)}{\partial
s}\mu_{x}$, where $\mu_{x}$ for a drift, $\mu_{D}$, and for an acceleration
section, $\mu_{A}$, are given by:

$\displaystyle\mu_{D}=\frac{L}{{\gamma_{1}}^{2}}[1.232+2\log(\frac{\gamma_{1}}{k_{c}\sigma})]$
(28)
$\displaystyle\mu_{A}=\int_{0}^{L}dz\frac{1}{\gamma^{2}}[1.232+2\log(\frac{\gamma}{k_{c}\sigma})]$
$\displaystyle=2L\bigg{(}\frac{1+\log{(\gamma_{1})}}{(\gamma_{2}-\gamma_{1})\gamma_{1}}-\frac{1+\log{(\gamma_{2})}}{(\gamma_{2}-\gamma_{1})\gamma_{2}}+\frac{1.232+2\log{(\frac{1}{k_{c}\sigma})}}{2\gamma_{1}\gamma_{2}}\bigg{)}$

For $\mu_{A}$, we assume the beam undergoes a linear acceleration over the
distance $L$, accelerating the beam from an initial to final energy described
by $\gamma_{1}$ and $\gamma_{2}$ respectively. The polynomial chirp
coefficents from LSC are then given by:

$\displaystyle H_{LSC(n)}=\frac{1}{I_{A}{\gamma_{f}}}\mu_{x}(n+1)\chi_{n+1}$
(29)

Here $\gamma_{f}$ describes the beam energy at the end of the accelerator
section under consideration.

###  III.5 Chirp from coherent synchrotron radiation

In order to find an analytical expression for the coherent synchrotron
radiation (CSR) energy modulation generated by the beam passing through a bend
magnet, we consider only the short beam-long magnet case where the electron
beam experiences energy modulation from the entrance transient, a steady state
regime, and the exit transient. This is true in many cases where the electron
beam peak current or bend strength is large enough to generate significant
energy modulation. For instance, in the case of the LCLS-II accelerator
significant energy modulation from CSR is generated in dog-leg magnets located
in the long bypass line after the beam reaches full compression. Following
[64, 65], we can approximate the CSR chirp as the bunch passes through a bend.
This derivation is shown in Appendix B. Expanding the expressions for the
chirps to Nth order we can write the CSR chirp coefficients as:

$\displaystyle
H_{CSR(n)}=-\frac{e(-1)^{n}}{mc^{3}4\pi\epsilon_{0}\gamma}\times$ (30)
$\displaystyle\bigg{(}\frac{4}{3}\log{(4)}(-1)^{n}\chi_{n}+\sum_{k=n}^{N}\sum_{i=0}^{n-1}\Xi_{n,k,i}(-1)^{k}\chi_{k}{S_{2}}^{k-n}+$
$\displaystyle\sum_{k=n+1}^{N}\Xi_{n,k,n}(-1)^{k}\chi_{k}{S_{2}}^{k-n}$
$\displaystyle+\sum_{k=0}^{N}\Lambda_{n,k}^{0}\Phi{\rho}^{\frac{1}{3}}(-1)^{k}\chi_{k}{S_{2}}^{k-n-\frac{1}{3}}+$
$\displaystyle\sum_{m=0}^{n}\sum_{k=m+1}^{N}\sum_{i=0}^{m}\Lambda_{n,m,k,i}^{1}\Phi{\rho}^{\frac{1}{3}}(-1)^{k}\chi_{k}{S_{2}}^{k-n-\frac{1}{3}}-$
$\displaystyle\sum_{k=n+1}^{N}\sum_{i=0}^{m}\Lambda_{n,k,i}^{2}(-1)^{k}\chi_{k}{S_{2}}^{k-n}-\sum_{i=0}^{n-1}\Lambda_{n,n,i}^{2}(-1)^{n}\chi_{n}+$
$\displaystyle\sum_{k=0}^{N-n}\sum_{m=0}^{n}(-1)^{k+n}\chi_{k+n}{S_{2}}^{k}\bigg{[}\Upsilon_{n,m,k}^{0}+\sum_{i=0}^{m+k-1}\Upsilon_{n,i,m,k}^{1}-$
$\displaystyle\sum_{i=0}^{m+k-1}\sum_{l=0}^{m+k-i-2}\Upsilon_{n,l,i,m,k}^{2}-\sum_{i=0}^{m+k-1}\sum_{l=m+k-i+1}^{3(m+k)-1}\Upsilon_{n,l,i,m,k}^{2}\bigg{]}\bigg{)}$

Here $\Phi$ is the bend angle of the magnet, $\rho$ is the bend radius and
$S_{2}$ is the bunch coordinate of the electron beam tail. The steady state
condition is met when
$\Phi>\bigg{[}\frac{24}{\rho}(S_{2}-S_{1})\bigg{]}^{1/3}$. The coefficients
$\Xi$, $\Lambda^{0}$, $\Lambda^{1}$, $\Lambda^{2}$, $\Upsilon^{0}$,
$\Upsilon^{1}$, and $\Upsilon^{2}$ are independent of the magnet and electron
beam parameters and are shown in Appendix B.

Figure 2: Layout of the LCLS-II accelerator, showing the three acceleration
sections, L1, L2 and L3, the harmonic linearizer, L1x, the two bunch
compressors, BC1 and BC2, and the bypass line following L3. The energy and
current is shown at pertinent locations as well as useful distances for LSC
calculations, $L_{In}$, $L_{IIn}$, and $L_{IIIn}$. The bactracking method
detailed in section II, can be done iteratively over beamline sections III,
II, and I.

##  IV LCLS-II example

Here we consider the LCLS-II accelerator as an example case for making use of
the backtracking method, specifically focusing on the hard x-ray line [66].
Downstream of the injector, the LCLS-II beamline consists of an acceleration
section, L1B, harmonic cavities, L1H, a 4 dipole chicane bunch compressor,
BC1, a second acceleration section, L2B, a second 4 dipole chicane bunch
compressor, BC2, a third acceleration section, L3B, and a long bypass line,
Fig. 2. Collective effects in the long bypass line, non-linear compression in
the two bunch compressors, and higher order correlations from the injector
create difficulties in reaching peak currents of several kA and narrow energy
spread, $<0.1\%$. Achieving these parameters is important to the efficient
operation of the hard X-Ray FEL. Furthermore, achieving a nearly flattop
current distribution is beneficial to the operation of self seeding schemes
[52].

Beginning with a beam satisfying the above conditions, we can backtrack to
find the necessary distribution at the exit of the LCLS-II injector. In order
to simplify the problem, we choose $E_{0}$, $E_{BC1}$, $E_{BC2}$, $E_{f}$,
$I_{0}$, and $I_{BC1}$ to be near the nominal operating values of the LCLS-II
accelerator. The specified current and chirp polynomial coefficients at the
undulator entrance and additional free parameters, $L_{1B}$ voltage, $L_{1B}$
phase, $L_{1H}$ phase, $L_{2B}$ phase, and $L_{3B}$ phase, can be adjusted to
achieve a smooth, roughly symmetric current distribution with minimized linear
chirp at the injector exit. For this example case we consider chirp and
current terms up to 6th order and dispersive terms up to 3rd order.

The efficacy of the backtracking method can be checked by comparison with
forward tracking in Elegant. To do this we generate a 6-D phase space from the
longitudinal phase space at the injector exit found from backtracking,
considering a bi-gaussian transverse distribution with
$\epsilon_{nx}=\epsilon_{ny}=$ 0.37 mm-mrad. The bend angles in the bunch
compressors, cavity voltages and cavity phases used in the backtracking are
used in the Elegant lattice and can be found in Table I.

Table 1: LCLS-II example case 1 parameters $L_{I1}$ $(m)$ | 52 |  $N_{C}$ $(L1B)$ | 16
---|---|---|---
$L_{I2}$ $(m)$ | 22 |  $L_{C}$ $(m)$ | 1.0377
$L_{I3}$ $(m)$ | 14 |  $\lambda_{C}$ $(m)$ | 0.23061
$L_{I4}$ $(m)$ | 7 |  $N_{CH}$ $(L1H)$ | 16
$L_{II1}$ $(m)$ | 50 |  $\lambda_{CH}$ $(m)$ | 0.07687
$L_{II2}$ $(m)$ | 155 |  $N_{C}$ $(L2B)$ | 96
$L_{III1}$ $(m)$ | 34 |  $N_{C}$ $(L3B)$ | 160
$L_{III2}$ $(m)$ | 253 |  $L_{rw}$ (cu) $(m)$ | 339.1
$L_{III3}$ $(m)$ | 2920 |  $L_{rw}$ (s.s.) $(m)$ | 2584.5
$E_{0}$ $(MeV)$ | 92 |  $I_{0}$ $(A)$ | 11.7
$E_{BC1}$ $(MeV)$ | 250 |  $R_{56}^{(1)}$ $(mm)$ | -47.37
$E_{BC2}$ $(MeV)$ | 1500 |  $I_{BC1}$ $(A)$ | 33.3
$E_{f}$ $(MeV)$ | 4000 |  $R_{56}^{(2)}$ $(mm)$ | -43.56
$V_{L1B}$ $(MV)$ | 15.992 |  $\phi_{L1B}$$\degree$ | -25.06
$V_{L1H}$ $(MV)$ | 4.601 |  $\phi_{L1H}$$\degree$ | -175.12
$V_{L2B}$ $(MV)$ | 16.065 |  $\phi_{L2B}$$\degree$ | -35.63
$V_{L3B}$ $(MV)$ | 15.67 |  $\phi_{L3B}$$\degree$ | 0
$h_{f0}$ | 0 |  $I_{f0}$ $(A)$ | 2000
$h_{f1}$ $(m^{-1})$ | -11.91 | $I_{f1}$ | 6428.16
$h_{f2}$ $(m^{-2})$ | 5.39$\times 10^{5}$ | $I_{f2}$ | -5.48$\times 10^{9}$
$h_{f3}$ $(m^{-3})$ | 3.76$\times 10^{10}$ | $I_{f3}$ | -1.83$\times 10^{14}$
$h_{f4}$ $(m^{-4})$ | 2.86$\times 10^{17}$ | $I_{f4}$ | -5.48$\times 10^{18}$
$h_{f5}$ $(m^{-5})$ | -8.17$\times 10^{22}$ | $I_{f5}$ | 5.58$\times 10^{24}$
$h_{f6}$ $(m^{-6})$ | 2.08$\times 10^{27}$ | $I_{f6}$ | -9.88$\times 10^{29}$
$h_{i0}$ | 0 |  $I_{i0}$ $(A)$ | 11.7
$h_{i1}$ $(m^{-1})$ | -0.026 | $I_{i1}$ | -23.43
$h_{i2}$ $(m^{-2})$ | -627.73 | $I_{i2}$ | -53277.4
$h_{i3}$ $(m^{-3})$ | 26168.05 | $I_{i3}$ | 5.49$\times 10^{7}$
$h_{i4}$ $(m^{-4})$ | -1.43$\times 10^{7}$ | $I_{i4}$ | -7.29$\times 10^{10}$
$h_{i5}$ $(m^{-5})$ | 2.65$\times 10^{10}$ | $I_{i5}$ | 1.83$\times 10^{13}$
$h_{i6}$ $(m^{-6})$ | 1.13$\times 10^{12}$ | $I_{i6}$ | -4.68$\times 10^{16}$

###  IV.1 Region III

Following Eq. 1-15, we begin backtracking through Region III consisting of the
BC2 bunch compressor, L3B linac, and long bypass line as shown in Fig. 2. The
bypass line consists of 3 dog-legs and 6 small chicanes used to compensate for
anomalous dispersion. As stated in section II, we do not consider evolution of
the current profile in the bypass line. This condition limits the correlated
energy spread and peak current at the bypass line entrance. For this example
case, we consider a 2 kA peak current. An additional example where the current
profile evolves significantly in the bypass line, reaching a peak current of 4
kA is shown in Appendix A.

The LSC chirp in the bypass line can be calculated from Eq. 29, using
$\mu_{D}$ assuming a beam size throughout of 50 $\mu m$. The resistive wall
wakefield in the bypass line can be calculated from Eq. 24, for a copper pipe
with radius 17.4 mm with $k_{r}=6.0423\times 10^{4}$ and $Q_{r}=1.6949$, and a
stainless steel pipe with 24.5 mm radius with $k_{r}=1.3748\times 10^{4}$ and
$Q_{r}=1.1388$. The dog leg and chicane magnets produce a CSR chirp which can
be calculated using Eq. 30. Magnet strengths are given in Table III in
Appendix B. The LSC chirp in L3B can be calculated from Eq. 29, using
$\mu_{A}$ assuming a beam size throughout of 100 $\mu m$. The wakefield in L3B
comes from the cavity walls and can be calculated from Eq. 21 using
$\alpha=4.15\times 10^{13}$ and $\beta=23.973$. Finally the chirp from RF
curvature in L3 can be found from Eq. 17.

The BC1 and BC2 bunch compressors are both 4 dipole chicanes. The associated
dispersive terms are given by:

$\displaystyle D_{1}=R_{56}=-2{\theta_{m}}^{2}(L_{d}+\frac{2}{3}L_{m})$ (31)
$\displaystyle D_{(n)}=(-1)^{n+1}\frac{n+1}{2}D_{1}$

Where $L_{m}$ is the magnet length, $\theta_{m}$ is the bend angle, and
$L_{d}$ is the drift length between the first and second, and third and fourth
magnets. The required $R_{56}$ of the bunch compressor, BC2, can be found in
terms of the total chirp at the BC2 exit, $Y_{1}$, the peak current at the BC2
exit, $I_{f0}$, and the peak current at the BC2 entrance, $I_{BC1}$, with
$R_{56(2)}=\frac{I_{BC1}-I_{f0}}{Y_{1}I_{BC1}}$. The non-linear dispersive
terms can be found based on Eq. 31. In order to treat the bunch compressor as
a point like transformation, we ignore CSR in the bunch compressor. A small
adjustment to the 2nd order dispersion, $T_{566}\sim-1.41R_{56}$, can be
introduced to compensate for additional non-linear dispersion introduced by
CSR energy modulation in the bunch compressor. With these quantities we can
find the current profile and chirp at the entrance of BC2. Pertinent
parameters are shown in Table 1.

Figure 3a shows the longitudinal phase space and current profile at the
undulator entrance that is backtracked to the BC2 exit (3b), and BC2 entrance
(3c). Comparison with the results from forward tracking in Elegant shows good
agreement with the major difference found in the chirp at the head of the
beam. This can be attributed to small differences in the CSR and LSC
modulations in the bypass line. Figure 4 shows comparison between the
analytical estimates of the energy modulation from collective effects and the
energy difference in Elegant turning the collective effect on and off in the
specific region.

Figure 3: Longitudinal phase space (left) and current profile (right) at the
undulator entrance (a), BC2 exit (b), and BC2 entrance (c), with polynomials
from backtracking (red) and particles from Elegant (blue). Figure 4: Chirp
from resistive wall wakefield in bypass line a), LSC in bypass line b), cavity
wakefield in L3B c), LSC in L3B d), CSR in the bypass line e), CSR from only
the first dog leg magnet f), with polynomials from backtracking (red) and
particles from difference between Elegant sims with respective collective
effect turned on and off (blue).

###  IV.2 Region II

The current profile and chirp at the entrance of BC2 found from backtracking
in Region III can be used to backtrack to the entrance of BC1 again following
Eq. 1-15 for Region II of the accelerator. Calculation of the chirp follows a
similar path. The LSC chirp can be calculated from Eq. 29, using $\mu_{D}$
over the distance $L_{II1}$ and $\mu_{A}$ over the distance $L_{II2}$,
assuming a beam size throughout of 50 $\mu m$. The wakefields again come from
the cavity walls, identical to those in L3B. There are no significant sources
of CSR. Again the chirp from RF curvature in L2B can be found from Eq. 17 and
the $R_{56}$ of the bunch compressor, BC1, can be found in terms of the total
chirp at the BC1 exit, $Y_{1}$, the peak current at the BC1 exit, $I_{BC1}$,
and the peak current at the BC1 entrance, $I_{0}$, giving
$R_{56(1)}=\frac{I_{0}-I_{BC1}}{Y_{1}I_{0}}$. Again the non-linear dispersion
terms are found based on Eq. 31. Ignoring CSR in BC1 does not result in
significant differences in the compression.

Figure 5a shows the longitudinal phase space and current profile at the BC2
entrance that is backtracked to the BC1 exit (5b), and BC1 entrance (5c).
Comparison with the results from forward tracking in Elegant shows good
agreement, with comparison of the analytical estimates and simulated
collective effect modulations shown in Fig. 6.

Figure 5: Longitudinal phase space (left) and current profile (right) at the
BC2 entrance (a), BC1 exit (b), and BC1 entrance (c) with polynomials from
backtracking (red) and particles from Elegant (blue). Figure 6: Chirp from
cavity wakefield in L2B a), LSC in L2B b), with polynomials from backtracking
(red) and particles from difference between Elegant sims with respective
collective effect turned on and off (blue).

###  IV.3 Region I

The current profile and chirp at the entrance of BC1 found from backtracking
in Region II can be used to backtrack to the exit of the LCLS-II laser heater,
which we consider the exit of the injector. Since there is no dispersive
section, this can be done simply using Eq. 3 to find the change in the chirp
in the region. The LSC chirp can be calculated from Eq. 23, using $\mu_{D}$
over the distance $L_{I1}$ and $L_{I4}$, and $\mu_{A}$ over the distance
$L_{I2}$ and $L_{I3}$, assuming a beam size throughout of 350 $\mu m$. The
wakefields again come from the cavity walls, with the L1B wake identical to
L2B and L3B, and L1H wake calculated with $\alpha=2.3\times 10^{14}$ and
$\beta=34.503$. There is no significant source of CSR. Again the chirp from RF
curvature in Region I can be found from Eq. 17 for both L1B and L1H.

Figure 7a shows the longitudinal phase space and current profile at the BC1
entrance that is backtracked to the laser heater exit (7b), with the latter
used for forward tracking in Elegant. Here an uncorrelated gaussian energy
spread of $\sigma_{\eta}=0.0001$ is applied to the beam in order to suppress
the microbunching instability. Again comparison with the results from forward
tracking in Elegant shows good agreement, with comparison of the analytical
estimates and simulated collective effect modulations shown in Fig. 8.

Figure 7: Longitudinal phase space (left) and current profile (right) at the
BC1 entrance (a), and laser heater exit (b), with polynomials from
backtracking (red) and particles from Elegant (blue). Figure 8: Chirp from
cavity wakefield in L1B and L1H a), LSC in L1B and L1H b), with polynomials
from backtracking (red) and particles from difference between Elegant sims
with respective collective effect turned on and off (blue).

The ability to produce this longitudinal phase space and current profile at
the injector exit requires further study. Comparing with nominal LCLS-II
injector configurations using flattop [67] and gaussian [68] cathode laser
temporal profiles, Fig. 9, shows that the correlated energy spread and peak
current values are achievable. This comparison also hints at the benefits of
temporal shaping of the cathode laser, perhaps suggesting a ramped or
exponentially modified gaussian distribution, shifted in the head direction,
similar to the results of [53, 58].

Figure 9: Comparison of the longitudinal phase space (left) and current
profile (right) at the laser heater exit from backtracking (blue) and nominal
LCLS-II cases with flattop (yellow) and gaussian (green) cathode laser
temporal profiles.

##  V conclusion

The analytical approach to backtracking outlined in this paper offers a fast,
effective method to investigate the longitudinal phase space requirements at
various points along the accelerator, relating the final and initial
longitudinal phase spaces and current profiles with analytical expressions.
Comparison with forward tracking in Elegant shows that the method is robust
and could be potentially applied to more exotic configurations. The extension
of this method to backtrack to the cathode is made complicated by the need to
include transverse space charge effects and requires additional study. However
combining this with backtracking in the particle tracking code Opal [69],
offers a possible path forward.

The method is limited in scope to piecewise continuous distributions, however
in many cases the associated caustics are what we seek to avoid. To avoid
these caustics, a recommended starting point is to match the non-linear chirp
acquired in the final drift/acceleration section, linearizing the phase space
at the exit of the dispersive section. Given target final and initial phase
spaces it may be possible to use this backtracking method to solve directly
for an accelerator configuration, however we leave this for further study.
Furthermore, combining this backtracking solution with current machine
learning techniques may be advantageous for swiftly finding a suitable initial
phase space and accelerator configuration.

###### Acknowledgements.

The authors would like to thank Karl Bane, Yuri Nosochkov, Zhen Zhang, David
Cesar, Joe Duris, Nicole Neveu and Arianna Formenti for useful discussions.
This work was supported by U.S. Department of Energy Contract No. DE-
AC02-76SF00515 and award no. 2017-SLAC-100382.

##  Appendix A LCLS-II high current example

Here we include a second LCLS-II example case where we have tried to maximize
the peak current at the undulator entrance. In this case the evolution of the
current profile in the bypass line cannot be ignored as can be seen in the
comparison with forward tracking in Elegant, Fig. 10. The peak current at the
BC2 exit is large enough to drive significant energy modulation from
collective effects between dog leg bends producing additional dispersion and
the chirp is large enough to experience compression in the compensating
chicanes. The accuracy of the backtracking method for this case could be
improved by using Eq. 1-15 to solve for the evolution of the longitudinal
phase space through each individual magnet and subsequent drift. Regardless of
this, forward tracking in Elegant of the longitudinal phase space and current
profile at the laser heater exit found from backtracking gives a peak current
of 4 kA with an energy spread of $\sigma_{\eta}=0.1\%$ in the core of the
beam. Simulation parameters are given in Table II.

Figure 10: Longitudinal phase space (left) and current profile (right) at the undulator entrance (a), BC2 exit (b), BC2 entrance (c), BC1 exit (d), BC1 entrance (e), and laser heater exit (f) with polynomials from backtracking (red) and particles from Elegant (blue). Table 2: LCLS-II example case 2 parameters $E_{0}$ $(MeV)$ | 92 |  $I_{0}$ $(A)$ | 9
---|---|---|---
$E_{BC1}$ $(MeV)$ | 250 |  $R_{56}^{(1)}$ $(mm)$ | -46.70
$E_{BC2}$ $(MeV)$ | 1500 |  $I_{BC1}$ $(A)$ | 23.4
$E_{f}$ $(MeV)$ | 4000 |  $R_{56}^{(2)}$ $(mm)$ | -42.97
$V_{L1B}$ $(MV)$ | 15.992 |  $\phi_{L1B}$$\degree$ | -25.06
$V_{L1H}$ $(MV)$ | 4.592 |  $\phi_{L1H}$$\degree$ | -176.62
$V_{L2B}$ $(MV)$ | 16.488 |  $\phi_{L2B}$$\degree$ | -37.63
$V_{L3B}$ $(MV)$ | 15.67 |  $\phi_{L3B}$$\degree$ | 0
$h_{f0}$ | 0 |  $I_{f0}$ $(A)$ | 3000
$h_{f1}$ $(m^{-1})$ | 281.94 | $I_{f1}$ | 50191.4
$h_{f2}$ $(m^{-2})$ | -6.72$\times 10^{7}$ | $I_{f2}$ | -1.53$\times 10^{9}$
$h_{f3}$ $(m^{-3})$ | -1.90$\times 10^{13}$ | $I_{f3}$ | -9.89$\times 10^{14}$
$h_{f4}$ $(m^{-4})$ | 3.99$\times 10^{17}$ | $I_{f4}$ | -2.92$\times 10^{20}$
$h_{f5}$ $(m^{-5})$ | -9.15$\times 10^{23}$ | $I_{f5}$ | 1.14$\times 10^{24}$
$h_{f6}$ $(m^{-6})$ | 3.49$\times 10^{28}$ | $I_{f6}$ | -9.31$\times 10^{30}$
$h_{i0}$ | 0 |  $I_{i0}$ $(A)$ | 9
$h_{i1}$ $(m^{-1})$ | 0.176 | $I_{i1}$ | -24.16
$h_{i2}$ $(m^{-2})$ | -352.6 | $I_{i2}$ | -50166.5
$h_{i3}$ $(m^{-3})$ | -4921.4 | $I_{i3}$ | -1.79$\times 10^{7}$
$h_{i4}$ $(m^{-4})$ | -1.99$\times 10^{5}$ | $I_{i4}$ | -2.22$\times 10^{10}$
$h_{i5}$ $(m^{-5})$ | 4.09$\times 10^{9}$ | $I_{i5}$ | 5.36$\times 10^{12}$
$h_{i6}$ $(m^{-6})$ | 3.64$\times 10^{11}$ | $I_{i6}$ | -1.02$\times 10^{16}$

##  Appendix B CSR chirp derivation

The derivation of the CSR chirp follows [64, 65], using the Lienard Wiechert
potentials to find the electric field experienced by a particle as it
traverses a bend magnet.

First, for the calculations throughout, we flip the sign of the current
distribution from Eq. 1 such that the head of the beam is on the right.

$\displaystyle\bar{I}(s)=I_{0}(1-I_{1}s+I_{2}{s}^{2}-$ (32) $\displaystyle
I_{3}{s}^{3}+\ldots+(-1)^{N}I_{N}{s}^{N})\quad-S_{2}<s<-S_{1}$
$\displaystyle\bar{I}(s)=0\quad s<-S_{2}\quad\&\quad s>-S_{1}$

For case A in [64], where the observation point, $s$, is inside the magnet and
the source point, $s^{\prime}$, is outside of the magnet entrance, the CSR
wake kernel is given by:

$w_{A}[s-s^{\prime}]=-\frac{4}{\rho^{2}\phi}\delta\bigg{[}\frac{s-s^{\prime}}{\rho}-\frac{\phi^{3}}{6}\bigg{]}$
(33)

Here $\phi$ is the angle of the observation point relative to the magnet
entrance. The instantaneous change of energy is given by integrating over the
source points:

$\displaystyle\frac{1}{\rho}\frac{d\eta_{A}}{d\phi}=-\frac{e}{mc^{3}4\pi\epsilon_{0}\gamma}\int
ds^{\prime}w_{A}[s-s^{\prime}]\bar{I}[s^{\prime}]$ (34)
$\displaystyle=\frac{e}{mc^{3}4\pi\epsilon_{0}\gamma}\frac{4}{\rho\phi}\bar{I}\bigg{[}s-\frac{\rho\phi^{3}}{6}\bigg{]}$

The total energy change is given by integrating over the observation point’s
path through the magnet up until the formation length of the radiation exceeds
the tail of the beam.

$\displaystyle\Delta\eta_{A}=\frac{e}{mc^{3}4\pi\epsilon_{0}\gamma}\int_{0}^{\phi_{f}}d\phi\frac{4}{\phi}\bar{I}\bigg{[}s-\frac{\rho\phi^{3}}{6}\bigg{]}$
(35) $\displaystyle\phi_{f}=\bigg{[}\frac{6}{\rho}(s+S_{2})\bigg{]}^{1/3}$

For case B in [64], where the observation point, $s$, is inside the magnet and
the source point, $s^{\prime}$ is inside the magnet, the CSR wake kernel is
given by:

$w_{B}[s-s^{\prime}]=-\frac{2}{(3\rho^{2})^{1/3}}\frac{d}{ds^{\prime}}\frac{1}{(s-s^{\prime})^{1/3}}$
(36)

The instantaneous change of energy is given by integrating over the source
points:

$\displaystyle\frac{1}{\rho}\frac{d\eta_{B}}{d\phi}=-\frac{e}{mc^{3}4\pi\epsilon_{0}\gamma}\int
ds^{\prime}w_{B}[s-s^{\prime}]\bar{I}[s^{\prime}]$ (37)
$\displaystyle=-\frac{e}{mc^{3}4\pi\epsilon_{0}\gamma}\bigg{(}\frac{4}{\rho\phi}\bar{I}\bigg{[}s-\frac{\rho\phi^{3}}{24}\bigg{]}+$
$\displaystyle\frac{2}{(3\rho^{2})^{1/3}}\int_{s-\frac{\rho\phi^{3}}{24}}^{s}ds^{\prime}\frac{1}{(s-s^{\prime})^{1/3}}\frac{d\bar{I}[s^{\prime}]}{ds^{\prime}}\bigg{)}$

The total energy change is given by integrating over the observation point’s
path through the magnet up until the tail of the beam enters the magnet.

$\displaystyle\Delta\eta_{B}=-\frac{e}{mc^{3}4\pi\epsilon_{0}\gamma}\int_{0}^{\phi_{f}}d\phi\bigg{(}\frac{4}{\phi}\bar{I}\bigg{[}s-\frac{\rho\phi^{3}}{24}\bigg{]}+$
(38)
$\displaystyle\frac{2}{(3\rho^{2})^{1/3}}\int_{s-\frac{\rho\phi^{3}}{24}}^{s}ds^{\prime}\frac{1}{(s-s^{\prime})^{1/3}}\frac{d\bar{I}[s^{\prime}]}{ds^{\prime}}\bigg{)}$
$\displaystyle\phi_{f}=\bigg{[}\frac{24}{\rho}(s+S_{2})\bigg{]}^{1/3}$

The sum of the integrals in Eq. 35 and 38 can be done explicitly, cancelling
the logarithmic dependence at $\phi=0$. Rewriting the energy modulation such
that the head of the beam is again on the left, the polynomial chirp
coefficients associated with this entrance transient are given by:

$\displaystyle
H_{A+B(n)}=-\frac{e(-1)^{n}}{mc^{3}4\pi\epsilon_{0}\gamma}\times$ (39)
$\displaystyle\bigg{(}\frac{4}{3}\log{(4)}(-1)^{n}\chi_{n}+\sum_{k=n}^{N}\sum_{i=0}^{n-1}\Xi_{n,k,i}(-1)^{k}\chi_{k}{S_{2}}^{k-n}+$
$\displaystyle\sum_{k=n+1}^{N}\Xi_{n,k,n}(-1)^{k}\chi_{k}{S_{2}}^{k-n}\bigg{)}$

The coefficient, $\Xi$, is independent of the beam and magnet parameters and
are given by:

$\Xi_{n,k,i}=\frac{8^{\frac{1}{3}}k(\frac{2}{3})^{(\overline{k-1-i})}(1-k)^{(\overline{k-1-i})}}{(k-n)!(n-i)!(\frac{5}{3})^{(\overline{k-1-i})}}$
(40)

Here $x^{\overline{n}}$ is the pochhammer function or rising factorial,
$x^{\overline{n}}=x(x+1)(x+2)...(x+n-1)$.

Provided the beam satisfies the condition
$\Phi>\bigg{[}\frac{24}{\rho}(S_{2}-S_{1})\bigg{]}^{1/3}$, the entire beam
will experience a steady state CSR wake. For the case where this condition is
not satisfied, some observation points in the beam will exit the magnet before
the tail enters, case C in [64]. In this regime, parts of the beam will
experience a different CSR wake, complicating the analytical expression of the
polynomial coefficients of the CSR chirp. Thus for simplicity, we assume the
steady state condition is satisfied for the magnets in consideration. The CSR
wake kernel for the steady state regime is given by the wake kernel for case
B.

$w_{SS}[s-s^{\prime}]=-\frac{2}{(3\rho^{2})^{1/3}}\frac{d}{ds^{\prime}}\frac{1}{(s-s^{\prime})^{1/3}}$
(41)

The instantaneous change of energy is again given by integrating over the
source points:

$\displaystyle\frac{1}{\rho}\frac{d\eta_{SS}}{d\phi}=-\frac{e}{mc^{3}4\pi\epsilon_{0}\gamma}\int
ds^{\prime}w_{SS}[s-s^{\prime}]\bar{I}[s^{\prime}]$ (42)
$\displaystyle=-\frac{e}{mc^{3}4\pi\epsilon_{0}\gamma}\bigg{(}\frac{4}{\rho\big{[}\frac{24}{\rho}(s+S_{2})\big{]}^{1/3}}\bar{I}[-S_{2}]+$
$\displaystyle\frac{2}{(3\rho^{2})^{1/3}}\int_{-S_{2}}^{s}ds^{\prime}\frac{1}{(s-s^{\prime})^{1/3}}\frac{d\bar{I}[s^{\prime}]}{ds^{\prime}}\bigg{)}$

The total energy change is given by the instantaneous energy change at the
point the tail enters the magnet multiplied the distance travelled through the
magnet until the the observation point exits.

$\displaystyle\Delta\eta_{SS}=-\frac{e}{mc^{3}4\pi\epsilon_{0}\gamma}\rho(\phi_{f}-\phi_{i})\bigg{(}\frac{4}{\rho\big{[}\frac{24}{\rho}(s+S_{2})\big{]}^{1/3}}\bar{I}[-S_{2}]+$
(43)
$\displaystyle\frac{2}{(3\rho^{2})^{1/3}}\int_{-S_{2}}^{s}ds^{\prime}\frac{1}{(s-s^{\prime})^{1/3}}\frac{d\bar{I}[s^{\prime}]}{ds^{\prime}}\bigg{)}$
$\displaystyle\phi_{i}=\bigg{[}\frac{24}{\rho}(s+S_{2})\bigg{]}^{1/3}\quad\quad\phi_{f}=\Phi$

Again rewriting the energy modulation such that the head of the beam is on the
left, the polynomial chirp coefficients associated with the steady state
regime are given by:

$\displaystyle
H_{SS(n)}=-\frac{e(-1)^{n}}{mc^{3}4\pi\epsilon_{0}\gamma}\times$ (44)
$\displaystyle\bigg{(}\sum_{k=0}^{N}\Lambda_{n,k}^{0}\Phi{\rho}^{\frac{1}{3}}(-1)^{k}\chi_{k}{S_{2}}^{k-n-\frac{1}{3}}+$
$\displaystyle\sum_{m=0}^{n}\sum_{k=m+1}^{N}\sum_{i=0}^{m}\Lambda_{n,m,k,i}^{1}\Phi{\rho}^{\frac{1}{3}}(-1)^{k}\chi_{k}{S_{2}}^{k-n-\frac{1}{3}}-$
$\displaystyle\sum_{k=n+1}^{N}\sum_{i=0}^{m}\Lambda_{n,k,i}^{2}(-1)^{k}\chi_{k}{S_{2}}^{k-n}-\sum_{i=0}^{n-1}\Lambda_{n,n,i}^{2}(-1)^{n}\chi_{n}\bigg{)}$

The coefficients $\Lambda$ are independent of the beam and magnet parameters
and are given by:

$\displaystyle\Lambda_{n,k}^{0}=\frac{(-1)^{k}4}{n!(24)^{\frac{1}{3}}}\bigg{(}-\frac{1}{3}\bigg{)}^{(\underline{n})}$
(45)
$\displaystyle\Lambda_{n,m,k,i}^{1}=\frac{3^{\frac{2}{3}}k(\frac{2}{3})^{(\underline{n-m})}(\frac{2}{3})^{(\overline{k-1-i})}(1-k)^{(\overline{k-1-i})}}{(n-m)!(m-i)!(k-m-i)!(\frac{5}{3})^{(\overline{k-1-i})}}$
$\displaystyle\Lambda_{n,k,i}^{2}=\frac{6k(k-i)(\frac{2}{3})^{(\overline{k-1-i})}(1-k)^{(\overline{k-1-i})}}{(n-i)!(k-n)!(\frac{5}{3})^{(\overline{k-1-i})}}$

Here $x^{\overline{n}}$ is again the pochhammer function or rising factorial,
and $y^{\underline{n}}$ is the falling factorial
$y^{\underline{n}}=y(y-1)(y-2)...(y-n+1)$.

For case D in [64], where the observation point, $s$, is outside the magnet
exit and the source point, $s^{\prime}$, is inside the magnet, the CSR wake
kernel is given by:

$w_{D}[s-s^{\prime}]=-\frac{4}{\rho}\frac{d}{ds^{\prime}}\frac{1}{\psi[s^{\prime}]+2x}$
(46)

Here $\psi$ is the angle of the source point from the magnet exit and $x$ is
the distance of the observation point from the magnet exit. The distance
between source point and observation point is related by $\psi$ and $x$ by:

$s-s^{\prime}=\frac{\rho\psi^{3}}{24}\frac{\psi+4x}{\psi+x}$ (47)

The instantaneous change of energy is given by integrating over the source
points:

$\displaystyle\frac{1}{\rho}\frac{d\eta_{D}}{d\phi}=-\frac{e}{mc^{3}4\pi\epsilon_{0}\gamma}\int
ds^{\prime}w_{D}[s-s^{\prime}]\bar{I}[s^{\prime}]$ (48)
$\displaystyle=-\frac{e}{mc^{3}4\pi\epsilon_{0}\gamma}\frac{4}{\rho}\bigg{(}\frac{\bar{I}[-S_{2}]}{\psi[-S_{2}]+2x}+$
$\displaystyle\int_{-S_{2}}^{s}ds^{\prime}\frac{1}{\psi[s^{\prime}]+2x}\frac{d\bar{I}[s^{\prime}]}{ds^{\prime}}\bigg{)}$

In order for us to solve the above integral we first define the angle of the
tail of the beam, $\psi_{0}$, when the observation point is at distance $x$:

$s+S_{2}=\frac{\rho{\psi_{0}}^{3}}{24}\frac{\psi_{0}+4x}{\psi_{0}+x}$ (49)

With the above relation $x$ can be defined in terms of $\psi_{0}$.

$x[\psi_{0}]=\frac{\rho{\psi_{0}}^{4}-24(s+S_{2})\psi_{0}}{24(s+S_{2})-4\rho{\psi_{0}}^{3}}$
(50)

The integral giving the instantaneous change of energy can be done changing
variables and integrating over the angle of the source points:

$\displaystyle\frac{1}{\rho}\frac{d\eta_{D}}{d\phi}=-\frac{e}{mc^{3}4\pi\epsilon_{0}\gamma}\frac{4}{\rho}\bigg{(}\frac{\bar{I}[-S_{2}]}{\psi_{0}+2x[\psi_{0}]}-$
(51)
$\displaystyle\int_{0}^{\psi_{0}}d\psi\frac{1}{\psi+2x[\psi_{0}]}\frac{d}{d\psi}\bar{I}\bigg{[}s-\frac{\rho\psi^{3}}{24}\frac{\psi+4x[\psi_{0}]}{\psi+x[\psi_{0}]}\bigg{]}\bigg{)}$

The total energy change is given by integrating over the angle of the beam
tail:.

$\displaystyle\Delta\eta_{D}=\frac{4e}{mc^{3}4\pi\epsilon_{0}\gamma}\int_{\psi_{0}i}^{\psi_{0f}}d\psi_{0}\bigg{(}\frac{\bar{I}[-S_{2}]}{\psi_{0}+2x[\psi_{0}]}-$
(52)
$\displaystyle\int_{0}^{\psi_{0}}d\psi\frac{1}{\psi+2x[\psi_{0}]}\frac{d}{d\psi}\bar{I}\bigg{[}s-\frac{\rho\psi^{3}}{24}\frac{\psi+4x[\psi_{0}]}{\psi+x[\psi_{0}]}\bigg{]}\bigg{)}$
$\displaystyle\psi_{0i}=\bigg{[}\frac{6}{\rho}(s+S_{2})\bigg{]}^{1/3}\quad\quad\psi_{0f}=\bigg{[}\frac{24}{\rho}(s+S_{2})\bigg{]}^{1/3}$

In general the above integral can not be done analytically. However, we can
proceed by approximating the integral term in Eq. 51 associated with each
polynomial coefficient of the current profile as being quadratic in
$\psi_{0}$. Referring to these integral terms as, $F_{D(n)}$, we choose a
quadratic approximation, $f_{D(n)}$:

$\displaystyle F_{D(n)}[\psi_{0}]=-\int_{0}^{\psi_{0}}d\psi(-1)^{n}n\times$
(53)
$\displaystyle\bigg{(}s-\frac{\rho\psi^{3}}{24}\frac{\psi+4x[\psi_{0}]}{\psi+x[\psi_{0}]}\bigg{)}^{n-1}\frac{\rho\psi^{2}(\psi+2x[\psi_{0}])}{8(\psi+x[\psi_{0}])^{2}}$
$\displaystyle\sim
f_{D(n)}[\psi_{0}]=A_{(n)}+B_{(n)}\bigg{(}\psi_{0}-\bigg{[}\frac{24}{\rho}(s+S_{2})\bigg{]}^{1/3}\bigg{)}+$
$\displaystyle
C_{(n)}\bigg{(}\psi_{0}-\bigg{[}\frac{24}{\rho}(s+S_{2})\bigg{]}^{1/3}\bigg{)}^{2}$

Here we choose $A_{(n)}$, $B_{(n)}$, and $C_{(n)}$ such that
$F_{D(n)}=f_{D(n)}$ as x goes to 0, $f_{D(n)}=0$ as x goes to infinity, and
$F_{D(n)}=f_{D(n)}$ at ${\psi_{0}}^{3}=\frac{1}{2}{\psi_{0f}}^{3}$:

$\displaystyle
A_{(n)}=F_{D(n)}\bigg{[}\bigg{(}\frac{24}{\rho}(s+S_{2})\bigg{)}^{1/3}\bigg{]}$
(54) $\displaystyle
f_{D(n)}\bigg{[}\bigg{(}\frac{6}{\rho}(s+S_{2})\bigg{)}^{1/3}\bigg{]}=0$
$\displaystyle
f_{D(n)}\bigg{[}\bigg{(}\frac{12}{\rho}(s+S_{2})\bigg{)}^{1/3}\bigg{]}=F_{D(n)}\bigg{[}\bigg{(}\frac{12}{\rho}(s+S_{2})\bigg{)}^{1/3}\bigg{]}$

Solving the above system of equations and inserting $f_{D(n)}$ into Eq. 52,
the integral is now trivial. Again rewriting the energy modulation such that
the head of the beam is on the left, the polynomial chirp coefficients
associated with the exit transient are given by:

$\displaystyle
H_{D(n)}\sim-\frac{e(-1)^{n}}{mc^{3}4\pi\epsilon_{0}\gamma}\times$ (55)
$\displaystyle\bigg{(}\sum_{k=0}^{N-n}\sum_{m=0}^{n}(-1)^{k+n}\chi_{k+n}{S_{2}}^{k}\bigg{[}\Upsilon_{n,m,k}^{0}+\sum_{i=0}^{m+k-1}\Upsilon_{n,i,m,k}^{1}-$
$\displaystyle\sum_{i=0}^{m+k-1}\sum_{l=0}^{m+k-i-2}\Upsilon_{n,l,i,m,k}^{2}-\sum_{i=0}^{m+k-1}\sum_{l=m+k-i+1}^{3(m+k)-1}\Upsilon_{n,l,i,m,k}^{2}\bigg{]}\bigg{)}$

The coefficients, $\Upsilon$, are independent of the beam and magnet
parameters and are given by:

$\displaystyle\Upsilon_{n,m,k}^{0}=\frac{3(11-2^{\frac{1}{3}}10+2^{\frac{2}{3}})(-1)^{k+m}(k+m)!(k+n)!}{(2^{\frac{1}{3}}4-5)(3(k+m)-1)k!m!(k+m-1)!(n-m)!}$
(56) $\displaystyle\Upsilon_{n,i,m,k}^{1}=(-1)^{k+m-i}\times$
$\displaystyle\frac{2^{\frac{1}{3}}12^{m+k-1}4[2i(4+\log{(27)})+(k+m)(10+\log{(27)})]}{2^{6(m+k)-1}3^{i}i!m!k!}\times$
$\displaystyle\frac{(k+n)!(m+k)!(3(k+m)-1)!}{(k+m-1-i)!(n-m)!(k+m-i)!(i+2(k+m))!}$
$\displaystyle\Upsilon_{n,l,i,m,k}^{2}=\frac{(-1)^{l-1}}{(n-m)!}\bigg{(}\frac{3^{i+l-k-m}-1}{i+l-k-m}+\frac{3^{i+l-k-m+1}-1}{i+l-k-m+1}\bigg{)}\times$
$\displaystyle\frac{2^{\frac{1}{3}}12^{m+k-1}4(k+n)!(k+m)!(3(k+m)-1)!}{2^{6(m+k)-1}3^{i-1}i!l!m!k!(k+m-1-i)!(3(k+m)-1-l)!}$

Combining the entrance transient, steady state and exit transients gives the
polynomial coefficients of the CSR chirp. A list of bypass line magnets
considered in the LCLS-II example case are given in Table III.

Table 3: Bypass line magnet table $\Phi$ | $L_{m}$ | # of magnets
---|---|---
0.01234 | 0.35 | 4
0.02448 | 1.0 | 2
0.01234 | 0.35 | 4
0.00553 | 1.0 | 1
0.00445 | 0.6 | 1
0.0037 | 0.6 | 1
0.0065 | 1.0 | 2
0.00553 | 1.0 | 1
0.00233 | 1.025 | 2
0.00873 | 2.623 | 2
0.0101 | 0.35 | 4
0.00713 | 0.35 | 4
0.00873 | 2.623 | 2
0.00713 | 0.35 | 4

## References

  * [1] C. Pellegrini, A. Marinelli, and S. Reiche.  The physics of x-ray free-electron lasers.  Rev. Mod. Phys., 88:015006, Mar 2016.
  * [2] P. J. Neyman, W. B. Colson, S. C. Gottshalk, and A. M. M. Todd.  Free electron lasers in 2017.  Proc. of the 38th international free electron laser conference, FEL2017, Santa Fe, NM, USA, 2017.
  * [3] W. Decking, S. Abeghyan, P. Abramian, and et al.  A mhz-repetition-rate hard x-ray free-electron laser driven by a superconducting linear accelerator.  Nat. Photonics, 14:391–397, May 2020.
  * [4] David Pile.  First light from sacla.  Nature Photonics, 5(8):456–457, 2011.
  * [5] Paul Emma and LCLS Commissioning Team.  First lasing of the lcls x-ray fel at 1.5 å.  Proceedings of PAC09, Vancouver, to be published in http://accelconf. web. cern. ch/AccelConf, 2009.
  * [6] Christopher J Milne, Thomas Schietinger, Masamitsu Aiba, Arturo Alarcon, Jürgen Alex, Alexander Anghel, Vladimir Arsov, Carl Beard, Paul Beaud, Simona Bettoni, et al.  Swissfel: the swiss x-ray free electron laser.  Applied Sciences, 7(7):720, 2017.
  * [7] Dong Wang et al.  Soft x-ray free electron laser at sinap.  In Proceedings of the Seventh International Particle Accelerator Conference, Busan, Korea, pages 8–13, 2016.
  * [8] Toru Hara.  Fully coherent soft x-rays at fermi.  Nature Photonics, 7(11):852–854, 2013.
  * [9] Intae Eom, Sae Hwan Chun, Jae Hyuk Lee, Daewoong Nam, Rory Ma, Jaehyun Park, Sehan Park, Sang Han Park, Haeryong Yang, Inhyuk Nam, et al.  Recent progress of the pal-xfel.  Applied Sciences, 12(3):1010, 2022.
  * [10] Alexander A Zholents.  Method of an enhanced self-amplified spontaneous emission for x-ray free electron lasers.  Physical Review Special Topics-Accelerators and Beams, 8(4):040701, 2005.
  * [11] J. Duris, S. Li, T. Driver, and et al.  Tunable isolated attosecond x-ray pulses with gigawatt peak power from a free-electron laser.  Nat. Photonics, 14:30–36, Jan. 2020.
  * [12] Erik Hemsing, Aliaksei Halavanau, and Zhen Zhang.  Enhanced self-seeding with ultrashort electron beams.  Phys. Rev. Lett., 125:044801, Jul 2020.
  * [13] Dao Xiang, Yuantao Ding, Tor Raubenheimer, and Juhao Wu.  Mode-locked multichromatic x rays in a seeded free-electron laser for single-shot x-ray spectroscopy.  Phys. Rev. ST Accel. Beams, 15:050707, May 2012.
  * [14] E Kur, D J Dunning, B W J McNeil, J Wurtele, and A A Zholents.  A wide bandwidth free-electron laser with mode locking using current modulation.  New Journal of Physics, 13(6):063012, jun 2011.
  * [15] Zhen Zhang, Joseph Duris, James P MacArthur, Zhirong Huang, and Agostino Marinelli.  Double chirp-taper x-ray free-electron laser for attosecond pump-probe experiments.  Physical Review Accelerators and Beams, 22(5):050701, 2019.
  * [16] J Morgan and BWJ McNeil.  Attosecond polarization modulation of x-ray radiation in a free-electron laser.  Physical Review Accelerators and Beams, 24(1):010701, 2021.
  * [17] Nicholas Sudar, Ryan Coffee, and Erik Hemsing.  Coherent x rays with tunable time-dependent polarization.  Physical Review Accelerators and Beams, 23(12):120701, 2020.
  * [18] Vladimir Shiltsev and Frank Zimmermann.  Modern and future colliders.  Reviews of Modern Physics, 93(1):015006, 2021.
  * [19] Shinichiro Michizono.  The international linear collider.  Nature Reviews Physics, 1(4):244–245, 2019.
  * [20] Glen White and Vitaly Yakimenko.  Ultra-short-z linear collider parameters.  arXiv preprint arXiv:1811.11782, 2018.
  * [21] Tim Barklow, Zhirong Huang, Adham Naji, Emilio Nanni, James Rosenzweig, Anne Sakdinawat, Sami Tantawi, and Glen White.  An x-ray fel-based $\mathbf{\gamma\gamma}$ collider higgs factory-material for af03 summary report.  2020\.
  * [22] Emilio A Nanni, Martin Breidenbach, Caterina Vernieri, Sergey Belomestnykh, Pushpalatha Bhat, Sergei Nagaitsev, Mei Bai, Tim Barklow, Ankur Dhar, Ram C Dhuley, et al.  $\mathbf{C^{3}}$ demonstration research and development plan.  arXiv preprint arXiv:2203.09076, 2022.
  * [23] M Litos, E Adli, W An, CI Clarke, CE Clayton, Sébastien Corde, JP Delahaye, RJ England, AS Fisher, J Frederico, et al.  High-efficiency acceleration of an electron beam in a plasma wakefield accelerator.  Nature, 515(7525):92–95, 2014.
  * [24] BD O’Shea, G Andonian, SK Barber, KL Fitzmorris, S Hakimi, J Harrison, PD Hoang, MJ Hogan, B Naranjo, OB Williams, et al.  Observation of acceleration and deceleration in gigaelectron-volt-per-metre gradient dielectric wakefield accelerators.  Nature communications, 7(1):1–7, 2016.
  * [25] Ryan Roussel, Gerard Andonian, Walter Lynn, Kunal Sanwalka, River Robles, Claire Hansel, Aihua Deng, Gerard Lawler, JB Rosenzweig, G Ha, et al.  Single shot characterization of high transformer ratio wakefields in nonlinear plasma acceleration.  Physical Review Letters, 124(4):044802, 2020.
  * [26] Francois Lemery and Philippe Piot.  Tailored electron bunches with smooth current profiles for enhanced transformer ratios in beam-driven acceleration.  Physical Review Special Topics-Accelerators and Beams, 18(8):081301, 2015.
  * [27] Vitaly Yakimenko, Yunhai Cai, Christine Clarke, Selina Green, Carsten Hast, Mark Hogan, Nate Lipkowitz, Nan Phinney, Greg White, Gerald Yocky, et al.  Facet-ii accelerator research with beams of extreme intensities.  TUOBB02, 2016.
  * [28] Erik Adli, Jean-Pierre Delahaye, Spencer J Gessner, Mark J Hogan, Tor Raubenheimer, Weiming An, Chan Joshi, and Warren Mori.  A beam driven plasma-wakefield linear collider: from higgs factory to multi-tev.  arXiv preprint arXiv:1308.1145, 2013.
  * [29] Claudio Emma, Jeroen van Tilborg, Félicie Albert, Luca Labate, Joel England, Spencer Gessner, Frederico Fiuza, Lieselotte Obst-Huebl, Alexander Zholents, Alex Murokh, et al.  Snowmass 2021 accelerator frontier white paper: Near term applications driven by advanced accelerator concepts.  arXiv preprint arXiv:2203.09094, 2022.
  * [30] Claudio Emma, Xinlu Xu, Andrew Fisher, R Robles, JP MacArthur, J Cryan, MJ Hogan, P Musumeci, G White, and A Marinelli.  Terawatt attosecond x-ray source driven by a plasma accelerator.  APL Photonics, 6(7):076107, 2021.
  * [31] S Di Mitri and M Cornacchia.  Electron beam brightness in linac drivers for free-electron-lasers.  Physics Reports, 539(1):1–48, 2014.
  * [32] Helmut Wiedemann.  Particle accelerator physics.  Springer Nature, 2015.
  * [33] KLF Bane.  Wakefields of sub-picosecond bunches.  Technical report, Report No. SLAC-PUB-11829, 2006.
  * [34] Alexander Novokhatski and Alban Mosnier.  Short bunch wake potentials for a chain of tesla cavities.  Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 763:202–209, 2014.
  * [35] James B Murphy.  ‘an introduction to coherent synchrotron radiation in storage rings.  ICFA Beam Dynamics Newsletter, 35:20, 2004.
  * [36] KLF Bane, F-J Decker, Y Ding, D Dowell, P Emma, J Frisch, Z Huang, R Iverson, C Limborg-Deprey, H Loos, et al.  Measurements and modeling of coherent synchrotron radiation and its impact on the linac coherent light source electron beam.  Physical Review Special Topics-Accelerators and Beams, 12(3):030704, 2009.
  * [37] Marco Venturini.  Models of longitudinal space-charge impedance for microbunching instability.  Physical Review Special Topics-Accelerators and Beams, 11(3):034401, 2008.
  * [38] TK Charles, J Björklund Svensson, Andrea Latina, and Sara Thorin.  First experimental measurements of the caustic nature of trajectories in bunch compressors.  In 10th Int. Particle Accelerator Conf.(IPAC’19), Melbourne, Australia, 19-24 May 2019, pages 2270–2273. JACOW Publishing, Geneva, Switzerland, 2019.
  * [39] TK Charles, DM Paganin, and RT Dowd.  Caustic-based approach to understanding bunching dynamics and current spike formation in particle bunches.  Physical Review Accelerators and Beams, 19(10):104402, 2016.
  * [40] Yipeng Sun, Paul Emma, Tor Raubenheimer, Juhao Wu, et al.  X-band rf driven free electron laser driver with optics linearization.  Physical Review Special Topics-Accelerators and Beams, 17(11):110703, 2014.
  * [41] Sara Thorin, Joel Andersson, Mathias Brandin, Francesca Curbis, Lennart Isaksson, Marija Kotur, and J Björklund Svensson.  Experience and initial measurements of magnetic linearisation in the max iv linac bunch compressors.  In 38th Int. Free Electron Laser Conf.(FEL’17), Santa Fe, NM, USA, August 20-25, 2017, pages 273–275. JACOW, Geneva, Switzerland, 2018.
  * [42] S Di Mitri, M Cornacchia, and S Spampinati.  Cancellation of coherent synchrotron radiation kicks with optics balance.  Physical Review Letters, 110(1):014801, 2013.
  * [43] Chad Mitchell, Ji Qiang, and Paul Emma.  Longitudinal pulse shaping for the suppression of coherent synchrotron radiation-induced emittance growth.  Physical Review Special Topics-Accelerators and Beams, 16(6):060703, 2013.
  * [44] G Penco, E Allaria, I Cudin, S Di Mitri, D Gauthier, S Spampinati, M Trovó, L Giannessi, E Roussel, S Bettoni, et al.  Passive linearization of the magnetic bunch compression using self-induced fields.  Physical review letters, 119(18):184802, 2017.
  * [45] Haixiao Deng, Meng Zhang, Chao Feng, Tong Zhang, Xingtao Wang, Taihe Lan, Lie Feng, Wenyan Zhang, Xiaoqing Liu, Haifeng Yao, et al.  Experimental demonstration of longitudinal beam phase-space linearizer in a free-electron laser facility by corrugated structures.  Physical Review Letters, 113(25):254802, 2014.
  * [46] LCLS-II TN.  Beam shaping with a passive linearizer at the lcls-ii for high-current operation.
  * [47] P Emma.  Lcls technical note.  Technical report, LCLS-TN-01-1, 2001.
  * [48] TK Charles, DM Paganin, A Latina, MJ Boland, and RT Dowd.  Current-horn suppression for reduced coherent-synchrotron-radiation-induced emittance growth in strong bunch compression.  Physical Review Accelerators and Beams, 20(3):030705, 2017.
  * [49] Yuantao Ding, KLF Bane, and YM Nosochkov.  Beam shaping for high-repetition-rate x-ray fels.  Technical report, SLAC National Accelerator Lab., Menlo Park, CA (United States), 2019.
  * [50] Nicholas Sudar, Y Nosochkov, K Bane, Z Zhang, and Y Ding.  Octupole based current horn suppression in multistage bunch compression with emittance growth correction.  Physical Review Accelerators and Beams, 23(11):112802, 2020.
  * [51] Haixiao Deng, Meng Zhang, Chao Feng, Tong Zhang, Xingtao Wang, Taihe Lan, Lie Feng, Wenyan Zhang, Xiaoqing Liu, Haifeng Yao, et al.  Experimental demonstration of longitudinal beam phase-space linearizer in a free-electron laser facility by corrugated structures.  Physical Review Letters, 113(25):254802, 2014.
  * [52] Yuantao Ding, KLF Bane, W Colocho, F-J Decker, P Emma, J Frisch, MW Guetg, Z Huang, R Iverson, J Krzywinski, et al.  Beam shaping to improve the free-electron laser performance at the linac coherent light source.  Physical Review Accelerators and Beams, 19(10):100703, 2016.
  * [53] G Penco, M Danailov, A Demidovich, Enrico Allaria, Giovanni De Ninno, S Di Mitri, WM Fawley, Eugenio Ferrari, L Giannessi, and Mauro Trovò.  Experimental demonstration of electron longitudinal-phase-space linearization by shaping the photoinjector laser pulse.  Physical review letters, 112(4):044801, 2014.
  * [54] Zhen Zhang, Joseph Duris, James P MacArthur, Alexander Zholents, Zhirong Huang, and Agostino Marinelli.  Experimental demonstration of enhanced self-amplified spontaneous emission by photocathode temporal shaping and self-compression in a magnetic wiggler.  New Journal of Physics, 22(8):083030, 2020.
  * [55] Randy Lemons, Nicole Neveu, Joseph Duris, Agostino Marinelli, Charles Durfee, and Sergio Carbajo.  Temporal shaping of narrow-band picosecond pulses via noncolinear sum-frequency mixing of dispersion-controlled pulses.  Physical Review Accelerators and Beams, 25(1):013401, 2022.
  * [56] Klaus Floettmann, Thorsten Limberg, and Philippe Piot.  Generation of ultrashort electron bunches by cancellation of nonlinear distortions in the longitudinal phase space.  TESLA-FEL Report: TESLA-FEL, 6:2001, 2001.
  * [57] Igor Zagorodnov and Martin Dohlus.  Semianalytical modeling of multistage bunch compression with collective effects.  Physical Review Special Topics-Accelerators and Beams, 14(1):014403, 2011.
  * [58] M. Cornacchia, S. Di Mitri, G. Penco, and A. A. Zholents.  Formation of electron bunches for harmonic cascade x-ray free electron lasers.  Phys. Rev. ST Accel. Beams, 9:120701, Dec 2006.
  * [59] M Borland.  Elegant: A flexible sdds-compliant code for accelerator simulation.
  * [60] Karl LF Bane.  Wakefields of sub-picosecond electron bunches.  International Journal of Modern Physics A, 22(22):3736–3758, 2007\.
  * [61] Karl LF Bane and Gennady Stupakov.  Resistive wall wakefield in the lcls undulator beam pipe.  Technical report, Citeseer, 2004.
  * [62] EL Saldin, EA Schneidmiller, and MV Yurkov.  Longitudinal space charge-driven microbunching instability in the tesla test facility linac.  Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 528(1-2):355–359, 2004.
  * [63] Zhirong Huang, M Borland, P Emma, J Wu, C Limborg, G Stupakov, and J Welch.  Suppression of microbunching instability in the linac coherent light source.  Physical Review Special Topics-Accelerators and Beams, 7(7):074401, 2004.
  * [64] Evgenij L Saldin, Evgeny A Schneidmiller, and MV Yurkov.  On the coherent radiation of an electron bunch moving in an arc of a circle.  Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 398(2-3):373–394, 1997.
  * [65] G Stupakov and P Emma.  Csr wake for a short magnet in ultrarelativistic limit.  In Proceedings of EPAC, page 1479. Citeseer, 2002.
  * [66] Axel Brachmann, M Dunham, and JF Schmerge.  Lcls-ii-status and upgrades.  Technical report, SLAC National Accelerator Lab., Menlo Park, CA (United States), 2019.
  * [67] G Marcus and J Qiang.  Lcls-ii scrf start-to-end simulations and global optimization as of september 2016.  LCLS-II TN-1704, 2017.
  * [68] N Neveu and Y Ding.  Lcls-ii standard configuration with a gaussian-profile injector laser.  Technical report, Technical Report LCLS-II-TN-20-03. SLAC National Accelerator Laboratory …, 2020.
  * [69] Andreas Adelmann, Ch Kraus, Y Ineichen, and JJ Yang.  The opal (object oriented parallel accelerator library) framework.  PSI, Zurich, Switzerland, Rep. PSI-PR-08-02, 2017, 2008.