TI

The TI estimator is a simple implementation of thermodynamic integration that uses the trapezoid rule for integrating the space between \(\left<\frac{dH}{d\lambda}\right>\) values for each \(\lambda\) sampled.

API Reference

class alchemlyb.estimators.TI(verbose: bool = False)[source]

Thermodynamic integration (TI).

Parameters:

verbose (bool, optional) – Set to True if verbose debug output is desired.

delta_f_

The estimated dimensionless free energy difference between each state.

Type:

DataFrame

d_delta_f_

The estimated statistical uncertainty (one standard deviation) in dimensionless free energy differences.

Type:

DataFrame

states_

Lambda states for which free energy differences were obtained.

Type:

list

dhdl

The estimated dhdl of each state.

Type:

DataFrame

Changed in version 1.0.0: delta_f_, d_delta_f_, states_ are view of the original object.

__init__(verbose: bool = False) None[source]
fit(dHdl: DataFrame) TI[source]

Compute free energy differences between each state by integrating dHdl across lambda values.

Parameters:

dHdl (DataFrame) – dHdl[n,k] is the potential energy gradient with respect to lambda for each configuration n and lambda k.

separate_dhdl() list[Series][source]

For transitions with multiple lambda, the attr:dhdl would return a DataFrame which gives the dHdl for all the lambda states, regardless of whether it is perturbed or not. This function creates a list of pandas.Series for each lambda, where each pandas.Series describes the potential energy gradient for the lambdas state that is perturbed.

Returns:

dHdl_list – A list of pandas.Series such that dHdl_list[k] is the potential energy gradient with respect to lambda for each configuration that lambda k is perturbed.

Return type:

list

classmethod __init_subclass__(**kwargs)

Set the set_{method}_request methods.

This uses PEP-487 [1] to set the set_{method}_request methods. It looks for the information available in the set default values which are set using __metadata_request__* class attributes, or inferred from method signatures.

The __metadata_request__* class attributes are used when a method does not explicitly accept a metadata through its arguments or if the developer would like to specify a request value for those metadata which are different from the default None.

References

property d_delta_f_: DataFrame | None
property d_delta_h_: DataFrame | None
property d_delta_sT_: DataFrame | None
property delta_f_: DataFrame | None
property delta_h_: DataFrame | None
property delta_sT_: DataFrame | None
get_metadata_routing()

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Returns:

routing – A MetadataRequest encapsulating routing information.

Return type:

MetadataRequest

get_params(deep=True)

Get parameters for this estimator.

Parameters:

deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:

params – Parameter names mapped to their values.

Return type:

dict

set_fit_request(*, dHdl: bool | None | str = '$UNCHANGED$') TI

Configure whether metadata should be requested to be passed to the fit method.

Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with enable_metadata_routing=True (see sklearn.set_config()). Please check the User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to fit if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to fit.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

Added in version 1.3.

Parameters:

dHdl (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for dHdl parameter in fit.

Returns:

self – The updated object.

Return type:

object

set_params(**params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters:

**params (dict) – Estimator parameters.

Returns:

self – Estimator instance.

Return type:

estimator instance

property states_: list[Any] | None