Meep simulations are Python scripts which involve specifying the device geometry, materials, current sources, monitor fields, and everything else necessary to set up a calculation. A Python script provides the flexibility to customize the simulation for practically any application particularly those involving parameter sweeps and optimization.
Python libraries such as NumPy, SciPy, and Matplotlib can be used to augment the simulation functionality and will also be demonstrated. Much of the functionality of the low-level C++ interface has been abstracted in Python which means that you don't need to be an experienced programmer to set up simulations. Reasonable defaults are available where necessary.
Several tutorials and examples are found here. These tutorials are meant to illustrate Meep's various features in an interactive and application-oriented manner.
Jupyter notebooks are interactive, browser based framework for displaying text, running python code, and visualizing results. There are several ways to read these notebooks online:
The recommended method to run the tutorial notebooks is by 1.) installing meep
via conda
, 2.) cloning this repo to your local drive, and 3.) launch a notebook server in this directory using jupyter notebook
.
nbviewer
is a web platform that can render interactive features found inside Jupyter notebooks openly stored on web-servers. While nbviewer
can't run python code, it can execute stored javascript code used to animate the simulations.
GitHub is able to render some of the smaller notebooks as plain text. However, they are not interactive and are often too large for GitHub.
Below are summaries for each tutorial, along with the features the tutorials highlight. While there is no particular order to the tutorials, they progressively incorporate more complicated features.
-
straight-waveguide.ipynb
- A simple 2D straight waveguide tutorial that explores basic meep features likegeometry
,sources
, andPML
layers. The tutorial also explores basic visualization and animation features. -
bent-waveguide.ipynb
- A followup to the 2D straight waveguide tutorial by adding a bend. -
bend-flux.ipynb
- Using the previous bent waveguide example, this tutorial calculates the loss, transmission, and reflection that the bent waveguide undergoes. -
ring.ipynb
- Computes the resonant mode frequencies of a 2D ring resonator usingharminv
.
-
holey-wg-cavity.ipynb
- Calculates the transmission and resonant modes of a waveguide photonic crystal cavity. Demonstrates theharminv
routines and how to estimate the$Q$ of cavities. -
holey-wg-bands.ipynb
- Computes the band diagram of the infinite periodic waveguide by itself with no defects in the time domain. Explores thek_point
,run_k_point
, and periodic boundary conditions features.
mpb_strip.ipynb
-
-
oblique-source.ipynb
- Launches straight and oblique sources within a silicon photonic strip waveguide and measures the flux using the eigenmode decomposition feature at an arbitrary angle. Explores features likeEigenModeSource
, the geometryrotate
function,get_eigenmode_coefficients
, andk
vectors that point in arbitrary directions. -
oblique-planewave.ipynb
- Launches a planewave in a homogenous medium using theEigenModeSource
. Explores Bloch-periodic boundaries via thek_point
.
-
mode-decomposition.ipynb
- Computes the reflectance and fundamental mode of a linear waveguide taper. Explores features likeEigenModeSource
,get_eigenmode_coefficients
,eig_parity
, and how to extract S Parameters. -
binary_grating.ipynb
- Computes the diffraction orders of a periodic grating in fuzed quartz as a function of wavelength. Explores planewave sources usingEigenModeSource
,get_eigenmode_coefficients
with a specified polarization constraint, mode decomposition using materials with dispersion, Bloch-periodic boundaries via thek_point
parameter, and how to compute diffraction angles from mode coefficients. -
binary_grating_oblique.ipynb
- Computes the diffraction orders of a periodic grating when a planewave is launched at an arbitrary angle. Explores user defined source profiles viaamp_func
, and compares the frequency domain solversolve_cw
to the time domain solutions. -
binary_grating_phasemap.ipynb
- -
polarization_grating.ipynb
-
refl-quartz.ipynb
-
-
3rd-harm-1d.ipynb
- Examines 3rd harmonic generation in a$\chi^{(3)}$ material. Explores the proper way to do 1d simulations, how to include nonlinearities in materials, and compares experimental results to theory.
-
antenna-radiation.ipynb
- Computes the radiation pattern of a simple point source "antenna". Exploresadd_near2far
,add_flux
,get_fluxes
, andget_farfield
features. -
metasurface_lens.ipynb
- -
binary_grating_n2f.ipynb
- -
cavity-farfield.ipynb
-
solve-cw.ipynb
-