Skip to main content

pysie2d

CI PyPI License: MIT Python 3.12+

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.

Near-field map

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.

Convergence to Mie theory

Documentation

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysie2d 1.6.0
File Size Uploaded Provenance Actions
pysie2d-1.6.0.tar.gz 165.6 kB Without provenance Details for pysie2d-1.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pysie2d 1.6.0
File Interpreter ABI Platform Actions
pysie2d-1.6.0-py3-none-any.whl Python 3 none any Details for pysie2d-1.6.0-py3-none-any.whl

Total release size: 341.7 kB

Release files / pysie2d-1.6.0.tar.gz

Download URL pysie2d-1.6.0.tar.gz
Size 165.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fc21e4eed7aa942dabc900cef2384965b4d033bd8d83b07d4a4e320ad94fb1ea
BLAKE2b-256 checksum
How to use checksums
c3630bb1f7e554674f0d437fd65a580adedb6b82c72dd939e2a4ce2e9faa8c37
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.0-py3-none-any.whl

Download URL pysie2d-1.6.0-py3-none-any.whl
Size 176.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fcfd60ee4002fc850b6f4c269cbcdddc2746500ec4708c587b8c19cb6a6b9c5
BLAKE2b-256 checksum
How to use checksums
cd77a1390942f10fc99b3d74df14f8ab9054d2621b172e1b4459954343f5b130
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.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page