This section contains examples in which pyGDM is used on specific physical problems. For more technical examples, see the tutorials. Note: The syntax of the example and tutorial notebooks is python 2 only.


You can download also the source code of the example and tutorial files (these are python 2 and 3 compatible).

Comparison to Mie theory


The spectra calculated by Mie theory used in the corresponding examples can be downloaded here.

Comparison to selected publications

Multipole analysis

2D simulations

LDOS / dipole emitter decay rate

Fast electrons

Surface Green’s Dyads with retardation


These examples require the external module pyGDM2-retard. It can be installed via pip.

Evolutionary optimization


The examples on the evolutionary optimization module (EO) are not deterministic. If the results differ slightly from run to run, this is completely normal and actually the consequence of the main drawback of evolutionary optimization: Convergence to the global optimum can never be guaranteed!. Nevertheless, usually the optimizations converge very closely to the optimum, which can be tested by repeated runs of the same optimization.