pydft_qmmm.wrappers package

Submodules

pydft_qmmm.wrappers.logger module

Centralized logging classes based on context management.

class pydft_qmmm.wrappers.logger.Logger(output_directory, system, write_to_log=True, decimal_places=3, 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

Logger for recording system and simulation data.

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

  • system (System) – The system whose data 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 = 3
log_write_interval: int = 1
output_directory: str
record(simulation)[source]

Record simulation data into the log files.

Parameters:

simulation (Simulation) – The simulation whose data will be recorded by the logger.

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 pydft_qmmm.wrappers.logger.NullLogger[source]

Bases: object

A default logger class which does not perform logging.

record(simulation)[source]

Default record call, which does nothing.

Parameters:

simulation (Simulation) – The simulation whose data will be recorded by the logger.

Return type:

None

pydft_qmmm.wrappers.simulation module

The core object which organizes simulations.

class pydft_qmmm.wrappers.simulation.Simulation(system, integrator, hamiltonian=None, calculator=None, plugins=None, logger=<pydft_qmmm.wrappers.logger.NullLogger object>)[source]

Bases: object

Manages and performs simulations.

Parameters:
  • system (System) – The system to simulate.

  • integrator (Integrator) – The integrator defining how the system evolves.

  • hamiltonian (Hamiltonian | None) – The Hamiltonian defining how calculations will be performed.

  • calculator (Calculator | None) – A user-defined calculator, which may be provided in place of a Hamiltonian object.

  • plugins (list[Plugin] | None) – A list of plugins to apply to the calculator or integrator objects before simulation.

  • logger (Any) – A logger to record data generated during the simulation.

_frame

The current frame of the simulation, defaults to zero upon instantiation.

Type:

int

calculate_energy_forces()[source]

Update total system energy and forces on atoms in the system.

Return type:

None

run_dynamics(steps)[source]

Perform a number of simulation steps.

Parameters:

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

Return type:

None

set_memory(memory)[source]

Set the amount of memory that calculators can use.

Parameters:

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

Return type:

None

set_threads(threads)[source]

Set the number of threads that calculators can use.

Parameters:

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

Return type:

None

Module contents

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