IMLCV.base.bias#

Module Contents#

Classes#

EnergyResult

BC

base class for biased Energy of MD simulation.

Energy

base class for biased Energy of MD simulation.

PlumedEnerg

base class for biased Energy of MD simulation.

Bias

base class for biased MD runs.

CompositeBias

Class that combines several biases in one single bias.

BiasF

Bias according to CV.

NoneBias

dummy bias.

Functions#

plot_app(bias, outputs[, n, vmin, vmax, map, ...])

class IMLCV.base.bias.EnergyResult[source]#
energy: float[source]#
gpos: Array | None[source]#
vtens: Array | None[source]#
__post_init__()[source]#
__add__(other) EnergyResult[source]#
__str__() EnergyResult.__str__.str[source]#

Return str(self).

class IMLCV.base.bias.BC[source]#

base class for biased Energy of MD simulation.

save(filename: str | Path)[source]#
static load(filename) BC[source]#
exception IMLCV.base.bias.EnergyError[source]#

Bases: Exception

Common base class for all non-exit exceptions.

class IMLCV.base.bias.Energy[source]#

Bases: BC

base class for biased Energy of MD simulation.

abstract property cell[source]#
abstract property coordinates[source]#
property sp: IMLCV.base.CV.SystemParams[source]#
static load(filename) Energy[source]#
abstract _compute_coor(gpos=False, vir=False) EnergyResult[source]#
_handle_exception()[source]#
compute_from_system_params(gpos=False, vir=False, sp: SystemParams | None = None, nl: NeighbourList | None = None) EnergyResult[source]#
class IMLCV.base.bias.PlumedEnerg[source]#

Bases: Energy

base class for biased Energy of MD simulation.

exception IMLCV.base.bias.BiasError[source]#

Bases: Exception

Common base class for all non-exit exceptions.

class IMLCV.base.bias.Bias(collective_variable: IMLCV.base.CV.CollectiveVariable, start=None, step=None)[source]#

Bases: BC, abc.ABC

base class for biased MD runs.

update_bias(md: IMLCV.base.MdEngine.MDEngine)[source]#

update the bias.

Can only change the properties from _get_args

_update_bias()[source]#

update the bias.

Can only change the properties from _get_args

compute_from_system_params(sp: IMLCV.base.CV.SystemParams, gpos=False, vir=False, nl: NeighbourList | None = None, jit=True) tuple[IMLCV.base.CV.CV, EnergyResult][source]#

Computes the bias, the gradient of the bias wrt the coordinates and the virial.

compute_from_cv(cvs: IMLCV.base.CV.CV, diff=False, jit=True) IMLCV.base.CV.CV[source]#

compute the energy and derivative.

If map==False, the cvs are assumed to be already mapped

abstract _compute(cvs, *args)[source]#

function that calculates the bias potential. CVs live in mapped space

abstract get_args()[source]#

function that return dictionary with kwargs of _compute.

finalize()[source]#

Should be called at end of metadynamics simulation.

Optimises compute

static load(filename) Bias[source]#
plot(name, x_unit: str | None = None, y_unit: str | None = None, n=50, traj: list[CV] | None = None, vmin=0, vmax=100 * kjmol, map=False, inverted=False, margin=None, x_lim=None, y_lim=None, bins=None)[source]#

plot bias.

IMLCV.base.bias.plot_app(bias: Bias, outputs: list[parsl.data_provider.files.File], n: int = 50, vmin: float = 0, vmax: float = 100 * kjmol, map: bool = True, inverted=False, traj: list[CV] | None = None, margin=None, x_unit=None, y_unit=None, x_lim=None, y_lim=None, bins=None)[source]#
class IMLCV.base.bias.CompositeBias(biases: collections.abc.Iterable[Bias], fun=jnp.sum)[source]#

Bases: Bias

Class that combines several biases in one single bias.

_append_bias(b: Bias)[source]#
_compute(cvs, *args)[source]#

function that calculates the bias potential. CVs live in mapped space

finalize()[source]#

Should be called at end of metadynamics simulation.

Optimises compute

update_bias(md: IMLCV.base.MdEngine.MDEngine)[source]#

update the bias.

Can only change the properties from _get_args

get_args()[source]#

function that return dictionary with kwargs of _compute.

class IMLCV.base.bias.BiasF(cvs: IMLCV.base.CV.CollectiveVariable, g=None)[source]#

Bases: Bias

Bias according to CV.

_compute(cvs)[source]#

function that calculates the bias potential. CVs live in mapped space

get_args()[source]#

function that return dictionary with kwargs of _compute.

class IMLCV.base.bias.NoneBias(cvs: IMLCV.base.CV.CollectiveVariable)[source]#

Bases: BiasF

dummy bias.