ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
occupy_smearing Namespace Reference

Smearing weight functions and the Fermi-level bisection built on them. More...

Functions

double wgauss (const double &x, const int n)
 smeared occupation of a state, as a function of (ef - e) / sigma
double w1gauss (const double &x, const int n)
 first moment of the smearing function, used for the -TS term
double sumkg (const ModuleBase::matrix &ekb, const int nband, const int nks, const std::vector< double > &wk, const double &smearing_sigma, const int ngauss, const double &e, const int &is, const std::vector< int > &isk)
 number of electrons below a trial Fermi level e
void efermig (const ModuleBase::matrix &ekb, const int nbnd, const int nks, const double &nelec, const std::vector< double > &wk, const double &smearing_sigma, const int ngauss, double &ef, const int &is, const std::vector< int > &isk)
 Find the Fermi level using a compensated, energy-centered electron count.

Detailed Description

Smearing weight functions and the Fermi-level bisection built on them.

Each of these depends only on its arguments – none of them reads any of Occupy's state – so they are free functions rather than private static members of that class.

Function Documentation

◆ efermig()

void occupy_smearing::efermig ( const ModuleBase::matrix & ekb,
const int nbnd,
const int nks,
const double & nelec,
const std::vector< double > & wk,
const double & smearing_sigma,
const int ngauss,
double & ef,
const int & is,
const std::vector< int > & isk )

Find the Fermi level using a compensated, energy-centered electron count.

Note
ef is the rounded absolute chemical potential. Re-evaluating sumkg(ef) can lose precision for a large energy offset; gweights retains the centered chemical potential internally when forming occupations. The electron-count target is 16*epsilon*max(1,abs(nelec)). Unresolved floating-point stagnation remains an error; there is no relaxed fallback.
Here is the caller graph for this function:

◆ sumkg()

double occupy_smearing::sumkg ( const ModuleBase::matrix & ekb,
const int nband,
const int nks,
const std::vector< double > & wk,
const double & smearing_sigma,
const int ngauss,
const double & e,
const int & is,
const std::vector< int > & isk )

number of electrons below a trial Fermi level e

Here is the caller graph for this function:

◆ w1gauss()

double occupy_smearing::w1gauss ( const double & x,
const int n )

first moment of the smearing function, used for the -TS term

Parameters
nsmearing type, as in wgauss()
Here is the caller graph for this function:

◆ wgauss()

double occupy_smearing::wgauss ( const double & x,
const int n )

smeared occupation of a state, as a function of (ef - e) / sigma

Parameters
nsmearing type: -99 Fermi-Dirac, -1 cold, 0 Gaussian, n > 0 n-th order Methfessel-Paxton
Here is the caller graph for this function: