openmmtools.testsystems.WaterBox

class openmmtools.testsystems.WaterBox(box_edge=Quantity(value=25.0, unit=angstrom), cutoff=Quantity(value=10.0, unit=angstrom), model='tip3p', switch_width=Quantity(value=1.5, unit=angstrom), constrained=True, dispersion_correction=True, nonbondedMethod=PME, ewaldErrorTolerance=1e-05, positive_ion='Na+', negative_ion='Cl-', ionic_strength=Quantity(value=0, unit=molar), **kwargs)[source]

Create a water box test system.

Examples

Create a default (TIP3P) waterbox.

>>> waterbox = WaterBox()

Control the cutoff.

>>> waterbox = WaterBox(box_edge=3.0*unit.nanometers, cutoff=1.0*unit.nanometers)

Use a different water model.

>>> waterbox = WaterBox(model='tip4pew')

Don’t use constraints.

>>> waterbox = WaterBox(constrained=False)
Attributes:
analytical_properties

A list of available analytical properties, accessible via ‘get_propertyname(thermodynamic_state)’ calls.

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.

system

The simtk.openmm.System object corresponding to the test system.

topology

The simtk.openmm.app.Topology object corresponding to the test system.

Methods

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__(box_edge=Quantity(value=25.0, unit=angstrom), cutoff=Quantity(value=10.0, unit=angstrom), model='tip3p', switch_width=Quantity(value=1.5, unit=angstrom), constrained=True, dispersion_correction=True, nonbondedMethod=PME, ewaldErrorTolerance=1e-05, positive_ion='Na+', negative_ion='Cl-', ionic_strength=Quantity(value=0, unit=molar), **kwargs)[source]

Create a water box test system.

Parameters:
box_edge : simtk.unit.Quantity with units compatible with nanometers, optional, default = 2.5 nm

Edge length for cubic box [should be greater than 2*cutoff]

cutoff : simtk.unit.Quantity with units compatible with nanometers, optional, default = DEFAULT_CUTOFF_DISTANCE

Nonbonded cutoff

model : str, optional, default = ‘tip3p’

The name of the water model to use [‘tip3p’, ‘tip4p’, ‘tip4pew’, ‘tip5p’, ‘spce’]

switch_width : simtk.unit.Quantity with units compatible with nanometers, optional, default = DEFAULT_SWITCH_WIDTH

Sets the width of the switch function for Lennard-Jones.

constrained : bool, optional, default=True

Sets whether water geometry should be constrained (rigid water implemented via SETTLE) or flexible.

dispersion_correction : bool, optional, default=True

Sets whether the long-range dispersion correction should be used.

nonbondedMethod : simtk.openmm.app nonbonded method, optional, default=app.PME

Sets the nonbonded method to use for the water box (one of app.CutoffPeriodic, app.Ewald, app.PME).

ewaldErrorTolerance : float, optional, default=DEFAULT_EWALD_ERROR_TOLERANCE

The Ewald or PME tolerance. Used only if nonbondedMethod is Ewald or PME.

positive_ion : str, optional

The positive ion to add (default is Na+).

negative_ion : str, optional

The negative ion to add (default is Cl-).

ionic_strength : simtk.unit.Quantity, optional

The total concentration of ions (both positive and negative) to add (default is 0.0*molar).

Examples

Create a default waterbox.

>>> waterbox = WaterBox()
>>> [system, positions] = [waterbox.system, waterbox.positions]

Use reaction-field electrostatics instead.

>>> waterbox = WaterBox(nonbondedMethod=app.CutoffPeriodic)

Control the cutoff.

>>> waterbox = WaterBox(box_edge=3.0*unit.nanometers, cutoff=1.0*unit.nanometers)

Use a different water model.

>>> waterbox = WaterBox(model='spce')

Use a five-site water model.

>>> waterbox = WaterBox(model='tip5p')

Turn off the switch function.

>>> waterbox = WaterBox(switch_width=None)

Set the switch width.

>>> waterbox = WaterBox(switch_width=0.8*unit.angstroms)

Turn of long-range dispersion correction.

>>> waterbox = WaterBox(dispersion_correction=False)

Methods

__init__([box_edge, unit, cutoff, unit, …]) Create a water box test system.
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_properties A list of available analytical properties, accessible via ‘get_propertyname(thermodynamic_state)’ calls.
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.
system The simtk.openmm.System object corresponding to the test system.
topology The 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.

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.