qmmm_pme.wrappers package

Submodules

qmmm_pme.wrappers.logger module

A module defining the Logger class.

class qmmm_pme.wrappers.logger.Logger(output_directory, system, write_to_log=True, decimal_places=6, log_write_interval=1, write_to_csv=True, csv_write_interval=1, write_to_dcd=True, dcd_write_interval=50, write_to_pdb=True)[source]

Bases: object

A logger for writing Simulation and System data.

Parameters:
  • output_dir – The directory where outputs are written.

  • system (System) – The System object which will be reported.

  • write_to_log (bool) – Whether or not to write energies to a tree-like log file.

  • decimal_places (int) – Number of decimal places to write energies in the log file before truncation.

  • log_write_interval (int) – The interval between successive log writes, in simulation steps.

  • write_to_csv (bool) – Whether or not to write energies to a CSV file.

  • csv_write_interval (int) – The interval between successive CSV writes, in simulation steps.

  • write_to_dcd (bool) – Whether or not to write atom positions to a DCD file.

  • dcd_write_interval (int) – The interval between successive DCD writes, in simulation steps.

  • write_to_pdb (bool) – Whether or not to write atom positions to a PDB file at the end of a simulation.

  • output_directory (str) –

csv_write_interval: int = 1
dcd_write_interval: int = 50
decimal_places: int = 6
log_write_interval: int = 1
output_directory: str
record(simulation)[source]

Log the current state of the Simulation to any relevant output files.

Parameters:

simulation (Simulation) – The Simulation object to log/record.

Return type:

None

system: System
write_to_csv: bool = True
write_to_dcd: bool = True
write_to_log: bool = True
write_to_pdb: bool = True
class qmmm_pme.wrappers.logger.NullLogger[source]

Bases: object

A default logger class which does not perform any logging.

record(simulation)[source]

Default record call, which does nothing.

Parameters:

simulation (Simulation) – The Simulation object to record/log.

Return type:

None

qmmm_pme.wrappers.simulation module

A module for defining the Simulation class.

class qmmm_pme.wrappers.simulation.Simulation(system, hamiltonian, dynamics, logger=<class 'qmmm_pme.wrappers.logger.NullLogger'>, num_threads=1, memory='1 GB', plugins=<factory>, frame=0, energy=<factory>)[source]

Bases: object

An object which manages and performs simulations.

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

  • hamiltonian (Hamiltonian) – The Hamiltonian object to perform calculations with.

  • integrator – The Integrator object to perform calculations with.

  • logger (Any) – The Logger object to record data generated during the simulation

  • num_threads (int) – The number of threads to run calculations on.

  • memory (str) – The amount of memory to allocate to calculations.

  • plugins (list[Plugin]) – Any Plugin objects to apply to the simulation.

  • dynamics (Dynamics) –

  • frame (int) –

  • energy (EnergyDict) –

calculate_energy_forces()[source]

Update the System forces and Simulation energy using calculations from the Calculator.

Return type:

None

calculate_forces()[source]

Update the State forces using calculations from the Calculator.

Return type:

None

dynamics: Dynamics
energy: EnergyDict
frame: int = 0
hamiltonian: Hamiltonian
logger

alias of NullLogger

memory: str = '1 GB'
num_threads: int = 1
plugins: list[Plugin]
run_dynamics(steps)[source]

Run simulation using the System, Calculator, and Integrator.

Parameters:

steps (int) – The number of steps to take.

Return type:

None

system: System
wrap_positions()[source]

Atoms are wrapped to stay inside of the periodic box. This function ensures molecules are not broken up by a periodic boundary, since OpenMM electrostatics will be incorrect if atoms in a molecule are not on the same side of the periodic box. This method currently assumes an isotropic box.

Return type:

None

qmmm_pme.wrappers.system module

A module defining the System class.

class qmmm_pme.wrappers.system.System(pdb_list, topology_list, forcefield_list)[source]

Bases: object

An wrapper class designed to generate and hold State and Topology record objects.

Parameters:
  • pdb_list (list[str]) – The directories containing the PDB files which define the System geometry.

  • topology_list (list[str]) – The directories containing the XML files which define the System topology.

  • forcefield_list (list[str]) – The directories containing the XML files which define the System interactions.

Module contents

A sub-package containing wrapper classes for the end user.