  Topology optimization methods for inverse design of nano-photonic systems
have recently become extremely popular and are presented in various forms and
under various names. Approaches comprise gradient and non-gradient based
algorithms combined with more or less systematic ways to improve convergence,
discreteness of solutions and satisfaction of manufacturing constraints. We
here provide a tutorial for the systematic and efficient design of
nano-photonic structures by Topology Optimization (TopOpt). The implementation
is based on the advanced and systematic approaches developed in TopOpt for
structural optimization during the last three decades. The tutorial presents a
step-by-step guide for deriving the continuous constrained optimization problem
forming the foundation of the Topology Optimization method, using a cylindrical
metalens design problem as an example. It demonstrates the effect and necessity
of applying a number of auxiliary tools in the design process in order to
ensure good numerical modelling practice and to achieve physically realisable
designs. Application examples also include an optical demultiplexer.
