120#include "./base/base_uses.f90"
126 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_tddfpt2_methods'
128 LOGICAL,
PARAMETER,
PRIVATE :: debug_this_module = .false.
130 INTEGER,
PARAMETER,
PRIVATE :: nderivs = 3
131 INTEGER,
PARAMETER,
PRIVATE :: maxspins = 2
151 SUBROUTINE tddfpt(qs_env, calc_forces, rixs_env)
153 LOGICAL,
INTENT(IN) :: calc_forces
156 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt'
158 INTEGER :: handle, ispin, istate, log_unit, mult, &
159 my_state, nao, nocc, nspins, &
160 nstate_max, nstates, nvirt, old_state
161 INTEGER,
DIMENSION(maxspins) :: nactive
162 LOGICAL :: do_admm, do_exck, do_hfx, do_hfxlr, &
163 do_hfxsr, do_rixs, do_sf, do_soc, &
164 lmult_tmp, state_change
165 REAL(kind=
dp) :: gsmin, gsval, xsval
166 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals, ostrength
171 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: my_active, my_mos
172 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: dipole_op_mos_occ, evects, s_evects
174 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_ks, matrix_ks_oep, matrix_s, &
176 matrix_s_aux_fit_vs_orb
181 TYPE(
mo_set_type),
DIMENSION(:),
POINTER :: mos, mos_aux_fit
184 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
188 lri_section, soc_section, &
189 tddfpt_print_section, tddfpt_section, &
199 CALL timeset(routinen, handle)
204 NULLIFY (tddfpt_section, tddfpt_control)
207 blacs_env=blacs_env, &
209 dft_control=dft_control, &
210 matrix_ks=matrix_ks, &
218 NULLIFY (rixs_control, valence_state)
219 rixs_control => dft_control%rixs_control
220 tddfpt_control => rixs_control%tddfpt2_control
221 valence_state => rixs_env%valence_state
224 tddfpt_control => dft_control%tddfpt2_control
228 CALL tddfpt_input(qs_env, tddfpt_section, tddfpt_control, do_hfx, do_admm, do_exck, &
229 do_hfxsr, do_hfxlr, xc_section, tddfpt_print_section, &
230 lri_section, hfxsr_section)
233 extension=
".tddfptLog")
235 tddfpt_control%do_hfx = do_hfx
236 tddfpt_control%do_admm = do_admm
237 tddfpt_control%do_hfxsr = do_hfxsr
238 tddfpt_control%hfxsr_primbas = 0
239 tddfpt_control%hfxsr_re_int = .true.
240 tddfpt_control%do_hfxlr = do_hfxlr
241 tddfpt_control%do_exck = do_exck
244 IF (tddfpt_control%do_hfxlr)
THEN
256 lmult_tmp = tddfpt_control%rks_triplets
257 tddfpt_control%rks_triplets = .NOT. (tddfpt_control%rks_triplets)
267 CALL kernel_info(log_unit, dft_control, tddfpt_control, xc_section)
274 IF (tddfpt_control%do_smearing)
THEN
281 IF ((tddfpt_control%do_lrigpw) .AND. &
283 CALL cp_abort(__location__,
"LRI only implemented for full kernel")
286 IF (
ASSOCIATED(matrix_ks_oep)) matrix_ks => matrix_ks_oep
290 CALL init_res_method(qs_env, gs_mos, tddfpt_control, tddfpt_section, log_unit)
298 nspins =
SIZE(gs_mos)
301 mult = abs(
SIZE(gs_mos(1)%evals_occ) -
SIZE(gs_mos(2)%evals_occ)) + 1
303 CALL cp_warn(__location__,
"There is a convergence issue for multiplicity >= 3")
305 IF (tddfpt_control%rks_triplets)
THEN
313 ALLOCATE (my_mos(nspins), my_active(nspins))
315 my_mos(ispin) = gs_mos(ispin)%mos_occ
316 my_active(ispin) = gs_mos(ispin)%mos_active
319 mos_occ=my_mos(:), mos_active=my_active(:), &
320 kernel=tddfpt_control%kernel)
321 DEALLOCATE (my_mos, my_active)
325 IF (dft_control%qs_control%xtb)
THEN
326 cpabort(
"TDDFPT: xTB only works with sTDA Kernel")
329 IF (tddfpt_control%do_hfxsr)
THEN
332 i_val=tddfpt_control%hfxsr_primbas)
335 primitive=tddfpt_control%hfxsr_primbas)
337 ALLOCATE (full_kernel_env%admm_control)
343 full_kernel_env%hfxsr_section => hfxsr_section
346 full_kernel_env%admm_control,
"TDA_HFX")
347 CALL get_admm_env(full_kernel_env%admm_env, mos_aux_fit=mos_aux_fit, &
348 matrix_s_aux_fit=matrix_s_aux_fit, &
349 matrix_s_aux_fit_vs_orb=matrix_s_aux_fit_vs_orb)
351 matrix_s_aux_fit_vs_orb, mos, mos_aux_fit, .true.)
353 CALL get_qs_env(qs_env, cell=cell, atomic_kind_set=atomic_kind_set, &
354 qs_kind_set=qs_kind_set, particle_set=particle_set, &
356 CALL hfx_create(full_kernel_env%x_data, para_env, hfxsr_section, atomic_kind_set, &
357 qs_kind_set, particle_set, dft_control, cell, orb_basis=
"TDA_HFX")
361 nstates = tddfpt_control%nstates
371 nstate_max = nocc*nvirt
372 IF (nstates > nstate_max)
THEN
373 cpwarn(
"NUMBER OF EXCITED STATES COULD LEAD TO PROBLEMS!")
374 cpwarn(
"Experimental: CHANGED NSTATES TO ITS MAXIMUM VALUE!")
376 tddfpt_control%nstates = nstate_max
379 do_hfx, do_admm, do_hfxlr, do_exck, do_sf, qs_env, sub_env)
382 kernel_env%full_kernel => full_kernel_env
383 kernel_env%admm_kernel => kernel_env_admm_aux
384 NULLIFY (kernel_env%stda_kernel)
396 nactive = tddfpt_control%nactive
401 nstates = tddfpt_control%nstates
405 work_matrices, tddfpt_control)
407 kernel_env%stda_kernel => stda_kernel
408 NULLIFY (kernel_env%full_kernel)
409 NULLIFY (kernel_env%admm_kernel)
412 nstates = tddfpt_control%nstates
414 NULLIFY (kernel_env%full_kernel)
415 NULLIFY (kernel_env%admm_kernel)
416 NULLIFY (kernel_env%stda_kernel)
421 ALLOCATE (evects(1, nstates))
423 ALLOCATE (evects(nspins, nstates))
425 ALLOCATE (evals(nstates))
426 ALLOCATE (s_evects(
SIZE(evects, 1), nstates))
428 DO istate = 1, nstates
429 DO ispin = 1,
SIZE(evects, 1)
431 work_matrices%fm_pool_ao_mo_active(ispin)%pool, &
432 s_evects(ispin, istate))
436 IF (.NOT. do_soc)
THEN
439 tddfpt_control, logger, tddfpt_print_section, evects, evals, &
440 gs_mos, tddfpt_section, s_evects, matrix_s, kernel_env, matrix_ks, &
441 sub_env, ostrength, dipole_op_mos_occ, mult, xc_section, full_kernel_env, &
444 CALL tddfpt_soc_energies(qs_env, nstates, work_matrices, &
445 tddfpt_control, logger, tddfpt_print_section, &
446 evects, evals, ostrength, &
447 gs_mos, tddfpt_section, s_evects, matrix_s, kernel_env, matrix_ks, &
448 sub_env, dipole_op_mos_occ, lmult_tmp, xc_section, full_kernel_env, &
453 IF (calc_forces)
THEN
455 tddfpt_print_section, gs_mos, &
456 kernel_env, sub_env, work_matrices)
460 IF (qs_env%excited_state)
THEN
461 IF (sub_env%is_split)
THEN
462 CALL cp_abort(__location__, &
463 "Excited state forces not possible when states"// &
464 " are distributed to different CPU pools.")
467 IF (
ASSOCIATED(matrix_ks_oep))
CALL get_qs_env(qs_env, matrix_ks=matrix_ks)
469 state_change = .false.
470 IF (ex_env%state > 0)
THEN
471 my_state = ex_env%state
472 ELSEIF (ex_env%state < 0)
THEN
474 ALLOCATE (my_mos(nspins))
476 my_mos(ispin) = gs_mos(ispin)%mos_occ
478 my_state = abs(ex_env%state)
479 CALL assign_state(qs_env, matrix_s, evects, my_mos, ex_env%wfn_history, my_state)
481 IF (my_state /= abs(ex_env%state))
THEN
482 state_change = .true.
483 old_state = abs(ex_env%state)
485 ex_env%state = -my_state
487 CALL cp_warn(__location__, &
488 "Active excited state not assigned. Use the first state.")
491 cpassert(my_state > 0)
492 IF (my_state > nstates)
THEN
493 CALL cp_warn(__location__, &
494 "There were not enough excited states calculated.")
495 cpabort(
"excited state potential energy surface")
499 ex_env%evalue = evals(my_state)
502 ALLOCATE (ex_env%evect(
SIZE(evects, 1)))
503 DO ispin = 1,
SIZE(evects, 1)
505 matrix_struct=matrix_struct)
507 CALL cp_fm_to_fm(evects(ispin, my_state), ex_env%evect(ispin))
510 IF (log_unit > 0)
THEN
511 gsval = ex_env%wfn_history%gsval
512 gsmin = ex_env%wfn_history%gsmin
513 xsval = ex_env%wfn_history%xsval
514 WRITE (log_unit,
"(1X,A,T40,F10.6,A,T62,F10.6,A)")
"Ground state orbital alignment:", &
515 gsmin,
"[MinVal]", gsval,
"[Average]"
516 WRITE (log_unit,
"(1X,A,T71,F10.6)")
"Excitation vector alignment:", xsval
517 IF (state_change)
THEN
518 WRITE (log_unit,
"(1X,A,I5,T60,A14,T76,I5)") &
519 "Target state has been changed from state ", &
520 old_state,
" to new state ", my_state
522 WRITE (log_unit,
"(1X,A,I4,A,F12.5,A)")
"Calculate properties for state:", &
523 my_state,
" with excitation energy ", ex_env%evalue*
evolt,
" eV"
527 IF (calc_forces)
THEN
529 sub_env, work_matrices)
536 valence_state%nstates = nstates
537 ALLOCATE (valence_state%evals(
SIZE(evals)))
538 valence_state%evals(:) = evals(:)
540 ALLOCATE (valence_state%evects(nspins, nstates))
541 ALLOCATE (valence_state%mos_active(nspins))
544 DO istate = 1, nstates
546 matrix_struct=matrix_struct)
547 CALL cp_fm_create(valence_state%evects(ispin, istate), matrix_struct)
548 CALL cp_fm_to_fm(evects(ispin, istate), valence_state%evects(ispin, istate))
552 matrix_struct=matrix_struct)
553 CALL cp_fm_create(valence_state%mos_active(ispin), matrix_struct)
554 CALL cp_fm_to_fm(gs_mos(ispin)%mos_active, valence_state%mos_active(ispin))
564 tddfpt_print_section, &
567 DEALLOCATE (evals, ostrength)
571 IF (tddfpt_control%do_lrigpw)
THEN
573 DEALLOCATE (kernel_env%full_kernel%lri_env)
575 DEALLOCATE (kernel_env%full_kernel%lri_density)
583 cpabort(
'Unknown kernel type')
590 DO ispin = nspins, 1, -1
595 IF (
ASSOCIATED(matrix_ks_oep)) &
598 CALL timestop(handle)
617 SUBROUTINE tddfpt_input(qs_env, tddfpt_section, tddfpt_control, do_hfx, do_admm, do_exck, &
618 do_hfxsr, do_hfxlr, xc_section, tddfpt_print_section, lri_section, &
623 LOGICAL,
INTENT(INOUT) :: do_hfx, do_admm, do_exck, do_hfxsr, &
626 lri_section, hfxsr_section
628 CHARACTER(len=20) :: nstates_str
629 LOGICAL :: exar, exf, exgcp, exhf, exhfxk, exk, &
630 explicit_root, expot, exvdw, exwfn, &
632 REAL(kind=
dp) :: c_hf
637 NULLIFY (dft_control, input)
638 CALL get_qs_env(qs_env, dft_control=dft_control, input=input)
641 IF (dft_control%nimages > 1) cpabort(
"k-points not implemented for TDDFPT")
643 IF (tddfpt_control%nstates <= 0)
THEN
645 CALL cp_warn(__location__,
"TDDFPT calculation was requested for "// &
646 trim(nstates_str)//
" excited states: nothing to do.")
650 NULLIFY (tddfpt_print_section)
658 IF (explicit_root)
THEN
664 CALL cp_warn(__location__,
"TDDFPT Kernel with ADIABATIC_RESCALING not possible.")
665 cpabort(
"TDDFPT Input")
672 CALL cp_warn(__location__,
"TDDFPT Kernel with GCP_POTENTIAL not possible.")
673 cpabort(
"TDDFPT Input")
680 CALL cp_warn(__location__,
"TDDFPT Kernel with VDW_POTENTIAL not possible.")
681 cpabort(
"TDDFPT Input")
688 CALL cp_warn(__location__,
"TDDFPT Kernel with WF_CORRELATION not possible.")
689 cpabort(
"TDDFPT Input")
696 CALL cp_warn(__location__,
"TDDFPT Kernel with XC_POTENTIAL not possible.")
697 cpabort(
"TDDFPT Input")
706 IF ((exf .AND. exk) .OR. .NOT. (exf .OR. exk))
THEN
707 CALL cp_warn(__location__,
"TDDFPT Kernel needs XC_FUNCTIONAL or XC_KERNEL section.")
708 cpabort(
"TDDFPT Input")
717 xc_section => xc_root
722 do_hfx = (c_hf /= 0.0_dp)
728 IF (.NOT. same_hfx)
THEN
729 cpabort(
"TDDFPT Kernel must use the same HF section as DFT%XC or no HF at all.")
733 do_admm = do_hfx .AND. dft_control%do_admm
736 CALL cp_abort(__location__, &
737 "ADMM is not implemented for a TDDFT kernel XC-functional which is different from "// &
738 "the one used for the ground-state calculation. A ground-state 'admm_env' cannot be reused.")
761 do_hfx = (c_hf /= 0.0_dp)
763 do_admm = do_hfx .AND. dft_control%do_admm
777 IF (tddfpt_control%rks_triplets .AND. dft_control%nspins > 1)
THEN
778 tddfpt_control%rks_triplets = .false.
779 CALL cp_warn(__location__,
"Keyword RKS_TRIPLETS has been ignored for spin-polarised calculations")
783 IF (tddfpt_control%do_lrigpw)
THEN
788 NULLIFY (hfxsr_section)
792 IF (.NOT. found)
THEN
793 cpabort(
"HFXSR option needs &HF section defined")
795 CALL section_vals_val_get(hfxsr_section,
"INTERACTION_POTENTIAL%POTENTIAL_TYPE", explicit=found)
796 IF (.NOT. found)
THEN
801 IF (.NOT. found)
THEN
802 CALL section_vals_val_set(hfxsr_section,
"INTERACTION_POTENTIAL%CUTOFF_RADIUS", r_val=7.5589_dp)
806 CALL cp_abort(__location__,
"Short range TDA kernel with RI not possible")
819 SUBROUTINE kernel_info(log_unit, dft_control, tddfpt_control, xc_section)
820 INTEGER,
INTENT(IN) :: log_unit
825 CHARACTER(LEN=4) :: ktype
828 lsd = (dft_control%nspins > 1)
831 IF (log_unit > 0)
THEN
832 WRITE (log_unit,
"(T2,A,T77,A4)")
"KERNEL|", trim(ktype)
833 CALL xc_write(log_unit, xc_section, lsd)
834 IF (tddfpt_control%do_hfx)
THEN
835 IF (tddfpt_control%do_admm)
THEN
836 WRITE (log_unit,
"(T2,A,T62,A19)")
"KERNEL|",
"ADMM Exact Exchange"
837 IF (tddfpt_control%admm_xc_correction)
THEN
838 WRITE (log_unit,
"(T2,A,T60,A21)")
"KERNEL|",
"Apply ADMM Kernel XC Correction"
840 IF (tddfpt_control%admm_symm)
THEN
841 WRITE (log_unit,
"(T2,A,T60,A21)")
"KERNEL|",
"Symmetric ADMM Kernel"
844 WRITE (log_unit,
"(T2,A,T67,A14)")
"KERNEL|",
"Exact Exchange"
847 IF (tddfpt_control%do_hfxsr)
THEN
848 WRITE (log_unit,
"(T2,A,T43,A38)")
"KERNEL|",
"Short range HFX approximation"
850 IF (tddfpt_control%do_hfxlr)
THEN
851 WRITE (log_unit,
"(T2,A,T43,A38)")
"KERNEL|",
"Long range HFX approximation"
853 IF (tddfpt_control%do_lrigpw)
THEN
854 WRITE (log_unit,
"(T2,A,T42,A39)")
"KERNEL|",
"LRI approximation of transition density"
859 IF (log_unit > 0)
THEN
860 WRITE (log_unit,
"(T2,A,T77,A4)")
"KERNEL|", trim(ktype)
861 IF (tddfpt_control%stda_control%do_ewald)
THEN
862 WRITE (log_unit,
"(T2,A,T78,A3)")
"KERNEL| Coulomb term uses Ewald summation"
864 WRITE (log_unit,
"(T2,A,T78,A3)")
"KERNEL| Coulomb term uses direct summation (MIC)"
866 IF (tddfpt_control%stda_control%do_exchange)
THEN
867 WRITE (log_unit,
"(T2,A,T78,A3)")
"KERNEL| Exact exchange term",
"YES"
868 WRITE (log_unit,
"(T2,A,T71,F10.3)")
"KERNEL| Short range HFX fraction:", &
869 tddfpt_control%stda_control%hfx_fraction
871 WRITE (log_unit,
"(T2,A,T79,A2)")
"KERNEL| Exact exchange term",
"NO"
873 WRITE (log_unit,
"(T2,A,T66,E15.3)")
"KERNEL| Transition density filter", &
874 tddfpt_control%stda_control%eps_td_filter
878 IF (log_unit > 0)
THEN
879 WRITE (log_unit,
"(T2,A,T77,A4)")
"KERNEL|", trim(ktype)
885 IF (log_unit > 0)
THEN
886 IF (tddfpt_control%rks_triplets)
THEN
887 WRITE (log_unit,
"(T2,A,T74,A7)")
"KERNEL| Spin symmetry of excitations",
"Triplet"
891 WRITE (log_unit,
"(T2,A,T69,A12)")
"KERNEL| Spin symmetry of excitations",
"Unrestricted"
894 WRITE (log_unit,
"(T2,A,T72,A9)")
"KERNEL| Spin flip",
"Collinear"
897 WRITE (log_unit,
"(T2,A,T69,A12)")
"KERNEL| Spin flip",
"Noncollinear"
900 WRITE (log_unit,
"(T2,A,T74,A7)")
"KERNEL| Spin symmetry of excitations",
"Singlet"
902 WRITE (log_unit,
"(T2,A,T73,I8)")
"TDDFPT| Number of states calculated", tddfpt_control%nstates
903 WRITE (log_unit,
"(T2,A,T73,I8)")
"TDDFPT| Number of Davidson iterations", tddfpt_control%niters
904 WRITE (log_unit,
"(T2,A,T66,E15.3)")
"TDDFPT| Davidson iteration convergence", tddfpt_control%conv
905 WRITE (log_unit,
"(T2,A,T73,I8)")
"TDDFPT| Max. number of Krylov space vectors", tddfpt_control%nkvs
908 END SUBROUTINE kernel_info
936 tddfpt_control, logger, tddfpt_print_section, evects, evals, &
937 gs_mos, tddfpt_section, S_evects, matrix_s, kernel_env, matrix_ks, &
938 sub_env, ostrength, dipole_op_mos_occ, mult, xc_section, full_kernel_env, &
942 INTEGER :: nstates, nspins
947 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: evects
948 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals
952 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: s_evects
957 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: ostrength
958 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: dipole_op_mos_occ
963 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_energies'
965 CHARACTER(len=20) :: nstates_str
966 INTEGER :: energy_unit, handle, iter, log_unit, &
967 niters, nocc, nstate_max, &
969 LOGICAL :: do_admm, do_exck, do_soc, explicit
970 REAL(kind=
dp) :: conv
973 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_ks_oep
977 CALL timeset(routinen, handle)
979 NULLIFY (admm_env, matrix_ks_oep)
980 do_admm = tddfpt_control%do_admm
981 IF (do_admm)
CALL get_qs_env(qs_env, admm_env=admm_env)
987 rho_orb_struct=work_matrices%rho_orb_struct_sub, &
988 rho_xc_struct=work_matrices%rho_xc_struct_sub, &
989 is_rks_triplets=tddfpt_control%rks_triplets, &
990 qs_env=qs_env, sub_env=sub_env, &
991 wfm_rho_orb=work_matrices%rho_ao_orb_fm_sub)
995 IF (tddfpt_control%admm_xc_correction)
THEN
997 rho_struct_sub=work_matrices%rho_orb_struct_sub, &
998 xc_section=admm_env%xc_section_primary, &
999 is_rks_triplets=tddfpt_control%rks_triplets, &
1003 rho_struct_sub=work_matrices%rho_orb_struct_sub, &
1004 xc_section=xc_section, &
1005 is_rks_triplets=tddfpt_control%rks_triplets, &
1010 rho_orb_struct=work_matrices%rho_orb_struct_sub, &
1011 rho_aux_fit_struct=work_matrices%rho_aux_fit_struct_sub, &
1012 local_rho_set=sub_env%local_rho_set_admm, &
1013 qs_env=qs_env, sub_env=sub_env, &
1014 wfm_rho_orb=work_matrices%rho_ao_orb_fm_sub, &
1015 wfm_rho_aux_fit=work_matrices%rho_ao_aux_fit_fm_sub, &
1016 wfm_aux_orb=work_matrices%wfm_aux_orb_sub)
1019 rho_struct_sub=work_matrices%rho_aux_fit_struct_sub, &
1020 xc_section=admm_env%xc_section_aux, &
1021 is_rks_triplets=tddfpt_control%rks_triplets, &
1023 kernel_env%full_kernel => full_kernel_env
1024 kernel_env%admm_kernel => kernel_env_admm_aux
1028 rho_struct_sub=work_matrices%rho_orb_struct_sub, &
1029 xc_section=xc_section, &
1030 is_rks_triplets=tddfpt_control%rks_triplets, &
1032 kernel_env%full_kernel => full_kernel_env
1033 NULLIFY (kernel_env%admm_kernel)
1036 do_exck = tddfpt_control%do_exck
1037 kernel_env%full_kernel%do_exck = do_exck
1040 CALL create_fxc_kernel(work_matrices%rho_orb_struct_sub, work_matrices%fxc_rspace_sub, &
1041 xc_section, tddfpt_control%rks_triplets, sub_env, qs_env)
1046 IF (tddfpt_control%do_lrigpw)
THEN
1049 tddfpt_print_section)
1061 nstate_max = nocc*nvirt
1062 IF ((
SIZE(gs_mos, 1) == 2) .AND. (tddfpt_control%spinflip ==
no_sf_tddfpt))
THEN
1065 nstate_max = nocc*nvirt + nstate_max
1067 IF (nstates > nstate_max)
THEN
1068 cpwarn(
"NUMBER OF EXCITED STATES COULD LEAD TO PROBLEMS!")
1069 cpwarn(
"Experimental: CHANGED NSTATES TO ITS MAXIMUM VALUE!")
1070 nstates = nstate_max
1077 IF (tddfpt_control%is_restart .AND. .NOT. do_soc)
THEN
1085 tddfpt_section=tddfpt_section, &
1086 tddfpt_print_section=tddfpt_print_section, &
1087 fm_pool_ao_mo_active=work_matrices%fm_pool_ao_mo_active, &
1088 blacs_env_global=blacs_env)
1096 "GUESS_VECTORS", extension=
".tddfptLog")
1098 gs_mos=gs_mos, log_unit=log_unit, tddfpt_control=tddfpt_control, &
1099 fm_pool_ao_mo_active=work_matrices%fm_pool_ao_mo_active, &
1100 qs_env=qs_env, nspins=nspins)
1102 tddfpt_print_section,
"GUESS_VECTORS")
1105 gs_mos, evals, tddfpt_control, work_matrices%S_C0)
1108 niters = tddfpt_control%niters
1109 IF (niters > 0)
THEN
1111 "ITERATION_INFO", extension=
".tddfptLog")
1113 tddfpt_print_section, &
1114 "DETAILED_ENERGY", &
1115 extension=
".tddfptLog")
1117 IF (log_unit > 0)
THEN
1118 WRITE (log_unit,
"(1X,A)")
"", &
1119 "-------------------------------------------------------------------------------", &
1120 "- TDDFPT WAVEFUNCTION OPTIMIZATION -", &
1121 "-------------------------------------------------------------------------------"
1123 WRITE (log_unit,
'(/,T11,A,T27,A,T40,A,T62,A)')
"Step",
"Time",
"Convergence",
"Conv. states"
1124 WRITE (log_unit,
'(1X,79("-"))')
1134 s_evects=s_evects, &
1136 tddfpt_control=tddfpt_control, &
1137 matrix_ks=matrix_ks, &
1139 kernel_env=kernel_env, &
1142 iter_unit=log_unit, &
1143 energy_unit=energy_unit, &
1144 tddfpt_print_section=tddfpt_print_section, &
1145 work_matrices=work_matrices)
1152 CALL cp_iterate(logger%iter_info, increment=0, iter_nr_out=iter)
1154 IF ((conv <= tddfpt_control%conv) .OR. iter >= niters)
EXIT
1158 IF (log_unit > 0)
THEN
1159 WRITE (log_unit,
'(1X,25("-"),1X,A,1X,25("-"))')
"Restart Davidson iterations"
1165 CALL cp_iterate(logger%iter_info, increment=0, last=.true.)
1170 tddfpt_print_section=tddfpt_print_section)
1175 IF (log_unit > 0)
THEN
1177 IF (conv <= tddfpt_control%conv)
THEN
1178 WRITE (log_unit,
"(1X,A)")
"", &
1179 "-------------------------------------------------------------------------------", &
1180 "- TDDFPT run converged in "//trim(nstates_str)//
" iteration(s) ", &
1181 "-------------------------------------------------------------------------------"
1183 WRITE (log_unit,
"(1X,A)")
"", &
1184 "-------------------------------------------------------------------------------", &
1185 "- TDDFPT run did NOT converge after "//trim(nstates_str)//
" iteration(s) ", &
1186 "-------------------------------------------------------------------------------"
1191 tddfpt_print_section,
"DETAILED_ENERGY")
1193 tddfpt_print_section,
"ITERATION_INFO")
1195 CALL cp_warn(__location__, &
1196 "Skipping TDDFPT wavefunction optimization")
1199 IF (
ASSOCIATED(matrix_ks_oep))
THEN
1201 CALL cp_warn(__location__, &
1202 "Transition dipole moments and oscillator strengths are likely to be incorrect "// &
1203 "when computed using an orbital energy correction XC-potential together with "// &
1204 "the velocity form of dipole transition integrals")
1212 tddfpt_print_section, &
1220 tddfpt_print_section, &
1221 matrix_s(1)%matrix, &
1225 ALLOCATE (ostrength(nstates))
1233 dipole_op_mos_occ, &
1234 tddfpt_control%dipole_form)
1240 matrix_s(1)%matrix, &
1241 tddfpt_control%spinflip, &
1242 min_amplitude=tddfpt_control%min_excitation_amplitude)
1247 matrix_s(1)%matrix, &
1248 tddfpt_print_section)
1249 IF (tddfpt_control%do_exciton_descriptors)
THEN
1254 matrix_s(1)%matrix, &
1255 tddfpt_control%do_directional_exciton_descriptors, &
1259 IF (tddfpt_control%do_lrigpw)
THEN
1262 tddfpt_lri_env=kernel_env%full_kernel%lri_env)
1265 CALL timestop(handle)
1297 SUBROUTINE tddfpt_soc_energies(qs_env, nstates, work_matrices, &
1298 tddfpt_control, logger, tddfpt_print_section, &
1299 evects, evals, ostrength, &
1300 gs_mos, tddfpt_section, S_evects, matrix_s, kernel_env, matrix_ks, &
1301 sub_env, dipole_op_mos_occ, lmult_tmp, xc_section, full_kernel_env, &
1302 kernel_env_admm_aux)
1305 INTEGER,
INTENT(in) :: nstates
1310 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: evects
1311 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals, ostrength
1315 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: s_evects
1320 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: dipole_op_mos_occ
1321 LOGICAL,
INTENT(in) :: lmult_tmp
1325 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_soc_energies'
1327 INTEGER :: handle, ispin, istate, log_unit, mult, &
1330 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals_mult, ostrength_mult
1331 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: evects_mult
1333 CALL timeset(routinen, handle)
1337 extension=
".tddfptLog")
1340 nspins =
SIZE(gs_mos)
1341 ALLOCATE (evects_mult(nspins, nstates))
1342 ALLOCATE (evals_mult(nstates))
1347 IF (log_unit > 0)
THEN
1348 WRITE (log_unit,
"(1X,A)")
"", &
1349 "-------------------------------------------------------------------------------", &
1350 "- TDDFPT SINGLET ENERGIES -", &
1351 "-------------------------------------------------------------------------------"
1355 IF (log_unit > 0)
THEN
1356 WRITE (log_unit,
"(1X,A)")
"", &
1357 "-------------------------------------------------------------------------------", &
1358 "- TDDFPT TRIPLET ENERGIES -", &
1359 "-------------------------------------------------------------------------------"
1364 CALL tddfpt_energies(qs_env, nstates, nspins, work_matrices, tddfpt_control, logger, &
1365 tddfpt_print_section, evects_mult, evals_mult, &
1366 gs_mos, tddfpt_section, s_evects, matrix_s, &
1367 kernel_env, matrix_ks, sub_env, ostrength_mult, &
1368 dipole_op_mos_occ, mult, xc_section, full_kernel_env, &
1369 kernel_env_admm_aux)
1377 tddfpt_control%do_hfx, &
1378 tddfpt_control%do_admm, tddfpt_control%do_hfxlr, &
1379 tddfpt_control%do_exck, do_sf, qs_env, sub_env)
1382 DO istate = 1, nstates
1383 DO ispin = 1, nspins
1388 DO istate = 1, nstates
1389 DO ispin = 1, nspins
1391 work_matrices%fm_pool_ao_mo_active(ispin)%pool, &
1392 s_evects(ispin, istate))
1396 tddfpt_control%rks_triplets = lmult_tmp
1400 IF (log_unit > 0)
THEN
1401 WRITE (log_unit,
"(1X,A)")
"", &
1402 " singlet excitations finished ", &
1404 "-------------------------------------------------------------------------------", &
1405 "- TDDFPT TRIPLET ENERGIES -", &
1406 "-------------------------------------------------------------------------------"
1410 IF (log_unit > 0)
THEN
1411 WRITE (log_unit,
"(1X,A)")
"", &
1412 " triplet excitations finished ", &
1414 "-------------------------------------------------------------------------------", &
1415 "- TDDFPT SINGLET ENERGIES -", &
1416 "-------------------------------------------------------------------------------"
1421 CALL tddfpt_energies(qs_env, nstates, nspins, work_matrices, tddfpt_control, logger, &
1422 tddfpt_print_section, evects, evals, &
1423 gs_mos, tddfpt_section, s_evects, matrix_s, &
1424 kernel_env, matrix_ks, sub_env, ostrength, &
1425 dipole_op_mos_occ, mult, xc_section, full_kernel_env, &
1426 kernel_env_admm_aux)
1431 CALL tddfpt_soc(qs_env, evals_mult, evals, evects_mult, evects, gs_mos)
1433 CALL tddfpt_soc(qs_env, evals, evals_mult, evects, evects_mult, gs_mos)
1437 DO ispin = 1,
SIZE(evects_mult, 1)
1438 DO istate = 1,
SIZE(evects_mult, 2)
1442 DEALLOCATE (evects_mult, evals_mult, ostrength_mult)
1444 CALL timestop(handle)
1446 END SUBROUTINE tddfpt_soc_energies
1456 SUBROUTINE init_res_method(qs_env, gs_mos, tddfpt_control, tddfpt_section, iounit)
1463 INTEGER,
INTENT(IN) :: iounit
1465 CHARACTER(LEN=*),
PARAMETER :: routinen =
'init_res_method'
1467 INTEGER :: handle, i, io, ispin, nao, nmo, nmol, &
1469 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: orblist
1470 INTEGER,
DIMENSION(:),
POINTER :: mollist
1471 LOGICAL :: do_res, do_sf, ew1, ew2, ew3, ewcut, lms
1472 REAL(kind=
dp) :: eclow, ecup, eint, emo
1473 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rvint
1478 CALL timeset(routinen, handle)
1490 nspins =
SIZE(gs_mos)
1491 IF (.NOT. do_res)
THEN
1492 DO ispin = 1, nspins
1493 nmo = gs_mos(ispin)%nmo_occ
1494 tddfpt_control%nactive(ispin) = nmo
1495 gs_mos(ispin)%nmo_active = nmo
1496 ALLOCATE (gs_mos(ispin)%index_active(nmo))
1498 gs_mos(ispin)%index_active(i) = i
1502 IF (iounit > 0)
THEN
1503 WRITE (iounit,
"(/,1X,27('='),A,26('='))")
' REDUCED EXCITATION SPACE '
1508 ewcut = (ew1 .OR. ew2 .OR. ew3)
1512 cpassert(
SIZE(rvint) == 2)
1516 ecup = min(ecup, eint)
1518 eclow = max(eclow, eint)
1519 IF (ewcut .AND. (iounit > 0))
THEN
1520 IF (eclow < -1.e8_dp .AND. ecup > 1.e8_dp)
THEN
1521 WRITE (iounit,
"(1X,A,T51,A10,T71,A10)") &
1522 'Orbital Energy Window [eV]',
" -Inf",
" Inf"
1523 ELSE IF (eclow < -1.e8_dp)
THEN
1524 WRITE (iounit,
"(1X,A,T51,A10,T71,F10.4)") &
1525 'Orbital Energy Window [eV]',
" -Inf",
evolt*ecup
1526 ELSE IF (ecup > 1.e8_dp)
THEN
1527 WRITE (iounit,
"(1X,A,T51,F10.4,T71,A10)") &
1528 'Orbital Energy Window [eV]',
evolt*eclow,
" Inf"
1530 WRITE (iounit,
"(1X,A,T51,F10.4,T71,F10.4)") &
1531 'Orbital Energy Window [eV]',
evolt*eclow,
evolt*ecup
1538 nmol =
SIZE(mollist)
1539 WRITE (iounit,
"(1X,A)")
'List of Selected Molecules'
1540 WRITE (iounit,
"(1X,15(I5))") mollist(1:nmol)
1543 DO ispin = 1, nspins
1544 tddfpt_control%nactive(ispin) = gs_mos(ispin)%nmo_occ
1546 nmo = maxval(tddfpt_control%nactive)
1547 ALLOCATE (orblist(nmo, nspins))
1553 DO ispin = 1, nspins
1554 cpassert(.NOT.
ASSOCIATED(gs_mos(ispin)%evals_occ_matrix))
1558 DO ispin = 1, nspins
1559 DO i = 1, gs_mos(ispin)%nmo_occ
1560 emo = gs_mos(ispin)%evals_occ(i)
1561 IF (emo > eclow .AND. emo < ecup) orblist(i, ispin) = 1
1571 cpabort(
"RSE TDA: no active orbitals selected.")
1573 DO ispin = 1, nspins
1574 nmo = sum(orblist(:, ispin))
1575 tddfpt_control%nactive(ispin) = nmo
1576 gs_mos(ispin)%nmo_active = nmo
1577 ALLOCATE (gs_mos(ispin)%index_active(nmo))
1579 DO i = 1,
SIZE(orblist, 1)
1580 IF (orblist(i, ispin) == 1)
THEN
1582 gs_mos(ispin)%index_active(io) = i
1586 DEALLOCATE (orblist)
1591 IF (iounit > 0)
THEN
1592 WRITE (iounit,
"(1X,A)")
'List of Selected States'
1593 IF (nspins == 1)
THEN
1594 WRITE (iounit,
"(A,T67,A)")
' Active State Orbital',
'Orbital Energy'
1595 DO i = 1, gs_mos(1)%nmo_active
1596 io = gs_mos(1)%index_active(i)
1597 WRITE (iounit,
"(T8,I6,T21,I6,T61,F20.4)") i, io, gs_mos(1)%evals_occ(io)*
evolt
1600 DO ispin = 1, nspins
1601 WRITE (iounit,
"(1X,A,I2)")
'Spin ', ispin
1602 WRITE (iounit,
"(A,T67,A)")
' Active State Orbital',
'Orbital Energy'
1603 DO i = 1, gs_mos(ispin)%nmo_active
1604 io = gs_mos(ispin)%index_active(i)
1605 WRITE (iounit,
"(T8,I6,T21,I6,T61,F20.4)") i, io, gs_mos(ispin)%evals_occ(io)*
evolt
1613 cpabort(
"Restricted Active Space with spin flip TDA NYA")
1616 IF (iounit > 0)
THEN
1617 WRITE (iounit,
"(1X,79('='))")
1622 DO ispin = 1, nspins
1625 nmo = gs_mos(ispin)%nmo_active
1626 CALL cp_fm_struct_create(fm_struct, template_fmstruct=gs_mos(ispin)%mos_occ%matrix_struct, &
1627 ncol_global=nmo, context=blacs_env)
1628 NULLIFY (gs_mos(ispin)%mos_active)
1629 ALLOCATE (gs_mos(ispin)%mos_active)
1633 IF (gs_mos(ispin)%nmo_active == gs_mos(ispin)%nmo_occ)
THEN
1634 DO i = 1, gs_mos(ispin)%nmo_active
1635 cpassert(i == gs_mos(ispin)%index_active(i))
1638 nao, nmo, 1, 1, 1, 1)
1640 DO i = 1, gs_mos(ispin)%nmo_active
1641 io = gs_mos(ispin)%index_active(i)
1643 nao, 1, 1, io, 1, i)
1648 CALL timestop(handle)
1650 END SUBROUTINE init_res_method
Contains ADMM methods which require molecular orbitals.
subroutine, public admm_fit_mo_coeffs(admm_env, matrix_s_aux_fit, matrix_s_mixed, mos, mos_aux_fit, geometry_did_change)
...
Types and set/get functions for auxiliary density matrix methods.
subroutine, public get_admm_env(admm_env, mo_derivs_aux_fit, mos_aux_fit, sab_aux_fit, sab_aux_fit_asymm, sab_aux_fit_vs_orb, matrix_s_aux_fit, matrix_s_aux_fit_kp, matrix_s_aux_fit_vs_orb, matrix_s_aux_fit_vs_orb_kp, task_list_aux_fit, matrix_ks_aux_fit, matrix_ks_aux_fit_kp, matrix_ks_aux_fit_im, matrix_ks_aux_fit_dft, matrix_ks_aux_fit_hfx, matrix_ks_aux_fit_dft_kp, matrix_ks_aux_fit_hfx_kp, rho_aux_fit, rho_aux_fit_buffer, admm_dm)
Get routine for the ADMM env.
Define the atomic kind types and their sub types.
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public grimme2016
integer, save, public iannuzzi2005
integer, save, public hernandez2025
integer, save, public grimme2013
Handles all functions related to the CELL.
methods related to the blacs parallel environment
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
DBCSR operations in CP2K.
pool for for elements that are retained and released
subroutine, public fm_pool_create_fm(pool, element, name)
returns an element, allocating it if none is in the pool
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
subroutine, public cp_fm_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, nrow_locals, ncol_locals, matrix_struct, para_env)
returns all kind of information about the full matrix
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp, nrow, ncol, set_zero)
creates a new full matrix with the given structure
subroutine, public cp_fm_to_fm_submat(msource, mtarget, nrow, ncol, s_firstrow, s_firstcol, t_firstrow, t_firstcol)
copy just a part ot the matrix
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
subroutine, public cp_iterate(iteration_info, last, iter_nr, increment, iter_nr_out)
adds one to the actual iteration
subroutine, public cp_rm_iter_level(iteration_info, level_name, n_rlevel_att)
Removes an iteration level.
subroutine, public cp_add_iter_level(iteration_info, level_name, n_rlevel_new)
Adds an iteration level.
Types for excited states potential energies.
Utilities for hfx and admm methods.
subroutine, public aux_admm_init(qs_env, mos, admm_env, admm_control, basis_type)
Minimal setup routine for admm_env No forces No k-points No DFT correction terms.
Types and set/get functions for HFX.
subroutine, public hfx_create(x_data, para_env, hfx_section, atomic_kind_set, qs_kind_set, particle_set, dft_control, cell, orb_basis, ri_basis, nelectron_total, nkp_grid)
This routine allocates and initializes all types in hfx_data
subroutine, public compare_hfx_sections(hfx_section1, hfx_section2, is_identical, same_except_frac)
Compares the non-technical parts of two HFX input section and check whether they are the same Ignore ...
Defines the basic variable types.
integer, parameter, public dp
Calculates integral matrices for LRIGPW method lri : local resolution of the identity.
subroutine, public lri_print_stat(qs_env, ltddfpt, tddfpt_lri_env)
...
contains the types and subroutines for dealing with the lri_env lri : local resolution of the identit...
subroutine, public lri_density_release(lri_density)
releases the given lri_density
subroutine, public lri_env_release(lri_env)
releases the given lri_env
Machine interface based on Fortran 2003 and POSIX.
subroutine, public m_flush(lunit)
flushes units if the &GLOBAL flag is set accordingly
Interface to the message passing library MPI.
generate or use from input minimal basis set
subroutine, public create_minbas_set(qs_env, unit_nr, basis_type, primitive)
...
Define the data structure for the particle information.
Definition of physical constants:
real(kind=dp), parameter, public evolt
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, mimic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
subroutine, public create_fxc_kernel(rho_struct, fxc_rspace, xc_section, is_rks_triplets, sub_env, qs_env)
Create the xc kernel potential for the approximate Fxc kernel model.
subroutine, public create_kernel_env(kernel_env, xc_section, is_rks_triplets, rho_struct_sub, lsd_singlets, do_excitations, sub_env, qs_env)
Create kernel environment.
subroutine, public release_kernel_env(kernel_env)
Release kernel environment.
Define the quickstep kind type and their sub types.
Definition and initialisation of the mo data type.
groups fairly general SCF methods, so that modules other than qs_scf can use them too split off from ...
subroutine, public eigensolver(matrix_ks_fm, mo_set, ortho, work, cholesky_method, do_level_shift, level_shift, matrix_u_fm, use_jacobi)
Diagonalise the Kohn-Sham matrix to get a new set of MO eigen- vectors and MO eigenvalues....
module that contains the definitions of the scf types
subroutine, public assign_state(qs_env, matrix_s, evects, psi0, wfn_history, my_state)
...
subroutine, public tddfpt_construct_aux_fit_density(rho_orb_struct, rho_aux_fit_struct, local_rho_set, qs_env, sub_env, wfm_rho_orb, wfm_rho_aux_fit, wfm_aux_orb)
Project a charge density expressed in primary basis set into the auxiliary basis set.
subroutine, public tddfpt_construct_ground_state_orb_density(rho_orb_struct, rho_xc_struct, is_rks_triplets, qs_env, sub_env, wfm_rho_orb)
Compute the ground-state charge density expressed in primary basis set.
subroutine, public tddfpt_orthonormalize_psi1_psi1(evects, nvects_new, s_evects, matrix_s)
Make new TDDFPT trial vectors orthonormal to all previous trial vectors.
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.
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 tddfpt_forces_main(qs_env, gs_mos, ex_env, kernel_env, sub_env, work_matrices)
Perform TDDFPT gradient calculation. This routine calculates the response vector R of Eq....
subroutine, public tddfpt_print_forces(qs_env, evects, evals, ostrength, print_section, gs_mos, kernel_env, sub_env, work_matrices)
Calculate and print forces of selected excited states.
subroutine, public tddfpt2_lri_init(qs_env, kernel_env, lri_section, tddfpt_print_section)
Initialize LRI environment, basis, neighborlists and matrices.
subroutine, public tddfpt(qs_env, calc_forces, rixs_env)
Perform TDDFPT calculation. If calc_forces then it also builds the response vector for the Z-vector m...
subroutine, public tddfpt_input(qs_env, tddfpt_section, tddfpt_control, do_hfx, do_admm, do_exck, do_hfxsr, do_hfxlr, xc_section, tddfpt_print_section, lri_section, hfxsr_section)
TDDFPT input.
subroutine, public tddfpt_energies(qs_env, nstates, nspins, work_matrices, tddfpt_control, logger, tddfpt_print_section, evects, evals, gs_mos, tddfpt_section, s_evects, matrix_s, kernel_env, matrix_ks, sub_env, ostrength, dipole_op_mos_occ, mult, xc_section, full_kernel_env, kernel_env_admm_aux)
The energy calculation has been moved to its own subroutine.
subroutine, public tddfpt_dipole_operator(dipole_op_mos_occ, tddfpt_control, gs_mos, qs_env)
Compute the action of the dipole operator on the ground state wave function.
subroutine, public tddfpt_print_nto_analysis(qs_env, evects, evals, ostrength, gs_mos, matrix_s, print_section)
Print natural transition orbital analysis.
subroutine, public tddfpt_print_excitation_analysis(log_unit, evects, evals, gs_mos, matrix_s, spinflip, min_amplitude)
Print excitation analysis.
subroutine, public tddfpt_print_exciton_descriptors(log_unit, evects, gs_mos, matrix_s, do_directional_exciton_descriptors, qs_env)
Print exciton descriptors, cf. Mewes et al., JCTC 14, 710-725 (2018)
subroutine, public tddfpt_print_summary(log_unit, evects, evals, gs_mos, ostrength, mult, dipole_op_mos_occ, dipole_form)
Print final TDDFPT excitation energies and oscillator strengths.
subroutine, public tddfpt_write_newtonx_output(evects, evals, gs_mos, logger, tddfpt_print_section, matrix_s, s_evects, sub_env)
Write Ritz vectors to a binary restart file.
subroutine, public tddfpt_write_restart(evects, evals, gs_mos, logger, tddfpt_print_section)
Write Ritz vectors to a binary restart file.
integer function, public tddfpt_read_restart(evects, evals, gs_mos, logger, tddfpt_section, tddfpt_print_section, fm_pool_ao_mo_active, blacs_env_global)
Initialise initial guess vectors by reading (un-normalised) Ritz vectors from a binary restart file.
subroutine, public tddfpt_smeared_occupation(qs_env, gs_mos, log_unit)
...
subroutine, public tddfpt_soc(qs_env, evals_a, evals_b, evects_a, evects_b, gs_mos)
Perform TDDFPT-SOC calculation.
Simplified Tamm Dancoff approach (sTDA).
subroutine, public stda_init_param(qs_env, stda_kernel, stda_control)
Get the parameters needed for an sTDA calculation.
subroutine, public deallocate_stda_env(stda_kernel)
Deallocate the sTDA environment.
subroutine, public allocate_stda_env(qs_env, stda_kernel, n_ao, nactive)
Allocate the sTDA environment.
Simplified Tamm Dancoff approach (sTDA).
subroutine, public get_lowdin_mo_coefficients(qs_env, sub_env, work)
Calculate Lowdin MO coefficients.
subroutine, public stda_init_matrices(qs_env, stda_kernel, sub_env, work, tddfpt_control)
Calculate sTDA matrices.
subroutine, public tddfpt_sub_env_init(sub_env, qs_env, mos_occ, mos_active, kernel)
Split MPI communicator to create a set of parallel (sub)groups.
subroutine, public tddfpt_sub_env_release(sub_env)
Release parallel group environment.
subroutine, public hfxsr_create_work_matrices(work_matrices, qs_env, admm_env)
Allocate work matrices for hfxsr.
subroutine, public tddfpt_create_work_matrices(work_matrices, gs_mos, nstates, do_hfx, do_admm, do_hfxlr, do_exck, do_sf, qs_env, sub_env)
Allocate work matrices for full kernel.
subroutine, public tddfpt_release_work_matrices(work_matrices, sub_env)
Release work matrices.
subroutine, public stda_create_work_matrices(work_matrices, gs_mos, nstates, qs_env, sub_env)
Allocate work matrices for sTDA kernel.
subroutine, public tddfpt_release_ground_state_mos(gs_mos)
Release molecular orbitals.
subroutine, public tddfpt_oecorr(qs_env, gs_mos, matrix_ks_oep)
Callculate orbital corrected KS matrix for TDDFPT.
subroutine, public tddfpt_guess_vectors(evects, evals, gs_mos, log_unit, tddfpt_control, fm_pool_ao_mo_active, qs_env, nspins)
Generate missed guess vectors.
subroutine, public tddfpt_init_mos(qs_env, gs_mos, iounit)
Prepare MOs for TDDFPT Calculations.
Define Resonant Inelastic XRAY Scattering (RIXS) control type and associated create,...
Utilities for string manipulations.
subroutine, public integer_to_string(inumber, string)
Converts an integer number to a string. The WRITE statement will return an error message,...
Writes information on XC functionals to output.
subroutine, public xc_write(iounit, xc_section, lsd)
...
stores some data used in wavefunction fitting
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
keeps the information about the structure of a full matrix
type of a logger, at the moment it contains just a print level starting at which level it should be l...
Contains information on the excited states energy.
stores all the informations relevant to an mpi environment
Collection of variables required to evaluate adiabatic TDDFPT kernel.
Type to hold environments for the different kernels.
Provides all information about a quickstep kind.
Parallel (sub)group environment.
Ground state molecular orbitals.
Set of temporary ("work") matrices.
Valence state coming from the qs_tddfpt2 routine.