(git:6a2e663)
qs_tddfpt2_eigensolver Module Reference

Functions/Subroutines

subroutine, public tddfpt_orthogonalize_psi1_psi0 (evects, S_C0_C0T)
 Make TDDFPT trial vectors orthogonal to all occupied molecular orbitals. More...
 
subroutine, public tddfpt_orthonormalize_psi1_psi1 (evects, nvects_new, S_evects, matrix_s)
 Make new TDDFPT trial vectors orthonormal to all previous trial vectors. More...
 
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. More...
 

Function/Subroutine Documentation

◆ tddfpt_orthogonalize_psi1_psi0()

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 
)

Make TDDFPT trial vectors orthogonal to all occupied molecular orbitals.

Parameters
evectstrial vectors distributed across all processors (modified on exit)
S_C0_C0Tmatrix 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
History
  • 05.2016 created [Sergey Chulkov]
  • 05.2019 use a temporary work matrix [JHU]
Note
Based on the subroutine p_preortho() which was created by Thomas Chassaing on 09.2002. Should be useless when ground state MOs are computed with extremely high accuracy, as all virtual orbitals are already orthogonal to the occupied ones by design. However, when the norm of residual vectors is relatively small (e.g. less then SCF_EPS), new Krylov's vectors seem to be random and should be orthogonalised even with respect to the occupied MOs.

Definition at line 94 of file qs_tddfpt2_eigensolver.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tddfpt_orthonormalize_psi1_psi1()

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(in)  S_evects,
type(dbcsr_type), pointer  matrix_s 
)

Make new TDDFPT trial vectors orthonormal to all previous trial vectors.

Parameters
evectstrial vectors (modified on exit)
nvects_newnumber of new trial vectors to orthogonalise
S_evectsset of matrices to store matrix product S * evects (modified on exit)
matrix_soverlap matrix
History
  • 05.2016 created [Sergey Chulkov]
  • 02.2017 caching the matrix product S * evects [Sergey Chulkov]
Note

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 224 of file qs_tddfpt2_eigensolver.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tddfpt_davidson_solver()

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.

Parameters
evectsTDDFPT trial vectors (modified on exit)
evalsTDDFPT eigenvalues (modified on exit)
S_evectscached matrix product S * evects (modified on exit)
gs_mosmolecular orbitals optimised for the ground state
tddfpt_controlTDDFPT control parameters
matrix_ksKohn-Sham matrix
qs_envQuickstep environment
kernel_envkernel environment
sub_envparallel (sub)group environment
loggerCP2K logger
iter_unitI/O unit to write basic iteration information
energy_unitI/O unit to write detailed energy information
tddfpt_print_sectionTDDFPT print input section (need to write TDDFPT restart files)
work_matricescollection of work matrices (modified on exit)
Returns
energy convergence achieved (in Hartree)
History
  • 03.2017 code related to Davidson eigensolver has been moved here from the main subroutine tddfpt() [Sergey Chulkov]
Note
Based on the subroutines apply_op() and iterative_solver() originally created by Thomas Chassaing in 2002.

Definition at line 720 of file qs_tddfpt2_eigensolver.F.

Here is the call graph for this function:
Here is the caller graph for this function: