Molecular grid class for integration of three-dimensional functions.
Molecular grid is defined here to be a weighted average of \(M\) atomic grids
(see AtomGrid). This is defined by a atom in molecule weights (or nuclear weight functions)
\(w_n(r)\) for each center n such that \(\sum^M_n w_n(r) = 1\) for all points
\(r\in\mathbb{R}^3\). [1]
Preset grid accuracy scheme. If string is provided, then preset is used
for all atoms, either it is specified by a list, or a dictionary whose keys
are from atnums. These predefined grid specify the radial sectors and
their corresponding number of Lebedev grid points. Supported preset options include:
‘coarse’, ‘medium’, ‘fine’, ‘veryfine’, ‘ultrafine’, and ‘insane’.
Other options include the “standard grids”:
‘sg_0’, ‘sg_1’, ‘sg_2’, and ‘sg_3’, and the Ochsenfeld grids:
‘g1’, ‘g2’, ‘g3’, ‘g4’, ‘g5’, ‘g6’, and ‘g7’, with higher number indicating
greater accuracy but denser grid. See Notes for more information.
One dimensional radial grid. If of type OneDGrid then this radial grid is used for
all atoms. If a list is provided, then ith grid correspond to the ith atom. If
dictionary is provided, then the keys correspond to the atnums[i] attribute.
If None, a default radial grid (PowerRTransform of UniformInteger grid) is constructed
based on the given atomic numbers.
aim_weightsCallable or np.ndarray(K,), optional
Atoms in molecule weights. If None, then aim_weights is Becke weights with order=3.
rotatebool or int, optional
Flag to set auto rotation for atomic grid, if given int, the number
will be used as a seed to generate rantom matrix.
The standard and Ochsenfeld presets were not designed with symmetric spherical t-design
in mind.
The “standard grids” [2] “SG-0” and “SG-1” are designed for large molecules with LDA
(GGA) functionals, whereas “SG-2” and “SG-3” are designed for Meta-GGA functionals and
B95/Minnesota functionals, respectively.
The Ochsenfeld pruned grids [3] are obtained based on the paper.
Three-dimensional Cartesian coordinates for each atoms in atomic units.
radius: float, List[float]
The atomic radius to be multiplied with r_sectors in atomic units (to make the
radial sectors atom specific). If float, then the same atomic radius is used for all
atoms, otherwise a list with \(M\) elements is used, where \(M\) is the number
of atoms in the molecule. If list, then the ith element is used for the ith atom.
r_sectorslist of List[float]
List of sequences of the boundary radius (in atomic units) specifying sectors of
the pruned radial grid of \(M\) atoms. For the first atom, the first
sector is (0,radius*r_sectors[0][0]), then (radius*r_sectors[0][0],radius*r_sectors[0][1]), and so on. See AtomGrid.from_pruned for more information.
d_sectorsint or list of List[int], optional
List of sequences of the angular degrees for radial sectors of \(M\) atoms.
If a number is given, then the same number of degrees is used for all sectors of
all atoms.
s_sectorsint or list of List[int] or None, optional, keyword-only
List of sequences of angular sizes for each radial sector of of \(M\) atoms.
If both d_sectors and s_sectors are given, s_sectors is used.
rgridOneDGrid or List[OneDGrid] or Dict[int: OneDGrid], optional
One dimensional grid for the radial component. If a list is provided,then ith
grid correspond to the ith atom. If dictionary is provided, then the keys are
correspond to the atnums[i] attribute. If None, then using atomic numbers it will
generate a default radial grid (PowerRTransform of UniformInteger grid).
aim_weights: Callable or np.ndarray(sum^M_n N_n,), optional
Atoms in molecule/nuclear weights \({ {w_n(r_k)}_k^{N_i}}_n^{M}\), where
\(N_i\) is the number of points in the ith atomic grid. If None, then aim_weights
is Becke weights with order=3.
rotatebool or int , optional
Flag to set auto rotation for atomic grid, if given int, the number
will be used as a seed to generate random matrix.
storebool, optional
Flag to store each original atomic grid information.
Return function that interpolates (and its derivatives) from function values.
Consider a real-valued function \(f(r, \theta, \phi) = \sum_A f_A(r, \theta, \phi)\)
written as a sum of atomic centers \(f_A(r, \theta, \phi)\). Each of these
functions can be further decomposed based on the atom grid centered at \(A\):
A cubic spline is used to interpolate the radial functions \(\sum_i \rho^A_{ilm}(r)\)
based on the atomic grid centered at \(A\).
This is then multipled by the corresponding spherical harmonics at all
\((\theta_j, \phi_j)\) angles and summed to obtain approximation to \(f_A\). This
is then further summed over all centers to get \(f\).
Callable function that interpolates the function and its derivative provided.
The function takes the following attributes:
pointsndarray(N, 3)
Cartesian coordinates of \(N\) points to evaluate the splines on.
derivint, optional
If deriv is zero, then only returns function values. If it is one, then
returns the first derivative of the interpolated function with respect to either
Cartesian or spherical coordinates. Only higher-order derivatives
(deriv=2,3) are supported for the derivatives wrt to radial components.
deriv_sphericalbool
If True, then returns the derivatives with respect to spherical coordinates
\((r, \theta, \phi)\). Default False.
only_radial_derivbool
If true, then the derivative wrt to radius \(r\) is returned.
This function returns the following.
ndarray(M,…):
The interpolated function values or its derivatives with respect to Cartesian
\((x,y,z)\) or if deriv_spherical then \((r, \theta, \phi)\) or
if only_radial_derivs then derivative wrt to \(r\) is only returned.