PROGRESS  master
prg_implicit_fermi_mod Module Reference

Functions/Subroutines

subroutine, public prg_implicit_fermi_save_inverse (Inv_bml, h_bml, p_bml, nsteps, nocc, mu, beta, occErrLimit, threshold, tol, SCF_IT, occiter, totns)
 Recursive Implicit Fermi Dirac for finite temperature. More...
 
subroutine, public prg_implicit_fermi (h_bml, p_bml, nsteps, k, nocc, mu, beta, method, osteps, occErrLimit, threshold, tol)
 Recursive Implicit Fermi Dirac for finite temperature. More...
 
subroutine, public prg_implicit_fermi_zero (h_bml, p_bml, nsteps, mu, method, threshold, tol)
 Recursive Implicit Fermi Dirac for zero temperature. More...
 
subroutine, public prg_implicit_fermi_first_order_response (H0_bml, H1_bml, P0_bml, P1_bml, Inv_bml, nsteps, mu0, beta, nocc, threshold)
 Calculate first order density matrix response to perturbations using Implicit Fermi Dirac. More...
 
subroutine, public prg_implicit_fermi_response (H0_bml, H1_bml, H2_bml, H3_bml, P0_bml, P1_bml, P2_bml, P3_bml, nsteps, mu0, mu, beta, nocc, occ_tol, lin_tol, order, threshold)
 Calculate density matrix response to perturbations using Implicit Fermi Dirac. More...
 
subroutine, public prg_finite_diff (H0_bml, H_list, mu0, mu_list, beta, order, lambda, h, threshold)
 Calculate density matrix response from perturbations in the Hamiltonian. More...
 
subroutine prg_setup_linsys (p_bml, A_bml, b_bml, p2_bml, y_bml, aux_bml, aux1_bml, k, threshold)
 Set up linear system for Implicit Fermi Dirac. More...
 
subroutine prg_newtonschulz (a_bml, ai_bml, r_bml, tmp_bml, d_bml, I_bml, tol, threshold, num_iter)
 Find the inverse of the matrix A with Newton-Schulz iteration. More...
 
subroutine prg_pcg (A_bml, p_bml, p2_bml, d_bml, wtmp_bml, cg_tol, threshold)
 Solve the system AX = B with conjugate gradient. More...
 
subroutine prg_conjgrad (A_bml, p_bml, p2_bml, tmp_bml, d_bml, w_bml, cg_tol, threshold)
 Solve the system AX = B with conjugate gradient. More...
 
subroutine prg_get_density_matrix (ham_bml, p_bml, beta, mu, threshold)
 Calculate the density matrix with diagonalization. More...
 
subroutine, public prg_test_density_matrix (ham_bml, p_bml, beta, mu, nocc, osteps, occErrLimit, threshold)
 Calculate the density matrix with diagonalization and converge chemical. More...
 
real(dp) function fermi (e, mu, beta)
 Gives the Fermi distribution value for energy e. More...
 

Variables

integer, parameter dp = kind(1.0d0)
 

Function/Subroutine Documentation

◆ fermi()

real(dp) function prg_implicit_fermi_mod::fermi ( real(dp), intent(in)  e,
real(dp), intent(in)  mu,
real(dp), intent(in)  beta 
)
private

Gives the Fermi distribution value for energy e.

Parameters
eEnergy.
muFermi energy.
betaInverse temperature

Definition at line 1192 of file prg_implicit_fermi_mod.F90.

◆ prg_conjgrad()

subroutine prg_implicit_fermi_mod::prg_conjgrad ( type(bml_matrix_t), intent(in)  A_bml,
type(bml_matrix_t), intent(inout)  p_bml,
type(bml_matrix_t), intent(in)  p2_bml,
type(bml_matrix_t), intent(inout)  tmp_bml,
type(bml_matrix_t), intent(inout)  d_bml,
type(bml_matrix_t), intent(inout)  w_bml,
real(dp), intent(in)  cg_tol,
real(dp), intent(in)  threshold 
)
private

Solve the system AX = B with conjugate gradient.

Parameters
A_bmlCoefficient matrix A
p_bmlOutput solution X
p2_bmlRight side matrix B
d_bmlAuxillary matrix
w_bmlAuxillary matrix
cg_tolConvergence condition (OBS squared Frobenius norm of residual matrix)
thresholdThreshold for matrix algebra

Definition at line 1006 of file prg_implicit_fermi_mod.F90.

◆ prg_finite_diff()

subroutine, public prg_implicit_fermi_mod::prg_finite_diff ( type(bml_matrix_t), intent(in)  H0_bml,
type(bml_matrix_t), dimension(:), intent(in), allocatable  H_list,
real(dp), intent(in)  mu0,
real(dp), dimension(:), intent(in), allocatable  mu_list,
real(dp), intent(in)  beta,
integer, intent(in)  order,
real(dp), intent(in)  lambda,
real(dp), intent(in)  h,
real(dp), intent(in)  threshold 
)

Calculate density matrix response from perturbations in the Hamiltonian.

Definition at line 726 of file prg_implicit_fermi_mod.F90.

◆ prg_get_density_matrix()

subroutine prg_implicit_fermi_mod::prg_get_density_matrix ( type(bml_matrix_t), intent(in)  ham_bml,
type(bml_matrix_t), intent(inout)  p_bml,
real(dp), intent(in)  beta,
real(dp), intent(in)  mu,
real(dp), intent(in)  threshold 
)
private

Calculate the density matrix with diagonalization.

Parameters
ham_bmlInput hamiltonian
p_bmlOutput density matrix
betaInverse temperature
muChemical potential
thresholdThreshold for matrix algebra

Definition at line 1056 of file prg_implicit_fermi_mod.F90.

◆ prg_implicit_fermi()

subroutine, public prg_implicit_fermi_mod::prg_implicit_fermi ( type(bml_matrix_t), intent(in)  h_bml,
type(bml_matrix_t), intent(inout)  p_bml,
integer, intent(in)  nsteps,
integer, intent(in)  k,
real(dp), intent(in)  nocc,
real(dp), intent(inout)  mu,
real(dp), intent(in)  beta,
integer, intent(in)  method,
integer, intent(in)  osteps,
real(dp), intent(in)  occErrLimit,
real(dp), intent(in)  threshold,
real(dp), intent(in)  tol 
)

Recursive Implicit Fermi Dirac for finite temperature.

Parameters
h_bmlInput Hamiltonian matrix.
p_bmlOutput density matrix.
nstepsNumber of recursion steps.
kExpansion order
noccNumber of occupied states.
muShifted chemical potential
betaInput inverse temperature.
method0 - conjugate gradient, 1 - newton-schultz
ostepsOuter loop steps to converge chemical potential
occErrLimitOccupation error limit.
thresholdThreshold for multiplication.
tolTolerance for linear system solver See

Definition at line 209 of file prg_implicit_fermi_mod.F90.

◆ prg_implicit_fermi_first_order_response()

subroutine, public prg_implicit_fermi_mod::prg_implicit_fermi_first_order_response ( type(bml_matrix_t), intent(in)  H0_bml,
type(bml_matrix_t), intent(in)  H1_bml,
type(bml_matrix_t), intent(inout)  P0_bml,
type(bml_matrix_t), intent(inout)  P1_bml,
type(bml_matrix_t), dimension(nsteps), intent(in)  Inv_bml,
integer, intent(in)  nsteps,
real(dp), intent(in)  mu0,
real(dp), intent(in)  beta,
real(dp), intent(in)  nocc,
real(dp), intent(in)  threshold 
)

Calculate first order density matrix response to perturbations using Implicit Fermi Dirac.

Parameters
H0_bmlInput Hamiltonian matrix.
H1_bmlInput First order perturbation of H0.
P0_bmlOutput density matrix.
P1_bmlOutput First order density matrix response.
nstepsNumber of recursion steps.
mu0Shifted chemical potential.
betaInput inverse temperature.
noccNumber of occupied states.
thresholdThreshold for matrix algebra. See

Definition at line 439 of file prg_implicit_fermi_mod.F90.

◆ prg_implicit_fermi_response()

subroutine, public prg_implicit_fermi_mod::prg_implicit_fermi_response ( type(bml_matrix_t), intent(in)  H0_bml,
type(bml_matrix_t), intent(in)  H1_bml,
type(bml_matrix_t), intent(in)  H2_bml,
type(bml_matrix_t), intent(in)  H3_bml,
type(bml_matrix_t), intent(inout)  P0_bml,
type(bml_matrix_t), intent(inout)  P1_bml,
type(bml_matrix_t), intent(inout)  P2_bml,
type(bml_matrix_t), intent(inout)  P3_bml,
integer, intent(in)  nsteps,
real(dp), intent(inout)  mu0,
real(dp), dimension(:), intent(inout), allocatable  mu,
real(dp), intent(in)  beta,
real(dp), intent(in)  nocc,
real(dp), intent(in)  occ_tol,
real(dp), intent(in)  lin_tol,
integer  order,
real(dp threshold 
)

Calculate density matrix response to perturbations using Implicit Fermi Dirac.

Parameters
H0_bmlInput Hamiltonian matrix.
H1_bml,H2_bml,H3_bmlInput First to third order perturbations of H0.
P0_bmlOutput density matrix.
P1_bml,P2_bml,P3_bmlOutput First to third order density matrix response.
nstepsNumber of recursion steps.
mu0Shifted chemical potential.
muPre-allocated array of length order.
betaInput inverse temperature.
noccNumber of occupied states.
occ_tolOccupation error tolerance.
lin_tolLinear solver tolerance.
orderCalculate response up to this order.
thresholdThreshold for matrix algebra. See

Definition at line 547 of file prg_implicit_fermi_mod.F90.

◆ prg_implicit_fermi_save_inverse()

subroutine, public prg_implicit_fermi_mod::prg_implicit_fermi_save_inverse ( type(bml_matrix_t), dimension(nsteps), intent(inout)  Inv_bml,
type(bml_matrix_t), intent(in)  h_bml,
type(bml_matrix_t), intent(inout)  p_bml,
integer, intent(in)  nsteps,
real(dp), intent(in)  nocc,
real(dp), intent(inout)  mu,
real(dp), intent(in)  beta,
real(dp), intent(in)  occErrLimit,
real(dp), intent(in)  threshold,
real(dp), intent(in)  tol,
integer, intent(in)  SCF_IT,
integer, intent(inout)  occiter,
integer, intent(inout)  totns 
)

Recursive Implicit Fermi Dirac for finite temperature.

Parameters
Inv_bmlInverses generated by algorithm.
h_bmlInput Hamiltonian matrix.
p_bmlOutput density matrix.
nstepsNumber of recursion steps.
noccNumber of occupied states.
muShifted chemical potential
betaInput inverse temperature.
occErrLimitOccupation error limit.
thresholdThreshold for multiplication.
tolTolerance for linear system solver.
SCF_ITThe current SCF iteration.
occiterCounts the total nr of DM calculations during MD. See

Definition at line 46 of file prg_implicit_fermi_mod.F90.

◆ prg_implicit_fermi_zero()

subroutine, public prg_implicit_fermi_mod::prg_implicit_fermi_zero ( type(bml_matrix_t), intent(in)  h_bml,
type(bml_matrix_t), intent(inout)  p_bml,
integer, intent(in)  nsteps,
real(dp), intent(in)  mu,
integer, intent(in)  method,
real(dp), intent(in)  threshold,
real(dp), intent(inout), optional  tol 
)

Recursive Implicit Fermi Dirac for zero temperature.

Parameters
h_bmlInput Hamiltonian matrix.
p_bmlOutput density matrix.
nstepsNumber of recursion steps.
muShifted chemical potential
betaInput inverse temperature.
method0 - conjugate gradient, 1 - newton-schultz
thresholdThreshold for multiplication.
tolTolerance for linear system solver

Definition at line 347 of file prg_implicit_fermi_mod.F90.

◆ prg_newtonschulz()

subroutine prg_implicit_fermi_mod::prg_newtonschulz ( type(bml_matrix_t), intent(in)  a_bml,
type(bml_matrix_t), intent(inout)  ai_bml,
type(bml_matrix_t), intent(inout)  r_bml,
type(bml_matrix_t), intent(inout)  tmp_bml,
type(bml_matrix_t), intent(inout)  d_bml,
type(bml_matrix_t), intent(in)  I_bml,
real(dp), intent(in)  tol,
real(dp), intent(in)  threshold,
integer, intent(out)  num_iter 
)
private

Find the inverse of the matrix A with Newton-Schulz iteration.

Parameters
a_bmlInput matrix A
ai_bmlInput starting guess and output inverse
r_bmlAuxillary matrix
tmp_bmlAuxillary matrix
tolConvergence criterion (Frobenius norm of residual matrix)
thresholdThreshold for matrix algebra

Definition at line 888 of file prg_implicit_fermi_mod.F90.

◆ prg_pcg()

subroutine prg_implicit_fermi_mod::prg_pcg ( type(bml_matrix_t), intent(in)  A_bml,
type(bml_matrix_t), intent(inout)  p_bml,
type(bml_matrix_t), intent(inout)  p2_bml,
type(bml_matrix_t), intent(inout)  d_bml,
type(bml_matrix_t), intent(inout)  wtmp_bml,
real(dp), intent(in)  cg_tol,
real(dp), intent(in)  threshold 
)
private

Solve the system AX = B with conjugate gradient.

Parameters
A_bmlCoefficient matrix A
p_bmlOutput solution X
p2_bmlRight side matrix B
d_bmlAuxillary matrix
w_bmlAuxillary matrix
cg_tolConvergence condition (OBS squared Frobenius norm of residual matrix)
thresholdThreshold for matrix algebra

Definition at line 934 of file prg_implicit_fermi_mod.F90.

◆ prg_setup_linsys()

subroutine prg_implicit_fermi_mod::prg_setup_linsys ( type(bml_matrix_t), intent(in)  p_bml,
type(bml_matrix_t), intent(inout)  A_bml,
type(bml_matrix_t), intent(inout)  b_bml,
type(bml_matrix_t), intent(inout)  p2_bml,
type(bml_matrix_t), intent(inout)  y_bml,
type(bml_matrix_t), intent(inout)  aux_bml,
type(bml_matrix_t), intent(inout)  aux1_bml,
integer, intent(in)  k,
real(dp), intent(in)  threshold 
)
private

Set up linear system for Implicit Fermi Dirac.

Parameters
p_bmlInput X_i matrix.
p2_bmlOutput X_i^k matrix.
A_bmlOutput [X_i^k + (I - X_i)^k] matrix.
y_bmlAuxillary matrix.
aux_bmlAuxillary matrix
aux1_bmlAuxillary matrix.
kExpansion order (an even number)
thresholdThreshold for multiplication. OBS this routine can be numerically unstable for k > 4

Definition at line 843 of file prg_implicit_fermi_mod.F90.

◆ prg_test_density_matrix()

subroutine, public prg_implicit_fermi_mod::prg_test_density_matrix ( type(bml_matrix_t), intent(in)  ham_bml,
type(bml_matrix_t), intent(inout)  p_bml,
real(dp), intent(in)  beta,
real(dp), intent(inout)  mu,
real(dp), intent(in)  nocc,
integer, intent(in)  osteps,
real(dp), intent(in)  occErrLimit,
real(dp), intent(in)  threshold 
)

Calculate the density matrix with diagonalization and converge chemical.

Definition at line 1112 of file prg_implicit_fermi_mod.F90.

Variable Documentation

◆ dp

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

Definition at line 20 of file prg_implicit_fermi_mod.F90.