Generation of large-bandwidth x-ray free electron laser with Evolutionary Many-Objective Optimization Algorithm

X-ray free-electron lasers (XFELs) are cutting-edge scientific instruments for a wide range of disciplines. Conventionally, the narrow bandwidth is pursued in an XFEL. However, in recent years, the large-bandwidth XFEL operation schemes are proposed for X-ray spectroscopy and X-ray crystallography, in which over-compression is a promising scheme to produce broad-bandwidth XFEL pulses through increasing the electron beam energy chirp. In this paper, combining with the beam yaw correction to overcome the transverse slice misalignment caused by the coherent synchrotron radiation, finding out the over-compression working point of the linac is treated as a many-objective (having four or more objectives) optimization problem, thus the non-dominated sorting genetic algorithm III is applied to the beam dynamic optimization for the first time. Start-to-end simulations demonstrate a full bandwidth of 4.6% for Shanghai soft x-ray free-electron laser user facility.

According to the FEL resonance condition [21], the wavelength of FEL radiation is determined by the electron beam energy and the undulator field parameters.In principle, properly sending the head-tail tilted electron bunches into a transverse gradient undulator [22] or into a planar undulator with natural gradient [23] can make different parts of the bunch experience different magnetic field, and thus generate broadband FEL pulses.Besides that, using electron beams with time-energy correlation is a more natural way to obtain broad-bandwidth FEL, which may be achieved without additional hardware elements in currently existed facilities.The simplest way to obtain energy chirp is off-crest acceleration, while it is inefficient and at the cost of reducing beam energy.There is another special compression mode named overcompression [24][25][26] which can be used to generate a large energy chirp.In this scheme electron beams are overcompressed in the bunch compressor which means the head and tail of the bunch will interchange their positions.The sign of energy chirp is changed too.Thus, the beam energy chirp will be further increased by the wakefields of subsequent rf structures.The crucial issue of over-compression mode is to find appropriate working point of the linac in which the electron beams have large energy chirp while other beam qualities can be maintained.The above process can be treated as a manyobjective (having four or more objectives) optimization problem in which the energy chirp, peak current, energy spread, and current profile of the electron bunch are objectives.
Pareto-dominance based multi-objective evolutionary algorithms (MOEAs), such as non-dominated sorting genetic algorithm II (NSGA-II) [27], have been widely and successfully used in the accelerator community [28][29][30][31][32] for physics study and optimization.However, in recent years, it has been pointed out that pareto-dominance based MOEAs will encounter some difficulties in manyobjective optimization problems (MaOPs) [33].The main reason is the severe loss of selection pressure towards the Pareto front which is caused by an increase in the objectives.Moreover, the diversity-preservation operator like crowding distance operator will become time consuming in many-objective problems.It is a common strategy to transform multiple objectives into one or two objectives by using the weighted method.Nevertheless, not only it is difficult to determine weights in the scenario, but it also loses the opportunity to analyze the relationships between each objective.
Recently, an improved NSGA-II procedure, which was termed NSGA-III [34,35], has been proposed as an evolutionary many-objective algorithm.NSGA-III maintains the diversity among population members by supplying and adaptively updating a set of well-spread reference points.It has been demonstrated that NSGA-III is efficient in optimizing 2 to 15 objectives problems [36][37][38].In this paper, using the Shanghai soft x-ray freeelectron laser (SXFEL) user facility parameters, the overcompression process is optimized by adjusting accelerator operation parameters with NSGA-III to explore the maximum FEL bandwidth.In addition, over-compressed electron bunches have gone through full compression status in chicane where the coherent synchrotron radiation (CSR) becomes quite strong [39].The slice misalignment along the electron bunch caused by the CSR leads to a projected emittance growth, which will be hindered for the broadband FEL lasing.More recently, dispersion section based beam yaw correction has been proposed and experimentally verified [40,41].However, the current profile and energy chirp of electron beam may be changed after such a correction.Therefore, in this study, the beam yaw correction is also included into the evolutionary many-objective optimization.
The paper is structured as follows.In Sec.II, the optimization strategy of the over-compression mode for SXFEL user facility is described, including the objectives and the algorithm used.The optimization results of NSGA-III and three typical cases are shown in Sec.III.The many-objective optimization including the beam yaw correction is presented in Sec.IV.The conclusions are summarized in Sec.V.

II. OPTIMIZATION STRATEGY
To obtain high quality electron beams in the overcompression mode, lattice parameters including the voltages and phases of the accelerating sections and the angels of the bunch compressors in the linac are optimized.The corresponding optimization objectives consist of the peak current, slice energy spread, current profile, and energy chirp of the electron bunch at the entrance of the undulator.In this optimization, the start-to-end simulations are performed to compute these optimization objectives and validate the large-bandwidth XFEL generation in the undulator.ASTRA [42] is used to track electron beams in the injector where the transverse space charge forces are strong.Tracking simulation in the main linac is performed by the ELEGANT [43] in which collective effects like the CSR, longitudinal space charge and wakefields are considered.The objectives calculation are based on the ELEGANT simulation results.Thus, to balance the calculation accuracy and time spent, the EL-EGANT simulation is performed with one hundred thousand macroparticles during the optimization.GENESIS [44] is used to verify the XFEL generation.
An electron bunch from the ELEGANT simulation result is divided into 100 slices to calculate objective values.The peak current I max is defined as the maximum current value of these slices.2% of the I max is chosen as a cutoff point.The cut-off points on two sides of a bunch are a and b respectively.The objective value of the energy spread, δ mean , is defined as average slice energy spread of slices between the two cut-off points: where δ i represents the energy spread of the i-th slice.
The energy chirp is defined as the relative energy difference between the two cut-off points: where γ i is the energy of the i-th slice.To discribe the current profile of an electron beam, a profile factor, C, is defined as the ratio of the sum of central 50 slice current to the sum of total slice current: It should be pointed out that the profile factor does not describe a specific shape.This is to analyze the relationship between current shape and energy chirp during the optimization.These optimization goals are not independent of each other.For example, peak current and slice energy spread are two conflicting objectives.Besides that, the current profile will influence the energy chirp brought by longitudinal wakefields.Therefore, it is important for the over-compression mode to optimize all the objective at the same time.As aforementioned, those widely used MOEAs are originally proposed for problems with two or three objectives.In recent years, numerous evolutionary many-objective optimization algorithms have been put forward to handle those problems with more than three objectives.The NSGA-III, one of the most frequentlyused many-objective optimization algorithm, is applied to optimize the over-compression mode in SXFEL user facility.
The NSGA-III is an improved version of the NSGA-II for MaOPs.The basic framework of NSGA-III is similar with the NSGA-II.Take the t-th generation as an example.Assume the population is Q t and its size is N.After the tournament selection, polynomial mutation, and simulated binary crossover, an offspring P t is generated from Q t with the same size.Thereafter, the Q t and P t are merged to R t , and the best N members need to be selected from the R t for the next generation.The selection in NSGA-III consists of two stages, one stage is used to guarantee the convergence to Pareto front and the other stage maintains the diversity of population.The first stage is the same as the NSGA-II which is based on the Pareto dominance to sort the population into multiple non-dominated fronts.If the total number of individuals in the top M Pareto fronts is larger than the population size, the first M-1 Pareto fronts will be selected FIG.1: Layout of the SXFEL user facility linac, with the injector section, S-band sections (L1), one X-band linearizer (LX), C-band sections (L2, L3) and two bunch compressor chicanes (BC1, BC2).Angle of the BC1, voltages and phases of L1 and LX are optimized for the large-bandwidth operation mode.The second bunch compressor is turned off to utilize more longitudinal wakefields.and the rest individuals are chosen from the M-th Pareto front based on the diversity keeping methods.In NSGA-II, solutions in the the M-th Pareto front with largest crowding distance will be chosen.However, the crowding distance measure is not working well for the MaOPs.In NSGA-III, the diversity is preserved by utilizing a set of well-distributed reference points.In this selection mechanism, objectives and the reference points are normalized to be in the same range.Thereafter, every population member is associated with a reference point based on a perpendicular distance measure.Next, to ensure the diversity, some population members are accepted after a niche operation.The reference points in the optimization of the over-compression mode are based on the systematic approach proposed by Das and Dennis [45] treating all objectives equally.

III. OVER-COMPRESSION MODE IN SXFEL USER FACILITY
As the first X-ray FEL in China, the SXFEL user facility is under construction at Shanghai [46].The SXFEL user facility will be equipped with two undulator lines.One is the two-stage seeded FEL line to generate 3 nm fully coherent FEL pulse, and the other is SASE line aimed at 2 nm on the basis of in-vacuum undulator.The scope of the optimization in this study is to design the large-bandwidth operation mode for the SASE line.
In the baseline design of the SXFEL user facility, 0.5 nC electron bunches with 130 MeV are generated in the injector section which includes two S-band accelerating structures and a laser heater.The downstream of the injector is the main linac with three accelerating sections and two bunch compressors.Electron beams are accelerated at the off-crest phase of a S-band accelerating section to create an energy chirp and an X-band rf cavity is used to linearize the chirp.Following this, electron beams with 256 MeV are compressed in the first magnetic chicane.There are two C-band linac accelerators which are used to further increase the energy to 1.5 GeV and the second chicane is between them.Finally, electron bunches are sent to the two FEL lines.In the over-compression mode, energy chirp is increased by the longitudinal wakefields after the over-compression.Therefore, it is more appropriate to make the electron beam be over-compressed in the first bunch compressor and turn off the second bunch compressor to utilize more longitudinal wakefields.Layout of the main linac with a single-stage bunch compressor and the SASE line are shown in Fig. 1.
The angle of the first bunch compressor (θ BC1 ), voltages and phases of the S-band accelerating section (V 1 , ϕ 1 ) and the X-band linearizer (V x , ϕ x ) are chosen as optimization variables.The ranges of these variables are decided by the limits of related hardware.Besides the limitations of variables, there are some restrictions on the beam qualities for FEL lasing, for instance, the slice energy spread.If those solutions with poor beam qualities are discarded earlierly, it will help to improve the efficiency of the optimization.Thus, those solutions with a peak current more than 2000 A or less than 700 A will be given the worst fitness in this optimization.In addition, those electron bunches which are not over-compressed, i.e., the tail of the electron bunch with larger energy than the head, will also be given the worst fitness value for faster convergence.The population and iteration in NSGA-III are set as 300 and 100.The Pareto front of the final iteration are shown in Fig. 2 (left) where objectives are normalized.For normalization, values of energy chirp, profile factor, peak current and slice energy spread are devided by 4.44%, 0.92, 2000 A, and 5.62 × 10 −4 separately.Fig. 2 (right) shows the projection of the Pareto front on the plane formed by the profile factor and the energy chirp.In general, a worse profile factor can achieve a larger energy chirp.From the prospective of the current shape, solutions can be divided into three categories.And three typical cases from the three kinds of current profile are given in Fig. 2 (right) with blue dots.The current profile and longitudinal phase space of the three cases are presented in Fig. 3.
The first kind of electron beams are those with profile factor lower than 0.5, which have a high-current leading peak and a long tail like the case 1 in Fig. 3 (a).The sharp single-horn of this kind of electron beam is caused by the nonlinear bunch compression.The maximum energy chirp available in this type of electron beams is 4.4%.Although the energy chirp is large, the low-current tail of such kind of electron beams will not contribute to the broad-bandwidth FEL lasing.Therefore, this kind of FIG.3: Current profile (upper) and longitudinal phase space (lower) of the three typical electron bunches selected from the Pareto-optimal front (see the three blue dots in Fig. 2).
electron beams are not suitable for the large-bandwidth operation mode.Furthermore, such sharp current profile has been proposed to produce single-spike x-ray pulses [47,48].It can further shorten the pulse by combining the energy chirp with an optimized reverse taper undulator.When the purpose is to generate the short pulses, it just need change corresponding optimization objectives of the NSGA-III like the length and energy chirp of the high-current part.
The second kind is those electron beams with profile factor between 0.5 and 0.7.This kind of electron bunches have a quasi-triangular current profile like the case 2 in Fig. 3 (b) with a profile factor of 0.54.The energy chirp of the case 2 is 3% which is the largest value in this kind.Similar to the first kind of electron beams, the lowcurrent tail does not contribute to the FEL lasing which causes the final FEL bandwidth to be much smaller than the theoretical value, i.e. the twice of the energy chirp.In addition, this kind of current shape also leads to a poor uniformity of the power profile.Thus, this kind of electron bunches are not the best choice for producing broad-bandwidth XFEL pulses.Nevertheless, this kind of electron bunches with triangular shape are capable of improving the transformer ratio in the beam-driven collinear wakefield accelerators [49,50].For such applications, the current values of each slice can be treated as optimization targets, to obtain a more precise triangular shape.
Those electron beams with a profile factor more than 0.7 are treated as the third kind.The current shape of this kind of electron bunches is more or less flattop or Gaussian shape, which are suitable for generating large-bandwidth FEL pulses to most users.The energy chirp and profile factor of the case 3 (see Fig. 3 (c)) are 2.39% and 0.89.Start-to-end simulations with one million macro particles have been performed based on the rf parameters of this case.Ideally, it will produce radiation with a bandwidth that is close to 4.8%.However, in this case, the full width FEL bandwidth including a 2% cut is 3.1%.The main reason for this bandwidth is the strong CSR in the over-compression mode.When the CSR effects are not considered in the ELEGANT simulation, the final FEL bandwidth is 4.5%.The CSR brings electron bunches with a longitudinally dependent energy loss which will be turned into slice misalignment called beam yaw and increase the projected emittance of the bending plane.The beam yaw is further increased in the subsequent accelerating sections due to the transverse wakefields.Fig. 4 shows the transverse phase space of the case 3 at the entrance of the undulator, in which there is a beam yaw in the horizontal phase space.Therefore, eliminating the CSR caused beam yaw is important for the large-bandwidth FEL generation.FIG.6: Current profile (top left), longitudinal phase space (top right) and horizontal phase space (bottom) of the chosen case (see the red dashed line in Fig. 5).

IV. COMBINING WITH BEAM YAW CORRECTION
The scheme presented in [40,41] removes the beam yaw by sending energy chirped electron beams into wellcontrolled dispersion sections.In SXFEL, there are two quadrupoles in the first magnetic chicane that can be used to correct the beam yaw.However, if an optimization result from the Section III is directly corrected by this method, the current profile and energy chirp of this electron bunch may also be changed.In order to get the optimal solutions, here combining the optimization algorithms with the beam yaw correction is considered.Due to the ability of NSGA-III to optimize many objectives, Power (GW) beam qualities affected by over-compression can be optimized simultaneously.In order to take into account the influence of the beam yaw, in addition to the four objectives proposed in Section III, the normalized horizontal emittance at the exit of Linac is chosen as the fifth goal.The smaller projected emittance means the less slice alignment.The strengths of the two quadrupoles in the first bunch compressors are added to optimization variables.In this optimization, only those electron beams with a Gaussian or flat-top shape are pursued.Therefore, besides limiting the peak current and the sign of the energy chirp, a solution with a profile factor less than 70% will also be given the worst fitness value.Population and iteration in this algorithm are set to 300 and 100.Pareto front of the last generation is presented in Fig. 5 where values of the five objectives are also normalized.In this figure, values of energy chirp, profile factor, peak current, slice energy spread, and normalized horizontal emittance are devided by 2.68%, 0.94, 2000 A, 6.56 × 10 −4 , and 75.1 mm • mrad separately.The front shows that the normalized horizontal emittance values of most electron bunches are in a small range, which indicate that the algorithm is practical and efficient for the beam yaw correction.The relationship between the other four objectives is similar to that in Fig. 2.
The maximum energy chirp in this optimization is 2.68% but the other objectives of the solution with maximum energy chirp do not approach the optimal values.After weighing the five objectives, a solution with an energy chirp of 2.54% is selected and presented in the Fig. 5 by a red dashed line.The peak current, normalized horizontal emittance, and profile factor of the chosen electron bunch are 1330 A, 1.6 mm•mrad, and 0.82.Current distribution and longitudinal phase space of the electron bunch are shown in Fig. 6 (top left) and Fig. 6 (top right).Fig. 6 (bottom) shows the horizontal phase space of the electron bunch in which the corresponding beam yaw has been correctly well.If the two quadrupoles are not used, the final normalized horizontal emittance is 3 mm • mrad and there is a clear beam yaw in the horizontal phase space.GENESIS simulation results of the solution are presented in Fig. 7.The XFEL bandwidth is 4.6% and the pulse energy is 286 µJ.
To analyze the effects of the voltages and timing jit-ters in the rf structure, 1000 ELEGANT runs are performed with randomized voltages and phases of the first accelerating section and linearizer.Phase jitters of the S-band and X-band are 0.1 and 0.4 deg.Voltage jitters in both sections are 0.04%.The impacts of these jitters on the optimization targets are calculated.The rms jitters of the peak current, profile factor, and energy chirp are 15.14%, 2.76%, and 0.84%.The jitter analyses indicate that the FEL bandwidth is stable in the over-compression mode and the peak power have some fluctuations due to the peak current jitter which is in an acceptable range.

V. CONCLUSIONS
In this paper, an evolutionary many-objective optimization algorithm has been applied to optimize the over-compression mode in the linac for producing largebandwidth XFEL pulses.Benefiting from the ability that can optimize more than three goals simultaneously, objectives including the energy chirp, slice energy spread, peak current, and current profile are all considered in the optimization.In addition, the beam yaw correction has been directly included by adding horizontal projected emittance as an objective.In the case of SXFEL user facility, simulations show that the current profile of the electron bunch has a large impact on the maximum available energy chirp.A maximum energy chirp of 4.4% can be obtained when the electron beam is of poor current uniformity.Considering the broadband FEL lasing, i.e., a good current profile and a beam yaw correction included, our results indicate that the electron beam with 2.54% energy chirp generates a 2nm FEL pulse with full bandwidth of 4.6%.
This algorithm can be easily extented to include more optimizations for other parts of the FEL facility such as the injector.And the accuracy of the optimization result largely depends on the definition and calculation method of the optimization goal.Moreover, it is also possible to optimize the problem based on the GENESIS simulation results when the computing power is sufficient.

FIG. 2 :
FIG.2: Parallel coordinate plots of the Pareto-optimal front for the optimization of the four objectives with the NSGA-III (left).Projection of the Pareto front on the plane formed by the energy chirp and current profile factor (right).The three blue dots show three typical solutions whose current profiles and longitudinal phase spaces are presented in Fig.3.

FIG. 4 :
FIG.4: Transverse phase space of the case 3 at the entrance of the undulator.

FIG. 5 :
FIG.5:The Pareto-optimal front for the optimization of the five objectives.The red dashed line indicates the chosen case whose current profile and longitudinal phase space are shown in Fig.6.