Tips and Tricks HPLC Troubleshooting

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Guide for PBC calculations with Gaussian

Cristian V. Diaconu

Department of Chemistry, Rice University

October 16, 2009

With contributions from Prof. Gustavo E. Scuseria, Dr. Artur F. Izmaylov, and Dr. Ionut D. Prodan

1. Practical Tips
2. An example
3. NOTES

Practical Tips
By Prof. Gustavo E. Scuseria

Read the Gaussian ’09 manual entries for Molecule Specifications and the keywords: PBC and FMM.
What not to do: If you want to put your computer system on its knees, try B3LYP with a diffuse
basis set on your favorite 3D system, eg, diamond. The near-field portion of the FMM without
symmetry included (symm is not implemented yet but we are working on it) will be very costly. The
HFx portion with diffuse bfs, full-range 1/r potential, and default cutoffs will take forever, and is
almost guaranteed that a single iteration will exceed your patience.
Hybrids with full or long-range 1/r potential are significantly more expensive (10-20X or even more)
than short-range hybrids like HSE that were designed with solids in mind. Be extremely careful if
you want to do a PBC full or long-range hybrid.
3D calculations are more expensive than 2D, which are in turn much more expensive than 1D. If you
are not familiar with the PBC code and how to tune up its options, we recommend that you start
playing in 1D and move your way up to 2D/3D slowly.
Diffuse bfs may be needed in some specific cases and for some specific properties but in general, it is
a good idea to carefully analyze whether your chosen MOLECULAR basis set (ie, a basis set that
was developed for atoms/molecules and usually contain fairly diffuse bfs to describe atomic tails) is
really needed for your PERIODIC system, which does not have any density tail (it does only if you
are doing 1D or 2D, but not in 3D).
Our PBC code does not suffer from linear dependencies, ie, if you use a dense basis on a dense
system and you end up with product bfs that are almost linearly dependent (overlap matrix eigenvalue
at some k-point below a certain threshold), the code will remove the offending linear combination.
However, there may be cases where the overall accuracy because of aggressive thresholds, sloppy (or
not accurate enough) xc quadrature grid, sloppy (or not accurate enough) Brillouin zone (k-point)
integration grid. In these cases, the SCF will die with some error message with the cause (not trivially
identifiable form the error message) being a combination of the above.
As a practical matter, bfs with exponents smaller than 0.10-0.15 are problematic and usually not
needed. Removing them (ie, adapting a molecular basis for an efficient periodic calculation) is not
required in our code (our numerics are usually robust enough to deal with them) but it will surely
make your calculations much faster and your life much easier on thresholds.

1
Metals are tricky and costly. Integration in k-point space is arduous. There are several options that
can be tried here if one has convergence problems in the SCF. A radical solution is to start from a finite
temperature calculation at ≈ 1,000K and then try to cool off the system some or converge ILT (or
similar) from there. Most PW calculations on metals are done at finite temperature, otherwise convergence
is rather difficult to achieve even with PW codes.
Another problem with metals is that diffuse and polarization functions are generally important for
them. Tread very carefully if your system is metallic. Your cpu time will go up because to achive
convergence you will need:
A larger basis than the one needed in an insulator or semiconductor
Lots of k-points
For semiconductors and insulators, if you feel that your calculations are slow, there is plenty of room
of improvement by playing with many of the accuracy thresholds (explained in detail in Izmaylov’s
piece). The record for this type improvement may be the InAs case finely tuned by Ed Brothers: he
was able to achieve a 20X speed-up by tuning thresholds (from default values) with a minimal loss of
accuracy for the band gap (less than 0.01 eV)
Gaussian provides the density fitting approximation for pure DFT calculations. The desired fitting
basis set is specified as a third component of the model chemistry, as in this example:
#p BLYP/6-31G(d)/Auto

Note that the slashes are required when a density fitting basis set is specified. See Basis Sets entry in
the Gaussian manual for more information.
Monitor your cpu time with flags like #p and iop1=timestamp, which will increase cpu time printing
and allow you to spot portions that are particularly expensive and amenable to improvement by
fine-tuning thresholds.

An example
This section presents an example that will be used throughout this document. The rest of the examples in
the document are based on this example and its checkpoint file silicon-pbe.chk

This is silicon bulk in cubic/diamond structure. Here we use Towler basis set for Si (from Mike Towler’s
CRYSTAL Resources Page).

Here is the input file for PBE calculation, file silicon-pbe.gjf:


%mem=1GB
%nprocsh=2
%chk=silicon-pbe.chk
#p pbepbe/gen/auto
pop=regular gfinput
fmm=(print) iop(5/13=1,5/33=1)
iop1=timestamp

Silicon cubic-diamond structure PBE/Towler

0 1
Si 0.0000 0.00000 0.00000
Si 1.35750 1.35750 1.35750

2
TV 0.000 2.715 2.715
TV 2.715 0.000 2.715
TV 2.715 2.715 0.000

@towler.gbs/n

Note: there is a blank line after @towler.gbs/n

Here is the basis set, file towler.gbs:


!Title: silicon
!Author: M.D. Towler
!When: 1998
!Comments: Derived from above basis. Reoptimized in bulk silicon.
! Includes new d polarization function.
!Use: Si
!Refs: used in "Muonium as a hydrogen analogue in silicon and
! germanium; quantum effects and hyperfine parameters", by
! A.R. Porter, M.D. Towler and R.J. Needs, PRB 60, 13534 (1999)
! (’large’ BS)
Si 0
S 8 1.0
149866.0000000000 1.2150000000E-04
22080.6000000000 9.7700000000E-04
4817.5000000000 5.5181000000E-03
1273.5000000000 2.5200000000E-02
385.1100000000 9.2656300000E-02
128.4290000000 2.6087290000E-01
45.4475000000 4.6375380000E-01
16.2589000000 2.9520000000E-01
SP 8 1.0
881.1110000000 -3.0000000000E-04 6.8090000000E-04
205.8400000000 -5.0000000000E-03 5.9446000000E-03
64.8552000000 -3.6800000000E-02 3.1200000000E-02
23.9000000000 -1.0790000000E-01 1.0840000000E-01
10.0010000000 1.3400000000E-02 2.3870000000E-01
4.4722000000 3.6750000000E-01 3.5600660000E-01
2.0340000000 5.6850000000E-01 3.4100000000E-01
0.9079000000 2.0650000000E-01 1.3260000000E-01
SP 1 1.0
3.7087000000 1.0 1.0
SP 1 1.0
1.0537000000 1.0 1.0
SP 1 1.0
0.3851000000 1.0 1.0
SP 1 1.0
0.1271000000 1.0 1.0
D 1 1.0
0.4388000000 1.0
****

To run this example job

3
1. create the files silicon-pbe.gjf and towler.gbs with the above content and put them in the
same directory
2. setup the gaussian environment and run gaussian (or create a job file and submit to the scheduler).

Example (do not forget to run this in a [t]csh shell)


#!/bin/tcsh -f

setenv g09root /projects/guscus/software/gaussian/x86_64/g09-a02


source $g09root/g09/bsd/g09.login
setenv GAUSS_SCRDIR /scratch/$LOGNAME/tmp/gau-$$
/bin/mkdir -p $GAUSS_SCRDIR

time nice g09 <silicon-pbe.gjf >silicon-pbe.out

/bin/rmdir $GAUSS_SCRDIR

Other useful tips


Useful tips related to using the PBC code:

i) Use pop=regular or pop=full in the route section. This particularly helps with analyzing the
results of open-shell PBC calculations, as it outputs important electronic structure information after
SCF convergence (in l601).

ii) Use guess=(check) iop(5/14=20) in the route section to just recompute the band structure
from the stored real-space Fock matrix of a converged PBC calculation. One obviously also needs to
specify the already-existing checkpoint file, but this should not be altered.

iii) Don’t forget to delete the read-write file after an abnormally terminated PBC run. These files tend
to be very large, depending on the size of the system, and can easily fill the scratch space.

NOTES
Common Problems
initial guess in PBC: guess=(read,fock) vs guess=read. In PBC guess=read uses the
Fock matrix if NMtPBC in the checkpoint file is the same as that of the current calculation, otherwise
it uses the MO coefficients, folded in the unit cell. The later is good for weakly interacting
molecular solids, but becomes increasingly bad with the inter-cell interaction increase. For
non-molecular solids I suggest always using guess=(read,fock).
NMtPBC is determined for k=0. Unfortunately, the convergence of the Bloch sums with the number
of cells depends on k for the Bloch sum form currently used in Gaussian. This is usually not a
problem. However, for diffuse functions this may become a huge problem, as the number of cells
may increase towards k=±π. What happens is that while the number of cells is enough at k=0, it may
not be enough towards k=±π, and Gaussian will die with the error:

4
Possibly not enough cells included in PBC.
Numerical problems in PBC.

If this happens the only way around it is to increase the number of cells by forcing a larger range:
PBC=(CellRange=N). See the PBC keyword in the Gaussian ’09 manual. Better yet, use less
diffuse basis functions, the calculations become prohibitively expensive with diffuse functions
anyway.
Due to the same problem of the form of the Bloch functions, the norms of the Bloch functions
become exponentially small when the exponents become small (norm ≈ exp(-k 2 /α)). The norms are
also k-dependent, so even if the near linear dependencies are elliminated at k=0, the norms of the
Bloch functions may still be too small at other values of k. This condition leads to warnings from
subroutine ZFrmV2 of the form:
ZFrmV2: there are 14 very small orbitals for k= 617 kxyz= 7 15 3.

The only solution to this problem is to prune the diffuse basis functions (especially the p-type).
Gaussian removes the culprits, but when this happens the basis functions are too diffuse and is
usually associated with the previous problem (not enough cells included in PBC) or Gaussian dies
with an error of the following type:
-------------------- ATTENTION--------------------
Total charge is not ZERO --- -0.002902253251
-------------------- ATTENTION--------------------

There is a problem with the total charge.

There is also a problem with 5d/6d basis sets. See the Basis Sets entry in the Gaussian ’09 manual.
This problem can be exacerbated for periodic calculations, especially when using a 5d basis set as a
6d one, thus having an extra s-type function that can be nearly linear dependent with the existing
s-type functions. This is true the other way, too: a 6d basis set may assume to have an extra s-type
functions from the d-type shells.
the rule of thumb for diffuse functions: the smallest exponent for s-type functions should be larger
than about α min = 2/d 2 , where d is the smallest distance between two atoms. The exponent input in
Gaussian is in Bohr −2 , so use d in Bohr.

To be added
antiferromagnetic guess, ferromagnetic metals and VMM, open shell, density symmetry and how to
break density matrix symmetry
convergence problems and solutions, temperature, damp, ndamp, maxcyc; limit maxcyc
band structure
utilities
charge error and convergence

Cristian V. Diaconu, October 16, 2009


Quantum Mechanics: The Dreams That Stuff Is Made Of

5
Table of Contents
Guide for PBC calculations with Gaussian . . . . . . . . . . . . . 1
Practical Tips . . . . . . . . . . . . . . . . . . . 1
An example . . . . . . . . . . . . . . . . . . . . 2
Other useful tips . . . . . . . . . . . . . . . . . . . 4
NOTES . . . . . . . . . . . . . . . . . . . . . 4
Common Problems . . . . . . . . . . . . . . . . . 4
To be added . . . . . . . . . . . . . . . . . . . 5

You might also like