Electron Density Plotter
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src
.editorconfig
.gitignore
LICENSE
README.md

README.md

EDP

Introduction

Electron density plotter is a tiny tool for generating electron density plots from VASP output.

CO orbitals generated using EDP

Figure: Four molecular orbitals of CO as generated by EDP.

Obtaining EDP from the repository

Install the GPG key

wget -O - http://www.zuidcoach.nl/repos/apt/conf/ivofilotsoftware.gpg.key|sudo apt-key add -

Add repository

echo "deb http://zuidcoach.nl/repos/apt/debian/ ivofilot-software main" | sudo tee -a /etc/apt/sources.list.d/ivofilot-software.list

Update apt sources and install edp

sudo apt-get update
sudo apt-get install edp

Compilation

EDP depends on a couple of libraries, which are normally directly available by your favorite package manager.

  • Boost
  • GLM
  • Cairo
  • TCLAP

Compilation is done using CMake

mkdir build
cd build
cmake ../src
make -j5

Usage

To run EDP to construct a contour plane, use something like the command below

./edp -i <PATH_TO_CHGCAR> -v <v1,v2,v3> -w <w1,w2,w3> -p <p1,p2,p3> -o plot.png

where v and w correspond to two vectors that will span the plane and p corresponds to a position on that plane. Additionally, you can supply -s to indicate a scaling in pixels/angstrom. Instead of supplying vectors, you can also supply two atoms for the vectors v and w and a single atom for the position p. For example:

./edp -i CHGCAR -v 1-2 -w 0,0,1 -p 1 -o plot.png

There are 16 different color schemes built into EDP, which you can choose using the -c directive. If there are negative values in the density file, use the -n directive. Finally, to create a legend, use the -l directive.

To obtain a concise overview of all the command line directives, you can run

./edp --help

Color schemes

The following color schemes are built into EDP

Color schemes supported by EDP

Tutorial

A short tutorial on using the program is provided in this blog post.

Projections

To obtain an meaningful plane projection, the vectors v and w should be orthogonal to each other. When you are using atoms instead of vectors as input to -v and -w, this is not always the case. Hence, the option to project vector v on w according to the Gram-Schmidt process is provided. To do so, simply add -g as an input directive.

Line extraction

A recently requested feature was to not only construct contour planes from a scalar field, but also allow to project the scalar values onto a line to make a simple graph. To do so, you can use the -e command line parameter followed by either two atoms or a vector. On the line as indicated by the vector and the point supplied by p, the scalar field will be projected and written to the textfile line_extraction.txt which you can then plot. In the file line_extraction.txt, there are four columns which are the Cartesian x,y,z positions and the value at that point.

Below, an example graph is provided which shows the electron density of the 5 sigma orbital of CO projected on the line that crosses both atoms. The x-axis presents the z-position in the unit cell. The C and O atoms are placed at z = 5.00A and z = 6.15A, respectively.

Electron density graph of 5 sigma orbital of CO

References

Color schemes have been taken from the following sources. Details can be found in plotter.cpp.