xnn.gnn.featurizers.cartesian#

Cartesian angular edge basis for the CACE potential (Cheng 2024).

Encodes an edge direction with the Cartesian monomials

L_lxlylz(r_hat) = x^lx * y^ly * z^lz, lx + ly + lz = l <= l_max

(paper eq. 2) instead of spherical harmonics – the two bases span the same space per total angular momentum l and are related by a fixed linear map, so all symmetrization can be done with simple multinomial combination rules in Cartesian coordinates (no Clebsch-Gordan contraction, no e3nn).

Faithful to the reference implementation (BingqingCheng/cace, cace.modules.AngularComponent): the monomials are built by the same recursion L[lxlylz] = L[parent] * component (autograd-safe – no pow with zero exponents, which produces NaN gradients for axis-aligned edges), grouped contiguously by total l in ascending order.

Functions

lxlylz_list(l_max)

Enumerate the Cartesian angular momentum triples up to l_max.

multinomial_coefficient(lxlylz)

Multinomial coefficient l! / (lx! ly! lz!) of one angular triple.

n_lxlylz(l_max)

Number of Cartesian monomials with total angular momentum <= l_max.

Classes

CartesianAngularBasis(l_max)

Cartesian monomial angular basis x^lx y^ly z^lz (CACE, paper eq.