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

License

MIT; see LICENSE.

Metadata

Release files for pysie2d 1.4.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.4.0
File Size Uploaded Provenance Actions
pysie2d-1.4.0.tar.gz 163.1 kB Without provenance Details for pysie2d-1.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 336.8 kB

Release files / pysie2d-1.4.0.tar.gz

Download URL pysie2d-1.4.0.tar.gz
Size 163.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5232a4f1f9fa1ef6dd07be7e4c6b984323428cb2fbe1e376ba9c267066408a5f
BLAKE2b-256 checksum
How to use checksums
57fdeda624cc3c93ce9ee789d50a401c7f298f7de068772a543021cab6c6215a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","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.4.0-py3-none-any.whl

Download URL pysie2d-1.4.0-py3-none-any.whl
Size 173.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac2369faefe0646e8a912c20701cc1f5a834344741eabe98be722157c2430c10
BLAKE2b-256 checksum
How to use checksums
a64218c44aec0091d4bb43387c7b3cc6acc92e299c5fa6e82b554a4f73709c4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","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.4.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