pydft_qmmm.interfaces.openmm package

Submodules

pydft_qmmm.interfaces.openmm.openmm_factory module

Functionality for building the OpenMM interface.

pydft_qmmm.interfaces.openmm.openmm_factory.SUPPORTED_FORCES

OpenMM force classes which can be processed by PyDFT-QMMM currently.

pydft_qmmm.interfaces.openmm.openmm_factory.openmm_interface_factory(settings)[source]

Build the interface to OpenMM given the settings.

Parameters:

settings (MMSettings) – The settings used to build the OpenMM interface.

Returns:

The OpenMM interface.

Return type:

OpenMMInterface

pydft_qmmm.interfaces.openmm.openmm_interface module

The basic OpenMM software interface.

class pydft_qmmm.interfaces.openmm.openmm_interface.OpenMMInterface(settings, base_context, ixn_context)[source]

Bases: MMInterface

A software interface wrapping OpenMM functionality.

Parameters:
  • settings (MMSettings) – The settings used to build the OpenMM interface.

  • base_context (openmm.Context) – The OpenMM Context object for the interface, comprising interactions of the entire system.

  • ixn_context (openmm.Context) – The OpenMM Context object for the interface, comprising interactions that may be required by QM/MM embedding procedures.

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

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

compute_components()[source]

Compute the components of energy using OpenMM.

Returns:

The components of the energy (\(\mathrm{kJ\;mol^{-1}}\)) of the system.

Return type:

dict[str, float]

compute_energy()[source]

Compute the energy of the system using OpenMM.

Returns:

The energy (\(\mathrm{kJ\;mol^{-1}}\)) of the system.

Return type:

float

compute_forces()[source]

Compute the forces on the system using OpenMM.

Returns:

The forces (\(\mathrm{kJ\;mol^{-1}\;\mathring{A}^{-1}}\)) acting on atoms in the system.

Return type:

NDArray[np.float64]

update_box(box)[source]

Set the lattice vectors used by OpenMM.

Parameters:

box (NDArray[np.float64]) – The lattice vectors (\(\mathrm{\mathring{A}}\)) of the box containing the system.

Return type:

None

update_charges(charges)[source]

Set the atomic partial charges used by OpenMM.

Parameters:

charges (NDArray[np.float64]) – The partial charges (\(e\)) of the atoms.

Return type:

None

update_memory(memory)[source]

Set the amount of memory used by OpenMM.

Parameters:

memory (str) – The amount of memory to utilize.

Return type:

None

update_positions(positions)[source]

Set the atomic positions used by OpenMM.

Parameters:

positions (NDArray[np.float64]) – The positions (\(\mathrm{\mathring{A}}\)) of the atoms within the system.

Return type:

None

update_subsystems(subsystems)[source]

Adjust embedding-related values by subsystem membership.

Parameters:

subsystems (np.ndarray[Any, np.dtype[np.object_]]) – The subsystems of which the atoms are a part.

Return type:

None

update_threads(threads)[source]

Set the number of threads used by OpenMM.

Parameters:

threads (int) – The number of threads to utilize.

Return type:

None

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

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

zero_intermolecular(atoms)[source]

Remove inter-molecular interactions for the specified atoms.

Parameters:

atoms (frozenset[int]) – The indices of atoms to remove inter-molecular interactions from.

Return type:

None

zero_intramolecular(atoms)[source]

Remove intra-molecular interactions for the specified atoms.

Parameters:

atoms (frozenset[int]) – The indices of atoms to remove intra-molecular interactions from.

Return type:

None

pydft_qmmm.interfaces.openmm.openmm_utils module

Functionality for performing exclusions and generating State objects.

Module contents

A sub-package for interfacing with OpenMM.