IMLCV.base.MdEngine

Contents

IMLCV.base.MdEngine#

MD engine class peforms MD simulations in a given NVT/NPT ensemble.

Classes#

StaticMdInfo

TrajectoryInfo

Base class for dataclasses that should act like a JAX pytree node.

MDEngine

Base class for MD engine.

Module Contents#

class IMLCV.base.MdEngine.StaticMdInfo#
_attr = ['timestep', 'r_cut', 'timecon_thermo', 'T', 'P', 'timecon_baro', 'write_step', 'equilibration',...#
_arr = ['atomic_numbers']#
timestep: float#
T: float#
timecon_thermo: float#
atomic_numbers: jax.Array#
r_cut: float | None = None#
P: float | None = None#
timecon_baro: float | None = None#
write_step: int = 100#
equilibration: float | None = None#
screen_log: int = 1000#
invalid: bool = False#
max_grad: float | None = 0.04031059429903557#
property masses#
property thermostat#
property barostat#
property neighbour_list_info: IMLCV.base.CV.NeighbourListInfo#
__post_init__()#
_save(hf: h5py.File)#
save(filename: str | pathlib.Path)#
static _load(hf: h5py.File) StaticMdInfo#
static load(filename) StaticMdInfo#
class IMLCV.base.MdEngine.TrajectoryInfo(*args, **kwargs)#

Bases: IMLCV.base.datastructures.MyPyTreeNode

Base class for dataclasses that should act like a JAX pytree node.

_positions: jax.Array#
_cell: jax.Array | None = None#
_charges: jax.Array | None = None#
_e_pot: jax.Array | None = None#
_e_bias: jax.Array | None = None#
_w: jax.Array | None = None#
_rho: jax.Array | None = None#
_cv: jax.Array | None = None#
_cv_orig: jax.Array | None = None#
_T: jax.Array | None = None#
_P: jax.Array | None = None#
_err: jax.Array | None = None#
_t: jax.Array | None = None#
_capacity: int#
_size: int#
_finished: int#
_invalid: int#
_items_scal = ['_t', '_e_pot', '_e_bias', '_T', '_P', '_err', '_w', '_rho']#
_items_vec = ['_positions', '_cell', '_charges', '_cv', '_cv_orig']#
static create(positions: jax.Array, cell: jax.Array | None = None, charges: jax.Array | None = None, e_pot: jax.Array | None = None, e_bias: jax.Array | None = None, cv: jax.Array | None = None, cv_orig: jax.Array | None = None, w: jax.Array | None = None, rho: jax.Array | None = None, T: jax.Array | None = None, P: jax.Array | None = None, err: jax.Array | None = None, t: jax.Array | None = None, capacity: int = -1, size: int = -1, finished=False, invalid=False) TrajectoryInfo#
__getitem__(slices)#

gets slice from indices. the output is truncated to the to include only items wihtin _size

_stack(*ti: TrajectoryInfo)#
__add__(ti: TrajectoryInfo) TrajectoryInfo#
_expand_capacity(nc=None) TrajectoryInfo#
_shrink_capacity() TrajectoryInfo#
save(filename: str | pathlib.Path)#
_save(hf: h5py.File)#
static load(filename) TrajectoryInfo#
static _load(hf: h5py.File)#
property sp: IMLCV.base.CV.SystemParams#
property positions: jax.Array | None#
property cell: jax.Array | None#
property volume#
property charges: jax.Array | None#
property e_pot: jax.Array | None#
property w: jax.Array | None#
property rho: jax.Array | None#
property e_bias: jax.Array | None#
property cv: jax.Array | None#
property cv_orig: jax.Array | None#
property T: jax.Array | None#
property P: jax.Array | None#
property err: jax.Array | None#
property t: jax.Array | None#
property shape#
property CV: IMLCV.base.CV.CV | None#
property CV_orig: IMLCV.base.CV.CV | None#
class IMLCV.base.MdEngine.MDEngine#

Bases: abc.ABC

Base class for MD engine.

bias: IMLCV.base.bias.Bias#
energy: IMLCV.base.bias.Energy#
sp: IMLCV.base.CV.SystemParams#
static_trajectory_info: StaticMdInfo#
trajectory_info: TrajectoryInfo | None#
trajectory_file: pathlib.Path | None = None#
time0: float#
step: int = 1#
nl: IMLCV.base.CV.NeighbourList | None = None#
r_skin = 1.889726133921252#
classmethod create(bias: IMLCV.base.bias.Bias, energy: IMLCV.base.bias.Energy, static_trajectory_info: StaticMdInfo, trajectory_info=None, trajectory_file=None, sp: IMLCV.base.CV.SystemParams | None = None, **kwargs) typing_extensions.Self#
update_nl()#
save(file)#
static load(file, **kwargs) MDEngine#
new_bias(bias: IMLCV.base.bias.Bias, **kwargs) MDEngine#
run(steps)#

run the integrator for a given number of steps.

Parameters:

steps – number of MD steps

abstract _run(steps)#
get_trajectory() TrajectoryInfo#
save_step(T=None, P=None, t=None, err=None, cv=None, e_bias=None, e_pot=None, gpos_rmsd=None, gpos_bias_rmsd=None, canonicalize=False)#
get_energy(sp: IMLCV.base.CV.SystemParams, gpos: bool = False, vtens: bool = False, manual_vir=None) IMLCV.base.bias.EnergyResult#
get_bias(sp: IMLCV.base.CV.SystemParams, gpos: bool = False, vtens: bool = False, shmap: bool = False, use_jac=False, push_jac=False, rel=False, shmap_kwargs=ShmapKwargs.create()) tuple[IMLCV.base.CV.CV, IMLCV.base.bias.EnergyResult]#
__getstate__()#
__setstate__(statedict: dict)#