The AA algorithm, depicted in Fig. 3, starts with an arbitrary initial guess for and an initial input wavefront . The Fourier transform of this wavefront is the starting estimate for the output electric field: . The corresponding intensity in the output plane, is unlikely to be a good rendition of the desired intensity pattern, . The error,

(16) |

is reduced by mixing a proportion, , of the desired amplitude into the field in the focal plane:

(17) |

Inverse transforming yields the corresponding field in the input plane, . At this point, the amplitude in the input plane no longer matches the actual laser profile, so we replace with . The result is an improved estimate for the input field: . This completes one iteration of the AA algorithm. Subsequent iterations lead to monotonically improving estimates, , for the desired phase modulation [13]. The cycle is repeated until the error, , in the -th iteration converges to within an acceptable tolerance: .

The phase and amplitude fields are computed as arrays of double-precision numbers, and their Fourier transforms calculated with fast Fourier transform (FFT) routines. Starting from random input phases, , uniformly distributed in the range 0 to , the AA algorithm typically requires eight iterations to converge within of an acceptably accurate local minimum of using an intermediate value for the mixing parameter, .