## 3 Electron Beam Transport for Ideal Magnetic Elements
### Beam Shape Dependence on QUAPEVA 2 Gradient  
The influence of the gradient change of the strongest QUAPEVA (the second one) is investigated in Figure 7, where the evolution of the beam transverse distribution at the undulator entrance versus the QUAPEVA 2 gradient is presented for the \"undulator-entrance\" optics (see Figure 5c). For the reference setting gradient, the beam displays a vertically and horizontally focused spot on the screen, especially for the energies around 176 \(\pm\) 1  MeV. For the larger gradient, the vertical-horizontal position per energy plot indicates that the high energies get vertically focused, while the central and lower energies are focused in the horizontal plane. In consequence, the pattern observed on the screen exhibits a cross shape. By decreasing the gradient, the opposite occurs, the lower energies being the ones focused vertically and the rest being focused horizontally as appreciated in the vertical-horizontal position per energy plot. The width and density in the cross arms are uneven due to the difference in electron density per energy (see Figure 2). \begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Optics**} & \multicolumn{2}{c}{**QUAPEVAs**} & \multicolumn{3}{c}{**Chicane**} & \multicolumn{3}{c}{**Electro-Magnetic**} \\  & \multicolumn{2}{c}{**(QAP)**} & \multicolumn{3}{c}{**Dipoles**} & \multicolumn{3}{c}{**Quadrupoles (QEM)**} \\ \hline  & \multicolumn{2}{c}{**Gradient**} & \multicolumn{2}{c}{**B Field**} & \multicolumn{2}{c}{**Qap**} & \multicolumn{2}{c}{**Current**} & \multicolumn{2}{c}{**\(r_{\textbf{56}}\)**} & \multicolumn{3}{c}{**Gradient**} \\
**Unit** & \multicolumn{2}{c}{**T/m**} & \multicolumn{2}{c}{**T/m**} & \multicolumn{2}{c}{**T**} & \multicolumn{2}{c}{**mm**} & \multicolumn{2}{c}{**A**} & \multicolumn{2}{c}{**mm**} & \multicolumn{2}{c}{**T/m**} \\
**Component** & **QAP1** & **QAP2** & **QAP3** & & & & **QEM1** & **QEM2** & **QEM3** & **QEM4** \\ \hline “Undulator” & +102.68 & \(-\)101.14 & \(+\)89.10 & 0.24 & 25 & 46.5 & 4.3 & \(-\)0.52 & 0.85 & \(-\)1.23 & 0.46 \\ \hline “Slit-undulator” & +104.1 & \(-\)103 & +96.43 & 0.24 & 25 & 46.5 & 4.3 & \(-\)0.01 & 4.70 & \(-\)4.40 & 0.29 \\ \hline “Undulator entrance” & +102.8 & \(-\)101.2 & +90.26 & 0.24 & 25 & 46.5 & 4.3 & 0 & 0 & 0 & 0 \\ \hline “Undulator exit” & +102.41 & \(-\)100.74 & +89.78 & 0.24 & 25 & 46.5 & 4.3 & \(-\)1.74 & 1.26 & \(-\)1.36 & 0.41 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Magnetic elements characteristics per optics configuration. Figure 6: Simulated vertical (**a**) horizontal (**b**) RMS beam envelope along the line. (**c**) Vertical (**blue**) and horizontal (**red**) normalized emittance at the undulator center and total beam charge (**green**). Case of flat-top beams of 180 \(\pm\) 0.3 MeV (**dashed line**), 176 \(\pm\) 0.3 MeV (**solid line**), and 172 \(\pm\) 0.3 MeV (**dotted line**), with the “Undulator” optics, an \(\sigma^{\prime}_{z,i}=\) 2 mrad RMS and \(\sigma^{\prime}_{x,i}=\) 3.12 mrad RMS, charge of 1 pC, \(\epsilon_{x,i}\),\(\epsilon_{z,i}=\) 0.2 mm.mrad. Figure 8a shows the maximum vertical and horizontal RMS beam sizes and the peak intensity at the center of the beam for the different gradients with the \"undulator entrance\" optics. When the beam is not properly focused (+1%), the beam size increases, and the intensity is reduced by a factor of two. Figure 8b presents the effectiveness of the transport at the undulator center versus QUAPEVA 2 gradient in the case of the \"undulator\" optics. When the gradient is reduced, the charge arriving at the center of the undulator is slightly increased because the lower energy electrons are focused on the horizontal plane avoiding the loss due to the vertical aperture of the undulator. When the gradient is increased by 3%, the charge is halved because of high energy electron loss (see Figure 2b) on the undulator vertical aperture (see Figure 5e). The horizontal emittance slightly changes from \(-3\%\) to \(+3\%\), and the vertical one grows by a factor of 1.5 for the 1% case.