The System section¶
The system section defines some properties of the system.
[system]
units = "reduced"
dimensions = 2
temperature = 1.0
Keywords for the System section¶
The following keywords can be set for the System section:
Keyword |
Description |
|---|---|
Specify the dimensionality of the system. |
|
Specify the temperature of the run. |
|
Specify the unit system to use. |
Keyword dimensions¶
Specify the dimensionality of the system. Should be 1, 2, or 3 for 1D, 2D or 3D, respectively.
- Default:
The default value is
dimensions = 3.
Keyword temperature¶
The temperature, \(T\), of the run. Every engine takes the temperature it runs at from one place:
The internal integrators, TurtleMD and ASE run at
temperature. It gives \(\beta = 1/(k_\text{B} \times T)\), with the Boltzmann constant \(k_\text{B}\) of the unit system (of theboltzmannsetting for TurtleMD), for the velocities of the particles (the velocity keyword of the particles section), the velocities of a shooting move, the Langevin dynamics and the acceptance of a soft velocity perturbation. TurtleMD gives its Langevin integrator this \(\beta\), and refuses abetain the settings of the integrator. TurtleMD takestemperaturein the temperature unit of itsboltzmann, and ASE in kelvin: the input of a run with either must settemperature, and a run whose input sets none does not start.An engine of your own, which
[engine] modulenames (see user-defined engines), runs at the temperature of the class it is built on. Built on an internal integrator (MDEngine,Verlet,VelocityVerlet,Langevin), it runs attemperature, 1 when the input sets none. Built on GROMACS, LAMMPS, CP2K, OpenMM or AMS, it runs at the temperature of its input, as these engines do (below). Built on any other class, such asEngineBaseorExternalMDEngine, it runs attemperature, which the input must set: a run whose input sets none does not start, with the messageThe <class> engine of [engine] runs at [system] temperature, which the input does not set. An engine of your own that runs attemperatureand whose constructor takes atemperatureargument is given the temperature of the run (1 for one built on an internal integrator when the input sets none); the default value of the argument is not used.GROMACS, LAMMPS, CP2K, OpenMM and AMS run at the temperature their own input states, which PyRETIS reads when the engine is created:
gen-tempand, for a run coupled to a thermostat (integrator = sdorbd, ortcouplother thanno), theref-tof eachtc-grpsgroup of the mdp file; theSET_TEMPvariable, the thermostat fixes, the thermostat pair stylesdpd/tstatanddpd/ext/tstatand thevelocitycommands oflammps.in(class = "lammps_steps"withvelocity_generation = "engine"asks LAMMPS to draw the velocities atSET_TEMP, and alammps.inwithout it does not start such a run);MOTION/MD TEMPERATUREof the CP2K input; the temperatures the integrator and the forces of the OpenMM simulation state (see the temperature of an OpenMM simulation below); andMolecularDynamics%InitialVelocities%Temperatureand theTemperatureof eachThermostatofams.inp. The settings of one input that hold a temperature must be one temperature, equal to four machine epsilons relative to the larger, as the temperatures of an OpenMM simulation below, and an input that leaves its temperature out (an mdp file withoutgen-temp, a CP2K input withoutTEMPERATURE, an OpenMM simulation that states no temperature) stops the run with a message that names what to set: the 300 K that GROMACS and CP2K take by default is not taken, and no temperature is assumed for an OpenMM simulation. For these enginestemperatureis optional. When it is set, it must equal the temperature of the input of every engine of the run within a relative \(10^{-9}\), else the run does not start. When it is not set and the inputs of the engines of the run state one temperature, the run sets it to that temperature,output.tomlrecords it, andpyretis analysereads it there. The inputs state one temperature when the lowest and the highest of their temperatures are equal to four machine epsilons relative, as the temperatures of an OpenMM simulation below. The run then takes the temperature of the first of those engine sections (the sections whose engine reads the temperature of its input), in the order[engine],[engine0], then the sections of the pool as the input lists them. The engines of a pool whose inputs state different temperatures each run at their own:temperatureis then left unset,output.tomlrecords the temperature of each engine in its engine section, and a run that also has an engine that runs attemperaturedoes not start. An input that declares its unit system (the LAMMPSunitscommand) must declare the one of the units keyword.
An OpenMM simulation runs at the temperature it states, in two places:
its integrator, when the integrator has a temperature. A
CustomIntegratorstates it in its global variablekT, the thermal energy in kJ/mol, which PyRETIS divides by the molar gas constantMOLAR_GAS_CONSTANT_Rof OpenMM (the integrator of the OpenMM example and OpenMM’sMTSLangevinIntegratorhold one): computekTasMOLAR_GAS_CONSTANT_Rtimes the temperature, as akTcomputed with another value of the gas constant reads as another temperature. The integrator of the simulation, when its class hasgetTemperature(as those of openmmtools), states both temperatures, that ofgetTemperaturefirst;getTemperaturemust return a temperatureQuantity(as300.0 * unit.kelvin). Every integrator aCompoundIntegratorholds that has a temperature states it, whether or not it is the integrator that steps the simulation, and so does every integrator of aCompoundIntegratorit holds; OpenMM gives aCustomIntegratorit holds as its ownCustomIntegrator, which states the temperature of itskTonly;each force of the System that has a temperature: a thermostat (
AndersenThermostat) or a barostat (MonteCarloBarostatand the other Monte Carlo barostats).
All the temperatures the simulation states must be one temperature,
else the run does not start, with a message that names each of them.
Two temperatures are one temperature when they differ by at most
four machine epsilons relative to the larger (for 300 K, about
2.7e-13 K): a kT computed from a temperature divides back to it
within a few units in the last place. The run takes the first of
them, that of the integrator the simulation steps with when that
integrator has a temperature.
A CustomIntegrator without kT that draws no random numbers
(none of its expressions uses uniform or gaussian), such as
one of velocity Verlet or OpenMM’s MTSIntegrator, has no
temperature. A simulation with such an integrator and no force with
a temperature states no temperature, and is refused: the run stops
before any engine runs, with a message that says how to state one.
To state the temperature without changing the dynamics, add to the
System an AndersenThermostat at the temperature of the run (here
300 K) with collision frequency 0, and give the
CustomIntegrator an addUpdateContextState() step, in which
it applies the thermostat (a path-sampling run refuses an
AndersenThermostat beside a CustomIntegrator without one).
It changes no velocity, and the integrator draws no random numbers,
so the trajectory is that of the integrator alone, step for step.
The simulation runs at the temperature of the thermostat:
system.addForce(openmm.AndersenThermostat(300 * unit.kelvin,
0 / unit.picosecond))
PyRETIS reads the temperature of a CustomIntegrator from its
global variable kT, spelled so. A CustomIntegrator that
holds a variable named kT of another kind, a
per-degree-of-freedom variable (kT, KT, kt or Kt) or
a global variable in another letter case (KT, kt or
Kt), alone or in a CompoundIntegrator, is refused, whatever
forces the System holds: such a variable stands for the temperature
of a thermostat of the integrator’s own, which PyRETIS cannot
compare with the temperature the simulation states. Hold that
temperature in the global variable kT.
A CustomIntegrator that draws random numbers (uniform or
gaussian) and has no global variable kT, alone or in a
CompoundIntegrator, is refused too, whatever forces the System
holds: its random numbers act at a temperature it holds in a
variable of its own, which PyRETIS does not read. Hold its thermal
energy in the global variable kT, MOLAR_GAS_CONSTANT_R times
the temperature, and use kT in the expressions that draw random
numbers. A CustomIntegrator with kT, or one that draws no
random numbers, that thermostats at a temperature held under
another name, or read from a parameter of a force, runs at the
temperature the simulation states, and must thermostat at that
temperature.
A path-sampling run refuses every integrator of OpenMM other than a
CustomIntegrator, alone or in a CompoundIntegrator (the
Drude integrators, NoseHooverIntegrator and the integrators with
a variable step size, VariableVerletIntegrator and
VariableLangevinIntegrator, with which a step of PyRETIS has
no fixed time, among them), and the accelerated-MD
CustomIntegrator classes, also in a CompoundIntegrator,
before any message about the temperature; the steps of the
CustomIntegrator must give the velocities at the time of its
positions (see the integrator of a path-sampling run). OpenMM runs the path-sampling
tasks only.
An engine section ([engine], [engine0] and the numbered
sections of a pool) may give a temperature too. It sets no
temperature: it is compared with the temperature the engine of the
section runs at, from the place given above, in the units of that
engine, and the two must agree within a relative \(10^{-9}\).
Otherwise the run stops before any engine runs, with a message that
names the two values, the section and the setting that holds the
temperature of the engine. When the engine runs at the temperature
of the kT of an OpenMM CustomIntegrator, this message, and
that of a [system] temperature that differs, say how PyRETIS
reads kT: kT divided by OpenMM’s MOLAR_GAS_CONSTANT_R.
output.toml records it in its section. A velocity keyword
of the particles section that sets temperature is refused: the
velocities of the particles are drawn at the temperature of the
system.
A temperature that is not a finite, positive number (a string, a
boolean, a list, a table, nan, inf, zero or a negative
number), here or in an engine section, is refused before the run
starts, and when a resume, a continuation or pyretis analyse
reads it from a run file, a restart file or an input: true is
not read as the temperature 1. So is a temperature of this
section so small that \(1/T\), or
\(\beta = 1/(k_\text{B} \times T)\) with the Boltzmann constant
of the units keyword, is not a finite number, such as
1e-320, or 1e-290 with units = "si": the message says
that it is so small.
- Default:
temperature = 1.0for a run whose engines are all internal integrators, or engines of your own built on one. TurtleMD, ASE and the other engines of your own that run attemperaturehave no default, and neither has theumbrellawindowtask, whose Monte Carlo moves are accepted attemperature: the input of such a run must set it. A run with an engine that reads its temperature from its input runs at that temperature. Anmd,md-nve,md-fluxorumbrellawindowrun that continues a restart file ([simulation] restart) and leavestemperatureout runs at the temperature of the run it continues (see the restart of create_simulation); with a TurtleMD or ASE engine, or another engine without a default, its input must still set it.
Keyword units¶
The units keyword defines the system of units to use by PyRETIS.
Currently, the following system of units are defined by PyRETIS
(see the definitions of unit systems):
lj: A Lennard-Jones type of (reduced) units (based on Argon [1]).real: A system of units similar to the LAMMPS [2] unit real.metal: A system of units similar to the LAMMPS [2] unit metal.au: Atomic units. [3]electron: A system of units similar to the LAMMPS [2] unit electron.si: A system of units similar to the LAMMPS [2] unit si.gromacs: A system of units similar to the units used by GROMACS. [4]openmm: nm, kJ/mol and g/mol, the units of OpenMM.cp2k: Å, hartree and the electron mass.reduced: Å, \(k_\text{B} \times 1\,\text{K}\) and g/mol, in which \(k_\text{B} = 1\).ase: eV, Å and fs, the energy and length units of ASE and the unit of the time step of the ASE engine.
The system of units should be one of the systems defined by
PyRETIS listed above. Alternatively, you can define your own unit system by
making use of a special unit-system section
in combination with the units keyword.
- Default:
The default is the unit system of the engine:
ljfor the internal integrators,gromacsfor GROMACS,openmmfor OpenMM,cp2kfor CP2K,reducedfor TurtleMD,asefor ASE, and theunitscommand of the LAMMPS input for LAMMPS.