A method of optimizing a filter response of an arrayed waveguide grating
is disclosed. The method includes the step of measuring a respective
phase error of a plurality of waveguide cores of the arrayed waveguide
grating. Once the phase error is measured, a respective optical path
length of the cores is adjusted in accordance with the respective phase
error of the cores. Optical path length is adjusted by adjusting a
respective refractive index of the cores. The respective optical path
length can be controlled to nanometer accuracies by adjusting the
respective refractive index of the cores.