Holomorphic integration on the unit disk

In this example, we explore integration of a harmonic function:

\[ f(x,y) = \frac{x^2-y^2+1}{(x^2-y^2+1)^2+(2xy+1)^2},\]

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(0,0)$. We analyze the function on an $N\times M$ tensor product grid defined by:

\[\begin{aligned} r_n & = \cos\left[(n+\tfrac{1}{2})\pi/2N\right],\quad{\rm for}\quad 0\le n < N,\quad{\rm and}\\ \theta_m & = 2\pi m/M,\quad{\rm for}\quad 0\le m < M; \end{aligned}\]

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.

For the storage pattern of the arrays, please consult the documentation.

using FastTransforms, LinearAlgebra, Plots
const GENFIGS = joinpath(pkgdir(FastTransforms), "docs/src/generated")
!isdir(GENFIGS) && mkdir(GENFIGS)
plotlyjs()
Plots.PlotlyJSBackend()

Our function $f$ on the disk:

f = (x,y) -> (x^2-y^2+1)/((x^2-y^2+1)^2+(2x*y+1)^2)
#1 (generic function with 1 method)

The Zernike polynomial degree:

N = 15
M = 4N-3
57

The radial grid:

r = [sinpi((N-n-0.5)/(2N)) for n in 0:N-1]
15-element Vector{Float64}:
 0.9986295347545738
 0.9876883405951378
 0.9659258262890683
 0.9335804264972017
 0.8910065241883678
 0.838670567945424
 0.7771459614569709
 0.7071067811865475
 0.6293203910498375
 0.5446390350150271
 0.45399049973954675
 0.35836794954530027
 0.25881904510252074
 0.15643446504023087
 0.052335956242943835

The angular grid (mod $\pi$):

θ = (0:M-1)*2/M
0.0:0.03508771929824561:1.9649122807017543

On the mapped tensor product grid, our function samples are:

F = [f(r*cospi(θ), r*sinpi(θ)) for r in r, θ in θ]
15×57 Matrix{Float64}:
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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

We superpose a surface plot of $f$ on top of the grid:

X = [r*cospi(θ) for r in r, θ in θ]
Y = [r*sinpi(θ) for r in r, θ in θ]
scatter3d(vec(X), vec(Y), vec(0F); markersize=0.75, markercolor=:red)
surface!(X, Y, F; legend=false, xlabel="x", ylabel="y", zlabel="f")
savefig(joinpath(GENFIGS, "zernike.html"))
"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/zernike.html"

We precompute a (generalized) Zernike–Chebyshev×Fourier plan:

α, β = 0, 0
P = plan_disk2cxf(F, α, β)
FastTransforms Zernike--Chebyshev×Fourier plan for 15×57-element array of Float64

And an FFTW Chebyshev×Fourier analysis plan on the disk:

PA = plan_disk_analysis(F)
FastTransforms plan for FFTW Chebyshev×Fourier analysis on the disk for 15×57-element array of Float64

Its Zernike coefficients are:

U = P\(PA*F)
15×57 Matrix{Float64}:
  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
  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
  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
 -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
 -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
  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
  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
 -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
  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
  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
 -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
 -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
  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
  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
 -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

The Zernike coefficients are useful for integration. The integral of $f(x,y)$ over the disk should be $\pi/2$ by harmonicity. The coefficient of $Z_{0,0}$ multiplied by √π is:

U[1, 1]*sqrt(π)
1.5707963267948968

Using an orthonormal basis, the integral of $[f(x,y)]^2$ over the disk is approximately the square of the 2-norm of the coefficients:

norm(U)^2, π/(2*sqrt(2))*log1p(sqrt(2))
(0.9789599193439185, 0.9789599179781414)

But there's more! Next, we repeat the experiment using the Dunkl-Xu orthonormal polynomials supported on the rectangularized disk.

N = 2N
M = N
30

We analyze the function on an $N\times M$ mapped tensor product $xy$-grid defined by:

\[\begin{aligned} x_n & = \cos\left(\frac{2n+1}{2N}\pi\right) = \sin\left(\frac{N-2n-1}{2N}\pi\right),\quad {\rm for} \quad 0 \le n < N,\quad{\rm and}\\ z_m & = \cos\left(\frac{2m+1}{2M}\pi\right) = \sin\left(\frac{M-2m-1}{2M}\pi\right),\quad {\rm for} \quad 0 \le m < M,\\ y_{n,m} & = \sqrt{1-x_n^2}z_m. \end{aligned}\]

Slightly more accuracy can be expected by using an auxiliary array:

\[ w_n = \sin\left(\frac{2n+1}{2N}\pi\right),\quad {\rm for} \quad 0 \le n < N,\]

so that $y_{n,m} = w_nz_m$.

The x grid

w = [sinpi((n+0.5)/N) for n in 0:N-1]
x = [sinpi((N-2n-1)/(2N)) for n in 0:N-1]
30-element Vector{Float64}:
  0.9986295347545738
  0.9876883405951378
  0.9659258262890683
  0.9335804264972017
  0.8910065241883678
  0.838670567945424
  0.7771459614569709
  0.7071067811865475
  0.6293203910498375
  0.5446390350150271
  0.45399049973954675
  0.35836794954530027
  0.25881904510252074
  0.15643446504023087
  0.052335956242943835
 -0.052335956242943835
 -0.15643446504023087
 -0.25881904510252074
 -0.35836794954530027
 -0.45399049973954675
 -0.5446390350150271
 -0.6293203910498375
 -0.7071067811865475
 -0.7771459614569709
 -0.838670567945424
 -0.8910065241883678
 -0.9335804264972017
 -0.9659258262890683
 -0.9876883405951378
 -0.9986295347545738

The z grid

z = [sinpi((M-2m-1)/(2M)) for m in 0:M-1]
30-element Vector{Float64}:
  0.9986295347545738
  0.9876883405951378
  0.9659258262890683
  0.9335804264972017
  0.8910065241883678
  0.838670567945424
  0.7771459614569709
  0.7071067811865475
  0.6293203910498375
  0.5446390350150271
  0.45399049973954675
  0.35836794954530027
  0.25881904510252074
  0.15643446504023087
  0.052335956242943835
 -0.052335956242943835
 -0.15643446504023087
 -0.25881904510252074
 -0.35836794954530027
 -0.45399049973954675
 -0.5446390350150271
 -0.6293203910498375
 -0.7071067811865475
 -0.7771459614569709
 -0.838670567945424
 -0.8910065241883678
 -0.9335804264972017
 -0.9659258262890683
 -0.9876883405951378
 -0.9986295347545738

On the mapped tensor product grid, our function samples are:

F = [f(x[n], w[n]*z) for n in 1:N, z in z]
30×30 Matrix{Float64}:
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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
 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

We superpose a surface plot of $f$ on top of the grid:

X = [x for x in x, z in z]
Y = [w*z for w in w, z in z]
scatter3d(vec(X), vec(Y), vec(0F); markersize=0.75, markercolor=:green)
surface!(X, Y, F; legend=false, xlabel="x", ylabel="y", zlabel="f")
savefig(joinpath(GENFIGS, "dunklxu.html"))
"/home/runner/work/FastTransforms.jl/FastTransforms.jl/docs/src/generated/dunklxu.html"

We precompute a Dunkl-Xu–Chebyshev plan:

P = plan_rectdisk2cheb(F, β)
FastTransforms Dunkl-Xu--Chebyshev² plan for 30×30-element array of Float64

And an FFTW Chebyshev² analysis plan on the rectangularized disk:

PA = plan_rectdisk_analysis(F)
FastTransforms plan for FFTW Chebyshev analysis on the rectangularized disk for 30×30-element array of Float64

Its Dunkl-Xu coefficients are:

U = P\(PA*F)
30×30 Matrix{Float64}:
  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
 -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
 -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
 -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
 -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
 -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
  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
  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
 -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
  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
  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
  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
  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
 -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
 -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
 -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
  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
 -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
 -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
  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
 -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
  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
  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
  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
 -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
  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
  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
 -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
  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
 -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

The Dunkl-Xu coefficients are useful for integration. The integral of $f(x,y)$ over the disk should be $\pi/2$ by harmonicity. The coefficient of $P_{0,0}$ multiplied by √π is:

U[1, 1]*sqrt(π)
1.5707955409153043

Using an orthonormal basis, the integral of $[f(x,y)]^2$ over the disk is approximately the square of the 2-norm of the coefficients:

norm(U)^2, π/(2*sqrt(2))*log1p(sqrt(2))
(0.978937045726087, 0.9789599179781414)

This page was generated using Literate.jl.