CDTK.Interfaces.EmbeddingInterface module

class CDTK.Interfaces.EmbeddingInterface.embedding(atomlist, atomnums, atommass3, xcart, **opts)[source]

Bases: object

This defines a class to embedd a QM interface into a MM region.

energy_gradient(X, V=None, S=0, Time=0.0, SH=False, **opts)[source]

Calculates the energy and gradient of the system using an ONIOM scheme: :math: E = E_{MM}(MM+QM) + E_{QM}(QM) - E_{MM}(QM) For the electrostatic embedding calculation, the Coulomb interaction in the QM region and the QM-MM Coulomb interaction are calculated with QCE. In this case, only the MM Coulomb energy is calculated with the forcefield.

Parameters:
  • X ((n_atoms, 3) ndarray of floats.) – Atomic positions, in Bohr (au).

  • V ((n_atoms, 3) ndarray of floats., optional) – Atomic velocities in au, by default None

  • S (int, optional) – Current electronic state, by default 0

  • Time (float, optional) – Current propagation time in au, by default 0.0

  • SH (bool, optional) – Whether to run surface hopping or not for QM energy, by default False

Returns:

  • e (float) – Energy in atomic units

  • g ((n_atoms, 3) ndarray of floats.) – Gradient in atomic units.

enforceConstraints(x)[source]
f_overlap(X1, X2, S)[source]
getConstraintsCorrection(vec0, vec1, dt, case)[source]

Calculates the correction to the position or velocities of atoms in case there are constraints. For now, only RATTLE algorithm implemented.

Parameters:
  • vec0 ((3 * n_atoms) ndarray of float.) – Array with position or velocities of atoms

  • vec1 ((3 * n_atoms) ndarray of float.) – Array with position or velocities of atoms

  • dt (float) – Timestep

  • case (str) – Flag for different types of correction

Returns:

correction – Array with correction for position or velocities.

Return type:

(3 * n_atoms) ndarray of float.

getD(X, V, t=0.0, **opts)[source]

Return matrix with kinetic couplings.

Parameters:
  • X ((n_atoms, 3) ndarray of floats.) – Array of atomic positions, in Bohr (au).

  • V ((n_atoms, 3) ndarray of floats.) – Array with atomic velocities in au.

  • t (float, optional) – Current propagation time in au, by default 0.0

Returns:

Matrix with kinetic couplings in au.

Return type:

_type_

getPartialCharges(chargetype='mulliken', state=0)[source]

returns partial charges of all atoms

Parameters:
  • chargetype (str, optional) – Type. Defaults to ‘mulliken’.

  • state (int, optional) – state index. Defaults to 0.

getW(X, V=None, t=0.0, **opts)[source]

Diagonal matrix with all adiabatic energies.

Parameters:
  • X ((n_atoms, 3) ndarray of floats.) – Atomic positions, in Bohr (au).

  • V ((n_atoms, 3) ndarray of floats., optional) – Atomic velocities in au, by default None

  • t (float, optional) – Current propagation time in au, by default 0.0

Returns:

e – Diagonal matrix with adiabatic energies in atomic units.

Return type:

__type__

hasConstraints()[source]

Checks wether there are constraints in the parts of the geometry modelled by forcefields.

nac(X, SI, SJ, V, t=0.0, **opts)[source]

Nonadiabatic coupling vector between states SI and SJ.

Parameters:
  • X ((n_atoms, 3) ndarray of floats.) – Atomic positions, in Bohr (au).

  • SI (int) – Current electronic state index.

  • SJ (int) – Index of state to which the coupling is calculated.

  • V ((n_atoms, 3) ndarray of floats.) – Atomic velocities in au.

  • t (float, optional) – Current propagation time in au, by default 0.0

Returns:

coupling – Nonadiabatic coupling vector.

Return type:

(n_atoms) ndarray of complex.

qmmmRepEgrad(d, alpha=0.8750892526850464, epsilon=0.79680726495395)[source]

computes Pauli exchance repulsion E = epsilon * exp(-alpha d**2)

Parameters:

d (double array shape(n)) – distances

Returns:

energy np.array of doubles: derivatives of energy with respect to distances

Return type:

double