Skip to main content

sh_impl

Function sh_impl 

Source
pub fn sh_impl<P, E, V, const L: usize, const N: usize, const CS: bool>(
    x: V,
    y: V,
    z: V,
    out: &mut [V; N],
)
where P: Policy, E: FloatElement + ShConsts<L, N, CS>, V: FloatVector<Element = E> + CoreMath,
Expand description

All real spherical harmonics through degree L at the unit direction (x, y, z).

out[l * (l + 1) + m] receives $Y_{\ell m}$ for m in -l..=l, and N must equal (L + 1)^2 (compile-time checked). See the module docs for conventions, the algorithm, and the unit-vector requirement.

The policy parameter is currently unused (the evaluation is pure polynomial arithmetic with one fixed, FMA-preferring lowering). It is accepted so the signature matches every sibling kernel and leaves room for policy-driven variants.

Last built: 2026-09-08 21:35:55 UTC