qmmm_pme.interfaces package¶
Submodules¶
qmmm_pme.interfaces.interface module¶
A module to define the SoftwareInterface base class and the
various SoftwareSettings classes.
- class qmmm_pme.interfaces.interface.MMSettings(system, nonbonded_method='PME', nonbonded_cutoff=14.0, pme_gridnumber=30, pme_alpha=5.0, temperature=300.0, friction=0.001, timestep=1.0)[source]¶
Bases:
SoftwareSettingsAn immutable wrapper class which holds settings for an MM software interface.
- Parameters:
system (System) – The
Systemobject to perform MM calculations on.nonbonded_method (str) – The MM nonbonded method.
nonbonded_cutoff (float | int) – The MM nonbonded cutoff.
pme_gridnumber (int) – The number of PME gridpoints to use along each box vector.
pme_alpha (float | int) – The PME alpha parameter for Gaussian widths, in inverse nanometers.
temperature (float | int) – The temperature, in Kelvin.
friction (float | int) – The friction felt by particles as a result of a thermostat, in inverse femtoseconds.
timestep (float | int) – The timestep that the
Simulationpropagates with, in femtoseconds.
- friction: float | int = 0.001¶
- nonbonded_cutoff: float | int = 14.0¶
- nonbonded_method: str = 'PME'¶
- pme_alpha: float | int = 5.0¶
- pme_gridnumber: int = 30¶
- temperature: float | int = 300.0¶
- timestep: float | int = 1.0¶
- class qmmm_pme.interfaces.interface.QMSettings(system, basis_set, functional, charge, spin, quadrature_spherical=302, quadrature_radial=75, scf_type='df', read_guess=True, reference_energy=None)[source]¶
Bases:
SoftwareSettingsAn immutable wrapper class which holds settings for a QM software interface.
- Parameters:
system (System) – The
Systemobject to perform QM calculations on.basis_set (str) – The basis set to use for QM calculations.
functional (str) – The DFT functional to use for the QM calculations.
charge (int) – The net charge of the QM atoms.
spin (int) – The net spin of the QM atoms.
quadrature_spherical (int) – The number of spherical (angular and azimuthal) points to use in the Lebedev quadrature.
quadrature_radial (int) – The number of radial points to use in the Lebedev quadrature.
scf_type (str) – The type of SCF procedure to perform for QM calculations.
read_guess (bool) – Whether or not read in wavefunction from previous a calculation. This speeds up calculations.
reference_energy (float | int | None) – The base potential energy for QM energies, in Hartree. This is subtracted from all QM energies.
- basis_set: str¶
- charge: int¶
- functional: str¶
- quadrature_radial: int = 75¶
- quadrature_spherical: int = 302¶
- read_guess: bool = True¶
- reference_energy: float | int | None = None¶
- scf_type: str = 'df'¶
- spin: int¶
- class qmmm_pme.interfaces.interface.SoftwareInterface[source]¶
Bases:
ABCThe abstract
SoftwareInterfacebase class.- abstract compute_components()[source]¶
Compute the components of the potential energy for the
Systemwith theSoftwareInterface.- Returns:
The individual contributions to the energy, in kJ/mol.
- Return type:
dict[str, float]
- abstract compute_energy()[source]¶
Compute the energy for the
Systemwith theSoftwareInterface.- Returns:
The calculated energy, in kJ/mol.
- Return type:
float
- abstract compute_forces()[source]¶
Compute the forces for the
Systemwith theSoftwareInterface.- Returns:
The calculated forces, in kJ/mol/Angstrom.
- Return type:
NDArray[np.float64]
- class qmmm_pme.interfaces.interface.SoftwareSettings[source]¶
Bases:
ABCAn abstract
SoftwareSettingsbase class.Note
This currently doesn’t do anything.
qmmm_pme.interfaces.interface_manager module¶
A module for handling software interface imports.
Warning
MyPy is not currently happy with this module.
- qmmm_pme.interfaces.interface_manager.get_software_factories(field)[source]¶
Get the FACTORIES dictionary for the specified field of the interfaces configuration file. Fields include ‘MMSoftware’ or ‘QMSoftware’.
- Parameters:
field (str) – The field of the interfaces configuration file to extract a FACTORIES dictionary for.
- Returns:
The FACTORIES dictionary for the specified field of the interfaces configuration file.
- Return type:
Factory
qmmm_pme.interfaces.openmm_interface module¶
A module to define the OpenMMInterface class.
- class qmmm_pme.interfaces.openmm_interface.OpenMMInterface(pdb, modeller, forcefield, system, context)[source]¶
Bases:
SoftwareInterfaceA
SoftwareInterfaceclass which wraps the functional components of OpenMM.- Parameters:
pdb (PDBFile) – The OpenMM PDBFile object for the interface.
modeller (Modeller) – The OpenMM Modeller object for the interface.
forcefield (ForceField) – The OpenMM ForceField object for the interface.
system (System) – The OpenMM System object for the interface.
context (Context) – The OpenMM Context object for the interface.
- compute_components(**kwargs)[source]¶
Compute the components of the potential energy for the
Systemwith theSoftwareInterface.- Returns:
The individual contributions to the energy, in kJ/mol.
- Parameters:
kwargs (bool) –
- Return type:
dict[str, float]
- compute_energy(**kwargs)[source]¶
Compute the energy for the
Systemwith theSoftwareInterface.- Returns:
The calculated energy, in kJ/mol.
- Parameters:
kwargs (bool) –
- Return type:
float
- compute_forces(**kwargs)[source]¶
Compute the forces for the
Systemwith theSoftwareInterface.- Returns:
The calculated forces, in kJ/mol/Angstrom.
- Parameters:
kwargs (bool) –
- Return type:
NDArray[np.float64]
- context: Context¶
- forcefield: ForceField¶
- get_state_notifiers()[source]¶
Get the methods which should be called when a given
StateVariableis updated.- Returns:
A dictionary of
StateVariablenames and their respective notifier methods.- Return type:
dict[str, Callable[[NDArray[np.float64]], None]]
- get_topology_notifiers()[source]¶
Get the methods which should be called when a given
TopologyVariableis updated.- Returns:
A dictionary of
TopologyVariablenames and their respective notifier methods.- Return type:
dict[str, Callable[(Ellipsis, None)]]
- modeller: Modeller¶
- pdb: PDBFile¶
- system: System¶
- update_box(box)[source]¶
Update the box vectors for OpenMM.
- Parameters:
box (NDArray[np.float64]) – The current box vectors of the
System, in Angstroms.- Return type:
None
Warning
This method is not currently implemented.
- qmmm_pme.interfaces.openmm_interface.openmm_embedding_factory(settings)[source]¶
A function which constructs the
OpenMMInterfacefor a mechanical embedding subsystem of a QM/MM supersystem.- Parameters:
settings (MMSettings) – The
MMSettingsobject to build the mechanical embedding subsystem interface from.- Returns:
The
OpenMMInterfacefor the mechanical embedding subsystem.- Return type:
- qmmm_pme.interfaces.openmm_interface.openmm_subsystem_factory(settings)[source]¶
A function which constructs the
OpenMMInterfacefor an MM subsystem of a QM/MM supersystem.- Parameters:
settings (MMSettings) – The
MMSettingsobject to build the MM subsystem interface from.- Returns:
The
OpenMMInterfacefor the MM subsystem.- Return type:
- qmmm_pme.interfaces.openmm_interface.openmm_system_factory(settings)[source]¶
A function which constructs the
OpenMMInterfacefor a standalone MM system.- Parameters:
settings (MMSettings) – The
MMSettingsobject to build the standalone MM system interface from.- Returns:
The
OpenMMInterfacefor the standalone MM system.- Return type:
qmmm_pme.interfaces.pme_openmm_interface module¶
A module to define the OpenMMInterface class.
- class qmmm_pme.interfaces.pme_openmm_interface.PMEOpenMMInterface(pdb, modeller, forcefield, system, context)[source]¶
Bases:
OpenMMInterfaceA class which wraps the functional components of OpenMM.
- Parameters:
pdb (PDBFile) –
modeller (Modeller) –
forcefield (ForceField) –
system (System) –
context (Context) –
- context: Context¶
- forcefield: ForceField¶
- modeller: Modeller¶
- pdb: PDBFile¶
- qmmm_pme.interfaces.pme_openmm_interface.pme_openmm_embedding_factory(settings)[source]¶
A function which constructs the
OpenMMInterface.- Parameters:
settings (MMSettings) –
- Return type:
- qmmm_pme.interfaces.pme_openmm_interface.pme_openmm_subsystem_factory(settings)[source]¶
A function which constructs the
OpenMMInterface.- Parameters:
settings (MMSettings) –
- Return type:
- qmmm_pme.interfaces.pme_openmm_interface.pme_openmm_system_factory(settings)[source]¶
A function which constructs the
OpenMMInterface.- Parameters:
settings (MMSettings) –
- Return type:
qmmm_pme.interfaces.psi4_interface module¶
A module to define the Psi4Interface class.
- class qmmm_pme.interfaces.psi4_interface.Psi4Context(atoms, embedding, elements, positions, charge, spin)[source]¶
Bases:
objectA wrapper class for managing Psi4 Geometry object generation.
- Parameters:
atoms (list[list[int]]) – …
embedding (list[list[int]]) – …
elements (list[str]) – The element symbols of all atoms in the
Topologyof theSystemobject.positions (NDArray[np.float64]) – The current positions of all atoms in the
System, in Angstroms.charge (int) – The net charge of the QM atoms.
spin (int) – The net spin of the QM atoms.
- generate_molecule()[source]¶
Create the Geometry object for Psi4 calculations.
- Returns:
The Psi4 Geometry object.
- Return type:
Molecule
- class qmmm_pme.interfaces.psi4_interface.Psi4Interface(options, functional, context, reference)[source]¶
Bases:
SoftwareInterfaceA
SoftwareInterfaceclass which wraps the functional components of Psi4.- Parameters:
options (Psi4Options) – The
Psi4Optionsobject for the interface.functional (str) – The DFT functional to use for the QM calculations.
context (Psi4Context) – The
Psi4Contextobject for the interface.reference (Psi4Reference) – The
Psi4Referenceobject for the interface.
- compute_components(**kwargs)[source]¶
Compute the components of the potential energy for the
Systemwith theSoftwareInterface.- Returns:
The individual contributions to the energy, in kJ/mol.
- Parameters:
kwargs (ComputationOptions) –
- Return type:
dict[str, float]
- compute_energy(**kwargs)[source]¶
Compute the energy for the
Systemwith theSoftwareInterface.- Returns:
The calculated energy, in kJ/mol.
- Parameters:
kwargs (ComputationOptions) –
- Return type:
float
- compute_forces(**kwargs)[source]¶
Compute the forces for the
Systemwith theSoftwareInterface.- Returns:
The calculated forces, in kJ/mol/Angstrom.
- Parameters:
kwargs (ComputationOptions) –
- Return type:
NDArray[np.float64]
- compute_quadrature()[source]¶
Build a reference quadrature.
- Returns:
A reference quadrature constructed from the Psi4 Geometry object.
- Return type:
ndarray[Any, dtype[float64]]
- context: Psi4Context¶
- functional: str¶
- get_state_notifiers()[source]¶
Get the methods which should be called when a given
StateVariableis updated.- Returns:
A dictionary of
StateVariablenames and their respective notifier methods.- Return type:
dict[str, Callable[(Ellipsis, None)]]
- get_topology_notifiers()[source]¶
Get the methods which should be called when a given
TopologyVariableis updated.- Returns:
A dictionary of
TopologyVariablenames and their respective notifier methods.- Return type:
dict[str, Callable[(Ellipsis, None)]]
- options: Psi4Options¶
- reference: Psi4Reference¶
- update_embedding(embedding)[source]¶
Update the analytic embedding atoms for Psi4.
- Parameters:
embedding (list[list[int]]) – …
- Return type:
None
- update_memory(memory)[source]¶
Update the amount of memory for Psi4 to use.
- Parameters:
memory (str) – The amount of memory for Psi4 to use.
- Return type:
None
- class qmmm_pme.interfaces.psi4_interface.Psi4Options(basis, dft_spherical_points, dft_radial_points, scf_type, scf__reference, scf__guess)[source]¶
Bases:
objectAn immutable wrapper class for storing Psi4 global options.
- Parameters:
basis (str) – The basis set to use for QM calculations.
dft_spherical_points (int) – The number of spherical (angular and azimuthal) points to use in the Lebedev quadrature.
dft_radial_points (int) – The number of radial points to use in the Lebedev quadrature.
scf_type (str) – The type of SCF procedure to perform for QM calculations.
scf__reference (str) – The base potential energy for QM energies, in Hartree. This is subtracted from all QM energies.
scf__guess (str) – The type of guess to use for the Psi4 calculation.
- basis: str¶
- dft_radial_points: int¶
- dft_spherical_points: int¶
- scf__guess: str¶
- scf__reference: str¶
- scf_type: str¶
- class qmmm_pme.interfaces.psi4_interface.Psi4Reference(total, nuclear_repulsion, one_electron, kinetic, potential, two_electron, exchange_correlation)[source]¶
Bases:
objectAn immutable wrapper class for storing Psi4 reference energies.
- Parameters:
total (float | int) – The total reference energy, in Hartree.
nuclear_repulsion (float | int) – The reference nuclear repulsion energy, in Hartree.
one_electron (float | int) – The reference one-electron energy, in Hartree.
kinetic (float | int) – The reference one-electron kinetic energy, in Hartree.
potential (float | int) – The reference one-electron potential energy, in Hartree.
two_electron (float | int) – The reference two-electron energy, in Hartree.
exchange_correlation (float | int) – The reference exchange-correlation energy, in Hartree.
- exchange_correlation: float | int¶
- kinetic: float | int¶
- nuclear_repulsion: float | int¶
- one_electron: float | int¶
- potential: float | int¶
- total: float | int¶
- two_electron: float | int¶
- qmmm_pme.interfaces.psi4_interface.psi4_system_factory(settings)[source]¶
A function which constructs the
Psi4Interfacefor a QM system.- Parameters:
settings (QMSettings) – The
QMSettingsobject to build the QM system interface from.- Returns:
The
Psi4Interfacefor the QM system.- Return type:
Module contents¶
A sub-package containing interfaces to external software.