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 openmm.unit.Quantity object containing the particle positions, with units compatible with openmm.unit.nanometers.
system
The openmm.System object corresponding to the test system.
topology
The 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_edgeopenmm.unit.Quantity with units compatible with nanometers, optional, default = 2.5 nm
Edge length for cubic box [should be greater than 2*cutoff]
- cutoffopenmm.unit.Quantity with units compatible with nanometers, optional, default = DEFAULT_CUTOFF_DISTANCE
Nonbonded cutoff
- modelstr, optional, default = ‘tip3p’
The name of the water model to use [‘tip3p’, ‘tip4p’, ‘tip4pew’, ‘tip5p’, ‘spce’]
- switch_widthopenmm.unit.Quantity with units compatible with nanometers, optional, default = DEFAULT_SWITCH_WIDTH
Sets the width of the switch function for Lennard-Jones.
- constrainedbool, optional, default=True
Sets whether water geometry should be constrained (rigid water implemented via SETTLE) or flexible.
- dispersion_correctionbool, optional, default=True
Sets whether the long-range dispersion correction should be used.
- nonbondedMethodopenmm.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).
- ewaldErrorTolerancefloat, optional, default=DEFAULT_EWALD_ERROR_TOLERANCE
The Ewald or PME tolerance. Used only if nonbondedMethod is Ewald or PME.
- positive_ionstr, optional
The positive ion to add (default is Na+).
- negative_ionstr, optional
The negative ion to add (default is Cl-).
- ionic_strengthopenmm.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, cutoff, model, ...])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 openmm.unit.Quantity object containing the particle positions, with units compatible with openmm.unit.nanometers.
system
The openmm.System object corresponding to the test system.
topology
The openmm.app.Topology object corresponding to the test system.