Documentation for module pexsi_methods

Methods using the PEXSI library to calculate the density matrix and related quantities using the Kohn-Sham and overlap matrices from the linear scaling quickstep SCF environment.

source: pexsi_methods.F
Loading...

public Subroutines/Functions:

Calculate density matrix, energy-weighted density matrix and entropic energy contribution with the DFT driver of the PEXSI library.
Deallocations and post-processing after SCF
Read CP2K input section PEXSI and pass it to the PEXSI environment
Initializations needed before SCF
Set PEXSI convergence tolerance (numElectronPEXSITolerance), adapted to the convergence error of the previous SCF step. The tolerance is calculated using an initial convergence threshold (tol_nel_initial) and a target convergence threshold (tol_nel_target): numElectronPEXSITolerance(delta_scf) = alpha*delta_scf+beta where alpha and beta are chosen such that numElectronPEXSITolerance(delta_scf_0) = tol_nel_initial numElectronPEXSITolerance(eps_scf) = tol_nel_target and delta_scf_0 is the initial SCF convergence error.
Pass energy weighted density matrix and entropic energy contribution to QS environment

SUBROUTINEdensity_matrix_pexsi(pexsi_env, matrix_p, matrix_w, kts, matrix_ks, matrix_s, nelectron_exact, mu, iscf, ispin)

Calculate density matrix, energy-weighted density matrix and entropic energy contribution with the DFT driver of the PEXSI library.

Arguments:
INTENT(inout)
:: pexsi_env PEXSI environment
TYPE(dbcsr_type),
INTENT(inout)
:: matrix_p density matrix returned by PEXSI
INTENT(inout)
:: matrix_w energy-weighted density matrix returned by PEXSI
REAL(dp),
INTENT(out)
:: kts entropic energy contribution returned by PEXSI
TYPE(dbcsr_type),
INTENT(in),
TARGET
:: matrix_ks Kohn-Sham matrix from linear scaling QS environment
TYPE(dbcsr_type),
INTENT(in),
TARGET
:: matrix_s overlap matrix from linear scaling QS environment
INTEGER,
INTENT(in)
:: nelectron_exact exact number of electrons
REAL(dp),
INTENT(out)
:: mu chemical potential calculated by PEXSI
INTEGER,
INTENT(in)
:: iscf SCF step
INTEGER,
INTENT(in)
:: ispin Number of spin

SUBROUTINEpexsi_finalize_scf(pexsi_env, mu_spin)

Deallocations and post-processing after SCF

Arguments:
INTENT(inout)
:: pexsi_env ...
REAL(dp),
INTENT(in)
:: mu_spin(2) ...

SUBROUTINEpexsi_init_read_input(pexsi_section, pexsi_env)

Read CP2K input section PEXSI and pass it to the PEXSI environment

Arguments:
INTENT(in),
POINTER
:: pexsi_section ...
INTENT(inout)
:: pexsi_env ...

SUBROUTINEpexsi_init_scf(ks_env, pexsi_env, template_matrix)

Initializations needed before SCF

Arguments:
POINTER
:: ks_env ...
INTENT(inout)
:: pexsi_env ...
TYPE(dbcsr_type),
INTENT(in)
:: template_matrix DBCSR matrix that defines the block structure and sparsity pattern of all matrices that are sent to PEXSI

SUBROUTINEpexsi_set_convergence_tolerance(pexsi_env, delta_scf, eps_scf, initialize, check_convergence)

Set PEXSI convergence tolerance (numElectronPEXSITolerance), adapted to the convergence error of the previous SCF step. The tolerance is calculated using an initial convergence threshold (tol_nel_initial) and a target convergence threshold (tol_nel_target): numElectronPEXSITolerance(delta_scf) = alpha*delta_scf+beta where alpha and beta are chosen such that numElectronPEXSITolerance(delta_scf_0) = tol_nel_initial numElectronPEXSITolerance(eps_scf) = tol_nel_target and delta_scf_0 is the initial SCF convergence error.

Arguments:
INTENT(inout)
:: pexsi_env ...
REAL(dp),
INTENT(in)
:: delta_scf convergence error of previous SCF step
REAL(dp),
INTENT(in)
:: eps_scf SCF convergence criterion
LOGICAL,
INTENT(in)
:: initialize whether or not adaptive thresholing should be initialized with delta_scf as initial convergence error
LOGICAL,
INTENT(out)
:: check_convergence is set to .FALSE. if convergence in number of electrons will not be achieved in next SCF step

SUBROUTINEpexsi_to_qs(ls_scf_env, qs_env, kts, matrix_w)

Pass energy weighted density matrix and entropic energy contribution to QS environment

Arguments:
:: ls_scf_env ...
INTENT(inout),
POINTER
:: qs_env ...
REAL(dp),
INTENT(in),
OPTIONAL
:: kts(:) ...
INTENT(in),
OPTIONAL
:: matrix_w(:) ...