Spin-weighted spherical harmonics

## Classes

struct  Spectral::Swsh::Tags::Eth
Struct for labeling the $\eth$ spin-weighted derivative in tags. More...

struct  Spectral::Swsh::Tags::Ethbar
Struct for labeling the $\bar{\eth}$ spin-weighted derivative in tags. More...

struct  Spectral::Swsh::Tags::EthEth
Struct for labeling the $\eth^2$ spin-weighted derivative in tags. More...

struct  Spectral::Swsh::Tags::EthbarEth
Struct for labeling the $\bar{\eth} \eth$ spin-weighted derivative in tags. More...

struct  Spectral::Swsh::Tags::EthEthbar
Struct for labeling the $\eth \bar{\eth}$ spin-weighted derivative in tags. More...

struct  Spectral::Swsh::Tags::EthbarEthbar
Struct for labeling the $\bar{\eth}^2$ spin-weighted derivative in tags. More...

struct  Spectral::Swsh::Tags::Derivative< Tag, DerivativeKind >
Prefix tag representing the spin-weighted derivative of a spin-weighted scalar. More...

struct  Spectral::Swsh::Tags::SwshTransform< Tag >
Prefix tag representing the spin-weighted spherical harmonic transform of a spin-weighted scalar. More...

class  Spectral::Swsh::TransformJob< Spin, Representation, TagList >
A class which gathers all necessary shared structure among several spin-weighted spherical harmonic transforms and dispatches to libsharp. Each TransformJob represents exactly one spin-weighted transform libsharp execution call, and one inverse transform libsharp execution call. More...

## Typedefs

template<int Spin, typename TagList >
using Spectral::Swsh::get_tags_with_spin = tmpl::remove_duplicates< tmpl::filter< TagList, detail::has_spin< tmpl::_1, std::integral_constant< int, Spin > >> >
Extract from TagList the subset of those tags that have a static int member spin equal to the template parameter Spin. More...

template<int Spin, typename TagList >
using Spectral::Swsh::get_prefix_tags_that_wrap_tags_with_spin = tmpl::filter< TagList, tmpl::bind< detail::wrapped_has_spin, tmpl::_1, std::integral_constant< int, Spin > >>
Extract from TagList the subset of those tags that wrap a tag that has a static int member spin equal to the template parameter Spin. More...

## Functions

constexpr size_t Spectral::Swsh::number_of_swsh_coefficients (const size_t l_max) noexcept
Convenience function for determining the number of spin-weighted spherical harmonics coefficients that are stored for a given l_max

constexpr double Spectral::Swsh::sharp_swsh_sign_change (const int from_spin_weight, const int to_spin_weight, const bool real) noexcept
Compute the relative sign change necessary to convert between the libsharp basis for spin weight from_spin_weight to the basis for spin weight to_spin_weight, for the real component coefficients if real is true, otherwise for the imaginary component coefficients. The sign change for a given coefficient is equivalent to the product of sharp_swsh_sign(from_spin, m, real) * sharp_swsh_sign(to_spin, m, real). Due to the form of the signs, it does not end up depending on m (the m's in the power of $-1$'s cancel). For full details of the libsharp sign conventions, see the documentation for TransformJob. More...

constexpr double Spectral::Swsh::sharp_swsh_sign (const int spin_weight, const int m, const bool real) noexcept
Compute the sign change between the libsharp convention and the set of spin-weighted spherical harmonics given by the relation to the Wigner rotation matrices. More...

constexpr size_t Spectral::Swsh::number_of_swsh_collocation_points (const size_t l_max) noexcept
Convenience function for determining the number of spin-weighted spherical harmonic collocation values that are stored for a given l_max for a libsharp-compatible set of collocation points.

## Detailed Description

Utilities, tags, and metafunctions for using and manipulating spin-weighted spherical harmonics

## ◆ get_prefix_tags_that_wrap_tags_with_spin

template<int Spin, typename TagList >
 using Spectral::Swsh::get_prefix_tags_that_wrap_tags_with_spin = typedef tmpl::filter >>

Extract from TagList the subset of those tags that wrap a tag that has a static int member spin equal to the template parameter Spin.

using WrappedTagList = tmpl::list<Derivative<SpinMinus1TestTag, Eth>,
Derivative<SpinMinus1TestTag, EthEthbar>,
Derivative<AnotherSpinMinus1TestTag, EthEth>,
Derivative<Spin2TestTag, Ethbar>>;
static_assert(cpp17::is_same_v<
get_prefix_tags_that_wrap_tags_with_spin<-1, WrappedTagList>,
tmpl::list<Derivative<SpinMinus1TestTag, Eth>,
Derivative<SpinMinus1TestTag, EthEthbar>,
Derivative<AnotherSpinMinus1TestTag, EthEth>>>,
"failed testing get_wrapped_tags_with_spin_from_prefix_tag_list");

## ◆ get_tags_with_spin

template<int Spin, typename TagList >
 using Spectral::Swsh::get_tags_with_spin = typedef tmpl::remove_duplicates >> >

Extract from TagList the subset of those tags that have a static int member spin equal to the template parameter Spin.

using TestVarTagList = tmpl::list<SpinMinus1TestTag, SpinMinus1TestTag,
AnotherSpinMinus1TestTag, Spin2TestTag>;
static_assert(
cpp17::is_same_v<get_tags_with_spin<-1, TestVarTagList>,
tmpl::list<SpinMinus1TestTag, AnotherSpinMinus1TestTag>>,
"failed testing get_tags_with_spin");
using TestDerivativeTagList =
tmpl::list<Derivative<SpinMinus1TestTag, Eth>,
Derivative<SpinMinus1TestTag, EthEthbar>,
Derivative<AnotherSpinMinus1TestTag, EthEth>,
Derivative<Spin2TestTag, Ethbar>>;
static_assert(
cpp17::is_same_v<get_tags_with_spin<1, TestDerivativeTagList>,
tmpl::list<Derivative<AnotherSpinMinus1TestTag, EthEth>,
Derivative<Spin2TestTag, Ethbar>>>,
"failed testing get_tags_with_spin");

## ◆ sharp_swsh_sign()

 constexpr double Spectral::Swsh::sharp_swsh_sign ( const int spin_weight, const int m, const bool real )
noexcept

Compute the sign change between the libsharp convention and the set of spin-weighted spherical harmonics given by the relation to the Wigner rotation matrices.

### Details

The sign change is obtained via the difference between the libsharp convention and the convention which uses:

${}_s Y_{\ell m} (\theta, \phi) = (-1)^m \sqrt{\frac{2 l + 1}{4 \pi}} D^{\ell}{}_{-m s}(\phi, \theta, 0).$

See [11]. The sign change is computed for the real component coefficients if real is true, otherwise for the imaginary component coefficients. For full details on the sign convention used in libsharp, see the documentation for TransformJob. This function outputs the $\mathrm{sign}(m, s, \mathrm{real})$ necessary to produce the conversion between Goldberg moments and libsharp moments:

\begin{align*} {}_s Y_{\ell m}^{\mathrm{real}, \mathrm{sharp}} =& \mathrm{sign}(m, s, \mathrm{real=true}) {}_s Y_{\ell m}^{\mathrm{Goldberg}}\\ {}_s Y_{\ell m}^{\mathrm{imag}, \mathrm{sharp}} =& \mathrm{sign}(m, s, \mathrm{real=false}) {}_s Y_{\ell m}^{\mathrm{Goldberg}}. \end{align*}

Note that in this equation, the "real" and "imag" superscripts refer to the set of basis functions used for the decomposition of the real and imaginary part of the spin-weighted collocation points, not real or imaginary parts of the basis functions themselves.

## ◆ sharp_swsh_sign_change()

 constexpr double Spectral::Swsh::sharp_swsh_sign_change ( const int from_spin_weight, const int to_spin_weight, const bool real )
noexcept

Compute the relative sign change necessary to convert between the libsharp basis for spin weight from_spin_weight to the basis for spin weight to_spin_weight, for the real component coefficients if real is true, otherwise for the imaginary component coefficients. The sign change for a given coefficient is equivalent to the product of sharp_swsh_sign(from_spin, m, real) * sharp_swsh_sign(to_spin, m, real). Due to the form of the signs, it does not end up depending on m (the m's in the power of $-1$'s cancel). For full details of the libsharp sign conventions, see the documentation for TransformJob.

### Details

The sign change is obtained by the difference between the libsharp convention and the convention which uses:

${}_s Y_{\ell m} (\theta, \phi) = (-1)^m \sqrt{\frac{2 l + 1}{4 \pi}} D^{\ell}{}_{-m s}(\phi, \theta, 0).$

See [11]