  A method to design gratings in integrated photonics, is presented. The method
is based on a transfer matrix formalism enhanced by Finite Element Method (FEM)
parameter calculations. The main advantages of the proposed technique are the
easy of use, the fast optimization time and the versatility of the approach.
Few examples of optimized gratings to obtain various scattered light field
profiles for different applications are presented: a double-Gaussian profile, a
flat top square profile, a spot profile on a chip surface, profiles suited to
get efficient and selective coupling to single mode and multimode fibers. A
discussion of the limits of the method and some insights on how to improve it
are also discussed.
