A method for producing aperiodic gratings and waveguides with aperiodic gratings
uses a simulated annealing process that starts with a random configuration of grating
elements and iteratively computes a spectral response from a Fourier transform
of the configuration of grating elements obtained in successive iterations. A cost
function is computed as a convergence criterion. The aperiodic grating can be used,
for example, as a filter in WDM applications.