3.4.1. horton.gbasis.cext
– C++ extensions¶

class
horton.gbasis.cext.
GOBasis
¶ Bases:
horton.gbasis.cext.GBasis

check_matrix_coeffs
()¶

check_matrix_four_index
()¶

check_matrix_two_index
()¶

compute_electron_repulsion
()¶ Compute electronelectron repulsion integrals
Argument:
 output
 When a
DenseFourIndex
object is given, it is used as output argument and its contents are overwritten. When aDenseLinalgFactory
orCholeskyLinalgFactory
is given, it is used to construct the fourindex object in which the integrals are stored.
Returns: The fourindex object with the electron repulsion integrals.
Keywords: ERI, fourcenter integrals

compute_grid_density_dm
()¶ Compute the electron density on a grid for a given density matrix.
Arguments:
 dm
 A density matrix. For now, this must be a DenseTwoIndex object.
 points
 A Numpy array with grid points, shape (npoint,3).
Optional arguments:
 output
 A Numpy array for the output, shape (npoint,). When not given, an output array is allocated and returned.
 epsilon
 Allow errors on the density of this magnitude for the sake of efficiency.
Warning: the results are added to the output array! This may be useful to combine results from different spin components.
Returns: the output array. (It is allocated when not given.)

compute_grid_density_fock
()¶ Compute a twoindex operator based on a density potential grid in realspace
Arguments:
 points
 A Numpy array with grid points, shape (npoint,3).
 weights
 A Numpy array with integration weights, shape (npoint,).
 pots
 A Numpy array with density potential data, shape (npoint,).
 fock
 A twoindex operator. For now, this must be a DenseTwoIndex object.
Warning: the results are added to the fock operator!

compute_grid_esp_dm
()¶ Compute the electrostatic potential on a grid for a given density matrix.
Arguments:
 dm
 A density matrix. For now, this must be a DenseTwoIndex object.
 coordinates
 A (N, 3) float numpy array with Cartesian coordinates of the atoms.
 charges
 A (N,) numpy vector with the atomic charges.
 points
 A Numpy array with grid points, shape (npoint,3).
 grid_fn
 A grid function.
Optional arguments:
 output
 A Numpy array for the output. When not given, it will be allocated.
Warning: the results are added to the output array! This may be useful to combine results from different spin components.

compute_grid_gradient_dm
()¶ Compute the electron density gradient on a grid for a given density matrix.
Arguments:
 dm
 A density matrix. For now, this must be a DenseTwoIndex object.
 points
 A Numpy array with grid points, shape (npoint,3).
Optional arguments:
 output
 A Numpy array for the output, shape (npoint,3). When not given, it will be allocated.
 epsilon
 Allow errors on the density of this magnitude for the sake of efficiency.
Warning: the results are added to the output array! This may be useful to combine results from different spin components.

compute_grid_gradient_fock
()¶ Compute a twoindex operator based on a density potential grid in realspace
Arguments:
 points
 A Numpy array with grid points, shape (npoint,3).
 weights
 A Numpy array with integration weights, shape (npoint,).
 pots
 A Numpy array with gradient potential data, shape (npoint, 3).
 fock
 A twoindex operator. For now, this must be a DenseTwoIndex object.
Warning: the results are added to the fock operator!

compute_grid_hartree_dm
()¶ Compute the Hartree potential on a grid for a given density matrix.
Arguments:
 dm
 A density matrix. For now, this must be a DenseTwoIndex object.
 points
 A Numpy array with grid points, shape (npoint,3).
 grid_fn
 A grid function.
Optional arguments:
 output
 A Numpy array for the output. When not given, it will be allocated.
Warning: the results are added to the output array! This may be useful to combine results from different spin components.

compute_grid_kinetic_dm
()¶ Compute the kinetic energy density on a grid for a given density matrix.
Arguments:
 dm
 A density matrix. For now, this must be a DenseTwoIndex object.
 points
 A Numpy array with grid points, shape (npoint,3).
Optional arguments:
 output
 A Numpy array for the output, shape (npoint,). When not given, it will be allocated.
Returns: An array with shape (npoint,) containing the kinetic energy density. When an output array is given, it is also used as return value.
Warning: the results are added to the output array! This may be useful to combine results from different spin components.

compute_grid_kinetic_fock
()¶ Compute a twoindex operator based on a kientic energy density potential grid in realspace
Arguments:
 points
 A Numpy array with grid points, shape (npoint,3).
 weights
 A Numpy array with integration weights, shape (npoint,).
 pots
 A Numpy array with kinetic energy density potential data, shape (npoint,).
 fock
 A onebody operator. For now, this must be a DenseOneBody object.
Warning: the results are added to the fock operator!

compute_grid_orbitals_exp
()¶ Compute the orbitals on a grid for a given set of expansion coefficients.
Arguments:
 exp
 An expansion object. For now, this must be a DenseExpansion object.
 points
 A Numpy array with grid points, shape (npoint,3).
 iorbs
 The indexes of the orbitals to be computed. If not given, the orbitals with a nonzero occupation number are computed
Optional arguments:
 output
 An output array, shape (npoint, len(iorbs)). The results are added to this array. When not given, an output array is allocated and the result is returned.
Warning: the results are added to the output array!
Returns: the output array. (It is allocated when not given.)

compute_grid_point1
()¶

compute_kinetic
()¶ 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. WhenLinalgFactory
is given, it is used to construct the outputTwoIndex
object. In both cases, the output twoindex object is returned.
Returns:
TwoIndex
object

compute_nuclear_attraction
()¶ 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. WhenLinalgFactory
is given, it is used to construct the outputTwoIndex
object. In both cases, the output twoindex object is returned.
Returns:
TwoIndex
object

compute_overlap
()¶ 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. WhenLinalgFactory
is given, it is used to construct the outputTwoIndex
object. In both cases, the output twoindex object is returned.
Returns:
TwoIndex
object

concatenate
()¶ Concatenate multiple basis objects into a new one.
Arguments: each argument is an instance of the same subclass of GBasis.

from_hdf5
()¶

get_basis_atoms
()¶ 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
()¶

get_subset
()¶ 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
()¶

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
()¶

cart_to_pure
()¶

get_work
()¶ 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
()¶

max_nbasis
¶

max_shell_type
¶

nwork
¶


class
horton.gbasis.cext.
GB2KineticIntegral
¶ Bases:
horton.gbasis.cext.GB2Integral
Wrapper for ints.GB2OverlapIntegral, for testing only

add
()¶

cart_to_pure
()¶

get_work
()¶ 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
()¶

max_nbasis
¶

max_shell_type
¶

nwork
¶


class
horton.gbasis.cext.
GB2NuclearAttractionIntegral
¶ Bases:
horton.gbasis.cext.GB2Integral
Wrapper for ints.GB2NuclearAttractionIntegral, for testing only

add
()¶

cart_to_pure
()¶

get_work
()¶ 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
()¶

max_nbasis
¶

max_shell_type
¶

nwork
¶


class
horton.gbasis.cext.
GB4ElectronRepulsionIntegralLibInt
¶ Bases:
horton.gbasis.cext.GB4Integral
Wrapper for ints.GB4ElectronRepulsionIntegralLibInt, for testing only

add
()¶

cart_to_pure
()¶

get_work
()¶ 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
()¶

max_nbasis
¶

max_shell_type
¶

nwork
¶


class
horton.gbasis.cext.
GB1DMGridDensityFn
¶ Bases:
horton.gbasis.cext.GB1DMGridFn

add
()¶

cart_to_pure
()¶

get_work
()¶ 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
()¶

dim_output
¶

dim_work
¶

max_nbasis
¶

max_shell_type
¶

nwork
¶

shell_type0
¶


class
horton.gbasis.cext.
GB1DMGridGradientFn
¶ Bases:
horton.gbasis.cext.GB1DMGridFn

add
()¶

cart_to_pure
()¶

get_work
()¶ 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
()¶

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
()¶

inc_shell
()¶

store
()¶

update_prim
()¶

update_shell
()¶

private_fields
¶

public_fields
¶


class
horton.gbasis.cext.
IterGB2
¶ Bases:
object
Wrapper for the IterGB2 class, for testing only.

inc_prim
()¶

inc_shell
()¶

store
()¶

update_prim
()¶

update_shell
()¶

private_fields
¶

public_fields
¶


class
horton.gbasis.cext.
IterGB4
¶ Bases:
object
Wrapper for the IterGB4 class, for testing only.

inc_prim
()¶

inc_shell
()¶

store
()¶

update_prim
()¶

update_shell
()¶

private_fields
¶

public_fields
¶


class
horton.gbasis.cext.
IterPow1
¶ Bases:
object
Wrapper for the IterPow1 class, for testing only.

inc
()¶

fields
¶


class
horton.gbasis.cext.
IterPow2
¶ Bases:
object
Wrapper for the IterPow2 class, for testing only.

inc
()¶

fields
¶


horton.gbasis.cext.
boys_function
()¶

horton.gbasis.cext.
cart_to_pure_low
()¶

horton.gbasis.cext.
compute_cholesky
()¶

horton.gbasis.cext.
fac
()¶

horton.gbasis.cext.
fac2
()¶

horton.gbasis.cext.
binom
()¶

horton.gbasis.cext.
get_shell_nbasis
()¶

horton.gbasis.cext.
get_max_shell_type
()¶

horton.gbasis.cext.
gpt_coeff
()¶

horton.gbasis.cext.
gb_overlap_int1d
()¶

horton.gbasis.cext.
nuclear_attraction_helper
()¶

horton.gbasis.cext.
gob_cart_normalization
()¶

horton.gbasis.cext.
gob_pure_normalization
()¶

horton.gbasis.cext.
get_2index_slice
()¶

horton.gbasis.cext.
compute_diagonal
()¶

horton.gbasis.cext.
select_2index
()¶

horton.gbasis.cext.
iter_pow1_inc
()¶