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).
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: bool = False)[source]
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
- dhdl
The estimated dhdl of each state.
- Type:
DataFrame
Added in version 2.1.0.
- special_points = {1: {'lambdas': [0.5], 'weights': [1.0]}, 2: {'lambdas': [0.21132, 0.78867], 'weights': [0.5, 0.5]}, 3: {'lambdas': [0.1127, 0.5, 0.88729], 'weights': [0.27777, 0.44444, 0.27777]}, 4: {'lambdas': [0.06943, 0.33001, 0.66999, 0.93057], 'weights': [0.17393, 0.32607, 0.32607, 0.17393]}, 5: {'lambdas': [0.04691, 0.23076, 0.5, 0.76923, 0.95308], 'weights': [0.11846, 0.23931, 0.28444, 0.23931, 0.11846]}, 6: {'lambdas': [0.03377, 0.1694, 0.38069, 0.61931, 0.8306, 0.96623], 'weights': [0.08566, 0.18038, 0.23396, 0.23396, 0.18038, 0.08566]}, 7: {'lambdas': [0.02544, 0.12923, 0.29707, 0.5, 0.70292, 0.87076, 0.97455], 'weights': [0.06474, 0.13985, 0.19091, 0.20897, 0.19091, 0.13985, 0.06474]}, 8: {'lambdas': [0.01986, 0.10167, 0.23723, 0.40828, 0.59172, 0.76277, 0.89833, 0.98014], 'weights': [0.05061, 0.11119, 0.15685, 0.18134, 0.18134, 0.15685, 0.11119, 0.05061]}, 9: {'lambdas': [0.01592, 0.08198, 0.19331, 0.33787, 0.5, 0.66213, 0.80669, 0.91802, 0.98408], 'weights': [0.04064, 0.09032, 0.13031, 0.15617, 0.16512, 0.15617, 0.13031, 0.09032, 0.04064]}, 10: {'lambdas': [0.01305, 0.06747, 0.1603, 0.2833, 0.42556, 0.57444, 0.7167, 0.8397, 0.93253, 0.98695], 'weights': [0.03334, 0.07473, 0.10954, 0.13463, 0.14776, 0.14776, 0.13463, 0.10954, 0.07473, 0.03334]}, 11: {'lambdas': [0.01089, 0.05647, 0.13492, 0.24045, 0.36523, 0.5, 0.63477, 0.75955, 0.86508, 0.94353, 0.98911], 'weights': [0.02783, 0.06279, 0.09315, 0.1166, 0.1314, 0.13646, 0.1314, 0.1166, 0.09315, 0.06279, 0.02783]}, 12: {'lambdas': [0.00922, 0.04794, 0.11505, 0.20634, 0.31608, 0.43738, 0.56262, 0.68392, 0.79366, 0.88495, 0.95206, 0.99078], 'weights': [0.02359, 0.05347, 0.08004, 0.10158, 0.11675, 0.12457, 0.12457, 0.11675, 0.10158, 0.08004, 0.05347, 0.02359]}, 13: {'lambdas': [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], 'weights': [0.02024, 0.04606, 0.06944, 0.08907, 0.10391, 0.11314, 0.11628, 0.11314, 0.10391, 0.08907, 0.06944, 0.04606, 0.02024]}, 14: {'lambdas': [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], 'weights': [0.01756, 0.04008, 0.06076, 0.0786, 0.09277, 0.1026, 0.10763, 0.10763, 0.1026, 0.09277, 0.0786, 0.06076, 0.04008, 0.01756]}, 15: {'lambdas': [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], 'weights': [0.01538, 0.03518, 0.05358, 0.06979, 0.08313, 0.09308, 0.09922, 0.10129, 0.09922, 0.09308, 0.08313, 0.06979, 0.05358, 0.03518, 0.01538]}, 16: {'lambdas': [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], 'weights': [0.01358, 0.03113, 0.04758, 0.06231, 0.0748, 0.08458, 0.0913, 0.09473, 0.09473, 0.0913, 0.08458, 0.0748, 0.06231, 0.04758, 0.03113, 0.01358]}}
- fit(dHdl: DataFrame) TI_GQ[source]
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: DataFrame, variances: DataFrame) tuple[list[Index], list[Series], list[Series], list[float | tuple[float, ...]]][source]
For transitions with multiple lambda, the
dhdlwould return aDataFramewhich gives the dHdl for all the lambda states, regardless of whether it is perturbed or not. This function creates 3 lists ofnumpy.ndarray,pandas.Seriesandpandas.Seriesfor 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.arraysuch thatlambda_list[k]is the lambda values with respect to each type of lambda.dhdl_list (list) – A list of
pandas.Seriessuch thatdHdl_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.Seriessuch thatvariance_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
floatortuplesuch that eachfloatortupleis the index of the final delta_f_ and d_delta_f_
- classmethod __init_subclass__(**kwargs)
Set the
set_{method}_requestmethods.This uses PEP-487 [1] to set the
set_{method}_requestmethods. 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 defaultNone.References
- get_metadata_routing()
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns:
routing – A
MetadataRequestencapsulating routing information.- Return type:
MetadataRequest
- get_params(deep=True)
Get parameters for this estimator.
- set_fit_request(*, dHdl: bool | None | str = '$UNCHANGED$') TI_GQ
Configure whether metadata should be requested to be passed to the
fitmethod.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(seesklearn.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 tofitif provided. The request is ignored if metadata is not provided.False: metadata is not requested and the meta-estimator will not pass it tofit.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.
- 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