sponge.colvar.CombineCV

View Source On Gitee
class sponge.colvar.CombineCV(colvar: Union[List[Colvar], Tuple[Colvar]], weights: Union[float, List[float], Tuple[float], Tensor] = 1, offsets: Union[float, List[float], Tuple[float], Tensor] = 0, exponents: Union[float, List[float], Tuple[float], Tensor] = 1, normal: bool = False, periodic_min: Union[float, ndarray, Tensor] = None, periodic_max: Union[float, ndarray, Tensor] = None, periodic_mask: Union[Tensor, ndarray] = None, use_pbc: bool = None, name: str = 'combine')[source]

Polynomial combination of a set of Colvar \({s_i}\) with shape (S_1, S_2, …, S_n). {S_i} means dimensions of collective variables.

\[S = \sum_i^n{w_i (s_i - o_i)^{p_i}}\]
Parameters
  • colvar (Union[List[Colvar], Tuple[Colvar]]) – Array of Colvar to be combined \({s_i}\).

  • weights (Union[List[float], Tuple[Float], float, Tensor]) – Weights \({w_i}\) for each Colvar. If a list or tuple is given, the number of the elements should be equal to the number of CVs. If a float or Tensor is given, the value will be used for all Colvar. Default: 1

  • offsets (Union[List[float], Tuple[Float], float, Tensor]) – Offsets \({o_i}\) for each Colvar. If a list or tuple is given, the number of the elements should be equal to the number of CVs. If a float or Tensor is given, the value will be used for all Colvar. Default: 0

  • exponents (Union[List[float], Tuple[Float], float, Tensor]) – Exponents \({p_i}\) for each Colvar. If a list or tuple is given, the number of the elements should be equal to the number of CVs. If a float or Tensor is given, the value will be used for all Colvar. Default: 1

  • normal (bool) – Whether to normalize all weights to 1. Default: False.

  • periodic_min (Union[float, ndarray, Tensor]) – The periodic minimum of the output of the combination of the CVs. If the output is not periodic, it should be None. Default: None.

  • periodic_max (Union[float, ndarray, Tensor]) – The periodic maximum of the output of the combination of the CVs. If the output is not periodic, it should be None. Default: None.

  • periodic_mask (Union[Tensor, ndarray]) – Mask for the periodicity of the outputs. The shape of the tensor should be as the same as the outputs, i.e. (S_1, S_2, …, S_n). Default: None.

  • use_pbc (bool) – Whether to use periodic boundary condition. If None is given, it will determine whether to use periodic boundary conditions based on whether the pbc_box is provided. Default: None.

  • name (str) – Name of the collective variables. Default: 'combine'

Supported Platforms:

Ascend GPU

set_pbc(use_pbc: bool)[source]

set whether to use periodic boundary condition