3.3.1. horton.gbasis.cext – C++ extensions

class horton.gbasis.cext.GOBasis

Bases: horton.gbasis.cext.GBasis

check_matrix_coeffs(self, matrix, nocc=None)
check_matrix_four_index(self, matrix)
check_matrix_two_index(self, matrix)
compute_electron_repulsion(self, output)

Compute electron-electron repulsion integrals

The potential has the following form:

\[v = \frac{1}{r}\]
Parameters:output (FourIndex) – When a DenseFourIndex object is given, it is used as output argument and its contents are overwritten. When a DenseLinalgFactory or CholeskyLinalgFactory is given, it is used to construct the four-index object in which the integrals are stored.
Returns:
  • output
  • Keywords (ERI, four-center integrals)
compute_erf_attraction(self, ndarray coordinates, ndarray charges, output, double mu=0.0)

Compute the model nuclear attraction integral with the long-range potential

The potential has the following form:

\[v = \frac{\mathrm{erf}(\mu r)}{r}\]
Parameters:
  • coordinates (np.ndarray, shape = (ncharge,3)) – A float array with shape (ncharge,3) with Cartesian coordinates of point charges that define the external field.
  • charges (np.ndarray, shape=(ncharge,)) – A float array with shape (ncharge,) with the values of the charges.
  • output (TwoIndex) –
    When a TwoIndex instance is given, it is used as output
    argument and its contents are overwritten. When LinalgFactory is given, it is used to construct the output TwoIndex object. In both cases, the output two-index object is returned.
    mu : float
    Parameter for the erf(mu r)/r potential. Default is zero.
Returns:

  • TwoIndex object
  • Keywords (two-center integrals)

compute_erf_repulsion(self, output, double mu=0.0)

Compute short-range electron repulsion integrals.

The potential has the following form:

\[v = \frac{\mathrm{erf}(\mu r)}{r}\]
Parameters:
  • output (FourIndex) – When a DenseFourIndex object is given, it is used as output argument and its contents are overwritten. When a DenseLinalgFactory or CholeskyLinalgFactory is given, it is used to construct the four-index object in which the integrals are stored.
  • mu (float) – Parameter for the erf(mu r)/r potential. Default is zero.
Returns:

  • output
  • Keywords (ERI, four-center integrals)

compute_gauss_attraction(self, ndarray coordinates, ndarray charges, output, double c=1.0, double alpha=1.0)

Compute the model nuclear attraction with a Gaussian potential.

The potential has the following form:

\[v = c \exp(-\alpha r^2)\]
Parameters:
  • output (TwoIndex) – When a DenseTwoIndex object is given, it is used as output argument and its contents are overwritten.
  • c (float) – Coefficient of the gaussian.
  • alpha (float) – Exponential parameter of the gaussian.
Returns:

  • output
  • Keywords (two-center integrals)

compute_gauss_repulsion(self, output, double c=1.0, double alpha=1.0)

Compute gaussian repulsion four-center integrals.

The potential has the following form:

\[v = c \exp(-\alpha r^2)\]
Parameters:
  • output (FourIndex) – When a DenseFourIndex object is given, it is used as output argument and its contents are overwritten. When a DenseLinalgFactory or CholeskyLinalgFactory is given, it is used to construct the four-index object in which the integrals are stored.
  • c (float) – Coefficient of the gaussian.
  • alpha (float) – Exponential parameter of the gaussian.
Returns:

  • output
  • Keywords (ERI, four-center integrals)

compute_grid_density_dm(self, dm, ndarray points, ndarray output=None, double epsilon=0)

Compute the electron density on a grid for a given density matrix.

Warning: the results are added to the output array! This may be useful to combine results from different spin components.

Parameters:
  • dm (DenseTwoIndex) – Density matrix, assumed to be symmetric.
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • output (np.ndarray, shape=(npoint,), dtype=float) – Output array. When not given, it is allocated and returned.
  • epsilon (float) – Allow errors on the density of this magnitude for the sake of efficiency. Some grid_fn implementations may ignore this.
Returns:

output – The output array.

Return type:

np.ndarray, shape=(npoint,), dtype=float

compute_grid_density_fock(self, ndarray points, ndarray weights, ndarray pots, fock)

Compute a Fock operator from a density potential.

Warning: the results are added to the Fock operator!

Parameters:
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • weights (np.ndarray, shape=(npoint,), dtype=float) – Integration weights.
  • pots (np.ndarray, shape=(npoint,), dtype=float) – Derivative of the energy toward the density at all grid points.
  • fock (DenseTwoIndex) – Output dense two-index object.
compute_grid_esp_dm(self, dm, ndarray coordinates, ndarray charges, ndarray points, ndarray output=None)

Compute the electrostatic potential on a grid for a given density matrix.

Warning: the results are added to the output array! This may be useful to combine results from different spin components.

Parameters:
  • dm (DenseTwoIndex) – Density matrix, assumed to be symmetric.
  • coordinates (np.ndarray, shape=(natom, 3), dtype=float) – Cartesian coordinates of the atoms.
  • charges (np.ndarray, shape=(natom,), dtype=float) – Atomic charges.
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • output (np.ndarray, shape=(npoint,), dtype=float) – Output array. When not given, it is allocated and returned.
Returns:

output – The output array.

Return type:

np.ndarray, shape=(npoint,), dtype=float

compute_grid_gga_dm(self, dm, ndarray points, ndarray output=None)

Compute the electron density and gradient on a grid for a given density matrix.

Warning: the results are added to the output array! This may be useful to combine results from different spin components.

Parameters:
  • dm (DenseTwoIndex) – Density matrix, assumed to be symmetric.
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • output (np.ndarray, shape=(npoint, 4), dtype=float) – Output array. When not given, it is allocated and returned. The first column contains the density. The last three columns contain the gradient.
Returns:

output – The output array.

Return type:

np.ndarray, shape=(npoint, 4), dtype=float

compute_grid_gga_fock(self, ndarray points, ndarray weights, ndarray pots, fock)

Compute a Fock operator from GGA potential data.

Warning: the results are added to the Fock operator!

Parameters:
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • weights (np.ndarray, shape=(npoint,), dtype=float) – Integration weights.
  • pots (np.ndarray, shape=(npoint, 4), dtype=float) – Derivative of the energy toward GGA ingredients (density and gradient) at all grid points.
  • fock (DenseTwoIndex) – Output dense two-index object.
compute_grid_gradient_dm(self, dm, ndarray points, ndarray output=None)

Compute the electron density gradient on a grid for a given density matrix.

Warning: the results are added to the output array! This may be useful to combine results from different spin components.

Parameters:
  • dm (DenseTwoIndex) – Density matrix, assumed to be symmetric.
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • output (np.ndarray, shape=(npoint, 3), dtype=float) – Output array. When not given, it is allocated and returned.
Returns:

output – The output array.

Return type:

np.ndarray, shape=(npoint, 3), dtype=float

compute_grid_gradient_fock(self, ndarray points, ndarray weights, ndarray pots, fock)

Compute a Fock operator from a density gradient potential.

Warning: the results are added to the Fock operator!

Parameters:
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • weights (np.ndarray, shape=(npoint,), dtype=float) – Integration weights.
  • pots (np.ndarray, shape=(npoint, 3), dtype=float) – Derivative of the energy toward the density gradient components at all grid points.
  • fock (DenseTwoIndex) – Output dense two-index object.
compute_grid_hartree_dm(self, dm, ndarray points, ndarray output=None)

Compute the Hartree potential on a grid for a given density matrix.

Warning: the results are added to the output array! This may be useful to combine results from different spin components.

Parameters:
  • dm (DenseTwoIndex) – Density matrix, assumed to be symmetric.
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • output (np.ndarray, shape=(npoint,), dtype=float) – Output array. When not given, it is allocated and returned.
Returns:

output – The output array.

Return type:

np.ndarray, shape=(npoint,), dtype=float

compute_grid_hessian_dm(self, dm, ndarray points, ndarray output=None)

Compute the electron density Hessian on a grid for a given density matrix.

Warning: the results are added to the output array! This may be useful to combine results from different spin components.

Parameters:
  • dm (DenseTwoIndex) – Density matrix, assumed to be symmetric.
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • output (np.ndarray, shape=(npoint, 6), dtype=float) –

    Output array. When not given, it is allocated and returned. The columns are assigned as follows:

    • 0: element (0, 0) of the Hessian
    • 1: element (0, 1) of the Hessian
    • 2: element (0, 2) of the Hessian
    • 3: element (1, 1) of the Hessian
    • 4: element (1, 2) of the Hessian
    • 5: element (2, 2) of the Hessian
Returns:

output – The output array.

Return type:

np.ndarray, shape=(npoint, 6), dtype=float

compute_grid_hessian_fock(self, ndarray points, ndarray weights, ndarray pots, fock)

Compute a Fock operator from a density hessian potential.

Warning: the results are added to the Fock operator!

Parameters:
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • weights (np.ndarray, shape=(npoint,), dtype=float) – Integration weights.
  • pots (np.ndarray, shape=(npoint, 6), dtype=float) –

    Derivative of energy toward components of the Hessian at all grid points. The columns are assigned as follows:

    • 0: element (0, 0) of the Hessian
    • 1: element (0, 1) of the Hessian
    • 2: element (0, 2) of the Hessian
    • 3: element (1, 1) of the Hessian
    • 4: element (1, 2) of the Hessian
    • 5: element (2, 2) of the Hessian
  • fock (DenseTwoIndex) – Output dense two-index object.
compute_grid_kinetic_dm(self, dm, ndarray points, ndarray output=None)

Compute the kinetic energy density on a grid for a given density matrix.

Warning: the results are added to the output array! This may be useful to combine results from different spin components.

Parameters:
  • dm (DenseTwoIndex) – Density matrix, assumed to be symmetric.
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • output (np.ndarray, shape=(npoint,), dtype=float) – Output array. When not given, it is allocated and returned.
Returns:

output – The output array.

Return type:

np.ndarray, shape=(npoint,), dtype=float

compute_grid_kinetic_fock(self, ndarray points, ndarray weights, ndarray pots, fock)

Compute a Fock operator from a kientic-energy-density potential.

Warning: the results are added to the Fock operator!

Parameters:
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • weights (np.ndarray, shape=(npoint,), dtype=float) – Integration weights.
  • pots (np.ndarray, shape=(npoint,), dtype=float) – Derivative of the energy toward the kinetic energy density at all grid points.
  • fock (DenseTwoIndex) – Output dense two-index object.
compute_grid_mgga_dm(self, dm, ndarray points, ndarray output=None)

Compute the MGGA quantities for a given density matrix.

Warning: the results are added to the output array! This may be useful to combine results from different spin components.

This includes the density, the gradient, the Laplacian and the kinetic energy density.

Parameters:
  • dm (DenseTwoIndex) – Density matrix, assumed to be symmetric.
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • output (np.ndarray, shape=(npoint, 6), dtype=float) –

    Output array. When not given, it is allocated and returned. The assignment of the columns is as follows:

    • 0: density
    • 1: gradient x
    • 2: gradient y
    • 3: gradient z
    • 4: laplacian
    • 5: kinetic energy density
Returns:

output – The output array.

Return type:

np.ndarray, shape=(npoint, 6), dtype=float

compute_grid_mgga_fock(self, ndarray points, ndarray weights, ndarray pots, fock)

Compute a Fock operator from MGGA potential data.

Warning: the results are added to the Fock operator!

Parameters:
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • weights (np.ndarray, shape=(npoint,), dtype=float) – Integration weights.
  • pots (np.ndarray, shape=(npoint, 6), dtype=float) –

    Derivative of the energy toward density, gradient, Laplacian and kinetic energy density. The assignment of the columns is as follows:

    • 0: density
    • 1: gradient x
    • 2: gradient y
    • 3: gradient z
    • 4: laplacian
    • 5: kinetic energy density
  • fock (DenseTwoIndex) – Output dense two-index object.
compute_grid_orb_gradient_exp(self, exp, ndarray points, ndarray iorbs, ndarray output=None)

Compute the orbital gradient on a grid for a given set of expansion coefficients.

Warning: the results are added to the output array!

Parameters:
  • exp (DenseExpansion) – Orbitals.
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • iorbs (np.ndarray, shape=(n,), dtype=int) – Indexes of the orbitals to be computed.
  • output (np.ndarray, shape=(npoint, n, 3), dtype=float) – An output array. The results are added to this array. When not given, an output array is allocated.
Returns:

output – the output array. (It is allocated when not given.)

Return type:

np.ndarray, shape=(npoint, n, 3), dtype=float

compute_grid_orbitals_exp(self, exp, ndarray points, ndarray iorbs, ndarray output=None)

Compute the orbitals on a grid for a given set of expansion coefficients.

Warning: the results are added to the output array!

Parameters:
  • exp (DenseExpansion) – Orbitals.
  • points (np.ndarray, shape=(npoint, 3), dtype=float) – Cartesian grid points.
  • iorbs (np.ndarray, shape=(n,), dtype=int) – Indexes of the orbitals to be computed. When not given, the orbitals with a non-zero occupation number are computed.
  • output (np.ndarray, shape=(npoint, n), dtype=float) – An output array. The results are added to this array. When not given, an output array is allocated.
Returns:

output – the output array. (It is allocated when not given.)

Return type:

np.ndarray, shape=(npoint, n), dtype=float

compute_grid_point1(self, ndarray output, ndarray point, GB1DMGridFn grid_fn)
compute_kinetic(self, output)

Compute the kinetic energy integrals in a Gaussian orbital basis

Arguments:

output
When a TwoIndex instance is given, it is used as output argument and its contents are overwritten. When LinalgFactory is given, it is used to construct the output TwoIndex object. In both cases, the output two-index object is returned.

Returns: TwoIndex object

compute_multipole_moment(self, ndarray xyz, ndarray center, output)

Compute the (multipole) moment integrals in a Gaussian orbital basis.

Calculates the integral < gto_a | (x - C_x)^l (y - C_y)^m (z - C_z)^n | gto_b >

Parameters:
  • xyz (numpy-array of int, shape=(3,)) – A integer (long) numpy-array with shape (3,) with the powers of x,y,z in the integrals.
  • center (np.ndarray, shape = (3,)) – A numpy array of shape (3,) with the center [C_x, C_y, C_z] around which the moment integral is computed.
  • output (TwoIndex or LinalgFactory object) – When a TwoIndex instance is given, it is used as output argument and its contents are overwritten. When LinalgFactory is given, it is used to construct the output TwoIndex object. In both cases, the output two-index object is returned.
Returns:

output – The values of the integrals.

Return type:

TwoIndex object

compute_nuclear_attraction(self, ndarray coordinates, ndarray charges, output)

Compute the nuclear attraction integral in a Gaussian orbital basis

Arguments:

coordinates
A float array with shape (ncharge,3) with Cartesian coordinates of point charges that define the external field.
charges
A float array with shape (ncharge,) with the values of the charges.
output
When a TwoIndex instance is given, it is used as output argument and its contents are overwritten. When LinalgFactory is given, it is used to construct the output TwoIndex object. In both cases, the output two-index object is returned.

Returns: TwoIndex object

compute_overlap(self, output)

Compute the overlap integrals in a Gaussian orbital basis

Arguments:

output
When a TwoIndex instance is given, it is used as output argument and its contents are overwritten. When LinalgFactory is given, it is used to construct the output TwoIndex object. In both cases, the output two-index object is returned.

Returns: TwoIndex object

compute_ralpha_repulsion(self, output, double alpha=-1.0)

Compute r^alpha repulsion four-center integrals.

The potential has the following form:

\[v = r^{\alpha}\]

with \(\alpha > -3\).

Parameters:
  • output (FourIndex) – When a DenseFourIndex object is given, it is used as output argument and its contents are overwritten. When a DenseLinalgFactory or CholeskyLinalgFactory is given, it is used to construct the four-index object in which the integrals are stored.
  • alpha (float) – The power of r in the interation potential.
Returns:

  • output
  • Keywords (ERI, four-center integrals)

concatenate(type cls, *gbs)

Concatenate multiple basis objects into a new one.

Arguments: each argument is an instance of the same subclass of GBasis.

from_hdf5(type cls, grp)
get_basis_atoms(self, coordinates)

Return a list of atomic basis sets for a given geometry

Arguments:

coordinates
An (N, 3) array with atomic coordinates, used to find the centers associated with atoms. An exact match of the Cartesian coordinates is required to properly select a shell.

Returns: A list with one tuple for every atom: (gbasis, ibasis_list), where gbasis is a basis set object for the atom and ibasis_list is a list of basis set indexes that can be used to substitute results from the atomic basis set back into the molecular basis set. For example, when a density matrix for the atom is obtained and it needs to be plugged back into the molecular density matrix, one can do the following:

mol_dm._array[ibasis_list,ibasis_list.reshape(-1,1)] = atom_dm._array
get_scales(self)
get_subset(self, ishells)

Construct a sub basis set for a selection of shells

Argument:

ishells
A list of indexes of shells to be retained in the sub basis set

Returns: An instance of the same class as self containing only the basis functions of self that correspond to the select shells in the ishells list.

to_hdf5(self, grp)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

alphas
basis_offsets
centers
con_coeffs
max_shell_type
nbasis
ncenter
nprim_total
nprims
nscales
nshell
shell_lookup
shell_map
shell_types
class horton.gbasis.cext.GB2OverlapIntegral

Bases: horton.gbasis.cext.GB2Integral

Wrapper for ints.GB2OverlapIntegral, for testing only

add(self, double coeff, double alpha0, double alpha1, ndarray scales0, ndarray scales1)
cart_to_pure(self)
get_work(self, shape0, shape1)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, long shell_type1, ndarray r0, ndarray r1)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

max_nbasis
max_shell_type
nwork
class horton.gbasis.cext.GB2KineticIntegral

Bases: horton.gbasis.cext.GB2Integral

Wrapper for ints.GB2KineticIntegral, for testing only

add(self, double coeff, double alpha0, double alpha1, ndarray scales0, ndarray scales1)
cart_to_pure(self)
get_work(self, shape0, shape1)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, long shell_type1, ndarray r0, ndarray r1)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

max_nbasis
max_shell_type
nwork
class horton.gbasis.cext.GB2ErfAttractionIntegral

Bases: horton.gbasis.cext.GB2Integral

Wrapper for ints.GB2ErfAttractionIntegral, for testing only

add(self, double coeff, double alpha0, double alpha1, ndarray scales0, ndarray scales1)
cart_to_pure(self)
get_work(self, shape0, shape1)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, long shell_type1, ndarray r0, ndarray r1)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

max_nbasis
max_shell_type
mu
nwork
class horton.gbasis.cext.GB2GaussAttractionIntegral

Bases: horton.gbasis.cext.GB2Integral

Wrapper for ints.GB2GaussAttractionIntegral, for testing only

add(self, double coeff, double alpha0, double alpha1, ndarray scales0, ndarray scales1)
cart_to_pure(self)
get_work(self, shape0, shape1)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, long shell_type1, ndarray r0, ndarray r1)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

alpha
c
max_nbasis
max_shell_type
nwork
class horton.gbasis.cext.GB2NuclearAttractionIntegral

Bases: horton.gbasis.cext.GB2Integral

Wrapper for ints.GB2NuclearAttractionIntegral, for testing only

add(self, double coeff, double alpha0, double alpha1, ndarray scales0, ndarray scales1)
cart_to_pure(self)
get_work(self, shape0, shape1)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, long shell_type1, ndarray r0, ndarray r1)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

max_nbasis
max_shell_type
nwork
class horton.gbasis.cext.GB4Integral

Bases: object

Wrapper for ints.GB4Integral

add(self, double coeff, double alpha0, double alpha1, double alpha2, double alpha3, ndarray scales0, ndarray scales1, ndarray scales2, ndarray scales3)
cart_to_pure(self)
get_work(self, shape0, shape1, shape2, shape3)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, long shell_type1, long shell_type2, long shell_type3, ndarray r0, ndarray r1, ndarray r2, ndarray r3)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

max_nbasis
max_shell_type
nwork
class horton.gbasis.cext.GB4ElectronRepulsionIntegralLibInt

Bases: horton.gbasis.cext.GB4Integral

Wrapper for ints.GB4ElectronRepulsionIntegralLibInt, for testing only

add(self, double coeff, double alpha0, double alpha1, double alpha2, double alpha3, ndarray scales0, ndarray scales1, ndarray scales2, ndarray scales3)
cart_to_pure(self)
get_work(self, shape0, shape1, shape2, shape3)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, long shell_type1, long shell_type2, long shell_type3, ndarray r0, ndarray r1, ndarray r2, ndarray r3)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

max_nbasis
max_shell_type
nwork
class horton.gbasis.cext.GB4ErfIntegralLibInt

Bases: horton.gbasis.cext.GB4Integral

Wrapper for ints.GB4ElectronRepulsionIntegralLibInt, for testing only

add(self, double coeff, double alpha0, double alpha1, double alpha2, double alpha3, ndarray scales0, ndarray scales1, ndarray scales2, ndarray scales3)
cart_to_pure(self)
get_work(self, shape0, shape1, shape2, shape3)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, long shell_type1, long shell_type2, long shell_type3, ndarray r0, ndarray r1, ndarray r2, ndarray r3)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

max_nbasis
max_shell_type
mu
nwork
class horton.gbasis.cext.GB4GaussIntegralLibInt

Bases: horton.gbasis.cext.GB4Integral

Wrapper for ints.GB4GaussIntegralLibInt, for testing only

add(self, double coeff, double alpha0, double alpha1, double alpha2, double alpha3, ndarray scales0, ndarray scales1, ndarray scales2, ndarray scales3)
cart_to_pure(self)
get_work(self, shape0, shape1, shape2, shape3)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, long shell_type1, long shell_type2, long shell_type3, ndarray r0, ndarray r1, ndarray r2, ndarray r3)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

alpha
c
max_nbasis
max_shell_type
nwork
class horton.gbasis.cext.GB4RAlphaIntegralLibInt

Bases: horton.gbasis.cext.GB4Integral

Wrapper for ints.GB4RAlphaIntegralLibInt, for testing only

add(self, double coeff, double alpha0, double alpha1, double alpha2, double alpha3, ndarray scales0, ndarray scales1, ndarray scales2, ndarray scales3)
cart_to_pure(self)
get_work(self, shape0, shape1, shape2, shape3)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, long shell_type1, long shell_type2, long shell_type3, ndarray r0, ndarray r1, ndarray r2, ndarray r3)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

alpha
max_nbasis
max_shell_type
nwork
class horton.gbasis.cext.GB1DMGridDensityFn

Bases: horton.gbasis.cext.GB1DMGridFn

add(self, double coeff, double alpha0, ndarray scales0)
cart_to_pure(self)
get_work(self, shape0)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, ndarray r0, ndarray point)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

dim_output
dim_work
max_nbasis
max_shell_type
nwork
shell_type0
class horton.gbasis.cext.GB1DMGridGradientFn

Bases: horton.gbasis.cext.GB1DMGridFn

add(self, double coeff, double alpha0, ndarray scales0)
cart_to_pure(self)
get_work(self, shape0)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, ndarray r0, ndarray point)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

dim_output
dim_work
max_nbasis
max_shell_type
nwork
shell_type0
class horton.gbasis.cext.GB1DMGridGGAFn

Bases: horton.gbasis.cext.GB1DMGridFn

add(self, double coeff, double alpha0, ndarray scales0)
cart_to_pure(self)
get_work(self, shape0)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, ndarray r0, ndarray point)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

dim_output
dim_work
max_nbasis
max_shell_type
nwork
shell_type0
class horton.gbasis.cext.GB1DMGridKineticFn

Bases: horton.gbasis.cext.GB1DMGridFn

add(self, double coeff, double alpha0, ndarray scales0)
cart_to_pure(self)
get_work(self, shape0)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, ndarray r0, ndarray point)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

dim_output
dim_work
max_nbasis
max_shell_type
nwork
shell_type0
class horton.gbasis.cext.GB1DMGridHessianFn

Bases: horton.gbasis.cext.GB1DMGridFn

add(self, double coeff, double alpha0, ndarray scales0)
cart_to_pure(self)
get_work(self, shape0)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, ndarray r0, ndarray point)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

dim_output
dim_work
max_nbasis
max_shell_type
nwork
shell_type0
class horton.gbasis.cext.GB1DMGridMGGAFn

Bases: horton.gbasis.cext.GB1DMGridFn

add(self, double coeff, double alpha0, ndarray scales0)
cart_to_pure(self)
get_work(self, shape0)

This returns a copy of the c++ work array.

Returning a numpy array with a buffer created in c++ is dangerous. If the c++ array becomes deallocated, the numpy array may still point to the deallocated memory. For that reason, a copy is returned. Speed is not an issue as this class is only used for testing.

reset(self, long shell_type0, ndarray r0, ndarray point)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

dim_output
dim_work
max_nbasis
max_shell_type
nwork
shell_type0
class horton.gbasis.cext.IterGB1

Bases: object

Wrapper for the IterGB1 class, for testing only.

inc_prim(self)
inc_shell(self)
store(self, ndarray work, ndarray output, long dim=1)
update_prim(self)
update_shell(self)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

private_fields
public_fields
class horton.gbasis.cext.IterGB2

Bases: object

Wrapper for the IterGB2 class, for testing only.

inc_prim(self)
inc_shell(self)
store(self, ndarray work, ndarray output)
update_prim(self)
update_shell(self)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

private_fields
public_fields
class horton.gbasis.cext.IterGB4

Bases: object

Wrapper for the IterGB4 class, for testing only.

inc_prim(self)
inc_shell(self)
store(self, ndarray work, ndarray output)
update_prim(self)
update_shell(self)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

private_fields
public_fields
class horton.gbasis.cext.IterPow1(long shell_type0)

Bases: object

Wrapper for the IterPow1 class, for testing only.

inc(self)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

fields
class horton.gbasis.cext.IterPow2(long shell_type0, long shell_type1)

Bases: object

Wrapper for the IterPow2 class, for testing only.

inc(self)
__init__

x.__init__(…) initializes x; see help(type(x)) for signature

fields
horton.gbasis.cext.boys_function(long m, double t)
horton.gbasis.cext.boys_function_array(long mmax, double t)
horton.gbasis.cext.cart_to_pure_low(ndarray work_cart, ndarray work_pure, long shell_type, long nant, long npost)
horton.gbasis.cext.compute_cholesky(GOBasis gobasis, GB4Integral gb4int, double threshold=1e-08, lf=None)
horton.gbasis.cext.fac(long n)
horton.gbasis.cext.fac2(long n)
horton.gbasis.cext.binom(long n, long m)
horton.gbasis.cext.get_shell_nbasis(long shell_type)
horton.gbasis.cext.get_max_shell_type()
horton.gbasis.cext.gpt_coeff(long k, long n0, long n1, double pa, double pb)
horton.gbasis.cext.gb_overlap_int1d(long n0, long n1, double pa, double pb, double inv_gamma)
horton.gbasis.cext.nuclear_attraction_helper(ndarray work_g, long n0, long n1, double pa, double pb, double cp, double gamma_inv)
horton.gbasis.cext.cit(int i, double t, int m)
horton.gbasis.cext.jfac(int j, int n)
horton.gbasis.cext.dtaylor(int n, double alpha, double t, double tfactor)
horton.gbasis.cext.gob_cart_normalization(double alpha, ndarray n)
horton.gbasis.cext.gob_pure_normalization(double alpha, long l)
horton.gbasis.cext.get_2index_slice(GOBasis gobasis, long index0, long index2, ndarray slice)
horton.gbasis.cext.compute_diagonal(GOBasis gobasis, ndarray diagonal)
horton.gbasis.cext.select_2index(GOBasis gobasis, long index0, long index2)
horton.gbasis.cext.iter_pow1_inc(ndarray n)