+
Skip to content

Python module to solve Maxwell's equations for a cluster of particles using the generalized multiparticle Mie theory (GMMT)

License

Notifications You must be signed in to change notification settings

johnaparker/miepy

Repository files navigation

MiePy

MiePy is a Python module for the generalized multiparticle Mie theory (GMMT), also known as the aggregate T-matrix method. MiePy solves the electrodynamics of a collection of spherical or non-spherical scatterers with an arbitrary incident source.

Electric field visualization
Electric field around a 37 particle cluster

Three particle system
3D electric field contours around three metal nanoparticles

Features

  • Non-spherical particles using the T-matrix formulation via the null-field method with discrete sources (NFM-DS). Includes cylinders, spheroids, ellipsoids, cubes and polygonal prisms
  • Arbitrary incident sources (plane waves, Gaussian beams, HG and LG beams, point dipoles)
  • Evaluation of cluster cross-sections and optical force and torque on individual particles
  • Periodic boundary conditions with various lattice types (square, hexagonal, etc.) and mirror and discrete rotational symmetries for faster calculations
  • Optional planar interface (substrate)
  • 3D scene visualization using the VPython library
  • Image clusters using a simulated microscope
  • OpenMP parallelization for systems with larger numbers of particles

Installation

pip install miepy

If using uv:

uv venv --python 3.13
uv pip install miepy
source .venv/bin/activate

Usage

For examples and use cases, see examples folder.

For an overview of the theory, see docs folder.

Install from source

MiePy uses vcpkg for C++ dependency management and uv for Python management, which simplifies building across platforms.

Prerequisites:

  • GCC and GFORTRAN
  • uv

Build steps:

  1. Clone MiePy and its submodules:
git clone https://github.com/johnaparker/miepy.git miepy --recurse-submodules && cd miepy
  1. Bootstrap vcpkg (first time only):
./vcpkg/bootstrap-vcpkg.sh
  1. Install MiePy using uv:
uv sync
  1. Optionally, run the tests to verify correctness:
uv run pytest tests

License

MiePy is licensed under the terms of the GPLv3 license.

About

Python module to solve Maxwell's equations for a cluster of particles using the generalized multiparticle Mie theory (GMMT)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载