17.1.1.18. pysisyphus.numint package
17.1.1.18.1. Submodules
17.1.1.18.2. pysisyphus.numint.angint module
- pysisyphus.numint.angint.get_lebedev_grid(n)[source]
Get Cartesian Lebedev-grid with selected number of points.
- Parameters:
n -- Number of quadrature points.
- Returns:
2d array of shape (n, 4) containing the angular Lebedev grid. The first
three columns contain the Cartesian coordinates of the grid points on the
unit sphere. The last column contains the weights. They are already multiplied
by 4π!
17.1.1.18.3. pysisyphus.numint.atomint module
- pysisyphus.numint.atomint.combine_grids(origin, rad_grid, ang_grid)[source]
Form atomic grid from cartesian product of radial and angular grid.
- Parameters:
origin (
ndarray) -- Origin of the grid. Usually the coordinates of the parent atom.rad_grid (
ndarray) -- Radial grid. 2d-array of shape (nrad, nrad) with the first column containing radii and the second column the associated weights.ang_grid (
ndarray) -- Cartesian angular grid of shape (nang, 4). The first three column contain the Cartesian coordiantes (x, y, z) of the grid points; the last column contains the associated integration weights.
- Returns:
Cartesian grid of shape (nrad * nang, 4). The first three column contain the Cartesian coordiantes (x, y, z) of the grid points; the last column contains the associated integration weights.
- Return type:
grid
- pysisyphus.numint.atomint.get_atomic_grid(atom, origin, kind='g3')
Get atomic grid, as described by the Fermion++ developers.
- Parameters:
atom (
str) -- Chemical symbol of the atom.origin (
ndarray) -- Coordinates of the grid's center/origin. Usually the coordiantes of the host atom.kind (
str, default:'g3') -- One of 'g1' to 'g7'. Higher kinds correspond to finer grids.
- Return type:
Tuple[ndarray,ndarray]- Returns:
xyz -- 2d array containing Cartesian gridpoints of shape (npoints, 3).
weights -- 1d array containing integration weights of shape (npoints, ).
- pysisyphus.numint.atomint.get_extra_n_rad(atom)[source]
Get additional number of radial points for the given atom.
As outlined (A6) in [1].
- Parameters:
atom (
str) -- Atomic symbol.- Returns:
Number of extra radial points for the given atom.
- Return type:
nextra
- pysisyphus.numint.atomint.get_fermion_atomic_grid(atom, origin, kind='g3')[source]
Get atomic grid, as described by the Fermion++ developers.
- Parameters:
atom (
str) -- Chemical symbol of the atom.origin (
ndarray) -- Coordinates of the grid's center/origin. Usually the coordiantes of the host atom.kind (
str, default:'g3') -- One of 'g1' to 'g7'. Higher kinds correspond to finer grids.
- Return type:
Tuple[ndarray,ndarray]- Returns:
xyz -- 2d array containing Cartesian gridpoints of shape (npoints, 3).
weights -- 1d array containing integration weights of shape (npoints, ).
- pysisyphus.numint.atomint.get_gdma_atomic_grid(origin, atom='c', n_rad=80, n_ang=590, r_scale=2.0)[source]
Get atomic grid, similar to the original GDMA grid.
In the original paper [2] Stone proposed 80 radial points w/ Euler-Maclaurin- integration and a 590-point Lebedev grid.
In GDMA the number of expansion sites may/can be different from the atomic sites. In such cases we default to the atomic radius of carbon, but the user may choose a different atom.
- Parameters:
origin (
ndarray) -- Coordinates of the grid's center/origin. Usually the coordiantes of the host atom.atom (
str, default:'c') -- Optional, defaults to carbon.n_rad (default:
80) -- Number of radial points, defaults to 80.n_ang (default:
590) -- Number of angular points, defaults to 590.r_scale (default:
2.0) -- Scaling factor for the atomic radii.
- Returns:
xyz -- 2d array containing Cartesian gridpoints of shape (npoints, 3).
weights -- 1d array containing integration weights of shape (npoints, ).
- pysisyphus.numint.atomint.get_grids_for_fermion_kind(kind)[source]
Get number of radial and angular grid points for given kind.
As outlined in Table III. in [1].
- Parameters:
kind (
str) -- One of 'g1' to 'g7'.- Returns:
Tuple of 4 integers comprising the number of radial grid points and three angular (Lebedev) grid sizes for the inner, middle and outer parts of an atom.
- Return type:
npoints
17.1.1.18.4. pysisyphus.numint.molint module
- class pysisyphus.numint.molint.MolGrid(xyz, weights, start_inds, centers)[source]
Bases:
object-
centers:
ndarray
- property npoints
-
start_inds:
ndarray
-
weights:
ndarray
-
xyz:
ndarray
-
centers:
- pysisyphus.numint.molint.get_mol_grid(atoms, coords3d, part_func=CPUDispatcher(<function stratmann_partitioning>), weight_thresh=1e-15, atom_grid_kwargs=None, grid_func=<function get_fermion_atomic_grid>)[source]
Get molecular grid for given atoms, centered at given Cartesian coordinates.
TODO: allow arguments for get_atomic_grid; keep grid host association after compression, as some points are deleted.
- Parameters:
atoms (
Tuple[str]) -- List of atomic symbols.coords3d -- 2d array denoting the origins of the atomic grids. Usually the atomic coordiantes.
part_func (default:
CPUDispatcher(<function stratmann_partitioning at 0x7fdb369c4af0>)) -- Function used to repartiton the atomic grid weights.weight_thresh (default:
1e-15) -- Positive floating point number used for grid compression. Quadrature points with values below this threshold will be ignored.atom_grid_kwargs (
Optional[dict], default:None) -- Additional kwarg for the atom grids.
- Returns:
xyz -- 2d array containing Cartesian gridpoints of shape (npoints, 3).
weights -- 1d array containing integration weights of shape (npoints, ).
- pysisyphus.numint.molint.stratmann_partitioning(coords3d, atomic_grids, part_weights, a=0.64)[source]
Partitioning of atomic weights according to Stratmann, Scuseria and Frisch.
- Parameters:
coords3d (
ndarray) -- Array holding the coordinates of the grid parents; usually the atomic coordiantes.atomic_grid -- Numba typed-List containig atomic grid arrays. The lengths of the respective arrays sum to 'npoints'.
part_weights (
ndarray) -- 1d array of shape(npoints, ) containing the partitioning weights that have to be multiplied with the integration weights.a (
float, default:0.64) -- Scaling factor for the smoothing function. Defaults to 0.64.
17.1.1.18.5. pysisyphus.numint.radint module
- pysisyphus.numint.radint.chebyshev_2nd_kind(n, atomic_radius=1.0)[source]
Roots and weights using Chebyshev quadrature of the second kind.
As outlined in [1].
- Parameters:
n (
int) -- Number of radial grid points.atomic_radius (
float, default:1.0) -- Radius of the atom, for which the radial grid is generated.
- Returns:
2d array of shape (n, 2) with the first column containing the radii and the second column containing the integration weights.
- Return type:
roots_weight
- pysisyphus.numint.radint.euler_maclaurin_dma(n, m_r=2, atomic_radius=1.0)[source]
Roots and weights as utilized in Stone's GDMA.
Adapated from the 'radial_grid(alpha)' subroutine found in'atomic_grids.f90' of Stone's GDMA code. Acutally a grid with one point less is returned to avoid division by 0.0.
NOTE: In contrast to chebyshev_2nd_kind() above, the weights in the equation below already seem to include a factor of r**2. We remove it, so the function behaves similar to the other radial integration approaches.
- Parameters:
n (
int) -- Positive integer > 1; number of points + 1.m_r (default:
2) -- Exponent, m_r = 2 was found to be sufficient. See Section 5.1 of [2] for a discussion.atomic_radius (
float, default:1.0) -- Positive float; corresponds to alpha in Stone's GDMA.
- Returns:
2d array of shape (n, 2) with the first column containing the radii and the second column containing the integration weights.
- Return type:
roots_weight
- pysisyphus.numint.radint.radint(func, n, grid_func=<function chebyshev_2nd_kind>)[source]
1d quadrature. Defaults to Chebyshev of the 2nd kind.
- Parameters:
func (
Callable[[float],float]) -- Callable taking one argument.n (
int) -- Integer number of quadrature points.
- Returns:
Floating point number holding the integration result.
- Return type:
res
- pysisyphus.numint.radint.treutler_m4_map(x, a=1.0, alpha=0.6, atomic_radius=1.0)[source]
Map finite inteval -1 <= x <= 1 to 0 <= r <= oo.
For -1 <= x <= 1 a must be 1.0; for 0 <= x <= 1 a must be 0.0.
Corresponds to scheme M4 in [1], eq. (19).
- Parameters:
x (
ndarray) -- Array of values in the interval [-1.0, 1.0].a (default:
1.0) -- Parameter a; see eq. (20) in [1]. Depends on the integration limits.alpha (default:
0.6) -- Parameter alpha with optimal value of 0.6 (see eq. (21) in [1]) in combination with Chebyshev 2nd kind roots and weights. As alpha is increased grid points are shifted towards r = 0 and r = oo.atomic_radius (default:
1.0) -- Additional parameter to better tailor the distribution of radial points.
- Returns:
r -- 1d-array of r-values mapped from [-1, 1] to [0, oo].
drdx -- 1d-array of derivatives dr/dx that are required for the change of variables in the integration.