From 6949039b03f088563818d4fc39ad5d7dbb63a656 Mon Sep 17 00:00:00 2001 From: zeptodoctor <44736852+zeptodoctor@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:45:40 +0000 Subject: [PATCH] build based on 368dcb9 --- dev/dev/index.html | 2 +- dev/generated/annulus.html | 4 +- dev/generated/annulus/index.html | 2 +- .../automaticdifferentiation/index.html | 2 +- dev/generated/chebyshev/index.html | 2 +- dev/generated/disk/index.html | 2 +- dev/generated/dunklxu.html | 4 +- dev/generated/halfrange.html | 4 +- dev/generated/halfrange/index.html | 2 +- dev/generated/nonlocaldiffusion/index.html | 2 +- dev/generated/padua/index.html | 2 +- dev/generated/proriol.html | 4 +- dev/generated/semiclassical.html | 4 +- dev/generated/semiclassical/index.html | 99 +++++++++---------- dev/generated/semiclassical1.html | 4 +- dev/generated/sphere/index.html | 2 +- dev/generated/sphere1.html | 4 +- dev/generated/sphere2.html | 4 +- dev/generated/sphere3.html | 4 +- dev/generated/spinweighted/index.html | 2 +- dev/generated/subspaceangles/index.html | 2 +- dev/generated/triangle/index.html | 2 +- dev/generated/zernike.html | 4 +- dev/index.html | 2 +- dev/search/index.html | 2 +- dev/search_index.js | 2 +- 26 files changed, 79 insertions(+), 90 deletions(-) diff --git a/dev/dev/index.html b/dev/dev/index.html index b504cec..13b33ce 100644 --- a/dev/dev/index.html +++ b/dev/dev/index.html @@ -34,4 +34,4 @@

Then we wait for the friendly folks at JuliaPackaging to merge the pull request to Yggdrasil, triggering a new release of the FastTransforms_jll.jl meta package that stores all precompiled binaries. With this release, we update the FastTransforms.jl Project.toml to point to the latest release and register the new version.

Since development of Yggdrasil is quite rapid, a fork may easily become stale. Git permits the developer to forcibly make a master branch on a fork even with upstream master:

git fetch upstream
 git checkout master
 git reset --hard upstream/master
-git push origin master --force
+git push origin master --force diff --git a/dev/generated/annulus.html b/dev/generated/annulus.html index 560735d..01b241a 100644 --- a/dev/generated/annulus.html +++ b/dev/generated/annulus.html @@ -1,7 +1,7 @@ -
+
+
-
+
+
-
+
-
+
+
+
+
+

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.

Fast Cholesky factorization of the Gram matrix

FastTransforms.GramMatrixType
GramMatrix(W::AbstractMatrix, X::AbstractMatrix)

Construct a symmetric positive-definite Gram matrix with data stored in $W$. Given a family of orthogonal polynomials ${\bf P}(x) = \{p_0(x), p_1(x),\ldots\}$ and a continuous inner product $\langle f, g\rangle$, the Gram matrix is defined by:

\[W_{i,j} = \langle p_{i-1}, p_{j-1}\rangle.\]

Moreover, given $X$, the transposed Jacobi matrix that satisfies $x {\bf P}(x) = {\bf P}(x) X$, the Gram matrix satisfies the skew-symmetric rank-2 displacement equation ($X = X_{1:n, 1:n}$):

\[X^\top W - WX = GJG^\top,\]

where $J = \begin{pmatrix} 0 & 1\\ -1 & 0\end{pmatrix}$ and where:

\[G_{:, 1} = e_n,\quad{\rm and}\quad G_{:, 2} = W_{n-1, :}X_{n-1, n} - X^\top W_{:, n}.\]

Fast ($O(n^2)$) Cholesky factorization of the Gram matrix returns the connection coefficients between ${\bf P}(x)$ and the polynomials ${\bf Q}(x)$ orthogonal in the modified inner product, ${\bf P}(x) = {\bf Q}(x) R$.

source
FastTransforms.ChebyshevGramMatrixType
ChebyshevGramMatrix(μ::AbstractVector)

Construct a Chebyshev–Gram matrix of size (length(μ)+1)÷2 with entries:

\[W_{i,j} = \frac{\mu_{|i-j|+1} +\mu_{i+j-1}}{2}.\]

Due to the linearization of a product of two first-kind Chebyshev polynomials, the Chebyshev–Gram matrix can be constructed from modified Chebyshev moments:

\[\mu_{n} = \langle T_{n-1}, 1\rangle.\]

Specialized construction and Cholesky factorization is given for this type.

See also GramMatrix for the general case.

source

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.\]
source

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.\]
source
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.\]
source

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.\]
source
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.\]
source

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.

source

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

source
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.\]
source

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.\]
source
FastTransforms.ΛFunction

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

source

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.

source

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

source
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)$.

source

Modified Chebyshev Moment-Based Quadrature

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.\]
source
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.\]
source

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)}.\]
source
+Home · FastTransforms.jl

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.

Fast Cholesky factorization of the Gram matrix

FastTransforms.GramMatrixType
GramMatrix(W::AbstractMatrix, X::AbstractMatrix)

Construct a symmetric positive-definite Gram matrix with data stored in $W$. Given a family of orthogonal polynomials ${\bf P}(x) = \{p_0(x), p_1(x),\ldots\}$ and a continuous inner product $\langle f, g\rangle$, the Gram matrix is defined by:

\[W_{i,j} = \langle p_{i-1}, p_{j-1}\rangle.\]

Moreover, given $X$, the transposed Jacobi matrix that satisfies $x {\bf P}(x) = {\bf P}(x) X$, the Gram matrix satisfies the skew-symmetric rank-2 displacement equation ($X = X_{1:n, 1:n}$):

\[X^\top W - WX = GJG^\top,\]

where $J = \begin{pmatrix} 0 & 1\\ -1 & 0\end{pmatrix}$ and where:

\[G_{:, 1} = e_n,\quad{\rm and}\quad G_{:, 2} = W_{n-1, :}X_{n-1, n} - X^\top W_{:, n}.\]

Fast ($O(n^2)$) Cholesky factorization of the Gram matrix returns the connection coefficients between ${\bf P}(x)$ and the polynomials ${\bf Q}(x)$ orthogonal in the modified inner product, ${\bf P}(x) = {\bf Q}(x) R$.

source
FastTransforms.ChebyshevGramMatrixType
ChebyshevGramMatrix(μ::AbstractVector)

Construct a Chebyshev–Gram matrix of size (length(μ)+1)÷2 with entries:

\[W_{i,j} = \frac{\mu_{|i-j|+1} +\mu_{i+j-1}}{2}.\]

Due to the linearization of a product of two first-kind Chebyshev polynomials, the Chebyshev–Gram matrix can be constructed from modified Chebyshev moments:

\[\mu_{n} = \langle T_{n-1}, 1\rangle.\]

Specialized construction and Cholesky factorization is given for this type.

See also GramMatrix for the general case.

source

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.\]
source

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.\]
source
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.\]
source

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.\]
source
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.\]
source

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.

source

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

source
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.\]
source

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.\]
source
FastTransforms.ΛFunction

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

source

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.

source

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

source
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)$.

source

Modified Chebyshev Moment-Based Quadrature

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.\]
source
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.\]
source

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)}.\]
source
diff --git a/dev/search/index.html b/dev/search/index.html index c6327ba..c1c5a8f 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · FastTransforms.jl

Loading search...

    +Search · FastTransforms.jl

    Loading search...

      diff --git a/dev/search_index.js b/dev/search_index.js index 4e135c6..a37b607 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/spinweighted.jl\"","category":"page"},{"location":"generated/spinweighted/#Spin-weighted-spherical-harmonics-1","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"","category":"section"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"This example plays with analysis of:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"f(r) = e^rm i kcdot r","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"for some kinmathbbR^3 and where rinmathbbS^2, using spin-0 spherical harmonics.","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"It applies ð, the spin-raising operator, both on the spin-0 coefficients as well as the original function, followed by a spin-1 analysis to compare coefficients.","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"For the storage pattern of the arrays, please consult the documentation.","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"using FastTransforms, LinearAlgebra","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"The colatitudinal grid (mod pi):","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"N = 10\nθ = (0.5:N-0.5)/N","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"0.05:0.1:0.95","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"The longitudinal grid (mod pi):","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"M = 2*N-1\nφ = (0:M-1)*2/M","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"0.0:0.10526315789473684:1.894736842105263","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"Our choice of k and angular parametrization of r:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"k = [2/7, 3/7, 6/7]\nr = (θ,φ) -> [sinpi(θ)*cospi(φ), sinpi(θ)*sinpi(φ), cospi(θ)]","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"#1 (generic function with 1 method)","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"On the tensor product grid, our function samples are:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"F = [exp(im*(k⋅r(θ,φ))) for θ in θ, φ in φ]","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"10×19 Matrix{ComplexF64}:\n 0.628413+0.77788im 0.613246+0.789892im 0.603399+0.79744im 0.600106+0.79992im 0.603786+0.797146im 0.613972+0.789328im 0.629387+0.777092im 0.64815+0.761513im 0.668065+0.744103im 0.686931+0.726723im 0.702801+0.711386im 0.71416+0.699982im 0.720001+0.693973im 0.71983+0.694151im 0.713662+0.700491im 0.702017+0.71216im 0.685934+0.727664im 0.666955+0.745098im 0.647044+0.762452im\n 0.626742+0.779227im 0.582025+0.813171im 0.552374+0.833596im 0.542362+0.840145im 0.55355+0.832816im 0.584193+0.811615im 0.629571+0.776943im 0.68294+0.730474im 0.736952+0.675945im 0.785185+0.619262im 0.823211+0.567736im 0.848825+0.528674im 0.861428+0.507879im 0.861065+0.508495im 0.84773+0.530428im 0.821392+0.570364im 0.782715+0.62238im 0.734019+0.679129im 0.679858+0.733344im\n 0.690857+0.722991im 0.625071+0.780568im 0.580335+0.814378im 0.565059+0.82505im 0.582122+0.813101im 0.628309+0.777964im 0.694941+0.719066im 0.769832+0.638246im 0.840471+0.541857im 0.897514+0.440985im 0.936972+0.349406im 0.959893+0.280368im 0.969821+0.243819im 0.969549+0.244899im 0.958985+0.283457im 0.935221+0.354065im 0.894765+0.446538im 0.836798+0.547511im 0.76563+0.643282im\n 0.799876+0.600166im 0.729022+0.68449im 0.678871+0.734257im 0.661444+0.749994im 0.680901+0.732375im 0.732596+0.680663im 0.804139+0.594441im 0.878702+0.477371im 0.940401+0.340068im 0.97989+0.199537im 0.997175+0.0751106im 0.999864-0.0165003im 0.997938-0.0641824im 0.998027-0.062782im 0.999923-0.0124432im 0.996684+0.0813636im 0.978303+0.207181im 0.937478+0.348046im 0.874727+0.484617im\n 0.914598+0.404364im 0.858511+0.512795im 0.815749+0.578405im 0.800419+0.599441im 0.81752+0.5759im 0.861473+0.507803im 0.917769+0.397116im 0.967817+0.251653im 0.996186+0.0872572im 0.99722-0.07452im 0.977203-0.212305im 0.950621-0.310353im 0.93288-0.360187im 0.933439-0.358735im 0.952008-0.306074im 0.978656-0.205506im 0.997827-0.065887im 0.99532+0.0966353im 0.965471+0.260509im\n 0.989052+0.147569im 0.963701+0.266985im 0.939852+0.341582im 0.930644+0.365927im 0.940896+0.338696im 0.965234+0.261387im 0.990188+0.13974im 0.999905-0.0137846im 0.983699-0.179822im 0.94183-0.33609im 0.88602-0.463647im 0.834409-0.551146im 0.804097-0.594498im 0.805021-0.593247im 0.836879-0.547388im 0.889222-0.457475im 0.944703-0.327927im 0.985349-0.170549im 0.999989-0.00462386im\n 0.99096-0.134156im 0.999703-0.0243628im 0.998928+0.0462861im 0.997566+0.0697274im 0.999053+0.0435207im 0.999562-0.0295972im 0.989978-0.141225im 0.960887-0.276941im 0.908431-0.418034im 0.837893-0.545834im 0.762849-0.646576im 0.700449-0.713703im 0.665602-0.746307im 0.666649-0.745372im 0.703339-0.710855im 0.76689-0.641779im 0.842129-0.539276im 0.91195-0.410301im 0.963143-0.26899im\n 0.919472-0.393156im 0.950297-0.311346im 0.966254-0.257589im 0.970887-0.23954im 0.965686-0.259711im 0.948995-0.315292im 0.91723-0.398357im 0.867837-0.49685im 0.802371-0.596825im 0.727938-0.685643im 0.656033-0.754733im 0.599431-0.800426im 0.568692-0.82255im 0.569608-0.821916im 0.602006-0.798492im 0.659781-0.751458im 0.732172-0.68112im 0.806377-0.591401im 0.871077-0.491147im\n 0.80566-0.592379im 0.837633-0.546233im 0.856754-0.515725im 0.862863-0.505438im 0.856026-0.516933im 0.836173-0.548466im 0.8035-0.595305im 0.759389-0.650637im 0.707251-0.706962im 0.652712-0.757606im 0.602883-0.79783im 0.564968-0.825113im 0.544739-0.838606im 0.545338-0.838216im 0.566673-0.823943im 0.605429-0.795899im 0.655721-0.755004im 0.710305-0.703894im 0.762122-0.647434im\n 0.695346-0.718675im 0.70912-0.705088im 0.717813-0.696236im 0.720677-0.693271im 0.717475-0.696585im 0.708471-0.70574im 0.694445-0.719545im 0.676692-0.736266im 0.656981-0.753907im 0.637428-0.77051im 0.620269-0.784389im 0.607563-0.794272im 0.600886-0.799335im 0.601083-0.799186im 0.608129-0.793839im 0.621132-0.783706im 0.638483-0.769636im 0.658105-0.752927im 0.67776-0.735284im","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"We precompute a spin-0 spherical harmonic–Fourier plan:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"P = plan_spinsph2fourier(F, 0)","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"FastTransforms Spin-weighted spherical harmonic--Fourier plan for 10×19-element array of ComplexF64","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"And an FFTW Fourier analysis plan on mathbbS^2:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"PA = plan_spinsph_analysis(F, 0)","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"FastTransforms plan for FFTW Fourier analysis on the sphere (spin-weighted) for 10×19-element array of ComplexF64","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"Its spin-0 spherical harmonic coefficients are:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"U⁰ = P\\(PA*F)","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"10×19 Matrix{ComplexF64}:\n 2.98294-8.51991e-17im -0.560381+0.373587im 0.560381+0.373587im 0.0307268-0.0737442im 0.0307268+0.0737442im 0.00123905+0.0063329im -0.00123905+0.0063329im -0.000278656-0.000280997im -0.000278656+0.000280997im 1.91763e-5+3.91877e-6im -1.91763e-5+3.91877e-6im -7.51512e-7+3.05775e-7im -7.51512e-7-3.05775e-7im 1.62607e-8-2.39542e-8im -1.62607e-8-2.39542e-8im -7.57573e-12+9.06989e-10im -7.6043e-12-9.06983e-10im -1.32856e-11-2.14392e-11im 1.44574e-11-2.09394e-11im\n -9.83939e-17+1.585im -0.147488-0.221233im -0.147488+0.221233im 0.0242802+0.0101168im -0.0242802+0.0101168im -0.001828+0.000357651im -0.001828-0.000357651im 7.31346e-5-7.25251e-5im -7.31346e-5-7.25251e-5im -9.36425e-7+4.58234e-6im -9.36425e-7-4.58234e-6im -6.79393e-8-1.66977e-7im 6.79393e-8-1.66977e-7im 4.99533e-9+3.39094e-9im 4.99533e-9-3.39094e-9im -1.78808e-10-1.4939e-12im 1.78807e-10-1.49874e-12im 3.97537e-12-2.47069e-12im 3.88749e-12+2.67669e-12im\n -0.296042+1.9373e-16im 0.0419095-0.0279397im -0.0419095-0.0279397im -0.00179667+0.00431201im -0.00179667-0.00431201im -5.92556e-5-0.000302862im 5.92556e-5-0.000302862im 1.12623e-5+1.13569e-5im 1.12623e-5-1.13569e-5im -6.70874e-7-1.37097e-7im 6.70874e-7-1.37097e-7im 2.31726e-8-9.42846e-9im 2.31726e-8+9.42846e-9im -4.48157e-10+6.60198e-10im 4.48157e-10+6.60199e-10im 1.83296e-13-2.21049e-11im 1.86671e-13+2.21043e-11im 2.77146e-13+4.85403e-13im -3.40624e-13+4.58315e-13im\n 7.69323e-17-0.0243812im 0.00315419+0.00473128im 0.00315419-0.00473128im -0.000498246-0.000207603im 0.000498246-0.000207603im 3.42215e-5-6.6955e-6im 3.42215e-5+6.6955e-6im -1.23971e-6+1.22938e-6im 1.23971e-6+1.22938e-6im 1.44141e-8-7.05344e-8im 1.44141e-8+7.05344e-8im 9.54963e-10+2.34704e-9im -9.54963e-10+2.34704e-9im -6.22737e-11-4.22728e-11im -6.22737e-11+4.22728e-11im 2.09765e-12+1.71393e-14im -2.09747e-12+1.79766e-14im -5.56471e-13+3.3894e-13im -5.39577e-13-3.78603e-13im\n -0.000199834-6.42779e-17im -0.000327232+0.000218154im 0.000327232+0.000218154im 1.67027e-5-4.00864e-5im 1.67027e-5+4.00864e-5im 5.5389e-7+2.83099e-6im -5.5389e-7+2.83099e-6im -1.01124e-7-1.01974e-7im -1.01124e-7+1.01974e-7im 5.69484e-9+1.16377e-9im -5.69484e-9+1.16377e-9im -1.69612e-10+6.90117e-11im -1.69612e-10-6.90117e-11im 2.98197e-12-4.39287e-12im -2.98201e-12-4.39288e-12im -3.48909e-14+4.21983e-12im -3.57157e-14-4.21966e-12im -4.58893e-14-8.03264e-14im 5.6381e-14-7.5835e-14im\n -6.51867e-17-0.000282488im -7.0029e-6-1.05044e-5im -7.0029e-6+1.05044e-5im 2.24809e-6+9.36704e-7im -2.24809e-6+9.36704e-7im -1.76539e-7+3.45402e-8im -1.76539e-7-3.45402e-8im 6.55393e-9-6.49931e-9im -6.55393e-9-6.49931e-9im -7.13679e-11+3.49235e-10im -7.1368e-11-3.49235e-10im -4.99715e-12-1.22817e-11im 4.99718e-12-1.22817e-11im 1.69023e-11+1.14737e-11im 1.69023e-11-1.14737e-11im -5.44917e-13-4.41379e-15im 5.44856e-13-4.70669e-15im 1.5798e-13-9.50585e-14im 1.52381e-13+1.08137e-13im\n 3.58969e-5-4.03624e-17im -4.7402e-7+3.16014e-7im 4.7402e-7+3.16014e-7im -3.23608e-8+7.76658e-8im -3.23608e-8-7.76658e-8im -1.6111e-9-8.2345e-9im 1.6111e-9-8.2345e-9im 2.28327e-10+2.30246e-10im 2.28327e-10-2.30246e-10im -1.02557e-11-2.09579e-12im 1.02557e-11-2.09576e-12im 4.54949e-11-1.8511e-11im 4.54949e-11+1.85109e-11im -5.65258e-13+8.32684e-13im 5.65261e-13+8.3268e-13im 9.40322e-15-1.14115e-12im 9.65269e-15+1.14112e-12im 8.76404e-15+1.53587e-14im -1.07761e-14+1.4515e-14im\n 1.02759e-16+2.64492e-6im -5.98533e-8-8.978e-8im -5.98533e-8+8.978e-8im -2.2753e-10-9.48042e-11im 2.2753e-10-9.48042e-11im 2.65455e-10-5.19369e-11im 2.65455e-10+5.19368e-11im -1.37076e-11+1.35933e-11im 1.37076e-11+1.35933e-11im 3.35969e-11-1.64405e-10im 3.35969e-11+1.64405e-10im 1.96453e-12+4.82831e-12im -1.96456e-12+4.82829e-12im -8.01172e-12-5.43855e-12im -8.01172e-12+5.43851e-12im 2.15355e-13+1.72018e-15im -2.15344e-13+1.85439e-15im -7.69555e-14+4.59648e-14im -7.40025e-14-5.28722e-14im\n -1.25204e-7-1.00025e-16im 6.65757e-9-4.43838e-9im -6.65757e-9-4.43838e-9im -1.43603e-11+3.44646e-11im -1.43603e-11-3.44647e-11im 5.78456e-14+2.95764e-13im -5.78679e-14+2.9576e-13im -3.63314e-11-3.66368e-11im -3.63314e-11+3.66367e-11im 7.38143e-13+1.50851e-13im -7.3814e-13+1.50867e-13im -7.24159e-12+2.94646e-12im -7.24159e-12-2.94644e-12im 4.07073e-14-5.99537e-14im -4.06954e-14-5.99558e-14im -1.50601e-15+1.8179e-13im -1.53602e-15-1.81804e-13im -6.15023e-16-1.09078e-15im 7.91118e-16-1.04469e-15im\n -1.37837e-16-3.0609e-9im 4.29751e-10+6.44627e-10im 4.29751e-10-6.44627e-10im -5.01384e-12-2.08911e-12im 5.01382e-12-2.08911e-12im -3.61552e-10+7.07385e-11im -3.61552e-10-7.07385e-11im 2.83376e-12-2.81014e-12im -2.83376e-12-2.81015e-12im -4.57901e-11+2.24071e-10im -4.57901e-11-2.24071e-10im -4.06243e-13-9.98407e-13im 4.06233e-13-9.98415e-13im 1.09292e-11+7.41901e-12im 1.09292e-11-7.41901e-12im -4.4566e-14-3.61759e-16im 4.45481e-14-3.97552e-16im 1.05374e-13-6.28694e-14im 1.01304e-13+7.23998e-14im","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"We can check its L^2(mathbbS^2) norm against an exact result:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"norm(U⁰) ≈ sqrt(4π)","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"true","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"Spin can be incremented by applying ð, either on the spin-0 coefficients:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"U¹c = zero(U⁰)\nfor n in 1:N-1\n U¹c[n, 1] = sqrt(n*(n+1))*U⁰[n+1, 1]\nend\nfor m in 1:M÷2\n for n in 0:N-1\n U¹c[n+1, 2m] = -sqrt((n+m)*(n+m+1))*U⁰[n+1, 2m]\n U¹c[n+1, 2m+1] = sqrt((n+m)*(n+m+1))*U⁰[n+1, 2m+1]\n end\nend","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"or on the original function through analysis with spin-1 spherical harmonics:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"F = [-(k[1]*(im*cospi(θ)*cospi(φ) + sinpi(φ)) + k[2]*(im*cospi(θ)*sinpi(φ)-cospi(φ)) - im*k[3]*sinpi(θ))*exp(im*(k⋅r(θ,φ))) for θ in θ, φ in φ]","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"10×19 Matrix{ComplexF64}:\n 0.384531+0.240303im 0.405167+0.0811656im 0.376168-0.08059im 0.296802-0.228644im 0.17173-0.345547im 0.0121942-0.415058im -0.164084-0.425345im -0.334877-0.37218im -0.47719-0.260862im -0.571781-0.105926im -0.607006+0.0715576im -0.58067+0.248234im -0.499453+0.402825im -0.376425+0.519276im -0.227802+0.588046im -0.0700889+0.605739im 0.0817378+0.573795im 0.214909+0.497059im 0.318781+0.382786im\n 0.16375+0.41829im 0.162116+0.268361im 0.128477+0.110061im 0.056034-0.0418675im -0.0588234-0.167146im -0.211042-0.242529im -0.383203-0.247832im -0.546769-0.173942im -0.669506-0.0288607im -0.726395+0.162453im -0.708448+0.365492im -0.624684+0.547246im -0.496849+0.685091im -0.350631+0.769743im -0.208037+0.802572im -0.0835191+0.79034im 0.016198+0.740573im 0.0899356+0.659195im 0.13893+0.55045im\n 0.00394925+0.589002im -0.0517508+0.441892im -0.117739+0.283703im -0.202276+0.132736im -0.313608+0.0132761im -0.450683-0.0475101im -0.596088-0.0271995im -0.717144+0.0808626im -0.777618+0.259594im -0.754769+0.470906im -0.650847+0.67007im -0.491452+0.823236im -0.313141+0.917212im -0.149502+0.957306im -0.0230169+0.957535im 0.0563716+0.930505im 0.0891711+0.881918im 0.083394+0.810775im 0.0511118+0.713512im\n -0.037706+0.764342im -0.167663+0.63523im -0.287398+0.487323im -0.400578+0.346904im -0.514827+0.244114im -0.62967+0.207393im -0.727882+0.254883im -0.777945+0.383583im -0.749353+0.563975im -0.631836+0.748617im -0.444017+0.892859im -0.224888+0.974245im -0.0160482+0.997806im 0.151723+0.986424im 0.261377+0.965157im 0.306018+0.948535im 0.286044+0.935214im 0.209798+0.910832im 0.0944472+0.857391im\n 0.0677134+0.90671im -0.132933+0.832114im -0.31272+0.722356im -0.463011+0.610267im -0.584223+0.531084im -0.67363+0.512373im -0.717075+0.564833im -0.692616+0.674959im -0.585463+0.805978im -0.402896+0.912201im -0.175697+0.960918im 0.0558086+0.947262im 0.258917+0.892857im 0.415705+0.832204im 0.518079+0.796763im 0.559103+0.802847im 0.530434+0.845158im 0.428907+0.898149im 0.265719+0.927327im\n 0.292353+0.944771im 0.0581069+0.961031im -0.162367+0.923101im -0.343726+0.861107im -0.474077+0.809852im -0.546787+0.794409im -0.553921+0.82068im -0.48849+0.87246im -0.353637+0.917742im -0.169005+0.924095im 0.0340849+0.875449im 0.226308+0.779766im 0.391603+0.66433im 0.527207+0.564551im 0.633493+0.513im 0.702424+0.529934im 0.714639+0.614543im 0.649544+0.740756im 0.502126+0.864782im\n 0.544556+0.82786im 0.335621+0.941682im 0.11692+0.992061im -0.074329+0.994789im -0.214433+0.975768im -0.291963+0.955971im -0.303796+0.942141im -0.254076+0.925583im -0.155653+0.88869im -0.0290943+0.815954im 0.10377+0.703491im 0.228799+0.562131im 0.344287+0.414327im 0.457269+0.288908im 0.572819+0.215991im 0.682616+0.220188im 0.761104+0.310327im 0.774782+0.470071im 0.701202+0.658896im\n 0.711777+0.57455im 0.575876+0.753741im 0.402359+0.877629im 0.227778+0.943189im 0.0807159+0.961489im -0.0227441+0.946886im -0.078234+0.908848im -0.0903981+0.849391im -0.0697694+0.765587im -0.0288206+0.65453im 0.0229208+0.517715im 0.0830404+0.363193im 0.157068+0.205921im 0.254332+0.067373im 0.379593-0.026087im 0.524118-0.0484074im 0.662039+0.0163403im 0.75688+0.163406im 0.777104+0.364037im\n 0.726602+0.264733im 0.673634+0.460754im 0.564658+0.62254im 0.42451+0.734172im 0.277783+0.792276im 0.142935+0.801596im 0.0303916+0.769731im -0.0562551+0.703542im -0.117442+0.608011im -0.154422+0.487008im -0.166521+0.34507im -0.149734+0.189474im -0.0974708+0.0321493im -0.00385489-0.109276im 0.131046-0.212499im 0.296212-0.254862im 0.468111-0.220723im 0.615102-0.109082im 0.707182+0.0630756im\n 0.597178-0.0185423im 0.601301+0.161421im 0.546217+0.32944im 0.442188+0.46657im 0.304261+0.559965im 0.149097+0.603283im -0.00741158+0.595734im -0.151367+0.540622im -0.271099+0.44408im -0.356905+0.314404im -0.400841+0.161998im -0.397025-0.000359286im -0.342634-0.157415im -0.239438-0.292068im -0.0953011-0.38711im 0.0751723-0.428079im 0.251638-0.406595im 0.410936-0.323077im 0.53139-0.187637im","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"We change plans with spin-1 now and reanalyze:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"P = plan_spinsph2fourier(F, 1)\nPA = plan_spinsph_analysis(F, 1)\nU¹s = P\\(PA*F)","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"10×19 Matrix{ComplexF64}:\n 4.81048e-17+2.24152im 0.792499-0.528332im 0.792499+0.528332im -0.0752649+0.180636im 0.0752649+0.180636im -0.00429218-0.0219378im -0.00429218+0.0219378im 0.00124619+0.00125666im -0.00124619+0.00125666im -0.000105033-2.1464e-5im -0.000105033+2.1464e-5im 4.87035e-6-1.98165e-6im -4.87035e-6-1.98165e-6im -1.21684e-7+1.79257e-7im -1.21684e-7-1.79257e-7im 6.4556e-11-7.69602e-9im -6.42651e-11-7.6961e-9im 1.3734e-10+1.99137e-10im 1.25853e-10-2.02909e-10im\n -0.725151+5.32221e-18im 0.361271+0.541907im -0.361271+0.541907im -0.0841092-0.0350455im -0.0841092+0.0350455im 0.00817504-0.00159947im -0.00817504-0.00159947im -0.000400574+0.000397236im -0.000400574-0.000397236im 6.06873e-6-2.9697e-5im -6.06873e-6-2.9697e-5im 5.08411e-7+1.24954e-6im 5.08411e-7-1.24954e-6im -4.23861e-8-2.87724e-8im 4.23861e-8-2.87724e-8im 1.69612e-9+1.41282e-11im 1.69628e-9-1.41119e-11im -4.07203e-11+2.96639e-11im 3.63017e-11+2.53159e-11im\n -7.43762e-17-0.0844589im -0.145179+0.096786im -0.145179-0.096786im 0.00803495-0.0192839im -0.00803495-0.0192839im 0.000324556+0.00165884im 0.000324556-0.00165884im -7.29881e-5-7.36014e-5im 7.29881e-5-7.36014e-5im 5.02037e-6+1.02593e-6im 5.02037e-6-1.02593e-6im -1.9664e-7+8.00072e-8im 1.9664e-7+8.00072e-8im 4.25378e-9-6.26388e-9im 4.25378e-9+6.26388e-9im 6.53269e-12+2.1811e-10im -6.52146e-12+2.18144e-10im -1.63776e-11+3.366e-12im -1.53622e-11-3.76794e-12im\n -0.000893686-1.84222e-18im -0.014106-0.0211589im 0.014106-0.0211589im 0.00272901+0.00113709im 0.00272901-0.00113709im -0.00022178+4.33918e-5im 0.00022178+4.33918e-5im 9.27716e-6-9.19981e-6im 9.27716e-6+9.19981e-6im -1.22275e-7+5.98394e-7im 1.22275e-7+5.98394e-7im -9.06826e-9-2.22464e-8im -9.06826e-9+2.22464e-8im 6.14926e-10+3.8178e-10im -6.14926e-10+3.81779e-10im -2.02946e-11+8.95683e-11im -2.03114e-11-8.95764e-11im -7.74583e-13-2.47296e-12im 9.78849e-13-2.19174e-12im\n -2.77419e-17-0.00154725im 0.00179232-0.00119488im 0.00179232+0.00119488im -0.000108246+0.00025979im 0.000108246+0.00025979im -4.14499e-6-2.11852e-5im -4.14499e-6+2.11852e-5im 8.58374e-7+8.65614e-7im -8.58374e-7+8.65614e-7im -5.40698e-8-1.11423e-8im -5.40698e-8+1.11423e-8im 1.63049e-9-7.15813e-10im -1.63049e-9-7.15813e-10im 2.6e-10+2.34806e-10im 2.6e-10-2.34805e-10im -9.52905e-12-1.46897e-12im 9.53119e-12-1.47348e-12im 3.24098e-12-6.83905e-13im 3.02544e-12+8.12829e-13im\n 0.000232639-3.672e-17im 4.53837e-5+6.80755e-5im -4.53837e-5+6.80755e-5im -1.68233e-5-7.00961e-6im -1.68233e-5+7.00961e-6im 1.49733e-6-2.92965e-7im -1.49733e-6-2.92965e-7im -6.18845e-8+6.17602e-8im -6.18845e-8-6.17602e-8im 4.71847e-10-3.03855e-9im -4.71847e-10-3.03855e-9im 1.02475e-9-3.12162e-10im 1.02475e-9+3.12161e-10im -2.32851e-11+2.79721e-11im 2.3285e-11+2.79721e-11im 5.51359e-12-2.47804e-11im 5.51954e-12+2.47829e-11im 2.05758e-13+6.50666e-13im -2.63466e-13+5.82305e-13im\n -2.539e-17+1.97929e-5im 3.54721e-6-2.36505e-6im 3.54721e-6+2.36505e-6im 2.74198e-7-6.5817e-7im -2.74198e-7-6.5817e-7im 1.49997e-8+7.82205e-8im 1.49997e-8-7.82205e-8im -2.72196e-9-2.73494e-9im 2.72196e-9-2.73494e-9im 4.22222e-10-1.58584e-9im 4.22222e-10+1.58584e-9im 1.4028e-11+4.2318e-11im -1.40281e-11+4.2318e-11im -7.00664e-11-6.32065e-11im -7.00664e-11+6.32064e-11im 1.8132e-12+2.78513e-13im -1.81361e-12+2.79436e-13im -8.89729e-13+1.90111e-13im -8.28862e-13-2.3028e-13im\n -1.0618e-6-1.60227e-16im 5.06265e-7+7.59331e-7im -5.06265e-7+7.59331e-7im 2.28542e-9+1.27481e-9im 2.28542e-9-1.27481e-9im -1.53825e-9+3.35011e-10im 1.53825e-9+3.35011e-10im -2.24932e-9-2.42853e-9im -2.24932e-9+2.42853e-9im 1.43487e-10+3.57671e-11im -1.43487e-10+3.57671e-11im -4.84249e-10+1.47683e-10im -4.84249e-10-1.47683e-10im 9.17835e-12-1.10319e-11im -9.17827e-12-1.10319e-11im -2.61497e-12+1.18851e-11im -2.61825e-12-1.18864e-11im -8.21156e-14-2.58948e-13im 1.05894e-13-2.32289e-13im\n 1.80271e-18-2.92736e-8im -6.36569e-8+4.17996e-8im -6.36569e-8-4.17996e-8im 6.18282e-10-1.39021e-9im -6.18282e-10-1.39021e-9im -4.16445e-10+7.77363e-11im -4.16445e-10-7.77363e-11im 8.6631e-12-8.2083e-12im -8.66306e-12-8.20835e-12im -6.71953e-11+2.52391e-10im -6.71953e-11-2.52391e-10im -1.00987e-12-3.04635e-12im 1.00985e-12-3.0463e-12im 1.11584e-11+1.00647e-11im 1.11584e-11-1.00647e-11im -1.30587e-13-2.0048e-14im 1.30633e-13-2.01267e-14im 1.41977e-13-3.03707e-14im 1.32247e-13+3.68603e-14im\n -1.3507e-9+1.40212e-16im -3.62349e-10-4.74615e-10im 3.62349e-10-4.74615e-10im 1.35757e-9-2.98609e-9im 1.35757e-9+2.98609e-9im -2.68037e-12-1.17672e-11im 2.68035e-12-1.17672e-11im 3.06502e-9+3.30916e-9im 3.06502e-9-3.30916e-9im -2.9668e-11-7.39519e-12im 2.9668e-11-7.39519e-12im 6.60325e-10-2.01412e-10im 6.60325e-10+2.01411e-10im -1.89842e-12+2.28193e-12im 1.89842e-12+2.28191e-12im 3.56751e-12-1.6238e-11im 3.57202e-12+1.62398e-11im 1.69962e-14+5.36059e-14im -2.19325e-14+4.80988e-14im","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"Finally, we check L^2(mathbbS^2) norms against another exact result:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"norm(U¹c) ≈ norm(U¹s) ≈ sqrt(8π/3*(k⋅k))","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"true","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/annulus.jl\"","category":"page"},{"location":"generated/annulus/#Integration-on-an-annulus-1","page":"Integration on an annulus","title":"Integration on an annulus","text":"","category":"section"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"In this example, we explore integration of the function:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":" f(xy) = fracx^3x^2+y^2-frac14","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"over the annulus defined by (rtheta) rho r 1 0 theta 2pi with parameter rho = frac23. We will calculate the integral:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":" int_0^2piint_frac23^1 f(rcosthetarsintheta)^2rrmdrrmdtheta","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"by analyzing the function in an annulus polynomial series. We analyze the function on an Ntimes M tensor product grid defined by:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"beginaligned\nr_n = sqrtcos^2left(n+tfrac12)pi2Nright + rho^2 sin^2left(n+tfrac12)pi2Nrightquadrm forquad 0le n Nquadrm and\ntheta_m = 2pi mMquadrm forquad 0le m M\nendaligned","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"we convert the function samples to Chebyshev×Fourier coefficients using plan_annulus_analysis; and finally, we transform the Chebyshev×Fourier coefficients to annulus polynomial coefficients using plan_ann2cxf.","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"For the storage pattern of the arrays, please consult the documentation.","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"using FastTransforms, LinearAlgebra, Plots\nconst GENFIGS = joinpath(pkgdir(FastTransforms), \"docs/src/generated\")\n!isdir(GENFIGS) && mkdir(GENFIGS)\nplotlyjs()","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"Plots.PlotlyJSBackend()","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"Our function f on the annulus:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"f = (x,y) -> x^3/(x^2+y^2-1/4)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"#1 (generic function with 1 method)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"The annulus polynomial degree:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"N = 8\nM = 4N-3","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"29","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"The annulus inner radius:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"ρ = 2/3","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"0.6666666666666666","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"The radial grid:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"r = [begin t = (N-n-0.5)/(2N); ct = sinpi(t); st = cospi(t); sqrt(ct^2+ρ^2*st^2) end for n in 0:N-1]","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"8-element Vector{Float64}:\n 0.9973277184004194\n 0.9763124517373388\n 0.9362410410518701\n 0.8811435628419545\n 0.8173313074308551\n 0.7535895152498838\n 0.7008983100472356\n 0.6706577864713554","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"The angular grid (mod pi):","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"θ = (0:M-1)*2/M","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"0.0:0.06896551724137931:1.9310344827586206","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"On the mapped tensor product grid, our function samples are:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"F = [f(r*cospi(θ), r*sinpi(θ)) for r in r, θ in θ]","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"8×29 Matrix{Float64}:\n 1.33215 1.24089 0.995869 0.672118 0.361447 0.136908 0.0255072 0.000211389 -0.00564085 -0.0675532 -0.235438 -0.509748 -0.838068 -1.13371 -1.30886 -1.30886 -1.13371 -0.838068 -0.509748 -0.235438 -0.0675532 -0.00564085 0.000211389 0.0255072 0.136908 0.361447 0.672118 0.995869 1.24089\n 1.32342 1.23275 0.989337 0.66771 0.359076 0.13601 0.0253399 0.000210003 -0.00560385 -0.0671101 -0.233894 -0.506405 -0.832572 -1.12628 -1.30028 -1.30028 -1.12628 -0.832572 -0.506405 -0.233894 -0.0671101 -0.00560385 0.000210003 0.0253399 0.13601 0.359076 0.66771 0.989337 1.23275\n 1.30981 1.22008 0.979168 0.660847 0.355385 0.134612 0.0250795 0.000207844 -0.00554625 -0.0664203 -0.23149 -0.5012 -0.824014 -1.1147 -1.28691 -1.28691 -1.1147 -0.824014 -0.5012 -0.23149 -0.0664203 -0.00554625 0.000207844 0.0250795 0.134612 0.355385 0.660847 0.979168 1.22008\n 1.29961 1.21057 0.97154 0.655698 0.352617 0.133563 0.0248841 0.000206225 -0.00550305 -0.0659028 -0.229687 -0.497295 -0.817594 -1.10601 -1.27689 -1.27689 -1.10601 -0.817594 -0.497295 -0.229687 -0.0659028 -0.00550305 0.000206225 0.0248841 0.133563 0.352617 0.655698 0.97154 1.21057\n 1.30613 1.21665 0.976415 0.658989 0.354386 0.134233 0.025009 0.00020726 -0.00553066 -0.0662336 -0.230839 -0.499791 -0.821697 -1.11156 -1.28329 -1.28329 -1.11156 -0.821697 -0.499791 -0.230839 -0.0662336 -0.00553066 0.00020726 0.025009 0.134233 0.354386 0.658989 0.976415 1.21665\n 1.34623 1.25399 1.00639 0.679218 0.365265 0.138354 0.0257767 0.000213622 -0.00570044 -0.0682668 -0.237925 -0.515133 -0.846922 -1.14569 -1.32269 -1.32269 -1.14569 -0.846922 -0.515133 -0.237925 -0.0682668 -0.00570044 0.000213622 0.0257767 0.138354 0.365265 0.679218 1.00639 1.25399\n 1.42719 1.32941 1.06692 0.720069 0.387234 0.146675 0.027327 0.00022647 -0.00604329 -0.0723726 -0.252235 -0.546115 -0.897858 -1.21459 -1.40224 -1.40224 -1.21459 -0.897858 -0.546115 -0.252235 -0.0723726 -0.00604329 0.00022647 0.027327 0.146675 0.387234 0.720069 1.06692 1.32941\n 1.5099 1.40645 1.12874 0.761795 0.409673 0.155175 0.0289105 0.000239594 -0.00639348 -0.0765664 -0.266852 -0.577762 -0.949887 -1.28498 -1.4835 -1.4835 -1.28498 -0.949887 -0.577762 -0.266852 -0.0765664 -0.00639348 0.000239594 0.0289105 0.155175 0.409673 0.761795 1.12874 1.40645","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"X = [r*cospi(θ) for r in r, θ in θ]\nY = [r*sinpi(θ) for r in r, θ in θ]\nscatter3d(vec(X), vec(Y), vec(0F); markersize=0.75, markercolor=:red)\nsurface!(X, Y, F; legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"annulus.html\"))","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/annulus.html\"","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"We precompute an Annulus–Chebyshev×Fourier plan:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"α, β, γ = 0, 0, 0\nP = plan_ann2cxf(F, α, β, γ, ρ)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"FastTransforms Annulus--Chebyshev×Fourier plan for 8×29-element array of Float64","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"And an FFTW Chebyshev×Fourier analysis plan on the annulus:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"PA = plan_annulus_analysis(F, ρ)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"FastTransforms plan for FFTW Chebyshev×Fourier analysis on the annulus for 8×29-element array of Float64","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"Its annulus coefficients are:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"U = P\\(PA*F)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"8×29 Matrix{Float64}:\n -1.22671e-17 2.92896e-17 0.926725 2.04896e-17 -7.722e-18 6.1888e-17 0.29418 -1.81602e-17 4.69005e-18 1.20498e-17 6.76339e-18 1.11857e-17 -1.99742e-17 -6.13512e-19 -4.02194e-17 6.23458e-17 3.04077e-17 3.12444e-17 -1.0558e-17 3.83711e-17 8.17668e-17 -1.08653e-17 5.99963e-17 -1.56088e-17 -4.23425e-17 -8.2245e-18 4.68313e-17 -3.30615e-17 -4.80225e-17\n -5.57014e-18 -2.254e-18 -0.124037 -5.91733e-18 3.70137e-17 -1.89099e-17 -0.0976704 1.024e-18 -2.07932e-18 -9.77876e-18 1.98227e-17 -1.04302e-17 7.22713e-18 -5.50321e-18 4.99656e-17 -4.01755e-17 -1.81639e-17 -2.52689e-17 1.66849e-17 -2.67731e-17 -6.74982e-17 5.4336e-18 -6.11451e-17 1.0013e-17 2.95944e-17 7.96412e-18 -5.49385e-17 2.50418e-17 4.69813e-17\n -2.33965e-17 1.12715e-18 0.042116 9.94105e-19 -1.44328e-17 9.15449e-18 0.0336531 3.6262e-19 1.34875e-17 7.39131e-18 -7.1196e-18 6.73552e-18 6.8403e-18 1.31493e-18 -1.89046e-17 2.30498e-17 5.34226e-18 1.03454e-17 -1.40577e-17 1.67754e-17 1.98659e-17 -8.57e-18 3.84689e-17 -1.14124e-17 -4.16632e-17 -5.45601e-18 3.66387e-17 -2.14064e-17 -4.31795e-17\n 2.21067e-18 4.00391e-18 -0.0139459 3.14722e-18 -1.97145e-18 5.82968e-18 -0.011224 6.26797e-18 2.18831e-17 6.88701e-18 -7.02346e-18 7.40166e-18 -2.2024e-18 9.55486e-18 4.62749e-18 2.9721e-18 -6.75798e-18 3.40533e-18 1.03823e-17 2.2961e-19 -1.52373e-17 7.73146e-18 -1.96827e-17 5.91455e-18 1.30222e-17 3.25478e-18 -1.53646e-17 8.18752e-18 6.59625e-18\n -1.96208e-17 7.71573e-19 0.00458845 -2.03822e-18 1.86344e-17 3.19547e-18 0.00369818 -1.86152e-18 -3.29302e-18 8.11326e-19 -4.97022e-21 -1.77139e-18 1.47439e-18 -6.8012e-18 2.63512e-18 -4.24712e-18 5.7017e-18 -7.2048e-18 7.38785e-18 -4.72462e-18 1.59607e-17 -5.27319e-18 1.44348e-17 -1.67467e-18 -4.59916e-19 8.00009e-19 5.99498e-18 -3.34661e-18 -2.03062e-18\n 1.3498e-17 1.71852e-19 -0.00150441 7.97602e-19 -9.38596e-18 -3.21855e-18 -0.00121128 -4.47164e-19 -1.76175e-17 -4.83245e-18 6.52956e-18 -5.47568e-18 5.27089e-18 -2.9175e-18 5.23985e-18 -5.70705e-18 -3.147e-18 -3.85137e-19 -3.05417e-18 -5.31797e-19 -4.09175e-18 3.59849e-18 4.48894e-18 3.4972e-18 1.74387e-18 1.53405e-18 8.8938e-18 4.33464e-18 5.85819e-18\n 5.24011e-17 -4.20047e-18 0.000517281 -2.62968e-18 1.29799e-17 -9.06153e-18 0.000424358 -4.57265e-18 2.49476e-18 -6.80939e-18 -6.07451e-18 -2.399e-18 1.03771e-18 6.6648e-19 -1.96393e-17 1.69496e-20 -1.42128e-18 5.37575e-18 -1.16727e-17 3.57204e-19 -7.01129e-18 2.48838e-18 -1.17285e-17 4.39475e-19 5.83824e-18 -1.63971e-18 -3.91773e-19 1.39577e-18 1.02075e-17\n -8.95802e-18 6.39707e-19 -0.000162126 3.55753e-18 7.44168e-18 4.28763e-18 -5.40419e-5 5.16629e-18 8.97839e-18 5.4486e-18 3.6724e-18 4.64571e-18 -1.67417e-18 6.04678e-19 5.73104e-18 -2.13942e-18 -1.44968e-17 -3.57457e-18 1.24167e-17 -5.67995e-18 -1.09651e-17 -4.98049e-18 6.22788e-18 -2.89642e-18 -1.52622e-17 -2.30036e-18 1.82749e-18 -1.26575e-18 -9.91876e-18","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"The annulus coefficients are useful for integration. The integral of f(xy)^2 over the annulus is approximately the square of the 2-norm of the coefficients:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"norm(U)^2, 5π/8*(1675/4536+9*log(3)/32-3*log(7)/32)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"(0.9735516844404257, 0.973547572736036)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/subspaceangles.jl\"","category":"page"},{"location":"generated/subspaceangles/#Subspace-angles-1","page":"Subspace angles","title":"Subspace angles","text":"","category":"section"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"This example considers the angles between neighbouring Laguerre polynomials with a perturbed measure:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"costheta_n = fraclangle L_n L_n+krangleL_n_2 L_n+k_2quadrm forquad 0le n N-k","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"where the inner product is defined by langle f grangle = int_0^infty f(x) g(x) x^beta e^-xrmdx.","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"We do so by connecting Laguerre polynomials to the normalized generalized Laguerre polynomials associated with the perturbed measure. It follows by the inner product of the connection coefficients that:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"costheta_n = frac(V^top V)_n n+ksqrt(V^top V)_n n(V^top V)_n+k n+k","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"using FastTransforms, LinearAlgebra","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"The neighbouring index k and the maximum degree N-1:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"k, N = 1, 11","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"(1, 11)","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"The Laguerre connection parameters:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"α, β = 0.0, 0.125","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"(0.0, 0.125)","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"We precompute a Laguerre–Laguerre plan:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"P = plan_lag2lag(Float64, N, α, β; norm2=true)","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"FastTransforms Laguerre--Laguerre plan for 11-element array of Float64","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"We apply the plan to the identity, followed by the adjoint plan:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"VtV = parent(P*I)\nlmul!(P', VtV)","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"11×11 Matrix{Float64}:\n 0.941743 -0.117718 -0.0515016 -0.0321885 -0.0231355 -0.01793 -0.0145681 -0.0122268 -0.0105074 -0.00919399 -0.00815966\n -0.117718 1.07418 -0.125995 -0.0539157 -0.0333201 -0.0237861 -0.0183502 -0.0148608 -0.0124417 -0.0106716 -0.00932328\n -0.0515016 -0.125995 1.14505 -0.131707 -0.0557687 -0.0342413 -0.024336 -0.0187146 -0.0151194 -0.0126345 -0.0108205\n -0.0321885 -0.0539157 -0.131707 1.19444 -0.136106 -0.0572798 -0.0350206 -0.0248132 -0.0190369 -0.0153515 -0.0128093\n -0.0231355 -0.0333201 -0.0557687 -0.136106 1.23272 -0.139703 -0.0585599 -0.0356975 -0.0252354 -0.0193261 -0.015562\n -0.01793 -0.0237861 -0.0342413 -0.0572798 -0.139703 1.26415 -0.142756 -0.059673 -0.0362968 -0.0256145 -0.0195886\n -0.0145681 -0.0183502 -0.024336 -0.0350206 -0.0585599 -0.142756 1.29092 -0.145414 -0.0606594 -0.0368352 -0.0259588\n -0.0122268 -0.0148608 -0.0187146 -0.0248132 -0.0356975 -0.059673 -0.145414 1.31429 -0.147773 -0.0615464 -0.0373246\n -0.0105074 -0.0124417 -0.0151194 -0.0190369 -0.0252354 -0.0362968 -0.0606594 -0.147773 1.33507 -0.149896 -0.062353\n -0.00919399 -0.0106716 -0.0126345 -0.0153515 -0.0193261 -0.0256145 -0.0368352 -0.0615464 -0.149896 1.3538 -0.151829\n -0.00815966 -0.00932328 -0.0108205 -0.0128093 -0.015562 -0.0195886 -0.0259588 -0.0373246 -0.062353 -0.151829 1.37089","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"From this matrix, the angles are recovered from:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"θ = [acos(VtV[n, n+k]/sqrt(VtV[n, n]*VtV[n+k, n+k])) for n in 1:N-k]","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"10-element Vector{Float64}:\n 1.6881063520094897\n 1.6846487354051982\n 1.6836556387180577\n 1.6831998143073255\n 1.6829427202726823\n 1.68277949501306\n 1.682667534322365\n 1.6825864250312665\n 1.6825252245704025\n 1.682477567030148","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/chebyshev.jl\"","category":"page"},{"location":"generated/chebyshev/#Chebyshev-transform-1","page":"Chebyshev transform","title":"Chebyshev transform","text":"","category":"section"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"This demonstrates the Chebyshev transform and inverse transform, explaining precisely the normalization and points","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"using FastTransforms\nn = 20","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"20","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"First kind points to first kind polynomials","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"p_1 = chebyshevpoints(Float64, n, Val(1))\nf = exp.(p_1)\nf̌ = chebyshevtransform(f, Val(1))\nf̃ = x -> [cos(k*acos(x)) for k=0:n-1]' * f̌\nf̃(0.1) ≈ exp(0.1)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"First kind polynomials to first kind points","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"ichebyshevtransform(f̌, Val(1)) ≈ exp.(p_1)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"Second kind points to first kind polynomials","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"p_2 = chebyshevpoints(Float64, n, Val(2))\nf = exp.(p_2)\nf̌ = chebyshevtransform(f, Val(2))\nf̃ = x -> [cos(k*acos(x)) for k=0:n-1]' * f̌\nf̃(0.1) ≈ exp(0.1)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"First kind polynomials to second kind points","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"ichebyshevtransform(f̌, Val(2)) ≈ exp.(p_2)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"First kind points to second kind polynomials","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"p_1 = chebyshevpoints(Float64, n, Val(1))\nf = exp.(p_1)\nf̌ = chebyshevutransform(f, Val(1))\nf̃ = x -> [sin((k+1)*acos(x))/sin(acos(x)) for k=0:n-1]' * f̌\nf̃(0.1) ≈ exp(0.1)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"Second kind polynomials to first kind points","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"ichebyshevutransform(f̌, Val(1)) ≈ exp.(p_1)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"Second kind points to second kind polynomials","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"p_2 = chebyshevpoints(Float64, n, Val(2))[2:n-1]\nf = exp.(p_2)\nf̌ = chebyshevutransform(f, Val(2))\nf̃ = x -> [sin((k+1)*acos(x))/sin(acos(x)) for k=0:n-3]' * f̌\nf̃(0.1) ≈ exp(0.1)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"Second kind polynomials to second kind points","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"ichebyshevutransform(f̌, Val(2)) ≈ exp.(p_2)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/triangle.jl\"","category":"page"},{"location":"generated/triangle/#Calculus-on-the-reference-triangle-1","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"","category":"section"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"In this example, we sample a bivariate function:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"f(xy) = frac11+x^2+y^2","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"on the reference triangle with vertices (00), (01), and (10) and analyze it in a Proriol series. Then, we find Proriol series for each component of its gradient by term-by-term differentiation of our expansion, and we compare them with the true Proriol series by sampling an exact expression for the gradient.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"We analyze f(xy) on an Ntimes M mapped tensor product grid defined by:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"beginaligned\nx = (1+u)2quadrm andquad y = (1-u)(1+v)4quad rm where\nu_n = cosleft(n+tfrac12)piNrightquadrm forquad 0le n Nquadrm and\nv_m = cosleft(m+tfrac12)piMrightquadrm forquad 0le m M\nendaligned","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"we convert the function samples to mapped Chebyshev² coefficients using plan_tri_analysis; and finally, we transform the mapped Chebyshev² coefficients to Proriol coefficients using plan_tri2cheb.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"For the storage pattern of the arrays, please consult the documentation.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"using FastTransforms, LinearAlgebra, Plots\nconst GENFIGS = joinpath(pkgdir(FastTransforms), \"docs/src/generated\")\n!isdir(GENFIGS) && mkdir(GENFIGS)\nplotlyjs()","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Plots.PlotlyJSBackend()","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Our function f and the Cartesian components of its gradient:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"f = (x,y) -> 1/(1+x^2+y^2)\nfx = (x,y) -> -2x/(1+x^2+y^2)^2\nfy = (x,y) -> -2y/(1+x^2+y^2)^2","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"#5 (generic function with 1 method)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"The polynomial degree:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"N = 15\nM = N","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"The parameters of the Proriol series:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"α, β, γ = 0, 0, 0","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"(0, 0, 0)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"The u grid:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"u = [sinpi((N-2n-1)/(2N)) for n in 0:N-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15-element Vector{Float64}:\n 0.9945218953682733\n 0.9510565162951536\n 0.8660254037844386\n 0.7431448254773942\n 0.5877852522924731\n 0.4067366430758002\n 0.20791169081775934\n 0.0\n -0.20791169081775934\n -0.4067366430758002\n -0.5877852522924731\n -0.7431448254773942\n -0.8660254037844386\n -0.9510565162951536\n -0.9945218953682733","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"And the v grid:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"v = [sinpi((M-2m-1)/(2M)) for m in 0:M-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15-element Vector{Float64}:\n 0.9945218953682733\n 0.9510565162951536\n 0.8660254037844386\n 0.7431448254773942\n 0.5877852522924731\n 0.4067366430758002\n 0.20791169081775934\n 0.0\n -0.20791169081775934\n -0.4067366430758002\n -0.5877852522924731\n -0.7431448254773942\n -0.8660254037844386\n -0.9510565162951536\n -0.9945218953682733","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Instead of using the utimes v grid, we use one with more accuracy near the origin. Defining x by:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"x = [sinpi((2N-2n-1)/(4N))^2 for n in 0:N-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15-element Vector{Float64}:\n 0.9972609476841365\n 0.9755282581475768\n 0.9330127018922194\n 0.8715724127386971\n 0.7938926261462365\n 0.7033683215379002\n 0.6039558454088797\n 0.4999999999999999\n 0.3960441545911204\n 0.2966316784620999\n 0.2061073738537634\n 0.12842758726130288\n 0.06698729810778066\n 0.024471741852423214\n 0.0027390523158633317","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"And w by:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"w = [sinpi((2M-2m-1)/(4M))^2 for m in 0:M-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15-element Vector{Float64}:\n 0.9972609476841365\n 0.9755282581475768\n 0.9330127018922194\n 0.8715724127386971\n 0.7938926261462365\n 0.7033683215379002\n 0.6039558454088797\n 0.4999999999999999\n 0.3960441545911204\n 0.2966316784620999\n 0.2061073738537634\n 0.12842758726130288\n 0.06698729810778066\n 0.024471741852423214\n 0.0027390523158633317","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"We see how the two grids are related:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"((1 .+ u)./2 ≈ x) * ((1 .- u).*(1 .+ v')/4 ≈ reverse(x).*w')","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"true","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"On the mapped tensor product grid, our function samples are:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"F = [f(x[n+1], x[N-n]*w[m+1]) for n in 0:N-1, m in 0:M-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15×15 Matrix{Float64}:\n 0.50137 0.50137 0.50137 0.50137 0.50137 0.50137 0.501371 0.501371 0.501371 0.501371 0.501371 0.501371 0.501371 0.501371 0.501371\n 0.512229 0.512236 0.512249 0.512266 0.512286 0.512308 0.512328 0.512346 0.512361 0.512372 0.512379 0.512383 0.512385 0.512385 0.512386\n 0.53334 0.533395 0.533499 0.53364 0.533806 0.533979 0.534145 0.534292 0.534412 0.5345 0.534558 0.534592 0.534607 0.534612 0.534613\n 0.56305 0.563274 0.563699 0.564281 0.564961 0.565675 0.566362 0.56697 0.567464 0.56783 0.568072 0.568211 0.568275 0.568295 0.568299\n 0.597903 0.598554 0.599792 0.601491 0.603486 0.60559 0.607622 0.609427 0.6109 0.611994 0.612719 0.613134 0.613325 0.613387 0.613397\n 0.632017 0.633527 0.636406 0.640382 0.645085 0.650086 0.654955 0.659315 0.662898 0.665571 0.66735 0.66837 0.668842 0.668995 0.669018\n 0.657568 0.660489 0.666088 0.673894 0.683237 0.693308 0.703247 0.712263 0.719753 0.725392 0.729168 0.731342 0.73235 0.732678 0.732728\n 0.667275 0.672082 0.681371 0.694488 0.710446 0.727971 0.745606 0.761905 0.775667 0.786165 0.79326 0.79737 0.799283 0.799904 0.799999\n 0.65806 0.664903 0.678251 0.69738 0.721111 0.74777 0.775252 0.801255 0.82368 0.841081 0.85299 0.859943 0.863194 0.864252 0.864414\n 0.632907 0.641519 0.658477 0.683152 0.714388 0.750331 0.788365 0.825306 0.857936 0.883766 0.901708 0.912284 0.917254 0.918876 0.919123\n 0.599054 0.608911 0.628482 0.657352 0.694582 0.738395 0.78593 0.833301 0.876165 0.910799 0.935231 0.94978 0.956655 0.958904 0.959246\n 0.564342 0.574908 0.59603 0.627532 0.668777 0.718232 0.773048 0.82891 0.880558 0.923076 0.953504 0.971796 0.980486 0.983334 0.983768\n 0.534691 0.545579 0.567447 0.600326 0.643856 0.69679 0.756419 0.818253 0.876403 0.924997 0.960184 0.981503 0.991676 0.995016 0.995526\n 0.513598 0.524591 0.546739 0.58021 0.624846 0.679621 0.74199 0.80742 0.869666 0.922224 0.960591 0.983966 0.995154 0.998833 0.999394\n 0.502741 0.513754 0.535975 0.569641 0.614694 0.670229 0.733797 0.800871 0.865052 0.919526 0.959458 0.983854 0.99555 0.999397 0.999985","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"X = [x for x in x, w in w]\nY = [x[N-n]*w[m+1] for n in 0:N-1, m in 0:M-1]\nscatter3d(vec(X), vec(Y), vec(0F); markersize=0.75, markercolor=:blue)\nsurface!(X, Y, F; legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"proriol.html\"))","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/proriol.html\"","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"We precompute a Proriol–Chebyshev² plan:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"P = plan_tri2cheb(F, α, β, γ)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"FastTransforms Proriol--Chebyshev² plan for 15×15-element array of Float64","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"And an FFTW Chebyshev² plan on the triangle:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"PA = plan_tri_analysis(F)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"FastTransforms plan for FFTW Chebyshev analysis on the triangle for 15×15-element array of Float64","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Its Proriol-(αβγ) coefficients are:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"U = P\\(PA*F)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15×15 Matrix{Float64}:\n 1.53694 -0.193325 -0.0251445 0.0109626 -0.000813095 -0.000299751 8.30397e-5 -1.59722e-6 -3.2141e-6 6.1667e-7 3.19775e-8 -3.21495e-8 4.17144e-9 6.97174e-10 -3.06613e-10\n -0.111616 0.0391775 -0.00636098 -0.000168172 0.000311296 -5.50434e-5 -2.99195e-6 2.97964e-6 -4.20688e-7 -5.4534e-8 2.85785e-8 -2.74994e-9 -7.77992e-10 2.56775e-10 -1.20763e-11\n -0.0620411 0.00717668 0.00153132 -0.000551474 4.1134e-5 1.40597e-5 -4.21186e-6 2.00844e-7 1.36869e-7 -3.34625e-8 3.38022e-10 1.36685e-9 -2.6459e-10 -1.30929e-11 1.45495e-11\n 0.0111316 -0.0036578 0.00043735 4.52913e-5 -2.72385e-5 3.78477e-6 3.57508e-7 -2.26663e-7 2.88459e-8 4.02905e-9 -1.98431e-9 2.01016e-10 4.97746e-11 -1.48758e-11 -2.03146e-12\n 0.00194132 -7.70184e-5 -0.000145948 3.68556e-5 -1.34273e-6 -1.26813e-6 3.06047e-7 -7.57685e-9 -1.11605e-8 2.45432e-9 -1.63544e-12 -1.03205e-10 9.8773e-12 5.45517e-12 -6.15774e-13\n -0.000642637 0.000243768 -2.28339e-5 -5.91216e-6 2.28045e-6 -2.36988e-7 -4.55496e-8 1.90448e-8 -1.91046e-9 -4.16463e-10 1.54281e-10 1.00975e-11 -8.91873e-12 -7.74998e-13 5.33203e-13\n -4.38389e-5 -1.71425e-5 1.23092e-5 -2.29813e-6 -6.48598e-8 1.17977e-7 -2.21226e-8 -4.58497e-10 1.02068e-9 -1.63471e-10 -4.64131e-11 6.91422e-12 3.5224e-12 -3.14298e-13 -2.28438e-13\n 2.79805e-5 -1.30453e-5 7.26152e-7 5.87656e-7 -1.71884e-7 1.12463e-8 5.13657e-9 -1.54461e-9 7.05239e-11 8.70592e-11 6.67156e-12 -5.87108e-12 -8.8146e-13 3.5065e-13 6.60112e-14\n 1.15026e-6 1.8828e-6 -8.87898e-7 1.24893e-7 1.74103e-8 -1.00961e-8 1.44036e-9 1.53829e-10 -9.59941e-11 -3.49153e-11 3.35895e-12 3.178e-12 -1.72628e-14 -2.20905e-13 -4.41417e-15\n -1.05261e-6 6.07061e-7 9.40225e-9 -4.93564e-8 1.14023e-8 -2.56371e-10 -4.79206e-10 1.50921e-11 6.48843e-11 1.18558e-11 -4.29767e-12 -1.50757e-12 2.19175e-13 1.20461e-13 -1.21213e-14\n -1.0706e-7 -1.2895e-7 5.63778e-8 -5.46716e-9 -1.98245e-9 6.62772e-10 1.96009e-10 -4.05866e-11 -3.72009e-11 -3.44512e-12 3.09917e-12 6.84678e-13 -1.9369e-13 -6.2004e-14 1.20543e-14\n 4.44232e-8 -2.74042e-8 -3.41194e-9 3.7536e-9 -3.47875e-10 -3.34332e-10 -7.92618e-11 2.84843e-11 1.87606e-11 8.64628e-13 -1.73542e-12 -2.9854e-13 1.16624e-13 2.95553e-14 -7.5397e-15\n 1.13247e-8 6.98157e-9 -3.2324e-9 -1.06114e-10 1.55319e-10 1.35282e-10 2.8768e-11 -1.28905e-11 -7.59282e-12 -1.99176e-13 7.32664e-13 1.12739e-13 -5.05664e-14 -1.1679e-14 3.30654e-15\n -2.57523e-9 1.14806e-9 1.12793e-10 2.51422e-11 -4.12541e-11 -3.49672e-11 -7.18293e-12 3.43673e-12 1.96276e-12 3.98594e-14 -1.91744e-13 -2.85196e-14 1.33316e-14 2.99912e-15 -8.74775e-16\n -7.03699e-10 -8.33285e-12 -8.53391e-12 -1.88826e-12 3.13558e-12 2.65053e-12 5.42528e-13 -2.61311e-13 -1.4878e-13 -2.93192e-15 1.45531e-14 2.15661e-15 -1.01287e-15 -2.27009e-16 6.63378e-17","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Similarly, our function's gradient samples are:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Fx = [fx(x[n+1], x[N-n]*w[m+1]) for n in 0:N-1, m in 0:M-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15×15 Matrix{Float64}:\n -0.501366 -0.501366 -0.501366 -0.501367 -0.501367 -0.501368 -0.501368 -0.501369 -0.501369 -0.501369 -0.501369 -0.501369 -0.501369 -0.50137 -0.50137\n -0.511916 -0.511929 -0.511955 -0.51199 -0.51203 -0.512073 -0.512114 -0.51215 -0.512179 -0.512201 -0.512215 -0.512223 -0.512227 -0.512228 -0.512228\n -0.530794 -0.530903 -0.53111 -0.531392 -0.531721 -0.532067 -0.532398 -0.532691 -0.532929 -0.533105 -0.533222 -0.533288 -0.533319 -0.533329 -0.53333\n -0.552621 -0.553061 -0.553896 -0.555039 -0.556378 -0.557787 -0.559142 -0.560343 -0.56132 -0.562044 -0.562524 -0.562798 -0.562924 -0.562965 -0.562972\n -0.567613 -0.568852 -0.571206 -0.574447 -0.578264 -0.582304 -0.586217 -0.589705 -0.59256 -0.594683 -0.596093 -0.5969 -0.597274 -0.597395 -0.597413\n -0.561915 -0.564604 -0.569746 -0.576887 -0.585391 -0.594503 -0.603442 -0.611504 -0.618167 -0.623163 -0.626498 -0.628414 -0.629303 -0.629591 -0.629635\n -0.522296 -0.526946 -0.535918 -0.548553 -0.563869 -0.580614 -0.59738 -0.612796 -0.625752 -0.635596 -0.64223 -0.646065 -0.647848 -0.648427 -0.648515\n -0.445256 -0.451694 -0.464267 -0.482314 -0.504734 -0.529941 -0.555929 -0.580499 -0.60166 -0.618055 -0.629262 -0.635798 -0.638853 -0.639847 -0.639998\n -0.343008 -0.350179 -0.364379 -0.385223 -0.411887 -0.442905 -0.476058 -0.508529 -0.537391 -0.560337 -0.576318 -0.585751 -0.590188 -0.591636 -0.591857\n -0.237644 -0.244156 -0.257234 -0.276874 -0.302772 -0.334005 -0.368724 -0.404089 -0.436673 -0.463364 -0.482369 -0.49375 -0.499145 -0.500911 -0.501181\n -0.14793 -0.152838 -0.162821 -0.178123 -0.198871 -0.22475 -0.254619 -0.286238 -0.316443 -0.341954 -0.360547 -0.371851 -0.377255 -0.37903 -0.379301\n -0.0818036 -0.0848957 -0.0912482 -0.101149 -0.114882 -0.132501 -0.153497 -0.176483 -0.199161 -0.218858 -0.233525 -0.242571 -0.246928 -0.248365 -0.248585\n -0.0383026 -0.0398784 -0.0431393 -0.0482832 -0.0555393 -0.0650468 -0.0766563 -0.0897011 -0.102903 -0.114631 -0.123518 -0.129064 -0.131754 -0.132643 -0.132779\n -0.0129105 -0.013469 -0.0146303 -0.0164765 -0.0191091 -0.0226062 -0.0269458 -0.0319076 -0.0370169 -0.0416263 -0.0451619 -0.0473866 -0.0484703 -0.0488293 -0.0488842\n -0.00138458 -0.00144591 -0.00157369 -0.0017776 -0.0020699 -0.0024608 -0.00294973 -0.00351363 -0.00409934 -0.00463189 -0.00504292 -0.00530263 -0.00542945 -0.0054715 -0.00547794","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"and:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Fy = [fy(x[n+1], x[N-n]*w[m+1]) for n in 0:N-1, m in 0:M-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15×15 Matrix{Float64}:\n -0.00137327 -0.00134334 -0.0012848 -0.00120019 -0.00109322 -0.000968569 -0.000831675 -0.000688523 -0.000545372 -0.000408476 -0.00028382 -0.000176851 -9.22448e-5 -3.36988e-5 -3.77181e-6\n -0.0128066 -0.0125278 -0.0119824 -0.0111941 -0.0101972 -0.00903524 -0.00775884 -0.0064238 -0.00508851 -0.00381138 -0.00264832 -0.00165022 -0.000860756 -0.000314451 -3.51956e-5\n -0.0380049 -0.0371844 -0.0355776 -0.0332524 -0.0303075 -0.0268691 -0.0230859 -0.0191228 -0.0151537 -0.0113536 -0.00789053 -0.00491728 -0.00256498 -0.000937054 -0.000104882\n -0.0812065 -0.0795001 -0.0761501 -0.0712824 -0.0650859 -0.0578104 -0.0497602 -0.0412837 -0.0327574 -0.0245665 -0.017084 -0.0106504 -0.00555645 -0.00203003 -0.000227217\n -0.146958 -0.144069 -0.138361 -0.129983 -0.119184 -0.106332 -0.0919169 -0.0765485 -0.0609267 -0.0457968 -0.0318962 -0.0199018 -0.0103872 -0.00379541 -0.000424822\n -0.236327 -0.232283 -0.224184 -0.212046 -0.195994 -0.176349 -0.153701 -0.128945 -0.103249 -0.0779568 -0.0544563 -0.0340361 -0.0177782 -0.00649768 -0.000727317\n -0.341557 -0.337089 -0.327887 -0.313516 -0.293548 -0.267799 -0.236589 -0.200921 -0.162512 -0.123634 -0.0868006 -0.0544092 -0.028458 -0.0104055 -0.00116482\n -0.444036 -0.44064 -0.433167 -0.420371 -0.400704 -0.372744 -0.335756 -0.290249 -0.238284 -0.183335 -0.129696 -0.0816541 -0.042795 -0.0156582 -0.00175299\n -0.521645 -0.520944 -0.518445 -0.512009 -0.498657 -0.475067 -0.438456 -0.387746 -0.32456 -0.253471 -0.181141 -0.114718 -0.0602899 -0.0220791 -0.00247217\n -0.561955 -0.56477 -0.56909 -0.572203 -0.569958 -0.557059 -0.528047 -0.479085 -0.410077 -0.325915 -0.235743 -0.15036 -0.0792838 -0.0290664 -0.00325507\n -0.568241 -0.574301 -0.585148 -0.597987 -0.608136 -0.608908 -0.592332 -0.551271 -0.482733 -0.39071 -0.286235 -0.183948 -0.0973409 -0.0357278 -0.00400177\n -0.553639 -0.562044 -0.577773 -0.598286 -0.618953 -0.632479 -0.629146 -0.598851 -0.535295 -0.440581 -0.326642 -0.211418 -0.112256 -0.0412478 -0.00462083\n -0.532026 -0.541842 -0.560603 -0.586131 -0.614126 -0.637241 -0.644834 -0.624688 -0.567634 -0.473605 -0.354585 -0.230866 -0.122928 -0.0452109 -0.00506551\n -0.513246 -0.523783 -0.544148 -0.572459 -0.604752 -0.633849 -0.648741 -0.635973 -0.584411 -0.492221 -0.371057 -0.242599 -0.129432 -0.0476343 -0.00533757\n -0.502731 -0.513558 -0.534584 -0.564086 -0.5983 -0.630184 -0.648628 -0.639638 -0.591107 -0.500247 -0.378429 -0.247947 -0.132421 -0.0487506 -0.00546294","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"For the partial derivative with respect to x, Olver et al. derive simple expressions for the representation of this component using a Proriol-(α+1βγ+1) series.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Gx = zeros(Float64, N, M)\nfor m = 0:M-2\n for n = 0:N-2\n cf1 = m == 0 ? sqrt((n+1)*(n+2m+α+β+γ+3)/(2m+β+γ+2)*(m+γ+1)*8) : sqrt((n+1)*(n+2m+α+β+γ+3)/(2m+β+γ+1)*(m+β+γ+1)/(2m+β+γ+2)*(m+γ+1)*8)\n cf2 = sqrt((n+α+1)*(m+1)/(2m+β+γ+2)*(m+β+1)/(2m+β+γ+3)*(n+2m+β+γ+3)*8)\n Gx[n+1, m+1] = cf1*U[n+2, m+1] + cf2*U[n+1, m+2]\n end\nend\nPx = plan_tri2cheb(Fx, α+1, β, γ+1)\nUx = Px\\(PA*Fx)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15×15 Matrix{Float64}:\n -0.773299 0.0719368 0.0119032 -0.00401514 0.00019856 0.000113662 -2.54579e-5 -2.37734e-7 1.03154e-6 -1.60364e-7 -1.48715e-8 9.00448e-9 -8.97984e-10 -2.25712e-10 7.08345e-11\n -0.223004 0.012725 0.00860848 -0.00187243 -6.32049e-5 8.83801e-5 -1.1938e-5 -1.70295e-6 7.84936e-7 -6.04351e-8 -2.29491e-8 6.45891e-9 -1.23274e-10 -2.55873e-10 5.02863e-11\n 0.11832 -0.0184961 -0.000231272 0.000708416 -0.000135183 -8.87531e-7 5.70658e-6 -1.08175e-6 -3.24208e-8 5.24395e-8 -8.50439e-9 -6.81366e-10 4.94759e-10 -5.56212e-11 -1.16264e-11\n -0.00167066 0.00241796 -0.00105495 0.000134423 2.32113e-5 -1.10992e-5 1.1835e-6 2.55024e-7 -1.00326e-7 8.05316e-9 2.80938e-9 -8.7387e-10 3.23657e-11 3.71003e-11 -4.71068e-12\n -0.00812992 0.00143193 9.5529e-5 -8.6497e-5 1.46322e-5 6.06568e-7 -7.52503e-7 1.2809e-7 6.41825e-9 -6.76798e-9 1.05309e-9 1.02809e-10 -6.38887e-11 -4.60392e-12 3.43243e-12\n 0.00134269 -0.000440563 9.61255e-5 -3.9763e-6 -4.07863e-6 1.16773e-6 -7.04875e-8 -3.76919e-8 1.09538e-8 -5.76688e-10 -3.72602e-10 6.21711e-11 2.34835e-11 -3.2882e-12 -1.02884e-12\n 0.000287063 -5.03055e-5 -1.79725e-5 8.218e-6 -1.05921e-6 -1.54886e-7 8.35392e-8 -1.11246e-8 -1.37121e-9 7.34787e-10 2.35493e-11 -4.77271e-11 -3.34076e-12 2.78949e-12 2.71211e-14\n -0.000114154 3.91247e-5 -6.41411e-6 -4.57437e-7 4.91696e-7 -1.01409e-7 1.49415e-12 4.73486e-9 -8.87703e-10 -2.29361e-10 4.39281e-11 2.01683e-11 -2.11614e-12 -1.32214e-12 2.00992e-13\n 6.85033e-7 -1.42592e-6 2.06904e-6 -6.34246e-7 4.7282e-8 2.34694e-8 -7.6778e-9 5.5085e-10 4.78984e-10 2.64819e-11 -3.78611e-11 -5.1067e-12 2.54966e-12 4.06715e-13 -1.864e-13\n 5.33318e-6 -2.34997e-6 2.9001e-7 9.45302e-8 -4.55097e-8 7.14241e-9 5.63984e-10 -6.44351e-10 -2.12017e-10 3.18388e-11 2.34425e-11 -6.60806e-13 -1.88678e-12 -1.3375e-14 1.29399e-13\n -7.178e-7 3.37971e-7 -1.76689e-7 3.81304e-8 -1.11295e-9 -2.48346e-9 1.24297e-10 4.4888e-10 8.62743e-11 -3.44107e-11 -1.28198e-11 1.79781e-12 1.16066e-12 -8.54664e-14 -7.76696e-14\n -1.15794e-7 9.93748e-8 -5.08059e-9 -9.45944e-9 2.65499e-9 1.0741e-9 -1.63514e-10 -2.32795e-10 -3.2556e-11 2.03989e-11 5.96492e-12 -1.21808e-12 -5.75474e-13 6.48293e-14 3.81294e-14\n 3.9894e-8 -2.50603e-8 1.18665e-8 -3.69658e-10 -9.43959e-10 -3.54061e-10 7.05516e-11 8.25944e-11 9.98239e-12 -7.57296e-12 -2.02892e-12 4.70119e-13 2.00988e-13 -2.57424e-14 -1.32678e-14\n -2.62946e-9 -2.09989e-9 -2.15583e-10 7.49659e-11 1.79606e-10 6.58835e-11 -1.40885e-11 -1.57067e-11 -1.81381e-12 1.45833e-12 3.81132e-13 -9.14684e-14 -3.80521e-14 5.0455e-15 2.50858e-15\n -2.54665e-10 1.01738e-11 9.71511e-12 -3.41148e-12 -8.12007e-12 -2.97149e-12 6.40143e-13 7.10069e-13 8.15917e-14 -6.60158e-14 -1.72077e-14 4.14496e-15 1.71962e-15 -2.2876e-16 -1.13402e-16","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"For the partial derivative with respect to y, the analogous formulae result in a Proriol-(αβ+1γ+1) series.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Gy = zeros(Float64, N, M)\nfor m = 0:M-2\n for n = 0:N-2\n Gy[n+1, m+1] = 4*sqrt((m+1)*(m+β+γ+2))*U[n+1, m+2]\n end\nend\nPy = plan_tri2cheb(Fy, α, β+1, γ+1)\nUy = Py\\(PA*Fy)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15×15 Matrix{Float64}:\n -1.09361 -0.246364 0.151902 -0.0145451 -0.00656722 0.00215264 -4.78099e-5 -0.00010909 2.3401e-5 1.34141e-6 -1.47744e-6 2.0787e-7 3.67354e-8 -1.65807e-8 1.30376e-9\n 0.221621 -0.0623246 -0.00233026 0.00556863 -0.00120594 -7.75602e-5 8.91904e-5 -1.42786e-5 -2.06939e-6 1.19894e-6 -1.26335e-7 -3.89258e-8 1.42118e-8 -5.60413e-10 -5.94789e-10\n 0.0405975 0.0150038 -0.00764145 0.000735827 0.000308032 -0.000109184 6.01193e-6 4.6455e-6 -1.26982e-6 1.41852e-8 6.28061e-8 -1.31763e-8 -5.9232e-10 7.38193e-10 -7.35368e-11\n -0.0206916 0.00428514 0.000627575 -0.000487257 8.29203e-5 9.26771e-6 -6.78478e-6 9.79044e-7 1.52891e-7 -8.32462e-8 9.23683e-9 2.37699e-9 -9.33549e-10 -2.54744e-11 5.13027e-11\n -0.000435682 -0.00142999 0.000510686 -2.40196e-5 -2.77834e-5 7.93359e-6 -2.26768e-7 -3.78776e-7 9.31367e-8 -7.2912e-11 -4.72764e-9 9.19194e-10 1.83342e-10 -5.07975e-11 -9.73934e-12\n 0.00137896 -0.000223726 -8.19213e-5 4.07942e-5 -5.19191e-6 -1.18071e-6 5.70025e-7 -6.48815e-8 -1.5805e-8 6.74933e-9 -5.22325e-10 -3.74577e-10 2.04346e-11 2.31629e-11 -1.45177e-12\n -9.69728e-5 0.000120605 -3.18437e-5 -1.1605e-6 2.58441e-6 -5.73589e-7 -1.36421e-8 3.47148e-8 -6.95597e-9 -3.86259e-10 4.86604e-10 7.26716e-11 -3.26991e-11 -5.56081e-12 2.18954e-12\n -7.37954e-5 7.11448e-6 8.14267e-6 -3.07439e-6 2.46945e-7 1.33361e-7 -4.63869e-8 3.49405e-9 1.69907e-9 -3.52262e-10 -2.0628e-10 1.07045e-11 1.73416e-11 -1.8863e-13 -1.24582e-12\n 1.06509e-5 -8.69913e-6 1.73077e-6 3.10766e-7 -2.22347e-7 3.70118e-8 3.9365e-9 -2.94133e-9 -2.1645e-10 2.94085e-10 6.42746e-11 -2.03559e-11 -6.99253e-12 1.20561e-12 5.53977e-13\n 3.43376e-6 9.14735e-8 -6.84306e-7 2.05405e-7 -4.3435e-9 -1.35246e-8 2.85641e-9 1.15843e-9 -9.56842e-11 -1.59766e-10 -1.45705e-11 1.36984e-11 2.42348e-12 -9.13606e-13 -2.1722e-13\n -7.29088e-7 5.54006e-7 -7.49665e-8 -3.61409e-8 1.78364e-8 -4.16571e-10 -1.36673e-9 -4.10814e-10 8.7904e-11 6.99201e-11 1.76879e-12 -6.65703e-12 -7.49913e-13 4.67293e-13 7.67801e-14\n -1.56131e-7 -3.60972e-8 5.21717e-8 -9.4804e-9 -1.42828e-9 2.71687e-10 4.84151e-10 1.24081e-10 -3.76632e-11 -2.38535e-11 1.8587e-13 2.38967e-12 2.02458e-13 -1.7174e-13 -2.30964e-14\n 4.09267e-8 -3.39594e-8 -3.06743e-9 7.64151e-10 3.1345e-10 -7.59843e-11 -1.14715e-10 -2.73663e-11 9.55255e-12 5.56757e-12 -1.22703e-13 -5.69904e-13 -4.18788e-14 4.1357e-14 5.08049e-15\n 8.57039e-9 6.52951e-9 -7.39973e-11 -9.29778e-11 -3.74097e-11 9.74901e-12 1.40429e-11 3.27131e-12 -1.19385e-12 -6.78321e-13 1.80885e-14 6.99172e-14 4.88939e-15 -5.08953e-15 -6.06728e-16\n -2.86296e-9 1.21911e-13 2.03235e-12 2.54849e-12 1.02299e-12 -2.68873e-13 -3.8519e-13 -8.94733e-14 3.28268e-14 1.85955e-14 -5.06217e-16 -1.9183e-15 -1.33318e-16 1.39692e-16 1.65859e-17","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"The 2-norm relative error in differentiating the Proriol series for f(xy) term-by-term and its sampled gradient is:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"hypot(norm(Ux-Gx), norm(Uy-Gy))/hypot(norm(Ux), norm(Uy))","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"1.8769900773500217e-8","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"This error can be improved upon by increasing N and M.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/nonlocaldiffusion.jl\"","category":"page"},{"location":"generated/nonlocaldiffusion/#Nonlocal-diffusion-on-\\mathbb{S}2-1","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"","category":"section"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"This example calculates the spectrum of the nonlocal diffusion operator:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"mathcalL_delta u = int_mathbbS^2 rho_delta(mathbfx-mathbfy)leftu(mathbfx) - u(mathbfy)right mathrmdOmega(mathbfy)","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"defined in Eq. (2) of","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"R. M. Slevinsky, H. Montanelli, and Q. Du, A spectral method for nonlocal diffusion operators on the sphere, J. Comp. Phys., 372:893–911, 2018.","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"In the above, 0delta2, -1alpha1, and the kernel:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"rho_delta(mathbfx-mathbfy) = frac4(1+alpha)pi delta^2+2alpha fracchi_0delta(mathbfx-mathbfy)mathbfx-mathbfy^2-2alpha","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"where chi_I(cdot) is the indicator function on the set I.","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"This nonlocal operator is diagonalized by spherical harmonics:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"mathcalL_delta Y_ell^m(mathbfx) = lambda_ell(alpha delta) Y_ell^m(mathbfx)","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"and its eigenfunctions are given by the generalized Funk–Hecke formula:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"lambda_ell(alpha delta) = frac(1+alpha) 2^2+alphadelta^2+2alphaint_1-delta^22^1 leftP_ell(t)-1right (1-t)^alpha-1 mathrmd t","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"In the paper, the authors use Clenshaw–Curtis quadrature and asymptotic evaluation of Legendre polynomials to achieve mathcalO(n^2log n) complexity for the evaluation of the first n eigenvalues. With a change of basis, this complexity can be reduced to mathcalO(nlog n).","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"First, we represent:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"P_n(t) - 1 = sum_j=0^n-1 leftP_j+1(t) - P_j(t)right = -sum_j=0^n-1 (1-t) P_j^(10)(t)","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"Then, we represent P_j^(10)(t) with Jacobi polynomials P_i^(alpha0)(t) and we integrate using DLMF 18.9.16:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"int_x^1 P_i^(alpha0)(t)(1-t)^alphamathrmdt = left beginarraycc frac(1-x)^alpha+1alpha+1 mathrmfori=0 frac12i(1-x)^alpha+1(1+x)P_i-1^(alpha+11)(x) mathrmfori0endarrayright","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"The code below implements this algorithm, making use of the Jacobi–Jacobi transform plan_jac2jac. For numerical stability, the conversion from Jacobi polynomials P_j^(10)(t) to P_i^(alpha0)(t) is divided into conversion from P_j^(10)(t) to P_k^(00)(t), before conversion from P_k^(00)(t) to P_i^(alpha0)(t).","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"using FastTransforms, LinearAlgebra\n\nfunction oprec!(n::Integer, v::AbstractVector, alpha::Real, delta2::Real)\n if n > 0\n v[1] = 1\n end\n if n > 1\n v[2] = (4*alpha+8-(alpha+4)*delta2)/4\n end\n for i = 1:n-2\n v[i+2] = (((2*i+alpha+2)*(2*i+alpha+4)+alpha*(alpha+2))/(2*(i+1)*(2*i+alpha+2))*(2*i+alpha+3)/(i+alpha+3) - delta2/4*(2*i+alpha+3)/(i+1)*(2*i+alpha+4)/(i+alpha+3))*v[i+1] - (i+alpha+1)/(i+alpha+3)*(2*i+alpha+4)/(2*i+alpha+2)*v[i]\n end\n return v\nend\n\nfunction evaluate_lambda(n::Integer, alpha::T, delta::T) where T\n delta2 = delta*delta\n scl = (1+alpha)*(2-delta2/2)\n\n lambda = Vector{T}(undef, n)\n\n if n > 0\n lambda[1] = 0\n end\n if n > 1\n lambda[2] = -2\n end\n\n oprec!(n-2, view(lambda, 3:n), alpha, delta2)\n\n for i = 2:n-1\n lambda[i+1] *= -scl/(i-1)\n end\n\n p = plan_jac2jac(T, n-1, zero(T), zero(T), alpha, zero(T))\n\n lmul!(p', view(lambda, 2:n))\n\n for i = 2:n-1\n lambda[i+1] = ((2i-1)*lambda[i+1] + (i-1)*lambda[i])/i\n end\n\n for i = 2:n-1\n lambda[i+1] += lambda[i]\n end\n\n return lambda\nend","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"evaluate_lambda (generic function with 1 method)","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"The spectrum in Float64:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"lambda = evaluate_lambda(10, -0.5, 1.0)","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"10-element Vector{Float64}:\n 0.0\n -2.0\n -5.5\n -9.75\n -14.09375\n -18.203125\n -22.08984375\n -25.935546875\n -29.8870849609375\n -33.95416259765625","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"The spectrum in BigFloat:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"lambdabf = evaluate_lambda(10, parse(BigFloat, \"-0.5\"), parse(BigFloat, \"1.0\"))","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"10-element Vector{BigFloat}:\n 0.0\n -2.0\n -5.5\n -9.75\n -14.09375\n -18.203125\n -22.08984375\n -25.935546875\n -29.8870849609375\n -33.95416259765625","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"The infty-norm relative error:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"norm(lambda-lambdabf, Inf)/norm(lambda, Inf)","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"0.0","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/disk.jl\"","category":"page"},{"location":"generated/disk/#Holomorphic-integration-on-the-unit-disk-1","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"","category":"section"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"In this example, we explore integration of a harmonic function:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":" f(xy) = fracx^2-y^2+1(x^2-y^2+1)^2+(2xy+1)^2","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"over the unit disk. In this case, we know from complex analysis that the integral of a holomorphic function is equal to pi times f(00). We analyze the function on an Ntimes M tensor product grid defined by:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"beginaligned\nr_n = cosleft(n+tfrac12)pi2Nrightquadrm forquad 0le n Nquadrm and\ntheta_m = 2pi mMquadrm forquad 0le m M\nendaligned","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"we convert the function samples to Chebyshev×Fourier coefficients using plan_disk_analysis; and finally, we transform the Chebyshev×Fourier coefficients to Zernike polynomial coefficients using plan_disk2cxf.","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"For the storage pattern of the arrays, please consult the documentation.","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"using FastTransforms, LinearAlgebra, Plots\nconst GENFIGS = joinpath(pkgdir(FastTransforms), \"docs/src/generated\")\n!isdir(GENFIGS) && mkdir(GENFIGS)\nplotlyjs()","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Plots.PlotlyJSBackend()","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Our function f on the disk:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"f = (x,y) -> (x^2-y^2+1)/((x^2-y^2+1)^2+(2x*y+1)^2)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"#1 (generic function with 1 method)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The Zernike polynomial degree:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"N = 15\nM = 4N-3","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"57","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The radial grid:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"r = [sinpi((N-n-0.5)/(2N)) for n in 0:N-1]","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"15-element Vector{Float64}:\n 0.9986295347545738\n 0.9876883405951378\n 0.9659258262890683\n 0.9335804264972017\n 0.8910065241883678\n 0.838670567945424\n 0.7771459614569709\n 0.7071067811865475\n 0.6293203910498375\n 0.5446390350150271\n 0.45399049973954675\n 0.35836794954530027\n 0.25881904510252074\n 0.15643446504023087\n 0.052335956242943835","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The angular grid (mod pi):","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"θ = (0:M-1)*2/M","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"0.0:0.03508771929824561:1.9649122807017543","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"On the mapped tensor product grid, our function samples are:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"F = [f(r*cospi(θ), r*sinpi(θ)) for r in r, θ in θ]","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"15×57 Matrix{Float64}:\n 0.400329 0.36696 0.336645 0.308443 0.281619 0.25557 0.22977 0.203733 0.176996 0.149111 0.119689 0.0885456 0.0561428 0.0249494 0.00382185 0.0233794 0.192001 0.82415 1.84146 1.85719 1.41721 1.08969 0.879424 0.739148 0.639757 0.565314 0.506844 0.459027 0.418538 0.383193 0.351486 0.32233 0.294899 0.268532 0.24267 0.216811 0.190481 0.163223 0.134611 0.104328 0.0724218 0.0400826 0.0120549 0.00476215 0.075801 0.422295 1.37342 1.98551 1.63411 1.23553 0.973247 0.802761 0.685557 0.600091 0.534475 0.481845 0.438023\n 0.402946 0.369531 0.339215 0.31106 0.284337 0.258454 0.232899 0.207211 0.180965 0.153777 0.125364 0.0957188 0.0656309 0.0381784 0.0233592 0.0535023 0.23469 0.838287 1.74173 1.78814 1.39763 1.08662 0.881061 0.742049 0.642889 0.56837 0.509752 0.461793 0.421195 0.385781 0.35405 0.324917 0.297559 0.271324 0.245665 0.220098 0.194183 0.16751 0.139734 0.110675 0.0806214 0.0512076 0.0280171 0.0289628 0.112787 0.46247 1.32844 1.88443 1.59532 1.22668 0.973254 0.805245 0.688639 0.603204 0.53746 0.48468 0.44073\n 0.408107 0.374635 0.344345 0.316308 0.289809 0.264275 0.239228 0.214259 0.189018 0.16325 0.136874 0.110236 0.0847405 0.0645701 0.0616188 0.110283 0.308499 0.852043 1.57431 1.65952 1.35481 1.07725 0.882418 0.74674 0.648492 0.574076 0.515313 0.467166 0.426411 0.390904 0.359157 0.330094 0.302904 0.276953 0.251718 0.226757 0.201691 0.176211 0.150131 0.123537 0.0971828 0.0735249 0.059617 0.0756242 0.180187 0.525812 1.24639 1.70902 1.5172 1.20513 0.970751 0.808756 0.693948 0.608911 0.543108 0.490146 0.446017\n 0.415648 0.382189 0.352011 0.324209 0.298096 0.273134 0.248897 0.225051 0.201367 0.177773 0.154485 0.132336 0.113545 0.103633 0.116351 0.186253 0.393918 0.849832 1.38148 1.49082 1.28527 1.05638 0.879972 0.751049 0.655222 0.581588 0.52299 0.474802 0.433974 0.398441 0.366752 0.33786 0.310977 0.2855 0.260948 0.236942 0.213198 0.189555 0.166059 0.143176 0.122289 0.106906 0.105724 0.140558 0.26534 0.588182 1.1413 1.4992 1.40336 1.16548 0.961348 0.810521 0.699782 0.616152 0.550745 0.497814 0.453615\n 0.425289 0.392035 0.362148 0.334773 0.309271 0.285158 0.262081 0.239809 0.218269 0.197619 0.178435 0.162105 0.151689 0.153844 0.183081 0.270225 0.470832 0.826183 1.19548 1.30726 1.19053 1.01926 0.869418 0.751971 0.661094 0.589601 0.531924 0.48414 0.443527 0.408177 0.376729 0.348191 0.321822 0.297066 0.273507 0.250853 0.228945 0.20781 0.187783 0.169776 0.15586 0.150546 0.163666 0.216532 0.352149 0.631169 1.0287 1.29056 1.26502 1.10458 0.940232 0.806897 0.703689 0.623316 0.559314 0.506989 0.463072\n 0.436597 0.403911 0.374626 0.347975 0.323392 0.300472 0.278957 0.258746 0.239942 0.222959 0.208736 0.199165 0.19792 0.212076 0.254963 0.349717 0.526163 0.785631 1.03278 1.13127 1.07899 0.964458 0.847102 0.746235 0.663661 0.596384 0.540917 0.494365 0.454527 0.419771 0.388896 0.361011 0.335454 0.311744 0.289549 0.268688 0.249152 0.23118 0.215414 0.203195 0.197165 0.20243 0.228745 0.293986 0.426183 0.648643 0.920719 1.10477 1.11859 1.02459 0.904279 0.794291 0.702811 0.628337 0.567372 0.51668 0.47372\n 0.448951 0.417414 0.389209 0.363706 0.340449 0.319139 0.299632 0.28197 0.266434 0.253672 0.244908 0.242329 0.249735 0.273549 0.32399 0.414856 0.556748 0.73654 0.898135 0.976631 0.96284 0.895308 0.811683 0.731268 0.660475 0.599969 0.54849 0.504405 0.466222 0.432719 0.402938 0.376152 0.351819 0.329563 0.309162 0.29056 0.273906 0.259647 0.248682 0.242655 0.244458 0.259053 0.294635 0.36347 0.47935 0.644419 0.824368 0.950029 0.979333 0.933025 0.853895 0.770471 0.694553 0.628995 0.573203 0.525623 0.484659\n 0.461538 0.431966 0.405508 0.381723 0.360304 0.341079 0.324035 0.309345 0.297441 0.289121 0.285721 0.289387 0.303423 0.332641 0.383252 0.461146 0.566675 0.686278 0.79016 0.848441 0.853234 0.818825 0.765072 0.706268 0.649804 0.598546 0.553073 0.513009 0.477665 0.446331 0.418379 0.393304 0.370732 0.350422 0.332279 0.316375 0.303005 0.292765 0.286694 0.286496 0.294846 0.315771 0.354858 0.418544 0.510882 0.626287 0.742362 0.826153 0.856971 0.839629 0.793294 0.735701 0.677489 0.623454 0.575098 0.532405 0.494793\n 0.473406 0.446815 0.422943 0.401579 0.382592 0.365953 0.35177 0.340321 0.332115 0.327962 0.329086 0.337225 0.354715 0.384367 0.428886 0.489368 0.562769 0.639621 0.705232 0.746138 0.75726 0.742897 0.711918 0.672777 0.631361 0.591026 0.553364 0.51894 0.487799 0.459755 0.434554 0.411958 0.391793 0.373976 0.358542 0.345678 0.33577 0.329466 0.327769 0.332147 0.344633 0.367837 0.404636 0.457191 0.524883 0.601613 0.674803 0.729338 0.755332 0.752747 0.728907 0.692933 0.652092 0.610928 0.571808 0.535736 0.502968\n 0.483592 0.461074 0.44072 0.422552 0.406616 0.393018 0.381958 0.373761 0.368913 0.368096 0.372211 0.382374 0.399829 0.425704 0.460521 0.503436 0.551426 0.599039 0.639428 0.66664 0.677821 0.673802 0.657934 0.634338 0.606657 0.577562 0.548776 0.521299 0.49565 0.472064 0.450625 0.431361 0.4143 0.399515 0.387153 0.377475 0.370881 0.36795 0.369472 0.37646 0.390112 0.411659 0.442005 0.481097 0.527085 0.575698 0.62056 0.654949 0.674261 0.67754 0.667091 0.646854 0.620817 0.592158 0.563054 0.534833 0.508227\n 0.491347 0.47384 0.457857 0.443596 0.43124 0.420991 0.413088 0.407835 0.405607 0.406854 0.41208 0.421791 0.436393 0.456016 0.480289 0.508089 0.537411 0.565495 0.589313 0.606297 0.614986 0.615273 0.608182 0.595383 0.578689 0.55973 0.539808 0.519875 0.500596 0.482417 0.465645 0.450499 0.437168 0.425839 0.416729 0.410109 0.406316 0.405766 0.408937 0.416345 0.428463 0.445585 0.467622 0.493853 0.522719 0.551798 0.578117 0.598782 0.611716 0.616137 0.612554 0.602381 0.587414 0.569403 0.549822 0.529795 0.510121\n 0.496372 0.484362 0.473263 0.463344 0.454844 0.447987 0.442992 0.440085 0.43949 0.441422 0.446059 0.453506 0.463734 0.476516 0.491364 0.507491 0.523832 0.539138 0.552155 0.561824 0.567461 0.568845 0.566188 0.560036 0.551118 0.54022 0.528088 0.515374 0.502621 0.490272 0.478681 0.468141 0.458903 0.451197 0.445243 0.441264 0.439485 0.440128 0.443394 0.44943 0.458281 0.469829 0.483724 0.499329 0.51571 0.531695 0.546006 0.557461 0.565171 0.568681 0.567994 0.563506 0.555873 0.545868 0.534265 0.521767 0.508973\n 0.498951 0.492196 0.485875 0.480211 0.475399 0.471612 0.469002 0.467693 0.467782 0.469331 0.472348 0.476782 0.482503 0.489293 0.496841 0.504746 0.512549 0.519761 0.525915 0.530618 0.533588 0.534687 0.533917 0.531408 0.527389 0.522155 0.516029 0.509344 0.502414 0.495534 0.488967 0.482948 0.477687 0.473367 0.470152 0.468178 0.467558 0.468372 0.470657 0.474394 0.479493 0.485782 0.492995 0.500776 0.508691 0.516259 0.522997 0.528468 0.532332 0.534375 0.53453 0.532867 0.52957 0.524904 0.519183 0.512736 0.505891\n 0.499854 0.497256 0.494799 0.492592 0.490727 0.489288 0.488339 0.487926 0.488075 0.488789 0.490046 0.491797 0.493969 0.496462 0.499157 0.501918 0.5046 0.507061 0.509167 0.510805 0.511889 0.512367 0.512222 0.51147 0.510163 0.508376 0.506206 0.503765 0.501171 0.498544 0.496003 0.493658 0.491611 0.48995 0.488749 0.488063 0.48793 0.488363 0.489352 0.490864 0.492836 0.495182 0.497793 0.500538 0.503278 0.505867 0.508166 0.51005 0.51142 0.512206 0.512372 0.511919 0.510882 0.509324 0.507332 0.505012 0.502479\n 0.499998 0.4997 0.499416 0.49916 0.498945 0.498781 0.498675 0.498633 0.498657 0.498746 0.498895 0.499098 0.499346 0.499625 0.499922 0.500224 0.500515 0.500781 0.50101 0.501189 0.50131 0.501367 0.501358 0.501283 0.501146 0.500953 0.500715 0.500442 0.500148 0.499848 0.499555 0.499284 0.499047 0.498856 0.49872 0.498646 0.498637 0.498693 0.498813 0.498991 0.499217 0.499482 0.499772 0.500074 0.500372 0.500652 0.500901 0.501106 0.501257 0.501347 0.501371 0.501328 0.501222 0.501056 0.500839 0.500582 0.500297","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"X = [r*cospi(θ) for r in r, θ in θ]\nY = [r*sinpi(θ) for r in r, θ in θ]\nscatter3d(vec(X), vec(Y), vec(0F); markersize=0.75, markercolor=:red)\nsurface!(X, Y, F; legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"zernike.html\"))","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/zernike.html\"","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"We precompute a (generalized) Zernike–Chebyshev×Fourier plan:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"α, β = 0, 0\nP = plan_disk2cxf(F, α, β)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"FastTransforms Zernike--Chebyshev×Fourier plan for 15×57-element array of Float64","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"And an FFTW Chebyshev×Fourier analysis plan on the disk:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"PA = plan_disk_analysis(F)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"FastTransforms plan for FFTW Chebyshev×Fourier analysis on the disk for 15×57-element array of Float64","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Its Zernike coefficients are:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"U = P\\(PA*F)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"15×57 Matrix{Float64}:\n 0.886227 3.60709e-6 -1.8336e-6 -0.361801 3.60559e-11 -1.17688e-6 6.36308e-6 0.140125 -0.140125 -6.35177e-6 -7.70959e-6 1.89039e-10 0.118427 1.54098e-5 7.4099e-7 -0.0522214 -0.0522214 -1.71856e-5 1.64002e-5 0.0472361 -5.20197e-10 4.08953e-7 -3.63399e-5 -0.0217254 0.0217254 3.88099e-5 3.92308e-5 -1.24018e-9 -0.0202253 -8.31939e-5 -2.14893e-7 0.00949917 0.00949917 8.82306e-5 -8.80125e-5 -0.00898531 2.80468e-9 -1.10226e-7 0.000185657 0.00427337 -0.00427337 -0.000194603 -0.000194714 6.17793e-9 0.00408335 0.000406568 5.5777e-8 -0.00195832 -0.0019583 -0.000423167 0.000423111 0.00188439 -1.33894e-8 2.79926e-8 -0.000878195 -0.00090912 0.000909147\n 1.04025e-17 4.60728e-6 -2.33805e-6 -4.33e-11 4.33e-11 -1.22625e-6 6.53675e-6 3.57706e-17 -1.46429e-10 -5.65109e-6 -6.90982e-6 1.84987e-10 1.84987e-10 1.21904e-5 6.29629e-7 -4.19031e-10 -2.48746e-18 -1.21069e-5 1.14861e-5 4.50193e-10 -4.50193e-10 3.03358e-7 -2.25713e-5 9.64739e-18 9.39347e-10 2.10848e-5 2.13797e-5 -9.62216e-10 -9.62216e-10 -3.90991e-5 -1.42777e-7 1.94644e-9 2.52523e-17 3.51181e-5 -3.49801e-5 -1.94972e-9 1.94972e-9 -6.65696e-8 6.06806e-5 1.62452e-17 -3.87473e-9 -4.9981e-5 -5.00452e-5 3.82278e-9 3.82278e-9 7.63297e-5 3.09339e-8 -7.49277e-9 3.07275e-19 -5.04164e-5 5.03866e-5 7.2952e-9 -7.2952e-9 1.38574e-8 -4.45519e-5 2.75116e-17 1.36316e-8\n 4.31967e-17 4.76065e-6 -2.40899e-6 -4.59639e-11 4.59638e-11 -1.12866e-6 5.89804e-6 -4.92893e-18 -1.43511e-10 -4.51295e-6 -5.57325e-6 1.70088e-10 1.70088e-10 8.73447e-6 4.92668e-7 -3.63967e-10 -1.96912e-17 -7.74165e-6 7.28634e-6 3.70513e-10 -3.70513e-10 2.09854e-7 -1.26794e-5 -1.115e-17 7.33255e-10 1.02945e-5 1.04878e-5 -7.12279e-10 -7.12279e-10 -1.63841e-5 -8.90173e-8 1.36506e-9 -1.79643e-17 1.23112e-5 -1.22292e-5 -1.29344e-9 1.29344e-9 -3.78749e-8 1.71213e-5 -1.31822e-17 -2.42653e-9 -1.07347e-5 -1.07697e-5 2.25423e-9 2.25423e-9 1.13275e-5 1.62097e-8 -4.14789e-9 4.72154e-18 -4.10621e-6 4.09201e-6 3.57033e-9 -3.57033e-9 7.2136e-9 -3.89728e-6 1.18842e-17 7.03625e-9\n -8.6759e-18 4.3306e-6 -2.18254e-6 -4.50915e-11 4.50915e-11 -9.41975e-7 4.79767e-6 9.95472e-18 -1.3221e-10 -3.27045e-6 -4.09126e-6 1.48194e-10 1.48194e-10 5.69834e-6 3.57019e-7 -3.00851e-10 2.82407e-18 -4.50516e-6 4.19432e-6 2.90868e-10 -2.90868e-10 1.35612e-7 -6.44339e-6 7.09943e-18 5.46652e-10 4.50749e-6 4.62617e-6 -5.03847e-10 -5.03847e-10 -6.09951e-6 -5.21037e-8 9.1491e-10 1.52128e-18 3.77955e-6 -3.73364e-6 -8.19854e-10 8.19854e-10 -2.03036e-8 4.12363e-6 2.08255e-17 -1.45125e-9 -1.88522e-6 -1.90324e-6 1.26862e-9 1.26862e-9 1.23872e-6 7.40728e-9 -2.01666e-9 4.52885e-18 -6.4875e-7 6.41095e-7 1.96336e-9 -1.96336e-9 3.94603e-9 -4.95856e-7 1.37158e-17 3.81545e-9\n -1.55357e-17 3.55971e-6 -1.7846e-6 -4.1593e-11 4.1593e-11 -7.20914e-7 3.55774e-6 1.25952e-17 -1.15465e-10 -2.16169e-6 -2.74892e-6 1.22948e-10 1.22948e-10 3.3937e-6 2.40326e-7 -2.37394e-10 1.15486e-17 -2.38904e-6 2.19119e-6 2.18301e-10 -2.18301e-10 8.19355e-8 -2.95988e-6 -5.32282e-18 3.89943e-10 1.76401e-6 1.8323e-6 -3.41184e-10 -3.41184e-10 -2.0084e-6 -2.86395e-8 5.87175e-10 -4.46611e-18 1.01021e-6 -9.86038e-7 -4.97705e-10 4.97705e-10 -1.02636e-8 8.36501e-7 -1.96829e-17 -8.31421e-10 -2.51578e-7 -2.59455e-7 6.11155e-10 6.11155e-10 2.81636e-7 4.14107e-9 -1.17835e-9 5.45336e-18 -1.31206e-7 1.26866e-7 1.1332e-9 -1.1332e-9 2.26757e-9 -8.50354e-8 6.1748e-18 2.17398e-9\n 4.5607e-17 2.67365e-6 -1.33163e-6 -3.63778e-11 3.63778e-11 -5.08751e-7 2.4183e-6 -1.79334e-18 -9.60672e-11 -1.3062e-6 -1.69561e-6 9.74399e-11 9.74399e-11 1.84711e-6 1.50509e-7 -1.79257e-10 3.76234e-18 -1.15523e-6 1.03773e-6 1.56975e-10 -1.56975e-10 4.63055e-8 -1.22747e-6 1.76766e-18 2.66772e-10 6.14181e-7 6.51026e-7 -2.21796e-10 -2.21796e-10 -5.82251e-7 -1.47961e-8 3.62177e-10 3.79631e-18 2.3447e-7 -2.22474e-7 -2.90765e-10 2.90765e-10 -4.27394e-9 1.32135e-7 3.89533e-18 -3.9572e-10 -7.37753e-8 -7.83499e-8 3.78556e-10 3.78556e-10 7.69466e-8 2.43764e-9 -7.22143e-10 5.49309e-18 -3.3267e-8 3.06793e-8 6.86748e-10 -6.86748e-10 1.36854e-9 -1.89956e-8 2.38165e-18 1.30213e-9\n 5.17884e-18 1.84493e-6 -9.11632e-7 -3.03234e-11 3.03234e-11 -3.31998e-7 1.51086e-6 -9.81832e-20 -7.63919e-11 -7.22019e-7 -9.61716e-7 7.39635e-11 7.39635e-11 9.19025e-7 8.7759e-8 -1.29855e-10 -9.09509e-18 -5.0973e-7 4.44593e-7 1.08464e-10 -1.08464e-10 2.44943e-8 -4.5896e-7 -9.96677e-18 1.75682e-10 1.89131e-7 2.07797e-7 -1.3908e-10 -1.3908e-10 -1.48285e-7 -7.20906e-9 2.15876e-10 -5.63307e-18 4.31232e-8 -3.83843e-8 -1.35983e-10 1.35983e-10 -2.58242e-9 4.86298e-8 -5.91649e-18 -2.58784e-10 -2.49419e-8 -2.77411e-8 2.45364e-10 2.45364e-10 2.49291e-8 1.50968e-9 -4.63692e-10 5.12088e-18 -1.04761e-8 8.85511e-9 4.36633e-10 -4.36633e-10 8.66632e-10 -5.46345e-9 5.4617e-18 8.19335e-10\n -3.03871e-17 1.17276e-6 -5.74087e-7 -2.41606e-11 2.41606e-11 -2.00616e-7 8.68671e-7 -6.96842e-19 -5.82253e-11 -3.64941e-7 -5.01985e-7 5.39205e-11 5.39205e-11 4.17975e-7 4.76625e-8 -9.05511e-11 -7.94098e-18 -2.05562e-7 1.71822e-7 7.23176e-11 -7.23176e-11 1.21586e-8 -1.5476e-7 2.76426e-18 1.11916e-10 5.11842e-8 6.01101e-8 -8.43279e-11 -8.43279e-11 -2.90142e-8 -2.68449e-9 9.8079e-11 3.48626e-18 1.93294e-8 -1.63497e-8 -9.30964e-11 9.30964e-11 -1.64272e-9 2.0359e-8 -6.43e-20 -1.75944e-10 -9.61519e-9 -1.14155e-8 1.65598e-10 1.65598e-10 9.47999e-9 9.81067e-10 -3.10521e-10 -4.22278e-18 -4.06062e-9 2.99682e-9 2.90001e-10 -2.90001e-10 5.7406e-10 -2.00747e-9 -3.75041e-19 5.39466e-10\n 1.15904e-17 6.87558e-7 -3.32907e-7 -1.84685e-11 1.84685e-11 -1.12306e-7 4.59773e-7 1.30243e-17 -4.265e-11 -1.68481e-7 -2.41286e-7 3.78985e-11 3.78985e-11 1.73828e-7 2.4139e-8 -6.10346e-11 -3.679e-18 -7.61356e-8 5.9745e-8 4.66938e-11 -4.66938e-11 5.69883e-9 -4.73542e-8 8.93103e-19 6.84382e-11 1.00798e-8 1.31808e-8 -3.64534e-11 -3.64534e-11 -1.46721e-8 -1.7526e-9 6.92775e-11 -7.65573e-18 9.70857e-9 -7.74328e-9 -6.54378e-11 6.54379e-11 -1.09391e-9 9.61505e-9 3.11249e-19 -1.23027e-10 -4.18802e-9 -5.39773e-9 1.15147e-10 1.15147e-10 4.18575e-9 6.64834e-10 -2.1464e-10 2.95795e-18 -1.89907e-9 1.17239e-9 1.99193e-10 -1.99193e-10 3.95103e-10 -9.19881e-10 3.54531e-18 3.68061e-10\n 1.3655e-17 3.71865e-7 -1.77783e-7 -1.35612e-11 1.35612e-11 -5.82608e-8 2.24022e-7 5.17824e-18 -3.01692e-11 -7.09608e-8 -1.06944e-7 2.57607e-11 2.57607e-11 6.63405e-8 1.14574e-8 -3.98083e-11 1.78738e-17 -2.62265e-8 1.87191e-8 2.83655e-11 -2.83655e-11 1.81554e-9 -1.02616e-8 2.36022e-18 2.72302e-11 5.57557e-9 7.66477e-9 -2.60181e-11 -2.60181e-11 -8.14921e-9 -1.19076e-9 4.92954e-11 1.02848e-17 5.39512e-9 -4.04931e-9 -4.64096e-11 4.64096e-11 -7.54615e-10 5.0669e-9 9.15652e-18 -8.69428e-11 -2.04308e-9 -2.88332e-9 8.10649e-11 8.10649e-11 2.11288e-9 4.64752e-10 -1.50494e-10 3.12591e-18 -1.03471e-9 5.23655e-10 1.39056e-10 -1.39056e-10 2.79431e-10 -5.01563e-10 5.09065e-18 2.55748e-10\n -1.70371e-17 1.85546e-7 -8.74169e-8 -9.6428e-12 9.6428e-12 -2.80375e-8 1.00537e-7 -1.47205e-17 -2.06073e-11 -2.73295e-8 -4.39821e-8 1.69233e-11 1.69233e-11 2.34206e-8 5.10163e-9 -2.35204e-11 8.47131e-18 -5.91169e-9 3.77929e-9 9.88461e-12 -9.88462e-12 1.24842e-9 -6.38622e-9 5.95056e-18 1.91141e-11 3.32832e-9 4.77417e-9 -1.82332e-11 -1.82332e-11 -4.89671e-9 -8.28984e-10 3.44828e-11 5.52642e-18 3.25458e-9 -2.31249e-9 -3.24e-11 3.24e-11 -5.30949e-10 2.93011e-9 -6.15329e-18 -6.05679e-11 -1.10379e-9 -1.6978e-9 5.63435e-11 5.63436e-11 1.1914e-9 3.3001e-10 -1.04342e-10 1.12709e-19 -6.27959e-10 2.63577e-10 9.6157e-11 -9.6157e-11 2.00002e-10 -3.071e-10 3.66282e-18 1.76348e-10\n -3.29615e-17 8.54426e-8 -3.95787e-8 -6.58741e-12 6.58744e-12 -1.26163e-8 4.18408e-8 -2.64892e-17 -1.3631e-11 -9.62687e-9 -1.67874e-8 9.48624e-12 9.48623e-12 4.72571e-9 1.23574e-9 -6.65263e-12 -4.22361e-18 -3.91558e-9 2.44388e-9 6.57828e-12 -6.57828e-12 8.65402e-10 -4.14906e-9 1.43425e-18 1.2711e-11 2.09945e-9 3.10576e-9 -1.21149e-11 -1.21149e-11 -3.10737e-9 -5.79121e-10 2.28905e-11 5.54319e-18 2.07394e-9 -1.41354e-9 -2.1486e-11 2.1486e-11 -3.73369e-10 1.81245e-9 -1.16961e-17 -4.01214e-11 -6.48005e-10 -1.06694e-9 3.72789e-11 3.72789e-11 7.26798e-10 2.33379e-10 -6.89482e-11 7.31145e-18 -4.05112e-10 1.46777e-10 6.34527e-11 -6.34527e-11 1.42127e-10 -1.99851e-10 5.42192e-18 1.16198e-10\n 1.6415e-17 3.66259e-8 -1.66324e-8 -4.39971e-12 4.39972e-12 -5.20978e-9 1.59586e-8 5.56694e-19 -7.0843e-12 -1.58674e-9 -2.96274e-9 1.91297e-12 1.91297e-12 3.12298e-9 8.33281e-10 -3.95183e-12 -4.20797e-18 -2.58884e-9 1.5939e-9 3.90661e-12 -3.90663e-12 5.8643e-10 -2.71374e-9 2.69379e-18 7.54633e-12 1.34984e-9 2.03322e-9 -7.18992e-12 -7.18992e-12 -2.00561e-9 -3.94051e-10 1.35798e-11 -4.17599e-18 1.34233e-9 -8.92165e-10 -1.27412e-11 1.27412e-11 -2.54934e-10 1.15296e-9 -8.61255e-18 -2.37812e-11 -3.99094e-10 -6.85581e-10 2.20855e-11 2.20855e-11 4.59097e-10 1.5982e-10 -4.0826e-11 -1.5289e-18 -2.64588e-10 8.74454e-11 3.75507e-11 -3.75507e-11 9.75761e-11 -1.31247e-10 -4.8282e-18 6.87229e-11\n 8.80953e-18 1.42637e-8 -6.34424e-9 -2.10397e-12 2.10396e-12 -6.84193e-10 1.98342e-9 -7.07889e-20 -7.77237e-13 -9.64872e-10 -1.8079e-9 8.82103e-13 8.82103e-13 1.90051e-9 5.11075e-10 -1.82213e-12 6.93021e-18 -1.57577e-9 9.64939e-10 1.80116e-12 -1.80117e-12 3.60351e-10 -1.64478e-9 5.43119e-18 3.47896e-12 8.12528e-10 1.2328e-9 -3.31434e-12 -3.31434e-12 -1.2092e-9 -2.42517e-10 6.2592e-12 -2.80085e-18 8.10242e-10 -5.33001e-10 -5.872e-12 5.872e-12 -1.57104e-10 6.91093e-10 -6.77559e-18 -1.09586e-11 -2.3601e-10 -4.12661e-10 1.01758e-11 1.01758e-11 2.74436e-10 9.85995e-11 -1.88077e-11 -4.72317e-18 -1.60322e-10 5.09818e-11 1.7296e-11 -1.7296e-11 6.02559e-11 -7.9705e-11 -7.79753e-20 3.16487e-11\n -3.17011e-17 3.5367e-9 -1.55057e-9 -5.05699e-14 5.05682e-14 -1.24617e-9 3.61129e-9 -1.06861e-18 -1.49121e-13 -1.75608e-9 -3.29176e-9 1.69228e-13 1.6923e-13 3.45928e-9 9.31108e-10 -3.49576e-13 -5.73066e-19 -2.86824e-9 1.75527e-9 3.45549e-13 -3.4555e-13 6.56655e-10 -2.99235e-9 -1.72502e-18 6.67424e-13 1.47702e-9 2.24293e-9 -6.35833e-13 -6.35833e-13 -2.1985e-9 -4.42011e-10 1.20078e-12 1.97444e-18 1.47335e-9 -9.68009e-10 -1.12648e-12 1.12649e-12 -2.86382e-10 1.25563e-9 2.20447e-19 -2.10227e-12 -4.28097e-10 -7.50132e-10 1.95208e-12 1.95208e-12 4.98453e-10 1.79759e-10 -3.60793e-12 1.54178e-18 -2.91666e-10 9.23134e-11 3.31791e-12 -3.31791e-12 1.09866e-10 -1.45042e-10 -1.11051e-18 6.07111e-12","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The Zernike coefficients are useful for integration. The integral of f(xy) over the disk should be pi2 by harmonicity. The coefficient of Z_00 multiplied by √π is:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"U[1, 1]*sqrt(π)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"1.5707963267948968","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Using an orthonormal basis, the integral of f(xy)^2 over the disk is approximately the square of the 2-norm of the coefficients:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"norm(U)^2, π/(2*sqrt(2))*log1p(sqrt(2))","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"(0.9789599193439185, 0.9789599179781414)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"But there's more! Next, we repeat the experiment using the Dunkl-Xu orthonormal polynomials supported on the rectangularized disk.","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"N = 2N\nM = N","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"30","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"We analyze the function on an Ntimes M mapped tensor product xy-grid defined by:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"beginaligned\nx_n = cosleft(frac2n+12Npiright) = sinleft(fracN-2n-12Npiright)quad rm for quad 0 le n Nquadrm and\nz_m = cosleft(frac2m+12Mpiright) = sinleft(fracM-2m-12Mpiright)quad rm for quad 0 le m M\ny_nm = sqrt1-x_n^2z_m\nendaligned","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Slightly more accuracy can be expected by using an auxiliary array:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":" w_n = sinleft(frac2n+12Npiright)quad rm for quad 0 le n N","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"so that y_nm = w_nz_m.","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The x grid","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"w = [sinpi((n+0.5)/N) for n in 0:N-1]\nx = [sinpi((N-2n-1)/(2N)) for n in 0:N-1]","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"30-element Vector{Float64}:\n 0.9986295347545738\n 0.9876883405951378\n 0.9659258262890683\n 0.9335804264972017\n 0.8910065241883678\n 0.838670567945424\n 0.7771459614569709\n 0.7071067811865475\n 0.6293203910498375\n 0.5446390350150271\n 0.45399049973954675\n 0.35836794954530027\n 0.25881904510252074\n 0.15643446504023087\n 0.052335956242943835\n -0.052335956242943835\n -0.15643446504023087\n -0.25881904510252074\n -0.35836794954530027\n -0.45399049973954675\n -0.5446390350150271\n -0.6293203910498375\n -0.7071067811865475\n -0.7771459614569709\n -0.838670567945424\n -0.8910065241883678\n -0.9335804264972017\n -0.9659258262890683\n -0.9876883405951378\n -0.9986295347545738","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The z grid","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"z = [sinpi((M-2m-1)/(2M)) for m in 0:M-1]","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"30-element Vector{Float64}:\n 0.9986295347545738\n 0.9876883405951378\n 0.9659258262890683\n 0.9335804264972017\n 0.8910065241883678\n 0.838670567945424\n 0.7771459614569709\n 0.7071067811865475\n 0.6293203910498375\n 0.5446390350150271\n 0.45399049973954675\n 0.35836794954530027\n 0.25881904510252074\n 0.15643446504023087\n 0.052335956242943835\n -0.052335956242943835\n -0.15643446504023087\n -0.25881904510252074\n -0.35836794954530027\n -0.45399049973954675\n -0.5446390350150271\n -0.6293203910498375\n -0.7071067811865475\n -0.7771459614569709\n -0.838670567945424\n -0.8910065241883678\n -0.9335804264972017\n -0.9659258262890683\n -0.9876883405951378\n -0.9986295347545738","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"On the mapped tensor product grid, our function samples are:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"F = [f(x[n], w[n]*z) for n in 1:N, z in z]","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"30×30 Matrix{Float64}:\n 0.383725 0.383905 0.384264 0.384798 0.3855 0.386365 0.387383 0.388542 0.389832 0.391237 0.392744 0.394337 0.395997 0.397708 0.399451 0.401207 0.402957 0.404681 0.406361 0.407977 0.409512 0.410949 0.41227 0.413462 0.41451 0.415403 0.41613 0.416683 0.417055 0.417242\n 0.353509 0.354039 0.355094 0.356664 0.358732 0.36128 0.364281 0.367707 0.371524 0.375695 0.380177 0.384927 0.389897 0.395036 0.400292 0.405609 0.41093 0.416197 0.421352 0.426336 0.431089 0.435556 0.439683 0.443417 0.446713 0.449527 0.451824 0.453573 0.454752 0.455346\n 0.325652 0.32653 0.328275 0.330873 0.334296 0.338513 0.343483 0.349158 0.355488 0.362412 0.36987 0.377792 0.386108 0.394741 0.40361 0.412629 0.421708 0.43075 0.439655 0.44832 0.456637 0.464501 0.471805 0.478449 0.484336 0.489382 0.493512 0.496665 0.498793 0.499866\n 0.29943 0.300665 0.303122 0.306774 0.311585 0.317506 0.324478 0.332436 0.341308 0.351018 0.361484 0.372625 0.384354 0.396582 0.409213 0.422145 0.435264 0.448446 0.461551 0.474426 0.486904 0.498809 0.50996 0.520175 0.529284 0.537127 0.54357 0.548501 0.551834 0.553515\n 0.274261 0.275876 0.279088 0.283858 0.290132 0.297838 0.306895 0.317212 0.328692 0.341239 0.354758 0.36916 0.384358 0.400269 0.416811 0.43389 0.451401 0.469213 0.487163 0.505054 0.522647 0.539669 0.555819 0.570781 0.584246 0.595923 0.605564 0.612965 0.617979 0.620509\n 0.249651 0.251685 0.255724 0.261714 0.269574 0.279203 0.290482 0.303282 0.31747 0.332923 0.349529 0.367198 0.385862 0.405474 0.426001 0.44741 0.469656 0.492656 0.516277 0.540305 0.564443 0.588294 0.611378 0.633149 0.653036 0.670489 0.685018 0.696234 0.703855 0.707707\n 0.225163 0.227669 0.232643 0.240006 0.249642 0.261402 0.275112 0.290582 0.307622 0.326061 0.345762 0.366637 0.388654 0.411835 0.43625 0.461998 0.489179 0.517862 0.548041 0.579594 0.612236 0.645481 0.678629 0.710777 0.740882 0.76785 0.790662 0.808467 0.820649 0.826828\n 0.200384 0.203443 0.209507 0.218467 0.230156 0.244357 0.260808 0.279223 0.299317 0.32084 0.343606 0.367524 0.392611 0.418996 0.446912 0.47667 0.508629 0.543152 0.580544 0.620979 0.664413 0.710473 0.758363 0.806792 0.853985 0.897808 0.936015 0.966541 0.987766 0.99863\n 0.174918 0.178645 0.186025 0.196908 0.211057 0.228154 0.247802 0.269562 0.292995 0.317717 0.343461 0.370116 0.397762 0.426667 0.457278 0.490195 0.526141 0.565917 0.610353 0.660232 0.716173 0.778452 0.846763 0.919914 0.995547 1.07001 1.13854 1.19588 1.23718 1.25878\n 0.148385 0.152947 0.161975 0.175262 0.192474 0.213137 0.23665 0.262328 0.289486 0.317533 0.346071 0.374964 0.404363 0.43471 0.4667 0.501255 0.539494 0.582713 0.632375 0.690092 0.75756 0.836429 0.928002 1.03272 1.1493 1.27371 1.39809 1.51064 1.59716 1.64443\n 0.120453 0.126104 0.137278 0.153696 0.174875 0.200102 0.228448 0.258839 0.290208 0.321663 0.352638 0.382979 0.41296 0.443231 0.47475 0.508726 0.546578 0.589942 0.640699 0.701019 0.773401 0.860651 0.965732 1.0913 1.23871 1.40612 1.58568 1.76048 1.90408 1.98636\n 0.0909577 0.098092 0.112194 0.132868 0.159398 0.19068 0.225238 0.261383 0.297474 0.332223 0.364913 0.395469 0.424393 0.452621 0.481372 0.512033 0.546102 0.585165 0.630904 0.685083 0.749484 0.825684 0.914588 1.01552 1.12484 1.23449 1.33202 1.40445 1.44601 1.46226\n 0.0602361 0.0695018 0.0877988 0.114536 0.148582 0.188133 0.230785 0.273857 0.314915 0.352268 0.385224 0.414044 0.439685 0.46349 0.486923 0.511411 0.53824 0.568495 0.60296 0.641919 0.684785 0.729453 0.77136 0.802572 0.811931 0.788253 0.727788 0.642222 0.558465 0.506932\n 0.0300951 0.0426105 0.0672646 0.103059 0.148022 0.199015 0.251986 0.302743 0.347947 0.385818 0.416228 0.440285 0.45973 0.476426 0.492035 0.507855 0.524738 0.542996 0.562232 0.581051 0.596627 0.604238 0.597148 0.56764 0.510053 0.425442 0.32469 0.226238 0.149204 0.107374\n 0.00673069 0.0245336 0.0593763 0.109244 0.17025 0.236535 0.301213 0.358181 0.403763 0.437224 0.460093 0.47501 0.484736 0.491598 0.497272 0.502743 0.508304 0.513517 0.517087 0.516699 0.508899 0.489293 0.453432 0.398651 0.326385 0.243411 0.160485 0.0888546 0.0371183 0.010234\n 0.010234 0.0371183 0.0888546 0.160485 0.243411 0.326385 0.398651 0.453432 0.489293 0.508899 0.516699 0.517087 0.513517 0.508304 0.502743 0.497272 0.491598 0.484736 0.47501 0.460093 0.437224 0.403763 0.358181 0.301213 0.236535 0.17025 0.109244 0.0593763 0.0245336 0.00673069\n 0.107374 0.149204 0.226238 0.32469 0.425442 0.510053 0.56764 0.597148 0.604238 0.596627 0.581051 0.562232 0.542996 0.524738 0.507855 0.492035 0.476426 0.45973 0.440285 0.416228 0.385818 0.347947 0.302743 0.251986 0.199015 0.148022 0.103059 0.0672646 0.0426105 0.0300951\n 0.506932 0.558465 0.642222 0.727788 0.788253 0.811931 0.802572 0.77136 0.729453 0.684785 0.641919 0.60296 0.568495 0.53824 0.511411 0.486923 0.46349 0.439685 0.414044 0.385224 0.352268 0.314915 0.273857 0.230785 0.188133 0.148582 0.114536 0.0877988 0.0695018 0.0602361\n 1.46226 1.44601 1.40445 1.33202 1.23449 1.12484 1.01552 0.914588 0.825684 0.749484 0.685083 0.630904 0.585165 0.546102 0.512033 0.481372 0.452621 0.424393 0.395469 0.364913 0.332223 0.297474 0.261383 0.225238 0.19068 0.159398 0.132868 0.112194 0.098092 0.0909577\n 1.98636 1.90408 1.76048 1.58568 1.40612 1.23871 1.0913 0.965732 0.860651 0.773401 0.701019 0.640699 0.589942 0.546578 0.508726 0.47475 0.443231 0.41296 0.382979 0.352638 0.321663 0.290208 0.258839 0.228448 0.200102 0.174875 0.153696 0.137278 0.126104 0.120453\n 1.64443 1.59716 1.51064 1.39809 1.27371 1.1493 1.03272 0.928002 0.836429 0.75756 0.690092 0.632375 0.582713 0.539494 0.501255 0.4667 0.43471 0.404363 0.374964 0.346071 0.317533 0.289486 0.262328 0.23665 0.213137 0.192474 0.175262 0.161975 0.152947 0.148385\n 1.25878 1.23718 1.19588 1.13854 1.07001 0.995547 0.919914 0.846763 0.778452 0.716173 0.660232 0.610353 0.565917 0.526141 0.490195 0.457278 0.426667 0.397762 0.370116 0.343461 0.317717 0.292995 0.269562 0.247802 0.228154 0.211057 0.196908 0.186025 0.178645 0.174918\n 0.99863 0.987766 0.966541 0.936015 0.897808 0.853985 0.806792 0.758363 0.710473 0.664413 0.620979 0.580544 0.543152 0.508629 0.47667 0.446912 0.418996 0.392611 0.367524 0.343606 0.32084 0.299317 0.279223 0.260808 0.244357 0.230156 0.218467 0.209507 0.203443 0.200384\n 0.826828 0.820649 0.808467 0.790662 0.76785 0.740882 0.710777 0.678629 0.645481 0.612236 0.579594 0.548041 0.517862 0.489179 0.461998 0.43625 0.411835 0.388654 0.366637 0.345762 0.326061 0.307622 0.290582 0.275112 0.261402 0.249642 0.240006 0.232643 0.227669 0.225163\n 0.707707 0.703855 0.696234 0.685018 0.670489 0.653036 0.633149 0.611378 0.588294 0.564443 0.540305 0.516277 0.492656 0.469656 0.44741 0.426001 0.405474 0.385862 0.367198 0.349529 0.332923 0.31747 0.303282 0.290482 0.279203 0.269574 0.261714 0.255724 0.251685 0.249651\n 0.620509 0.617979 0.612965 0.605564 0.595923 0.584246 0.570781 0.555819 0.539669 0.522647 0.505054 0.487163 0.469213 0.451401 0.43389 0.416811 0.400269 0.384358 0.36916 0.354758 0.341239 0.328692 0.317212 0.306895 0.297838 0.290132 0.283858 0.279088 0.275876 0.274261\n 0.553515 0.551834 0.548501 0.54357 0.537127 0.529284 0.520175 0.50996 0.498809 0.486904 0.474426 0.461551 0.448446 0.435264 0.422145 0.409213 0.396582 0.384354 0.372625 0.361484 0.351018 0.341308 0.332436 0.324478 0.317506 0.311585 0.306774 0.303122 0.300665 0.29943\n 0.499866 0.498793 0.496665 0.493512 0.489382 0.484336 0.478449 0.471805 0.464501 0.456637 0.44832 0.439655 0.43075 0.421708 0.412629 0.40361 0.394741 0.386108 0.377792 0.36987 0.362412 0.355488 0.349158 0.343483 0.338513 0.334296 0.330873 0.328275 0.32653 0.325652\n 0.455346 0.454752 0.453573 0.451824 0.449527 0.446713 0.443417 0.439683 0.435556 0.431089 0.426336 0.421352 0.416197 0.41093 0.405609 0.400292 0.395036 0.389897 0.384927 0.380177 0.375695 0.371524 0.367707 0.364281 0.36128 0.358732 0.356664 0.355094 0.354039 0.353509\n 0.417242 0.417055 0.416683 0.41613 0.415403 0.41451 0.413462 0.41227 0.410949 0.409512 0.407977 0.406361 0.404681 0.402957 0.401207 0.399451 0.397708 0.395997 0.394337 0.392744 0.391237 0.389832 0.388542 0.387383 0.386365 0.3855 0.384798 0.384264 0.383905 0.383725","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"X = [x for x in x, z in z]\nY = [w*z for w in w, z in z]\nscatter3d(vec(X), vec(Y), vec(0F); markersize=0.75, markercolor=:green)\nsurface!(X, Y, F; legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"dunklxu.html\"))","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/dunklxu.html\"","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"We precompute a Dunkl-Xu–Chebyshev plan:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"P = plan_rectdisk2cheb(F, β)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"FastTransforms Dunkl-Xu--Chebyshev² plan for 30×30-element array of Float64","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"And an FFTW Chebyshev² analysis plan on the rectangularized disk:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"PA = plan_rectdisk_analysis(F)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"FastTransforms plan for FFTW Chebyshev analysis on the rectangularized disk for 30×30-element array of Float64","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Its Dunkl-Xu coefficients are:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"U = P\\(PA*F)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"30×30 Matrix{Float64}:\n 0.886226 2.88387e-18 -6.09829e-7 7.35851e-18 -0.0236857 -1.47226e-18 -0.00550977 2.32206e-18 -0.000650943 1.21902e-18 2.15779e-9 -5.41906e-19 1.86065e-5 -3.45643e-21 4.38992e-6 7.16086e-19 4.19398e-7 -1.83364e-18 -1.00953e-7 2.70552e-18 -8.14396e-8 -5.42887e-19 -3.94076e-8 1.3337e-19 -1.67897e-8 9.86492e-19 -6.33162e-9 -3.20905e-18 -2.11252e-9 6.15501e-19\n -1.77522e-18 -0.361799 -4.0846e-18 -0.062663 -1.17608e-18 2.72128e-6 2.30691e-19 0.00252359 -2.63137e-18 0.000679258 -4.46159e-18 9.1001e-5 6.38235e-18 1.03955e-6 5.22321e-19 -2.31664e-6 1.94715e-18 -3.11859e-7 -1.79784e-18 1.77496e-7 -2.62985e-18 1.44389e-7 2.91238e-18 6.82707e-8 -7.25576e-18 2.5634e-8 1.20042e-18 7.91583e-9 1.49738e-18 1.6359e-9\n -5.19659e-7 1.8508e-18 0.105921 -4.31929e-18 0.0404829 5.73996e-19 0.00663284 -1.0327e-18 -5.56102e-6 -4.21579e-19 -0.000301082 1.47301e-19 -8.77391e-5 5.41984e-22 -1.39615e-5 -8.87659e-20 -1.31088e-6 9.44811e-20 -2.80392e-7 5.51227e-20 -2.38006e-7 -4.98362e-20 -1.39444e-7 2.17216e-20 -5.76521e-8 2.30505e-19 -1.77475e-8 -9.7631e-19 -3.52357e-9 2.0364e-19\n -1.27221e-18 0.125331 4.97304e-18 1.52509e-6 1.45775e-18 -0.013651 7.22456e-21 -0.00478429 2.98148e-18 -0.000775222 4.75045e-18 4.86933e-6 -6.43203e-18 4.00219e-5 -4.98601e-19 1.28528e-5 -1.75937e-18 2.68143e-6 1.53754e-18 5.35246e-7 2.12609e-18 1.5728e-7 -2.22161e-18 5.72745e-8 5.21008e-18 1.62262e-8 -8.09068e-19 4.075e-10 -9.18958e-19 -1.20696e-9\n -0.0886209 5.9287e-18 -0.0913638 3.0208e-18 -0.0231032 -8.79578e-19 2.55845e-6 3.0702e-20 0.00173316 -2.27626e-20 0.000591205 7.34455e-20 9.51801e-5 -1.76615e-22 -9.67049e-7 -2.32129e-19 -5.17388e-6 7.52376e-19 -1.60228e-6 -1.32782e-18 -2.52759e-7 3.07657e-19 9.35469e-9 -8.51145e-20 2.66735e-8 -6.95778e-19 1.62648e-8 2.22225e-18 7.6679e-9 -4.29514e-19\n -2.27783e-19 -2.79797e-6 -7.72126e-18 0.0328526 -1.8342e-18 0.0160342 9.1729e-19 0.00332497 -2.80639e-18 -8.62281e-6 -4.2378e-18 -0.000228689 5.32969e-18 -7.87989e-5 3.83086e-19 -1.43006e-5 1.25448e-18 -1.11779e-6 -1.0031e-18 2.57992e-8 -1.25205e-18 -9.03781e-8 1.15981e-18 -8.97012e-8 -2.35026e-18 -4.18139e-8 3.12661e-19 -1.37244e-8 3.79461e-19 -2.86072e-9\n 0.0632999 3.51932e-18 0.0392743 1.49837e-19 3.65838e-6 -1.38938e-18 -0.00566089 8.65236e-20 -0.00237159 4.64215e-19 -0.0004495 -2.36182e-19 7.81213e-6 -6.26519e-21 3.39614e-5 4.25838e-19 1.24485e-5 -1.20569e-18 2.90796e-6 1.93539e-18 5.68462e-7 -4.14661e-19 1.34604e-7 1.07214e-19 3.66282e-8 7.3063e-19 6.0499e-9 -2.39201e-18 -9.48683e-10 4.62309e-19\n 3.09083e-18 -0.0381303 6.45574e-18 -0.0305859 1.32867e-18 -0.00858298 1.18843e-18 4.65679e-6 2.44694e-18 0.000859316 3.22841e-18 0.000335164 -3.73751e-18 6.02308e-5 -2.3993e-19 -1.60502e-6 -6.34732e-19 -4.61957e-6 3.88944e-19 -1.57519e-6 3.0958e-19 -2.83912e-7 -8.05568e-20 6.48665e-9 -9.16014e-20 2.64839e-8 1.4656e-20 1.29647e-8 1.77924e-20 3.53416e-9\n -0.0246173 1.34369e-18 -7.2626e-6 -6.12659e-19 0.0116417 -1.5041e-18 0.00624266 -1.85365e-18 0.00144602 -4.90943e-19 -1.39151e-5 3.17046e-19 -0.000132715 -1.2879e-20 -5.15476e-5 -5.01755e-19 -1.08626e-5 1.3675e-18 -1.14678e-6 -2.05969e-18 -1.60201e-8 4.1645e-19 -6.95967e-8 -8.86395e-20 -5.06628e-8 -6.56352e-19 -1.89806e-8 2.14815e-18 -4.88118e-9 -4.14794e-19\n 2.96922e-18 0.0318389 -7.01232e-18 0.0141265 -1.88894e-18 5.77928e-6 2.25083e-18 -0.00227906 -1.49048e-18 -0.00104803 -1.8946e-18 -0.000212855 1.43332e-18 1.03295e-5 3.07928e-20 2.34123e-5 -3.37163e-20 9.30847e-6 2.08986e-19 2.35417e-6 5.45452e-19 3.9768e-7 -5.99282e-19 5.08658e-8 1.44195e-18 -3.96513e-9 -2.31687e-19 -6.27377e-9 -2.80629e-19 -2.22939e-9\n 4.3203e-6 -1.01505e-18 -0.0150888 3.50579e-18 -0.0112343 -3.04793e-18 -0.00328812 1.6965e-19 1.04744e-5 1.13928e-18 0.00039214 -4.16429e-19 0.000165953 -4.32603e-20 3.20022e-5 5.4276e-19 -1.20827e-6 -1.2744e-18 -2.94655e-6 1.81728e-18 -7.04511e-7 -2.92334e-19 -5.6071e-8 7.05523e-20 3.46324e-8 5.34236e-19 2.06785e-8 -1.75157e-18 7.17059e-9 3.39977e-19\n 2.8983e-18 -0.013664 6.5678e-18 -1.51866e-5 5.4757e-19 0.00436874 2.16097e-18 0.00244523 1.06017e-18 0.000590637 4.65336e-19 -2.14758e-5 -9.40954e-20 -7.38896e-5 2.3552e-20 -3.13213e-5 5.26085e-19 -7.72648e-6 -6.82977e-19 -1.29269e-6 -8.74011e-19 -2.78823e-7 9.5171e-19 -5.90858e-8 -2.26756e-18 -1.01665e-8 3.58531e-19 -5.87834e-11 4.39097e-19 6.08272e-10\n 0.00851225 -3.46779e-18 0.0134873 -4.47271e-18 0.00537692 -8.3977e-19 6.02617e-6 -3.08821e-18 -0.000910525 -3.39517e-19 -0.000437065 3.03366e-19 -8.7068e-5 -8.80118e-20 1.1278e-5 -3.65139e-19 1.49731e-5 1.04786e-18 4.52269e-6 -1.08717e-18 1.07064e-6 2.22069e-19 1.46243e-7 -7.88106e-20 -1.38814e-8 -4.24262e-19 -1.70166e-8 1.34473e-18 -7.00317e-9 -2.34873e-19\n -5.243e-19 1.53467e-5 -3.42908e-18 -0.00600077 -1.14879e-18 -0.00428943 1.57332e-18 -0.00126564 4.71504e-19 2.25421e-5 1.05408e-18 0.000179497 -3.19824e-18 8.01025e-5 -4.07863e-19 1.7027e-5 -1.1788e-18 1.57076e-6 8.41234e-19 2.06968e-7 1.08582e-18 6.4408e-8 -1.00962e-18 3.71494e-8 2.54812e-18 1.54347e-8 -4.43537e-19 4.19595e-9 -5.02122e-19 6.39706e-10\n -0.00737561 3.20877e-19 -0.00609917 5.01968e-18 -2.74248e-5 -1.69707e-18 0.00166484 4.53517e-19 0.000938074 1.49633e-18 0.000214292 -4.51956e-19 -2.95524e-5 -1.70254e-19 -4.43089e-5 4.86992e-19 -1.48998e-5 -3.74819e-19 -4.66705e-6 8.30785e-19 -1.1166e-6 -1.63135e-19 -1.75326e-7 -5.17937e-20 6.20197e-11 2.28331e-19 1.22805e-8 -9.15375e-19 5.74874e-9 2.71057e-19\n -1.53896e-18 0.00528716 2.99138e-18 0.00556329 -2.15535e-19 0.00208938 -7.47732e-21 -5.2783e-7 -6.15068e-19 -0.000359085 -2.14571e-18 -0.000171677 2.3754e-18 -2.96656e-5 1.23813e-20 2.10201e-6 1.54216e-19 2.03799e-6 -3.37798e-19 7.36548e-7 -8.65849e-19 1.34796e-7 1.57582e-18 -8.41342e-9 -3.22682e-18 -1.56944e-8 3.58566e-19 -6.34761e-9 6.01843e-19 -1.40381e-9\n 0.00325817 -2.84485e-19 3.77292e-5 -6.03158e-18 -0.00236387 1.7388e-18 -0.0016225 -1.91543e-18 -0.000450124 4.45629e-20 4.2479e-5 6.05433e-20 9.29879e-5 -2.32382e-19 3.37099e-5 4.71114e-19 1.28552e-5 8.98504e-19 3.9506e-6 -2.91014e-19 9.51441e-7 1.15619e-19 1.58677e-7 -3.87565e-19 5.78941e-9 -4.52573e-19 -8.22477e-9 7.86929e-19 -4.24338e-9 2.31952e-19\n -1.89824e-18 -0.00475403 -2.71301e-19 -0.00260261 3.02312e-19 -4.17061e-5 -1.89426e-18 0.000603349 2.04618e-18 0.000321014 3.43974e-18 4.91036e-5 -6.38959e-18 -1.33075e-5 -1.05918e-18 -9.95643e-6 -2.63009e-18 -4.40482e-6 1.5221e-18 -1.35103e-6 1.63207e-18 -2.69324e-7 -1.27253e-19 -1.41967e-8 1.6452e-18 1.40866e-8 -7.11669e-19 7.16251e-9 -2.35918e-19 1.77508e-9\n -2.1087e-5 4.43105e-18 0.00246819 5.58103e-18 0.00221801 5.16957e-19 0.000774953 1.78195e-18 -2.27028e-5 1.01858e-18 -0.000146058 -3.94509e-19 -5.59485e-5 -6.27763e-19 -2.5516e-5 1.37015e-18 -9.52201e-6 7.96212e-19 -2.90084e-6 3.76863e-19 -7.0138e-7 -2.09039e-20 -1.20528e-7 -3.15268e-19 -6.49799e-9 -8.95548e-20 5.20338e-9 -4.60083e-19 2.87275e-9 4.70547e-19\n 6.06272e-20 0.00217575 -2.66229e-18 7.86173e-5 -6.71472e-19 -0.000845473 -2.57966e-18 -0.000526267 -2.09351e-18 -9.24417e-5 -3.21392e-18 2.85383e-5 8.09944e-19 2.55329e-5 -6.62568e-19 1.39518e-5 -1.59662e-18 5.53959e-6 -4.47258e-19 1.63754e-6 3.62645e-20 3.34514e-7 2.00636e-18 2.71988e-8 -3.09107e-18 -1.21682e-8 -2.21799e-19 -7.17118e-9 1.08785e-18 -1.87466e-9\n -0.00127442 3.52931e-19 -0.00226313 -4.30745e-18 -0.00105975 1.87531e-18 -4.70324e-5 6.00057e-19 0.000173699 -1.38557e-19 6.84882e-5 -3.26853e-19 3.73772e-5 -5.60827e-20 1.67333e-5 9.3379e-19 6.1804e-6 8.39235e-19 1.87498e-6 -2.66208e-19 4.54341e-7 3.00091e-19 7.92679e-8 1.95688e-20 4.9557e-9 -8.34156e-21 -3.08203e-9 -2.03576e-19 -1.77447e-9 7.2992e-20\n 1.96865e-18 -7.54358e-5 3.58988e-18 0.000953128 1.6236e-18 0.00073895 -2.40377e-18 0.000186348 2.16847e-18 -3.08415e-5 2.54719e-18 -4.20801e-5 1.22943e-19 -2.97992e-5 3.21331e-19 -1.49958e-5 -8.15942e-19 -5.73922e-6 -1.98008e-18 -1.67382e-6 1.43452e-18 -3.45419e-7 -1.22162e-18 -3.19319e-8 3.32858e-18 1.04223e-8 -1.08684e-18 6.70585e-9 4.47261e-19 1.79997e-9\n 0.00115733 1.30891e-18 0.00108248 4.06073e-18 0.000140675 -2.51786e-19 -0.00015525 2.19311e-18 -6.00244e-5 -3.22812e-19 -3.94963e-5 -3.02667e-19 -2.12639e-5 4.02577e-19 -9.44009e-6 1.85579e-19 -3.47007e-6 -2.98953e-19 -1.05071e-6 -7.43343e-19 -2.54885e-7 2.09385e-19 -4.47918e-8 9.68517e-19 -2.98189e-9 1.09376e-18 1.6509e-9 -1.31313e-18 9.71987e-10 -9.95033e-19\n 1.48521e-18 -0.000757848 -5.47813e-18 -0.000843449 -1.0829e-18 -0.000328982 5.05077e-19 8.77607e-7 -6.47403e-19 4.13033e-5 -7.47716e-19 4.36922e-5 3.11321e-18 2.88832e-5 2.20016e-19 1.41096e-5 5.10479e-19 5.3233e-6 -1.4537e-18 1.5442e-6 -2.20346e-19 3.20051e-7 7.40593e-19 3.10541e-8 -2.56423e-19 -8.83962e-9 -1.51978e-19 -5.9456e-9 -2.58702e-19 -1.61537e-9\n -0.000553886 -2.72894e-18 -0.000187639 -1.75508e-18 0.000102621 -1.51373e-18 3.50362e-5 -7.82231e-19 2.80559e-5 -1.16799e-18 1.831e-5 2.74456e-19 9.80506e-6 9.84228e-19 4.33835e-6 -3.15583e-19 1.59166e-6 2.69126e-20 4.81568e-7 1.46454e-18 1.16874e-7 9.49945e-20 2.05996e-8 -1.29623e-18 1.40536e-9 -3.22261e-19 -7.42251e-10 9.2967e-19 -4.4125e-10 3.14499e-19\n 3.43006e-19 0.00067785 7.65451e-18 0.000443404 1.23865e-18 5.25409e-5 6.64849e-19 -8.79182e-6 2.73158e-19 -3.88737e-5 3.09642e-19 -3.84611e-5 -2.37757e-18 -2.48679e-5 -5.12093e-19 -1.20249e-5 -1.41333e-19 -4.51391e-6 9.67661e-19 -1.30691e-6 5.07231e-19 -2.71299e-7 9.18246e-19 -2.67727e-8 1.99136e-19 7.24306e-9 -1.49026e-19 4.95787e-9 -1.41127e-18 1.35319e-9\n 0.000104898 -1.01818e-18 -4.97719e-5 -7.29653e-19 -1.14056e-5 5.87956e-19 -1.12136e-5 4.60098e-19 -8.949e-6 4.53171e-19 -5.82665e-6 -2.44462e-19 -3.11536e-6 -6.1681e-19 -1.37708e-6 5.61031e-19 -5.04943e-7 -8.46536e-20 -1.52739e-7 -3.66863e-19 -3.7074e-8 -2.38249e-19 -6.54014e-9 1.24858e-19 -4.49338e-10 7.25589e-19 2.34081e-10 -4.87718e-19 1.39557e-10 -5.94023e-19\n -3.13646e-18 -0.000389793 -3.28188e-18 -8.04943e-5 -1.37241e-19 -3.68665e-5 -2.30965e-18 8.03845e-6 -6.09189e-19 2.97453e-5 -5.0944e-19 2.89916e-5 1.05019e-18 1.86472e-5 6.3629e-19 8.99472e-6 1.43239e-18 3.37228e-6 -1.20318e-18 9.75922e-7 4.1214e-20 2.02668e-7 -1.14334e-19 2.00821e-8 1.81185e-19 -5.36499e-9 -1.23364e-19 -3.68864e-9 4.2811e-20 -1.00792e-9\n 1.54054e-5 1.23828e-18 1.00144e-6 1.84463e-19 1.23964e-6 -8.43152e-20 1.21824e-6 5.74481e-20 9.71898e-7 -1.03935e-19 6.32656e-7 -8.20175e-20 3.38215e-7 1.5389e-19 1.49487e-7 -1.12048e-19 5.48103e-8 -2.06987e-19 1.65791e-8 6.79198e-20 4.02426e-9 1.22785e-19 7.09969e-10 -6.46596e-20 4.88112e-11 -5.51333e-20 -2.53943e-11 1.23995e-19 -1.51441e-11 7.96269e-20\n -1.5778e-18 0.000145153 1.32424e-19 0.000143445 -7.6147e-20 6.55677e-5 2.22587e-19 -1.45469e-5 3.01577e-19 -5.3233e-5 3.22253e-20 -5.18305e-5 -8.36085e-22 -3.33247e-5 -1.86065e-19 -1.60719e-5 -4.43286e-19 -6.0251e-6 8.63083e-20 -1.74358e-6 5.65738e-21 -3.62096e-7 4.33784e-20 -3.58901e-8 -1.49965e-19 9.57958e-9 1.3012e-20 6.5884e-9 3.28648e-19 1.80042e-9","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The Dunkl-Xu coefficients are useful for integration. The integral of f(xy) over the disk should be pi2 by harmonicity. The coefficient of P_00 multiplied by √π is:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"U[1, 1]*sqrt(π)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"1.5707955409153043","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Using an orthonormal basis, the integral of f(xy)^2 over the disk is approximately the square of the 2-norm of the coefficients:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"norm(U)^2, π/(2*sqrt(2))*log1p(sqrt(2))","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"(0.978937045726087, 0.9789599179781414)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"This page was generated using Literate.jl.","category":"page"},{"location":"dev/#Development-Documentation-1","page":"Development","title":"Development Documentation","text":"","category":"section"},{"location":"dev/#","page":"Development","title":"Development","text":"The core of FastTransforms.jl is developed in parallel with the C library of the same name. Julia and C interoperability is enhanced by the BinaryBuilder infrastructure, which provides the user a safe and seamless experience using a package in a different language.","category":"page"},{"location":"dev/#Why-two-packages?-1","page":"Development","title":"Why two packages?","text":"","category":"section"},{"location":"dev/#","page":"Development","title":"Development","text":"Orthogonal polynomial transforms are performance-sensitive imperative tasks. Yet, many of Julia's rich and evolving language features are simply unnecessary for defining these computational routines. Moreover, rapid language changes in Julia (as compared to C) have been more than a perturbation to this repository in the past.","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"The C library generates assembly for vectorized operations such as single instruction multiple data (SIMD) that is more efficient than that generated by a compiler without human intervention. It also uses OpenMP to introduce shared memory parallelism for large tasks. Finally, calling into precompiled binaries reduces the Julia package's pre-compilation and dependencies, improving the user experience. Some of these capabilities also exist in Julia, but with C there is frankly more control over performance.","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"C libraries are easier to call from any other language, partly explaining why the Python package manager Spack already supports the C library through third-party efforts.","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"In Julia, a parametric composite type with unrestricted type parameters is just about as big as Any. Such a type allows the Julia API to far exceed the C API in its ability to unify all of the orthogonal polynomial transforms and present them as linear operators. The mutable struct FTPlan{T, N, K}, together with AdjointFTPlan and TransposeFTPlan, are the core Julia types in this repository. Whereas T is understood to represent element type of the plan and N represents the number of leading dimensions of the array on which it operates, K is a mere enumeration which serves to distinguish the orthogonal polynomials at play. For example, FTPlan{Float64, 1, LEG2CHEB} represents the necessary pre-computations to convert 64-bit Legendre series to Chebyshev series (of the first kind). N == 1 because Chebyshev and Legendre series are naturally represented with vectors of coefficients. However, this particular plan may operate not only on vectors but also on matrices, column-by-column.","category":"page"},{"location":"dev/#The-developer's-right-to-build-from-source-1","page":"Development","title":"The developer's right to build from source","text":"","category":"section"},{"location":"dev/#","page":"Development","title":"Development","text":"Precompiled binaries are important for users, but development in C may be greatly accelerated by coupling it with a dynamic language such as Julia. For this reason, the repository preserves the developer's right to build the C library from source by setting an environment variable to trigger the build script:","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"julia> ENV[\"FT_BUILD_FROM_SOURCE\"] = \"true\"\n\"true\"\n\n(@v1.5) pkg> build FastTransforms\n Building FFTW ──────────→ `~/.julia/packages/FFTW/ayqyZ/deps/build.log`\n Building TimeZones ─────→ `~/.julia/packages/TimeZones/K98G0/deps/build.log`\n Building FastTransforms → `~/.julia/dev/FastTransforms/deps/build.log`\n\njulia> using FastTransforms\n[ Info: Precompiling FastTransforms [057dd010-8810-581a-b7be-e3fc3b93f78c]\n","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"This lets the developer experiment with new features through ccalling into bleeding edge source code. Customizing the build script further allows the developer to track a different branch or even a fork.","category":"page"},{"location":"dev/#From-release-to-release-to-release-1","page":"Development","title":"From release to release to release","text":"","category":"section"},{"location":"dev/#","page":"Development","title":"Development","text":"To get from a C library release to a Julia package release, the developer needs to update Yggdrasil's build_tarballs.jl script for the new version and its 256-bit SHA. On macOS, the SHA can be found by:","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"shell> curl https://codeload.github.com/MikaelSlevinsky/FastTransforms/tar.gz/v0.6.2 --output FastTransforms.tar.gz\n % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n100 168k 0 168k 0 0 429k 0 --:--:-- --:--:-- --:--:-- 429k\n\nshell> shasum -a 256 FastTransforms.tar.gz\nfd00befcb0c20ba962a8744a7b9139355071ee95be70420de005b7c0f6e023aa FastTransforms.tar.gz\n\nshell> rm -f FastTransforms.tar.gz\n","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"Using SHA.jl, the SHA can also be found by:","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"shell> curl https://codeload.github.com/MikaelSlevinsky/FastTransforms/tar.gz/v0.6.2 --output FastTransforms.tar.gz\n % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n100 168k 0 168k 0 0 442k 0 --:--:-- --:--:-- --:--:-- 443k\n\njulia> using SHA\n\njulia> open(\"FastTransforms.tar.gz\") do f\n bytes2hex(sha256(f))\n end\n\"fd00befcb0c20ba962a8744a7b9139355071ee95be70420de005b7c0f6e023aa\"\n\nshell> rm -f FastTransforms.tar.gz\n","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"Then we wait for the friendly folks at JuliaPackaging to merge the pull request to Yggdrasil, triggering a new release of the FastTransforms_jll.jl meta package that stores all precompiled binaries. With this release, we update the FastTransforms.jl Project.toml to point to the latest release and register the new version.","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"Since development of Yggdrasil is quite rapid, a fork may easily become stale. Git permits the developer to forcibly make a master branch on a fork even with upstream master:","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"git fetch upstream\ngit checkout master\ngit reset --hard upstream/master\ngit push origin master --force","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/halfrange.jl\"","category":"page"},{"location":"generated/halfrange/#Half-range-Chebyshev-polynomials-1","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"","category":"section"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"In this paper, Daan Huybrechs introduced the so-called half-range Chebyshev polynomials as the semi-classical orthogonal polynomials with respect to the inner product:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"langle f g rangle = int_0^1 f(x) g(x)fracrm d xsqrt1-x^2","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"By the variable transformation y = 2x-1, the resulting polynomials can be related to orthogonal polynomials on (-11) with the Jacobi weight (1-y)^-frac12 modified by the weight (3+y)^-frac12.","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"We shall use the fact that:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"frac1sqrt3+y = sqrtfrac23+sqrt8sum_n=0^infty P_n(y) left(frac-13+sqrt8right)^n","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"and results from this paper to consider the half-range Chebyshev polynomials as modifications of the Jacobi polynomials P_n^(-frac120)(y).","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"using FastTransforms, LinearAlgebra, Plots, LaTeXStrings\nconst GENFIGS = joinpath(pkgdir(FastTransforms), \"docs/src/generated\")\n!isdir(GENFIGS) && mkdir(GENFIGS)\nplotlyjs()","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"Plots.PlotlyJSBackend()","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"We truncate the generating function to ensure a relative error less than eps() in the uniform norm on (-11):","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"z = -1/(3+sqrt(8))\nK = sqrt(-2z)\nN = ceil(Int, log(abs(z), eps()/2*(1-abs(z))/K) - 1)\nd = K .* z .^(0:N)","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"21-element Vector{Float64}:\n 0.585786437626905\n -0.10050506338833466\n 0.017243942703102998\n -0.0029585928302833363\n 0.0005076142785970194\n -8.70928412987791e-5\n 1.4942769195655289e-5\n -2.563773875152638e-6\n 4.3987405526054037e-7\n -7.547045641060418e-8\n 1.2948683203084688e-8\n -2.221642807903953e-9\n 3.8117364433902886e-10\n -6.53990581302203e-11\n 1.122070444229295e-11\n -1.925168523537399e-12\n 3.303066989314436e-13\n -5.6671670051262317e-14\n 9.723321376130305e-15\n -1.6682582055195078e-15\n 2.862278569867433e-16","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"Then, we convert this representation to the expansion in Jacobi polynomials P_n^(-frac12 0)(y):","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"u = jac2jac(d, 0.0, 0.0, -0.5, 0.0; norm1 = false, norm2 = true)","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"21-element Vector{Float64}:\n 0.9340010840223151\n -0.09412895357801879\n 0.012332003442981326\n -0.0017749924171044493\n 0.00026739546832682813\n -4.137724994351243e-5\n 6.516867953544994e-6\n -1.0393137552650633e-6\n 1.673019401749671e-7\n -2.7126077156467505e-8\n 4.423525597533419e-9\n -7.247452797834485e-10\n 1.1920483520702293e-10\n -1.9671182646957104e-11\n 3.2552876283504113e-12\n -5.400110170678753e-13\n 8.977555063800248e-14\n -1.4948797757615094e-14\n 2.4980123321513196e-15\n -4.125155260660654e-16\n 7.540496818753807e-17","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"Our working polynomial degree will be:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"n = 100","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"100","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"We compute the connection coefficients between the modified orthogonal polynomials and the Jacobi polynomials:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"P = plan_modifiedjac2jac(Float64, n+1, -0.5, 0.0, u)","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"FastTransforms Modified Jacobi--Jacobi plan for 101-element array of Float64","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"We store the connection to first kind Chebyshev polynomials:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"P1 = plan_jac2cheb(Float64, n+1, -0.5, 0.0; normjac = true)","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"FastTransforms Jacobi--Chebyshev plan for 101-element array of Float64","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"We compute the Chebyshev series for the degree-kle n modified polynomial and its values at the Chebyshev points:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"q = k -> lmul!(P1, lmul!(P, [zeros(k); 1.0; zeros(n-k)]))\nqvals = k-> ichebyshevtransform(q(k))","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"#3 (generic function with 1 method)","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"With the symmetric Jacobi matrix for P_n^(-frac12 0)(y) and the modified plan, we may compute the modified Jacobi matrix and the corresponding roots (as eigenvalues):","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"XP = SymTridiagonal([-inv((4n-1)*(4n-5)) for n in 1:n+1], [4n*(2n-1)/(4n-1)/sqrt((4n-3)*(4n+1)) for n in 1:n])\nXQ = FastTransforms.modified_jacobi_matrix(P, XP)\nSymTridiagonal(XQ.dv[1:10], XQ.ev[1:9])","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"10×10 LinearAlgebra.SymTridiagonal{Float64, Vector{Float64}}:\n 0.27324 0.615517 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ \n 0.615517 -0.0327708 0.509195 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ 0.509195 -0.0115134 0.50391 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ 0.50391 -0.00564494 0.502131 ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ 0.502131 -0.00333235 0.501338 ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ 0.501338 -0.00219677 0.500918 ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ 0.500918 -0.00155663 0.500668 ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.500668 -0.00116057 0.500509 ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.500509 -0.000898551 0.5004\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.5004 -0.000716244","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"And we plot:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"x = (chebyshevpoints(Float64, n+1, Val(1)) .+ 1 ) ./ 2\np = plot(x, qvals(0); linewidth=2.0, legend = false, xlim=(0,1), xlabel=L\"x\",\n ylabel=L\"T^h_n(x)\", title=\"Half-Range Chebyshev Polynomials and Their Roots\",\n extra_plot_kwargs = KW(:include_mathjax => \"cdn\"))\nfor k in 1:10\n λ = (eigvals(SymTridiagonal(XQ.dv[1:k], XQ.ev[1:k-1])) .+ 1) ./ 2\n plot!(x, qvals(k); linewidth=2.0, color=palette(:default)[k+1])\n scatter!(λ, zero(λ); markersize=2.5, color=palette(:default)[k+1])\nend\np\nsavefig(joinpath(GENFIGS, \"halfrange.html\"))","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/halfrange.html\"","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"By Theorem 2.20 it turns out that the derivatives of the half-range Chebyshev polynomials are a linear combination of at most two polynomials orthogonal with respect to sqrt(3+y)(1-y)(1+y) on (-11). This fact enables us to compute the banded differentiation matrix:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"v̂ = 3*[u; 0]+XP[1:N+2, 1:N+1]*u\nv = jac2jac(v̂, -0.5, 0.0, 0.5, 1.0; norm1 = true, norm2 = true)\nfunction threshold!(A::AbstractArray, ϵ)\n for i in eachindex(A)\n if abs(A[i]) < ϵ A[i] = 0 end\n end\n A\nend\nP′ = plan_modifiedjac2jac(Float64, n+1, 0.5, 1.0, v)\nDP = UpperTriangular(diagm(1=>[sqrt(n*(n+1/2)) for n in 1:n])) # The classical differentiation matrix representing 𝒟 P^{(-1/2,0)}(y) = P^{(1/2,1)}(y) D_P.\nDQ = UpperTriangular(threshold!(P′\\(DP*(P*I)), 100eps())) # The semi-classical differentiation matrix representing 𝒟 Q(y) = Q̂(y) D_Q.\nUpperTriangular(DQ[1:10,1:10])","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"10×10 LinearAlgebra.UpperTriangular{Float64, Matrix{Float64}}:\n 0.0 2.11682 0.481094 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n ⋅ 0.0 3.82901 0.789619 0.0 0.0 0.0 0.0 0.0 0.0\n ⋅ ⋅ 0.0 5.53918 1.08781 0.0 0.0 0.0 0.0 0.0\n ⋅ ⋅ ⋅ 0.0 7.24821 1.38334 0.0 0.0 0.0 0.0\n ⋅ ⋅ ⋅ ⋅ 0.0 8.95658 1.67782 0.0 0.0 0.0\n ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 10.6646 1.97177 0.0 0.0\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 12.3723 2.26542 0.0\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 14.0799 2.55888\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 15.7874\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/sphere.jl\"","category":"page"},{"location":"generated/sphere/#Spherical-harmonic-addition-theorem-1","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"","category":"section"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"This example confirms numerically that","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"f(z) = fracP_n(zcdot y) - P_n(xcdot y)zcdot y - xcdot y","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"is actually a degree-(n-1) polynomial on mathbbS^2, where P_n is the degree-n Legendre polynomial, and xyz in mathbbS^2. To verify, we sample the function on a Ntimes M equiangular grid defined by:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"beginaligned\ntheta_n = (n+tfrac12)piNquadrm forquad 0le n Nquadrm and\nvarphi_m = 2pi mMquadrm forquad 0le m M\nendaligned","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"we convert the function samples to Fourier coefficients using plan_sph_analysis; and finally, we transform the Fourier coefficients to spherical harmonic coefficients using plan_sph2fourier.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"In the basis of spherical harmonics, it is plain to see the addition theorem in action, since P_n(xcdot y) should only consist of exact-degree-n harmonics.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"For the storage pattern of the arrays, please consult the documentation.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"function threshold!(A::AbstractArray, ϵ)\n for i in eachindex(A)\n if abs(A[i]) < ϵ A[i] = 0 end\n end\n A\nend\n\nusing FastTransforms, LinearAlgebra, Plots\nconst GENFIGS = joinpath(pkgdir(FastTransforms), \"docs/src/generated\")\n!isdir(GENFIGS) && mkdir(GENFIGS)\nplotlyjs()","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Plots.PlotlyJSBackend()","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"The colatitudinal grid (mod pi):","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"N = 15\nθ = (0.5:N-0.5)/N","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"0.03333333333333333:0.06666666666666667:0.9666666666666667","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"The longitudinal grid (mod pi):","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"M = 2*N-1\nφ = (0:M-1)*2/M","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"0.0:0.06896551724137931:1.9310344827586206","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Arbitrarily, we place x at the North pole:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"x = [0,0,1]","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"3-element Vector{Int64}:\n 0\n 0\n 1","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Another vector is completely free:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"y = normalize([.123,.456,.789])","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"3-element Vector{Float64}:\n 0.13375998748853216\n 0.4958906853233388\n 0.8580213831581455","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Thus z in mathbbS^2 is our variable vector, parameterized in spherical coordinates:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"z = (θ,φ) -> [sinpi(θ)*cospi(φ), sinpi(θ)*sinpi(φ), cospi(θ)]","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"#1 (generic function with 1 method)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"On the tensor product grid, the Legendre polynomial P_n(zcdot y) is:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"A = [(2k+1)/(k+1) for k in 0:N-1]\nB = zeros(N)\nC = [k/(k+1) for k in 0:N]\nc = zeros(N); c[N] = 1\npts = vec([z(θ, φ)⋅y for θ in θ, φ in φ])\nphi0 = ones(N*M)\nF = reshape(FastTransforms.clenshaw!(c, A, B, C, pts, phi0, zeros(N*M)), N, M)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"15×29 Matrix{Float64}:\n 0.264259 0.299171 0.304985 0.288068 0.261038 0.237692 0.228241 0.236528 0.259192 0.286391 0.304437 0.300462 0.26755 0.207601 0.130208 0.0483744 -0.0262845 -0.0865116 -0.129804 -0.156955 -0.169985 -0.170403 -0.158265 -0.132139 -0.0899937 -0.0308858 0.0429655 0.124641 0.202756\n 0.212068 0.303332 0.129215 -0.186607 -0.387155 -0.383993 -0.338172 -0.379747 -0.392602 -0.206438 0.109443 0.299961 0.225231 -0.0101802 -0.207053 -0.258628 -0.187516 -0.070652 0.0323131 0.0988479 0.12977 0.130741 0.102005 0.0380582 -0.0627707 -0.180155 -0.256899 -0.215501 -0.0267606\n -0.115553 0.236712 0.221776 -0.251073 -0.32857 0.421619 0.986223 0.482429 -0.299585 -0.280602 0.198511 0.253762 -0.0930651 -0.258938 -0.0793421 0.160653 0.233501 0.154045 0.0336174 -0.0560314 -0.0990238 -0.100375 -0.0604041 0.0261339 0.145985 0.231751 0.1719 -0.0610864 -0.255787\n -0.18454 -0.186901 0.216999 0.207436 -0.278408 -0.36511 -0.189358 -0.35156 -0.304334 0.180746 0.238643 -0.165767 -0.202157 0.128252 0.217098 -0.00943667 -0.200512 -0.194373 -0.0821865 0.0208264 0.0732008 0.0748654 0.0260895 -0.074028 -0.188494 -0.206184 -0.027257 0.20837 0.147067\n 0.233218 -0.0443128 -0.25662 0.0443223 0.302577 0.209245 0.107407 0.198264 0.305263 0.0716125 -0.25045 -0.0709297 0.228915 0.0560634 -0.209167 -0.109098 0.135993 0.209367 0.121014 0.0107106 -0.049922 -0.0518826 0.00472316 0.112882 0.206906 0.148044 -0.0921222 -0.214775 0.0327421\n -0.14959 0.176398 0.159536 -0.157586 -0.253853 -0.135785 -0.0630475 -0.127292 -0.249419 -0.174706 0.141057 0.191837 -0.130845 -0.171771 0.128955 0.181407 -0.058914 -0.206946 -0.154207 -0.0410986 0.0276329 0.029906 -0.034464 -0.146673 -0.208687 -0.0754426 0.17029 0.145612 -0.156134\n 0.03232 -0.216991 -0.0542418 0.201432 0.206916 0.0892457 0.0316764 0.0822717 0.200041 0.210302 -0.0334057 -0.219505 0.00906962 0.211107 -0.0222883 -0.209099 -0.0231776 0.189332 0.183999 0.0724419 -0.00503206 -0.00766855 0.065182 0.177672 0.19593 -0.0044746 -0.206821 -0.0443208 0.20777\n 0.0772106 0.200813 -0.0345837 -0.214416 -0.166372 -0.0543381 -0.0063074 -0.0483886 -0.158601 -0.217382 -0.0533452 0.193042 0.0976693 -0.187906 -0.085199 0.193101 0.105896 -0.154519 -0.211246 -0.107108 -0.019323 -0.0162213 -0.09921 -0.206977 -0.166608 0.0879047 0.201099 -0.0639311 -0.196895\n -0.161616 -0.14919 0.105731 0.2116 0.130202 0.0251362 -0.0160611 0.0199531 0.122174 0.210305 0.12046 -0.134582 -0.17451 0.114917 0.174042 -0.130385 -0.182374 0.0957622 0.234753 0.148573 0.0475436 0.0437788 0.140028 0.233975 0.113813 -0.1691 -0.148371 0.159712 0.133414\n 0.208908 0.0728989 -0.161008 -0.198486 -0.0961065 0.00135321 0.037119 0.00590617 -0.0881639 -0.194067 -0.170766 0.0549875 0.211431 -0.00338118 -0.21986 0.016122 0.234375 0.00021735 -0.247537 -0.203094 -0.0836434 -0.0787903 -0.19406 -0.253043 -0.023216 0.231655 0.0407554 -0.218225 -0.0261102\n -0.203495 0.0220031 0.200371 0.176174 0.0619327 -0.0270702 -0.058089 -0.0310551 0.0543296 0.169516 0.204695 0.0395021 -0.194934 -0.128043 0.183785 0.141369 -0.211961 -0.150004 0.2205 0.283345 0.137864 0.130789 0.275142 0.23809 -0.126501 -0.226893 0.11958 0.198142 -0.109095\n 0.12233 -0.127714 -0.219526 -0.142772 -0.0253159 0.0536809 0.080125 0.0571016 -0.0183211 -0.134724 -0.218347 -0.140698 0.10537 0.230635 -0.0169741 -0.260275 0.00868827 0.306062 -0.0323035 -0.400665 -0.252906 -0.23893 -0.40434 -0.0688019 0.303902 0.0393269 -0.259455 -0.0416906 0.225524\n 0.0533261 0.221676 0.20588 0.0928744 -0.0169863 -0.083121 -0.10464 -0.0859165 -0.0229991 0.0845139 0.199903 0.226054 0.0700661 -0.185075 -0.235303 0.0671548 0.306034 0.0030983 -0.399433 -0.020757 0.815719 0.855083 0.0350084 -0.404293 -0.0323252 0.304047 0.0929697 -0.224541 -0.198835\n -0.251975 -0.233798 -0.13019 -0.0152352 0.0703864 0.11835 0.133806 0.120358 0.0748091 -0.00825682 -0.122061 -0.22853 -0.255028 -0.136944 0.097903 0.288106 0.247787 -0.0273998 -0.313828 -0.4047 -0.353264 -0.349855 -0.403561 -0.327222 -0.0497156 0.234981 0.294129 0.11465 -0.123547\n 0.0890404 0.00957584 -0.0584588 -0.110278 -0.145276 -0.165114 -0.171728 -0.165964 -0.14708 -0.113177 -0.062519 0.00451035 0.0834519 0.16497 0.23634 0.285407 0.305513 0.298672 0.274919 0.248139 0.230823 0.230209 0.246547 0.273036 0.297446 0.305825 0.287718 0.240496 0.170292","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"X = [sinpi(θ)*cospi(φ) for θ in θ, φ in φ]\nY = [sinpi(θ)*sinpi(φ) for θ in θ, φ in φ]\nZ = [cospi(θ) for θ in θ, φ in φ]\nscatter3d(vec(X), vec(Y), vec(Z); markersize=1.25, markercolor=:violetred)\nsurface!(X, Y, Z; surfacecolor=F, legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"sphere1.html\"))","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/sphere1.html\"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"We show the cut in the surface to help illustrate the definition of the grid. In particular, we do not sample the poles.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"We precompute a spherical harmonic–Fourier plan:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"P = plan_sph2fourier(F)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"FastTransforms Spherical harmonic--Fourier plan for 15×29-element array of Float64","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"And an FFTW Fourier analysis plan on mathbbS^2:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"PA = plan_sph_analysis(F)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"FastTransforms plan for FFTW Fourier analysis on the sphere for 15×29-element array of Float64","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Its spherical harmonic coefficients demonstrate that it is exact-degree-n:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"V = PA*F\nU = threshold!(P\\V, 400*eps())","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"15×29 Matrix{Float64}:\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -1.66397e-5 2.73274e-5\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.000271538 -7.91038e-5 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.29805e-5 -0.00164832 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.00703526 -0.00174747 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0122275 0.0220184 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.0503776 0.0488881 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.134224 -0.0799001 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0729185 -0.259962 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.337609 0.00337719 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0610941 0.235853 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0289877 -0.0164793 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.190197 0.192109 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 -0.0788841 0.135585 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.188313 0.0507949 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.142187 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"The L^2(mathbbS^2) norm of the function is:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"nrm1 = norm(U)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"0.6582728344942347","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Similarly, on the tensor product grid, our function samples are:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Pnxy = FastTransforms.clenshaw!(c, A, B, C, [x⋅y], [1.0], [0.0])[1]\nF = [(F[n, m] - Pnxy)/(z(θ[n], φ[m])⋅y - x⋅y) for n in 1:N, m in 1:M]","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"15×29 Matrix{Float64}:\n 5.19948 4.13834 2.99067 1.90658 1.02691 0.455272 0.249877 0.429314 0.977414 1.83893 2.91328 4.06148 5.13287 6.0026 6.60156 6.92544 7.02254 6.96965 6.84793 6.72603 6.65164 6.64905 6.71906 6.83899 6.96269 7.02276 6.93845 6.63197 6.05227\n 5.95491 2.78879 -1.44975 -4.81316 -5.93907 -5.32122 -4.74802 -5.26014 -5.93537 -4.96628 -1.72861 2.51536 5.80241 7.01649 6.35996 4.76275 3.10172 1.83264 1.03553 0.610092 0.43191 0.426508 0.591355 0.996377 1.76414 3.00054 4.64424 6.26964 7.0226\n 6.89687 5.65236 0.11585 -5.28724 -4.64181 1.51819 5.42995 1.95544 -4.33608 -5.4796 -0.331651 5.39124 6.95616 4.78949 1.90996 0.265776 -0.0679633 0.206459 0.546026 0.760489 0.851318 0.854026 0.770114 0.565133 0.231314 -0.0604333 0.208258 1.74968 4.58324\n 3.06027 6.5357 5.89997 -0.165743 -5.46592 -5.06636 -3.28816 -4.90175 -5.62054 -0.644121 5.6253 6.677 3.31846 0.440384 -0.00401181 0.652985 1.01303 0.876591 0.580633 0.35795 0.254199 0.250991 0.347269 0.561893 0.857659 1.01648 0.69514 0.0273999 0.337402\n -0.070137 1.60923 5.43093 6.93528 3.91137 -0.131309 -1.75656 -0.336142 3.61343 6.85843 5.66343 1.83509 -0.053904 0.487406 1.01741 0.644213 0.136921 0.0101545 0.134135 0.275013 0.346961 0.349218 0.282296 0.144972 0.0138328 0.115298 0.603776 1.01615 0.548272\n 0.945078 0.135483 0.27158 2.71505 5.55048 6.82449 7.00499 6.85725 5.69314 2.92844 0.369819 0.0844295 0.912316 0.807551 0.149683 0.0509116 0.357273 0.499174 0.407141 0.269902 0.193177 0.1907 0.262329 0.397299 0.498435 0.37596 0.0666419 0.119637 0.764012\n 0.3347 0.96741 0.756526 0.0516758 0.0403323 0.667862 1.0399 0.710559 0.0718486 0.0205398 0.70939 0.987443 0.382027 0.0075432 0.314675 0.493074 0.249535 0.0255986 0.0288774 0.124344 0.187529 0.189637 0.130366 0.0344678 0.0191719 0.228563 0.486554 0.340488 0.0125441\n 0.19163 0.0244645 0.474228 0.953439 0.971777 0.756739 0.645454 0.743468 0.95977 0.969839 0.515354 0.0373859 0.165042 0.488731 0.32132 0.0219213 0.0963195 0.301654 0.329627 0.240493 0.171995 0.169627 0.234193 0.325354 0.310183 0.111448 0.0141702 0.296273 0.495085\n 0.41699 0.454012 0.154439 0.00689009 0.147415 0.349199 0.434542 0.359728 0.162073 0.00898106 0.134876 0.43942 0.434649 0.100528 0.0376636 0.284172 0.302882 0.085971 -0.0128005 0.0446154 0.109712 0.112106 0.0501911 -0.0122374 0.0727995 0.291434 0.297253 0.0501979 0.0815347\n 0.00653828 0.144506 0.416175 0.496049 0.398793 0.286378 0.242449 0.28086 0.390091 0.493228 0.429442 0.163601 0.00423886 0.186207 0.340647 0.145106 -0.0125214 0.139641 0.288402 0.253913 0.179097 0.176118 0.248108 0.291182 0.154331 -0.0106262 0.126633 0.337571 0.204303\n 0.334489 0.165749 0.014265 0.0385386 0.156172 0.253936 0.289478 0.258454 0.164306 0.0451436 0.010362 0.151498 0.32921 0.257363 0.0225829 0.0493168 0.268651 0.220231 -0.0026208 -0.0383697 0.0440181 0.047986 -0.0336588 -0.0128432 0.205569 0.277144 0.0634765 0.012466 0.242082\n 0.0666146 0.257095 0.341563 0.293211 0.203674 0.139862 0.117949 0.137043 0.198126 0.287354 0.341672 0.267702 0.0789497 -0.00992474 0.150427 0.293905 0.12293 -0.051658 0.138809 0.33873 0.255252 0.247571 0.340446 0.15898 -0.0503184 0.104503 0.292551 0.165851 -0.00643622\n 0.106032 -0.00382806 0.00704658 0.088086 0.17021 0.221457 0.238521 0.223661 0.174806 0.0942214 0.0112304 -0.00679647 0.0953468 0.252997 0.275056 0.0878466 -0.0516354 0.119191 0.338121 0.128404 -0.323093 -0.344224 0.0980961 0.340427 0.138821 -0.0504052 0.0724608 0.267888 0.261055\n 0.286625 0.280994 0.220196 0.149338 0.0951419 0.0642734 0.0542416 0.0629728 0.0923113 0.144964 0.215269 0.278062 0.288893 0.21207 0.0695276 -0.0416382 -0.0180382 0.136094 0.292814 0.340282 0.310784 0.308881 0.339519 0.300016 0.148439 -0.0107592 -0.0450601 0.0595874 0.203734\n 0.0747987 0.122395 0.163672 0.195512 0.217272 0.229726 0.233902 0.230262 0.2184 0.197306 0.166153 0.125451 0.0781262 0.0298766 -0.0118277 -0.0400996 -0.0514099 -0.0472393 -0.0335309 -0.0182388 -0.00839924 -0.0080514 -0.0173325 -0.0324517 -0.0465243 -0.0515701 -0.0414172 -0.0142377 0.0267486","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"scatter3d(vec(X), vec(Y), vec(Z); markersize=1.25, markercolor=:violetred)\nsurface!(X, Y, Z; surfacecolor=F, legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"sphere2.html\"))","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/sphere2.html\"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Its spherical harmonic coefficients demonstrate that it is degree-(n-1):","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"V = PA*F\nU = threshold!(P\\V, 400*eps())","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"15×29 Matrix{Float64}:\n 2.07907 0.87453 0.235893 0.069594 -0.119618 0.0581001 0.0586842 0.0859934 -0.0488866 -0.015775 -0.060899 -0.0291623 -0.000291717 -0.00253358 0.00903247 0.000694039 0.000413142 -0.00117608 0.0011413 0.000780662 0.00140576 0.000942806 -0.000234181 8.63587e-6 -0.00043161 -0.000121732 -3.54626e-5 0.0 0.0\n 1.51317 0.44642 0.120416 -0.169934 0.292081 0.328839 0.332145 0.288911 -0.164244 -0.0423205 -0.163378 -0.0586349 -0.000586539 -0.00145765 0.00519666 -0.00998075 -0.00594126 -0.00862106 0.00836616 0.00369554 0.00665466 0.00342882 -0.000851678 2.16057e-5 -0.00107982 0.0 0.0 0.0 0.0\n 0.36606 -0.627659 -0.169303 -0.592046 1.0176 0.703541 0.710614 0.503834 -0.286426 -0.056082 -0.216504 -0.0224552 -0.000224625 0.0140577 -0.0501173 -0.0493515 -0.0293776 -0.0276576 0.0268398 0.00914327 0.0164645 0.00585456 -0.0014542 0.0 0.0 0.0 0.0 0.0 0.0\n -0.225238 -1.3923 -0.375555 -0.884141 1.51965 0.893241 0.902221 0.498016 -0.283118 -0.0162747 -0.0628284 0.165928 0.00165982 0.0536982 -0.191439 -0.123087 -0.0732701 -0.0534663 0.0518855 0.0122482 0.0220556 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0279478 -1.24976 -0.337105 -0.80053 1.37594 0.669715 0.676448 0.113165 -0.0643333 0.096013 0.370657 0.512707 0.00512874 0.109365 -0.389897 -0.195697 -0.116493 -0.0592355 0.0574841 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.642706 -0.460978 -0.124343 -0.408306 0.701792 0.115506 0.116667 -0.53107 0.30191 0.2422 0.935011 0.866631 0.00866913 0.145962 -0.520371 -0.183527 -0.109249 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.924445 0.171516 0.0462641 -0.0394459 0.0677993 -0.395183 -0.399156 -1.05835 0.601662 0.335991 1.29709 0.970497 0.00970813 0.116526 -0.415426 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.619857 0.0934262 0.0252005 0.0128822 -0.0221418 -0.505099 -0.510177 -1.1197 0.636541 0.30573 1.18027 0.65018 0.00650392 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0816312 -0.512221 -0.138165 -0.239451 0.411566 -0.194804 -0.196763 -0.706203 0.401471 0.16128 0.622619 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n -0.15003 -0.975789 -0.263206 -0.507765 0.872741 0.197111 0.199092 -0.186337 0.105931 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.105958 -0.834521 -0.225101 -0.515565 0.886148 0.287159 0.290046 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.530802 -0.266039 -0.0717606 -0.261012 0.448626 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.668154 0.140073 0.0377829 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.390394 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Finally, the Legendre polynomial P_n(zcdot x) is aligned with the grid:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"pts = vec([z(θ, φ)⋅x for θ in θ, φ in φ])\nF = reshape(FastTransforms.clenshaw!(c, A, B, C, pts, phi0, zeros(N*M)), N, M)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"15×29 Matrix{Float64}:\n 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808\n -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968\n 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489\n -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835\n 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901\n -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532\n 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677\n -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473\n 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677\n -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532\n 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901\n -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835\n 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489\n -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968\n 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"scatter3d(vec(X), vec(Y), vec(Z); markersize=1.25, markercolor=:violetred)\nsurface!(X, Y, Z; surfacecolor=F, legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"sphere3.html\"))","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/sphere3.html\"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"It only has one nonnegligible spherical harmonic coefficient. Can you spot it?","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"V = PA*F\nU = threshold!(P\\V, 400*eps())","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"15×29 Matrix{Float64}:\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.658273 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"That nonnegligible coefficient should be","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"ret = eval(\"√(2π/($(N-1)+1/2))\")","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"\"√(2π/(14+1/2))\"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"which is approximately","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"eval(Meta.parse(ret))","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"0.6582728344942353","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"since the convention in this library is to orthonormalize.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"nrm2 = norm(U)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"0.6582728344942352","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Note that the integrals of both functions P_n(zcdot y) and P_n(zcdot x) and their L^2(mathbbS^2) norms are the same because of rotational invariance. The integral of either is perhaps not interesting as it is mathematically zero, but the norms of either should be approximately the same.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"nrm1 ≈ nrm2","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"true","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/automaticdifferentiation.jl\"","category":"page"},{"location":"generated/automaticdifferentiation/#Automatic-differentiation-through-spherical-harmonic-transforms-1","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"","category":"section"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"This example finds a positive value of lambda in:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"f(r) = sinlambda (kcdot r)","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"for some krinmathbbS^2 such that int_mathbbS^2 f^2 rmdOmega = 1. We do this by using derivative information through:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"dfracpartial fpartial lambda = (kcdot r) coslambda (kcdot r)","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"using FastTransforms, LinearAlgebra","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"The colatitudinal grid (mod pi):","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"N = 15\nθ = (0.5:N-0.5)/N","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"0.03333333333333333:0.06666666666666667:0.9666666666666667","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"The longitudinal grid (mod pi):","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"M = 2*N-1\nφ = (0:M-1)*2/M","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"0.0:0.06896551724137931:1.9310344827586206","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"We precompute a spherical harmonic–Fourier plan:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"P = plan_sph2fourier(Float64, N)","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"FastTransforms Spherical harmonic--Fourier plan for 15×29-element array of Float64","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"And an FFTW Fourier analysis plan on mathbbS^2:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"PA = plan_sph_analysis(Float64, N, M)","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"FastTransforms plan for FFTW Fourier analysis on the sphere for 15×29-element array of Float64","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"Our choice of k and angular parametrization of r:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"k = [2/7, 3/7, 6/7]\nr = (θ,φ) -> [sinpi(θ)*cospi(φ), sinpi(θ)*sinpi(φ), cospi(θ)]","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"#1 (generic function with 1 method)","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"Our initial guess for lambda:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"λ = 1.0","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"1.0","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"Then we run Newton iteration and grab an espresso:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"for _ in 1:7\n F = [sin(λ*(k⋅r(θ,φ))) for θ in θ, φ in φ]\n Fλ = [(k⋅r(θ,φ))*cos(λ*(k⋅r(θ,φ))) for θ in θ, φ in φ]\n U = P\\(PA*F)\n Uλ = P\\(PA*Fλ)\n global λ = λ - (norm(U)^2-1)/(2*sum(U.*Uλ))\n println(\"λ: $(rpad(λ, 18)) and the 2-norm: $(rpad(norm(U), 18))\")\nend","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"λ: 0.5565017029393282 and the 2-norm: 1.8510924318185522\nλ: 0.5031571262839712 and the 2-norm: 1.104184591487036 \nλ: 0.5010418434316171 and the 2-norm: 1.0040147091934828\nλ: 0.5010383094266806 and the 2-norm: 1.000006698425886 \nλ: 0.5010383094167955 and the 2-norm: 1.0000000000187363\nλ: 0.5010383094167954 and the 2-norm: 1.0000000000000002\nλ: 0.5010383094167955 and the 2-norm: 0.9999999999999999\n","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/padua.jl\"","category":"page"},{"location":"generated/padua/#Padua-transform-1","page":"Padua transform","title":"Padua transform","text":"","category":"section"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"This demonstrates the Padua transform and inverse transform, explaining precisely the normalization and points","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"using FastTransforms","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"We define the Padua points and extract Cartesian components:","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"N = 15\npts = paduapoints(N)\nx = pts[:,1]\ny = pts[:,2];\nnothing #hide","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"We take the Padua transform of the function:","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"f = (x,y) -> exp(x + cos(y))\nf̌ = paduatransform(f.(x , y));\nnothing #hide","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"and use the coefficients to create an approximation to the function f:","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"f̃ = (x,y) -> begin\n j = 1\n ret = 0.0\n for n in 0:N, k in 0:n\n ret += f̌[j]*cos((n-k)*acos(x)) * cos(k*acos(y))\n j += 1\n end\n ret\nend","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"#3 (generic function with 1 method)","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"At a particular point, is the function well-approximated?","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"f̃(0.1,0.2) ≈ f(0.1,0.2)","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"true","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"Does the inverse transform bring us back to the grid?","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"ipaduatransform(f̌) ≈ f̃.(x,y)","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"true","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/semiclassical.jl\"","category":"page"},{"location":"generated/semiclassical/#Semi-classical-Jacobi-polynomials-1","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"","category":"section"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"In this example, we will consider the semi-classical orthogonal polynomials with respect to the inner product:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"langle f g rangle = int_-1^1 f(x) g(x) w(x)rm d x","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"where w(x) = w^(alphabetagammadeltaepsilon)(x) = (1-x)^alpha(1+x)^beta(2+x)^gamma(3+x)^delta(5-x)^epsilon is a modification of the Jacobi weight. We shall use results from this paper to consider these semi-classical orthogonal polynomials as modifications of the orthonormalized Jacobi polynomials tildeP_n^(alphabeta)(x).","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"using ApproxFun, FastTransforms, LazyArrays, LinearAlgebra, Plots, LaTeXStrings\nconst GENFIGS = joinpath(pkgdir(FastTransforms), \"docs/src/generated\")\n!isdir(GENFIGS) && mkdir(GENFIGS)\nplotlyjs()","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"Plots.PlotlyJSBackend()","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"We set the five parameters:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"α,β,γ,δ,ϵ = -0.125, -0.25, 0.123, 0.456, 0.789","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"(-0.125, -0.25, 0.123, 0.456, 0.789)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"We use ApproxFun to construct a finite normalized Jacobi series as a proxy for (2+x)^gamma(3+x)^delta(5-x)^epsilon.","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"u = Fun(x->(2+x)^γ*(3+x)^δ*(5-x)^ϵ, NormalizedJacobi(β, α))","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"Fun(NormalizedJacobi(-0.25,-0.125), [9.44307, 0.378961, -0.175993, 0.00993571, -0.00159705, 0.000269325, -5.50832e-5, 1.18886e-5, -2.70741e-6, 6.33251e-7, -1.51159e-7, 3.65681e-8, -8.93731e-9, 2.2014e-9, -5.45681e-10, 1.35976e-10, -3.40364e-11, 8.55277e-12, -2.15663e-12, 5.45371e-13, -1.38184e-13, 3.50987e-14, -8.6989e-15, 2.26453e-15, -6.27902e-16])","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"Our working polynomial degree will be:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"n = 100","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"100","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"We compute the connection coefficients between the modified orthogonal polynomials and the Jacobi polynomials:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"P = plan_modifiedjac2jac(Float64, n+1, α, β, u.coefficients)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"FastTransforms Modified Jacobi--Jacobi plan for 101-element array of Float64","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"We store the connection to first kind Chebyshev polynomials:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"P1 = plan_jac2cheb(Float64, n+1, α, β; normjac = true)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"FastTransforms Jacobi--Chebyshev plan for 101-element array of Float64","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"We compute the Chebyshev series for the degree-kle n modified polynomial and its values at the Chebyshev points:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"q = k -> lmul!(P1, lmul!(P, [zeros(k); 1.0; zeros(n-k)]))\nqvals = k -> ichebyshevtransform(q(k))","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"#5 (generic function with 1 method)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"With the symmetric Jacobi matrix for tildeP_n^(alpha beta)(x) and the modified plan, we may compute the modified Jacobi matrix and the corresponding roots (as eigenvalues):","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"x = Fun(x->x, NormalizedJacobi(β, α))\nXP = SymTridiagonal(Symmetric(Multiplication(x, space(x))[1:n+1, 1:n+1]))\nXQ = FastTransforms.modified_jacobi_matrix(P, XP)\nSymTridiagonal(XQ.dv[1:10], XQ.ev[1:9])","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"10×10 LinearAlgebra.SymTridiagonal{Float64, Vector{Float64}}:\n -0.052227 0.611763 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ \n 0.611763 0.000494468 0.518899 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ 0.518899 0.00129929 0.507083 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ 0.507083 0.000851746 0.503749 ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ 0.503749 0.000542956 0.502328 ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ 0.502328 0.00037014 0.501587 ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ 0.501587 0.000267516 0.501151 ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.501151 0.000202134 0.500873 ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.500873 0.000158029 0.500685\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.500685 0.000126906","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"And we plot:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"x = chebyshevpoints(Float64, n+1, Val(1))\np = plot(x, qvals(0); linewidth=2.0, legend = false, xlim=(-1,1), xlabel=L\"x\",\n ylabel=L\"Q_n(x)\", title=\"Semi-classical Jacobi Polynomials and Their Roots\",\n extra_plot_kwargs = KW(:include_mathjax => \"cdn\"))\nfor k in 1:10\n λ = eigvals(SymTridiagonal(XQ.dv[1:k], XQ.ev[1:k-1]))\n plot!(x, qvals(k); linewidth=2.0, color=palette(:default)[k+1])\n scatter!(λ, zero(λ); markersize=2.5, color=palette(:default)[k+1])\nend\np\nsavefig(joinpath(GENFIGS, \"semiclassical.html\"))","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/semiclassical.html\"","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"By Theorem 2.20 it turns out that the derivatives of these particular semi-classical Jacobi polynomials are a linear combination of at most four polynomials orthogonal with respect to the weight w^(alpha+1beta+1gamma+1delta+1epsilon+1)(x) on (-11). This fact enables us to compute the banded differentiation matrix:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"v = Fun(x->(2+x)^(γ+1)*(3+x)^(δ+1)*(5-x)^(ϵ+1), NormalizedJacobi(β+1, α+1))\nfunction threshold!(A::AbstractArray, ϵ)\n for i in eachindex(A)\n if abs(A[i]) < ϵ A[i] = 0 end\n end\n A\nend\nP′ = plan_modifiedjac2jac(Float64, n+1, α+1, β+1, v.coefficients)\nDP = UpperTriangular(diagm(1=>[sqrt(n*(n+α+β+1)) for n in 1:n])) # The classical differentiation matrix representing 𝒟 P^{(α,β)}(x) = P^{(α+1,β+1)}(x) D_P.\nDQ = UpperTriangular(threshold!(P′\\(DP*(P*I)), 100eps())) # The semi-classical differentiation matrix representing 𝒟 Q(x) = Q̂(x) D_Q.\nUpperTriangular(DQ[1:10, 1:10])","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"10×10 LinearAlgebra.UpperTriangular{Float64, Matrix{Float64}}:\n 0.0 7.02067 3.74167 -0.0809111 -0.113147 0.0 0.0 0.0 0.0 0.0\n ⋅ 0.0 12.0138 5.7562 -0.0612112 -0.149381 0.0 0.0 0.0 0.0\n ⋅ ⋅ 0.0 17.1606 7.59222 -0.0517326 -0.177356 0.0 0.0 0.0\n ⋅ ⋅ ⋅ 0.0 22.3446 9.38452 -0.0442887 -0.203279 0.0 0.0\n ⋅ ⋅ ⋅ ⋅ 0.0 27.5348 11.1618 -0.0369428 -0.228469 0.0\n ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 32.7255 12.932 -0.0294519 -0.253304\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 37.916 14.6983 -0.0218256\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 43.1061 16.462\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 48.2958\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"A faster method now exists via the GramMatrix architecture and its associated displacement equation. Given the modified orthogonal polynomial moments implied by the normalized Jacobi series for u(x), we pad this vector to the necessary size and construct the GramMatrix with these moments, the multiplication operator, and the constant tildeP_0^(alphabeta)(x):","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"μ = PaddedVector(u.coefficients, 2n+1)\nx = Fun(x->x, NormalizedJacobi(β, α))\nXP2 = SymTridiagonal(Symmetric(Multiplication(x, space(x))[1:2n+1, 1:2n+1]))\np0 = Fun(NormalizedJacobi(β, α), [1])(0)\nG = GramMatrix(μ, XP2, p0)\nG[1:10, 1:10]","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"10×10 Matrix{Float64}:\n 6.23087 0.250052 -0.116126 0.00655593 -0.00105379 0.00017771 -3.63458e-5 7.84452e-6 -1.78645e-6 4.17841e-7\n 0.250052 6.16778 0.20056 -0.0956742 0.00537811 -0.000867428 0.00014667 -3.0069e-5 6.50088e-6 -1.48227e-6\n -0.116126 0.20056 6.21001 0.195291 -0.092858 0.00516771 -0.000829459 0.000139559 -2.85329e-5 6.15569e-6\n 0.00655593 -0.0956742 0.195291 6.21487 0.194013 -0.091981 0.00510563 -0.000818228 0.000137483 -2.80846e-5\n -0.00105379 0.00537811 -0.092858 0.194013 6.21641 0.193488 -0.0915835 0.00507762 -0.000813118 0.000136541\n 0.00017771 -0.000867428 0.00516771 -0.091981 0.193488 6.21711 0.193216 -0.0913674 0.00506216 -0.000810261\n -3.63458e-5 0.00014667 -0.000829459 0.00510563 -0.0915835 0.193216 6.21749 0.193058 -0.0912363 0.00505264\n 7.84452e-6 -3.0069e-5 0.000139559 -0.000818228 0.00507762 -0.0913674 0.193058 6.21772 0.192956 -0.0911507\n -1.78645e-6 6.50088e-6 -2.85329e-5 0.000137483 -0.000813118 0.00506216 -0.0912363 0.192956 6.21787 0.192888\n 4.17841e-7 -1.48227e-6 6.15569e-6 -2.80846e-5 0.000136541 -0.000810261 0.00505264 -0.0911507 0.192888 6.21797","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"And compute its cholesky factorization. The upper-triangular Cholesky factor represents the connection between original Jacobi and semi-classical Jacobi as bf P^(alphabeta)(x) = bf Q(x) R.","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"R = cholesky(G).U\nR[1:10, 1:10]","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"10×10 Matrix{Float64}:\n 2.49617 0.100174 -0.0465217 0.0026264 -0.000422164 7.1193e-5 -1.45606e-5 3.14262e-6 -7.15674e-7 1.67393e-7\n 0.0 2.48148 0.0827006 -0.0386613 0.00218434 -0.000352435 5.96937e-5 -1.22442e-5 2.64865e-6 -6.0409e-7\n 0.0 0.0 2.49018 0.0797576 -0.0373701 0.00208827 -0.000335346 5.65089e-5 -1.15595e-5 2.49517e-6\n 0.0 0.0 0.0 2.49139 0.079104 -0.036992 0.00206099 -0.000330425 5.55951e-5 -1.13621e-5\n 0.0 0.0 0.0 0.0 2.49174 0.0788577 -0.0368254 0.00204913 -0.000328267 5.51962e-5\n 0.0 0.0 0.0 0.0 0.0 2.49189 0.0787344 -0.0367357 0.00204268 -0.000327077\n 0.0 0.0 0.0 0.0 0.0 0.0 2.49197 0.078663 -0.0366815 0.00203873\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.49202 0.0786179 -0.0366462\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.49206 0.0785874\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.49208","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"Every else works almost as before, including evaluation on a Chebyshev grid:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"q = k -> lmul!(P1, ldiv!(R, [zeros(k); 1.0; zeros(n-k)]))\nqvals = k -> ichebyshevtransform(q(k))","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"#17 (generic function with 1 method)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"Computation of the modified Jacobi matrix:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"XQ1 = FastTransforms.modified_jacobi_matrix(R, XP)\nnorm(XQ-XQ1)/norm(XQ)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"2.4194977316379476e-16","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"Plotting:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"x = chebyshevpoints(Float64, n+1, Val(1))\np = plot(x, qvals(0); linewidth=2.0, legend = false, xlim=(-1,1), xlabel=L\"x\",\n ylabel=L\"Q_n(x)\", title=\"Semi-classical Jacobi Polynomials and Their Roots\",\n extra_plot_kwargs = KW(:include_mathjax => \"cdn\"))\nfor k in 1:10\n λ = eigvals(SymTridiagonal(XQ1.dv[1:k], XQ1.ev[1:k-1]))\n plot!(x, qvals(k); linewidth=2.0, color=palette(:default)[k+1])\n scatter!(λ, zero(λ); markersize=2.5, color=palette(:default)[k+1])\nend\np\nsavefig(joinpath(GENFIGS, \"semiclassical1.html\"))","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/semiclassical1.html\"","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"And banded differentiation:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"μ′ = PaddedVector(v.coefficients, 2n+1)\nx′ = Fun(x->x, NormalizedJacobi(β+1, α+1))\nXP′ = SymTridiagonal(Symmetric(Multiplication(x′, space(x′))[1:2n+1, 1:2n+1]))\np0′ = Fun(NormalizedJacobi(β+1, α+1), [1])(0)\nG′ = GramMatrix(μ′, XP′, p0′)\nR′ = cholesky(G′).U\nDP = UpperTriangular(diagm(1=>[sqrt(n*(n+α+β+1)) for n in 1:n])) # The classical differentiation matrix representing 𝒟 P^{(α,β)}(x) = P^{(α+1,β+1)}(x) D_P.\nDQ = UpperTriangular(threshold!(R′*(DP*(R\\I)), 100eps())) # The semi-classical differentiation matrix representing 𝒟 Q(x) = Q̂(x) D_Q.\nUpperTriangular(DQ[1:10, 1:10])","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"10×10 LinearAlgebra.UpperTriangular{Float64, Matrix{Float64}}:\n 0.0 7.02067 3.74167 -0.0809111 -0.113147 0.0 0.0 0.0 0.0 0.0\n ⋅ 0.0 12.0138 5.7562 -0.0612112 -0.149381 0.0 0.0 0.0 0.0\n ⋅ ⋅ 0.0 17.1606 7.59222 -0.0517326 -0.177356 0.0 0.0 0.0\n ⋅ ⋅ ⋅ 0.0 22.3446 9.38452 -0.0442887 -0.203279 0.0 0.0\n ⋅ ⋅ ⋅ ⋅ 0.0 27.5348 11.1618 -0.0369428 -0.228469 0.0\n ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 32.7255 12.932 -0.0294519 -0.253304\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 37.916 14.6983 -0.0218256\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 43.1061 16.462\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 48.2958\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"This page was generated using Literate.jl.","category":"page"},{"location":"#FastTransforms.jl-Documentation-1","page":"Home","title":"FastTransforms.jl Documentation","text":"","category":"section"},{"location":"#Introduction-1","page":"Home","title":"Introduction","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.jl allows the user to conveniently work with orthogonal polynomials with degrees well into the millions.","category":"page"},{"location":"#","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Fast-orthogonal-polynomial-transforms-1","page":"Home","title":"Fast orthogonal polynomial transforms","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Fast-Cholesky-factorization-of-the-Gram-matrix-1","page":"Home","title":"Fast Cholesky factorization of the Gram matrix","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"GramMatrix","category":"page"},{"location":"#FastTransforms.GramMatrix","page":"Home","title":"FastTransforms.GramMatrix","text":"GramMatrix(W::AbstractMatrix, X::AbstractMatrix)\n\nConstruct a symmetric positive-definite Gram matrix with data stored in W. Given a family of orthogonal polynomials bf P(x) = p_0(x) p_1(x)ldots and a continuous inner product langle f grangle, the Gram matrix is defined by:\n\nW_ij = langle p_i-1 p_j-1rangle\n\nMoreover, given X, the transposed Jacobi matrix that satisfies x bf P(x) = bf P(x) X, the Gram matrix satisfies the skew-symmetric rank-2 displacement equation (X = X_1n 1n):\n\nX^top W - WX = GJG^top\n\nwhere J = beginpmatrix 0 1 -1 0endpmatrix and where:\n\nG_ 1 = e_nquadrm andquad G_ 2 = W_n-1 X_n-1 n - X^top W_ n\n\nFast (O(n^2)) Cholesky factorization of the Gram matrix returns the connection coefficients between bf P(x) and the polynomials bf Q(x) orthogonal in the modified inner product, bf P(x) = bf Q(x) R.\n\n\n\n\n\n","category":"type"},{"location":"#","page":"Home","title":"Home","text":"ChebyshevGramMatrix","category":"page"},{"location":"#FastTransforms.ChebyshevGramMatrix","page":"Home","title":"FastTransforms.ChebyshevGramMatrix","text":"ChebyshevGramMatrix(μ::AbstractVector)\n\nConstruct a Chebyshev–Gram matrix of size (length(μ)+1)÷2 with entries:\n\nW_ij = fracmu_i-j+1 +mu_i+j-12\n\nDue to the linearization of a product of two first-kind Chebyshev polynomials, the Chebyshev–Gram matrix can be constructed from modified Chebyshev moments:\n\nmu_n = langle T_n-1 1rangle\n\nSpecialized construction and Cholesky factorization is given for this type.\n\nSee also GramMatrix for the general case.\n\n\n\n\n\n","category":"type"},{"location":"#Nonuniform-fast-Fourier-transforms-1","page":"Home","title":"Nonuniform fast Fourier transforms","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"nufft1","category":"page"},{"location":"#FastTransforms.nufft1","page":"Home","title":"FastTransforms.nufft1","text":"Computes a nonuniform fast Fourier transform of type I:\n\nf_j = sum_k=0^N-1 c_k e^-2pirm i fracjN omega_kquadrm forquad 0 le j le N-1\n\n\n\n\n\nComputes a 2D nonuniform fast Fourier transform of type I-I:\n\nF_ij = sum_k=0^M-1sum_ell=0^N-1 C_kell e^-2pirm i (fraciM omega_k + fracjN pi_ell)quadrm forquad 0 le i le M-1quad 0 le j le N-1\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"nufft2","category":"page"},{"location":"#FastTransforms.nufft2","page":"Home","title":"FastTransforms.nufft2","text":"Computes a nonuniform fast Fourier transform of type II:\n\nf_j = sum_k=0^N-1 c_k e^-2pirm i x_j kquadrm forquad 0 le j le N-1\n\n\n\n\n\nComputes a 2D nonuniform fast Fourier transform of type II-II:\n\nF_ij = sum_k=0^M-1sum_ell=0^N-1 C_kell e^-2pirm i (x_i k + y_j ell)quadrm forquad 0 le i le M-1quad 0 le j le N-1\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"nufft3","category":"page"},{"location":"#FastTransforms.nufft3","page":"Home","title":"FastTransforms.nufft3","text":"Computes a nonuniform fast Fourier transform of type III:\n\nf_j = sum_k=0^N-1 c_k e^-2pirm i x_j omega_kquadrm forquad 0 le j le N-1\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"inufft1","category":"page"},{"location":"#FastTransforms.inufft1","page":"Home","title":"FastTransforms.inufft1","text":"Computes an inverse nonuniform fast Fourier transform of type I.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"inufft2","category":"page"},{"location":"#FastTransforms.inufft2","page":"Home","title":"FastTransforms.inufft2","text":"Computes an inverse nonuniform fast Fourier transform of type II.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"paduatransform","category":"page"},{"location":"#FastTransforms.paduatransform","page":"Home","title":"FastTransforms.paduatransform","text":"Padua Transform maps from interpolant values at the Padua points to the 2D Chebyshev coefficients.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"ipaduatransform","category":"page"},{"location":"#FastTransforms.ipaduatransform","page":"Home","title":"FastTransforms.ipaduatransform","text":"Inverse Padua Transform maps the 2D Chebyshev coefficients to the values of the interpolation polynomial at the Padua points.\n\n\n\n\n\n","category":"function"},{"location":"#Other-Exported-Methods-1","page":"Home","title":"Other Exported Methods","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"gaunt","category":"page"},{"location":"#FastTransforms.gaunt","page":"Home","title":"FastTransforms.gaunt","text":"Calculates the Gaunt coefficients, defined by:\n\na(mnmunuq) = frac2(n+nu-2q)+12 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) rmdx\n\nor defined by:\n\nP_n^m(x) P_nu^mu(x) = sum_q=0^q_rm max a(mnmunuq) P_n+nu-2q^m+mu(x)\n\nThis is a Julia implementation of the stable recurrence described in:\n\nY.-l. Xu, Fast evaluation of Gaunt coefficients: recursive approach, J. Comp. Appl. Math., 85:53–65, 1997.\n\n\n\n\n\nCalculates the Gaunt coefficients in 64-bit floating-point arithmetic.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"paduapoints","category":"page"},{"location":"#FastTransforms.paduapoints","page":"Home","title":"FastTransforms.paduapoints","text":"Returns coordinates of the (n+1)(n+2)2 Padua points.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"sphevaluate","category":"page"},{"location":"#FastTransforms.sphevaluate","page":"Home","title":"FastTransforms.sphevaluate","text":"Pointwise evaluation of real orthonormal spherical harmonic:\n\nY_ell^m(thetavarphi) = (-1)^msqrt(ell+frac12)frac(ell-m)(ell+m) P_ell^m(costheta) sqrtfrac2-delta_m02pi leftbeginarrayccc cos mvarphi rm for m ge 0 sin(-mvarphi) rm for m 0endarrayright\n\n\n\n\n\n","category":"function"},{"location":"#Internal-Methods-1","page":"Home","title":"Internal Methods","text":"","category":"section"},{"location":"#Miscellaneous-Special-Functions-1","page":"Home","title":"Miscellaneous Special Functions","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.half","category":"page"},{"location":"#FastTransforms.half","page":"Home","title":"FastTransforms.half","text":"Compute a typed 0.5.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.two","category":"page"},{"location":"#FastTransforms.two","page":"Home","title":"FastTransforms.two","text":"Compute a typed 2.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.δ","category":"page"},{"location":"#FastTransforms.δ","page":"Home","title":"FastTransforms.δ","text":"The Kronecker delta function:\n\ndelta_kj = leftbeginarrayccc 1 rm for k = j 0 rm for k ne jendarrayright\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.Λ","category":"page"},{"location":"#FastTransforms.Λ","page":"Home","title":"FastTransforms.Λ","text":"The Lambda function Lambda(z) = fracGamma(z+frac12)Gamma(z+1) for the ratio of gamma functions.\n\n\n\n\n\nFor 64-bit floating-point arithmetic, the Lambda function uses the asymptotic series for tau in Appendix B of\n\nI. 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.\n\n\n\n\n\nThe Lambda function Lambda(zλ₁λ₂) = fracGamma(z+lambda_1)Γ(z+lambda_2) for the ratio of gamma functions.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.lambertw","category":"page"},{"location":"#FastTransforms.lambertw","page":"Home","title":"FastTransforms.lambertw","text":"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^-1infty).\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.pochhammer","category":"page"},{"location":"#FastTransforms.pochhammer","page":"Home","title":"FastTransforms.pochhammer","text":"Pochhammer symbol (x)_n = fracGamma(x+n)Gamma(x) for the rising factorial.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.stirlingseries","category":"page"},{"location":"#FastTransforms.stirlingseries","page":"Home","title":"FastTransforms.stirlingseries","text":"Stirling's asymptotic series for Gamma(z).\n\n\n\n\n\n","category":"function"},{"location":"#Modified-Chebyshev-Moment-Based-Quadrature-1","page":"Home","title":"Modified Chebyshev Moment-Based Quadrature","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.clenshawcurtisnodes","category":"page"},{"location":"#FastTransforms.clenshawcurtisnodes","page":"Home","title":"FastTransforms.clenshawcurtisnodes","text":"Compute nodes of the Clenshaw—Curtis quadrature rule.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.clenshawcurtisweights","category":"page"},{"location":"#FastTransforms.clenshawcurtisweights","page":"Home","title":"FastTransforms.clenshawcurtisweights","text":"Compute weights of the Clenshaw—Curtis quadrature rule with modified Chebyshev moments of the first kind mu.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.fejernodes1","category":"page"},{"location":"#FastTransforms.fejernodes1","page":"Home","title":"FastTransforms.fejernodes1","text":"Compute nodes of Fejer's first quadrature rule.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.fejerweights1","category":"page"},{"location":"#FastTransforms.fejerweights1","page":"Home","title":"FastTransforms.fejerweights1","text":"Compute weights of Fejer's first quadrature rule with modified Chebyshev moments of the first kind mu.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.fejernodes2","category":"page"},{"location":"#FastTransforms.fejernodes2","page":"Home","title":"FastTransforms.fejernodes2","text":"Compute nodes of Fejer's second quadrature rule.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.fejerweights2","category":"page"},{"location":"#FastTransforms.fejerweights2","page":"Home","title":"FastTransforms.fejerweights2","text":"Compute weights of Fejer's second quadrature rule with modified Chebyshev moments of the second kind mu.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.chebyshevmoments1","category":"page"},{"location":"#FastTransforms.chebyshevmoments1","page":"Home","title":"FastTransforms.chebyshevmoments1","text":"Modified Chebyshev moments of the first kind:\n\n int_-1^+1 T_n(x) rmdx\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.chebyshevjacobimoments1","category":"page"},{"location":"#FastTransforms.chebyshevjacobimoments1","page":"Home","title":"FastTransforms.chebyshevjacobimoments1","text":"Modified Chebyshev moments of the first kind with respect to the Jacobi weight:\n\n int_-1^+1 T_n(x) (1-x)^alpha(1+x)^betarmdx\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.chebyshevlogmoments1","category":"page"},{"location":"#FastTransforms.chebyshevlogmoments1","page":"Home","title":"FastTransforms.chebyshevlogmoments1","text":"Modified Chebyshev moments of the first kind with respect to the logarithmic weight:\n\n int_-1^+1 T_n(x) logleft(frac1-x2right)rmdx\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.chebyshevmoments2","category":"page"},{"location":"#FastTransforms.chebyshevmoments2","page":"Home","title":"FastTransforms.chebyshevmoments2","text":"Modified Chebyshev moments of the second kind:\n\n int_-1^+1 U_n(x) rmdx\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.chebyshevjacobimoments2","category":"page"},{"location":"#FastTransforms.chebyshevjacobimoments2","page":"Home","title":"FastTransforms.chebyshevjacobimoments2","text":"Modified Chebyshev moments of the second kind with respect to the Jacobi weight:\n\n int_-1^+1 U_n(x) (1-x)^alpha(1+x)^betarmdx\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.chebyshevlogmoments2","category":"page"},{"location":"#FastTransforms.chebyshevlogmoments2","page":"Home","title":"FastTransforms.chebyshevlogmoments2","text":"Modified Chebyshev moments of the second kind with respect to the logarithmic weight:\n\n int_-1^+1 U_n(x) logleft(frac1-x2right)rmdx\n\n\n\n\n\n","category":"function"},{"location":"#Elliptic-1","page":"Home","title":"Elliptic","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.Elliptic","category":"page"},{"location":"#FastTransforms.Elliptic","page":"Home","title":"FastTransforms.Elliptic","text":"FastTransforms submodule for the computation of some elliptic integrals and functions.\n\nComplete elliptic integrals of the first and second kinds:\n\nK(k) = int_0^fracpi2 fracrm dthetasqrt1-k^2sin^2thetaquadrm and\n\nE(k) = int_0^fracpi2 sqrt1-k^2sin^2theta rmdtheta\n\nJacobian elliptic functions:\n\nx = int_0^operatornamesn(xk) fracrm dtsqrt(1-t^2)(1-k^2t^2)\n\nx = int_operatornamecn(xk)^1 fracrm dtsqrt(1-t^2)1-k^2(1-t^2)\n\nx = int_operatornamedn(xk)^1 fracrm dtsqrt(1-t^2)(t^2-1+k^2)\n\nand the remaining nine are defined by:\n\noperatornamepq(xk) = fracoperatornamepr(xk)operatornameqr(xk) = frac1operatornameqp(xk)\n\n\n\n\n\n","category":"module"}] +[{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/spinweighted.jl\"","category":"page"},{"location":"generated/spinweighted/#Spin-weighted-spherical-harmonics-1","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"","category":"section"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"This example plays with analysis of:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"f(r) = e^rm i kcdot r","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"for some kinmathbbR^3 and where rinmathbbS^2, using spin-0 spherical harmonics.","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"It applies ð, the spin-raising operator, both on the spin-0 coefficients as well as the original function, followed by a spin-1 analysis to compare coefficients.","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"For the storage pattern of the arrays, please consult the documentation.","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"using FastTransforms, LinearAlgebra","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"The colatitudinal grid (mod pi):","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"N = 10\nθ = (0.5:N-0.5)/N","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"0.05:0.1:0.95","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"The longitudinal grid (mod pi):","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"M = 2*N-1\nφ = (0:M-1)*2/M","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"0.0:0.10526315789473684:1.894736842105263","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"Our choice of k and angular parametrization of r:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"k = [2/7, 3/7, 6/7]\nr = (θ,φ) -> [sinpi(θ)*cospi(φ), sinpi(θ)*sinpi(φ), cospi(θ)]","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"#1 (generic function with 1 method)","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"On the tensor product grid, our function samples are:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"F = [exp(im*(k⋅r(θ,φ))) for θ in θ, φ in φ]","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"10×19 Matrix{ComplexF64}:\n 0.628413+0.77788im 0.613246+0.789892im 0.603399+0.79744im 0.600106+0.79992im 0.603786+0.797146im 0.613972+0.789328im 0.629387+0.777092im 0.64815+0.761513im 0.668065+0.744103im 0.686931+0.726723im 0.702801+0.711386im 0.71416+0.699982im 0.720001+0.693973im 0.71983+0.694151im 0.713662+0.700491im 0.702017+0.71216im 0.685934+0.727664im 0.666955+0.745098im 0.647044+0.762452im\n 0.626742+0.779227im 0.582025+0.813171im 0.552374+0.833596im 0.542362+0.840145im 0.55355+0.832816im 0.584193+0.811615im 0.629571+0.776943im 0.68294+0.730474im 0.736952+0.675945im 0.785185+0.619262im 0.823211+0.567736im 0.848825+0.528674im 0.861428+0.507879im 0.861065+0.508495im 0.84773+0.530428im 0.821392+0.570364im 0.782715+0.62238im 0.734019+0.679129im 0.679858+0.733344im\n 0.690857+0.722991im 0.625071+0.780568im 0.580335+0.814378im 0.565059+0.82505im 0.582122+0.813101im 0.628309+0.777964im 0.694941+0.719066im 0.769832+0.638246im 0.840471+0.541857im 0.897514+0.440985im 0.936972+0.349406im 0.959893+0.280368im 0.969821+0.243819im 0.969549+0.244899im 0.958985+0.283457im 0.935221+0.354065im 0.894765+0.446538im 0.836798+0.547511im 0.76563+0.643282im\n 0.799876+0.600166im 0.729022+0.68449im 0.678871+0.734257im 0.661444+0.749994im 0.680901+0.732375im 0.732596+0.680663im 0.804139+0.594441im 0.878702+0.477371im 0.940401+0.340068im 0.97989+0.199537im 0.997175+0.0751106im 0.999864-0.0165003im 0.997938-0.0641824im 0.998027-0.062782im 0.999923-0.0124432im 0.996684+0.0813636im 0.978303+0.207181im 0.937478+0.348046im 0.874727+0.484617im\n 0.914598+0.404364im 0.858511+0.512795im 0.815749+0.578405im 0.800419+0.599441im 0.81752+0.5759im 0.861473+0.507803im 0.917769+0.397116im 0.967817+0.251653im 0.996186+0.0872572im 0.99722-0.07452im 0.977203-0.212305im 0.950621-0.310353im 0.93288-0.360187im 0.933439-0.358735im 0.952008-0.306074im 0.978656-0.205506im 0.997827-0.065887im 0.99532+0.0966353im 0.965471+0.260509im\n 0.989052+0.147569im 0.963701+0.266985im 0.939852+0.341582im 0.930644+0.365927im 0.940896+0.338696im 0.965234+0.261387im 0.990188+0.13974im 0.999905-0.0137846im 0.983699-0.179822im 0.94183-0.33609im 0.88602-0.463647im 0.834409-0.551146im 0.804097-0.594498im 0.805021-0.593247im 0.836879-0.547388im 0.889222-0.457475im 0.944703-0.327927im 0.985349-0.170549im 0.999989-0.00462386im\n 0.99096-0.134156im 0.999703-0.0243628im 0.998928+0.0462861im 0.997566+0.0697274im 0.999053+0.0435207im 0.999562-0.0295972im 0.989978-0.141225im 0.960887-0.276941im 0.908431-0.418034im 0.837893-0.545834im 0.762849-0.646576im 0.700449-0.713703im 0.665602-0.746307im 0.666649-0.745372im 0.703339-0.710855im 0.76689-0.641779im 0.842129-0.539276im 0.91195-0.410301im 0.963143-0.26899im\n 0.919472-0.393156im 0.950297-0.311346im 0.966254-0.257589im 0.970887-0.23954im 0.965686-0.259711im 0.948995-0.315292im 0.91723-0.398357im 0.867837-0.49685im 0.802371-0.596825im 0.727938-0.685643im 0.656033-0.754733im 0.599431-0.800426im 0.568692-0.82255im 0.569608-0.821916im 0.602006-0.798492im 0.659781-0.751458im 0.732172-0.68112im 0.806377-0.591401im 0.871077-0.491147im\n 0.80566-0.592379im 0.837633-0.546233im 0.856754-0.515725im 0.862863-0.505438im 0.856026-0.516933im 0.836173-0.548466im 0.8035-0.595305im 0.759389-0.650637im 0.707251-0.706962im 0.652712-0.757606im 0.602883-0.79783im 0.564968-0.825113im 0.544739-0.838606im 0.545338-0.838216im 0.566673-0.823943im 0.605429-0.795899im 0.655721-0.755004im 0.710305-0.703894im 0.762122-0.647434im\n 0.695346-0.718675im 0.70912-0.705088im 0.717813-0.696236im 0.720677-0.693271im 0.717475-0.696585im 0.708471-0.70574im 0.694445-0.719545im 0.676692-0.736266im 0.656981-0.753907im 0.637428-0.77051im 0.620269-0.784389im 0.607563-0.794272im 0.600886-0.799335im 0.601083-0.799186im 0.608129-0.793839im 0.621132-0.783706im 0.638483-0.769636im 0.658105-0.752927im 0.67776-0.735284im","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"We precompute a spin-0 spherical harmonic–Fourier plan:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"P = plan_spinsph2fourier(F, 0)","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"FastTransforms Spin-weighted spherical harmonic--Fourier plan for 10×19-element array of ComplexF64","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"And an FFTW Fourier analysis plan on mathbbS^2:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"PA = plan_spinsph_analysis(F, 0)","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"FastTransforms plan for FFTW Fourier analysis on the sphere (spin-weighted) for 10×19-element array of ComplexF64","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"Its spin-0 spherical harmonic coefficients are:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"U⁰ = P\\(PA*F)","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"10×19 Matrix{ComplexF64}:\n 2.98294-8.51991e-17im -0.560381+0.373587im 0.560381+0.373587im 0.0307268-0.0737442im 0.0307268+0.0737442im 0.00123905+0.0063329im -0.00123905+0.0063329im -0.000278656-0.000280997im -0.000278656+0.000280997im 1.91763e-5+3.91877e-6im -1.91763e-5+3.91877e-6im -7.51512e-7+3.05775e-7im -7.51512e-7-3.05775e-7im 1.62607e-8-2.39542e-8im -1.62607e-8-2.39542e-8im -7.57573e-12+9.06989e-10im -7.6043e-12-9.06983e-10im -1.32856e-11-2.14392e-11im 1.44574e-11-2.09394e-11im\n -9.83939e-17+1.585im -0.147488-0.221233im -0.147488+0.221233im 0.0242802+0.0101168im -0.0242802+0.0101168im -0.001828+0.000357651im -0.001828-0.000357651im 7.31346e-5-7.25251e-5im -7.31346e-5-7.25251e-5im -9.36425e-7+4.58234e-6im -9.36425e-7-4.58234e-6im -6.79393e-8-1.66977e-7im 6.79393e-8-1.66977e-7im 4.99533e-9+3.39094e-9im 4.99533e-9-3.39094e-9im -1.78808e-10-1.4939e-12im 1.78807e-10-1.49874e-12im 3.97537e-12-2.47069e-12im 3.88749e-12+2.67669e-12im\n -0.296042+1.9373e-16im 0.0419095-0.0279397im -0.0419095-0.0279397im -0.00179667+0.00431201im -0.00179667-0.00431201im -5.92556e-5-0.000302862im 5.92556e-5-0.000302862im 1.12623e-5+1.13569e-5im 1.12623e-5-1.13569e-5im -6.70874e-7-1.37097e-7im 6.70874e-7-1.37097e-7im 2.31726e-8-9.42846e-9im 2.31726e-8+9.42846e-9im -4.48157e-10+6.60198e-10im 4.48157e-10+6.60199e-10im 1.83296e-13-2.21049e-11im 1.86671e-13+2.21043e-11im 2.77146e-13+4.85403e-13im -3.40624e-13+4.58315e-13im\n 7.69323e-17-0.0243812im 0.00315419+0.00473128im 0.00315419-0.00473128im -0.000498246-0.000207603im 0.000498246-0.000207603im 3.42215e-5-6.6955e-6im 3.42215e-5+6.6955e-6im -1.23971e-6+1.22938e-6im 1.23971e-6+1.22938e-6im 1.44141e-8-7.05344e-8im 1.44141e-8+7.05344e-8im 9.54963e-10+2.34704e-9im -9.54963e-10+2.34704e-9im -6.22737e-11-4.22728e-11im -6.22737e-11+4.22728e-11im 2.09765e-12+1.71393e-14im -2.09747e-12+1.79766e-14im -5.56471e-13+3.3894e-13im -5.39577e-13-3.78603e-13im\n -0.000199834-6.42779e-17im -0.000327232+0.000218154im 0.000327232+0.000218154im 1.67027e-5-4.00864e-5im 1.67027e-5+4.00864e-5im 5.5389e-7+2.83099e-6im -5.5389e-7+2.83099e-6im -1.01124e-7-1.01974e-7im -1.01124e-7+1.01974e-7im 5.69484e-9+1.16377e-9im -5.69484e-9+1.16377e-9im -1.69612e-10+6.90117e-11im -1.69612e-10-6.90117e-11im 2.98197e-12-4.39287e-12im -2.98201e-12-4.39288e-12im -3.48909e-14+4.21983e-12im -3.57157e-14-4.21966e-12im -4.58893e-14-8.03264e-14im 5.6381e-14-7.5835e-14im\n -6.51867e-17-0.000282488im -7.0029e-6-1.05044e-5im -7.0029e-6+1.05044e-5im 2.24809e-6+9.36704e-7im -2.24809e-6+9.36704e-7im -1.76539e-7+3.45402e-8im -1.76539e-7-3.45402e-8im 6.55393e-9-6.49931e-9im -6.55393e-9-6.49931e-9im -7.13679e-11+3.49235e-10im -7.1368e-11-3.49235e-10im -4.99715e-12-1.22817e-11im 4.99718e-12-1.22817e-11im 1.69023e-11+1.14737e-11im 1.69023e-11-1.14737e-11im -5.44917e-13-4.41379e-15im 5.44856e-13-4.70669e-15im 1.5798e-13-9.50585e-14im 1.52381e-13+1.08137e-13im\n 3.58969e-5-4.03624e-17im -4.7402e-7+3.16014e-7im 4.7402e-7+3.16014e-7im -3.23608e-8+7.76658e-8im -3.23608e-8-7.76658e-8im -1.6111e-9-8.2345e-9im 1.6111e-9-8.2345e-9im 2.28327e-10+2.30246e-10im 2.28327e-10-2.30246e-10im -1.02557e-11-2.09579e-12im 1.02557e-11-2.09576e-12im 4.54949e-11-1.8511e-11im 4.54949e-11+1.85109e-11im -5.65258e-13+8.32684e-13im 5.65261e-13+8.3268e-13im 9.40322e-15-1.14115e-12im 9.65269e-15+1.14112e-12im 8.76404e-15+1.53587e-14im -1.07761e-14+1.4515e-14im\n 1.02759e-16+2.64492e-6im -5.98533e-8-8.978e-8im -5.98533e-8+8.978e-8im -2.2753e-10-9.48042e-11im 2.2753e-10-9.48042e-11im 2.65455e-10-5.19369e-11im 2.65455e-10+5.19368e-11im -1.37076e-11+1.35933e-11im 1.37076e-11+1.35933e-11im 3.35969e-11-1.64405e-10im 3.35969e-11+1.64405e-10im 1.96453e-12+4.82831e-12im -1.96456e-12+4.82829e-12im -8.01172e-12-5.43855e-12im -8.01172e-12+5.43851e-12im 2.15355e-13+1.72018e-15im -2.15344e-13+1.85439e-15im -7.69555e-14+4.59648e-14im -7.40025e-14-5.28722e-14im\n -1.25204e-7-1.00025e-16im 6.65757e-9-4.43838e-9im -6.65757e-9-4.43838e-9im -1.43603e-11+3.44646e-11im -1.43603e-11-3.44647e-11im 5.78456e-14+2.95764e-13im -5.78679e-14+2.9576e-13im -3.63314e-11-3.66368e-11im -3.63314e-11+3.66367e-11im 7.38143e-13+1.50851e-13im -7.3814e-13+1.50867e-13im -7.24159e-12+2.94646e-12im -7.24159e-12-2.94644e-12im 4.07073e-14-5.99537e-14im -4.06954e-14-5.99558e-14im -1.50601e-15+1.8179e-13im -1.53602e-15-1.81804e-13im -6.15023e-16-1.09078e-15im 7.91118e-16-1.04469e-15im\n -1.37837e-16-3.0609e-9im 4.29751e-10+6.44627e-10im 4.29751e-10-6.44627e-10im -5.01384e-12-2.08911e-12im 5.01382e-12-2.08911e-12im -3.61552e-10+7.07385e-11im -3.61552e-10-7.07385e-11im 2.83376e-12-2.81014e-12im -2.83376e-12-2.81015e-12im -4.57901e-11+2.24071e-10im -4.57901e-11-2.24071e-10im -4.06243e-13-9.98407e-13im 4.06233e-13-9.98415e-13im 1.09292e-11+7.41901e-12im 1.09292e-11-7.41901e-12im -4.4566e-14-3.61759e-16im 4.45481e-14-3.97552e-16im 1.05374e-13-6.28694e-14im 1.01304e-13+7.23998e-14im","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"We can check its L^2(mathbbS^2) norm against an exact result:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"norm(U⁰) ≈ sqrt(4π)","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"true","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"Spin can be incremented by applying ð, either on the spin-0 coefficients:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"U¹c = zero(U⁰)\nfor n in 1:N-1\n U¹c[n, 1] = sqrt(n*(n+1))*U⁰[n+1, 1]\nend\nfor m in 1:M÷2\n for n in 0:N-1\n U¹c[n+1, 2m] = -sqrt((n+m)*(n+m+1))*U⁰[n+1, 2m]\n U¹c[n+1, 2m+1] = sqrt((n+m)*(n+m+1))*U⁰[n+1, 2m+1]\n end\nend","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"or on the original function through analysis with spin-1 spherical harmonics:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"F = [-(k[1]*(im*cospi(θ)*cospi(φ) + sinpi(φ)) + k[2]*(im*cospi(θ)*sinpi(φ)-cospi(φ)) - im*k[3]*sinpi(θ))*exp(im*(k⋅r(θ,φ))) for θ in θ, φ in φ]","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"10×19 Matrix{ComplexF64}:\n 0.384531+0.240303im 0.405167+0.0811656im 0.376168-0.08059im 0.296802-0.228644im 0.17173-0.345547im 0.0121942-0.415058im -0.164084-0.425345im -0.334877-0.37218im -0.47719-0.260862im -0.571781-0.105926im -0.607006+0.0715576im -0.58067+0.248234im -0.499453+0.402825im -0.376425+0.519276im -0.227802+0.588046im -0.0700889+0.605739im 0.0817378+0.573795im 0.214909+0.497059im 0.318781+0.382786im\n 0.16375+0.41829im 0.162116+0.268361im 0.128477+0.110061im 0.056034-0.0418675im -0.0588234-0.167146im -0.211042-0.242529im -0.383203-0.247832im -0.546769-0.173942im -0.669506-0.0288607im -0.726395+0.162453im -0.708448+0.365492im -0.624684+0.547246im -0.496849+0.685091im -0.350631+0.769743im -0.208037+0.802572im -0.0835191+0.79034im 0.016198+0.740573im 0.0899356+0.659195im 0.13893+0.55045im\n 0.00394925+0.589002im -0.0517508+0.441892im -0.117739+0.283703im -0.202276+0.132736im -0.313608+0.0132761im -0.450683-0.0475101im -0.596088-0.0271995im -0.717144+0.0808626im -0.777618+0.259594im -0.754769+0.470906im -0.650847+0.67007im -0.491452+0.823236im -0.313141+0.917212im -0.149502+0.957306im -0.0230169+0.957535im 0.0563716+0.930505im 0.0891711+0.881918im 0.083394+0.810775im 0.0511118+0.713512im\n -0.037706+0.764342im -0.167663+0.63523im -0.287398+0.487323im -0.400578+0.346904im -0.514827+0.244114im -0.62967+0.207393im -0.727882+0.254883im -0.777945+0.383583im -0.749353+0.563975im -0.631836+0.748617im -0.444017+0.892859im -0.224888+0.974245im -0.0160482+0.997806im 0.151723+0.986424im 0.261377+0.965157im 0.306018+0.948535im 0.286044+0.935214im 0.209798+0.910832im 0.0944472+0.857391im\n 0.0677134+0.90671im -0.132933+0.832114im -0.31272+0.722356im -0.463011+0.610267im -0.584223+0.531084im -0.67363+0.512373im -0.717075+0.564833im -0.692616+0.674959im -0.585463+0.805978im -0.402896+0.912201im -0.175697+0.960918im 0.0558086+0.947262im 0.258917+0.892857im 0.415705+0.832204im 0.518079+0.796763im 0.559103+0.802847im 0.530434+0.845158im 0.428907+0.898149im 0.265719+0.927327im\n 0.292353+0.944771im 0.0581069+0.961031im -0.162367+0.923101im -0.343726+0.861107im -0.474077+0.809852im -0.546787+0.794409im -0.553921+0.82068im -0.48849+0.87246im -0.353637+0.917742im -0.169005+0.924095im 0.0340849+0.875449im 0.226308+0.779766im 0.391603+0.66433im 0.527207+0.564551im 0.633493+0.513im 0.702424+0.529934im 0.714639+0.614543im 0.649544+0.740756im 0.502126+0.864782im\n 0.544556+0.82786im 0.335621+0.941682im 0.11692+0.992061im -0.074329+0.994789im -0.214433+0.975768im -0.291963+0.955971im -0.303796+0.942141im -0.254076+0.925583im -0.155653+0.88869im -0.0290943+0.815954im 0.10377+0.703491im 0.228799+0.562131im 0.344287+0.414327im 0.457269+0.288908im 0.572819+0.215991im 0.682616+0.220188im 0.761104+0.310327im 0.774782+0.470071im 0.701202+0.658896im\n 0.711777+0.57455im 0.575876+0.753741im 0.402359+0.877629im 0.227778+0.943189im 0.0807159+0.961489im -0.0227441+0.946886im -0.078234+0.908848im -0.0903981+0.849391im -0.0697694+0.765587im -0.0288206+0.65453im 0.0229208+0.517715im 0.0830404+0.363193im 0.157068+0.205921im 0.254332+0.067373im 0.379593-0.026087im 0.524118-0.0484074im 0.662039+0.0163403im 0.75688+0.163406im 0.777104+0.364037im\n 0.726602+0.264733im 0.673634+0.460754im 0.564658+0.62254im 0.42451+0.734172im 0.277783+0.792276im 0.142935+0.801596im 0.0303916+0.769731im -0.0562551+0.703542im -0.117442+0.608011im -0.154422+0.487008im -0.166521+0.34507im -0.149734+0.189474im -0.0974708+0.0321493im -0.00385489-0.109276im 0.131046-0.212499im 0.296212-0.254862im 0.468111-0.220723im 0.615102-0.109082im 0.707182+0.0630756im\n 0.597178-0.0185423im 0.601301+0.161421im 0.546217+0.32944im 0.442188+0.46657im 0.304261+0.559965im 0.149097+0.603283im -0.00741158+0.595734im -0.151367+0.540622im -0.271099+0.44408im -0.356905+0.314404im -0.400841+0.161998im -0.397025-0.000359286im -0.342634-0.157415im -0.239438-0.292068im -0.0953011-0.38711im 0.0751723-0.428079im 0.251638-0.406595im 0.410936-0.323077im 0.53139-0.187637im","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"We change plans with spin-1 now and reanalyze:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"P = plan_spinsph2fourier(F, 1)\nPA = plan_spinsph_analysis(F, 1)\nU¹s = P\\(PA*F)","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"10×19 Matrix{ComplexF64}:\n 4.81048e-17+2.24152im 0.792499-0.528332im 0.792499+0.528332im -0.0752649+0.180636im 0.0752649+0.180636im -0.00429218-0.0219378im -0.00429218+0.0219378im 0.00124619+0.00125666im -0.00124619+0.00125666im -0.000105033-2.1464e-5im -0.000105033+2.1464e-5im 4.87035e-6-1.98165e-6im -4.87035e-6-1.98165e-6im -1.21684e-7+1.79257e-7im -1.21684e-7-1.79257e-7im 6.4556e-11-7.69602e-9im -6.42651e-11-7.6961e-9im 1.3734e-10+1.99137e-10im 1.25853e-10-2.02909e-10im\n -0.725151+5.32221e-18im 0.361271+0.541907im -0.361271+0.541907im -0.0841092-0.0350455im -0.0841092+0.0350455im 0.00817504-0.00159947im -0.00817504-0.00159947im -0.000400574+0.000397236im -0.000400574-0.000397236im 6.06873e-6-2.9697e-5im -6.06873e-6-2.9697e-5im 5.08411e-7+1.24954e-6im 5.08411e-7-1.24954e-6im -4.23861e-8-2.87724e-8im 4.23861e-8-2.87724e-8im 1.69612e-9+1.41282e-11im 1.69628e-9-1.41119e-11im -4.07203e-11+2.96639e-11im 3.63017e-11+2.53159e-11im\n -7.43762e-17-0.0844589im -0.145179+0.096786im -0.145179-0.096786im 0.00803495-0.0192839im -0.00803495-0.0192839im 0.000324556+0.00165884im 0.000324556-0.00165884im -7.29881e-5-7.36014e-5im 7.29881e-5-7.36014e-5im 5.02037e-6+1.02593e-6im 5.02037e-6-1.02593e-6im -1.9664e-7+8.00072e-8im 1.9664e-7+8.00072e-8im 4.25378e-9-6.26388e-9im 4.25378e-9+6.26388e-9im 6.53269e-12+2.1811e-10im -6.52146e-12+2.18144e-10im -1.63776e-11+3.366e-12im -1.53622e-11-3.76794e-12im\n -0.000893686-1.84222e-18im -0.014106-0.0211589im 0.014106-0.0211589im 0.00272901+0.00113709im 0.00272901-0.00113709im -0.00022178+4.33918e-5im 0.00022178+4.33918e-5im 9.27716e-6-9.19981e-6im 9.27716e-6+9.19981e-6im -1.22275e-7+5.98394e-7im 1.22275e-7+5.98394e-7im -9.06826e-9-2.22464e-8im -9.06826e-9+2.22464e-8im 6.14926e-10+3.8178e-10im -6.14926e-10+3.81779e-10im -2.02946e-11+8.95683e-11im -2.03114e-11-8.95764e-11im -7.74583e-13-2.47296e-12im 9.78849e-13-2.19174e-12im\n -2.77419e-17-0.00154725im 0.00179232-0.00119488im 0.00179232+0.00119488im -0.000108246+0.00025979im 0.000108246+0.00025979im -4.14499e-6-2.11852e-5im -4.14499e-6+2.11852e-5im 8.58374e-7+8.65614e-7im -8.58374e-7+8.65614e-7im -5.40698e-8-1.11423e-8im -5.40698e-8+1.11423e-8im 1.63049e-9-7.15813e-10im -1.63049e-9-7.15813e-10im 2.6e-10+2.34806e-10im 2.6e-10-2.34805e-10im -9.52905e-12-1.46897e-12im 9.53119e-12-1.47348e-12im 3.24098e-12-6.83905e-13im 3.02544e-12+8.12829e-13im\n 0.000232639-3.672e-17im 4.53837e-5+6.80755e-5im -4.53837e-5+6.80755e-5im -1.68233e-5-7.00961e-6im -1.68233e-5+7.00961e-6im 1.49733e-6-2.92965e-7im -1.49733e-6-2.92965e-7im -6.18845e-8+6.17602e-8im -6.18845e-8-6.17602e-8im 4.71847e-10-3.03855e-9im -4.71847e-10-3.03855e-9im 1.02475e-9-3.12162e-10im 1.02475e-9+3.12161e-10im -2.32851e-11+2.79721e-11im 2.3285e-11+2.79721e-11im 5.51359e-12-2.47804e-11im 5.51954e-12+2.47829e-11im 2.05758e-13+6.50666e-13im -2.63466e-13+5.82305e-13im\n -2.539e-17+1.97929e-5im 3.54721e-6-2.36505e-6im 3.54721e-6+2.36505e-6im 2.74198e-7-6.5817e-7im -2.74198e-7-6.5817e-7im 1.49997e-8+7.82205e-8im 1.49997e-8-7.82205e-8im -2.72196e-9-2.73494e-9im 2.72196e-9-2.73494e-9im 4.22222e-10-1.58584e-9im 4.22222e-10+1.58584e-9im 1.4028e-11+4.2318e-11im -1.40281e-11+4.2318e-11im -7.00664e-11-6.32065e-11im -7.00664e-11+6.32064e-11im 1.8132e-12+2.78513e-13im -1.81361e-12+2.79436e-13im -8.89729e-13+1.90111e-13im -8.28862e-13-2.3028e-13im\n -1.0618e-6-1.60227e-16im 5.06265e-7+7.59331e-7im -5.06265e-7+7.59331e-7im 2.28542e-9+1.27481e-9im 2.28542e-9-1.27481e-9im -1.53825e-9+3.35011e-10im 1.53825e-9+3.35011e-10im -2.24932e-9-2.42853e-9im -2.24932e-9+2.42853e-9im 1.43487e-10+3.57671e-11im -1.43487e-10+3.57671e-11im -4.84249e-10+1.47683e-10im -4.84249e-10-1.47683e-10im 9.17835e-12-1.10319e-11im -9.17827e-12-1.10319e-11im -2.61497e-12+1.18851e-11im -2.61825e-12-1.18864e-11im -8.21156e-14-2.58948e-13im 1.05894e-13-2.32289e-13im\n 1.80271e-18-2.92736e-8im -6.36569e-8+4.17996e-8im -6.36569e-8-4.17996e-8im 6.18282e-10-1.39021e-9im -6.18282e-10-1.39021e-9im -4.16445e-10+7.77363e-11im -4.16445e-10-7.77363e-11im 8.6631e-12-8.2083e-12im -8.66306e-12-8.20835e-12im -6.71953e-11+2.52391e-10im -6.71953e-11-2.52391e-10im -1.00987e-12-3.04635e-12im 1.00985e-12-3.0463e-12im 1.11584e-11+1.00647e-11im 1.11584e-11-1.00647e-11im -1.30587e-13-2.0048e-14im 1.30633e-13-2.01267e-14im 1.41977e-13-3.03707e-14im 1.32247e-13+3.68603e-14im\n -1.3507e-9+1.40212e-16im -3.62349e-10-4.74615e-10im 3.62349e-10-4.74615e-10im 1.35757e-9-2.98609e-9im 1.35757e-9+2.98609e-9im -2.68037e-12-1.17672e-11im 2.68035e-12-1.17672e-11im 3.06502e-9+3.30916e-9im 3.06502e-9-3.30916e-9im -2.9668e-11-7.39519e-12im 2.9668e-11-7.39519e-12im 6.60325e-10-2.01412e-10im 6.60325e-10+2.01411e-10im -1.89842e-12+2.28193e-12im 1.89842e-12+2.28191e-12im 3.56751e-12-1.6238e-11im 3.57202e-12+1.62398e-11im 1.69962e-14+5.36059e-14im -2.19325e-14+4.80988e-14im","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"Finally, we check L^2(mathbbS^2) norms against another exact result:","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"norm(U¹c) ≈ norm(U¹s) ≈ sqrt(8π/3*(k⋅k))","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"true","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"","category":"page"},{"location":"generated/spinweighted/#","page":"Spin-weighted spherical harmonics","title":"Spin-weighted spherical harmonics","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/annulus.jl\"","category":"page"},{"location":"generated/annulus/#Integration-on-an-annulus-1","page":"Integration on an annulus","title":"Integration on an annulus","text":"","category":"section"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"In this example, we explore integration of the function:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":" f(xy) = fracx^3x^2+y^2-frac14","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"over the annulus defined by (rtheta) rho r 1 0 theta 2pi with parameter rho = frac23. We will calculate the integral:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":" int_0^2piint_frac23^1 f(rcosthetarsintheta)^2rrmdrrmdtheta","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"by analyzing the function in an annulus polynomial series. We analyze the function on an Ntimes M tensor product grid defined by:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"beginaligned\nr_n = sqrtcos^2left(n+tfrac12)pi2Nright + rho^2 sin^2left(n+tfrac12)pi2Nrightquadrm forquad 0le n Nquadrm and\ntheta_m = 2pi mMquadrm forquad 0le m M\nendaligned","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"we convert the function samples to Chebyshev×Fourier coefficients using plan_annulus_analysis; and finally, we transform the Chebyshev×Fourier coefficients to annulus polynomial coefficients using plan_ann2cxf.","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"For the storage pattern of the arrays, please consult the documentation.","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"using FastTransforms, LinearAlgebra, Plots\nconst GENFIGS = joinpath(pkgdir(FastTransforms), \"docs/src/generated\")\n!isdir(GENFIGS) && mkdir(GENFIGS)\nplotlyjs()","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"Plots.PlotlyJSBackend()","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"Our function f on the annulus:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"f = (x,y) -> x^3/(x^2+y^2-1/4)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"#1 (generic function with 1 method)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"The annulus polynomial degree:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"N = 8\nM = 4N-3","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"29","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"The annulus inner radius:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"ρ = 2/3","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"0.6666666666666666","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"The radial grid:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"r = [begin t = (N-n-0.5)/(2N); ct = sinpi(t); st = cospi(t); sqrt(ct^2+ρ^2*st^2) end for n in 0:N-1]","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"8-element Vector{Float64}:\n 0.9973277184004194\n 0.9763124517373388\n 0.9362410410518701\n 0.8811435628419545\n 0.8173313074308551\n 0.7535895152498838\n 0.7008983100472356\n 0.6706577864713554","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"The angular grid (mod pi):","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"θ = (0:M-1)*2/M","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"0.0:0.06896551724137931:1.9310344827586206","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"On the mapped tensor product grid, our function samples are:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"F = [f(r*cospi(θ), r*sinpi(θ)) for r in r, θ in θ]","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"8×29 Matrix{Float64}:\n 1.33215 1.24089 0.995869 0.672118 0.361447 0.136908 0.0255072 0.000211389 -0.00564085 -0.0675532 -0.235438 -0.509748 -0.838068 -1.13371 -1.30886 -1.30886 -1.13371 -0.838068 -0.509748 -0.235438 -0.0675532 -0.00564085 0.000211389 0.0255072 0.136908 0.361447 0.672118 0.995869 1.24089\n 1.32342 1.23275 0.989337 0.66771 0.359076 0.13601 0.0253399 0.000210003 -0.00560385 -0.0671101 -0.233894 -0.506405 -0.832572 -1.12628 -1.30028 -1.30028 -1.12628 -0.832572 -0.506405 -0.233894 -0.0671101 -0.00560385 0.000210003 0.0253399 0.13601 0.359076 0.66771 0.989337 1.23275\n 1.30981 1.22008 0.979168 0.660847 0.355385 0.134612 0.0250795 0.000207844 -0.00554625 -0.0664203 -0.23149 -0.5012 -0.824014 -1.1147 -1.28691 -1.28691 -1.1147 -0.824014 -0.5012 -0.23149 -0.0664203 -0.00554625 0.000207844 0.0250795 0.134612 0.355385 0.660847 0.979168 1.22008\n 1.29961 1.21057 0.97154 0.655698 0.352617 0.133563 0.0248841 0.000206225 -0.00550305 -0.0659028 -0.229687 -0.497295 -0.817594 -1.10601 -1.27689 -1.27689 -1.10601 -0.817594 -0.497295 -0.229687 -0.0659028 -0.00550305 0.000206225 0.0248841 0.133563 0.352617 0.655698 0.97154 1.21057\n 1.30613 1.21665 0.976415 0.658989 0.354386 0.134233 0.025009 0.00020726 -0.00553066 -0.0662336 -0.230839 -0.499791 -0.821697 -1.11156 -1.28329 -1.28329 -1.11156 -0.821697 -0.499791 -0.230839 -0.0662336 -0.00553066 0.00020726 0.025009 0.134233 0.354386 0.658989 0.976415 1.21665\n 1.34623 1.25399 1.00639 0.679218 0.365265 0.138354 0.0257767 0.000213622 -0.00570044 -0.0682668 -0.237925 -0.515133 -0.846922 -1.14569 -1.32269 -1.32269 -1.14569 -0.846922 -0.515133 -0.237925 -0.0682668 -0.00570044 0.000213622 0.0257767 0.138354 0.365265 0.679218 1.00639 1.25399\n 1.42719 1.32941 1.06692 0.720069 0.387234 0.146675 0.027327 0.00022647 -0.00604329 -0.0723726 -0.252235 -0.546115 -0.897858 -1.21459 -1.40224 -1.40224 -1.21459 -0.897858 -0.546115 -0.252235 -0.0723726 -0.00604329 0.00022647 0.027327 0.146675 0.387234 0.720069 1.06692 1.32941\n 1.5099 1.40645 1.12874 0.761795 0.409673 0.155175 0.0289105 0.000239594 -0.00639348 -0.0765664 -0.266852 -0.577762 -0.949887 -1.28498 -1.4835 -1.4835 -1.28498 -0.949887 -0.577762 -0.266852 -0.0765664 -0.00639348 0.000239594 0.0289105 0.155175 0.409673 0.761795 1.12874 1.40645","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"X = [r*cospi(θ) for r in r, θ in θ]\nY = [r*sinpi(θ) for r in r, θ in θ]\nscatter3d(vec(X), vec(Y), vec(0F); markersize=0.75, markercolor=:red)\nsurface!(X, Y, F; legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"annulus.html\"))","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/annulus.html\"","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"We precompute an Annulus–Chebyshev×Fourier plan:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"α, β, γ = 0, 0, 0\nP = plan_ann2cxf(F, α, β, γ, ρ)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"FastTransforms Annulus--Chebyshev×Fourier plan for 8×29-element array of Float64","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"And an FFTW Chebyshev×Fourier analysis plan on the annulus:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"PA = plan_annulus_analysis(F, ρ)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"FastTransforms plan for FFTW Chebyshev×Fourier analysis on the annulus for 8×29-element array of Float64","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"Its annulus coefficients are:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"U = P\\(PA*F)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"8×29 Matrix{Float64}:\n -1.22671e-17 2.92896e-17 0.926725 2.04896e-17 -7.722e-18 6.1888e-17 0.29418 -1.81602e-17 4.69005e-18 1.20498e-17 6.76339e-18 1.11857e-17 -1.99742e-17 -6.13512e-19 -4.02194e-17 6.23458e-17 3.04077e-17 3.12444e-17 -1.0558e-17 3.83711e-17 8.17668e-17 -1.08653e-17 5.99963e-17 -1.56088e-17 -4.23425e-17 -8.2245e-18 4.68313e-17 -3.30615e-17 -4.80225e-17\n -5.57014e-18 -2.254e-18 -0.124037 -5.91733e-18 3.70137e-17 -1.89099e-17 -0.0976704 1.024e-18 -2.07932e-18 -9.77876e-18 1.98227e-17 -1.04302e-17 7.22713e-18 -5.50321e-18 4.99656e-17 -4.01755e-17 -1.81639e-17 -2.52689e-17 1.66849e-17 -2.67731e-17 -6.74982e-17 5.4336e-18 -6.11451e-17 1.0013e-17 2.95944e-17 7.96412e-18 -5.49385e-17 2.50418e-17 4.69813e-17\n -2.33965e-17 1.12715e-18 0.042116 9.94105e-19 -1.44328e-17 9.15449e-18 0.0336531 3.6262e-19 1.34875e-17 7.39131e-18 -7.1196e-18 6.73552e-18 6.8403e-18 1.31493e-18 -1.89046e-17 2.30498e-17 5.34226e-18 1.03454e-17 -1.40577e-17 1.67754e-17 1.98659e-17 -8.57e-18 3.84689e-17 -1.14124e-17 -4.16632e-17 -5.45601e-18 3.66387e-17 -2.14064e-17 -4.31795e-17\n 2.21067e-18 4.00391e-18 -0.0139459 3.14722e-18 -1.97145e-18 5.82968e-18 -0.011224 6.26797e-18 2.18831e-17 6.88701e-18 -7.02346e-18 7.40166e-18 -2.2024e-18 9.55486e-18 4.62749e-18 2.9721e-18 -6.75798e-18 3.40533e-18 1.03823e-17 2.2961e-19 -1.52373e-17 7.73146e-18 -1.96827e-17 5.91455e-18 1.30222e-17 3.25478e-18 -1.53646e-17 8.18752e-18 6.59625e-18\n -1.96208e-17 7.71573e-19 0.00458845 -2.03822e-18 1.86344e-17 3.19547e-18 0.00369818 -1.86152e-18 -3.29302e-18 8.11326e-19 -4.97022e-21 -1.77139e-18 1.47439e-18 -6.8012e-18 2.63512e-18 -4.24712e-18 5.7017e-18 -7.2048e-18 7.38785e-18 -4.72462e-18 1.59607e-17 -5.27319e-18 1.44348e-17 -1.67467e-18 -4.59916e-19 8.00009e-19 5.99498e-18 -3.34661e-18 -2.03062e-18\n 1.3498e-17 1.71852e-19 -0.00150441 7.97602e-19 -9.38596e-18 -3.21855e-18 -0.00121128 -4.47164e-19 -1.76175e-17 -4.83245e-18 6.52956e-18 -5.47568e-18 5.27089e-18 -2.9175e-18 5.23985e-18 -5.70705e-18 -3.147e-18 -3.85137e-19 -3.05417e-18 -5.31797e-19 -4.09175e-18 3.59849e-18 4.48894e-18 3.4972e-18 1.74387e-18 1.53405e-18 8.8938e-18 4.33464e-18 5.85819e-18\n 5.24011e-17 -4.20047e-18 0.000517281 -2.62968e-18 1.29799e-17 -9.06153e-18 0.000424358 -4.57265e-18 2.49476e-18 -6.80939e-18 -6.07451e-18 -2.399e-18 1.03771e-18 6.6648e-19 -1.96393e-17 1.69496e-20 -1.42128e-18 5.37575e-18 -1.16727e-17 3.57204e-19 -7.01129e-18 2.48838e-18 -1.17285e-17 4.39475e-19 5.83824e-18 -1.63971e-18 -3.91773e-19 1.39577e-18 1.02075e-17\n -8.95802e-18 6.39707e-19 -0.000162126 3.55753e-18 7.44168e-18 4.28763e-18 -5.40419e-5 5.16629e-18 8.97839e-18 5.4486e-18 3.6724e-18 4.64571e-18 -1.67417e-18 6.04678e-19 5.73104e-18 -2.13942e-18 -1.44968e-17 -3.57457e-18 1.24167e-17 -5.67995e-18 -1.09651e-17 -4.98049e-18 6.22788e-18 -2.89642e-18 -1.52622e-17 -2.30036e-18 1.82749e-18 -1.26575e-18 -9.91876e-18","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"The annulus coefficients are useful for integration. The integral of f(xy)^2 over the annulus is approximately the square of the 2-norm of the coefficients:","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"norm(U)^2, 5π/8*(1675/4536+9*log(3)/32-3*log(7)/32)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"(0.9735516844404257, 0.973547572736036)","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"","category":"page"},{"location":"generated/annulus/#","page":"Integration on an annulus","title":"Integration on an annulus","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/subspaceangles.jl\"","category":"page"},{"location":"generated/subspaceangles/#Subspace-angles-1","page":"Subspace angles","title":"Subspace angles","text":"","category":"section"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"This example considers the angles between neighbouring Laguerre polynomials with a perturbed measure:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"costheta_n = fraclangle L_n L_n+krangleL_n_2 L_n+k_2quadrm forquad 0le n N-k","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"where the inner product is defined by langle f grangle = int_0^infty f(x) g(x) x^beta e^-xrmdx.","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"We do so by connecting Laguerre polynomials to the normalized generalized Laguerre polynomials associated with the perturbed measure. It follows by the inner product of the connection coefficients that:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"costheta_n = frac(V^top V)_n n+ksqrt(V^top V)_n n(V^top V)_n+k n+k","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"using FastTransforms, LinearAlgebra","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"The neighbouring index k and the maximum degree N-1:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"k, N = 1, 11","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"(1, 11)","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"The Laguerre connection parameters:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"α, β = 0.0, 0.125","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"(0.0, 0.125)","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"We precompute a Laguerre–Laguerre plan:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"P = plan_lag2lag(Float64, N, α, β; norm2=true)","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"FastTransforms Laguerre--Laguerre plan for 11-element array of Float64","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"We apply the plan to the identity, followed by the adjoint plan:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"VtV = parent(P*I)\nlmul!(P', VtV)","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"11×11 Matrix{Float64}:\n 0.941743 -0.117718 -0.0515016 -0.0321885 -0.0231355 -0.01793 -0.0145681 -0.0122268 -0.0105074 -0.00919399 -0.00815966\n -0.117718 1.07418 -0.125995 -0.0539157 -0.0333201 -0.0237861 -0.0183502 -0.0148608 -0.0124417 -0.0106716 -0.00932328\n -0.0515016 -0.125995 1.14505 -0.131707 -0.0557687 -0.0342413 -0.024336 -0.0187146 -0.0151194 -0.0126345 -0.0108205\n -0.0321885 -0.0539157 -0.131707 1.19444 -0.136106 -0.0572798 -0.0350206 -0.0248132 -0.0190369 -0.0153515 -0.0128093\n -0.0231355 -0.0333201 -0.0557687 -0.136106 1.23272 -0.139703 -0.0585599 -0.0356975 -0.0252354 -0.0193261 -0.015562\n -0.01793 -0.0237861 -0.0342413 -0.0572798 -0.139703 1.26415 -0.142756 -0.059673 -0.0362968 -0.0256145 -0.0195886\n -0.0145681 -0.0183502 -0.024336 -0.0350206 -0.0585599 -0.142756 1.29092 -0.145414 -0.0606594 -0.0368352 -0.0259588\n -0.0122268 -0.0148608 -0.0187146 -0.0248132 -0.0356975 -0.059673 -0.145414 1.31429 -0.147773 -0.0615464 -0.0373246\n -0.0105074 -0.0124417 -0.0151194 -0.0190369 -0.0252354 -0.0362968 -0.0606594 -0.147773 1.33507 -0.149896 -0.062353\n -0.00919399 -0.0106716 -0.0126345 -0.0153515 -0.0193261 -0.0256145 -0.0368352 -0.0615464 -0.149896 1.3538 -0.151829\n -0.00815966 -0.00932328 -0.0108205 -0.0128093 -0.015562 -0.0195886 -0.0259588 -0.0373246 -0.062353 -0.151829 1.37089","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"From this matrix, the angles are recovered from:","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"θ = [acos(VtV[n, n+k]/sqrt(VtV[n, n]*VtV[n+k, n+k])) for n in 1:N-k]","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"10-element Vector{Float64}:\n 1.6881063520094897\n 1.6846487354051982\n 1.6836556387180577\n 1.6831998143073255\n 1.6829427202726823\n 1.68277949501306\n 1.682667534322365\n 1.6825864250312665\n 1.6825252245704025\n 1.682477567030148","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"","category":"page"},{"location":"generated/subspaceangles/#","page":"Subspace angles","title":"Subspace angles","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/chebyshev.jl\"","category":"page"},{"location":"generated/chebyshev/#Chebyshev-transform-1","page":"Chebyshev transform","title":"Chebyshev transform","text":"","category":"section"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"This demonstrates the Chebyshev transform and inverse transform, explaining precisely the normalization and points","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"using FastTransforms\nn = 20","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"20","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"First kind points to first kind polynomials","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"p_1 = chebyshevpoints(Float64, n, Val(1))\nf = exp.(p_1)\nf̌ = chebyshevtransform(f, Val(1))\nf̃ = x -> [cos(k*acos(x)) for k=0:n-1]' * f̌\nf̃(0.1) ≈ exp(0.1)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"First kind polynomials to first kind points","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"ichebyshevtransform(f̌, Val(1)) ≈ exp.(p_1)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"Second kind points to first kind polynomials","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"p_2 = chebyshevpoints(Float64, n, Val(2))\nf = exp.(p_2)\nf̌ = chebyshevtransform(f, Val(2))\nf̃ = x -> [cos(k*acos(x)) for k=0:n-1]' * f̌\nf̃(0.1) ≈ exp(0.1)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"First kind polynomials to second kind points","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"ichebyshevtransform(f̌, Val(2)) ≈ exp.(p_2)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"First kind points to second kind polynomials","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"p_1 = chebyshevpoints(Float64, n, Val(1))\nf = exp.(p_1)\nf̌ = chebyshevutransform(f, Val(1))\nf̃ = x -> [sin((k+1)*acos(x))/sin(acos(x)) for k=0:n-1]' * f̌\nf̃(0.1) ≈ exp(0.1)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"Second kind polynomials to first kind points","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"ichebyshevutransform(f̌, Val(1)) ≈ exp.(p_1)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"Second kind points to second kind polynomials","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"p_2 = chebyshevpoints(Float64, n, Val(2))[2:n-1]\nf = exp.(p_2)\nf̌ = chebyshevutransform(f, Val(2))\nf̃ = x -> [sin((k+1)*acos(x))/sin(acos(x)) for k=0:n-3]' * f̌\nf̃(0.1) ≈ exp(0.1)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"Second kind polynomials to second kind points","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"ichebyshevutransform(f̌, Val(2)) ≈ exp.(p_2)","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"true","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"","category":"page"},{"location":"generated/chebyshev/#","page":"Chebyshev transform","title":"Chebyshev transform","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/triangle.jl\"","category":"page"},{"location":"generated/triangle/#Calculus-on-the-reference-triangle-1","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"","category":"section"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"In this example, we sample a bivariate function:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"f(xy) = frac11+x^2+y^2","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"on the reference triangle with vertices (00), (01), and (10) and analyze it in a Proriol series. Then, we find Proriol series for each component of its gradient by term-by-term differentiation of our expansion, and we compare them with the true Proriol series by sampling an exact expression for the gradient.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"We analyze f(xy) on an Ntimes M mapped tensor product grid defined by:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"beginaligned\nx = (1+u)2quadrm andquad y = (1-u)(1+v)4quad rm where\nu_n = cosleft(n+tfrac12)piNrightquadrm forquad 0le n Nquadrm and\nv_m = cosleft(m+tfrac12)piMrightquadrm forquad 0le m M\nendaligned","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"we convert the function samples to mapped Chebyshev² coefficients using plan_tri_analysis; and finally, we transform the mapped Chebyshev² coefficients to Proriol coefficients using plan_tri2cheb.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"For the storage pattern of the arrays, please consult the documentation.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"using FastTransforms, LinearAlgebra, Plots\nconst GENFIGS = joinpath(pkgdir(FastTransforms), \"docs/src/generated\")\n!isdir(GENFIGS) && mkdir(GENFIGS)\nplotlyjs()","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Plots.PlotlyJSBackend()","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Our function f and the Cartesian components of its gradient:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"f = (x,y) -> 1/(1+x^2+y^2)\nfx = (x,y) -> -2x/(1+x^2+y^2)^2\nfy = (x,y) -> -2y/(1+x^2+y^2)^2","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"#5 (generic function with 1 method)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"The polynomial degree:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"N = 15\nM = N","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"The parameters of the Proriol series:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"α, β, γ = 0, 0, 0","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"(0, 0, 0)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"The u grid:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"u = [sinpi((N-2n-1)/(2N)) for n in 0:N-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15-element Vector{Float64}:\n 0.9945218953682733\n 0.9510565162951536\n 0.8660254037844386\n 0.7431448254773942\n 0.5877852522924731\n 0.4067366430758002\n 0.20791169081775934\n 0.0\n -0.20791169081775934\n -0.4067366430758002\n -0.5877852522924731\n -0.7431448254773942\n -0.8660254037844386\n -0.9510565162951536\n -0.9945218953682733","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"And the v grid:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"v = [sinpi((M-2m-1)/(2M)) for m in 0:M-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15-element Vector{Float64}:\n 0.9945218953682733\n 0.9510565162951536\n 0.8660254037844386\n 0.7431448254773942\n 0.5877852522924731\n 0.4067366430758002\n 0.20791169081775934\n 0.0\n -0.20791169081775934\n -0.4067366430758002\n -0.5877852522924731\n -0.7431448254773942\n -0.8660254037844386\n -0.9510565162951536\n -0.9945218953682733","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Instead of using the utimes v grid, we use one with more accuracy near the origin. Defining x by:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"x = [sinpi((2N-2n-1)/(4N))^2 for n in 0:N-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15-element Vector{Float64}:\n 0.9972609476841365\n 0.9755282581475768\n 0.9330127018922194\n 0.8715724127386971\n 0.7938926261462365\n 0.7033683215379002\n 0.6039558454088797\n 0.4999999999999999\n 0.3960441545911204\n 0.2966316784620999\n 0.2061073738537634\n 0.12842758726130288\n 0.06698729810778066\n 0.024471741852423214\n 0.0027390523158633317","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"And w by:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"w = [sinpi((2M-2m-1)/(4M))^2 for m in 0:M-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15-element Vector{Float64}:\n 0.9972609476841365\n 0.9755282581475768\n 0.9330127018922194\n 0.8715724127386971\n 0.7938926261462365\n 0.7033683215379002\n 0.6039558454088797\n 0.4999999999999999\n 0.3960441545911204\n 0.2966316784620999\n 0.2061073738537634\n 0.12842758726130288\n 0.06698729810778066\n 0.024471741852423214\n 0.0027390523158633317","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"We see how the two grids are related:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"((1 .+ u)./2 ≈ x) * ((1 .- u).*(1 .+ v')/4 ≈ reverse(x).*w')","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"true","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"On the mapped tensor product grid, our function samples are:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"F = [f(x[n+1], x[N-n]*w[m+1]) for n in 0:N-1, m in 0:M-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15×15 Matrix{Float64}:\n 0.50137 0.50137 0.50137 0.50137 0.50137 0.50137 0.501371 0.501371 0.501371 0.501371 0.501371 0.501371 0.501371 0.501371 0.501371\n 0.512229 0.512236 0.512249 0.512266 0.512286 0.512308 0.512328 0.512346 0.512361 0.512372 0.512379 0.512383 0.512385 0.512385 0.512386\n 0.53334 0.533395 0.533499 0.53364 0.533806 0.533979 0.534145 0.534292 0.534412 0.5345 0.534558 0.534592 0.534607 0.534612 0.534613\n 0.56305 0.563274 0.563699 0.564281 0.564961 0.565675 0.566362 0.56697 0.567464 0.56783 0.568072 0.568211 0.568275 0.568295 0.568299\n 0.597903 0.598554 0.599792 0.601491 0.603486 0.60559 0.607622 0.609427 0.6109 0.611994 0.612719 0.613134 0.613325 0.613387 0.613397\n 0.632017 0.633527 0.636406 0.640382 0.645085 0.650086 0.654955 0.659315 0.662898 0.665571 0.66735 0.66837 0.668842 0.668995 0.669018\n 0.657568 0.660489 0.666088 0.673894 0.683237 0.693308 0.703247 0.712263 0.719753 0.725392 0.729168 0.731342 0.73235 0.732678 0.732728\n 0.667275 0.672082 0.681371 0.694488 0.710446 0.727971 0.745606 0.761905 0.775667 0.786165 0.79326 0.79737 0.799283 0.799904 0.799999\n 0.65806 0.664903 0.678251 0.69738 0.721111 0.74777 0.775252 0.801255 0.82368 0.841081 0.85299 0.859943 0.863194 0.864252 0.864414\n 0.632907 0.641519 0.658477 0.683152 0.714388 0.750331 0.788365 0.825306 0.857936 0.883766 0.901708 0.912284 0.917254 0.918876 0.919123\n 0.599054 0.608911 0.628482 0.657352 0.694582 0.738395 0.78593 0.833301 0.876165 0.910799 0.935231 0.94978 0.956655 0.958904 0.959246\n 0.564342 0.574908 0.59603 0.627532 0.668777 0.718232 0.773048 0.82891 0.880558 0.923076 0.953504 0.971796 0.980486 0.983334 0.983768\n 0.534691 0.545579 0.567447 0.600326 0.643856 0.69679 0.756419 0.818253 0.876403 0.924997 0.960184 0.981503 0.991676 0.995016 0.995526\n 0.513598 0.524591 0.546739 0.58021 0.624846 0.679621 0.74199 0.80742 0.869666 0.922224 0.960591 0.983966 0.995154 0.998833 0.999394\n 0.502741 0.513754 0.535975 0.569641 0.614694 0.670229 0.733797 0.800871 0.865052 0.919526 0.959458 0.983854 0.99555 0.999397 0.999985","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"X = [x for x in x, w in w]\nY = [x[N-n]*w[m+1] for n in 0:N-1, m in 0:M-1]\nscatter3d(vec(X), vec(Y), vec(0F); markersize=0.75, markercolor=:blue)\nsurface!(X, Y, F; legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"proriol.html\"))","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/proriol.html\"","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"We precompute a Proriol–Chebyshev² plan:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"P = plan_tri2cheb(F, α, β, γ)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"FastTransforms Proriol--Chebyshev² plan for 15×15-element array of Float64","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"And an FFTW Chebyshev² plan on the triangle:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"PA = plan_tri_analysis(F)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"FastTransforms plan for FFTW Chebyshev analysis on the triangle for 15×15-element array of Float64","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Its Proriol-(αβγ) coefficients are:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"U = P\\(PA*F)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15×15 Matrix{Float64}:\n 1.53694 -0.193325 -0.0251445 0.0109626 -0.000813095 -0.000299751 8.30397e-5 -1.59722e-6 -3.2141e-6 6.1667e-7 3.19775e-8 -3.21495e-8 4.17144e-9 6.97174e-10 -3.06613e-10\n -0.111616 0.0391775 -0.00636098 -0.000168172 0.000311296 -5.50434e-5 -2.99195e-6 2.97964e-6 -4.20688e-7 -5.4534e-8 2.85785e-8 -2.74994e-9 -7.77992e-10 2.56775e-10 -1.20763e-11\n -0.0620411 0.00717668 0.00153132 -0.000551474 4.1134e-5 1.40597e-5 -4.21186e-6 2.00844e-7 1.36869e-7 -3.34625e-8 3.38022e-10 1.36685e-9 -2.6459e-10 -1.30929e-11 1.45495e-11\n 0.0111316 -0.0036578 0.00043735 4.52913e-5 -2.72385e-5 3.78477e-6 3.57508e-7 -2.26663e-7 2.88459e-8 4.02905e-9 -1.98431e-9 2.01016e-10 4.97746e-11 -1.48758e-11 -2.03146e-12\n 0.00194132 -7.70184e-5 -0.000145948 3.68556e-5 -1.34273e-6 -1.26813e-6 3.06047e-7 -7.57685e-9 -1.11605e-8 2.45432e-9 -1.63544e-12 -1.03205e-10 9.8773e-12 5.45517e-12 -6.15774e-13\n -0.000642637 0.000243768 -2.28339e-5 -5.91216e-6 2.28045e-6 -2.36988e-7 -4.55496e-8 1.90448e-8 -1.91046e-9 -4.16463e-10 1.54281e-10 1.00975e-11 -8.91873e-12 -7.74998e-13 5.33203e-13\n -4.38389e-5 -1.71425e-5 1.23092e-5 -2.29813e-6 -6.48598e-8 1.17977e-7 -2.21226e-8 -4.58497e-10 1.02068e-9 -1.63471e-10 -4.64131e-11 6.91422e-12 3.5224e-12 -3.14298e-13 -2.28438e-13\n 2.79805e-5 -1.30453e-5 7.26152e-7 5.87656e-7 -1.71884e-7 1.12463e-8 5.13657e-9 -1.54461e-9 7.05239e-11 8.70592e-11 6.67156e-12 -5.87108e-12 -8.8146e-13 3.5065e-13 6.60112e-14\n 1.15026e-6 1.8828e-6 -8.87898e-7 1.24893e-7 1.74103e-8 -1.00961e-8 1.44036e-9 1.53829e-10 -9.59941e-11 -3.49153e-11 3.35895e-12 3.178e-12 -1.72628e-14 -2.20905e-13 -4.41417e-15\n -1.05261e-6 6.07061e-7 9.40225e-9 -4.93564e-8 1.14023e-8 -2.56371e-10 -4.79206e-10 1.50921e-11 6.48843e-11 1.18558e-11 -4.29767e-12 -1.50757e-12 2.19175e-13 1.20461e-13 -1.21213e-14\n -1.0706e-7 -1.2895e-7 5.63778e-8 -5.46716e-9 -1.98245e-9 6.62772e-10 1.96009e-10 -4.05866e-11 -3.72009e-11 -3.44512e-12 3.09917e-12 6.84678e-13 -1.9369e-13 -6.2004e-14 1.20543e-14\n 4.44232e-8 -2.74042e-8 -3.41194e-9 3.7536e-9 -3.47875e-10 -3.34332e-10 -7.92618e-11 2.84843e-11 1.87606e-11 8.64628e-13 -1.73542e-12 -2.9854e-13 1.16624e-13 2.95553e-14 -7.5397e-15\n 1.13247e-8 6.98157e-9 -3.2324e-9 -1.06114e-10 1.55319e-10 1.35282e-10 2.8768e-11 -1.28905e-11 -7.59282e-12 -1.99176e-13 7.32664e-13 1.12739e-13 -5.05664e-14 -1.1679e-14 3.30654e-15\n -2.57523e-9 1.14806e-9 1.12793e-10 2.51422e-11 -4.12541e-11 -3.49672e-11 -7.18293e-12 3.43673e-12 1.96276e-12 3.98594e-14 -1.91744e-13 -2.85196e-14 1.33316e-14 2.99912e-15 -8.74775e-16\n -7.03699e-10 -8.33285e-12 -8.53391e-12 -1.88826e-12 3.13558e-12 2.65053e-12 5.42528e-13 -2.61311e-13 -1.4878e-13 -2.93192e-15 1.45531e-14 2.15661e-15 -1.01287e-15 -2.27009e-16 6.63378e-17","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Similarly, our function's gradient samples are:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Fx = [fx(x[n+1], x[N-n]*w[m+1]) for n in 0:N-1, m in 0:M-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15×15 Matrix{Float64}:\n -0.501366 -0.501366 -0.501366 -0.501367 -0.501367 -0.501368 -0.501368 -0.501369 -0.501369 -0.501369 -0.501369 -0.501369 -0.501369 -0.50137 -0.50137\n -0.511916 -0.511929 -0.511955 -0.51199 -0.51203 -0.512073 -0.512114 -0.51215 -0.512179 -0.512201 -0.512215 -0.512223 -0.512227 -0.512228 -0.512228\n -0.530794 -0.530903 -0.53111 -0.531392 -0.531721 -0.532067 -0.532398 -0.532691 -0.532929 -0.533105 -0.533222 -0.533288 -0.533319 -0.533329 -0.53333\n -0.552621 -0.553061 -0.553896 -0.555039 -0.556378 -0.557787 -0.559142 -0.560343 -0.56132 -0.562044 -0.562524 -0.562798 -0.562924 -0.562965 -0.562972\n -0.567613 -0.568852 -0.571206 -0.574447 -0.578264 -0.582304 -0.586217 -0.589705 -0.59256 -0.594683 -0.596093 -0.5969 -0.597274 -0.597395 -0.597413\n -0.561915 -0.564604 -0.569746 -0.576887 -0.585391 -0.594503 -0.603442 -0.611504 -0.618167 -0.623163 -0.626498 -0.628414 -0.629303 -0.629591 -0.629635\n -0.522296 -0.526946 -0.535918 -0.548553 -0.563869 -0.580614 -0.59738 -0.612796 -0.625752 -0.635596 -0.64223 -0.646065 -0.647848 -0.648427 -0.648515\n -0.445256 -0.451694 -0.464267 -0.482314 -0.504734 -0.529941 -0.555929 -0.580499 -0.60166 -0.618055 -0.629262 -0.635798 -0.638853 -0.639847 -0.639998\n -0.343008 -0.350179 -0.364379 -0.385223 -0.411887 -0.442905 -0.476058 -0.508529 -0.537391 -0.560337 -0.576318 -0.585751 -0.590188 -0.591636 -0.591857\n -0.237644 -0.244156 -0.257234 -0.276874 -0.302772 -0.334005 -0.368724 -0.404089 -0.436673 -0.463364 -0.482369 -0.49375 -0.499145 -0.500911 -0.501181\n -0.14793 -0.152838 -0.162821 -0.178123 -0.198871 -0.22475 -0.254619 -0.286238 -0.316443 -0.341954 -0.360547 -0.371851 -0.377255 -0.37903 -0.379301\n -0.0818036 -0.0848957 -0.0912482 -0.101149 -0.114882 -0.132501 -0.153497 -0.176483 -0.199161 -0.218858 -0.233525 -0.242571 -0.246928 -0.248365 -0.248585\n -0.0383026 -0.0398784 -0.0431393 -0.0482832 -0.0555393 -0.0650468 -0.0766563 -0.0897011 -0.102903 -0.114631 -0.123518 -0.129064 -0.131754 -0.132643 -0.132779\n -0.0129105 -0.013469 -0.0146303 -0.0164765 -0.0191091 -0.0226062 -0.0269458 -0.0319076 -0.0370169 -0.0416263 -0.0451619 -0.0473866 -0.0484703 -0.0488293 -0.0488842\n -0.00138458 -0.00144591 -0.00157369 -0.0017776 -0.0020699 -0.0024608 -0.00294973 -0.00351363 -0.00409934 -0.00463189 -0.00504292 -0.00530263 -0.00542945 -0.0054715 -0.00547794","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"and:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Fy = [fy(x[n+1], x[N-n]*w[m+1]) for n in 0:N-1, m in 0:M-1]","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15×15 Matrix{Float64}:\n -0.00137327 -0.00134334 -0.0012848 -0.00120019 -0.00109322 -0.000968569 -0.000831675 -0.000688523 -0.000545372 -0.000408476 -0.00028382 -0.000176851 -9.22448e-5 -3.36988e-5 -3.77181e-6\n -0.0128066 -0.0125278 -0.0119824 -0.0111941 -0.0101972 -0.00903524 -0.00775884 -0.0064238 -0.00508851 -0.00381138 -0.00264832 -0.00165022 -0.000860756 -0.000314451 -3.51956e-5\n -0.0380049 -0.0371844 -0.0355776 -0.0332524 -0.0303075 -0.0268691 -0.0230859 -0.0191228 -0.0151537 -0.0113536 -0.00789053 -0.00491728 -0.00256498 -0.000937054 -0.000104882\n -0.0812065 -0.0795001 -0.0761501 -0.0712824 -0.0650859 -0.0578104 -0.0497602 -0.0412837 -0.0327574 -0.0245665 -0.017084 -0.0106504 -0.00555645 -0.00203003 -0.000227217\n -0.146958 -0.144069 -0.138361 -0.129983 -0.119184 -0.106332 -0.0919169 -0.0765485 -0.0609267 -0.0457968 -0.0318962 -0.0199018 -0.0103872 -0.00379541 -0.000424822\n -0.236327 -0.232283 -0.224184 -0.212046 -0.195994 -0.176349 -0.153701 -0.128945 -0.103249 -0.0779568 -0.0544563 -0.0340361 -0.0177782 -0.00649768 -0.000727317\n -0.341557 -0.337089 -0.327887 -0.313516 -0.293548 -0.267799 -0.236589 -0.200921 -0.162512 -0.123634 -0.0868006 -0.0544092 -0.028458 -0.0104055 -0.00116482\n -0.444036 -0.44064 -0.433167 -0.420371 -0.400704 -0.372744 -0.335756 -0.290249 -0.238284 -0.183335 -0.129696 -0.0816541 -0.042795 -0.0156582 -0.00175299\n -0.521645 -0.520944 -0.518445 -0.512009 -0.498657 -0.475067 -0.438456 -0.387746 -0.32456 -0.253471 -0.181141 -0.114718 -0.0602899 -0.0220791 -0.00247217\n -0.561955 -0.56477 -0.56909 -0.572203 -0.569958 -0.557059 -0.528047 -0.479085 -0.410077 -0.325915 -0.235743 -0.15036 -0.0792838 -0.0290664 -0.00325507\n -0.568241 -0.574301 -0.585148 -0.597987 -0.608136 -0.608908 -0.592332 -0.551271 -0.482733 -0.39071 -0.286235 -0.183948 -0.0973409 -0.0357278 -0.00400177\n -0.553639 -0.562044 -0.577773 -0.598286 -0.618953 -0.632479 -0.629146 -0.598851 -0.535295 -0.440581 -0.326642 -0.211418 -0.112256 -0.0412478 -0.00462083\n -0.532026 -0.541842 -0.560603 -0.586131 -0.614126 -0.637241 -0.644834 -0.624688 -0.567634 -0.473605 -0.354585 -0.230866 -0.122928 -0.0452109 -0.00506551\n -0.513246 -0.523783 -0.544148 -0.572459 -0.604752 -0.633849 -0.648741 -0.635973 -0.584411 -0.492221 -0.371057 -0.242599 -0.129432 -0.0476343 -0.00533757\n -0.502731 -0.513558 -0.534584 -0.564086 -0.5983 -0.630184 -0.648628 -0.639638 -0.591107 -0.500247 -0.378429 -0.247947 -0.132421 -0.0487506 -0.00546294","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"For the partial derivative with respect to x, Olver et al. derive simple expressions for the representation of this component using a Proriol-(α+1βγ+1) series.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Gx = zeros(Float64, N, M)\nfor m = 0:M-2\n for n = 0:N-2\n cf1 = m == 0 ? sqrt((n+1)*(n+2m+α+β+γ+3)/(2m+β+γ+2)*(m+γ+1)*8) : sqrt((n+1)*(n+2m+α+β+γ+3)/(2m+β+γ+1)*(m+β+γ+1)/(2m+β+γ+2)*(m+γ+1)*8)\n cf2 = sqrt((n+α+1)*(m+1)/(2m+β+γ+2)*(m+β+1)/(2m+β+γ+3)*(n+2m+β+γ+3)*8)\n Gx[n+1, m+1] = cf1*U[n+2, m+1] + cf2*U[n+1, m+2]\n end\nend\nPx = plan_tri2cheb(Fx, α+1, β, γ+1)\nUx = Px\\(PA*Fx)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15×15 Matrix{Float64}:\n -0.773299 0.0719368 0.0119032 -0.00401514 0.00019856 0.000113662 -2.54579e-5 -2.37734e-7 1.03154e-6 -1.60364e-7 -1.48715e-8 9.00448e-9 -8.97984e-10 -2.25712e-10 7.08345e-11\n -0.223004 0.012725 0.00860848 -0.00187243 -6.32049e-5 8.83801e-5 -1.1938e-5 -1.70295e-6 7.84936e-7 -6.04351e-8 -2.29491e-8 6.45891e-9 -1.23274e-10 -2.55873e-10 5.02863e-11\n 0.11832 -0.0184961 -0.000231272 0.000708416 -0.000135183 -8.87531e-7 5.70658e-6 -1.08175e-6 -3.24208e-8 5.24395e-8 -8.50439e-9 -6.81366e-10 4.94759e-10 -5.56212e-11 -1.16264e-11\n -0.00167066 0.00241796 -0.00105495 0.000134423 2.32113e-5 -1.10992e-5 1.1835e-6 2.55024e-7 -1.00326e-7 8.05316e-9 2.80938e-9 -8.7387e-10 3.23657e-11 3.71003e-11 -4.71068e-12\n -0.00812992 0.00143193 9.5529e-5 -8.6497e-5 1.46322e-5 6.06568e-7 -7.52503e-7 1.2809e-7 6.41825e-9 -6.76798e-9 1.05309e-9 1.02809e-10 -6.38887e-11 -4.60392e-12 3.43243e-12\n 0.00134269 -0.000440563 9.61255e-5 -3.9763e-6 -4.07863e-6 1.16773e-6 -7.04875e-8 -3.76919e-8 1.09538e-8 -5.76688e-10 -3.72602e-10 6.21711e-11 2.34835e-11 -3.2882e-12 -1.02884e-12\n 0.000287063 -5.03055e-5 -1.79725e-5 8.218e-6 -1.05921e-6 -1.54886e-7 8.35392e-8 -1.11246e-8 -1.37121e-9 7.34787e-10 2.35493e-11 -4.77271e-11 -3.34076e-12 2.78949e-12 2.71211e-14\n -0.000114154 3.91247e-5 -6.41411e-6 -4.57437e-7 4.91696e-7 -1.01409e-7 1.49415e-12 4.73486e-9 -8.87703e-10 -2.29361e-10 4.39281e-11 2.01683e-11 -2.11614e-12 -1.32214e-12 2.00992e-13\n 6.85033e-7 -1.42592e-6 2.06904e-6 -6.34246e-7 4.7282e-8 2.34694e-8 -7.6778e-9 5.5085e-10 4.78984e-10 2.64819e-11 -3.78611e-11 -5.1067e-12 2.54966e-12 4.06715e-13 -1.864e-13\n 5.33318e-6 -2.34997e-6 2.9001e-7 9.45302e-8 -4.55097e-8 7.14241e-9 5.63984e-10 -6.44351e-10 -2.12017e-10 3.18388e-11 2.34425e-11 -6.60806e-13 -1.88678e-12 -1.3375e-14 1.29399e-13\n -7.178e-7 3.37971e-7 -1.76689e-7 3.81304e-8 -1.11295e-9 -2.48346e-9 1.24297e-10 4.4888e-10 8.62743e-11 -3.44107e-11 -1.28198e-11 1.79781e-12 1.16066e-12 -8.54664e-14 -7.76696e-14\n -1.15794e-7 9.93748e-8 -5.08059e-9 -9.45944e-9 2.65499e-9 1.0741e-9 -1.63514e-10 -2.32795e-10 -3.2556e-11 2.03989e-11 5.96492e-12 -1.21808e-12 -5.75474e-13 6.48293e-14 3.81294e-14\n 3.9894e-8 -2.50603e-8 1.18665e-8 -3.69658e-10 -9.43959e-10 -3.54061e-10 7.05516e-11 8.25944e-11 9.98239e-12 -7.57296e-12 -2.02892e-12 4.70119e-13 2.00988e-13 -2.57424e-14 -1.32678e-14\n -2.62946e-9 -2.09989e-9 -2.15583e-10 7.49659e-11 1.79606e-10 6.58835e-11 -1.40885e-11 -1.57067e-11 -1.81381e-12 1.45833e-12 3.81132e-13 -9.14684e-14 -3.80521e-14 5.0455e-15 2.50858e-15\n -2.54665e-10 1.01738e-11 9.71511e-12 -3.41148e-12 -8.12007e-12 -2.97149e-12 6.40143e-13 7.10069e-13 8.15917e-14 -6.60158e-14 -1.72077e-14 4.14496e-15 1.71962e-15 -2.2876e-16 -1.13402e-16","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"For the partial derivative with respect to y, the analogous formulae result in a Proriol-(αβ+1γ+1) series.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"Gy = zeros(Float64, N, M)\nfor m = 0:M-2\n for n = 0:N-2\n Gy[n+1, m+1] = 4*sqrt((m+1)*(m+β+γ+2))*U[n+1, m+2]\n end\nend\nPy = plan_tri2cheb(Fy, α, β+1, γ+1)\nUy = Py\\(PA*Fy)","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"15×15 Matrix{Float64}:\n -1.09361 -0.246364 0.151902 -0.0145451 -0.00656722 0.00215264 -4.78099e-5 -0.00010909 2.3401e-5 1.34141e-6 -1.47744e-6 2.0787e-7 3.67354e-8 -1.65807e-8 1.30376e-9\n 0.221621 -0.0623246 -0.00233026 0.00556863 -0.00120594 -7.75602e-5 8.91904e-5 -1.42786e-5 -2.06939e-6 1.19894e-6 -1.26335e-7 -3.89258e-8 1.42118e-8 -5.60413e-10 -5.94789e-10\n 0.0405975 0.0150038 -0.00764145 0.000735827 0.000308032 -0.000109184 6.01193e-6 4.6455e-6 -1.26982e-6 1.41852e-8 6.28061e-8 -1.31763e-8 -5.9232e-10 7.38193e-10 -7.35368e-11\n -0.0206916 0.00428514 0.000627575 -0.000487257 8.29203e-5 9.26771e-6 -6.78478e-6 9.79044e-7 1.52891e-7 -8.32462e-8 9.23683e-9 2.37699e-9 -9.33549e-10 -2.54744e-11 5.13027e-11\n -0.000435682 -0.00142999 0.000510686 -2.40196e-5 -2.77834e-5 7.93359e-6 -2.26768e-7 -3.78776e-7 9.31367e-8 -7.2912e-11 -4.72764e-9 9.19194e-10 1.83342e-10 -5.07975e-11 -9.73934e-12\n 0.00137896 -0.000223726 -8.19213e-5 4.07942e-5 -5.19191e-6 -1.18071e-6 5.70025e-7 -6.48815e-8 -1.5805e-8 6.74933e-9 -5.22325e-10 -3.74577e-10 2.04346e-11 2.31629e-11 -1.45177e-12\n -9.69728e-5 0.000120605 -3.18437e-5 -1.1605e-6 2.58441e-6 -5.73589e-7 -1.36421e-8 3.47148e-8 -6.95597e-9 -3.86259e-10 4.86604e-10 7.26716e-11 -3.26991e-11 -5.56081e-12 2.18954e-12\n -7.37954e-5 7.11448e-6 8.14267e-6 -3.07439e-6 2.46945e-7 1.33361e-7 -4.63869e-8 3.49405e-9 1.69907e-9 -3.52262e-10 -2.0628e-10 1.07045e-11 1.73416e-11 -1.8863e-13 -1.24582e-12\n 1.06509e-5 -8.69913e-6 1.73077e-6 3.10766e-7 -2.22347e-7 3.70118e-8 3.9365e-9 -2.94133e-9 -2.1645e-10 2.94085e-10 6.42746e-11 -2.03559e-11 -6.99253e-12 1.20561e-12 5.53977e-13\n 3.43376e-6 9.14735e-8 -6.84306e-7 2.05405e-7 -4.3435e-9 -1.35246e-8 2.85641e-9 1.15843e-9 -9.56842e-11 -1.59766e-10 -1.45705e-11 1.36984e-11 2.42348e-12 -9.13606e-13 -2.1722e-13\n -7.29088e-7 5.54006e-7 -7.49665e-8 -3.61409e-8 1.78364e-8 -4.16571e-10 -1.36673e-9 -4.10814e-10 8.7904e-11 6.99201e-11 1.76879e-12 -6.65703e-12 -7.49913e-13 4.67293e-13 7.67801e-14\n -1.56131e-7 -3.60972e-8 5.21717e-8 -9.4804e-9 -1.42828e-9 2.71687e-10 4.84151e-10 1.24081e-10 -3.76632e-11 -2.38535e-11 1.8587e-13 2.38967e-12 2.02458e-13 -1.7174e-13 -2.30964e-14\n 4.09267e-8 -3.39594e-8 -3.06743e-9 7.64151e-10 3.1345e-10 -7.59843e-11 -1.14715e-10 -2.73663e-11 9.55255e-12 5.56757e-12 -1.22703e-13 -5.69904e-13 -4.18788e-14 4.1357e-14 5.08049e-15\n 8.57039e-9 6.52951e-9 -7.39973e-11 -9.29778e-11 -3.74097e-11 9.74901e-12 1.40429e-11 3.27131e-12 -1.19385e-12 -6.78321e-13 1.80885e-14 6.99172e-14 4.88939e-15 -5.08953e-15 -6.06728e-16\n -2.86296e-9 1.21911e-13 2.03235e-12 2.54849e-12 1.02299e-12 -2.68873e-13 -3.8519e-13 -8.94733e-14 3.28268e-14 1.85955e-14 -5.06217e-16 -1.9183e-15 -1.33318e-16 1.39692e-16 1.65859e-17","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"The 2-norm relative error in differentiating the Proriol series for f(xy) term-by-term and its sampled gradient is:","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"hypot(norm(Ux-Gx), norm(Uy-Gy))/hypot(norm(Ux), norm(Uy))","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"1.8769900773500217e-8","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"This error can be improved upon by increasing N and M.","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"","category":"page"},{"location":"generated/triangle/#","page":"Calculus on the reference triangle","title":"Calculus on the reference triangle","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/nonlocaldiffusion.jl\"","category":"page"},{"location":"generated/nonlocaldiffusion/#Nonlocal-diffusion-on-\\mathbb{S}2-1","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"","category":"section"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"This example calculates the spectrum of the nonlocal diffusion operator:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"mathcalL_delta u = int_mathbbS^2 rho_delta(mathbfx-mathbfy)leftu(mathbfx) - u(mathbfy)right mathrmdOmega(mathbfy)","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"defined in Eq. (2) of","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"R. M. Slevinsky, H. Montanelli, and Q. Du, A spectral method for nonlocal diffusion operators on the sphere, J. Comp. Phys., 372:893–911, 2018.","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"In the above, 0delta2, -1alpha1, and the kernel:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"rho_delta(mathbfx-mathbfy) = frac4(1+alpha)pi delta^2+2alpha fracchi_0delta(mathbfx-mathbfy)mathbfx-mathbfy^2-2alpha","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"where chi_I(cdot) is the indicator function on the set I.","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"This nonlocal operator is diagonalized by spherical harmonics:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"mathcalL_delta Y_ell^m(mathbfx) = lambda_ell(alpha delta) Y_ell^m(mathbfx)","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"and its eigenfunctions are given by the generalized Funk–Hecke formula:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"lambda_ell(alpha delta) = frac(1+alpha) 2^2+alphadelta^2+2alphaint_1-delta^22^1 leftP_ell(t)-1right (1-t)^alpha-1 mathrmd t","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"In the paper, the authors use Clenshaw–Curtis quadrature and asymptotic evaluation of Legendre polynomials to achieve mathcalO(n^2log n) complexity for the evaluation of the first n eigenvalues. With a change of basis, this complexity can be reduced to mathcalO(nlog n).","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"First, we represent:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"P_n(t) - 1 = sum_j=0^n-1 leftP_j+1(t) - P_j(t)right = -sum_j=0^n-1 (1-t) P_j^(10)(t)","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"Then, we represent P_j^(10)(t) with Jacobi polynomials P_i^(alpha0)(t) and we integrate using DLMF 18.9.16:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"int_x^1 P_i^(alpha0)(t)(1-t)^alphamathrmdt = left beginarraycc frac(1-x)^alpha+1alpha+1 mathrmfori=0 frac12i(1-x)^alpha+1(1+x)P_i-1^(alpha+11)(x) mathrmfori0endarrayright","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"The code below implements this algorithm, making use of the Jacobi–Jacobi transform plan_jac2jac. For numerical stability, the conversion from Jacobi polynomials P_j^(10)(t) to P_i^(alpha0)(t) is divided into conversion from P_j^(10)(t) to P_k^(00)(t), before conversion from P_k^(00)(t) to P_i^(alpha0)(t).","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"using FastTransforms, LinearAlgebra\n\nfunction oprec!(n::Integer, v::AbstractVector, alpha::Real, delta2::Real)\n if n > 0\n v[1] = 1\n end\n if n > 1\n v[2] = (4*alpha+8-(alpha+4)*delta2)/4\n end\n for i = 1:n-2\n v[i+2] = (((2*i+alpha+2)*(2*i+alpha+4)+alpha*(alpha+2))/(2*(i+1)*(2*i+alpha+2))*(2*i+alpha+3)/(i+alpha+3) - delta2/4*(2*i+alpha+3)/(i+1)*(2*i+alpha+4)/(i+alpha+3))*v[i+1] - (i+alpha+1)/(i+alpha+3)*(2*i+alpha+4)/(2*i+alpha+2)*v[i]\n end\n return v\nend\n\nfunction evaluate_lambda(n::Integer, alpha::T, delta::T) where T\n delta2 = delta*delta\n scl = (1+alpha)*(2-delta2/2)\n\n lambda = Vector{T}(undef, n)\n\n if n > 0\n lambda[1] = 0\n end\n if n > 1\n lambda[2] = -2\n end\n\n oprec!(n-2, view(lambda, 3:n), alpha, delta2)\n\n for i = 2:n-1\n lambda[i+1] *= -scl/(i-1)\n end\n\n p = plan_jac2jac(T, n-1, zero(T), zero(T), alpha, zero(T))\n\n lmul!(p', view(lambda, 2:n))\n\n for i = 2:n-1\n lambda[i+1] = ((2i-1)*lambda[i+1] + (i-1)*lambda[i])/i\n end\n\n for i = 2:n-1\n lambda[i+1] += lambda[i]\n end\n\n return lambda\nend","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"evaluate_lambda (generic function with 1 method)","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"The spectrum in Float64:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"lambda = evaluate_lambda(10, -0.5, 1.0)","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"10-element Vector{Float64}:\n 0.0\n -2.0\n -5.5\n -9.75\n -14.09375\n -18.203125\n -22.08984375\n -25.935546875\n -29.8870849609375\n -33.95416259765625","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"The spectrum in BigFloat:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"lambdabf = evaluate_lambda(10, parse(BigFloat, \"-0.5\"), parse(BigFloat, \"1.0\"))","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"10-element Vector{BigFloat}:\n 0.0\n -2.0\n -5.5\n -9.75\n -14.09375\n -18.203125\n -22.08984375\n -25.935546875\n -29.8870849609375\n -33.95416259765625","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"The infty-norm relative error:","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"norm(lambda-lambdabf, Inf)/norm(lambda, Inf)","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"0.0","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"","category":"page"},{"location":"generated/nonlocaldiffusion/#","page":"Nonlocal diffusion on mathbbS^2","title":"Nonlocal diffusion on mathbbS^2","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/disk.jl\"","category":"page"},{"location":"generated/disk/#Holomorphic-integration-on-the-unit-disk-1","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"","category":"section"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"In this example, we explore integration of a harmonic function:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":" f(xy) = fracx^2-y^2+1(x^2-y^2+1)^2+(2xy+1)^2","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"over the unit disk. In this case, we know from complex analysis that the integral of a holomorphic function is equal to pi times f(00). We analyze the function on an Ntimes M tensor product grid defined by:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"beginaligned\nr_n = cosleft(n+tfrac12)pi2Nrightquadrm forquad 0le n Nquadrm and\ntheta_m = 2pi mMquadrm forquad 0le m M\nendaligned","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"we convert the function samples to Chebyshev×Fourier coefficients using plan_disk_analysis; and finally, we transform the Chebyshev×Fourier coefficients to Zernike polynomial coefficients using plan_disk2cxf.","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"For the storage pattern of the arrays, please consult the documentation.","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"using FastTransforms, LinearAlgebra, Plots\nconst GENFIGS = joinpath(pkgdir(FastTransforms), \"docs/src/generated\")\n!isdir(GENFIGS) && mkdir(GENFIGS)\nplotlyjs()","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Plots.PlotlyJSBackend()","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Our function f on the disk:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"f = (x,y) -> (x^2-y^2+1)/((x^2-y^2+1)^2+(2x*y+1)^2)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"#1 (generic function with 1 method)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The Zernike polynomial degree:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"N = 15\nM = 4N-3","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"57","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The radial grid:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"r = [sinpi((N-n-0.5)/(2N)) for n in 0:N-1]","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"15-element Vector{Float64}:\n 0.9986295347545738\n 0.9876883405951378\n 0.9659258262890683\n 0.9335804264972017\n 0.8910065241883678\n 0.838670567945424\n 0.7771459614569709\n 0.7071067811865475\n 0.6293203910498375\n 0.5446390350150271\n 0.45399049973954675\n 0.35836794954530027\n 0.25881904510252074\n 0.15643446504023087\n 0.052335956242943835","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The angular grid (mod pi):","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"θ = (0:M-1)*2/M","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"0.0:0.03508771929824561:1.9649122807017543","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"On the mapped tensor product grid, our function samples are:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"F = [f(r*cospi(θ), r*sinpi(θ)) for r in r, θ in θ]","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"15×57 Matrix{Float64}:\n 0.400329 0.36696 0.336645 0.308443 0.281619 0.25557 0.22977 0.203733 0.176996 0.149111 0.119689 0.0885456 0.0561428 0.0249494 0.00382185 0.0233794 0.192001 0.82415 1.84146 1.85719 1.41721 1.08969 0.879424 0.739148 0.639757 0.565314 0.506844 0.459027 0.418538 0.383193 0.351486 0.32233 0.294899 0.268532 0.24267 0.216811 0.190481 0.163223 0.134611 0.104328 0.0724218 0.0400826 0.0120549 0.00476215 0.075801 0.422295 1.37342 1.98551 1.63411 1.23553 0.973247 0.802761 0.685557 0.600091 0.534475 0.481845 0.438023\n 0.402946 0.369531 0.339215 0.31106 0.284337 0.258454 0.232899 0.207211 0.180965 0.153777 0.125364 0.0957188 0.0656309 0.0381784 0.0233592 0.0535023 0.23469 0.838287 1.74173 1.78814 1.39763 1.08662 0.881061 0.742049 0.642889 0.56837 0.509752 0.461793 0.421195 0.385781 0.35405 0.324917 0.297559 0.271324 0.245665 0.220098 0.194183 0.16751 0.139734 0.110675 0.0806214 0.0512076 0.0280171 0.0289628 0.112787 0.46247 1.32844 1.88443 1.59532 1.22668 0.973254 0.805245 0.688639 0.603204 0.53746 0.48468 0.44073\n 0.408107 0.374635 0.344345 0.316308 0.289809 0.264275 0.239228 0.214259 0.189018 0.16325 0.136874 0.110236 0.0847405 0.0645701 0.0616188 0.110283 0.308499 0.852043 1.57431 1.65952 1.35481 1.07725 0.882418 0.74674 0.648492 0.574076 0.515313 0.467166 0.426411 0.390904 0.359157 0.330094 0.302904 0.276953 0.251718 0.226757 0.201691 0.176211 0.150131 0.123537 0.0971828 0.0735249 0.059617 0.0756242 0.180187 0.525812 1.24639 1.70902 1.5172 1.20513 0.970751 0.808756 0.693948 0.608911 0.543108 0.490146 0.446017\n 0.415648 0.382189 0.352011 0.324209 0.298096 0.273134 0.248897 0.225051 0.201367 0.177773 0.154485 0.132336 0.113545 0.103633 0.116351 0.186253 0.393918 0.849832 1.38148 1.49082 1.28527 1.05638 0.879972 0.751049 0.655222 0.581588 0.52299 0.474802 0.433974 0.398441 0.366752 0.33786 0.310977 0.2855 0.260948 0.236942 0.213198 0.189555 0.166059 0.143176 0.122289 0.106906 0.105724 0.140558 0.26534 0.588182 1.1413 1.4992 1.40336 1.16548 0.961348 0.810521 0.699782 0.616152 0.550745 0.497814 0.453615\n 0.425289 0.392035 0.362148 0.334773 0.309271 0.285158 0.262081 0.239809 0.218269 0.197619 0.178435 0.162105 0.151689 0.153844 0.183081 0.270225 0.470832 0.826183 1.19548 1.30726 1.19053 1.01926 0.869418 0.751971 0.661094 0.589601 0.531924 0.48414 0.443527 0.408177 0.376729 0.348191 0.321822 0.297066 0.273507 0.250853 0.228945 0.20781 0.187783 0.169776 0.15586 0.150546 0.163666 0.216532 0.352149 0.631169 1.0287 1.29056 1.26502 1.10458 0.940232 0.806897 0.703689 0.623316 0.559314 0.506989 0.463072\n 0.436597 0.403911 0.374626 0.347975 0.323392 0.300472 0.278957 0.258746 0.239942 0.222959 0.208736 0.199165 0.19792 0.212076 0.254963 0.349717 0.526163 0.785631 1.03278 1.13127 1.07899 0.964458 0.847102 0.746235 0.663661 0.596384 0.540917 0.494365 0.454527 0.419771 0.388896 0.361011 0.335454 0.311744 0.289549 0.268688 0.249152 0.23118 0.215414 0.203195 0.197165 0.20243 0.228745 0.293986 0.426183 0.648643 0.920719 1.10477 1.11859 1.02459 0.904279 0.794291 0.702811 0.628337 0.567372 0.51668 0.47372\n 0.448951 0.417414 0.389209 0.363706 0.340449 0.319139 0.299632 0.28197 0.266434 0.253672 0.244908 0.242329 0.249735 0.273549 0.32399 0.414856 0.556748 0.73654 0.898135 0.976631 0.96284 0.895308 0.811683 0.731268 0.660475 0.599969 0.54849 0.504405 0.466222 0.432719 0.402938 0.376152 0.351819 0.329563 0.309162 0.29056 0.273906 0.259647 0.248682 0.242655 0.244458 0.259053 0.294635 0.36347 0.47935 0.644419 0.824368 0.950029 0.979333 0.933025 0.853895 0.770471 0.694553 0.628995 0.573203 0.525623 0.484659\n 0.461538 0.431966 0.405508 0.381723 0.360304 0.341079 0.324035 0.309345 0.297441 0.289121 0.285721 0.289387 0.303423 0.332641 0.383252 0.461146 0.566675 0.686278 0.79016 0.848441 0.853234 0.818825 0.765072 0.706268 0.649804 0.598546 0.553073 0.513009 0.477665 0.446331 0.418379 0.393304 0.370732 0.350422 0.332279 0.316375 0.303005 0.292765 0.286694 0.286496 0.294846 0.315771 0.354858 0.418544 0.510882 0.626287 0.742362 0.826153 0.856971 0.839629 0.793294 0.735701 0.677489 0.623454 0.575098 0.532405 0.494793\n 0.473406 0.446815 0.422943 0.401579 0.382592 0.365953 0.35177 0.340321 0.332115 0.327962 0.329086 0.337225 0.354715 0.384367 0.428886 0.489368 0.562769 0.639621 0.705232 0.746138 0.75726 0.742897 0.711918 0.672777 0.631361 0.591026 0.553364 0.51894 0.487799 0.459755 0.434554 0.411958 0.391793 0.373976 0.358542 0.345678 0.33577 0.329466 0.327769 0.332147 0.344633 0.367837 0.404636 0.457191 0.524883 0.601613 0.674803 0.729338 0.755332 0.752747 0.728907 0.692933 0.652092 0.610928 0.571808 0.535736 0.502968\n 0.483592 0.461074 0.44072 0.422552 0.406616 0.393018 0.381958 0.373761 0.368913 0.368096 0.372211 0.382374 0.399829 0.425704 0.460521 0.503436 0.551426 0.599039 0.639428 0.66664 0.677821 0.673802 0.657934 0.634338 0.606657 0.577562 0.548776 0.521299 0.49565 0.472064 0.450625 0.431361 0.4143 0.399515 0.387153 0.377475 0.370881 0.36795 0.369472 0.37646 0.390112 0.411659 0.442005 0.481097 0.527085 0.575698 0.62056 0.654949 0.674261 0.67754 0.667091 0.646854 0.620817 0.592158 0.563054 0.534833 0.508227\n 0.491347 0.47384 0.457857 0.443596 0.43124 0.420991 0.413088 0.407835 0.405607 0.406854 0.41208 0.421791 0.436393 0.456016 0.480289 0.508089 0.537411 0.565495 0.589313 0.606297 0.614986 0.615273 0.608182 0.595383 0.578689 0.55973 0.539808 0.519875 0.500596 0.482417 0.465645 0.450499 0.437168 0.425839 0.416729 0.410109 0.406316 0.405766 0.408937 0.416345 0.428463 0.445585 0.467622 0.493853 0.522719 0.551798 0.578117 0.598782 0.611716 0.616137 0.612554 0.602381 0.587414 0.569403 0.549822 0.529795 0.510121\n 0.496372 0.484362 0.473263 0.463344 0.454844 0.447987 0.442992 0.440085 0.43949 0.441422 0.446059 0.453506 0.463734 0.476516 0.491364 0.507491 0.523832 0.539138 0.552155 0.561824 0.567461 0.568845 0.566188 0.560036 0.551118 0.54022 0.528088 0.515374 0.502621 0.490272 0.478681 0.468141 0.458903 0.451197 0.445243 0.441264 0.439485 0.440128 0.443394 0.44943 0.458281 0.469829 0.483724 0.499329 0.51571 0.531695 0.546006 0.557461 0.565171 0.568681 0.567994 0.563506 0.555873 0.545868 0.534265 0.521767 0.508973\n 0.498951 0.492196 0.485875 0.480211 0.475399 0.471612 0.469002 0.467693 0.467782 0.469331 0.472348 0.476782 0.482503 0.489293 0.496841 0.504746 0.512549 0.519761 0.525915 0.530618 0.533588 0.534687 0.533917 0.531408 0.527389 0.522155 0.516029 0.509344 0.502414 0.495534 0.488967 0.482948 0.477687 0.473367 0.470152 0.468178 0.467558 0.468372 0.470657 0.474394 0.479493 0.485782 0.492995 0.500776 0.508691 0.516259 0.522997 0.528468 0.532332 0.534375 0.53453 0.532867 0.52957 0.524904 0.519183 0.512736 0.505891\n 0.499854 0.497256 0.494799 0.492592 0.490727 0.489288 0.488339 0.487926 0.488075 0.488789 0.490046 0.491797 0.493969 0.496462 0.499157 0.501918 0.5046 0.507061 0.509167 0.510805 0.511889 0.512367 0.512222 0.51147 0.510163 0.508376 0.506206 0.503765 0.501171 0.498544 0.496003 0.493658 0.491611 0.48995 0.488749 0.488063 0.48793 0.488363 0.489352 0.490864 0.492836 0.495182 0.497793 0.500538 0.503278 0.505867 0.508166 0.51005 0.51142 0.512206 0.512372 0.511919 0.510882 0.509324 0.507332 0.505012 0.502479\n 0.499998 0.4997 0.499416 0.49916 0.498945 0.498781 0.498675 0.498633 0.498657 0.498746 0.498895 0.499098 0.499346 0.499625 0.499922 0.500224 0.500515 0.500781 0.50101 0.501189 0.50131 0.501367 0.501358 0.501283 0.501146 0.500953 0.500715 0.500442 0.500148 0.499848 0.499555 0.499284 0.499047 0.498856 0.49872 0.498646 0.498637 0.498693 0.498813 0.498991 0.499217 0.499482 0.499772 0.500074 0.500372 0.500652 0.500901 0.501106 0.501257 0.501347 0.501371 0.501328 0.501222 0.501056 0.500839 0.500582 0.500297","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"X = [r*cospi(θ) for r in r, θ in θ]\nY = [r*sinpi(θ) for r in r, θ in θ]\nscatter3d(vec(X), vec(Y), vec(0F); markersize=0.75, markercolor=:red)\nsurface!(X, Y, F; legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"zernike.html\"))","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/zernike.html\"","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"We precompute a (generalized) Zernike–Chebyshev×Fourier plan:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"α, β = 0, 0\nP = plan_disk2cxf(F, α, β)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"FastTransforms Zernike--Chebyshev×Fourier plan for 15×57-element array of Float64","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"And an FFTW Chebyshev×Fourier analysis plan on the disk:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"PA = plan_disk_analysis(F)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"FastTransforms plan for FFTW Chebyshev×Fourier analysis on the disk for 15×57-element array of Float64","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Its Zernike coefficients are:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"U = P\\(PA*F)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"15×57 Matrix{Float64}:\n 0.886227 3.60709e-6 -1.8336e-6 -0.361801 3.60559e-11 -1.17688e-6 6.36308e-6 0.140125 -0.140125 -6.35177e-6 -7.70959e-6 1.89039e-10 0.118427 1.54098e-5 7.4099e-7 -0.0522214 -0.0522214 -1.71856e-5 1.64002e-5 0.0472361 -5.20197e-10 4.08953e-7 -3.63399e-5 -0.0217254 0.0217254 3.88099e-5 3.92308e-5 -1.24018e-9 -0.0202253 -8.31939e-5 -2.14893e-7 0.00949917 0.00949917 8.82306e-5 -8.80125e-5 -0.00898531 2.80468e-9 -1.10226e-7 0.000185657 0.00427337 -0.00427337 -0.000194603 -0.000194714 6.17793e-9 0.00408335 0.000406568 5.5777e-8 -0.00195832 -0.0019583 -0.000423167 0.000423111 0.00188439 -1.33894e-8 2.79926e-8 -0.000878195 -0.00090912 0.000909147\n 1.04025e-17 4.60728e-6 -2.33805e-6 -4.33e-11 4.33e-11 -1.22625e-6 6.53675e-6 3.57706e-17 -1.46429e-10 -5.65109e-6 -6.90982e-6 1.84987e-10 1.84987e-10 1.21904e-5 6.29629e-7 -4.19031e-10 -2.48746e-18 -1.21069e-5 1.14861e-5 4.50193e-10 -4.50193e-10 3.03358e-7 -2.25713e-5 9.64739e-18 9.39347e-10 2.10848e-5 2.13797e-5 -9.62216e-10 -9.62216e-10 -3.90991e-5 -1.42777e-7 1.94644e-9 2.52523e-17 3.51181e-5 -3.49801e-5 -1.94972e-9 1.94972e-9 -6.65696e-8 6.06806e-5 1.62452e-17 -3.87473e-9 -4.9981e-5 -5.00452e-5 3.82278e-9 3.82278e-9 7.63297e-5 3.09339e-8 -7.49277e-9 3.07275e-19 -5.04164e-5 5.03866e-5 7.2952e-9 -7.2952e-9 1.38574e-8 -4.45519e-5 2.75116e-17 1.36316e-8\n 4.31967e-17 4.76065e-6 -2.40899e-6 -4.59639e-11 4.59638e-11 -1.12866e-6 5.89804e-6 -4.92893e-18 -1.43511e-10 -4.51295e-6 -5.57325e-6 1.70088e-10 1.70088e-10 8.73447e-6 4.92668e-7 -3.63967e-10 -1.96912e-17 -7.74165e-6 7.28634e-6 3.70513e-10 -3.70513e-10 2.09854e-7 -1.26794e-5 -1.115e-17 7.33255e-10 1.02945e-5 1.04878e-5 -7.12279e-10 -7.12279e-10 -1.63841e-5 -8.90173e-8 1.36506e-9 -1.79643e-17 1.23112e-5 -1.22292e-5 -1.29344e-9 1.29344e-9 -3.78749e-8 1.71213e-5 -1.31822e-17 -2.42653e-9 -1.07347e-5 -1.07697e-5 2.25423e-9 2.25423e-9 1.13275e-5 1.62097e-8 -4.14789e-9 4.72154e-18 -4.10621e-6 4.09201e-6 3.57033e-9 -3.57033e-9 7.2136e-9 -3.89728e-6 1.18842e-17 7.03625e-9\n -8.6759e-18 4.3306e-6 -2.18254e-6 -4.50915e-11 4.50915e-11 -9.41975e-7 4.79767e-6 9.95472e-18 -1.3221e-10 -3.27045e-6 -4.09126e-6 1.48194e-10 1.48194e-10 5.69834e-6 3.57019e-7 -3.00851e-10 2.82407e-18 -4.50516e-6 4.19432e-6 2.90868e-10 -2.90868e-10 1.35612e-7 -6.44339e-6 7.09943e-18 5.46652e-10 4.50749e-6 4.62617e-6 -5.03847e-10 -5.03847e-10 -6.09951e-6 -5.21037e-8 9.1491e-10 1.52128e-18 3.77955e-6 -3.73364e-6 -8.19854e-10 8.19854e-10 -2.03036e-8 4.12363e-6 2.08255e-17 -1.45125e-9 -1.88522e-6 -1.90324e-6 1.26862e-9 1.26862e-9 1.23872e-6 7.40728e-9 -2.01666e-9 4.52885e-18 -6.4875e-7 6.41095e-7 1.96336e-9 -1.96336e-9 3.94603e-9 -4.95856e-7 1.37158e-17 3.81545e-9\n -1.55357e-17 3.55971e-6 -1.7846e-6 -4.1593e-11 4.1593e-11 -7.20914e-7 3.55774e-6 1.25952e-17 -1.15465e-10 -2.16169e-6 -2.74892e-6 1.22948e-10 1.22948e-10 3.3937e-6 2.40326e-7 -2.37394e-10 1.15486e-17 -2.38904e-6 2.19119e-6 2.18301e-10 -2.18301e-10 8.19355e-8 -2.95988e-6 -5.32282e-18 3.89943e-10 1.76401e-6 1.8323e-6 -3.41184e-10 -3.41184e-10 -2.0084e-6 -2.86395e-8 5.87175e-10 -4.46611e-18 1.01021e-6 -9.86038e-7 -4.97705e-10 4.97705e-10 -1.02636e-8 8.36501e-7 -1.96829e-17 -8.31421e-10 -2.51578e-7 -2.59455e-7 6.11155e-10 6.11155e-10 2.81636e-7 4.14107e-9 -1.17835e-9 5.45336e-18 -1.31206e-7 1.26866e-7 1.1332e-9 -1.1332e-9 2.26757e-9 -8.50354e-8 6.1748e-18 2.17398e-9\n 4.5607e-17 2.67365e-6 -1.33163e-6 -3.63778e-11 3.63778e-11 -5.08751e-7 2.4183e-6 -1.79334e-18 -9.60672e-11 -1.3062e-6 -1.69561e-6 9.74399e-11 9.74399e-11 1.84711e-6 1.50509e-7 -1.79257e-10 3.76234e-18 -1.15523e-6 1.03773e-6 1.56975e-10 -1.56975e-10 4.63055e-8 -1.22747e-6 1.76766e-18 2.66772e-10 6.14181e-7 6.51026e-7 -2.21796e-10 -2.21796e-10 -5.82251e-7 -1.47961e-8 3.62177e-10 3.79631e-18 2.3447e-7 -2.22474e-7 -2.90765e-10 2.90765e-10 -4.27394e-9 1.32135e-7 3.89533e-18 -3.9572e-10 -7.37753e-8 -7.83499e-8 3.78556e-10 3.78556e-10 7.69466e-8 2.43764e-9 -7.22143e-10 5.49309e-18 -3.3267e-8 3.06793e-8 6.86748e-10 -6.86748e-10 1.36854e-9 -1.89956e-8 2.38165e-18 1.30213e-9\n 5.17884e-18 1.84493e-6 -9.11632e-7 -3.03234e-11 3.03234e-11 -3.31998e-7 1.51086e-6 -9.81832e-20 -7.63919e-11 -7.22019e-7 -9.61716e-7 7.39635e-11 7.39635e-11 9.19025e-7 8.7759e-8 -1.29855e-10 -9.09509e-18 -5.0973e-7 4.44593e-7 1.08464e-10 -1.08464e-10 2.44943e-8 -4.5896e-7 -9.96677e-18 1.75682e-10 1.89131e-7 2.07797e-7 -1.3908e-10 -1.3908e-10 -1.48285e-7 -7.20906e-9 2.15876e-10 -5.63307e-18 4.31232e-8 -3.83843e-8 -1.35983e-10 1.35983e-10 -2.58242e-9 4.86298e-8 -5.91649e-18 -2.58784e-10 -2.49419e-8 -2.77411e-8 2.45364e-10 2.45364e-10 2.49291e-8 1.50968e-9 -4.63692e-10 5.12088e-18 -1.04761e-8 8.85511e-9 4.36633e-10 -4.36633e-10 8.66632e-10 -5.46345e-9 5.4617e-18 8.19335e-10\n -3.03871e-17 1.17276e-6 -5.74087e-7 -2.41606e-11 2.41606e-11 -2.00616e-7 8.68671e-7 -6.96842e-19 -5.82253e-11 -3.64941e-7 -5.01985e-7 5.39205e-11 5.39205e-11 4.17975e-7 4.76625e-8 -9.05511e-11 -7.94098e-18 -2.05562e-7 1.71822e-7 7.23176e-11 -7.23176e-11 1.21586e-8 -1.5476e-7 2.76426e-18 1.11916e-10 5.11842e-8 6.01101e-8 -8.43279e-11 -8.43279e-11 -2.90142e-8 -2.68449e-9 9.8079e-11 3.48626e-18 1.93294e-8 -1.63497e-8 -9.30964e-11 9.30964e-11 -1.64272e-9 2.0359e-8 -6.43e-20 -1.75944e-10 -9.61519e-9 -1.14155e-8 1.65598e-10 1.65598e-10 9.47999e-9 9.81067e-10 -3.10521e-10 -4.22278e-18 -4.06062e-9 2.99682e-9 2.90001e-10 -2.90001e-10 5.7406e-10 -2.00747e-9 -3.75041e-19 5.39466e-10\n 1.15904e-17 6.87558e-7 -3.32907e-7 -1.84685e-11 1.84685e-11 -1.12306e-7 4.59773e-7 1.30243e-17 -4.265e-11 -1.68481e-7 -2.41286e-7 3.78985e-11 3.78985e-11 1.73828e-7 2.4139e-8 -6.10346e-11 -3.679e-18 -7.61356e-8 5.9745e-8 4.66938e-11 -4.66938e-11 5.69883e-9 -4.73542e-8 8.93103e-19 6.84382e-11 1.00798e-8 1.31808e-8 -3.64534e-11 -3.64534e-11 -1.46721e-8 -1.7526e-9 6.92775e-11 -7.65573e-18 9.70857e-9 -7.74328e-9 -6.54378e-11 6.54379e-11 -1.09391e-9 9.61505e-9 3.11249e-19 -1.23027e-10 -4.18802e-9 -5.39773e-9 1.15147e-10 1.15147e-10 4.18575e-9 6.64834e-10 -2.1464e-10 2.95795e-18 -1.89907e-9 1.17239e-9 1.99193e-10 -1.99193e-10 3.95103e-10 -9.19881e-10 3.54531e-18 3.68061e-10\n 1.3655e-17 3.71865e-7 -1.77783e-7 -1.35612e-11 1.35612e-11 -5.82608e-8 2.24022e-7 5.17824e-18 -3.01692e-11 -7.09608e-8 -1.06944e-7 2.57607e-11 2.57607e-11 6.63405e-8 1.14574e-8 -3.98083e-11 1.78738e-17 -2.62265e-8 1.87191e-8 2.83655e-11 -2.83655e-11 1.81554e-9 -1.02616e-8 2.36022e-18 2.72302e-11 5.57557e-9 7.66477e-9 -2.60181e-11 -2.60181e-11 -8.14921e-9 -1.19076e-9 4.92954e-11 1.02848e-17 5.39512e-9 -4.04931e-9 -4.64096e-11 4.64096e-11 -7.54615e-10 5.0669e-9 9.15652e-18 -8.69428e-11 -2.04308e-9 -2.88332e-9 8.10649e-11 8.10649e-11 2.11288e-9 4.64752e-10 -1.50494e-10 3.12591e-18 -1.03471e-9 5.23655e-10 1.39056e-10 -1.39056e-10 2.79431e-10 -5.01563e-10 5.09065e-18 2.55748e-10\n -1.70371e-17 1.85546e-7 -8.74169e-8 -9.6428e-12 9.6428e-12 -2.80375e-8 1.00537e-7 -1.47205e-17 -2.06073e-11 -2.73295e-8 -4.39821e-8 1.69233e-11 1.69233e-11 2.34206e-8 5.10163e-9 -2.35204e-11 8.47131e-18 -5.91169e-9 3.77929e-9 9.88461e-12 -9.88462e-12 1.24842e-9 -6.38622e-9 5.95056e-18 1.91141e-11 3.32832e-9 4.77417e-9 -1.82332e-11 -1.82332e-11 -4.89671e-9 -8.28984e-10 3.44828e-11 5.52642e-18 3.25458e-9 -2.31249e-9 -3.24e-11 3.24e-11 -5.30949e-10 2.93011e-9 -6.15329e-18 -6.05679e-11 -1.10379e-9 -1.6978e-9 5.63435e-11 5.63436e-11 1.1914e-9 3.3001e-10 -1.04342e-10 1.12709e-19 -6.27959e-10 2.63577e-10 9.6157e-11 -9.6157e-11 2.00002e-10 -3.071e-10 3.66282e-18 1.76348e-10\n -3.29615e-17 8.54426e-8 -3.95787e-8 -6.58741e-12 6.58744e-12 -1.26163e-8 4.18408e-8 -2.64892e-17 -1.3631e-11 -9.62687e-9 -1.67874e-8 9.48624e-12 9.48623e-12 4.72571e-9 1.23574e-9 -6.65263e-12 -4.22361e-18 -3.91558e-9 2.44388e-9 6.57828e-12 -6.57828e-12 8.65402e-10 -4.14906e-9 1.43425e-18 1.2711e-11 2.09945e-9 3.10576e-9 -1.21149e-11 -1.21149e-11 -3.10737e-9 -5.79121e-10 2.28905e-11 5.54319e-18 2.07394e-9 -1.41354e-9 -2.1486e-11 2.1486e-11 -3.73369e-10 1.81245e-9 -1.16961e-17 -4.01214e-11 -6.48005e-10 -1.06694e-9 3.72789e-11 3.72789e-11 7.26798e-10 2.33379e-10 -6.89482e-11 7.31145e-18 -4.05112e-10 1.46777e-10 6.34527e-11 -6.34527e-11 1.42127e-10 -1.99851e-10 5.42192e-18 1.16198e-10\n 1.6415e-17 3.66259e-8 -1.66324e-8 -4.39971e-12 4.39972e-12 -5.20978e-9 1.59586e-8 5.56694e-19 -7.0843e-12 -1.58674e-9 -2.96274e-9 1.91297e-12 1.91297e-12 3.12298e-9 8.33281e-10 -3.95183e-12 -4.20797e-18 -2.58884e-9 1.5939e-9 3.90661e-12 -3.90663e-12 5.8643e-10 -2.71374e-9 2.69379e-18 7.54633e-12 1.34984e-9 2.03322e-9 -7.18992e-12 -7.18992e-12 -2.00561e-9 -3.94051e-10 1.35798e-11 -4.17599e-18 1.34233e-9 -8.92165e-10 -1.27412e-11 1.27412e-11 -2.54934e-10 1.15296e-9 -8.61255e-18 -2.37812e-11 -3.99094e-10 -6.85581e-10 2.20855e-11 2.20855e-11 4.59097e-10 1.5982e-10 -4.0826e-11 -1.5289e-18 -2.64588e-10 8.74454e-11 3.75507e-11 -3.75507e-11 9.75761e-11 -1.31247e-10 -4.8282e-18 6.87229e-11\n 8.80953e-18 1.42637e-8 -6.34424e-9 -2.10397e-12 2.10396e-12 -6.84193e-10 1.98342e-9 -7.07889e-20 -7.77237e-13 -9.64872e-10 -1.8079e-9 8.82103e-13 8.82103e-13 1.90051e-9 5.11075e-10 -1.82213e-12 6.93021e-18 -1.57577e-9 9.64939e-10 1.80116e-12 -1.80117e-12 3.60351e-10 -1.64478e-9 5.43119e-18 3.47896e-12 8.12528e-10 1.2328e-9 -3.31434e-12 -3.31434e-12 -1.2092e-9 -2.42517e-10 6.2592e-12 -2.80085e-18 8.10242e-10 -5.33001e-10 -5.872e-12 5.872e-12 -1.57104e-10 6.91093e-10 -6.77559e-18 -1.09586e-11 -2.3601e-10 -4.12661e-10 1.01758e-11 1.01758e-11 2.74436e-10 9.85995e-11 -1.88077e-11 -4.72317e-18 -1.60322e-10 5.09818e-11 1.7296e-11 -1.7296e-11 6.02559e-11 -7.9705e-11 -7.79753e-20 3.16487e-11\n -3.17011e-17 3.5367e-9 -1.55057e-9 -5.05699e-14 5.05682e-14 -1.24617e-9 3.61129e-9 -1.06861e-18 -1.49121e-13 -1.75608e-9 -3.29176e-9 1.69228e-13 1.6923e-13 3.45928e-9 9.31108e-10 -3.49576e-13 -5.73066e-19 -2.86824e-9 1.75527e-9 3.45549e-13 -3.4555e-13 6.56655e-10 -2.99235e-9 -1.72502e-18 6.67424e-13 1.47702e-9 2.24293e-9 -6.35833e-13 -6.35833e-13 -2.1985e-9 -4.42011e-10 1.20078e-12 1.97444e-18 1.47335e-9 -9.68009e-10 -1.12648e-12 1.12649e-12 -2.86382e-10 1.25563e-9 2.20447e-19 -2.10227e-12 -4.28097e-10 -7.50132e-10 1.95208e-12 1.95208e-12 4.98453e-10 1.79759e-10 -3.60793e-12 1.54178e-18 -2.91666e-10 9.23134e-11 3.31791e-12 -3.31791e-12 1.09866e-10 -1.45042e-10 -1.11051e-18 6.07111e-12","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The Zernike coefficients are useful for integration. The integral of f(xy) over the disk should be pi2 by harmonicity. The coefficient of Z_00 multiplied by √π is:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"U[1, 1]*sqrt(π)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"1.5707963267948968","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Using an orthonormal basis, the integral of f(xy)^2 over the disk is approximately the square of the 2-norm of the coefficients:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"norm(U)^2, π/(2*sqrt(2))*log1p(sqrt(2))","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"(0.9789599193439185, 0.9789599179781414)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"But there's more! Next, we repeat the experiment using the Dunkl-Xu orthonormal polynomials supported on the rectangularized disk.","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"N = 2N\nM = N","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"30","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"We analyze the function on an Ntimes M mapped tensor product xy-grid defined by:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"beginaligned\nx_n = cosleft(frac2n+12Npiright) = sinleft(fracN-2n-12Npiright)quad rm for quad 0 le n Nquadrm and\nz_m = cosleft(frac2m+12Mpiright) = sinleft(fracM-2m-12Mpiright)quad rm for quad 0 le m M\ny_nm = sqrt1-x_n^2z_m\nendaligned","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Slightly more accuracy can be expected by using an auxiliary array:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":" w_n = sinleft(frac2n+12Npiright)quad rm for quad 0 le n N","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"so that y_nm = w_nz_m.","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The x grid","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"w = [sinpi((n+0.5)/N) for n in 0:N-1]\nx = [sinpi((N-2n-1)/(2N)) for n in 0:N-1]","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"30-element Vector{Float64}:\n 0.9986295347545738\n 0.9876883405951378\n 0.9659258262890683\n 0.9335804264972017\n 0.8910065241883678\n 0.838670567945424\n 0.7771459614569709\n 0.7071067811865475\n 0.6293203910498375\n 0.5446390350150271\n 0.45399049973954675\n 0.35836794954530027\n 0.25881904510252074\n 0.15643446504023087\n 0.052335956242943835\n -0.052335956242943835\n -0.15643446504023087\n -0.25881904510252074\n -0.35836794954530027\n -0.45399049973954675\n -0.5446390350150271\n -0.6293203910498375\n -0.7071067811865475\n -0.7771459614569709\n -0.838670567945424\n -0.8910065241883678\n -0.9335804264972017\n -0.9659258262890683\n -0.9876883405951378\n -0.9986295347545738","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The z grid","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"z = [sinpi((M-2m-1)/(2M)) for m in 0:M-1]","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"30-element Vector{Float64}:\n 0.9986295347545738\n 0.9876883405951378\n 0.9659258262890683\n 0.9335804264972017\n 0.8910065241883678\n 0.838670567945424\n 0.7771459614569709\n 0.7071067811865475\n 0.6293203910498375\n 0.5446390350150271\n 0.45399049973954675\n 0.35836794954530027\n 0.25881904510252074\n 0.15643446504023087\n 0.052335956242943835\n -0.052335956242943835\n -0.15643446504023087\n -0.25881904510252074\n -0.35836794954530027\n -0.45399049973954675\n -0.5446390350150271\n -0.6293203910498375\n -0.7071067811865475\n -0.7771459614569709\n -0.838670567945424\n -0.8910065241883678\n -0.9335804264972017\n -0.9659258262890683\n -0.9876883405951378\n -0.9986295347545738","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"On the mapped tensor product grid, our function samples are:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"F = [f(x[n], w[n]*z) for n in 1:N, z in z]","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"30×30 Matrix{Float64}:\n 0.383725 0.383905 0.384264 0.384798 0.3855 0.386365 0.387383 0.388542 0.389832 0.391237 0.392744 0.394337 0.395997 0.397708 0.399451 0.401207 0.402957 0.404681 0.406361 0.407977 0.409512 0.410949 0.41227 0.413462 0.41451 0.415403 0.41613 0.416683 0.417055 0.417242\n 0.353509 0.354039 0.355094 0.356664 0.358732 0.36128 0.364281 0.367707 0.371524 0.375695 0.380177 0.384927 0.389897 0.395036 0.400292 0.405609 0.41093 0.416197 0.421352 0.426336 0.431089 0.435556 0.439683 0.443417 0.446713 0.449527 0.451824 0.453573 0.454752 0.455346\n 0.325652 0.32653 0.328275 0.330873 0.334296 0.338513 0.343483 0.349158 0.355488 0.362412 0.36987 0.377792 0.386108 0.394741 0.40361 0.412629 0.421708 0.43075 0.439655 0.44832 0.456637 0.464501 0.471805 0.478449 0.484336 0.489382 0.493512 0.496665 0.498793 0.499866\n 0.29943 0.300665 0.303122 0.306774 0.311585 0.317506 0.324478 0.332436 0.341308 0.351018 0.361484 0.372625 0.384354 0.396582 0.409213 0.422145 0.435264 0.448446 0.461551 0.474426 0.486904 0.498809 0.50996 0.520175 0.529284 0.537127 0.54357 0.548501 0.551834 0.553515\n 0.274261 0.275876 0.279088 0.283858 0.290132 0.297838 0.306895 0.317212 0.328692 0.341239 0.354758 0.36916 0.384358 0.400269 0.416811 0.43389 0.451401 0.469213 0.487163 0.505054 0.522647 0.539669 0.555819 0.570781 0.584246 0.595923 0.605564 0.612965 0.617979 0.620509\n 0.249651 0.251685 0.255724 0.261714 0.269574 0.279203 0.290482 0.303282 0.31747 0.332923 0.349529 0.367198 0.385862 0.405474 0.426001 0.44741 0.469656 0.492656 0.516277 0.540305 0.564443 0.588294 0.611378 0.633149 0.653036 0.670489 0.685018 0.696234 0.703855 0.707707\n 0.225163 0.227669 0.232643 0.240006 0.249642 0.261402 0.275112 0.290582 0.307622 0.326061 0.345762 0.366637 0.388654 0.411835 0.43625 0.461998 0.489179 0.517862 0.548041 0.579594 0.612236 0.645481 0.678629 0.710777 0.740882 0.76785 0.790662 0.808467 0.820649 0.826828\n 0.200384 0.203443 0.209507 0.218467 0.230156 0.244357 0.260808 0.279223 0.299317 0.32084 0.343606 0.367524 0.392611 0.418996 0.446912 0.47667 0.508629 0.543152 0.580544 0.620979 0.664413 0.710473 0.758363 0.806792 0.853985 0.897808 0.936015 0.966541 0.987766 0.99863\n 0.174918 0.178645 0.186025 0.196908 0.211057 0.228154 0.247802 0.269562 0.292995 0.317717 0.343461 0.370116 0.397762 0.426667 0.457278 0.490195 0.526141 0.565917 0.610353 0.660232 0.716173 0.778452 0.846763 0.919914 0.995547 1.07001 1.13854 1.19588 1.23718 1.25878\n 0.148385 0.152947 0.161975 0.175262 0.192474 0.213137 0.23665 0.262328 0.289486 0.317533 0.346071 0.374964 0.404363 0.43471 0.4667 0.501255 0.539494 0.582713 0.632375 0.690092 0.75756 0.836429 0.928002 1.03272 1.1493 1.27371 1.39809 1.51064 1.59716 1.64443\n 0.120453 0.126104 0.137278 0.153696 0.174875 0.200102 0.228448 0.258839 0.290208 0.321663 0.352638 0.382979 0.41296 0.443231 0.47475 0.508726 0.546578 0.589942 0.640699 0.701019 0.773401 0.860651 0.965732 1.0913 1.23871 1.40612 1.58568 1.76048 1.90408 1.98636\n 0.0909577 0.098092 0.112194 0.132868 0.159398 0.19068 0.225238 0.261383 0.297474 0.332223 0.364913 0.395469 0.424393 0.452621 0.481372 0.512033 0.546102 0.585165 0.630904 0.685083 0.749484 0.825684 0.914588 1.01552 1.12484 1.23449 1.33202 1.40445 1.44601 1.46226\n 0.0602361 0.0695018 0.0877988 0.114536 0.148582 0.188133 0.230785 0.273857 0.314915 0.352268 0.385224 0.414044 0.439685 0.46349 0.486923 0.511411 0.53824 0.568495 0.60296 0.641919 0.684785 0.729453 0.77136 0.802572 0.811931 0.788253 0.727788 0.642222 0.558465 0.506932\n 0.0300951 0.0426105 0.0672646 0.103059 0.148022 0.199015 0.251986 0.302743 0.347947 0.385818 0.416228 0.440285 0.45973 0.476426 0.492035 0.507855 0.524738 0.542996 0.562232 0.581051 0.596627 0.604238 0.597148 0.56764 0.510053 0.425442 0.32469 0.226238 0.149204 0.107374\n 0.00673069 0.0245336 0.0593763 0.109244 0.17025 0.236535 0.301213 0.358181 0.403763 0.437224 0.460093 0.47501 0.484736 0.491598 0.497272 0.502743 0.508304 0.513517 0.517087 0.516699 0.508899 0.489293 0.453432 0.398651 0.326385 0.243411 0.160485 0.0888546 0.0371183 0.010234\n 0.010234 0.0371183 0.0888546 0.160485 0.243411 0.326385 0.398651 0.453432 0.489293 0.508899 0.516699 0.517087 0.513517 0.508304 0.502743 0.497272 0.491598 0.484736 0.47501 0.460093 0.437224 0.403763 0.358181 0.301213 0.236535 0.17025 0.109244 0.0593763 0.0245336 0.00673069\n 0.107374 0.149204 0.226238 0.32469 0.425442 0.510053 0.56764 0.597148 0.604238 0.596627 0.581051 0.562232 0.542996 0.524738 0.507855 0.492035 0.476426 0.45973 0.440285 0.416228 0.385818 0.347947 0.302743 0.251986 0.199015 0.148022 0.103059 0.0672646 0.0426105 0.0300951\n 0.506932 0.558465 0.642222 0.727788 0.788253 0.811931 0.802572 0.77136 0.729453 0.684785 0.641919 0.60296 0.568495 0.53824 0.511411 0.486923 0.46349 0.439685 0.414044 0.385224 0.352268 0.314915 0.273857 0.230785 0.188133 0.148582 0.114536 0.0877988 0.0695018 0.0602361\n 1.46226 1.44601 1.40445 1.33202 1.23449 1.12484 1.01552 0.914588 0.825684 0.749484 0.685083 0.630904 0.585165 0.546102 0.512033 0.481372 0.452621 0.424393 0.395469 0.364913 0.332223 0.297474 0.261383 0.225238 0.19068 0.159398 0.132868 0.112194 0.098092 0.0909577\n 1.98636 1.90408 1.76048 1.58568 1.40612 1.23871 1.0913 0.965732 0.860651 0.773401 0.701019 0.640699 0.589942 0.546578 0.508726 0.47475 0.443231 0.41296 0.382979 0.352638 0.321663 0.290208 0.258839 0.228448 0.200102 0.174875 0.153696 0.137278 0.126104 0.120453\n 1.64443 1.59716 1.51064 1.39809 1.27371 1.1493 1.03272 0.928002 0.836429 0.75756 0.690092 0.632375 0.582713 0.539494 0.501255 0.4667 0.43471 0.404363 0.374964 0.346071 0.317533 0.289486 0.262328 0.23665 0.213137 0.192474 0.175262 0.161975 0.152947 0.148385\n 1.25878 1.23718 1.19588 1.13854 1.07001 0.995547 0.919914 0.846763 0.778452 0.716173 0.660232 0.610353 0.565917 0.526141 0.490195 0.457278 0.426667 0.397762 0.370116 0.343461 0.317717 0.292995 0.269562 0.247802 0.228154 0.211057 0.196908 0.186025 0.178645 0.174918\n 0.99863 0.987766 0.966541 0.936015 0.897808 0.853985 0.806792 0.758363 0.710473 0.664413 0.620979 0.580544 0.543152 0.508629 0.47667 0.446912 0.418996 0.392611 0.367524 0.343606 0.32084 0.299317 0.279223 0.260808 0.244357 0.230156 0.218467 0.209507 0.203443 0.200384\n 0.826828 0.820649 0.808467 0.790662 0.76785 0.740882 0.710777 0.678629 0.645481 0.612236 0.579594 0.548041 0.517862 0.489179 0.461998 0.43625 0.411835 0.388654 0.366637 0.345762 0.326061 0.307622 0.290582 0.275112 0.261402 0.249642 0.240006 0.232643 0.227669 0.225163\n 0.707707 0.703855 0.696234 0.685018 0.670489 0.653036 0.633149 0.611378 0.588294 0.564443 0.540305 0.516277 0.492656 0.469656 0.44741 0.426001 0.405474 0.385862 0.367198 0.349529 0.332923 0.31747 0.303282 0.290482 0.279203 0.269574 0.261714 0.255724 0.251685 0.249651\n 0.620509 0.617979 0.612965 0.605564 0.595923 0.584246 0.570781 0.555819 0.539669 0.522647 0.505054 0.487163 0.469213 0.451401 0.43389 0.416811 0.400269 0.384358 0.36916 0.354758 0.341239 0.328692 0.317212 0.306895 0.297838 0.290132 0.283858 0.279088 0.275876 0.274261\n 0.553515 0.551834 0.548501 0.54357 0.537127 0.529284 0.520175 0.50996 0.498809 0.486904 0.474426 0.461551 0.448446 0.435264 0.422145 0.409213 0.396582 0.384354 0.372625 0.361484 0.351018 0.341308 0.332436 0.324478 0.317506 0.311585 0.306774 0.303122 0.300665 0.29943\n 0.499866 0.498793 0.496665 0.493512 0.489382 0.484336 0.478449 0.471805 0.464501 0.456637 0.44832 0.439655 0.43075 0.421708 0.412629 0.40361 0.394741 0.386108 0.377792 0.36987 0.362412 0.355488 0.349158 0.343483 0.338513 0.334296 0.330873 0.328275 0.32653 0.325652\n 0.455346 0.454752 0.453573 0.451824 0.449527 0.446713 0.443417 0.439683 0.435556 0.431089 0.426336 0.421352 0.416197 0.41093 0.405609 0.400292 0.395036 0.389897 0.384927 0.380177 0.375695 0.371524 0.367707 0.364281 0.36128 0.358732 0.356664 0.355094 0.354039 0.353509\n 0.417242 0.417055 0.416683 0.41613 0.415403 0.41451 0.413462 0.41227 0.410949 0.409512 0.407977 0.406361 0.404681 0.402957 0.401207 0.399451 0.397708 0.395997 0.394337 0.392744 0.391237 0.389832 0.388542 0.387383 0.386365 0.3855 0.384798 0.384264 0.383905 0.383725","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"X = [x for x in x, z in z]\nY = [w*z for w in w, z in z]\nscatter3d(vec(X), vec(Y), vec(0F); markersize=0.75, markercolor=:green)\nsurface!(X, Y, F; legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"dunklxu.html\"))","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/dunklxu.html\"","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"We precompute a Dunkl-Xu–Chebyshev plan:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"P = plan_rectdisk2cheb(F, β)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"FastTransforms Dunkl-Xu--Chebyshev² plan for 30×30-element array of Float64","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"And an FFTW Chebyshev² analysis plan on the rectangularized disk:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"PA = plan_rectdisk_analysis(F)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"FastTransforms plan for FFTW Chebyshev analysis on the rectangularized disk for 30×30-element array of Float64","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Its Dunkl-Xu coefficients are:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"U = P\\(PA*F)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"30×30 Matrix{Float64}:\n 0.886226 2.88387e-18 -6.09829e-7 7.35851e-18 -0.0236857 -1.47226e-18 -0.00550977 2.32206e-18 -0.000650943 1.21902e-18 2.15779e-9 -5.41906e-19 1.86065e-5 -3.45643e-21 4.38992e-6 7.16086e-19 4.19398e-7 -1.83364e-18 -1.00953e-7 2.70552e-18 -8.14396e-8 -5.42887e-19 -3.94076e-8 1.3337e-19 -1.67897e-8 9.86492e-19 -6.33162e-9 -3.20905e-18 -2.11252e-9 6.15501e-19\n -1.77522e-18 -0.361799 -4.0846e-18 -0.062663 -1.17608e-18 2.72128e-6 2.30691e-19 0.00252359 -2.63137e-18 0.000679258 -4.46159e-18 9.1001e-5 6.38235e-18 1.03955e-6 5.22321e-19 -2.31664e-6 1.94715e-18 -3.11859e-7 -1.79784e-18 1.77496e-7 -2.62985e-18 1.44389e-7 2.91238e-18 6.82707e-8 -7.25576e-18 2.5634e-8 1.20042e-18 7.91583e-9 1.49738e-18 1.6359e-9\n -5.19659e-7 1.8508e-18 0.105921 -4.31929e-18 0.0404829 5.73996e-19 0.00663284 -1.0327e-18 -5.56102e-6 -4.21579e-19 -0.000301082 1.47301e-19 -8.77391e-5 5.41984e-22 -1.39615e-5 -8.87659e-20 -1.31088e-6 9.44811e-20 -2.80392e-7 5.51227e-20 -2.38006e-7 -4.98362e-20 -1.39444e-7 2.17216e-20 -5.76521e-8 2.30505e-19 -1.77475e-8 -9.7631e-19 -3.52357e-9 2.0364e-19\n -1.27221e-18 0.125331 4.97304e-18 1.52509e-6 1.45775e-18 -0.013651 7.22456e-21 -0.00478429 2.98148e-18 -0.000775222 4.75045e-18 4.86933e-6 -6.43203e-18 4.00219e-5 -4.98601e-19 1.28528e-5 -1.75937e-18 2.68143e-6 1.53754e-18 5.35246e-7 2.12609e-18 1.5728e-7 -2.22161e-18 5.72745e-8 5.21008e-18 1.62262e-8 -8.09068e-19 4.075e-10 -9.18958e-19 -1.20696e-9\n -0.0886209 5.9287e-18 -0.0913638 3.0208e-18 -0.0231032 -8.79578e-19 2.55845e-6 3.0702e-20 0.00173316 -2.27626e-20 0.000591205 7.34455e-20 9.51801e-5 -1.76615e-22 -9.67049e-7 -2.32129e-19 -5.17388e-6 7.52376e-19 -1.60228e-6 -1.32782e-18 -2.52759e-7 3.07657e-19 9.35469e-9 -8.51145e-20 2.66735e-8 -6.95778e-19 1.62648e-8 2.22225e-18 7.6679e-9 -4.29514e-19\n -2.27783e-19 -2.79797e-6 -7.72126e-18 0.0328526 -1.8342e-18 0.0160342 9.1729e-19 0.00332497 -2.80639e-18 -8.62281e-6 -4.2378e-18 -0.000228689 5.32969e-18 -7.87989e-5 3.83086e-19 -1.43006e-5 1.25448e-18 -1.11779e-6 -1.0031e-18 2.57992e-8 -1.25205e-18 -9.03781e-8 1.15981e-18 -8.97012e-8 -2.35026e-18 -4.18139e-8 3.12661e-19 -1.37244e-8 3.79461e-19 -2.86072e-9\n 0.0632999 3.51932e-18 0.0392743 1.49837e-19 3.65838e-6 -1.38938e-18 -0.00566089 8.65236e-20 -0.00237159 4.64215e-19 -0.0004495 -2.36182e-19 7.81213e-6 -6.26519e-21 3.39614e-5 4.25838e-19 1.24485e-5 -1.20569e-18 2.90796e-6 1.93539e-18 5.68462e-7 -4.14661e-19 1.34604e-7 1.07214e-19 3.66282e-8 7.3063e-19 6.0499e-9 -2.39201e-18 -9.48683e-10 4.62309e-19\n 3.09083e-18 -0.0381303 6.45574e-18 -0.0305859 1.32867e-18 -0.00858298 1.18843e-18 4.65679e-6 2.44694e-18 0.000859316 3.22841e-18 0.000335164 -3.73751e-18 6.02308e-5 -2.3993e-19 -1.60502e-6 -6.34732e-19 -4.61957e-6 3.88944e-19 -1.57519e-6 3.0958e-19 -2.83912e-7 -8.05568e-20 6.48665e-9 -9.16014e-20 2.64839e-8 1.4656e-20 1.29647e-8 1.77924e-20 3.53416e-9\n -0.0246173 1.34369e-18 -7.2626e-6 -6.12659e-19 0.0116417 -1.5041e-18 0.00624266 -1.85365e-18 0.00144602 -4.90943e-19 -1.39151e-5 3.17046e-19 -0.000132715 -1.2879e-20 -5.15476e-5 -5.01755e-19 -1.08626e-5 1.3675e-18 -1.14678e-6 -2.05969e-18 -1.60201e-8 4.1645e-19 -6.95967e-8 -8.86395e-20 -5.06628e-8 -6.56352e-19 -1.89806e-8 2.14815e-18 -4.88118e-9 -4.14794e-19\n 2.96922e-18 0.0318389 -7.01232e-18 0.0141265 -1.88894e-18 5.77928e-6 2.25083e-18 -0.00227906 -1.49048e-18 -0.00104803 -1.8946e-18 -0.000212855 1.43332e-18 1.03295e-5 3.07928e-20 2.34123e-5 -3.37163e-20 9.30847e-6 2.08986e-19 2.35417e-6 5.45452e-19 3.9768e-7 -5.99282e-19 5.08658e-8 1.44195e-18 -3.96513e-9 -2.31687e-19 -6.27377e-9 -2.80629e-19 -2.22939e-9\n 4.3203e-6 -1.01505e-18 -0.0150888 3.50579e-18 -0.0112343 -3.04793e-18 -0.00328812 1.6965e-19 1.04744e-5 1.13928e-18 0.00039214 -4.16429e-19 0.000165953 -4.32603e-20 3.20022e-5 5.4276e-19 -1.20827e-6 -1.2744e-18 -2.94655e-6 1.81728e-18 -7.04511e-7 -2.92334e-19 -5.6071e-8 7.05523e-20 3.46324e-8 5.34236e-19 2.06785e-8 -1.75157e-18 7.17059e-9 3.39977e-19\n 2.8983e-18 -0.013664 6.5678e-18 -1.51866e-5 5.4757e-19 0.00436874 2.16097e-18 0.00244523 1.06017e-18 0.000590637 4.65336e-19 -2.14758e-5 -9.40954e-20 -7.38896e-5 2.3552e-20 -3.13213e-5 5.26085e-19 -7.72648e-6 -6.82977e-19 -1.29269e-6 -8.74011e-19 -2.78823e-7 9.5171e-19 -5.90858e-8 -2.26756e-18 -1.01665e-8 3.58531e-19 -5.87834e-11 4.39097e-19 6.08272e-10\n 0.00851225 -3.46779e-18 0.0134873 -4.47271e-18 0.00537692 -8.3977e-19 6.02617e-6 -3.08821e-18 -0.000910525 -3.39517e-19 -0.000437065 3.03366e-19 -8.7068e-5 -8.80118e-20 1.1278e-5 -3.65139e-19 1.49731e-5 1.04786e-18 4.52269e-6 -1.08717e-18 1.07064e-6 2.22069e-19 1.46243e-7 -7.88106e-20 -1.38814e-8 -4.24262e-19 -1.70166e-8 1.34473e-18 -7.00317e-9 -2.34873e-19\n -5.243e-19 1.53467e-5 -3.42908e-18 -0.00600077 -1.14879e-18 -0.00428943 1.57332e-18 -0.00126564 4.71504e-19 2.25421e-5 1.05408e-18 0.000179497 -3.19824e-18 8.01025e-5 -4.07863e-19 1.7027e-5 -1.1788e-18 1.57076e-6 8.41234e-19 2.06968e-7 1.08582e-18 6.4408e-8 -1.00962e-18 3.71494e-8 2.54812e-18 1.54347e-8 -4.43537e-19 4.19595e-9 -5.02122e-19 6.39706e-10\n -0.00737561 3.20877e-19 -0.00609917 5.01968e-18 -2.74248e-5 -1.69707e-18 0.00166484 4.53517e-19 0.000938074 1.49633e-18 0.000214292 -4.51956e-19 -2.95524e-5 -1.70254e-19 -4.43089e-5 4.86992e-19 -1.48998e-5 -3.74819e-19 -4.66705e-6 8.30785e-19 -1.1166e-6 -1.63135e-19 -1.75326e-7 -5.17937e-20 6.20197e-11 2.28331e-19 1.22805e-8 -9.15375e-19 5.74874e-9 2.71057e-19\n -1.53896e-18 0.00528716 2.99138e-18 0.00556329 -2.15535e-19 0.00208938 -7.47732e-21 -5.2783e-7 -6.15068e-19 -0.000359085 -2.14571e-18 -0.000171677 2.3754e-18 -2.96656e-5 1.23813e-20 2.10201e-6 1.54216e-19 2.03799e-6 -3.37798e-19 7.36548e-7 -8.65849e-19 1.34796e-7 1.57582e-18 -8.41342e-9 -3.22682e-18 -1.56944e-8 3.58566e-19 -6.34761e-9 6.01843e-19 -1.40381e-9\n 0.00325817 -2.84485e-19 3.77292e-5 -6.03158e-18 -0.00236387 1.7388e-18 -0.0016225 -1.91543e-18 -0.000450124 4.45629e-20 4.2479e-5 6.05433e-20 9.29879e-5 -2.32382e-19 3.37099e-5 4.71114e-19 1.28552e-5 8.98504e-19 3.9506e-6 -2.91014e-19 9.51441e-7 1.15619e-19 1.58677e-7 -3.87565e-19 5.78941e-9 -4.52573e-19 -8.22477e-9 7.86929e-19 -4.24338e-9 2.31952e-19\n -1.89824e-18 -0.00475403 -2.71301e-19 -0.00260261 3.02312e-19 -4.17061e-5 -1.89426e-18 0.000603349 2.04618e-18 0.000321014 3.43974e-18 4.91036e-5 -6.38959e-18 -1.33075e-5 -1.05918e-18 -9.95643e-6 -2.63009e-18 -4.40482e-6 1.5221e-18 -1.35103e-6 1.63207e-18 -2.69324e-7 -1.27253e-19 -1.41967e-8 1.6452e-18 1.40866e-8 -7.11669e-19 7.16251e-9 -2.35918e-19 1.77508e-9\n -2.1087e-5 4.43105e-18 0.00246819 5.58103e-18 0.00221801 5.16957e-19 0.000774953 1.78195e-18 -2.27028e-5 1.01858e-18 -0.000146058 -3.94509e-19 -5.59485e-5 -6.27763e-19 -2.5516e-5 1.37015e-18 -9.52201e-6 7.96212e-19 -2.90084e-6 3.76863e-19 -7.0138e-7 -2.09039e-20 -1.20528e-7 -3.15268e-19 -6.49799e-9 -8.95548e-20 5.20338e-9 -4.60083e-19 2.87275e-9 4.70547e-19\n 6.06272e-20 0.00217575 -2.66229e-18 7.86173e-5 -6.71472e-19 -0.000845473 -2.57966e-18 -0.000526267 -2.09351e-18 -9.24417e-5 -3.21392e-18 2.85383e-5 8.09944e-19 2.55329e-5 -6.62568e-19 1.39518e-5 -1.59662e-18 5.53959e-6 -4.47258e-19 1.63754e-6 3.62645e-20 3.34514e-7 2.00636e-18 2.71988e-8 -3.09107e-18 -1.21682e-8 -2.21799e-19 -7.17118e-9 1.08785e-18 -1.87466e-9\n -0.00127442 3.52931e-19 -0.00226313 -4.30745e-18 -0.00105975 1.87531e-18 -4.70324e-5 6.00057e-19 0.000173699 -1.38557e-19 6.84882e-5 -3.26853e-19 3.73772e-5 -5.60827e-20 1.67333e-5 9.3379e-19 6.1804e-6 8.39235e-19 1.87498e-6 -2.66208e-19 4.54341e-7 3.00091e-19 7.92679e-8 1.95688e-20 4.9557e-9 -8.34156e-21 -3.08203e-9 -2.03576e-19 -1.77447e-9 7.2992e-20\n 1.96865e-18 -7.54358e-5 3.58988e-18 0.000953128 1.6236e-18 0.00073895 -2.40377e-18 0.000186348 2.16847e-18 -3.08415e-5 2.54719e-18 -4.20801e-5 1.22943e-19 -2.97992e-5 3.21331e-19 -1.49958e-5 -8.15942e-19 -5.73922e-6 -1.98008e-18 -1.67382e-6 1.43452e-18 -3.45419e-7 -1.22162e-18 -3.19319e-8 3.32858e-18 1.04223e-8 -1.08684e-18 6.70585e-9 4.47261e-19 1.79997e-9\n 0.00115733 1.30891e-18 0.00108248 4.06073e-18 0.000140675 -2.51786e-19 -0.00015525 2.19311e-18 -6.00244e-5 -3.22812e-19 -3.94963e-5 -3.02667e-19 -2.12639e-5 4.02577e-19 -9.44009e-6 1.85579e-19 -3.47007e-6 -2.98953e-19 -1.05071e-6 -7.43343e-19 -2.54885e-7 2.09385e-19 -4.47918e-8 9.68517e-19 -2.98189e-9 1.09376e-18 1.6509e-9 -1.31313e-18 9.71987e-10 -9.95033e-19\n 1.48521e-18 -0.000757848 -5.47813e-18 -0.000843449 -1.0829e-18 -0.000328982 5.05077e-19 8.77607e-7 -6.47403e-19 4.13033e-5 -7.47716e-19 4.36922e-5 3.11321e-18 2.88832e-5 2.20016e-19 1.41096e-5 5.10479e-19 5.3233e-6 -1.4537e-18 1.5442e-6 -2.20346e-19 3.20051e-7 7.40593e-19 3.10541e-8 -2.56423e-19 -8.83962e-9 -1.51978e-19 -5.9456e-9 -2.58702e-19 -1.61537e-9\n -0.000553886 -2.72894e-18 -0.000187639 -1.75508e-18 0.000102621 -1.51373e-18 3.50362e-5 -7.82231e-19 2.80559e-5 -1.16799e-18 1.831e-5 2.74456e-19 9.80506e-6 9.84228e-19 4.33835e-6 -3.15583e-19 1.59166e-6 2.69126e-20 4.81568e-7 1.46454e-18 1.16874e-7 9.49945e-20 2.05996e-8 -1.29623e-18 1.40536e-9 -3.22261e-19 -7.42251e-10 9.2967e-19 -4.4125e-10 3.14499e-19\n 3.43006e-19 0.00067785 7.65451e-18 0.000443404 1.23865e-18 5.25409e-5 6.64849e-19 -8.79182e-6 2.73158e-19 -3.88737e-5 3.09642e-19 -3.84611e-5 -2.37757e-18 -2.48679e-5 -5.12093e-19 -1.20249e-5 -1.41333e-19 -4.51391e-6 9.67661e-19 -1.30691e-6 5.07231e-19 -2.71299e-7 9.18246e-19 -2.67727e-8 1.99136e-19 7.24306e-9 -1.49026e-19 4.95787e-9 -1.41127e-18 1.35319e-9\n 0.000104898 -1.01818e-18 -4.97719e-5 -7.29653e-19 -1.14056e-5 5.87956e-19 -1.12136e-5 4.60098e-19 -8.949e-6 4.53171e-19 -5.82665e-6 -2.44462e-19 -3.11536e-6 -6.1681e-19 -1.37708e-6 5.61031e-19 -5.04943e-7 -8.46536e-20 -1.52739e-7 -3.66863e-19 -3.7074e-8 -2.38249e-19 -6.54014e-9 1.24858e-19 -4.49338e-10 7.25589e-19 2.34081e-10 -4.87718e-19 1.39557e-10 -5.94023e-19\n -3.13646e-18 -0.000389793 -3.28188e-18 -8.04943e-5 -1.37241e-19 -3.68665e-5 -2.30965e-18 8.03845e-6 -6.09189e-19 2.97453e-5 -5.0944e-19 2.89916e-5 1.05019e-18 1.86472e-5 6.3629e-19 8.99472e-6 1.43239e-18 3.37228e-6 -1.20318e-18 9.75922e-7 4.1214e-20 2.02668e-7 -1.14334e-19 2.00821e-8 1.81185e-19 -5.36499e-9 -1.23364e-19 -3.68864e-9 4.2811e-20 -1.00792e-9\n 1.54054e-5 1.23828e-18 1.00144e-6 1.84463e-19 1.23964e-6 -8.43152e-20 1.21824e-6 5.74481e-20 9.71898e-7 -1.03935e-19 6.32656e-7 -8.20175e-20 3.38215e-7 1.5389e-19 1.49487e-7 -1.12048e-19 5.48103e-8 -2.06987e-19 1.65791e-8 6.79198e-20 4.02426e-9 1.22785e-19 7.09969e-10 -6.46596e-20 4.88112e-11 -5.51333e-20 -2.53943e-11 1.23995e-19 -1.51441e-11 7.96269e-20\n -1.5778e-18 0.000145153 1.32424e-19 0.000143445 -7.6147e-20 6.55677e-5 2.22587e-19 -1.45469e-5 3.01577e-19 -5.3233e-5 3.22253e-20 -5.18305e-5 -8.36085e-22 -3.33247e-5 -1.86065e-19 -1.60719e-5 -4.43286e-19 -6.0251e-6 8.63083e-20 -1.74358e-6 5.65738e-21 -3.62096e-7 4.33784e-20 -3.58901e-8 -1.49965e-19 9.57958e-9 1.3012e-20 6.5884e-9 3.28648e-19 1.80042e-9","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"The Dunkl-Xu coefficients are useful for integration. The integral of f(xy) over the disk should be pi2 by harmonicity. The coefficient of P_00 multiplied by √π is:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"U[1, 1]*sqrt(π)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"1.5707955409153043","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"Using an orthonormal basis, the integral of f(xy)^2 over the disk is approximately the square of the 2-norm of the coefficients:","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"norm(U)^2, π/(2*sqrt(2))*log1p(sqrt(2))","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"(0.978937045726087, 0.9789599179781414)","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"","category":"page"},{"location":"generated/disk/#","page":"Holomorphic integration on the unit disk","title":"Holomorphic integration on the unit disk","text":"This page was generated using Literate.jl.","category":"page"},{"location":"dev/#Development-Documentation-1","page":"Development","title":"Development Documentation","text":"","category":"section"},{"location":"dev/#","page":"Development","title":"Development","text":"The core of FastTransforms.jl is developed in parallel with the C library of the same name. Julia and C interoperability is enhanced by the BinaryBuilder infrastructure, which provides the user a safe and seamless experience using a package in a different language.","category":"page"},{"location":"dev/#Why-two-packages?-1","page":"Development","title":"Why two packages?","text":"","category":"section"},{"location":"dev/#","page":"Development","title":"Development","text":"Orthogonal polynomial transforms are performance-sensitive imperative tasks. Yet, many of Julia's rich and evolving language features are simply unnecessary for defining these computational routines. Moreover, rapid language changes in Julia (as compared to C) have been more than a perturbation to this repository in the past.","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"The C library generates assembly for vectorized operations such as single instruction multiple data (SIMD) that is more efficient than that generated by a compiler without human intervention. It also uses OpenMP to introduce shared memory parallelism for large tasks. Finally, calling into precompiled binaries reduces the Julia package's pre-compilation and dependencies, improving the user experience. Some of these capabilities also exist in Julia, but with C there is frankly more control over performance.","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"C libraries are easier to call from any other language, partly explaining why the Python package manager Spack already supports the C library through third-party efforts.","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"In Julia, a parametric composite type with unrestricted type parameters is just about as big as Any. Such a type allows the Julia API to far exceed the C API in its ability to unify all of the orthogonal polynomial transforms and present them as linear operators. The mutable struct FTPlan{T, N, K}, together with AdjointFTPlan and TransposeFTPlan, are the core Julia types in this repository. Whereas T is understood to represent element type of the plan and N represents the number of leading dimensions of the array on which it operates, K is a mere enumeration which serves to distinguish the orthogonal polynomials at play. For example, FTPlan{Float64, 1, LEG2CHEB} represents the necessary pre-computations to convert 64-bit Legendre series to Chebyshev series (of the first kind). N == 1 because Chebyshev and Legendre series are naturally represented with vectors of coefficients. However, this particular plan may operate not only on vectors but also on matrices, column-by-column.","category":"page"},{"location":"dev/#The-developer's-right-to-build-from-source-1","page":"Development","title":"The developer's right to build from source","text":"","category":"section"},{"location":"dev/#","page":"Development","title":"Development","text":"Precompiled binaries are important for users, but development in C may be greatly accelerated by coupling it with a dynamic language such as Julia. For this reason, the repository preserves the developer's right to build the C library from source by setting an environment variable to trigger the build script:","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"julia> ENV[\"FT_BUILD_FROM_SOURCE\"] = \"true\"\n\"true\"\n\n(@v1.5) pkg> build FastTransforms\n Building FFTW ──────────→ `~/.julia/packages/FFTW/ayqyZ/deps/build.log`\n Building TimeZones ─────→ `~/.julia/packages/TimeZones/K98G0/deps/build.log`\n Building FastTransforms → `~/.julia/dev/FastTransforms/deps/build.log`\n\njulia> using FastTransforms\n[ Info: Precompiling FastTransforms [057dd010-8810-581a-b7be-e3fc3b93f78c]\n","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"This lets the developer experiment with new features through ccalling into bleeding edge source code. Customizing the build script further allows the developer to track a different branch or even a fork.","category":"page"},{"location":"dev/#From-release-to-release-to-release-1","page":"Development","title":"From release to release to release","text":"","category":"section"},{"location":"dev/#","page":"Development","title":"Development","text":"To get from a C library release to a Julia package release, the developer needs to update Yggdrasil's build_tarballs.jl script for the new version and its 256-bit SHA. On macOS, the SHA can be found by:","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"shell> curl https://codeload.github.com/MikaelSlevinsky/FastTransforms/tar.gz/v0.6.2 --output FastTransforms.tar.gz\n % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n100 168k 0 168k 0 0 429k 0 --:--:-- --:--:-- --:--:-- 429k\n\nshell> shasum -a 256 FastTransforms.tar.gz\nfd00befcb0c20ba962a8744a7b9139355071ee95be70420de005b7c0f6e023aa FastTransforms.tar.gz\n\nshell> rm -f FastTransforms.tar.gz\n","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"Using SHA.jl, the SHA can also be found by:","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"shell> curl https://codeload.github.com/MikaelSlevinsky/FastTransforms/tar.gz/v0.6.2 --output FastTransforms.tar.gz\n % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n100 168k 0 168k 0 0 442k 0 --:--:-- --:--:-- --:--:-- 443k\n\njulia> using SHA\n\njulia> open(\"FastTransforms.tar.gz\") do f\n bytes2hex(sha256(f))\n end\n\"fd00befcb0c20ba962a8744a7b9139355071ee95be70420de005b7c0f6e023aa\"\n\nshell> rm -f FastTransforms.tar.gz\n","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"Then we wait for the friendly folks at JuliaPackaging to merge the pull request to Yggdrasil, triggering a new release of the FastTransforms_jll.jl meta package that stores all precompiled binaries. With this release, we update the FastTransforms.jl Project.toml to point to the latest release and register the new version.","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"Since development of Yggdrasil is quite rapid, a fork may easily become stale. Git permits the developer to forcibly make a master branch on a fork even with upstream master:","category":"page"},{"location":"dev/#","page":"Development","title":"Development","text":"git fetch upstream\ngit checkout master\ngit reset --hard upstream/master\ngit push origin master --force","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/halfrange.jl\"","category":"page"},{"location":"generated/halfrange/#Half-range-Chebyshev-polynomials-1","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"","category":"section"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"In this paper, Daan Huybrechs introduced the so-called half-range Chebyshev polynomials as the semi-classical orthogonal polynomials with respect to the inner product:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"langle f g rangle = int_0^1 f(x) g(x)fracrm d xsqrt1-x^2","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"By the variable transformation y = 2x-1, the resulting polynomials can be related to orthogonal polynomials on (-11) with the Jacobi weight (1-y)^-frac12 modified by the weight (3+y)^-frac12.","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"We shall use the fact that:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"frac1sqrt3+y = sqrtfrac23+sqrt8sum_n=0^infty P_n(y) left(frac-13+sqrt8right)^n","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"and results from this paper to consider the half-range Chebyshev polynomials as modifications of the Jacobi polynomials P_n^(-frac120)(y).","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"using FastTransforms, LinearAlgebra, Plots, LaTeXStrings\nconst GENFIGS = joinpath(pkgdir(FastTransforms), \"docs/src/generated\")\n!isdir(GENFIGS) && mkdir(GENFIGS)\nplotlyjs()","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"Plots.PlotlyJSBackend()","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"We truncate the generating function to ensure a relative error less than eps() in the uniform norm on (-11):","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"z = -1/(3+sqrt(8))\nK = sqrt(-2z)\nN = ceil(Int, log(abs(z), eps()/2*(1-abs(z))/K) - 1)\nd = K .* z .^(0:N)","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"21-element Vector{Float64}:\n 0.585786437626905\n -0.10050506338833466\n 0.017243942703102998\n -0.0029585928302833363\n 0.0005076142785970194\n -8.70928412987791e-5\n 1.4942769195655289e-5\n -2.563773875152638e-6\n 4.3987405526054037e-7\n -7.547045641060418e-8\n 1.2948683203084688e-8\n -2.221642807903953e-9\n 3.8117364433902886e-10\n -6.53990581302203e-11\n 1.122070444229295e-11\n -1.925168523537399e-12\n 3.303066989314436e-13\n -5.6671670051262317e-14\n 9.723321376130305e-15\n -1.6682582055195078e-15\n 2.862278569867433e-16","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"Then, we convert this representation to the expansion in Jacobi polynomials P_n^(-frac12 0)(y):","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"u = jac2jac(d, 0.0, 0.0, -0.5, 0.0; norm1 = false, norm2 = true)","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"21-element Vector{Float64}:\n 0.9340010840223151\n -0.09412895357801879\n 0.012332003442981326\n -0.0017749924171044493\n 0.00026739546832682813\n -4.137724994351243e-5\n 6.516867953544994e-6\n -1.0393137552650633e-6\n 1.673019401749671e-7\n -2.7126077156467505e-8\n 4.423525597533419e-9\n -7.247452797834485e-10\n 1.1920483520702293e-10\n -1.9671182646957104e-11\n 3.2552876283504113e-12\n -5.400110170678753e-13\n 8.977555063800248e-14\n -1.4948797757615094e-14\n 2.4980123321513196e-15\n -4.125155260660654e-16\n 7.540496818753807e-17","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"Our working polynomial degree will be:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"n = 100","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"100","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"We compute the connection coefficients between the modified orthogonal polynomials and the Jacobi polynomials:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"P = plan_modifiedjac2jac(Float64, n+1, -0.5, 0.0, u)","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"FastTransforms Modified Jacobi--Jacobi plan for 101-element array of Float64","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"We store the connection to first kind Chebyshev polynomials:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"P1 = plan_jac2cheb(Float64, n+1, -0.5, 0.0; normjac = true)","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"FastTransforms Jacobi--Chebyshev plan for 101-element array of Float64","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"We compute the Chebyshev series for the degree-kle n modified polynomial and its values at the Chebyshev points:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"q = k -> lmul!(P1, lmul!(P, [zeros(k); 1.0; zeros(n-k)]))\nqvals = k-> ichebyshevtransform(q(k))","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"#3 (generic function with 1 method)","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"With the symmetric Jacobi matrix for P_n^(-frac12 0)(y) and the modified plan, we may compute the modified Jacobi matrix and the corresponding roots (as eigenvalues):","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"XP = SymTridiagonal([-inv((4n-1)*(4n-5)) for n in 1:n+1], [4n*(2n-1)/(4n-1)/sqrt((4n-3)*(4n+1)) for n in 1:n])\nXQ = FastTransforms.modified_jacobi_matrix(P, XP)\nSymTridiagonal(XQ.dv[1:10], XQ.ev[1:9])","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"10×10 LinearAlgebra.SymTridiagonal{Float64, Vector{Float64}}:\n 0.27324 0.615517 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ \n 0.615517 -0.0327708 0.509195 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ 0.509195 -0.0115134 0.50391 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ 0.50391 -0.00564494 0.502131 ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ 0.502131 -0.00333235 0.501338 ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ 0.501338 -0.00219677 0.500918 ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ 0.500918 -0.00155663 0.500668 ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.500668 -0.00116057 0.500509 ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.500509 -0.000898551 0.5004\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.5004 -0.000716244","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"And we plot:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"x = (chebyshevpoints(Float64, n+1, Val(1)) .+ 1 ) ./ 2\np = plot(x, qvals(0); linewidth=2.0, legend = false, xlim=(0,1), xlabel=L\"x\",\n ylabel=L\"T^h_n(x)\", title=\"Half-Range Chebyshev Polynomials and Their Roots\",\n extra_plot_kwargs = KW(:include_mathjax => \"cdn\"))\nfor k in 1:10\n λ = (eigvals(SymTridiagonal(XQ.dv[1:k], XQ.ev[1:k-1])) .+ 1) ./ 2\n plot!(x, qvals(k); linewidth=2.0, color=palette(:default)[k+1])\n scatter!(λ, zero(λ); markersize=2.5, color=palette(:default)[k+1])\nend\np\nsavefig(joinpath(GENFIGS, \"halfrange.html\"))","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/halfrange.html\"","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"By Theorem 2.20 it turns out that the derivatives of the half-range Chebyshev polynomials are a linear combination of at most two polynomials orthogonal with respect to sqrt(3+y)(1-y)(1+y) on (-11). This fact enables us to compute the banded differentiation matrix:","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"v̂ = 3*[u; 0]+XP[1:N+2, 1:N+1]*u\nv = jac2jac(v̂, -0.5, 0.0, 0.5, 1.0; norm1 = true, norm2 = true)\nfunction threshold!(A::AbstractArray, ϵ)\n for i in eachindex(A)\n if abs(A[i]) < ϵ A[i] = 0 end\n end\n A\nend\nP′ = plan_modifiedjac2jac(Float64, n+1, 0.5, 1.0, v)\nDP = UpperTriangular(diagm(1=>[sqrt(n*(n+1/2)) for n in 1:n])) # The classical differentiation matrix representing 𝒟 P^{(-1/2,0)}(y) = P^{(1/2,1)}(y) D_P.\nDQ = UpperTriangular(threshold!(P′\\(DP*(P*I)), 100eps())) # The semi-classical differentiation matrix representing 𝒟 Q(y) = Q̂(y) D_Q.\nUpperTriangular(DQ[1:10,1:10])","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"10×10 LinearAlgebra.UpperTriangular{Float64, Matrix{Float64}}:\n 0.0 2.11682 0.481094 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n ⋅ 0.0 3.82901 0.789619 0.0 0.0 0.0 0.0 0.0 0.0\n ⋅ ⋅ 0.0 5.53918 1.08781 0.0 0.0 0.0 0.0 0.0\n ⋅ ⋅ ⋅ 0.0 7.24821 1.38334 0.0 0.0 0.0 0.0\n ⋅ ⋅ ⋅ ⋅ 0.0 8.95658 1.67782 0.0 0.0 0.0\n ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 10.6646 1.97177 0.0 0.0\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 12.3723 2.26542 0.0\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 14.0799 2.55888\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 15.7874\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"","category":"page"},{"location":"generated/halfrange/#","page":"Half-range Chebyshev polynomials","title":"Half-range Chebyshev polynomials","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/sphere.jl\"","category":"page"},{"location":"generated/sphere/#Spherical-harmonic-addition-theorem-1","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"","category":"section"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"This example confirms numerically that","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"f(z) = fracP_n(zcdot y) - P_n(xcdot y)zcdot y - xcdot y","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"is actually a degree-(n-1) polynomial on mathbbS^2, where P_n is the degree-n Legendre polynomial, and xyz in mathbbS^2. To verify, we sample the function on a Ntimes M equiangular grid defined by:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"beginaligned\ntheta_n = (n+tfrac12)piNquadrm forquad 0le n Nquadrm and\nvarphi_m = 2pi mMquadrm forquad 0le m M\nendaligned","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"we convert the function samples to Fourier coefficients using plan_sph_analysis; and finally, we transform the Fourier coefficients to spherical harmonic coefficients using plan_sph2fourier.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"In the basis of spherical harmonics, it is plain to see the addition theorem in action, since P_n(xcdot y) should only consist of exact-degree-n harmonics.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"For the storage pattern of the arrays, please consult the documentation.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"function threshold!(A::AbstractArray, ϵ)\n for i in eachindex(A)\n if abs(A[i]) < ϵ A[i] = 0 end\n end\n A\nend\n\nusing FastTransforms, LinearAlgebra, Plots\nconst GENFIGS = joinpath(pkgdir(FastTransforms), \"docs/src/generated\")\n!isdir(GENFIGS) && mkdir(GENFIGS)\nplotlyjs()","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Plots.PlotlyJSBackend()","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"The colatitudinal grid (mod pi):","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"N = 15\nθ = (0.5:N-0.5)/N","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"0.03333333333333333:0.06666666666666667:0.9666666666666667","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"The longitudinal grid (mod pi):","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"M = 2*N-1\nφ = (0:M-1)*2/M","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"0.0:0.06896551724137931:1.9310344827586206","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Arbitrarily, we place x at the North pole:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"x = [0,0,1]","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"3-element Vector{Int64}:\n 0\n 0\n 1","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Another vector is completely free:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"y = normalize([.123,.456,.789])","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"3-element Vector{Float64}:\n 0.13375998748853216\n 0.4958906853233388\n 0.8580213831581455","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Thus z in mathbbS^2 is our variable vector, parameterized in spherical coordinates:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"z = (θ,φ) -> [sinpi(θ)*cospi(φ), sinpi(θ)*sinpi(φ), cospi(θ)]","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"#1 (generic function with 1 method)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"On the tensor product grid, the Legendre polynomial P_n(zcdot y) is:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"A = [(2k+1)/(k+1) for k in 0:N-1]\nB = zeros(N)\nC = [k/(k+1) for k in 0:N]\nc = zeros(N); c[N] = 1\npts = vec([z(θ, φ)⋅y for θ in θ, φ in φ])\nphi0 = ones(N*M)\nF = reshape(FastTransforms.clenshaw!(c, A, B, C, pts, phi0, zeros(N*M)), N, M)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"15×29 Matrix{Float64}:\n 0.264259 0.299171 0.304985 0.288068 0.261038 0.237692 0.228241 0.236528 0.259192 0.286391 0.304437 0.300462 0.26755 0.207601 0.130208 0.0483744 -0.0262845 -0.0865116 -0.129804 -0.156955 -0.169985 -0.170403 -0.158265 -0.132139 -0.0899937 -0.0308858 0.0429655 0.124641 0.202756\n 0.212068 0.303332 0.129215 -0.186607 -0.387155 -0.383993 -0.338172 -0.379747 -0.392602 -0.206438 0.109443 0.299961 0.225231 -0.0101802 -0.207053 -0.258628 -0.187516 -0.070652 0.0323131 0.0988479 0.12977 0.130741 0.102005 0.0380582 -0.0627707 -0.180155 -0.256899 -0.215501 -0.0267606\n -0.115553 0.236712 0.221776 -0.251073 -0.32857 0.421619 0.986223 0.482429 -0.299585 -0.280602 0.198511 0.253762 -0.0930651 -0.258938 -0.0793421 0.160653 0.233501 0.154045 0.0336174 -0.0560314 -0.0990238 -0.100375 -0.0604041 0.0261339 0.145985 0.231751 0.1719 -0.0610864 -0.255787\n -0.18454 -0.186901 0.216999 0.207436 -0.278408 -0.36511 -0.189358 -0.35156 -0.304334 0.180746 0.238643 -0.165767 -0.202157 0.128252 0.217098 -0.00943667 -0.200512 -0.194373 -0.0821865 0.0208264 0.0732008 0.0748654 0.0260895 -0.074028 -0.188494 -0.206184 -0.027257 0.20837 0.147067\n 0.233218 -0.0443128 -0.25662 0.0443223 0.302577 0.209245 0.107407 0.198264 0.305263 0.0716125 -0.25045 -0.0709297 0.228915 0.0560634 -0.209167 -0.109098 0.135993 0.209367 0.121014 0.0107106 -0.049922 -0.0518826 0.00472316 0.112882 0.206906 0.148044 -0.0921222 -0.214775 0.0327421\n -0.14959 0.176398 0.159536 -0.157586 -0.253853 -0.135785 -0.0630475 -0.127292 -0.249419 -0.174706 0.141057 0.191837 -0.130845 -0.171771 0.128955 0.181407 -0.058914 -0.206946 -0.154207 -0.0410986 0.0276329 0.029906 -0.034464 -0.146673 -0.208687 -0.0754426 0.17029 0.145612 -0.156134\n 0.03232 -0.216991 -0.0542418 0.201432 0.206916 0.0892457 0.0316764 0.0822717 0.200041 0.210302 -0.0334057 -0.219505 0.00906962 0.211107 -0.0222883 -0.209099 -0.0231776 0.189332 0.183999 0.0724419 -0.00503206 -0.00766855 0.065182 0.177672 0.19593 -0.0044746 -0.206821 -0.0443208 0.20777\n 0.0772106 0.200813 -0.0345837 -0.214416 -0.166372 -0.0543381 -0.0063074 -0.0483886 -0.158601 -0.217382 -0.0533452 0.193042 0.0976693 -0.187906 -0.085199 0.193101 0.105896 -0.154519 -0.211246 -0.107108 -0.019323 -0.0162213 -0.09921 -0.206977 -0.166608 0.0879047 0.201099 -0.0639311 -0.196895\n -0.161616 -0.14919 0.105731 0.2116 0.130202 0.0251362 -0.0160611 0.0199531 0.122174 0.210305 0.12046 -0.134582 -0.17451 0.114917 0.174042 -0.130385 -0.182374 0.0957622 0.234753 0.148573 0.0475436 0.0437788 0.140028 0.233975 0.113813 -0.1691 -0.148371 0.159712 0.133414\n 0.208908 0.0728989 -0.161008 -0.198486 -0.0961065 0.00135321 0.037119 0.00590617 -0.0881639 -0.194067 -0.170766 0.0549875 0.211431 -0.00338118 -0.21986 0.016122 0.234375 0.00021735 -0.247537 -0.203094 -0.0836434 -0.0787903 -0.19406 -0.253043 -0.023216 0.231655 0.0407554 -0.218225 -0.0261102\n -0.203495 0.0220031 0.200371 0.176174 0.0619327 -0.0270702 -0.058089 -0.0310551 0.0543296 0.169516 0.204695 0.0395021 -0.194934 -0.128043 0.183785 0.141369 -0.211961 -0.150004 0.2205 0.283345 0.137864 0.130789 0.275142 0.23809 -0.126501 -0.226893 0.11958 0.198142 -0.109095\n 0.12233 -0.127714 -0.219526 -0.142772 -0.0253159 0.0536809 0.080125 0.0571016 -0.0183211 -0.134724 -0.218347 -0.140698 0.10537 0.230635 -0.0169741 -0.260275 0.00868827 0.306062 -0.0323035 -0.400665 -0.252906 -0.23893 -0.40434 -0.0688019 0.303902 0.0393269 -0.259455 -0.0416906 0.225524\n 0.0533261 0.221676 0.20588 0.0928744 -0.0169863 -0.083121 -0.10464 -0.0859165 -0.0229991 0.0845139 0.199903 0.226054 0.0700661 -0.185075 -0.235303 0.0671548 0.306034 0.0030983 -0.399433 -0.020757 0.815719 0.855083 0.0350084 -0.404293 -0.0323252 0.304047 0.0929697 -0.224541 -0.198835\n -0.251975 -0.233798 -0.13019 -0.0152352 0.0703864 0.11835 0.133806 0.120358 0.0748091 -0.00825682 -0.122061 -0.22853 -0.255028 -0.136944 0.097903 0.288106 0.247787 -0.0273998 -0.313828 -0.4047 -0.353264 -0.349855 -0.403561 -0.327222 -0.0497156 0.234981 0.294129 0.11465 -0.123547\n 0.0890404 0.00957584 -0.0584588 -0.110278 -0.145276 -0.165114 -0.171728 -0.165964 -0.14708 -0.113177 -0.062519 0.00451035 0.0834519 0.16497 0.23634 0.285407 0.305513 0.298672 0.274919 0.248139 0.230823 0.230209 0.246547 0.273036 0.297446 0.305825 0.287718 0.240496 0.170292","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"X = [sinpi(θ)*cospi(φ) for θ in θ, φ in φ]\nY = [sinpi(θ)*sinpi(φ) for θ in θ, φ in φ]\nZ = [cospi(θ) for θ in θ, φ in φ]\nscatter3d(vec(X), vec(Y), vec(Z); markersize=1.25, markercolor=:violetred)\nsurface!(X, Y, Z; surfacecolor=F, legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"sphere1.html\"))","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/sphere1.html\"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"We show the cut in the surface to help illustrate the definition of the grid. In particular, we do not sample the poles.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"We precompute a spherical harmonic–Fourier plan:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"P = plan_sph2fourier(F)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"FastTransforms Spherical harmonic--Fourier plan for 15×29-element array of Float64","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"And an FFTW Fourier analysis plan on mathbbS^2:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"PA = plan_sph_analysis(F)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"FastTransforms plan for FFTW Fourier analysis on the sphere for 15×29-element array of Float64","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Its spherical harmonic coefficients demonstrate that it is exact-degree-n:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"V = PA*F\nU = threshold!(P\\V, 400*eps())","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"15×29 Matrix{Float64}:\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -1.66397e-5 2.73274e-5\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.000271538 -7.91038e-5 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.29805e-5 -0.00164832 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.00703526 -0.00174747 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0122275 0.0220184 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.0503776 0.0488881 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.134224 -0.0799001 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0729185 -0.259962 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.337609 0.00337719 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0610941 0.235853 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0289877 -0.0164793 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.190197 0.192109 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 -0.0788841 0.135585 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.188313 0.0507949 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.142187 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"The L^2(mathbbS^2) norm of the function is:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"nrm1 = norm(U)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"0.6582728344942347","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Similarly, on the tensor product grid, our function samples are:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Pnxy = FastTransforms.clenshaw!(c, A, B, C, [x⋅y], [1.0], [0.0])[1]\nF = [(F[n, m] - Pnxy)/(z(θ[n], φ[m])⋅y - x⋅y) for n in 1:N, m in 1:M]","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"15×29 Matrix{Float64}:\n 5.19948 4.13834 2.99067 1.90658 1.02691 0.455272 0.249877 0.429314 0.977414 1.83893 2.91328 4.06148 5.13287 6.0026 6.60156 6.92544 7.02254 6.96965 6.84793 6.72603 6.65164 6.64905 6.71906 6.83899 6.96269 7.02276 6.93845 6.63197 6.05227\n 5.95491 2.78879 -1.44975 -4.81316 -5.93907 -5.32122 -4.74802 -5.26014 -5.93537 -4.96628 -1.72861 2.51536 5.80241 7.01649 6.35996 4.76275 3.10172 1.83264 1.03553 0.610092 0.43191 0.426508 0.591355 0.996377 1.76414 3.00054 4.64424 6.26964 7.0226\n 6.89687 5.65236 0.11585 -5.28724 -4.64181 1.51819 5.42995 1.95544 -4.33608 -5.4796 -0.331651 5.39124 6.95616 4.78949 1.90996 0.265776 -0.0679633 0.206459 0.546026 0.760489 0.851318 0.854026 0.770114 0.565133 0.231314 -0.0604333 0.208258 1.74968 4.58324\n 3.06027 6.5357 5.89997 -0.165743 -5.46592 -5.06636 -3.28816 -4.90175 -5.62054 -0.644121 5.6253 6.677 3.31846 0.440384 -0.00401181 0.652985 1.01303 0.876591 0.580633 0.35795 0.254199 0.250991 0.347269 0.561893 0.857659 1.01648 0.69514 0.0273999 0.337402\n -0.070137 1.60923 5.43093 6.93528 3.91137 -0.131309 -1.75656 -0.336142 3.61343 6.85843 5.66343 1.83509 -0.053904 0.487406 1.01741 0.644213 0.136921 0.0101545 0.134135 0.275013 0.346961 0.349218 0.282296 0.144972 0.0138328 0.115298 0.603776 1.01615 0.548272\n 0.945078 0.135483 0.27158 2.71505 5.55048 6.82449 7.00499 6.85725 5.69314 2.92844 0.369819 0.0844295 0.912316 0.807551 0.149683 0.0509116 0.357273 0.499174 0.407141 0.269902 0.193177 0.1907 0.262329 0.397299 0.498435 0.37596 0.0666419 0.119637 0.764012\n 0.3347 0.96741 0.756526 0.0516758 0.0403323 0.667862 1.0399 0.710559 0.0718486 0.0205398 0.70939 0.987443 0.382027 0.0075432 0.314675 0.493074 0.249535 0.0255986 0.0288774 0.124344 0.187529 0.189637 0.130366 0.0344678 0.0191719 0.228563 0.486554 0.340488 0.0125441\n 0.19163 0.0244645 0.474228 0.953439 0.971777 0.756739 0.645454 0.743468 0.95977 0.969839 0.515354 0.0373859 0.165042 0.488731 0.32132 0.0219213 0.0963195 0.301654 0.329627 0.240493 0.171995 0.169627 0.234193 0.325354 0.310183 0.111448 0.0141702 0.296273 0.495085\n 0.41699 0.454012 0.154439 0.00689009 0.147415 0.349199 0.434542 0.359728 0.162073 0.00898106 0.134876 0.43942 0.434649 0.100528 0.0376636 0.284172 0.302882 0.085971 -0.0128005 0.0446154 0.109712 0.112106 0.0501911 -0.0122374 0.0727995 0.291434 0.297253 0.0501979 0.0815347\n 0.00653828 0.144506 0.416175 0.496049 0.398793 0.286378 0.242449 0.28086 0.390091 0.493228 0.429442 0.163601 0.00423886 0.186207 0.340647 0.145106 -0.0125214 0.139641 0.288402 0.253913 0.179097 0.176118 0.248108 0.291182 0.154331 -0.0106262 0.126633 0.337571 0.204303\n 0.334489 0.165749 0.014265 0.0385386 0.156172 0.253936 0.289478 0.258454 0.164306 0.0451436 0.010362 0.151498 0.32921 0.257363 0.0225829 0.0493168 0.268651 0.220231 -0.0026208 -0.0383697 0.0440181 0.047986 -0.0336588 -0.0128432 0.205569 0.277144 0.0634765 0.012466 0.242082\n 0.0666146 0.257095 0.341563 0.293211 0.203674 0.139862 0.117949 0.137043 0.198126 0.287354 0.341672 0.267702 0.0789497 -0.00992474 0.150427 0.293905 0.12293 -0.051658 0.138809 0.33873 0.255252 0.247571 0.340446 0.15898 -0.0503184 0.104503 0.292551 0.165851 -0.00643622\n 0.106032 -0.00382806 0.00704658 0.088086 0.17021 0.221457 0.238521 0.223661 0.174806 0.0942214 0.0112304 -0.00679647 0.0953468 0.252997 0.275056 0.0878466 -0.0516354 0.119191 0.338121 0.128404 -0.323093 -0.344224 0.0980961 0.340427 0.138821 -0.0504052 0.0724608 0.267888 0.261055\n 0.286625 0.280994 0.220196 0.149338 0.0951419 0.0642734 0.0542416 0.0629728 0.0923113 0.144964 0.215269 0.278062 0.288893 0.21207 0.0695276 -0.0416382 -0.0180382 0.136094 0.292814 0.340282 0.310784 0.308881 0.339519 0.300016 0.148439 -0.0107592 -0.0450601 0.0595874 0.203734\n 0.0747987 0.122395 0.163672 0.195512 0.217272 0.229726 0.233902 0.230262 0.2184 0.197306 0.166153 0.125451 0.0781262 0.0298766 -0.0118277 -0.0400996 -0.0514099 -0.0472393 -0.0335309 -0.0182388 -0.00839924 -0.0080514 -0.0173325 -0.0324517 -0.0465243 -0.0515701 -0.0414172 -0.0142377 0.0267486","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"scatter3d(vec(X), vec(Y), vec(Z); markersize=1.25, markercolor=:violetred)\nsurface!(X, Y, Z; surfacecolor=F, legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"sphere2.html\"))","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/sphere2.html\"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Its spherical harmonic coefficients demonstrate that it is degree-(n-1):","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"V = PA*F\nU = threshold!(P\\V, 400*eps())","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"15×29 Matrix{Float64}:\n 2.07907 0.87453 0.235893 0.069594 -0.119618 0.0581001 0.0586842 0.0859934 -0.0488866 -0.015775 -0.060899 -0.0291623 -0.000291717 -0.00253358 0.00903247 0.000694039 0.000413142 -0.00117608 0.0011413 0.000780662 0.00140576 0.000942806 -0.000234181 8.63587e-6 -0.00043161 -0.000121732 -3.54626e-5 0.0 0.0\n 1.51317 0.44642 0.120416 -0.169934 0.292081 0.328839 0.332145 0.288911 -0.164244 -0.0423205 -0.163378 -0.0586349 -0.000586539 -0.00145765 0.00519666 -0.00998075 -0.00594126 -0.00862106 0.00836616 0.00369554 0.00665466 0.00342882 -0.000851678 2.16057e-5 -0.00107982 0.0 0.0 0.0 0.0\n 0.36606 -0.627659 -0.169303 -0.592046 1.0176 0.703541 0.710614 0.503834 -0.286426 -0.056082 -0.216504 -0.0224552 -0.000224625 0.0140577 -0.0501173 -0.0493515 -0.0293776 -0.0276576 0.0268398 0.00914327 0.0164645 0.00585456 -0.0014542 0.0 0.0 0.0 0.0 0.0 0.0\n -0.225238 -1.3923 -0.375555 -0.884141 1.51965 0.893241 0.902221 0.498016 -0.283118 -0.0162747 -0.0628284 0.165928 0.00165982 0.0536982 -0.191439 -0.123087 -0.0732701 -0.0534663 0.0518855 0.0122482 0.0220556 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0279478 -1.24976 -0.337105 -0.80053 1.37594 0.669715 0.676448 0.113165 -0.0643333 0.096013 0.370657 0.512707 0.00512874 0.109365 -0.389897 -0.195697 -0.116493 -0.0592355 0.0574841 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.642706 -0.460978 -0.124343 -0.408306 0.701792 0.115506 0.116667 -0.53107 0.30191 0.2422 0.935011 0.866631 0.00866913 0.145962 -0.520371 -0.183527 -0.109249 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.924445 0.171516 0.0462641 -0.0394459 0.0677993 -0.395183 -0.399156 -1.05835 0.601662 0.335991 1.29709 0.970497 0.00970813 0.116526 -0.415426 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.619857 0.0934262 0.0252005 0.0128822 -0.0221418 -0.505099 -0.510177 -1.1197 0.636541 0.30573 1.18027 0.65018 0.00650392 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0816312 -0.512221 -0.138165 -0.239451 0.411566 -0.194804 -0.196763 -0.706203 0.401471 0.16128 0.622619 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n -0.15003 -0.975789 -0.263206 -0.507765 0.872741 0.197111 0.199092 -0.186337 0.105931 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.105958 -0.834521 -0.225101 -0.515565 0.886148 0.287159 0.290046 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.530802 -0.266039 -0.0717606 -0.261012 0.448626 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.668154 0.140073 0.0377829 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.390394 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Finally, the Legendre polynomial P_n(zcdot x) is aligned with the grid:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"pts = vec([z(θ, φ)⋅x for θ in θ, φ in φ])\nF = reshape(FastTransforms.clenshaw!(c, A, B, C, pts, phi0, zeros(N*M)), N, M)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"15×29 Matrix{Float64}:\n 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808\n -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968\n 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489\n -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835\n 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901\n -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532\n 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677\n -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473 -0.209473\n 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677 0.210677\n -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532 -0.214532\n 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901 0.221901\n -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835 -0.234835\n 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489 0.258489\n -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968 -0.30968\n 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808 0.501808","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"We superpose a surface plot of f on top of the grid:","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"scatter3d(vec(X), vec(Y), vec(Z); markersize=1.25, markercolor=:violetred)\nsurface!(X, Y, Z; surfacecolor=F, legend=false, xlabel=\"x\", ylabel=\"y\", zlabel=\"f\")\nsavefig(joinpath(GENFIGS, \"sphere3.html\"))","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/sphere3.html\"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"It only has one nonnegligible spherical harmonic coefficient. Can you spot it?","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"V = PA*F\nU = threshold!(P\\V, 400*eps())","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"15×29 Matrix{Float64}:\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 0.658273 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"That nonnegligible coefficient should be","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"ret = eval(\"√(2π/($(N-1)+1/2))\")","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"\"√(2π/(14+1/2))\"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"which is approximately","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"eval(Meta.parse(ret))","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"0.6582728344942353","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"since the convention in this library is to orthonormalize.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"nrm2 = norm(U)","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"0.6582728344942352","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"Note that the integrals of both functions P_n(zcdot y) and P_n(zcdot x) and their L^2(mathbbS^2) norms are the same because of rotational invariance. The integral of either is perhaps not interesting as it is mathematically zero, but the norms of either should be approximately the same.","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"nrm1 ≈ nrm2","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"true","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"","category":"page"},{"location":"generated/sphere/#","page":"Spherical harmonic addition theorem","title":"Spherical harmonic addition theorem","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/automaticdifferentiation.jl\"","category":"page"},{"location":"generated/automaticdifferentiation/#Automatic-differentiation-through-spherical-harmonic-transforms-1","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"","category":"section"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"This example finds a positive value of lambda in:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"f(r) = sinlambda (kcdot r)","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"for some krinmathbbS^2 such that int_mathbbS^2 f^2 rmdOmega = 1. We do this by using derivative information through:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"dfracpartial fpartial lambda = (kcdot r) coslambda (kcdot r)","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"using FastTransforms, LinearAlgebra","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"The colatitudinal grid (mod pi):","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"N = 15\nθ = (0.5:N-0.5)/N","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"0.03333333333333333:0.06666666666666667:0.9666666666666667","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"The longitudinal grid (mod pi):","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"M = 2*N-1\nφ = (0:M-1)*2/M","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"0.0:0.06896551724137931:1.9310344827586206","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"We precompute a spherical harmonic–Fourier plan:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"P = plan_sph2fourier(Float64, N)","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"FastTransforms Spherical harmonic--Fourier plan for 15×29-element array of Float64","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"And an FFTW Fourier analysis plan on mathbbS^2:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"PA = plan_sph_analysis(Float64, N, M)","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"FastTransforms plan for FFTW Fourier analysis on the sphere for 15×29-element array of Float64","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"Our choice of k and angular parametrization of r:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"k = [2/7, 3/7, 6/7]\nr = (θ,φ) -> [sinpi(θ)*cospi(φ), sinpi(θ)*sinpi(φ), cospi(θ)]","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"#1 (generic function with 1 method)","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"Our initial guess for lambda:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"λ = 1.0","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"1.0","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"Then we run Newton iteration and grab an espresso:","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"for _ in 1:7\n F = [sin(λ*(k⋅r(θ,φ))) for θ in θ, φ in φ]\n Fλ = [(k⋅r(θ,φ))*cos(λ*(k⋅r(θ,φ))) for θ in θ, φ in φ]\n U = P\\(PA*F)\n Uλ = P\\(PA*Fλ)\n global λ = λ - (norm(U)^2-1)/(2*sum(U.*Uλ))\n println(\"λ: $(rpad(λ, 18)) and the 2-norm: $(rpad(norm(U), 18))\")\nend","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"λ: 0.5565017029393282 and the 2-norm: 1.8510924318185522\nλ: 0.5031571262839712 and the 2-norm: 1.104184591487036 \nλ: 0.5010418434316171 and the 2-norm: 1.0040147091934828\nλ: 0.5010383094266806 and the 2-norm: 1.000006698425886 \nλ: 0.5010383094167955 and the 2-norm: 1.0000000000187363\nλ: 0.5010383094167954 and the 2-norm: 1.0000000000000002\nλ: 0.5010383094167955 and the 2-norm: 0.9999999999999999\n","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"","category":"page"},{"location":"generated/automaticdifferentiation/#","page":"Automatic differentiation through spherical harmonic transforms","title":"Automatic differentiation through spherical harmonic transforms","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/padua.jl\"","category":"page"},{"location":"generated/padua/#Padua-transform-1","page":"Padua transform","title":"Padua transform","text":"","category":"section"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"This demonstrates the Padua transform and inverse transform, explaining precisely the normalization and points","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"using FastTransforms","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"We define the Padua points and extract Cartesian components:","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"N = 15\npts = paduapoints(N)\nx = pts[:,1]\ny = pts[:,2];\nnothing #hide","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"We take the Padua transform of the function:","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"f = (x,y) -> exp(x + cos(y))\nf̌ = paduatransform(f.(x , y));\nnothing #hide","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"and use the coefficients to create an approximation to the function f:","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"f̃ = (x,y) -> begin\n j = 1\n ret = 0.0\n for n in 0:N, k in 0:n\n ret += f̌[j]*cos((n-k)*acos(x)) * cos(k*acos(y))\n j += 1\n end\n ret\nend","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"#3 (generic function with 1 method)","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"At a particular point, is the function well-approximated?","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"f̃(0.1,0.2) ≈ f(0.1,0.2)","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"true","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"Does the inverse transform bring us back to the grid?","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"ipaduatransform(f̌) ≈ f̃.(x,y)","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"true","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"","category":"page"},{"location":"generated/padua/#","page":"Padua transform","title":"Padua transform","text":"This page was generated using Literate.jl.","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"EditURL = \"https://github.com/JuliaApproximation/FastTransforms.jl/blob/master/examples/semiclassical.jl\"","category":"page"},{"location":"generated/semiclassical/#Semi-classical-Jacobi-polynomials-1","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"","category":"section"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"In this example, we will consider the semi-classical orthogonal polynomials with respect to the inner product:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"langle f g rangle = int_-1^1 f(x) g(x) w(x)rm d x","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"where w(x) = w^(alphabetagammadeltaepsilon)(x) = (1-x)^alpha(1+x)^beta(2+x)^gamma(3+x)^delta(5-x)^epsilon is a modification of the Jacobi weight. We shall use results from this paper to consider these semi-classical orthogonal polynomials as modifications of the orthonormalized Jacobi polynomials tildeP_n^(alphabeta)(x).","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"using ApproxFun, FastTransforms, LazyArrays, LinearAlgebra, Plots, LaTeXStrings\nconst GENFIGS = joinpath(pkgdir(FastTransforms), \"docs/src/generated\")\n!isdir(GENFIGS) && mkdir(GENFIGS)\nplotlyjs()","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"Plots.PlotlyJSBackend()","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"We set the five parameters:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"α,β,γ,δ,ϵ = -0.125, -0.25, 0.123, 0.456, 0.789","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"(-0.125, -0.25, 0.123, 0.456, 0.789)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"We use ApproxFun to construct a finite normalized Jacobi series as a proxy for (2+x)^gamma(3+x)^delta(5-x)^epsilon.","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"u = Fun(x->(2+x)^γ*(3+x)^δ*(5-x)^ϵ, NormalizedJacobi(β, α))","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"Fun(NormalizedJacobi(-0.25,-0.125), [9.44307, 0.378961, -0.175993, 0.00993571, -0.00159705, 0.000269325, -5.50832e-5, 1.18886e-5, -2.70741e-6, 6.33251e-7, -1.51159e-7, 3.65681e-8, -8.93731e-9, 2.2014e-9, -5.45681e-10, 1.35976e-10, -3.40364e-11, 8.55277e-12, -2.15663e-12, 5.45371e-13, -1.38184e-13, 3.50987e-14, -8.6989e-15, 2.26453e-15, -6.27902e-16])","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"Our working polynomial degree will be:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"n = 100","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"100","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"We compute the connection coefficients between the modified orthogonal polynomials and the Jacobi polynomials:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"P = plan_modifiedjac2jac(Float64, n+1, α, β, u.coefficients)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"FastTransforms Modified Jacobi--Jacobi plan for 101-element array of Float64","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"We store the connection to first kind Chebyshev polynomials:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"P1 = plan_jac2cheb(Float64, n+1, α, β; normjac = true)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"FastTransforms Jacobi--Chebyshev plan for 101-element array of Float64","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"We compute the Chebyshev series for the degree-kle n modified polynomial and its values at the Chebyshev points:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"q = k -> lmul!(P1, lmul!(P, [zeros(k); 1.0; zeros(n-k)]))\nqvals = k -> ichebyshevtransform(q(k))","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"#5 (generic function with 1 method)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"With the symmetric Jacobi matrix for tildeP_n^(alpha beta)(x) and the modified plan, we may compute the modified Jacobi matrix and the corresponding roots (as eigenvalues):","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"x = Fun(x->x, NormalizedJacobi(β, α))\nXP = SymTridiagonal(Symmetric(Multiplication(x, space(x))[1:n+1, 1:n+1]))\nXQ = FastTransforms.modified_jacobi_matrix(P, XP)\nview(XQ, 1:7, 1:7)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"7×7 view(::LinearAlgebra.SymTridiagonal{Float64, Vector{Float64}}, 1:7, 1:7) with eltype Float64:\n -0.052227 0.611763 ⋅ ⋅ ⋅ ⋅ ⋅ \n 0.611763 0.000494468 0.518899 ⋅ ⋅ ⋅ ⋅ \n ⋅ 0.518899 0.00129929 0.507083 ⋅ ⋅ ⋅ \n ⋅ ⋅ 0.507083 0.000851746 0.503749 ⋅ ⋅ \n ⋅ ⋅ ⋅ 0.503749 0.000542956 0.502328 ⋅ \n ⋅ ⋅ ⋅ ⋅ 0.502328 0.00037014 0.501587\n ⋅ ⋅ ⋅ ⋅ ⋅ 0.501587 0.000267516","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"And we plot:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"x = chebyshevpoints(Float64, n+1, Val(1))\np = plot(x, qvals(0); linewidth=2.0, legend = false, xlim=(-1,1), xlabel=L\"x\",\n ylabel=L\"Q_n(x)\", title=\"Semi-classical Jacobi Polynomials and Their Roots\",\n extra_plot_kwargs = KW(:include_mathjax => \"cdn\"))\nfor k in 1:10\n λ = eigvals(SymTridiagonal(XQ.dv[1:k], XQ.ev[1:k-1]))\n plot!(x, qvals(k); linewidth=2.0, color=palette(:default)[k+1])\n scatter!(λ, zero(λ); markersize=2.5, color=palette(:default)[k+1])\nend\np\nsavefig(joinpath(GENFIGS, \"semiclassical.html\"))","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/semiclassical.html\"","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"By Theorem 2.20 it turns out that the derivatives of these particular semi-classical Jacobi polynomials are a linear combination of at most four polynomials orthogonal with respect to the weight w^(alpha+1beta+1gamma+1delta+1epsilon+1)(x) on (-11). This fact enables us to compute the banded differentiation matrix:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"v = Fun(x->(2+x)^(γ+1)*(3+x)^(δ+1)*(5-x)^(ϵ+1), NormalizedJacobi(β+1, α+1))\nfunction threshold!(A::AbstractArray, ϵ)\n for i in eachindex(A)\n if abs(A[i]) < ϵ A[i] = 0 end\n end\n A\nend\nP′ = plan_modifiedjac2jac(Float64, n+1, α+1, β+1, v.coefficients)\nDP = UpperTriangular(diagm(1=>[sqrt(n*(n+α+β+1)) for n in 1:n])) # The classical differentiation matrix representing 𝒟 P^{(α,β)}(x) = P^{(α+1,β+1)}(x) D_P.\nDQ = UpperTriangular(threshold!(P′\\(DP*(P*I)), 100eps())) # The semi-classical differentiation matrix representing 𝒟 Q(x) = Q̂(x) D_Q.\nUpperTriangular(DQ[1:9, 1:9])","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"9×9 LinearAlgebra.UpperTriangular{Float64, Matrix{Float64}}:\n 0.0 7.02067 3.74167 -0.0809111 -0.113147 0.0 0.0 0.0 0.0\n ⋅ 0.0 12.0138 5.7562 -0.0612112 -0.149381 0.0 0.0 0.0\n ⋅ ⋅ 0.0 17.1606 7.59222 -0.0517326 -0.177356 0.0 0.0\n ⋅ ⋅ ⋅ 0.0 22.3446 9.38452 -0.0442887 -0.203279 0.0\n ⋅ ⋅ ⋅ ⋅ 0.0 27.5348 11.1618 -0.0369428 -0.228469\n ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 32.7255 12.932 -0.0294519\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 37.916 14.6983\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 43.1061\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"A faster method now exists via the GramMatrix architecture and its associated displacement equation. Given the modified orthogonal polynomial moments implied by the normalized Jacobi series for u(x), we pad this vector to the necessary size and construct the GramMatrix with these moments, the multiplication operator, and the constant tildeP_0^(alphabeta)(x):","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"μ = PaddedVector(u.coefficients, 2n+1)\nx = Fun(x->x, NormalizedJacobi(β, α))\nXP2 = SymTridiagonal(Symmetric(Multiplication(x, space(x))[1:2n+1, 1:2n+1]))\np0 = Fun(NormalizedJacobi(β, α), [1])(0)\nG = GramMatrix(μ, XP2, p0)\nview(G, 1:7, 1:7)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"7×7 view(::GramMatrix{Float64, LinearAlgebra.Symmetric{Float64, BandedMatrices.BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}}, LinearAlgebra.SymTridiagonal{Float64, Vector{Float64}}}, 1:7, 1:7) with eltype Float64:\n 6.23087 0.250052 -0.116126 0.00655593 -0.00105379 0.00017771 -3.63458e-5\n 0.250052 6.16778 0.20056 -0.0956742 0.00537811 -0.000867428 0.00014667\n -0.116126 0.20056 6.21001 0.195291 -0.092858 0.00516771 -0.000829459\n 0.00655593 -0.0956742 0.195291 6.21487 0.194013 -0.091981 0.00510563\n -0.00105379 0.00537811 -0.092858 0.194013 6.21641 0.193488 -0.0915835\n 0.00017771 -0.000867428 0.00516771 -0.091981 0.193488 6.21711 0.193216\n -3.63458e-5 0.00014667 -0.000829459 0.00510563 -0.0915835 0.193216 6.21749","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"And compute its cholesky factorization. The upper-triangular Cholesky factor represents the connection between original Jacobi and semi-classical Jacobi as bf P^(alphabeta)(x) = bf Q(x) R.","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"R = cholesky(G).U\nUpperTriangular(view(R, 1:7, 1:7))","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"7×7 LinearAlgebra.UpperTriangular{Float64, SubArray{Float64, 2, LinearAlgebra.UpperTriangular{Float64, LinearAlgebra.Adjoint{Float64, BandedMatrices.BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}}}, Tuple{UnitRange{Int64}, UnitRange{Int64}}, false}}:\n 2.49617 0.100174 -0.0465217 0.0026264 -0.000422164 7.1193e-5 -1.45606e-5\n ⋅ 2.48148 0.0827006 -0.0386613 0.00218434 -0.000352435 5.96937e-5\n ⋅ ⋅ 2.49018 0.0797576 -0.0373701 0.00208827 -0.000335346\n ⋅ ⋅ ⋅ 2.49139 0.079104 -0.036992 0.00206099\n ⋅ ⋅ ⋅ ⋅ 2.49174 0.0788577 -0.0368254\n ⋅ ⋅ ⋅ ⋅ ⋅ 2.49189 0.0787344\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 2.49197","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"Every else works almost as before, including evaluation on a Chebyshev grid:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"q = k -> lmul!(P1, ldiv!(R, [zeros(k); 1.0; zeros(n-k)]))\nqvals = k -> ichebyshevtransform(q(k))","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"#17 (generic function with 1 method)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"Computation of the modified Jacobi matrix:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"XQ1 = FastTransforms.modified_jacobi_matrix(R, XP)\nnorm(XQ-XQ1)/norm(XQ)","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"2.4194977316379476e-16","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"Plotting:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"x = chebyshevpoints(Float64, n+1, Val(1))\np = plot(x, qvals(0); linewidth=2.0, legend = false, xlim=(-1,1), xlabel=L\"x\",\n ylabel=L\"Q_n(x)\", title=\"Semi-classical Jacobi Polynomials and Their Roots\",\n extra_plot_kwargs = KW(:include_mathjax => \"cdn\"))\nfor k in 1:10\n λ = eigvals(SymTridiagonal(XQ1.dv[1:k], XQ1.ev[1:k-1]))\n plot!(x, qvals(k); linewidth=2.0, color=palette(:default)[k+1])\n scatter!(λ, zero(λ); markersize=2.5, color=palette(:default)[k+1])\nend\np\nsavefig(joinpath(GENFIGS, \"semiclassical1.html\"))","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"\"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/semiclassical1.html\"","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"And banded differentiation:","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"μ′ = PaddedVector(v.coefficients, 2n+1)\nx′ = Fun(x->x, NormalizedJacobi(β+1, α+1))\nXP′ = SymTridiagonal(Symmetric(Multiplication(x′, space(x′))[1:2n+1, 1:2n+1]))\np0′ = Fun(NormalizedJacobi(β+1, α+1), [1])(0)\nG′ = GramMatrix(μ′, XP′, p0′)\nR′ = cholesky(G′).U\nDP = UpperTriangular(diagm(1=>[sqrt(n*(n+α+β+1)) for n in 1:n])) # The classical differentiation matrix representing 𝒟 P^{(α,β)}(x) = P^{(α+1,β+1)}(x) D_P.\nDQ = UpperTriangular(threshold!(R′*(DP*(R\\I)), 100eps())) # The semi-classical differentiation matrix representing 𝒟 Q(x) = Q̂(x) D_Q.\nUpperTriangular(DQ[1:9, 1:9])","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"9×9 LinearAlgebra.UpperTriangular{Float64, Matrix{Float64}}:\n 0.0 7.02067 3.74167 -0.0809111 -0.113147 0.0 0.0 0.0 0.0\n ⋅ 0.0 12.0138 5.7562 -0.0612112 -0.149381 0.0 0.0 0.0\n ⋅ ⋅ 0.0 17.1606 7.59222 -0.0517326 -0.177356 0.0 0.0\n ⋅ ⋅ ⋅ 0.0 22.3446 9.38452 -0.0442887 -0.203279 0.0\n ⋅ ⋅ ⋅ ⋅ 0.0 27.5348 11.1618 -0.0369428 -0.228469\n ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 32.7255 12.932 -0.0294519\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 37.916 14.6983\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0 43.1061\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.0","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"","category":"page"},{"location":"generated/semiclassical/#","page":"Semi-classical Jacobi polynomials","title":"Semi-classical Jacobi polynomials","text":"This page was generated using Literate.jl.","category":"page"},{"location":"#FastTransforms.jl-Documentation-1","page":"Home","title":"FastTransforms.jl Documentation","text":"","category":"section"},{"location":"#Introduction-1","page":"Home","title":"Introduction","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.jl allows the user to conveniently work with orthogonal polynomials with degrees well into the millions.","category":"page"},{"location":"#","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Fast-orthogonal-polynomial-transforms-1","page":"Home","title":"Fast orthogonal polynomial transforms","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"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.","category":"page"},{"location":"#Fast-Cholesky-factorization-of-the-Gram-matrix-1","page":"Home","title":"Fast Cholesky factorization of the Gram matrix","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"GramMatrix","category":"page"},{"location":"#FastTransforms.GramMatrix","page":"Home","title":"FastTransforms.GramMatrix","text":"GramMatrix(W::AbstractMatrix, X::AbstractMatrix)\n\nConstruct a symmetric positive-definite Gram matrix with data stored in W. Given a family of orthogonal polynomials bf P(x) = p_0(x) p_1(x)ldots and a continuous inner product langle f grangle, the Gram matrix is defined by:\n\nW_ij = langle p_i-1 p_j-1rangle\n\nMoreover, given X, the transposed Jacobi matrix that satisfies x bf P(x) = bf P(x) X, the Gram matrix satisfies the skew-symmetric rank-2 displacement equation (X = X_1n 1n):\n\nX^top W - WX = GJG^top\n\nwhere J = beginpmatrix 0 1 -1 0endpmatrix and where:\n\nG_ 1 = e_nquadrm andquad G_ 2 = W_n-1 X_n-1 n - X^top W_ n\n\nFast (O(n^2)) Cholesky factorization of the Gram matrix returns the connection coefficients between bf P(x) and the polynomials bf Q(x) orthogonal in the modified inner product, bf P(x) = bf Q(x) R.\n\n\n\n\n\n","category":"type"},{"location":"#","page":"Home","title":"Home","text":"ChebyshevGramMatrix","category":"page"},{"location":"#FastTransforms.ChebyshevGramMatrix","page":"Home","title":"FastTransforms.ChebyshevGramMatrix","text":"ChebyshevGramMatrix(μ::AbstractVector)\n\nConstruct a Chebyshev–Gram matrix of size (length(μ)+1)÷2 with entries:\n\nW_ij = fracmu_i-j+1 +mu_i+j-12\n\nDue to the linearization of a product of two first-kind Chebyshev polynomials, the Chebyshev–Gram matrix can be constructed from modified Chebyshev moments:\n\nmu_n = langle T_n-1 1rangle\n\nSpecialized construction and Cholesky factorization is given for this type.\n\nSee also GramMatrix for the general case.\n\n\n\n\n\n","category":"type"},{"location":"#Nonuniform-fast-Fourier-transforms-1","page":"Home","title":"Nonuniform fast Fourier transforms","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"nufft1","category":"page"},{"location":"#FastTransforms.nufft1","page":"Home","title":"FastTransforms.nufft1","text":"Computes a nonuniform fast Fourier transform of type I:\n\nf_j = sum_k=0^N-1 c_k e^-2pirm i fracjN omega_kquadrm forquad 0 le j le N-1\n\n\n\n\n\nComputes a 2D nonuniform fast Fourier transform of type I-I:\n\nF_ij = sum_k=0^M-1sum_ell=0^N-1 C_kell e^-2pirm i (fraciM omega_k + fracjN pi_ell)quadrm forquad 0 le i le M-1quad 0 le j le N-1\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"nufft2","category":"page"},{"location":"#FastTransforms.nufft2","page":"Home","title":"FastTransforms.nufft2","text":"Computes a nonuniform fast Fourier transform of type II:\n\nf_j = sum_k=0^N-1 c_k e^-2pirm i x_j kquadrm forquad 0 le j le N-1\n\n\n\n\n\nComputes a 2D nonuniform fast Fourier transform of type II-II:\n\nF_ij = sum_k=0^M-1sum_ell=0^N-1 C_kell e^-2pirm i (x_i k + y_j ell)quadrm forquad 0 le i le M-1quad 0 le j le N-1\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"nufft3","category":"page"},{"location":"#FastTransforms.nufft3","page":"Home","title":"FastTransforms.nufft3","text":"Computes a nonuniform fast Fourier transform of type III:\n\nf_j = sum_k=0^N-1 c_k e^-2pirm i x_j omega_kquadrm forquad 0 le j le N-1\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"inufft1","category":"page"},{"location":"#FastTransforms.inufft1","page":"Home","title":"FastTransforms.inufft1","text":"Computes an inverse nonuniform fast Fourier transform of type I.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"inufft2","category":"page"},{"location":"#FastTransforms.inufft2","page":"Home","title":"FastTransforms.inufft2","text":"Computes an inverse nonuniform fast Fourier transform of type II.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"paduatransform","category":"page"},{"location":"#FastTransforms.paduatransform","page":"Home","title":"FastTransforms.paduatransform","text":"Padua Transform maps from interpolant values at the Padua points to the 2D Chebyshev coefficients.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"ipaduatransform","category":"page"},{"location":"#FastTransforms.ipaduatransform","page":"Home","title":"FastTransforms.ipaduatransform","text":"Inverse Padua Transform maps the 2D Chebyshev coefficients to the values of the interpolation polynomial at the Padua points.\n\n\n\n\n\n","category":"function"},{"location":"#Other-Exported-Methods-1","page":"Home","title":"Other Exported Methods","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"gaunt","category":"page"},{"location":"#FastTransforms.gaunt","page":"Home","title":"FastTransforms.gaunt","text":"Calculates the Gaunt coefficients, defined by:\n\na(mnmunuq) = frac2(n+nu-2q)+12 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) rmdx\n\nor defined by:\n\nP_n^m(x) P_nu^mu(x) = sum_q=0^q_rm max a(mnmunuq) P_n+nu-2q^m+mu(x)\n\nThis is a Julia implementation of the stable recurrence described in:\n\nY.-l. Xu, Fast evaluation of Gaunt coefficients: recursive approach, J. Comp. Appl. Math., 85:53–65, 1997.\n\n\n\n\n\nCalculates the Gaunt coefficients in 64-bit floating-point arithmetic.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"paduapoints","category":"page"},{"location":"#FastTransforms.paduapoints","page":"Home","title":"FastTransforms.paduapoints","text":"Returns coordinates of the (n+1)(n+2)2 Padua points.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"sphevaluate","category":"page"},{"location":"#FastTransforms.sphevaluate","page":"Home","title":"FastTransforms.sphevaluate","text":"Pointwise evaluation of real orthonormal spherical harmonic:\n\nY_ell^m(thetavarphi) = (-1)^msqrt(ell+frac12)frac(ell-m)(ell+m) P_ell^m(costheta) sqrtfrac2-delta_m02pi leftbeginarrayccc cos mvarphi rm for m ge 0 sin(-mvarphi) rm for m 0endarrayright\n\n\n\n\n\n","category":"function"},{"location":"#Internal-Methods-1","page":"Home","title":"Internal Methods","text":"","category":"section"},{"location":"#Miscellaneous-Special-Functions-1","page":"Home","title":"Miscellaneous Special Functions","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.half","category":"page"},{"location":"#FastTransforms.half","page":"Home","title":"FastTransforms.half","text":"Compute a typed 0.5.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.two","category":"page"},{"location":"#FastTransforms.two","page":"Home","title":"FastTransforms.two","text":"Compute a typed 2.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.δ","category":"page"},{"location":"#FastTransforms.δ","page":"Home","title":"FastTransforms.δ","text":"The Kronecker delta function:\n\ndelta_kj = leftbeginarrayccc 1 rm for k = j 0 rm for k ne jendarrayright\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.Λ","category":"page"},{"location":"#FastTransforms.Λ","page":"Home","title":"FastTransforms.Λ","text":"The Lambda function Lambda(z) = fracGamma(z+frac12)Gamma(z+1) for the ratio of gamma functions.\n\n\n\n\n\nFor 64-bit floating-point arithmetic, the Lambda function uses the asymptotic series for tau in Appendix B of\n\nI. 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.\n\n\n\n\n\nThe Lambda function Lambda(zλ₁λ₂) = fracGamma(z+lambda_1)Γ(z+lambda_2) for the ratio of gamma functions.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.lambertw","category":"page"},{"location":"#FastTransforms.lambertw","page":"Home","title":"FastTransforms.lambertw","text":"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^-1infty).\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.pochhammer","category":"page"},{"location":"#FastTransforms.pochhammer","page":"Home","title":"FastTransforms.pochhammer","text":"Pochhammer symbol (x)_n = fracGamma(x+n)Gamma(x) for the rising factorial.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.stirlingseries","category":"page"},{"location":"#FastTransforms.stirlingseries","page":"Home","title":"FastTransforms.stirlingseries","text":"Stirling's asymptotic series for Gamma(z).\n\n\n\n\n\n","category":"function"},{"location":"#Modified-Chebyshev-Moment-Based-Quadrature-1","page":"Home","title":"Modified Chebyshev Moment-Based Quadrature","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.clenshawcurtisnodes","category":"page"},{"location":"#FastTransforms.clenshawcurtisnodes","page":"Home","title":"FastTransforms.clenshawcurtisnodes","text":"Compute nodes of the Clenshaw—Curtis quadrature rule.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.clenshawcurtisweights","category":"page"},{"location":"#FastTransforms.clenshawcurtisweights","page":"Home","title":"FastTransforms.clenshawcurtisweights","text":"Compute weights of the Clenshaw—Curtis quadrature rule with modified Chebyshev moments of the first kind mu.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.fejernodes1","category":"page"},{"location":"#FastTransforms.fejernodes1","page":"Home","title":"FastTransforms.fejernodes1","text":"Compute nodes of Fejer's first quadrature rule.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.fejerweights1","category":"page"},{"location":"#FastTransforms.fejerweights1","page":"Home","title":"FastTransforms.fejerweights1","text":"Compute weights of Fejer's first quadrature rule with modified Chebyshev moments of the first kind mu.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.fejernodes2","category":"page"},{"location":"#FastTransforms.fejernodes2","page":"Home","title":"FastTransforms.fejernodes2","text":"Compute nodes of Fejer's second quadrature rule.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.fejerweights2","category":"page"},{"location":"#FastTransforms.fejerweights2","page":"Home","title":"FastTransforms.fejerweights2","text":"Compute weights of Fejer's second quadrature rule with modified Chebyshev moments of the second kind mu.\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.chebyshevmoments1","category":"page"},{"location":"#FastTransforms.chebyshevmoments1","page":"Home","title":"FastTransforms.chebyshevmoments1","text":"Modified Chebyshev moments of the first kind:\n\n int_-1^+1 T_n(x) rmdx\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.chebyshevjacobimoments1","category":"page"},{"location":"#FastTransforms.chebyshevjacobimoments1","page":"Home","title":"FastTransforms.chebyshevjacobimoments1","text":"Modified Chebyshev moments of the first kind with respect to the Jacobi weight:\n\n int_-1^+1 T_n(x) (1-x)^alpha(1+x)^betarmdx\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.chebyshevlogmoments1","category":"page"},{"location":"#FastTransforms.chebyshevlogmoments1","page":"Home","title":"FastTransforms.chebyshevlogmoments1","text":"Modified Chebyshev moments of the first kind with respect to the logarithmic weight:\n\n int_-1^+1 T_n(x) logleft(frac1-x2right)rmdx\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.chebyshevmoments2","category":"page"},{"location":"#FastTransforms.chebyshevmoments2","page":"Home","title":"FastTransforms.chebyshevmoments2","text":"Modified Chebyshev moments of the second kind:\n\n int_-1^+1 U_n(x) rmdx\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.chebyshevjacobimoments2","category":"page"},{"location":"#FastTransforms.chebyshevjacobimoments2","page":"Home","title":"FastTransforms.chebyshevjacobimoments2","text":"Modified Chebyshev moments of the second kind with respect to the Jacobi weight:\n\n int_-1^+1 U_n(x) (1-x)^alpha(1+x)^betarmdx\n\n\n\n\n\n","category":"function"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.chebyshevlogmoments2","category":"page"},{"location":"#FastTransforms.chebyshevlogmoments2","page":"Home","title":"FastTransforms.chebyshevlogmoments2","text":"Modified Chebyshev moments of the second kind with respect to the logarithmic weight:\n\n int_-1^+1 U_n(x) logleft(frac1-x2right)rmdx\n\n\n\n\n\n","category":"function"},{"location":"#Elliptic-1","page":"Home","title":"Elliptic","text":"","category":"section"},{"location":"#","page":"Home","title":"Home","text":"FastTransforms.Elliptic","category":"page"},{"location":"#FastTransforms.Elliptic","page":"Home","title":"FastTransforms.Elliptic","text":"FastTransforms submodule for the computation of some elliptic integrals and functions.\n\nComplete elliptic integrals of the first and second kinds:\n\nK(k) = int_0^fracpi2 fracrm dthetasqrt1-k^2sin^2thetaquadrm and\n\nE(k) = int_0^fracpi2 sqrt1-k^2sin^2theta rmdtheta\n\nJacobian elliptic functions:\n\nx = int_0^operatornamesn(xk) fracrm dtsqrt(1-t^2)(1-k^2t^2)\n\nx = int_operatornamecn(xk)^1 fracrm dtsqrt(1-t^2)1-k^2(1-t^2)\n\nx = int_operatornamedn(xk)^1 fracrm dtsqrt(1-t^2)(t^2-1+k^2)\n\nand the remaining nine are defined by:\n\noperatornamepq(xk) = fracoperatornamepr(xk)operatornameqr(xk) = frac1operatornameqp(xk)\n\n\n\n\n\n","category":"module"}] }