openmmtools.states.GlobalParameterFunction

class openmmtools.states.GlobalParameterFunction(expression)[source]

A function of global parameters.

All the functions supported by openmmtools.utils.math_eval are supported.

Parameters:
expression : str

A mathematical expression involving global parameters.

Examples

>>> class MyComposableState(GlobalParameterState):
...     gamma = GlobalParameterState.GlobalParameter('gamma', standard_value=1.0)
...     lambda_angles = GlobalParameterState.GlobalParameter('lambda_angles', standard_value=1.0)
...
>>> composable_state = MyComposableState(gamma=1.0, lambda_angles=0.5)
>>> composable_state.set_function_variable('lambda', 0.5)
>>> composable_state.set_function_variable('lambda2', 1.0)
>>> composable_state.gamma = GlobalParameterFunction('lambda**2')
>>> composable_state.gamma
0.25
>>> composable_state.lambda_angles = GlobalParameterFunction('(lambda + lambda2) / 2')
>>> composable_state.lambda_angles
0.75
>>> composable_state.set_function_variable('lambda2', 0.5)
>>> composable_state.lambda_angles
0.5

Methods

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

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

Methods

__init__(expression) Initialize self.