pydft_qmmm.interfaces package¶
Subpackages¶
- pydft_qmmm.interfaces.openmm package
- Submodules
- pydft_qmmm.interfaces.openmm.openmm_factory module
- pydft_qmmm.interfaces.openmm.openmm_interface module
OpenMMInterface
OpenMMInterface.add_non_elst()
OpenMMInterface.add_real_elst()
OpenMMInterface.compute_components()
OpenMMInterface.compute_energy()
OpenMMInterface.compute_forces()
OpenMMInterface.update_box()
OpenMMInterface.update_charges()
OpenMMInterface.update_memory()
OpenMMInterface.update_positions()
OpenMMInterface.update_subsystems()
OpenMMInterface.update_threads()
OpenMMInterface.zero_charges()
OpenMMInterface.zero_forces()
OpenMMInterface.zero_intermolecular()
OpenMMInterface.zero_intramolecular()
- pydft_qmmm.interfaces.openmm.openmm_utils module
- Module contents
- pydft_qmmm.interfaces.psi4 package
- pydft_qmmm.interfaces.qmmm_pme_openmm package
- pydft_qmmm.interfaces.qmmm_pme_psi4 package
Submodules¶
pydft_qmmm.interfaces.interface module¶
Base classes for software interfaces and settings.
- class pydft_qmmm.interfaces.interface.MMInterface[source]¶
Bases:
SoftwareInterface
The abstract MM interface base class.
- theory_level¶
The level of theory that the software applies in energy and force calculations.
- abstract add_non_elst(atoms, inclusion=None)[source]¶
Add a non-electrostatic interaction for the specified atoms.
- Parameters:
atoms (frozenset[int]) – The indices of atoms to add a non-electrostatic, non-bonded interaction for.
inclusion (NDArray[np.float64] | None) – An Nx3 array with values that will be applied to the forces of the non-electrostatic interaction through element-wise multiplication.
- Return type:
None
- abstract add_real_elst(atoms, const=1, inclusion=None)[source]¶
Add Coulomb interaction for the specified atoms.
- Parameters:
atoms (frozenset[int]) – The indices of atoms to add a Coulomb interaction for.
const (float | int) – A constant to multiply at the beginning of the coulomb expression.
inclusion (NDArray[np.float64] | None) – An Nx3 array with values that will be applied to the forces of the Coulomb interaction through element-wise multiplication.
- Return type:
None
- theory_level: TheoryLevel = 'The molecular mechanical (forcefield) level of theory.'¶
- abstract zero_charges(atoms)[source]¶
Remove charges from the specified atoms.
- Parameters:
atoms (frozenset[int]) – The indices of atoms to remove charges from.
- Return type:
None
- abstract zero_forces(atoms)[source]¶
Zero forces on the specified atoms.
- Parameters:
atoms (frozenset[int]) – The indices of atoms to zero forces for.
- Return type:
None
- class pydft_qmmm.interfaces.interface.MMSettings(system, forcefield, nonbonded_method='PME', nonbonded_cutoff=14.0, pme_gridnumber=None, pme_alpha=None)[source]¶
Bases:
SoftwareSettings
Immutable container which holds settings for an MM interface.
- Parameters:
system (System) – The system which will be tied to the MM interface.
forcefield (list[str]) – The files containing forcefield and topology data for the system.
nonbonded_method (str) – The method for treating non-bonded interactions, as in OpenMM.
nonbonded_cutoff (float | int) – The distance at which to truncate close-range non-bonded interactions.
pme_gridnumber (tuple[int, int, int] | None) – The number of grid points to include along each lattice edge in PME summation.
pme_alpha (float | int | None) – The Gaussian width parameter in Ewald summation (\(\mathrm{nm^{-1}}\)).
- forcefield: list[str]¶
- nonbonded_cutoff: float | int = 14.0¶
- nonbonded_method: str = 'PME'¶
- pme_alpha: float | int | None = None¶
- pme_gridnumber: tuple[int, int, int] | None = None¶
- class pydft_qmmm.interfaces.interface.QMInterface[source]¶
Bases:
SoftwareInterface
The abstract QM interface base class.
- theory_level¶
The level of theory that the software applies in energy and force calculations.
- theory_level: TheoryLevel = 'The quantum mechanical (DFT) level of theory.'¶
- class pydft_qmmm.interfaces.interface.QMSettings(system, basis_set, functional, charge, spin, quadrature_spherical=302, quadrature_radial=75, scf_type='df', read_guess=True)[source]¶
Bases:
SoftwareSettings
Immutable container which holds settings for an QM interface.
- Parameters:
system (System) – The system which will be tied to the QM interface.
basis_set (str) – The name of the basis set to be used in QM calculations.
functional (str) – The name of the functional set to be used in QM calculations.
charge (int) – The net charge (\(e\)) of the system represented by the QM Hamiltonian.
spin (int) – The net spin of the system represented by the QM Hamiltonian
quadrature_spherical (int) – The number of spherical Lebedev points to use in the DFT quadrature.
quadrature_radial (int) – The number of radial points to use in the DFT quadrature.
scf_type (str) – The name of the type of SCF to perform, relating to the JK build algorithms as in Psi4.
read_guess (bool) – Whether or not to reuse previous wavefunctions as initial guesses in subsequent QM calculations.
- basis_set: str¶
- charge: int¶
- functional: str¶
- quadrature_radial: int = 75¶
- quadrature_spherical: int = 302¶
- read_guess: bool = True¶
- scf_type: str = 'df'¶
- spin: int¶
- class pydft_qmmm.interfaces.interface.SoftwareInterface[source]¶
Bases:
ABC
The abstract software interface base class.
- theory_level¶
The level of theory that the software applies in energy and force calculations.
- abstract compute_components()[source]¶
Compute the components of energy using the external software.
- Returns:
The components of the energy (\(\mathrm{kJ\;mol^{-1}}\)) of the system.
- Return type:
dict[str, float]
- abstract compute_energy()[source]¶
Compute the energy of the system using the external software.
- Returns:
The energy (\(\mathrm{kJ\;mol^{-1}}\)) of the system.
- Return type:
float
- abstract compute_forces()[source]¶
Compute the forces on the system using the external software.
- Returns:
The forces (\(\mathrm{kJ\;mol^{-1}\;\mathring{A}^{-1}}\)) acting on atoms in the system.
- Return type:
NDArray[np.float64]
- theory_level: TheoryLevel¶
pydft_qmmm.interfaces.interface_manager module¶
Functionality for importing package and external interfaces.
- pydft_qmmm.interfaces.interface_manager.MODULE_PATH¶
The directory where the PyDFT-QMMM interfaces sub-package is installed.
- pydft_qmmm.interfaces.interface_manager.DISCOVERED_INTERFACES¶
A list of entry points into the interface architecture of PyDFT-QMMM within installed package metadata.
- pydft_qmmm.interfaces.interface_manager.get_software_factory(field)[source]¶
Get a factory method according to the interfaces in
interfaces.conf
.Fields include ‘MMSoftware’ or ‘QMSoftware’.
- Parameters:
field (str) – The field of the interfaces configuration file to extract a factory method for.
- Returns:
A factory method which builds a software interface for the specified field.
- Return type:
Factory
- pydft_qmmm.interfaces.interface_manager.set_default_interfaces(qm_interface='Psi4', mm_interface='OpenMM')[source]¶
Set the default QM and MM interfaces in
interfaces.conf
.- Parameters:
qm_interface (str | None) – The name of the new default QM interface.
mm_interface (str | None) – The name of the new default MM interface.
- Return type:
None
- pydft_qmmm.interfaces.interface_manager.set_interfaces(qm_interface='Psi4', mm_interface='OpenMM')[source]¶
Set the active QM and MM interfaces in
interfaces.conf
.- Parameters:
qm_interface (str | None) – The name of the QM interface to use.
mm_interface (str | None) – The name of the MM interface to use.
- Return type:
None
Module contents¶
A sub-package containing interfaces to external software.