md module
Full Documentation for hippynn.molecular_dynamics.md
module.
Click here for a summary page.
- class ASELangevinDynamics(force_db_name: str, temperature_K: float, frix: float, force_units: float | None = None, position_units: float | None = None, time_units: float | None = None, fix_cm: bool | None = True, rng: int | None = None)
Bases:
VariableUpdater
Implements the Langevin algorithm from the ASE codebase
- post_step(dt: float, model_outputs: dict)
Updates to variables performed during each step of MD simulation after HIPNN model evaluation :param dt: timestep :param model_outputs: dictionary of HIPNN model outputs
- pre_step(dt: float)
Updates to variables performed during each step of MD simulation before HIPNN model evaluation :param dt: timestep
- required_variable_data = ['position', 'velocity', 'mass']
- class LangevinDynamics(force_db_name: str, temperature: float, frix: float, force_units: float | None = None, position_units: float | None = None, time_units: float | None = None, seed: int | None = None)
Bases:
VariableUpdater
Implements the Langevin algorithm
- post_step(dt: float, model_outputs: dict)
Updates to variables performed during each step of MD simulation after HIPNN model evaluation
- Parameters:
dt – timestep
model_outputs – dictionary of HIPNN model outputs
- pre_step(dt: float)
Updates to variables performed during each step of MD simulation before HIPNN model evaluation
- Parameters:
dt – timestep
- required_variable_data = ['position', 'velocity', 'mass']
- class MolecularDynamics(variables: list[Variable], model: Predictor, device: device | None = None, dtype: dtype | None = None)
Bases:
object
Driver for MD run
- get_data()
Returns a dictionary of the recorded data
- reset_data()
Clear all recorded data
- run(dt: float, n_steps: int, record_every: int | None = None)
Run n_steps of MD algorithm.
- Parameters:
dt – timestep
n_steps – number of steps to execute
record_every – frequency at which to store the data at a step in memory, record_every = 1 means every step will be stored, defaults to None
- to(arg)
- to(arg: device)
- to(arg: dtype)
- property device
- property dtype
- property model
- property variables
- class NullUpdater
Bases:
VariableUpdater
Makes no change to the variable data at each step of MD.
- post_step(dt, model_outputs)
Updates to variables performed during each step of MD simulation after HIPNN model evaluation
- Parameters:
dt – timestep
model_outputs – dictionary of HIPNN model outputs
- pre_step(dt)
Updates to variables performed during each step of MD simulation before HIPNN model evaluation
- Parameters:
dt – timestep
- class Variable(name: str, data: dict[str, Tensor], model_input_map: dict[str, str] = {}, updater: VariableUpdater = None, device: device | None = None, dtype: dtype | None = None)
Bases:
object
Tracks the state of a quantity (eg. position, cell, species, volume) on each particle or each system in an MD simulation. Can also hold additional data associated to that quantity (such as its velocity, acceleration, etc…)
- to(arg)
- to(arg: device)
- to(arg: dtype)
- property data
- property device
- property dtype
- property model_input_map
- property updater
- class VariableUpdater
Bases:
object
Parent class for algorithms that make updates to the data of a Variable during each step of an MD simulation.
Subclasses should redefine __init__, pre_step, post_step, and required_variable_data as needed. The inputs to pre_step and post_step should not be changed.
- post_step(dt: float, model_outputs: dict)
Updates to variables performed during each step of MD simulation after HIPNN model evaluation
- Parameters:
dt – timestep
model_outputs – dictionary of HIPNN model outputs
- pre_step(dt: float)
Updates to variables performed during each step of MD simulation before HIPNN model evaluation
- Parameters:
dt – timestep
- required_variable_data = []
- property variable
- class VelocityVerlet(force_db_name: str, force_units: float | None = None, position_units: float | None = None, time_units: float | None = None)
Bases:
VariableUpdater
Implements the Velocity Verlet algorithm
- post_step(dt: float, model_outputs: dict)
Updates to variables performed during each step of MD simulation after HIPNN model evaluation
- Parameters:
dt – timestep
model_outputs – dictionary of HIPNN model outputs
- pre_step(dt: float)
Updates to variables performed during each step of MD simulation before HIPNN model evaluation
- Parameters:
dt – timestep
- required_variable_data = ['position', 'velocity', 'acceleration', 'mass']