EMTO Tutorial – Get started

This tutorial is written by Wei Li.

This EMTO tutorial is meant for new users of EMTO and only focus on "how". If you are interested with the theory behind EMTO-CPA code please reading the Book by Professor Levente Vitos (find link below).

EMTO-CPA is an all-electron density functional theory code based on using the Exact Muffin-Tin Orbitals (EMTO) formalism used in materials science to represent the single-electron wave functions for the optimised overlapping muffin-tin (OOMT) potential. The total energy is calculated with the Full Charge Density (FCD) technique.

This combination makes the code nearly as accurate as the full-potential methods, but still keeps its computational efficiency. It also incorporates the Coherent Potential Approximation (CPA) to handle the effects of chemical and magnetic disorder. EMTO-CPA code was created at KTH Royal Institute of Technology in Stockholm by Prof. Levente Vitos and his co-workers since 2000. It has been widely used to explore and design complex alloy systems, especially stainless steels and high entropy alloys (HEA) / Multi-Principal Element Alloys (MPEA).

ENCCS currently provides support and contributes to the development under EMTO's license through a proof of concept (POC) project.

Goal of this tutorial

  1. Run the code.
  2. Get equation of state of FCC Cu.

Links

Units:
• length: Bohr
• energy: Rydberg

Wigner–Seitz Radius

EMTO input file follows a very strict format, even one extra space may causes problems. Please use replace in the editor when you manually modify the input values.


EMTO Subprograms & Execution Dependency

Executables with detailed input/output files

exefunction
bmdlCalculates the Madelung potentials
kstrComputes the energy dependent slope matrix in real space.
shapeComputes the so called shape function, which transforms any integral over the unit cell into an integral over a sphere surrounding the unit cell.
kgrn_cpaSolves the actual self-consistent Kohn-Sham equations And calculate the Full charge density
kfcd_cpaEvaluate the total energy functional from the full charge density generated by kgrn

Example: FCC Cu

Run the Subprograms

Prepare your inputs like below: (create the folders and copy the dat file into them)

tree
.
├── bmdl
   ├── fcc.dat
   └── mdl/
├── kfcd
   └── cu.dat
├── kgrn
   ├── chd/
   ├── cu.dat
   └── pot/
├── kstr
   ├── fcc.dat
   └── smx/
└── shape
    ├── fcc.dat
    └── shp/

10 directories, 5 files
Bash
exe < inp.dat
Bash

e.g. in the kstr folder.

kstr < fcc.dat
Bash

Run each emto subprogram following the dependency shown in section Execution Flow above.
You will get all outputs as below:

tree
.
├── bmdl
   ├── fcc.dat
   ├── fcc.prn
   └── mdl
       └── fcc.mdl
├── kfcd
   ├── cu.dat
   └── cu.prn
├── kgrn
   ├── chd
      └── cu.chd
   ├── cu.dat
   ├── cu.prn
   └── pot
       ├── cu.atm
       ├── cu.pot
       └── cu.zms
├── kstr
   ├── fcc.dat
   ├── fcc.prn
   └── smx
       └── fcc.tfh
└── shape
    ├── fcc.dat
    ├── fcc.prn
    └── shp
        └── fcc.shp

10 directories, 17 files
Bash

Extract Useful Information

Check the Convergence

cd kgrn
Bash

In the cu.dat the energy tolerance is set to TOLE...= 1.d-07, and tolerance for Fermi level is set to TOLEF.= 1.d-07 (line#23).

grep -n TOLE cu.dat
23:TOLE...= 1.d-07 TOLEF.= 1.d-07 TOLCPA= 1.d-06 TFERMI=  500.0 (K)
Bash

Let’s check if the calculation reaches the criteria.

 grep erren cu.prn
Bash
output
KGRN:  Iteration no.   1 Etot =     -103.063287 erren = 1.00000000
KGRN:  Iteration no.   2 Etot =     -102.857445 erren = 0.20584215
KGRN:  Iteration no.   3 Etot =     -102.856273 erren = 0.00117217
KGRN:  Iteration no.   4 Etot =     -102.856379 erren = 0.00010572
KGRN:  Iteration no.   5 Etot =     -102.856351 erren = 0.00002778
KGRN:  Iteration no.   6 Etot =     -102.856288 erren = 0.00006265
KGRN:  Iteration no.   7 Etot =     -102.856909 erren = 0.00062120
KGRN:  Iteration no.   8 Etot =     -102.857487 erren = 0.00057781
KGRN:  Iteration no.   9 Etot =     -102.858399 erren = 0.00091236
KGRN:  Iteration no.  10 Etot =     -102.858455 erren = 0.00005586
KGRN:  Iteration no.  11 Etot =     -102.858537 erren = 0.00008201
KGRN:  Iteration no.  12 Etot =     -102.858552 erren = 0.00001434
KGRN:  Iteration no.  13 Etot =     -102.858553 erren = 0.00000134
KGRN:  Iteration no.  14 Etot =     -102.858553 erren = 0.00000025
KGRN:  Iteration no.  15 Etot =     -102.858553 erren = 0.00000007
KGRN:  Iteration no.  16 Etot =     -102.858553 erren = 0.00000000
KGRN:  Iteration no.  17 Etot =     -102.858553 erren = 0.00000001
KGRN:  Iteration no.  18 Etot =     -102.858553 erren = 0.00000001
KGRN:  Iteration no.  19 Etot =     -102.858553 erren = 0.00000001
Bash
grep erref cu.prn
Bash
output
Dyson loops    32 EF   =       -0.078518 erref = 0.07575668
Dyson loops    32 EF   =       -0.080007 erref = 0.18907543
Dyson loops    32 EF   =       -0.083393 erref = 0.03030721
Dyson loops    32 EF   =       -0.085897 erref = 0.00272249
Dyson loops    32 EF   =       -0.088113 erref = 0.00236061
Dyson loops    32 EF   =       -0.090461 erref = 0.00229151
Dyson loops    32 EF   =       -0.092218 erref = 0.00199204
Dyson loops    32 EF   =       -0.093602 erref = 0.00140372
Dyson loops    32 EF   =       -0.092772 erref = 0.00065422
Dyson loops    32 EF   =       -0.092529 erref = 0.00056859
Dyson loops    32 EF   =       -0.092504 erref = 0.00005250
Dyson loops    32 EF   =       -0.092498 erref = 0.00000803
Dyson loops    31 EF   =       -0.092499 erref = 0.00000015
Dyson loops    23 EF   =       -0.092497 erref = 0.00000142
Dyson loops    26 EF   =       -0.092497 erref = 0.00000013
Dyson loops    12 EF   =       -0.092498 erref = 0.00000037
Dyson loops    15 EF   =       -0.092498 erref = 0.00000028
Dyson loops    21 EF   =       -0.092498 erref = 0.00000011
Dyson loops    24 EF   =       -0.092498 erref = 0.00000003
Bash

Let’s check the number of states (NOS) up to Fermi Level is close to the number of total valence electrons in the unit cell. For our calculation, one Cu atom in the unit cell should have 11 Valence electrons.

grep NOS cu.prn
KKRFCD: NOS(Ef) = 11.000000 ELT = 11.000000
KKRFCD: NOS(Ef) = 11.000000 ELT = 11.000000
Bash

Get Total Energy

Most importance results should be the energy, and lets change to kfcd directory and extract them.

cd kfcd
Bash
grep TOT- cu.prn
TOT-LDA    -102.846730 (Ry)    -102.846730 (Ry/site)   S=  2.686842 Bohr
TOT-PBE    -102.559347 (Ry)    -102.559347 (Ry/site)   S=  2.686842 Bohr
TOT-P07    -102.554000 (Ry)    -102.554000 (Ry/site)   S=  2.686842 Bohr
TOT-AM5    -102.550405 (Ry)    -102.550405 (Ry/site)   S=  2.686842 Bohr
TOT-LAG    -102.693623 (Ry)    -102.693623 (Ry/site)   S=  2.686842 Bohr
Bash

Now we get different total energies with different exchange correlation approximations.
S= 2.686842 Bohr shows that we set the average Wigner-Seitz radius in kgrn input file (line#24): SWS......=2.686842.

grep -n SWS kgrn/cu.dat
24:SWS......=2.686842   NSWS.=  1 DSWS..=   0.05 ALPCPA= 0.6020
Bash

Equation of State (EOS)

We need to get curve of SWS (\omega) vs. energy (E), and fit the curve with Morse function:

E(\omega)=a+be^{-\lambda\omega}+ce^{-2\lambda\omega}

EMTO input file follows a very strict format, even one extra space may causes problem. Please use replace in the editor when you manually modify the input values.

Let’s create 5 kgrn input files with different SWS values (also with different JOBNAM):

Make sure kgrn calculations use Soft-Core approximation: SOFC.= Y.

for i in $(seq 2.55 0.05 2.75)
do 
    sws=$(printf %10.8f $i)
    sed -E -e "s/(^SWS\.*)=.{10}/\1=$sws/" \
           -e "s/JOBNAM=.*/JOBNAM=cu$sws/" cu.dat > cu$sws.dat 
done
Bash

Let’s check:

egrep '(JOBNAM)|(^SWS)' cu?*.dat
Bash
output
cu2.55000000.dat:JOBNAM=cu2.55000000
cu2.55000000.dat:SWS......=2.55000000 NSWS.=  1 DSWS..=   0.05 ALPCPA= 0.6020
cu2.60000000.dat:JOBNAM=cu2.60000000
cu2.60000000.dat:SWS......=2.60000000 NSWS.=  1 DSWS..=   0.05 ALPCPA= 0.6020
cu2.65000000.dat:JOBNAM=cu2.65000000
cu2.65000000.dat:SWS......=2.65000000 NSWS.=  1 DSWS..=   0.05 ALPCPA= 0.6020
cu2.70000000.dat:JOBNAM=cu2.70000000
cu2.70000000.dat:SWS......=2.70000000 NSWS.=  1 DSWS..=   0.05 ALPCPA= 0.6020
cu2.75000000.dat:JOBNAM=cu2.75000000
cu2.75000000.dat:SWS......=2.75000000 NSWS.=  1 DSWS..=   0.05 ALPCPA= 0.6020
Bash

Finished these kgrn calculations:

ls cu?*.dat | xargs -P 5 -I {} bash -c "time kgrn_cpa < {}"
Bash

check the output:

egrep '(Converged)|(NOS)|(finished)' cu?*.prn
Bash
output
cu2.55000000.prn: Converged in 19 iterations at 22:05  09-Nov-23
cu2.55000000.prn: KKRFCD: NOS(Ef) = 11.000000 ELT = 11.000000
cu2.55000000.prn: KKRFCD: NOS(Ef) = 11.000000 ELT = 11.000000
cu2.55000000.prn: KGRN calculation finished at 22:05 on 09-Nov-23
cu2.60000000.prn: Converged in 19 iterations at 22:05  09-Nov-23
cu2.60000000.prn: KKRFCD: NOS(Ef) = 11.000000 ELT = 11.000000
cu2.60000000.prn: KKRFCD: NOS(Ef) = 11.000000 ELT = 11.000000
cu2.60000000.prn: KGRN calculation finished at 22:05 on 09-Nov-23
cu2.65000000.prn: Converged in 19 iterations at 22:05  09-Nov-23
cu2.65000000.prn: KKRFCD: NOS(Ef) = 11.000000 ELT = 11.000000
cu2.65000000.prn: KKRFCD: NOS(Ef) = 11.000000 ELT = 11.000000
cu2.65000000.prn: KGRN calculation finished at 22:05 on 09-Nov-23
cu2.70000000.prn: Converged in 20 iterations at 22:05  09-Nov-23
cu2.70000000.prn: KKRFCD: NOS(Ef) = 11.000000 ELT = 11.000000
cu2.70000000.prn: KKRFCD: NOS(Ef) = 11.000000 ELT = 11.000000
cu2.70000000.prn: KGRN calculation finished at 22:05 on 09-Nov-23
cu2.75000000.prn: Converged in 19 iterations at 22:05  09-Nov-23
cu2.75000000.prn: KKRFCD: NOS(Ef) = 11.000000 ELT = 11.000000
cu2.75000000.prn: KKRFCD: NOS(Ef) = 11.000000 ELT = 11.000000
cu2.75000000.prn: KGRN calculation finished at 22:05 on 09-Nov-23
Bash

Let’s create 5 kfcd input files with different JOBNAM (in kfcd directory):

for i in $(seq 2.55 0.05 2.75)
do 
    sws=$(printf %10.8f $i)
    sed -E -e "s/(JOBNAM.*)=.*/\1=cu$sws/" cu.dat > cu$sws.dat 
done
Bash

Finished these kfcd calculations:

ls cu?*.dat | xargs -P 5 -I {} bash -c "time kfcd_cpa < {}"
Bash

check the output:

egrep 'Finished' cu?*.prn
Bash
output
cu2.55000000.prn: KFCD: Finished at: 09-Nov-23  22:41
cu2.60000000.prn: KFCD: Finished at: 09-Nov-23  22:41
cu2.65000000.prn: KFCD: Finished at: 09-Nov-23  22:41
cu2.70000000.prn: KFCD: Finished at: 09-Nov-23  22:41
cu2.75000000.prn: KFCD: Finished at: 09-Nov-23  22:41
Bash

prepare data for Morse EOS fitting (choose PBE functional here):

grep TOT-PBE cu?*.prn
cu2.55000000.prn:    TOT-PBE   -3310.056503 (Ry)   -3310.056503 (Ry/site)   S=  2.550000 Bohr
cu2.60000000.prn:    TOT-PBE   -3310.063412 (Ry)   -3310.063412 (Ry/site)   S=  2.600000 Bohr
cu2.65000000.prn:    TOT-PBE   -3310.066848 (Ry)   -3310.066848 (Ry/site)   S=  2.650000 Bohr
cu2.70000000.prn:    TOT-PBE   -3310.067436 (Ry)   -3310.067436 (Ry/site)   S=  2.700000 Bohr
cu2.75000000.prn:    TOT-PBE   -3310.065767 (Ry)   -3310.065767 (Ry/site)   S=  2.750000 Bohr
Bash

Fit Morse function with the 8th and 5th column:

Apart from EMTO and materials science, ENCCS produces short tutorials on multiple topics related to supercomputing and its use cases. Check other tutorials here.

Categories: