qmmm_pme.calculators package

Submodules

qmmm_pme.calculators.calculator module

A module defining the Calculator base class and derived non-multiscale classes.

class qmmm_pme.calculators.calculator.CalculatorType(value)[source]

Bases: Enum

Enumeration of types of non-multiscale calculators.

ME = 'An ME Calculator.'
MM = 'An MM Calculator.'
QM = 'A QM Calculator.'
class qmmm_pme.calculators.calculator.ModifiableCalculator[source]

Bases: ABC

An abstract Calculator base class for interfacing with plugins.

active_plugins()[source]

Get the current list of active plugins.

Returns:

A list of the active plugins being employed by the Calculator.

Return type:

list[str]

abstract calculate(return_forces=True, return_components=True)[source]

Calculate energies and forces for the System with the Calculator.

Parameters:
  • return_forces (bool | None) – Whether or not to return forces.

  • return_components (bool | None) – Whether or not to return the components of the energy.

Returns:

The energy, forces, and energy components of the calculation.

Return type:

tuple[Any, …]

register_plugin(plugin)[source]

Register a Plugin modifying a Calculator routine.

Parameters:

plugin (CalculatorPlugin) – An CalculatorPlugin object.

Return type:

None

system: System
class qmmm_pme.calculators.calculator.Results(energy=0, forces=array([], dtype=float64), components=<factory>)[source]

Bases: object

A wrapper class for storing the results of a calculation.

Parameters:
  • energy (float) – The energy calculated for the system.

  • forces (NDArray[np.float64]) – The forces calculated for the system.

  • components (dict[str, float]) –

Components:

The components of the energy calculated for the system.

components: dict[str, float]
energy: float = 0
forces: NDArray[np.float64] = array([], dtype=float64)
class qmmm_pme.calculators.calculator.StandaloneCalculator(system, interface, options=<factory>)[source]

Bases: ModifiableCalculator

A Calculator class, defining the procedure for standalone QM or MM calculations.

Parameters:
  • system (System) – The System object to perform calculations on.

  • interface (SoftwareInterface) – The SoftwareInterface object to perform calculations with.

  • options (dict[str, Any]) – Options to provide to the SoftwareInterface.

calculate(return_forces=True, return_components=True)[source]

Calculate energies and forces for the System with the Calculator.

Parameters:
  • return_forces (bool | None) – Whether or not to return forces.

  • return_components (bool | None) – Whether or not to return the components of the energy.

Returns:

The energy, forces, and energy components of the calculation.

Return type:

tuple[Any, …]

interface: SoftwareInterface
options: dict[str, Any]
system: System

qmmm_pme.calculators.qmmm_calculator module

A module to define the QMMMCalculator class.

class qmmm_pme.calculators.qmmm_calculator.QMMMCalculator(system, calculators, embedding_cutoff, options=<factory>)[source]

Bases: ModifiableCalculator

A Calculator class for performing QM/MM calculations for an entire system.

Parameters:
  • system (System) – The System object to perform calculations on.

  • calculators (dict[CalculatorType, StandaloneCalculator]) – The subsystem Calculators to perform calculations with.

  • embedding_cutoff (float | int) – The electrostatic QM/MM embedding cutoff, in Angstroms.

  • options (dict[str, Any]) – Options to provide to either of the SoftwareInterface objects.

calculate(return_forces=True, return_components=True)[source]

Calculate energies and forces for the System with the Calculator.

Parameters:
  • return_forces (bool | None) – Whether or not to return forces.

  • return_components (bool | None) – Whether or not to return the components of the energy.

Returns:

The energy, forces, and energy components of the calculation.

Return type:

tuple[Any, …]

calculators: dict[CalculatorType, StandaloneCalculator]
compute_embedding()[source]

Create the embedding list for the current System, as well as the corrective Coulomb potential and forces.

The distances from the QM atoms are computed using the centroid of the non-QM molecule from the centroid of the QM atoms.

Returns:

The corrective Coulomb energy and forces for the embedded point charges, and the charge field for the QM calculation.

Return type:

tuple[Any, …]

embedding_cutoff: float | int
options: dict[str, Any]
system: System

Module contents

A sub-package containing the calculators of the simulation engine.