Structure Optimization for Cubic Systems

for helium version of Exciting


Purpose: In this tutorial you will learn how to set up and execute a structural minimization for a cubic system. Additionally, it will be explained how to visualize the relative atomic coordinates during the relaxation process.



1. Define relevant shell variables and download scripts

Very important: Before starting, the following shell variables must be set by the user:

EXCITINGROOT = Directory where exciting has been downloaded, e.g.: /home/user/exciting .
EXCITINGRUNDIR = Directory where the user runs the calculations (must be existing!!), e.g.: /home/user/tempdir .
EXCITINGSCRIPTS = Directory where the scripts are downloaded (not necessary if the downloaded files are copied in /usr/bin), e.g.: /home/user/scriptsdir .

The setting of these variables can be done in a bash shell by typing (from now on the symbol $ will indicate the shell prompt):

$ export EXCITINGROOT=/local_path_to_exciting_root
$ export EXCITINGRUNDIR=/local_run_directory
$ export EXCITINGSCRIPTS=/local_tutorial_scripts_bin_directory
$ export PATH=$PATH:$EXCITINGSCRIPTS

The directory names /local_path_to_exciting_root, /local_run_directory, and /local_tutorial_scripts_bin_directory are dummy names which must be explicitly changed by the user to the appropriate ones.

As a second step, it is necessary to download the scripts which are used in this tutorial. Here is a list of these scripts with a short description, click on the script name to download it:

  • EXECUTE-single.sh: (Bash) shell script for running a single exciting calculation.
  • GNU-relax: Gnuplot visualization tool for following the relative atomic coordinates of the atoms during the relaxation process.
  • GNU-status: Gnuplot visualization tool for the RMS deviations of the SCF potential as a function of the iteration number during the SCF loop.
  • GNU-forces: Gnuplot visualization tool for the maximum amplitude of the force on the atoms during relaxation.

All the downloaded scrips must be executable, if this is not the case use, e.g.:

$ chmod u+x SETUP-single.py

Requirements: Bash shell. Gnuplot.

2. Set up the calculations

i) Preparation of the input file

The first step is to create a directory for each system that you want to investigate. In this tutorial, we consider as an example the relaxation of the internal coordinates of carbon (nevertheless, the same formalism can be easily applied to silicon or germanium) in the diamond structure. In fact, we already know that the optimized atomic coordinates of this structure are (without a common translation):

  • (0, 0, 0) for the first atom,
  • (0.25, 0,25, 0.25) for the second atom.

In this tutorial, we will verify this fact. Thus, we will create a directory diamond and we move inside it:

$ mkdir diamond
$ cd diamond

Inside this directory, we create the file input.xml. This file could look like the following:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="inputtohtml.xsl" type="text/xsl"?>
 
<input xsi:noNamespaceSchemaLocation="/local_path_to_exciting_root/xml/excitinginput.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsltpath="/local_path_to_exciting_root/xml/">
 
  <title>Diamond</title>
 
  <structure speciespath="/local_path_to_exciting_root/species">
    <crystal scale="6.7468">
      <basevect> 0.5     0.5     0.0 </basevect>
      <basevect> 0.5     0.0     0.5 </basevect>
      <basevect> 0.0     0.5     0.5 </basevect>
    </crystal>
    <species speciesfile="C.xml" rmt="1.20">
      <atom coord="0.00 0.00 0.00" />
      <atom coord="0.30 0.30 0.30" />
    </species>
  </structure>
 
  <groundstate ngridk="6 6 6"
               xctype="GGAPerdew-Burke-Ernzerhof"
               stype= "Methfessel-Paxton 1"
               swidth="0.001"
               gmaxvr="18"
               lmaxvr="8" 
               rgkmax="7.0">
  </groundstate>
 
  <structureoptimization></structureoptimization>
 
</input>

Please, remind that the input file for an exciting calculation must be always called input.xml.

Be sure to set the correct path for the exciting root directory (/local_path_to_exciting_root) to the one pointing to the place where the exciting directory is placed:

...
<input xsi:noNamespaceSchemaLocation="/local_path_to_exciting_root/xml/excitinginput.xsd"
  ... 
  xsltpath="/local_path_to_exciting_root/xml/">
  ...
  <structure speciespath="/local_path_to_exciting_root/species">
  ...

By examining the input file, we notice, in particular, that the chosen lattice constant is

    ...
    <crystal scale="6.7468">
    ...

which correspond to the equilibrium one. Furthermore, the initial atomic positions are set according to
    ...
    <species speciesfile="C.xml" rmt="1.20">
      <atom coord="0.00 0.00 0.00" />
      <atom coord="0.30 0.30 0.30" />
    </species>
    ...

Finally, in order to perform the structure optimization, we must insert in the input file, after the SCF calculation performed in groundstate, the following line:
  ...
  <structureoptimization></structureoptimization>
  ...

3. Perform the calculation

To execute the calculation with the input file we created in the previous section, you have to run the script EXECUTE-single.sh:

$ EXECUTE-single.sh 

Running exciting for file input.xml -------------------------------------

...

Run completed for file input.xml ----------------------------------------

$

After the complete run, the results of the calculation for the input file input.xml are contained in the subdirectory rundir-00.

Notice that the output directory rundir-00 will be overwritten each time you execute the script EXECUTE-single.sh. Therefore, before performing a new calculation please rename the rundir-00 directory to a different name, e.g.:

$ mv rundir-00 rundir-label

4. Analysis of the results: Visualization tools

All the scripts mentioned here produce as output a PostScript file named gnu.ps.

ii) GNU-relax

Gnuplot visualization tool for following the relative atomic coordinates of the atoms during the relaxation process. It is executed as follows:

$ GNU-relax

Enter label [r or 00,label,...] >>>> 00

$

In this example, the input entry, preceded by the symbol »» (in our example 00) represents the label of the calculation for which you would like to follow the relaxation of the relative atomic coordinates. In particular, the choice r refers to the currently running calculation, 00 to the calculation already saved in the directory rundir-00, and label to the calculation already saved in the generic directory rundir-label. An example of the script output is the following:
c-relax.png
Here, (Δ1, Δ2, Δ3) represent the vector joining the 2 atoms in the unit cell, expressed in crystal coordinates.

ii) GNU-status

Gnuplot visualization tool for the RMS deviations of the effective SCF potential as a function of the iteration number during the SCF loop. It is executed as follows:

$ GNU-status

Enter label [r or 00,label,...] >>>> 00

$

The input entry definition is the same as for the script GNU-relax. An example of the script output is the following:
c-status.png
The different line segments correspond to the SCF calculations for the different atomic coordinates during the relaxation.

iii) GNU-forces

Gnuplot visualization tool for the maximum amplitude of the force on the atoms during relaxation. It is executed as follows:

$ GNU-forces

Enter label [r or 00,label,...] >>>> 00

$

The input entry definition is the same as for the script GNU-relax. An example of the script output is the following:
c-forces.png
The red points show the calculated value at each iteration, whereas the blue line indicates the target value of the maximum amplitude of the force for stopping the relaxation.

Remark on the visualization scripts

All the visualization scripts accept two on-the-command-line entries specifying the y-axis limiting values. So that, e.g., the command

$ GNU-relax 0.24 0.26

will visualize the results in the y-axis range between the atomic coordinates 0.24 and 0.25 (in crystal coordinates).

5. Additional exercises

i) Change the initial position

Change the initial position of the second atom in the unit cell according to the following (non symmetrical choice):

    ...
    <species speciesfile="C.xml" rmt="1.20">
      <atom coord="0.00 0.00 0.00" />
      <atom coord="0.30 0.20 0.37" />
    </species>
    ...

Perform a new calculation:
  • Why do you expect a longer execution time in this case?

ii) Change the lattice parameter

Set the cubic lattice constant to a smaller value, as in the following example:

    ...
    <crystal scale="5.0">
    ...

Due to the smaller volume (and distances), set the muffin-tin radius of the carbon atoms to a smaller value:
    ...
    <species speciesfile="C.xml" rmt="1.05">
    ...

Set the initial coordinates of the second atom according to:
      ...
      <atom coord="0.00 0.00 0.00" />
      <atom coord="0.45 0.45 0.45" />
      ...

Perform a new calculation:
  • What are the equilibrium relative atomic coordinates in this case?
  • What happens if the initial coordinates of the second atom are set to (0.26, 0.26, 0.26)?
  • What is the physical meaning of this result?
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License