chemtools.utils.molecule.BaseMolecule¶

class
chemtools.utils.molecule.
BaseMolecule
(coordinates, numbers)[source]¶ Molecule Class.
This class serves as a template for the internal datatype used in ChemTools. Each of the methods are required to run different parts of ChemTools. If these methods are not defined, then a NotImplementedError will be raised to indicate that this method is not compatible with the given Molecule instance/class.
Initialize class.
Parameters:  coordinates (ndarray) – The 2darray containing the cartesian coordinates of atomic centers. It has a shape of (M, 3) where M is the number of atoms.
 numbers (ndarray) – The 1darray containing the atomic number of atoms. It has a shape of (M,) where M is the number of atoms.

classmethod
from_file
(filename)[source]¶ Initialize class given a file.
Parameters: filename (str) – Path to molecule’s files.

coordinates
¶ Cartesian coordinates of atomic centers.

numbers
¶ Aomic number of atomic centers.

natom
¶ Number of atoms.

nbasis
¶ Number of basis functions.

nelectrons
¶ Number of alpha and beta electrons.

homo_index
¶ Index of alpha and beta HOMO orbital.

lumo_index
¶ Index of alpha and beta LUMO orbital.

homo_energy
¶ Energy of alpha and beta HOMO orbital.

lumo_energy
¶ Energy of alpha and beta LUMO orbital.

orbital_occupation
¶ Orbital occupation of alpha and beta electrons.

orbital_energy
¶ Orbital energy of alpha and beta electrons.

orbital_coefficient
¶ Orbital coefficient of alpha and beta electrons.
The alpha and beta orbital coefficients are each storied in a 2darray in which the columns represent the basis coefficients of each molecular orbital.

compute_density_matrix_array
(spin='ab')[source]¶ Return the density matrix array for the specified spin orbitals.
Parameters: spin (str) – The type of occupied spin orbitals. By default, the alpha and beta electrons (i.e. alpha and beta occupied spin orbitals) are used for computing the electron density.  ‘a’ or ‘alpha’: consider alpha electrons  ‘b’ or ‘beta’: consider beta electrons  ‘ab’: consider alpha and beta electrons

compute_density
(points, spin='ab', orbital_index=None, output=None)[source]¶ Return electron density evaluated on the given points for the spin orbitals.
Parameters:  points (ndarray) – The 2darray containing the cartesian coordinates of points on which density is evaluated. It has a shape (n, 3) where n is the number of points.
 spin (str) – The type of occupied spin orbitals. By default, the alpha and beta electrons (i.e. alpha and beta occupied spin orbitals) are used for computing the electron density.  ‘a’ or ‘alpha’: consider alpha electrons  ‘b’ or ‘beta’: consider beta electrons  ‘ab’: consider alpha and beta electrons
 orbital_index (sequence) – Sequence of integers representing the index of spin orbitals. Alpha and beta spin
orbitals are each indexed from 1 to
nbasis
. IfNone
, all occupied spin orbtails are included.  output (np.ndarray) – Array with shape (n,) to store the output, where n in the number of points.
When
None
the array is allocated.

compute_gradient
(points, spin='ab', orbital_index=None, output=None)[source]¶ Return gradient of electron density evaluated on the given points for the spin orbitals.
Parameters:  points (ndarray) – The 2darray containing the cartesian coordinates of points on which density is evaluated. It has a shape (n, 3) where n is the number of points.
 spin (str) – The type of occupied spin orbitals. By default, the alpha and beta electrons (i.e. alpha and beta occupied spin orbitals) are used for computing the electron density.  ‘a’ or ‘alpha’: consider alpha electrons  ‘b’ or ‘beta’: consider beta electrons  ‘ab’: consider alpha and beta electrons
 orbital_index (sequence) – Sequence of integers representing the index of spin orbitals. Alpha and beta spin
orbitals are each indexed from 1 to
nbasis
. IfNone
, all occupied spin orbtails are included.  output (np.ndarray) – Array with shape (n, 3) to store the output, where n in the number of points.
When
None
the array is allocated.

compute_hessian
(points, spin='ab', orbital_index=None, output=None)[source]¶ Return hessian of electron density evaluated on the given points for the spin orbitals.
Parameters:  points (ndarray) – The 2darray containing the cartesian coordinates of points on which density is evaluated. It has a shape (n, 3) where n is the number of points.
 spin (str) – The type of occupied spin orbitals. By default, the alpha and beta electrons (i.e. alpha and beta occupied spin orbitals) are used for computing the electron density.  ‘a’ or ‘alpha’: consider alpha electrons  ‘b’ or ‘beta’: consider beta electrons  ‘ab’: consider alpha and beta electrons
 orbital_index (sequence) – Sequence of integers representing the index of spin orbitals. Alpha and beta spin
orbitals are each indexed from 1 to
nbasis
. IfNone
, all occupied spin orbtails are included.  output (np.ndarray) – Array with shape (n, 6) to store the output, where n in the number of points.
When
None
the array is allocated.

compute_esp
(points, spin='ab', orbital_index=None, output=None)[source]¶ Return the molecular electrostatic potential on the given points for the specified spin.
Parameters:  points (ndarray) – The 2darray containing the cartesian coordinates of points on which density is evaluated. It has a shape (n, 3) where n is the number of points.
 spin (str) – The type of occupied spin orbitals. By default, the alpha and beta electrons (i.e. alpha and beta occupied spin orbitals) are used for computing the electron density.  ‘a’ or ‘alpha’: consider alpha electrons  ‘b’ or ‘beta’: consider beta electrons  ‘ab’: consider alpha and beta electrons
 orbital_index (sequence) – Sequence of integers representing the index of spin orbitals. Alpha and beta spin
orbitals are each indexed from 1 to
nbasis
. IfNone
, all occupied spin orbtails are included.  output (np.ndarray) – Array with shape (n,) to store the output, where n in the number of points.
When
None
the array is allocated.

compute_kinetic_energy_density
(points, spin='ab', orbital_index=None, output=None)[source]¶ Return positive definite kinetic energy density on the given points for the specified spin.
Positive definite kinetic energy density is defined as,
\[\tau \left(\mathbf{r}\right) = \sum_i^N n_i \frac{1}{2} \rvert \nabla \phi_i \left(\mathbf{r}\right) \lvert^2\]Parameters:  points (ndarray) – The 2darray containing the cartesian coordinates of points on which density is evaluated. It has a shape (n, 3) where n is the number of points.
 spin (str) – The type of occupied spin orbitals. By default, the alpha and beta electrons (i.e. alpha and beta occupied spin orbitals) are used for computing the electron density.  ‘a’ or ‘alpha’: consider alpha electrons  ‘b’ or ‘beta’: consider beta electrons  ‘ab’: consider alpha and beta electrons
 orbital_index (sequence) – Sequence of integers representing the index of spin orbitals. Alpha and beta spin
orbitals are each indexed from 1 to
nbasis
. IfNone
, all occupied spin orbtails are included.  output (np.ndarray) – Array with shape (n,) to store the output, where n in the number of points.
When
None
the array is allocated.