Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add polynomials for spin-weighted harmonics? #34

Open
milankl opened this issue Dec 13, 2022 · 3 comments
Open

Add polynomials for spin-weighted harmonics? #34

milankl opened this issue Dec 13, 2022 · 3 comments

Comments

@milankl
Copy link

milankl commented Dec 13, 2022

Hey Justin, just had a chat with @kburns on spin-weighted spherical harmonics, which

  1. remove the cos scaling when calculating gradients (convenience and simplicity)
  2. simplify meridional gradients where otherwise the gradient for $\ell$ depends on $\ell+1,\ell-1$

Downside is obviously that one needs to get their head around the theory behind it. The recursion relations for the polynomials change as outlined in this paper https://doi.org/10.1016/j.jcpx.2019.100013 (equation 26-28 particularly). But apart from that, not much actually changes when implementing the transform, which is neat.

Keaton and I thought about starting a project whereby SpeedyWeather could be using spin-weighted harmonics but as a starting point we would need the calculation of the polynomials to support spin-weighted ones. Would you be keen to get those implemented here, either by contributing directly or by providing guidance how this could be done with your package without interfering with its current features? Keaton has implemented these before for Dedalus and understands the maths. I'm happy to help with the implementation but I just learned about the theory ;)

@milankl
Copy link
Author

milankl commented Jan 12, 2023

@jmert do you have an opinion on this ☝🏼 ? It shouldn't be much work on your side, but at the moment it sounds easier to make this part of AssociatedLegendrePolynomials than to branch this idea off somehow.

@jmert
Copy link
Owner

jmert commented Jan 16, 2023

Yes, I'm generically interested in supporting enough computation that one could calculate the spin-weighted spherical harmonics. I've never actually done that, though, because the reference I've seen before always resort to calculate the spin-weighted spherical harmonic in terms of the Wigner d-matrices, which end up being a completely different calculation.

I'll put reviewing the paper you referenced on my TODO list to review more closely. On a quick glance, it looks like the function P used in the equations you referenced are for the Jacobi polynomials rather than the Legendre polynomials, but wikipedia says they're related.

If there's a way to "boost" by ±1 spin with some kind of simple relation, I think that could be accommodated with relative ease. The Jacobi recurrence relations have a mixture of coefficients, so maybe there's a not-too-complicated way to mix the results of the spin-0 terms to iteratively generate different spins. (Unless we're very lucky, I'd expect that route will be neither the most performant nor the most numerically accurate, but the proof-of-concept would be a big step on its own worth doing.)

@kburns
Copy link

kburns commented Jan 17, 2023

Great! This looks like a great package and it would be fantastic to have it support spin-weighted transforms.

Yes the Legendre polynomials are just a special/particular case of Jacobi polynomials, and all the identities are formulas that people use for them generally apply to Jacobi polynomials more broadly, just with modified coefficients. In general the "spin weight" $s$ in the spin weighted spherical harmonics tells you how different the Jacobi $(a,b)$ parameters are from those for the regular associated Legendre functions. In theory the spin weight can be arbitrarily large, in which case the polynomials behave quite differently. But in practice, $s$ is typically just 0 or 1 or 2 (corresponding to the rank of the tensor field you're interested in), so the recursions and envelopes, etc., behave pretty similarly to the regular associated Legendre functions.

There are many different recurrence formulas that can be used, but the easiest place to start is probably to just generalize the current recurrences to work for general spin weights. I'll need to take a closer look to understand how over/underflow in the recursions is being handled here, but the typical strategies should also work for moderate spin weights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants