This tutorial is aimed at introducing students to advanced electronic structure calculation package NRLMOL. In this tutorial students will learn to optimize the geometries of diatomic molecules.
January 10, 2010
Again, as a reminder the CLUSTER file is the main input file of NRLMOL. It contains the minimal information to set up the calculation. See below the CLUSTER file for the hydrogen molecule.
GGA-PBE*GGA-PBE # Exchange-correlation parametrization GRP # Point group of system 2 # No. of atoms 0.0 0.0 0.5 1 ALL # x,y,z coordinates, Atomic number, ALL means all electron 0.0 0.0 -0.5 1 ALL # x,y,z coordinates, Atomic number, ALL means all electron 0.0 0.000 # Charge and Moment Hydrogen molecule. Input auto generated by Perl script.
We will now describe the input structure of this file.
$ rm -f GEOCNVRG SYMBOL ISYMGEN INPUT RUNS $ ./cluster < print.SCF
Now, browse through the file print.SCF and look at the energies printed at each iteration. Also, look at the EVALUES file in which Kohn-Sham eigenvalues and occupation numbers are printed. Try to understand the SCF process.
Now, let's open the GEOCNVRG file:
1.0000000000000000E-003 CONVERGE FALSE ENERGY= -1.113884538059298 TOTAL GRADIENT= 0.4658517560326668 LARGEST NUCLEAR GRADIENT= 0.3294070519678478
The number on the first line is the optimization threshold. If the RMS gradient falls below this value then optimization of structure is complete. The following line CONVERGENCE FALSEtells us that the structure is not optimized yet, that is, the atoms have still significant forces. The next line is the total energy in Hartree for the current geometry. The last line prints out the maximum rms force.
To get more information on the forces, look at the file FRCOUT.
$ cat FRCOUT -1.1138845381 1 Energy and Symbol NCALC 0.00000000 0.00000000 0.50000000 1 1 -0.593228680992D-07 -0.593228686397D-07 0.329406819469D+00 0.00000000 0.00000000 -0.50000000 1 1 -0.593227768567D-07 -0.593227770511D-07 -0.329407051968D+00 <--- MAX-FORCE 0.557780120356D-07 0.557780123507D-07 -0.768552000929D-07 0.000000000000D+00 0.000000000000D+00 0.000000000000D+00 $
The first line is the total energy in Hartree. It will also be printed in GEOCNVRG. Followed by these are atomic positions (x,y,z) components of atom 1, which is followed by the x,y,z component's of forces. Similar, information is printed on subsequent lines. The second last line contains DIPOLE MOMENT while the last line prints out the external electric field. The H2 molecule does not have dipole moment and our calculations are in absence of electric field. Note that since we placed atoms on Z axis only the Z component of force is nonzero. The forces are significant and tell us that atoms should be moved away from each other. Since the forces are significant we need to repeat calculation until the forces vanish (fall below the threshold).
So repeat following command until forces are zero which is easy to figure out by looking at GEOCNVRG.
$ ./cluster > print.SCF
You can also use following script to automate optimization. For the bash shell it is :
#!/bin/bash export iter=1 while [ $iter -lt 31 ]; do #${mpirun} -np ${NP} ./bcluster > print.${iter} ${mpirun} -machinefile $PBS_NODEFILE -np ${NP} ./cluster > print.${iter} cat FRCOUT >> FRCOUT-TOT cat FRCOUT FRCOUT.${iter} if [ -e "EXIT" ]; then rm -f EXIT; exit fi if [ -e "GEOCNVRG" ]; then export x=`cat GEOCNVRG| grep CONV |awk '{print $2}'` if [ $x == 'TRUE' ]; then echo "Looks like geometry is converged at step ${iter}. \n Stopping..." exit fi fi let iter=${iter}+1 done # end_of_while_loop
Cut and paste the above script in a file called "opt.bash". Then do the following to run it.
$ chmod +x opt.bash $ ./opt.bash &
The first command will make the file "opt.bash" executable and the second one will run the program in background.
The final GEOCNVRG file is
1.0000000000000000E-003 CONVERGE TRUE ENERGY= -1.166529242444089 TOTAL GRADIENT= 4.6930900067498795E-004 LARGEST NUCLEAR GRADIENT= 3.3185157688592808E-004
Note the second line says that CONVERGENCE is TRUE meaning that structure is optimized.
The final forces are in "FRCOUT".
$ cat FRCOUT -1.1665292424 6 Energy and Symbol NCALC -0.00000200 -0.00000200 0.70838900 1 1 -0.156998838711D-06 -0.156998838805D-06 0.331851502536D-03 -0.00000200 -0.00000200 -0.70838900 1 1 -0.156998838240D-06 -0.156998838613D-06 -0.331851502610D-03 <--- MAX-FORCE 0.311218459833D-06 0.311218459219D-06 -0.930366894636D-13 0.000000000000D+00 0.000000000000D+00 0.000000000000D+00 $
The final optimized coordinates are stored in "XMOL.DAT" (They are in Angstrom).
2 Cluster output 1 0.00000 0.00000 0.37486 1 0.00000 0.00000 -0.37486
So the optimized bond length is 0.749 Angstrom.