Skip to content
/ pyMPB Public

Python package for running simulations with MIT Photonic-Bands (MPB)

License

Notifications You must be signed in to change notification settings

probstj/pyMPB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyMPB

This is a Python package for running bandstructure simulations of photonic crystals (PhCs) with MIT Photonic-Bands (MPB, http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands). It creates a .ctl file, runs it, and does some postprocessing and plotting.

Features:

  • supports 2D and 3D simulations
  • works with anisotropic dielectric materials
  • supports MPB's cylinder and block objects (but easily extendable)
  • rectangular and triangular lattices
  • uses mpb-data (from MPB) and h5topng (from h5utils) to export PNG-Images of calculated fields
  • exports simulation results (frequencies, group velocities) to .csv files
  • plots band structure diagrams with matplotlib
  • predefined simulations for 2D triangular lattice of holes and 3D triangular PhC slab

Dependencies:

Usage:

  1. Inside downloaded folder, install package with pip (-e installs with symlinks, meaning you can change and update the source code without reinstalling; The dot at the end is important): pip install -e .
  2. Add your material's refractive indices to data.py
  3. Update defaults (programm calls etc.) in defaults.py
  4. Start with predefined PhC simulations in phc_simulations.py
  5. See examples in examples folder

"Disclaimer"

I am in a hurry - I need to finish my thesis. So my code is neither nice nor clean. Meanwhile, I hope somebody finds this useful!

About

Python package for running simulations with MIT Photonic-Bands (MPB)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published