SpECTRE  v2024.03.19
Spectral::Swsh::SpinWeightedSphericalHarmonic Class Reference

A utility for evaluating a particular spin-weighted spherical harmonic function at arbitrary points. More...

#include <SwshInterpolation.hpp>

Public Member Functions

 SpinWeightedSphericalHarmonic (int spin, size_t l, int m)
 
void evaluate (gsl::not_null< ComplexDataVector * > result, const DataVector &theta, const DataVector &phi, const DataVector &sin_theta_over_2, const DataVector &cos_theta_over_2) const
 
ComplexDataVector evaluate (const DataVector &theta, const DataVector &phi, const DataVector &sin_theta_over_2, const DataVector &cos_theta_over_2) const
 Return by value the spin-weighted spherical harmonic evaluated at theta and phi. More...
 
std::complex< double > evaluate (double theta, double phi) const
 Return by value the spin-weighted spherical harmonic evaluated at theta and phi.
 
void pup (PUP::er &p)
 Serialization for Charm++.
 

Detailed Description

A utility for evaluating a particular spin-weighted spherical harmonic function at arbitrary points.

Warning
This should NOT be used for interpolation; such an evaluation strategy is hopelessly slow compared to Clenshaw recurrence strategies. Instead use SwshInterpolator.

Member Function Documentation

◆ evaluate() [1/2]

ComplexDataVector Spectral::Swsh::SpinWeightedSphericalHarmonic::evaluate ( const DataVector theta,
const DataVector phi,
const DataVector sin_theta_over_2,
const DataVector cos_theta_over_2 
) const

Return by value the spin-weighted spherical harmonic evaluated at theta and phi.

Details

The additional values sin_theta_over_2 and cos_theta_over_2, representing \(\sin(\theta/2)\) and \(\cos(\theta/2)\) are taken as required input to improve the speed of evaluation when called more than once.

◆ evaluate() [2/2]

void Spectral::Swsh::SpinWeightedSphericalHarmonic::evaluate ( gsl::not_null< ComplexDataVector * >  result,
const DataVector theta,
const DataVector phi,
const DataVector sin_theta_over_2,
const DataVector cos_theta_over_2 
) const

Return by pointer the values of the spin-weighted spherical harmonic evaluated at theta and phi.

Details

The additional values sin_theta_over_2 and cos_theta_over_2, representing \(\sin(\theta/2)\) and \(\cos(\theta/2)\) are taken as required input to improve the speed of evaluation when called more than once.

The formula we evaluate (with various prefactors precomputed, cached, and optimized from the factorials) is [75]

\begin{align*} {}_s Y_{l m} = (-1)^m \sqrt{\frac{(l + m)! (l-m)! (2l + 1)} {4 \pi (l + s)! (l - s)!}} \sin^{2 l}(\theta / 2) \sum_{r = 0}^{l - s} {l - s \choose r} {l + s \choose r + s - m} (-1)^{l - r - s} e^{i m \phi} \cot^{2 r + s - m}(\theta / 2). \end{align*}


The documentation for this class was generated from the following file: