molecularintegrals

class slowquant.molecularintegrals.integralclass._Integral(molecule_object_: _Molecule)

Initialize integral class.

Parameters:

molecule_object – Molecule class object.

property electron_repulsion_tensor: ndarray

Compute electron-repulsion integral tensor.

Returns:

Electron-repulsion integral tensor.

get_multipole_matrix(multipole_order: ndarray) ndarray

Compute multipole integral matrix.

Parameters:

multipole_order – Cartesian multipole orders (x, y, z).

Returns:

Multipole integral matrix.

property kinetic_energy_matrix: ndarray

Compute kinetic-energy integral matrix.

Returns:

Kinetic-energy integral matrix.

property nuclear_attraction_matrix: ndarray

Compute nuclear-attraction integral matrix.

Returns:

Nuclear-attraction integral matrix.

property overlap_matrix: ndarray

Compute overlap integral matrix.

Returns:

Overlap integral matrix.

slowquant.molecularintegrals.integralfunctions.boys_function(n: int, z: float) float

Calculate Boys function.

slowquant.molecularintegrals.integralfunctions.expansion_coefficients(A_x: float, B_x: float, a: float, b: float, angular_a: int, angular_b: int) ndarray

Calculate expansion coefficients for McMurchie-Davidson scheme.

\[E_t^{i,j} = 0\ \ \mathrm{for}\ \ t<0\ \mathrm{or}\ t>i+j\]
\[E_t^{i+1,j} = \frac{1}{2p}E_{t-1}^{i,j} + X_{PA}E_t^{i,j} + (t+1)E_{t+1}^{i,j}\]
\[E_t^{i,j+1} = \frac{1}{2p}E_{t-1}^{i,j} + X_{PB}E_t^{i,j} + (t+1)E_{t+1}^{i,j}\]
\[E_0^{0,0} = \exp\left(-\mu X^2_{AB}\right)\]

With \(p=a+b\), \(\mu=\frac{ab}{a+b}\), \(X_{AB}=A_x-B_x\), \(P_x=\frac{aA_x+bB_x}{p}\), and, for \(a\) and \(b\) being Gaussian exponents, and \(A_x\) \(B_x\) being the Gaussian centers.

Reference: Molecular Electronic-Structure Theory, https://onlinelibrary.wiley.com/doi/book/10.1002/9781119019572

Parameters:
  • A_x – x-coordinate of first Gaussian.

  • B_x – x-coordinate of second Gaussian.

  • a – Exponent of first Gaussian.

  • b – Exponent of second Gaussian.

  • angular_a – x-angular moment of first Gaussian.

  • angular_b – x-angular moment of second Gaussian.

Returns:

Returns expansion coefficients for McMurchie-Davidson scheme

slowquant.molecularintegrals.integralfunctions.hermite_coulomb_integral(angular_x: int, angular_y: int, angular_z: int, p: float, PC: ndarray) ndarray

Calculate Hermite coulomb integral.

\[R^n_{t+1,u,v} = t*R^{n+1}_{t-1,u,v} + X_{PC}R^{n+1}_{tuv}\]
\[R^n_{t,u+1,v} = u*R^{n+1}_{t,u-1,v} + Y_{PC}R^{n+1}_{tuv}\]
\[R^n_{t,u,v+1} = v*R^{n+1}_{t,u,v-1} + Z_{PC}R^{n+1}_{tuv}\]
\[R^{n}_{000} = (-2p)^nF_n\left(pR^2_{PC}\right)\]

Reference: Molecular Electronic-Structure Theory, https://onlinelibrary.wiley.com/doi/book/10.1002/9781119019572

slowquant.molecularintegrals.integralfunctions.hermite_multipole_integral(A_x: float, B_x: float, C_x: float, a: float, b: float, multipole_order: int) ndarray

Calculate Hermite multipole integral.

\[M_t^{e+1} = tM_{t-1}^e + X_{PC}M_t^e + \frac{1}{2p}M_{t+1}^e\]
\[M_t^0 = \delta_{t0}\left(\frac{\pi}{p}\right)^(1/2)\]
\[M_t^e = 0,\quad\quad t>e\]
slowquant.molecularintegrals.integralfunctions.one_electron_integral_transform(C: ndarray, int1e: ndarray) ndarray

Transform one-electron integrals from AO to MO.

Parameters:
  • C – MO coefficients.

  • int1e – One-electron integrals in AO.

Returns:

One-electron integrals in MO.

slowquant.molecularintegrals.integralfunctions.two_electron_integral_transform(C: ndarray, int2e: ndarray) ndarray

Transform two-electron integrals from AO to MO.

Parameters:
  • C – MO coefficients.

  • int2e – Two-electron integrals in AO.

Returns:

Two-electron integrals in MO.

slowquant.molecularintegrals.multipole.multipole_integral(center1: ndarray, center2: ndarray, exponents1: ndarray, exponents2: ndarray, contra_coeff1: ndarray, contra_coeff2: ndarray, norm1: ndarray, norm2: ndarray, angular_moments1: ndarray, angular_moments2: ndarray, multipole_origin: ndarray, multipole_moment: ndarray) ndarray

Calculate overlap integral over shells.

\[S^{efg}_\mathrm{primitive} = \sum_{t=0}^{\mathrm{min}(i+j,e)}\sum_{r=0}^{\mathrm{min}(k+l,f)}\sum_{p=0}^{\mathrm{min}(m+n,g)}E_t^{ij}E_s^{kl}E_k^{mn}M^e_tM^f_rM^g_p\]
\[S = \sum_{ij}N_iN_jc_ic_jS_{\mathrm{primitive},ij}\]

With \(E\) being the expansion coefficients, \(p\) the sum of the exponents of the Gaussians, \(N\) the normalization constant, and, \(c\) the contraction coefficients.

Reference: Molecular Electronic-Structure Theory, https://onlinelibrary.wiley.com/doi/book/10.1002/9781119019572

Parameters:
  • center1 – Center of first shell.

  • center2 – Center of second shell.

  • exponents1 – Exponents of primitives in first shell.

  • exponents2 – Exponents of primitives in second shell.

  • contra_coeff1 – Contraction coefficients of primitives in first shell.

  • contra_coeff2 – Contraction coefficients of primitives in second shell.

  • norm1 – Normalization constant of basis-functions in first shell.

  • norm2 – Normalization constant of basis-functions in second shell.

  • angular_moments1 – Cartesian angular moments of basis-functions in first shell.

  • angular_moments2 – Cartesian angular moments of basis-functions in second shell.

  • multipole_origin – Origin with respect to the multipole moment. Does not matter for the case when all the moments are zero (overlap integral).

  • multipole_moment – Cartesian multipole moment (x, y, z).

Returns:

Overlap integral between two shells.

slowquant.molecularintegrals.multipole.multipole_integral_driver(mol_obj: _Molecule, multipole_moment: ndarray) ndarray

Driver function for calculating overlap integrals.

Parameters:

mol_obj – Molecule object.

Returns:

Multipole integrals.

slowquant.molecularintegrals.kineticenergy.kinetic_energy_integral(center1: ndarray, center2: ndarray, exponents1: ndarray, exponents2: ndarray, contra_coeff1: ndarray, contra_coeff2: ndarray, norm1: ndarray, norm2: ndarray, angular_moments1: ndarray, angular_moments2: ndarray) ndarray

Calculate kinetic energy integral over shells.

\[D^2_{ij} = 4a^2S_{i+2,j} - 2a(2i+1)S_{ij}+i(i-1)S_[i-2,j]\]
\[T_\mathrm{primitive} = -\frac{1}{2}\left( D^2_{ij}S_{kl}S_{mn} + S_{ij}D^2_{kl}S_{mn} + S_{ij}S_{kl}D^2_{mn} \right)\]
\[T = \sum_{ij}N_iN_jc_ic_jT_{\mathrm{primitive},ij}\]

With \(E\) being the expansion coefficients, \(p\) the sum of the exponents of the Gaussians, \(N\) the normalization constant, and, \(c\) the contraction coefficients.

Reference: Molecular Electronic-Structure Theory, https://onlinelibrary.wiley.com/doi/book/10.1002/9781119019572

Parameters:
  • center1 – Center of first shell.

  • center2 – Center of second shell.

  • exponents1 – Exponents of primitives in first shell.

  • exponents2 – Exponents of primitives in second shell.

  • contra_coeff1 – Contraction coefficients of primitives in first shell.

  • contra_coeff2 – Contraction coefficients of primitives in second shell.

  • norm1 – Normalization constant of basis-functions in first shell.

  • norm2 – Normalization constant of basis-functions in second shell.

  • angular_moments1 – Cartesian angular moments of basis-functions in first shell.

  • angular_moments2 – Cartesian angular moments of basis-functions in second shell.

Returns:

Kinetic energy integral between two shells.

slowquant.molecularintegrals.kineticenergy.kinetic_energy_integral_driver(mol_obj: _Molecule) ndarray

Driver function for calculating kinetic energy integrals.

Parameters:

mol_obj – Molecule object.

Returns:

Kinetic energy integrals.

slowquant.molecularintegrals.nuclearattraction.nuclear_attraction_integral(center1: ndarray, center2: ndarray, exponents1: ndarray, exponents2: ndarray, contra_coeff1: ndarray, contra_coeff2: ndarray, norm1: ndarray, norm2: ndarray, angular_moments1: ndarray, angular_moments2: ndarray, atom_coordinates: ndarray, atom_charges: ndarray) ndarray

Calculate nuclear-attraction integral over shells.

\[V_\mathrm{primitive} = -\frac{2\pi}{p}\sum_NZ_N\sum_{tuv}E_t^{ij}E_u^{kl}E_v^{mn}R_{tuv}\]
\[V = \sum_{ij}N_iN_jc_ic_jV_{\mathrm{primitive},ij}\]

With \(E\) being the expansion coefficients, \(p\) the sum of the exponents of the Gaussians, \(N\) the normalization constant, and, \(c\) the contraction coefficients.

Reference: Molecular Electronic-Structure Theory, https://onlinelibrary.wiley.com/doi/book/10.1002/9781119019572

Parameters:
  • center1 – Center of first shell.

  • center2 – Center of second shell.

  • exponents1 – Exponents of primitives in first shell.

  • exponents2 – Exponents of primitives in second shell.

  • contra_coeff1 – Contraction coefficients of primitives in first shell.

  • contra_coeff2 – Contraction coefficients of primitives in second shell.

  • norm1 – Normalization constant of basis-functions in first shell.

  • norm2 – Normalization constant of basis-functions in second shell.

  • angular_moments1 – Cartesian angular moments of basis-functions in first shell.

  • angular_moments2 – Cartesian angular moments of basis-functions in second shell.

  • atom_coordinates – Coordinates of atoms in the molecule.

  • atom_charges – Charges of the atoms in the molecule.

Returns:

Nuclear-attraction integral between two shells.

slowquant.molecularintegrals.nuclearattraction.nuclear_attraction_integral_driver(mol_obj: _Molecule) ndarray

Driver function for calculating nuclear-attraction integrals.

Parameters:

mol_obj – Molecule object.

Returns:

Nuclear-attraction integrals.

slowquant.molecularintegrals.electronrepulsion.electron_repulsion_integral(center1: ndarray, center2: ndarray, center3: ndarray, center4: ndarray, exponents1: ndarray, exponents2: ndarray, exponents3: ndarray, exponents4: ndarray, contra_coeff1: ndarray, contra_coeff2: ndarray, contra_coeff3: ndarray, contra_coeff4: ndarray, norm1: ndarray, norm2: ndarray, norm3: ndarray, norm4: ndarray, angular_moments1: ndarray, angular_moments2: ndarray, angular_moments3: ndarray, angular_moments4: ndarray) ndarray

Calculate electron-repulsion integral over shells.

Args:

Returns:

Electron-repulsion integral between two shells.

slowquant.molecularintegrals.electronrepulsion.electron_repulsion_integral_driver(mol_obj: _Molecule, cauchy_schwarz_matrix: ndarray = None, cauchy_schwarz_threshold: float = 1e-10) ndarray

Driver function for calculating electron-repulsion integrals.

Might use the Cauchy Schwarz inequility to do integral screening:

\[|g_{abcd}| \geq \sqrt{g_{abab}}\sqrt{{g_{cdcd}}}\]

Reference: Molecular Electronic-Structure Theory, https://onlinelibrary.wiley.com/doi/book/10.1002/9781119019572

Parameters:
  • mol_obj – Molecule object.

  • cauchy_schwarz_matrix – Cauchy Schwarz matrix, \(\sqrt{g_{ijij}}\).

  • cauchy_schwarz_threshold – Integral threshold using Cauchy Scwartz inequlity.

Returns:

Electron-repulsion integrals.

slowquant.molecularintegrals.electronrepulsion.get_cauchy_schwarz_matrix(mol_obj: _Molecule) ndarray

Calculate Cauchy Schwarz inequality matrix on shell level.

Integrals of the form \(\sqrt{g_{ijij}}\) will be the Cauchy Schwarz marix.

Parameters:

mol_obj – Molecule object.

Returns:

Cauchy Schwarz inequality matrix.