# 3.1.7. horton.moments – Auxiliary routines related to multipole moments¶

This module fixes all the conventions with respect to multipole moments. Some of the code below may (in some way) reoccur in the low-level routines. In any case, such low-level code should be consistent with the conventions in this module. See for example, horton.gobasis.cext.cart_to_pur_low.

horton.moments.get_cartesian_powers(lmax)

Return an ordered list of power for x, y and z up to angular moment lmax

Arguments:

lmax
The maximum angular momentum (0=s, 1=p, 2=d, …)

Returns: an array where each row corresponds to a multipole moment and each column corresponds to a power of x, y and z respectively. The rows are grouped per angular momentum, first s, them p, then d, and so on. Within one angular momentum the rows are sorted ‘alphabetically’, e.g. for l=2: xxx, xxy, xxz, xyy, xyz, xzz, yyy, yyz, yzz, zzz.

horton.moments.get_ncart(l)

The number of cartesian powers for a given angular momentum, l

horton.moments.get_ncart_cumul(lmax)

The number of cartesian powers up to a given angular momentum, lmax.

horton.moments.rotate_cartesian_multipole(rmat, moments, mode)

Compute rotated Cartesian multipole moment/expansion.

Arguments:

rmat
A (3,3) rotation matrix.
moments
A multipole moment/coeffs. The angular momentum is derived from the length of this vector.
mode
A string containing either ‘moments’ or ‘coeffs’. In case if ‘moments’, a Cartesian multipole moment rotation is carried out. In case of ‘coeffs’, the coefficients of a Cartesian multipole basis are rotated.

Returns: rotated multipole.

horton.moments.rotate_cartesian_moments_all(rmat, moments)

Rotate cartesian moments

Arguments:

rmat
A (3,3) rotation matrix.
moments
A row vector with a series of cartesian multipole moments, starting from l=0 up to l=lmax. Items in this vector should follow the same order as defined by the function get_cartesian_powers.

Returns: A similar vector with rotated multipole moments

horton.moments.get_npure(l)

The number of pure functions for a given angular momentum, l

horton.moments.get_npure_cumul(lmax)

The number of pure functions up to a given angular momentum, lmax.