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

Differences with scipy.special.sph_harm for high degrees #33

Open
sdeslauriers opened this issue May 17, 2023 · 1 comment
Open

Differences with scipy.special.sph_harm for high degrees #33

sdeslauriers opened this issue May 17, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@sdeslauriers
Copy link

sdeslauriers commented May 17, 2023

There are significant differences between the complex SH provided by scipy.special.sph_harm and those provided by sphrs for high degrees. For example, the conjugate of the computed SH at the point Coordinates::spherical(1f64, 1.7453292519943295, 1.3962634015954636) are

degree 11 and order 11:
scipy: 0.4405634627748642+0.16035198675529674j
sphrs: 3.561861287727778+1.2964114873179975j

degree 12 and order 12:
scipy: -0.23561802283529287+0.4081023867296495j
sphrs: -56.973351046253434+98.68073868956799j

degree 13 and order 13:
scipy: -0.3622756435535203-0.3039853588902706j
sphrs: -1770.9169188717583-1485.975733470897j

The dramatic increase in the values returned by sphrs makes me think of numerical instability, but I couldn't pinpoint the issue.

@stefan-k
Copy link
Member

That's not great. I also suspect a numerical instability. I'll have to investigate, but unfortunately I won't be able to look into it for at least a couple of weeks. Therefore if someone wants to have a go at this, feel free to do so!

Thanks for reporting this bug!

@stefan-k stefan-k added bug Something isn't working help wanted Extra attention is needed labels May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants