Automating the analysis of NEB calculations

by Andrew Peterson

A common task in atomistic reaction engineering is to search for a saddle point on the potential energy surface (the transition state of the minimum energy path) using the Nudged Elastic Band (NEB) method. The implementation of this is in ASE makes it simple to use this method with your electronic structure calculator of choice. However, monitoring the progress of the band -- that is, examining the evolution of the shape of the energy pathway -- can take a lot of back and forth to the GUI with commands such as

ase-gui neb.traj@154:161

which is an example to pull up the 23rd iteration for a 7-image long band. This would be followed by clicking menus in the GUI (Tools > NEB) to produce a plot which shows you the energy path. You often desire to watch the progress of this band as the calculation ensues, requiring many such calls.

Automating this with a script

To get around the tedium of this process, we have a simple script, available here. You run this script in the same directory as your neb calculation, as

./analyze_NEB.py -i 7

where, here, 7 refers to the number of images in your band. (If you leave off this command, it will default to 7 images.) This should produce a "flip-book", of energy plots, one per iteration of your NEB, in a file called all-NEBs.pdf. Each energy plot should look something like the figure below:

NEB_energy

The script assembles this by looking for files of the sort "neb*.traj", then sorting them alphabetically. Thus, if you have restarted your NEB and have many files such as "neb01.traj", "neb02.traj", ..., this should still work nicely. Note if you prefix your files differently, such as with "qn*.traj", you can change this with the "-s" flag.

Options are below:

$ ./analyze_NEB.py -h
Usage: analyze_NEB.py [options]

Options:
  -h, --help     show this help message and exit
  -i IMAGES      number of images per band, default=7
  -s STARTSWITH  NEB traj files start with, default="neb"
  -o OUTPUT      filename (without suffix) for output, default="all-NEBs"