Open mreineck opened 10 months ago
Hi @mreineck, as far as I can tell it seems as though you're calling everything correctly. @jasonmcewen and I have noticed similar behaviour and it's something we plan to look into when we get some time.
My current best guess is that the recursion (equations 24-27 in our paper) at larger spin numbers starts to get around our renormalisation strategy, which could introduce floating point errors which compound. However, this is just speculation and we'll have to dig into it to really know what's going on.
For the time being I've opened a PR which warns users that precision may degrade at higher spin (N) values.
In any case, most users likely will not encounter spins this high even for directional convolutions N ~ 5 is often more than sufficient.
Thanks a lot, @cosmomatt!
My current best guess is that the recursion (equations 24-27 in our paper) at larger spin numbers starts to get around our renormalisation strategy, which could introduce floating point errors which compound. However, this is just speculation and we'll have to dig into it to really know what's going on.
I'll try to have a look myself, and will let you know if I find something.
In any case, most users likely will not encounter spins this high even for directional convolutions N ~ 5 is often more than sufficient.
In most cases I agree, but it's still good to have a warning. During the Planck mission, we often ran the equivalent of a Wigner tranform up to spins of 20 to simulate the effect of beam far side lobes (see, e.g., https://arxiv.org/abs/2201.03478). For LiteBIRD this limit may even increase.
Fantastic, thanks @mreineck I'll try and find some time soon to look into this.
I wrote a little test looking at the round-trip accuracy of the forward and inverse SHTs and noticed a surprising behaviour: accuracy is really good up to spin 5, and then degrades rapidly in the spin 5 to 10 range. Afterwards the results appear to be more or less random.
For testing I used this scipt:
The results I get on my laptop (using te CPU implementation) are:
Am I using the code incorrectly?