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 point | Returns | Caller |
|---|---|---|
intkambe | I_n(z, eta) after checking the inputs | treams_rs.special.intkambe, intkambe_array |
kambe | I_n(z, eta) without checks | intkambe, the IntkambeResidual pullback (order n + 2), real-space terms of the Ewald sums (lattice::real) |
kambe_with_bound | I_n and a bound on its rounding error | integer-order reduced integrals of the 1D spherical sums (lattice::reduced) |
kambe_series, kambe_series_with | the series over scaled incomplete gamma functions | kambe, kambe_with_bound and SmallSplitKambe only |
EvenKambe | the even orders of one argument from one recurrence | half-integer reduced integrals of the 2D spherical and 1D cylindrical sums (lattice::reduced) |
SmallSplitKambe | the orders of real-space terms at a split below every automatic one, with bounds | real-space terms at small splits (lattice::real) |
Modulesยง
- double ๐
- Double-double arithmetic: reals
hi + lowith|lo|at most half an ulp ofhi, 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)) dtwith first-order bounds on their rounding errors.
Structsยง
- Incgamma
Residual - What
incgamma_arraysaves for its pullback: the degrees and the arguments. Only the arguments get gradients. - Intkambe
Residual - What
intkambe_arraysaves 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 incgammaover 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 intkambeover arrays, each input one value or one value per element, with the residual of theirzandetagradients; the integer order has none.- kambe_
eta_ ๐derivative - kambe_
z_ ๐derivative