Sudden Jumps/Discontinuities in MD calculation

Questions and discussions regarding the use of Qbox
Forum rules
You must be a registered user to post in this forum. Registered users may also post new topics if they consider that their subject does not correspond to any topic already present on the forum.

Sudden Jumps/Discontinuities in MD calculation

Postby tbbishop » Tue Sep 19, 2017 2:51 am

Dear Francois,

I was wondering if you had some insight into a problem we were having. I am running an MD calculation on a material and looking at some of the variables temp_ion, sigma_xx (for the stress tensor), and etotal_int from the output to make sure things are running smoothly, and values seem to be more or less continuous but with a few random jumps every now and then. I was wondering if you knew what might be causing sudden jumps in the system. We thought it might be caused by the electronic state not being well converged, so I am going to do the calculation with more electronic iterations (previously had none) to see it that fixes it, but that's currently running and we weren't sure what the problem is. The calculation is done in many chunks, saving an xml file at the end of the calcluation and continuing where we left off by loading it at the beginning again, and it seems that many of these jumps occur when the job is restarted, but not all. My input file is just
Code: Select all
set nrowmax 160
load md_previous.xml
set ref_cell 67 0 0 0 67 0 0 0 30
set ecuts 60
set wf_dyn JD
set ecutprec 10
set xc PBE
set stress ON
set atoms_dyn MD
set dt 60
# randomize_v 80
set thermostat BDP
set th_temp 40
set scf_tol 2.e-6
run 50 10
save md_final.xml


The jumps are not that large but clearly noticeable. Also the higher the temperature it seems the more discontinuities. Hopefully this is clear and you have any tips.
Thanks in advance,
Tyler
tbbishop
 
Posts: 8
Joined: Tue Jun 13, 2017 1:06 pm

Re: Sudden Jumps/Discontinuities in MD calculation

Postby fgygi » Wed Sep 20, 2017 12:07 pm

Hi Tyler,

Some small discontinuities in the ionic temperature <temp_ion> are normal when using the BDP thermostat, since it is a stochastic thermostat that rescales velocities using a random variable to reproduce a canonical ensemble (see Bussi, Donadio, Parrinello, J. Chem. Phys. 126, 014101 (2007)). The use of this thermostat also causes <econst> to have jumps between runs, but during a run, <econst> should be smooth. Could you check if that is the case?

I am not sure if the discontinuities you observe can be attributed entirely to the thermostat. Is the total energy <etotal> continuous?

As you mentioned, the smoothness of the energy can be affected if the electronic ground state is not well converged at each step. This can be monitored by observing the convergence of <etotal_int> between MD steps.

Another possible source of discontinuities is the closing of the band gap. If the gap closes, this will cause a very slow convergence of <etotal_int> between MD steps. This can be remedied by including empty states in the calculation (variable nempty) and computing occupation numbers with the Fermi distribution (variable fermi_temp). If your system has a sufficiently large band gap in its minimum energy configuration, it is likely that this will hold at finite (moderate) temperatures.

Francois
fgygi
Site Admin
 
Posts: 130
Joined: Tue Jun 17, 2008 7:03 pm

Re: Sudden Jumps/Discontinuities in MD calculation

Postby tbbishop » Sun Sep 24, 2017 3:11 am

Hi Francois,

The value of econst is nicely smooth during a run, but makes a jump between runs. However, we found that during the jump the percent change was around 10^-6; is this not of concern then, even though there is a jump? The value of etotal_int is pretty much continuous -- at the beginning of each run it jumps up to a high value and then in the next step it goes back down to what it was previously.
tbbishop
 
Posts: 8
Joined: Tue Jun 13, 2017 1:06 pm

Re: Sudden Jumps/Discontinuities in MD calculation

Postby fgygi » Sun Sep 24, 2017 7:40 pm

Hi Tyler,

The discontinuities of <econst> between runs are normal when using the BDP thermostat for the following reasons:
- At every MD time step, the thermostat gives a small positive or negative contribution to the ionic kinetic energy through the stochastic velocity rescaling algorithm described by Bussi-Donadio-Parrinello. As a result, the quantity <etotal> + <ekin_ion> is not a constant of the motion (as it ignores the contributions from the thermostat).
In order to correct for that, Qbox keeps track of all the contributions from the thermostat since the beginning of the run, and defines the quantity <econst> as:

<econst> = <etotal> + <ekin_ion> + accumulated_contributions_from_thermostat

The quantity <econst> should therefore be smooth (and constant) during an MD run. Note that there can still be a slight drift in <econst>, which indicates that the electronic ground state is not fully converged between MD steps.

The discontinuity in <econst> between runs appears because Qbox does not keep track of the thermostat contributions between runs, i.e. it does not know what the thermostat did during the previous run. This is not a concern though. The behavior of <econst> can be used to monitor the quality of the MD integration, but only within one run.

In the absence of thermostat, the value of <econst> should be continuous between runs.

As an example of expected normal behavior, I have attached a tar file containing four short simulations (8 MD steps each). The example is taken from the 324-atom SnO system. The first two simulations (md10.r md11.r) do not use a thermostat, and show what happens when restarting from a previous simulation (i.e. how md11.r restarts from md10.r). The next two simulations (md12.r md13.r) use a BDP thermostat, and show how <econst> has a discontinuity when md13.r is restarted from md12.r

Here is the plot of <etotal> together with <econst>, as can be obtained using the econste.plt script used with all four files:
econste.png
Plot of <etotal> and <econst> in md10-md13
econste.png (72.99 KiB) Viewed 147 times

The plot was generated using the command:
Code: Select all
$ econste.plt md10.r md11.r md12.r md13.r


As you can see, there is no discontinuity in <econst> between md10.r and md11.r (at step 8), or md11.r and md12.r (at step 16), but there is a discontinuity between md12.r and md13.r (at step 24) since the thermostat is used during these last two runs.

Regarding <etotal_int>, an example of normal behavior is shown in this plot (md11.r)
etotal_int.png
Plot of <etotal_int> in md11
etotal_int.png (111.91 KiB) Viewed 146 times

The plot was generated using the command
Code: Select all
$ etotal_int.plt md11.r

At each MD step, the value of <etotal_int> increases sharply following the ionic move. It then decreases and converges back to the ground state, before the next MD step is taken. This run includes 8 MD steps, with 10 SCF iterations per step.

Finally, note that the PSDA algorithm might work faster than JD in these simulations (see the attached input files). Also, inserting an "rseed" command before the "run" command would reinitialize the random number generator (used by the thermostat), which avoids going through the same sequence of random number in each job.
Attachments
md10-13.tgz
Tar files of simulations md10-md13
(564.94 KiB) Downloaded 34 times
fgygi
Site Admin
 
Posts: 130
Joined: Tue Jun 17, 2008 7:03 pm

Re: Sudden Jumps/Discontinuities in MD calculation

Postby tbbishop » Mon Sep 25, 2017 2:16 am

Thank you for your thoughtful response! Yes, my etotal_int looks exactly like the plot you showed. I also noticed I accidentally used JD instead of PSDA and corrected it, but thank you for pointing it out.

Much appreciated!
Tyler
tbbishop
 
Posts: 8
Joined: Tue Jun 13, 2017 1:06 pm


Return to Qbox Users Discussion

cron