3.3.2. horton.gbasis.gobasis
– Gaussian orbital basis set module.¶
-
class
horton.gbasis.gobasis.
GOBasisDesc
(default, element_map=None, index_map=None, pure=True)¶ Bases:
object
Arguments:
- default
- The default basis set applied to each atom.
Optional arguments:
- element_map
- A dictionary with element names or numbers as keys, and basis sets as values. These specs override the default basis
- index_map
- A dictionary with atomic indexes (based on the order of the atoms) as keys and basis sets as values
- pure
- By default pure basis functions are used. Set this to false to switch to Cartesian basis functions.
In the argument
default
,element_map
andindex_map
, basis may either refer to None, a string representation like"STO-3G"
, a GOBasisFamily instance or a GOBasisAtom instance.-
__init__
(default, element_map=None, index_map=None, pure=True)¶ Arguments:
- default
- The default basis set applied to each atom.
Optional arguments:
- element_map
- A dictionary with element names or numbers as keys, and basis sets as values. These specs override the default basis
- index_map
- A dictionary with atomic indexes (based on the order of the atoms) as keys and basis sets as values
- pure
- By default pure basis functions are used. Set this to false to switch to Cartesian basis functions.
In the argument
default
,element_map
andindex_map
, basis may either refer to None, a string representation like"STO-3G"
, a GOBasisFamily instance or a GOBasisAtom instance.
-
apply_to
(coordinates, numbers)¶ Construct a GOBasis object for the given molecular geometry
Arguments:
- coordinates
- A (N, 3) float numpy array with Cartesian coordinates of the atoms.
- numbers
- A (N,) numpy vector with the atomic numbers.
Note that the geometry specified by the arguments may also contain ghost atoms.
-
class
horton.gbasis.gobasis.
GOBasisFamily
(name, basis_atom_map=None, filename=None)¶ Bases:
object
Arguments:
- name
- The name of the basis set family, e.g. ‘STO-3G’.
Optional Arguments:
- basis_atom_map
- A dictionary with atomic numbers as values and GOBasisAtom instances as keys.
- filename
- A file to load the basis set from when needed.
Either one of the two optional arguments must be provided. The first allows the user to craft his/her own basis set family. The second can be used to refer to a file that contains the basis set family. This file is only loaded when a basis set is requested for a given atom, in order to avoid slow startup times. The format of the basis set filename is deduced from the extension.
-
__init__
(name, basis_atom_map=None, filename=None)¶ Arguments:
- name
- The name of the basis set family, e.g. ‘STO-3G’.
Optional Arguments:
- basis_atom_map
- A dictionary with atomic numbers as values and GOBasisAtom instances as keys.
- filename
- A file to load the basis set from when needed.
Either one of the two optional arguments must be provided. The first allows the user to craft his/her own basis set family. The second can be used to refer to a file that contains the basis set family. This file is only loaded when a basis set is requested for a given atom, in order to avoid slow startup times. The format of the basis set filename is deduced from the extension.
-
dump
(filename)¶ Dump the basis set in the gbs format.
Parameters: filename (str) – Name of the gbs file that will be created.
-
get
(number)¶ Return the GOBasisAtom instance for the given number.
-
load
()¶ Load the basis set from file if it hasn’t been done already.
Note
If the basis_atom_map is already defined (not None), then the load method is ignored
-
class
horton.gbasis.gobasis.
GOBasisAtom
(bcs)¶ Bases:
object
Arguments:
- bcs
- A list of GOBasisContraction instances.
-
__init__
(bcs)¶ Arguments:
- bcs
- A list of GOBasisContraction instances.
-
extend
(i, shell_map, nprims, shell_types, alphas, con_coeffs, pure=True)¶ Extend the lists with basis functions for this atom.
Arguments:
- i
- The index of the center of this atom.
- shell_map, nprims, shell_types, alphas, con_coeffs
- These are all output arguments that must be extended with the basis set parameters for this atom. The meaning of each argument is defined in the documentation for constructor of the GOBasis class.
Optional argument:
- pure
- By default pure basis functions are used. Set this to False to switch to Cartesian basis functions.
-
class
horton.gbasis.gobasis.
GOBasisContraction
(shell_type, alphas, con_coeffs)¶ Bases:
object
Arguments:
- shell_type
- The angular quantum numbers of the shell. (0=s, 1=p, 2=d, …)
- alphas
- 1D array with exponents of the primitives.
- con_coeffs
- the linear coefficients of the contraction. In the case of a segmented basis set, this is just a 1D array with the same size as alphas. In the case of a generalized contraction, this is a 2D numpy array, where each row corresponds to a primitive and the columns correspond to different contractions.
It is possible to construct this object with lists instead of arrays as arguments. Just call the to_arrays method once the lists are completed. (This is convenient when loading basis sets from a file.)
-
__init__
(shell_type, alphas, con_coeffs)¶ Arguments:
- shell_type
- The angular quantum numbers of the shell. (0=s, 1=p, 2=d, …)
- alphas
- 1D array with exponents of the primitives.
- con_coeffs
- the linear coefficients of the contraction. In the case of a segmented basis set, this is just a 1D array with the same size as alphas. In the case of a generalized contraction, this is a 2D numpy array, where each row corresponds to a primitive and the columns correspond to different contractions.
It is possible to construct this object with lists instead of arrays as arguments. Just call the to_arrays method once the lists are completed. (This is convenient when loading basis sets from a file.)
-
get_segmented_bcs
()¶ Return a list of segmented contractions.
-
is_generalized
()¶ Return True if this is a generalized contraction.
-
normalize
(**kwargs)¶ Normalize the contraction.
-
to_arrays
()¶ Convert the alphas and con_coeffs attributes to numpy arrays.
-
horton.gbasis.gobasis.
get_gobasis
(coordinates, numbers, default, element_map=None, index_map=None, pure=True)¶ Return GOBasis for a given molecule
Arguments:
- coordinates
- A (N, 3) float numpy array with Cartesian coordinates of the atoms.
- numbers
- A (N,) numpy vector with the atomic numbers.
- default
- The default basis set applied to each atom.
Optional arguments:
- element_map
- A dictionary with element names or numbers as keys, and basis sets as values. These specs override the default basis
- index_map
- A dictionary with atomic indexes (based on the order of the atoms) as keys and basis sets as values
- pure
- By default pure basis functions are used. Set this to false to switch to Cartesian basis functions.
Returns: a GOBasis instance
In the argument
default
,element_map
andindex_map
, basis may either refer to None, a string representation like"STO-3G"
, a GOBasisFamily instance or a GOBasisAtom instance.Note that the geometry specified by the arguments can also contain ghost atoms.