_invariants
Pure-python rotation-invariant descriptors of spherical harmonic coefficients.
Public functions match the previous cython module:
p_invariants_c(coeffs)— invariants from a complex SHT coefficient vectorp_invariants_r(coeffs)— invariants from a real (m >= 0) coefficient vectorclebsch_gordan(l1, m1, l2, m2, l, m)— convenience wrapper
The Racah formula for Clebsch-Gordan coefficients is computed in scalar python with an LRU cache so that repeated triples in the invariant loops are free after the first call. lmax is typically <= 20 for shape descriptors so even without vectorisation this runs in a few ms.
References
Brink & Satchler, "Angular Momentum", Oxford, 1968 (Racah formula) Burel & Henocq, "Three-dimensional invariants and their application to object recognition", Sig. Proc. 45 (1995) 1-22 (P-invariants)
clebsch_gordan(l1, m1, l2, m2, l, m)
Clebsch-Gordan coefficient ⟨l1 m1; l2 m2 | l m⟩.
p_invariants_c(coeffs)
P-invariants from a complex SHT coefficient vector (length (lmax+1)^2).
Source code in chmpy/shape/_invariants.py
p_invariants_r(coeffs)
P-invariants from a real (m >= 0) SHT coefficient vector.