Elements Tool

The elements tool is a python program for calculating the bulk modulus of pure bulk materials. It also helps to find a converged set of calculation parameters in order to maximize accuracy.


- Python 2.6
- Python libraries: numpy, matplotlib(optional)
- xsltproc

Get the scripts

At first you have to download a bunch of python scripts and xml templates.
Download and unpack in your preferred location: elements.tgz .


The elements.py tool is called with one argument to specify the input file. The input file must define the element object according to the following specifications.

python /path/to/script/elements.py config.py

where config.py would look like:

                'param': { 
                             'scale' : { 
                                          'azero': 4.319, 
                                          'da': 0.05, 
                                          'steps': 11},
                             'rmt': [2.85],
                             'rgkmax': [6,7,8,9,10],
                             'ngridk' : [8],
                             'swidth': [0.01],
                             'covera' :{ 
                                          'coverazero': 1.6,  
                                          'dcovera': 1.6/50, 
                                          'steps': 11 } 
                'species': 'Be',
                'mod': 'eos',
                'speciespath': "/appl/EXCITING/versions/hydrogen/species/",

Element Object

The element object is defined as a nested dictionary as it is part of the python language. A dictionary is a list of key-value pairs. The values however may be lists themselves, even lists of key-value pairs.

for the element object the following keywords are defined ( * means required):

param *
Is a list of key value pairs used to specify calculation parameters which are meant to be varied (See below).
species *
string containing the two letter abbreviation defining the chemical element
structure *
one of ['hcp','hex','fcc','bcc','diamond']
mod *
one of ['eos','simple_conv']
path to the exciting species definition files. defaults to http://xml.exciting-code.org/species
path to directory where calculations are performed and results will be located. defaults lo "./"
one of ['True','False']. If false a dry run is performed without starting exciting. Defaults to "True"
specifies template o create exec script. This allows adapting the program to differrent hpc computing environments. defaults to "shelcommand.xsl". Other option is "loadleveler.xsl" or anny customized template in the templates directory.

Param Object

the param object allows for specification of the following fields.

scale *
unit cell scaling (list) or specifications to calculate a series
muffin tin radius (list). Overrides rmt in species definition.
rgkmax *
cutoff parameter (list)
ngridk *
k point grid (list)
swidth *
smearing parameter (list)
covera *
covera ratio (list) or specifications to calculate covera according to the crystal type

each of them may be a list of numerical values instead of a number. Except covera ans scale may have optionally a more resolved structure.


coverazero *
c/a ratio
dcovera *
steps in c/a
steps *
number of steps


azero *
lattice parameter [Bohr]
da *
steps size [Bohr]
steps *
number of steps


as the configuration file is python, it is possible to use any valid python expressions to generate the lists.

 'rgkmax': np.arange(8,10,0.5)


After the setup of the input files elements.py needs to care about the calculations. In order to adapt this to different HPC environments the elements tool uses templates to create scripts that can be easily adapted for different situations e.g. cluster schedulers. The user must adapt the templates to fit the current exciting installation.

The simplest example is a script for sequential execution on a local machine. The template is located in templates/shelcommand.xsl. The interesting snipped the user may change is:

cd -

This is the commands that are executed in the directories where the input files are located. The user must change the path of the executable to fit his exciting installation.

If a cluster with a scheduling service is available the themplate could generate a script that allows for parallel execution on the whole cluster. One example of which is the loadleveler.xsl template

Data Analysis

The collect_data script will extract energy values and perform the Birch-Murnaghan fit, giving equilibrium values of volume, energy, bulk modulus and its first derivative.
From within your calculation directory execute:

$ python ~elements/collect_data.py

Simple convergence?


$ python ~elements/plot.py

A shell prompt will appear. Typing eos will start a interactive plotting window.
What do you want to plot?
For energy vs. volume type: eos
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License