Module spectral

Module spectral 

Source
Expand description

The spectral series of 1D spherical sums off the axis, and when to take it.

treams-rs extension: treams has only the Ewald sum.

ConstantsΒ§

QUIET_SHELL πŸ”’
Part of the summed moduli below which a shell of spectral_sw1d counts as quiet; the series stops after two quiet shells past the peak.
REAL_ULPS πŸ”’
Rounding error of the real-space part of a 1D spherical sum relative to its moduli, in ulps: its Kambe integrals of even order keep their relative accuracy.
SERIES_DECAY πŸ”’
spectral_sw1d is used only where its terms fall by e^-SERIES_DECAY past their peak within SERIES_SHELLS orders.
SERIES_SHELLS πŸ”’
Diffraction orders the spectral series of a 1D spherical sum may take on each side of zero before it is not used.
SPECTRAL_FIRST_W πŸ”’
The w = |k| rho |eta| from which a 1D spherical sum tries its spectral series before the Ewald sum, whose reciprocal part then cancels by e^(w^2) or more.
SPECTRAL_SWITCH_LOSS πŸ”’
Relative rounding error, on the scale of max(|S|, 1), from which a component of a 1D spherical Ewald sum is taken from its spectral series instead, if that bounds it more tightly. Derivatives count on the scale |dS| + max(|S|, 1) s with s = |k| for length derivatives and 1 / |k| for inverse-length ones.

FunctionsΒ§

prefer_spectral_sw1d πŸ”’
A 1D spherical Ewald sum ewald with the rounding bounds rounding of its components (the value’s with the predicted loss of the cancellation of its parts), completed from the spectral series: each component whose bound exceeds SPECTRAL_SWITCH_LOSS comes from the series where that bounds it more tightly, and a failed sum is replaced by the series. The choice of the value reads only values and value bounds, as in value-only evaluations. Fails where the value’s bound still exceeds MAX_LOSS.
spectral_sw1d πŸ”’
The spectral series of a 1D spherical sum along z off the axis, with first-order bounds on its rounding errors in units of epsilon.