Module integrals

Module integrals 

Source
Expand description

Incomplete gamma and Kambe integrals used by the Ewald lattice sums. Recurrences follow DLMF 8.8 and Kambe (1968), as in treams.

Upstream: treams.special.incgamma and intkambe (_integrals.pyx).

incgamma and intkambe evaluate one integral after checking its inputs. incgamma_array and intkambe_array evaluate them over arrays and return an IncgammaResidual or IntkambeResidual, which keeps the arguments for the gradient. The private submodules hold the numerics:

  • gamma: the upper incomplete gamma function and its scaled ladder;
  • kambe: the Kambe integrals;
  • double: double-double arithmetic for the small-split Kambe series.

The Kambe integrals have several entry points, one per kind of caller:

Entry pointReturnsCaller
intkambeI_n(z, eta) after checking the inputstreams_rs.special.intkambe, intkambe_array
kambeI_n(z, eta) without checksintkambe, the IntkambeResidual pullback (order n + 2), real-space terms of the Ewald sums (lattice::real)
kambe_with_boundI_n and a bound on its rounding errorinteger-order reduced integrals of the 1D spherical sums (lattice::reduced)
kambe_series, kambe_series_withthe series over scaled incomplete gamma functionskambe, kambe_with_bound and SmallSplitKambe only
EvenKambethe even orders of one argument from one recurrencehalf-integer reduced integrals of the 2D spherical and 1D cylindrical sums (lattice::reduced)
SmallSplitKambethe orders of real-space terms at a split below every automatic one, with boundsreal-space terms at small splits (lattice::real)

Modulesยง

double ๐Ÿ”’
Double-double arithmetic: reals hi + lo with |lo| at most half an ulp of hi, and complex numbers with such parts.
gamma ๐Ÿ”’
The upper incomplete gamma function Gamma(n, z) of integer and half-integer degree.
kambe ๐Ÿ”’
Kambe integrals I_n(z, eta) = integral_eta^infinity t^n exp(-z^2 t^2/2 + 1/(2t^2)) dt with first-order bounds on their rounding errors.

Structsยง

IncgammaResidual
What incgamma_array saves for its pullback: the degrees and the arguments. Only the arguments get gradients.
IntkambeResidual
What intkambe_array saves for its pullback: the orders and the arguments. The pullback uses the adjacent-order recurrence and the endpoint integrand.

Constantsยง

BROADCAST ๐Ÿ”’
COTANGENT ๐Ÿ”’
PARALLEL ๐Ÿ”’
Elementwise integral evaluations and pullbacks run in parallel from this many elements.

Functionsยง

incgamma
Upper incomplete gamma function Gamma(n, z) = integral_z^infinity t^(n-1) e^-t dt.
incgamma_array
incgamma over arrays, each input one value or one value per element, with the residual of their argument gradient.
intkambe
The Kambe integral I_n(z, eta) = integral_eta^infinity t^n exp(-z^2 t^2/2 + 1/(2t^2)) dt.
intkambe_array
intkambe over arrays, each input one value or one value per element, with the residual of their z and eta gradients; the integer order has none.
kambe_eta_derivative ๐Ÿ”’
kambe_z_derivative ๐Ÿ”’