Friday, June 3, 2016

Generate CUBE files in GAMESS

GAMESS can generate CUBE files of various computable properties so you can visualize the results in programs like Avogadro or GaussView.

Here, I'll show how to compute the density of a methanol molecule since I struggled to generate the grid in the right way (the INPUT description was not exactly helpful).

The input file is

if run through GAMESS you'll get the usual output file, but more importantly in your user scratch space you'll get a .dat file too. This file contains the CUBE data we requested. Just search for START to locate where the CUBE file starts, extract that and change the file extension to .cube. This file can automatically be loaded into Avogadro where you can create a surface of the data to get something like the following

EDIT: A note on the $GRID section in the input file. One selects an origin through the ORIGIN(1) keyword. When selecting the vectors for the box, one must provide the coordinate of the X, Y and Z corners and not just the change in vector. You can see that XVEC(1)=6,5,4 which tells GAMESS that the vector that takes us from ORIGIN(1) to XVEC(1) is 8,0,0. I spent a good 20 minutes trying to figure out what the problem was since I thought that one should specify 8,0,0 and not 6,5,4 in XVEC. Oh well.


  1. Thanks for posting this. I realise it is a fairly old post, but can I ask why have you define a grid in this way? How did you pick the origin and extent of the grid? Looking at your molecule it would seem that you could for example have set the origin at say (0, 0, 1) and the XVEC (-4, 0, 0) YVEC (0, 3, 0) and ZVEC (0, 0, -2) This should cover your molecules using far fewer points. Have I missed something about how you set up these grids?

  2. Thanks for making the honest attempt to speak about this. I believe very robust approximately it and want to read more. If it’s OK, as you gain more in depth wisdom, would you thoughts adding extra articles similar to this one with additional information? It might be extremely useful and useful for me and my friends. data science from scratch