Ion microscopy with evolutionary-algorithm-based autofocusing

Ion microscopy is an established technique for laser focus diagnostics and the accurate, intensity-resolved measurement of laser ionization processes. In the present feasibility study, we discuss a new ion microscope design, which improves its resolution across a large range of magnifications and simplifies its operation. Instead of the common two einzel lens configuration, which is usually optimized for a fixed magnification, we propose a generic design consisting of an array of equally spaced ring electrodes, whose individually adjustable voltages are controlled by an evolutionary algorithm. In this way, we can realize aberration minimized magnifications between 25 and 100. Moreover, the algorithm can adjust the voltage settings under changing experimental conditions and facilitates autofocusing for user-defined magnification.


Introduction
Time resolving and controlling the dynamics of nonlinear light-matter interaction on the shortest time scales is the main concern of attosecond science [1]. As one of the fastest processes, ionization by focused laser pulses plays a fundamental role in most ultrafast physics experiments. However, the inherently nonlinear ionization signal is usually collected and averaged over the intensity distribution in the focal volume. It is probably fair to say that the blurred vision of ultrafast dynamics caused by focal averaging is one of the major obstacles when it comes to increasing the precision of ultrafast science experiments. Different approaches have been developed to address this problem, such as spatially filtering the ionization signal produced in an unfocused laser beam [2], or the method of intensity-selective scanning [3], where the signal is confined with an aperture in the propagation direction of the laser beam. Three-dimensional confinement was achieved by more sophisticated ion time-offlight methods [4,5]. Ion microscopy (IM) was introduced a decade ago [6]. The method is based on spatially resolved time of flight mass spectroscopy. The assets of IM are twofold: On the one hand, it allows intensityresolved measurements, and on the other hand, it facilitates non-invasive in situ focus diagnostics [7,8]. The IM technique has played a key role in numerous studies [9]. In particular, it has allowed the study of strong-field ionization at intensities beyond saturation [6,10] and provided important insight into XUV-matter interactions [8,11,12]. Recently, ion microscopy has also been applied to the study of Rydberg atoms in strong electric fields [13,14].
Until now, ion microscopes have typically been optimized for a specific magnification. Any change in magnification results in increased aberrations and a loss of resolution. Here, we propose to overcome this problem by means of a novel generic design in combination with an evolutionary algorithm. We demonstrate a nearly constant resolution better than 3.5 μm for magnifications between 25 and 100. Here and in the following, we use the standard deviation of the mapped particle positions as a measure for the resolution. Furthermore, the algorithm facilitates auto-focusing for a user-defined magnification, which is a multidimensional optimization task with respect to the voltage settings. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.

Description of the design
In state-of-the-art ion microscopes, charged particle imaging typically involves an arrangement of annular electrodes in a high vacuum environment. Figure 1 illustrates the principle. Ions are generated from a target gas in the laser focus between a repeller and an extractor electrode. They are subsequently accelerated towards a position-sensitive detector by an electrostatic field that is controlled via the electrode voltages. Usually, the geometry of the device is optimized for a specific magnification, with electrodes arranged in einzel lens configuration at fixed positions in the device. In practice, both the geometry and the voltage settings required for a sharp image are inferred from simulations. However, deviations from the nominal voltages resulting from the finite precision of the voltage supply and/or laser-focus positioning make voltage adjustments unavoidable.
In the absence of salient features in the ion distribution, which would provide an objective criterion for the sharpness of the image, these manual voltage adjustments remain rather inaccurate. In order to automatize this challenging procedure, we have implemented an evolutionary algorithm that enables the optimization of the computer-controlled electrode voltages during experiments. To be more specific, we applied the so-called differential evolution algorithm [15] and use the measured image as feedback for the optimization.
The automatized voltage optimization, in turn, allows increasing the parameter space and the use of a larger number of electrodes. In the present work, we introduce a generic design with 23 evenly spaced electrodes, including a disk-shaped repeller and 22 annular electrodes with an inner diameter of 26 mm. The electrodes are 2 mm thick and separated by a gap of 10 mm. During the optimization, the electrode potentials are allowed to vary between 0 kV and 10 kV. Simulations showed that the best solutions are obtained when only the repeller voltage and that of the first 15 electrodes are considered for the optimization, while the remaining electrodes are grounded. A detailed drawing of the setup and a discussion of the number of active electrodes are provided in section 1 of the supplementary material.

Simulation
To test the feasibility of our scheme, we simulated our Generic Ion Microscope (GIM) using SIMION-8.1 [16], which allows for calculating electrostatic fields and ion trajectories for a given set of electrode voltages. The grid size used to model the geometry was set to 0.2 μm, since a further increase in resolution had no significant effect on the calculated ion trajectories.
In the following, we will refer to the detector's axis of symmetry as the x-axis, while the y and z-directions span the object and image plane (cf figure 1). For the ion trajectory calculations, singly charged argon ions are launched between repeller and extractor, which is in our case the first annular electrode. The field of view (FOV) of the microscope is centered around the x-axis. In the first part of this paper, where we test the performance of our new IM design, the starting positions of the ions are randomly distributed on a Cartesian grid in the (y,z)plane (cf figures 3 and 4). The initial x-coordinates of the starting positions are uniformly distributed within an interval dx = 0.1 mm centered at the object plane. The ion's initial energies are set to 50 meV, while their emission directions are distributed isotropically.
The differential evolution algorithm employed to optimize the electrode voltages is described in more detail in section 2 of the supplementary material. Briefly, the algorithm creates a new generation of voltages from a linear combination of those from the previous generation. Out of these, the best-performing members are selected based on a loss function. The process is then repeated until the convergence criterion is met.
The loss function L that measures the performance of a given voltage set is defined as Here, N = 36 is the number of ions launched at predefined positions in the object plane, M N is the number of ions that reach the detector with splat positions y i and z i (i = 1, K , M), andȳ i andz i are the coordinates of the target positions determined from the initial position and the specified magnification. The loss function provides an upper limit for the deviation from the target positions. When a particle misses the detector, the loss function is increased by a constant C, corresponding to twice the squared detector radius measured in the same units as L.
In case none of the ions reaches the screen, the loss function evaluates to L = CN. In the following, we denote this optimization method as the 'grid optimization'. Since the initial ion position is not accessible in a real experiment, a realistic optimization procedure has to be performed with the entire ion distribution, instead. To this end, we shift the laser focus to various predefined positions along a grid in the object plane. Because of the cylindrical symmetry, it is sufficient to move the focus position only along the z-direction across the field of view. The resulting images of the shifted distribution are depicted in figure 2.
The shifted distributions are then compared with the initial unshifted one, taking into account the applied amount of shift and the nominal magnification. More specifically, we estimate the mean of the splat positions and their variance along the z-axis. From this, we determine three different quality criteria. The first one, Δμ, is the absolute difference between the initial and the shifted beam's center coordinates in z after subtracting the applied shift times magnification.
The second one is the difference Δσ 2 between the variances of the initial and the shifted beam along z, and the third one is the variance σ 2 of the shifted beam along z. Giving preference to small variances ensures that the optimum resolution is reached for the respective magnification. More concretely, for a magnification mag and a number of N g = 3 evaluated laser positions we choose the loss function The relative weights of the different terms in the loss function were determined empirically via simulations to w 1 = 2.5, w 2 = 150, w 3 = 300 and were found to yield a good balance between correct magnification and small variance as compared to other weight combinations investigated. In case less than 20 ions reach the detector, the loss function is set to a large constant value. In the experiment, this would correspond to a significantly smaller number of detected ions than expected and would indicate that most ions hit some other part of the microscope than the detector. In order to demonstrate the feasibility of such an experimental procedure, we simulate its outcome by sampling a three-dimensional Gaussian ion distribution in the object plane, with a full width at half maximum FWHM x,y,z =10 μm, 100 μm, 10 μm in the x, y, z-directions, respectively. The distribution was sampled with 800 ions for each focus position. In order to accelerate the convergence, we gradually increase the number of sampled ions up to 800 in the course of the optimization. In the following, we denote this optimization method as the 'focus optimization'.

Results and discussion
To assess the performance of the GIM, we compare it to existing ion microscope designs based on two electrostatic einzel lenses. In the simulations, we use a design similar to that of the IMT12 (Stefan Kaesdorf GmbH [17]) as a reference for an einzel lens microscope (ELM). In the following, we apply the differential evolution algorithm to both the GIM and the ELM in order to determine the optimum voltages for a given magnification. The comparison is performed for a range of magnifications between 25 and 100. The electrode voltages are allowed to vary between 0 kV and 10 kV.
Repeating the simulations presented below for higher maximum electrode voltages of 15 kV and 20 kV, we found that the use of higher voltages only results in a marginal improvement of the resolution for the GIM and no notable improvement for the ELM. For practical implementation, this gain in resolution has to be balanced with the additional costs of the high voltage supply.
Our comparison is first performed using the grid optimization. In figure 3 we consider the magnification of 100. For both microscopes, we simulate the image of ions on a grid of radius 0.15 mm in the object plane as shown in figures 3(a) and (b). At first glance, the images obtained with the ELM and the GIM are very similar. A more quantitative analysis of the local magnification and resolution in the object plane is shown in figure 3(c). A homogeneous magnification is achieved for both designs, but the variations of the local resolution over the field of view are slightly less pronounced for the GIM.
A more significant difference between the two designs is observed for a magnification of 25. As can be seen in figure 4, the ELM image exhibits significant aberrations, i.e. a radial increase of the local magnification. In contrast, those aberrations are much less pronounced in the GIM image for which the local magnification is essentially homogeneous over the entire field of view. This results in a local resolution better than 3 μm while having a large field of view at the same time.
The high versatility of the new design becomes apparent in figure 5. The algorithm was allowed to run up to three times in a row for each magnification and was given the best solution of the next larger magnification or of the previous run as a member of the starting population. As presented in figure 4, the ELM image suffers from significant aberrations at low magnifications and large distances from the microscope axis. To allow a comparison with the GIM, we restrict the field of view in figure 5 to ions landing within a disk with a radius of 10 mm on the detector. The results demonstrate that while for the ELM, the resolution deteriorates towards lower magnification, the resolution of the GIM is mostly independent of the magnification. The worst resolution for the GIM within the restricted field of view is better than 1.2 μm when using the grid optimization. As a result, even at small magnifications with a large field of view, fine details of the image can be resolved with the GIM. A detailed analysis of the found solutions for different magnifications is provided in section 3 of the supplementary material.  In order to demonstrate that the presented setup and evolutionary algorithm can help determine the correct settings in a real experiment, we also evaluated the results for the focus optimization. It becomes apparent from figure 5 that the loss of information about the individual ions when using the focus optimization leads to a slight deterioration of the optimum resolution found by the algorithm. Nevertheless, the GIM reliably reaches resolutions below 2 μm for all magnifications between 30 and 100 when using focus optimization. When requiring the same absolute resolution of 2 μm for all magnifications, the smaller the magnification, the higher the demand on the relative resolution. This may explain why the algorithm had difficulties reaching the desired resolution for small magnifications within a maximum of 50 generations.
Another important aspect that needs to be considered in practice is the finite accuracy of the absolute focus position along the x-direction, which is typically limited to about ±500 μm. In addition, the finite width Δx of the ion distribution in the x-direction may influence the measurements. These effects are illustrated in figure 6, where we applied the focus optimization for three different absolute beam positions at x i ä { − 0.5 mm, 0.0 mm, 0.5 mm} (blue stars). For each of these three positions, the autofocusing algorithm achieves a resolution better than 3.0 μm in the entire field of view and hence permits to overcome the finite positioning accuracy.
In order to determine the effect of the finite width Δx, the resolution is simulated as a function of the deviation x − x i in the beam position with voltages kept fixed at their optimal values for x = x i . It can be seen in figure 6, that while the resolution deteriorates when moving away from the optimum, it remains better than 3.5 μm within a range of ±25 μm around the optimum position. This depth of field is sufficient to image typical ion distributions. This lets us conclude that the effect of laser pointing fluctuations along the x-direction is negligible as compared to their effect along the z-direction.
Finally, we also tested the influence of the finite precision of the high voltage supply on the resolution and found that uniformly distributed deviations of up to ±10 V in the applied voltages have a negligible effect on the reached resolution. This voltage precision corresponds to a realistic voltage setting reproducibility of 10 kV voltage sources, as specified by different manufacturers [18][19][20].

Conclusion
In conclusion, we have proposed a novel generic IM design combined with a differential-evolution-based autofocus that optimizes the electrode voltages automatically for a given user-defined magnification. Detailed simulations of the proposed concept have allowed us to assess its performance and compare it to commercially available state-of-the-art ion microscopes. In particular, we found that in contrast to designs optimized for a specific magnification, our generic geometry, and autofocusing algorithm facilitate a nearly constant resolution better than 3.5 μm for magnifications ranging from 25 to 100. The scheme is robust with respect to experimental inaccuracies in the voltage values and beam position. Beyond pure ion microscopy, these results may help boost the performance of other charged particle imaging techniques, such as electron imaging spectrometry [21,22], or reaction microscopy [23], opening the way to a new generation of evolutionary and machine-learning-based imaging spectroscopy techniques.