Skip to content

PyStratify 0.8.0

Choose a tag to compare

@multilayerapp multilayerapp released this 05 Oct 00:15
· 71 commits to main since this release

PyStratify 0.8.0 evaluates every quantity that sums the high-order tail of the multipole series at a source through the normalized formulation. Each term is an explicit factor that can only underflow, multiplied by quantities that neither overflow nor underflow. The results are accurate to about 1e-14 at any distance from metal shells and lossless interfaces, with up to tens of thousands of multipoles.

What's new

Normalized formulation by default

  • decay_rates and emission_rates take their total and radiative rates from the normalized formulation (route="auto").
  • route="log" keeps the logarithmic recursion of 0.7 for cross-checks. Within about 1 nm of a lossless interface it loses ~1e-8 in the total rate; the normalized route does not.
  • Results carry a route field. On the logarithmic route, converged=False flags a failed energy balance.
  • Absorption per layer is computed in closed form (Lommel integrals, O(L)).

Frequency shift

  • The Lamb shift is available as DecayRates.shift, EmissionRates.shift and NormalizedRates.shift.
  • It needs the reactive high-order tail even next to lossless surfaces (10⁴ orders where the total rate needs ten), so the truncation is automatic and tests the complex series.

New near-field quantities, normalized from the start

  • green_dyadic: the two-point Green's dyadic between any two points in lossless shells, in the same shell or across shells. It gives energy transfer, coherent dipole–dipole coupling and collective decay, with reciprocity and envelope truncation.
  • spectral_density: J(ω) and the shift over wavelength, for Wigner–Weisskopf dynamics and pseudomode strong coupling.
  • shell_average: emitters spread through a shell, with volume- and orientation-averaged rates and quantum yield, and a cutoff next to absorbing layers.
  • casimir_polder: the Casimir–Polder potential at any distance, from the normalized series at imaginary frequency.
  • normalized_terms: the per-order Green's forms and radiated amplitudes for many emitter radii at once.

Interface responses in the normalized maps

  • 2D sheets (Sheet, graphene_conductivity) enter as additive terms of the Möbius maps, with cancellation-free mismatches and the surface absorption as a flux jump.
  • Feibelman d-parameters, Feibelman(d_perp, d_par, metal="inner"|"outer"), are new. They reproduce the mesoscopic Mie theory of Gonçalves et al., Nat. Commun. 11, 366 (2020), to 1e-15.
  • Chiral (Pasteur) layers use 2×2 maps in the (TM, TE) basis, with a closed-form contrast matrix, so the small TE parts keep full precision.

Sources

  • Magnetic quadrupoles are obtained by duality.
  • General p + m sources are routed in the TE/TM basis with real covariance weights.

References

  • references.layered_green_forms and references.layered_green_sums give mpmath transfer-matrix references for the per-order forms, the shift and sheets.
  • references.classical_decay_rates(..., with_shift=True) gives the unnormalized shift.

Known limitations

These are documented in the README and in the docstrings of decay_rates and emission_rates.

  • Absorption next to metal. Absorption is still computed from the amplitudes of the logarithmic solver. Its accuracy is ~1e-13 at 1 nm, ~1e-12 at 0.1 nm and ~1e-11 at 0.05 nm from gold. Total rate, radiative rate and shift are not affected.
  • Quadrupoles deep in a subwavelength lossless core. They are accurate to ~1e-13.
  • Chiral layers. Sources inside a chiral layer take the logarithmic route. Absorption in absorbing chiral structures uses O(L²) quadrature, which is slow within ~0.5 nm.
  • d-parameters. The conditions are linearized from the metal side: exact for d∥ = 0, and second-order differences for d⊥d∥ ≠ 0.

Tests

472 tests (one skipped locally) cover:

  • the new quantities against mpmath transfer matrices (shift, two-point dyadic, sheets, d-parameters, chiral layers, Casimir–Polder);
  • the Gonçalves Mie theory;
  • energy balance with sheets, d-parameters and chiral layers;
  • reciprocity of the two-point dyadic;
  • the agreement of the two routes.

CI runs on Python 3.10 and 3.12.

Compatibility

  • decay_rates and emission_rates return the same fields as in 0.7, plus shift and route.
  • Their numbers agree with 0.7.1 to ~1e-14, except within about a nanometre of lossless interfaces, where 0.8.0 is the more accurate.
  • For plane-wave scattering, near fields and far fields, nothing changes.