Problem
On current origin/main, the configured ARTS2D spherical-harmonic anisotropy cannot affect the fit as intended:
sph_harm_y expects degree/order (n, m), but tsadar/core/modules/distribution_functions/spherical_harmonics.py:306-308 passes (j, i) for loop variables (l=i, m=j).
- Lines 202-204 set
theta=atan2(vy, vx) and phi=acos(vy / abs(vy)). The latter is only 0 or pi, so the velocity plane is mapped onto the two poles. With the current call ordering, both configured l=1 modes evaluate to zero. Even after correcting (n, m), Re(Y_1^1) remains identically zero and Y_1^0 is only a half-plane step.
FLM_MY.dt is annotated and stored as a Python float at lines 79-84. Equinox treats it as static even though the distribution filter marks dtx/dty trainable. Direct eqx.filter_value_and_grad returns None for both gradients.
Consequently existing Mora-Yahi spherical-harmonic runs effectively optimize the isotropic shape parameter, not the requested anisotropy.
Reproduction
- Perturbing
dty on the partially corrected local implementation changes the EDF by exactly zero.
- On tracked
origin/main, perturbing either dtx or dty leaves the anisotropic contribution zero because degree/order and plane coordinates both collapse the modes.
type(module.dt) is float, and the filtered gradient for each dt leaf is None.
Acceptance criteria
Related: #124.
Problem
On current
origin/main, the configured ARTS2D spherical-harmonic anisotropy cannot affect the fit as intended:sph_harm_yexpects degree/order(n, m), buttsadar/core/modules/distribution_functions/spherical_harmonics.py:306-308passes(j, i)for loop variables(l=i, m=j).theta=atan2(vy, vx)andphi=acos(vy / abs(vy)). The latter is only 0 or pi, so the velocity plane is mapped onto the two poles. With the current call ordering, both configuredl=1modes evaluate to zero. Even after correcting(n, m),Re(Y_1^1)remains identically zero andY_1^0is only a half-plane step.FLM_MY.dtis annotated and stored as a Pythonfloatat lines 79-84. Equinox treats it as static even though the distribution filter marksdtx/dtytrainable. Directeqx.filter_value_and_gradreturnsNonefor both gradients.Consequently existing Mora-Yahi spherical-harmonic runs effectively optimize the isotropic shape parameter, not the requested anisotropy.
Reproduction
dtyon the partially corrected local implementation changes the EDF by exactly zero.origin/main, perturbing eitherdtxordtyleaves the anisotropic contribution zero because degree/order and plane coordinates both collapse the modes.type(module.dt) is float, and the filtered gradient for eachdtleaf isNone.Acceptance criteria
(l,m)conventions.l=1Cartesian modes are linearly independent and have the expected odd x/y parity and centroids.Nl > 1construction, state serialization, andget_unnormed_paramswithout key errors.Related: #124.