Tasks.parametrization module

Description

This module defines the ParaMol.Tasks.parametrization.Parametrization class, which is a ParaMol task that performs force field parametrization.

class ParaMol.Tasks.parametrization.Parametrization

Bases: ParaMol.Tasks.task.Task

ParaMol parametrization task.

_apply_charge_correction(system)

Method that applies charge correction to the system.

Parameters

system (ParaMol.System.system.ParaMolSystem) – Instance of ParaMol System.

Notes

Due to numerical errors, the numerical total charge of the system may not be equal to the real total charge of the system. Hence, in order to overcome this problem, which causes unexpected behaviour specially when constraints are being applied, the excess or deficiency of charge is shared equally amongst all atoms. This usually changes the charge in each atom by a very small (negligible) amount. Note that this method only changes the charges in the ParaMol ForceField of the ParaMolSystem. Therefore, it is required to update the OpenMM systems after this method is called.

Returns

total_charge (float) – Final total charge of the system.

static _get_constraints(scipy_method, parameter_space, total_charge=0.0, threshold=1e-08)

Method that gets the constraints to be passed into the SciPy optimizer.

Parameters
  • scipy_method (str) – SciPy method. Should be “COBYLA”, SLSQP” or “trust-consr”.

  • parameter_space (ParaMol.Parameter_space.parameter_space.ParameterSpace) – Instance of parameter space.

  • total_charge (float) – System’s total charge

  • threshold (float) – Constraint’s threshold.

Returns

list – List with constraints.

static _get_total_charge(system)

Method that gets the system’s total charge as in the ParaMol ForceField of the ParaMolSystem.

Parameters

system (ParaMol.System.system.ParaMolSystem) – Instance of ParaMol System.

Returns

total_charge (float) – Final total charge of the system.

static _perform_assertions(settings, system)

Method that asserts if the parametrization asked by the user contains the necessary data (coordinates, forces, energies, esp).

Parameters
Returns

True

_perform_optimization(settings, optimizer, objective_function, parameter_space)

Method that wraps the functions used to perform the optimization of the parameters.

Parameters
Returns

parameters_values (list) – List of optimized parameters

run_task(settings, systems, parameter_space=None, objective_function=None, optimizer=None, interface=None, adaptive_parametrization=False, apply_charge_correction=False, restart=False)

Method that performs the standard ParaMol parametrization.

Parameters
Returns

systems, parameter_space, objective_function, optimizer