exatomic.algorithms.basis module
Basis Function Manipulation
Functions for managing and manipulating basis set data. Many of the ordering schemes used in computational codes can be generated programmatically with the right numerical function. This is preferred to an explicit parsing and storage of a given basis set ordering scheme.
- exatomic.algorithms.basis.gen_enum_cartesian(lmax)[source]
Cartesian powers in the order expected for overlap computation up to order lmax.
- Parameters:
lmax (int) – highest order angular momentum quantum number
- exatomic.algorithms.basis.spherical_harmonics(lmax)[source]
Symbolic real spherical harmonics up to order lmax.
sh = spherical_harmonics(6) # Inclusive, so computes up to l = 6 sh[3][-3] # symbolic f-phi angular function
- Parameters:
lmax (int) – highest order angular momentum quantum number
- exatomic.algorithms.basis.solid_harmonics(lmax, scaled=False)[source]
Symbolic real solid harmonics up to order lmax.
sh = solid_harmonics(6) # Inclusive, so computes up to l = 6 sh[3][-3] # symbolic f-phi angular function
- exatomic.algorithms.basis.car2sph(sh, cart, orderedp=True)[source]
Cartesian to spherical transform matrices.
sh = solid_harmonics(8) # symbolic solid harmonics cart = gen_enum_cartesian(8) # cartesian powers in a defined order c2s = car2sph(sh, cart) # dictionary of {l: transform_matrix}
- Parameters:
sh (OrderedDict) – symbolic solid harmonics
cart (OrderedDict) – cartesian powers in a defined order
orderedp (bool) – order l=1 as [‘x’, ‘y’, ‘z’], not [-1, 0, 1] (default True)
- Returns:
c2s (OrderedDict) – cartesian to spherical transform matrices
- exatomic.algorithms.basis.diff_expr(expr, cart='x', order=1)[source]
Compute the nth order derivative symbolically with respect to cart.
- exatomic.algorithms.basis.evaluate_expr(expr, xs, ys, zs, arr=None, alpha=None)[source]
Evaluate symbolic expression on a numerical grid.
- Parameters:
expr (symbolic) – sympy or symengine expression
xs (np.ndarray) – 1D-array of x values
ys (np.ndarray) – 1D-array of y values
zs (np.ndarray) – 1D-array of z values
arr (np.ndarray) – additional 1D-array to multiply expression by
alpha (float) – multiply expression by gaussian with exponent alpha
Note
See
exatomic.algorithms.orbital_util.numerical_grid_from_field_params()
for grid construction details.
- class exatomic.algorithms.basis.BasisFunctions(uni, frame=0, cartp=True)[source]
Bases:
object
Composition wrapper class that leverages symbolic expressions using symengine and numexpr, using values extracted from the numerical Shell jitclasses, to evaluate basis functions on a numerical grid.
- Parameters:
uni (
exatomic.core.universe.Universe
) – a universe with basis setframe (int) – frame corresponding to basis set (default 0)
cartp (bool) – forces p function ordering as (x, y, z) not (-1, 0, 1)
- enum_shell(shl)[source]
Return a generator over angular momentum degrees of freedom.
- Parameters:
shl (
exatomic.algorithms.numerical.Shell
) – basis set shell
- evaluate(xs=None, ys=None, zs=None, irrep=None, verbose=False)[source]
Evaluate basis functions on a numerical grid.
- Parameters:
Note
Default behavior returns symbolic expressions if xs is None. See
exatomic.algorithms.orbital_util.numerical_grid_from_field_params()
for grid construction details.
- evaluate_diff(xs, ys, zs, cart='x', verbose=False)[source]
Evaluate basis function derivatives on a numerical grid.
- Parameters:
Note
See
numerical_grid_from_field_params()
for grid construction details.