Solve Maxwell's equations for a cluster of particles using the generalized multiparticle Mie theory (GMMT)
Project description
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 around a 37 particle cluster
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
See the examples folder for how to use MiePy.
Run any of the available examples without explicit installation using uv:
| Command | Description |
|---|---|
uvx miepy dielectric_sphere |
Dielectric sphere scattering and cross-sections |
uvx miepy ag_sphere |
Silver sphere scattering and absorption |
uvx miepy ag_shell |
Core-shell particle scattering |
uvx miepy vary_index |
Scattering intensity vs wavelength and refractive index |
uvx miepy fields |
Electric and magnetic field visualization |
uvx miepy dimer_scattering |
Au dimer cross-sections |
uvx miepy dimer_force |
Force and torque on dimer particles |
uvx miepy far_field |
Far-field radiation patterns |
uvx miepy whispering_gallery |
Whispering gallery modes in dielectric sphere |
uvx miepy focused_gaussian |
Focused Gaussian beam with orbital angular momentum |
uvx miepy imaging |
Near-field, far-field, and microscope imaging |
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:
- Clone MiePy and its submodules:
git clone https://github.com/johnaparker/miepy.git miepy --recurse-submodules && cd miepy
- Bootstrap vcpkg (first time only):
./vcpkg/bootstrap-vcpkg.sh
- Install MiePy using uv:
uv sync
- Optionally, run the tests to verify correctness:
uv run pytest tests
License
MiePy is licensed under the terms of the GPLv3 license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file miepy-1.0.2.tar.gz.
File metadata
- Download URL: miepy-1.0.2.tar.gz
- Upload date:
- Size: 7.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93f4b013c468aebad74af2cb7abea1de7c81fa00aa53febb5e0682465ccd0c2d
|
|
| MD5 |
8d9517e162771cb299d66aebbf617959
|
|
| BLAKE2b-256 |
b67319d65a8b1d4f47a03ccdb0b68932d662855adadafd0da2292b8cc67c0567
|
File details
Details for the file miepy-1.0.2-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: miepy-1.0.2-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 9.6 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd468725f485cf7c0cf9e57560ab94e004433f0d2247dd6fdda6f4ece47e380a
|
|
| MD5 |
62690d1d336618514cc21fad872e1946
|
|
| BLAKE2b-256 |
60fa43bafb9e6df752f8dc8c7485892792d37d5ed839f5ea4dff368b32f6e0cf
|
File details
Details for the file miepy-1.0.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: miepy-1.0.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 8.1 MB
- Tags: CPython 3.13, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
267a02553c3c5785851edc0b6f3c751e3f1b0eb8aa43f4c0ecefeedeb9cb4bbc
|
|
| MD5 |
66063c13a1b8e077eca7d984459da207
|
|
| BLAKE2b-256 |
75dd5f6253d309f28c0e0fbce2091411c9e37852bfd013698c9efd05a74a4c50
|
File details
Details for the file miepy-1.0.2-cp313-cp313-macosx_15_0_x86_64.whl.
File metadata
- Download URL: miepy-1.0.2-cp313-cp313-macosx_15_0_x86_64.whl
- Upload date:
- Size: 7.8 MB
- Tags: CPython 3.13, macOS 15.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36ecac8666e6e23e65e73dbfffbfb494403c57c6cbde0869879cc19533e928e2
|
|
| MD5 |
8c49693ffba7f048ff441e84eeb537f6
|
|
| BLAKE2b-256 |
a776d120407886a1f2867e961af98b4858e98c33385e99ab13aec4ca8e42b426
|
File details
Details for the file miepy-1.0.2-cp313-cp313-macosx_15_0_arm64.whl.
File metadata
- Download URL: miepy-1.0.2-cp313-cp313-macosx_15_0_arm64.whl
- Upload date:
- Size: 7.6 MB
- Tags: CPython 3.13, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08b71e3b54794bb932e04b4c5408f9991186adfafc1ef06513a0433addac7c19
|
|
| MD5 |
e789a6126a0111c48fe57ceba4016074
|
|
| BLAKE2b-256 |
2e4e2e6d9cf225c211a1bc947d26724066080f83c1c43bd132ab3a2d4f7f0c58
|
File details
Details for the file miepy-1.0.2-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: miepy-1.0.2-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 9.5 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47292eb7c2b5e9852fa345b6219ef9d6d3ca0b30a60d416c1b229221386424f6
|
|
| MD5 |
1b3692a782149f7a38625a6bb884ac8f
|
|
| BLAKE2b-256 |
6d2dde8fa60bdca39dbb45cef3418f23a462252b25a28498bab84e14314cc717
|
File details
Details for the file miepy-1.0.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: miepy-1.0.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 8.1 MB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61ee174ea7a85aded30c904e1f0b137d03914dd5f311c85d171657ca4bf5f9c3
|
|
| MD5 |
51960ea1590f9a086cf2225860dd693a
|
|
| BLAKE2b-256 |
23a27453f0238609ff61593f0a776159d493905df882792fe8e3aa5a888d47b8
|
File details
Details for the file miepy-1.0.2-cp312-cp312-macosx_15_0_x86_64.whl.
File metadata
- Download URL: miepy-1.0.2-cp312-cp312-macosx_15_0_x86_64.whl
- Upload date:
- Size: 7.8 MB
- Tags: CPython 3.12, macOS 15.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95eeb47e4d0d12d8eea71525ea4b238b86e010de44b696c13aa93d00830b5025
|
|
| MD5 |
493c0966e5c87b0efca219a452f051c5
|
|
| BLAKE2b-256 |
d36cc77f578fa5a2200d0cfd390c08cf973cb488ca627b6819a7ecf690444d7a
|
File details
Details for the file miepy-1.0.2-cp312-cp312-macosx_15_0_arm64.whl.
File metadata
- Download URL: miepy-1.0.2-cp312-cp312-macosx_15_0_arm64.whl
- Upload date:
- Size: 7.6 MB
- Tags: CPython 3.12, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
752f85d8e1c43af13a8f73a3d26cc1936c97279e0b99b9f5c848492e2eb98022
|
|
| MD5 |
708ba877b16e080009ddeaf0e4530443
|
|
| BLAKE2b-256 |
9f4f4b63860102640990ccf2be04579fca0c8cf9bc1d7303f166685d26df636c
|
File details
Details for the file miepy-1.0.2-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: miepy-1.0.2-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 9.5 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2d8669303e5184ec5742114b324ca65f0bd6333659bce616c41d17ed81b361c
|
|
| MD5 |
40106656c8ecdee19c98877a74a271ea
|
|
| BLAKE2b-256 |
a697b7de7713b2c1bca55dfc0dc5080886cb8c1b79bb659c1f44fe50960a50c6
|
File details
Details for the file miepy-1.0.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: miepy-1.0.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 8.1 MB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f79d6b791acefd50d7478e739ac29a1865f529acd55544bace80f27243e9cc34
|
|
| MD5 |
6313be3a6415aca0be75d6252e24a041
|
|
| BLAKE2b-256 |
c062efd441538f9ad0a63423281c62560c30e94d86621f00d1f9f63d60ccc8fb
|
File details
Details for the file miepy-1.0.2-cp311-cp311-macosx_15_0_x86_64.whl.
File metadata
- Download URL: miepy-1.0.2-cp311-cp311-macosx_15_0_x86_64.whl
- Upload date:
- Size: 7.8 MB
- Tags: CPython 3.11, macOS 15.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87ba4955efa3dbe0f16ca13df8060d0dfc677a7d3f58ec9f2f86f63811fefaff
|
|
| MD5 |
7ca6bd0abad56f1faa98483cd7d79547
|
|
| BLAKE2b-256 |
d5f0c515fd0a917a8c7db2c7fe90e7a5e2b533f4ddbaf36556db13a579239e20
|
File details
Details for the file miepy-1.0.2-cp311-cp311-macosx_15_0_arm64.whl.
File metadata
- Download URL: miepy-1.0.2-cp311-cp311-macosx_15_0_arm64.whl
- Upload date:
- Size: 7.6 MB
- Tags: CPython 3.11, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd9c6fe6b25cb799743db8df7028cfce7c693374067b64bd800510996e4e2f78
|
|
| MD5 |
15ace71461bb4f34dfece05b7f259c3f
|
|
| BLAKE2b-256 |
56165cbe287cf8790231b02f376eea9baa3a549c65f3d2bbf3b9715e6f3b0e6b
|