openmmtools.testsystems.Diatom¶
-
class
openmmtools.testsystems.Diatom(K=Quantity(value=290.1, unit=kilocalorie/(angstrom**2*mole)), r0=Quantity(value=1.55, unit=angstrom), m1=Quantity(value=39.948, unit=dalton), m2=Quantity(value=39.948, unit=dalton), constraint=False, use_central_potential=False, **kwargs)[source]¶ Create a free diatomic molecule with a single harmonic bond between the two atoms.
Parameters: - K : simtk.unit.Quantity, optional, default=290.1 * unit.kilocalories_per_mole / unit.angstrom**2
harmonic bond potential. default is GAFF c-c bond
- r0 : simtk.unit.Quantity, optional, default=1.550 * unit.amu
bond length. Default is Amber GAFF c-c bond.
- constraint : bool, default=False
if True, the bond length will be constrained
- m1 : simtk.unit.Quantity, optional, default=12.01 * unit.amu
particle1 mass
- m2 : simtk.unit.Quantity, optional, default=12.01 * unit.amu
particle2 mass
- use_central_potential : bool, optional, default=False
if True, a soft central potential will also be added to keep the system from drifting away
Notes
The natural period of a harmonic oscillator is T = sqrt(m/K), so you will want to use an integration timestep smaller than ~ T/10.
Examples
Create a Diatom:
>>> diatom = Diatom() >>> system, positions = diatom.system, diatom.positions
Create a Diatom with constraint in a central potential >>> diatom = Diatom(constraint=True, use_central_potential=True) >>> system, positions = diatom.system, diatom.positions
Attributes: analytical_propertiesA list of available analytical properties, accessible via ‘get_propertyname(thermodynamic_state)’ calls.
mdtraj_topologyThe mdtraj.Topology object corresponding to the test system (read-only).
nameThe name of the test system.
positionsThe simtk.unit.Quantity object containing the particle positions, with units compatible with simtk.unit.nanometers.
systemThe simtk.openmm.System object corresponding to the test system.
topologyThe simtk.openmm.app.Topology object corresponding to the test system.
Methods
get_potential_expectation(state)Return the expectation of the potential energy, computed analytically or numerically. reduced_potential_expectation(…)Calculate the expected potential energy in state_sampled_from, divided by kB * T in state_evaluated_in. serialize()Return the System and positions in serialized XML form. -
__init__(K=Quantity(value=290.1, unit=kilocalorie/(angstrom**2*mole)), r0=Quantity(value=1.55, unit=angstrom), m1=Quantity(value=39.948, unit=dalton), m2=Quantity(value=39.948, unit=dalton), constraint=False, use_central_potential=False, **kwargs)[source]¶ Abstract base class for test system.
Methods
__init__([K, unit, r0, unit, m1, unit, m2, …])Abstract base class for test system. get_potential_expectation(state)Return the expectation of the potential energy, computed analytically or numerically. reduced_potential_expectation(…)Calculate the expected potential energy in state_sampled_from, divided by kB * T in state_evaluated_in. serialize()Return the System and positions in serialized XML form. Attributes
analytical_propertiesA list of available analytical properties, accessible via ‘get_propertyname(thermodynamic_state)’ calls. mdtraj_topologyThe mdtraj.Topology object corresponding to the test system (read-only). nameThe name of the test system. positionsThe simtk.unit.Quantity object containing the particle positions, with units compatible with simtk.unit.nanometers. systemThe simtk.openmm.System object corresponding to the test system. topologyThe simtk.openmm.app.Topology object corresponding to the test system. -
analytical_properties¶ A list of available analytical properties, accessible via ‘get_propertyname(thermodynamic_state)’ calls.
-
get_potential_expectation(state)[source]¶ Return the expectation of the potential energy, computed analytically or numerically.
Parameters: - state : ThermodynamicState with temperature defined
The thermodynamic state at which the property is to be computed.
Returns: - potential_mean : simtk.unit.Quantity compatible with simtk.unit.kilojoules_per_mole
The expectation of the potential energy.
-
mdtraj_topology¶ The mdtraj.Topology object corresponding to the test system (read-only).
-
name¶ The name of the test system.
-
positions¶ The simtk.unit.Quantity object containing the particle positions, with units compatible with simtk.unit.nanometers.
-
reduced_potential_expectation(state_sampled_from, state_evaluated_in)¶ Calculate the expected potential energy in state_sampled_from, divided by kB * T in state_evaluated_in.
Notes
This is not called get_reduced_potential_expectation because this function requires two, not one, inputs.
-
serialize()¶ Return the System and positions in serialized XML form.
Returns: - system_xml : str
Serialized XML form of System object.
- state_xml : str
Serialized XML form of State object containing particle positions.
-
system¶ The simtk.openmm.System object corresponding to the test system.
-
topology¶ The simtk.openmm.app.Topology object corresponding to the test system.