1. Introduction
Particle accelerators are complex instruments that require constant operator supervision and control to produce high-quality beams for use in a variety of scientific endeavors. Often, this requires measuring beam attributes that have a high impact on accelerator applications, most notably, the transverse beam emittance. A common method of measuring beam emittances is a quadrupole scan [
1], where a quadrupole is used to rotate the transverse beam distribution in phase space while measuring the projected beam size on a downstream diagnostic screen.
Quadrupole scans are relatively straightforward to perform manually or automatically given prior measurements or knowledge of beam properties in the accelerator. The quadrupole strength is scanned at fixed intervals between upper and lower bounds, predetermined by operators based on prior experience or beam dynamics simulations. Quadrupole focusing strengths must be chosen such that the beam remains within the confines of the diagnostic screen and is focused enough to be resolvable above background noise in screen measurements in order to guarantee that measurements of the beam size are accurate. On the other hand, a wide range of focusing strengths must be used to sample multiple phase advances in order to accurately calculate the beam emittance.
This beam size sampling method works well for repeated measurements of beam emittances in well-understood beamline configurations. However, it becomes inefficient to perform quadrupole scans in novel contexts such as varying operational conditions or new beamlines. Determining the sample spacing and the lower and upper bounds of fixed quadrupole scans is a tedious and inefficient trial-and-error process that must be repeated for each beamline and operating configuration. As a result, it is challenging to use quadrupole scans for emittance measurements when performing optimization of upstream beamline parameters. This is especially true if upstream beamline parameters significantly affect the beam size and divergence at the quadrupole scan location, which in turn alters the range of quadrupole strengths that lead to valid beam size measurements.
These challenges also present a barrier towards future autonomous operation of accelerator facilities. Emittance measurements using the quadrupole scan method require substantial operator oversight to configure, monitor and validate the results. Beam size measurements are often subject to errors due to noise and uncertainties. Reconstructions of the beam phase space distribution using least-squares fitting of experimental data can be strongly influenced by these errors. Even small errors in the determination of beam matrix elements from this fitting can have major ramifications for calculating the beam emittances due to catastrophic cancellation effects. For example, if the true transverse phase space has the second-order beam moments , then the beam has a emittance of . However, a 5% error in the determination of () results in an emittance measurement error of 24% (). This limits the accuracy of least-squares fitting techniques for determining the beam emittance, and in the worst case, can result in physically invalid (imaginary) emittance predictions. Emittance measurement algorithms used in the context of autonomous accelerator operations need to be robust to these potential errors and produce only physically valid predictions of the beam emittance.
In this work, we introduce and demonstrate a “turn-key” technique for robust, autonomous characterization of beam emittances with calibrated uncertainty estimates that requires little to no operator oversight. Our method uses a model-based algorithm, built from scratch, to autonomously choose quadrupole focusing strengths that maximize information gain about the beam size response. We then use robust statistical regression techniques to fit experimental measurements of the beam size as a function of quadrupole strength, taking into account beam dynamics principles and measurement noise. Samples drawn from the statistical model are then used to produce a detailed probability distribution of possible emittance values. This technique is demonstrated in an experiment conducted at the Argonne Wakefield Accelerator.
2. Materials and Methods
Here we detail our algorithm for sampling beam sizes at different quadrupole strengths and analyzing beam size data.
2.1. Conducting Autonomous Beamsize Measurements
Our algorithm for selecting the quadrupole strengths at which we measure the beam size is an adaptation of the Bayesian optimization [
2] algorithm. Bayesian optimization starts by creating a statistical model of an objective function, known as a Gaussian process [
3] (GP), to make predictions of the mean function value and corresponding uncertainty using previously measured data and expected function smoothness. This model is then used by an acquisition function to forecast the anticipated value of making future measurements. The acquisition function is then maximized to select the next parameter setting to measure.
Instead of optimizing the objective function, our algorithm, coined
Bayesian exploration [
4], aims to characterize the objective function (in this case the beam size) as a function of quadrupole strengths by choosing measurements that have the highest predicted uncertainty. This process is shown in
Figure 1. Given a set of previous measurements
of the RMS beam size, a GP model produces both a prediction of the beam size (
) as a function of quadrupole focusing strength and the corresponding uncertainty (
) of that prediction. The acquisition function is defined as
and is maximized to select the next value of
x to be observed. This, in turn, causes the sampling algorithm to choose points that maximize model uncertainty, thus maximally increasing the information gained about the beam size dependence for each experimental measurement. In one-dimensional problems, such as quadrupole scans, this algorithm will sample points in a quasi-grid like pattern, depending on the distribution of initial sample points.
In addition to this intelligent sampling strategy, our algorithm also considers observational constraints that need to be satisfied during characterization. For quadrupole scans, primary constraints involve ensuring valid beam size measurements by keeping the beam within a region of interest on the diagnostic screen and ensuring that the beam is focused enough to be discernible from background noise. As a result, the range of quadrupole strengths that result in valid beam size measurements is strongly dependent on upstream beam parameters and beamline configuration. Bayesian exploration prevents the selection of invalid quadrupole parameters by building independent GP models of each constraining function and using them to predict the likelihood that a given quadrupole strength satisfies the constraints. This process is shown in
Figure 1. We determine the likelihood of an input point meeting the constraint by integrating the GP model’s predicted probability distribution over constraint-compliant values. The acquisition function is scaled by this likelihood, which lessens the chance of selecting future measurements with a low probability of satisfying the constraint.
We developed a specific constraining function to effectively reduce the frequency of invalid beam size measurements in the context of imaging diagnostics. For GP models to effectively predict where input points satisfy the given constraints, the constraining functions must have a relatively smooth dependence on input parameters. To satisfy this requirement, we developed what we will refer to here as a “bounding-box” constraint, as shown in
Figure 2. We specify a circular region of interest (ROI) in screen images with a center pixel coordinate
and a radius
r (also given in pixels). After processing the raw screen image of a beam (using a Gaussian smoothing filter and a fixed minimum threshold), we calculate the weighted centroid and RMS size of the beam intensity inside the ROI in both the vertical and horizontal directions. We then create a rectangular bounding box centered at the beam centroid with side lengths equal to four times the RMS beam sizes in each direction, which encapsulates most if not all of the beam intensity on the screen for observed beams. The constraint function is then defined by the maximum distance between the ROI center and the bounding box corners,
, where
denotes the pixel coordinates of each bounding box corner. If the beam bounding box is inside the circular ROI, then this constraining function is negative; conversely, if it extends beyond the bounding box boundary, then the constraining function value is positive. To prevent diffuse beams we use a constraint on the total intensity of all pixel values inside the ROI, requiring a minimum intensity for valid beam size measurements. If individual measurements of the beam do not satisfy all of these constraints, the measurement of the beam size is discarded while constraining function values are retained, as shown in
Figure 3.
2.2. Calculating Emittances
Once beam size data has been collected, we determine the distribution of possible emittances from the data by drawing samples from a GP trained on the data set combined with a physics-informed kernel function. It is known from first-order beam dynamics that the beam size squared should have a quadratic dependence on the focusing strength of the quadrupole, so in turn, we use a second-order polynomial kernel for the GP model. As a result, samples drawn from the GP model will also have quadratic dependence on the quadrupole strength (see
Figure 4). A corresponding emittance value for each sample is calculated by fitting each functional sample independently to the analytical model of beam transport through a quadrupole and drift, resulting in a distribution of emittance values from the GP model of the beam sizes. GP samples that predict negative beam sizes or imaginary emittances are dropped from the distribution in a process known as rejection sampling.
2.3. Experimental Demonstration
We conducted an experimental demonstration of automatic emittance measurements at the Argonne Wakefield Accelerator (AWA) [
5]. Our study attempted to characterize the beam emittance of beams exiting the accelerating section of the AWA beamline using a single quadrupole magnet (effective length 0.12 m) and a YAG diagnostic screen located 1.065 m downstream. First, the beam was centered on the screen and manipulated by upstream quadrupoles to fit within the ROI. Then, we used the python library Xopt [
6] to sample four chosen points to create an initial data set. Xopt was then used to perform constrained Bayesian exploration as described in the previous sections with a Gaussian process. After a fixed number of iterations, the algorithm was terminated and the data was used to calculate a distribution of possible emittances.
3. Results
Results from the experimental demonstration are shown in
Figure 3,
Figure 4 and
Figure 5. In
Figure 3 (left), we observe that Bayesian exploration distributed beam size measurements evenly throughout the valid input space of quadrupole strengths.
Figure 3 (right) shows that the constraining function was learned during the exploration process, resulting in only three measurements that violated the constraint.
Figure 4 shows samples drawn from the GP model. An emittance value is calculated for each sample using a second-order polynomial fit to calculate elements of the beam matrix. Samples that predict an imaginary beam emittance (approximately 10% for the data sets shown here) are considered “invalid” and are rejected.
Figure 5 shows predictions of the beam emittance from valid samples drawn from the predictive beamsize model. Our algorithm predicted a horizontal emittance of
mm.mrad and a vertical emittance of
mm.mrad. Furthermore, our algorithm identified the asymmetry in the probability distribution, with longer tails below the median value. Finally, our algorithm predictions are consistent with conventional least-squares fitting of the experimental data, which predicts transverse emittances of
mm.mrad and
mm.mrad.
Despite relatively small uncertainty in the predictive beamsize model, there is still significant uncertainty in the beam emittance. It is likely that these large uncertainties are a result of a combination of factors, including the noisy measurements and catastrophic cancellation effects described earlier. The well-calibrated uncertainty metrics produced by our algorithm can be used to inform optimization algorithms for tuning upstream beamline parameters.
4. Discussion
Our results show that this algorithm is successful in automating the quadrupole scan process given arbitrary upstream beamline parameters, thus reducing the burden on accelerator operators when emittance measurements are needed. The algorithm can select quadrupole strengths to rotate the beam in phase space while adhering to practical constraints that provide valid beam size measurements. This enables future attempts to automate the optimization of beam emittances at AWA and other accelerator facilities.
This method can be further improved through several means. First, beam size measurements at every shot can be used in creating the predictive model, as opposed to using averaged measurements, which would improve the accuracy of uncertainty estimates of the emittance due to jitter. Second, the speed of decision making in the algorithm could be increased by using a mesh numerical optimizer of the acquisition function, since the decision space is only one-dimensional. Third, to promote efficient sampling of quadrupole strengths on each side of the beam size minimum, the upper confidence bound acquisition function [
7] can be used with a large
parameter to bias exploration towards quadrupole strengths that are closer to the observed beam size minimum. Finally, instead of using the beam images to calculate RMS beam sizes for fitting a polynomial model, the entire image can be used to accurately reconstruct the transverse phase space distribution, as is done in [
8].
Author Contributions
Conceptualization, R.R. and A.E.; Data curation, R.R.; Formal analysis, R.R.; Funding acquisition, A.E.; Investigation, R.R., S.K. and E.W.; Methodology, R.R., D.K. and A.E.; Software, R.R. and D.K.; Supervision, A.E. and J.P.; Validation, R.R.; Visualization, R.R.; Writing—original draft, R.R., D.K. and A.E.; Writing—review and editing, R.R., D.K. and A.E. All authors have read and agreed to the published version of the manuscript.
Funding
This work was funded by the U.S. Department of Energy, Office of Science, Office of Basic Energy Sciences under Contract No. DE-AC02-76SF00515.
Data Availability Statement
Conflicts of Interest
The authors declare no conflict of interest.
References
- Minty, M.G.; Zimmermann, F. Measurement and Control of Charged Particle Beams; Springer Nature: Berlin/Heidelberg, Germany, 2003. [Google Scholar]
- Shahriari, B.; Swersky, K.; Wang, Z.; Adams, R.P.; de Freitas, N. Taking the Human Out of the Loop: A Review of Bayesian Optimization. Proc. IEEE 2016, 104, 148–175. [Google Scholar] [CrossRef]
- Rasmussen, C.E.; Williams, C.K.I. Gaussian Processes for Machine Learning; MIT Press: Cambridge, MA, USA, 2006; Volume 103. [Google Scholar]
- Roussel, R.; Gonzalez-Aguilera, J.P.; Kim, Y.K.; Wisniewski, E.; Liu, W.; Piot, P.; Power, J.; Hanuka, A.; Edelen, A. Turn-key constrained parameter space exploration for particle accelerators using Bayesian active learning. Nat. Commun. 2021, 12, 5612. [Google Scholar] [CrossRef] [PubMed]
- Conde, M.E.; Antipov, S.P.; Doran, D.S.; Gai, W.; Gao, Q.; Ha, G. Research Program and Recent Results at the Argonne Wakefield Accelerator Facility (AWA). In Proceedings of the IPAC2017, Copenhagen, Denmark, 14–19 May 2017; p. 3. [Google Scholar]
- Roussel, R.; Mayes, C.; Edelen, A.; Bartnik, A. Xopt: A simplified framework for optimization of accelerator problems using advanced algorithms. In Proceedings of the IPAC’23—14th International Particle Accelerator Conference, Venice, Italy, 7–12 May 2023; JACoW Publishing: Geneva, Switzerland, 2023; pp. 4796–4799. [Google Scholar]
- Srinivas, N.; Krause, A.; Kakade, S.M.; Seeger, M.W. Gaussian Process Optimization in the Bandit Setting: No Regret and Experimental Design. In Proceedings of the 27th International Conference on Machine Learning (ICML 2010), Haifa, Israel, 21–24 June 2010; pp. 1015–1022. [Google Scholar] [CrossRef]
- Roussel, R.; Edelen, A.; Mayes, C.; Ratner, D.; Gonzalez-Aguilera, J.P.; Kim, S.; Wisniewski, E.; Power, J. Phase Space Reconstruction from Accelerator Beam Measurements Using Neural Networks and Differentiable Simulations. Phys. Rev. Lett. 2023, 130, 145001. [Google Scholar] [CrossRef] [PubMed]
| Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).