IMLCV.base.bias#
Exceptions#
Common base class for all non-exit exceptions. |
|
Common base class for all non-exit exceptions. |
Classes#
Base class for dataclasses that should act like a JAX pytree node. |
|
Base class for dataclasses that should act like a JAX pytree node. |
|
base class for biased MD runs. |
|
Class that combines several biases in one single bias. |
|
Bias according to CV. |
|
Bias according to CV. |
|
Bias according to CV. |
Functions#
Module Contents#
- class IMLCV.base.bias.EnergyResult(*args, **kwargs)#
Bases:
IMLCV.base.datastructures.MyPyTreeNodeBase class for dataclasses that should act like a JAX pytree node.
- __add__(other: EnergyResult) EnergyResult#
- exception IMLCV.base.bias.EnergyError#
Bases:
ExceptionCommon base class for all non-exit exceptions.
- class IMLCV.base.bias.Energy#
- external_callback = True#
- manual_vtens = False#
- property nl: IMLCV.base.CV.NeighbourList | None#
- property sp: IMLCV.base.CV.SystemParams | None#
- abstract _compute_coor(sp: IMLCV.base.CV.SystemParams, nl: IMLCV.base.CV.NeighbourList | None, gpos=False, vir=False) EnergyResult#
- _handle_exception(e=None)#
- get_vtens_finite_difference(sp: IMLCV.base.CV.SystemParams, nl: IMLCV.base.CV.NeighbourList | None, eps=1e-05, gpos=False)#
- compute_from_system_params(sp: IMLCV.base.CV.SystemParams, gpos=False, vir=False, nl: IMLCV.base.CV.NeighbourList | None = None, manual_vir=None, shmap=False, shmap_kwarg=ShmapKwargs.create()) EnergyResult#
- save(filename: str | pathlib.Path)#
- class IMLCV.base.bias.EnergyFn(*args, **kwargs)#
Bases:
Energy,IMLCV.base.datastructures.MyPyTreeNodeBase class for dataclasses that should act like a JAX pytree node.
- external_callback = False#
- f: Callable#
- _sp: IMLCV.base.CV.SystemParams | None = None#
- _nl: IMLCV.base.CV.NeighbourList | None = None#
- property nl#
- property sp: IMLCV.base.CV.SystemParams | None#
- _compute_coor(sp: IMLCV.base.CV.SystemParams, nl: IMLCV.base.CV.NeighbourList | None, gpos=False, vir=False) EnergyResult#
- exception IMLCV.base.bias.BiasError#
Bases:
ExceptionCommon base class for all non-exit exceptions.
- class IMLCV.base.bias.Bias(*args, **kwargs)#
Bases:
abc.ABC,IMLCV.base.datastructures.MyPyTreeNodebase class for biased MD runs.
- collective_variable: IMLCV.base.CV.CollectiveVariable#
- static create(*args, **kwargs)#
- Abstractmethod:
- update_bias(md: IMLCV.base.MdEngine.MDEngine) Bias#
update the bias.
Can only change the properties from _get_args
- _update_bias() tuple[bool, typing_extensions.Self]#
update the bias.
Can only change the properties from _get_args
- compute_from_system_params(sp: IMLCV.base.CV.SystemParams, nl: IMLCV.base.CV.NeighbourList | None = None, gpos=False, vir=False, chunk_size: int | None = None, shmap=False, use_jac=False, push_jac=False, rel=False, shmap_kwargs=ShmapKwargs.create()) tuple[IMLCV.base.CV.CV, EnergyResult]#
Computes the bias, the gradient of the bias wrt the coordinates and the virial.
- compute_from_cv(cvs: IMLCV.base.CV.CV, diff=False, chunk_size=None, shmap=False, shmap_kwargs=ShmapKwargs.create()) tuple[jax.Array, IMLCV.base.CV.CV | None]#
compute the energy and derivative.
If map==False, the cvs are assumed to be already mapped
- plot(name: str | None = None, traj: list[IMLCV.base.CV.CV] | None = None, dlo_kwargs=None, dlo=None, vmax=100 * kjmol, map=False, inverted=False, margin=0.1, dpi=300, T=300 * kelvin, **kwargs)#
- resample(cv_grid: IMLCV.base.CV.CV | None = None, n=40, margin=0.3) Bias#
- save(filename: str | pathlib.Path, cv_file: pathlib.Path | None = None)#
- __getstate__()#
- bounds_from_bias(T, sign=1.0, margin=1e-10, n=50)#
- slice(T, inverted=True, vmax=None, n_max_bias=100000.0, margin=0.2, macro_chunk=10000, offset=True) dict[int, dict[tuple[int], Bias]]#
- apply(cvs: list[IMLCV.base.CV.CV], shmap=False, macro_chunk_size=10000)#
- class IMLCV.base.bias.CompositeBias(*args, **kwargs)#
Bases:
BiasClass that combines several biases in one single bias.
- fun: Callable#
- classmethod create(biases: list[Bias], fun=jnp.sum) CompositeBias#
- _compute(cvs)#
function that calculates the bias potential.
- update_bias(md: IMLCV.base.MdEngine.MDEngine) Bias#
update the bias.
Can only change the properties from _get_args
- IMLCV.base.bias._zero_fun(cvs: IMLCV.base.CV.CV)#
- IMLCV.base.bias._constant(cvs: IMLCV.base.CV.CV, val: float = 0.0)#
- class IMLCV.base.bias.BiasModify(*args, **kwargs)#
Bases:
BiasBias according to CV.
- fun: Callable#
- classmethod create(fun: Callable, bias: Bias, kwargs: dict = {}, static_kwargs: dict = {}) BiasModify#
- _compute(cvs)#
function that calculates the bias potential.
- update_bias(md: IMLCV.base.MdEngine.MDEngine) Bias#
update the bias.
Can only change the properties from _get_args
- __getstate__()#
- class IMLCV.base.bias.BiasF(*args, **kwargs)#
Bases:
BiasBias according to CV.
- g: Callable#
- static create(cvs: IMLCV.base.CV.CollectiveVariable, g: Callable = _constant, kwargs: dict = {}, static_kwargs: dict = {}) BiasF#
- _compute(cvs)#
function that calculates the bias potential.
- class IMLCV.base.bias.NoneBias(*args, **kwargs)#
Bases:
BiasFBias according to CV.
- static create(collective_variable: IMLCV.base.CV.CollectiveVariable) NoneBias#