treams_core/tmatrix/
mod.rs

1//! T-matrices of single spheres and cylinders, and three helicity measures of a
2//! T-matrix.
3//!
4//! Upstream: `treams.TMatrix` and `treams.TMatrixC`.
5//!
6//! | treams-rs | treams | Differences |
7//! |---|---|---|
8//! | [`sphere()`] | `TMatrix.sphere` | helicity convention only; the Python layer converts to parity |
9//! | [`cylinder()`] | `TMatrixC.cylinder` | a block `(kz, m)` reuses the boundary solve of its mirror `(-kz, -m)` when both are requested; the two solves agree to rounding |
10//! | [`metric()`] with [`Metric::CircularDichroism`] | `TMatrix.cd` | requires positive real wavenumbers instead of a real material |
11//! | [`metric()`] with [`Metric::DualityBreaking`] | `TMatrix.db` | scales the matrix to a largest entry of 1 first, so tiny or huge matrices do not underflow or overflow |
12//! | [`metric()`] with [`Metric::Chirality`] | `TMatrix.chi` | the same scaling; the gradient is an error where the helicity contrast is zero |
13//!
14//! [`sphere()`] and [`cylinder()`] list the modes as treams does: within each degree and
15//! order (or axial wavenumber and order), polarization index 1 (positive helicity)
16//! comes before 0. The Mie coefficients of [`coeffs`](crate::coeffs) use the reverse
17//! order (negative, positive), so both axes of every 2 x 2 block swap when it is
18//! placed. [`metric()`] takes the polarization index of each row in `pol`.
19
20mod cylinder;
21mod metric;
22mod sphere;
23
24pub use cylinder::{CylinderGradient, CylinderResidual, cylinder};
25pub use metric::{Metric, MetricGradient, MetricResidual, metric};
26pub(crate) use sphere::block_degrees;
27pub use sphere::{SphereGradient, SphereResidual, sphere};