Python bindings for FaSTMM2 (Fast Superposition T-Matrix Method, MLFMM-accelerated)
Project description
pyFaSTMM
Python bindings for FaSTMM2 (Fast Superposition T-Matrix Method), a Multi-Level Fast Multipole Method (MLFMM) accelerated solver for electromagnetic scattering from clusters of spheres.
Geometry goes in and Mueller/Jones/cross-section/T-matrix data comes out as plain NumPy arrays -- no input/output files required (unlike the upstream CLI, which reads/writes HDF5).
Quick start
from pyfastmm import FaSTMM2
f = FaSTMM2()
coords = [[-1.5, 0.0, 0.0], [1.5, 0.0, 0.0]]
radii = [1.0, 1.0]
eps = [3.0 + 0.1j, 3.0 + 0.1j] # permittivity = (refractive index)**2
k = 1.2 # wavenumber
result = f.solve(coords, radii, eps, k, N_theta=91, N_phi=16)
print(f"Cext = {result['c_ext']:.6f}")
print(f"Csca = {result['c_sca']:.6f}")
print(f"Mueller matrix shape: {result['mueller'].shape}")
Features
- Fixed-orientation scattering: Mueller and Jones matrices, extinction/ absorption/scattering cross sections, asymmetry parameter
- Orientation-averaged scattering: Halton-sequence orientation averaging
- T-matrix computation: full T-matrix output (
Taa,Tab,Tba,Tbb) for a cluster of spheres - MLFMM acceleration:
formulation=2(FaSTMM2, default) scales to large clusters far better than direct superposition T-matrix (formulation=0)
Current scope (v1): spherical (Lorenz-Mie) monomers only -- not the precomputed-per-monomer-T-matrix ("arbitrarily-shaped constituent particles") input the upstream CLI also supports.
Installation
# Clone with submodules
git clone --recurse-submodules https://github.com/arunoruto/pyFaSTMM.git
cd pyFaSTMM
# Build the extension (requires gfortran, LAPACK; see devenv.nix/flake.nix)
make f2py-ext
# Install in development mode
pip install -e .
Note: unlike the upstream CLI, the Python extension itself never links
HDF5 -- only make cli (the standalone reference binary used by the
compatibility tests) needs it.
Requirements
- Python >= 3.12
- NumPy >= 1.25
- gfortran (GCC), LAPACK/BLAS
Running tests
pip install -e ".[dev]"
make cli # optional: builds the CLI reference binary for compatibility tests
pytest tests/
Dashboard
pip install -e ".[dashboard]"
streamlit run scripts/streamlit_app.py
License
MIT. The bundled FaSTMM2 Fortran code retains its original (BSD-3-Clause/
MIT) licenses -- see LICENSE and external/fastmm2/ for details.
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 pyfastmm-1.0.0.tar.gz.
File metadata
- Download URL: pyfastmm-1.0.0.tar.gz
- Upload date:
- Size: 265.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
863abd40412ac82fc86bbc44f15f0d910ec2751fb4ac5286a73f4fcebdb9e37d
|
|
| MD5 |
e2482adbe63f6247fee7b69b64519598
|
|
| BLAKE2b-256 |
cbdf119ae5d8b5b922455f7cd0691eb89e20ff0c4d4ff1e3e520627e751dddb6
|
Provenance
The following attestation bundles were made for pyfastmm-1.0.0.tar.gz:
Publisher:
publish.yml on arunoruto/pyFaSTMM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyfastmm-1.0.0.tar.gz -
Subject digest:
863abd40412ac82fc86bbc44f15f0d910ec2751fb4ac5286a73f4fcebdb9e37d - Sigstore transparency entry: 2169704418
- Sigstore integration time:
-
Permalink:
arunoruto/pyFaSTMM@664a4a7d99c29d38c20670820b604d4ef94c6a49 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/arunoruto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@664a4a7d99c29d38c20670820b604d4ef94c6a49 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pyfastmm-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyfastmm-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.14, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ae29569e8cf5505ac5abd27dd0a6893a1f1646324b5d1a90f4f9bf2faa06363
|
|
| MD5 |
309577718b4a39a51e517914f616836f
|
|
| BLAKE2b-256 |
7df5d64eec60e1f9db5bd0ea6c2d7310cd4fe8b9bfe3f11779d26409e937eb39
|
Provenance
The following attestation bundles were made for pyfastmm-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on arunoruto/pyFaSTMM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyfastmm-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
0ae29569e8cf5505ac5abd27dd0a6893a1f1646324b5d1a90f4f9bf2faa06363 - Sigstore transparency entry: 2169704451
- Sigstore integration time:
-
Permalink:
arunoruto/pyFaSTMM@664a4a7d99c29d38c20670820b604d4ef94c6a49 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/arunoruto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@664a4a7d99c29d38c20670820b604d4ef94c6a49 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pyfastmm-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyfastmm-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.13, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e264a351b27f874ed363b4e8ee8a432591bb3d124510780227b74f08f2b27af2
|
|
| MD5 |
a74803e26ef240da79dfbb9a166e6f3c
|
|
| BLAKE2b-256 |
7e3bacb046cadad694ad3be03ebd27be70a8b65dbbd0e1f98bade0cc178ffcf0
|
Provenance
The following attestation bundles were made for pyfastmm-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on arunoruto/pyFaSTMM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyfastmm-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
e264a351b27f874ed363b4e8ee8a432591bb3d124510780227b74f08f2b27af2 - Sigstore transparency entry: 2169704439
- Sigstore integration time:
-
Permalink:
arunoruto/pyFaSTMM@664a4a7d99c29d38c20670820b604d4ef94c6a49 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/arunoruto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@664a4a7d99c29d38c20670820b604d4ef94c6a49 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pyfastmm-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyfastmm-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ad62ea63b352c860289502f77f9dbdcba70cbb565d90c5539dbec3fa9467e5b
|
|
| MD5 |
23bf4e6ee2f10113a09b40409ae3e7a0
|
|
| BLAKE2b-256 |
305869de5cb6458b3d1f10037acf794b3b0e7bb0179264fd4c6286d1fd3b93b5
|
Provenance
The following attestation bundles were made for pyfastmm-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on arunoruto/pyFaSTMM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyfastmm-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
3ad62ea63b352c860289502f77f9dbdcba70cbb565d90c5539dbec3fa9467e5b - Sigstore transparency entry: 2169704463
- Sigstore integration time:
-
Permalink:
arunoruto/pyFaSTMM@664a4a7d99c29d38c20670820b604d4ef94c6a49 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/arunoruto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@664a4a7d99c29d38c20670820b604d4ef94c6a49 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pyfastmm-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyfastmm-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 5.2 MB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92184ab27d0a10acc97ae78ad952975fd7908fc40ab6c640f0c2637b468ac52f
|
|
| MD5 |
055358dfacdf870407deb435ec315c62
|
|
| BLAKE2b-256 |
45165b9cf78ca892641d2231e6a1eb43253708129fedccaf5e874955614c5cc4
|
Provenance
The following attestation bundles were made for pyfastmm-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on arunoruto/pyFaSTMM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyfastmm-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
92184ab27d0a10acc97ae78ad952975fd7908fc40ab6c640f0c2637b468ac52f - Sigstore transparency entry: 2169704472
- Sigstore integration time:
-
Permalink:
arunoruto/pyFaSTMM@664a4a7d99c29d38c20670820b604d4ef94c6a49 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/arunoruto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@664a4a7d99c29d38c20670820b604d4ef94c6a49 -
Trigger Event:
workflow_dispatch
-
Statement type: