openmmtools.testsystems.IdealGas¶
-
class
openmmtools.testsystems.IdealGas(nparticles=216, mass=Quantity(value=39.9, unit=dalton), temperature=Quantity(value=298.0, unit=kelvin), pressure=Quantity(value=1.0, unit=atmosphere), volume=None, **kwargs)[source]¶ Create an ‘ideal gas’ of noninteracting particles in a periodic box.
Parameters: - nparticles : int, optional, default=216
number of particles
- mass : int, optional, default=39.9 * unit.amu
- temperature : int, optional, default=298.0 * unit.kelvin
- pressure : int, optional, default=1.0 * unit.atmosphere
- volume : None
if None, defaults to (nparticles * temperature * unit.BOLTZMANN_CONSTANT_kB / pressure).in_units_of(unit.nanometers**3)
Examples
Create an ideal gas system.
>>> gas = IdealGas() >>> system, positions = gas.system, gas.positions
Create a smaller ideal gas system containing 64 particles.
>>> gas = IdealGas(nparticles=64) >>> system, positions = gas.system, gas.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_kinetic_expectation(state)Return the expectation of the kinetic energy, computed analytically or numerically. get_kinetic_standard_deviation(state)Return the standard deviation of the kinetic energy, computed analytically or numerically. get_potential_expectation(state)Return the expectation of the potential energy, computed analytically or numerically. get_potential_standard_deviation(state)Return the standard deviation of the potential energy, computed analytically or numerically. get_volume_expectation(state)Return the expectation of the volume, computed analytically. get_volume_standard_deviation(state)Return the standard deviation of the volume, computed analytically. 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__(nparticles=216, mass=Quantity(value=39.9, unit=dalton), temperature=Quantity(value=298.0, unit=kelvin), pressure=Quantity(value=1.0, unit=atmosphere), volume=None, **kwargs)[source]¶ Abstract base class for test system.
Methods
__init__([nparticles, mass, unit, …])Abstract base class for test system. get_kinetic_expectation(state)Return the expectation of the kinetic energy, computed analytically or numerically. get_kinetic_standard_deviation(state)Return the standard deviation of the kinetic energy, computed analytically or numerically. get_potential_expectation(state)Return the expectation of the potential energy, computed analytically or numerically. get_potential_standard_deviation(state)Return the standard deviation of the potential energy, computed analytically or numerically. get_volume_expectation(state)Return the expectation of the volume, computed analytically. get_volume_standard_deviation(state)Return the standard deviation of the volume, computed analytically. 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_kinetic_expectation(state)[source]¶ Return the expectation of the kinetic 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.
-
get_kinetic_standard_deviation(state)[source]¶ Return the standard deviation of the kinetic energy, computed analytically or numerically.
Parameters: - state : ThermodynamicState with temperature defined
The thermodynamic state at which the property is to be computed.
Returns: - potential_stddev : simtk.unit.Quantity compatible with simtk.unit.kilojoules_per_mole
potential energy standard deviation if implemented, or else None
-
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.
-
get_potential_standard_deviation(state)[source]¶ Return the standard deviation 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_stddev : simtk.unit.Quantity compatible with simtk.unit.kilojoules_per_mole
potential energy standard deviation if implemented, or else None
-
get_volume_expectation(state)[source]¶ Return the expectation of the volume, computed analytically.
Parameters: - state : ThermodynamicState with temperature and pressure defined
The thermodynamic state at which the property is to be computed.
Returns: - volume_mean : simtk.unit.Quantity compatible with simtk.unit.nanometers**3
The expectation of the volume at equilibrium.
Notes
The true mean volume is used, rather than the large-N limit.
-
get_volume_standard_deviation(state)[source]¶ Return the standard deviation of the volume, computed analytically.
Parameters: - state : ThermodynamicState with temperature and pressure defined
The thermodynamic state at which the property is to be computed.
Returns: - volume_stddev : simtk.unit.Quantity compatible with simtk.unit.nanometers**3
The standard deviation of the volume at equilibrium.
Notes
The true mean volume is used, rather than the large-N limit.
-
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.