Self-consistency
Summary
Self-consistency is a concept closely linked with mean-field theories. In mean-field treatment of the Schrodinger equation, interacting particles give off a field, and interact with the (mean) field other particles generate. The field a particle senses controls its motion, which in turn affects the field it generates. Mean-field theories link the field a particle generates to the field it senses in a self-consistent manner. For the field to be time-independent, the effective field must be some average field. Thus in the mean-field approximation a particle moves in an average effective external field Veff(r) which determines the particles’ motion, which in turn determines Veff(r). Each feeds the other; the condition for which both are satisfied is the self-consistency condition.
Table of Contents
- Self-Consistency in Density-functional Theory
- Self-Consistency in the Coherent Potential Approximation
- Self-Consistency in nonequilibrium transport
- Self-Consistency in the Quasiparticle Self-Consistent GW Approximation
- Self-Consistency in tight-binding models
- References
Self-Consistency in Density-functional Theory
Practical implementations of DFT, such as the LDA are instances of a mean-field theory. Formally the density n is determined by minimization of a total energy functional E[n]. In principle it could be done through iterating trial densities nin until the point of minimum energy is found. In practice this is not possible because realistic schemes must calculate the kinetic energy contribution to E[n] via an effective non-interacting Schrodinger equation. An effective one-particle potential Veff(r) is generated from the functional derivative Veff(r)=δE[n]/δn(r). Veff(r) defines a one-particle Hamiltonian which generates a new density nout, which differs from nin. Self-consistency is reached when an nout=nin. This density is also the one for which E[n] is minimum, or at least stationary, for certain formulations. The codes here implement the standard Hohenberg Kohn (HK) functional, for which the energy is a minimum, and also the Harris-Foulkes (HF) functional 1, for which the energy is stationary at self-consistency, though typically it is a maximum point.
Approaching self-consistency can be a tricky business, especially in magnetic systems (or whenever there is a degree of freedom with a very low energy scale associated with it).
Charge mixing, general considerations
Questaal codes follow the usual procedure of mixing a linear combination of input density nin and output density nout to make a trial n* as an estimate for the self-consistent density n (see for example Chapter 9 in Richard Martin’s book5). In a perfect mixing scheme, it would be possible to infer the self-consistent density n directly from nin and nout. Instead we must make an estimate n* from nin and nout, use it for a new nin find a new nout, iterating until nout − nin is small.
Practical implementation of density mixing in Questaal is controlled by the ITER_MIX tag, as explained on this page. Questaal uses two independent techniques to accelerate convergence to the self-consistency condition nout→nin. First, the quantities are mixed making use of model for the dielectric function. Second, multiple (nin,nout) pairs (taken from prior iterations) can be used to accelerate convergence (Anderson and Broyden schemes). The contents of ITER_MIX control options all components of the mixing algorithm.
If the static dielectric response is known, n* can approach the self-consistent density n to linear order in nout−nin. It is not difficult to show that choosing
yields to linear order in . ε is a function of source and field point coordinates r and r′: ε = ε(r,r′) and in any case it is not given by the standard self-consistency procedure. Nevertheless it can be important and some estimate for ε is needed. An especially pertinent example can be found in the NbFe superlattice tutorial.
can also be written in reciprocal space, as . are the Fourier representation of the periodic part of , thus characterizing the shape of with confined to a unit cell. characterizes the variation of between unit cells. Since the density is a periodic function of the lattice, only the part enters into Eq. 1.
In any case none of the Questaal codes have a purely plane wave representation of the density, so they do something else.
Charge mixing in the full-potential code
lmf uses a three component density: a smooth density n0 represented as plane waves (carried on a uniform mesh), defined everywhere in space and two local densities: the true density n1 and a one-center expansion n2 of the smooth density. (See Section 3.6 of Ref. 6 for a detailed description of augmentation and the density derived from it.)
If the density were expanded solely in plane waves n = ΣG CG nG, a simple mixing scheme would be to mix each CG using a model dielectric function. The Thomas Fermi approximation provides a reasonable, if rough estimate for ε, which reads in reciprocal space
Eq.(2) has one free parameter, the Thomas Fermi wave number kTF. It can be estimated given the total number of electrons qval from the free electron gas formula.
This is called the “Kerker mixing” algorithm. The beauty of Kerker mixing is that charges in small G components of the density get damped out, while the short-ranged, large G components do not.
One can use the Lindhard function instead. The idea is similar, but the Lindhard function is the static dielectric function of the free-electron gas in the random-phase approximation. In the same notation as Eq.(2),
The Thomas Fermi function is the case and is the inverse of Eq.(2). Since the two functions are the same for small , which is the region that matters for damping charge sloshing. They differ near , where has a logarithmic singularity in its derivative, and is non-analytic. This has consequences for slabs and other cells with a large vacuum; see here.
The function and its parameter are selected in the ITER_MIX string: elind=# invokes the Lindhard function, Eq.(2b), and etf=# the Thomas Fermi (Kerker) function, Eq.(2). In both cases # is in the formulas above (in Ry). A negative # means |#| times the default taken from HAM_ELIND, which is itself a multiple of the free-electron value if it is negative. This rule and the parameter elin2 for the local densities are described there.
Example : mix=a2,etf=0.83,b=0.2 mixes with Anderson’s method and Thomas Fermi screening, .
The mixing algorithm must mix all three density components and it is somewhat involved, though the plane wave part does indeed use the Lindhard or Thomas Fermi function. See fp/mixrho.f for details.
Charge mixing in the ASA
The ASA uses a simplified mixing scheme since the logarithmic derivative parameters P and energy moments of charge Q for each class is sufficient to completely specify the charge density. The density is not explicitly mixed. Since it does not have plane waves, some alternative model must be employed. One has been implemented (which diagonalizes the Madelung matrix and substitutes the eigenvalues for a kind of screened version). It dampens the small G fluctuations, but at the same time it conceals true physical changes in the moments, and it is not ideal.
The ASA codes have the ability to make a discretized form ε(q=0) explicitly in spirit of the energy moments of charge that serve as a discretized representation of the density. This matrix is a good approximation to ε(q=0) in this context, and its use greatly stabilizes the convergence in difficult cases. The ASA Nb/Fe superlattice tutorial provides a classic illustration of this feature.
In summary the ASA codes (lm, lmgf, lmpg) offer two options:
- The q=0 discretized polarization is explicitly calculated
- A rough ε is obtained from eigenvalues of the Madelung matrix
There is some overhead associated with the second option, but it is not too large and having it greatly facilitates convergence in large systems. This is particularly important in magnetic metals, where there are low-energy degrees of freedom associated with the magnetic parts that require that a healthy component of nout for reasonable approach to self-consistency.
Mixing the density
The mixing process reduces to estimating a vector X* related to the density (e.g. P,Q in the ASA) where δX = Xout − Xin vanishes at Xin = X*.
Mixing algorithms mix linear combinations of (Xin,Xout) pairs taken from the current iteration together with pairs from prior iterations. If there are no prior iterations, then
It is evident from Eq.(1) that beta should be connected with the dielectric function. However, beta is just a number. If beta=1, X* = Xout; if beta→0, X* scarcely changes from Xin. Thus in that case you move like an “amoeba” downhill towards the self-consistent solution. For small systems it is usually sufficient to take beta on the order of, but smaller than unity. For large systems charge sloshing becomes a problem so you have to do something different. This is because the potential change goes as δV ~ G−2×δn so small G components of δn determine the rate of mixing. The simplest (but inefficient) choice is to make beta small.
By some method (see above) an estimate ε for the dielectric function is constructed. Construct δn = ε−1 (nout−nin) and build δX from δn. Then estimate
Now beta can be much larger again, of order unity.
The mixing algorithms use yet another device to accelerate the approach to self-consistency. Each iteration produces a new (Xin,Xout) pairs. There are acceleration techniques that given a family (Xin,Xout) pairs some combination of them can be taken that is better than taking any one pair. See ITER_MIX on this page.
If the (inverse) dielectric function is known, it can be used to accelerate convergence. The ASA and FP codes use different strategies for this.
The next sections explain how can be estimated in the ASA.
ASA Option 1. Direct calculation of a discretized dielectric function
As seen in Eq. 1, knowledge of the static greatly facilitates convergence. Since the density is a periodic function of the lattice, we need only the part as noted above.
In the ASA, and are not given Instead charge is discretized inside unit spheres. We can accordingly define the ASA bare response function , as:
is the constant potential shift in the channel of sphere , and is the induced change in the 0th moment in channel L of sphere R, without taking into account interactions between electrons (noninteracting susceptibility). The inverse of the static dielectric matrix (the ASA analog of ) is:
where
+ (on-site term = something like the intra-atomic U)
and
Madelung Matrix
lm and lmgf can both generate , and store it on the disk. If you have generated , you can have the mixing procedure construct and then screen by . More exactly, it replaces the raw (generated by lm, lmgf or lmpg) by
and then it proceeds with self-consistency in the usual way, using in place of the usual . It is not difficult to show that if is the exact inverse dielectric function, is the RPA estimate of the self-consistent density. See, for example, Richard Martin’s book, Electronic Structure. (The density-density response function is , not .)
To tell lm or lmgf to do this screening, set OPTIONS_SCR=2. The program will crash if it can’t read from the disk ( is stored in the file psta.ext). You can create either with the band program lm or the Green’s function code lmgf. Since the metals treatment of is very primitive in the lm code, it is better to use the lmgf to create for metals. lmgf can also make for the noncollinear case. To run lmgf, you need to add a couple of tokens to the ctrl file. For either program, set OPTIONS_SCR=1 to create .
The intra-atomic U is estimated from the second derivative of the sphere total energy wrt to charge. You can update it every iteration by adding 10*k to the token SCR=… thus SCR=52 will update the U each iteration in the sphere program.
Note: lmpg can also read a already generated, but it cannot create it.
If you don’t want to make , you can let the codes make a model estimate for you (Option 2 below). It saves you the trouble of making , but it is less good than when is calculated explicitly.
ASA Option 2. Rough estimate of the dielectric function through modifying eigenvalues of the Madelung matrix
is a symmetric matrix and has real eigenvalues. It is a discretized form of the coulomb interaction which in reciprocal space is . In a periodic potential, the only allowed are the reciprocal lattice vectors .
In the Thomas-Fermi dielectric function, , the bare Coulomb interaction enters linearly. Option 2 diagonalizes the bare Coulomb matrix (the Madelung matrix plus the intra-atomic term), replaces by its eigenvalues in the Thomas-Fermi form, , and rotates back to the atomic representation. The screening parameter elind is the one described above; a negative value is scaled by the free-electron value. A projection then makes the response conserve charge, and is inverted. This gives an estimate for the screened , and it is selected by OPTIONS_SCR=4.
All of these functionalities can be enabled through tag OPTIONS_SCR:
OPTIONS_SCR opt i4 1, 1 default = 0
Use scr to accelerate convergence:
0 do nothing
1 Make ASA static response function (see documentation)
2 Use response to screen output q and ves
4 Use model response to screen output q
6 Use response to screen output ves only
The vacuum floor in slab calculations
In a cell with a large region of vacuum (a slab, in 3D or 2D mode) the full-potential mixing step can generate a small spurious density in the vacuum, a “floor” of order 10−5 e/a.u.3. The floor is not in the output density of the band calculation; it is made by the mixing step and is explained here together with tests that show how convergence depends on the mixing parameter and on the screening, in particular the parameter etf of ITER_MIX.
In brief: the plane-wave part of the density difference is screened by adding . The large differences inside the slab produce a screening charge that extends into the vacuum. It oscillates in sign and decays slowly for the Lindhard function. It is much smaller for the Thomas-Fermi function, which is why etf (rather than elind) is recommended for slabs. Without any screening there is no floor, but the iteration is unstable. Since at the smallest of a large cell, a floor component is removed by the mixing at a rate of only per iteration, and the screened RMS hardly registers it.
The –floorxfer switch: mathematics
The switch --floorxfer is intended for slab geometries (large vacuum regions), in particular with DIM_TWOD=1 or DIM_VHAR=1 (2D mode). When the density is mixed with a Thomas-Fermi/Lindhard-screened scheme described above (etf or elind in ITER_MIX), screening can induce a spurious small, roughly uniform density in the vacuum, and it is particularly pronounced when differences between input and output densities in the slab are large. The spurious density is removed only very slowly by further iterations, by a factor per iteration ( is the mixing parameter and the model dielectric function at the of the component, about 50 for the smallest of a large cell): a vacuum “floor”.\
--floorxfer creates a local, charge-conserving correction, applied inside the mixing step to the smooth density on the real-space mesh, to the new input density returned by the mixing step. It is not used when mixing is switched off (ITER_MIX none). Tests are described here. Let be the raw smooth output density on the real-space mesh (saved before the mixing step, which modifies it), and the new input density returned by the mixing step. Write . The parameters are a density threshold (given by ~theta=, default ) and a strength (~alpha=, default 1).
- Vacuum weight, smooth and computed from the output density, which has no floor, as the raw density decays exponentially into the vacuum: It is close to 1 where (vacuum), equal to 1/2 where and close to 0 in the slab.
- Excess to be removed: where is the volume per mesh point.
- Redistribution weight, proportional to the density where it is large:
- Update, applied to the total density and split equally between the spin channels, so that the magnetization is not changed:
Properties:
- Exact charge conservation. , so the cell charge, the term and the neutrality condition are unchanged.
- The fixed point is unchanged. If then , so is still a fixed point. For the correction vanishes as the iteration converges.
- Vacuum. For , and the new input density equals the raw output density. The floor is replaced at every iteration by the output density, which has no floor.
- Dense region. For the density changes only through : the removed charge is added in proportion to , a smooth and small change.
- Locality. The removal is a pointwise nonlinear function of and , with no real-space masks; only the redistribution is global, through and the normalization of . The correction also acts where (in the tails), with weight 1/2 at .
- Placement. The raw output density is saved when the mixing routine is entered and the correction is applied at its end, after the neutrality correction. The screening and the Anderson or Broyden mixing itself are not changed. The mixing history holds the input densities actually used, which include the correction, and the raw output densities.
The charge moved is printed in each iteration on a line beginning FLOORXFER. It is small: typically 10−2 e in the first iteration and below 10−4 e near convergence. Only has been tested, and has not been optimized.
The ~pos option: removing negative densities
The option ~pos of --floorxfer (–floorxfer~pos) is applied after the vacuum transfer above, to each spin density on the mesh separately. Mixing can leave small negative values, mainly in the vacuum. Let , (negative), , and with the same as above. The negative part is removed and the charge it carried is taken from the dense region, with the weight of step 3 above, computed from :
or equivalently with .
Properties:
- Charge conservation. The charge of each spin is conserved, because is the original charge.
- Positivity. The bracket is at least , which is positive as long as the negative charge is smaller than , the charge of the dense region. Otherwise the program stops with an error.
- Dense region only. The compensating charge is removed in proportion to , which is small in the vacuum. This differs from the mesh part of --rhopos, which sets negative points to a small positive number and scales the whole mesh density.
- Mesh only. The one-center densities inside the augmentation spheres are not changed; --rhopos treats those as well.
One line per spin, beginning FLOORXFER pos, reports the number of negative points, the most negative value and the charge moved. In the tests described here the most negative value was e/a.u.3 in the early iterations and about after 50, at to mesh points per spin, carrying between and e.
LDA+U
LDA+U theory, an extension to LDA, is also a mean-field theory. At sites where U is added there is a self-consistency condition on the site density matrix, which must be incorporated together with the standard charge self-consistency. As of this writing, the density matrix is mixed separately from the density, with its own mixing parameter.
Self-Consistency in noncollinear magnetism
In noncollinear extensions to standard DFT, the density turns into a 2×2 matrix, for which at any point r the density may be decomposed into linear combinations of Pauli matrices. The decomposition defines the x,y,z components of the spin density. Using the connection between Pauli matrices and Cartesian coordinates, the spin density represented as spin amplitude and direction. This is how it is represented externally. Internally it is represented at times either as (amplitude, direction), or (when constructing the hamiltonian or charge density) as a 2×2 matrix. Noncollinear magnetism is implemented in the ASA and in the full-potential code lmf. In the ASA the spin orientation at a site is assumed to be constant for the whole site, and self-consistency means that the spin at each site is rotated so that the off-diagonal part of the 2×2 spin density matrix vanishes.
Self-Consistency in the Coherent Potential Approximation
Alloys consist of different kinds of atoms sitting at a given lattice site, or in the magnetic version, an atom of a particular type (e.g. Fe) with different spin configurations. The CPA replaces a statistical ensemble of atoms with a single atom that is taken to be an average, or composite, of the true atoms. CPA theory is a way to construct the “average” properties of a composite atom, in an optimal manner, by constructing the average scattering properties of a site. The theory is naturally formulated in the language of Green’s functions. The CPA has been implemented in the ASA for both magnetic and chemical disorder, in program lmgf. Thus lmgf requires two kinds of self-consistency: an outer loop for charge and an inner loop for the CPA condition. See here for a description of Questaal’s implementation of CPA.
Self-Consistency in nonequilibrium transport
lmpg is a Green’s function code, similar to lmgf but designed for layered systems (periodic in two dimensions but not in the third). One of the best uses of this method is its ability to calculate transport in the Landauer-Buttiker framework. Outside the small bias regime, the potential must be determined self-consistently under nonequilibrium conditions. Questaal’s implementation is described in Ref [2].
Self-Consistency in the Quasiparticle Self-Consistent GW Approximation
Self-consistency has a different purpose in the quasiparticle self-consistent GW approximation (QSGW) [3]. QSGW is based on a kind of self-consistent perturbation theory, where the self-consistency is used to construct an optimal non-interacting hamiltonian by minimizing the difference between it and the many-body hamiltonian, within the GW approximation. Self-consistency enables QSGW to describe optical properties in a wide range of materials rather well, including cases where the local-density and LDA-based GW approximations fail qualitatively. Self-consistency dramatically improves agreement with experiment, and is sometimes essential. QSGW avoids some formal and practical problems encountered in fully self-consistent GW, which is more akin to the mean-field self-consistency described earlier. QSGW handles both itinerant and correlated electrons on an equal footing, without any ambiguity about how a localized state is defined, or how double-counting terms should be subtracted. Weakly correlated materials such as Na and sp semiconductors are described with uniformly high accuracy. Discrepancies with experiment are small and systematic, and can be explained in terms of the approximations made.
Questaal mixes the quasiparticle self-energy generated by the GW code much in the same way as it mixes charge densities. It uses a mixing parameter beta in Eq. 3 above where in this context X refers to . It mixes with the input (note that different beta’s are used for the charge and ). The mixing beta to mix is read through tag GW_MIXBETA.
In addition, the mixing scheme uses an Anderson mixing scheme [7] to mix () combinations from prior iterations when they become available (this information is kept in a file (mixsigma). The scheme is analogous to charge mixing; see the description of ITER_MIX on this page.
To see how much the mixing scheme mixed prior iterations of in a particular run, do grep tj lsg.
Self-Consistency in tight-binding models
Typically empirical tight-binding models, for which the form of matrix elements is postulated, ignore self-consistency. However, the effects of charge transfer can be important, and the quality tight-binding models can be vastly improved with minimal complexity added to the hamiltonian [4].
This package’s implementation of empirical tight-binding hamiltonians, tbe, has a capability to include potential changes from charge transfer in a self-consistent manner. The site charges generate an electrostatic potential through a Madelung matrix, and must be determined self-consistently.
References
[1] M. Foulkes and R. Haydock, Tight-binding models and density-functional theory, Phys. Rev. B39, 12520 (1989). See also comment 3 on this page.
[2] S. V. Faleev, F. Leonard, D. A. Stewart, and M. van Schilfgaarde, Ab initio tight-binding LMTO method for nonequilibrium electron transport in nanosystems, Phys. Rev. B71, 195422 (2005).
[3] Takao Kotani, M. van Schilfgaarde, S. V. Faleev, Quasiparticle self-consistent GW method: a basis for the independent-particle approximation, Phys. Rev. B 76, 165106 (2007).
[4] M. W. Finnis, A. T. Paxton, M. Methfessel and M. van Schilfgaarde, Crystal Structures of Zirconia from First Principles and Self-Consistent Tight Binding, Phys. Rev. Lett. 81, 5149 (1998)
[5] R. M. Martin, Electronic Structure, Cambridge University Press (2004).
[6] Dimitar Pashov, Swagata Acharya, Walter R. L. Lambrecht, Jerome Jackson, Kirill D. Belashchenko, Athanasios Chantis, Francois Jamet, Mark van Schilfgaarde, Questaal: a package of electronic structure methods based on the linear muffin-tin orbital technique, Comp. Phys. Comm. 249, 107065 (2020).
[7] D. G. Anderson. Iterative procedures for nonlinear integral equations. J. Assoc. Comput. Mach., 12:547–560, 1965