openmmtools.alchemy.AlchemicalFunction

class openmmtools.alchemy.AlchemicalFunction(expression)[source]

A function of alchemical variables.

Parameters:
expression : str

A mathematical expression involving alchemical variables.

Examples

>>> alchemical_state = AlchemicalState(lambda_sterics=1.0, lambda_angles=1.0)
>>> alchemical_state.set_alchemical_variable('lambda', 0.5)
>>> alchemical_state.set_alchemical_variable('lambda2', 1.0)
>>> alchemical_state.lambda_sterics = AlchemicalFunction('lambda**2')
>>> alchemical_state.lambda_sterics
0.25
>>> alchemical_state.lambda_angles = AlchemicalFunction('(lambda + lambda2) / 2')
>>> alchemical_state.lambda_angles
0.75

Methods

__call__(variables) Call self as a function.
__init__(expression)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(expression) Initialize self.