for helium version of Exciting
Purpose: In this tutorial you will learn how to set up and execute exciting calculations using the ElaStic@exciting program, which allows to obtain the full elastic tensors (elastic constants) of crystal systems for any crystal structure. In addition, the application of ElaStic@exciting to the determination of the elastic constants of C in the diamond phase and of Mg is explicitly presented.
Table of Contents
|
0. Define relevant shell variables and download scripts
Read the following paragraphs before starting with the rest of this tutorial!
In order to use the program ElaStic@exciting, one has first to follow a procedere in different steps:
STEP 1
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 .
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 EXCITINGSCRIPTS=/local_tutorial_scripts_bin_directory
$ export PATH=$PATH:$EXCITINGSCRIPTS
The directory names /local_path_to_exciting_root and /local_tutorial_scripts_bin_directory are dummy names which must be explicitly changed by the user to the appropriate ones.
STEP 2
It is necessary to download the scripts which are used in this tutorial. Here, is a tar file of the directory containing all the exciting_ElaStic scripts needed for elastic-constant calculations, click on the name of tar file to download it:
- ElaSticSCRIPTS.tar.gz: All the scripts for performing elastic-constant calculations.
Requirements: Bash shell. Python numpy, lxml, os, and sys libraries. xmgrace (visualization tool).
STEP 3
Open one terminal page and go to directory where you saved the tar file and execute the following commands:
$ tar xfvp ElaSticSCRIPTS.tar.gz
$ cd ElaSticSCRIPTS/
$ ls
After this, these files should be found in the ElaSticSCRIPTS directory:
ElaStic_Energy.par
exciting2sgroup.xsl
exciting_ElaStic_Analysis.py
exciting_ElaStic_Execute.sh
exciting_ElaStic_Result.py
exciting_ElaStic_Setup.py
exciting_ElaStic_xyz2XYZ.py
All the downloaded scripts (except the .par file) must be executable, if this is not the case use, e.g.:
$ chmod u+x exciting_ElaStic_Setup.py
STEP 4
Copy these files to the EXCITINGSCRIPTS directory using the command:
$ cp * $EXCITINGSCRIPTS/
STEP 5
ATTENTION: sgroup program has been installed in your computer simply go to the next step.
exciting_ElaStic uses the sgroup program, which should be downloaded and installed. The program sgroup is a utility which allows to determine the space group and symmetry operations of a crystal structure. It can be downloaded here (open this link and push the Download botton and save the file). After that, you will get a tar file, go to the directory where you saved the tar file and execute the following commands:
$ tar xfvp DownloadedFile.tar.gz
$ cd SpaceGroups/
$ make
After the make command, these lines should appear on the screen:
cc -c sgroup.c
cc -c math_sg.c
cc -c sto.c
cc -c io.c
cc -c lat.c
cc -c pgrp.c
cc -c pgrp_op.c
cc -c rotb.c
cc -c sgrp_cub.c
cc -c sgrp_hex.c
cc -c sgrp_tet.c
cc -c sgrp_ort.c
cc -c sgrp_trg.c
cc -c sgrp_mon.c
cc -c sgrp_trc.c
cc -o sgroup sgroup.o math_sg.o sto.o io.o lat.o pgrp.o pgrp_op.o rotb.o sgrp_cub.o sgrp_hex.o sgrp_tet.o sgrp_ort.o sgrp_trg.o sgrp_mon.o sgrp_trc.o -L/usr/lib -lm
Next, copy the sgroup exe file to the EXCITINGSCRIPTS directory, you can use this command:
$ cp sgroup $EXCITINGSCRIPTS/
CONGRATULATION: At this point, you have everything that you need for starting and performing an elastic-constants calculation.
1. Basic background on elastic constants
The second-order elastic constants (SOEC) can be represented, in the Voigt notation, as a 6x6 matrix. Since this matrix is symmetric, the maximum number of independent Cij is 21. For a given crystal symmetry, some of these 21 elastic constants may be equal, vanish, or be simply related to other Ckl. Therefore, the actual number of independent elastic constants depends on the symmetry of the crystal structure.
In the following table, we show the 9 different groups of SOEC, classified by the space group number. In order to calculate the SOEC, the number of independent distortions that one should consider is equal to the number of independent elastic constants. For instance, for cubic structures like diamond we need only 3 independent distorsions, for hexagonal crystals 5, and so on.
Lattice type | Space-group numbers | No. of independent elastic constants | Independent elastic constants |
Cubic | 195 … 230 | 3 | C11, C12, C44 |
Hexagonal | 168 … 194 | 5 | C11, C12, C13, C33, C44 |
Rhombohedral I | 149 … 167 | 6 | C11, C12, C13, C14, C33, C44 |
Rhombohedral II | 143 … 148 | 7 | C11, C12, C13, C14, C15, C33, C44 |
Tetragonal I | 89 … 142 | 6 | C11, C12, C13, C33, C44, C66 |
Tetragonal II | 75 … 88 | 7 | C11, C12, C13, C16, C33, C44, C66 |
Orthorhombic | 16 … 74 | 9 | C11, C12, C13, C22, C23, C33, C44, C55, C66 |
Monoclinic | 3 … 15 | 13 | C11, C12, C13, C15, C22, C23, C25, C33, C35, C44, C46, C55, C66 |
Triclinic | 1 … 2 | 21 | C11, C12, C13, C14, C15, C16, C22, C23, C24, C25, C26, C33, C34, C35, C36, C44, C45, C46, C55, C56, C66 |
In this tutorial, we will consider two examples: First, Carbon in the diamond structure, which belongs to the group in the first row in the table (see also the tutorial Energy vs. Strain Calculations). Second, Magnesium in the hexagonal structure.
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 first consider as an example carbon in the diamond structure (the procedure we use is, nevertheless, valid for any system). Thus, we will create a directory ElaStic_diamond and we move inside it:
$ mkdir ElaStic_diamond
$ cd ElaStic_diamond
Inside this directory, we create (or copy from a previous calculation) the file input.xml corresponding to a calculation for the equilibrium structure of diamond. 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: equilibrium structure</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.25"> <atom coord="0.00 0.00 0.00" /> <atom coord="0.25 0.25 0.25" /> </species> </structure> <groundstate ngridk="4 4 4" 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"> ...
- have in your file the appropriate commands for performing the structure optimization: Deforming your system may change the relative positions of the atoms in the unit cell:
<structureoptimization></structureoptimization>
ii) Generation of input files for distorted structures:
All the strains considered in this tutorial are Lagrangian strains.
In order to generate input files for a series of distorted structure, you have to run the script exciting_ElaStic_Setup.py, which will produce the following output on the screen:
$ exciting_ElaStic_Setup.py
>>>> Please enter maximum Lagrangian strain [suggested value is between 0.030 and 0.100]: 0.060
Maximum Lagrangian strain is 0.06
>>>> Please enter the number of distorted structures for each deformation type [odd number > 4]: 9
Number of distorted structures is 9
$
In this example, the (on screen) input entries are preceded by the symbol »». The entry values must be typed on the screen when requested. The first entry (in our example 0.060) represents the absolute value of the maximum strain for which we want to perform the calculation. The second entry (9) is the number of deformed structures equally spaced in strain, which are generated between the maximum negative strain and the maximum positive one.
The script generates some new directories and files, which you can list with the command (in the ElaStic_diamond directory):
$ ll
drwxr-xr-x 6 exciting exciting 4096 2010-11-10 16:57 ./
drwxr-xr-x 44 exciting exciting 4096 2010-11-10 16:57 ../
-rw-r--r-- 1 exciting exciting 5556 2010-11-10 16:57 Distorted_Parameter
drwxr-xr-x 11 exciting exciting 4096 2010-11-10 16:57 Dst01/
drwxr-xr-x 11 exciting exciting 4096 2010-11-10 16:57 Dst02/
drwxr-xr-x 11 exciting exciting 4096 2010-11-10 16:57 Dst03/
-rw-r--r-- 1 exciting exciting 243 2010-11-10 16:57 INFO_ElaStic
-rw-r--r-- 1 exciting exciting 1068 2010-11-10 16:57 input.xml
-rw-r--r-- 1 exciting exciting 6555 2010-11-10 16:57 sgroup.out
drwxr-xr-x 2 exciting exciting 4096 2010-11-10 16:57 Structures_exciting/
You may also list the single direcories, e.g., if you list Dst01 you will see the following (sub)directories:
$ ll Dst01/
total 44
drwxr-xr-x 11 exciting exciting 4096 2010-11-10 16:57 ./
drwxr-xr-x 6 exciting exciting 4096 2010-11-10 16:57 ../
drwxr-xr-x 2 exciting exciting 4096 2010-11-10 16:57 Dst01_01/
drwxr-xr-x 2 exciting exciting 4096 2010-11-10 16:57 Dst01_02/
drwxr-xr-x 2 exciting exciting 4096 2010-11-10 16:57 Dst01_03/
drwxr-xr-x 2 exciting exciting 4096 2010-11-10 16:57 Dst01_04/
drwxr-xr-x 2 exciting exciting 4096 2010-11-10 16:57 Dst01_05/
drwxr-xr-x 2 exciting exciting 4096 2010-11-10 16:57 Dst01_06/
drwxr-xr-x 2 exciting exciting 4096 2010-11-10 16:57 Dst01_07/
drwxr-xr-x 2 exciting exciting 4096 2010-11-10 16:57 Dst01_08/
drwxr-xr-x 2 exciting exciting 4096 2010-11-10 16:57 Dst01_09/
3. Execute the calculations
To execute the series of calculations, please move to the ElaStic_diamond directory and then run the script exciting_ElaStic_Execute.sh which will produce the following output on the screen:
$ exciting_ElaStic_Execute.sh
+-------------------------------------+
| SCF calculation of Dst01_01 starts. |
+-------------------------------------+
Warning(charge): total charge density incorrect for s.c. loop 0
Calculated : 11.97661243
Required : 12.00000000
real 0m24.506s
user 0m20.581s
sys 0m2.884s
Wed Nov 10 17:11:38 CET 2010
+-------------------------------------+
| SCF calculation of Dst01_02 starts. |
+-------------------------------------+
Warning(charge): total charge density incorrect for s.c. loop 0
Calculated : 11.97656968
Required : 12.00000000
real 0m25.461s
user 0m21.549s
sys 0m2.656s
Wed Nov 10 17:12:03 CET 2010
+-------------------------------------+
| SCF calculation of Dst01_03 starts. |
+-------------------------------------+
*
*
*
After the complete run, the elastic constants can be calculated.
ATTENTION:The computation time necessary for running exciting_ElaStic for the complete calculation of the elastic constants of diamond, is of the order of hour. In order to save time, you could alternatively download here a tar archive with the relevant output files (INFO.OUT and TOTENERGY.OUT for all distorsions).
4. Extract elastic constants
In order to calculate the elastic constants, you should run the script exciting_ElaStic_Result.py:
$ exciting_ElaStic_Result.py
At this point, if you list you will see some new files and directory:
$ ll
total 64
drwxr-xr-x 7 exciting exciting 4096 2010-11-10 18:27 ./
drwxr-xr-x 6 exciting exciting 4096 2010-11-10 18:19 ../
-rw-r--r-- 1 exciting exciting 5556 2010-11-10 16:57 Distorted_Parameter
drwxr-xr-x 11 exciting exciting 4096 2010-11-10 18:27 Dst01/
drwxr-xr-x 11 exciting exciting 4096 2010-11-10 18:27 Dst02/
drwxr-xr-x 11 exciting exciting 4096 2010-11-10 18:27 Dst03/
-rw-r--r-- 1 exciting exciting 2974 2010-11-10 18:27 ElaStic_2nd.out
-rw-r--r-- 1 exciting exciting 2974 2010-11-10 18:27 ElaStic_4th.out
-rw-r--r-- 1 exciting exciting 2974 2010-11-10 18:27 ElaStic_6th.out
drwxr-xr-x 2 exciting exciting 4096 2010-11-10 18:27 Energy-vs-Strain/
-rw-r--r-- 1 exciting exciting 243 2010-11-10 16:57 INFO_ElaStic
-rw-r--r-- 1 exciting exciting 1068 2010-11-10 16:57 input.xml
-rw-r--r-- 1 exciting exciting 6555 2010-11-10 16:57 sgroup.out
drwxr-xr-x 2 exciting exciting 4096 2010-11-10 16:57 Structures_exciting/
The main output files of the script exciting_ElaStic_Result.py are ElaStic_2nd.out, ElaStic_4th.out, and ElaStic_6th.out. These file contains the results for the elastic constants, the different numbers refers to the different order of the polynomial used in the fit (see the tutorial Energy vs. Strain Calculations for more details on the fitting procedure).
5. Post-processing: Visualization tool
The script exciting_ElaStic_Analysis.py allows to represent the dependence of the calculated derivatives of the energy-vs-strain curve on
- the range of points included in the fitting procedure(x axis in xmgrace plots),
- the maximum degree of the polynomial used in the fitting procedure(different colors in xmgrace plots).
The script is executed as follows:
$ exciting_ElaStic_Analysis.py
At this point, three xmgrace plots will appear on your screen automatically. An example is shown in the following plots, corresponding do the deformation Dst01, Dst02, and Dst03, respectively:



As an example, we analize the first plot, corresponding to the distorsion Dst01. The distortion types are listed in the file Distorted_Parameter. By examinating this file, we can see that the Dst01 distorsion corresponds to an applied Lagrangian strain in Voigt notation with the form (η,η,η,0,0,0), where η is a strain parameter. This deformation type is directly connected with the bulk module B0. By analyzing the first plot, we notice that the curves corresponding to the higher order of the polynomial used in the fit shows a horizontal plateau at about 3870-3880 GPa. This can be assumed to be the converged value for the second derivative, from the point of view of the fit. For this distorsion type, this value equals 9 times the bulk modulus. Thus, the extracted value of the bulk modulus is 430-431 GPa.
Experimental reference values for diamond:
- C11 = 1076 GPa
- C12 = 125 GPa
- C44 = 577 GPa
- B0 = 452 GPa
6. Set up the calculation for Mg
In the next example, we consider the calculation of the elastic constants of hexagonal Mg.
First, create a new directory ElaStic_Mg and we move inside it:
$ mkdir ElaStic_Mg
$ cd ElaStic_Mg
Inside this directory, we create the file input.xml corresponding to a calculation for the equilibrium structure of Mg. 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>Mg: equilibrium structure</title> <structure speciespath="/local_path_to_exciting_root/species"> <crystal scale="6.056"> <basevect> 1.000000000 0.0000000000 0.0000000000 </basevect> <basevect> -0.500000000 0.8660254040 0.0000000000 </basevect> <basevect> 0.000000000 0.0000000000 1.6152520200 </basevect> </crystal> <species speciesfile="Mg.xml" rmt="2.0"> <atom coord="0.66666666 0.33333334 0.75000000"/> <atom coord="0.33333334 0.66666666 0.25000000"/> </species> </structure> <groundstate ngridk="8 8 8" xctype="GGAPerdew-Burke-Ernzerhof" stype= "Methfessel-Paxton 1" swidth="0.010" epspot="1e-06" gmaxvr="18" rgkmax="9.0"> </groundstate> <structureoptimization></structureoptimization> </input>
We generate a set of exciting input files with the command:
$ exciting_ElaStic_Setup.py
>>>> Please enter maximum Lagrangian strain [suggested value is between 0.030 and 0.100]: 0.070
Maximum Lagrangian strain is 0.07
>>>> Please enter the number of distorted structures for each deformation type [odd number > 4]: 15
Number of distorted structures is 15
$
The computation time necessary for running exciting_ElaStic for the complete calculation of the elastic constants of Mg, is of the order of several hours. In order to save time, you could alternatively download here a tar archive with the relevant output files (INFO.OUT and TOTENERGY.OUT for all distorsions).
After that, you will get a tar file, go to the directory where you saved the tar file and execute the following commands:
$ tar xfvp ElaStic_Mg_Download.tar
$ cd ElaStic_Mg_Download
Now, the analysis of the results can be made, as in the previous example, using the scripts:
$ exciting_ElaStic_Result.py
$ exciting_ElaStic_Analysis.py