User Tools

Site Tools


benzen_structure_optimization

This is an old revision of the document!


Here we describe how to perform structure optimization of a simple molecule using the new version of the Fireball code. There are minimal steps required to optimize atomic structure using quenching optimization method:

atomic structure

In this particular case, we are about to optimize atomic structure of benzene molecule. An initial configuration is written in a file with an arbitrary name (e.g. initial.bas, see text bellow)

        12
 6     -4.192725     -3.947918     -0.000885
 6     -3.105518     -3.068150      0.003445
 6     -3.324254     -1.686900      0.002294
 6     -4.629983     -1.185844      0.001786
 6     -5.717209     -2.065606     -0.001295
 6     -5.498437     -3.446870     -0.005502
 1     -6.367512     -4.151865     -0.010025
 1     -4.018424     -5.053386     -0.000752
 1     -2.061162     -3.470265      0.006507
 1     -2.455303     -0.981710      0.003944
 1     -4.804199     -0.080387      0.004380
 1     -6.761568     -1.663453     -0.002176

input file

The fireball.in input file provides control over what sort of calculation will be done. If the file is not presented, fireball run default task with predefined parameters. Complete list of all choices can be found here. In our particular case, fireball.in file looks like:

&OPTION
basisfile = initial.bas
nstepf = 5000
iquench = -1
icluster = 1
iqout = 3
dt = 0.5
&END
&OUTPUT
iwrtxyz = 1
&END

where
keyword 'basisfile' defines name of a file with an initial atomic configuration;
keyword 'nstepf' defines the maximal number of time steps;
keyword 'iquench' sets a type of structure optimization;
keyword 'icluster' defines type of boundary conditions (here no periodicity);
keyword 'dt' is time step in femtoseconds;
keyword 'iwrtxyz' allows to save history of atomic trajectories during optimization proces into xyz-format output file answer.xyz

Fdata

To initiate Fireball run, we need to create Fdata directory in working directory, which contains all electronic integrals to build up Hamiltonian for each geometry. These integrals has to be calculated in advance by create module. Once we have these data, usually we create Fdata dir via symbolic link

 ln -s $CURRENT_DIR_Fdata Fdata

or we write the path in the variable fdataLocation in the fireball.in file:

&OPTION
basisfile = initial.bas
nstepf = 5000
iquench = -1
icluster = 1
iqout = 3
dt = 0.5
fdataLocation = '$CURRENT_DIR_Fdata'
&END
&OUTPUT
iwrtxyz = 1
&END

run optimization process

Initiate Fireball run we need to execute binary file fireball.x. Usually we do that via shell script e.g. named run.bat:

 rm -fr CHARGES *.xv *.ac *.xyz
 $DIR_FIR/fireball.x

to run code we simply type in command line:

 ./run.bat > out &

this command run fireball on background.

output

Status of optimization process we can follow by simple command:

 grep "+++" out

You'll obtain on your screen comprehensive information how close optimization criteria are to used convergence tolerance:

 ....
  
 ++++ iter =       46 Etot=     -83.90303173 Fi_max=       0.074447
  +++ Etot  RES =      0.00189182  TOL =       0.00010000   NOT CONVERGED 
  +++ Fmax  RES =      0.07444720  TOL =       0.05000000   NOT CONVERGED 
 ++++ iter =       47 Etot=     -83.90304323 Fi_max=       0.071943
  +++ Etot  RES =      0.00013796  TOL =       0.00010000   NOT CONVERGED 
  +++ Fmax  RES =      0.07194256  TOL =       0.05000000   NOT CONVERGED 
 ++++ iter =       48 Etot=     -83.90307246 Fi_max=       0.065520
  +++ Etot  RES =      0.00035078  TOL =       0.00010000   NOT CONVERGED 
  +++ Fmax  RES =      0.06552009  TOL =       0.05000000   NOT CONVERGED 
 ++++ iter =       49 Etot=     -83.90322186 Fi_max=       0.053999
  +++ Etot  RES =      0.00179281  TOL =       0.00010000   NOT CONVERGED 
  +++ Fmax  RES =      0.05399895  TOL =       0.05000000   NOT CONVERGED 
 ++++ iter =       50 Etot=     -83.90327990 Fi_max=       0.040755
  +++ Etot  RES =      0.00069654  TOL =       0.00010000   NOT CONVERGED 
  +++ Fmax  RES =      0.04075507  TOL =       0.05000000   CONVERGED 
 ++++ iter =       51 Etot=     -83.90347863 Fi_max=       0.024827
  +++ Etot  RES =      0.00238468  TOL =       0.00010000   NOT CONVERGED 
  +++ Fmax  RES =      0.02482667  TOL =       0.05000000   CONVERGED 
 ++++ iter =       52 Etot=     -83.90359903 Fi_max=       0.011633
  +++ Etot  RES =      0.00144488  TOL =       0.00010000   NOT CONVERGED 
  +++ Fmax  RES =      0.01163264  TOL =       0.05000000   CONVERGED 
 ++++ iter =       53 Etot=     -83.90365698 Fi_max=       0.022778
  +++ Etot  RES =      0.00069536  TOL =       0.00010000   NOT CONVERGED 
  +++ Fmax  RES =      0.02277786  TOL =       0.05000000   CONVERGED 
 ++++ iter =       54 Etot=     -83.90365157 Fi_max=       0.021744
  +++ Etot  RES =      0.00006491  TOL =       0.00010000   CONVERGED 
  +++ Fmax  RES =      0.02174432  TOL =       0.05000000   CONVERGED 
  +++++  Quenching  process converged  +++++ 

History of the total energy during the optimization process can be easily plotted using Gnuplot program as follows:

grep ETOT so_sp.out | cut -b22- > etot.dat
gnuplot
gnuplot> set xlabel "time step"
gnuplot> set xlabel "Etot [eV]"
gnuplot> set format y "%8.4f"
gnuplot> plot "etot.dat" with linespoints

optionally, we save the output into png figure format doing

gnuplot> set term png 
gnuplot> set output "etot.png"

final optimized structure & charge analysis

Current optimized structure is placed in answer.bas file and it can be directly used as input file for a next run.

        12
 6     -4.183507     -4.005641     -0.001142
 6     -3.050800     -3.089167      0.003179
 6     -3.278833     -1.650218      0.003065
 6     -4.639215     -1.128095      0.001770
 6     -5.771898     -2.044592     -0.001875
 6     -5.543886     -3.483549     -0.004966
 1     -6.427498     -4.200469     -0.008348
 1     -4.006604     -5.129725     -0.002273
 1     -1.988933     -3.498117      0.005219
 1     -2.395194     -0.933283      0.005850
 1     -4.815981     -0.004012      0.002952
 1     -6.833808     -1.635777     -0.003761

Each atomic configuration achieved during the optimization procedure is recorded into the answer.xyz file. The history can be visualized by e.g. Jmol program.

benzene

In addition, there is a file CHARGES which contains projected Lowdin charges onto individual shells.

   12  initial0.bas                               3
    0.99704005    3.10168254
    0.99692942    3.10180981
    0.99697651    3.10173483
    0.99702943    3.10168959
    0.99693536    3.10181070
    0.99696818    3.10179334
    0.89726521    0.00398424
    0.89733723    0.00398285
    0.89723911    0.00398370
    0.89728961    0.00398349
    0.89731948    0.00398339
    0.89724802    0.00398392
benzen_structure_optimization.1520520200.txt.gz · Last modified: 2018/03/08 15:43 (external edit)