10.5 Visualizing and Plotting Orbitals, Densities, and Other Volumetric Data

10.5.3 Generation of Volumetric Data Using $plots

The simplest way to visualize the charge densities and molecular orbitals that Q-Chem evaluates is via a graphical user interface, such as those described in the preceding section. An alternative procedure, which is often useful for generating high-quality images for publication, is to evaluate certain densities and orbitals on a user-specified grid of points. This is accomplished by invoking the $plots option, which is itself enabled by requesting IANLTY = 200.

The format of the $plots input is documented below. It permits plotting of molecular orbitals, the SCF ground-state density, and excited-state densities obtained from CIS, RPA or TDDFT/TDA, or TDDFT calculations. Also in connection with excited states, either transition densities, attachment/detachment densities, or natural transition orbitals (at the same levels of theory given above) can be plotted as well.

By default, the output from the $plots command is one (or several) ASCII files in the working directory, named plot.mo, etc.. The results then must be visualized with a third-party program capable of making 3-D plots. (Some suggestions are given in Section 10.5.4.)

An example of the use of the $plots option is the following input deck:

Example 10.8  A job that evaluates the H2 HOMO and LUMO on a 1×1×15 grid, along the bond axis. The plotting output is in an ASCII file called plot.mo, which lists for each grid point, x, y, z, and the value of each requested MO.

$molecule
   0  1
   H   0.0   0.0   0.35
   H   0.0   0.0  -0.35
$end

$rem
   METHOD     hf
   BASIS      6-31g**
   IANLTY     200
$end

$plots
   Plot the HOMO and the LUMO on a line
   1   0.0   0.0
   1   0.0   0.0
  15  -3.0   3.0
   2   0   0   0
   1   2
$end

General format for the $plots section of the Q-Chem input deck.

$plots
        One comment line
        Specification of the 3-D mesh of points on 3 lines:
               Nxxminxmax
               Nyyminymax
               Nzzminzmax
        A line with 4 integers indicating how many things to plot:
               NMONRhoNTransNDA
        An optional line with the integer list of MO’s to evaluate (only if NMO>0)
               MO(1)  MO(2) MO(NMO)
        An optional line with the integer list of densities to evaluate (only if NRho>0)
               Rho(1)  Rho(2) Rho(NRho)
        An optional line with the integer list of transition densities (only if NTrans>0)
               Trans(1)  Trans(2) Trans(NTrans)
        An optional line with states for detachment/attachment densities (if NDA>0)
               DA(1)  DA(2) DA(NDA)
$end

Line 1 of the $plots keyword section is reserved for comments. Lines 2–4 list the number of one dimension points and the range of the grid (note that coordinate ranges are in Ångstroms if INPUT_BOHR is not set, while all output is in atomic units). Line 5 must contain 4 non-negative integers indicating the number of: molecular orbitals (NMO), electron densities (NRho), transition densities and attach/detach densities (NDA), to have mesh values calculated.

The final lines specify which MOs, electron densities, transition densities and CIS attach/detach states are to be plotted (the line can be left blank, or removed, if the number of items to plot is zero). Molecular orbitals are numbered 1Nα,Nα+1Nα+Nβ; electron densities numbered where 0= ground state, 1 = first excited state, 2 = second excited state, etc.; and attach/detach specified from state 1NDA.

By default, all output data are printed to files in the working directory, overwriting any existing file of the same name.

  • Molecular orbital data is printed to a file called plot.mo

  • Densities are plotted to plots.hf

  • Restricted unrelaxed attachment/detachment analysis is sent to plot.attach.alpha and plot.detach.alpha;

  • Unrestricted unrelaxed attachment/detachment analysis is sent to plot.attach.alpha, plot.detach.alpha, plot.attach.beta and plot.detach.beta

  • Restricted relaxed attachments/detachment analysis is plotted in plot.attach.rlx.alpha and plot.detach.rlx.alpha;

  • Unrestricted relaxed attachment/detachment analysis is sent to plot.attach.rlx.alpha, plot.detach.rlx.alpha, plot.attach.rlx.beta and plot.detach.rlx.beta.

Output is printed in atomic units, with coordinates first followed by item value, as shown below:

x1   y1   z1      a1   a2  ...  aN
x2   y1   z1      b1   b2  ...  bN
...

Instead of a standard one-, two-, or three-dimensional Cartesian grid, a user may wish to plot orbitals or densities on a set of grid points of his or her choosing. Such points are specified using a $grid input section whose format is simply the Cartesian coordinates of all user-specified grid points:

x1   y1   z1
x2   y2   z2
...

The $plots section must still be specified as described above, but if the $grid input section is present, then these user-specified grid points will override the ones specified in the $plots section.

The Q-Chem $plots utility allows the user to plot transition densities and detachment/attachment densities directly from amplitudes saved from a previous calculation, without having to solve the post-SCF (CIS, RPA, TDA, or TDDFT) equations again. To take advantage of this feature, the same Q-Chem scratch directory must be used, and the SKIP_CIS_RPA $rem variable must be set to TRUE. To further reduce computational time, the SCF_GUESS $rem can be set to READ.

SKIP_CIS_RPA
       Skips the solution of the CIS, RPA, TDA or TDDFT equations for wave function analysis.
TYPE:
       LOGICAL
DEFAULT:
       FALSE
OPTIONS:
       TRUE / FALSE
RECOMMENDATION:
       Set to true to speed up the generation of plot data if the same calculation has been run previously with the scratch files saved.

10.5.3.1 New $plots input

New format for the $plots section provides readable and friendly input for generation of volumetric data. The input section can be divided into three parts. The first part contains basic plot options which define the 3-D mesh of points. The second part contains the selection of densities or orbitals. The advanced options are included in the last part.

With new plot format, there are multiple ways to define 3-D mesh points. If no plot option is given, the boundaries of the mesh box are the maximum/minimum molecular coordinates ±3.0 Å. The default box can be simply enlarged or reduced by setting grid_range to a value larger or smaller than 3.0 (negative number is accepted), respectively. To customize the mesh box, set grid_range to desired boundaries:

$plots
  grid_range (-1,1)  (-1,1)  (-1,1)
$end

This defines a 2×2×2 mesh box centered at the molecular coordinate origin. Note that there is no space in the parentheses.

The number of one dimension points is the value of the box length divided by grid_spacing. The default grid point spacing is 0.3 Å. To override the usage of grid_spacing and customize the number of 3-D points, set grid_points to desired values.

To generate cube file (Section 10.5.4) using new plot format, just set MAKE_CUBE_FILES to TRUE in $rem section. The new plot format is enabled by requesting PLOTS = 1.

Table 10.3: Options for new $plots input section
Option Explanation
Basic plot options
grid_range boundaries of the mesh box or increment/decrement in the default boundaries in Å
grid_spacing grid point spacing in Å
grid_points Nx Ny Nz
Density/orbital selection
alpha_molecular_orbital an integer range of alpha MO’s to evaluate
beta_molecular_orbital an integer range of beta MO’s to evaluate
total_density an integer range of total densities to evaluate
spin_density an integer range of spin densities to evaluate
transition_density an integer range of transition densities to evaluate
natural_transition_orbitals an integer range of excited states whose NTOs are evaluated
attachment_detachment_density an integer range of det.-att. densities to evaluate
natural_bond_orbitals an integer range of NBOs for each state to evaluate
nbo_state an integer range of states whose NBOs are evaluated
Advanced options
reduced_density_gradient invoke non-covalent interaction (NCI) plot
orbital_laplacians evaluate orbital Laplacians
average_local_ionization evaluate average local ionization energies883 with a given contour value of the electron density. The default is 0.0135e/Å3 (0.002e/a03).
elf invoke electron localization function (ELF) plots
the format: (xmin,xmax)(ymin,ymax)(zmin,zmax)
the default is 3.0 Å increment in the boundaries derived from the molecular coordinates
the default is 0.3 Å; it can be overridden by option ’grid_points’
input format: n-m or n, indicating n-th oribtal or state; use 0 for the ground-state

Example 10.9  Generating the cube files: the total densities of the ground and the first two excited states, the transition and detachment/attachment densities of the first two excited states, and the 28th to 31th alpha molecular orbitals, with customized 3-D mesh box and points.

$molecule
0 1
  C    0.0000000   -0.0000000   -0.6133791
  O   -0.0000000    0.0000000    0.6060734
  H    0.0000000    0.9391300   -1.1555819
  H    0.0000000   -0.9391300   -1.1555819
$end

$rem
   METHOD           cis
   BASIS            6-31+G*
   CIS_N_ROOTS      4
   CIS_TRIPLETS     false
   MAKE_CUBE_FILES  true   ! triggers writing of cube files
   PLOTS            true
$end

$plots
   grid_range                     (-8,8) (-8,8) (-8,8)
   grid_points                    40 40 40
   total_density                  0-2
   transition_density             1-2
   attachment_detachment_density  1-2
   alpha_molecular_orbital        28-31
$end

Example 10.10  Generating the cube files of the average local ionization energies and the total density for the ground state of aniline.

$molecule
0 1
  H        -2.952725   -0.026758    0.000000
  C        -1.871492   -0.010683    0.000000
  C        -1.172124   -0.001127   -1.197270
  H        -1.709244   -0.009471   -2.137819
  C         0.211522    0.017487   -1.202676
  H         0.754733    0.024328   -2.137945
  C         0.916518    0.025234    0.000000
  N         2.357874    0.119819    0.000000
  H         2.747183   -0.346427   -0.829920
  H         2.747183   -0.346427    0.829920
  C         0.211522    0.017487    1.202676
  H         0.754733    0.024328    2.137945
  C        -1.172124   -0.001127    1.197270
  H        -1.709244   -0.009471    2.137819
$end

$rem
   EXCHANGE         hf
   BASIS            6-31g*
   MAKE_CUBE_FILES  true
   PLOTS            true
$end

$plots
   grid_spacing   0.1
   total_density  0
   average_local_ionization
$end