[lammps-users] temperature output from parallel tempering

Hi,

I'm running a parallel tempering simulation with lammps. I selected 12 temperatures from 300K to 600K,
and a customized "thermo_style" command was issued to output the instantaneous temperature at a regular
interval. However, when I check the output temperatures, all the 12 replica give statistically the same average
temperature ~425K (about the average of 300 and 600K). I don't know why.
What I could make sure is the initial temperature for each replica was correctly set and output.

I'd like to know
1. After an exchange of replica, are the velocities rescaled to produce the new temperature?
2. Does the temperature output from a exchange replica simulation have the same meaning as that output
from a usual MD run?

lt

Just add some of my understanding after some experiments. Please give me a sign if something is wrong here:
1. When I run a replica exchange simulation, lammps will give a log.lammps in which the index of temperature
used by each partition is listed.
2. However, the output log file is partition-based. This means in each log.lammps.N (N is the partition number)
the properties output by "thermo_style" are mixed from different temperatures. (that's why I saw the averaged
temperature in my previous email.)
3. If point 2 is true, then the trajectory file is also mixed. (right?)

So, to get properties at a specific temperature, should I extract and re-sort the log file and the dump file
according to the temperature id? Is there a way to write the log and dump file based on temperature instead
of partition id? I can understand to swap a temperature is much more efficient than doing real "replica exchange
of the molecular structure", but it will be really more convenient if the output data files are sorted by temperature.

Here is the script I used
>>>>>>>>>>>>>>>>>>>>>
variable t world 300.0 400.0
fix tfix all nvt $t $t 100.0
velocity all create $t 663678750 mom yes rot yes dist gaussian
timestep 1.0
dump 1 all atom $f dump-T$t.trj
temper 1000000 1000 $t tfix 70174753 5262781155
<<<<<<<<<<<<<<<<<<<<<<<

I hope someone could make me clearer.Thanks

lt

MyLinkka wrote:

After an exchange, the target temperature is reset for
the swapped replicas, so the velocities will adjust (after
a short time) to the new temperature. So the temperature
of an individual replica should go up/down over time
as swaps take place.

If you want a log or dump file that has data for only
one temperature, then you have to extract that from
the ensemble of log/dump files, using the master log
file as a guide to which is which.

Steve

Thanks, Steve! I know what I should do now.

However, don't you think the log/dump should or is better to be organized by temperature?
(data for the same temperature go to the same file.) I cannot see why people need files with
data mixed from different temperatures. Is there any reason not to do it during the simulation
(e.g. too many file closing and re-opening)?

lt

Steve Plimpton wrote:

Hi, Steve,

In the reply "the velocities will adjust (after a short time) to the new temperature",
what did you mean "after a short time" there? Aren't the velocities rescaled immediately
to the new temperature after a swap? Or the old temperature remains right after
a swap and then the thermostat equilibrates the system to the new temperature?
Could please you make it clearer?

I think this is important and it's mentioned in Okamato's paper that the kinetic energy
must be correctly handled in ptmd, because the kinetic energy part also affects the
exchange criterion.

lt

Steve Plimpton wrote:

Hi, Steve,

I did some experiment on parallel tempering. I'm not so sure if everything
I did is appropriate. Please point it out in case I misunderstood.

I set up a very simple system, and only two temperatures (300K and 400K) were used.
I dump thermo info at each step in order to check the temperature change.
The first several lines from log.lammps look like
>>>>>>>>>>>>>>
LAMMPS (21 May 2008)
Running on 2 partitions of processors
Step T1 T2 ...
0 0 1
10 1 0
20 1 0
30 1 0
<<<<<<<<<<<
I think this indicates at timestep 10 two temperatures were swapped.

Then I check the temperature output from the partition log files and they
show texts as below (I list just the first 3 columns for clarity because this
mailing list seems wrapping the long line automatically. Note the 2 column
data is the instantaneous temperature):
.../test sed \-n \-e &#39;88,90p&#39; log\.lammps\.0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9 149\.51332 13\.085661 10 161\.82122 13\.03579 11 171\.13408 13\.024371 \.\.\./test sed -n -e '88,90p' log.lammps.1
       9 185.97408 17.601327 10 202.83832 17.533336 11 216.15248 17.517429

Here I couldn't see how the temperatures at timestep 10 are swapped or rescaled.
Could you explain how it works?

lt

Steve Plimpton wrote:

All a successful swap does is swap the target temperatures
for the thermostats of the 2 simluations that were swapped.
So following the swap, simulation 1 will equilibate
to T2 and sim 2 to T1. The velocities are not rescaled.
An exception would be using temp/rescale as the thermostat, which
might do it right away. But other thermostats are more gentle.

Steve

To clarify: after the swap each simulation will begin
to equilibrate to a new temperature using their
thermostat with a new target T. How long that takes
depends on the thermostat and the damping constants
you have defined.

Steve