calypso.plugins.cond_cdvae_deploy_v1.pl_modules.gemnet.layers.basis_utils module

Copyright (c) Facebook, Inc. and its affiliates.

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

calypso.plugins.cond_cdvae_deploy_v1.pl_modules.gemnet.layers.basis_utils.Jn(r, n)

numerical spherical bessel functions of order n

calypso.plugins.cond_cdvae_deploy_v1.pl_modules.gemnet.layers.basis_utils.Jn_zeros(n, k)

Compute the first k zeros of the spherical bessel functions up to order n (excluded)

calypso.plugins.cond_cdvae_deploy_v1.pl_modules.gemnet.layers.basis_utils.associated_legendre_polynomials(L_maxdegree, zero_m_only=True, pos_m_only=True)

Computes string formulas of the associated legendre polynomials up to degree L (excluded).

Parameters:
  • L_maxdegree (int) – Degree up to which to calculate the associated legendre polynomials (degree L is excluded).

  • zero_m_only (bool) – If True only calculate the polynomials for the polynomials where m=0.

  • pos_m_only (bool) – If True only calculate the polynomials for the polynomials where m>=0. Overwritten by zero_m_only.

Returns:

polynomials – Contains the sympy functions of the polynomials (in total L many if zero_m_only is True else L^2 many).

Return type:

list

calypso.plugins.cond_cdvae_deploy_v1.pl_modules.gemnet.layers.basis_utils.bessel_basis(n, k)

Compute the sympy formulas for the normalized and rescaled spherical bessel functions up to order n (excluded) and maximum frequency k (excluded).

Returns:

list

Bessel basis formulas taking in a single argument x. Has length n where each element has length k. -> In total n*k many.

Return type:

bess_basis

calypso.plugins.cond_cdvae_deploy_v1.pl_modules.gemnet.layers.basis_utils.real_sph_harm(L_maxdegree, use_theta, use_phi=True, zero_m_only=True)

Computes formula strings of the the real part of the spherical harmonics up to degree L (excluded). Variables are either spherical coordinates phi and theta (or cartesian coordinates x,y,z) on the UNIT SPHERE.

Parameters:
  • L_maxdegree (int) – Degree up to which to calculate the spherical harmonics (degree L is excluded).

  • use_theta (bool) –

    • True: Expects the input of the formula strings to contain theta.

    • False: Expects the input of the formula strings to contain z.

  • use_phi (bool) –

    • True: Expects the input of the formula strings to contain phi.

    • False: Expects the input of the formula strings to contain x and y.

    Does nothing if zero_m_only is True

  • zero_m_only (bool) – If True only calculate the harmonics where m=0.

Returns:

Y_lm_real – Computes formula strings of the the real part of the spherical harmonics up to degree L (where degree L is not excluded). In total L^2 many sph harm exist up to degree L (excluded). However, if zero_m_only only is True then the total count is reduced to be only L many.

Return type:

list

calypso.plugins.cond_cdvae_deploy_v1.pl_modules.gemnet.layers.basis_utils.sph_harm_prefactor(l_degree, m_order)

Computes the constant pre-factor for the spherical harmonic of degree l and order m.

Parameters:
  • l_degree (int) – Degree of the spherical harmonic. l >= 0

  • m_order (int) – Order of the spherical harmonic. -l <= m <= l

Returns:

factor

Return type:

float

calypso.plugins.cond_cdvae_deploy_v1.pl_modules.gemnet.layers.basis_utils.spherical_bessel_formulas(n)

Computes the sympy formulas for the spherical bessel functions up to order n (excluded)