New techniques method for improving the performance of the ALPI Linac

The superconductive quarter wave cavities hadron linac ALPI is the final acceleration stage at the Legnaro National Laboratories. It can accelerate heavy ions from carbon to uranium up to 10 MeV/u for nuclear and applied physics experiments. It is also planned to use it for re-acceleration of the radioactive ion beams for the SPES (Selective Production of Exotic Species) project. In this article, we will present the innovative results obtained with swarm intelligence algorithms, in simulations and measurements. In particular, the increment of the longitudinal acceptance for RIB (Radioactive Ion Beams) acceleration, and beam orbit correction without the beam first-order measurements will be discussed.


The superconductive linac ALPI and recent results
The Legnaro National Laboratories heavy ion accelerator facility is composed of two injectors (one superconductive RFQ and a Tandem type accelerator) which supply the beam to the superconductive folded linac ALPI.The linac is composed of 20 cryostats which house four Superconductive Quarter Wave Cavities each.Each cavity must be independently tuned with the beam during the runs.The ALPI linac was one of the first prototypes in Europe, designed and built between the 80'-90' and it exploited many innovative techniques at that time [1].At the design stage, the superconductive cavities accelerating field was designed to achieve 3 MV/m with a diameter bore of 20 mm diameter.To maximize the real estate of the machine, the base lattice period of ALPI was designed with one triplet for transverse focusing and 2 cryostats (8 cavities).The cavity bores, the accelerating field improvements during its construction (the accelerating field was increased from 3 MV/m to 5 MV/m), and the lattice design, forced a very aggressive transverse focusing, which resulted in a transverse phase advance of about 120 deg (see figure 1).Such transverse phase advance makes the linac sensitive to beam misalignment.Another important fact to consider for the experiments presented in this paper: the transverse positions of the cavities have an error of 1 mm when cooled down, while, when they are at room temperature, the error can reach several millimeters, further closing the aperture.This was the situation when we tested the algorithm.
The high fields and aggressive lattice design forced us to use the alternate phase focusing technique on the synchronous phases of the cavities, to cope with the higher electric field and reduce the longitudinal phase advance below 180 deg.However, it reduces the longitudinal acceptance of the linac.We addressed this issue in a recent paper [2], where we applied the Particle Swarm Optimization (PSO) technique [3] to increase the longitudinal acceptance of the linac.The acceptance was calculated using the following method: the longitudinal phase space input was uniformly populated, resulting in the formation of a large emittance beam; the beam was then tracked through the linac.The surviving macro-particles at the end of the linac were back-tracked to the input.We were able to double the longitudinal acceptance (see figure 2) with respect previous value.However, this solution required an efficient steering procedure, because the new synchronous phases of the cavities, found by the PSO, increase the RF defocusing effects.However, because the steering procedure is very troublesome in ALPI, as explained in [1], we proposed a different procedure (based on PSO) that targets the beam transmission directly, adjusting the steerer's strengths.We verified it in simulations and then we applied it to the real ALPI linac obtaining an increase of transmission from 24% (manual setting) to 35% (automatic setting).For that particular linac configuration, the expected transmission was 50%.
-1 -  -2 -2 Implementation in the real accelerator ùThe application of these methods was possible on the real machine due to the last year's implementation of the EPICS layer.It allows, within the many features, to control the PVs of the power supply (PS) and the diagnostic outputs directly from Python scripts.The main bottleneck for the application of the PSO on the transport optimization, found during the steerer experiments [2], was the time taken by the PSs to reach the required values by the routine.As an example, a too-fast variation of the steerer strengths brought to a fault of the PSs, therefore a power ramp had to be implemented by software.As a result, the tests had to be weakened both in terms of the number of swarm components and iterations, to reduce the time required to complete the procedure and to find the solution.However, thanks to the good preliminary results obtained in these preliminary tests [2], we decided to expand the procedure to all the transverse optics, composed of steerer and quadrupole strengths, and dipole fields, to be optimized at the same time.

Transverse optics optimization tests
We performed the test with the beam 32 S 9+ @ 135 MeV, 1.05 Tm rigidity, and 130 nA current, from TANDEM (electrostatic accelerator), which is one of the injectors of ALPI.The beam produced (coasting beam) was transported through ALPI, up to the half of the line (due to maintenance operation on the other second half), which terminates with a Faraday Cup (FC) (see figure 3).The cavities were at room temperature and therefore suffered from the misalignment presented in 1.The ALPI line is composed of two doublets, nine triplets, three dipoles, and six horizontal and vertical steerers.From the TANDEM exit, all diagnostics, quadrupoles, dipoles, and steerers were controllable by EPICS.The electrostatic lens and steerers of the injector, instead, were not under the control of the EPICS layer.In the beginning, the beam was transported up to the FC manually in three hours.It was possible to achieve a transmission of 50% from the Tandem exit.The working environment was quite troublesome due to the instabilities of the machine.Then, a general optimization which also involved the negative sputtering ion source, the TANDEM electrostatic lens (not under EPICS control), and the linac, after four hours, brought the transmission up to 90%.The transverse -3 -optics setting (which included the steerers, the dipoles, and the quadrupole from the TANDEM exit) was recorded.However, at the start of the experiment, three hours later, due to the machine's instabilities, the transmission with the reference set gave zero current at the target FC.After a quick manual adjustment of the only ALPI transverse optics, we were able to retrieve at least 35% transmission.We recorded again the solution and called it a reference solution.It was decided then to start the experiment from this situation, without adjusting the injector parameters.The reference solution was used to build up the population distribution at the initial iteration.We defined a variation range vector Δp.The components of this vector contain the ranges of variations of each element of the line such that: Where p * ∈  ⊂ R  components are the values of the lens/steerers/dipoles of the reference solution.
is the number of parameters involved in the study, in this specific case equal to 37.Then, we defined the initial deposition vector (which impacts on the starting position at the initial iteration of the population), Δp  = Δp/  such that: In such a way that [p min, , p max, ] ⊂ [p min , p max ].Therefore, we could control the initial distance of the values of the components of the population compared to the reference one: the larger   value, the closer the initial positions of the population will be compared to the reference values.This allowed us to check also the effect of the hysteresis that resulted particularly important for the dipole magnets.Figure 4 shows the concept described above.On the first trials, we supplied directly to the population ensemble a component with the reference set.Therefore, at the first iteration, while all the other components of the swarm resulted in 0 transmission (due to the initial randomize values) at the FC, the reference solution showed a non-zero -4 -transmission.It is important to mention that a full range variation (see table 1) of any element of the line compared to the reference solution, was able to decrease the transmission down to 0. The individual and social coefficients were found to be most effective with 0.5 and 2 respectively.Therefore, strong social behavior pulled the swarm close to the reference solution on these initial iterations.However, after some time, we decided to modify the initial steerer (INST1) of the reference solution setting it to 0 strength (the transmission of the reference set resulted in 0 then), and we doubled its variation range.The reason for that was that we noticed that in our linac the initial conditions (mainly the first-order moments) were not stable at all during the run time; therefore we allowed more freedom to the algorithm to choose the proper initial steerer values to try to counteract this.Moreover, we wanted to test the exploration behavior of the PSO (for finding a non-zero solution starting from the initial "0 currents" population).At the last test, we were able to reach the total variations reported in table 1.The hyper-parameters of the PSO were explored by looking at the following two criteria: the best transmission value reached at the FC positioned at the end of the line and the time taken by the algorithm to find it.This last point was critical because every swarm component evaluation required an average of 7 seconds (to reach the field values and stabilize the current readback) to be evaluated.Therefore, the algorithm requires order of hundreds of evaluations (850 for this case).To keep the time taken by the algorithm below 1.5 hours, we had to reduce the number of swarm populations.Moreover, one mitigation strategy was adopted, which involved a two-stage evaluation of each component of the swarm: three seconds after the EPICS command, the current at the FC is recorded (the fields of the magnets were normally halfway to the target value); if the result was zero current, the swarm component was assigned zero current; if some current above a certain threshold was recorded, then the algorithm waited other 4 seconds (to let stabilize the current) and then stored the actual current.This strategy allowed to speed up the algorithm in the very first iterations, where the large range of variations of the parameters normally led to unusable zero-current solutions.
Table 2 reports the final parameters used.Parameter value p is the number of the population in the swarm: each of  p is composed of 38 parameters (lives in a 38-dimensional space), divided between dipoles, quadrupoles and steerers.Δ is the total time given to the algorithm. 1, ,  2, are respectively the initial individual and social parameters.They are -5 -usually modified after the first iteration but the value reported proved to be beneficial for convergence purposes.One interesting point discussed the variations in bending magnets: the dipoles in ALPI have a significant impact on hysteresis.Small variations used during the tests, around 0.3%, could move the beam position completely out of frame, keeping the hysteresis effect under control.However, a tested variation of 0.9% led instead to a too-large effect of hysteresis that affects the PSO algorithm.
The following plot shows the initial and final population distribution of the vertical steerers (left plots) and quadrupole gradients (right plots) in PS units (figure 5).It is interesting to notice the following characteristics: the final population of the steerers shows non-zero values for the first vertical steerer after the injector (i.e.INST1V), while the reference one (violet line) at the initial iteration was 0. This indicates that the first-order moments at the line input changed during the procedure.As far as the quadrupole gradients are concerned, they showed generally higher values (between 5-10%) of the gradient compared to the initial reference solution in the periodic lattice zone (between AL3Q1 and AL3Q5).The latter result indicates that the steering solution found by the PSO is valuable in reducing the first-order moments: it allowed to increase in the quadrupole gradient values, going towards the 120 deg transverse phase advance.This value is normally not reached manually because of the large steering in the line, which forces it to decrease the focusing strength.To investigate further the behaviour of the algorithm during iterations, we looked at the evolution of the FC current compared to the iterations of three swarm components, as shown in the upper plot of figure 6: the best one (blue), the reference (orange) and a control one (green)).
It is possible to see that after 0.5 h (15 th iteration) the algorithm was going to find a maximum in the current at the FC (upper plot) through the best component.However, something happened -6 - and the best population component showed a sudden decrease trend of current.After some search, the swarm could find a new set that retrieves and improves the transmission.The information was supplied by the other population components, such as the control component (green).To understand what changed, we looked at all the lens and steerer values of the best component.The lower plot in figure 6 shows the best component's first vertical steerer power supply values (after the injector).From the analysis, the current was retrieved after the event at 15 th iteration by increasing the vertical initial steerer strength (around 27 th iteration).Therefore, the event that decreases the current at 15 th iteration

Figure 1 .
Figure 1.ALPI lattice beam envelopes (transverse xy in the upper plot and longitudinal in the lower plot) with  0 = 120 deg.Cavities gaps are indicated by yellow ellipses, while triplet structures are indicated by blue rectangles.Blue curve is the x envelope, while red curve is the y envelope.

Figure 2 .
Figure 2. a) alternate phase-focusing acceptance ellipse (green) superimposed to the ALPI longitudinal acceptance.b) PSO-optimized acceptance ellipse (blue) superimposed to the ALPI PSO-optimized longitudinal acceptance.The acceptance is shown in the longitudinal phase space plane.

Figure 3 .
Figure 3. Sketch of the experimental line used for the tests.It corresponds to half the ALPI section.The main line elements are shown: triplets and doublets (orange and green rectangular), dipoles (blue), steerers (violet) and cavities (black).the input beam direction and the target FC (endo point) are indicated, as well as the first steerer after the injector and the last elements before the periodic line.

Figure 4 .
Figure 4. Sketch of the logic of the swarm initial distribution for an arbitrary parameter Ī .The deployment range (red dashed line), the full variation range (black solid line), the reference solution values (blue) and examples of swarm component (violet) are shown.

Figure 5 .
Figure 5.Initial and final population of the steerers (left) and quadrupoles (right).The initial population deployment intervals and the total variation boundaries are shown.

Figure 6 .
Figure 6.Upper plot: trend of current at the I FC compared to the iterations of three components of the swarm.The component which will give the higher current is called the best (blue), the reference (orange), and the control one (green).Lower plot: the trend of the power supply of the first vertical steerer after the injectors of the best component, compared to the iterations.The evolutions of the 25 components of the swarm are shown.The best component is highlighted with blue markers along a blue line.