IMLCV.implementations.bias
==========================

.. py:module:: IMLCV.implementations.bias


Classes
-------

.. autoapisummary::

   IMLCV.implementations.bias.MinBias
   IMLCV.implementations.bias.HarmonicBias
   IMLCV.implementations.bias.BiasMTD
   IMLCV.implementations.bias.RbfBias
   IMLCV.implementations.bias.GridBias


Functions
---------

.. autoapisummary::

   IMLCV.implementations.bias._clip


Module Contents
---------------

.. py:function:: _clip(x, a_min, a_max)

.. py:class:: MinBias(*args, **kwargs)

   Bases: :py:obj:`IMLCV.base.bias.CompositeBias`


   Class that combines several biases in one single bias.


   .. py:method:: create(biases: list[IMLCV.base.bias.Bias]) -> IMLCV.base.bias.CompositeBias
      :classmethod:



.. py:class:: HarmonicBias(*args, **kwargs)

   Bases: :py:obj:`IMLCV.base.bias.Bias`


   Harmonic bias potential centered arround q0 with force constant k.


   .. py:attribute:: q0
      :type:  IMLCV.base.CV.CV


   .. py:attribute:: k
      :type:  jax.Array


   .. py:attribute:: k_max
      :type:  jax.Array | None
      :value: None



   .. py:attribute:: y0
      :type:  jax.Array | None
      :value: None



   .. py:attribute:: r0
      :type:  jax.Array | None
      :value: None



   .. py:method:: create(cvs: IMLCV.base.CV.CollectiveVariable, q0: IMLCV.base.CV.CV, k: float | jax.Array, k_max: jax.Array | float | None = None, start=None, step=None, finalized=True) -> HarmonicBias
      :staticmethod:


      generate harmonic potentia;

      :param cvs: CV
      :param q0: rest pos spring
      :param k: force constant spring



   .. py:method:: _compute(cvs: IMLCV.base.CV.CV)

      function that calculates the bias potential.



.. py:class:: BiasMTD(*args, **kwargs)

   Bases: :py:obj:`IMLCV.base.bias.Bias`


   A sum of Gaussian hills, for instance used in metadynamics:
   Adapted from Yaff.

   V = \sum_{\\alpha} K_{\\alpha}} \exp{-\sum_{i}
   \\frac{(q_i-q_{i,\\alpha}^0)^2}{2\sigma^2}}

   where \\alpha loops over deposited hills and i loops over collective
   variables.


   .. py:attribute:: q0s
      :type:  jax.Array


   .. py:attribute:: sigmas
      :type:  jax.Array


   .. py:attribute:: K
      :type:  jax.Array


   .. py:attribute:: Ks
      :type:  jax.Array


   .. py:attribute:: tempering
      :type:  float


   .. py:method:: create(cvs: IMLCV.base.CV.CollectiveVariable, K, sigmas, tempering=0.0, start=None, step=None, finalized=False) -> typing_extensions.Self
      :classmethod:


      _summary_

      :param cvs: _description_
      :param K: _description_
      :param sigmas: _description_
      :param start: _description_. Defaults to None.
      :param step: _description_. Defaults to None.
      :param tempering: _description_. Defaults to 0.0.



   .. py:method:: update_bias(md: IMLCV.base.MdEngine.MDEngine)

      update the bias.

      Can only change the properties from _get_args



   .. py:method:: _compute(cvs)

      Computes sum of hills.



.. py:class:: RbfBias(*args, **kwargs)

   Bases: :py:obj:`IMLCV.base.bias.Bias`


   Bias interpolated from lookup table on uniform grid.

   values are caluclated in bin centers


   .. py:attribute:: rbf
      :type:  IMLCV.tools._rbf_interp.RBFInterpolator


   .. py:attribute:: offset
      :type:  float | jax.Array
      :value: 0.0



   .. py:method:: create(cvs: IMLCV.base.CV.CollectiveVariable, vals: jax.Array, cv: IMLCV.base.CV.CV, start=None, step=None, kernel='gaussian', epsilon=None, smoothing=0.0, degree=None, finalized=True, slice_exponent=1, log_exp_slice=True, slice_mean=False) -> RbfBias
      :classmethod:



   .. py:method:: _compute(cvs: IMLCV.base.CV.CV)

      function that calculates the bias potential.



.. py:class:: GridBias(*args, **kwargs)

   Bases: :py:obj:`IMLCV.base.bias.Bias`


   Bias interpolated from lookup table on uniform grid.

   values are caluclated in bin centers


   .. py:attribute:: n
      :type:  int


   .. py:attribute:: bounds
      :type:  jax.Array


   .. py:attribute:: vals
      :type:  jax.Array


   .. py:attribute:: order
      :type:  int


   .. py:method:: create(cvs: IMLCV.base.CV.CollectiveVariable, bias: IMLCV.base.bias.Bias, n=30, bounds: jax.Array | None = None, margin=0.1, order=1) -> GridBias
      :classmethod:



   .. py:method:: _compute(cvs: IMLCV.base.CV.CV)

      function that calculates the bias potential.



