The Electronic Structure Code Class Library (ESCL)

Introduction

In the community of electronic structure code development (this includes, e. g., density functional theory, Monte Carlo, and molecular dynamics) FORTRAN77 and Fortran90 are still the dominating languages. The Electronic Structure Code Class Library (ESCL) is an attempt to demonstrate that even this field of software development can benefit from more modern languages and concepts (like C++ and object-oriented programming) that nowadays are common within software development. I won't go into any details about why C++ is advantageous to Fortran, but those of you who know both languages probably agree on that.... Where performance is an issue Fortran is of course still the best way to go. That is, if you don't find an optimized library that does the job for you (like BLAS, LAPACK, FFTW). A common rule of thumb in high-performance computing states that 90 percent of the execution time is spent in 10 percent of the code. And vice versa. Why not write the 90 percent in C++ and use optimized libraries plus Fortran for the rest?

The ESCL so far contains classes related to setting up the crystal lattice with a basis, symmetry check, and some classes that make file handling and input processing a little more convenient. It's only a start and far from complete. If you think that sounds interesting just download the source and have a look. It shouldn't be too difficult to compile the library, although it doesn't come with a configure script yet, so you might have to edit the makefile. The sources are quite well documented and there's also a documentation generated by doxygen. Future plans include adding classes for atoms and electronic states, k-point meshes, setting up Hamiltonians and overlap matrices, and everything else that might be needed in an electronic structure code.

The ESCL is released under the GNU General Public License. I would appreciate if you send me an email if you find the ESCL useful, or if you have any thoughts, comments, or suggestions. The library comes with a tool, called checklattice, to illustrate its usage. checklattice reads a lattice and a basis from an input file and looks for symmetries. Here is an example of an input file and the output that checklattice yields:

Input:

 !BRAVAIS
 stet 1 1.3
 !BASIS
 0.0 0.0 0.0 Fe
 0.5 0.5 0.5 Pt
 

Output:

 checklattice, linked with ESCL 0.1.0

 Bravais lattice:
 ----------------
 Lattice type: simple tetragonal
 Length scale: 1
 Unit cell volume: 1.3
 Lattice vectors /length_scale (in rows):
    1.0000000000000   0.0000000000000   0.0000000000000
    0.0000000000000   1.0000000000000   0.0000000000000
    0.0000000000000   0.0000000000000   1.3000000000000
 Reciprocal lattice vectors *length_scale/(2*pi) (in rows):
    1.0000000000000   0.0000000000000   0.0000000000000
    0.0000000000000   1.0000000000000   0.0000000000000
    0.0000000000000   0.0000000000000   0.7692307692308

 Basis:
 ------
  Number of species: 2
 Species: Fe Pt
 Number of sites: 2
 1: Fe, 1 sites
    0.0000000000000   0.0000000000000   0.0000000000000
 2: Pt, 1 sites
    0.5000000000000   0.5000000000000   0.5000000000000

 Symmetry:
 ---------
 Number of symmetries: 16
 Number of Bravais lattice symmetries: 16
 Inversion symmetry is included.
 Tried 55 symmetry centers (mode: between three sites).

 Types:
 ------
 Number of types: 2
 1: Fe, 1 sites, 16 symmetries
    0.0000000000000   0.0000000000000   0.0000000000000
 2: Pt, 1 sites, 16 symmetries
    0.5000000000000   0.5000000000000   0.5000000000000

 Done.
 
Also, some short programs that test certain aspects of the library can be found in the directory called test.

Installation

The ESCL has been developed using the GNU Compiler Collection and GNU make. To compile the library simply type make. This will compile the library, some tests, and some tools that are based on the library. To install the library and the header files in $PREFIX/lib and $PREFIX/include/escl, respectively, simply type make install. $PREFIX is set to $HOME but can easily easily be overwritten by typing make install PREFIX=installdir.

Using the ESCL

To use the ESCL include the ESCL header file escl.h in your code:
 #include "escl/escl.h"
 
The namespace is called 'escl'. To link the library add -lescl to your linker command. If the compiler/linker do not find the corresponding files use -I and -L, respectively.

Resources

The ESCL homepage http://escl.sourceforge.net/ and the ESCL project homepage at Sourceforge http://sourceforge.net/projects/escl.

License

The ESCL is released under the GNU General Public License. For details see the file COPYING, or visit http://www.gnu.org/copyleft/gpl.html.

Author

The ESCL is developed by Till Burkert (till.burkert@gmail.com).