SpECTRE  v2024.04.12
Spectral::Swsh::SwshTransform< TagList, Representation > Struct Template Reference

A DataBox mutate-compatible computational struct for performing several spin-weighted spherical harmonic transforms. Internally dispatches to libsharp. More...

Detailed Description

template<typename TagList, ComplexRepresentation Representation = ComplexRepresentation::Interleaved>
struct Spectral::Swsh::SwshTransform< TagList, Representation >

A DataBox mutate-compatible computational struct for performing several spin-weighted spherical harmonic transforms. Internally dispatches to libsharp.

Details

Template Parameters:

  • Representation: The element of the ComplexRepresentation enum which parameterizes how the data passed to libsharp will be represented. Two options are available:

    • ComplexRepresentation:Interleaved: indicates that the real and imaginary parts of the collocation values will be passed to libsharp as pointers into existing complex data structures, minimizing copies, but maintaining a stride of 2 for 'adjacent' real or imaginary values.
    • ComplexRepresentation::RealsThenImags: indicates that the real and imaginary parts of the collocation values will be passed to libsharp as separate contiguous blocks. At current, this introduces both allocations and copies. optimization note In the future most of the allocations can be aggregated to calling code, which would pass in buffers by not_null pointers.

    For performance-sensitive code, both options should be tested, as each strategy has trade-offs.

  • TagList: A tmpl::list of Tags to be forward transformed. The tags must represent the nodal data.
Note
The signs obtained from libsharp transformations must be handled carefully. (In particular, it does not use the sign convention you will find in [Wikipedia] (https://en.wikipedia.org/wiki/Spin-weighted_spherical_harmonics)).
  • libsharp deals only with the transformation of real values, so transformation of complex values must be done for real and imaginary parts separately.
  • due to only transforming real components, it stores only the positive \(m\) modes (as the rest would be redundant). Therefore, the negative \(m\) modes must be inferred from conjugation and further sign changes.
  • libsharp only has the capability of transforming positive spin weighted quantities. Therefore, additional steps are taken (involving further conjugation of the provided data) in order to use those utilities on negative spin-weighted quantities. The resulting modes have yet more sign changes that must be taken into account.

The decomposition resulting from the libsharp transform for spin \(s\) and complex spin-weighted \({}_s f\) can be represented mathematically as:

\begin{align*} {}_s f(\theta, \phi) = \sum_{\ell = 0}^{\ell_\mathrm{max}} \Bigg\{& \left(\sum_{m = 0}^{\ell} a^\mathrm{sharp, real}_{l m} {}_s Y_{\ell m}^\mathrm{sharp, real}\right) + \left(\sum_{m=1}^{\ell} \left(a^\mathrm{sharp, real}_{l m}{}\right)^* {}_s Y_{\ell -m}^\mathrm{sharp, real}\right) \notag\\ &+ i \left[\left(\sum_{m = 0}^{\ell} a^\mathrm{sharp, imag}_{l m} {}_s Y_{\ell m}^\mathrm{sharp, imag}\right) + \left(\sum_{m=1}^{\ell} \left(a^\mathrm{sharp, imag}_{l m}{}\right)^* {}_s Y_{\ell -m}^\mathrm{sharp, imag} \right)\right] \Bigg\}, \end{align*}

where

\begin{align*} {}_s Y_{\ell m}^\mathrm{sharp, real} &= \begin{cases} (-1)^{s + 1} {}_s Y_{\ell m}, & \mathrm{for}\; s < 0, m \ge 0 \\ {}_s Y_{\ell m}, & \mathrm{for}\; s = 0, m \ge 0 \\ - {}_s Y_{\ell m}, & \mathrm{for}\; s > 0, m \ge 0 \\ (-1)^{s + m + 1} {}_s Y_{\ell m}, & \mathrm{for}\; s < 0, m < 0 \\ (-1)^{m} {}_s Y_{\ell m}, & \mathrm{for}\; s = 0, m < 0 \\ (-1)^{m + 1} {}_s Y_{\ell m}, & \mathrm{for}\; s > 0, m < 0 \end{cases} \\ &\equiv {}_s S_{\ell m}^{\mathrm{real}} {}_s Y_{\ell m}\\ {}_s Y_{\ell m}^\mathrm{sharp, imag} &= \begin{cases} (-1)^{s + 1} {}_s Y_{\ell m}, & \mathrm{for}\; s < 0, m \ge 0 \\ -{}_s Y_{\ell m}, & \mathrm{for}\; s = 0, m \ge 0 \\ {}_s Y_{\ell m}, & \mathrm{for}\; s > 0, m \ge 0 \\ (-1)^{s + m} {}_s Y_{\ell m}, & \mathrm{for}\; s < 0, m < 0 \\ (-1)^{m} {}_s Y_{\ell m}, & \mathrm{for}\; s = 0, m < 0 \\ (-1)^{m + 1} {}_s Y_{\ell m}, & \mathrm{for}\; s > 0, m < 0 \end{cases} \\ &\equiv {}_s S_{\ell m}^{\mathrm{real}} {}_s Y_{\ell m}, \end{align*}

where the unadorned \({}_s Y_{\ell m}\) on the right-hand-sides follow the (older) convention of [77]. Note the phase in these expressions is not completely standardized, so should be checked carefully whenever coefficient data is directly manipulated.

For reference, we can compute the relation between Goldberg spin-weighted moments \({}_s f_{\ell m}\), defined as

\[ {}_s f(\theta, \phi) = \sum_{\ell = 0}^{\ell_\mathrm{max}} \sum_{m = -\ell}^{\ell} {}_s f_{\ell m} {}_s Y_{\ell m} \]

so,

\[ {}_s f_{\ell m} = \begin{cases} a_{\ell m}^{\mathrm{sharp}, \mathrm{real}} {}_s S_{\ell m}^{\mathrm{real}} + a_{\ell m}^{\mathrm{sharp}, \mathrm{imag}} {}_s S_{\ell m}^{\mathrm{imag}} & \mathrm{for} \; m \ge 0 \\ \left(a_{\ell -m}^{\mathrm{sharp}, \mathrm{real}}\right)^* {}_s S_{\ell m}^{\mathrm{real}} + \left(a_{\ell -m}^{\mathrm{sharp}, \mathrm{imag}}\right)^* {}_s S_{\ell m}^{\mathrm{imag}} & \mathrm{for} \; m < 0 \\ \end{cases} \]

The resulting coefficients \(a_{\ell m}\) are stored in a triangular, \(\ell\)-varies-fastest configuration. So, for instance, the first \(\ell_\mathrm{max}\) entries contain the coefficients for \(m=0\) and all \(\ell\)s, and the next \(\ell_\mathrm{max} - 1\) entries contain the coefficients for \(m=1\) and \(1 \le \ell \le \ell_\mathrm{max} \), and so on.


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