PROGRESS  master
prg_chebyshev_mod Module Reference

Module to obtain the density matrix by applying a Chebyshev polynomial expansion. More...

Data Types

type  chebdata_type
 General Cheb solver type. More...
 

Functions/Subroutines

subroutine, public prg_parse_cheb (chebdata, filename)
 Chebyshev parser. This module is used to parse all the input variables for the cheb electronic structure solver. Adding a new input keyword to the parser: More...
 
subroutine, public prg_build_density_cheb (ham_bml, rho_bml, athr, threshold, ncoeffs, kbt, ef, bndfil, jon, verbose)
 Builds the density matrix from \( H_0 \) for a Fermi function approximated with a Chebyshev polynomial expansion. More...
 
subroutine, public prg_build_density_cheb_fermi (ham_bml, rho_bml, athr, threshold, ncoeffs, kbt, ef, bndfil, getef, fermitol, jon, npts, trkfunc, verbose)
 Builds the density matrix from \( H_0 \) for a Fermi function approximated with a Chebyshev polynomial expansion. In this case the self-consistent recursion is applied to converge to the correct number of electrons and obtain the Fermi level. More...
 
real(dp) function jackson (ncoeffs, i, jon)
 Evaluates the Jackson Kernel Coefficients. More...
 
subroutine prg_get_chebcoeffs (npts, kbt, ef, ncoeffs, coeffs, emin, emax)
 Gets the coefficients of the Chebyshev expansion. More...
 
subroutine prg_get_chebcoeffs_fermi_bs (npts, kbt, ef, tracesT, ncoeffs, coeffs, emin, emax, bndfil, norb, tol, jon, verbose)
 Gets the coefficients of the Chebyshev expansion with Ef computation. More...
 
subroutine prg_get_chebcoeffs_fermi_nt (npts, kbt, ef, tracesT, ncoeffs, coeffs, emin, emax, bndfil, norb, tol, jon, verbose)
 Gets the coefficients of the Chebyshev expansion with Ef computation. More...
 
real(dp) function tr (r, x)
 Chebyshev polynomial obtained by recursion. More...
 
real(dp) function fermi (e, ef, kbt)
 Gives the Fermi distribution value for energy e. More...
 
real(dp) function absmaxderivative (func, de)
 Gets the absolute maximum of the derivative of a function. More...
 

Variables

integer, parameter dp = kind(1.0d0)
 
real(dp), parameter pi = 3.14159265358979323846264338327950_dp
 

Detailed Description

Module to obtain the density matrix by applying a Chebyshev polynomial expansion.

See Amparo Gil 2007 [Amparo2007] , See Silver et al [Silver1996] , See Weisse et al [Weisse2006]

Function/Subroutine Documentation

◆ absmaxderivative()

real(dp) function prg_chebyshev_mod::absmaxderivative ( real(dp), dimension(:), intent(in)  func,
real(dp), intent(in)  de 
)
private

Gets the absolute maximum of the derivative of a function.

Parameters
func.
deEnergy step.

Definition at line 801 of file prg_chebyshev_mod.F90.

◆ fermi()

real(dp) function prg_chebyshev_mod::fermi ( real(dp), intent(in)  e,
real(dp), intent(in)  ef,
real(dp), intent(in)  kbt 
)
private

Gives the Fermi distribution value for energy e.

Parameters
eEnergy.
efFermi energy.

Definition at line 789 of file prg_chebyshev_mod.F90.

◆ jackson()

real(dp) function prg_chebyshev_mod::jackson ( integer, intent(in)  ncoeffs,
integer, intent(in)  i,
logical, intent(in)  jon 
)
private

Evaluates the Jackson Kernel Coefficients.

Parameters
ncoeffsNumber of Chebyshev polynomial.
iCoefficient number i.

Definition at line 531 of file prg_chebyshev_mod.F90.

◆ prg_build_density_cheb()

subroutine, public prg_chebyshev_mod::prg_build_density_cheb ( type(bml_matrix_t), intent(in)  ham_bml,
type(bml_matrix_t), intent(inout)  rho_bml,
real(dp), intent(in)  athr,
real(dp), intent(in)  threshold,
integer, intent(in)  ncoeffs,
real(dp), intent(in)  kbt,
real(dp), intent(in)  ef,
real(dp), intent(in)  bndfil,
logical, intent(in)  jon,
integer, intent(in)  verbose 
)

Builds the density matrix from \( H_0 \) for a Fermi function approximated with a Chebyshev polynomial expansion.

\( \rho_{n+1} = b_{n+1}T_{n+1} + \rho_{n} \) Where, \( T_n \) is the nth Chebyshev polynomial and \( b_{n} \) is the nth coefficient of the expansion for the Fermi function. In the sparse version (when ellpack is used) the threshold can be varied linearly with the polynomial degree. The function is the following: \( Thresh(n) = Thresh_0 [a_{thr} (n-1) + (1-a_{thr})] \)

Parameters
ham_bmlInput Orthogonalized Hamiltonian matrix.
rho_bmlOutput density matrix.
athrThreshold linear increasing constant.
thresholdThreshold for sparse matrix algebra.
ncoeffsNumber of Chebyshev coefficients.
kbtElectronic temperature in the energy units of the Hamiltonian.
efFermi level in the energy units of the Hamiltonian.
bndfilBand filing factor.
verboseVerbosity level.

Definition at line 141 of file prg_chebyshev_mod.F90.

◆ prg_build_density_cheb_fermi()

subroutine, public prg_chebyshev_mod::prg_build_density_cheb_fermi ( type(bml_matrix_t), intent(in)  ham_bml,
type(bml_matrix_t), intent(inout)  rho_bml,
real(dp), intent(in)  athr,
real(dp), intent(in)  threshold,
integer, intent(in)  ncoeffs,
real(dp), intent(in)  kbt,
real(dp), intent(out)  ef,
real(dp), intent(in)  bndfil,
logical, intent(in)  getef,
real(dp fermitol,
logical, intent(in)  jon,
integer  npts,
logical, intent(in)  trkfunc,
integer, intent(in)  verbose 
)

Builds the density matrix from \( H_0 \) for a Fermi function approximated with a Chebyshev polynomial expansion. In this case the self-consistent recursion is applied to converge to the correct number of electrons and obtain the Fermi level.

\( \rho_{n+1} = b_{n+1}T_{n+1} + \rho_{n} \) Where, \( T_n \) is the nth Chebyshev polynomial and \( b_{n} \) is the nth coefficient of the expansion for the Fermi function. In the sparse version (when ellpack is used) the threshold can be varied linearly with the polynomial degree. The function is the following: \( Thresh(n) = Thresh_0 [a_{thr} (n-1) + (1-a_{thr})] \)

Parameters
ham_bmlInput Orthogonalized Hamiltonian matrix.
rho_bmlOutput density matrix.
athrThreshold linear increasing constant.
thresholdThreshold for sparse matrix algebra.
ncoeffsNumber of Chebyshev coefficients.
kbtElectronic temperature in the energy units of the Hamiltonian.
efFermi level in the energy units of the Hamiltonian.
bndfilBand filing factor.
nptsNumber of energy points to compute the coefficients
verboseVerbosity level.

Definition at line 307 of file prg_chebyshev_mod.F90.

◆ prg_get_chebcoeffs()

subroutine prg_chebyshev_mod::prg_get_chebcoeffs ( integer, intent(in)  npts,
real(dp), intent(in)  kbt,
real(dp), intent(in)  ef,
integer, intent(in)  ncoeffs,
real(dp), dimension(:), intent(inout)  coeffs,
real(dp), intent(in)  emin,
real(dp), intent(in)  emax 
)
private

Gets the coefficients of the Chebyshev expansion.

Parameters
nptsNumber of points for discretization.
kbtElectronic temperature.
efFermi level.
ncoeffsNumber of Chebyshev coefficients.
coeffsOutput vector for the Chebyshev coefficients.
eminlowest boundary for the eigenvalues of H.
emaxhighest boundary for the eigenvalues of H.

Definition at line 567 of file prg_chebyshev_mod.F90.

◆ prg_get_chebcoeffs_fermi_bs()

subroutine prg_chebyshev_mod::prg_get_chebcoeffs_fermi_bs ( integer, intent(in)  npts,
real(dp), intent(in)  kbt,
real(dp), intent(inout)  ef,
real(dp), dimension(:), intent(in)  tracesT,
integer, intent(in)  ncoeffs,
real(dp), dimension(:), intent(inout)  coeffs,
real(dp), intent(in)  emin,
real(dp), intent(in)  emax,
real(dp), intent(in)  bndfil,
integer, intent(in)  norb,
real(dp), intent(in)  tol,
logical, intent(in)  jon,
integer, intent(in)  verbose 
)
private

Gets the coefficients of the Chebyshev expansion with Ef computation.

In this case we are applying the bisection method to find the root.

Parameters
nptsNumber of points for the discretization.
kbtElectronic temperature.
efFermi level.
tracesTInput traces for matrix polynomials.
ncoeffsNumber of Chebyshev coefficients.
coeffsOutput vector for the Chebyshev coefficients.
eminlowest boundary for the eigenvalues of H.
emaxhighest boundary for the eigenvalues of H.
tolTolerance for the bisection method.
verboseVerbosity level.

Definition at line 618 of file prg_chebyshev_mod.F90.

◆ prg_get_chebcoeffs_fermi_nt()

subroutine prg_chebyshev_mod::prg_get_chebcoeffs_fermi_nt ( integer, intent(in)  npts,
real(dp), intent(in)  kbt,
real(dp), intent(inout)  ef,
real(dp), dimension(:), intent(in)  tracesT,
integer, intent(in)  ncoeffs,
real(dp), dimension(:), intent(inout)  coeffs,
real(dp), intent(in)  emin,
real(dp), intent(in)  emax,
real(dp), intent(in)  bndfil,
integer, intent(in)  norb,
real(dp), intent(in)  tol,
logical, intent(in)  jon,
integer, intent(in)  verbose 
)
private

Gets the coefficients of the Chebyshev expansion with Ef computation.

In this case the Newton-Raphson method is applied to find the root.

Parameters
npstNumber of points for the discretization.
kbtElectronic temperature.
efFermi level.
tracesTInput traces for matrix polynomials.
ncoeffsNumber of Chebyshev coefficients.
coeffsOutput vector for the Chebyshev coefficients.
eminlowest boundary for the eigenvalues of H.
emaxhighest boundary for the eigenvalues of H.
bndfilBand filing factor.
norbNumber of orbitals.
tolTolerance for NR method.
verboseVerbosity level.

Definition at line 695 of file prg_chebyshev_mod.F90.

◆ prg_parse_cheb()

subroutine, public prg_chebyshev_mod::prg_parse_cheb ( type(chebdata_type), intent(inout)  chebdata,
character(len=*)  filename 
)

Chebyshev parser. This module is used to parse all the input variables for the cheb electronic structure solver. Adding a new input keyword to the parser:

  • If the variable is real, we have to increase nkey_re.
  • Add the keyword (character type) in the keyvector_re vector.
  • Add a default value (real type) in the valvector_re.
  • Define a new variable and pass the value through valvector_re(num) where num is the position of the new keyword in the vector.

Definition at line 53 of file prg_chebyshev_mod.F90.

◆ tr()

real(dp) function prg_chebyshev_mod::tr ( integer, intent(in)  r,
real(dp), intent(in)  x 
)
private

Chebyshev polynomial obtained by recursion.

Parameters
rrth polynomial.
xargument the evaluate the polynomial.

Definition at line 776 of file prg_chebyshev_mod.F90.

Variable Documentation

◆ dp

integer, parameter prg_chebyshev_mod::dp = kind(1.0d0)
private

Definition at line 23 of file prg_chebyshev_mod.F90.

◆ pi

real(dp), parameter prg_chebyshev_mod::pi = 3.14159265358979323846264338327950_dp
private

Definition at line 24 of file prg_chebyshev_mod.F90.