QMol_DFT_SCF_Anderson - fmauger1/QMol-grid GitHub Wiki
QMol_DFT_SCF_Anderson
Anderson's mising scheme for DFT ground-state calculations.
Description
Use QMol_DFT_SCF_Anderson
to solve DFT self-consistent field (SCF) nonlinear eigen-state problem
$$ {\hat{\mathcal{H}} }_{{\mathrm{D}\mathrm{F}\mathrm{T}}} \left\lbrack \lbrace \phi_k \rbrace_k \right\rbrack ~\phi_k (x)=E_k ~\phi_k (x)~~{\mathrm{f}\mathrm{o}\mathrm{r}}~~k=1,2,\ldots~~~~~~(1) $$
where ${\hat{\mathcal{H}} }_{{\mathrm{D}\mathrm{F}\mathrm{T}}}
$ is the DFT Hamiltonian operator and $\lbrace \phi_k \rbrace_k
$ are the Kohn-Sham orbitals with energies $\lbrace E_k \rbrace_k
$ . QMol_DFT_SCF_Anderson
uses an Anderson's mixing scheme [Anderson 1965] in SCF iterations, as described in [Johnson 1988], for either the one-body density or the Kohn-Sham potential. QMol_DFT_SCF_Anderson
is a handle class.
Class properties
Anderson's mixing
The QMol_DFT_SCF_Anderson
class defines the following public get-access properties; each can be changed using the set
method:
tolerance (tol)
Convergence tolerance [ nonnegative scalar (default 1e-10) ]
maxIterations (maxit)
Maximum number of SCF iterations [ nonnegative integer (default 100) ]
mixing (mix)
Mixing coefficient [ 0 to 1 scalar (default 0.5) ]
- Too large
mixing
coefficient may render the SCF unstable and prevent convergence. - Too small
mixing
coefficient makes the SCF convergence slower. - Optimal
mixing
coefficient is system dependent and should be adapted accordingly.
mixingMode (mode)
What to mix in the SCF iterations [ density (default) | potential ]
density
mixes the one-body density whilepotential
mixes the Kohn-Sham potential. In both cases, only the explicit part of the potential is being mixed in the SCF iterations and any implicit exchange-correlation functional is not being mixed.
convergenceTest (test)
Convergence criterion [ 'density' (default) | 'eigenvalues' ]
- With the
'density'
criterion, the result is considered converged when the ${\mathcal{L}}^2
$ norm difference in the one-body density between two consecutive SCF iterations is smaller thantolerance*mixing
. - With the
'eigenvalues'
criterion, the result is considered converged when the sum in the absolute-value difference between the DFT Hamiltonian operator eigenvalues between two consecutive SCF iterations is smaller thantolerance*mixing
.
display (disp)
Whether to display the SCF iteration progress [ true (default) | false ]
Other properties
To facilitate simulations, QMol_DFT_SCF_Anderson
defines a handful of additional transient properties. These cannot be edited with the set
method.
isInitialized (isInit)
Whether the DFT-model object is properly initialized. This is used throughout the QMol-grid package to check that the DFT-model object holds meaningful information and is ready for use.
Class methods
Creation
constructor
Create an Anderson's mixing scheme object with empty class properties.
obj = QMol_DFT_SCF_Anderson;
Create an Anderson's mixing scheme object with the name
properties set to the specified value
. Several name-value
pairs can be specified consecutively. Suitable name
is any of Anderson's mixing and is case insensitive.
obj = QMol_DFT_SCF_Anderson(name1,value1);
obj = QMol_DFT_SCF_Anderson(name1,value1,name2,value2,___);
Changing class properties
set
Update the name
properties of an Anderson's mixing scheme object to the specified value
. Several name-value
pairs can be specified consecutively. Suitable name
is any of Anderson's mixing and is case insensitive.
obj.set(name1,value1);
obj.set(name1,value1,name2,value2,___);
This is the common name-value pair assignment method used throughout the QMol-grid package. The set
method also reset
the class. After running, the set
property updates the isInitialized
flag to a false
value.
reset
Reset the object by deleting/re-initializing all run-time properties of the class and updating the isInitialized
flag to false
.
obj.reset;
- This is the common
reset
method available to all classes throughout the QMol-grid package.
clear
Clear all class properties
obj.clear;
Clear a specific set of the class properties. Suitable name
is any of Anderson's mixing and is case insensitive.
obj.clear(name1,name2,___);
This is the common clear
method available to all classes throughout the QMol-grid package. The clear
method also reset
the class.
Initializing the object
initialize
Initialize a QMol_DFT_SCF_Anderson
object and set the isInitialized
flag to true
.
obj.initialize;
Run-time documentation
showDocumentation
Display the run-time documentation for the specific configuration of a QMol_DFT_SCF_Anderson
object, wich must have been initialize
d beforehand.
ref = obj.showDocumentation;
- The output
ref
is a cell vector containing the list of references to be included in the bibliography.
SCF computation
solveSCF
Compute the solution of the SCF problem of Eq. (1) with
obj.solveSCF(DFT);
DFT
is the DFT-model handle object, i.e.,QMol_DFT_spinPol
orQMol_DFT_spinRes
, that describes the DFT Hamiltonian operator of Eq. (1).- To avoid any mismatch in internal properties,
solveSCF
firstreset
the object and (re)initializes theDFT
before performing the SCF iterations. - The first step of the SCF iterations uses linear mixing (with the
mixing
coefficient); the following iterations use Anderson's mixing. - For grid-based DFT models, the SCF iterations use the
QMol_DFT_eigs
eigen-state solver with default properties; for basis set models, it uses theQMol_DFT_eig_basis
solver (again with default properties). - The result Kohn-Sham orbitals are stored in the input
DFT
object (inDFT.orbital
).
Specify the eigen-state solver to use in the SCF iterations with
obj.solveSCF(DFT,ES);
- This enables non-default properties for the eigen-state solver object
ES
.
Specify the initial condition to start the SCF iterations with
obj.solveSCF(DFT,[],IC); % Default eigen-state solver
obj.solveSCF(DFT,ES,IC); % supplied eigen-state solver
IC = []
(or omitted) starts the SCF iterations from scratch, from the equivalent of the eigen-states of the external potential only (no Hartree or exchange-correlation contribution). This is the default and most general option but my result in slow (or failed) convergence.IC = 'DFT'
starts the SCF iterations from the one-body density from the input DFT object (DFT.getDensity
).IC = rho
, whererho
is a compatible one-body density object, starts SCF iterations from the supplied one-body density (the total charge inrho
may not match theDFT
total charge, in which case the input density is rescaled to the proper total charge).IC = Vks
, whereVks
is a compatible Kohn-Sham potential object, starts SCF iterations from the supplied Kohn-Sham potential.- The type of initial condition may not match the
mixingMode
. For instance, one my supply a starting one-body density while mixing the Kohn-Sham potential in the SCF iterations.
Examples
Examples of SCF calculations for spin-polarized and spin-restricted DFT models can be found in the QMol_DFT_spinPol
and QMol_DFT_spinRes
documentation pages, respectively.
Test suite
Run the test suite for the class in normal or summary mode respectively with
QMol_test.test('DFT_SCF_Anderson');
QMol_test.test('-summary','DFT_SCF_Anderson');
References
[Anderson 1965] D.G. Anderson, "Iterative procedures for nonlinear integral equations," Journal of the ACM 12, 547 (1965).
[Johnson 1988] D. D. Johnson, "Modified Broyden''s method for accelerating convergence in self-consistent calculations," Physical Review B 38, 12807 (1988).
Notes
QMol_DFT_SCF_Anderson
was introduced in version 01.00.