# Recirculated Wave Undulators for Compact FELs
## 3 Solution of the Liouville Equation for Longitudinal Beam Dynamics in Magnetic Chicanes  
In this section, we develop the theory that will be used to calculate the phase-space evolution of the electron beam passing from the first to the second interaction point through the magnetic chicane, as shown in Figure 2 at the end of this section. We study the longitudinal dynamics of relativistic electron beams in magnetic chicanes [28; 30]. The traveling direction is denoted by \(z\). The 1D Liouville equation describing the evolution of the longitudinal phase-space of an electron beam is:  
\[\frac{\partial\rho}{dt}(z,p_{z};t)=\hat{L}\rho(z,p_{z};t) \tag{3}\]  
where \(\rho\) is the longitudinal phase-space density, \(p_{z}\) is the electron longitudinal momentum and the expression of the Liouville operator is:  
\[\hat{L}=\left[\frac{\partial H}{\partial z}\frac{\partial}{\partial p_{z}}- \frac{\partial H}{\partial p_{z}}\frac{\partial}{\partial z}\right] \tag{4}\]  
The Hamiltonian function has been denoted as \(H\) and the respective Hamilton equations are:  
\[ \begin{split}\frac{dp_{z}}{dt}=-\frac{\partial H}{\partial z}= F_{z}\\ \frac{dz}{dt}=\frac{\partial H}{\partial p_{z}}=v_{z}\end{split}  \tag{5}\]  
where \(F_{z}\) is the longitudinal force acting on the electrons and \(v_{z}=p_{z}/\gamma mc\) the longitudinal velocity, with \(\gamma\) the Lorentz factor of the particle. Equation (3) admits the integral solution:  
\[\rho(z,p_{z};t)=e^{\int_{0}^{t}dt\hat{L}}\rho(z,p_{z};0) \tag{6}\]  
Equation (6) states that the action of the exponential operator \(\exp\left(\int_{0}^{t}dt\hat{L}\right)\) on the phase-space density \(\rho\) at the initial time \(t=0\) yields the phase-space density at time \(t\). Moreover, using Equation (5), Equation (6) can be further reduced to a more explicit form:  
\[\rho(z,p_{z};t)=e^{-\int_{0}^{t}dt\hat{r}_{z}\frac{\partial}{\partial p_{z}}- \int_{0}^{t}dt\hat{r}_{z}\frac{\partial}{\partial z}}\rho(z,p_{z};0)=\rho\bigg{(} z-\int_{0}^{t}dtv_{z},p_{z}-\int_{0}^{t}dt\hat{r}_{z};0\bigg{)} \tag{7}\]  
Indeed, in Equation (7) we have used the definition of unitary displacement-operator for both the coordinate and the momentum subspaces [30]. The power of this solution lays in the fact that the knowing the single-particle dynamics allows for a complete description of the whole beam in the phase-space at any time. A magnetic chicane consists of dipole magnets usually with the same field-strengths and magnetic lengths. For the study of the recirculated wave undulator under consideration it is preferable to exploit the ponderomotive phase-energy deviation (\(\psi-\delta\)) space instead than the coordinate-momentum space (\(z-p_{z}\)), where \(\delta=(\gamma-\gamma_{r})/\gamma_{r}\) with \(\gamma_{r}\) the Lorentz factor of the reference particle (the one with energy equal to the beam average energy). The meaning of the ponderomotive phase \(\psi\) will be clearer in Section 5, where the 1D FEL theory is presented. The transformation matrix associated with a magnetic chicane composed by four dipoles, up to the second-order in the energy deviation, reads:  
\[ \begin{pmatrix}\psi\\ \delta\end{pmatrix} = \begin{pmatrix}1&\frac{2\pi}{\lambda_{0}}R_{56}\\ 0&1\end{pmatrix}\begin{pmatrix}\psi_{0}\\ \delta_{0}\end{pmatrix}  \tag{8}\]  
where  
\[R_{56}=\frac{4L}{\sin\theta}(\tan\theta-\theta)+2d\frac{\tan\theta^{2}}{\cos\theta} \tag{9}\]is the linear longitudinal dispersion, \(\theta\) is bending angle, \(d\) is distance between the dipoles and \(L\) is the dipole length [31].