Cube Keyword
Last Update: 6/26/2001

 Description

The Cube properties keyword can be used to evaluate molecular orbitals, the electrostatic potential, the electron density, density gradient, the norm of the density gradient, and Laplacian of the density over a 3 dimensional grid (cube) of points. By default, Cube evaluates the electron density (corresponding to the Density option). Which density is used is controlled by the Density keyword; use Density=Current to evaluate the cube over the density from a correlated or CI-Singles wavefunction instead of the default Hartree-Fock density.

Note that only one of the available quantities can be evaluated within any one job step. Save the checkpoint file (using %Chk), and include Guess=(Read,Only) Density=Checkpoint in the route section of a subsequent job (or job step) in order to evaluate a different quantity without repeating any of the other steps of the calculation.

Gaussian 98 provides reasonable defaults for grids, so Cube no longer requires that the cube be specified by the user. However, the output filename must still always be provided (see below).

Alternatively, Cube may be given a parameter specifying the number of points to use per "side" (the default is 80). For example, Cube=100 specifies a grid of 1,000,000 points (1003), evenly distributed over the rectangular grid generated by the program (which is not necessarily a cube). In addition, the input format used by earlier versions of Gaussian is still supported; Cube=Cards indicates that a grid will be input. It may be used to specify a grid of arbitrary size and shape.

The options Coarse, Medium and Fine may also be specified as the parameter to Cube. They correspond to values of 40, 80 and 100, respectively. These options are designed to facilitate uniform quality in grid sampling across the range of molecular sizes.

The files created by Cube can be manipulated using the cubman utility, described in chapter 5 of the Gaussian 98 manual.

Note that Pop=None will inhibit cube file creation.


 Input Format

When the user elects to provide it, the grid information is read from the input stream. The first line--required for all Cube jobs--gives a file name for the cube file. Subsequent lines, which are included only with Cube=Cards, must conform to format (I5,3F12.6), according to the following syntax:

Output-file-name Required in all Cubejobs.
IFlag, X0, Y0, Z0 Output unit number and initial point.
N1, X1, Y1, Z1 Number of points and step-size in the X-direction.
N2, X2, Y2, Z2 Number of points and step-size in the Y-direction.
N3, X3, Y3, Z3 Number of points and step-size in the Z-direction.

If N1<0 the input cube coordinates are assumed to be in Bohr, otherwise, they are interpreted as Angstroms (this keyword is not affected by the setting of the Units keyword).) |N1| is used as the number of X-direction points in any case. Note that the three axes are used exactly as specified; they are not orthogonalized, so the grid need not be rectangular.

If the Orbitals option is selected, the cube filename (or cube filename and cube specification input) is immediately followed by a list of the orbitals to evaluate, in free-format, terminated by a blank line. In addition to numbers for the orbitals (with 20000002.gif orbitals numbered starting at N+1), the following abbreviations can appear in the list:

HOMO The highest occupied molecular orbital

LUMO The lowest unoccupied molecular orbital

OCCA All occupied (20000001.gif) orbitals

OCCB All 20000002.gif occupied orbitals for UHF

ALL All orbitals

VALENCE All occupied non-core orbitals

VIRTUALS All virtual orbitals


 Output File Formats

Using the default input to Cube produces an unformatted output file (you can use the cubman utility to convert it to a formatted version if you so desire; see chapter 5). When the Cards option is specified, then the IFlag parameter’s sign determines the output file type. If IFlag>0, the output is unformatted. If IFlag&lt0, the output is formatted. All values in the cube file are in atomic units, regardless of the input units.

For density and potential grids, unformatted files have one row per record (i.e., N1*N2 records each of length N3). For formatted output, each row is written out in format (6E13.5). In this case, if N3 is not a multiple of six, then there may be blank space in some lines.

The norm of the density gradient is also a scalar (i.e., one value per point), and is written out in the same manner. Density+gradient grids are similar, but with two writes for each row (of lengths N3 and 3*N3). Density+gradient+Laplacian grids have 3 writes per row (of lengths N3, 3*N3, and N3).

For example, for a density cube, the output file looks like this:

NAtoms, X-Origin, Y-Origin, Z-Origin
N1, X1, Y1, Z1              # of increments in the slowest running direction
N2, X2, Y2, Z2
N3, X3, Y3, Z3              # of increments in the fastest running direction
IA1, Chg1, X1, Y1, Z1       Atomic number, charge, and coordinates each atom
...
IAn, Chgn, Xn, Yn, Zn       
(N1*N2) records (length N3) Values of the density at each point in the grid

Note that a separate write is used for each record.

For molecular orbital output, NAtoms will be less than zero, and an additional record follows the data for the final atom (in format 10I5 if the file is formatted):

NMO, (MO(I),I=1,NMO)      Number of MOs and their numbers

If NMO orbitals were evaluated, then each record is NMO*N3 long and has the values for all orbitals at each point together.


 Reading Cube Files With Fortran Programs

If one wishes to read the values of the density, Laplacian, or potential back into an array dimensioned X(N3,N2,N1) code like the following Fortran loop may be used:

    Do 10 I1 = 1, N1
    Do 10 I2 = 1, N2
       Read(n,'(6E13.5)') (X(I3,I2,I1),I3=1,N3)
10  Continue

where n is the unit number corresponding to the cube file.

If the origin is (X0,Y0,Z0), and the increments (X1,Y1,Z1), then point (I1,I2,I3) has the coordinates:

X-coordinate: X0+(I1-1)*X1+(I2-1)*X2+(I3-1)*X3
Y-coordinate: Y0+(I1-1)*Y1+(I2-1)*Y2+(I3-1)*Y3
Z-coordinate: Z0+(I1-1)*Z1+(I2-1)*Z2+(I3-1)*Z3

The output is similar if the gradient or gradient and Laplacian of the charge density are also requested, except that in these cases there are two or three records, respectively, written for each pair of I1, I2 values. Thus, if the density and gradient are to be read into arrays D(N3,N2,N1), G(3,N3,N2,N1), RL(N3,N2,N1) from a formatted output file, a correct set of Fortran loops would be:

    Do 10 I1 = 1, N1
    Do 10 I2 = 1, N2
       Read(n,'(6F13.5)')  (D(I3,I2,I1),I3=1,N3)
       Read(n,'(6F13.5)')  ((G(IXYZ,I3,I2,I1),IXYZ=1,3), I3=1,N3)
       
10  Continue

where again n is the unit number corresponding to the cube file.


 Grid Related Options

N
Number of points to use per "side" (the default is 80). For example, Cube=100 specifies a grid of 1,000,000 points (1003), evenly distributed over the rectangular grid generated by the program (which is not necessarily a cube).

Coarse
Corresponds to N=40.

Medium

Corresponds to N=80.

Fine
Corresponds to N=100.


 Cube Contents Options

Density
Compute just the density values. This is the default.

Potential
Compute the electrostatic potential at each point.

Gradient
Compute the density and gradient.

Laplacian
Compute the Laplacian of the density <Ñ2r>. Divergence is a synonym for Laplacian.

NormGradient
Compute the norm of the density gradient at each point.

Orbitals
Compute the values of one or more molecular orbitals at each point.

FrozenCore
Remove the SCF core density. This is the default for the density, and is not allowed for the potential.

Full
Evaluate the density including all electrons.

Total
Use the total density. This is the default.

Alpha
Use only the alpha spin density.

Beta
Use only the beta spin density.

Spin
Use the spin density (difference between alpha and beta densities).

Cards
Read grid specification from the input stream (as described above).


 Related Keywords

Density



Return to TOC