Bayesian optimization of the dynamic aperture in UVSOR-IV design study

A lattice of a storage ring for the future plan of UVSOR synchrotron facility, UVSOR-IV, is designed at 1 GeV electron energy. The lattice of 12 compact double achromat cells conducts to an emittance of 4.2 nm at 1 GeV electron energy and 2.3 nm at 750 MeV electron energy in achromat condition, 82.5 m circumference, and six straight sections of 4 m long and six of 1.5 m long. The lattice requires strong sextupole magnets to compensate the natural chromaticity. To help deal with the challenge of dynamic aperture associated with the strong nonlinearities, we examined improving the dynamic aperture by optimizing the sextupole arrangement based on the Bayesian method. We have demonstrated optimizing the harmonic sextupole strength of four families with 100 iterations of running particle tracking simulation that is much faster than traditional methods such as complete parameter survey.


Introduction
UVSOR is a low energy synchrotron light source, which had been operated since 1983.After two major upgrades [1][2][3][4], now it is called UVSOR-III [5].The circumference of the storage ring is 53 m and the electron beam energy 750 MeV.It has a moderately small emittance of about 17 nm and provides vacuum ultraviolet light of high brightness.
Nowadays, to meet the demand of diffraction limited light beam in the vacuum ultraviolet and x-ray ranges from scientific community, several synchrotron light sources, which have exceedingly small emittance less than 1nm, are under consideration, construction, or in operation [6][7][8].In such a situation, we have started considering a future plan for UVSOR with an emittance smaller than at least a few nm to provide diffraction-limited light in the vacuum ultraviolet range.As the first step of the investigation, we have analyzed the present magnetic lattice of UVSOR to explore the possibility to get a lower emittance with some minor changes in the configuration of magnets.We found a few optics which has smaller emittance around 10 nm than the present value, 17 nm [9].To reach the lower emittance around a few nm, we have designed a totally new storage ring, UVSOR-IV which has higher electron energy, 1 GeV, a larger circumference, 82.5m, and small emittance around 4 nm [10].The lattice consists of twelve double bend cells.
In a low emittance storage ring, sextupole magnets used in the lattice for chromaticity correction become strong.Due to the strong nonlinear fields in the sextupole magnets, the region of stable motion which called dynamic aperture (DA) is limited around the design orbit.Therefore, DA is the most important issue in the lattice design, and it is a challenge to achieve a sufficiently large DA for a very low-emittance lattice.
In order to supress the nonlinear effects on beam dynamics, it is effective to add nonlinear magnets with optimized parameters, such as so-called harmonic sextupoles or higher order nonlinear elements like octupoles.In fact, finding the optimal parameters of additional magnets to achieve large DA by surveying the magnet parameters is a costly evaluation in the design study of the lattice.In order to reduce the cost of the evaluation we can use advanced global optimization algorithms which have been adopted to optimize a black-box function in high efficiency [11][12][13][14].Bayesian optimization [15,16] is an especially appealing, effective, and general approach for black-box systems in which objective function is expensive (in time or other costs) due to the complexity of the system.Recently Bayesian optimization has been used extensively for optimization of expensive evaluations in accelerator physics [17][18][19].
Bayesian optimization is one of machine-learning-based optimization methods focused on solving the problems where an objective function is expensive to probe or mostly takes a long time to evaluate.Bayesian optimization builds a surrogate model for prediction of an objective function and quantifies the uncertainty in that surrogate using Gaussian process regression [20], and then uses an acquisition function for choosing an optimal set of coordinates for the next evaluation.This procedure is repeated until a satisfactory solution which optimize the objective function is found.
In this paper, we will present the result from the optimization of DA of UVSOR-IV by using Bayesian optimization method.

Lattice design
The lattice of UVSOR-IV has been designed based on a compact double bend achromat cell (DBA), which consists of two bending magnets and four focusing magnets, all of which are combined function magnets.Two sextupole families are located in the dispersive sections between two combined dipoles for the chromaticity correction and two harmonic sextupole families are also employed to correct the high order geometric aberrations.This lattice has twelve DBA cells with six long straight sections about 4 m and six short straight sections around 1.5 m long.These lengths are same as those of UVSOR-III.This may enable us to use the undulators at UVSOR-III in the new ring.
A tune survey was performed to find the linear optics with a low emittance and appropriate optical functions.ELEGANT [21] was used for the calculations.We found an optic with the emittance of around 4 nm in the achromatic condition, which becomes lower in the non-achromatic condition.The emittance is a few times larger than 1 nm which was our initial target.In order to reduce the emittance more, we could introduce the multi-bend achromat lattice which decrease the number of straight sections or increase the number of the cells which make the circumference larger.Our design has been selected as making a balance between the circumference, the number of the straight sections, and the  1 shows the optical functions in the achromatic condition.The major parameters are listed in Table 1 and are compared with those of UVSOR-III.

Dynamic aperture
In a low emittance lattice, the dynamic aperture (DA), which corresponds to the maximum betatron amplitude where electrons remain bounded is limited due to the nonlinear effects.Sextupole magnets, which are needed to correct the chromaticity resulting from strong quadrupoles are the major source of the nonlinear effects.The appropriate placement and field strength of the sextupoles in the lattice can decrease the effect of the nonlinear perturbations from certain sextupoles on the beam.Therefore, arranging the sextupole magnets to minimize the nonlinear effects is a key issue to make the DA sufficiently large for injection and storage.DA can be calculated by single-particle tracking simulations, which tracks a particle with a set of initial conditions in six-dimensional phase space through the accelerator lattice for a given number of turns.Figure 2 shows the DA for on-momentum particles at the straight section with only two sextupole families at the dispersive section, whose strengths are determined so as to make the chromaticity zero.The DA is calculated by tracking 1024 turns using ELEGANT [21].In this optics, the horizontal aperture is -14 to 5 mm and vertical aperture is about 6 mm.Th DA would get even smaller if we take the machine errors in the calculation.Therefore, it should be increased.In order to increase DA, it is effective to introduce extra sextupole families at the free dispersion sections, whose strengths become free parameters for controlling the nonlinear effects.Usually, these parameters are determined so as to maximize the DA.In general, the calculation of dynamic aperture using single particle tracking simulation is computationally expensive in terms of CPU time (time consuming).Thus, using the traditional method such as surveying sextupole parameters to find the optimum becomes a costly evaluation.A powerful optimization algorithm is needed to save the CPU time.

Optimization algorithm
In order to optimize a black-box function there are a large variety of local optimization algorithms in use [22][23][24].Due to the simplicity of local optimization methods, they have very strong performance for cheap functions which are noiseless and does not require significant time or resources for evaluation.While for expensive function evaluations (in time or other costs) it may perform a large number of evaluations, which decreases the performance efficiency.There are some global optimization algorithms which can approach to global optima in better performance on time limited and noisy measurements [11][12][13][14].Recently Bayesian optimization method has been attracted in accelerator community [17][18][19].
Bayesian optimization, which is a framework to optimize a costly black-box function which take a long time to evaluate.It consists of two elements; a surrogate model which is a mathematical model to approximate the real objective function and an acquisition function which describes the strategy to determine the next points in input space to measure.The surrogate model is usually generated through Gaussian process regression [20] that returns a probability distribution of possible functions compatible with previous evaluations and is much faster and/or cheaper to evaluate.The model can predict the most probable value of objective function at an unexplored location and provides an uncertainty for this prediction.Then the model predictions and their uncertainties are combined into an acquisition function to determine the next parameters to sample.After the evaluation, the model is refined with the newly gathered information.This process is repeated iteratively to find the optimum parameters that optimize the objective function.

Dynamic aperture optimization
In the presence of strong chromatic sextupole magnets in the 4-nm lattice of UVSOR-IV, the nonlinear beam dynamics result in reduction of the DA as shown in Fig. 2. In order to improve DA the total number of sextupole families has been increased from 2 to 6 to create more degrees of freedom to control nonlinear beam dynamics.Four of sextupole families called harmonic sextupole families are used as free parameters with the remaining two families used for chromaticity correction.The harmonic sextupoles around the short straight sections and those around the long straight sections are independently tuned.
The most straight forward way to optimize the harmonic sextupole strengths is completely surveying the sextupole strengths.If we examine at least 10 values for each harmonic sextupole strength, the number of running the simulation code will be around 10000, which is very expensive in CPU time.To save the CPU time, decreasing the number of running simulation code is important.Using a global optimization algorithm has better performance on time.Here, we used Bayesian optimization method by using GPyOPT algorithm [25].This algorithm gives the optimum parameters by modeling the data points with Gaussian process regression and using acquisition functions to filter out the maximum information about the location of the global maximum.Therefore, it can approach to optimum parameters in small number of iterations as shown in Fig. 3.In this calculation, the DA evaluated using particle-tracking simulation, ELEGANT, is objective function for each trial solution.For the acquisition function which is defined as the target for selecting next trial solution, we chose the lower confidence bound (LCB) [26] with GP model as a prior function.Since LCB acquisition function is implemented for minimization, a negative sign is added to DA to increase it through optimization.Figure 3 (up) represents the distance between consecutive's evaluations in terms of the number of times.Each time, the objective function is evaluated.Figure 3 (bottom) shows the best evaluated DA at each iteration.As can be seen from Fig. 3 (bottom), Bayesian optimization method can approach the optimal harmonic sextupole strengths after 50 iterations (it takes around 3 hours).While the surveying method to find the optimal harmonic sextupole strengths needs at least 10000 number of running simulation code which requires approximately 7 processor days to complete.

Conclusion
In this paper we studied the optimization of sextupole parameters in order to improve DA of UVSOR-IV, new lattice for future plan of UVSOR.Due to the time-consuming of DA evaluation by particle tracking simulation, an effective optimization algorithm is needed.Here Bayesian optimization has been used to optimize harmonic sextupole families to improve DA.Our results show that optimal harmonic sextupole strengths are found after 100 times iteration (around 3 hours) that is much faster than the traditional (surveying) method which takes 7 days for computation.Furthermore, Bayesian optimization is expected to be powerful to optimize multi-dimensional objective functions.Therefore, it should be effective when we have more free parameters to control the nonlinear effects on beam dynamics such as more harmonic sextupole families and including their placements as free parameters.Although the number of iterations increases by increasing the dimensions of objective function, it should be much more faster than traditional methods in multi-dimensional systems.

Figure 1 .
Figure 1.Lattice function of 1 GeV storage ring for UVSOR-IV.Upper part shows the horizontal (blue) and vertical (red) betatron functions and the lower part shows the dispersion function along the ring.Bending magnets and quadrupoles shown as yellow and green strips, respectively.

Figure 2 .
Figure 2. Dynamic aperture of the optic.The particle tracking has been run for 1024 turns passing through the storage ring.

Figure 3 .
Figure 3. Convergence plots of Bayesian optimization method .Figure4shows DA for the optimized sextupole settings.The DA is obtained for four harmonic sextupole families found by using Bayesian method.As shown in Fig.4, the horizontal aperture increased to -40 to 19 mm and vertical aperture increased to 9 mm.The total DA improvement evaluated by GPyOPT algorithm increased 4.8 times.

Figure 4
Figure 3. Convergence plots of Bayesian optimization method .Figure4shows DA for the optimized sextupole settings.The DA is obtained for four harmonic sextupole families found by using Bayesian method.As shown in Fig.4, the horizontal aperture increased to -40 to 19 mm and vertical aperture increased to 9 mm.The total DA improvement evaluated by GPyOPT algorithm increased 4.8 times.

Figure 4 .
Figure 4. Optimized dynamic aperture of the UVSOR-IV storage ring.