pysie2d
A 2-D surface-integral-equation solver for time-harmonic electromagnetic scattering by smooth cylinders, circular or Gielis-superformula in cross-section, at real or complex wavelength. Single particles and finite clusters, in a homogeneous background, over a half-space, or over a layered stack. Convergence is spectral, each feature is checked against a reference independent of the solver wherever one exists, and the public API is typed.
Install
pip install pysie2d
From a clone, with uv and Python 3.12+:
uv sync # create the environment
uv run pytest # run the validation suite
uv run ruff format --check . && uv run ruff check .
Minimal use
from pysie2d import BIESolver, Geometry, Material
geom = Geometry.gielis(rad=200, n_pts=300, m=0) # circular cylinder, nm
mat = Material(n_core=1.5, n_clad=1.0, pol=2) # TE
result = BIESolver(geom, mat).scatter(wavelength=600.0) # vacuum nm
print(result.efficiencies()) # {'qsca', 'qext', 'qabs'}
The snippets here and in the feature guides are excerpts of scripts in
examples/. CI runs
every one of them, with the numbers they state asserted.
What it does
| Capability | Entry point | Guide |
|---|---|---|
| Plane waves and line dipoles, near and far field, cross-sections | BIESolver, ScatterResult |
scattering |
| Relative LDOS and Purcell maps | relative_ldos, relative_ldos_map |
scattering |
| Multipole decomposition | ScatterResult.multipoles |
scattering |
| Quasi-normal modes by Beyn's contour method | QNMSolver, QNMResult |
QNM guide |
| Elliptic, adaptive and interpolated contours | QNMSolver.modes(contour=, adaptive=, interpolate=) |
QNM guide |
Adjoint mode sensitivity dλ/dp |
QNMResult.sensitivity |
mode sensitivity |
| Finite clusters of particles | Cluster, ClusterBIESolver |
clusters |
| Many materials at one wavelength, eigenpermittivities | ClusterBIESolver.at_wavelength, ClusterEigenEps |
clusters |
| Half-space substrate, fields above and below it | HalfSpace |
layered backgrounds |
| N-layer stack, guided modes, scattering-matrix columns | Stack, mode_amplitudes |
layered backgrounds |
Lengths are in nm, wavelengths are vacuum wavelengths, and the time convention
is exp(-iωt). Every sign and layout convention is in
docs/conventions.md.
Validation
Each feature is checked against something that shares none of its assumptions:
analytic Mie theory and its poles for a circle, a closed-form self-Green
function, a two-cylinder addition-theorem solution for clusters, image and
closed-form solutions over a perfect conductor, and real-axis quadrature
references for the layered Green functions. Without a closed form, as for a
Gielis star, the reference is two independent solvers: MEEP (FDTD) and
FEniCSx/dolfinx (FEM). Their results are committed to tests/data/ with full
provenance, so uv run pytest re-checks them with numpy alone. Every tolerance
is derived from a measurement.
docs/validation.md gives the whole account in one page, including what is not validated.
Documentation
- Scattering, fields and the LDOS, with the formulation, the references and performance
- Finding quasi-normal modes and mode sensitivity
- Clusters of particles
- Layered backgrounds
- Conventions and validation
- Migrating from v0.5 to v0.6
- Release history: CHANGELOG.md
Citing
Citation metadata live in CITATION.cff; GitHub's Cite this repository button turns them into BibTeX or APA. Releases are archived on Zenodo, which gives each version its own DOI.
License
MIT; see LICENSE.
Metadata
Release files for pysie2d 1.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pysie2d-1.6.1.tar.gz | 166.7 kB | Without provenance | Details for pysie2d-1.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pysie2d-1.6.1-py3-none-any.whl | Python 3 | none | any | Details for pysie2d-1.6.1-py3-none-any.whl |
Total release size: 343.9 kB
Release files / pysie2d-1.6.1.tar.gz
| Download URL | pysie2d-1.6.1.tar.gz |
|---|---|
| Size | 166.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07f13e393d0e3786dc09ecdcb7e30ad7097433441af1b7c06aab17b8aab52e60
|
|
BLAKE2b-256 checksum How to use checksums |
b455cfc7bd3d0fc50532bf79e266e96b0e3715c1afa5fc9e2262c19a7449111f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pysie2d-1.6.1-py3-none-any.whl
| Download URL | pysie2d-1.6.1-py3-none-any.whl |
|---|---|
| Size | 177.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca85e929d7cfa8cf3dc1eeac26a08cb9d6a1f949cb487a95dcf356f0187e9796
|
|
BLAKE2b-256 checksum How to use checksums |
d33170b0270ef357312208ea5900036fe229d450fa457d988611f105dde69c9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for pysie2d 1.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.