Skip to main content

Crystal structure

Structure databases

Density functional theory (DFT) calculations are ab-initio meaning the calculation is done from the scratch based on given input parameters. We need to provide the crystal structure in order to calculate DFT. Crystal structures are widely available in Crystallographic Information File (.CIF) format. There are several databases where you can look for crystal structures.

In Quantum Espresso, the structure information is provided by ibrav number, and corresponding celldm values or lattice constants and cosines of angle between the axes. It is also possible to set ibrav=0 and provide lattice vectors in CELL_PARAMETERS.


When set ibrav=0, the lattice vectors must be provided with sufficiently large number of decimal accuracy, otherwise symmetry detection may fail and strange problems may arrise.

ibrav numbers for different lattice types:

ibravLattice type
1Simple cubic
2Face centered cubic
3,-3Body centered cubic
5Trigonal with c as 3-fold axis
-5Trigonal with <111> as 3-fold axis
6Simple tetragonal
7Centered tetragonal
8Simple orthorhombic
9,-9,91One-face centered orthorhombic
10Face centered orthorhombic
11Body centered orthorhombic
12Simple monoclinic, c unique
-12Simple monoclinic, b unique
13One base centered monoclinic, c unique
-13One base centered monoclinic, b unique

Useful tools:

Vesta - It helps you visualize crystal structure, create and modify supercells, crystal structures, and many other useful functionalities.

We can prepare our Quantum Espresso input file using cif2cell utility. If you do not have cif2cell installed, you can use pip to install:

sudo pip3 install cif2cell

You may need to add it to the path in your .bashrc manually:

export PATH="/home/pranab/.local/lib/python3.8/site-packages/:$PATH"

Running cif2cell command:

cif2cell file.cif -p quantum-espresso -o


You can explore the crystal structure, find out k-path and many more using Xcrysdens application -

For certain functionality, Xcrysdens requires basic calculator program. On Ubuntu/ Debian:

sudo apt update
sudo apt install bc xcrysden

Manual installation:

# install dependencies
sudo apt install --no-install-recommends bc tk libglu1-mesa libtogl2 \
libfftw3-3 libxmu6 imagemagick openbabel libgfortran5

# download the latest version of xcrysden and extract
tar -zxvf xcrysden-1.6.2-linux_x86_64-shared.tar.gz

# launch (provided you extracted under your home directory)

If you are on WSL, you need to install X-server (X-ming for Windows) on the host and set export DISPLAY=:0 in your WSL instance.

QE Input generator

You can generate PWscf input files using tools in this website as well

The same website also has a tool for k-path visualization and generation