From 424ee1c8cfa547c601223f7ac8fce54466f1d4b5 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Mon, 10 Oct 2022 11:00:19 -0400 Subject: [PATCH 001/108] Update RFC-00xx-special-functions.md --- .gitignore | 3 +- RFC-00xx-special-functions.md | 3646 +++++++++++++++++++++++++++++++++ 2 files changed, 3648 insertions(+), 1 deletion(-) create mode 100644 RFC-00xx-special-functions.md diff --git a/.gitignore b/.gitignore index 2dc8ca37..6143c2bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -**/.DS_STORE \ No newline at end of file +**/.DS_STORE +.idea diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md new file mode 100644 index 00000000..d332a4ac --- /dev/null +++ b/RFC-00xx-special-functions.md @@ -0,0 +1,3646 @@ +
+Instructions - click to expand + +- Fork the rfcs repo: https://github.com/pytorch/rfcs +- Copy `RFC-0000-template.md` to `RFC-00xx-my-feature.md`, or write your own open-ended proposal. Put care into the details. +- Submit a pull request titled `RFC-00xx-my-feature`. + - Assign the `draft` label while composing the RFC. You may find it easier to use a WYSIWYG editor (like Google Docs) when working with a few close collaborators; feel free to use whatever platform you like. Ideally this document is publicly visible and is linked to from the PR. + - When opening the RFC for general discussion, copy your document into the `RFC-00xx-my-feature.md` file on the PR and assign the `commenting` label. +- Build consensus for your proposal, integrate feedback and revise it as needed, and summarize the outcome of the discussion via a [resolution template](https://github.com/pytorch/rfcs/blob/rfc-process/RFC-0000-template.md#resolution). + - If the RFC is idle here (no activity for 2 weeks), assign the label `stalled` to the PR. +- Once the discussion has settled, assign a new label based on the level of support: + - `accepted` if a decision has been made in the RFC + - `draft` if the author needs to rework the RFC’s proposal + - `shelved` if there are no plans to move ahead with the current RFC’s proposal. We want neither to think about evaluating the proposal + nor about implementing the described feature until some time in the future. +- A state of `accepted` means that the core team has agreed in principle to the proposal, and it is ready for implementation. +- The author (or any interested developer) should next open a tracking issue on Github corresponding to the RFC. + - This tracking issue should contain the implementation next steps. Link to this tracking issue on the RFC (in the Resolution > Next Steps section) +- Once all relevant PRs are merged, the RFC’s status label can be finally updated to `closed`. + +
+ +# Special Functions + +_Author’s note—This RFC is a work-in-progress._ + +## Authors + +* Allen Goodman (@0x00b1) + +## Summary + +This proposal concerns adding new operators to PyTorch's special functions module (i.e., `torch.special`). The proposed operators have a wide range of use in scientific computing and numerical methods. + +This RFC proposes: + +* a coherent philosophy for PyTorch’s special functions module ([torch.special](https://pytorch.org/docs/stable/special.html)) that clearly distinguishes PyTorch’s elementary from special functions; and +* a set of new [torch](https://pytorch.org/docs/stable/torch.html) and [torch.special](https://pytorch.org/docs/stable/special.html) operators that provide a robust numerical foundation for PyTorch and adhere to the aforementioned philosophy. + +This feature has two audiences: + +PyTorch users: + +* solves the variety of common scientific and engineering problems that special functions address. + +PyTorch maintainers: + +* provides much needed standardization to committing future operators to PyTorch. +* provides an extremely useful set of operators that can and should be used for tricky numerical problems (e.g., implementing challenging distribution functions and gradients) and useful decomposition targets. + +## Table of Contents + +## Motivation + +### What’s a special function? + +There’s no formal definition of a “special function.” Colloquially, and for the purpose of this RFC, a special function is a mathematical function that has an established name and notation due to its importance and ubiquity. + +## Special Function Policies + +PyTorch’s mathematical operators should be categorized as either “elementary” or “special.” An elementary function is a mathematical function whose corresponding operator is available from the `torch` module. A special function is a mathematical function whose corresponding operator is available from the `torch.special` module. Regardless of whether an operator implements an elementary or special function, each operator must share the following properties: + +* A name that adheres to the naming policy. +* A docstring that clearly communicates the following: + * A primary definition + * Real and complex domains + * Real and complex graphs +* If differentiable, derivtatives for each variable. + +### Elementary Functions + +Unlike “special functions,” “elementary functions” have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing a function as an elementary function if the function is a mathematical function of a single variable (i.e., a unary operator) and the function is one of the following functions or belongs to the following families of functions: + +* Cardinal Functions +* Dirac delta +* Euler Number +* Exponential +* Fibonaci Number +* Greatest common divisor +* Hyperbolic +* Inverse Hyperbolic +* Inverse Trigonometric +* Kronecker delta +* Least common multiple +* Logarithmic +* Partitions +* Power +* Rounding and Congruence Functions +* Tensorial Functions +* Trigonometric + +## Proposed Implementation + +### Factorials + +#### Factorial + +```Python +factorial( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ factorial, if $n \in \mathbb{N}$: + +$$n! = \prod_{k = 1}^{n}k.$$ + +Otherwise: + +$$n! = \Gamma(n + 1),$$ + +where $\Gamma$ is the gamma function. + +$n!$ is defined for $\left\\{n \in \mathbb{R} \mid n \geq 0 \vee n \notin \mathbb{Z} \right\\}$ and $\left\\{n \in \mathbb{C} \mid \operatorname{Re}(n) \geq 0 \vee n \notin \mathbb{Z} \right\\}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of Factorial + +```Python +ln_factorial( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Natural logarithm of $n^{\text{th}}$ factorial, $\ln{(n!)}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Double Factorial + +```Python +double_factorial( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ double factorial, if $n \in \mathbb{N}$: + +$$n!!=\prod_{k = 0}^{\left\lceil\tfrac{n}{2}\right\rceil-1}(n-2k).$$ + +Otherwise: + +$$n!!=\left(\frac{2}{\pi}\right)^{\frac{1}{4}(1-\cos(\pi n))}2^{\tfrac{2}{n}}\Gamma\left(\frac{n}{2}+1\right),$$ + +where $\Gamma$ is the gamma function. + +$n!!$ is defined for $\left\\{n \in \mathbb{R} \mid n \geq 0 \vee \tfrac{n}{2} \notin \mathbb{Z} \right\\}$ and $\left\\{n \in \mathbb{C} \mid n \geq 0 \vee \tfrac{n}{2} \notin \mathbb{Z} \right\\}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of Double Factorial + +```Python +ln_double_factorial( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Natural logarithm of $n^{\text{th}}$ double factorial, $\ln{(n!!)}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Rising Factorial + +```Python +rising_factorial( + z: Tensor, + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Rising factorial: + +$$z^{n}=\frac{\Gamma(z + n)}{\Gamma(z)},$$ + +where $\Gamma$ is the gamma function. + +$z^{n}$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $n$ is a number, $z$ must be a tensor. + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – exponent. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of Rising Factorial + +```Python +ln_rising_factorial( + z: Tensor, + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Natural logarithm of rising factorial, $\operatorname{ln}{(z^{n})}$. + +$\operatorname{ln}{(z^{n})}$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $n$ is a number, $z$ must be a tensor. + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – exponent. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Falling Factorial + +```Python +falling_factorial( + z: Tensor, + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Falling factorial: + +$$z_{n}=\frac{\Gamma(z + 1)}{\Gamma(z - n + 1)},$$ + +where $\Gamma$ is the gamma function. + +$z_{n}$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $n$ is a number, $z$ must be a tensor. + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – exponent. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of Falling Factorial + +```Python +ln_falling_factorial( + z: Tensor, + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Natural logarithm of falling factorial, $\operatorname{ln}{(z_{n})}$. + +$\operatorname{ln}{(z_{n})}$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $n$ is a number, $z$ must be a tensor. + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – exponent. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Combinatorial Numbers and Functions + +#### Binomial Coefficient + +```Python +binomial_coefficient( + n: Tensor, + k: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Binomial coefficient: + +$${\binom{n}{k}} = {\frac{n!}{k!(n - k)!}}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $k$ is a number, $n$ must be a tensor. + +**k** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – exponent. If $n$ is a number, $k$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of Binomial Coefficient + +```Python +ln_binomial_coefficient( + n: Tensor, + k: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Natural logarithm of binomial coefficient, $\operatorname{ln}{{\binom{n}{k}}}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $k$ is a number, $n$ must be a tensor. + +**k** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – exponent. If $n$ is a number, $k$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Catalan Number + +```Python +catalan_number_c( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ Catalan number: + +$$C_{z} = \frac{2^{2z}\Gamma(z + \tfrac{1}{2})}{\sqrt{\pi} \Gamma(z + 2)}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Stirling Number of the First Kind + +```Python +stirling_number_s_1( + n: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Stirling number of the first kind: + +$$s(n, k) = $$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Stirling Number of the Second Kind + +```Python +stirling_number_s_2( + n: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Stirling number of the second kind: + +$$S(n, k) = {\frac{1}{k!}}\sum_{i = 0}^{k}(-1)^{i}{\binom{k}{i}}(k - i)^{n}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bell Number + +```Python +bell_number_b( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ Bell number: + +$$B_{n}=\sum_{k = 0}^{n}S(n, k).$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Delannoy Number + +```Python +delannoy_number_d( + m: Tensor, + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Delannoy number: + +$$D(m, n) = \sum_{k = 0}^{\min(m, n)}\binom{m + n - k}{m}\binom{m}{k}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Motzkin Number + +```Python +motzkin_number_m( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ Motzkin number: + +$$M_{n} = \sum_{k = 0}^{\lfloor \frac{n}{2} \rfloor}{\binom{n}{2k}}C_{k}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Narayana Number + +```Python +narayana_number_n( + n: Tensor, + k: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Narayana number: + +$$N(n, k) = {\frac{1}{n}}\binom{n}{k}\binom{n}{k - 1}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Schröder Number + +```Python +schroder_number_r( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ Schröder number: + +$$r_{n} = D(n, n) - D(n + 1, n - 1).$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Gamma and Related Functions + +#### Gamma Function + +```Python +gamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Gamma function: + +$$\Gamma(z)=\int_{0}^{\infty}t^{z-1}e^{-t}dt.$$ + +$\Gamma(z)$ is defined for $\left\\{n \in \mathbb{R} \mid n > 0 \vee n \notin \mathbb{Z} \right\\}$ and $\left\\{n \in \mathbb{C} \mid \operatorname{Re}(n) > 0 \vee n \notin \mathbb{Z} \right\\}$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Reciprocal Gamma Function + +```Python +reciprocal_gamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Polygamma Function + +```Python +polygamma( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – derivative. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Digamma Function + +```Python +digamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Digamma function: + +$$\psi(z)=\sum_{k=1}^{\infty}\left(\frac{1}{k}-\frac{1}{k+z-1}\right)-\gamma.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Trigamma Function + +```Python +trigamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of the Gamma Function + +```Python +ln_gamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Sign of the Gamma Function + +```Python +sign_gamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Beta Function + +```Python +beta( + a: Tensor, + b: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Beta function: + +$$\operatorname{B}(a, b) = \frac{\Gamma(a) \Gamma(b)}{\Gamma(a + b)}$$ + +where $\Gamma$ is the gamma function. + +##### Parameters + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of the Beta Function + +```Python +ln_beta( + a: Tensor, + b: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Exponential and Logarithmic Integrals + +#### Exponential Integral, $\operatorname{Ein}$ + +```Python +exponential_integral_ein( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponential integral: + +$$\operatorname{Ein}(z)=\int_{0}^{z}(1-e^{-t}){\frac{dt}{t}}.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponential Integral, $\operatorname{Ei}$ + +```Python +exponential_integral_ei( + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponential integral: + +$$\operatorname{Ei}(z) = \sum_{k = 1}^{\infty} \frac{z^{k}}{k k!} + \gamma + \frac{1}{2}(\ln{(z)} - \ln{(\tfrac{1}{z})}).$$ + +##### Parameters + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponential Integral, $E_{1}$ + +```Python +exponential_integral_e_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponential integral: + +$$E_{1}(z)=\int _{z}^{\infty}{\frac{e^{-t}}{t}}.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponential Integral, $E_{n}$ + +```Python +exponential_integral_e( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponential integral: + +$$E_{n}(x)=\int_{1}^{\infty}{\frac{e^{-xt}}{t^{n}}}dt.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Logarithmic Integral + +```Python +logarithmic_integral_li( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Logarithmic integral: + +$$\operatorname{li}(z)=\int_{0}^{z}{\frac{1}{\ln{(t)}}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Error and Related Functions + +#### Error Function + +```Python +error_erf(z: Tensor, *, out: Optional[Tensor] = None) -> Tensor +``` + +Error function: + +$$\operatorname{erf}(z) = \frac{2}{\sqrt{\pi}} \sum_{k = 0}^{\infty } \frac{-1^{k} z^{2k + 1}}{k!(2k + 1)}.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Complementary Error Function + +```Python +error_erfc(z: Tensor, *, out: Optional[Tensor] = None) -> Tensor +``` + +Complementary error function: + +$$\operatorname{erfc}(z) = 1 - \frac{2}{\sqrt{\pi}} \sum_{k = 0}^{\infty} \frac{-1^{k} z^{2k + 1}}{k!(2k + 1)}.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Imaginary Error Function + +```Python +error_erfi( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Imaginary error function: + +$$\operatorname{erfc}(z) = \frac{2}{\sqrt{\pi}} \sum_{k = 0}^{\infty} \frac{z^{2k + 1}}{k!(2k + 1)}.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Inverse Error Function + +```Python +error_inverse_erf( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Inverse error function: + +$$\operatorname{erf}^{-1}(z)=\sum_{k=0}^{\infty}{\frac{c_{k}}{2k+1}}({\frac{\sqrt{\pi}}{2}}z)^{2k+1}$$ + +where $c_{0}=1$ and: + +$$c_{k}=\sum_{m=0}^{k-1}{\frac{c_{m}c_{k-1-m}}{(m+1)(2m+1)}}.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Inverse Complementary Error Function + +```Python +error_inverse_erfc( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Dawson and Fresnel Integrals + +#### Dawson’s Integral + +```Python +dawson_integral_f( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Dawson’s integral: + +$$\operatorname{F}(z)=e^{-z^{2}}\int_{0}^{z}e^{t^{2}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Sine Fresnel Integral + +```Python +fresnel_integral_s( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Fresnel integral: + +$$\operatorname{S}(z)=\int_{0}^{x}\sin{t^{2}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Cosine Fresnel Integral + +```Python +fresnel_integral_c( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Fresnel integral: + +$$\operatorname{C}(z)=\int_{0}^{x}\cos{t^{2}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Trigonometric and Hyperbolic Integrals + +#### Sine Integral ($operatorname{Sin}$) + +```Python +sine_integral_sin( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Sine integral: + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Sine Integral ($\operatorname{Si}$) + +$$\operatorname{Sin}(z)=\int_{0}^{z}{\frac{\sin{t}}{t}}dt.$$ + +```Python +sine_integral_si( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Sine integral: + +$$\operatorname{Si}(z)=-\int_{z}^{\infty }{\frac{\sin{t}}{t}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Cosine Integral ($\operatorname{Cin}$) + +```Python +cosine_integral_cin( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Cosine integral: + +$$\operatorname{Cin}(z)=\int_{0}^{z}{\frac{1-\cos{t}}{t}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Cosine Integral ($\operatorname{Ci}$) + +```Python +cosine_integral_ci( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Cosine integral: + +$$\operatorname{Ci}(z)=\gamma+\ln{z}-\int_{0}^{z}{\frac{1-\cos{t}}{t}}$$ + +where $\gamma$ is the Euler–Mascheroni constant. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Hyperbolic Sine Integral + +```Python +hyperbolic_sine_integral_shi( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Hyperbolic sine integral: + +$$\operatorname{Shi}(z)=\int_{0}^{z}{\frac{\sinh{t}}{t}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Hyperbolic Cosine Integral + +```Python +hyperbolic_cosine_integral_chi( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Hyperbolic cosine integral: + +$$\operatorname{Chi}(z)=\gamma+\ln{z}+\int_{0}^{z}{\frac{\cosh{t-1}}{t}}dt.$$ + +where $\gamma$ is the Euler–Mascheroni constant. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Incomplete Gamma and Related Functions + +#### Incomplete Gamma Function ($\gamma$) + +```Python +lower_incomplete_gamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Lower incomplete gamma function: + +$$\Gamma(s,z)=\int_{z}^{\infty}t^{s-1}e^{-t}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Incomplete Gamma Function ($\Gamma$) + +```Python +upper_incomplete_gamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Upper incomplete gamma function: + +$$\gamma(s,z)=\int_{0}^{z}t^{s-1}e^{-t}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Incomplete Beta Function + +```Python +incomplete_beta( + z: Tensor, + a: Tensor, + b: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Airy Functions + +Functions defined as the two, linearly independent solutions to: + +$$y'' - yz = 0.$$ + +#### Airy Function of the First Kind + +```Python +airy_ai( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Airy function of the first kind: + +$$\operatorname{Ai}(z)={\frac{1}{3^{\tfrac{2}{3}}\Gamma(\tfrac{2}{3})}} {_0F_1(; \tfrac{2}{3}; \tfrac{1}{9}; z^{3})} - \frac{z}{3^{\tfrac{1}{3}}\Gamma(\tfrac{1}{3})} {_0F_1(; \tfrac{4}{3}; \tfrac{1}{9}; z^{3})}$$ + +where $\Gamma$ is the gamma function and $_0F_1(; a; z)$ is the confluent hypergeometric limit function. + +$\operatorname{Ai}(z)$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Airy Function of the Second Kind + +```Python +airy_bi( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Airy function of the second kind: + +$$\operatorname{Bi}(z)=\frac{_0F_1\left(;\frac{2}{3};\frac{z^3}{9}\right)}{\sqrt[6]{3} \Gamma \left(\frac{2}{3}\right)}+\frac{\sqrt[6]{3} z _0F_1\left(;\frac{4}{3};\frac{z^3}{9}\right)}{\Gamma \left(\frac{1}{3}\right)}$$ + +where $\Gamma$ is the gamma function and $_0F_1(; a; z)$ is the confluent hypergeometric limit function. + +$\operatorname{Bi}(z)$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Derivative of the Airy Function of the First Kind + +```Python +airy_ai_derivative( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Derivative of the Airy function of the first kind: + +$$\operatorname{Ai}'(z)=\frac{z^2 \\,_0F_1\left(;\frac{5}{3};\frac{z^3}{9}\right)}{2\ 3^{\tfrac{2}{3}} \Gamma \left(\frac{2}{3}\right)}-\frac{\\, _0F_1\left(;\frac{1}{3};\frac{z^3}{9}\right)}{\sqrt[3]{3} \Gamma \left(\frac{1}{3}\right)},$$ + +where $\Gamma$ is the gamma function and $_0F_1(; a; z)$ is the confluent hypergeometric limit function. + +$\operatorname{Ai}'(z)$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Derivative of the Airy Function of the Second Kind + +```Python +airy_bi_derivative( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Derivative of the Airy function of the second kind: + +$$\operatorname{Bi}'(z)=\frac{z^2 \\, _0F_1\left(;\frac{5}{3};\frac{z^3}{9}\right)}{2 \sqrt[6]{3} \\, \Gamma \left(\frac{2}{3}\right)}+\frac{\sqrt[6]{3} \\, _0F_1\left(;\frac{1}{3};\frac{z^3}{9}\right)}{\Gamma \left(\frac{1}{3}\right)},$$ + +where $\Gamma$ is the gamma function and $_0F_1(; a; z)$ is the confluent hypergeometric limit function. + +$\operatorname{Bi}'(z)$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponentially Scaled Airy Function of the First Kind + +```Python +exp_airy_ai( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponentially scaled Airy function of the first kind, $\operatorname{exp}(\operatorname{Ai}(z))$. + +$\exp{(\operatorname{Ai}(z))}$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponentially Scaled Airy Function of the Second Kind + +```Python +exp_airy_bi( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponentially scaled Airy function of the second kind, $\operatorname{exp}(\operatorname{Bi}(z))$. + +$\exp{(\operatorname{Bi}(z))}$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponentially Scaled Derivative of the Airy Function of the First Kind + +```Python +exp_airy_ai_derivative( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponentially scaled Derivative of the Airy function of the first kind, $\operatorname{exp}(\operatorname{Ai'}(z))$. + +$\exp{(\operatorname{Ai}'(z))}$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponentially Scaled Derivative of the Airy Function of the Second Kind + +```Python +exp_airy_bi_derivative( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponentially scaled Derivative of the Airy function of the second kind, $\operatorname{exp}(\operatorname{Bi'}(z))$. + +$\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Bessel Functions + +#### Bessel Function of the First Kind + +```Python +bessel_j( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bessel function of the first kind: + +$$J_{n}(z)=\sum _{k=0}^{\infty } \frac{(-1)^k \left(\frac{z}{2}\right)^{2k+n}}{\Gamma (k+\nu +1) k!},$$ + +where $\Gamma$ is the gamma function. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $n$ is a number, $z$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bessel Function of the First Kind of Order 0 + +```Python +bessel_j_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bessel function of the first kind of order $0$, $J_{0}(z)$ + +$J_{0}(z)$ is defined for all real and complex $z$. + +#### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bessel Function of the First Kind of Order 1 + +```Python +bessel_j_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bessel function of the first kind of order $1$, $J_{1}(z)$ + +$J_{1}(z)$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bessel Function of the Second Kind + +```Python +bessel_y( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bessel function of the second kind, if, and only if $\nu \notin \mathbb{Z}$: + +$$Y_{\nu }(z)=\csc (\pi \nu ) (\cos (\nu \pi ) J_{\nu }(z)-J_{-\nu }(z)),$$ + +where $J_{n}(z)$ is the Bessel function of the first kind. + +If $z \in \mathbb{R}$, $Y_{n}(z)$ is defined for $z > 0$. + +If $z \in \mathbb{C}$, $Y_{n}(z)$ is defined for $z \neq 0$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $n$ is a number, $z$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bessel Function of the Second Kind of Order 0 + +```Python +bessel_y_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bessel function of the second kind of order $0$, $Y_{0}(z)$. + +$Y_{0}(z)$ is defined for $\\{z \in \mathbb{R}\\}$ and $\\{z \in \mathbb{C} \mid z \neq 0\\}$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bessel Function of the Second Kind of Order 1 + +```Python +bessel_y_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bessel function of the second kind of order $1$, $Y_{1}(z)$. + +$Y_{1}(z)$ is defined for $\\{z \in \mathbb{R} \mid z > 0\\}$ and $\\{z \in \mathbb{C} \mid z \neq 0\\}$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Hankel Functions + +#### Hankel Function of the First Kind + +```Python +hankel_h_1( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Hankel function of the first kind: + +$$H_{n}^{1}(z) = J_{n}(z) + i Y_{n}(z),$$ + +where $J_{n}(z)$ is the Bessel function of the first kind, $i$ is the imaginary unit, and $Y_{n}(z)$ is the Bessel function of the second kind. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Hankel Function of the Second Kind + +```Python +hankel_h_2( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Hankel function of the second kind: + +$$H_{n}^{2}(z) = J_{n}(z) - i Y_{n}(z),$$ + +where $J_{n}(z)$ is the Bessel function of the first kind, $i$ is the imaginary unit, and $Y_{n}(z)$ is the Bessel function of the second kind. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Modified Bessel Functions + +#### Modified Bessel Function of the First Kind + +```Python +modified_bessel_i( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Bessel function of the first kind: + +$$I_{\nu }(z)=\sum _{k=0}^{\infty } \frac{\left(\frac{z}{2}\right)^{2 k+\nu }}{\Gamma (k+\nu +1) k!}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Bessel Function of the First Kind of Order 0 + +```Python +modified_bessel_i_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Bessel function of the first kind of order $0$, $I_{0}(z)$. + +$I_{0}(z)$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Bessel Function of the First Kind of Order 1 + +```Python +modified_bessel_i_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Bessel function of the first kind of order $1$, $I_{1}(z)$. + +$I_{1}(z)$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Bessel Function of the Second Kind + +```Python +modified_bessel_k( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Bessel function of the second kind: + +$$K_{n}(z) = \frac{1}{2} \pi i^{n + 1} H_n^{1}(i z),$$ + +where $i$ is the imaginary unit and $H_{n}^{1}(z)$ is the Hankel function of the first kind. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Bessel Function of the Second Kind of Order 0 + +```Python +modified_bessel_k_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Bessel function of the first kind of order $0$, $K_{0}(z)$. + +$K_{0}(z)$ is defined for $\\{z \in \mathbb{R} \mid z > 0\\}$ and $\\{z \in \mathbb{C} \mid z \neq 0\\}$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Bessel Function of the Second Kind of Order 1 + +```Python +modified_bessel_k_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Bessel function of the first kind of order $1$, $K_{1}(z)$. + +$K_{1}(z)$ is defined for $\\{z \in \mathbb{R} \mid z > 0\\}$ and $\\{z \in \mathbb{C} \mid z \neq 0\\}$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Spherical Bessel Functions + +#### Spherical Bessel Function of the First Kind + +```Python +spherical_bessel_j( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Bessel function of the first kind: + +$$j_{n}(x)={\sqrt{\frac{\pi}{2x}}}J_{n + {\frac{1}{2}}}(x).$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Spherical Bessel Function of the First Kind of Order 0 + +```Python +spherical_bessel_j_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Bessel function of the first kind: + +$$j_{n}(x)={\sqrt{\frac{\pi}{2x}}}J_{n + {\frac{1}{2}}}(x)$$ + +where $n = 0$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Spherical Bessel Function of the First Kind of Order 1 + +```Python +spherical_bessel_j_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Bessel function of the first kind: + +$$j_{n}(x)={\sqrt{\frac{\pi}{2x}}}J_{n + {\frac{1}{2}}}(x)$$ + +where $n = 1$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Spherical Bessel Function of the Second Kind + +```Python +spherical_bessel_y( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Bessel function of the second kind: + +$$y_{n}(x)={\sqrt{\frac{\pi}{2x}}}Y_{n+{\frac{1}{2}}}(x).$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Spherical Bessel Function of the Second Kind of Order 0 + +```Python +spherical_bessel_y_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Bessel function of the second kind: + +$$y_{n}(x)={\sqrt{\frac{\pi}{2x}}}Y_{n+{\frac{1}{2}}}(x)$$ + +where $n = 0$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Spherical Bessel Function of the Second Kind of Order 1 + +```Python +spherical_bessel_y_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Bessel function of the second kind: + +$$y_{n}(x)={\sqrt{\frac{\pi}{2x}}}Y_{n+{\frac{1}{2}}}(x)$$ + +where $n = 1$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Spherical Hankel Functions + +#### Spherical Hankel Function of the First Kind + +```Python +spherical_hankel_h_1( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Hankel function of the first kind: + +$$h_{n}^{1}(z)=\frac{\sqrt{\frac{\pi}{2}}H_{n +\frac{1}{2}}^{1}(z)}{\sqrt{z}},$$ + +where $H_{n}^{1}$ is the Hankel function of the first kind. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Spherical Hankel Function of the Second Kind + +```Python +spherical_hankel_h_2( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Hankel function of the second kind: + +$$h_{n}^{2}(z)=\frac{\sqrt{\frac{\pi}{2}}H_{n+\frac{1}{2}}^{2}(z)}{\sqrt{z}},$$ + +where $H_{n}^{2}$ is the Hankel function of the second kind. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Modified Spherical Bessel Functions + +#### Modified Spherical Bessel Function of the First Kind + +```Python +modified_spherical_bessel_i( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified spherical Bessel function of the first kind: + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Spherical Bessel Function of the First Kind of Order 0 + +```Python +modified_spherical_bessel_i_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Spherical Bessel Function of the First Kind of Order 1 + +```Python +modified_spherical_bessel_i_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Spherical Bessel Function of the Second Kind + +```Python +modified_spherical_bessel_k( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Spherical Bessel Function of the Second Kind of Order 0 + +```Python +modified_spherical_bessel_k_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Spherical Bessel Function of the Second Kind of Order 1 + +```Python +modified_spherical_bessel_k_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Kelvin Functions + +#### Kelvin Function of the First Kind ($\operatorname{ber}$) + +```Python +kelvin_ber( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$$\mathrm {ber} _{n}(x)=({\frac {x}{2}})^{n}\sum _{k\geq 0}{\frac {\cos [({\frac {3n}{4}}+{\frac {k}{2}})\pi ]}{k!\Gamma (n+k+1)}}({\frac {x^{2}}{4}})^{k}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Kelvin Function of the First Kind ($\operatorname{bei}$) + +```Python +kelvin_bei( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Kelvin Function of the Second Kind ($\operatorname{kei}$) + +```Python +kelvin_kei( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Kelvin Function of the Second Kind ($\operatorname{ker}$) + +```Python +kelvin_ker( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Struve and Modified Struve Functions + +#### Struve Function + +```Python +struve_h( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Struve function: + +$$\mathbf{H}_{n}(z) = \sum_{m = 0}^{\infty}{\frac {(-1)^{m}}{\Gamma (m+{\frac {3}{2}})\Gamma (m+n +{\frac {3}{2}})}}({\frac {z}{2}})^{2m+n +1}.$$ + +where $\Gamma(z)$ is the gamma function. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Struve Function + +```Python +struve_l( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Struve function: + +$$\mathbf {L} _{n }(z)=\sum _{m=0}^{\infty }{\frac {1}{\Gamma (m+{\frac {3}{2}})\Gamma (m+n +{\frac {3}{2}})}}({\frac {z}{2}})^{2m+n +1}.$$ + +where $\Gamma(z)$ is the gamma function. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Lommel Functions + +#### Lommel Function of the First Kind + +#### Lommel Function of the Second Kind + +### Anger and Weber Functions + +#### Anger Function + +```Python +anger_j( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Anger function: + +$$\mathbf{J}_{n}(z)={\frac{1}{\pi}}\int_{0}^{\pi}\cos(n\theta-z\sin\theta)d\theta.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Weber Function + +```Python +weber_e( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Weber function: + +$$\mathbf{E}_{n}(z)={\frac{1}{\pi}}\int_{0}^{\pi}\sin(n\theta-z\sin \theta )d\theta.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Parabolic Cylinder Function + +```Python +parabolic_cylinder_d( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None +) -> Tensor +``` + +Parabolic cylinder function: + +$$D_{n}(z) = \sqrt{\pi} 2^{\tfrac{n}{2}} e^{-\frac{z^2}{4}} \left(\frac{ _1F_1(-\frac{n }{2}; \frac{1}{2}; \frac{z^2}{2})}{\Gamma (\frac{1-n }{2})}-\frac{\sqrt{2} z _1F_1(\frac{1-n }{2};\frac{3}{2};\frac{z^2}{2})}{\Gamma (-\frac{n }{2})} \right),$$ + +where $_1F_1$ is the confluent hypergeometric function of the first kind and $\Gamma$ is the gamma function. + +### Confluent Hypergeometric Functions + +#### Confluent Hypergeometric Function of the First Kind + +```Python +confluent_hypergeometric_1_f_1( + a: Tensor, + b: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Confluent hypergeometric function of the first kind: + +$$_{1}{F}_{1}(a; b; z) = \sum_{k = 0}^{\infty} \frac{a_{k}}{b_{k}} \frac{z^{k}}{k!},$$ + +where $a_{k}$ and $b_{k}$ are rising factorials. + +#### Confluent Hypergeometric Function of the Second Kind + +### Whittaker Functions + +Whittaker functions are defined as a special solution of Whittaker’s equation: + +$${\frac {d^{2}w}{dz^{2}}}+(-{\frac {1}{4}}+{\frac {\kappa }{z}}+{\frac {1/4-\mu ^{2}}{z^{2}}})w=0.$$ + +#### Whittaker Function ($M_{\kappa, \mu}$) + +```Python +whittaker_m( + k: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Whittaker function: + +$${\displaystyle M_{\kappa ,\mu }(z)=\exp (-z/2)z^{\mu +{\tfrac {1}{2}}}M(\mu -\kappa +{\tfrac {1}{2}},1+2\mu ,z)}.$$ + +##### Parameters + +**k** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Whittaker Function ($W_{\kappa, \mu}$) + +```Python +whittaker_w( + k: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Whittaker function: + +$${\displaystyle W_{\kappa ,\mu }(z)=\exp (-z/2)z^{\mu +{\tfrac {1}{2}}}U(\mu -\kappa +{\tfrac {1}{2}},1+2\mu ,z).}$$ + +##### Parameters + +**k** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Legendre Functions + +#### Legendre Function of the First Kind + +#### Legendre Function of the Second Kind + +### Associated Legendre Functions + +#### Associated Legendre Function of the First Kind + +#### Associated Legendre Function of the Second Kind + +### Ferrers Functions + +#### Ferrers Function of the First Kind + +#### Ferrers Function of the Second Kind + +### Spherical and Spheroidal Harmonics + +### Generalized Hypergeometric and Related Functions + +### Appell Functions + +#### Appell Function ($F_{1}$) + +```Python +appell_f_1( + a: Tensor, + b: Tensor, + c: Tensor, + d: Tensor, + x: Tensor, + y: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Appell function: + +$$F_{1}(a; b, c; d; x, y) = \sum_{m, n=0}^{\infty}{\frac{a_{m + n}b_{m}c_{n}}{d_{m + n}m!n!}}x^{m}y^{n}.$$ + +##### Parameters + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**c** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Appell Function ($F_{2}$) + +```Python +appell_f_2( + a: Tensor, + b: Tensor, + c: Tensor, + d: Tensor, + e: Tensor, + x: Tensor, + y: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**c** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Appell Function ($F_{3}$) + +```Python +appell_f_3( + a: Tensor, + b: Tensor, + c: Tensor, + d: Tensor, + e: Tensor, + x: Tensor, + y: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**c** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Appell Function ($F_{4}$) + +```Python +appell_f_4( + a: Tensor, + b: Tensor, + c: Tensor, + d: Tensor, + x: Tensor, + y: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**c** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### $q$-Hypergeometric and Related Functions + +#### $q$-Factorial + +#### $q$-Binomial Coefficient + +#### $q$-Gamma Function + +#### $q$-Digamma Function + +#### $q$-Polygamma Function + +### Chebyshev Polynomials + +#### Chebyshev Polynomial of the First Kind + +```Python +chebyshev_polynomial_t( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Chebyshev polynomial of the first kind, $T_{n}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Chebyshev Polynomial of the Second Kind + +```Python +chebyshev_polynomial_u( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Chebyshev polynomial of the second kind, $U_{n}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Chebyshev Polynomial of the Third Kind + +```Python +chebyshev_polynomial_v( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Chebyshev polynomial of the third kind, $V_{n}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Chebyshev Polynomial of the Fourth Kind + +```Python +chebyshev_polynomial_w( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Chebyshev polynomial of the fourth kind, $W_{n}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Shifted Chebyshev Polynomials + +#### Shifted Chebyshev Polynomial of the First Kind + +```Python +shifted_chebyshev_polynomial_t( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Shifted Chebyshev polynomial of the first kind, $T_{n}^{\ast}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Shifted Chebyshev Polynomial of the Second Kind + +```Python +shifted_chebyshev_polynomial_u( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Shifted Chebyshev polynomial of the second kind, $U_{n}^{\ast}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Shifted Chebyshev Polynomial of the Third Kind + +```Python +shifted_chebyshev_polynomial_v( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Shifted Chebyshev polynomial of the third kind, $V_{n}^{\ast}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Shifted Chebyshev Polynomial of the Fourth Kind + +```Python +shifted_chebyshev_polynomial_w( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Shifted Chebyshev polynomial of the fourth kind, $W_{n}^{\ast}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Hermite Polynomials + +#### Probabilist’s Hermite Polynomial + +```Python +hermite_polynomial_he( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Probabilist’s Hermite polynomial: + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Physicist’s Hermite Polynomial + +```Python +hermite_polynomial_h( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Physicist’s Hermite polynomial: + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Orthogonal Polynomials + +### Legendre Forms of Elliptic Integrals + +#### Elliptic Integral of the First Kind + +```Python +legendre_elliptic_integral_f( + m: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre form of the incomplete elliptic integral of the first kind: + +The incomplete elliptic integral is defined in terms of the parameter $m$ instead of the elliptic modulus $k$. $m$ is defined as $m = k^{2}$. + +##### Parameters + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Elliptic Integral of the Second Kind + +```Python +legendre_elliptic_integral_e( + m: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre form of the incomplete elliptic integral of the second kind: + +The incomplete elliptic integral is defined in terms of the parameter $m$ instead of the elliptic modulus $k$. $m$ is defined as $m = k^{2}$. + +##### Parameters + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Elliptic Integral of the Third Kind + +```Python +legendre_elliptic_integral_pi( + n: Tensor, + m: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre form of the incomplete elliptic integral of the third kind: + +The incomplete elliptic integral is defined in terms of the parameter $m$ instead of the elliptic modulus $k$. $m$ is defined as $m = k^{2}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Legendre Forms of Complete Elliptic Integrals + +#### Complete Elliptic Integral of the First Kind + +```Python +complete_legendre_elliptic_integral_k( + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre form of the complete elliptic integral of the first kind: + +$$K(m) = F({\tfrac{\pi}{2}}, m).$$ + +The complete elliptic integral is defined in terms of the parameter $m$ instead of the elliptic modulus $k$. $m$ is defined as $m = k^{2}$. + +##### Parameters + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Complete Elliptic Integral of the Second Kind + +```Python +complete_legendre_elliptic_integral_e( + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre form of the complete elliptic integral of the second kind: + +$$E(m) = \int_{0}^{\tfrac{\pi}{2}}{\sqrt{1 - m \sin^{2} \theta}}d\theta.$$ + +The complete elliptic integral is defined in terms of the parameter $m$ instead of the elliptic modulus $k$. $m$ is defined as $m = k^{2}$. + +##### Parameters + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Complete Elliptic Integral of the Third Kind + +```Python +complete_legendre_elliptic_integral_pi( + n: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre form of the complete elliptic integral of the third kind: + +$$\Pi(n, m) = \int_{0}^{\frac{\pi}{2}}{\frac{d\theta}{(1 - n\sin^{2}\theta){\sqrt{1 - m\sin ^{2}\theta }}}}.$$ + +The complete elliptic integral is defined in terms of the parameter $m$ instead of the elliptic modulus $k$. $m$ is defined as $m = k^{2}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Carlson Symmetric Forms of Elliptic Integrals + +#### Carlson Elliptic Integral ($R_{C}$) + +```Python +carlson_elliptic_integral_r_c( + x: Tensor, + y: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Carlson Elliptic Integral ($R_{D}$) + +```Python +carlson_elliptic_integral_r_d( + x: Tensor, + y: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Carlson Elliptic Integral ($R_{E}$) + +```Python +carlson_elliptic_integral_r_e( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Carlson Elliptic Integral ($R_{F}$) + +```Python +carlson_elliptic_integral_r_f( + x: Tensor, + y: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Carlson Elliptic Integral ($R_{G}$) + +```Python +carlson_elliptic_integral_r_g( + x: Tensor, + y: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Carlson Elliptic Integral ($R_{J}$) + +```Python +carlson_elliptic_integral_r_j( + x: Tensor, + y: Tensor, + z: Tensor, + p: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Carlson Elliptic Integral ($R_{K}$) + +```Python +carlson_elliptic_integral_r_k( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Carlson Elliptic Integral ($R_{M}$) + +```Python +carlson_elliptic_integral_r_m( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +### Theta Functions + +#### Theta Function ($\theta_{1}$) + +```Python +theta_1( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Theta Function ($\theta_{2}$) + +```Python +theta_2( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Theta Function ($\theta_{3}$) + +```Python +theta_3( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Theta Function ($\theta_{4}$) + +```Python +theta_4( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +### Jacobi Elliptic Functions + +#### Jacobi Amplitude Function + +```Python +jacobi_amplitude_am( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Jacobi Elliptic Function ($\operatorname{sn}$) + +```Python +jacobi_elliptic_sn( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$$\operatorname{sn}(z \mid m) = \sin(\operatorname{am}(z \mid m))$$ + +#### Jacobi Elliptic Function ($\operatorname{cn}$) + +```Python +jacobi_elliptic_cn( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$$\operatorname{cn}(z \mid m) = \cos(\operatorname{am}(z \mid m))$$ + +#### Jacobi Elliptic Function ($\operatorname{dn}$) + +```Python +jacobi_elliptic_dn( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Jacobi Elliptic Function ($\operatorname{sd}$) + +```Python +jacobi_elliptic_sd( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Jacobi Elliptic Function ($\operatorname{cd}$) + +```Python +jacobi_elliptic_cd( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$$\operatorname{cd}(z \mid m) = \frac{\operatorname{cn}(z \mid m)}{\operatorname{dn}(z \mid m)}$$ + +#### Jacobi Elliptic Function ($\operatorname{sc}$) + +```Python +jacobi_elliptic_sc( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +### Inverse Jacobi Elliptic Functions + +#### Inverse Jacobi Elliptic Function ($\operatorname{sn}$) + +```Python +inverse_jacobi_elliptic_sn( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Inverse Jacobi Elliptic Function ($\operatorname{cn}$) + +```Python +inverse_jacobi_elliptic_cn( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Inverse Jacobi Elliptic Function ($\operatorname{dn}$) + +```Python +inverse_jacobi_elliptic_dn( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Inverse Jacobi Elliptic Function ($\operatorname{sd}$) + +```Python +inverse_jacobi_elliptic_sd( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Inverse Jacobi Elliptic Function ($\operatorname{cd}$) + +```Python +inverse_jacobi_elliptic_cd( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Inverse Jacobi Elliptic Function ($\operatorname{sc}$) + +```Python +inverse_jacobi_elliptic_sc( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +### Weierstrass Elliptic Functions + +#### Weierstrass Elliptic Function (p) + +#### Weierstrass Elliptic Function (\zeta) + +#### Weierstrass Elliptic Function (\sigma) + +### Modular Functions + +#### Elliptic Function (\lambda) + +#### Klein’s Complete Invariant Function + +### Bernoulli Number and Polynomial + +#### Bernoulli Number + +```Python +bernoulli_number_b( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ Bernoulli number, $B_{n}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bernoulli Polynomial + +```Python +bernoulli_polynomial_b( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bernoulli polynomial, $B_{n}(x)$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Euler Number and Polynomial + +#### Euler Number + +```Python +euler_number_e( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ Euler number, $E_{n}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Euler Polynomial + +```Python +euler_polynomial_e( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Euler polynomial, $E_{n}(x)$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Zeta and Related Functions + +#### Riemann Zeta Function + +```Python +riemann_zeta( + s: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Riemann zeta function: + +$$\zeta(s)=\sum _{n=1}^{\infty}{\frac{1}{n^{s}}}.$$ + +#### Hurwitz Zeta Function + +```Python +hurwitz_zeta( + s: Tensor, + a: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Hurwitz zeta function: + +$$\zeta(s, a) = \sum _{n = 0}^{\infty}{\frac{1}{(n + a)^{s}}}.$$ + +#### Polylogarithm + +```Python +polylogarithm_li( + s: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Polylogarithm: + +$$\operatorname{Li}_{s + 1}(z ) = \int_{0}^{z}{\frac{\operatorname{Li}_{s}(t)}{t}}dt.$$ + +#### Lerch Zeta Function + +```Python +lerch_zeta_l( + l: Tensor, + z: Tensor, + a: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Lerch Transcendent + +#### Dirichlet L-Function + +### Multiplicative Number Theoretic Functions + +#### Prime Number + +```Python +prime_number_p( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ prime number, $p(n)$. + +#### Euler’s Totient Function + +#### Divisor Function + +#### Jordan’s Totient Function + +#### Möbius Function + +#### Liouville Function + +### Matthieu Characteristic Values + +#### Matthieu Characteristic Value ($a$) + +#### Matthieu Characteristic Value ($b$) + +### Angular Matthieu Functions + +#### Angular Matthieu Function ($\operatorname{ce}$) + +#### Angular Matthieu Function ($\operatorname{se}$) + +### Radial Mathieu Functions + +#### Radial Matthieu Function ($\operatorname{M}c$) + +#### Radial Matthieu Function ($\operatorname{M}s$) + +### Lamé Functions + +### Spherodial Wave Functions + +### Heun Functions + +#### Heun Function + +#### Confluent Heun Function + +#### Doubly-Confluent Heun Function + +#### Bi-Confluent Heun Function + +#### Tri-Confluent Heun Function + +### Painlevé Transcendents + +### Coulomb Wave Functions + +#### Coulomb Wave Function (F) + +#### Coulomb Wave Function (G) + +### 3-j, 6-j, and 9-j Symbols + +#### 3-j Symbol + +#### 6-j Symbol + +#### 9-j Symbol + +## Metrics + +
+What are the main metrics to measure the value of this feature? +
+ +## Drawbacks + +
+Are there any reasons why we should not do this? Here we aim to evaluate risk and check ourselves. + +Please consider: +* is it a breaking change? +* Impact on UX +* implementation cost, both in terms of code size and complexity +* integration of this feature with other existing and planned features +
+ +## Alternatives + +
+What other designs have been considered? What is the impact of not doing this? +
+ +## Prior Art + +
+Discuss prior art (both good and bad) in relation to this proposal: +* Does this feature exist in other libraries? What experience has their community had? +* What lessons can be learned from other implementations of this feature? +* Published papers or great posts that discuss this +
+ +### Cephes Mathematical Library + +Suite of elementary and special functions written by Stephen L. Moshier. It was initially created as a supplement to his numerical analysis textbook, “Methods and Programs for Mathematical Functions.” Unsure of the original publication date, but I estimate somewhere between 1984 and 1986. It was most recently updated, by Moshier, in 2018. Its use is ubiquitous (it’s even presently used in PyTorch), and DeepMind recently maintained a library wrapper for PyTorch. + +### specfun + +Suite of elementary and special functions authored by W. J. Cody, a numerical analysis pioneer, written in Fortran. It’s abandonware. + +### Wolfram Language + +General-purpose, commercial, multi-paradigm programming language written and maintained by Wolfram Research. The Wolfram Language touts one of the best suites of elementary and special functions. Most of these functions support either symbolic, or relevant to PyTorch, numerical evaluation and differentiation. + +### MATLAB +### International Mathematics and Statistics Library (IMSL) +### NAG Numerical Library +### GNU Octave +### GNU Scientific Library (GSL) + +### SciPy + +SciPy is a free and open-source Python package for scientific computing. It contains modules for linear algebra, integration, optimization, etc. SciPy also contains a robust suite of special functions. Most of the special function implementations rely on third-party packages, many featured elsewhere in this subsection (e.g., Cephes and specfun). + +## How we teach this + +
+* What names and terminology work best for these concepts and why? How is this idea best presented? +* Would the acceptance of this proposal mean the PyTorch documentation must be re-organized or altered? +* How should this feature be taught to existing PyTorch users? +
+ +## Unresolved questions + +
+* What parts of the design do you expect to resolve through the RFC process before this gets merged? +* What parts of the design do you expect to resolve through the implementation of this feature before stabilization? +* What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC? +
+ +## Resolution + +
+We decided to do it. X% of the engineering team actively approved of this change. +
+ +### Level of Support + +
+Choose one of the following: +* 1: Overwhelming positive feedback. +* 2: Positive feedback. +* 3: Majority Acceptance, with conflicting Feedback. +* 4: Acceptance, with Little Feedback. +* 5: Unclear Resolution. +* 6: RFC Rejected. +* 7: RFC Rejected, with Conflicting Feedback. +
+ +#### Additional Context + +
+Some people were in favor of it, but some people didn’t want it for project X. +
+ +### Next Steps + +
+Will implement it. +
+ +#### Tracking issue + +
+ +
+ +#### Exceptions + +
+Not implementing on project X now. Will revisit the decision in 1 year. +
\ No newline at end of file From 6ace7e70ee9020fb4aee6dd20d8dedcdc34657a8 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:26:27 -0400 Subject: [PATCH 002/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 54 +++++++++++------------------------ 1 file changed, 16 insertions(+), 38 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index d332a4ac..44b297a7 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1,25 +1,3 @@ -
-Instructions - click to expand - -- Fork the rfcs repo: https://github.com/pytorch/rfcs -- Copy `RFC-0000-template.md` to `RFC-00xx-my-feature.md`, or write your own open-ended proposal. Put care into the details. -- Submit a pull request titled `RFC-00xx-my-feature`. - - Assign the `draft` label while composing the RFC. You may find it easier to use a WYSIWYG editor (like Google Docs) when working with a few close collaborators; feel free to use whatever platform you like. Ideally this document is publicly visible and is linked to from the PR. - - When opening the RFC for general discussion, copy your document into the `RFC-00xx-my-feature.md` file on the PR and assign the `commenting` label. -- Build consensus for your proposal, integrate feedback and revise it as needed, and summarize the outcome of the discussion via a [resolution template](https://github.com/pytorch/rfcs/blob/rfc-process/RFC-0000-template.md#resolution). - - If the RFC is idle here (no activity for 2 weeks), assign the label `stalled` to the PR. -- Once the discussion has settled, assign a new label based on the level of support: - - `accepted` if a decision has been made in the RFC - - `draft` if the author needs to rework the RFC’s proposal - - `shelved` if there are no plans to move ahead with the current RFC’s proposal. We want neither to think about evaluating the proposal - nor about implementing the described feature until some time in the future. -- A state of `accepted` means that the core team has agreed in principle to the proposal, and it is ready for implementation. -- The author (or any interested developer) should next open a tracking issue on Github corresponding to the RFC. - - This tracking issue should contain the implementation next steps. Link to this tracking issue on the RFC (in the Resolution > Next Steps section) -- Once all relevant PRs are merged, the RFC’s status label can be finally updated to `closed`. - -
- # Special Functions _Author’s note—This RFC is a work-in-progress._ @@ -47,29 +25,16 @@ PyTorch maintainers: * provides much needed standardization to committing future operators to PyTorch. * provides an extremely useful set of operators that can and should be used for tricky numerical problems (e.g., implementing challenging distribution functions and gradients) and useful decomposition targets. - -## Table of Contents - + ## Motivation -### What’s a special function? +### Special Functions There’s no formal definition of a “special function.” Colloquially, and for the purpose of this RFC, a special function is a mathematical function that has an established name and notation due to its importance and ubiquity. -## Special Function Policies - -PyTorch’s mathematical operators should be categorized as either “elementary” or “special.” An elementary function is a mathematical function whose corresponding operator is available from the `torch` module. A special function is a mathematical function whose corresponding operator is available from the `torch.special` module. Regardless of whether an operator implements an elementary or special function, each operator must share the following properties: - -* A name that adheres to the naming policy. -* A docstring that clearly communicates the following: - * A primary definition - * Real and complex domains - * Real and complex graphs -* If differentiable, derivtatives for each variable. - ### Elementary Functions -Unlike “special functions,” “elementary functions” have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing a function as an elementary function if the function is a mathematical function of a single variable (i.e., a unary operator) and the function is one of the following functions or belongs to the following families of functions: +Unlike “special functions,” “elementary functions” have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing a function as an elementary function if the function is one of the following functions or belongs to the following families of functions: * Cardinal Functions * Dirac delta @@ -89,6 +54,19 @@ Unlike “special functions,” “elementary functions” have a rigorous defi * Tensorial Functions * Trigonometric +## Special Function Policies + +PyTorch’s mathematical operators should be categorized as either “elementary” or “special.” An elementary function is a mathematical function whose corresponding operator is available from the `torch` module. A special function is a mathematical function whose corresponding operator is available from the `torch.special` module. Regardless of whether an operator implements an elementary or special function, each operator must share the following properties: + +* A name that adheres to the naming policy. +* A docstring that clearly communicates the following: + * A primary definition + * Real and complex domains + * Real and complex graphs +* If differentiable, derivtatives for each variable. + + + ## Proposed Implementation ### Factorials From 6b4edfe746586929e1c4556af0e638f2bd8b7345 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:27:16 -0400 Subject: [PATCH 003/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 44b297a7..e8d938c8 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -30,7 +30,7 @@ PyTorch maintainers: ### Special Functions -There’s no formal definition of a “special function.” Colloquially, and for the purpose of this RFC, a special function is a mathematical function that has an established name and notation due to its importance and ubiquity. +There’s no formal definition of a “special function.” Colloquially, and for the purpose of this RFC, a special function is a non-elementary function that has an established name and notation due to its importance and ubiquity. ### Elementary Functions From 9c39c44de8235c493abe6891489859cc93a372a7 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:27:47 -0400 Subject: [PATCH 004/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index e8d938c8..0fd5fed4 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -34,7 +34,7 @@ There’s no formal definition of a “special function.” Colloquially, and fo ### Elementary Functions -Unlike “special functions,” “elementary functions” have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing a function as an elementary function if the function is one of the following functions or belongs to the following families of functions: +Unlike “special functions,” “elementary functions” have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing a function as an elementary function if the function belongs to the following families of functions: * Cardinal Functions * Dirac delta From 0b7ac7c13b56ba8fb9a43ea229ee3c590435ae08 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:29:19 -0400 Subject: [PATCH 005/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 0fd5fed4..e00571a3 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -36,22 +36,17 @@ There’s no formal definition of a “special function.” Colloquially, and fo Unlike “special functions,” “elementary functions” have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing a function as an elementary function if the function belongs to the following families of functions: -* Cardinal Functions -* Dirac delta -* Euler Number -* Exponential -* Fibonaci Number -* Greatest common divisor +* Arithmetic +* Greatest Common Divisor * Hyperbolic * Inverse Hyperbolic * Inverse Trigonometric -* Kronecker delta -* Least common multiple +* Least Common Multiple * Logarithmic +* Logical * Partitions * Power * Rounding and Congruence Functions -* Tensorial Functions * Trigonometric ## Special Function Policies From b5fa55de143b82aad0f208bba9e2017c7c446525 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:30:09 -0400 Subject: [PATCH 006/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index e00571a3..d788279f 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -34,7 +34,7 @@ There’s no formal definition of a “special function.” Colloquially, and fo ### Elementary Functions -Unlike “special functions,” “elementary functions” have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing a function as an elementary function if the function belongs to the following families of functions: +Unlike “special functions,” “elementary functions” have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing a function as an elementary function if the function is one of the following functions: * Arithmetic * Greatest Common Divisor From 60fa1304f239050c72c8e3e339c35853ddaebf32 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:31:13 -0400 Subject: [PATCH 007/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index d788279f..b3e52815 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -60,9 +60,7 @@ PyTorch’s mathematical operators should be categorized as either “elementary * Real and complex graphs * If differentiable, derivtatives for each variable. - - -## Proposed Implementation +## Python API ### Factorials From 498e1f8b27ea954b17324083dfaf384373870810 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:34:02 -0400 Subject: [PATCH 008/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index b3e52815..d784f9fd 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -36,18 +36,15 @@ There’s no formal definition of a “special function.” Colloquially, and fo Unlike “special functions,” “elementary functions” have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing a function as an elementary function if the function is one of the following functions: -* Arithmetic -* Greatest Common Divisor -* Hyperbolic -* Inverse Hyperbolic -* Inverse Trigonometric -* Least Common Multiple -* Logarithmic -* Logical -* Partitions -* Power +* Power Functions +* Exponential Functions +* Logarithmic Functions +* Trigonometric Functions +* Inverse Trigonometric Functions +* Hyperbolic Functions +* Inverse Hyperbolic Functions +* Greatest Common Divisor and Least Common Multiple * Rounding and Congruence Functions -* Trigonometric ## Special Function Policies From 220b9aeb98d0ba8b96894524943887ffbae334d8 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:35:00 -0400 Subject: [PATCH 009/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index d784f9fd..ef2be647 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -43,6 +43,10 @@ Unlike “special functions,” “elementary functions” have a rigorous defi * Inverse Trigonometric Functions * Hyperbolic Functions * Inverse Hyperbolic Functions +* Product Logarithms +* Roots +* Maximum and Minimum +* Cardinal Functions * Greatest Common Divisor and Least Common Multiple * Rounding and Congruence Functions From cb4f3a62319468939c58add8b27cc53431443562 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:36:11 -0400 Subject: [PATCH 010/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index ef2be647..68267123 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -30,11 +30,11 @@ PyTorch maintainers: ### Special Functions -There’s no formal definition of a “special function.” Colloquially, and for the purpose of this RFC, a special function is a non-elementary function that has an established name and notation due to its importance and ubiquity. +There’s no formal definition of a *special function*. Colloquially, and for the purpose of this RFC, a special function is a non-elementary function that has an established name and notation due to its importance and ubiquity. ### Elementary Functions -Unlike “special functions,” “elementary functions” have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing a function as an elementary function if the function is one of the following functions: +Unlike special functions, *elementary functions* have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing a function as an elementary function if the function is one of the following functions: * Power Functions * Exponential Functions From ed359b47ed70835b4432d3f6e102a39588dcf5bd Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:37:07 -0400 Subject: [PATCH 011/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 68267123..5cc4d186 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -34,7 +34,7 @@ There’s no formal definition of a *special function*. Colloquially, and for th ### Elementary Functions -Unlike special functions, *elementary functions* have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing a function as an elementary function if the function is one of the following functions: +Unlike special functions, *elementary functions* have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing the following functions as elementary: * Power Functions * Exponential Functions From 9d80cf43e11ec041854657d9e8add4a119555948 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:37:46 -0400 Subject: [PATCH 012/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 5cc4d186..b8ca948f 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -15,7 +15,7 @@ This RFC proposes: * a coherent philosophy for PyTorch’s special functions module ([torch.special](https://pytorch.org/docs/stable/special.html)) that clearly distinguishes PyTorch’s elementary from special functions; and * a set of new [torch](https://pytorch.org/docs/stable/torch.html) and [torch.special](https://pytorch.org/docs/stable/special.html) operators that provide a robust numerical foundation for PyTorch and adhere to the aforementioned philosophy. -This feature has two audiences: +## Motivation PyTorch users: @@ -26,8 +26,6 @@ PyTorch maintainers: * provides much needed standardization to committing future operators to PyTorch. * provides an extremely useful set of operators that can and should be used for tricky numerical problems (e.g., implementing challenging distribution functions and gradients) and useful decomposition targets. -## Motivation - ### Special Functions There’s no formal definition of a *special function*. Colloquially, and for the purpose of this RFC, a special function is a non-elementary function that has an established name and notation due to its importance and ubiquity. From 649aca3ed03614a5f5dddebd93378fd91f431048 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:42:29 -0400 Subject: [PATCH 013/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 39 +++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index b8ca948f..ccabe1d1 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -35,17 +35,52 @@ There’s no formal definition of a *special function*. Colloquially, and for th Unlike special functions, *elementary functions* have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing the following functions as elementary: * Power Functions + * torch.pow + * torch.sqrt * Exponential Functions + * torch.exp * Logarithmic Functions + * torch.log * Trigonometric Functions -* Inverse Trigonometric Functions + * torch.sin + * torch.cos + * torch.tan + * torch.cot + * torch.csc + * torch.sec +* Inverse Trigonometric Functions + * torch.asin + * torch.acos + * torch.atan + * torch.atan + * torch.acot + * torch.acsc + * torch.asec * Hyperbolic Functions + * torch.sinh + * torch.cosh + * torch.tanh + * torch.coth + * torch.csch + * torch.sech * Inverse Hyperbolic Functions + * torch.asinh + * torch.acosh + * torch.atanh + * torch.atanh + * torch.acoth + * torch.acsch + * torch.asech * Product Logarithms * Roots * Maximum and Minimum + * torch.max + * torch.min * Cardinal Functions -* Greatest Common Divisor and Least Common Multiple + * torch.sinc +* Greatest Common Divisor (GCD) and Least Common Multiple (LCM) + * torch.gcd + * torch.lcm * Rounding and Congruence Functions ## Special Function Policies From 17b128e740bbaed56ec850aeabf4e95b087f69dc Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:44:32 -0400 Subject: [PATCH 014/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index ccabe1d1..f83f5f50 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -39,8 +39,13 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.sqrt * Exponential Functions * torch.exp + * torch.exp2 + * torch.expm1 * Logarithmic Functions * torch.log + * torch.log10 + * torch.log1p + * torch.log2 * Trigonometric Functions * torch.sin * torch.cos From 998f6c28387bab6870d3b15b70b5c4a3965d82fb Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:47:45 -0400 Subject: [PATCH 015/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index f83f5f50..e601eb1c 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -87,6 +87,11 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.gcd * torch.lcm * Rounding and Congruence Functions + * torch.ceil + * torch.floor + * torch.round + * torch.floor_divide + * torch.remainder ## Special Function Policies From 5359b120998ddae5a7b0da910c008eae7697e6d5 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:49:12 -0400 Subject: [PATCH 016/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index e601eb1c..5acd13ec 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -32,7 +32,7 @@ There’s no formal definition of a *special function*. Colloquially, and for th ### Elementary Functions -Unlike special functions, *elementary functions* have a rigorous definition but, for simplicity, PyTorch uses a simplified definition, categorizing the following functions as elementary: +Unlike special functions, *elementary functions* have a rigorous definition but, for simplicity, this RFC uses a simplified definition, categorizing the following functions as elementary: * Power Functions * torch.pow @@ -89,9 +89,9 @@ Unlike special functions, *elementary functions* have a rigorous definition but * Rounding and Congruence Functions * torch.ceil * torch.floor - * torch.round * torch.floor_divide * torch.remainder + * torch.round ## Special Function Policies From fe4511da4faddbe75a792aa65a2c3c7a5ef158e5 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:50:33 -0400 Subject: [PATCH 017/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 5acd13ec..1f2b716d 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -46,6 +46,8 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.log10 * torch.log1p * torch.log2 + * torch.xlog1py + * torch.xlogy * Trigonometric Functions * torch.sin * torch.cos From ea05803a16419863e0c6a59996d2cbb720459183 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:51:39 -0400 Subject: [PATCH 018/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 1f2b716d..1f7ce449 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -80,6 +80,7 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.asech * Product Logarithms * Roots + * *See the proposed torch.root operator subsection* * Maximum and Minimum * torch.max * torch.min From 48f21120680c67c311bc7f6f35113f52042dbb13 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:52:33 -0400 Subject: [PATCH 019/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 1f7ce449..c6ebc09e 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -95,6 +95,8 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.floor_divide * torch.remainder * torch.round +* Partitions +* Tensorial Functions ## Special Function Policies From ac536f5b97891d79d576a8459a19363ab64f14d0 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:56:13 -0400 Subject: [PATCH 020/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index c6ebc09e..23c41ff3 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -80,7 +80,7 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.asech * Product Logarithms * Roots - * *See the proposed torch.root operator subsection* + * *See the `torch.root` section for the proposed operator* * Maximum and Minimum * torch.max * torch.min @@ -97,6 +97,9 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.round * Partitions * Tensorial Functions + * *See the `torch.dirac_delta` section for the proposed operator* + * *See the `torch.kronecker_delta` section for the proposed operator* + * *See the `torch.levi_civita` section for the proposed operator* ## Special Function Policies From 1a198606549921d8c0d950210853da5112379c3c Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:57:05 -0400 Subject: [PATCH 021/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 23c41ff3..917ea21e 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -97,9 +97,9 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.round * Partitions * Tensorial Functions - * *See the `torch.dirac_delta` section for the proposed operator* - * *See the `torch.kronecker_delta` section for the proposed operator* - * *See the `torch.levi_civita` section for the proposed operator* + * torch.dirac_delta *See the section for the proposed operator* + * torch.kronecker_delta *See the section for the proposed operator* + * torch.levi_civita *See the section for the proposed operator* ## Special Function Policies From 72d45506b011a22a72ae19d63a7f841b4d5ba87e Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:57:21 -0400 Subject: [PATCH 022/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 917ea21e..fd013761 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -97,9 +97,9 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.round * Partitions * Tensorial Functions - * torch.dirac_delta *See the section for the proposed operator* - * torch.kronecker_delta *See the section for the proposed operator* - * torch.levi_civita *See the section for the proposed operator* + * `torch.dirac_delta` *See the section for the proposed operator* + * `torch.kronecker_delta` *See the section for the proposed operator* + * `torch.levi_civita` *See the section for the proposed operator* ## Special Function Policies From 18c4fa205200b81ecd00829fffec367f506d458d Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:58:26 -0400 Subject: [PATCH 023/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index fd013761..fddc98fc 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -97,9 +97,9 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.round * Partitions * Tensorial Functions - * `torch.dirac_delta` *See the section for the proposed operator* - * `torch.kronecker_delta` *See the section for the proposed operator* - * `torch.levi_civita` *See the section for the proposed operator* + * `torch.dirac_delta` *See the “Dirac Delta” section for the proposed operator* + * `torch.kronecker_delta` *See the “Kronecker Delta” section for the proposed operator* + * `torch.levi_civita` *See the “Levi-Civita Symbol” section for the proposed operator* ## Special Function Policies From 217714b87bdca9de5c677014045f310135cc9c0b Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 16:59:27 -0400 Subject: [PATCH 024/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index fddc98fc..b7a8b986 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -80,7 +80,7 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.asech * Product Logarithms * Roots - * *See the `torch.root` section for the proposed operator* + * `torch.root` *See the “Polynomial Root” section for the proposed operator* * Maximum and Minimum * torch.max * torch.min From 7105ef1540a526d5f98bc2e333546e4cc5f3f70b Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 17:00:35 -0400 Subject: [PATCH 025/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index b7a8b986..dbd8c090 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -96,6 +96,7 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.remainder * torch.round * Partitions + * `torch.partition_p` *See the “Partition Function” section for the proposed operator* * Tensorial Functions * `torch.dirac_delta` *See the “Dirac Delta” section for the proposed operator* * `torch.kronecker_delta` *See the “Kronecker Delta” section for the proposed operator* From 59c6f0f8db019c2139157bb2fed7e06451511cd0 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 17:01:10 -0400 Subject: [PATCH 026/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index dbd8c090..efcc2925 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -101,6 +101,8 @@ Unlike special functions, *elementary functions* have a rigorous definition but * `torch.dirac_delta` *See the “Dirac Delta” section for the proposed operator* * `torch.kronecker_delta` *See the “Kronecker Delta” section for the proposed operator* * `torch.levi_civita` *See the “Levi-Civita Symbol” section for the proposed operator* +* Discontinuous Functions +* Functions with Singular Support ## Special Function Policies From 8c3e3f2115e7b9cf4a727899ecfcc8abf67b1733 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 17:06:02 -0400 Subject: [PATCH 027/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 92 ----------------------------------- 1 file changed, 92 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index efcc2925..7878bc6e 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3549,47 +3549,14 @@ $n^{\text{th}}$ prime number, $p(n)$. #### Coulomb Wave Function (G) -### 3-j, 6-j, and 9-j Symbols - -#### 3-j Symbol - -#### 6-j Symbol - -#### 9-j Symbol - ## Metrics -
-What are the main metrics to measure the value of this feature? -
- ## Drawbacks -
-Are there any reasons why we should not do this? Here we aim to evaluate risk and check ourselves. - -Please consider: -* is it a breaking change? -* Impact on UX -* implementation cost, both in terms of code size and complexity -* integration of this feature with other existing and planned features -
- ## Alternatives -
-What other designs have been considered? What is the impact of not doing this? -
- ## Prior Art -
-Discuss prior art (both good and bad) in relation to this proposal: -* Does this feature exist in other libraries? What experience has their community had? -* What lessons can be learned from other implementations of this feature? -* Published papers or great posts that discuss this -
- ### Cephes Mathematical Library Suite of elementary and special functions written by Stephen L. Moshier. It was initially created as a supplement to his numerical analysis textbook, “Methods and Programs for Mathematical Functions.” Unsure of the original publication date, but I estimate somewhere between 1984 and 1986. It was most recently updated, by Moshier, in 2018. Its use is ubiquitous (it’s even presently used in PyTorch), and DeepMind recently maintained a library wrapper for PyTorch. @@ -3611,62 +3578,3 @@ General-purpose, commercial, multi-paradigm programming language written and mai ### SciPy SciPy is a free and open-source Python package for scientific computing. It contains modules for linear algebra, integration, optimization, etc. SciPy also contains a robust suite of special functions. Most of the special function implementations rely on third-party packages, many featured elsewhere in this subsection (e.g., Cephes and specfun). - -## How we teach this - -
-* What names and terminology work best for these concepts and why? How is this idea best presented? -* Would the acceptance of this proposal mean the PyTorch documentation must be re-organized or altered? -* How should this feature be taught to existing PyTorch users? -
- -## Unresolved questions - -
-* What parts of the design do you expect to resolve through the RFC process before this gets merged? -* What parts of the design do you expect to resolve through the implementation of this feature before stabilization? -* What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC? -
- -## Resolution - -
-We decided to do it. X% of the engineering team actively approved of this change. -
- -### Level of Support - -
-Choose one of the following: -* 1: Overwhelming positive feedback. -* 2: Positive feedback. -* 3: Majority Acceptance, with conflicting Feedback. -* 4: Acceptance, with Little Feedback. -* 5: Unclear Resolution. -* 6: RFC Rejected. -* 7: RFC Rejected, with Conflicting Feedback. -
- -#### Additional Context - -
-Some people were in favor of it, but some people didn’t want it for project X. -
- -### Next Steps - -
-Will implement it. -
- -#### Tracking issue - -
- -
- -#### Exceptions - -
-Not implementing on project X now. Will revisit the decision in 1 year. -
\ No newline at end of file From 8ac959930b9ab71cb776c2c253fd196c37fe92e9 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Mon, 10 Oct 2022 11:00:19 -0400 Subject: [PATCH 028/108] Update RFC-00xx-special-functions.md --- .gitignore | 3 +- RFC-00xx-special-functions.md | 3669 +++++++++++++++++++++++++++++++++ 2 files changed, 3671 insertions(+), 1 deletion(-) create mode 100644 RFC-00xx-special-functions.md diff --git a/.gitignore b/.gitignore index 2dc8ca37..6143c2bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -**/.DS_STORE \ No newline at end of file +**/.DS_STORE +.idea diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md new file mode 100644 index 00000000..b7a8b986 --- /dev/null +++ b/RFC-00xx-special-functions.md @@ -0,0 +1,3669 @@ +# Special Functions + +_Author’s note—This RFC is a work-in-progress._ + +## Authors + +* Allen Goodman (@0x00b1) + +## Summary + +This proposal concerns adding new operators to PyTorch's special functions module (i.e., `torch.special`). The proposed operators have a wide range of use in scientific computing and numerical methods. + +This RFC proposes: + +* a coherent philosophy for PyTorch’s special functions module ([torch.special](https://pytorch.org/docs/stable/special.html)) that clearly distinguishes PyTorch’s elementary from special functions; and +* a set of new [torch](https://pytorch.org/docs/stable/torch.html) and [torch.special](https://pytorch.org/docs/stable/special.html) operators that provide a robust numerical foundation for PyTorch and adhere to the aforementioned philosophy. + +## Motivation + +PyTorch users: + +* solves the variety of common scientific and engineering problems that special functions address. + +PyTorch maintainers: + +* provides much needed standardization to committing future operators to PyTorch. +* provides an extremely useful set of operators that can and should be used for tricky numerical problems (e.g., implementing challenging distribution functions and gradients) and useful decomposition targets. + +### Special Functions + +There’s no formal definition of a *special function*. Colloquially, and for the purpose of this RFC, a special function is a non-elementary function that has an established name and notation due to its importance and ubiquity. + +### Elementary Functions + +Unlike special functions, *elementary functions* have a rigorous definition but, for simplicity, this RFC uses a simplified definition, categorizing the following functions as elementary: + +* Power Functions + * torch.pow + * torch.sqrt +* Exponential Functions + * torch.exp + * torch.exp2 + * torch.expm1 +* Logarithmic Functions + * torch.log + * torch.log10 + * torch.log1p + * torch.log2 + * torch.xlog1py + * torch.xlogy +* Trigonometric Functions + * torch.sin + * torch.cos + * torch.tan + * torch.cot + * torch.csc + * torch.sec +* Inverse Trigonometric Functions + * torch.asin + * torch.acos + * torch.atan + * torch.atan + * torch.acot + * torch.acsc + * torch.asec +* Hyperbolic Functions + * torch.sinh + * torch.cosh + * torch.tanh + * torch.coth + * torch.csch + * torch.sech +* Inverse Hyperbolic Functions + * torch.asinh + * torch.acosh + * torch.atanh + * torch.atanh + * torch.acoth + * torch.acsch + * torch.asech +* Product Logarithms +* Roots + * `torch.root` *See the “Polynomial Root” section for the proposed operator* +* Maximum and Minimum + * torch.max + * torch.min +* Cardinal Functions + * torch.sinc +* Greatest Common Divisor (GCD) and Least Common Multiple (LCM) + * torch.gcd + * torch.lcm +* Rounding and Congruence Functions + * torch.ceil + * torch.floor + * torch.floor_divide + * torch.remainder + * torch.round +* Partitions +* Tensorial Functions + * `torch.dirac_delta` *See the “Dirac Delta” section for the proposed operator* + * `torch.kronecker_delta` *See the “Kronecker Delta” section for the proposed operator* + * `torch.levi_civita` *See the “Levi-Civita Symbol” section for the proposed operator* + +## Special Function Policies + +PyTorch’s mathematical operators should be categorized as either “elementary” or “special.” An elementary function is a mathematical function whose corresponding operator is available from the `torch` module. A special function is a mathematical function whose corresponding operator is available from the `torch.special` module. Regardless of whether an operator implements an elementary or special function, each operator must share the following properties: + +* A name that adheres to the naming policy. +* A docstring that clearly communicates the following: + * A primary definition + * Real and complex domains + * Real and complex graphs +* If differentiable, derivtatives for each variable. + +## Python API + +### Factorials + +#### Factorial + +```Python +factorial( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ factorial, if $n \in \mathbb{N}$: + +$$n! = \prod_{k = 1}^{n}k.$$ + +Otherwise: + +$$n! = \Gamma(n + 1),$$ + +where $\Gamma$ is the gamma function. + +$n!$ is defined for $\left\\{n \in \mathbb{R} \mid n \geq 0 \vee n \notin \mathbb{Z} \right\\}$ and $\left\\{n \in \mathbb{C} \mid \operatorname{Re}(n) \geq 0 \vee n \notin \mathbb{Z} \right\\}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of Factorial + +```Python +ln_factorial( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Natural logarithm of $n^{\text{th}}$ factorial, $\ln{(n!)}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Double Factorial + +```Python +double_factorial( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ double factorial, if $n \in \mathbb{N}$: + +$$n!!=\prod_{k = 0}^{\left\lceil\tfrac{n}{2}\right\rceil-1}(n-2k).$$ + +Otherwise: + +$$n!!=\left(\frac{2}{\pi}\right)^{\frac{1}{4}(1-\cos(\pi n))}2^{\tfrac{2}{n}}\Gamma\left(\frac{n}{2}+1\right),$$ + +where $\Gamma$ is the gamma function. + +$n!!$ is defined for $\left\\{n \in \mathbb{R} \mid n \geq 0 \vee \tfrac{n}{2} \notin \mathbb{Z} \right\\}$ and $\left\\{n \in \mathbb{C} \mid n \geq 0 \vee \tfrac{n}{2} \notin \mathbb{Z} \right\\}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of Double Factorial + +```Python +ln_double_factorial( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Natural logarithm of $n^{\text{th}}$ double factorial, $\ln{(n!!)}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Rising Factorial + +```Python +rising_factorial( + z: Tensor, + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Rising factorial: + +$$z^{n}=\frac{\Gamma(z + n)}{\Gamma(z)},$$ + +where $\Gamma$ is the gamma function. + +$z^{n}$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $n$ is a number, $z$ must be a tensor. + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – exponent. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of Rising Factorial + +```Python +ln_rising_factorial( + z: Tensor, + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Natural logarithm of rising factorial, $\operatorname{ln}{(z^{n})}$. + +$\operatorname{ln}{(z^{n})}$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $n$ is a number, $z$ must be a tensor. + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – exponent. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Falling Factorial + +```Python +falling_factorial( + z: Tensor, + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Falling factorial: + +$$z_{n}=\frac{\Gamma(z + 1)}{\Gamma(z - n + 1)},$$ + +where $\Gamma$ is the gamma function. + +$z_{n}$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $n$ is a number, $z$ must be a tensor. + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – exponent. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of Falling Factorial + +```Python +ln_falling_factorial( + z: Tensor, + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Natural logarithm of falling factorial, $\operatorname{ln}{(z_{n})}$. + +$\operatorname{ln}{(z_{n})}$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $n$ is a number, $z$ must be a tensor. + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – exponent. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Combinatorial Numbers and Functions + +#### Binomial Coefficient + +```Python +binomial_coefficient( + n: Tensor, + k: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Binomial coefficient: + +$${\binom{n}{k}} = {\frac{n!}{k!(n - k)!}}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $k$ is a number, $n$ must be a tensor. + +**k** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – exponent. If $n$ is a number, $k$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of Binomial Coefficient + +```Python +ln_binomial_coefficient( + n: Tensor, + k: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Natural logarithm of binomial coefficient, $\operatorname{ln}{{\binom{n}{k}}}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $k$ is a number, $n$ must be a tensor. + +**k** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – exponent. If $n$ is a number, $k$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Catalan Number + +```Python +catalan_number_c( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ Catalan number: + +$$C_{z} = \frac{2^{2z}\Gamma(z + \tfrac{1}{2})}{\sqrt{\pi} \Gamma(z + 2)}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Stirling Number of the First Kind + +```Python +stirling_number_s_1( + n: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Stirling number of the first kind: + +$$s(n, k) = $$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Stirling Number of the Second Kind + +```Python +stirling_number_s_2( + n: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Stirling number of the second kind: + +$$S(n, k) = {\frac{1}{k!}}\sum_{i = 0}^{k}(-1)^{i}{\binom{k}{i}}(k - i)^{n}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bell Number + +```Python +bell_number_b( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ Bell number: + +$$B_{n}=\sum_{k = 0}^{n}S(n, k).$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Delannoy Number + +```Python +delannoy_number_d( + m: Tensor, + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Delannoy number: + +$$D(m, n) = \sum_{k = 0}^{\min(m, n)}\binom{m + n - k}{m}\binom{m}{k}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Motzkin Number + +```Python +motzkin_number_m( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ Motzkin number: + +$$M_{n} = \sum_{k = 0}^{\lfloor \frac{n}{2} \rfloor}{\binom{n}{2k}}C_{k}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Narayana Number + +```Python +narayana_number_n( + n: Tensor, + k: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Narayana number: + +$$N(n, k) = {\frac{1}{n}}\binom{n}{k}\binom{n}{k - 1}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Schröder Number + +```Python +schroder_number_r( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ Schröder number: + +$$r_{n} = D(n, n) - D(n + 1, n - 1).$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Gamma and Related Functions + +#### Gamma Function + +```Python +gamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Gamma function: + +$$\Gamma(z)=\int_{0}^{\infty}t^{z-1}e^{-t}dt.$$ + +$\Gamma(z)$ is defined for $\left\\{n \in \mathbb{R} \mid n > 0 \vee n \notin \mathbb{Z} \right\\}$ and $\left\\{n \in \mathbb{C} \mid \operatorname{Re}(n) > 0 \vee n \notin \mathbb{Z} \right\\}$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Reciprocal Gamma Function + +```Python +reciprocal_gamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Polygamma Function + +```Python +polygamma( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – derivative. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Digamma Function + +```Python +digamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Digamma function: + +$$\psi(z)=\sum_{k=1}^{\infty}\left(\frac{1}{k}-\frac{1}{k+z-1}\right)-\gamma.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Trigamma Function + +```Python +trigamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of the Gamma Function + +```Python +ln_gamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Sign of the Gamma Function + +```Python +sign_gamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Beta Function + +```Python +beta( + a: Tensor, + b: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Beta function: + +$$\operatorname{B}(a, b) = \frac{\Gamma(a) \Gamma(b)}{\Gamma(a + b)}$$ + +where $\Gamma$ is the gamma function. + +##### Parameters + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Natural Logarithm of the Beta Function + +```Python +ln_beta( + a: Tensor, + b: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Exponential and Logarithmic Integrals + +#### Exponential Integral, $\operatorname{Ein}$ + +```Python +exponential_integral_ein( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponential integral: + +$$\operatorname{Ein}(z)=\int_{0}^{z}(1-e^{-t}){\frac{dt}{t}}.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponential Integral, $\operatorname{Ei}$ + +```Python +exponential_integral_ei( + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponential integral: + +$$\operatorname{Ei}(z) = \sum_{k = 1}^{\infty} \frac{z^{k}}{k k!} + \gamma + \frac{1}{2}(\ln{(z)} - \ln{(\tfrac{1}{z})}).$$ + +##### Parameters + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponential Integral, $E_{1}$ + +```Python +exponential_integral_e_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponential integral: + +$$E_{1}(z)=\int _{z}^{\infty}{\frac{e^{-t}}{t}}.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponential Integral, $E_{n}$ + +```Python +exponential_integral_e( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponential integral: + +$$E_{n}(x)=\int_{1}^{\infty}{\frac{e^{-xt}}{t^{n}}}dt.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Logarithmic Integral + +```Python +logarithmic_integral_li( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Logarithmic integral: + +$$\operatorname{li}(z)=\int_{0}^{z}{\frac{1}{\ln{(t)}}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Error and Related Functions + +#### Error Function + +```Python +error_erf(z: Tensor, *, out: Optional[Tensor] = None) -> Tensor +``` + +Error function: + +$$\operatorname{erf}(z) = \frac{2}{\sqrt{\pi}} \sum_{k = 0}^{\infty } \frac{-1^{k} z^{2k + 1}}{k!(2k + 1)}.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Complementary Error Function + +```Python +error_erfc(z: Tensor, *, out: Optional[Tensor] = None) -> Tensor +``` + +Complementary error function: + +$$\operatorname{erfc}(z) = 1 - \frac{2}{\sqrt{\pi}} \sum_{k = 0}^{\infty} \frac{-1^{k} z^{2k + 1}}{k!(2k + 1)}.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Imaginary Error Function + +```Python +error_erfi( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Imaginary error function: + +$$\operatorname{erfc}(z) = \frac{2}{\sqrt{\pi}} \sum_{k = 0}^{\infty} \frac{z^{2k + 1}}{k!(2k + 1)}.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Inverse Error Function + +```Python +error_inverse_erf( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Inverse error function: + +$$\operatorname{erf}^{-1}(z)=\sum_{k=0}^{\infty}{\frac{c_{k}}{2k+1}}({\frac{\sqrt{\pi}}{2}}z)^{2k+1}$$ + +where $c_{0}=1$ and: + +$$c_{k}=\sum_{m=0}^{k-1}{\frac{c_{m}c_{k-1-m}}{(m+1)(2m+1)}}.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Inverse Complementary Error Function + +```Python +error_inverse_erfc( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Dawson and Fresnel Integrals + +#### Dawson’s Integral + +```Python +dawson_integral_f( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Dawson’s integral: + +$$\operatorname{F}(z)=e^{-z^{2}}\int_{0}^{z}e^{t^{2}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Sine Fresnel Integral + +```Python +fresnel_integral_s( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Fresnel integral: + +$$\operatorname{S}(z)=\int_{0}^{x}\sin{t^{2}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Cosine Fresnel Integral + +```Python +fresnel_integral_c( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Fresnel integral: + +$$\operatorname{C}(z)=\int_{0}^{x}\cos{t^{2}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Trigonometric and Hyperbolic Integrals + +#### Sine Integral ($operatorname{Sin}$) + +```Python +sine_integral_sin( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Sine integral: + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Sine Integral ($\operatorname{Si}$) + +$$\operatorname{Sin}(z)=\int_{0}^{z}{\frac{\sin{t}}{t}}dt.$$ + +```Python +sine_integral_si( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Sine integral: + +$$\operatorname{Si}(z)=-\int_{z}^{\infty }{\frac{\sin{t}}{t}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Cosine Integral ($\operatorname{Cin}$) + +```Python +cosine_integral_cin( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Cosine integral: + +$$\operatorname{Cin}(z)=\int_{0}^{z}{\frac{1-\cos{t}}{t}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Cosine Integral ($\operatorname{Ci}$) + +```Python +cosine_integral_ci( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Cosine integral: + +$$\operatorname{Ci}(z)=\gamma+\ln{z}-\int_{0}^{z}{\frac{1-\cos{t}}{t}}$$ + +where $\gamma$ is the Euler–Mascheroni constant. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Hyperbolic Sine Integral + +```Python +hyperbolic_sine_integral_shi( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Hyperbolic sine integral: + +$$\operatorname{Shi}(z)=\int_{0}^{z}{\frac{\sinh{t}}{t}}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Hyperbolic Cosine Integral + +```Python +hyperbolic_cosine_integral_chi( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Hyperbolic cosine integral: + +$$\operatorname{Chi}(z)=\gamma+\ln{z}+\int_{0}^{z}{\frac{\cosh{t-1}}{t}}dt.$$ + +where $\gamma$ is the Euler–Mascheroni constant. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Incomplete Gamma and Related Functions + +#### Incomplete Gamma Function ($\gamma$) + +```Python +lower_incomplete_gamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Lower incomplete gamma function: + +$$\Gamma(s,z)=\int_{z}^{\infty}t^{s-1}e^{-t}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Incomplete Gamma Function ($\Gamma$) + +```Python +upper_incomplete_gamma( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Upper incomplete gamma function: + +$$\gamma(s,z)=\int_{0}^{z}t^{s-1}e^{-t}dt.$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Incomplete Beta Function + +```Python +incomplete_beta( + z: Tensor, + a: Tensor, + b: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Airy Functions + +Functions defined as the two, linearly independent solutions to: + +$$y'' - yz = 0.$$ + +#### Airy Function of the First Kind + +```Python +airy_ai( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Airy function of the first kind: + +$$\operatorname{Ai}(z)={\frac{1}{3^{\tfrac{2}{3}}\Gamma(\tfrac{2}{3})}} {_0F_1(; \tfrac{2}{3}; \tfrac{1}{9}; z^{3})} - \frac{z}{3^{\tfrac{1}{3}}\Gamma(\tfrac{1}{3})} {_0F_1(; \tfrac{4}{3}; \tfrac{1}{9}; z^{3})}$$ + +where $\Gamma$ is the gamma function and $_0F_1(; a; z)$ is the confluent hypergeometric limit function. + +$\operatorname{Ai}(z)$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Airy Function of the Second Kind + +```Python +airy_bi( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Airy function of the second kind: + +$$\operatorname{Bi}(z)=\frac{_0F_1\left(;\frac{2}{3};\frac{z^3}{9}\right)}{\sqrt[6]{3} \Gamma \left(\frac{2}{3}\right)}+\frac{\sqrt[6]{3} z _0F_1\left(;\frac{4}{3};\frac{z^3}{9}\right)}{\Gamma \left(\frac{1}{3}\right)}$$ + +where $\Gamma$ is the gamma function and $_0F_1(; a; z)$ is the confluent hypergeometric limit function. + +$\operatorname{Bi}(z)$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Derivative of the Airy Function of the First Kind + +```Python +airy_ai_derivative( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Derivative of the Airy function of the first kind: + +$$\operatorname{Ai}'(z)=\frac{z^2 \\,_0F_1\left(;\frac{5}{3};\frac{z^3}{9}\right)}{2\ 3^{\tfrac{2}{3}} \Gamma \left(\frac{2}{3}\right)}-\frac{\\, _0F_1\left(;\frac{1}{3};\frac{z^3}{9}\right)}{\sqrt[3]{3} \Gamma \left(\frac{1}{3}\right)},$$ + +where $\Gamma$ is the gamma function and $_0F_1(; a; z)$ is the confluent hypergeometric limit function. + +$\operatorname{Ai}'(z)$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Derivative of the Airy Function of the Second Kind + +```Python +airy_bi_derivative( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Derivative of the Airy function of the second kind: + +$$\operatorname{Bi}'(z)=\frac{z^2 \\, _0F_1\left(;\frac{5}{3};\frac{z^3}{9}\right)}{2 \sqrt[6]{3} \\, \Gamma \left(\frac{2}{3}\right)}+\frac{\sqrt[6]{3} \\, _0F_1\left(;\frac{1}{3};\frac{z^3}{9}\right)}{\Gamma \left(\frac{1}{3}\right)},$$ + +where $\Gamma$ is the gamma function and $_0F_1(; a; z)$ is the confluent hypergeometric limit function. + +$\operatorname{Bi}'(z)$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponentially Scaled Airy Function of the First Kind + +```Python +exp_airy_ai( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponentially scaled Airy function of the first kind, $\operatorname{exp}(\operatorname{Ai}(z))$. + +$\exp{(\operatorname{Ai}(z))}$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponentially Scaled Airy Function of the Second Kind + +```Python +exp_airy_bi( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponentially scaled Airy function of the second kind, $\operatorname{exp}(\operatorname{Bi}(z))$. + +$\exp{(\operatorname{Bi}(z))}$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponentially Scaled Derivative of the Airy Function of the First Kind + +```Python +exp_airy_ai_derivative( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponentially scaled Derivative of the Airy function of the first kind, $\operatorname{exp}(\operatorname{Ai'}(z))$. + +$\exp{(\operatorname{Ai}'(z))}$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Exponentially Scaled Derivative of the Airy Function of the Second Kind + +```Python +exp_airy_bi_derivative( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Exponentially scaled Derivative of the Airy function of the second kind, $\operatorname{exp}(\operatorname{Bi'}(z))$. + +$\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Bessel Functions + +#### Bessel Function of the First Kind + +```Python +bessel_j( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bessel function of the first kind: + +$$J_{n}(z)=\sum _{k=0}^{\infty } \frac{(-1)^k \left(\frac{z}{2}\right)^{2k+n}}{\Gamma (k+\nu +1) k!},$$ + +where $\Gamma$ is the gamma function. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $n$ is a number, $z$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bessel Function of the First Kind of Order 0 + +```Python +bessel_j_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bessel function of the first kind of order $0$, $J_{0}(z)$ + +$J_{0}(z)$ is defined for all real and complex $z$. + +#### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bessel Function of the First Kind of Order 1 + +```Python +bessel_j_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bessel function of the first kind of order $1$, $J_{1}(z)$ + +$J_{1}(z)$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bessel Function of the Second Kind + +```Python +bessel_y( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bessel function of the second kind, if, and only if $\nu \notin \mathbb{Z}$: + +$$Y_{\nu }(z)=\csc (\pi \nu ) (\cos (\nu \pi ) J_{\nu }(z)-J_{-\nu }(z)),$$ + +where $J_{n}(z)$ is the Bessel function of the first kind. + +If $z \in \mathbb{R}$, $Y_{n}(z)$ is defined for $z > 0$. + +If $z \in \mathbb{C}$, $Y_{n}(z)$ is defined for $z \neq 0$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $n$ is a number, $z$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bessel Function of the Second Kind of Order 0 + +```Python +bessel_y_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bessel function of the second kind of order $0$, $Y_{0}(z)$. + +$Y_{0}(z)$ is defined for $\\{z \in \mathbb{R}\\}$ and $\\{z \in \mathbb{C} \mid z \neq 0\\}$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bessel Function of the Second Kind of Order 1 + +```Python +bessel_y_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bessel function of the second kind of order $1$, $Y_{1}(z)$. + +$Y_{1}(z)$ is defined for $\\{z \in \mathbb{R} \mid z > 0\\}$ and $\\{z \in \mathbb{C} \mid z \neq 0\\}$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Hankel Functions + +#### Hankel Function of the First Kind + +```Python +hankel_h_1( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Hankel function of the first kind: + +$$H_{n}^{1}(z) = J_{n}(z) + i Y_{n}(z),$$ + +where $J_{n}(z)$ is the Bessel function of the first kind, $i$ is the imaginary unit, and $Y_{n}(z)$ is the Bessel function of the second kind. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Hankel Function of the Second Kind + +```Python +hankel_h_2( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Hankel function of the second kind: + +$$H_{n}^{2}(z) = J_{n}(z) - i Y_{n}(z),$$ + +where $J_{n}(z)$ is the Bessel function of the first kind, $i$ is the imaginary unit, and $Y_{n}(z)$ is the Bessel function of the second kind. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Modified Bessel Functions + +#### Modified Bessel Function of the First Kind + +```Python +modified_bessel_i( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Bessel function of the first kind: + +$$I_{\nu }(z)=\sum _{k=0}^{\infty } \frac{\left(\frac{z}{2}\right)^{2 k+\nu }}{\Gamma (k+\nu +1) k!}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Bessel Function of the First Kind of Order 0 + +```Python +modified_bessel_i_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Bessel function of the first kind of order $0$, $I_{0}(z)$. + +$I_{0}(z)$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Bessel Function of the First Kind of Order 1 + +```Python +modified_bessel_i_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Bessel function of the first kind of order $1$, $I_{1}(z)$. + +$I_{1}(z)$ is defined for all real and complex $z$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Bessel Function of the Second Kind + +```Python +modified_bessel_k( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Bessel function of the second kind: + +$$K_{n}(z) = \frac{1}{2} \pi i^{n + 1} H_n^{1}(i z),$$ + +where $i$ is the imaginary unit and $H_{n}^{1}(z)$ is the Hankel function of the first kind. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Bessel Function of the Second Kind of Order 0 + +```Python +modified_bessel_k_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Bessel function of the first kind of order $0$, $K_{0}(z)$. + +$K_{0}(z)$ is defined for $\\{z \in \mathbb{R} \mid z > 0\\}$ and $\\{z \in \mathbb{C} \mid z \neq 0\\}$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Bessel Function of the Second Kind of Order 1 + +```Python +modified_bessel_k_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Bessel function of the first kind of order $1$, $K_{1}(z)$. + +$K_{1}(z)$ is defined for $\\{z \in \mathbb{R} \mid z > 0\\}$ and $\\{z \in \mathbb{C} \mid z \neq 0\\}$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Spherical Bessel Functions + +#### Spherical Bessel Function of the First Kind + +```Python +spherical_bessel_j( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Bessel function of the first kind: + +$$j_{n}(x)={\sqrt{\frac{\pi}{2x}}}J_{n + {\frac{1}{2}}}(x).$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Spherical Bessel Function of the First Kind of Order 0 + +```Python +spherical_bessel_j_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Bessel function of the first kind: + +$$j_{n}(x)={\sqrt{\frac{\pi}{2x}}}J_{n + {\frac{1}{2}}}(x)$$ + +where $n = 0$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Spherical Bessel Function of the First Kind of Order 1 + +```Python +spherical_bessel_j_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Bessel function of the first kind: + +$$j_{n}(x)={\sqrt{\frac{\pi}{2x}}}J_{n + {\frac{1}{2}}}(x)$$ + +where $n = 1$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Spherical Bessel Function of the Second Kind + +```Python +spherical_bessel_y( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Bessel function of the second kind: + +$$y_{n}(x)={\sqrt{\frac{\pi}{2x}}}Y_{n+{\frac{1}{2}}}(x).$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Spherical Bessel Function of the Second Kind of Order 0 + +```Python +spherical_bessel_y_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Bessel function of the second kind: + +$$y_{n}(x)={\sqrt{\frac{\pi}{2x}}}Y_{n+{\frac{1}{2}}}(x)$$ + +where $n = 0$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Spherical Bessel Function of the Second Kind of Order 1 + +```Python +spherical_bessel_y_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Bessel function of the second kind: + +$$y_{n}(x)={\sqrt{\frac{\pi}{2x}}}Y_{n+{\frac{1}{2}}}(x)$$ + +where $n = 1$. + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Spherical Hankel Functions + +#### Spherical Hankel Function of the First Kind + +```Python +spherical_hankel_h_1( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Hankel function of the first kind: + +$$h_{n}^{1}(z)=\frac{\sqrt{\frac{\pi}{2}}H_{n +\frac{1}{2}}^{1}(z)}{\sqrt{z}},$$ + +where $H_{n}^{1}$ is the Hankel function of the first kind. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Spherical Hankel Function of the Second Kind + +```Python +spherical_hankel_h_2( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Spherical Hankel function of the second kind: + +$$h_{n}^{2}(z)=\frac{\sqrt{\frac{\pi}{2}}H_{n+\frac{1}{2}}^{2}(z)}{\sqrt{z}},$$ + +where $H_{n}^{2}$ is the Hankel function of the second kind. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Modified Spherical Bessel Functions + +#### Modified Spherical Bessel Function of the First Kind + +```Python +modified_spherical_bessel_i( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified spherical Bessel function of the first kind: + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Spherical Bessel Function of the First Kind of Order 0 + +```Python +modified_spherical_bessel_i_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Spherical Bessel Function of the First Kind of Order 1 + +```Python +modified_spherical_bessel_i_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Spherical Bessel Function of the Second Kind + +```Python +modified_spherical_bessel_k( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Spherical Bessel Function of the Second Kind of Order 0 + +```Python +modified_spherical_bessel_k_0( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Spherical Bessel Function of the Second Kind of Order 1 + +```Python +modified_spherical_bessel_k_1( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Kelvin Functions + +#### Kelvin Function of the First Kind ($\operatorname{ber}$) + +```Python +kelvin_ber( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$$\mathrm {ber} _{n}(x)=({\frac {x}{2}})^{n}\sum _{k\geq 0}{\frac {\cos [({\frac {3n}{4}}+{\frac {k}{2}})\pi ]}{k!\Gamma (n+k+1)}}({\frac {x^{2}}{4}})^{k}.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Kelvin Function of the First Kind ($\operatorname{bei}$) + +```Python +kelvin_bei( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Kelvin Function of the Second Kind ($\operatorname{kei}$) + +```Python +kelvin_kei( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Kelvin Function of the Second Kind ($\operatorname{ker}$) + +```Python +kelvin_ker( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Struve and Modified Struve Functions + +#### Struve Function + +```Python +struve_h( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Struve function: + +$$\mathbf{H}_{n}(z) = \sum_{m = 0}^{\infty}{\frac {(-1)^{m}}{\Gamma (m+{\frac {3}{2}})\Gamma (m+n +{\frac {3}{2}})}}({\frac {z}{2}})^{2m+n +1}.$$ + +where $\Gamma(z)$ is the gamma function. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Modified Struve Function + +```Python +struve_l( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Modified Struve function: + +$$\mathbf {L} _{n }(z)=\sum _{m=0}^{\infty }{\frac {1}{\Gamma (m+{\frac {3}{2}})\Gamma (m+n +{\frac {3}{2}})}}({\frac {z}{2}})^{2m+n +1}.$$ + +where $\Gamma(z)$ is the gamma function. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Lommel Functions + +#### Lommel Function of the First Kind + +#### Lommel Function of the Second Kind + +### Anger and Weber Functions + +#### Anger Function + +```Python +anger_j( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Anger function: + +$$\mathbf{J}_{n}(z)={\frac{1}{\pi}}\int_{0}^{\pi}\cos(n\theta-z\sin\theta)d\theta.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Weber Function + +```Python +weber_e( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Weber function: + +$$\mathbf{E}_{n}(z)={\frac{1}{\pi}}\int_{0}^{\pi}\sin(n\theta-z\sin \theta )d\theta.$$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Parabolic Cylinder Function + +```Python +parabolic_cylinder_d( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None +) -> Tensor +``` + +Parabolic cylinder function: + +$$D_{n}(z) = \sqrt{\pi} 2^{\tfrac{n}{2}} e^{-\frac{z^2}{4}} \left(\frac{ _1F_1(-\frac{n }{2}; \frac{1}{2}; \frac{z^2}{2})}{\Gamma (\frac{1-n }{2})}-\frac{\sqrt{2} z _1F_1(\frac{1-n }{2};\frac{3}{2};\frac{z^2}{2})}{\Gamma (-\frac{n }{2})} \right),$$ + +where $_1F_1$ is the confluent hypergeometric function of the first kind and $\Gamma$ is the gamma function. + +### Confluent Hypergeometric Functions + +#### Confluent Hypergeometric Function of the First Kind + +```Python +confluent_hypergeometric_1_f_1( + a: Tensor, + b: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Confluent hypergeometric function of the first kind: + +$$_{1}{F}_{1}(a; b; z) = \sum_{k = 0}^{\infty} \frac{a_{k}}{b_{k}} \frac{z^{k}}{k!},$$ + +where $a_{k}$ and $b_{k}$ are rising factorials. + +#### Confluent Hypergeometric Function of the Second Kind + +### Whittaker Functions + +Whittaker functions are defined as a special solution of Whittaker’s equation: + +$${\frac {d^{2}w}{dz^{2}}}+(-{\frac {1}{4}}+{\frac {\kappa }{z}}+{\frac {1/4-\mu ^{2}}{z^{2}}})w=0.$$ + +#### Whittaker Function ($M_{\kappa, \mu}$) + +```Python +whittaker_m( + k: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Whittaker function: + +$${\displaystyle M_{\kappa ,\mu }(z)=\exp (-z/2)z^{\mu +{\tfrac {1}{2}}}M(\mu -\kappa +{\tfrac {1}{2}},1+2\mu ,z)}.$$ + +##### Parameters + +**k** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Whittaker Function ($W_{\kappa, \mu}$) + +```Python +whittaker_w( + k: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Whittaker function: + +$${\displaystyle W_{\kappa ,\mu }(z)=\exp (-z/2)z^{\mu +{\tfrac {1}{2}}}U(\mu -\kappa +{\tfrac {1}{2}},1+2\mu ,z).}$$ + +##### Parameters + +**k** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Legendre Functions + +#### Legendre Function of the First Kind + +#### Legendre Function of the Second Kind + +### Associated Legendre Functions + +#### Associated Legendre Function of the First Kind + +#### Associated Legendre Function of the Second Kind + +### Ferrers Functions + +#### Ferrers Function of the First Kind + +#### Ferrers Function of the Second Kind + +### Spherical and Spheroidal Harmonics + +### Generalized Hypergeometric and Related Functions + +### Appell Functions + +#### Appell Function ($F_{1}$) + +```Python +appell_f_1( + a: Tensor, + b: Tensor, + c: Tensor, + d: Tensor, + x: Tensor, + y: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Appell function: + +$$F_{1}(a; b, c; d; x, y) = \sum_{m, n=0}^{\infty}{\frac{a_{m + n}b_{m}c_{n}}{d_{m + n}m!n!}}x^{m}y^{n}.$$ + +##### Parameters + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**c** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Appell Function ($F_{2}$) + +```Python +appell_f_2( + a: Tensor, + b: Tensor, + c: Tensor, + d: Tensor, + e: Tensor, + x: Tensor, + y: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**c** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Appell Function ($F_{3}$) + +```Python +appell_f_3( + a: Tensor, + b: Tensor, + c: Tensor, + d: Tensor, + e: Tensor, + x: Tensor, + y: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**c** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Appell Function ($F_{4}$) + +```Python +appell_f_4( + a: Tensor, + b: Tensor, + c: Tensor, + d: Tensor, + x: Tensor, + y: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**c** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### $q$-Hypergeometric and Related Functions + +#### $q$-Factorial + +#### $q$-Binomial Coefficient + +#### $q$-Gamma Function + +#### $q$-Digamma Function + +#### $q$-Polygamma Function + +### Chebyshev Polynomials + +#### Chebyshev Polynomial of the First Kind + +```Python +chebyshev_polynomial_t( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Chebyshev polynomial of the first kind, $T_{n}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Chebyshev Polynomial of the Second Kind + +```Python +chebyshev_polynomial_u( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Chebyshev polynomial of the second kind, $U_{n}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Chebyshev Polynomial of the Third Kind + +```Python +chebyshev_polynomial_v( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Chebyshev polynomial of the third kind, $V_{n}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Chebyshev Polynomial of the Fourth Kind + +```Python +chebyshev_polynomial_w( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Chebyshev polynomial of the fourth kind, $W_{n}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Shifted Chebyshev Polynomials + +#### Shifted Chebyshev Polynomial of the First Kind + +```Python +shifted_chebyshev_polynomial_t( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Shifted Chebyshev polynomial of the first kind, $T_{n}^{\ast}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Shifted Chebyshev Polynomial of the Second Kind + +```Python +shifted_chebyshev_polynomial_u( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Shifted Chebyshev polynomial of the second kind, $U_{n}^{\ast}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Shifted Chebyshev Polynomial of the Third Kind + +```Python +shifted_chebyshev_polynomial_v( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Shifted Chebyshev polynomial of the third kind, $V_{n}^{\ast}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Shifted Chebyshev Polynomial of the Fourth Kind + +```Python +shifted_chebyshev_polynomial_w( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Shifted Chebyshev polynomial of the fourth kind, $W_{n}^{\ast}(x).$ + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Hermite Polynomials + +#### Probabilist’s Hermite Polynomial + +```Python +hermite_polynomial_he( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Probabilist’s Hermite polynomial: + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Physicist’s Hermite Polynomial + +```Python +hermite_polynomial_h( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Physicist’s Hermite polynomial: + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Orthogonal Polynomials + +### Legendre Forms of Elliptic Integrals + +#### Elliptic Integral of the First Kind + +```Python +legendre_elliptic_integral_f( + m: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre form of the incomplete elliptic integral of the first kind: + +The incomplete elliptic integral is defined in terms of the parameter $m$ instead of the elliptic modulus $k$. $m$ is defined as $m = k^{2}$. + +##### Parameters + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Elliptic Integral of the Second Kind + +```Python +legendre_elliptic_integral_e( + m: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre form of the incomplete elliptic integral of the second kind: + +The incomplete elliptic integral is defined in terms of the parameter $m$ instead of the elliptic modulus $k$. $m$ is defined as $m = k^{2}$. + +##### Parameters + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Elliptic Integral of the Third Kind + +```Python +legendre_elliptic_integral_pi( + n: Tensor, + m: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre form of the incomplete elliptic integral of the third kind: + +The incomplete elliptic integral is defined in terms of the parameter $m$ instead of the elliptic modulus $k$. $m$ is defined as $m = k^{2}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Legendre Forms of Complete Elliptic Integrals + +#### Complete Elliptic Integral of the First Kind + +```Python +complete_legendre_elliptic_integral_k( + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre form of the complete elliptic integral of the first kind: + +$$K(m) = F({\tfrac{\pi}{2}}, m).$$ + +The complete elliptic integral is defined in terms of the parameter $m$ instead of the elliptic modulus $k$. $m$ is defined as $m = k^{2}$. + +##### Parameters + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Complete Elliptic Integral of the Second Kind + +```Python +complete_legendre_elliptic_integral_e( + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre form of the complete elliptic integral of the second kind: + +$$E(m) = \int_{0}^{\tfrac{\pi}{2}}{\sqrt{1 - m \sin^{2} \theta}}d\theta.$$ + +The complete elliptic integral is defined in terms of the parameter $m$ instead of the elliptic modulus $k$. $m$ is defined as $m = k^{2}$. + +##### Parameters + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Complete Elliptic Integral of the Third Kind + +```Python +complete_legendre_elliptic_integral_pi( + n: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre form of the complete elliptic integral of the third kind: + +$$\Pi(n, m) = \int_{0}^{\frac{\pi}{2}}{\frac{d\theta}{(1 - n\sin^{2}\theta){\sqrt{1 - m\sin ^{2}\theta }}}}.$$ + +The complete elliptic integral is defined in terms of the parameter $m$ instead of the elliptic modulus $k$. $m$ is defined as $m = k^{2}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Carlson Symmetric Forms of Elliptic Integrals + +#### Carlson Elliptic Integral ($R_{C}$) + +```Python +carlson_elliptic_integral_r_c( + x: Tensor, + y: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Carlson Elliptic Integral ($R_{D}$) + +```Python +carlson_elliptic_integral_r_d( + x: Tensor, + y: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Carlson Elliptic Integral ($R_{E}$) + +```Python +carlson_elliptic_integral_r_e( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Carlson Elliptic Integral ($R_{F}$) + +```Python +carlson_elliptic_integral_r_f( + x: Tensor, + y: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Carlson Elliptic Integral ($R_{G}$) + +```Python +carlson_elliptic_integral_r_g( + x: Tensor, + y: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Carlson Elliptic Integral ($R_{J}$) + +```Python +carlson_elliptic_integral_r_j( + x: Tensor, + y: Tensor, + z: Tensor, + p: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**y** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Carlson Elliptic Integral ($R_{K}$) + +```Python +carlson_elliptic_integral_r_k( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Carlson Elliptic Integral ($R_{M}$) + +```Python +carlson_elliptic_integral_r_m( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +### Theta Functions + +#### Theta Function ($\theta_{1}$) + +```Python +theta_1( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Theta Function ($\theta_{2}$) + +```Python +theta_2( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Theta Function ($\theta_{3}$) + +```Python +theta_3( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Theta Function ($\theta_{4}$) + +```Python +theta_4( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +### Jacobi Elliptic Functions + +#### Jacobi Amplitude Function + +```Python +jacobi_amplitude_am( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Jacobi Elliptic Function ($\operatorname{sn}$) + +```Python +jacobi_elliptic_sn( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$$\operatorname{sn}(z \mid m) = \sin(\operatorname{am}(z \mid m))$$ + +#### Jacobi Elliptic Function ($\operatorname{cn}$) + +```Python +jacobi_elliptic_cn( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$$\operatorname{cn}(z \mid m) = \cos(\operatorname{am}(z \mid m))$$ + +#### Jacobi Elliptic Function ($\operatorname{dn}$) + +```Python +jacobi_elliptic_dn( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Jacobi Elliptic Function ($\operatorname{sd}$) + +```Python +jacobi_elliptic_sd( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Jacobi Elliptic Function ($\operatorname{cd}$) + +```Python +jacobi_elliptic_cd( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$$\operatorname{cd}(z \mid m) = \frac{\operatorname{cn}(z \mid m)}{\operatorname{dn}(z \mid m)}$$ + +#### Jacobi Elliptic Function ($\operatorname{sc}$) + +```Python +jacobi_elliptic_sc( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +### Inverse Jacobi Elliptic Functions + +#### Inverse Jacobi Elliptic Function ($\operatorname{sn}$) + +```Python +inverse_jacobi_elliptic_sn( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Inverse Jacobi Elliptic Function ($\operatorname{cn}$) + +```Python +inverse_jacobi_elliptic_cn( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Inverse Jacobi Elliptic Function ($\operatorname{dn}$) + +```Python +inverse_jacobi_elliptic_dn( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Inverse Jacobi Elliptic Function ($\operatorname{sd}$) + +```Python +inverse_jacobi_elliptic_sd( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Inverse Jacobi Elliptic Function ($\operatorname{cd}$) + +```Python +inverse_jacobi_elliptic_cd( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Inverse Jacobi Elliptic Function ($\operatorname{sc}$) + +```Python +inverse_jacobi_elliptic_sc( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +### Weierstrass Elliptic Functions + +#### Weierstrass Elliptic Function (p) + +#### Weierstrass Elliptic Function (\zeta) + +#### Weierstrass Elliptic Function (\sigma) + +### Modular Functions + +#### Elliptic Function (\lambda) + +#### Klein’s Complete Invariant Function + +### Bernoulli Number and Polynomial + +#### Bernoulli Number + +```Python +bernoulli_number_b( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ Bernoulli number, $B_{n}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bernoulli Polynomial + +```Python +bernoulli_polynomial_b( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bernoulli polynomial, $B_{n}(x)$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Euler Number and Polynomial + +#### Euler Number + +```Python +euler_number_e( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ Euler number, $E_{n}$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Euler Polynomial + +```Python +euler_polynomial_e( + n: Tensor, + x: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Euler polynomial, $E_{n}(x)$. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +### Zeta and Related Functions + +#### Riemann Zeta Function + +```Python +riemann_zeta( + s: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Riemann zeta function: + +$$\zeta(s)=\sum _{n=1}^{\infty}{\frac{1}{n^{s}}}.$$ + +#### Hurwitz Zeta Function + +```Python +hurwitz_zeta( + s: Tensor, + a: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Hurwitz zeta function: + +$$\zeta(s, a) = \sum _{n = 0}^{\infty}{\frac{1}{(n + a)^{s}}}.$$ + +#### Polylogarithm + +```Python +polylogarithm_li( + s: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Polylogarithm: + +$$\operatorname{Li}_{s + 1}(z ) = \int_{0}^{z}{\frac{\operatorname{Li}_{s}(t)}{t}}dt.$$ + +#### Lerch Zeta Function + +```Python +lerch_zeta_l( + l: Tensor, + z: Tensor, + a: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Lerch Transcendent + +#### Dirichlet L-Function + +### Multiplicative Number Theoretic Functions + +#### Prime Number + +```Python +prime_number_p( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +$n^{\text{th}}$ prime number, $p(n)$. + +#### Euler’s Totient Function + +#### Divisor Function + +#### Jordan’s Totient Function + +#### Möbius Function + +#### Liouville Function + +### Matthieu Characteristic Values + +#### Matthieu Characteristic Value ($a$) + +#### Matthieu Characteristic Value ($b$) + +### Angular Matthieu Functions + +#### Angular Matthieu Function ($\operatorname{ce}$) + +#### Angular Matthieu Function ($\operatorname{se}$) + +### Radial Mathieu Functions + +#### Radial Matthieu Function ($\operatorname{M}c$) + +#### Radial Matthieu Function ($\operatorname{M}s$) + +### Lamé Functions + +### Spherodial Wave Functions + +### Heun Functions + +#### Heun Function + +#### Confluent Heun Function + +#### Doubly-Confluent Heun Function + +#### Bi-Confluent Heun Function + +#### Tri-Confluent Heun Function + +### Painlevé Transcendents + +### Coulomb Wave Functions + +#### Coulomb Wave Function (F) + +#### Coulomb Wave Function (G) + +### 3-j, 6-j, and 9-j Symbols + +#### 3-j Symbol + +#### 6-j Symbol + +#### 9-j Symbol + +## Metrics + +
+What are the main metrics to measure the value of this feature? +
+ +## Drawbacks + +
+Are there any reasons why we should not do this? Here we aim to evaluate risk and check ourselves. + +Please consider: +* is it a breaking change? +* Impact on UX +* implementation cost, both in terms of code size and complexity +* integration of this feature with other existing and planned features +
+ +## Alternatives + +
+What other designs have been considered? What is the impact of not doing this? +
+ +## Prior Art + +
+Discuss prior art (both good and bad) in relation to this proposal: +* Does this feature exist in other libraries? What experience has their community had? +* What lessons can be learned from other implementations of this feature? +* Published papers or great posts that discuss this +
+ +### Cephes Mathematical Library + +Suite of elementary and special functions written by Stephen L. Moshier. It was initially created as a supplement to his numerical analysis textbook, “Methods and Programs for Mathematical Functions.” Unsure of the original publication date, but I estimate somewhere between 1984 and 1986. It was most recently updated, by Moshier, in 2018. Its use is ubiquitous (it’s even presently used in PyTorch), and DeepMind recently maintained a library wrapper for PyTorch. + +### specfun + +Suite of elementary and special functions authored by W. J. Cody, a numerical analysis pioneer, written in Fortran. It’s abandonware. + +### Wolfram Language + +General-purpose, commercial, multi-paradigm programming language written and maintained by Wolfram Research. The Wolfram Language touts one of the best suites of elementary and special functions. Most of these functions support either symbolic, or relevant to PyTorch, numerical evaluation and differentiation. + +### MATLAB +### International Mathematics and Statistics Library (IMSL) +### NAG Numerical Library +### GNU Octave +### GNU Scientific Library (GSL) + +### SciPy + +SciPy is a free and open-source Python package for scientific computing. It contains modules for linear algebra, integration, optimization, etc. SciPy also contains a robust suite of special functions. Most of the special function implementations rely on third-party packages, many featured elsewhere in this subsection (e.g., Cephes and specfun). + +## How we teach this + +
+* What names and terminology work best for these concepts and why? How is this idea best presented? +* Would the acceptance of this proposal mean the PyTorch documentation must be re-organized or altered? +* How should this feature be taught to existing PyTorch users? +
+ +## Unresolved questions + +
+* What parts of the design do you expect to resolve through the RFC process before this gets merged? +* What parts of the design do you expect to resolve through the implementation of this feature before stabilization? +* What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC? +
+ +## Resolution + +
+We decided to do it. X% of the engineering team actively approved of this change. +
+ +### Level of Support + +
+Choose one of the following: +* 1: Overwhelming positive feedback. +* 2: Positive feedback. +* 3: Majority Acceptance, with conflicting Feedback. +* 4: Acceptance, with Little Feedback. +* 5: Unclear Resolution. +* 6: RFC Rejected. +* 7: RFC Rejected, with Conflicting Feedback. +
+ +#### Additional Context + +
+Some people were in favor of it, but some people didn’t want it for project X. +
+ +### Next Steps + +
+Will implement it. +
+ +#### Tracking issue + +
+ +
+ +#### Exceptions + +
+Not implementing on project X now. Will revisit the decision in 1 year. +
\ No newline at end of file From ac9b4415b03d0f2e6cfbcd6aab1fdd145b64fb6c Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 17:00:35 -0400 Subject: [PATCH 029/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index b7a8b986..dbd8c090 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -96,6 +96,7 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.remainder * torch.round * Partitions + * `torch.partition_p` *See the “Partition Function” section for the proposed operator* * Tensorial Functions * `torch.dirac_delta` *See the “Dirac Delta” section for the proposed operator* * `torch.kronecker_delta` *See the “Kronecker Delta” section for the proposed operator* From 093699ab4c41eb1a324822a80bac8138b80db170 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 17:01:10 -0400 Subject: [PATCH 030/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index dbd8c090..efcc2925 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -101,6 +101,8 @@ Unlike special functions, *elementary functions* have a rigorous definition but * `torch.dirac_delta` *See the “Dirac Delta” section for the proposed operator* * `torch.kronecker_delta` *See the “Kronecker Delta” section for the proposed operator* * `torch.levi_civita` *See the “Levi-Civita Symbol” section for the proposed operator* +* Discontinuous Functions +* Functions with Singular Support ## Special Function Policies From 9ba84ced1b2063fe4ad6bfd0388dd79277f6f0d4 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 17:06:02 -0400 Subject: [PATCH 031/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 92 ----------------------------------- 1 file changed, 92 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index efcc2925..7878bc6e 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3549,47 +3549,14 @@ $n^{\text{th}}$ prime number, $p(n)$. #### Coulomb Wave Function (G) -### 3-j, 6-j, and 9-j Symbols - -#### 3-j Symbol - -#### 6-j Symbol - -#### 9-j Symbol - ## Metrics -
-What are the main metrics to measure the value of this feature? -
- ## Drawbacks -
-Are there any reasons why we should not do this? Here we aim to evaluate risk and check ourselves. - -Please consider: -* is it a breaking change? -* Impact on UX -* implementation cost, both in terms of code size and complexity -* integration of this feature with other existing and planned features -
- ## Alternatives -
-What other designs have been considered? What is the impact of not doing this? -
- ## Prior Art -
-Discuss prior art (both good and bad) in relation to this proposal: -* Does this feature exist in other libraries? What experience has their community had? -* What lessons can be learned from other implementations of this feature? -* Published papers or great posts that discuss this -
- ### Cephes Mathematical Library Suite of elementary and special functions written by Stephen L. Moshier. It was initially created as a supplement to his numerical analysis textbook, “Methods and Programs for Mathematical Functions.” Unsure of the original publication date, but I estimate somewhere between 1984 and 1986. It was most recently updated, by Moshier, in 2018. Its use is ubiquitous (it’s even presently used in PyTorch), and DeepMind recently maintained a library wrapper for PyTorch. @@ -3611,62 +3578,3 @@ General-purpose, commercial, multi-paradigm programming language written and mai ### SciPy SciPy is a free and open-source Python package for scientific computing. It contains modules for linear algebra, integration, optimization, etc. SciPy also contains a robust suite of special functions. Most of the special function implementations rely on third-party packages, many featured elsewhere in this subsection (e.g., Cephes and specfun). - -## How we teach this - -
-* What names and terminology work best for these concepts and why? How is this idea best presented? -* Would the acceptance of this proposal mean the PyTorch documentation must be re-organized or altered? -* How should this feature be taught to existing PyTorch users? -
- -## Unresolved questions - -
-* What parts of the design do you expect to resolve through the RFC process before this gets merged? -* What parts of the design do you expect to resolve through the implementation of this feature before stabilization? -* What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC? -
- -## Resolution - -
-We decided to do it. X% of the engineering team actively approved of this change. -
- -### Level of Support - -
-Choose one of the following: -* 1: Overwhelming positive feedback. -* 2: Positive feedback. -* 3: Majority Acceptance, with conflicting Feedback. -* 4: Acceptance, with Little Feedback. -* 5: Unclear Resolution. -* 6: RFC Rejected. -* 7: RFC Rejected, with Conflicting Feedback. -
- -#### Additional Context - -
-Some people were in favor of it, but some people didn’t want it for project X. -
- -### Next Steps - -
-Will implement it. -
- -#### Tracking issue - -
- -
- -#### Exceptions - -
-Not implementing on project X now. Will revisit the decision in 1 year. -
\ No newline at end of file From 7453c43392af3f67405027fc353de9bc222310ef Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 17:07:08 -0400 Subject: [PATCH 032/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 7878bc6e..0885b7b0 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -115,6 +115,8 @@ PyTorch’s mathematical operators should be categorized as either “elementary * Real and complex graphs * If differentiable, derivtatives for each variable. +## ATen + ## Python API ### Factorials From f50b2a013681b196c948890cc52501184661c2b8 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Tue, 1 Nov 2022 17:07:28 -0400 Subject: [PATCH 033/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 1303 +++++++++++++++++++++++++++++++-- 1 file changed, 1236 insertions(+), 67 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 7878bc6e..2e69ff14 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -6,6 +6,291 @@ _Author’s note—This RFC is a work-in-progress._ * Allen Goodman (@0x00b1) +## Table of Contents + +* [Summary](#summary) +* [Motivation](#motivation) +* [Special Functions](#special-functions-1) + + [Elementary Functions](#elementary-functions) + + [Special Functions](#special-functions-2) + - [Naming Policy](#naming-policy) +* [Implementation](#implementation) + + [c10](#c10) + - [Constants](#constants) + - [Functions](#functions) + * [Lanczos Approximation](#lanczos-approximation) + * [Spouge’s approximation](#spouge-s-approximation) + * [Stirling’s Approximation](#stirling-s-approximation) + + [ATen](#aten) + - [CPU](#cpu) + - [CUDA](#cuda) + + [torch](#torch) +* [C++ API](#c---api) +* [Python API](#python-api) + + [Factorials](#factorials) + - [Factorial](#factorial) + - [Natural Logarithm of Factorial](#natural-logarithm-of-factorial) + - [Double Factorial](#double-factorial) + - [Natural Logarithm of Double Factorial](#natural-logarithm-of-double-factorial) + - [Rising Factorial](#rising-factorial) + - [Natural Logarithm of Rising Factorial](#natural-logarithm-of-rising-factorial) + - [Falling Factorial](#falling-factorial) + - [Natural Logarithm of Falling Factorial](#natural-logarithm-of-falling-factorial) + + [Combinatorial Numbers and Functions](#combinatorial-numbers-and-functions) + - [Binomial Coefficient](#binomial-coefficient) + - [Natural Logarithm of Binomial Coefficient](#natural-logarithm-of-binomial-coefficient) + - [Catalan Number](#catalan-number) + - [Stirling Number of the First Kind](#stirling-number-of-the-first-kind) + - [Stirling Number of the Second Kind](#stirling-number-of-the-second-kind) + - [Bell Number](#bell-number) + - [Delannoy Number](#delannoy-number) + - [Motzkin Number](#motzkin-number) + - [Narayana Number](#narayana-number) + - [Schröder Number](#schr-der-number) + + [Gamma and Related Functions](#gamma-and-related-functions) + - [Gamma Function](#gamma-function) + - [Reciprocal Gamma Function](#reciprocal-gamma-function) + - [Polygamma Function](#polygamma-function) + - [Digamma Function](#digamma-function) + - [Trigamma Function](#trigamma-function) + - [Natural Logarithm of the Gamma Function](#natural-logarithm-of-the-gamma-function) + - [Sign of the Gamma Function](#sign-of-the-gamma-function) + - [Beta Function](#beta-function) + - [Natural Logarithm of the Beta Function](#natural-logarithm-of-the-beta-function) + + [Exponential and Logarithmic Integrals](#exponential-and-logarithmic-integrals) + - [Exponential Integral, $\operatorname{Ein}$](#exponential-integral----operatorname-ein--) + - [Exponential Integral, $\operatorname{Ei}$](#exponential-integral----operatorname-ei--) + - [Exponential Integral, $E_{1}$](#exponential-integral---e--1--) + - [Exponential Integral, $E_{n}$](#exponential-integral---e--n--) + - [Logarithmic Integral](#logarithmic-integral) + + [Error and Related Functions](#error-and-related-functions) + - [Error Function](#error-function) + - [Complementary Error Function](#complementary-error-function) + - [Imaginary Error Function](#imaginary-error-function) + - [Inverse Error Function](#inverse-error-function) + - [Inverse Complementary Error Function](#inverse-complementary-error-function) + + [Dawson and Fresnel Integrals](#dawson-and-fresnel-integrals) + - [Dawson’s Integral](#dawson-s-integral) + - [Sine Fresnel Integral](#sine-fresnel-integral) + - [Cosine Fresnel Integral](#cosine-fresnel-integral) + + [Trigonometric and Hyperbolic Integrals](#trigonometric-and-hyperbolic-integrals) + - [Sine Integral ($operatorname{Sin}$)](#sine-integral---operatorname-sin---) + - [Sine Integral ($\operatorname{Si}$)](#sine-integral----operatorname-si---) + - [Cosine Integral ($\operatorname{Cin}$)](#cosine-integral----operatorname-cin---) + - [Cosine Integral ($\operatorname{Ci}$)](#cosine-integral----operatorname-ci---) + - [Hyperbolic Sine Integral](#hyperbolic-sine-integral) + - [Hyperbolic Cosine Integral](#hyperbolic-cosine-integral) + + [Incomplete Gamma and Related Functions](#incomplete-gamma-and-related-functions) + - [Incomplete Gamma Function ($\gamma$)](#incomplete-gamma-function----gamma--) + - [Incomplete Gamma Function ($\Gamma$)](#incomplete-gamma-function----gamma--) + - [Incomplete Beta Function](#incomplete-beta-function) + + [Airy Functions](#airy-functions) + - [Airy Function of the First Kind](#airy-function-of-the-first-kind) + - [Airy Function of the Second Kind](#airy-function-of-the-second-kind) + - [Derivative of the Airy Function of the First Kind](#derivative-of-the-airy-function-of-the-first-kind) + - [Derivative of the Airy Function of the Second Kind](#derivative-of-the-airy-function-of-the-second-kind) + - [Exponentially Scaled Airy Function of the First Kind](#exponentially-scaled-airy-function-of-the-first-kind) + - [Exponentially Scaled Airy Function of the Second Kind](#exponentially-scaled-airy-function-of-the-second-kind) + - [Exponentially Scaled Derivative of the Airy Function of the First Kind](#exponentially-scaled-derivative-of-the-airy-function-of-the-first-kind) + - [Exponentially Scaled Derivative of the Airy Function of the Second Kind](#exponentially-scaled-derivative-of-the-airy-function-of-the-second-kind) + + [Bessel Functions](#bessel-functions) + - [Bessel Function of the First Kind](#bessel-function-of-the-first-kind) + - [Bessel Function of the First Kind of Order 0](#bessel-function-of-the-first-kind-of-order-0) + - [Bessel Function of the First Kind of Order 1](#bessel-function-of-the-first-kind-of-order-1) + - [Bessel Function of the Second Kind](#bessel-function-of-the-second-kind) + - [Bessel Function of the Second Kind of Order 0](#bessel-function-of-the-second-kind-of-order-0) + - [Bessel Function of the Second Kind of Order 1](#bessel-function-of-the-second-kind-of-order-1) + + [Hankel Functions](#hankel-functions) + - [Hankel Function of the First Kind](#hankel-function-of-the-first-kind) + - [Hankel Function of the Second Kind](#hankel-function-of-the-second-kind) + + [Modified Bessel Functions](#modified-bessel-functions) + - [Modified Bessel Function of the First Kind](#modified-bessel-function-of-the-first-kind) + - [Modified Bessel Function of the First Kind of Order 0](#modified-bessel-function-of-the-first-kind-of-order-0) + - [Modified Bessel Function of the First Kind of Order 1](#modified-bessel-function-of-the-first-kind-of-order-1) + - [Modified Bessel Function of the Second Kind](#modified-bessel-function-of-the-second-kind) + - [Modified Bessel Function of the Second Kind of Order 0](#modified-bessel-function-of-the-second-kind-of-order-0) + - [Modified Bessel Function of the Second Kind of Order 1](#modified-bessel-function-of-the-second-kind-of-order-1) + + [Spherical Bessel Functions](#spherical-bessel-functions) + - [Spherical Bessel Function of the First Kind](#spherical-bessel-function-of-the-first-kind) + - [Spherical Bessel Function of the First Kind of Order 0](#spherical-bessel-function-of-the-first-kind-of-order-0) + - [Spherical Bessel Function of the First Kind of Order 1](#spherical-bessel-function-of-the-first-kind-of-order-1) + - [Spherical Bessel Function of the Second Kind](#spherical-bessel-function-of-the-second-kind) + - [Spherical Bessel Function of the Second Kind of Order 0](#spherical-bessel-function-of-the-second-kind-of-order-0) + - [Spherical Bessel Function of the Second Kind of Order 1](#spherical-bessel-function-of-the-second-kind-of-order-1) + + [Spherical Hankel Functions](#spherical-hankel-functions) + - [Spherical Hankel Function of the First Kind](#spherical-hankel-function-of-the-first-kind) + - [Spherical Hankel Function of the Second Kind](#spherical-hankel-function-of-the-second-kind) + + [Modified Spherical Bessel Functions](#modified-spherical-bessel-functions) + - [Modified Spherical Bessel Function of the First Kind](#modified-spherical-bessel-function-of-the-first-kind) + - [Modified Spherical Bessel Function of the First Kind of Order 0](#modified-spherical-bessel-function-of-the-first-kind-of-order-0) + - [Modified Spherical Bessel Function of the First Kind of Order 1](#modified-spherical-bessel-function-of-the-first-kind-of-order-1) + - [Modified Spherical Bessel Function of the Second Kind](#modified-spherical-bessel-function-of-the-second-kind) + - [Modified Spherical Bessel Function of the Second Kind of Order 0](#modified-spherical-bessel-function-of-the-second-kind-of-order-0) + - [Modified Spherical Bessel Function of the Second Kind of Order 1](#modified-spherical-bessel-function-of-the-second-kind-of-order-1) + + [Kelvin Functions](#kelvin-functions) + - [Kelvin Function of the First Kind ($\operatorname{ber}$)](#kelvin-function-of-the-first-kind----operatorname-ber---) + - [Kelvin Function of the First Kind ($\operatorname{bei}$)](#kelvin-function-of-the-first-kind----operatorname-bei---) + - [Kelvin Function of the Second Kind ($\operatorname{kei}$)](#kelvin-function-of-the-second-kind----operatorname-kei---) + - [Kelvin Function of the Second Kind ($\operatorname{ker}$)](#kelvin-function-of-the-second-kind----operatorname-ker---) + + [Struve and Modified Struve Functions](#struve-and-modified-struve-functions) + - [Struve Function](#struve-function) + - [Modified Struve Function](#modified-struve-function) + + [Lommel Functions](#lommel-functions) + - [Lommel Function of the First Kind](#lommel-function-of-the-first-kind) + - [Lommel Function of the Second Kind](#lommel-function-of-the-second-kind) + + [Anger and Weber Functions](#anger-and-weber-functions) + - [Anger Function](#anger-function) + - [Weber Function](#weber-function) + + [Parabolic Cylinder Function](#parabolic-cylinder-function) + + [Confluent Hypergeometric Functions](#confluent-hypergeometric-functions) + - [Confluent Hypergeometric Function of the First Kind](#confluent-hypergeometric-function-of-the-first-kind) + - [Confluent Hypergeometric Function of the Second Kind](#confluent-hypergeometric-function-of-the-second-kind) + + [Whittaker Functions](#whittaker-functions) + - [Whittaker Function ($M_{\kappa, \mu}$)](#whittaker-function---m---kappa---mu---) + - [Whittaker Function ($W_{\kappa, \mu}$)](#whittaker-function---w---kappa---mu---) + + [Legendre Functions](#legendre-functions) + - [Legendre Function of the First Kind](#legendre-function-of-the-first-kind) + - [Legendre Function of the Second Kind](#legendre-function-of-the-second-kind) + + [Associated Legendre Functions](#associated-legendre-functions) + - [Associated Legendre Function of the First Kind](#associated-legendre-function-of-the-first-kind) + - [Associated Legendre Function of the Second Kind](#associated-legendre-function-of-the-second-kind) + + [Ferrers Functions](#ferrers-functions) + - [Ferrers Function of the First Kind](#ferrers-function-of-the-first-kind) + - [Ferrers Function of the Second Kind](#ferrers-function-of-the-second-kind) + + [Appell Functions](#appell-functions) + - [Appell Function $\left(F_{1}\right)$](#appell-function---left-f--1--right--) + - [Appell Function $\left(F_{2}\right)$](#appell-function---left-f--2--right--) + - [Appell Function $\left(F_{3}\right)$](#appell-function---left-f--3--right--) + - [Appell Function $\left(F_{4}\right)$](#appell-function---left-f--4--right--) + + [$q$-Hypergeometric and Related Functions](#-q--hypergeometric-and-related-functions) + - [$q$-Factorial](#-q--factorial) + - [$q$-Binomial Coefficient](#-q--binomial-coefficient) + - [$q$-Gamma Function](#-q--gamma-function) + - [$q$-Digamma Function](#-q--digamma-function) + - [$q$-Polygamma Function](#-q--polygamma-function) + + [Chebyshev Polynomials](#chebyshev-polynomials) + - [Chebyshev Polynomial of the First Kind](#chebyshev-polynomial-of-the-first-kind) + - [Chebyshev Polynomial of the Second Kind](#chebyshev-polynomial-of-the-second-kind) + - [Chebyshev Polynomial of the Third Kind](#chebyshev-polynomial-of-the-third-kind) + - [Chebyshev Polynomial of the Fourth Kind](#chebyshev-polynomial-of-the-fourth-kind) + + [Shifted Chebyshev Polynomials](#shifted-chebyshev-polynomials) + - [Shifted Chebyshev Polynomial of the First Kind](#shifted-chebyshev-polynomial-of-the-first-kind) + - [Shifted Chebyshev Polynomial of the Second Kind](#shifted-chebyshev-polynomial-of-the-second-kind) + - [Shifted Chebyshev Polynomial of the Third Kind](#shifted-chebyshev-polynomial-of-the-third-kind) + - [Shifted Chebyshev Polynomial of the Fourth Kind](#shifted-chebyshev-polynomial-of-the-fourth-kind) + + [Hermite Polynomials](#hermite-polynomials) + - [Probabilist’s Hermite Polynomial](#probabilist-s-hermite-polynomial) + - [Physicist’s Hermite Polynomial](#physicist-s-hermite-polynomial) + + [Legendre Forms of Elliptic Integrals](#legendre-forms-of-elliptic-integrals) + - [Elliptic Integral of the First Kind](#elliptic-integral-of-the-first-kind) + - [Elliptic Integral of the Second Kind](#elliptic-integral-of-the-second-kind) + - [Elliptic Integral of the Third Kind](#elliptic-integral-of-the-third-kind) + + [Legendre Forms of Complete Elliptic Integrals](#legendre-forms-of-complete-elliptic-integrals) + - [Complete Elliptic Integral of the First Kind](#complete-elliptic-integral-of-the-first-kind) + - [Complete Elliptic Integral of the Second Kind](#complete-elliptic-integral-of-the-second-kind) + - [Complete Elliptic Integral of the Third Kind](#complete-elliptic-integral-of-the-third-kind) + + [Carlson Symmetric Forms of Elliptic Integrals](#carlson-symmetric-forms-of-elliptic-integrals) + - [Carlson Elliptic Integral $\left(R_{C}\right)$](#carlson-elliptic-integral---left-r--c--right--) + - [Carlson Elliptic Integral $\left(R_{D}\right)$](#carlson-elliptic-integral---left-r--d--right--) + - [Carlson Elliptic Integral $\left(R_{E}\right)$](#carlson-elliptic-integral---left-r--e--right--) + - [Carlson Elliptic Integral $\left(R_{F}\right)$](#carlson-elliptic-integral---left-r--f--right--) + - [Carlson Elliptic Integral $\left(R_{G}\right)$](#carlson-elliptic-integral---left-r--g--right--) + - [Carlson Elliptic Integral $\left(R_{J}\right)$](#carlson-elliptic-integral---left-r--j--right--) + - [Carlson Elliptic Integral $\left(R_{K}\right)$](#carlson-elliptic-integral---left-r--k--right--) + - [Carlson Elliptic Integral $\left(R_{M}\right)$](#carlson-elliptic-integral---left-r--m--right--) + + [Theta Functions](#theta-functions) + - [Theta Function $\left(\theta_{1}\right)$](#theta-function---left--theta--1--right--) + - [Theta Function $\left(\theta_{2}\right)$](#theta-function---left--theta--2--right--) + - [Theta Function $\left(\theta_{3}\right)$](#theta-function---left--theta--3--right--) + - [Theta Function $\left(\theta_{4}\right)$](#theta-function---left--theta--4--right--) + + [Jacobi Elliptic and Related Functions](#jacobi-elliptic-and-related-functions) + - [Jacobi Amplitude Function](#jacobi-amplitude-function) + - [Jacobi Elliptic Function $\left(\operatorname{sn}\right)$](#jacobi-elliptic-function---left--operatorname-sn--right--) + - [Jacobi Elliptic Function $\left(\operatorname{cn}\right)$](#jacobi-elliptic-function---left--operatorname-cn--right--) + - [Jacobi Elliptic Function $\left(\operatorname{dn}\right)$](#jacobi-elliptic-function---left--operatorname-dn--right--) + - [Jacobi Elliptic Function $\left(\operatorname{sd}\right)$](#jacobi-elliptic-function---left--operatorname-sd--right--) + - [Jacobi Elliptic Function $\left(\operatorname{cd}\right)$](#jacobi-elliptic-function---left--operatorname-cd--right--) + - [Jacobi Elliptic Function $\left(\operatorname{sc}\right)$](#jacobi-elliptic-function---left--operatorname-sc--right--) + + [Inverse Jacobi Elliptic Functions](#inverse-jacobi-elliptic-functions) + - [Inverse Jacobi Elliptic Function $\left(\operatorname{sn}\right)$](#inverse-jacobi-elliptic-function---left--operatorname-sn--right--) + - [Inverse Jacobi Elliptic Function $\left(\operatorname{cn}\right)$](#inverse-jacobi-elliptic-function---left--operatorname-cn--right--) + - [Inverse Jacobi Elliptic Function $\left(\operatorname{dn}\right)$](#inverse-jacobi-elliptic-function---left--operatorname-dn--right--) + - [Inverse Jacobi Elliptic Function $\left(\operatorname{sd}\right)$](#inverse-jacobi-elliptic-function---left--operatorname-sd--right--) + - [Inverse Jacobi Elliptic Function $\left(\operatorname{cd}\right)$](#inverse-jacobi-elliptic-function---left--operatorname-cd--right--) + - [Inverse Jacobi Elliptic Function $\left(\operatorname{sc}\right)$](#inverse-jacobi-elliptic-function---left--operatorname-sc--right--) + + [Weierstrass Elliptic Functions](#weierstrass-elliptic-functions) + - [Weierstrass Elliptic Function (p)](#weierstrass-elliptic-function--p-) + - [Weierstrass Elliptic Function (\zeta)](#weierstrass-elliptic-function---zeta-) + - [Weierstrass Elliptic Function (\sigma)](#weierstrass-elliptic-function---sigma-) + + [Modular Functions](#modular-functions) + - [Elliptic Function (\lambda)](#elliptic-function---lambda-) + - [Klein’s Complete Invariant Function](#klein-s-complete-invariant-function) + + [Bernoulli Number and Polynomial](#bernoulli-number-and-polynomial) + - [Bernoulli Number](#bernoulli-number) + - [Bernoulli Polynomial](#bernoulli-polynomial) + + [Euler Number and Polynomial](#euler-number-and-polynomial) + - [Euler Number](#euler-number) + - [Euler Polynomial](#euler-polynomial) + + [Zeta and Related Functions](#zeta-and-related-functions) + - [Riemann Zeta Function](#riemann-zeta-function) + - [Hurwitz Zeta Function](#hurwitz-zeta-function) + - [Polylogarithm](#polylogarithm) + - [Lerch Zeta Function](#lerch-zeta-function) + - [Lerch Transcendent](#lerch-transcendent) + - [Dirichlet L-Function](#dirichlet-l-function) + - [Dirichlet Beta Function](#dirichlet-beta-function) + - [Dirichlet Eta Function](#dirichlet-eta-function) + - [Dirichlet Lambda Function](#dirichlet-lambda-function) + - [Stieltjes Constant](#stieltjes-constant) + + [Multiplicative Number Theoretic Functions](#multiplicative-number-theoretic-functions) + - [Prime Number](#prime-number) + - [Euler’s Totient Function](#euler-s-totient-function) + - [Divisor Function](#divisor-function) + - [Jordan’s Totient Function](#jordan-s-totient-function) + - [Möbius Function](#m-bius-function) + - [Liouville Function](#liouville-function) + + [Matthieu Characteristic Values](#matthieu-characteristic-values) + - [Matthieu Characteristic Value $\left(a\right)$](#matthieu-characteristic-value---left-a-right--) + - [Matthieu Characteristic Value $\left(b\right)$](#matthieu-characteristic-value---left-b-right--) + + [Angular Matthieu Functions](#angular-matthieu-functions) + - [Angular Matthieu Function ($\operatorname{ce}$)](#angular-matthieu-function----operatorname-ce---) + - [Angular Matthieu Function ($\operatorname{se}$)](#angular-matthieu-function----operatorname-se---) + + [Radial Mathieu Functions](#radial-mathieu-functions) + - [Radial Matthieu Function ($\operatorname{M}c$)](#radial-matthieu-function----operatorname-m-c--) + - [Radial Matthieu Function ($\operatorname{M}s$)](#radial-matthieu-function----operatorname-m-s--) + + [Lamé Functions](#lam--functions) + - [Lamé Function $\left(Ec_{n}^{j}\right)$](#lam--function---left-ec--n---j--right--) + - [Derivative of the Lamé Function $\left(Ec_{n}^{j}\right)$](#derivative-of-the-lam--function---left-ec--n---j--right--) + - [Lamé Function $\left(Es_{n}^{j}\right)$](#lam--function---left-es--n---j--right--) + - [Derivative of the Lamé Function $\left(Es_{n}^{j}\right)$](#derivative-of-the-lam--function---left-es--n---j--right--) + + [Heun Functions](#heun-functions) + - [Heun Function](#heun-function) + - [Derivative of the Heun Function](#derivative-of-the-heun-function) + - [Confluent Heun Function](#confluent-heun-function) + - [Derivative of the Confluent Heun Function](#derivative-of-the-confluent-heun-function) + - [Doubly-Confluent Heun Function](#doubly-confluent-heun-function) + - [Derivative of the Doubly-Confluent Heun Function](#derivative-of-the-doubly-confluent-heun-function) + - [Bi-Confluent Heun Function](#bi-confluent-heun-function) + - [Derivative of the Bi-Confluent Heun Function](#derivative-of-the-bi-confluent-heun-function) + - [Tri-Confluent Heun Function](#tri-confluent-heun-function) + - [Derivative of the Tri-Confluent Heun Function](#derivative-of-the-tri-confluent-heun-function) + + [Coulomb Wave Functions](#coulomb-wave-functions) + - [Coulomb Wave Function](#coulomb-wave-function) + - [Irregular Coulomb Wave Function](#irregular-coulomb-wave-function) + - [Outgoing Irregular Coulomb Wave Function](#outgoing-irregular-coulomb-wave-function) + - [Incoming Irregular Coulomb Wave Function](#incoming-irregular-coulomb-wave-function) +* [Prior Art](#prior-art) + + [Cephes Mathematical Library](#cephes-mathematical-library) + + [specfun](#specfun) + + [Wolfram Language](#wolfram-language) + + [MATLAB](#matlab) + + [International Mathematics and Statistics Library (IMSL)](#international-mathematics-and-statistics-library--imsl-) + + [NAG Numerical Library](#nag-numerical-library) + + [GNU Octave](#gnu-octave) + + [GNU Scientific Library (GSL)](#gnu-scientific-library--gsl-) + + [SciPy](#scipy) + + ## Summary This proposal concerns adding new operators to PyTorch's special functions module (i.e., `torch.special`). The proposed operators have a wide range of use in scientific computing and numerical methods. @@ -26,7 +311,7 @@ PyTorch maintainers: * provides much needed standardization to committing future operators to PyTorch. * provides an extremely useful set of operators that can and should be used for tricky numerical problems (e.g., implementing challenging distribution functions and gradients) and useful decomposition targets. -### Special Functions +## Special Functions There’s no formal definition of a *special function*. Colloquially, and for the purpose of this RFC, a special function is a non-elementary function that has an established name and notation due to its importance and ubiquity. @@ -95,28 +380,77 @@ Unlike special functions, *elementary functions* have a rigorous definition but * torch.floor_divide * torch.remainder * torch.round -* Partitions - * `torch.partition_p` *See the “Partition Function” section for the proposed operator* -* Tensorial Functions - * `torch.dirac_delta` *See the “Dirac Delta” section for the proposed operator* - * `torch.kronecker_delta` *See the “Kronecker Delta” section for the proposed operator* - * `torch.levi_civita` *See the “Levi-Civita Symbol” section for the proposed operator* * Discontinuous Functions * Functions with Singular Support -## Special Function Policies +### Special Functions + +PyTorch’s mathematical operators are categorized as either “elementary” or “special.” -PyTorch’s mathematical operators should be categorized as either “elementary” or “special.” An elementary function is a mathematical function whose corresponding operator is available from the `torch` module. A special function is a mathematical function whose corresponding operator is available from the `torch.special` module. Regardless of whether an operator implements an elementary or special function, each operator must share the following properties: +An elementary function is a mathematical function whose corresponding operator is available from the `torch` module. A special function is a mathematical function whose corresponding operator is available from the `torch.special` module. Regardless of whether an operator implements an elementary or special function, users should expect that each operator share the following properties: * A name that adheres to the naming policy. -* A docstring that clearly communicates the following: - * A primary definition - * Real and complex domains - * Real and complex graphs +* CPU and CUDA implementations +* C++ and Python function documentation that state a function’s: + * common mathematical definition; + * real and complex domains; + * real and complex graphs; and, if relevant, + * mathematical and scientific applications. * If differentiable, derivtatives for each variable. +#### Naming Policy + +## Implementation + +### c10 + +#### Constants + +To ease implementation, c10 will provide the following lookup tables (LUTs): + +* factorial, $n!$, where $n = 1, 2, \cdots, 170;$ +* natural logarithm of factorial, $\ln{\left(n!\right)}$, where $n = 1, 2, \cdots, 300;$ +* double factorial, $n!!$, where $n = -1,000, -999, \cdots, 300;$ +* natural logarithm of double factorial, $\ln{\left(n!!\right)}$, where $n = -1,000, -999, \cdots, 300;$ and +* prime number, $p\left(n\right)$, where $n = 1, 2, \cdots, 10,000.$ + +#### Functions + +To ease implementation, c10 will provide the following numerical approximations: + +* Lanczos approximation; +* Spouge’s approximation; and +* Stirling’s approximation. + +##### Lanczos Approximation + +Numerical method for computing the gamma function. It exhibits faster convergence than Spouge’s approximation. + +##### Spouge’s approximation + +Numerical method for computing the gamma function. Its coefficients are faster to compute than Lanczos approximation coefficients. + +##### Stirling’s Approximation + +Numerical method for computing factorials. + +### ATen + +Each special function has a corresponding ATen operator. + +#### CPU + +#### CUDA + +### torch + +## C++ API + ## Python API +
+Factorials + ### Factorials #### Factorial @@ -326,6 +660,10 @@ $\operatorname{ln}{(z_{n})}$ is defined for all real and complex $z$. ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Combinatorial Numbers and Functions ### Combinatorial Numbers and Functions @@ -556,6 +894,10 @@ $$r_{n} = D(n, n) - D(n + 1, n - 1).$$ ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Gamma and Related Functions ### Gamma and Related Functions @@ -745,6 +1087,10 @@ ln_beta( ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Exponential and Logarithmic Integrals ### Exponential and Logarithmic Integrals @@ -860,6 +1206,10 @@ $$\operatorname{li}(z)=\int_{0}^{z}{\frac{1}{\ln{(t)}}}dt.$$ ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Error and Related Functions ### Error and Related Functions @@ -964,6 +1314,10 @@ error_inverse_erfc( ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Dawson and Fresnel Integrals ### Dawson and Fresnel Integrals @@ -1032,6 +1386,10 @@ $$\operatorname{C}(z)=\int_{0}^{x}\cos{t^{2}}dt.$$ ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Trigonometric and Hyperbolic Integrals ### Trigonometric and Hyperbolic Integrals @@ -1170,6 +1528,10 @@ where $\gamma$ is the Euler–Mascheroni constant. ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Incomplete Gamma and Related Functions ### Incomplete Gamma and Related Functions @@ -1240,6 +1602,10 @@ incomplete_beta( ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Airy Functions ### Airy Functions @@ -1438,6 +1804,10 @@ $\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values. ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Bessel Functions ### Bessel Functions @@ -1586,6 +1956,10 @@ $Y_{1}(z)$ is defined for $\\{z \in \mathbb{R} \mid z > 0\\}$ and $\\{z \in \mat ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Hankel Functions ### Hankel Functions @@ -1642,6 +2016,10 @@ where $J_{n}(z)$ is the Bessel function of the first kind, $i$ is the imaginary ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Modified Bessel Functions ### Modified Bessel Functions @@ -1784,6 +2162,10 @@ $K_{1}(z)$ is defined for $\\{z \in \mathbb{R} \mid z > 0\\}$ and $\\{z \in \mat ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Spherical Bessel Functions ### Spherical Bessel Functions @@ -1932,6 +2314,10 @@ where $n = 1$. ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Spherical Hankel Functions ### Spherical Hankel Functions @@ -1988,6 +2374,10 @@ where $H_{n}^{2}$ is the Hankel function of the second kind. ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Modified Spherical Bessel Functions ### Modified Spherical Bessel Functions @@ -2106,6 +2496,10 @@ modified_spherical_bessel_k_1( ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Kelvin Functions ### Kelvin Functions @@ -2194,6 +2588,10 @@ kelvin_ker( ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Struve and Modified Struve Functions ### Struve and Modified Struve Functions @@ -2250,12 +2648,20 @@ where $\Gamma(z)$ is the gamma function. ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Lommel Functions ### Lommel Functions #### Lommel Function of the First Kind #### Lommel Function of the Second Kind +
+ +
+Anger and Weber Functions ### Anger and Weber Functions @@ -2308,6 +2714,10 @@ $$\mathbf{E}_{n}(z)={\frac{1}{\pi}}\int_{0}^{\pi}\sin(n\theta-z\sin \theta )d\th ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Parabolic Cylinder Function ### Parabolic Cylinder Function @@ -2325,6 +2735,10 @@ Parabolic cylinder function: $$D_{n}(z) = \sqrt{\pi} 2^{\tfrac{n}{2}} e^{-\frac{z^2}{4}} \left(\frac{ _1F_1(-\frac{n }{2}; \frac{1}{2}; \frac{z^2}{2})}{\Gamma (\frac{1-n }{2})}-\frac{\sqrt{2} z _1F_1(\frac{1-n }{2};\frac{3}{2};\frac{z^2}{2})}{\Gamma (-\frac{n }{2})} \right),$$ where $_1F_1$ is the confluent hypergeometric function of the first kind and $\Gamma$ is the gamma function. +
+ +
+Confluent Hypergeometric Functions ### Confluent Hypergeometric Functions @@ -2347,6 +2761,10 @@ $$_{1}{F}_{1}(a; b; z) = \sum_{k = 0}^{\infty} \frac{a_{k}}{b_{k}} \frac{z^{k}}{ where $a_{k}$ and $b_{k}$ are rising factorials. #### Confluent Hypergeometric Function of the Second Kind +
+ +
+Whittaker Functions ### Whittaker Functions @@ -2403,32 +2821,44 @@ $${\displaystyle W_{\kappa ,\mu }(z)=\exp (-z/2)z^{\mu +{\tfrac {1}{2}}}U(\mu -\ ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Legendre Functions ### Legendre Functions #### Legendre Function of the First Kind #### Legendre Function of the Second Kind +
+ +
+Associated Legendre Functions ### Associated Legendre Functions #### Associated Legendre Function of the First Kind #### Associated Legendre Function of the Second Kind +
+ +
+Ferrers Functions ### Ferrers Functions #### Ferrers Function of the First Kind #### Ferrers Function of the Second Kind +
-### Spherical and Spheroidal Harmonics - -### Generalized Hypergeometric and Related Functions +
+Appell Functions ### Appell Functions -#### Appell Function ($F_{1}$) +#### Appell Function $\left(F_{1}\right)$ ```Python appell_f_1( @@ -2465,7 +2895,7 @@ $$F_{1}(a; b, c; d; x, y) = \sum_{m, n=0}^{\infty}{\frac{a_{m + n}b_{m}c_{n}}{d_ **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Appell Function ($F_{2}$) +#### Appell Function $\left(F_{2}\right)$ ```Python appell_f_2( @@ -2501,7 +2931,7 @@ appell_f_2( **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Appell Function ($F_{3}$) +#### Appell Function $\left(F_{3}\right)$ ```Python appell_f_3( @@ -2537,7 +2967,7 @@ appell_f_3( **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Appell Function ($F_{4}$) +#### Appell Function $\left(F_{4}\right)$ ```Python appell_f_4( @@ -2569,6 +2999,10 @@ appell_f_4( ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+$q$-Hypergeometric and Related Functions ### $q$-Hypergeometric and Related Functions @@ -2581,6 +3015,10 @@ appell_f_4( #### $q$-Digamma Function #### $q$-Polygamma Function +
+ +
+Chebyshev Polynomials ### Chebyshev Polynomials @@ -2675,6 +3113,10 @@ Chebyshev polynomial of the fourth kind, $W_{n}(x).$ ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Shifted Chebyshev Polynomials ### Shifted Chebyshev Polynomials @@ -2769,6 +3211,10 @@ Shifted Chebyshev polynomial of the fourth kind, $W_{n}^{\ast}(x).$ ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Hermite Polynomials ### Hermite Polynomials @@ -2817,8 +3263,10 @@ Physicist’s Hermite polynomial: ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
-### Orthogonal Polynomials +
+Legendre Forms of Elliptic Integrals ### Legendre Forms of Elliptic Integrals @@ -2899,6 +3347,10 @@ The incomplete elliptic integral is defined in terms of the parameter $m$ instea ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Legendre Forms of Complete Elliptic Integrals ### Legendre Forms of Complete Elliptic Integrals @@ -2976,10 +3428,14 @@ The complete elliptic integral is defined in terms of the parameter $m$ instead ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Carlson Symmetric Forms of Elliptic Integrals ### Carlson Symmetric Forms of Elliptic Integrals -#### Carlson Elliptic Integral ($R_{C}$) +#### Carlson Elliptic Integral $\left(R_{C}\right)$ ```Python carlson_elliptic_integral_r_c( @@ -3000,7 +3456,7 @@ carlson_elliptic_integral_r_c( **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Carlson Elliptic Integral ($R_{D}$) +#### Carlson Elliptic Integral $\left(R_{D}\right)$ ```Python carlson_elliptic_integral_r_d( @@ -3024,7 +3480,7 @@ carlson_elliptic_integral_r_d( **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Carlson Elliptic Integral ($R_{E}$) +#### Carlson Elliptic Integral $\left(R_{E}\right)$ ```Python carlson_elliptic_integral_r_e( @@ -3034,7 +3490,7 @@ carlson_elliptic_integral_r_e( ) -> Tensor ``` -#### Carlson Elliptic Integral ($R_{F}$) +#### Carlson Elliptic Integral $\left(R_{F}\right)$ ```Python carlson_elliptic_integral_r_f( @@ -3058,7 +3514,7 @@ carlson_elliptic_integral_r_f( **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Carlson Elliptic Integral ($R_{G}$) +#### Carlson Elliptic Integral $\left(R_{G}\right)$ ```Python carlson_elliptic_integral_r_g( @@ -3082,7 +3538,7 @@ carlson_elliptic_integral_r_g( **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Carlson Elliptic Integral ($R_{J}$) +#### Carlson Elliptic Integral $\left(R_{J}\right)$ ```Python carlson_elliptic_integral_r_j( @@ -3107,7 +3563,7 @@ carlson_elliptic_integral_r_j( **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Carlson Elliptic Integral ($R_{K}$) +#### Carlson Elliptic Integral $\left(R_{K}\right)$ ```Python carlson_elliptic_integral_r_k( @@ -3117,7 +3573,7 @@ carlson_elliptic_integral_r_k( ) -> Tensor ``` -#### Carlson Elliptic Integral ($R_{M}$) +#### Carlson Elliptic Integral $\left(R_{M}\right)$ ```Python carlson_elliptic_integral_r_m( @@ -3126,14 +3582,19 @@ carlson_elliptic_integral_r_m( out: Optional[Tensor] = None, ) -> Tensor ``` +
+ +
+Theta Functions ### Theta Functions -#### Theta Function ($\theta_{1}$) +#### Theta Function $\left(\theta_{1}\right)$ ```Python theta_1( - n: Tensor, + z: Tensor, + t: Tensor, *, out: Optional[Tensor] = None, ) -> Tensor @@ -3141,43 +3602,82 @@ theta_1( ##### Parameters -**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**t** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Theta Function ($\theta_{2}$) +#### Theta Function $\left(\theta_{2}\right)$ ```Python theta_2( - n: Tensor, + z: Tensor, + t: Tensor, *, out: Optional[Tensor] = None, ) -> Tensor ``` -#### Theta Function ($\theta_{3}$) +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**t** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Theta Function $\left(\theta_{3}\right)$ ```Python theta_3( - n: Tensor, + z: Tensor, + t: Tensor, *, out: Optional[Tensor] = None, ) -> Tensor ``` -#### Theta Function ($\theta_{4}$) +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**t** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Theta Function $\left(\theta_{4}\right)$ ```Python theta_4( - n: Tensor, + z: Tensor, + t: Tensor, *, out: Optional[Tensor] = None, ) -> Tensor ``` -### Jacobi Elliptic Functions +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**t** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Jacobi Elliptic and Related Functions + +### Jacobi Elliptic and Related Functions #### Jacobi Amplitude Function @@ -3189,7 +3689,7 @@ jacobi_amplitude_am( ) -> Tensor ``` -#### Jacobi Elliptic Function ($\operatorname{sn}$) +#### Jacobi Elliptic Function $\left(\operatorname{sn}\right)$ ```Python jacobi_elliptic_sn( @@ -3201,7 +3701,7 @@ jacobi_elliptic_sn( $$\operatorname{sn}(z \mid m) = \sin(\operatorname{am}(z \mid m))$$ -#### Jacobi Elliptic Function ($\operatorname{cn}$) +#### Jacobi Elliptic Function $\left(\operatorname{cn}\right)$ ```Python jacobi_elliptic_cn( @@ -3213,7 +3713,7 @@ jacobi_elliptic_cn( $$\operatorname{cn}(z \mid m) = \cos(\operatorname{am}(z \mid m))$$ -#### Jacobi Elliptic Function ($\operatorname{dn}$) +#### Jacobi Elliptic Function $\left(\operatorname{dn}\right)$ ```Python jacobi_elliptic_dn( @@ -3223,7 +3723,7 @@ jacobi_elliptic_dn( ) -> Tensor ``` -#### Jacobi Elliptic Function ($\operatorname{sd}$) +#### Jacobi Elliptic Function $\left(\operatorname{sd}\right)$ ```Python jacobi_elliptic_sd( @@ -3233,7 +3733,7 @@ jacobi_elliptic_sd( ) -> Tensor ``` -#### Jacobi Elliptic Function ($\operatorname{cd}$) +#### Jacobi Elliptic Function $\left(\operatorname{cd}\right)$ ```Python jacobi_elliptic_cd( @@ -3245,7 +3745,7 @@ jacobi_elliptic_cd( $$\operatorname{cd}(z \mid m) = \frac{\operatorname{cn}(z \mid m)}{\operatorname{dn}(z \mid m)}$$ -#### Jacobi Elliptic Function ($\operatorname{sc}$) +#### Jacobi Elliptic Function $\left(\operatorname{sc}\right)$ ```Python jacobi_elliptic_sc( @@ -3254,10 +3754,14 @@ jacobi_elliptic_sc( out: Optional[Tensor] = None, ) -> Tensor ``` +
+ +
+Inverse Jacobi Elliptic Functions ### Inverse Jacobi Elliptic Functions -#### Inverse Jacobi Elliptic Function ($\operatorname{sn}$) +#### Inverse Jacobi Elliptic Function $\left(\operatorname{sn}\right)$ ```Python inverse_jacobi_elliptic_sn( @@ -3267,7 +3771,7 @@ inverse_jacobi_elliptic_sn( ) -> Tensor ``` -#### Inverse Jacobi Elliptic Function ($\operatorname{cn}$) +#### Inverse Jacobi Elliptic Function $\left(\operatorname{cn}\right)$ ```Python inverse_jacobi_elliptic_cn( @@ -3277,7 +3781,7 @@ inverse_jacobi_elliptic_cn( ) -> Tensor ``` -#### Inverse Jacobi Elliptic Function ($\operatorname{dn}$) +#### Inverse Jacobi Elliptic Function $\left(\operatorname{dn}\right)$ ```Python inverse_jacobi_elliptic_dn( @@ -3287,7 +3791,7 @@ inverse_jacobi_elliptic_dn( ) -> Tensor ``` -#### Inverse Jacobi Elliptic Function ($\operatorname{sd}$) +#### Inverse Jacobi Elliptic Function $\left(\operatorname{sd}\right)$ ```Python inverse_jacobi_elliptic_sd( @@ -3297,7 +3801,7 @@ inverse_jacobi_elliptic_sd( ) -> Tensor ``` -#### Inverse Jacobi Elliptic Function ($\operatorname{cd}$) +#### Inverse Jacobi Elliptic Function $\left(\operatorname{cd}\right)$ ```Python inverse_jacobi_elliptic_cd( @@ -3307,7 +3811,7 @@ inverse_jacobi_elliptic_cd( ) -> Tensor ``` -#### Inverse Jacobi Elliptic Function ($\operatorname{sc}$) +#### Inverse Jacobi Elliptic Function $\left(\operatorname{sc}\right)$ ```Python inverse_jacobi_elliptic_sc( @@ -3316,6 +3820,10 @@ inverse_jacobi_elliptic_sc( out: Optional[Tensor] = None, ) -> Tensor ``` +
+ +
+Weierstrass Elliptic Functions ### Weierstrass Elliptic Functions @@ -3324,12 +3832,20 @@ inverse_jacobi_elliptic_sc( #### Weierstrass Elliptic Function (\zeta) #### Weierstrass Elliptic Function (\sigma) +
+ +
+Modular Functions ### Modular Functions #### Elliptic Function (\lambda) #### Klein’s Complete Invariant Function +
+ +
+Bernoulli Number and Polynomial ### Bernoulli Number and Polynomial @@ -3375,6 +3891,10 @@ Bernoulli polynomial, $B_{n}(x)$. ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Euler Number and Polynomial ### Euler Number and Polynomial @@ -3420,6 +3940,10 @@ Euler polynomial, $E_{n}(x)$. ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Zeta and Related Functions ### Zeta and Related Functions @@ -3437,6 +3961,14 @@ Riemann zeta function: $$\zeta(s)=\sum _{n=1}^{\infty}{\frac{1}{n^{s}}}.$$ +##### Parameters + +**s** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + #### Hurwitz Zeta Function ```Python @@ -3452,6 +3984,16 @@ Hurwitz zeta function: $$\zeta(s, a) = \sum _{n = 0}^{\infty}{\frac{1}{(n + a)^{s}}}.$$ +##### Parameters + +**s** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + #### Polylogarithm ```Python @@ -3467,6 +4009,16 @@ Polylogarithm: $$\operatorname{Li}_{s + 1}(z ) = \int_{0}^{z}{\frac{\operatorname{Li}_{s}(t)}{t}}dt.$$ +##### Parameters + +**s** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + #### Lerch Zeta Function ```Python @@ -3479,9 +4031,25 @@ lerch_zeta_l( ) -> Tensor ``` +##### Parameters + +**l** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + #### Lerch Transcendent #### Dirichlet L-Function +
+ +
+Multiplicative Number Theoretic Functions ### Multiplicative Number Theoretic Functions @@ -3499,61 +4067,662 @@ $n^{\text{th}}$ prime number, $p(n)$. #### Euler’s Totient Function +```Python +euler_totient_phi( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + #### Divisor Function #### Jordan’s Totient Function #### Möbius Function +```Python +mobius_mu( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + #### Liouville Function +```Python +liouville_lambda( + n: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` +
+ +
+Matthieu Characteristic Values + ### Matthieu Characteristic Values -#### Matthieu Characteristic Value ($a$) +#### Matthieu Characteristic Value $\left(a\right)$ + +```Python +matthieu_characteristic_a( + r: Tensor, + q: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +#### Matthieu Characteristic Value $\left(b\right)$ + +```Python +matthieu_characteristic_b( + r: Tensor, + q: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` +
-#### Matthieu Characteristic Value ($b$) +
+Angular Matthieu Functions ### Angular Matthieu Functions #### Angular Matthieu Function ($\operatorname{ce}$) #### Angular Matthieu Function ($\operatorname{se}$) +
+ +
+Radial Mathieu Functions ### Radial Mathieu Functions #### Radial Matthieu Function ($\operatorname{M}c$) #### Radial Matthieu Function ($\operatorname{M}s$) +
+ +
+Lamé Functions ### Lamé Functions -### Spherodial Wave Functions +#### Lamé Function $\left(Ec_{n}^{j}\right)$ -### Heun Functions +```Python +lame_ec( + n: Tensor, + j: Tensor, + z: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` -#### Heun Function +##### Parameters -#### Confluent Heun Function +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -#### Doubly-Confluent Heun Function +**j** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -#### Bi-Confluent Heun Function +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -#### Tri-Confluent Heun Function +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -### Painlevé Transcendents +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Derivative of the Lamé Function $\left(Ec_{n}^{j}\right)$ + +```Python +lame_ec_prime( + n: Tensor, + j: Tensor, + z: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**j** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Lamé Function $\left(Es_{n}^{j}\right)$ + +```Python +lame_es( + n: Tensor, + j: Tensor, + z: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**j** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Derivative of the Lamé Function $\left(Es_{n}^{j}\right)$ + +```Python +lame_es_prime( + n: Tensor, + j: Tensor, + z: Tensor, + m: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` -### Coulomb Wave Functions +##### Parameters -#### Coulomb Wave Function (F) +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -#### Coulomb Wave Function (G) +**j** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -## Metrics +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -## Drawbacks +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -## Alternatives +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Heun Functions + +### Heun Functions + +#### Heun Function + +```Python +heun( + p: Tensor, + q: Tensor, + a: Tensor, + b: Tensor, + g: Tensor, + d: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Heun function: + +##### Parameters + +**p** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**g** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Derivative of the Heun Function + +```Python +heun_prime( + p: Tensor, + q: Tensor, + a: Tensor, + b: Tensor, + g: Tensor, + d: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Derivative of the Heun function: + +##### Parameters + +**p** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**b** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**g** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Confluent Heun Function + +```Python +confluent_heun( + q: Tensor, + a: Tensor, + g: Tensor, + d: Tensor, + e: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Confluent Heun function: + +##### Parameters + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**g** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Derivative of the Confluent Heun Function + +```Python +confluent_heun_prime( + q: Tensor, + a: Tensor, + g: Tensor, + d: Tensor, + e: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Derivative of the confluent Heun function: + +##### Parameters + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**g** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Doubly-Confluent Heun Function + +```Python +confluent_heun( + q: Tensor, + a: Tensor, + g: Tensor, + d: Tensor, + e: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Doubly-confluent Heun function: + +##### Parameters + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**g** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Derivative of the Doubly-Confluent Heun Function + +```Python +confluent_heun_prime( + q: Tensor, + a: Tensor, + g: Tensor, + d: Tensor, + e: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Derivative of the doubly-confluent Heun function: + +##### Parameters + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**g** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Bi-Confluent Heun Function + +```Python +biconfluent_heun( + q: Tensor, + a: Tensor, + g: Tensor, + d: Tensor, + e: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Bi-confluent Heun function: + +##### Parameters + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**g** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Derivative of the Bi-Confluent Heun Function + +```Python +biconfluent_heun_prime( + q: Tensor, + a: Tensor, + g: Tensor, + d: Tensor, + e: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Derivative of the bi-confluent Heun function: + +##### Parameters + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**g** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Tri-Confluent Heun Function + +```Python +triconfluent_heun( + q: Tensor, + a: Tensor, + g: Tensor, + d: Tensor, + e: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Tri-confluent Heun function: + +##### Parameters + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**g** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Derivative of the Tri-Confluent Heun Function + +```Python +triconfluent_heun_prime( + q: Tensor, + a: Tensor, + g: Tensor, + d: Tensor, + e: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Derivative of the tri-confluent Heun function: + +##### Parameters + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**a** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**g** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**d** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Coulomb Wave Functions + +#### Coulomb Wave Function + +```Python +coulomb_f( + l: Tensor, + e: Tensor, + r: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**l** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**r** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Irregular Coulomb Wave Function + +```Python +coulomb_g( + l: Tensor, + e: Tensor, + r: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**l** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**r** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Outgoing Irregular Coulomb Wave Function + +```Python +coulomb_h_positive( + l: Tensor, + e: Tensor, + r: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**l** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**r** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + +#### Incoming Irregular Coulomb Wave Function + +```Python +coulomb_h_negative( + l: Tensor, + e: Tensor, + r: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +##### Parameters + +**l** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**e** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**r** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
## Prior Art From dffaf5e5c162a0a31c1843c67229ffa568a660f9 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 12:50:06 -0400 Subject: [PATCH 034/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 285 ---------------------------------- 1 file changed, 285 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 2e69ff14..f6caac2d 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -6,291 +6,6 @@ _Author’s note—This RFC is a work-in-progress._ * Allen Goodman (@0x00b1) -## Table of Contents - -* [Summary](#summary) -* [Motivation](#motivation) -* [Special Functions](#special-functions-1) - + [Elementary Functions](#elementary-functions) - + [Special Functions](#special-functions-2) - - [Naming Policy](#naming-policy) -* [Implementation](#implementation) - + [c10](#c10) - - [Constants](#constants) - - [Functions](#functions) - * [Lanczos Approximation](#lanczos-approximation) - * [Spouge’s approximation](#spouge-s-approximation) - * [Stirling’s Approximation](#stirling-s-approximation) - + [ATen](#aten) - - [CPU](#cpu) - - [CUDA](#cuda) - + [torch](#torch) -* [C++ API](#c---api) -* [Python API](#python-api) - + [Factorials](#factorials) - - [Factorial](#factorial) - - [Natural Logarithm of Factorial](#natural-logarithm-of-factorial) - - [Double Factorial](#double-factorial) - - [Natural Logarithm of Double Factorial](#natural-logarithm-of-double-factorial) - - [Rising Factorial](#rising-factorial) - - [Natural Logarithm of Rising Factorial](#natural-logarithm-of-rising-factorial) - - [Falling Factorial](#falling-factorial) - - [Natural Logarithm of Falling Factorial](#natural-logarithm-of-falling-factorial) - + [Combinatorial Numbers and Functions](#combinatorial-numbers-and-functions) - - [Binomial Coefficient](#binomial-coefficient) - - [Natural Logarithm of Binomial Coefficient](#natural-logarithm-of-binomial-coefficient) - - [Catalan Number](#catalan-number) - - [Stirling Number of the First Kind](#stirling-number-of-the-first-kind) - - [Stirling Number of the Second Kind](#stirling-number-of-the-second-kind) - - [Bell Number](#bell-number) - - [Delannoy Number](#delannoy-number) - - [Motzkin Number](#motzkin-number) - - [Narayana Number](#narayana-number) - - [Schröder Number](#schr-der-number) - + [Gamma and Related Functions](#gamma-and-related-functions) - - [Gamma Function](#gamma-function) - - [Reciprocal Gamma Function](#reciprocal-gamma-function) - - [Polygamma Function](#polygamma-function) - - [Digamma Function](#digamma-function) - - [Trigamma Function](#trigamma-function) - - [Natural Logarithm of the Gamma Function](#natural-logarithm-of-the-gamma-function) - - [Sign of the Gamma Function](#sign-of-the-gamma-function) - - [Beta Function](#beta-function) - - [Natural Logarithm of the Beta Function](#natural-logarithm-of-the-beta-function) - + [Exponential and Logarithmic Integrals](#exponential-and-logarithmic-integrals) - - [Exponential Integral, $\operatorname{Ein}$](#exponential-integral----operatorname-ein--) - - [Exponential Integral, $\operatorname{Ei}$](#exponential-integral----operatorname-ei--) - - [Exponential Integral, $E_{1}$](#exponential-integral---e--1--) - - [Exponential Integral, $E_{n}$](#exponential-integral---e--n--) - - [Logarithmic Integral](#logarithmic-integral) - + [Error and Related Functions](#error-and-related-functions) - - [Error Function](#error-function) - - [Complementary Error Function](#complementary-error-function) - - [Imaginary Error Function](#imaginary-error-function) - - [Inverse Error Function](#inverse-error-function) - - [Inverse Complementary Error Function](#inverse-complementary-error-function) - + [Dawson and Fresnel Integrals](#dawson-and-fresnel-integrals) - - [Dawson’s Integral](#dawson-s-integral) - - [Sine Fresnel Integral](#sine-fresnel-integral) - - [Cosine Fresnel Integral](#cosine-fresnel-integral) - + [Trigonometric and Hyperbolic Integrals](#trigonometric-and-hyperbolic-integrals) - - [Sine Integral ($operatorname{Sin}$)](#sine-integral---operatorname-sin---) - - [Sine Integral ($\operatorname{Si}$)](#sine-integral----operatorname-si---) - - [Cosine Integral ($\operatorname{Cin}$)](#cosine-integral----operatorname-cin---) - - [Cosine Integral ($\operatorname{Ci}$)](#cosine-integral----operatorname-ci---) - - [Hyperbolic Sine Integral](#hyperbolic-sine-integral) - - [Hyperbolic Cosine Integral](#hyperbolic-cosine-integral) - + [Incomplete Gamma and Related Functions](#incomplete-gamma-and-related-functions) - - [Incomplete Gamma Function ($\gamma$)](#incomplete-gamma-function----gamma--) - - [Incomplete Gamma Function ($\Gamma$)](#incomplete-gamma-function----gamma--) - - [Incomplete Beta Function](#incomplete-beta-function) - + [Airy Functions](#airy-functions) - - [Airy Function of the First Kind](#airy-function-of-the-first-kind) - - [Airy Function of the Second Kind](#airy-function-of-the-second-kind) - - [Derivative of the Airy Function of the First Kind](#derivative-of-the-airy-function-of-the-first-kind) - - [Derivative of the Airy Function of the Second Kind](#derivative-of-the-airy-function-of-the-second-kind) - - [Exponentially Scaled Airy Function of the First Kind](#exponentially-scaled-airy-function-of-the-first-kind) - - [Exponentially Scaled Airy Function of the Second Kind](#exponentially-scaled-airy-function-of-the-second-kind) - - [Exponentially Scaled Derivative of the Airy Function of the First Kind](#exponentially-scaled-derivative-of-the-airy-function-of-the-first-kind) - - [Exponentially Scaled Derivative of the Airy Function of the Second Kind](#exponentially-scaled-derivative-of-the-airy-function-of-the-second-kind) - + [Bessel Functions](#bessel-functions) - - [Bessel Function of the First Kind](#bessel-function-of-the-first-kind) - - [Bessel Function of the First Kind of Order 0](#bessel-function-of-the-first-kind-of-order-0) - - [Bessel Function of the First Kind of Order 1](#bessel-function-of-the-first-kind-of-order-1) - - [Bessel Function of the Second Kind](#bessel-function-of-the-second-kind) - - [Bessel Function of the Second Kind of Order 0](#bessel-function-of-the-second-kind-of-order-0) - - [Bessel Function of the Second Kind of Order 1](#bessel-function-of-the-second-kind-of-order-1) - + [Hankel Functions](#hankel-functions) - - [Hankel Function of the First Kind](#hankel-function-of-the-first-kind) - - [Hankel Function of the Second Kind](#hankel-function-of-the-second-kind) - + [Modified Bessel Functions](#modified-bessel-functions) - - [Modified Bessel Function of the First Kind](#modified-bessel-function-of-the-first-kind) - - [Modified Bessel Function of the First Kind of Order 0](#modified-bessel-function-of-the-first-kind-of-order-0) - - [Modified Bessel Function of the First Kind of Order 1](#modified-bessel-function-of-the-first-kind-of-order-1) - - [Modified Bessel Function of the Second Kind](#modified-bessel-function-of-the-second-kind) - - [Modified Bessel Function of the Second Kind of Order 0](#modified-bessel-function-of-the-second-kind-of-order-0) - - [Modified Bessel Function of the Second Kind of Order 1](#modified-bessel-function-of-the-second-kind-of-order-1) - + [Spherical Bessel Functions](#spherical-bessel-functions) - - [Spherical Bessel Function of the First Kind](#spherical-bessel-function-of-the-first-kind) - - [Spherical Bessel Function of the First Kind of Order 0](#spherical-bessel-function-of-the-first-kind-of-order-0) - - [Spherical Bessel Function of the First Kind of Order 1](#spherical-bessel-function-of-the-first-kind-of-order-1) - - [Spherical Bessel Function of the Second Kind](#spherical-bessel-function-of-the-second-kind) - - [Spherical Bessel Function of the Second Kind of Order 0](#spherical-bessel-function-of-the-second-kind-of-order-0) - - [Spherical Bessel Function of the Second Kind of Order 1](#spherical-bessel-function-of-the-second-kind-of-order-1) - + [Spherical Hankel Functions](#spherical-hankel-functions) - - [Spherical Hankel Function of the First Kind](#spherical-hankel-function-of-the-first-kind) - - [Spherical Hankel Function of the Second Kind](#spherical-hankel-function-of-the-second-kind) - + [Modified Spherical Bessel Functions](#modified-spherical-bessel-functions) - - [Modified Spherical Bessel Function of the First Kind](#modified-spherical-bessel-function-of-the-first-kind) - - [Modified Spherical Bessel Function of the First Kind of Order 0](#modified-spherical-bessel-function-of-the-first-kind-of-order-0) - - [Modified Spherical Bessel Function of the First Kind of Order 1](#modified-spherical-bessel-function-of-the-first-kind-of-order-1) - - [Modified Spherical Bessel Function of the Second Kind](#modified-spherical-bessel-function-of-the-second-kind) - - [Modified Spherical Bessel Function of the Second Kind of Order 0](#modified-spherical-bessel-function-of-the-second-kind-of-order-0) - - [Modified Spherical Bessel Function of the Second Kind of Order 1](#modified-spherical-bessel-function-of-the-second-kind-of-order-1) - + [Kelvin Functions](#kelvin-functions) - - [Kelvin Function of the First Kind ($\operatorname{ber}$)](#kelvin-function-of-the-first-kind----operatorname-ber---) - - [Kelvin Function of the First Kind ($\operatorname{bei}$)](#kelvin-function-of-the-first-kind----operatorname-bei---) - - [Kelvin Function of the Second Kind ($\operatorname{kei}$)](#kelvin-function-of-the-second-kind----operatorname-kei---) - - [Kelvin Function of the Second Kind ($\operatorname{ker}$)](#kelvin-function-of-the-second-kind----operatorname-ker---) - + [Struve and Modified Struve Functions](#struve-and-modified-struve-functions) - - [Struve Function](#struve-function) - - [Modified Struve Function](#modified-struve-function) - + [Lommel Functions](#lommel-functions) - - [Lommel Function of the First Kind](#lommel-function-of-the-first-kind) - - [Lommel Function of the Second Kind](#lommel-function-of-the-second-kind) - + [Anger and Weber Functions](#anger-and-weber-functions) - - [Anger Function](#anger-function) - - [Weber Function](#weber-function) - + [Parabolic Cylinder Function](#parabolic-cylinder-function) - + [Confluent Hypergeometric Functions](#confluent-hypergeometric-functions) - - [Confluent Hypergeometric Function of the First Kind](#confluent-hypergeometric-function-of-the-first-kind) - - [Confluent Hypergeometric Function of the Second Kind](#confluent-hypergeometric-function-of-the-second-kind) - + [Whittaker Functions](#whittaker-functions) - - [Whittaker Function ($M_{\kappa, \mu}$)](#whittaker-function---m---kappa---mu---) - - [Whittaker Function ($W_{\kappa, \mu}$)](#whittaker-function---w---kappa---mu---) - + [Legendre Functions](#legendre-functions) - - [Legendre Function of the First Kind](#legendre-function-of-the-first-kind) - - [Legendre Function of the Second Kind](#legendre-function-of-the-second-kind) - + [Associated Legendre Functions](#associated-legendre-functions) - - [Associated Legendre Function of the First Kind](#associated-legendre-function-of-the-first-kind) - - [Associated Legendre Function of the Second Kind](#associated-legendre-function-of-the-second-kind) - + [Ferrers Functions](#ferrers-functions) - - [Ferrers Function of the First Kind](#ferrers-function-of-the-first-kind) - - [Ferrers Function of the Second Kind](#ferrers-function-of-the-second-kind) - + [Appell Functions](#appell-functions) - - [Appell Function $\left(F_{1}\right)$](#appell-function---left-f--1--right--) - - [Appell Function $\left(F_{2}\right)$](#appell-function---left-f--2--right--) - - [Appell Function $\left(F_{3}\right)$](#appell-function---left-f--3--right--) - - [Appell Function $\left(F_{4}\right)$](#appell-function---left-f--4--right--) - + [$q$-Hypergeometric and Related Functions](#-q--hypergeometric-and-related-functions) - - [$q$-Factorial](#-q--factorial) - - [$q$-Binomial Coefficient](#-q--binomial-coefficient) - - [$q$-Gamma Function](#-q--gamma-function) - - [$q$-Digamma Function](#-q--digamma-function) - - [$q$-Polygamma Function](#-q--polygamma-function) - + [Chebyshev Polynomials](#chebyshev-polynomials) - - [Chebyshev Polynomial of the First Kind](#chebyshev-polynomial-of-the-first-kind) - - [Chebyshev Polynomial of the Second Kind](#chebyshev-polynomial-of-the-second-kind) - - [Chebyshev Polynomial of the Third Kind](#chebyshev-polynomial-of-the-third-kind) - - [Chebyshev Polynomial of the Fourth Kind](#chebyshev-polynomial-of-the-fourth-kind) - + [Shifted Chebyshev Polynomials](#shifted-chebyshev-polynomials) - - [Shifted Chebyshev Polynomial of the First Kind](#shifted-chebyshev-polynomial-of-the-first-kind) - - [Shifted Chebyshev Polynomial of the Second Kind](#shifted-chebyshev-polynomial-of-the-second-kind) - - [Shifted Chebyshev Polynomial of the Third Kind](#shifted-chebyshev-polynomial-of-the-third-kind) - - [Shifted Chebyshev Polynomial of the Fourth Kind](#shifted-chebyshev-polynomial-of-the-fourth-kind) - + [Hermite Polynomials](#hermite-polynomials) - - [Probabilist’s Hermite Polynomial](#probabilist-s-hermite-polynomial) - - [Physicist’s Hermite Polynomial](#physicist-s-hermite-polynomial) - + [Legendre Forms of Elliptic Integrals](#legendre-forms-of-elliptic-integrals) - - [Elliptic Integral of the First Kind](#elliptic-integral-of-the-first-kind) - - [Elliptic Integral of the Second Kind](#elliptic-integral-of-the-second-kind) - - [Elliptic Integral of the Third Kind](#elliptic-integral-of-the-third-kind) - + [Legendre Forms of Complete Elliptic Integrals](#legendre-forms-of-complete-elliptic-integrals) - - [Complete Elliptic Integral of the First Kind](#complete-elliptic-integral-of-the-first-kind) - - [Complete Elliptic Integral of the Second Kind](#complete-elliptic-integral-of-the-second-kind) - - [Complete Elliptic Integral of the Third Kind](#complete-elliptic-integral-of-the-third-kind) - + [Carlson Symmetric Forms of Elliptic Integrals](#carlson-symmetric-forms-of-elliptic-integrals) - - [Carlson Elliptic Integral $\left(R_{C}\right)$](#carlson-elliptic-integral---left-r--c--right--) - - [Carlson Elliptic Integral $\left(R_{D}\right)$](#carlson-elliptic-integral---left-r--d--right--) - - [Carlson Elliptic Integral $\left(R_{E}\right)$](#carlson-elliptic-integral---left-r--e--right--) - - [Carlson Elliptic Integral $\left(R_{F}\right)$](#carlson-elliptic-integral---left-r--f--right--) - - [Carlson Elliptic Integral $\left(R_{G}\right)$](#carlson-elliptic-integral---left-r--g--right--) - - [Carlson Elliptic Integral $\left(R_{J}\right)$](#carlson-elliptic-integral---left-r--j--right--) - - [Carlson Elliptic Integral $\left(R_{K}\right)$](#carlson-elliptic-integral---left-r--k--right--) - - [Carlson Elliptic Integral $\left(R_{M}\right)$](#carlson-elliptic-integral---left-r--m--right--) - + [Theta Functions](#theta-functions) - - [Theta Function $\left(\theta_{1}\right)$](#theta-function---left--theta--1--right--) - - [Theta Function $\left(\theta_{2}\right)$](#theta-function---left--theta--2--right--) - - [Theta Function $\left(\theta_{3}\right)$](#theta-function---left--theta--3--right--) - - [Theta Function $\left(\theta_{4}\right)$](#theta-function---left--theta--4--right--) - + [Jacobi Elliptic and Related Functions](#jacobi-elliptic-and-related-functions) - - [Jacobi Amplitude Function](#jacobi-amplitude-function) - - [Jacobi Elliptic Function $\left(\operatorname{sn}\right)$](#jacobi-elliptic-function---left--operatorname-sn--right--) - - [Jacobi Elliptic Function $\left(\operatorname{cn}\right)$](#jacobi-elliptic-function---left--operatorname-cn--right--) - - [Jacobi Elliptic Function $\left(\operatorname{dn}\right)$](#jacobi-elliptic-function---left--operatorname-dn--right--) - - [Jacobi Elliptic Function $\left(\operatorname{sd}\right)$](#jacobi-elliptic-function---left--operatorname-sd--right--) - - [Jacobi Elliptic Function $\left(\operatorname{cd}\right)$](#jacobi-elliptic-function---left--operatorname-cd--right--) - - [Jacobi Elliptic Function $\left(\operatorname{sc}\right)$](#jacobi-elliptic-function---left--operatorname-sc--right--) - + [Inverse Jacobi Elliptic Functions](#inverse-jacobi-elliptic-functions) - - [Inverse Jacobi Elliptic Function $\left(\operatorname{sn}\right)$](#inverse-jacobi-elliptic-function---left--operatorname-sn--right--) - - [Inverse Jacobi Elliptic Function $\left(\operatorname{cn}\right)$](#inverse-jacobi-elliptic-function---left--operatorname-cn--right--) - - [Inverse Jacobi Elliptic Function $\left(\operatorname{dn}\right)$](#inverse-jacobi-elliptic-function---left--operatorname-dn--right--) - - [Inverse Jacobi Elliptic Function $\left(\operatorname{sd}\right)$](#inverse-jacobi-elliptic-function---left--operatorname-sd--right--) - - [Inverse Jacobi Elliptic Function $\left(\operatorname{cd}\right)$](#inverse-jacobi-elliptic-function---left--operatorname-cd--right--) - - [Inverse Jacobi Elliptic Function $\left(\operatorname{sc}\right)$](#inverse-jacobi-elliptic-function---left--operatorname-sc--right--) - + [Weierstrass Elliptic Functions](#weierstrass-elliptic-functions) - - [Weierstrass Elliptic Function (p)](#weierstrass-elliptic-function--p-) - - [Weierstrass Elliptic Function (\zeta)](#weierstrass-elliptic-function---zeta-) - - [Weierstrass Elliptic Function (\sigma)](#weierstrass-elliptic-function---sigma-) - + [Modular Functions](#modular-functions) - - [Elliptic Function (\lambda)](#elliptic-function---lambda-) - - [Klein’s Complete Invariant Function](#klein-s-complete-invariant-function) - + [Bernoulli Number and Polynomial](#bernoulli-number-and-polynomial) - - [Bernoulli Number](#bernoulli-number) - - [Bernoulli Polynomial](#bernoulli-polynomial) - + [Euler Number and Polynomial](#euler-number-and-polynomial) - - [Euler Number](#euler-number) - - [Euler Polynomial](#euler-polynomial) - + [Zeta and Related Functions](#zeta-and-related-functions) - - [Riemann Zeta Function](#riemann-zeta-function) - - [Hurwitz Zeta Function](#hurwitz-zeta-function) - - [Polylogarithm](#polylogarithm) - - [Lerch Zeta Function](#lerch-zeta-function) - - [Lerch Transcendent](#lerch-transcendent) - - [Dirichlet L-Function](#dirichlet-l-function) - - [Dirichlet Beta Function](#dirichlet-beta-function) - - [Dirichlet Eta Function](#dirichlet-eta-function) - - [Dirichlet Lambda Function](#dirichlet-lambda-function) - - [Stieltjes Constant](#stieltjes-constant) - + [Multiplicative Number Theoretic Functions](#multiplicative-number-theoretic-functions) - - [Prime Number](#prime-number) - - [Euler’s Totient Function](#euler-s-totient-function) - - [Divisor Function](#divisor-function) - - [Jordan’s Totient Function](#jordan-s-totient-function) - - [Möbius Function](#m-bius-function) - - [Liouville Function](#liouville-function) - + [Matthieu Characteristic Values](#matthieu-characteristic-values) - - [Matthieu Characteristic Value $\left(a\right)$](#matthieu-characteristic-value---left-a-right--) - - [Matthieu Characteristic Value $\left(b\right)$](#matthieu-characteristic-value---left-b-right--) - + [Angular Matthieu Functions](#angular-matthieu-functions) - - [Angular Matthieu Function ($\operatorname{ce}$)](#angular-matthieu-function----operatorname-ce---) - - [Angular Matthieu Function ($\operatorname{se}$)](#angular-matthieu-function----operatorname-se---) - + [Radial Mathieu Functions](#radial-mathieu-functions) - - [Radial Matthieu Function ($\operatorname{M}c$)](#radial-matthieu-function----operatorname-m-c--) - - [Radial Matthieu Function ($\operatorname{M}s$)](#radial-matthieu-function----operatorname-m-s--) - + [Lamé Functions](#lam--functions) - - [Lamé Function $\left(Ec_{n}^{j}\right)$](#lam--function---left-ec--n---j--right--) - - [Derivative of the Lamé Function $\left(Ec_{n}^{j}\right)$](#derivative-of-the-lam--function---left-ec--n---j--right--) - - [Lamé Function $\left(Es_{n}^{j}\right)$](#lam--function---left-es--n---j--right--) - - [Derivative of the Lamé Function $\left(Es_{n}^{j}\right)$](#derivative-of-the-lam--function---left-es--n---j--right--) - + [Heun Functions](#heun-functions) - - [Heun Function](#heun-function) - - [Derivative of the Heun Function](#derivative-of-the-heun-function) - - [Confluent Heun Function](#confluent-heun-function) - - [Derivative of the Confluent Heun Function](#derivative-of-the-confluent-heun-function) - - [Doubly-Confluent Heun Function](#doubly-confluent-heun-function) - - [Derivative of the Doubly-Confluent Heun Function](#derivative-of-the-doubly-confluent-heun-function) - - [Bi-Confluent Heun Function](#bi-confluent-heun-function) - - [Derivative of the Bi-Confluent Heun Function](#derivative-of-the-bi-confluent-heun-function) - - [Tri-Confluent Heun Function](#tri-confluent-heun-function) - - [Derivative of the Tri-Confluent Heun Function](#derivative-of-the-tri-confluent-heun-function) - + [Coulomb Wave Functions](#coulomb-wave-functions) - - [Coulomb Wave Function](#coulomb-wave-function) - - [Irregular Coulomb Wave Function](#irregular-coulomb-wave-function) - - [Outgoing Irregular Coulomb Wave Function](#outgoing-irregular-coulomb-wave-function) - - [Incoming Irregular Coulomb Wave Function](#incoming-irregular-coulomb-wave-function) -* [Prior Art](#prior-art) - + [Cephes Mathematical Library](#cephes-mathematical-library) - + [specfun](#specfun) - + [Wolfram Language](#wolfram-language) - + [MATLAB](#matlab) - + [International Mathematics and Statistics Library (IMSL)](#international-mathematics-and-statistics-library--imsl-) - + [NAG Numerical Library](#nag-numerical-library) - + [GNU Octave](#gnu-octave) - + [GNU Scientific Library (GSL)](#gnu-scientific-library--gsl-) - + [SciPy](#scipy) - - ## Summary This proposal concerns adding new operators to PyTorch's special functions module (i.e., `torch.special`). The proposed operators have a wide range of use in scientific computing and numerical methods. From da665d91ceca4eed841ea70a063771c0272ea7b2 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 12:57:02 -0400 Subject: [PATCH 035/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index f6caac2d..2203c342 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2742,19 +2742,21 @@ appell_f_4( ```Python chebyshev_polynomial_t( n: Tensor, - x: Tensor, + z: Tensor, *, out: Optional[Tensor] = None, ) -> Tensor ``` -Chebyshev polynomial of the first kind, $T_{n}(x).$ +Chebyshev polynomial of the first kind: + +$$T_n(z)=\frac{\delta _{n,0}}{2}+\frac{1}{2} n \sum _{k=1}^{\left\lfloor\frac{n}{2}\right\rfloor } \frac{(-1)^k (n-k-1)! (2 z)^{n-2 k}}{k! (n-2 k)!}+2^{n-1}z^n.$$ ##### Parameters **n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – ##### Keyword Arguments From 24dbe8f09e8d9db22e3ae039f131c4c3eec34763 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 12:58:25 -0400 Subject: [PATCH 036/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 2203c342..f907bc2e 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2748,7 +2748,7 @@ chebyshev_polynomial_t( ) -> Tensor ``` -Chebyshev polynomial of the first kind: +Chebyshev polynomial of the first kind, if, and only if, $n \in \mathbb{N}:$ $$T_n(z)=\frac{\delta _{n,0}}{2}+\frac{1}{2} n \sum _{k=1}^{\left\lfloor\frac{n}{2}\right\rfloor } \frac{(-1)^k (n-k-1)! (2 z)^{n-2 k}}{k! (n-2 k)!}+2^{n-1}z^n.$$ From ab94fdc4ed4fe768fe3489b78d4cbc737dd45f5d Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:01:56 -0400 Subject: [PATCH 037/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index f907bc2e..af5a7a7c 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2773,7 +2773,9 @@ chebyshev_polynomial_u( ) -> Tensor ``` -Chebyshev polynomial of the second kind, $U_{n}(x).$ +Chebyshev polynomial of the second kind: + +$$U_n(z)=\sum _{k=0}^{\left\lfloor \frac{n}{2}\right\rfloor } \frac{(-1)^k (n-k)! (2 z)^{n-2 k}}{k! (n-2 k)!}.$$ ##### Parameters From dd38d8311d5bb98e2ae638d77950f32225cd8cc9 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:03:36 -0400 Subject: [PATCH 038/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index af5a7a7c..7efc7360 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2767,13 +2767,13 @@ $$T_n(z)=\frac{\delta _{n,0}}{2}+\frac{1}{2} n \sum _{k=1}^{\left\lfloor\frac{n} ```Python chebyshev_polynomial_u( n: Tensor, - x: Tensor, + z: Tensor, *, out: Optional[Tensor] = None, ) -> Tensor ``` -Chebyshev polynomial of the second kind: +Chebyshev polynomial of the second kind, if, and only if $n \in \mathbb{Z} \wedge n \geq 0$: $$U_n(z)=\sum _{k=0}^{\left\lfloor \frac{n}{2}\right\rfloor } \frac{(-1)^k (n-k)! (2 z)^{n-2 k}}{k! (n-2 k)!}.$$ @@ -2781,7 +2781,7 @@ $$U_n(z)=\sum _{k=0}^{\left\lfloor \frac{n}{2}\right\rfloor } \frac{(-1)^k (n-k) **n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -**x** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – ##### Keyword Arguments From 913dcc7b516394b71da164bd152bbc2492bc5765 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:05:07 -0400 Subject: [PATCH 039/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 7efc7360..4b4501f2 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2748,7 +2748,7 @@ chebyshev_polynomial_t( ) -> Tensor ``` -Chebyshev polynomial of the first kind, if, and only if, $n \in \mathbb{N}:$ +Chebyshev polynomial of the first kind, if, and only if $n \in \mathbb{N} \wedge n \geq 0$: $$T_n(z)=\frac{\delta _{n,0}}{2}+\frac{1}{2} n \sum _{k=1}^{\left\lfloor\frac{n}{2}\right\rfloor } \frac{(-1)^k (n-k-1)! (2 z)^{n-2 k}}{k! (n-2 k)!}+2^{n-1}z^n.$$ @@ -2773,7 +2773,7 @@ chebyshev_polynomial_u( ) -> Tensor ``` -Chebyshev polynomial of the second kind, if, and only if $n \in \mathbb{Z} \wedge n \geq 0$: +Chebyshev polynomial of the second kind, if, and only if $n \in \mathbb{N} \wedge n \geq 0$: $$U_n(z)=\sum _{k=0}^{\left\lfloor \frac{n}{2}\right\rfloor } \frac{(-1)^k (n-k)! (2 z)^{n-2 k}}{k! (n-2 k)!}.$$ From 8986f8a5ed82ed740458d94c5d7b4dd5edbd4213 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:05:46 -0400 Subject: [PATCH 040/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 4b4501f2..0c5c01b7 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2748,7 +2748,7 @@ chebyshev_polynomial_t( ) -> Tensor ``` -Chebyshev polynomial of the first kind, if, and only if $n \in \mathbb{N} \wedge n \geq 0$: +Chebyshev polynomial of the first kind, if, and only if, $n \in \mathbb{N} \wedge n \geq 0$: $$T_n(z)=\frac{\delta _{n,0}}{2}+\frac{1}{2} n \sum _{k=1}^{\left\lfloor\frac{n}{2}\right\rfloor } \frac{(-1)^k (n-k-1)! (2 z)^{n-2 k}}{k! (n-2 k)!}+2^{n-1}z^n.$$ @@ -2773,7 +2773,7 @@ chebyshev_polynomial_u( ) -> Tensor ``` -Chebyshev polynomial of the second kind, if, and only if $n \in \mathbb{N} \wedge n \geq 0$: +Chebyshev polynomial of the second kind, if, and only if, $n \in \mathbb{N} \wedge n \geq 0$: $$U_n(z)=\sum _{k=0}^{\left\lfloor \frac{n}{2}\right\rfloor } \frac{(-1)^k (n-k)! (2 z)^{n-2 k}}{k! (n-2 k)!}.$$ From c2af690e68cf9b1a2994d560cf9537ae254b3e80 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:07:34 -0400 Subject: [PATCH 041/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 0c5c01b7..6405df43 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2750,7 +2750,9 @@ chebyshev_polynomial_t( Chebyshev polynomial of the first kind, if, and only if, $n \in \mathbb{N} \wedge n \geq 0$: -$$T_n(z)=\frac{\delta _{n,0}}{2}+\frac{1}{2} n \sum _{k=1}^{\left\lfloor\frac{n}{2}\right\rfloor } \frac{(-1)^k (n-k-1)! (2 z)^{n-2 k}}{k! (n-2 k)!}+2^{n-1}z^n.$$ +$$T_n(z)=\frac{\delta _{n,0}}{2}+\frac{1}{2} n \sum _{k=1}^{\left\lfloor\frac{n}{2}\right\rfloor } \frac{(-1)^k (n-k-1)! (2 z)^{n-2 k}}{k! (n-2 k)!}+2^{n-1}z^n,$$ + +where $\delta$ is the Kronecker delta function. ##### Parameters From 1ae47cceec8ea3140b1c326ee3879f685768f014 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:16:43 -0400 Subject: [PATCH 042/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 6405df43..fc0ae234 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2545,7 +2545,32 @@ $${\displaystyle W_{\kappa ,\mu }(z)=\exp (-z/2)z^{\mu +{\tfrac {1}{2}}}U(\mu -\ #### Legendre Function of the First Kind +```Python +legendre_p( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre function of the first kind: + +$$P_{n}(z)=_{2}F_{1}\left(-n,n+1;1;\frac{1-z}{2}\right).$$ + #### Legendre Function of the Second Kind + +```Python +legendre_q( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Legendre function of the second kind: +
From 08a48a23c73206d9687b4ad119f839e1013cb05d Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:17:27 -0400 Subject: [PATCH 043/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index fc0ae234..a8c5d1f7 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2556,7 +2556,7 @@ legendre_p( Legendre function of the first kind: -$$P_{n}(z)=_{2}F_{1}\left(-n,n+1;1;\frac{1-z}{2}\right).$$ +$$P_{n}(z)= _2F_1 \left(-n,n+1;1;\frac{1-z}{2}\right).$$ #### Legendre Function of the Second Kind From b5c28f0a31e020dd8206b11cee4aee63ac0f364e Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:19:28 -0400 Subject: [PATCH 044/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index a8c5d1f7..b7fb1faf 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2556,7 +2556,7 @@ legendre_p( Legendre function of the first kind: -$$P_{n}(z)= _2F_1 \left(-n,n+1;1;\frac{1-z}{2}\right).$$ +$$P_{n}(z)=\operatorname{_2F_2}\left(-n,n+1;1;\frac{1-z}{2}\right).$$ #### Legendre Function of the Second Kind From 2423bfe45cadbd15b0f1b10b170f056d56285c43 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:21:03 -0400 Subject: [PATCH 045/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index b7fb1faf..5260bf23 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2571,6 +2571,7 @@ legendre_q( Legendre function of the second kind: +$$Q_{n}(z)=Q_{n}^0(z).$$
From 6f66d87f5298a7a9e21cbaec511b7090c95a6f88 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:22:15 -0400 Subject: [PATCH 046/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 5260bf23..18d0b207 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2556,7 +2556,9 @@ legendre_p( Legendre function of the first kind: -$$P_{n}(z)=\operatorname{_2F_2}\left(-n,n+1;1;\frac{1-z}{2}\right).$$ +$$P_{n}(z)=\operatorname{_2F_2}\left(-n,n+1;1;\frac{1-z}{2}\right),$$ + +where $\operatorname{_2F_2}$ is the #### Legendre Function of the Second Kind @@ -2571,7 +2573,9 @@ legendre_q( Legendre function of the second kind: -$$Q_{n}(z)=Q_{n}^0(z).$$ +$$Q_{n}(z)=Q_{n}^0(z),$$ + +where $Q_{n}^0$ is the
From 6c93034ba020cadd4893342312bc16e946f46270 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:23:52 -0400 Subject: [PATCH 047/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 18d0b207..9d67cdc5 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2575,7 +2575,7 @@ Legendre function of the second kind: $$Q_{n}(z)=Q_{n}^0(z),$$ -where $Q_{n}^0$ is the +where $Q_{n}^m$ is the associated Legendre of the second kind.
From c9b727a96bda83bfa4f63e1b26db25566379c386 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:24:16 -0400 Subject: [PATCH 048/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 9d67cdc5..ef0bdc08 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2575,7 +2575,7 @@ Legendre function of the second kind: $$Q_{n}(z)=Q_{n}^0(z),$$ -where $Q_{n}^m$ is the associated Legendre of the second kind. +where $Q_{n}^m$ is the associated Legendre function of the second kind.
From 7031c34163288c04fef2a1816f135d4119aed304 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:26:24 -0400 Subject: [PATCH 049/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index ef0bdc08..fac4ae78 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2558,7 +2558,17 @@ Legendre function of the first kind: $$P_{n}(z)=\operatorname{_2F_2}\left(-n,n+1;1;\frac{1-z}{2}\right),$$ -where $\operatorname{_2F_2}$ is the +where $\operatorname{_2F_2}$ is the generalized hypergeometric function. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. #### Legendre Function of the Second Kind @@ -2576,6 +2586,16 @@ Legendre function of the second kind: $$Q_{n}(z)=Q_{n}^0(z),$$ where $Q_{n}^m$ is the associated Legendre function of the second kind. + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output.
From 8c665b7471388ef1c35930267fcddf51ea29332a Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:30:53 -0400 Subject: [PATCH 050/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index fac4ae78..2a3ae6b5 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2605,7 +2605,53 @@ where $Q_{n}^m$ is the associated Legendre function of the second kind. #### Associated Legendre Function of the First Kind +```Python +associated_legendre_p( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Associated Legendre function of the first kind: + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + #### Associated Legendre Function of the Second Kind + +```Python +associated_legendre_q( + n: Tensor, + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Associated Legendre function of the second kind: + +##### Parameters + +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**m** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output.
From 8aa81c7d235a4522afa09806048e18558dbd301b Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:33:41 -0400 Subject: [PATCH 051/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 2a3ae6b5..10694e11 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2657,6 +2657,14 @@ Associated Legendre function of the second kind:
Ferrers Functions +
+Legendre Polynomial + +### Legendre Polynomial + +#### Legendre Polynomial +
+ ### Ferrers Functions #### Ferrers Function of the First Kind From f070f164409e25d2b217945533b0cfc0e5aa0287 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:34:28 -0400 Subject: [PATCH 052/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 10694e11..c59b8f74 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2654,9 +2654,6 @@ Associated Legendre function of the second kind: **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output.
-
-Ferrers Functions -
Legendre Polynomial @@ -2665,6 +2662,9 @@ Associated Legendre function of the second kind: #### Legendre Polynomial
+
+Ferrers Functions + ### Ferrers Functions #### Ferrers Function of the First Kind From a0b165709503090de7f16a5b2253efd3502a1f37 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:35:19 -0400 Subject: [PATCH 053/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index c59b8f74..5c53465e 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2654,14 +2654,6 @@ Associated Legendre function of the second kind: **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output.
-
-Legendre Polynomial - -### Legendre Polynomial - -#### Legendre Polynomial -
-
Ferrers Functions @@ -2836,6 +2828,14 @@ appell_f_4( #### $q$-Polygamma Function
+
+Legendre Polynomial + +### Legendre Polynomial + +#### Legendre Polynomial +
+
Chebyshev Polynomials From a2c765e24bdee5a093173879646c457241085b71 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:36:32 -0400 Subject: [PATCH 054/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 5c53465e..f1aa3d0c 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2829,9 +2829,9 @@ appell_f_4(
-Legendre Polynomial +Orthogonal Polynomials -### Legendre Polynomial +### Orthogonal Polynomials #### Legendre Polynomial
From ebfb22154b806de802311eafe166b358c96e47c9 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:37:49 -0400 Subject: [PATCH 055/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index f1aa3d0c..9ff76c79 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2834,6 +2834,8 @@ appell_f_4( ### Orthogonal Polynomials #### Legendre Polynomial + +#### Laguerre Polynomial
From 917ec0841204853276d4d87fc22e34421ad97d97 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:39:37 -0400 Subject: [PATCH 056/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 9ff76c79..af73d46d 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3661,6 +3661,16 @@ inverse_jacobi_elliptic_sc( #### Weierstrass Elliptic Function (\sigma)
+
+Inverse Weierstrass Elliptic Functions + +### Inverse Weierstrass Elliptic Functions + +#### Inverse Weierstrass Elliptic Function (p) + +#### Inverse Weierstrass Elliptic Function (q) +
+
Modular Functions From 476e80e93af087a9f5e5e3481db672929df60950 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:47:11 -0400 Subject: [PATCH 057/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index af73d46d..cf66508e 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2323,7 +2323,7 @@ struve_h( Struve function: -$$\mathbf{H}_{n}(z) = \sum_{m = 0}^{\infty}{\frac {(-1)^{m}}{\Gamma (m+{\frac {3}{2}})\Gamma (m+n +{\frac {3}{2}})}}({\frac {z}{2}})^{2m+n +1}.$$ +$$\mathbf{H}_{n}(z)=\left(\frac{z}{2}\right)^{n+1} \sum _{k=0}^{\infty } \frac{(-1)^k \left(\frac{z}{2}\right)^{2 k}}{\Gamma \left(k+\frac{3}{2}\right) \Gamma \left(k+\nu +\frac{3}{2}\right)},$$ where $\Gamma(z)$ is the gamma function. From 5d86a3b9a17b2b0bee78eca1c7500c4cfbddc045 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:48:05 -0400 Subject: [PATCH 058/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index cf66508e..3f478dca 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2323,7 +2323,7 @@ struve_h( Struve function: -$$\mathbf{H}_{n}(z)=\left(\frac{z}{2}\right)^{n+1} \sum _{k=0}^{\infty } \frac{(-1)^k \left(\frac{z}{2}\right)^{2 k}}{\Gamma \left(k+\frac{3}{2}\right) \Gamma \left(k+\nu +\frac{3}{2}\right)},$$ +$$\mathbf{H}_{n}(z)=\left(\frac{z}{2}\right)^{n+1} \sum _{k=0}^{\infty } \frac{(-1)^k \left(\frac{z}{2}\right)^{2 k}}{\Gamma \left(k+\frac{3}{2}\right) \Gamma \left(k+n+\frac{3}{2}\right)},$$ where $\Gamma(z)$ is the gamma function. From 240e37842fbbd243efa4c15b23134a55b07c1b5b Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:49:34 -0400 Subject: [PATCH 059/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 3f478dca..3f693c8a 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2350,7 +2350,7 @@ struve_l( Modified Struve function: -$$\mathbf {L} _{n }(z)=\sum _{m=0}^{\infty }{\frac {1}{\Gamma (m+{\frac {3}{2}})\Gamma (m+n +{\frac {3}{2}})}}({\frac {z}{2}})^{2m+n +1}.$$ +$$\mathbf{L}_{n}(z)=\left(\frac{z}{2}\right)^{n+1} \sum _{k=0}^{\infty } \frac{\left(\frac{z}{2}\right)^{2 k}}{\Gamma \left(k+\frac{3}{2}\right) \Gamma \left(k+n+\frac{3}{2}\right)},$$ where $\Gamma(z)$ is the gamma function. From ed67d6eb660436b46969c89aa955146eea8a35a5 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:51:48 -0400 Subject: [PATCH 060/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 3f693c8a..a175dc27 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2329,9 +2329,9 @@ where $\Gamma(z)$ is the gamma function. ##### Parameters -**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. -**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. ##### Keyword Arguments @@ -2340,7 +2340,7 @@ where $\Gamma(z)$ is the gamma function. #### Modified Struve Function ```Python -struve_l( +modified_struve_l( n: Tensor, z: Tensor, *, @@ -2356,9 +2356,9 @@ where $\Gamma(z)$ is the gamma function. ##### Parameters -**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – +**n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – order. If $z$ is a number, $n$ must be a tensor. -**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – input. If $z$ is a number, $n$ must be a tensor. ##### Keyword Arguments From 978502cb088d602ce0cd7dc35a8e6561e18aab98 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:55:49 -0400 Subject: [PATCH 061/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index a175dc27..68755087 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2370,6 +2370,10 @@ where $\Gamma(z)$ is the gamma function. ### Lommel Functions +Functions defined as the solutions to the Lommel differential equation: + +$$z^{2}{\frac {d^{2}y}{dz^{2}}}+z{\frac {dy}{dz}}+(z^{2}-\nu ^{2})y=z^{\mu +1}.$$ + #### Lommel Function of the First Kind #### Lommel Function of the Second Kind From 2575ad0967eeeeaf66f8dd332cf6797b998beaed Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 13:57:05 -0400 Subject: [PATCH 062/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 68755087..7bb294a0 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2372,7 +2372,7 @@ where $\Gamma(z)$ is the gamma function. Functions defined as the solutions to the Lommel differential equation: -$$z^{2}{\frac {d^{2}y}{dz^{2}}}+z{\frac {dy}{dz}}+(z^{2}-\nu ^{2})y=z^{\mu +1}.$$ +$$z^{2}{\frac{d^{2}y}{dz^{2}}}+z{\frac{dy}{dz}}+(z^{2}-n^{2})y=z^{m+1}.$$ #### Lommel Function of the First Kind From 0e950ebb451585fabcd3e608e307104280e08725 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 14:03:00 -0400 Subject: [PATCH 063/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 7bb294a0..ffac3ffa 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2438,7 +2438,9 @@ $$\mathbf{E}_{n}(z)={\frac{1}{\pi}}\int_{0}^{\pi}\sin(n\theta-z\sin \theta )d\th
Parabolic Cylinder Function -### Parabolic Cylinder Function +### Parabolic Cylinder Functions + +#### Parabolic Cylinder Function ```Python parabolic_cylinder_d( From 88e68748231cb75c1bff06949d367ae4469f40b7 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 4 Nov 2022 14:03:36 -0400 Subject: [PATCH 064/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index ffac3ffa..b122647d 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2436,7 +2436,7 @@ $$\mathbf{E}_{n}(z)={\frac{1}{\pi}}\int_{0}^{\pi}\sin(n\theta-z\sin \theta )d\th
-Parabolic Cylinder Function +Parabolic Cylinder Functions ### Parabolic Cylinder Functions From 1a305f8b896c67f7e0510878f3f635345ec40b7f Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 17:49:25 -0500 Subject: [PATCH 065/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index b122647d..78c55f36 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -669,6 +669,10 @@ polygamma( ) -> Tensor ``` +Polygamma function: + +$$\psi^{n}(z)=(-1)^{n+1} n! \sum _{k=0}^{\infty }\frac{1}{(k+z)^{n+1}}.$$ + ##### Parameters **n** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor) *or Number*) – derivative. @@ -691,7 +695,7 @@ digamma( Digamma function: -$$\psi(z)=\sum_{k=1}^{\infty}\left(\frac{1}{k}-\frac{1}{k+z-1}\right)-\gamma.$$ +$$\psi(z)=\sum _{k=1}^{\infty } \left(\frac{1}{k}-\frac{1}{k+z-1}\right)-\gamma.$$ ##### Parameters From 459449a304a970b01ca39c5dc7a5680e64a2ed93 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 17:50:38 -0500 Subject: [PATCH 066/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 78c55f36..fbad3d32 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -669,7 +669,7 @@ polygamma( ) -> Tensor ``` -Polygamma function: +Polygamma function, if, and only if, $n \in \mathbb{Z} \land n > 0$: $$\psi^{n}(z)=(-1)^{n+1} n! \sum _{k=0}^{\infty }\frac{1}{(k+z)^{n+1}}.$$ From 4c9bda7e1c8ebc4f6b672ace35dd3b20f6c88fdd Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 17:54:56 -0500 Subject: [PATCH 067/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index fbad3d32..90c7b338 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -733,6 +733,10 @@ ln_gamma( ) -> Tensor ``` +Natural logarithm of the gamma function: + +$$\log{\Gamma}(z)=\sum _{k=1}^{\infty } \left(\frac{z}{k}-\log \left(1+\frac{z}{k}\right)\right)-\gamma z-\log (z).$$ + ##### Parameters **z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. From fcca2c923968955deeabfb4b0570c5ea3230c037 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 17:55:40 -0500 Subject: [PATCH 068/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 90c7b338..5d647d49 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -726,14 +726,14 @@ trigamma( #### Natural Logarithm of the Gamma Function ```Python -ln_gamma( +log_gamma( z: Tensor, *, out: Optional[Tensor] = None, ) -> Tensor ``` -Natural logarithm of the gamma function: +Logarithm of the gamma function: $$\log{\Gamma}(z)=\sum _{k=1}^{\infty } \left(\frac{z}{k}-\log \left(1+\frac{z}{k}\right)\right)-\gamma z-\log (z).$$ From b97f420f7713779bfacb4c2b5c7bc0de2d2bfdda Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 17:56:05 -0500 Subject: [PATCH 069/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 5d647d49..7820d402 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -723,7 +723,7 @@ trigamma( **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Natural Logarithm of the Gamma Function +#### Logarithm of the Gamma Function ```Python log_gamma( From a231b0787e4c2832a9b099f1838435cb72fb0907 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 17:57:19 -0500 Subject: [PATCH 070/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 7820d402..dc9770d3 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -790,10 +790,10 @@ where $\Gamma$ is the gamma function. **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Natural Logarithm of the Beta Function +#### Logarithm of the Beta Function ```Python -ln_beta( +log_beta( a: Tensor, b: Tensor, *, From eb4aee635deb9b175d1b7ceca327a5921ff8dc0a Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:06:38 -0500 Subject: [PATCH 071/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index dc9770d3..24eb2fd8 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3954,7 +3954,7 @@ liouville_lambda(
Matthieu Characteristic Values -### Matthieu Characteristic Values +### Mathieu Characteristic Values #### Matthieu Characteristic Value $\left(a\right)$ @@ -3982,11 +3982,13 @@ matthieu_characteristic_b(
Angular Matthieu Functions -### Angular Matthieu Functions +### Angular Mathieu Functions -#### Angular Matthieu Function ($\operatorname{ce}$) +#### Angular Mathieu Function ($\operatorname{ce}$) -#### Angular Matthieu Function ($\operatorname{se}$) +Even Mathieu function: + +#### Angular Mathieu Function ($\operatorname{se}$)
From 47c60e35bd0556e2eafe650e243017a31f585226 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:15:44 -0500 Subject: [PATCH 072/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 24eb2fd8..33d975c9 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3441,6 +3441,10 @@ theta_1( ) -> Tensor ``` +Theta function: + +$$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin ((2 k+1) z).$$ + ##### Parameters **z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – From ae06feecbea9dfda6bcab6664ebebb386b0e4c9f Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:16:59 -0500 Subject: [PATCH 073/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 33d975c9..3ed3b02e 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3466,6 +3466,10 @@ theta_2( ) -> Tensor ``` +Theta function: + +$$\vartheta _2(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } q^{k (k+1)} \cos ((2 k+1) z).$$ + ##### Parameters **z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – From 095c84c61aa352b1d82b15b86e3037a05f9a740e Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:18:27 -0500 Subject: [PATCH 074/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 3ed3b02e..e044dbcb 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3491,6 +3491,10 @@ theta_3( ) -> Tensor ``` +Theta function: + +$$\vartheta _3(z,q)=1+2 \sum _{k=1}^{\infty } q^{k^2} \cos (2 k z).$$ + ##### Parameters **z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – From 8c6596f00d97b20f5fe9aed92dc3af4315a4dafc Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:19:51 -0500 Subject: [PATCH 075/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index e044dbcb..753448f8 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3516,6 +3516,10 @@ theta_4( ) -> Tensor ``` +Theta function: + +$$\vartheta _4(z,q)=1+2 \sum _{k=1}^{\infty } (-1)^k q^{k^2} \cos (2 k z).$$ + ##### Parameters **z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – From 15ed06863f7dd3370d4d1a6277378dd7907563f6 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:20:52 -0500 Subject: [PATCH 076/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 753448f8..ccdd07ce 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3435,7 +3435,7 @@ carlson_elliptic_integral_r_m( ```Python theta_1( z: Tensor, - t: Tensor, + q: Tensor, *, out: Optional[Tensor] = None, ) -> Tensor @@ -3460,7 +3460,7 @@ $$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin ```Python theta_2( z: Tensor, - t: Tensor, + q: Tensor, *, out: Optional[Tensor] = None, ) -> Tensor @@ -3485,7 +3485,7 @@ $$\vartheta _2(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } q^{k (k+1)} \cos ((2 k+1 ```Python theta_3( z: Tensor, - t: Tensor, + q: Tensor, *, out: Optional[Tensor] = None, ) -> Tensor @@ -3510,7 +3510,7 @@ $$\vartheta _3(z,q)=1+2 \sum _{k=1}^{\infty } q^{k^2} \cos (2 k z).$$ ```Python theta_4( z: Tensor, - t: Tensor, + q: Tensor, *, out: Optional[Tensor] = None, ) -> Tensor From 448ee8826aea580dc43bbc351372d7090bce1aa8 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:21:19 -0500 Subject: [PATCH 077/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index ccdd07ce..eeda553f 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3449,7 +3449,7 @@ $$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin **z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -**t** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – ##### Keyword Arguments @@ -3474,7 +3474,7 @@ $$\vartheta _2(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } q^{k (k+1)} \cos ((2 k+1 **z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -**t** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – ##### Keyword Arguments @@ -3499,7 +3499,7 @@ $$\vartheta _3(z,q)=1+2 \sum _{k=1}^{\infty } q^{k^2} \cos (2 k z).$$ **z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -**t** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – ##### Keyword Arguments @@ -3524,7 +3524,7 @@ $$\vartheta _4(z,q)=1+2 \sum _{k=1}^{\infty } (-1)^k q^{k^2} \cos (2 k z).$$ **z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – -**t** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – ##### Keyword Arguments From e6d7638c7e98362c72a39d51e6d13caad1d39af6 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:22:58 -0500 Subject: [PATCH 078/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index eeda553f..9d91d1a6 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3430,7 +3430,7 @@ carlson_elliptic_integral_r_m( ### Theta Functions -#### Theta Function $\left(\theta_{1}\right)$ +#### Theta Function $\vartheta_1\left(z, q\right)$ ```Python theta_1( @@ -3455,7 +3455,7 @@ $$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Theta Function $\left(\theta_{2}\right)$ +#### Theta Function $\vartheta_2\left(z, q\right)$ ```Python theta_2( @@ -3480,7 +3480,7 @@ $$\vartheta _2(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } q^{k (k+1)} \cos ((2 k+1 **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Theta Function $\left(\theta_{3}\right)$ +#### Theta Function $\vartheta_3\left(z, q\right)$ ```Python theta_3( @@ -3505,7 +3505,7 @@ $$\vartheta _3(z,q)=1+2 \sum _{k=1}^{\infty } q^{k^2} \cos (2 k z).$$ **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Theta Function $\left(\theta_{4}\right)$ +#### Theta Function $\vartheta_4\left(z, q\right)$ ```Python theta_4( From 4fa55798aae5f3e2215902926bfa9f566891af86 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:23:40 -0500 Subject: [PATCH 079/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 9d91d1a6..864b6793 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3430,7 +3430,7 @@ carlson_elliptic_integral_r_m( ### Theta Functions -#### Theta Function $\vartheta_1\left(z, q\right)$ +#### Theta Function, $\vartheta_1\left(z, q\right)$ ```Python theta_1( @@ -3455,7 +3455,7 @@ $$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Theta Function $\vartheta_2\left(z, q\right)$ +#### Theta Function, $\vartheta_2\left(z, q\right)$ ```Python theta_2( @@ -3480,7 +3480,7 @@ $$\vartheta _2(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } q^{k (k+1)} \cos ((2 k+1 **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Theta Function $\vartheta_3\left(z, q\right)$ +#### Theta Function, $\vartheta_3\left(z, q\right)$ ```Python theta_3( @@ -3505,7 +3505,7 @@ $$\vartheta _3(z,q)=1+2 \sum _{k=1}^{\infty } q^{k^2} \cos (2 k z).$$ **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Theta Function $\vartheta_4\left(z, q\right)$ +#### Theta Function, $\vartheta_4\left(z, q\right)$ ```Python theta_4( From f33f4278e2a58999959f52febd2401a6119dc9b2 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:24:45 -0500 Subject: [PATCH 080/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 864b6793..9d91d1a6 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3430,7 +3430,7 @@ carlson_elliptic_integral_r_m( ### Theta Functions -#### Theta Function, $\vartheta_1\left(z, q\right)$ +#### Theta Function $\vartheta_1\left(z, q\right)$ ```Python theta_1( @@ -3455,7 +3455,7 @@ $$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Theta Function, $\vartheta_2\left(z, q\right)$ +#### Theta Function $\vartheta_2\left(z, q\right)$ ```Python theta_2( @@ -3480,7 +3480,7 @@ $$\vartheta _2(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } q^{k (k+1)} \cos ((2 k+1 **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Theta Function, $\vartheta_3\left(z, q\right)$ +#### Theta Function $\vartheta_3\left(z, q\right)$ ```Python theta_3( @@ -3505,7 +3505,7 @@ $$\vartheta _3(z,q)=1+2 \sum _{k=1}^{\infty } q^{k^2} \cos (2 k z).$$ **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Theta Function, $\vartheta_4\left(z, q\right)$ +#### Theta Function $\vartheta_4\left(z, q\right)$ ```Python theta_4( From 829b15f2c6c21893efe9cc413336517e01a4dad3 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:25:52 -0500 Subject: [PATCH 081/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 9d91d1a6..6ddd35c6 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3430,7 +3430,7 @@ carlson_elliptic_integral_r_m( ### Theta Functions -#### Theta Function $\vartheta_1\left(z, q\right)$ +#### Theta Function $\left(\vartheta_1\right)$ ```Python theta_1( @@ -3455,7 +3455,7 @@ $$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Theta Function $\vartheta_2\left(z, q\right)$ +#### Theta Function $\left(\vartheta_2\right)$ ```Python theta_2( @@ -3480,7 +3480,7 @@ $$\vartheta _2(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } q^{k (k+1)} \cos ((2 k+1 **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Theta Function $\vartheta_3\left(z, q\right)$ +#### Theta Function $\left(\vartheta_3\right)$ ```Python theta_3( @@ -3505,7 +3505,7 @@ $$\vartheta _3(z,q)=1+2 \sum _{k=1}^{\infty } q^{k^2} \cos (2 k z).$$ **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Theta Function $\vartheta_4\left(z, q\right)$ +#### Theta Function $\left(\vartheta_4\right)$ ```Python theta_4( From ec74536cb945a345c733ce3e6b549af55823d6fb Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:28:37 -0500 Subject: [PATCH 082/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 6ddd35c6..29f197c4 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3455,6 +3455,8 @@ $$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +#### Derivative of Theta Function $\left(\vartheta_1'\right)$ + #### Theta Function $\left(\vartheta_2\right)$ ```Python @@ -3480,6 +3482,8 @@ $$\vartheta _2(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } q^{k (k+1)} \cos ((2 k+1 **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +#### Derivative of Theta Function $\left(\vartheta_2'\right)$ + #### Theta Function $\left(\vartheta_3\right)$ ```Python @@ -3505,6 +3509,8 @@ $$\vartheta _3(z,q)=1+2 \sum _{k=1}^{\infty } q^{k^2} \cos (2 k z).$$ **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +#### Derivative of Theta Function $\left(\vartheta_3'\right)$ + #### Theta Function $\left(\vartheta_4\right)$ ```Python @@ -3534,6 +3540,8 @@ $$\vartheta _4(z,q)=1+2 \sum _{k=1}^{\infty } (-1)^k q^{k^2} \cos (2 k z).$$
Jacobi Elliptic and Related Functions +#### Derivative of Theta Function $\left(\vartheta_4'\right)$ + ### Jacobi Elliptic and Related Functions #### Jacobi Amplitude Function From a0834babd03c73c1c677ba18bc5f4005b46653ad Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:29:39 -0500 Subject: [PATCH 083/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 92 +++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 29f197c4..e1f17485 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3457,6 +3457,29 @@ $$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin #### Derivative of Theta Function $\left(\vartheta_1'\right)$ +```Python +theta_1( + z: Tensor, + q: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Theta function: + +$$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin ((2 k+1) z).$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + #### Theta Function $\left(\vartheta_2\right)$ ```Python @@ -3484,6 +3507,29 @@ $$\vartheta _2(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } q^{k (k+1)} \cos ((2 k+1 #### Derivative of Theta Function $\left(\vartheta_2'\right)$ +```Python +theta_1( + z: Tensor, + q: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Theta function: + +$$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin ((2 k+1) z).$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + #### Theta Function $\left(\vartheta_3\right)$ ```Python @@ -3511,6 +3557,29 @@ $$\vartheta _3(z,q)=1+2 \sum _{k=1}^{\infty } q^{k^2} \cos (2 k z).$$ #### Derivative of Theta Function $\left(\vartheta_3'\right)$ +```Python +theta_1( + z: Tensor, + q: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Theta function: + +$$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin ((2 k+1) z).$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + #### Theta Function $\left(\vartheta_4\right)$ ```Python @@ -3542,6 +3611,29 @@ $$\vartheta _4(z,q)=1+2 \sum _{k=1}^{\infty } (-1)^k q^{k^2} \cos (2 k z).$$ #### Derivative of Theta Function $\left(\vartheta_4'\right)$ +```Python +theta_1( + z: Tensor, + q: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + +Theta function: + +$$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin ((2 k+1) z).$$ + +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +**q** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + ### Jacobi Elliptic and Related Functions #### Jacobi Amplitude Function From 92570884ce318ffc8572381514cc4171f0e718f8 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:32:45 -0500 Subject: [PATCH 084/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index e1f17485..9f549d3b 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3458,7 +3458,7 @@ $$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin #### Derivative of Theta Function $\left(\vartheta_1'\right)$ ```Python -theta_1( +theta_1_prime( z: Tensor, q: Tensor, *, @@ -3466,9 +3466,9 @@ theta_1( ) -> Tensor ``` -Theta function: +Derivative of theta function: -$$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin ((2 k+1) z).$$ +$$\vartheta_1^{\prime}(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} (2 k+1) \cos ((2 k+1) z).$$ ##### Parameters From 49cd3f86240ccc123c15ec7d023b9d17963565e0 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:35:30 -0500 Subject: [PATCH 085/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 9f549d3b..5c351a15 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3508,7 +3508,7 @@ $$\vartheta _2(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } q^{k (k+1)} \cos ((2 k+1 #### Derivative of Theta Function $\left(\vartheta_2'\right)$ ```Python -theta_1( +theta_2_prime( z: Tensor, q: Tensor, *, @@ -3516,9 +3516,9 @@ theta_1( ) -> Tensor ``` -Theta function: +Derivative of theta function: -$$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin ((2 k+1) z).$$ +$$\vartheta _2^{\prime }(z,q)=-2 \sqrt[4]{q} \sum _{k=0}^{\infty } q^{k (k+1)} (2 k+1) \sin ((2 k+1) z).$$ ##### Parameters @@ -3558,7 +3558,7 @@ $$\vartheta _3(z,q)=1+2 \sum _{k=1}^{\infty } q^{k^2} \cos (2 k z).$$ #### Derivative of Theta Function $\left(\vartheta_3'\right)$ ```Python -theta_1( +theta_3_prime( z: Tensor, q: Tensor, *, @@ -3566,9 +3566,9 @@ theta_1( ) -> Tensor ``` -Theta function: +Derivative of theta function: -$$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin ((2 k+1) z).$$ +$$\vartheta_1^{\prime}(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} (2 k+1) \cos ((2 k+1) z).$$ ##### Parameters @@ -3612,7 +3612,7 @@ $$\vartheta _4(z,q)=1+2 \sum _{k=1}^{\infty } (-1)^k q^{k^2} \cos (2 k z).$$ #### Derivative of Theta Function $\left(\vartheta_4'\right)$ ```Python -theta_1( +theta_4_prime( z: Tensor, q: Tensor, *, @@ -3620,9 +3620,9 @@ theta_1( ) -> Tensor ``` -Theta function: +Derivative of theta function: -$$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin ((2 k+1) z).$$ +$$\vartheta_1^{\prime}(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} (2 k+1) \cos ((2 k+1) z).$$ ##### Parameters From ff47b9ba83d3be6a5a9f54eaf26cb74d5bd619be Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:38:14 -0500 Subject: [PATCH 086/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 5c351a15..be51ed5f 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3568,7 +3568,7 @@ theta_3_prime( Derivative of theta function: -$$\vartheta_1^{\prime}(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} (2 k+1) \cos ((2 k+1) z).$$ +$$\vartheta _3^{\prime }(z,q)=-4 \sum _{k=1}^{\infty } q^{k^2} k \sin (2 k z).$$ ##### Parameters From add70f6e7909f8179a62bdff09bea5389b9945a4 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:40:41 -0500 Subject: [PATCH 087/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index be51ed5f..0422b754 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3622,7 +3622,7 @@ theta_4_prime( Derivative of theta function: -$$\vartheta_1^{\prime}(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} (2 k+1) \cos ((2 k+1) z).$$ +$$\vartheta _4^{\prime }(z,q)=-4 \sum _{k=1}^{\infty } (-1)^k k q^{k^2} \sin (2 k z).$$ ##### Parameters From 4d806cafc5966c42df8c406825a9333262090064 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:41:21 -0500 Subject: [PATCH 088/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 0422b754..a4723770 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3604,10 +3604,6 @@ $$\vartheta _4(z,q)=1+2 \sum _{k=1}^{\infty } (-1)^k q^{k^2} \cos (2 k z).$$ ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -
- -
-Jacobi Elliptic and Related Functions #### Derivative of Theta Function $\left(\vartheta_4'\right)$ @@ -3633,6 +3629,10 @@ $$\vartheta _4^{\prime }(z,q)=-4 \sum _{k=1}^{\infty } (-1)^k k q^{k^2} \sin (2 ##### Keyword Arguments **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. +
+ +
+Jacobi Elliptic and Related Functions ### Jacobi Elliptic and Related Functions From c9b7fd17a18db2b59ded38f3c6cd7535b9c31507 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 18:46:47 -0500 Subject: [PATCH 089/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index a4723770..8bdb2d8b 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -3455,7 +3455,7 @@ $$\vartheta _1(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} \sin **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Derivative of Theta Function $\left(\vartheta_1'\right)$ +#### Derivative of the Theta Function $\left(\vartheta_1'\right)$ ```Python theta_1_prime( @@ -3466,7 +3466,7 @@ theta_1_prime( ) -> Tensor ``` -Derivative of theta function: +Derivative of the theta function: $$\vartheta_1^{\prime}(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } (-1)^k q^{k (k+1)} (2 k+1) \cos ((2 k+1) z).$$ @@ -3505,7 +3505,7 @@ $$\vartheta _2(z,q)=2 \sqrt[4]{q} \sum _{k=0}^{\infty } q^{k (k+1)} \cos ((2 k+1 **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Derivative of Theta Function $\left(\vartheta_2'\right)$ +#### Derivative of the Theta Function $\left(\vartheta_2'\right)$ ```Python theta_2_prime( @@ -3516,7 +3516,7 @@ theta_2_prime( ) -> Tensor ``` -Derivative of theta function: +Derivative of the theta function: $$\vartheta _2^{\prime }(z,q)=-2 \sqrt[4]{q} \sum _{k=0}^{\infty } q^{k (k+1)} (2 k+1) \sin ((2 k+1) z).$$ @@ -3555,7 +3555,7 @@ $$\vartheta _3(z,q)=1+2 \sum _{k=1}^{\infty } q^{k^2} \cos (2 k z).$$ **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Derivative of Theta Function $\left(\vartheta_3'\right)$ +#### Derivative of the Theta Function $\left(\vartheta_3'\right)$ ```Python theta_3_prime( @@ -3566,7 +3566,7 @@ theta_3_prime( ) -> Tensor ``` -Derivative of theta function: +Derivative of the theta function: $$\vartheta _3^{\prime }(z,q)=-4 \sum _{k=1}^{\infty } q^{k^2} k \sin (2 k z).$$ @@ -3605,7 +3605,7 @@ $$\vartheta _4(z,q)=1+2 \sum _{k=1}^{\infty } (-1)^k q^{k^2} \cos (2 k z).$$ **out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. -#### Derivative of Theta Function $\left(\vartheta_4'\right)$ +#### Derivative of the Theta Function $\left(\vartheta_4'\right)$ ```Python theta_4_prime( @@ -3616,7 +3616,7 @@ theta_4_prime( ) -> Tensor ``` -Derivative of theta function: +Derivative of the theta function: $$\vartheta _4^{\prime }(z,q)=-4 \sum _{k=1}^{\infty } (-1)^k k q^{k^2} \sin (2 k z).$$ From 71a1165a59313749f74707c689f0e98a191a798d Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 19:07:32 -0500 Subject: [PATCH 090/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 8bdb2d8b..5a61eaab 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2833,6 +2833,10 @@ appell_f_4( #### $q$-Factorial +$q$-factorial: + +$$[n]_q! = \prod^{n - 1}_{i = 0} \left(\textstyle\sum^{i}_{j = 0} q^j\right).$$ + #### $q$-Binomial Coefficient #### $q$-Gamma Function From 9856ff13f7b030e43cb891d79f390d6270036a9c Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 19:08:04 -0500 Subject: [PATCH 091/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 5a61eaab..b31c5120 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -2835,7 +2835,7 @@ appell_f_4( $q$-factorial: -$$[n]_q! = \prod^{n - 1}_{i = 0} \left(\textstyle\sum^{i}_{j = 0} q^j\right).$$ +$$[n]_q! = \prod^{n - 1} _{i = 0} \left(\textstyle\sum^{i} _{j = 0} q^j\right).$$ #### $q$-Binomial Coefficient From 65afb9bd3f43c1c7bb51dfae47899e24039d70be Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 19:12:10 -0500 Subject: [PATCH 092/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index b31c5120..10281ed7 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1532,6 +1532,8 @@ $\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values.
Bessel Functions +### Scorer Functions + ### Bessel Functions #### Bessel Function of the First Kind From c9fcf0b99fcf1980be75e54e32e0aea70e1fb791 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 19:13:11 -0500 Subject: [PATCH 093/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 10281ed7..b251e9ff 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1530,9 +1530,13 @@ $\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values.
-Bessel Functions +Scorer Functions ### Scorer Functions +
+ +
+Bessel Functions ### Bessel Functions From f0c1cf8d437d2cce4ff4bbeb5cf8141ad7daa092 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 19:14:58 -0500 Subject: [PATCH 094/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index b251e9ff..d257e11d 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1530,13 +1530,9 @@ $\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values.
-Scorer Functions +Scorer’s Functions -### Scorer Functions -
- -
-Bessel Functions +### Scorer’s Functions ### Bessel Functions From 08cdf94ac0eba57a35b1760658dcc298a0ca1163 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 19:15:23 -0500 Subject: [PATCH 095/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index d257e11d..2e811e60 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1533,6 +1533,7 @@ $\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values. Scorer’s Functions ### Scorer’s Functions +
### Bessel Functions From 5da6a88895eb56502442f55a46d6e7652f4fc2da Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 19:16:37 -0500 Subject: [PATCH 096/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 2e811e60..bb979494 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1535,6 +1535,9 @@ $\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values. ### Scorer’s Functions
+
+Bessel Functions + ### Bessel Functions #### Bessel Function of the First Kind From 61ac0c1c16022af8f9433705f56d82c0bb92ff6e Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 19:17:38 -0500 Subject: [PATCH 097/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index bb979494..ea316554 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1533,6 +1533,10 @@ $\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values. Scorer’s Functions ### Scorer’s Functions + +#### Scorer’s Function + +#### Scorer’s Function
From 5a205528f0721da8516fe9e6a70d7cb7bedd5910 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 19:19:04 -0500 Subject: [PATCH 098/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index ea316554..611aa2eb 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1534,9 +1534,9 @@ $\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values. ### Scorer’s Functions -#### Scorer’s Function +#### Scorer’s Function $\left(\operatorname{Gi}\right)$ -#### Scorer’s Function +#### Scorer’s Function $\left(\operatorname{Hi}\right)$
From a138d3b46f54dcab4a39fbf0d0cc0a97713061d3 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 19:20:58 -0500 Subject: [PATCH 099/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 611aa2eb..d3fd9bf6 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1537,6 +1537,9 @@ $\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values. #### Scorer’s Function $\left(\operatorname{Gi}\right)$ #### Scorer’s Function $\left(\operatorname{Hi}\right)$ + +$$\mathrm{Hi}(x)=\frac{1}{\pi}\int_0^{\infty} \exp \left( -\dfrac{t^3}{3}+xt\right)\text{d}t.$$ +
From 5db229cb6b7af2b4d60cd8ff0c0d0bdec4ade1c7 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 19:22:55 -0500 Subject: [PATCH 100/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index d3fd9bf6..222d5700 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1536,8 +1536,14 @@ $\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values. #### Scorer’s Function $\left(\operatorname{Gi}\right)$ +Scorer’s function: + +$$\mathrm{Gi}(x)=\frac{1}{\pi}\int_0^{\infty}\sin\left(\frac{t^3}{3}+xt\right)\text{d}t.$$ + #### Scorer’s Function $\left(\operatorname{Hi}\right)$ +Scorer’s function: + $$\mathrm{Hi}(x)=\frac{1}{\pi}\int_0^{\infty} \exp \left( -\dfrac{t^3}{3}+xt\right)\text{d}t.$$
From e376a7393a1aff893fa476fd80b6fce3fc044a4f Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 19:24:10 -0500 Subject: [PATCH 101/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 222d5700..df4acb9c 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1538,13 +1538,13 @@ $\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values. Scorer’s function: -$$\mathrm{Gi}(x)=\frac{1}{\pi}\int_0^{\infty}\sin\left(\frac{t^3}{3}+xt\right)\text{d}t.$$ +$$\mathrm{Gi}(z)=\frac{1}{\pi}\int_0^{\infty}\sin\left(\frac{t^3}{3}+zt\right)\text{d}t.$$ #### Scorer’s Function $\left(\operatorname{Hi}\right)$ Scorer’s function: -$$\mathrm{Hi}(x)=\frac{1}{\pi}\int_0^{\infty} \exp \left( -\dfrac{t^3}{3}+xt\right)\text{d}t.$$ +$$\mathrm{Hi}(z)=\frac{1}{\pi}\int_0^{\infty}\exp\left(-\frac{t^3}{3}+zt\right)\text{d}t.$$
From 9d6f2fcb4b3cdcefa088ef8239127157450a7f7c Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Sun, 6 Nov 2022 19:26:30 -0500 Subject: [PATCH 102/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index df4acb9c..4caa452c 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1536,16 +1536,47 @@ $\exp{(\operatorname{Bi}'(z))}$ is defined for all real and complex values. #### Scorer’s Function $\left(\operatorname{Gi}\right)$ +```Python +scorer_gi( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + Scorer’s function: $$\mathrm{Gi}(z)=\frac{1}{\pi}\int_0^{\infty}\sin\left(\frac{t^3}{3}+zt\right)\text{d}t.$$ +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output. + #### Scorer’s Function $\left(\operatorname{Hi}\right)$ +```Python +scorer_hi( + z: Tensor, + *, + out: Optional[Tensor] = None, +) -> Tensor +``` + Scorer’s function: $$\mathrm{Hi}(z)=\frac{1}{\pi}\int_0^{\infty}\exp\left(-\frac{t^3}{3}+zt\right)\text{d}t.$$ +##### Parameters + +**z** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor)) – input. + +##### Keyword Arguments + +**out** ([Tensor](https://pytorch.org/docs/stable/tensors.html#torch.Tensor), *optional*) – output.
From 85745145def0a9809ec3efa8e8e6f02fd9090e83 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Mon, 7 Nov 2022 10:43:41 -0500 Subject: [PATCH 103/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 4caa452c..d3e7c3fe 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1809,7 +1809,7 @@ modified_bessel_i( Modified Bessel function of the first kind: -$$I_{\nu }(z)=\sum _{k=0}^{\infty } \frac{\left(\frac{z}{2}\right)^{2 k+\nu }}{\Gamma (k+\nu +1) k!}.$$ +$$I_{n}(z)=\sum _{k=0}^{\infty} \frac{\left(\frac{z}{2}\right)^{2k+n}}{\Gamma(k+n+1) k!}.$$ ##### Parameters From d823193453943090403d30233c11fcfaaa199a73 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Mon, 7 Nov 2022 10:44:39 -0500 Subject: [PATCH 104/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index d3e7c3fe..427d6622 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1809,7 +1809,9 @@ modified_bessel_i( Modified Bessel function of the first kind: -$$I_{n}(z)=\sum _{k=0}^{\infty} \frac{\left(\frac{z}{2}\right)^{2k+n}}{\Gamma(k+n+1) k!}.$$ +$$I_{n}(z)=\sum _{k=0}^{\infty} \frac{\left(\frac{z}{2}\right)^{2k+n}}{\Gamma(k+n+1) k!},$$ + +where $\Gamma{\left(z\right) is the gamma function.$ ##### Parameters From 86c77ea143c123d1252c4a110e6fefa8c71c4858 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Mon, 7 Nov 2022 10:44:57 -0500 Subject: [PATCH 105/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 427d6622..7421a7bc 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1811,7 +1811,7 @@ Modified Bessel function of the first kind: $$I_{n}(z)=\sum _{k=0}^{\infty} \frac{\left(\frac{z}{2}\right)^{2k+n}}{\Gamma(k+n+1) k!},$$ -where $\Gamma{\left(z\right) is the gamma function.$ +where $\Gamma{\left(z\right)$ is the gamma function. ##### Parameters From 8f9943885714c2eda15455e6c0667ee1a13573ab Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Mon, 7 Nov 2022 10:45:03 -0500 Subject: [PATCH 106/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 7421a7bc..02f0afce 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1811,7 +1811,7 @@ Modified Bessel function of the first kind: $$I_{n}(z)=\sum _{k=0}^{\infty} \frac{\left(\frac{z}{2}\right)^{2k+n}}{\Gamma(k+n+1) k!},$$ -where $\Gamma{\left(z\right)$ is the gamma function. +where $\Gamma{\left(z\right)}$ is the gamma function. ##### Parameters From 75c0ce1378c9864a0a612ec3329b7d995ffd1db2 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Mon, 7 Nov 2022 10:45:59 -0500 Subject: [PATCH 107/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index 02f0afce..d53f0fda 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1811,7 +1811,7 @@ Modified Bessel function of the first kind: $$I_{n}(z)=\sum _{k=0}^{\infty} \frac{\left(\frac{z}{2}\right)^{2k+n}}{\Gamma(k+n+1) k!},$$ -where $\Gamma{\left(z\right)}$ is the gamma function. +where $n!$ is the $n^{\text{th}}$ factorial and $\Gamma{\left(z\right)}$ is the gamma function. ##### Parameters From be2c25fa830cd85c54a1384e50f1e16b829d710c Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Mon, 7 Nov 2022 10:47:28 -0500 Subject: [PATCH 108/108] Update RFC-00xx-special-functions.md --- RFC-00xx-special-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RFC-00xx-special-functions.md b/RFC-00xx-special-functions.md index d53f0fda..428c66a2 100644 --- a/RFC-00xx-special-functions.md +++ b/RFC-00xx-special-functions.md @@ -1882,7 +1882,7 @@ Modified Bessel function of the second kind: $$K_{n}(z) = \frac{1}{2} \pi i^{n + 1} H_n^{1}(i z),$$ -where $i$ is the imaginary unit and $H_{n}^{1}(z)$ is the Hankel function of the first kind. +where $H_{n}^{1}(z)$ is the Hankel function of the first kind. ##### Parameters