SpECTRE
v2024.05.11
|
A DataBox mutate-compatible computational struct for performing several spin-weighted spherical harmonic transforms. Internally dispatches to libsharp. More...
A DataBox mutate-compatible computational struct for performing several spin-weighted spherical harmonic transforms. Internally dispatches to libsharp.
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.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.