treams.special

Special (mathematical) functions.

Special mathematical functions used in treams. Some functions are reexported from scipy.special. Most functions are available as Numpy universal functions (numpy.ufunc) or as generalized universal functions (Generalized universal function API).

Available functions

Bessel and Hankel functions, with their spherical counterparts, derivatives

hankel1_d(v, z)

Derivative of the Hankel function of the first kind.

hankel2_d(v, z)

Derivative of the Hankel function of the second kind

jv_d(v, z)

Derivative of the Bessel function of the first kind

yv_d(v, z)

Derivative of the Bessel function of the second kind

spherical_hankel1(n, z)

Spherical Hankel function of the first kind

spherical_hankel2(n, z)

Spherical Hankel function of the second kind

spherical_hankel1_d(n, z)

Derivative of the spherical Hankel function of the first kind.

spherical_hankel2_d(n, z)

Derivative of the spherical Hankel function of the second kind

Those functions are just reexported from Scipy. So, one only needs to import this subpackage within treams.

hankel1(v, z[, out])

Hankel function of the first kind.

hankel2(v, z[, out])

Hankel function of the second kind.

jv(v, z[, out])

Bessel function of the first kind of real order and complex argument.

yv(v, z[, out])

Bessel function of the second kind of real order and complex argument.

spherical_jn(n, z[, derivative])

Spherical Bessel function of the first kind or its derivative.

spherical_yn(n, z[, derivative])

Spherical Bessel function of the second kind or its derivative.

Those functions just wrap Scipy functions with special optional arguments to be able to analogously access them like their non-spherical counterparts:

spherical_jn_d(n, z)

Derivative of the spherical Bessel function of the first kind.

spherical_yn_d(n, z)

Derivative of the spherical Bessel function of the second kind.

Scipy functions with enhanced domain

sph_harm(m, l, phi, theta)

Spherical harmonics of real and complex argument

lpmv(m, v, z)

Associated legendre polynomials of real and complex argument

Integrals for the Ewald summation

incgamma(l, z)

Upper incomplete Gamma function of integer and half-integer degree and real and complex argument

intkambe(n, z, eta)

Integral appearing in the accelerated lattice summations

Wigner d- and Wigner D-matrix elements

wignersmalld(l, m, k, theta)

Wigner-d matrix element

wignerd(l, m, k, phi, theta, psi)

Wigner-D matrix element

Wigner 3j-symbols

wigner3j(j1, j2, j3, m1, m2, m3)

Wigner-3j symbol

Vector wave functions

pi_fun(l, m, x)

Angular function pi

tau_fun(l, m, x)

Angular function tau

Spherical waves and translation coefficients

vsh_X(l, m, theta, phi)

Vector spherical harmonic X in spherical coordinates

vsh_Y(l, m, theta, phi)

Vector spherical harmonic Y in spherical coordinates

vsh_Z(l, m, theta, phi)

Vector spherical harmonic Z in spherical coordinates

vsw_M(l, m, x, theta, phi)

Singular vector spherical wave M

vsw_N(l, m, x, theta, phi)

Singular vector spherical wave N

vsw_A(l, m, x, theta, phi, p)

Singular helical vector spherical wave

vsw_rM(l, m, x, theta, phi)

Regular vector spherical wave M

vsw_rN(l, m, x, theta, phi)

Regular vector spherical wave N

vsw_rA(l, m, x, theta, phi, p)

Regular helical vector spherical wave

tl_vsw_A(lambda, mu, l, m, x, theta, phi)

Translation coefficient for vector spherical waves with the same parity

tl_vsw_B(lambda, mu, l, m, x, theta, phi)

Translation coefficient for vector spherical waves with opposite parity

tl_vsw_rA(lambda, mu, l, m, x, theta, phi)

Translation coefficient for vector spherical waves with the same parity

tl_vsw_rB(lambda, mu, l, m, x, theta, phi)

Translation coefficient for vector spherical waves with opposite parity

Cylindrical waves

vcw_M(kz, m, xrho, phi, z)

Singular vector cylindrical wave M

vcw_N(kz, m, xrho, phi, z, k)

Singular vector cylindrical wave N

vcw_A(kz, m, xrho, phi, z, k, pol)

Singular helical vector cylindrical wave

vcw_rM(kz, m, xrho, phi, z)

Regular vector cylindrical wave M

vcw_rN(kz, m, xrho, phi, z, k)

Regular vector cylindrical wave N

vcw_rA(kz, m, xrho, phi, z, k, pol)

Regular helical vector cylindrical wave

tl_vcw(kz1, mu, kz2, m, k, xrho, phi, z)

Translation coefficient for vector cylindrical waves from scattered to incident modes

tl_vcw_r(kz1, mu, kz2, m, k, xrho, phi, z)

Translation coefficient for vector cylindrical waves of the same kind

Plane waves

vpw_M(kx, ky, kz, x, y, z)

Vector plane wave M

vpw_N(kx, ky, kz, x, y, z)

Vector plane wave N

vpw_A(kx, ky, kz, x, y, z, p)

Vector plane wave of well-defined helicity

Coordinate system transformations

car2cyl(r)

Convert cartesian to cylindrical coordinates

car2sph(r)

Convert cartesian to spherical coordinates

cyl2car(r)

Convert cylindrical to cartesian coordinates

cyl2sph(r)

Convert cylindrical to spherical coordinates

sph2car(r)

Convert spherical to cartesian coordinates

sph2cyl(r)

Convert spherical to cylindrical coordinates

vcar2cyl(v, r)

Convert vector in cartesian coordinates to vector in cylindrical coordinates

vcar2sph(v, r)

Convert vector in cartesian coordinates to vector in spherical coordinates

vcyl2car(v, r)

Convert vector in cylindrical coordinates to vector in cartesian coordinates

vcyl2sph(v, r)

Convert vector in cylindrical coordinates to vector in spherical coordinates

vsph2car(v, r)

Convert vector in spherical coordinates to vector in cartesian coordinates

vsph2cyl(v, r)

Convert vector in spherical coordinates to vector in cylindrical coordinates

car2pol(r)

Convert cartesian to polar coordinates

pol2car(r)

Convert polar to cartesian coordinates

vcar2pol(v, r)

Convert vector in cartesian coordinates to vector in polar coordinates

vpol2car(v, r)

Convert vector in polar coordinates to vector in cartesian coordinates

Cython module

cython_special

Cython versions of special functions.