TI_GQ

The TI_GQ estimator is an implementation of thermodynamic integration that uses the gaussian quadrature for integrating the space between \(\left<\frac{dH}{d\lambda}\right>\) values for each \(\lambda\) sampled. To use this method, please make sure that the simulations are performed at certain \(\lambda\) values using fixed gaussian quadrature points (e.g., [He2020]). Currently, up to 16 guassian quadrature points are supported (see the table below).

gaussian quadrature points

number of \(\lambda\)

\(\lambda\) values

1

0.5

2

0.21132, 0.78867

3

0.1127, 0.5, 0.88729

4

0.06943, 0.33001, 0.66999, 0.93057

5

0.04691, 0.23076, 0.5, 0.76923, 0.95308

6

0.03377, 0.1694 , 0.38069, 0.61931, 0.8306 , 0.96623

7

0.02544, 0.12923, 0.29707, 0.5, 0.70292, 0.87076, 0.97455

8

0.01986, 0.10167, 0.23723, 0.40828, 0.59172, 0.76277, 0.89833, 0.98014

9

0.01592, 0.08198, 0.19331, 0.33787, 0.5, 0.66213, 0.80669, 0.91802, 0.98408

10

0.01305, 0.06747, 0.1603, 0.2833, 0.42556, 0.57444, 0.7167, 0.8397, 0.93253, 0.98695

11

0.01089, 0.05647, 0.13492, 0.24045, 0.36523, 0.5, 0.63477, 0.75955, 0.86508, 0.94353, 0.98911

12

0.00922, 0.04794, 0.11505, 0.20634, 0.31608, 0.43738, 0.56262, 0.68392, 0.79366, 0.88495, 0.95206, 0.99078

13

0.00791, 0.0412, 0.09921, 0.17883, 0.27575, 0.38477, 0.5, 0.61523, 0.72425, 0.82117, 0.90079, 0.9588, 0.99209

14

0.00686, 0.03578, 0.0864, 0.15635, 0.24238, 0.34044, 0.44597, 0.55403, 0.65956, 0.75762, 0.84365, 0.9136, 0.96422, 0.99314

15

0.006, 0.03136, 0.0759, 0.13779, 0.21451, 0.30292, 0.3994 , 0.5, 0.6006, 0.69708, 0.78549, 0.86221, 0.9241, 0.96864, 0.994

16

0.0053, 0.02771, 0.06718, 0.1223, 0.19106, 0.27099, 0.3592, 0.45249, 0.54751, 0.6408, 0.72901, 0.80894, 0.8777, 0.93282, 0.97229, 0.9947

API Reference

class alchemlyb.estimators.TI_GQ(verbose=False)

Thermodynamic integration (TI) with gaussian quadrature estimation.

Parameters:

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

delta_f_

The estimated cumulative free energy from one state to another.

Type:

DataFrame

d_delta_f_

The estimated statistical uncertainty (one standard deviation) in dimensionless cumulative free energies.

Type:

DataFrame

states_

Lambda states for which free energy estimation were obtained.

Type:

list

dhdl

The estimated dhdl of each state.

Type:

DataFrame

Added in version 2.1.0.

fit(dHdl)

Compute cumulative free energy from one state to another 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.

static separate_mean_variance(means, variances)

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 3 lists of numpy.array, pandas.Series and pandas.Series for each lambda, where the lists describe the lambda values, potential energy gradient and variance values for the lambdas state that is perturbed.

Parameters:
  • means (DataFrame) – means is the average potential energy gradient at each lambda.

  • variances (DataFrame) – variances is variance of the potential energy gradient at each lambda.

Returns:

  • lambda_list (list) – A list of numpy.array such that lambda_list[k] is the lambda values with respect to each type of lambda.

  • dhdl_list (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.

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

  • index_list (list) – A list of float or tuple such that each float or tuple is the index of the final delta_f_ and d_delta_f_

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_GQ

Request metadata passed to the fit method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config()). Please see 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.

Note

This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a Pipeline. Otherwise it has no effect.

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