pyxtal.lego.SO3 module

pyxtal.lego.SO3.Cosine(Rij, Rc, derivative=False)[source]
pyxtal.lego.SO3.GaussChebyshevQuadrature(nmax, lmax)[source]
class pyxtal.lego.SO3.SO3(nmax=3, lmax=3, rcut=3.5, alpha=2.0, weight_on=False)[source]

Bases: object

A class to generate the SO3 power spectrum components based off of the Gaussian atomic neighbor density function defined in “On Representing Atomic Environments”.

Parameters:
  • nmax – int, degree of radial expansion

  • lmax – int, degree of spherical harmonic expansion

  • rcut – float, cutoff radius for neighbor calculation

  • alpha – float, gaussian width parameter

  • weight_on – bool, if True, the neighbors with different type will be counted as negative

property alpha
build_neighbor_list(atom_ids=None)[source]

Builds a neighborlist for the calculation of bispectrum components for a given ASE atoms object given in the calculate method.

calculate(atoms, atom_ids=None, derivative=False)[source]

API for Calculating the SO(3) power spectrum components of the smoothened atomic neighbor density function

Parameters:
  • atoms – an ASE atoms object corresponding to the desired atomic arrangement

  • derivative – bool, whether to calculate the gradient of not

clear_memory()[source]

Clears all non essential attributes for the calculator

compute_dpdr(atoms, atom_ids=None)[source]

Compute the powerspectrum function

Parameters:
  • atoms – ase atoms object

  • atom_ids – optional list of atomic indices

Returns:

dpdr array (N, N, M, 3) and p array (N, M)

compute_dpdr_5d(atoms, atom_ids=None)[source]

Compute the powerspectrum function with respect to supercell

Parameters:

atoms – ase atoms object

Returns:

dpdr array (N, N, M, 3, 27) and p array (N, M)

compute_p(atoms, atom_ids=None, return_CN=False)[source]

Compute the powerspectrum function

Parameters:
  • atoms – ase atoms object

  • atom_ids – optional list of atomic indices

Returns:

p array (N, M)

property cutoff_function
init_atoms(atoms, atom_ids=None)[source]

initilize atoms related attributes

property lmax
load_from_dict(dict0)[source]
property nmax
property rcut
save_dict()[source]

save the model as a dictionary in json

pyxtal.lego.SO3.W(nmax)[source]
pyxtal.lego.SO3.compute_cs(pos, nmax, lmax, rcut, alpha, cutoff)[source]

Compute expansion coefficients for a system based on the input positions.

This function calculates the expansion coefficients for a set of atomic positions using Gauss-Chebyshev quadrature, spherical Bessel functions, and spherical harmonics. It is typically used in models that require high-dimensional projections of atomic environments.

Parameters:
  • pos (numpy.ndarray) – An array of atomic positions (N x 3) where N is the number of atoms.

  • nmax (int) – Maximum radial quantum number used in the expansion.

  • lmax (int) – Maximum angular momentum quantum number used in the expansion.

  • rcut (float) – Cutoff radius for interactions and the radial expansion.

  • alpha (float) – Gaussian decay factor applied to the radial functions.

  • cutoff (callable) – A function to compute cutoff values for the radial distances.

Returns:

A 4D array of expansion coefficients with shape (N_neighbors, nmax, lmax+1, 2*lmax+1), where N_neighbors is the number of neighbor atoms, nmax is the number of radial terms, and lmax and m correspond to angular momentum quantum numbers.

Return type:

numpy.ndarray

pyxtal.lego.SO3.compute_dcs(pos, nmax, lmax, rcut, alpha, cutoff)[source]

Compute exapnsion coefficients

Parameters:
  • pos

  • nmax (int)

  • lmax (int)

  • rcut (float)

  • alpha (float)

  • cutoff (callable)

Returns:

c(N_ij, nmax, lmax+1, 2lmax+1) dc(N_ij, nmax, lmax+1, 2lmax+1, 3) for each x,y,z

pyxtal.lego.SO3.g(r, n, nmax, rcut, w)[source]
pyxtal.lego.SO3.phi(r, alpha, rcut)[source]

See g below