Objective_function.Properties.force_property module

Description

This module defines the ParaMol.Objective_function.Properties.force_property.ForceProperty class, which is a ParaMol representation of the force property.

class ParaMol.Objective_function.Properties.force_property.ForceProperty(systems=[], term_type='components', weight=1.0)

Bases: ParaMol.Objective_function.Properties.property.Property

ParaMol representation of the force property.

Parameters
  • systems (list of ParaMol.System.system.ParaMolSystem) – List of ParaMol Systems.

  • weight (float) – Weight of this property in the objective function.

  • term_type (str) – Forces term type. Available options are “norm” or “components”.

Variables
  • name (str) – ‘FORCE’

  • systems (list of ParaMol.System.system.ParaMolSystem) – List of ParaMol Systems. Currently not used and it is set to None.

  • units (simtk.unit.Quantity) – kj/mol/nm

  • value (float) – Current value of this property

  • weight (float) – Weight of this property in the objective function.

  • variance (list of np.array(n_atoms)) – Variance.

  • inv_covariance (list of np.array) – Inverse covariance.

calculate_inverse_covariance_qm_forces()

Method that calculates the inverse covariance of the QM forces, i.e., \(<F^{QM} * F^{QM}>^{-1}\), where \(*\) means tensorial multiplication.

Notes

This is useful when the forces term type used in the objective function is “COMPONENTS”. The inverted covariance will be stored in the attribute variable self.inv_covariance. It is used as a normalization factor in the objective function because it introduces the correct re-scalings.

Returns

inv_covariance (list of np.array)

calculate_property(fmm_data, term_type=None)

Method that computes the forces term of the objective function.

Notes

This method should be modified by the user if another objective function form is to be used. The two term types available are:

  • “components”: \(\sum_i^{N_s} \omega_i \sum_j^{N_a} \Delta F_{i,j}<F^{QM} * F^{QM}>^{-1}\Delta F_{i,j}\) where \(\Delta F_{i,j}=F_{i,j}^{MM}-F_{i,j}^{QM}\) and \(*\) means tensorial multiplication. This type becomes very slow as the number of atoms of the system increases (faster implementation soon to be implemented).

  • “norm”: \(\sum_i^{N_s} \omega_i \sum_j^{N_a} | \Delta F_{i,j}|^2/var(|F_{i,j}^{QM}|)\) where \(\Delta F_{i,j}=F_{i,j}^{MM}-F_{i,j}^{QM}\).

Parameters
  • fmm_data (np.array) – array containing the MM energies for each conformation

  • term_type (str) – Available options are “components”, “norm”.

Returns

value (float) – Value of the forces property contribution to the objective function for every system.

calculate_variance()

Method that calculates the variance covariance of the QM forces, \(var(|F_{i,j}^{QM}|)\).

Notes

This is useful when the forces term type used in the objective function is “NORM.”. The variance will be stored in the attribute variable self.variance. It is used as a normalization factor in the objective function because it introduces the correct re-scalings.

Returns

variance (list of np.array)