Classes | Functions | Variables

gridripper::multipole Namespace Reference

Multipole expansion classes and methods. More...

Classes

class  Y
 Class for spherical harmonic functions. More...
class  Yre
 Class for real spherical harmonic functions. More...
class  Coeff< GReal_t >
 Class for real spherical harmonic (Yre) expansion coefficients. More...
class  Coeff< GComplex_t >
 Class for complex spherical harmonic (Y) expansion coefficients. More...
class  ScalarFieldMP< GReal_t >
 Class for real scalar fields on sphere. More...
class  ScalarFieldMP< GComplex_t >
 Class for complex scalar fields on sphere. More...

Functions

Coeff< GReal_toperator* (const GReal_t, const Yre &)
 Tensor product of a number and an Yre.
Coeff< GReal_toperator* (const Yre &, const GReal_t)
Coeff< GReal_toperator/ (const Yre &, const GReal_t)
 Tensor quotient of a number and an Yre.
Coeff< GReal_toperator* (const GReal_t, const Coeff< GReal_t > &)
 Multiply a coefficient by a number.
Coeff< GReal_toperator* (const Coeff< GReal_t > &, const GReal_t)
Coeff< GReal_toperator/ (const Coeff< GReal_t > &, const GReal_t)
 Divide a coefficient by a number.
Coeff< GReal_toperator- (const Yre &)
 Negative of a coefficient.
Coeff< GReal_toperator- (const Coeff< GReal_t > &)
Coeff< GComplex_t > operator* (const GReal_t, const Y &)
 Tensor product of a number and an Y.
Coeff< GComplex_t > operator* (const Y &, const GReal_t)
Coeff< GComplex_t > operator* (const GComplex_t &, const Y &)
Coeff< GComplex_t > operator* (const Y &, const GComplex_t &)
Coeff< GComplex_t > operator/ (const Y &, const GReal_t)
 Tensor quotient of a number and an Y.
Coeff< GComplex_t > operator/ (const Y &, const GComplex_t &)
Coeff< GComplex_t > operator* (const GReal_t, const Coeff< GComplex_t > &)
 Multiply a coefficient by a number.
Coeff< GComplex_t > operator* (const Coeff< GComplex_t > &, const GReal_t)
Coeff< GComplex_t > operator* (const GComplex_t &, const Coeff< GComplex_t > &)
Coeff< GComplex_t > operator* (const Coeff< GComplex_t > &, const GComplex_t &)
Coeff< GComplex_t > operator/ (const Coeff< GComplex_t > &, const GReal_t)
 Divide a coefficient by a number.
Coeff< GComplex_t > operator/ (const Coeff< GComplex_t > &, const GComplex_t &)
Coeff< GComplex_t > operator- (const Y &)
 Negative of a coefficient.
Coeff< GComplex_t > operator- (const Coeff< GComplex_t > &)
Coeff< GComplex_t > conj (const Y &)
 Complex conjugate a coefficient.
Coeff< GComplex_t > conj (const Coeff< GComplex_t > &)
GReal_t YYY_coupling (const int l1, const int l2, const int l3, const int m1, const int m2, const int m3)
 The $ \int_{0}^{\pi}\int_{0}^{2\pi} Y_{l_1}^{m_1}(\vartheta, \varphi) Y_{l_2}^{m_2}(\vartheta, \varphi) Y_{l_3}^{m_3}(\vartheta, \varphi) \;\sin(\vartheta)\mathrm{d}\vartheta\,\mathrm{d}\varphi $ spherical harmonic function Gaunt coefficient calculator routine.
bool YYY_coupling_zeros (const int l1, const int l2, const int l3, const int m1, const int m2, const int m3)
 Returns true if the Gaunt coefficient of given index is known to be zero.
unsigned int YYY_coupling_size ()
 Show table size currently used in YYY_coupling.
GReal_t YreYreYre_coupling (const int l1, const int l2, const int l3, const int m1, const int m2, const int m3)
 The same coupling for Yre basis.
GComplex_t YYreY_coupling (const int l1, const int l2, const int l3, const int m1, const int m2, const int m3)
 Similar coupling for Y and Yre basis.
GReal_t intYl1ExpMIPhi (const int l)
 Calculation of $\int_{0}^{2\pi}\int_{0}^{\pi} Y_{l}^{1}(\vartheta, \varphi) \exp(-\mathrm{i}\varphi) \sin(\vartheta)\;\mathrm{d}\vartheta\,\mathrm{d}\varphi$.
GReal_t ExpPmIPhiYY_coupling (const int l1, const int m1, const int l2, const int sign)
 The overlap integrals $\int_{0}^{\pi}\int_{0}^{2\pi} \mathrm{e}^{\pm\mathrm{i}\varphi} Y_{l_1}^{m_1}(\vartheta, \varphi) Y_{l_2}^{-(m_1\pm1)}(\vartheta, \varphi) \;\sin(\vartheta)\mathrm{d}\vartheta\,\mathrm{d}\varphi$.
unsigned int ExpPmIPhiYY_coupling_size ()
 Show table size currently used in ExpPmIPhiYY_coupling.
GReal_t intYl0 (const int l, const GReal_t theta)
 Calculation of $\int_{[0,\theta]\times[0,2\pi]} Y_{l}^{0} \;\mathrm{d}\lambda_{S^2}$.
GReal_t intBarYl1mYl2m (const int l1, const int l2, const int m, const GReal_t theta, tvector< tvector< tvector< GReal_t > > > *coeffstorage)
 Calculation of $\int_{[0,\theta]\times[0,2\pi]} \bar{Y}_{l_1}^{m} Y_{l_2}^{m} \;\mathrm{d}\lambda_{S^2}$.
GReal_t SobolevConstantS2 (const int m)
 The minimal Sobolev constant in the inequality over the sphere: $\Vert\cdot\Vert_{C^{0}} \leq C \Vert\cdot\Vert_{H^{2}_{\mu}}$.
GReal_t tailSumS2 (const int mup, const int mu, const int L)
 The sum $\sum_{l=L}^{\infty} \sum_{m=-l}^{l} \frac{(l(l+1))^{\mu+1}-1}{(l(l+1))^{\mu^{'}+1}-1} \frac{1}{(2l+1)^{2}}$.
ScalarFieldMP< GReal_toperator+ (const ScalarFieldMP< GReal_t > &, const ScalarFieldMP< GReal_t > &)
 ScalarFieldMP<GReal_t> algebraic operators.
ScalarFieldMP< GReal_toperator- (const ScalarFieldMP< GReal_t > &, const ScalarFieldMP< GReal_t > &)
ScalarFieldMP< GReal_toperator- (const ScalarFieldMP< GReal_t > &)
ScalarFieldMP< GReal_toperator* (const ScalarFieldMP< GReal_t > &, const GReal_t)
ScalarFieldMP< GReal_toperator* (const GReal_t, const ScalarFieldMP< GReal_t > &)
ScalarFieldMP< GReal_toperator* (const ScalarFieldMP< GReal_t > &, const ScalarFieldMP< GReal_t > &)
ScalarFieldMP< GReal_toperator/ (const ScalarFieldMP< GReal_t > &, const GReal_t)
GReal_t L2S2 (const ScalarFieldMP< GReal_t > &, const ScalarFieldMP< GReal_t > &)
 L^2 scalarproduct of two fields on sphere.
GReal_t H2S2 (const ScalarFieldMP< GReal_t > &, const ScalarFieldMP< GReal_t > &, const int mu)
 $H_{\mu}^2$ Sobolev scalarproduct of two fields on sphere.
ScalarFieldMP< GReal_treflect (const ScalarFieldMP< GReal_t > &)
 Reflect with respect to origin (parity operator).
ScalarFieldMP< GReal_tmulCosTheta (const ScalarFieldMP< GReal_t > &)
 Multiplication operator by $\cos(\vartheta)$.
ScalarFieldMP< GReal_tmulCosThetaSqr (const ScalarFieldMP< GReal_t > &)
 Multiplication operator by $\cos(\vartheta)^2$.
ScalarFieldMP< GReal_tmulSinThetaSqr (const ScalarFieldMP< GReal_t > &)
 Multiplication operator by $\sin(\vartheta)^2$.
ScalarFieldMP< GReal_tpartial_phi (const ScalarFieldMP< GReal_t > &)
 $\varphi$ derivative on sphere for real scalar field.
ScalarFieldMP< GReal_tSqr_partial_phi (const ScalarFieldMP< GReal_t > &)
 Second $\varphi$ derivative on sphere for real scalar field.
ScalarFieldMP< GReal_tsinTheta_partial_theta (const ScalarFieldMP< GReal_t > &)
 $\sin(\vartheta)\partial_{\vartheta}$ derivative on sphere for real scalar field.
ScalarFieldMP< GReal_tpartial_x (const ScalarFieldMP< GReal_t > &)
 ( $\partial_{1}(\cdot)\circ(\arccos,\mathrm{id}))\circ(\cos,\mathrm{id})$ derivative on sphere for real scalar field.
ScalarFieldMP< GReal_tLaplaceS2 (const ScalarFieldMP< GReal_t > &)
 Laplace operator on unit sphere for real scalar field.
GReal_t normBoundNeumann (const GReal_t a00, const GReal_t H2S2aa)
 Upper estimate of the $C^{0}$ norm of $1 -$ a real field for Neumann series expansion.
GReal_t optimalScalingNeumann (const GReal_t a00, const GReal_t H2S2aa)
 Scaling factor $a$, with which $\Vert1-a^{-1}A\Vert^2_{H_2^2}$ is minimized for a real field $A$ on sphere.
ScalarFieldMP< GReal_tdivideByNeumann (const ScalarFieldMP< GReal_t > &a, const ScalarFieldMP< GReal_t > &f, const GReal_t norm, const GReal_t errortolerance)
 Division of a real field by a real field, using Neumann series.
GReal_t tailErrorBoundS2 (const ScalarFieldMP< GReal_t > &, const int mup, const int mu, int *lmax, int *mmax)
 An upper bound for the tail sum in $H_{\mu}^{2}$ norm, assuming that the field is in the space $H_{\mu'}^2$.
ScalarFieldMP< GComplex_t > operator+ (const ScalarFieldMP< GComplex_t > &, const ScalarFieldMP< GComplex_t > &)
 ScalarFieldMP<GComplex_t> algebraic operators.
ScalarFieldMP< GComplex_t > operator+ (const ScalarFieldMP< GComplex_t > &, const ScalarFieldMP< GReal_t > &)
ScalarFieldMP< GComplex_t > operator+ (const ScalarFieldMP< GReal_t > &, const ScalarFieldMP< GComplex_t > &)
ScalarFieldMP< GComplex_t > operator- (const ScalarFieldMP< GComplex_t > &, const ScalarFieldMP< GComplex_t > &)
ScalarFieldMP< GComplex_t > operator- (const ScalarFieldMP< GComplex_t > &, const ScalarFieldMP< GReal_t > &)
ScalarFieldMP< GComplex_t > operator- (const ScalarFieldMP< GReal_t > &, const ScalarFieldMP< GComplex_t > &)
ScalarFieldMP< GComplex_t > operator- (const ScalarFieldMP< GComplex_t > &)
ScalarFieldMP< GComplex_t > operator* (const ScalarFieldMP< GComplex_t > &, const GReal_t)
ScalarFieldMP< GComplex_t > operator* (const GReal_t, const ScalarFieldMP< GComplex_t > &)
ScalarFieldMP< GComplex_t > operator* (const ScalarFieldMP< GComplex_t > &, const GComplex_t &)
ScalarFieldMP< GComplex_t > operator* (const GComplex_t &, const ScalarFieldMP< GComplex_t > &)
ScalarFieldMP< GComplex_t > operator* (const ScalarFieldMP< GReal_t > &, const GComplex_t &)
ScalarFieldMP< GComplex_t > operator* (const GComplex_t &, const ScalarFieldMP< GReal_t > &)
ScalarFieldMP< GComplex_t > operator* (const ScalarFieldMP< GComplex_t > &, const ScalarFieldMP< GComplex_t > &)
ScalarFieldMP< GComplex_t > operator* (const ScalarFieldMP< GComplex_t > &, const ScalarFieldMP< GReal_t > &)
ScalarFieldMP< GComplex_t > operator* (const ScalarFieldMP< GReal_t > &, const ScalarFieldMP< GComplex_t > &)
ScalarFieldMP< GComplex_t > operator/ (const ScalarFieldMP< GComplex_t > &, const GReal_t)
ScalarFieldMP< GComplex_t > operator/ (const ScalarFieldMP< GComplex_t > &, const GComplex_t &)
ScalarFieldMP< GComplex_t > operator/ (const ScalarFieldMP< GReal_t > &, const GComplex_t &)
ScalarFieldMP< GComplex_t > conj (const ScalarFieldMP< GComplex_t > &)
 Complex conjugate a scalarfield on sphere.
ScalarFieldMP< GReal_treal (const ScalarFieldMP< GComplex_t > &)
 Real part of a scalarfield on sphere.
ScalarFieldMP< GReal_timag (const ScalarFieldMP< GComplex_t > &)
 Imaginary part of a scalarfield on sphere.
GComplex_t L2S2 (const ScalarFieldMP< GComplex_t > &, const ScalarFieldMP< GReal_t > &)
 L^2 scalarproduct of fields.
GComplex_t L2S2 (const ScalarFieldMP< GReal_t > &, const ScalarFieldMP< GComplex_t > &)
GComplex_t L2S2 (const ScalarFieldMP< GComplex_t > &, const ScalarFieldMP< GComplex_t > &)
GComplex_t H2S2 (const ScalarFieldMP< GComplex_t > &, const ScalarFieldMP< GReal_t > &, const int mu)
 $H_{\mu}^2$ Sobolev scalarproduct of two fields on sphere.
GComplex_t H2S2 (const ScalarFieldMP< GReal_t > &, const ScalarFieldMP< GComplex_t > &, const int mu)
GComplex_t H2S2 (const ScalarFieldMP< GComplex_t > &, const ScalarFieldMP< GComplex_t > &, const int mu)
GComplex_t L2S2limited (const ScalarFieldMP< GComplex_t > &, const ScalarFieldMP< GComplex_t > &, const GReal_t theta, tvector< tvector< tvector< GReal_t > > > *coeffstorage)
 $L^2$ scalarproduct of fields, with limited integration domain to $[0,\theta]\times[0,2\pi]$.
ScalarFieldMP< GComplex_t > reflect (const ScalarFieldMP< GComplex_t > &)
 Reflect with respect to origin (parity operator).
ScalarFieldMP< GComplex_t > stepping (const ScalarFieldMP< GComplex_t > &, const int upOrDown)
 Stepping up and down operators.
ScalarFieldMP< GComplex_t > mulCosTheta (const ScalarFieldMP< GComplex_t > &)
 Multiplication operator by $\cos(\vartheta)$.
ScalarFieldMP< GComplex_t > mulCosThetaSqr (const ScalarFieldMP< GComplex_t > &)
 Multiplication operator by $\cos(\vartheta)^2$.
ScalarFieldMP< GComplex_t > mulSinThetaSqr (const ScalarFieldMP< GComplex_t > &)
 Multiplication operator by $\sin(\vartheta)^2$.
ScalarFieldMP< GComplex_t > mulExpPmIPhi (const ScalarFieldMP< GComplex_t > &, const int sign)
 Multiplication operator by $\mathrm{e}^{\pm\mathrm{i}\varphi}$.
ScalarFieldMP< GComplex_t > partial_phi (const ScalarFieldMP< GComplex_t > &)
 $\varphi$ derivative on sphere for complex scalar field.
ScalarFieldMP< GComplex_t > Sqr_partial_phi (const ScalarFieldMP< GComplex_t > &)
 Second $\varphi$ derivative on sphere for complex scalar field.
ScalarFieldMP< GComplex_t > sinTheta_partial_theta (const ScalarFieldMP< GComplex_t > &)
 $\sin(\vartheta)\partial_{\vartheta}$ derivative on sphere for complex scalar field.
ScalarFieldMP< GComplex_t > partial_theta (const ScalarFieldMP< GComplex_t > &)
 $\partial_{\vartheta}$ derivative on sphere for complex field.
ScalarFieldMP< GComplex_t > partial_x (const ScalarFieldMP< GComplex_t > &)
 $(\partial_{1}(\cdot)\circ(\arccos,\mathrm{id}))\circ(\cos,\mathrm{id})$ derivative on sphere for complex scalar field.
ScalarFieldMP< GComplex_t > LaplaceS2 (const ScalarFieldMP< GComplex_t > &)
 Laplace operator on unit sphere for complex scalar field.
GReal_t normBoundNeumann (const GComplex_t &a00, const GComplex_t &H2S2aa)
 Upper estimate of the $C^{0}$ norm of $1 -$ a complex field for Neumann series.
GComplex_t optimalScalingNeumann (const GComplex_t &a00, const GComplex_t &H2S2aa)
 Scaling factor $a$, with which $\Vert1-a^{-1}A\Vert^2_{H_2^2}$ is minimized for a complex field $A$ on sphere.
ScalarFieldMP< GComplex_t > divideByNeumann (const ScalarFieldMP< GComplex_t > &a, const ScalarFieldMP< GReal_t > &f, const GReal_t norm, const GReal_t errortolerance)
 Division of a complex field by a complex field, using Neumann series.
ScalarFieldMP< GComplex_t > divideByNeumann (const ScalarFieldMP< GReal_t > &a, const ScalarFieldMP< GComplex_t > &f, const GReal_t norm, const GReal_t errortolerance)
ScalarFieldMP< GComplex_t > divideByNeumann (const ScalarFieldMP< GComplex_t > &a, const ScalarFieldMP< GComplex_t > &f, const GReal_t norm, const GReal_t errortolerance)
GReal_t tailErrorBoundS2 (const ScalarFieldMP< GComplex_t > &a, const int mup, const int mu, int *lmax, int *mmax)
 An upper bound for the tail sum in the $H_{\mu}^{2}$ norm, assuming that the field is in the space $H_{\mu'}^{2}$.
void maxEval (const unsigned int)
 Integration error tolerance parameters for functional field expansion by AGM routine.
unsigned int maxEval ()
void reqAbsError (const GReal_t)
GReal_t reqAbsError ()
void reqRelError (const GReal_t)
GReal_t reqRelError ()

Variables

const int SobolevOrderS2 = 1000000
 Maximal series expansion order for the numerical calculation of Sobolev related constants over the sphere.

Detailed Description

Multipole expansion classes and methods.


Function Documentation

Coeff<GComplex_t> gridripper::multipole::conj ( const Y &   ) 

Complex conjugate a coefficient.

ScalarFieldMP<GComplex_t> gridripper::multipole::conj ( const ScalarFieldMP< GComplex_t > &   ) 

Complex conjugate a scalarfield on sphere.

Based on: $\bar{Y}_{l}^{m} = (-1)^{m} Y_{l}^{-m}$.

ScalarFieldMP<GComplex_t> gridripper::multipole::divideByNeumann ( const ScalarFieldMP< GComplex_t > &  a,
const ScalarFieldMP< GReal_t > &  f,
const GReal_t  norm,
const GReal_t  errortolerance 
)

Division of a complex field by a complex field, using Neumann series.

Based on: $\sum_{n=0}^{N} (I-A)^{n} A = I - (I-A)^{N+1}$, where $I$ is the identity operator and $A$ is such an operator that $Ran(A)\in Dom(A)$. Specially, if $A$ is continuous, then it is absolute convergent if and only if $\Vert I-A\Vert<1$, furthermore $\Vert I - \sum_{n=0}^{N} (I-A)^{n} A\Vert \leq \Vert I-A\Vert^{N+1}$. If $A$ is a multiplication by a measurable function $a$, then equality holds instead of inequality, and $\Vert I-A\Vert^{N+1} = (\mathrm{ess-sup}|1-a|)^{N+1}$.

Parameters:
a : the field, which is in the nominator
f : the field to be divided
norm : an estimate for the essential supremum of $|1-a|$
tolerance : an error tolarance
Returns:
f/a : up to the specified error tolerance
ScalarFieldMP<GReal_t> gridripper::multipole::divideByNeumann ( const ScalarFieldMP< GReal_t > &  a,
const ScalarFieldMP< GReal_t > &  f,
const GReal_t  norm,
const GReal_t  errortolerance 
)

Division of a real field by a real field, using Neumann series.

Based on: same rule as for complex.

GReal_t gridripper::multipole::ExpPmIPhiYY_coupling ( const int  l1,
const int  m1,
const int  l2,
const int  sign 
)

The overlap integrals $\int_{0}^{\pi}\int_{0}^{2\pi} \mathrm{e}^{\pm\mathrm{i}\varphi} Y_{l_1}^{m_1}(\vartheta, \varphi) Y_{l_2}^{-(m_1\pm1)}(\vartheta, \varphi) \;\sin(\vartheta)\mathrm{d}\vartheta\,\mathrm{d}\varphi$.

Based on: idea from J. Phys. A31 (1998) 1101, and J. Phys. A32 (1999) 2601, and J. Phys. A35 (2002) 4187. Namely, on expanding of products of Y-s by Gaunt coefficients $G$. $\int_{0}^{\pi}\int_{0}^{2\pi} \mathrm{e}^{\pm\mathrm{i}\varphi} Y_{l_1}^{m_1}(\vartheta, \varphi) Y_{l_2}^{-(m_1\pm1)}(\vartheta, \varphi) \;\sin(\vartheta)\mathrm{d}\vartheta\,\mathrm{d}\varphi = \sum_{k=0}^{\min(l_1,l_2)} \pm G^{m_1,-(m_1\pm1),\pm1}_{l_1,l_2,|l_1-l_2|+2k} \int_{0}^{\pi}\int_{0}^{2\pi} Y^{1}_{|l_1-l_2|+2k}(\vartheta, \varphi) \exp(-\mathrm{i}\varphi) \;\sin{\vartheta}\mathrm{d}\vartheta\,\mathrm{d}\varphi$. This quantity is zero for: 1) $l_1<0$ or $l_2<0$, 2) $|m_1|>l_1$ or $|m_1\pm1|>l_2$, 3) $l_1+l_2$ even.

Numerically verified using a Maple code.

Version:
0.5, 04/01/2008
Since:
GridRipper 0.5
Author:
Andras Laszlo
unsigned int gridripper::multipole::ExpPmIPhiYY_coupling_size (  ) 

Show table size currently used in ExpPmIPhiYY_coupling.

ScalarFieldMP<GReal_t> gridripper::multipole::imag ( const ScalarFieldMP< GComplex_t > &   ) 

Imaginary part of a scalarfield on sphere.

GReal_t gridripper::multipole::intBarYl1mYl2m ( const int  l1,
const int  l2,
const int  m,
const GReal_t  theta,
tvector< tvector< tvector< GReal_t > > > *  coeffstorage 
)

Calculation of $\int_{[0,\theta]\times[0,2\pi]} \bar{Y}_{l_1}^{m} Y_{l_2}^{m} \;\mathrm{d}\lambda_{S^2}$.

Based on: expansion of $\bar{Y}_{l_1}^{m}Y_{l_2}^{m}$ product by using Gaunt coefficients. Result: $\int_{[0,\theta]\times[0,2\pi]} \bar{Y}_{l_1}^{m} Y_{l_2}^{m} \;\mathrm{d}\lambda_{S^2} = (-1)^{m} \sum_{k=0}^{\min(l_1, l_2)} G_{l_1,l_2,|l_1-l_2|+|l_1-l_2|\%2+2k}^{-m,m,0} \int_{[0,\theta]\times[0,2\pi]} Y_{|l_1-l_2|+|l_1-l_2|\%2+2k}^{0} \;\mathrm{d}\lambda_{S^2}$, $G$ being the Gaunt coefficients.

To avoid expensive evaluation, a table is stored (appended) to 'coeffstorage'. Initially should be empty, and should be different for every ' $\theta$'. If the pointer to 'coeffstorage' is NULL, the coefficients are not stored, but calculated each time.

Numerically verified using Maple.

Version:
0.5, 22/07/2008
Since:
GridRipper 0.5
Author:
Andras Laszlo
GReal_t gridripper::multipole::intYl0 ( const int  l,
const GReal_t  theta 
)

Calculation of $\int_{[0,\theta]\times[0,2\pi]} Y_{l}^{0} \;\mathrm{d}\lambda_{S^2}$.

Based on: $P_{l+1}^{0'}-P_{l-1}^{0'} = (2l+1) P_{l}^{0}$ (from Journal of Modern Optics 36 (1989) 685, but may be easily verified from Rodriguez formula). Result is: $\int_{[0,\theta]\times[0,2\pi]} Y_{l}^{0} \;\mathrm{d}\lambda_{S^2} = 2\pi ( \frac{1}{\sqrt{4\pi}}\delta_{l,0} - \frac{1}{\sqrt{(2l+1)(2l+3)}}Y_{l+1}^{0}(\theta, 0) + \frac{1}{\sqrt{(2l-1)(2l+1)}}Y_{l-1}^{0}(\theta, 0) )$.

Numerically verified using Maple.

Version:
0.5, 22/07/2008
Since:
GridRipper 0.5
Author:
Andras Laszlo
GReal_t gridripper::multipole::intYl1ExpMIPhi ( const int  l  ) 

Calculation of $\int_{0}^{2\pi}\int_{0}^{\pi} Y_{l}^{1}(\vartheta, \varphi) \exp(-\mathrm{i}\varphi) \sin(\vartheta)\;\mathrm{d}\vartheta\,\mathrm{d}\varphi$.

Based on: formula in J. Phys. A32 (1999) 2601. Namely: $\int_{-1}^{1} P^{1}_{l}(x) \;\mathrm{d}x = \frac{(-1)^{l}-1}{2} \frac{l}{l+1} \left(\frac{\Gamma(l/2)}{((l-1)/2)!}\right)^{2} = \frac{(-1)^{l}-1}{2} \pi \frac{l}{l+1} \left(\prod_{k=1}^{(l-1)/2} \frac{l/2-k}{(l+1)/2-k}\right)^{2} = \frac{(-1)^{l}-1}{2} \pi \frac{l}{l+1} \prod_{n=1}^{(l-1)/2} \left(\frac{n-1/2}{n}\right)^{2}$ delivers final result (which is zero for even $l$). Thus: $\int_{0}^{2\pi}\int_{0}^{\pi} Y_{l}^{1}(\vartheta, \varphi) \exp(-\mathrm{i}\varphi) \sin(\vartheta)\;\mathrm{d}\vartheta\,\mathrm{d}\varphi = \frac{(-1)^{l}-1}{2} \sqrt{\pi^{3} \frac{l(2l+1)}{(l+1)^{3}}} \prod_{n=1}^{(l-1)/2} \left(\frac{n-1/2}{n}\right)^{2}$ delivers final result (which is zero for even $l$).

Numerically verified using a Maple and Mathematica code.

Version:
0.5, 04/01/2008
Since:
GridRipper 0.5
Author:
Andras Laszlo
GComplex_t gridripper::multipole::L2S2 ( const ScalarFieldMP< GComplex_t > &  ,
const ScalarFieldMP< GReal_t > &   
)

L^2 scalarproduct of fields.

Based on: $\int_{0}^{\pi}\int_{0}^{2\pi} \bar{Y_{l_1}^{m_1}(\vartheta,\varphi)} Y_{l_2}^{m_2}(\vartheta,\varphi) \;\sin(\vartheta)\mathrm{d}\vartheta\,\mathrm{d}\varphi = \delta_{l_1, l_2}\delta_{m_1, m_2}$.

GReal_t gridripper::multipole::L2S2 ( const ScalarFieldMP< GReal_t > &  ,
const ScalarFieldMP< GReal_t > &   
)

L^2 scalarproduct of two fields on sphere.

Based on: $\int_{0}^{\pi}\int_{0}^{2\pi} Yre_{l_1}^{m_1}(\vartheta,\varphi) Yre_{l_2}^{m_2}(\vartheta,\varphi) \;\sin(\vartheta)\mathrm{d}\vartheta\,\mathrm{d}\varphi = \delta_{l_1, l_2}\delta_{m_1, m_2}$.

GComplex_t gridripper::multipole::L2S2limited ( const ScalarFieldMP< GComplex_t > &  ,
const ScalarFieldMP< GComplex_t > &  ,
const GReal_t  theta,
tvector< tvector< tvector< GReal_t > > > *  coeffstorage 
)

$L^2$ scalarproduct of fields, with limited integration domain to $[0,\theta]\times[0,2\pi]$.

Based on the Gaunt expansion of spherical harmonic products. (See Gaunt.h and Gaunt.cxx.) The necessary coefficient matrix is stored (appended) to 'coeffstorage', for a given ' $\vartheta$'. Should be empty initially for a given ' $\vartheta$'. If the pointer to 'coeffstorage' is NULL, the coefficient matrix is not stored in table, but calculated every time.

ScalarFieldMP<GReal_t> gridripper::multipole::LaplaceS2 ( const ScalarFieldMP< GReal_t > &   ) 

Laplace operator on unit sphere for real scalar field.

Based on: $(\frac{1}{\sin(\vartheta)}\partial_{\vartheta}\sin(\vartheta)\partial_{\vartheta} + \frac{1}{\sin^{2}(\vartheta)}\partial_{\varphi}\partial_{\varphi}) Yre_{l}^{m} = -l(l+1) Yre_{l}^{m}$.

ScalarFieldMP<GComplex_t> gridripper::multipole::LaplaceS2 ( const ScalarFieldMP< GComplex_t > &   ) 

Laplace operator on unit sphere for complex scalar field.

Based on: $(\frac{1}{\sin(\vartheta)}\partial_{\vartheta}\sin(\vartheta)\partial_{\vartheta} + \frac{1}{\sin^{2}(\vartheta)}\partial_{\varphi}\partial_{\varphi}) Y_{l}^{m} = -l(l+1) Y_{l}^{m}$.

ScalarFieldMP<GComplex_t> gridripper::multipole::mulCosTheta ( const ScalarFieldMP< GComplex_t > &   ) 

Multiplication operator by $\cos(\vartheta)$.

Based on: $\cos(\vartheta) Y_{l}^{m} = \sqrt{\frac{(l-m)(l+m)}{(2l-1)(2l+1)}} Y_{l-1}^{m} + + \sqrt{\frac{(l+1-m)(l+1+m)}{(2l+1)(2l+3)}} Y_{l+1}^{m}$. Numerically verified by a C++ code.

ScalarFieldMP<GReal_t> gridripper::multipole::mulCosTheta ( const ScalarFieldMP< GReal_t > &   ) 

Multiplication operator by $\cos(\vartheta)$.

Based on the rule for Y basis. Numerically verified using a C++ code.

ScalarFieldMP<GComplex_t> gridripper::multipole::mulCosThetaSqr ( const ScalarFieldMP< GComplex_t > &   ) 

Multiplication operator by $\cos(\vartheta)^2$.

Based on: $\cos(\vartheta)^{2} Y_{l}^{m} = \sqrt{\frac{(l-1-m)(l-m)(l-1+m)(l+m)} {(2l-3)(2l-1)(2l-1)(2l+1)}} Y_{l-2}^{m} + \left(\frac{(l-m)(l+m)}{(2l-1)(2l+1)}+\frac{(l+1-m)(l+1+m)}{(2l+1)(2l+3)}\right) Y_{l}^{m} + \sqrt{\frac{(l+1-m)(l+2-m)(l+1+m)(l+2+m)} {(2l+1)(2l+3)(2l+3)(2l+5)}} Y_{l+2}^{m}$. Numerically verified by a C++ code.

ScalarFieldMP<GReal_t> gridripper::multipole::mulCosThetaSqr ( const ScalarFieldMP< GReal_t > &   ) 

Multiplication operator by $\cos(\vartheta)^2$.

Based on the rule for Y basis. Numerically verified using a C++ code.

ScalarFieldMP<GComplex_t> gridripper::multipole::mulExpPmIPhi ( const ScalarFieldMP< GComplex_t > &  ,
const int  sign 
)

Multiplication operator by $\mathrm{e}^{\pm\mathrm{i}\varphi}$.

Based on: matrix elements is Gaunt.h, Gaunt.cxx. Numerically verified by a Maple code.

ScalarFieldMP<GComplex_t> gridripper::multipole::mulSinThetaSqr ( const ScalarFieldMP< GComplex_t > &   ) 

Multiplication operator by $\sin(\vartheta)^2$.

Based on: $\cos(\vartheta)^2$. Numerically verified by a C++ code.

ScalarFieldMP<GReal_t> gridripper::multipole::mulSinThetaSqr ( const ScalarFieldMP< GReal_t > &   ) 

Multiplication operator by $\sin(\vartheta)^2$.

Based on: $\cos(\vartheta)^2$. Numerically verified using a C++ code.

GReal_t gridripper::multipole::normBoundNeumann ( const GComplex_t &  a00,
const GComplex_t &  H2S2aa 
)

Upper estimate of the $C^{0}$ norm of $1 -$ a complex field for Neumann series.

Based on: the Sobolev inequality, namely $\Vert\cdot\Vert_{C^{0}} \leq C\Vert\cdot\Vert_{H_2^2}$.

Parameters:
a00 : the (0, 0) multipole component of the field
H2S2aa : the $\left<a, a\right>_{H_2^2}$ scalar product
GReal_t gridripper::multipole::normBoundNeumann ( const GReal_t  a00,
const GReal_t  H2S2aa 
)

Upper estimate of the $C^{0}$ norm of $1 -$ a real field for Neumann series expansion.

Based on: the $H_2^2$ Sobolev inequality, namely $\Vert\cdot\Vert_{C^{0}} \leq C\Vert\cdot\Vert_{H_2^2}$.

Parameters:
a00 : the (0, 0) multipole component of the field
H2S2aa : the $\left<a, a\right>_{H_2^2}$ scalar product
Coeff<GReal_t> gridripper::multipole::operator* ( const   GReal_t,
const Coeff< GReal_t > &   
)

Multiply a coefficient by a number.

Coeff<GReal_t> gridripper::multipole::operator* ( const   GReal_t,
const Yre &   
)

Tensor product of a number and an Yre.

Coeff<GComplex_t> gridripper::multipole::operator* ( const   GReal_t,
const Y &   
)

Tensor product of a number and an Y.

Coeff<GComplex_t> gridripper::multipole::operator* ( const   GReal_t,
const Coeff< GComplex_t > &   
)

Multiply a coefficient by a number.

ScalarFieldMP<GReal_t> gridripper::multipole::operator+ ( const ScalarFieldMP< GReal_t > &  ,
const ScalarFieldMP< GReal_t > &   
)

ScalarFieldMP<GReal_t> algebraic operators.

ScalarFieldMP<GComplex_t> gridripper::multipole::operator+ ( const ScalarFieldMP< GComplex_t > &  ,
const ScalarFieldMP< GComplex_t > &   
)

ScalarFieldMP<GComplex_t> algebraic operators.

Coeff<GReal_t> gridripper::multipole::operator- ( const Yre &   ) 

Negative of a coefficient.

Coeff<GComplex_t> gridripper::multipole::operator- ( const Y &   ) 

Negative of a coefficient.

Coeff<GComplex_t> gridripper::multipole::operator/ ( const Coeff< GComplex_t > &  ,
const   GReal_t 
)

Divide a coefficient by a number.

Coeff<GReal_t> gridripper::multipole::operator/ ( const Yre &  ,
const   GReal_t 
)

Tensor quotient of a number and an Yre.

Coeff<GReal_t> gridripper::multipole::operator/ ( const Coeff< GReal_t > &  ,
const   GReal_t 
)

Divide a coefficient by a number.

Coeff<GComplex_t> gridripper::multipole::operator/ ( const Y &  ,
const   GReal_t 
)

Tensor quotient of a number and an Y.

GReal_t gridripper::multipole::optimalScalingNeumann ( const GReal_t  a00,
const GReal_t  H2S2aa 
)

Scaling factor $a$, with which $\Vert1-a^{-1}A\Vert^2_{H_2^2}$ is minimized for a real field $A$ on sphere.

It is: $a=\frac{\Vert A\Vert^{2}_{H_2^2}}{\sqrt{4\pi}|A_{0}^{0}|^{2}}A_{0}^{0}$.

Parameters:
a00 : the (0, 0) multipole component of the field
H2S2aa : the $\left<a, a\right>_{H_2^2}$ scalar product
GComplex_t gridripper::multipole::optimalScalingNeumann ( const GComplex_t &  a00,
const GComplex_t &  H2S2aa 
)

Scaling factor $a$, with which $\Vert1-a^{-1}A\Vert^2_{H_2^2}$ is minimized for a complex field $A$ on sphere.

It is: $a=\frac{\Vert A\Vert^{2}_{H_2^2}}{\sqrt{4\pi}|A_{0}^{0}|^{2}}A_{0}^{0}$.

Parameters:
a00 : the (0, 0) multipole component of the field
H2S2aa : the $\left<a, a\right>_{H_2^2}$ scalar product
ScalarFieldMP<GReal_t> gridripper::multipole::partial_phi ( const ScalarFieldMP< GReal_t > &   ) 

$\varphi$ derivative on sphere for real scalar field.

Based on: $\partial_{\varphi} Yre_{l}^{m} = -m Yre_{l}^{-m}$.

ScalarFieldMP<GComplex_t> gridripper::multipole::partial_phi ( const ScalarFieldMP< GComplex_t > &   ) 

$\varphi$ derivative on sphere for complex scalar field.

Based on: $\partial_{\varphi} Y_{l}^{m} = \mathrm{i}m Y_{l}^{m}$.

ScalarFieldMP<GComplex_t> gridripper::multipole::partial_theta ( const ScalarFieldMP< GComplex_t > &   ) 

$\partial_{\vartheta}$ derivative on sphere for complex field.

Based on the stepping operators and on the matrix elements of the multiplication operator by $\mathrm{e}^{\pm\mathrm{i}\varphi}$ (Gaunt.h and Gaunt.cxx). Numerically verified by a Maple code.

ScalarFieldMP<GComplex_t> gridripper::multipole::partial_x ( const ScalarFieldMP< GComplex_t > &   ) 

$(\partial_{1}(\cdot)\circ(\arccos,\mathrm{id}))\circ(\cos,\mathrm{id})$ derivative on sphere for complex scalar field.

(' $x$'-derivative, $x=\cos(\vartheta)$.) From Journal of Modern Optics 36 (1989) 685: $P_{l+1}^{0'}-P_{l-1}^{0'} = (2l+1) P_{l}^{0}$ (easily verified from Rodriguez formula). Thus: $P_{l}^{0'} = \sum_{k=0}^{(l-l\%2)/2-(1-l\%2)} (2(2k+(1-l\%2))+1) P_{2k+(1-l\%2)}^{0}$. Thus: $(\partial_{1} Y_{l}^{0}\circ(\arccos,\mathrm{id}))\circ(\cos,\mathrm{id}) = (\sqrt{2l+1} \sum_{k=0}^{(l-l\%2)/2-(1-l\%2)} \sqrt{2(2k+(1-l\%2))+1} Y_{2k+(1-l\%2)}^{0})$. Not implemented for $m\neq0$. Not even all $Y_{l}^{m}$ is in its domain in the $L^2$ sense. Numerically verified using a C++ code.

ScalarFieldMP<GReal_t> gridripper::multipole::partial_x ( const ScalarFieldMP< GReal_t > &   ) 

( $\partial_{1}(\cdot)\circ(\arccos,\mathrm{id}))\circ(\cos,\mathrm{id})$ derivative on sphere for real scalar field.

(' $x$'-derivative, $x=\cos(\vartheta)$.) Based on the rule for Y basis. Not implemented for $m\neq0$. Not even all $Yre_{l}^{m}$ is in its domain in the L^2 sense if $m\neq0$. Numerically verified using a C++ code.

ScalarFieldMP<GReal_t> gridripper::multipole::real ( const ScalarFieldMP< GComplex_t > &   ) 

Real part of a scalarfield on sphere.

ScalarFieldMP<GReal_t> gridripper::multipole::reflect ( const ScalarFieldMP< GReal_t > &   ) 

Reflect with respect to origin (parity operator).

Based on: $P Yre_{l}^{m} = (-1)^{l} Yre_{l}^{m}$.

ScalarFieldMP<GComplex_t> gridripper::multipole::reflect ( const ScalarFieldMP< GComplex_t > &   ) 

Reflect with respect to origin (parity operator).

Based on: $P Y_{l}^{m} = (-1)^{l} Y_{l}^{m}$.

ScalarFieldMP<GComplex_t> gridripper::multipole::sinTheta_partial_theta ( const ScalarFieldMP< GComplex_t > &   ) 

$\sin(\vartheta)\partial_{\vartheta}$ derivative on sphere for complex scalar field.

Based on: $-\sin(\vartheta)\partial_{\vartheta} Y_{l}^{m} = (l+1)\sqrt{\frac{(l-m)(l+m)}{(2l-1)(2l+1)}} Y_{l-1}^{m} - l\sqrt{\frac{(l+1-m)(l+1+m)}{(2l+1)(2l+3)}} Y_{l+1}^{m}$. Numerically verified using a C++ code.

ScalarFieldMP<GReal_t> gridripper::multipole::sinTheta_partial_theta ( const ScalarFieldMP< GReal_t > &   ) 

$\sin(\vartheta)\partial_{\vartheta}$ derivative on sphere for real scalar field.

Based on the rule for Y basis. Numerically verified using a C++ code.

GReal_t gridripper::multipole::SobolevConstantS2 ( const int  m  ) 

The minimal Sobolev constant in the inequality over the sphere: $\Vert\cdot\Vert_{C^{0}} \leq C \Vert\cdot\Vert_{H^{2}_{\mu}}$.

It is the sum $\sqrt{\frac{1}{4\pi}\sum_{l=0}^{\infty} (2l+1)\frac{l(l+1)-1}{(l(l+1))^{\mu+1}-1}}$.

ScalarFieldMP<GReal_t> gridripper::multipole::Sqr_partial_phi ( const ScalarFieldMP< GReal_t > &   ) 

Second $\varphi$ derivative on sphere for real scalar field.

Based on: $\partial_{\varphi}\partial_{\varphi} Yre_{l}^{m} = -m^{2} Yre_{l}^{m}$.

ScalarFieldMP<GComplex_t> gridripper::multipole::Sqr_partial_phi ( const ScalarFieldMP< GComplex_t > &   ) 

Second $\varphi$ derivative on sphere for complex scalar field.

Based on: $\partial_{\varphi}\partial_{\varphi} Y_{l}^{m} = -m^{2} Y_{l}^{m}$.

ScalarFieldMP<GComplex_t> gridripper::multipole::stepping ( const ScalarFieldMP< GComplex_t > &  ,
const int  upOrDown 
)

Stepping up and down operators.

Based on: $\mathrm{e}^{\mathrm{i}\varphi} (\partial_{\vartheta} + \cot(\vartheta)\mathrm{i}\partial_{\phi}) Y_{l}^{m} = \sqrt{l(l+1)-m(m+1)} Y_{l}^{m+1}$ (stepping up, $L_{+}$ operator). $\mathrm{e}^{-\mathrm{i}\varphi} (-\partial_{\vartheta} + \cot(\vartheta)\mathrm{i}\partial_{\phi}) Y_{l}^{m} = \sqrt{l(l+1)-m(m-1)} Y_{l}^{m-1}$ (stepping down, $L_{-}$ operator).

Numerically verified using a C++ code.

GReal_t gridripper::multipole::tailErrorBoundS2 ( const ScalarFieldMP< GReal_t > &  ,
const int  mup,
const int  mu,
int *  lmax,
int *  mmax 
)

An upper bound for the tail sum in $H_{\mu}^{2}$ norm, assuming that the field is in the space $H_{\mu'}^2$.

Based on: same rule for complex.

GReal_t gridripper::multipole::tailErrorBoundS2 ( const ScalarFieldMP< GComplex_t > &  a,
const int  mup,
const int  mu,
int *  lmax,
int *  mmax 
)

An upper bound for the tail sum in the $H_{\mu}^{2}$ norm, assuming that the field is in the space $H_{\mu'}^{2}$.

In this case, its multipole coefficients may be bound by the sequence $l \mapsto K \cdot \sqrt{\frac{l(l+1)-1}{(l(l+1))^{\mu'+1}-1}}\frac{1}{2l+1}$. By adjusting $K$ to the stored coefficients, and by summing up the tail of this bound in the $H_{\mu}^2$ norm, one gets an upper estimate for the $H_{\mu}^2$ norm of the tail error.

GReal_t gridripper::multipole::YreYreYre_coupling ( const int  l1,
const int  l2,
const int  l3,
const int  m1,
const int  m2,
const int  m3 
)

The same coupling for Yre basis.

They are real valued as Yre -s are real valued. Zero if not: 1) $l_1\geq 0$ and $l_2\geq 0$ and $l_3\geq 0$, and 2) $|m_1|\leq l_1$ and $|m2|\leq l_2$ and $|m_3|\leq l_3$, and 3) $|l_1-l_2|\leq l_3$ and $l_3\leq l_1+l_2$, and 4) only zero or two of the $\{m_1, m_2, m_3\}$ are negative, and 5) $(l_1+l_2+l_3)\%2=0$. See Bases.h for definition of Yre basis.

Not tested numerically. Not used so far in multiplication operator.

Version:
0.5, 01/31/2007
Since:
GridRipper 0.5
Author:
Andras Laszlo
GComplex_t gridripper::multipole::YYreY_coupling ( const int  l1,
const int  l2,
const int  l3,
const int  m1,
const int  m2,
const int  m3 
)

Similar coupling for Y and Yre basis.

They are not necessarily real valued. Zero if not: 1) $l_1\geq 0$ and $l_2\geq 0$ and $l_3\geq 0$, and 2) $|m_1|\leq l_1$ and $|m_2|\leq l_2$ and $|m_3|\leq l_3$, and 3) $|l_1-l_2|\leq l_3$ and $l_3\leq l_1+l_2$, and 4) $m_1+m_2+m_3=0$ or $m_1-m_2+m_3=0$, and 5) $(l_1+l_2+l_3)\%2=0$.

Not tested numerically. Not used so far in multiplication operator.

Version:
0.5, 01/31/2007
Since:
GridRipper 0.5
Author:
Andras Laszlo
GReal_t gridripper::multipole::YYY_coupling ( const int  l1,
const int  l2,
const int  l3,
const int  m1,
const int  m2,
const int  m3 
)

The $ \int_{0}^{\pi}\int_{0}^{2\pi} Y_{l_1}^{m_1}(\vartheta, \varphi) Y_{l_2}^{m_2}(\vartheta, \varphi) Y_{l_3}^{m_3}(\vartheta, \varphi) \;\sin(\vartheta)\mathrm{d}\vartheta\,\mathrm{d}\varphi $ spherical harmonic function Gaunt coefficient calculator routine.

Zero if not: 1) $l_1\geq 0$ and $l_2\geq 0$ and $l_3\geq 0$, and 2) $|m_1|\leq l_1$ and $|m_2|\leq l_2$ and $|m_3|\leq l_3$, and 3) $|l_1-l_2|\leq l_3$ and $l_3\leq l_1+l_2$, and 4) $m_1+m_2+m_3=0$, and 5) $(l_1+l_2+l_3)\%2=0$. Thus, by 4), they are real valued, which is not obvious otherwise. See Bases.h for definition of Y basis.

Numerically verified using Maple.

Version:
0.5, 01/31/2007
Since:
GridRipper 0.5
Author:
Andras Laszlo
unsigned int gridripper::multipole::YYY_coupling_size (  ) 

Show table size currently used in YYY_coupling.

bool gridripper::multipole::YYY_coupling_zeros ( const int  l1,
const int  l2,
const int  l3,
const int  m1,
const int  m2,
const int  m3 
)

Returns true if the Gaunt coefficient of given index is known to be zero.

I.e. returns true if the output of YYY_coupling is not needed to be stored, as it will be zero anyway.

Numerically verified using Maple.

Version:
1.0, 22/04/2011
Since:
GridRipper 1.0
Author:
Andras Laszlo