Plotting electrostatic potentials

Anybody know how to plot colorized electrostatic potentials using Q-Chem data?

IQmol can automatically generate these plots based on atomic Mulliken charges. But if we want to plot the actual, grid-based ESP data from Q-Chem, how is this task accomplished?

  • IQmol can read cube file data, but I can’t seem to determine how to plot the ESP data there.
  • VMD can ostensibly handle this task (see https://www.ks.uiuc.edu/Research/vmd/minitutorials/colorbypot/ ), but all of my attempts led to single-color plots and oddly shaped densities. Is it possible in VMD, for example, to plot an isosurface of the density but color it from another cube file’s data?

Thanks!

Hi Ryan,

I was wondering about the same question about one year ago and I figured out the way to do this. First, you need to run a calculation with ESP_GRID = -1 and MAKE_CUBE_FILES = TRUE, as well as a $plots section. Here is an example:

$molecule
0 1
C      0.0000000000    1.1875260400   -0.9222574453
H      0.0000000000    2.1040448420   -0.3278874451
H      0.8829100000    1.1527498559   -1.5686567469
H     -0.8829100000    1.1527498559   -1.5686567469
C      0.0000000000    0.0000000000    0.0000000000
O      0.0000000000   -0.0000000000    1.1898062021
Cl     0.0000000000   -1.5820990033   -0.9145005744
$end

$rem
JOBTYPE  SP  
METHOD  B3LYP
BASIS  6-31G(D)
SYMMETRY  FALSE
SYM_IGNORE  TRUE
SCF_CONVERGENCE  8
ESP_GRID  -1  
MAKE_CUBE_FILES   TRUE
$end

$plots
plot the ESP 
100  -4.0  4.0 
100  -5.0  5.0 
100  -5.0  5.0 
0 0 0 0 
0
$end

After the calculation is done, a directory “xxx.plots” should appear in your working directory, which contains a cube file. You can then generate the ESP plot using IQmol:
(i) Open the cube file using IQmol, and then under “Surfaces”, you can calculate a vdW surface with a scaling factor you choose
(ii) Then double-click the generated “van der Waals” surface, and under the dropdown menu of “Property”, you can choose the “Cube Data” option, which will then give you the colored ESP contour plot. By double-clicking the color bar you can also switch to the widely used rainbow (called “spectrum”) color scheme.

Hope this helps.

Yuezhi

1 Like

Thanks, Yuezhi! That’s great info to know.

The one remaining hiccup is that this color map can’t be placed on an isosurface of the actual electronic density (say, from a density cube file or the IQmol-computed total density surface). If Andrew happens to see this thread…is this something that we could add to IQmol? i.e., plot a surface from one cube file and colorize from another? Or add the cube-file coloring option to total density surfaces generated by IQmol, in the manner described by Yuezhi?

After fiddling with VMD, I can get it to colorize according to the ESP (from a cube) on top of an isosurface of the density (also from a cube). The transition between colors seems to occur in a strangely narrow window, but I think we can get it to work.

Here’s the process…

  • Load the density cube file
  • Add an isosurface of the density
  • In the vmd prompt, “mol addfile esp.1.cube” (or similar)
  • Change Coloring Method of the isosurface to “volume”
  • For the Volume coloring method, choose the esp cube file
    For the Drawing method, keep the density as the isosurface file
  • Switch to the Trajectory tab, and set the data range
  • In Graphics → Colors, shift the midpoint until things look reasonable

*In my case, I had to dial back the maximum value of the Color Scale Data Range considerably. Otherwise, the spread is too large to capture the transitions. I think that VMD’s “autorange” feature is choosing the range based on the extrema of the entire cube file (some of which are huge near the nuclei), rather than the extreme values on the generated isosurface.

Hi Ryan,

If you want to colour the density surface with a cube file property, then you need to setup the directory structure in a particular way. For example, if you have the following set up:

methanol/methanol.inp
methanol/methanol.out
methanol/methanol.fchk
methanol/methanol.1.cube

you can use the ‘File → Open Dir’ menu option to open the methanol directory and IQmol will load all the files in that directory with the same base name, (i.e. methanol/methanol.*). Plot the SCF density as you would normally (using the fchk data) and double-click the ‘Total Density’ item in the ‘Model View’ to bring up the configurator dialog. The cube file data will appear as one of the options in the ‘Property’ combo box.

If you don’t like the colour scheme, you can click on the colour panel in the surface configurator dialog and edit it.

The process is quite general, so you can colour the vdW surface with cube data as well. If you had another cube file in the directory with a transition density, you could plot the transition density and colour it with the ESP, or you could colour the SCF density with a transition density and spend the rest of the day working out what it meant.

1 Like

Awesome…thanks, Andrew! The directory/naming setup was the piece that I was missing. I appreciate the info.

Happy holidays to you and Yuezhi!

Thanks, Andrew. I learned something new too.

Wish you both happy holidays!

Yuezhi