Documentation for module qs_ks_methods

routines that build the Kohn-Sham matrix (i.e calculate the coulomb and xc parts

source: qs_ks_methods.F
Loading...

Generic procedures:

calculate_w_matrix

public Subroutines/Functions:

Calculate the W matrix from the MO coefs, MO derivs could overwrite the mo_derivs for increased memory efficiency
...
Allocate ks_matrix and ks_env if necessary
routine where the real calculations are made: the KS matrix is calculated
updates the Kohn Sham matrix of the given qs_env (facility method)

Generic procedure calculate_w_matrix

...

POINTER
:: mo_set × ×
TYPE(dbcsr_type),
POINTER
:: w_matrix ×
TYPE(dbcsr_type),
POINTER
:: matrix_ks ×
TYPE(dbcsr_type),
POINTER
:: matrix_p ×
TYPE(dbcsr_type),
POINTER
:: matrix_w ×

SUBROUTINEcalculate_w_matrix_ot(mo_set, mo_deriv, w_matrix, s_matrix)

Calculate the W matrix from the MO coefs, MO derivs could overwrite the mo_derivs for increased memory efficiency

Arguments:
POINTER
:: mo_set type containing the full matrix of the MO coefs mo_deriv:
TYPE(dbcsr_type),
POINTER
:: mo_deriv ...
TYPE(dbcsr_type),
POINTER
:: w_matrix sparse matrix
TYPE(dbcsr_type),
POINTER
:: s_matrix sparse matrix for the overlap error

SUBROUTINEcalc_rho_tot_gspace(rho_tot_gspace, qs_env, rho, skip_nuclear_density)

...

Arguments:
TYPE(pw_p_type),
INTENT(inout)
:: rho_tot_gspace ...
POINTER
:: qs_env ...
POINTER
:: rho ...
LOGICAL,
INTENT(in),
OPTIONAL
:: skip_nuclear_density ...

SUBROUTINEqs_ks_allocate_basics(qs_env)

Allocate ks_matrix and ks_env if necessary

Arguments:
POINTER
:: qs_env ...

SUBROUTINEqs_ks_build_kohn_sham_matrix(qs_env, calculate_forces, just_energy, print_active, ext_ks_matrix)

routine where the real calculations are made: the KS matrix is calculated

Arguments:
POINTER
:: qs_env the qs_env to update
LOGICAL,
INTENT(in)
:: calculate_forces if true calculate the quantities needed to calculate the forces. Defaults to false.
LOGICAL,
INTENT(in)
:: just_energy if true updates the energies but not the ks matrix. Defaults to false
LOGICAL,
INTENT(in),
OPTIONAL
:: print_active ...
OPTIONAL, POINTER
:: ext_ks_matrix(:) ...

SUBROUTINEqs_ks_update_qs_env(qs_env, calculate_forces, just_energy, print_active)

updates the Kohn Sham matrix of the given qs_env (facility method)

Arguments:
POINTER
:: qs_env the qs_env to update
LOGICAL,
INTENT(in),
OPTIONAL
:: calculate_forces if true calculate the quantities needed to calculate the forces. Defaults to false.
LOGICAL,
INTENT(in),
OPTIONAL
:: just_energy if true updates the energies but not the ks matrix. Defaults to false
LOGICAL,
INTENT(in),
OPTIONAL
:: print_active ...

SUBROUTINEcalculate_w_matrix_1(mo_set, w_matrix)

Calculate the W matrix from the MO eigenvectors, MO eigenvalues, and the MO occupation numbers. Only works if they are eigenstates

Arguments:
POINTER
:: mo_set type containing the full matrix of the MO and the eigenvalues
TYPE(dbcsr_type),
POINTER
:: w_matrix sparse matrix error

SUBROUTINEcalculate_w_matrix_roks(mo_set, matrix_ks, matrix_p, matrix_w)

Calculate the energy-weighted density matrix W if ROKS is active. The W matrix is returned in matrix_w.

Arguments:
POINTER
:: mo_set ...
TYPE(dbcsr_type),
POINTER
:: matrix_ks ...
TYPE(dbcsr_type),
POINTER
:: matrix_p ...
TYPE(dbcsr_type),
POINTER
:: matrix_w ...