Below is an extract from the Gaussian online manual on how to use the cubegen program.
Gaussian includes a standalone utility for generating cubs from the data in a formatted checkpoint file (equivalent to the previous Cube keyword). The utility is named cubegen, and it has the following syntax:
cubegen memory kind fchkfile cubefile npts format
All parameters are optional; cubegen will prompt for fchkfile if necessary. The default command is:
cubegen 0 density=scf response-to-prompt test.cube 0 h
The parameters, which are not case-sensitive, have the following meanings:
Amount of dynamic memory to allocate in words. A value of 0 implies a machine-specific default value.
A keyword specifying the type of cube to generate:
MO=n: Molecular orbital n. The keywords Homo, Lumo, All, OccA (all alpha occupied), OccB (all beta occupied), Valence (all valence orbitals) and Virtuals (all virtual orbitals) may also be used in place of a specific orbital number. There is no default for n, and an error will occur if it is omitted.
Density=type: Total density of the specified type.
Spin=type: Spin density (difference between α and β densities) of the specified type.
Alpha=type: Alpha spin density of the specified type.
Beta=type: Beta spin density of the specified type.
Potential=type: Electrostatic potential using the density of the specified type.
The type keyword is one of the single density selection options that are valid with the Density keyword: SCF, MP2, CI, QCI, and so on (note that Current is not supported). The fdensity, falpha and fbeta forms request the use of full instead of frozen-core densities. The default is SCF.
Gradient: Compute the density and gradient.
Laplacian: Compute the Laplacian of the density (∇2ρ).
NormGradient: Compute the norm of the density gradient at each point.
CurrentDensity=I: Magnitude of the magnetically-induced (GIAO) current density, where I is the applied magnetic field direction (X, Y or Z).
ShieldingDensity=IJN: Magnetic shielding density. I is the direction of the applied magnetic field, J is the direction of the induced field (X, Y or Z), and N is the number of the nucleus for which the shielding density (GIAO) is to be calculated.
Name of the formatted checkpoint file. cubegen will prompt for this filename if it is not specified.
Name of the output cube file; test.cube is the default if it is not explicitly specified (i.e., specifying the name of the checkpoint file does not change the default cube filename).
Number of points per side in the cube. A value of 0 selects the default value of 803 points distributed evenly over a rectangular grid generated automatically by the program (not necessarily a cube). Positive values of npts similarly specify the number of points per "side"; e.g., 100 specified a grid of 1,000,000 (1003) points.
The values -2, -3 and -4 correspond to the keywords Coarse, Medium and Fine and to values of 3 points/Bohr, 6 points/Bohr and 12 points/Bohr (respectively). Negative values of npts < -5 specify spacing of npts*10-3 Angstroms between points in the grid.
A value of -1 says to read the cube specification from the input stream, according to the following format:
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.
IFlag is the output unit number. If IFlag is less than 0, then a formatted file will be produced; otherwise, an unformatted file will be written.
If N1<0 the input cube coordinates are assumed to be in Bohr, otherwise, they are interpreted as Angstroms. |N1| is used as the number of X-direction points in any case; N2 and N3 specify the number of points in the Y and Z directions, respectively. Note that the three axes are used exactly as specified; they are not orthogonalized, so the grid need not be rectangular.
The value -5 says to read in an arbitrary list of points from standard input. If you enter this input by hand, terminate the input with an end-of-file (i.e., ^D under Unix). Alternatively, you can redirect standard input to a file containing the list of points (do not place a blank line or ^D at the end of the file).
Format of formatted output files: h means include header (this is the default); n means don't include header. This parameter is ignore when unformatted cube files are produced.
Send all questions, suggestions and comments to Vlad (email@example.com)
Dr. Vladislav Vasilyev
The Australian National University,
Canberra, ACT, 0200, Australia