Bessel and Related Functions
Labels: feature, triaged, module: special

# Bessel and Related Functions

A brief proposal for providing a complete suite of Bessel and related functions as PyTorch operators. Enjoy!

One of a five-part series of special functions issues:

- Gamma and Related Functions (#78065)
- Bessel and Related Functions (#76324)
- Orthogonal Polynomials (#80152)
- Elliptic Functions and Integrals (#80157)
-

## API

### Bessel Functions

- [ ] `bessel_j(input: Tensor, n: int = 0) → Tensor`

Bessel function of the first kind, $J_{n}\left(\text{input}\right)$.

- [x] `bessel_j_0(input: Tensor) → Tensor`

Bessel function of the first kind at order $0$, $J_{0}\left(\text{input}\right)$.

- [x] `bessel_j_1(input: Tensor) → Tensor`

Bessel function of the first kind at order $1$, $J_{1}\left(\text{input}\right)$.

- [ ] `bessel_y(input: Tensor, n: int = 0) → Tensor`

Bessel function of the second kind, $Y_{n}\left(\text{input}\right)$.

- [x] `bessel_y_0(input: Tensor) → Tensor`

Bessel function of the second kind at order $0$, $Y_{0}\left(\text{input}\right)$.

- [x] `bessel_y_1(input: Tensor) → Tensor`

Bessel function of the second kind at order $1$, $Y_{1}\left(\text{input}\right)$.

### Modified Bessel Functions

- [ ] `modified_bessel_i(input: Tensor, n: int = 0) → Tensor`

Modified Bessel function of the first kind, $I_{n}\left(\text{input}\right)$.

- [x] `modified_bessel_i_0(input: Tensor) → Tensor`

Modified Bessel function of the first kind at order $0$, $I_{0}\left(\text{input}\right)$.

- [x] `modified_bessel_i_1(input: Tensor) → Tensor`

Modified Bessel function of the first kind at order $1$, $I_{1}\left(\text{input}\right)$.

- [ ] `modified_bessel_k(input: Tensor, n: int = 0) → Tensor`

Modified Bessel function of the second kind, $K_{n}\left(\text{input}\right)$.

- [x] `modified_bessel_k_0(input: Tensor) → Tensor`

Modified Bessel function of the second kind at order $0$, $K_{0}\left(\text{input}\right)$.

- [x] `modified_bessel_k_1(input: Tensor) → Tensor`

Bessel function of the second kind at order $1$, $K_{1}\left(\text{input}\right)$.

### Exponentially Scaled Modified Bessel Functions

- [ ] `scaled_modified_bessel_i(input: Tensor, n: int = 0) → Tensor`

Exponentially scaled modified Bessel function of the first kind:

$$\text{exp}\left(|-\text{input}|\right)I_{n}\left(\text{input}\right)$$

- [ ] `scaled_modified_bessel_i_0(input: Tensor) → Tensor`

Exponentially scaled modified Bessel function of the first kind at order $0$:

$$\text{exp}\left(|-\text{input}|\right)I_{0}\left(\text{input}\right).$$

- [ ] `scaled_modified_bessel_i_1(input: Tensor) → Tensor`

Exponentially scaled modified Bessel function of the first kind at order $1$:

$$\text{exp}\left(|-\text{input}|\right)I_{1}\left(\text{input}\right)$$

- [ ] `scaled_modified_bessel_k(input: Tensor, n: int = 0) → Tensor`

Exponentially scaled modified Bessel function of the second kind:

$$\text{exp}\left(|-\text{input}|\right)K_{n}\left(\text{input}\right)$$

- [ ] `scaled_modified_bessel_k_0(input: Tensor) → Tensor`

Exponentially scaled modified Bessel function of the second kind at order $0$:

$$\text{exp}\left(|-\text{input}|\right)K_{0}\left(\text{input}\right)$$

- [x] `scaled_modified_bessel_k_1(input: Tensor) → Tensor`

Exponentially scaled modified Bessel function of the second kind at order $1$:

$$\text{exp}\left(|-\text{input}|\right)K_{1}\left(\text{input}\right)$$

### Spherical Bessel Functions

- [ ] `spherical_bessel_j(input: Tensor, n: int = 0) → Tensor`

Spherical Bessel function of the first kind, $j_{n}\left(\text{input}\right)$.

- [ ] `spherical_bessel_j_0(input: Tensor) → Tensor`

Spherical Bessel function of the first kind at order $0$, $j_{0}\left(\text{input}\right)$.

- [ ] `spherical_bessel_j_1(input: Tensor) → Tensor`

Spherical Bessel function of the first kind at order $1$, $j_{1}\left(\text{input}\right)$.

- [ ] `spherical_bessel_y(input: Tensor, n: int = 0) → Tensor`

Spherical Bessel function of the second kind $y_{n}\left(\text{input}\right)$.

- [ ] `spherical_bessel_y_0(input: Tensor) → Tensor`

Spherical Bessel function of the second kind at order $0$, $y_{0}\left(\text{input}\right)$.

- [ ] `spherical_bessel_y_1(input: Tensor) → Tensor`

Spherical Bessel function of the second kind at order $1$, $y_{1}\left(\text{input}\right)$.

### Hankel Functions

- [ ] `hankel_1(input: Tensor, a) → Tensor`

Hankel function of the first kind $H_{\alpha}^{1}\left(\text{input}\right)$.

- [ ] `hankel_2(input: Tensor, a) → Tensor`

Hankel function of the second kind $H_{\alpha}^{2}\left(\text{input}\right)$.

### Spherical Hankel Functions

- [ ] `spherical_hankel_1(input: Tensor, a) → Tensor`

Spherical Hankel function of the first kind $h_{\alpha}^{1}\left(\text{input}\right)$.

- [ ] `spherical_hankel_2(input: Tensor, a) → Tensor`

Spherical Hankel function of the second kind $h_{\alpha}^{2}\left(\text{input}\right)$.

### Airy Functions and Derivatives 

- [x] `airy_ai(input: Tensor) → Tensor`

Airy function $\text{Ai}\left(\text{input}\right)$.

- [ ] `airy_bi(input: Tensor) → Tensor`

Airy function $\text{Bi}\left(\text{input}\right)$.

- [ ] `airy_derivative_ai(input: Tensor) → Tensor`

Derivative of Airy function $\text{Ai}'\left(\text{input}\right)$.

- [ ] `airy_derivative_bi(input: Tensor) → Tensor`

Derivative of Airy function $\text{Bi}'\left(\text{input}\right)$.

### Scorer Functions

- [ ] `scorer_gi(input: Tensor) → Tensor`

Scorer function $\text{Gi}\left(\text{input}\right)$.

- [ ] `scorer_hi(input: Tensor) → Tensor`

Scorer function $\text{Hi}\left(\text{input}\right)$.

### Kelvin Functions

- [ ] `kelvin_ber(input: Tensor) → Tensor`

Kelvin function $\text{ber}\left(\text{input}\right)$.

- [ ] `kelvin_bei(input: Tensor) → Tensor`

Kelvin function $\text{bei}\left(\text{input}\right)$.

- [ ] `kelvin_ker(input: Tensor) → Tensor`

Kelvin function $\text{ker}\left(\text{input}\right)$.

- [ ] `kelvin_kei(input: Tensor) → Tensor`

Kelvin function $\text{kei}\left(\text{input}\right)$.