There have been longstanding issues with spherical harmonics in SageMath,
notably as described in
https://groups.google.com/g/sage-support/c/I_d_meMxRbM/m/Esxo5UO2BAAJ
In that the latter thread, Eric Gourgoulhon's message of 2019-06-15 gives
a simple test case:
from sage.functions.special import SphericalHarmonic
theta,phi = var('theta phi')
spherical_harmonic(1,1, theta,phi)
producing the (wrong) result
-1/4*sqrt(3)*sqrt(2)*sqrt(-sin(theta)^2)*e^(I*phi)/sqrt(pi)
whereas the correct result would be
-1/4*sqrt(6)*e^(I*phi)*sin(theta)/sqrt(pi)
Eric also noted that this problem was apparently a consequence of
https://trac.sagemath.org/ticket/25034
and suggested a workaround, using the spin-weighted spherical harmonics
from the SageMath /kerrgeodesics_gw/ package.
An update:
* As of 9.3.rc2, SageMath's builting spherical harmonics are still broken
(same result as above for Eric's test case).
* As of 9.3.rc2, the /kerrgeodesics_gw/ package fails to load (it worked
fine for me in 9.2.). I'll report that error to the
bhptoolkit.org
issue tracker.
And a question:
Given that the underlying problem
https://trac.sagemath.org/ticket/25034
is unlikely to be fixed for 9.3, should we perhaps put a note in the
documentation for 9.3 that spherical harmonics are unreliable at present?
--
-- "Jonathan Thornburg [remove -animal to reply]" <
jthor...@gmail.com>
Dept of Astronomy & IUCSS, Indiana University, Bloomington, Indiana, USA
currently on the west coast of Canada
"There was of course no way of knowing whether you were being watched
at any given moment. How often, or on what system, the Thought Police
plugged in on any individual wire was guesswork. It was even conceivable
that they watched everybody all the time." -- George Orwell, "1984"