qimpy.math.RadialFunction

class RadialFunction(r, dr, f=None, l=None)

Bases: object

Set of radial functions in real and reciprocal space. For l > 0, the convention is to remove a factor of r^l in real space (f) and G^l in reciprocal space (f_tilde). This makes it convenient to work with solid harmonics that already contain these factors of r^l or G^l.

Parameters:
  • r (Tensor) –

  • dr (Tensor) –

  • f (Tensor) –

  • l (Tensor) –

__init__(r, dr, f=None, l=None)

Initialize real-space portion of radial function. Note that f should have a factor of r^l removed for correct subsequent behavior with transforms and solid harmonics.

Parameters:
  • r (Tensor) –

  • dr (Tensor) –

  • f (ndarray | Tensor | None) –

  • l (ndarray | Tensor | None) –

Return type:

None

Methods

__init__

Initialize real-space portion of radial function.

transform

Initialize reciprocal space version of radial functions.

Attributes

DG

reciprocal space spacing of (quintic) spline nodes

r

radial grid

dr

radial grid integration weights (dr in 4 pi r^2 dr)

f

real-space values corresponding to r (n x len(r))

l

angular momentum for each function in f

Gmax

max G till which reciprocal space versions are current

G

uniform reciprocal-space grid

f_tilde

reciprocal-space version of each f on G

f_tilde_coeff

quintic spline coefficients for f_tilde

classmethod transform(radial_functions, Gmax, comm, name='')

Initialize reciprocal space version of radial functions. For efficiency, perform this together on all radial functions that share the same radial grid (r and dr) and parallelize the computation over MPI communicator comm.

Parameters:
  • radial_functions (list[RadialFunction]) –

  • Gmax (float) –

  • comm (Comm) –

  • name (str) –

Return type:

None

DG: float = 0.02

reciprocal space spacing of (quintic) spline nodes

G: Tensor

uniform reciprocal-space grid

Gmax: float

max G till which reciprocal space versions are current

dr: Tensor

radial grid integration weights (dr in 4 pi r^2 dr)

f: Tensor

real-space values corresponding to r (n x len(r))

f_tilde: Tensor

reciprocal-space version of each f on G

f_tilde_coeff: Tensor

quintic spline coefficients for f_tilde

l: Tensor

angular momentum for each function in f

r: Tensor

radial grid