![]() |
(git:b77b4be)
|
Functions/Subroutines | |
subroutine, public | tddfpt_orthogonalize_psi1_psi0 (evects, s_c0_c0t, qs_env, gs_mos, evals, tddfpt_control, s_c0) |
Make TDDFPT trial vectors orthogonal to all occupied molecular orbitals. | |
subroutine, public | tddfpt_orthonormalize_psi1_psi1 (evects, nvects_new, s_evects, matrix_s) |
Make new TDDFPT trial vectors orthonormal to all previous trial vectors. | |
real(kind=dp) function, public | tddfpt_davidson_solver (evects, evals, s_evects, gs_mos, tddfpt_control, matrix_ks, qs_env, kernel_env, sub_env, logger, iter_unit, energy_unit, tddfpt_print_section, work_matrices) |
Perform Davidson iterations. | |
subroutine, public qs_tddfpt2_eigensolver::tddfpt_orthogonalize_psi1_psi0 | ( | type(cp_fm_type), dimension(:, :), intent(in) | evects, |
type(cp_fm_type), dimension(:), intent(in) | s_c0_c0t, | ||
type(qs_environment_type), pointer | qs_env, | ||
type(tddfpt_ground_state_mos), dimension(:), intent(in) | gs_mos, | ||
real(kind=dp), dimension(:), intent(in) | evals, | ||
type(tddfpt2_control_type), intent(in), pointer | tddfpt_control, | ||
type(cp_fm_type), dimension(:), intent(in) | s_c0 | ||
) |
Make TDDFPT trial vectors orthogonal to all occupied molecular orbitals.
evects | trial vectors distributed across all processors (modified on exit) |
S_C0_C0T | matrix product S * C_0 * C_0^T, where C_0 is the ground state wave function for each spin expressed in atomic basis set, and S is the corresponding overlap matrix |
qs_env | ... |
gs_mos | ... |
evals | ... |
tddfpt_control | ... |
S_C0 | ... |
Definition at line 102 of file qs_tddfpt2_eigensolver.F.
subroutine, public qs_tddfpt2_eigensolver::tddfpt_orthonormalize_psi1_psi1 | ( | type(cp_fm_type), dimension(:, :), intent(in) | evects, |
integer, intent(in) | nvects_new, | ||
type(cp_fm_type), dimension(:, :), intent(inout) | s_evects, | ||
type(dbcsr_type), pointer | matrix_s | ||
) |
Make new TDDFPT trial vectors orthonormal to all previous trial vectors.
evects | trial vectors (modified on exit) |
nvects_new | number of new trial vectors to orthogonalise |
S_evects | set of matrices to store matrix product S * evects (modified on exit) |
matrix_s | overlap matrix |
Based on the subroutines reorthogonalize() and normalize() which were originally created by Thomas Chassaing on 03.2003.
In order to orthogonalise a trial vector C3 = evects(:,3) with respect to previously orthogonalised vectors C1 = evects(:,1) and C2 = evects(:,2) we need to compute the quantity C3'' using the following formulae: C3' = C3 - Tr(C3^T * S * C1) * C1, C3'' = C3' - Tr(C3'^T * S * C2) * C2, which can be expanded as: C3'' = C3 - Tr(C3^T * S * C1) * C1 - Tr(C3^T * S * C2) * C2 + Tr(C3^T * S * C1) * Tr(C2^T * S * C1) * C2 . In case of unlimited float-point precision, the last term in above expression is exactly 0, due to orthogonality condition between C1 and C2. In this case the expression could be simplified as (taking into account the identity: Tr(A * S * B) = Tr(B * S * A)): C3'' = C3 - Tr(C1^T * S * C3) * C1 - Tr(C2^T * S * C3) * C2 , which means we do not need the variable S_evects to keep the matrix products S * Ci .
In reality, however, we deal with limited float-point precision arithmetic meaning that the trace Tr(C2^T * S * C1) is close to 0 but does not equal to 0 exactly. The term Tr(C3^T * S * C1) * Tr(C2^T * S * C1) * C2 can not be ignored anymore. Ignorance of this term will lead to numerical instability when the trace Tr(C3^T * S * C1) is large enough.
Definition at line 262 of file qs_tddfpt2_eigensolver.F.
real(kind=dp) function, public qs_tddfpt2_eigensolver::tddfpt_davidson_solver | ( | type(cp_fm_type), dimension(:, :), intent(inout) | evects, |
real(kind=dp), dimension(:), intent(inout) | evals, | ||
type(cp_fm_type), dimension(:, :), intent(inout) | s_evects, | ||
type(tddfpt_ground_state_mos), dimension(:), intent(in) | gs_mos, | ||
type(tddfpt2_control_type), pointer | tddfpt_control, | ||
type(dbcsr_p_type), dimension(:), pointer | matrix_ks, | ||
type(qs_environment_type), pointer | qs_env, | ||
type(kernel_env_type), intent(in) | kernel_env, | ||
type(tddfpt_subgroup_env_type), intent(in) | sub_env, | ||
type(cp_logger_type), pointer | logger, | ||
integer, intent(in) | iter_unit, | ||
integer, intent(in) | energy_unit, | ||
type(section_vals_type), pointer | tddfpt_print_section, | ||
type(tddfpt_work_matrices), intent(inout) | work_matrices | ||
) |
Perform Davidson iterations.
evects | TDDFPT trial vectors (modified on exit) |
evals | TDDFPT eigenvalues (modified on exit) |
S_evects | cached matrix product S * evects (modified on exit) |
gs_mos | molecular orbitals optimised for the ground state |
tddfpt_control | TDDFPT control parameters |
matrix_ks | Kohn-Sham matrix |
qs_env | Quickstep environment |
kernel_env | kernel environment |
sub_env | parallel (sub)group environment |
logger | CP2K logger |
iter_unit | I/O unit to write basic iteration information |
energy_unit | I/O unit to write detailed energy information |
tddfpt_print_section | TDDFPT print input section (need to write TDDFPT restart files) |
work_matrices | collection of work matrices (modified on exit) |
Definition at line 772 of file qs_tddfpt2_eigensolver.F.