You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This statement of Legendre_val used the wrong array, which should be changed to legendre_val = legendre.at[abs(m), n, jnp.arange(len(phi))].get(mode="clip")
The reason of function value is correct when degree $n=0$, is at that degree, the Legendre polynomial is a constant, so every value in legendre.at[abs(m), n, jnp.arange(len(phi))] is as same as the value of legendre.at[abs(m), n, jnp.arange(len(n))] . But when degree $n\neq 0$, the value will be wrong.
System info (python version, jaxlib version, accelerator, etc.)
Description
There is a wrong output of$n \neq 0$ .
jax.scipy.special.sph_harm(m, n, theta, phi, n_max=None)
, when the degree of the harmonicHere is an example:
The return value should be close to zero, but the real return is$m = 0, n = 0$ , the return is
0.8381599
. When2.9802322e-08
is correct.I check the source code of
jax.scipy.special.sph_harm
and find the wrong maybe is here:This statement of
Legendre_val
used the wrong array, which should be changed tolegendre_val = legendre.at[abs(m), n, jnp.arange(len(phi))].get(mode="clip")
The reason of function value is correct when degree$n=0$ , is at that degree, the Legendre polynomial is a constant, so every value in $n\neq 0$ , the value will be wrong.
legendre.at[abs(m), n, jnp.arange(len(phi))]
is as same as the value oflegendre.at[abs(m), n, jnp.arange(len(n))]
. But when degreeSystem info (python version, jaxlib version, accelerator, etc.)
jax: 0.4.7
jaxlib: 0.4.7
numpy: 1.22.4
python: 3.8.16 (default, Mar 1 2023, 21:19:10) [Clang 14.0.6 ]
jax.devices (1 total, 1 local): [CpuDevice(id=0)]
process_count: 1
The text was updated successfully, but these errors were encountered: