the output of qbox during running

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.
Post Reply
luke419
Posts: 7
Joined: Tue Feb 27, 2024 2:50 am

the output of qbox during running

Post by luke419 »

Hello, Francois

Many thanks for your helps on my use of qbox.
I've installed qbox and tested several examples. They worked well and finished without any error.
I'd like to ask some questions on the output of qbox.

1. For gs.i, it seems that "run 0 200" indicates 200 SCF iteration should be done.
I suppose that it is a maximum iteration number and the iteration may stop before 200 if criterion is met. If so, how can I know at what step the computation finished?
If it is possible, would you let me know how I can change the setting of force and/or energy criterion for geometric optimization?

2. For molecular dynamics (MD) simulations, I'd like to know the status (the step number and the total energy at that step etc.) of MD during running.
For this, what keywords should I use?

Thank you for your answers in advance.

Best regards,
Young
Last edited by luke419 on Tue Mar 19, 2024 12:41 pm, edited 1 time in total.
fgygi
Site Admin
Posts: 151
Joined: Tue Jun 17, 2008 7:03 pm

Re: the output of qbox during running

Post by fgygi »

The full details of the parameters of the run command are given in http://qboxcode.org/doc/html/usage/commands.html#run
Indeed, the number of SCF iterations actually performed may be smaller than nitscf if the scf_tol variable has been set and the change in etotal_int is smaller than scf_tol. Note that if the scf_tol variable is not set, its default value is zero. In that case the number of SCF iterations will be nitscf.
You can monitor the progress of a ground state calculation by simply using the grep etotal gs.r command. You can also generate a plot of the evolution of <etotal_int> using the etotal_int.plt script provided in the util directory (this requires installing the Gnuplot plotting program).

In geometry optimizations, the variable force_tol can be set to limit the total number of iterations (niter). The same logic is used. Iterations continue until the largest component of any ionic force is larger than force_tol. You can monitor the convergence of a geometry optimization using the qbox_maxforce.py script provided in the util directory. This prints the largest component of the ionic forces and the atom on which the force is applied at each step of the optimization.

During an MD simulation, every iteration is printed in the output within an <iteration> XML element. You can extract XML elements using e.g. the xml_grep program provided in the Perl distribution. You can monitor the evolution of <etotal> using grep '<etotal>' md.r, or by generating a plot using the etotal.plt script. The econste.plt script also shows the constant of the motion, which allows you to verify that the simulation parameters are reasonable. See e.g. the Si64 simulation example in the documentation http://qboxcode.org/doc/html/examples/s ... #silicon64
luke419
Posts: 7
Joined: Tue Feb 27, 2024 2:50 am

Re: the output of qbox during running

Post by luke419 »

Thank you for your answers, Francois.
I'd like to ask some more questions on the output of qbox as follows.

1. In what output file, would mlwf be stored? Can I output mxwf to a different file rather than md.r or md.xml?

2. I'd like to also output O and H(or D) positions at the same steps as those of mlwf (every 10 period), if possible to a postion.dat file.
Would you let me know how I can do it in qbox?

3. What information would be stored in md.xml?

Best regards,
Young
fgygi
Site Admin
Posts: 151
Joined: Tue Jun 17, 2008 7:03 pm

Re: the output of qbox during running

Post by fgygi »

Hello Young,

1. The MLWF centers and spreads are only printed on standard output (e.g. md.r). If you want to plot the MLWF wavefunctions themselves, you can use the plot -wf command to generate a cube file immediately after the compute_mlwf command. You can also save the wave functions after the compute_mlwf command using the save command. If you use the -text option, the save command will write the wave functions as formatted text (instead as the more compact base64 encoding used by default).

If you want to have multiple commands executed every 10 steps, for example, you can create a file (e.g. periodic_cmds.i) and then use set iter_cmd periodic_cmds.i.

2. The atomic positions are printed on standard output at every MD iteration in the XML <atomset> element. You can also use the list_atoms command to get the <atomset> printed on standard output at any time. If you want to write the current atomic positions to a file in XML format, you can use save -atomsonly filename.xml. If you want to write the current atomic positions in the xyz format, you can use plot file.xyz.

3. The md.xml file contains all the information needed to restart the calculation at the point where it was written. The file is a standard text file (you can read it e.g. using the less command). It includes in particular the <atomset> element including pseudopotential information, atomic positions and velocities. It also contains the wave functions in the form of their values on a grid, encoded with base64 encoding.

More details about these commands can be found at http://qboxcode.org/doc/html/usage/commands.html

Note also that you can name the xml files any way you want, e.g. md003.xml to save the state at the end of the third MD run.
Post Reply