## Documentation for module qs_mo_methods

collects routines that perform operations directly related to MOs

source: qs_mo_methods.F

#### Generic procedures:

calculate_density_matrix
calculate_subspace_eigenvalues
make_basis_sv

#### public Subroutines/Functions:

...
...
return a set of S orthonormal vectors (C^T S C == 1) where the cholesky decomposed form of S is passed as an argument
return a set of S orthonormal vectors (C^T S C == 1) where a Loedwin transformation is applied to keep the rotated vectors as close as possible to the original ones
given a set of vectors, return an orthogonal (C^T C == 1) set spanning the same space (notice, only for cases where S==1)
returns an S-orthonormal basis v (v^T S v ==1)
Calculate KS eigenvalues starting from OF MOS

#### Generic procedure calculate_density_matrix^

Calculate the density matrix

POINTER
:: mo_set ×
TYPE(dbcsr_type),
POINTER
:: density_matrix ×
LOGICAL,
INTENT(in),
OPTIONAL
:: use_dbcsr ×
LOGICAL,
INTENT(in),
OPTIONAL
:: retain_sparsity ×

#### Generic procedure calculate_subspace_eigenvalues^

computes ritz values of a set of orbitals given a ks_matrix rotates the orbitals into eigenstates depending on do_rotation writes the evals to the screen depending on ionode/scr

TYPE(cp_fm_type),
POINTER
:: orbitals ×
TYPE(dbcsr_type),
POINTER
:: orbitals ×
TYPE(dbcsr_type),
POINTER
:: ks_matrix × ×
REAL(dp),
OPTIONAL
:: evals_arg(:) × ×
LOGICAL,
INTENT(in),
OPTIONAL
:: ionode × ×
INTEGER,
INTENT(in),
OPTIONAL
:: scr × ×
LOGICAL,
INTENT(in),
OPTIONAL
:: do_rotation × ×
TYPE(cp_fm_type),
OPTIONAL, POINTER
:: co_rotate ×
TYPE(dbcsr_type),
OPTIONAL, POINTER
:: co_rotate ×
TYPE(dbcsr_type),
OPTIONAL, POINTER
:: co_rotate_dbcsr ×
POINTER
:: para_env ×
POINTER
:: blacs_env ×

#### Generic procedure make_basis_sv^

returns an S-orthonormal basis v and the corresponding matrix S*v as well

TYPE(cp_fm_type),
POINTER
:: vmatrix ×
:: vmatrix ×
INTEGER,
INTENT(in)
:: ncol × ×
TYPE(cp_fm_type),
POINTER
:: svmatrix ×
:: svmatrix ×
POINTER
:: para_env ×
POINTER
:: blacs_env ×

#### SUBROUTINEcalculate_magnitude(mo_array, mo_mag_min, mo_mag_max)^

...

##### Arguments:
 TYPE(mo_set_p_type), POINTER :: mo_array(:) ... REAL(dp) :: mo_mag_min ... REAL(dp) :: mo_mag_max ...

#### SUBROUTINEcalculate_orthonormality(orthonormality, mo_array, matrix_s)^

...

##### Arguments:
 REAL(dp) :: orthonormality ... TYPE(mo_set_p_type), POINTER :: mo_array(:) ... TYPE(dbcsr_type), OPTIONAL, POINTER :: matrix_s ...

#### SUBROUTINEmake_basis_cholesky(vmatrix, ncol, ortho)^

return a set of S orthonormal vectors (C^T S C == 1) where the cholesky decomposed form of S is passed as an argument

##### Arguments:
 TYPE(cp_fm_type), POINTER :: vmatrix ... INTEGER, INTENT(in) :: ncol ... TYPE(cp_fm_type), POINTER :: ortho cholesky decomposed S matrix

#### SUBROUTINEmake_basis_lowdin(vmatrix, ncol, matrix_s)^

return a set of S orthonormal vectors (C^T S C == 1) where a Loedwin transformation is applied to keep the rotated vectors as close as possible to the original ones

##### Arguments:
 TYPE(cp_fm_type), POINTER :: vmatrix ... INTEGER, INTENT(in) :: ncol ... TYPE(dbcsr_type), POINTER :: matrix_s ...

#### SUBROUTINEmake_basis_simple(vmatrix, ncol)^

given a set of vectors, return an orthogonal (C^T C == 1) set spanning the same space (notice, only for cases where S==1)

##### Arguments:
 TYPE(cp_fm_type), POINTER :: vmatrix ... INTEGER, INTENT(in) :: ncol ...

#### SUBROUTINEmake_basis_sm(vmatrix, ncol, matrix_s)^

returns an S-orthonormal basis v (v^T S v ==1)

##### Arguments:
 TYPE(cp_fm_type), POINTER :: vmatrix ... INTEGER, INTENT(in) :: ncol ... TYPE(dbcsr_type), POINTER :: matrix_s ...

#### SUBROUTINEmake_mo_eig(mos, nspins, ks_rmpv, scf_control, mo_derivs, admm_env)^

Calculate KS eigenvalues starting from OF MOS

##### Arguments:
 TYPE(mo_set_p_type), POINTER :: mos(:) ... INTEGER, INTENT(in) :: nspins ... TYPE(dbcsr_p_type), POINTER :: ks_rmpv(:) ... TYPE(scf_control_type), POINTER :: scf_control ... TYPE(dbcsr_p_type), POINTER :: mo_derivs(:) ... TYPE(admm_type), OPTIONAL, POINTER :: admm_env ...

#### SUBROUTINEcalculate_dm_sparse(mo_set, density_matrix, use_dbcsr, retain_sparsity)^

Calculate the density matrix

##### Arguments:
 TYPE(mo_set_type), POINTER :: mo_set ... TYPE(dbcsr_type), POINTER :: density_matrix ... LOGICAL, INTENT(in), OPTIONAL :: use_dbcsr ... LOGICAL, INTENT(in), OPTIONAL :: retain_sparsity ...

#### SUBROUTINEsubspace_eigenvalues_ks_fm(orbitals, ks_matrix, evals_arg, ionode, scr, do_rotation, co_rotate, co_rotate_dbcsr)^

computes ritz values of a set of orbitals given a ks_matrix rotates the orbitals into eigenstates depending on do_rotation writes the evals to the screen depending on ionode/scr

##### Arguments:
 TYPE(cp_fm_type), POINTER :: orbitals S-orthonormal orbitals TYPE(dbcsr_type), POINTER :: ks_matrix Kohn-Sham matrix REAL(dp), OPTIONAL :: evals_arg(:) optional, filled with the evals LOGICAL, INTENT(in), OPTIONAL :: ionode if present write to unit scr where ionode INTEGER, INTENT(in), OPTIONAL :: scr if present write to unit scr where ionode LOGICAL, INTENT(in), OPTIONAL :: do_rotation optional rotate orbitals (default=.TRUE.) note that rotating the orbitals is slower TYPE(cp_fm_type), OPTIONAL, POINTER :: co_rotate an optional set of orbitals rotated by the same rotation matrix TYPE(dbcsr_type), OPTIONAL, POINTER :: co_rotate_dbcsr ...

#### SUBROUTINEsubspace_eigenvalues_ks_dbcsr(orbitals, ks_matrix, evals_arg, ionode, scr, do_rotation, co_rotate, para_env, blacs_env)^

...

##### Arguments:
 TYPE(dbcsr_type), POINTER :: orbitals ... TYPE(dbcsr_type), POINTER :: ks_matrix ... REAL(dp), OPTIONAL :: evals_arg(:) ... LOGICAL, INTENT(in), OPTIONAL :: ionode ... INTEGER, INTENT(in), OPTIONAL :: scr ... LOGICAL, INTENT(in), OPTIONAL :: do_rotation ... TYPE(dbcsr_type), OPTIONAL, POINTER :: co_rotate ... TYPE(cp_para_env_type), POINTER :: para_env ... TYPE(cp_blacs_env_type), POINTER :: blacs_env ...

#### SUBROUTINEmake_basis_sv_fm(vmatrix, ncol, svmatrix)^

returns an S-orthonormal basis v and the corresponding matrix S*v as well

##### Arguments:
 TYPE(cp_fm_type), POINTER :: vmatrix ... INTEGER, INTENT(in) :: ncol ... TYPE(cp_fm_type), POINTER :: svmatrix ...

#### SUBROUTINEmake_basis_sv_dbcsr(vmatrix, ncol, svmatrix, para_env, blacs_env)^

...

##### Arguments:
 TYPE(dbcsr_type) :: vmatrix ... INTEGER, INTENT(in) :: ncol ... TYPE(dbcsr_type) :: svmatrix ... TYPE(cp_para_env_type), POINTER :: para_env ... TYPE(cp_blacs_env_type), POINTER :: blacs_env ...