Centre d’Élaboration de Matériaux et d’Etudes Structurales

Home > Research > NeO: Nano-Optics and Nanomaterials for Optics > pyGDM: Numerical simulations for nano-optics


pyGDM is an open source python toolkit developed in CEMES for electro-dynamical simulations in nano-optics. It is based on the Green Dyadic Method (GDM)

The Green Dyadic Method (GDM) is a volume discretization technique (see figure 1) [1]. In contrast to most coupled-dipole codes, the GDM is based on a generalized propagator [2], which allows to cost-efficiently treat large monochromatic problems such us polarization-resolved calculations or raster-scan simulations [3]. pyGDM is based on fortran code developed during about the last 20 years, mainly by Christian Girard at the CEMES. Further contributions were made from Arnaud Arbouet, Renaud Marty and Peter Wiecha. The python interface and tools were written by P. Wiecha.

JPEG - 130.9 kb
Figure 1: Volume discretization of an arbitrary nanostructure (here made of gold), lying on a glass substrate.

pyGDM includes tools to easily derive and directly plot several physical quantities such as far-field patterns, extinction and scattering cross-sections (see figure 2), the near-field inside and in the vicinity of the structure (both, the electric and magnetic fields can be calculated), the local density of states (LDOS) or the heat deposited inside the nanoparticle.

PNG - 128.6 kb
Figure 2:: Extinction cross-section of a dielectric sphere (n = 2.0) of diameter D = 300 nm, placed in vacuum, illuminated by a linearly polarized plane wave. Calculated either using pyGDM with differently fine meshing (blue lines, number of meshpoints N) or by Mie theory (dashed red line).


PyGDM offers many easy to use visualization tools (see figure 3), including animations of the electro-magnetic fields (see animation at the top of the page).

JPEG - 228 kb
Figure 3: Visualization of the structure geometry (top), the internal field vectors (center) and the internal field intensity (bottom). Plots are as returned by the pyGDM 2D and 3D visualization tools.


pyGDM finally offers a toolkit for evolutionary single- and multi-objective optimization of nanoparticle geometries. The “EO” module allows to automatically design nanostructures which optimize optical properties such as a certain resonance wavelength, strong field enhancement or the direction of scattering. An example optimization of a double resonant gold nanostructure is shown in figure 4.


JPEG - 140.3 kb
Figure 4: a) scheme of the evolutionary optimization cycle. b) sketch of a cross-like gold nanostructure, to be optimized for double-resonant behavior. c) results of the evolutionary multi-objective optimization. Left: Optimum structure for scattering at 800nm and X polarization, right: for 1200nm and Y polarization and center: compromise multi-objective solution.



The code can be downloaded from the pypi repository (https://pypi.python.org/pypi/pygdm2/), cloned from gitlab (“$ git clone https://gitlab.com/wiechapeter/pyGDM2”), or directly installed with pip (“$ pip install pygdm2”).


An extensive online documentation is available under https://wiechapeter.gitlab.io/pyGDM2-doc/


peter.wiecha at cemes.fr, christian.girard at cemes.fr


Reference [4] includes details on the implementation and physical models behind the different functions.

[1] Girard, C. “Near fields in nanostructures”. Reports on Progress in Physics 68, 1883–1933 (2005).

[2] Martin, O. J. F., Girard, C. & Dereux, A. “Generalized Field Propagator for Electromagnetic Scattering and Light” Confinement. Phys. Rev. Lett. 74, 526–529 (1995).

[3] Teulle, A. et al. “Scanning optical microscopy modeling in nanoplasmonics”. Journal of the Optical Society of America B 29, 2431 (2012).

[4] Wiecha, P. R. “pyGDM - A python toolkit for full-field electro-dynamical simulations and evolutionary optimization of nanostructures”. accepted in Computer Physics Communications, arXiv:1802.04071 (2018).