Skip to main content

barytmat

A small Python library for saving and loading T-matrices in barycentric rational form (equivalent to the pole-expansion form), stored in a format compatible with the daphona T-matrix database.

Background

Electromagnetic scattering properties of particles are fully encoded in their T-matrix. The T-matrix varies smoothly with frequency, and its poles correspond to resonances of the scatterer. barytmat stores a compact pole expansion, for example computed via a matrix-valued AAA algorithm (diffaaable), as an HDF5 file that conforms to the treams/daphona data format. The expansion can then be evaluated at arbitrary frequencies without re-running the full T-matrix calculation.

The method is described in:

J. D. Fischbach et al., Pole-Expansion of the T-Matrix Based on a Matrix-Valued AAA-Algorithm, arXiv:2602.18414 (2026). https://doi.org/10.48550/arXiv.2602.18414

Related publications

Resource Reference
T-matrix database (daphona) N. Asadova et al., arXiv:2602.02101 (2026). https://doi.org/10.48550/arXiv.2602.02101
treams T-matrix package D. Beutel et al., Comput. Phys. Commun. 297, 109076 (2024). https://doi.org/10.1016/j.cpc.2023.109076
Multiple-scattering resonances via AAA J. D. Fischbach et al., Adv. Theory Simul. 8, 2400989 (2025). https://doi.org/10.1002/adts.202400989

Installation

pip install barytmat

or

uv add barytmat

Usage

import numpy as np
import barytmat

# Save a pole expansion to HDF5 (daphona-compatible)
# z_j: pole frequencies (complex), f_j: residues (matrix-valued), w_j: AAA weights
# T0: a treams.TMatrix instance that carries the basis/poltype/material metadata
barytmat.save_hdf5("my_particle.hdf5", z_j, f_j, w_j, T0,
                   description="Gold nanosphere, r=50 nm")

# Load and evaluate at arbitrary frequencies
T = barytmat.load_hdf5("my_particle.hdf5")
Ts = T(k0=np.linspace(0.9e7, 1.1e7, 50))  # array of frequencies

The saved file is a valid daphona/treams HDF5 file. The barycentric weights needed to reconstruct the rational approximation are stored in the file's description attribute so that no sidecar files are required.

Dependencies

  • treams — T-matrix representation and HDF5 I/O
  • diffaaable — differentiable matrix-valued AAA algorithm
  • h5py, numpy

Metadata

Release files for barytmat 0.5.1

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

Source distribution (sdist)

Source distribution for barytmat 0.5.1
File Size Uploaded Provenance Actions
barytmat-0.5.1.tar.gz 21.5 kB Without provenance Details for barytmat-0.5.1.tar.gz

Built distribution (wheel)

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

Total release size: 25.0 kB

Release files / barytmat-0.5.1.tar.gz

Download URL barytmat-0.5.1.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d2bc87952a8cd04db6c9dcbdd303f770a6a2dd693fbed5de4c21c55d2ada4995
BLAKE2b-256 checksum
How to use checksums
c522c9c1b5b38f562dadf60b254f671742db8d1f655e70e4b3a065692678e50d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / barytmat-0.5.1-py3-none-any.whl

Download URL barytmat-0.5.1-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27f4f515afded75de38dabc5a9a1fbcfff56e56e6562135e6c259fdf5f1fff8a
BLAKE2b-256 checksum
How to use checksums
edb5d535ad62d5eb00746151a8aa4103330b1af7fd2ce03b838b59b1ac4b5cea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for barytmat 0.5.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.

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files No provenance

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