rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

spherical_harmonic switches phase for odd values of m #2215

Open rtoy opened 2 months ago

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-05 21:37:02 Created by maximuser on 2011-09-18 11:40:18 Original: https://sourceforge.net/p/maxima/bugs/2275


I detected that spherical_harmonic function switches phase of functions with odd values of m. Help file reference towards Merzbacher 9.64 (in fact this is 9.65), but results from Maxima doesn't correspond to sample formulas in 9.68 (and http://mathworld.wolfram.com/SphericalHarmonic.html) - see Y1, +-1 and Y2, +- 1. Maxima gives formula with opposite phase (sign). this is probably due to use factor (-1)^m both in spherical_function and assoc_legendre_p (which gives proper results according to http://mathworld.wolfram.com/AssociatedLegendrePolynomial.html). Formula 9.64 in Merzbacher includes (-1)^m factor, but it is ommited in 9.59 - definition of associated Legendre polynomials.

The problem is described in http://mathworld.wolfram.com/Condon-ShortleyPhase.html. I suggest omitting (-1)^m factor in definition of spherical_harmonic and/or some description in help file for spherical_harmonic. Temporary formula

Y(l, m, theta, phi):=(-1)^m*spherical_harmonic(l, m, theta, phi);

works fine.

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-05 21:37:03 Created by willisbl on 2011-09-19 11:53:53 Original: https://sourceforge.net/p/maxima/bugs/2275/#42fb


Thank you for the detailed analysis. I proposed using the definition in dlmf; specifically http://dlmf.nist.gov/14.30\#E3.

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-05 21:37:07 Created by willisbl on 2011-09-19 11:53:53 Original: https://sourceforge.net/p/maxima/bugs/2275/#3e58