FastTransforms.jl Documentation

Introduction

FastTransforms.jl allows the user to conveniently work with orthogonal polynomials with degrees well into the millions.

This package provides a Julia wrapper for the C library of the same name. Additionally, all three types of nonuniform fast Fourier transforms available, as well as the Padua transform.

Fast orthogonal polynomial transforms

For this documentation, please see the documentation for FastTransforms. Most transforms have separate forward and inverse plans. In some instances, however, the inverse is in the sense of least-squares, and therefore only the forward transform is planned.

Nonuniform fast Fourier transforms

FastTransforms.nufft1Function

Computes a nonuniform fast Fourier transform of type I:

\[f_j = \sum_{k=0}^{N-1} c_k e^{-2\pi{\rm i} \frac{j}{N} \omega_k},\quad{\rm for}\quad 0 \le j \le N-1.\]

Computes a 2D nonuniform fast Fourier transform of type I-I:

\[F_{i,j} = \sum_{k=0}^{M-1}\sum_{\ell=0}^{N-1} C_{k,\ell} e^{-2\pi{\rm i} (\frac{i}{M} \omega_k + \frac{j}{N} \pi_{\ell})},\quad{\rm for}\quad 0 \le i \le M-1,\quad 0 \le j \le N-1.\]
FastTransforms.nufft2Function

Computes a nonuniform fast Fourier transform of type II:

\[f_j = \sum_{k=0}^{N-1} c_k e^{-2\pi{\rm i} x_j k},\quad{\rm for}\quad 0 \le j \le N-1.\]

Computes a 2D nonuniform fast Fourier transform of type II-II:

\[F_{i,j} = \sum_{k=0}^{M-1}\sum_{\ell=0}^{N-1} C_{k,\ell} e^{-2\pi{\rm i} (x_i k + y_j \ell)},\quad{\rm for}\quad 0 \le i \le M-1,\quad 0 \le j \le N-1.\]
FastTransforms.nufft3Function

Computes a nonuniform fast Fourier transform of type III:

\[f_j = \sum_{k=0}^{N-1} c_k e^{-2\pi{\rm i} x_j \omega_k},\quad{\rm for}\quad 0 \le j \le N-1.\]
FastTransforms.ipaduatransformFunction

Inverse Padua Transform maps the 2D Chebyshev coefficients to the values of the interpolation polynomial at the Padua points.

Other Exported Methods

FastTransforms.gauntFunction

Calculates the Gaunt coefficients, defined by:

\[a(m,n,\mu,\nu,q) = \frac{2(n+\nu-2q)+1}{2} \frac{(n+\nu-2q-m-\mu)!}{(n+\nu-2q+m+\mu)!} \int_{-1}^{+1} P_n^m(x) P_\nu^\mu(x) P_{n+\nu-2q}^{m+\mu}(x) {\rm\,d}x.\]

or defined by:

\[P_n^m(x) P_\nu^\mu(x) = \sum_{q=0}^{q_{\rm max}} a(m,n,\mu,\nu,q) P_{n+\nu-2q}^{m+\mu}(x)\]

This is a Julia implementation of the stable recurrence described in:

Y.-l. Xu, Fast evaluation of Gaunt coefficients: recursive approach, J. Comp. Appl. Math., 85:53–65, 1997.

Calculates the Gaunt coefficients in 64-bit floating-point arithmetic.

FastTransforms.sphevaluateFunction

Pointwise evaluation of real orthonormal spherical harmonic:

\[Y_\ell^m(\theta,\varphi) = (-1)^{|m|}\sqrt{(\ell+\frac{1}{2})\frac{(\ell-|m|)!}{(\ell+|m|)!}} P_\ell^{|m|}(\cos\theta) \sqrt{\frac{2-\delta_{m,0}}{2\pi}} \left\{\begin{array}{ccc} \cos m\varphi & {\rm for} & m \ge 0,\\ \sin(-m\varphi) & {\rm for} & m < 0.\end{array}\right.\]

Internal Methods

Miscellaneous Special Functions

FastTransforms.δFunction

The Kronecker $\delta$ function:

\[\delta_{k,j} = \left\{\begin{array}{ccc} 1 & {\rm for} & k = j,\\ 0 & {\rm for} & k \ne j.\end{array}\right.\]
FastTransforms.ΛFunction

The Lambda function $\Lambda(z) = \frac{\Gamma(z+\frac{1}{2})}{\Gamma(z+1)}$ for the ratio of gamma functions.

For 64-bit floating-point arithmetic, the Lambda function uses the asymptotic series for $\tau$ in Appendix B of

I. Bogaert and B. Michiels and J. Fostier, 𝒪(1) computation of Legendre polynomials and Gauss–Legendre nodes and weights for parallel computing, SIAM J. Sci. Comput., 34:C83–C101, 2012.

The Lambda function $\Lambda(z,λ₁,λ₂) = \frac{\Gamma(z+\lambda_1)}{Γ(z+\lambda_2)}$ for the ratio of gamma functions.

FastTransforms.lambertwFunction

The principal branch of the Lambert-W function, defined by $x = W_0(x) e^{W_0(x)}$, computed using Halley's method for $x \in [-e^{-1},\infty)$.

Modified Chebyshev Moment-Based Quadrature

FastTransforms.fejerweights1Function

Compute weights of Fejer's first quadrature rule with modified Chebyshev moments of the first kind $\mu$.

FastTransforms.fejerweights2Function

Compute weights of Fejer's second quadrature rule with modified Chebyshev moments of the second kind $\mu$.

FastTransforms.chebyshevjacobimoments1Function

Modified Chebyshev moments of the first kind with respect to the Jacobi weight:

\[ \int_{-1}^{+1} T_n(x) (1-x)^\alpha(1+x)^\beta{\rm\,d}x.\]
FastTransforms.chebyshevlogmoments1Function

Modified Chebyshev moments of the first kind with respect to the logarithmic weight:

\[ \int_{-1}^{+1} T_n(x) \log\left(\frac{1-x}{2}\right){\rm\,d}x.\]
FastTransforms.chebyshevjacobimoments2Function

Modified Chebyshev moments of the second kind with respect to the Jacobi weight:

\[ \int_{-1}^{+1} U_n(x) (1-x)^\alpha(1+x)^\beta{\rm\,d}x.\]
FastTransforms.chebyshevlogmoments2Function

Modified Chebyshev moments of the second kind with respect to the logarithmic weight:

\[ \int_{-1}^{+1} U_n(x) \log\left(\frac{1-x}{2}\right){\rm\,d}x.\]

Elliptic

FastTransforms.EllipticModule

FastTransforms submodule for the computation of some elliptic integrals and functions.

Complete elliptic integrals of the first and second kinds:

\[K(k) = \int_0^{\frac{\pi}{2}} \frac{{\rm d}\theta}{\sqrt{1-k^2\sin^2\theta}},\quad{\rm and},\]
\[E(k) = \int_0^{\frac{\pi}{2}} \sqrt{1-k^2\sin^2\theta} {\rm\,d}\theta.\]

Jacobian elliptic functions:

\[x = \int_0^{\operatorname{sn}(x,k)} \frac{{\rm d}t}{\sqrt{(1-t^2)(1-k^2t^2)}},\]
\[x = \int_{\operatorname{cn}(x,k)}^1 \frac{{\rm d}t}{\sqrt{(1-t^2)[1-k^2(1-t^2)]}},\]
\[x = \int_{\operatorname{dn}(x,k)}^1 \frac{{\rm d}t}{\sqrt{(1-t^2)(t^2-1+k^2)}},\]

and the remaining nine are defined by:

\[\operatorname{pq}(x,k) = \frac{\operatorname{pr}(x,k)}{\operatorname{qr}(x,k)} = \frac{1}{\operatorname{qp}(x,k)}.\]