VASP Electronic Optimization Guide
VASP Electronic Optimization Guide
Georg KRESSE
b-initio
ackage
ienna imulation
– general strategies
– strategy adopted in VASP
iterative matrix diagonalization and mixing
– how to overcome slow convergence
molecular dynamics
the algorithms are particularly well suited for molecular dynamics
Ne 2
ρtot r ∑ ψn r ρion r
2
2 Ne number of electrons
n 1
ψn r ∇2 ψn r d 3 r Exc ρ r
2 d rd r
2 r r
LDA/GGA
value of the functional (iteration)
h̄2 2
Gradient: Fn r ∇ V eff r ψn r εn ψn r
2me
iteration – self consistency (old fashioned)
start with a trial density ρ, set up the Schrödinger equation, and solve the Schrödinger equation
to obtain wavefunctions ψn r
h̄2 2
∇ V eff r ρ r ψn r ε n ψn r n 1 Ne 2
2me
!
as a result one obtains a new charge density ρ r ∑ n ψn r 2 and a new Schrödinger
equation iteration
"
log 10 E-E 0
DCC DCC BA DCC BA @?? BA @?? >= @?? >= <;; >= <;; <;; :9 :9 877 :9 877 6877 6 6 43 43 21 43 21 0/ 21 0/ 0/ .- .- ,++ .- ,++ *) ,++ *) ('' *) ('' &%('' &% $## &% $## $##
D D BA D BA @ BA @ >= @ >= < >= < < :9 :9 8 :9 8 568 56 56 43 43 21 43 21 0/ 21 0/ 0/ .- .- , .- , *) , *) ( *) ( &%( &% $ &% $ $
log 10 E-E 0
-4 direct Car−Parrinello
Car−Parrinello -4
-6 -6 n=1
n=1,2,4,8 n=1 n=8
555
L -8 -8
n=8
1 self.consistent 1 self.consistent
0 0
|
log 10 |F-F 0 |
0
-1 -1
log 10 |F-F
-2 -2
n=1
-3 -3
-4 -4
0 5 10 15 20 0 10 20 30 40
iteration forces iteration
h̄2 2
Gradient: Fn r ∇ V eff r ψn r εn ψn r
2me
the main troubles are
– to keep the set of wavefunctions ψn r n 1 Ne 2 orthogonal
!
– “sub-space” rotation
at the end one aims to have a set of wavefunction ψn r n 1 Nbands that
E
diagonalize the Hamiltonian
ψn H ψ m δnm ε̄n
F
G
for metals, this condition is difficult to achieve with direct algorithms
E
HH
M M I
set up Hamiltonian H ρin two subproblems
N
optimization of ψn and ρin
iterative refinements of wavefunctions ψn
I refinement of density:
N
DIIS algorithm
I
393 (1980).
refinement of density ρin ρout new ρin
I
refinement of wavefunctions:
N
"
no
I JK L KJ I
∆E
J K
K J
Ebreak
J K
K J
KJ
JK
generally the user can not influence the behavior of these algorithms (delicately
optimized black box routines)
N iteration count
E total energy
dE change of total energy
d eps change of the eigenvalues (fixed potential)
ncg number of optimisation steps Hψ
rms total initial residual vector ∑nk wk fnk H εnk ψnk
rms(c) charge density residual vector
charge update:
cpu time wall clock time
POTLOK: VPU time 0.04: CPU time 0.04 new local potential
SETDIJ: VPU time 0.09: CPU time 0.09 set PAW strength coefficients
EDDIAG: VPU time 0.14: CPU time 0.14 sub-space rotation
RMM-DIIS: VPU time 0.77: CPU time 0.77 RMM-DIIS step (wavefunc.)
ORTHCH: VPU time 0.01: CPU time 0.02 orthogonalisation
DOS : VPU time -0.01: CPU time 0.00 new density of states
CHARGE: VPU time 0.07: CPU time 0.07 new charge
MIXING: VPU time 0.01: CPU time 0.01 mixing of charge
one usually starts with a set of trial vectors (wavefunctions) representing the filled
states and a few empty one electron states
ψn n 1 Nbands
these are initialized using a random number generator
then the wavefunctions are improved by adding to each a certain amount of the
residual vector
the residual vector is defined as
R ψn H εapp S ψn εapp ψn H ψ n
G
G
G
adding a small amount of the residual vector
ψn ψn λR ψn
O
is in the spirit of the steepest descent approach (usually termed “Jacobi relaxation”)
– apply Raighly Ritz optimization in the space spanned by all bands (“sub-space”
rotation)
transform: ψn n 1 Nbands so that
ψn H ψ m G δnm ε̄n
F
G. K RESSE , E LECTRONIC O PTIMISATION Page 13
“In space” optimization EDDIAG
Raighly Ritz optimization in the space spanned by these vectors (subspace)
search for the unitary matrix Ū such that the wavefunctions ψn
ψn ∑ Ūmn ψm
m
fulfill ψ n H ψm εm δnm
F
G
G
F
F
and it’s diagonalisation
2
the setup of the matrix scales like Nbands NFFT (worst scaling part of VASP)
in the parallel version, communication is required, but modest
worse is the fact that the diagonalisation of H̄mn is not done in parallel
R ψn H εapp S ψn R ψn R ψn minimal
O G
G
G
F
P
– in the worst case, you might not notice anything
in these cases, switch to blocked Davidson (manual contains a number of tricks how you
might be able to use the DIIS algorithm even when it initially fails)
"
– optimize this subset by adding the orthogonalized residual vector to the presently
considered subspace
ψk H εapp S ψk k n1 n2
– apply Raighly Ritz optimization in the space spanned by these vectors
(“sub-space” rotation in a 2(n2-n1+1) dim. space)
– add additional residuals calculated from the yet optimized bands (“sub-space”
rotation in a 3(n2-n1+1) dim. space)
approximately a factor of 1.5-2 slower than RMM-DIIS, but always stable
"
with ρout r ∑occupied wk fnk ψnk r 2
Q
Q
DIIS algorithm is used for the optimization of the norm of the residual vector
linearization of R ρin around ρsc (linear response theory)
Rρ Jρ ρsc
with the charge dielectric function J
J 1 χ U
4πe2
q2
leads to
R ρin ρout ρin ρin J ρin ρsc
J 1 χ U
4πe2
q2
"
for insulators and semi-conductors the width of the eigenvalue spectrum is constant
and system size independent !
for metals the eigenvalue spectrum diverges, its width is proportional to the square of
the longest dimension of the cell:
– short wavelength limit J 1 (no screening)
R
0.4
VASP uses a model dielectric function
AMIX
which is a good initial approximation 0.3
for most systems
0.2
J
1 q2
J G1q max
STU WUT
V V
P
q2
R
STU
X
0.1 AMIN
defaults:
0
AMIX=0.4 ; AMIN=0.1 ; 0 1 2 3 4
BMIX=1.0 2
G (1/A )
1
J G1q A
R
VASP also gives information on how good the initial mixing parameters are
allow VASP to run until selfconsistency is achieved and search for the last occurrence
of
eigenvalues of (default mixing * dielectric matrix)
average eigenvalue GAMMA= 2.200
– for linear mixing (e.g. AMIX=0.1 ; BMIX=0.0001) the optimal AMIX is given by
the present AMIX GAMMA
Y
converges
converges
play with mixing parameters
converges ICHARG=2
use this setting AMIX=0.1 ; BMIX=0.01
fails to converge
converges
increase BMIX
BMIX=3.0 ; AMIN=0.01
fails to converge
bug report
after positions have been checked
usually VASP resets the dielectric matrix to it’s default after moving the ions
but if the ions move only a little bit one can bypass this reset
– definitely a good option for molecular dynamics
– damped molecular dynamics (optimisation)
– works also well during relaxations, if the forces are not large ( 0.5 eV/Å)
L
you need to specify MAXMIX in the INCAR file
set MAXMIX to roughly three times the number of iterations in the first ionic step
the resulting speedups can be substantial (a factor 2 to 3 less electronic steps for each
ionic step)
IBRION = 0 # MD
NSW = 1000 # number ofMD steps
POTIM = 3.0 # time step
TEBEG = 1500 ; TEEND = 500 # target temperature 1500-500 K
SMASS = -1 ; NBLOCK = 50 # scale velocities every 50 steps
SMASS = 2 # use a Nose Hoover thermostat
SMASS = -3 # micro canonical
timestep POTIM, depends on the vibrational frequencies and the required energy
conservation
as a rule of thumb: increase POTIM until 3 electronic minisation steps are required per
timestep
another rule of thumb:
H 0.5 fs
increase by 1 fs for each row
Li-F 1 fs
SMASS controls the MD simulation
– SMASS=-3 micro canonical ensemble
– for equilibration and simulated annealing SMASS = -1 ; NBLOCK = 50-100
microcanonical MD, and every NBLOCK steps the kinetic energy is scaled to
meet the requied temperature criterion
– for positive values a Nose Hoover thermostat is introduced