**2. Stochastic algorithms for sensorless correction**

### **2.1. Genetic algorithm**

sition [5]. Then, this information is suitably coded and passed to an AO, as a fast deformable mirror located along the optical path, that adapts its shape to compensate the time depend‐ ent aberrations. Similarly in vision science [6, 7] or retinal imaging [8-15], static and dynamic aberrations created by variation in shape of eye refractive elements and eye movements are measured by wavefront sensor, usually Schack-Hartmann and corrected by wavefront cor‐ rector, in most cases a deformable mirror. Other applications which make use of AO sys‐ tems are for example: free space optical communication systems [16, 17], microscopy [18-20] or beam shaping in laser applications [21]. It is, however, rather obvious that not all AO ap‐ plications have similar needs, and in particular that in some cases systems simpler than the astronomical ones can be realized. For example, in some cases there is no need to have the real time information about the aberrated wavefront: either because the aberration variation is slow [22] or because there is a specific phase which remains for a limited amount of time, as for example when correcting low order ocular aberrations "eyeglass prescription"for pa‐ tient in ophthalmic diagnostics, or in optical devices in which the environmental conditions are not initially defined but the system remains stable in time [23-25]. In all these cases it can be convenient to have a simpler AO system, able to correct only the slow variations of the

In the above mentioned cases the wavefront correction can be operated with a strong re‐ duction in the hardware complexity, in particular by using a sensorless approach. Sever‐ al techniques have been developed which use these simpler AO systems. They are generally based on the optimization of some merit function that depends on the optical

The algorithms for the sensorless correction can be divided into two main classes: the stochastic and the image-based ones. In the first class, the system is optimized starting from a random set and, then, applying an iterative selection of the best solutions. These algorithms have the advantage of not requiring any preliminary information about the system but they take a lot of time for converging. Many algorithms using this approach have been written and exploited successfully in different fields. Among them the most popular are: genetic algorithms [18, 26, 24], simulated annealing [13], simplex or ant col‐ onies [27]. These approaches have the drawback of requiring a rather long computation time, or many iterations before converging, taking up to several minutes before reaching

Other sensorless techniques can be realized by analyzing some specific known feature, ei‐ ther intrinsic to the system or artificially introduced. An example of the latter case can be found in [28-29]. With respect to classical AO systems, the sensorless approach offers the ad‐ vantage of not needing the wavefront sensor: this reduces the cost of the instrument and avoids all the problems related to maintaining the performance of such a device once instal‐ led and aligned. However, the absence of the wavefront sensor implies also some limita‐ tions, for instance, a much longer time before reaching an optimal image quality, or a final image not perfectly optimized. Clearly, the required final result and the available resources are the key elements driving the choice towards one system or another. In section 2, we will

wavefront aberrations.

44 Adaptive Optics Progress

system under consideration.

the desired system optimization.

A genetic algorithm [30] searches the solution of a problem by simulating the evolution process. Starting from a population of possible solutions, it saves some of the strongest ele‐ ments, that are the only ones selected to survive, and, thus, are able to reproduce themselves giving rise to the next generations. In general, the inferior individuals can survive and re‐ produce with a smaller probability.

This strategy allows solving a large class of problems without any initial hypothesis or pre‐ liminary knowledge. Its effectiveness was demonstrated in many experimental setups, as will be discussed in the following paragraphs.

The main steps of a genetic algorithm are depicted in Table 1 and in Fig. 1.

**Table 1.** Main steps required by a genetic algorithm.

The initial population is chosen randomly in the whole set of possible solutions. The selec‐ tion function can be either probabilistic or deterministic. In the probabilistic case, the stron‐ gest elements have more chances of being selected and of reproducing to the next generation. This decreases the possibility of falling in a "local" maximum solution.

The reproduction function creates new individuals from the old population. There are two kinds of functions: crossover and mutations.

*CrossOver* functions: they mix the genes of the two parents by slightly modifying them and by obtaining two sons.

Example: EuristicXOver:

From the parents Va (k-1) and Vb (k-1), the children Va (k) and Vb (k) are generated by the following rule:

*2.1.1. Application example: Laser focalization*

the interaction of an ultrafast laser and a gas jet.

the XUV spectrometer output.

DM.

The intensity of a laser in its focal spot is largely dependent on the quality of the focal point, and this effect is even stronger in nonlinear optics. Often, in laser systems it is not simple to

Devices and Techniques for Sensorless Adaptive Optics

http://dx.doi.org/10.5772/53550

47

For example, in ref. [24] it was demonstrated how an AO sensorless optimization based on a genetic algorithm can largely enhance the XUV high-order harmonics (HH) generated by

The AO system was composed by an electrostatic deformable mirror (Okotech) placed be‐ fore the interaction chamber as illustrated in Fig. 2. The feedback for the genetic algorithm was the photon flux at the shortest wavelengths acquired placing a photomultiplier tube at

**Figure 2.** Experimental setup for the optimization of a laser focalization used for high order harmonics generation in ultrafast nonlinear optics. The pulsed laser beam interacts with a gas jet in the interaction chamber. The photomulti‐ plier tube collects the signal from the spectrograph and feeds the genetic algorithm that drives the deformable mirror

The laser pulse was generated by a Ti:S CPA laser system with a hollow-fiber to realize the compression of the pulse duration. The typical values used in the experiment are 6 fs of du‐ ration, 200 µJ of pulse energy, at 1 kHz repetition rate (all the experimental details are de‐ scribed in Villoresi et al. 2004). The focusing of the laser pulses on the gas jet, after the modifications introduced by the Deformable Mirror (DM), is obtained by means of a 250 mm focal length spherical mirror. The spectrometer that analyzes the HHs beam is based on

The real-time acquisition of the spectral intensity is realized by the combination of a solarblind open microchannel-plate (MCP) with MgF2 photocathode and a phosphor screen placed on the spectrometer focal plane, which converts the HHs XUV spectrum in the visi‐ ble, and by a photomultiplier which acquires a HHs spectral interval selected with a slit. In this way, the single-shot intensity of a single harmonic, or group of harmonics, is used as feedback by the algorithm. A separate optical channel acquires in parallel the image of all at

The genetic algorithm used a population of 80 individuals, with a deterministic selection rule that saved the 13 best ones. Both mutations and crossover were used. The results

a flat varied-line-spacing grazing-incidence grating with two toroidal mirrors.

the MCP, from which the HHs spectrum is obtained.

reach an optimal alignment, so that AO devices can be very useful in these cases.

$$\begin{aligned} \boldsymbol{V}\_a^{(k)} &= \boldsymbol{V}\_a^{(k-1)} + r \left( \boldsymbol{V}\_b^{(k-1)} - \boldsymbol{V}\_a^{(k-1)} \right) \\\\ \boldsymbol{V}\_b^{(k)} &= \boldsymbol{V}\_b^{(k-1)} \end{aligned}$$

*Mutations* functions: the genes of the parent are randomly modified.

Example: Uniform Mutation:

The mutation take an element Vcj (k-1) and mutate it in a new one by the rule:

$$\begin{array}{cc} V\_{cj}^{\ \ \ \ \left(k\right)} = \begin{cases} V\_{cj}^{\ \ \left(k\ -1\right)} + w\left(k\right) \left(1 - V\_{cj}^{\ \ \left(k\ -1\right)}\right) & \text{if} \ rand > 0.5\\ V\_{cj}^{\ \ \left(k\ -1\right)} + w\left(k\right) V\_{cj}^{\ \ \left(k\ -1\right)} & \text{if} \ rand \leq 0.5 \end{cases} \end{array}$$

where w(k) is weight function which decreases with the iteration k.

**Figure 1.** Diagram representing the genetic algorithm principle. The algorithm starts from a random population and then each individual is measured and the population is sorted according to its fitness. Then, some of the best individu‐ als are selected for the generation of the next population.
