Math

torchpme.lib.exp1(x)[source]

Exponential integral E1.

For a real number \(x > 0\) the exponential integral can be defined as

\[E1(x) = \int_{x}^{\infty} \frac{e^{-t}}{t} dt\]
Parameters:

x – Input tensor (x > 0)

Returns:

Exponential integral E1(x)

torchpme.lib.gamma(x: Tensor) Tensor[source]

(Complete) Gamma function.

pytorch has not implemented the commonly used (complete) Gamma function. We define it in a custom way to make autograd work as in https://discuss.pytorch.org/t/is-there-a-gamma-function-in-pytorch/17122

Parameters:

x (Tensor)

Return type:

Tensor

torchpme.lib.gammaincc_over_powerlaw(exponent: Tensor, z: Tensor) Tensor[source]

Compute the regularized incomplete gamma function complement for integer exponents.

Parameters:
  • exponent (Tensor) – Exponent of the power law

  • z (Tensor) – Value at which to evaluate the function

Returns:

Regularized incomplete gamma function complement

Return type:

Tensor