24 November 2012

281. Visualising NWChem output with GabEdit

Update: please read Karol's comment below. I will put a link here once I've written up a post on how to modify nwchem.

Update 2: Here's the post: http://verahill.blogspot.com.au/2013/02/3xx-modifying-nwchem-611-to-work-with.html .The conclusion is that you MUST edit nwchem. Luckily, it's easy.

Original post:
I've never liked Gabedit much (looks a bit dated, tries to do 'too much') -- until today. Suddenly I have a newfound respect for the developer(s) behind it. It actually doesn't try to do 'too much' -- it simply does A LOT, and actually does it in a pretty transparent way.

Long story short -- you can do things with gabedit which you can't do (easily) with ECCE, and as such it has become an important ally. Besides, it's always nice to have alternatives.

GabEdit is in the Debian repos.

Running your calculations
There are some restrictions"
1. NOTE: you must run your nwchem job with explicit basis sets (i.e. entered as text) -- to do that in ECCE tick the box as shown in the figure below. If you're running 'pure' nwchem, you (probably) have to cut and paste from the basis set directory -- see e.g. section 7.2 here. It's a minor convenience for gaining access to what GabEdit has to offer.

2. You can only open Single point/Energy calculations i.e. Optimizations won't work. So do a single point calculation on your optimized structure.

3. Also, you need to rename/copy your output file so that it ends with .out.
gabedit won't read it otherwise

It's fairly straightforward -- just point and click. One thing which you will want to play with are the iso-surface settings. The defaults are rarely good.

Anyway, I'll let the screenshots do the talking:

Go straight to the Output viewer -- Geometry/Orbital/Density
Click on the M, or right-click anywhere in the window, and load your renamed nwchem output file.

Here's triplet oxygen. The alpha, beta orbitals are listed in the right window

You can do electron localisation

Look at spin density (the unpaired electrons are in the anti-bonding  pi orbitals)

Contour plots are neat -- here showing spin density

Electrostatic potential. 

There's a lot to explore. GabEdit can obviously also prepare and submit jobs, but I'm happy with ECCE in this respect, and content with using GabEdit for post-processing.


  1. Hello,
    I have one important comment:
    The vectors coefficients in the nwchem output are incomplete!
    The default behaviour of nwchem is to print 10 first coefficients with value bigger than 0.15. For systems with many atoms it is not enough, usually its not even close.

    This behaviour is hard-coded in the nwchem source.
    To change this you must search each instance of movecs_print_anal in the source code and replace 0.15d0 for smaller value in appropriate calls.
    Furthermore you must change one loop in the src/ddscf/movecs_pr_anal.F file and around 200 line there will be loop:
    do klo = 0, min(n-1,9), 2
    You must increase the range of this loop, for something more reasonable like:
    do klo = 0, min(n-1,199), 2

    After recompiling the nwchem will print more coefficients and the gabedit will produce more reliable orbitals.

    Best regards,
    Karol Strutynski

    1. Thanks for your comment Karol!

    2. Thanks for your comment Karol.

    3. I just realised that I forgot to thank Karol. Either way, based on his comment I wrote the following post which shows how to modify nwchem to work with gabedit: http://verahill.blogspot.com.au/2013/02/3xx-modifying-nwchem-611-to-work-with.html