openmmtools.testsystems.DiatomicFluid¶
-
class
openmmtools.testsystems.DiatomicFluid(nmolecules=250, K=Quantity(value=424.0, unit=kilocalorie/(angstrom**2*mole)), r0=Quantity(value=1.383, unit=angstrom), m1=Quantity(value=14.01, unit=dalton), m2=Quantity(value=14.01, unit=dalton), epsilon=Quantity(value=0.17, unit=kilocalorie/mole), sigma=Quantity(value=1.824, unit=angstrom), charge=Quantity(value=0.0, unit=elementary charge), reduced_density=0.05, switch_width=Quantity(value=0.5, unit=angstrom), cutoff=None, constraint=False, dispersion_correction=True, **kwargs)[source]¶ Create a diatomic fluid.
Parameters: - nmolecules : int, optional, default=250
Number of molecules.
- 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
- epsilon : simtk.unit.Quantity, optional, default=0.1700 * unit.kilocalories_per_mole
particle Lennard-Jones well depth
- sigma : simtk.unit.Quantity, optional, default=1.8240 * unit.angstroms
particle Lennard-Jones sigma
- charge : simtk.unit.Quantity, optional, default=0.0 * unit.elementary_charge
charge to place on atomic centers to create a dipole
- reduced_density : float, optional, default=0.05
Reduced density (density * sigma**3); default is appropriate for gas
- cutoff : simtk.unit.Quantity, optional, default=None
if specified, the specified cutoff will be used; otherwise, 3.0 * sigma will be used
- switch_width : simtk.unit.Quantity with units compatible with angstroms, optional, default=0.2*unit.angstroms
switching function is turned on at cutoff - switch_width If None, no switch will be applied (e.g. hard cutoff).
- dispersion_correction : bool, optional, default=True
if True, will use analytical dispersion correction (if not using switching function)
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 an uncharged Diatomic fluid.
>>> diatom = DiatomicFluid() >>> system, positions = diatom.system, diatom.positions
Create a dipolar fluid.
>>> diatom = DiatomicFluid(charge=1.0*unit.elementary_charge) >>> system, positions = diatom.system, diatom.positions
Create a Diatomic fluid with constraints instead of harmonic bonds
>>> diatom = DiatomicFluid(constraint=True) >>> system, positions = diatom.system, diatom.positions
Specify a different system size.
>>> diatom = DiatomicFluid(constraint=True, nmolecules=200) >>> 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__(nmolecules=250, K=Quantity(value=424.0, unit=kilocalorie/(angstrom**2*mole)), r0=Quantity(value=1.383, unit=angstrom), m1=Quantity(value=14.01, unit=dalton), m2=Quantity(value=14.01, unit=dalton), epsilon=Quantity(value=0.17, unit=kilocalorie/mole), sigma=Quantity(value=1.824, unit=angstrom), charge=Quantity(value=0.0, unit=elementary charge), reduced_density=0.05, switch_width=Quantity(value=0.5, unit=angstrom), cutoff=None, constraint=False, dispersion_correction=True, **kwargs)[source]¶ Abstract base class for test system.
Methods
__init__([nmolecules, K, unit, r0, unit, …])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.