PROGRESS  master
prg_sp2_fermi_mod Module Reference

The SP2 Fermi module. More...

Functions/Subroutines

subroutine, public prg_sp2_fermi_init (h_bml, nsteps, nocc, tscale, threshold, occErrLimit, traceLimit, x_bml, mu, beta, h1, hN, sgnlist)
 Truncated SP2 prg_initialization. More...
 
subroutine, public prg_sp2_fermi_init_norecs (h_bml, nsteps, nocc, tscale, threshold, occErrLimit, traceLimit, x_bml, mu, beta, h1, hN, sgnlist, verbose)
 Truncated SP2 prg_initialization. This routine also gives back the Number of SP2 recursive steps that gets a Pseudo-Fermi distribution with a temperature close to the target temperature which is entered using parameter beta = (1/KbT). More...
 
subroutine, public prg_sp2_fermi (h_bml, osteps, nsteps, nocc, mu, beta, h1, hN, sgnlist, threshold, eps, traceLimit, x_bml)
 Calculate Truncated SP2. More...
 
subroutine, public prg_sp2_entropy_function (mu, h1, hN, nsteps, sgnlist, GG, ee)
 Calculate SP2 entropy function using gaussian quadrature. Note that GG and ee are allocated and returned from this routine. More...
 
real(dp) function, public sp2_entropy_ts (D0_bml, GG, ee)
 Test SP2 entropy. Get the entropy contribution TS to the total free energy. More...
 
real(dp) function, public sp2_inverse (f, mu, h1, hN, nsteps, sgnlist)
 Calculate the SP2 inverse. 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)
 

Detailed Description

The SP2 Fermi module.

This subroutine implements Niklasson's truncated SP2 density matrix purification algorithm.

Function/Subroutine Documentation

◆ absmaxderivative()

real(dp) function prg_sp2_fermi_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 617 of file prg_sp2_fermi_mod.F90.

◆ prg_sp2_entropy_function()

subroutine, public prg_sp2_fermi_mod::prg_sp2_entropy_function ( real(dp), intent(in)  mu,
real(dp), intent(in)  h1,
real(dp), intent(in)  hN,
integer, intent(in)  nsteps,
integer, dimension(:), intent(in)  sgnlist,
real(dp), dimension(:), intent(inout), allocatable  GG,
real(dp), dimension(:), intent(inout), allocatable  ee 
)

Calculate SP2 entropy function using gaussian quadrature. Note that GG and ee are allocated and returned from this routine.

Parameters
muShifted chemical potential
h1Minimum scaled Gershgorin bound
hNMaximum scaled Gershgorin bound
nstepsNumber of SP2 steps
sgnlistSP2 sequence
GGEntropy function
ee1D mesh

Definition at line 482 of file prg_sp2_fermi_mod.F90.

◆ prg_sp2_fermi()

subroutine, public prg_sp2_fermi_mod::prg_sp2_fermi ( type(bml_matrix_t), intent(in)  h_bml,
integer, intent(in)  osteps,
integer, intent(in)  nsteps,
real(dp), intent(in)  nocc,
real(dp), intent(inout)  mu,
real(dp), intent(inout)  beta,
real(dp), intent(inout)  h1,
real(dp), intent(inout)  hN,
integer, dimension(:), intent(in)  sgnlist,
real(dp), intent(in)  threshold,
real(dp), intent(in)  eps,
real(dp), intent(in)  traceLimit,
type(bml_matrix_t), intent(inout)  x_bml 
)

Calculate Truncated SP2.

Parameters
h_bmlHamiltonian matrix
ostepsOuter loop steps
nstepsNumber of sequence branches
noccNumber of occupation states
muShifted chemical potential
betaInverse temperature
h1Minimum scaled Gershgorin bound.
hNMaximum scaled Gershgorin bound.
sgnlistSP2 sequence
thresholdThreshold for multiplies
epsOccupation error limit
traceLimitTrace limit
x_bmlOutput density matrix

Definition at line 388 of file prg_sp2_fermi_mod.F90.

◆ prg_sp2_fermi_init()

subroutine, public prg_sp2_fermi_mod::prg_sp2_fermi_init ( type(bml_matrix_t), intent(in)  h_bml,
integer, intent(in)  nsteps,
real(dp), intent(in)  nocc,
real(dp), intent(in)  tscale,
real(dp), intent(in)  threshold,
real(dp), intent(in)  occErrLimit,
real(dp), intent(in)  traceLimit,
type(bml_matrix_t), intent(inout)  x_bml,
real(dp), intent(inout)  mu,
real(dp), intent(inout)  beta,
real(dp), intent(inout)  h1,
real(dp), intent(inout)  hN,
integer, dimension(:), intent(inout)  sgnlist 
)

Truncated SP2 prg_initialization.

Parameters
h_bmlInput Hamiltonian matrix.
nstepsNumber of sp2 iterations.
noccNumber of occupied states.
tscaleTemperature rescaling factor.
thresholdThreshold for multiplication.
occErrLimitOccupation error limit.
traceLimitTrace limit.
x_bmlOutput prg_initial matrix.
muShifted chemical potential
betaOutput inverse temperature.
h1Output temperature-scaled minimum gershgorin bound.
hNOutput temperature-scaled maximum gershgorin bound.
sgnlistSP2 sequence

Calculate Gershgorin bounds and rescale

Determine sequence branching first time through

Definition at line 43 of file prg_sp2_fermi_mod.F90.

◆ prg_sp2_fermi_init_norecs()

subroutine, public prg_sp2_fermi_mod::prg_sp2_fermi_init_norecs ( type(bml_matrix_t), intent(in)  h_bml,
integer, intent(inout)  nsteps,
real(dp), intent(in)  nocc,
real(dp), intent(in)  tscale,
real(dp), intent(in)  threshold,
real(dp), intent(in)  occErrLimit,
real(dp), intent(in)  traceLimit,
type(bml_matrix_t), intent(inout)  x_bml,
real(dp), intent(inout)  mu,
real(dp), intent(inout)  beta,
real(dp), intent(inout)  h1,
real(dp), intent(inout)  hN,
integer, dimension(:), intent(inout)  sgnlist,
integer, optional  verbose 
)

Truncated SP2 prg_initialization. This routine also gives back the Number of SP2 recursive steps that gets a Pseudo-Fermi distribution with a temperature close to the target temperature which is entered using parameter beta = (1/KbT).

Parameters
h_bmlInput Hamiltonian matrix.
nstepsOutput number of sp2 iterations.
noccNumber of occupied states.
tscaleTemperature rescaling factor.
thresholdThreshold for multiplication.
occErrLimitOccupation error limit.
traceLimitTrace limit.
x_bmlOutput prg_initial matrix.
muShifted chemical potential
betaInput guess and output inverse temperature.
h1Output temperature-scaled minimum gershgorin bound.
hNOutput temperature-scaled maximum gershgorin bound.
sgnlistSP2 sequence
verboseOptional parameter for verbosity.

Calculate Gershgorin bounds and rescale

Determine sequence branching first time through

Definition at line 198 of file prg_sp2_fermi_mod.F90.

◆ sp2_entropy_ts()

real(dp) function, public prg_sp2_fermi_mod::sp2_entropy_ts ( type(bml_matrix_t), intent(in)  D0_bml,
real(dp), dimension(*), intent(in)  GG,
real(dp), dimension(*), intent(in)  ee 
)

Test SP2 entropy. Get the entropy contribution TS to the total free energy.

Parameters
D0_bmlBML matrix
GGEntropy function
ee1D mesh
TSEnergy contribution

Definition at line 540 of file prg_sp2_fermi_mod.F90.

◆ sp2_inverse()

real(dp) function, public prg_sp2_fermi_mod::sp2_inverse ( real(dp), intent(in)  f,
real(dp), intent(in)  mu,
real(dp), intent(in)  h1,
real(dp), intent(in)  hN,
integer, intent(in)  nsteps,
integer, dimension(:), intent(in)  sgnlist 
)

Calculate the SP2 inverse.

Parameters
fOccupation factor
muShifted chemical potential
h1Minimum scaled Gershgorin bound
hNMaximum scaled Gershgorin bound
nstepsNumbers of SP2 iterations
sgnlistSP2 sequence
eeEnergy value

Definition at line 592 of file prg_sp2_fermi_mod.F90.

Variable Documentation

◆ dp

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

Definition at line 18 of file prg_sp2_fermi_mod.F90.