From Johnson Group Wiki
Jump to: navigation, search



Critic2 is a program for the topological anaylisis of real-space scalar fields in periodic systems. The functionality includes Bader's atoms in molecules theory (critical point search, basin integration via different methods, basin plotting,...), analysis of other chemically-interesting fields (e.g. elf, laplacian of the density,...), non-covalent interaction plots (NCIplots), and much more.

Critic2 is designed to provide an abstraction layer on top of the underlying electronic structure calculation. Different methods (FPLAPW, pseudopotentials, local orbitals,...) represent the electron density and other fields in diverse ways. Critic2 interfaces to many of these and applies common techinques and algorithms to them. At the moment of writing this, critic2 can interface to WIEN2k, elk, PI, Quantum ESPRESSO, abinit, VASP, and any program capable of writing the scalar field of interest to a grid.

The electron density is the usual field critic2 works with, but any other (ELF, molecular electrostatic potential,...) can be analysed using the same techniques. Hence, it is possible to compute, for instance, the charges inside the basins of ELF, or the gradient paths of the molecular electrostatic potential. New scalar fields can be computed using critic2's powerful arithmetic expressions.


The latest version of critic2 can be found on github:

Contact: Alberto Otero de la Roza


  • README: this file.
  • AUTHORS: the authors of the package.
  • COPYING: a copy of the licence. Critic2 is distributed under the GNU/GPL license v3.
  • ChangeLog: list of changes by revision.
  • NEWS: a summary of changes from the last stable version.
  • INSTALL: installation instructions.
  • THANKS: acknowledgements.
  • src/: source code.
  • doc/: documentation (user's guide) and syntax reference (syntax.txt).
  • tools/: some tools to work with the files produced by critic2.
  • dat/: atomic density and cif database data.

Compilation and installation

Prepare for compilation doing:


Use configure --help for information about the compilation options. The --prefix option sets the installation path. Once critic2 is configured, compile using:


This should create the critic2 executable inside the src/ subdirectory. The binary can be used directly or the entire critic2 distribution can be installed to the 'prefix' path by doing:

make install

Critic2 is parallelized for shared-memory architectures (unless compiled with --disable-openmp). You modify the number of parallel threads by setting the OMP_NUM_THREADS environment variable. The following are parallelized in critic2:

  • CP search (over starting seeds)
  • Bisection (over integration rays)
  • Generation of 3D grids in CUBE, WRITE,... (over planes)
  • Qtree (over tetrahedra)

Note that the compilation flags for compilers different from ifort and gfortran regarding parallelization may not be correct.

The environment variable CRITIC_HOME is necessary if critic2 was not installed with 'make install'. It must point to the root directory of the distribution:

export CRITIC_HOME=/home/alberto/programs/critic2dir

This variable is necessary for critic2 to find the atomic densities and the cif library data. These should be located in ${CRITIC_HOME}/dat/.

NOTE: older versions of the intel fortran compiler have a bug in how openmp deals with allocatable arrays which affects the qtree integrator and maybe other parts of the code. These problems have been solved in version 13.1. Gfortran 4.9 and later versions compile correctly as far as I know.

Compiling and using libxc

Critic2 can be compiled with libxc support. Libxc is used in critic2 to calculate exchange and correlation energy densities via the xc() function in arithmetic expressions. To do this, the --with-libxc option must be passed to configure:

./configure --with-libxc=/path/to/bleh

Critic2 will assume that the include files (the module files necessary at compile time) are in /path/to/bleh/include and that the static library file (which is linked in critic2) is in /path/to/bleh/lib/libxc.a . These are the standard locations after a successfull 'make install' in libxc configure with --prefix=/path/to/bleh.

See 'Use of LIBXC in arithmetic expressions' in the user's guide for instructions on how to use libxc in critic2.

Use (documentation)

The user's guide is in the doc/ directory in plain text (user-guide.txt) and PDF formats (user-guide.pdf). A concise summary of the syntax can be found in the syntax.txt file. Test cases and input examples for critic2 are provided separately.

Critic2 reads a single input file (the incritic file). A simple input is:

crytal cubicBN.cube
load cubicBN.cube
zpsp B 3 N 5

which reads the crystal structure from a cube file, then the electron density from the same cube file, and then calculates the atomic charges and volumes. Run critic2 as:

critic2 cubicBN.incritic cubicBN.outcritic

A detailed description of the keywords accepted by critic2 is given in the user's guide and a short reference in the syntax.txt file.

References and citation

The basic references for critic2 are:

  • A. Otero-de-la-Roza, E. R. Johnson and V. Luaña, Comput. Phys. Commun. 185, 1007–1018 (2014) link
  • A. Otero-de-la-Roza, M. A. Blanco, A. Martín Pendás and V. Luaña, Comput. Phys. Commun. 180, 157–166 (2009) link

For qtree:

  • A. Otero-de-la-Roza, V. Luaña J. Comput. Chem. 32 (2010) 291–305. link

Topology of the Laplacian:

  • A. Otero-de-la-Roza, V. Luaña J. Chem. Theory Comput. 6 (2010) 3761–3779. link

Copyright notice

Copyright (c) 2013 Alberto Otero de la Roza, Ángel Martín Pendás and Víctor Luaña.

critic2 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

critic2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see

Research Interests
Personal tools