34 dbcsr_type_antisymmetric,&
150#include "./base/base_uses.f90"
156 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_tddfpt2_methods'
158 LOGICAL,
PARAMETER,
PRIVATE :: debug_this_module = .false.
160 INTEGER,
PARAMETER,
PRIVATE :: nderivs = 3
161 INTEGER,
PARAMETER,
PRIVATE :: maxspins = 2
181 SUBROUTINE tddfpt(qs_env, calc_forces, rixs_env)
183 LOGICAL,
INTENT(IN) :: calc_forces
186 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt'
188 INTEGER :: handle, ispin, istate, log_unit, mult, &
189 my_state, nao, nocc, nspins, &
190 nstate_max, nstates, nvirt, old_state
191 INTEGER,
DIMENSION(maxspins) :: nactive
192 LOGICAL :: do_admm, do_exck, do_hfx, do_hfxlr, &
193 do_hfxsr, do_kpoints, do_rixs, do_sf, &
194 do_soc, lmult_tmp, state_change
195 REAL(kind=
dp) :: gsmin, gsval, xsval
196 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals, ostrength
201 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: my_active, my_mos
202 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: dipole_op_mos_occ, evects, s_evects
204 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_ks, matrix_ks_oep, matrix_s, &
206 matrix_s_aux_fit_vs_orb
211 TYPE(
mo_set_type),
DIMENSION(:),
POINTER :: mos, mos_aux_fit
214 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
218 lri_section, soc_section, &
219 tddfpt_print_section, tddfpt_section, &
229 CALL timeset(routinen, handle)
234 NULLIFY (tddfpt_section, tddfpt_control)
237 dft_control=dft_control, &
239 do_kpoints = dft_control%nimages > 1
243 NULLIFY (rixs_control, valence_state)
244 rixs_control => dft_control%rixs_control
245 tddfpt_control => rixs_control%tddfpt2_control
246 valence_state => rixs_env%valence_state
249 tddfpt_control => dft_control%tddfpt2_control
253 CALL tddfpt_input(qs_env, tddfpt_section, tddfpt_control, do_hfx, do_admm, do_exck, &
254 do_hfxsr, do_hfxlr, xc_section, tddfpt_print_section, &
255 lri_section, hfxsr_section)
258 extension=
".tddfptLog")
260 tddfpt_control%do_hfx = do_hfx
261 tddfpt_control%do_admm = do_admm
262 tddfpt_control%do_hfxsr = do_hfxsr
263 tddfpt_control%hfxsr_primbas = 0
264 tddfpt_control%hfxsr_re_int = .true.
265 tddfpt_control%do_hfxlr = do_hfxlr
266 tddfpt_control%do_exck = do_exck
269 IF (tddfpt_control%do_hfxlr)
THEN
281 lmult_tmp = tddfpt_control%rks_triplets
282 tddfpt_control%rks_triplets = .NOT. (tddfpt_control%rks_triplets)
292 CALL kernel_info(log_unit, dft_control, tddfpt_control, xc_section)
295 IF (calc_forces)
THEN
296 cpabort(
"TDDFPT forces are not implemented for k-points")
299 cpabort(
"RIXS/TDDFPT is not implemented for k-points")
302 cpabort(
"TDDFPT-SOC is not implemented for k-points")
304 CALL tddfpt_kpoint_independent_particle(qs_env, logger, tddfpt_control)
307 tddfpt_print_section, &
309 CALL timestop(handle)
314 blacs_env=blacs_env, &
316 matrix_ks=matrix_ks, &
326 IF (tddfpt_control%do_smearing)
THEN
333 IF ((tddfpt_control%do_lrigpw) .AND. &
335 CALL cp_abort(__location__,
"LRI only implemented for full kernel")
338 IF (
ASSOCIATED(matrix_ks_oep)) matrix_ks => matrix_ks_oep
342 CALL init_res_method(qs_env, gs_mos, tddfpt_control, tddfpt_section, log_unit)
350 nspins =
SIZE(gs_mos)
353 mult = abs(
SIZE(gs_mos(1)%evals_occ) -
SIZE(gs_mos(2)%evals_occ)) + 1
355 CALL cp_warn(__location__,
"There is a convergence issue for multiplicity >= 3")
358 IF (tddfpt_control%rks_triplets)
THEN
366 ALLOCATE (my_mos(nspins), my_active(nspins))
368 my_mos(ispin) = gs_mos(ispin)%mos_occ
369 my_active(ispin) = gs_mos(ispin)%mos_active
372 mos_occ=my_mos(:), mos_active=my_active(:), &
373 kernel=tddfpt_control%kernel)
374 DEALLOCATE (my_mos, my_active)
378 IF (dft_control%qs_control%xtb)
THEN
379 cpabort(
"TDDFPT: xTB only works with sTDA Kernel")
382 IF (tddfpt_control%do_hfxsr)
THEN
385 i_val=tddfpt_control%hfxsr_primbas)
388 primitive=tddfpt_control%hfxsr_primbas)
390 ALLOCATE (full_kernel_env%admm_control)
396 full_kernel_env%hfxsr_section => hfxsr_section
399 full_kernel_env%admm_control,
"TDA_HFX")
400 CALL get_admm_env(full_kernel_env%admm_env, mos_aux_fit=mos_aux_fit, &
401 matrix_s_aux_fit=matrix_s_aux_fit, &
402 matrix_s_aux_fit_vs_orb=matrix_s_aux_fit_vs_orb)
404 matrix_s_aux_fit_vs_orb, mos, mos_aux_fit, .true.)
406 CALL get_qs_env(qs_env, cell=cell, atomic_kind_set=atomic_kind_set, &
407 qs_kind_set=qs_kind_set, particle_set=particle_set, &
409 CALL hfx_create(full_kernel_env%x_data, para_env, hfxsr_section, atomic_kind_set, &
410 qs_kind_set, particle_set, dft_control, cell, orb_basis=
"TDA_HFX")
414 nstates = tddfpt_control%nstates
424 nstate_max = nocc*nvirt
425 IF (nstates > nstate_max)
THEN
426 cpwarn(
"NUMBER OF EXCITED STATES COULD LEAD TO PROBLEMS!")
427 cpwarn(
"Experimental: CHANGED NSTATES TO ITS MAXIMUM VALUE!")
429 tddfpt_control%nstates = nstate_max
432 do_hfx, do_admm, do_hfxlr, do_exck, do_sf, qs_env, sub_env)
435 kernel_env%full_kernel => full_kernel_env
436 kernel_env%admm_kernel => kernel_env_admm_aux
437 NULLIFY (kernel_env%stda_kernel)
449 nactive = tddfpt_control%nactive
454 nstates = tddfpt_control%nstates
458 work_matrices, tddfpt_control)
460 kernel_env%stda_kernel => stda_kernel
461 NULLIFY (kernel_env%full_kernel)
462 NULLIFY (kernel_env%admm_kernel)
465 nstates = tddfpt_control%nstates
467 NULLIFY (kernel_env%full_kernel)
468 NULLIFY (kernel_env%admm_kernel)
469 NULLIFY (kernel_env%stda_kernel)
474 ALLOCATE (evects(1, nstates))
476 ALLOCATE (evects(nspins, nstates))
478 ALLOCATE (evals(nstates))
479 ALLOCATE (s_evects(
SIZE(evects, 1), nstates))
481 DO istate = 1, nstates
482 DO ispin = 1,
SIZE(evects, 1)
484 work_matrices%fm_pool_ao_mo_active(ispin)%pool, &
485 s_evects(ispin, istate))
489 IF (.NOT. do_soc)
THEN
492 tddfpt_control, logger, tddfpt_print_section, evects, evals, &
493 gs_mos, tddfpt_section, s_evects, matrix_s, kernel_env, matrix_ks, &
494 sub_env, ostrength, dipole_op_mos_occ, mult, xc_section, full_kernel_env, &
497 CALL tddfpt_soc_energies(qs_env, nstates, work_matrices, &
498 tddfpt_control, logger, tddfpt_print_section, &
499 evects, evals, ostrength, &
500 gs_mos, tddfpt_section, s_evects, matrix_s, kernel_env, matrix_ks, &
501 sub_env, dipole_op_mos_occ, lmult_tmp, xc_section, full_kernel_env, &
506 IF (calc_forces)
THEN
508 tddfpt_print_section, gs_mos, &
509 kernel_env, sub_env, work_matrices)
513 IF (qs_env%excited_state)
THEN
514 IF (sub_env%is_split)
THEN
515 CALL cp_abort(__location__, &
516 "Excited state forces not possible when states"// &
517 " are distributed to different CPU pools.")
520 IF (
ASSOCIATED(matrix_ks_oep))
CALL get_qs_env(qs_env, matrix_ks=matrix_ks)
522 state_change = .false.
523 IF (ex_env%state > 0)
THEN
524 my_state = ex_env%state
525 ELSE IF (ex_env%state < 0)
THEN
527 ALLOCATE (my_mos(nspins))
529 my_mos(ispin) = gs_mos(ispin)%mos_occ
531 my_state = abs(ex_env%state)
532 CALL assign_state(qs_env, matrix_s, evects, my_mos, ex_env%wfn_history, my_state)
534 IF (my_state /= abs(ex_env%state))
THEN
535 state_change = .true.
536 old_state = abs(ex_env%state)
538 ex_env%state = -my_state
540 CALL cp_warn(__location__, &
541 "Active excited state not assigned. Use the first state.")
544 cpassert(my_state > 0)
545 IF (my_state > nstates)
THEN
546 CALL cp_warn(__location__, &
547 "There were not enough excited states calculated.")
548 cpabort(
"excited state potential energy surface")
552 ex_env%evalue = evals(my_state)
555 ALLOCATE (ex_env%evect(
SIZE(evects, 1)))
556 DO ispin = 1,
SIZE(evects, 1)
558 matrix_struct=matrix_struct)
560 CALL cp_fm_to_fm(evects(ispin, my_state), ex_env%evect(ispin))
563 IF (log_unit > 0)
THEN
564 gsval = ex_env%wfn_history%gsval
565 gsmin = ex_env%wfn_history%gsmin
566 xsval = ex_env%wfn_history%xsval
567 WRITE (log_unit,
"(1X,A,T40,F10.6,A,T62,F10.6,A)")
"Ground state orbital alignment:", &
568 gsmin,
"[MinVal]", gsval,
"[Average]"
569 WRITE (log_unit,
"(1X,A,T71,F10.6)")
"Excitation vector alignment:", xsval
570 IF (state_change)
THEN
571 WRITE (log_unit,
"(1X,A,I5,T60,A14,T76,I5)") &
572 "Target state has been changed from state ", &
573 old_state,
" to new state ", my_state
575 WRITE (log_unit,
"(1X,A,I4,A,F12.5,A)")
"Calculate properties for state:", &
576 my_state,
" with excitation energy ", ex_env%evalue*
evolt,
" eV"
580 IF (calc_forces)
THEN
582 sub_env, work_matrices)
589 valence_state%nstates = nstates
590 ALLOCATE (valence_state%evals(
SIZE(evals)))
591 valence_state%evals(:) = evals(:)
593 ALLOCATE (valence_state%evects(nspins, nstates))
594 ALLOCATE (valence_state%mos_active(nspins))
597 DO istate = 1, nstates
599 matrix_struct=matrix_struct)
600 CALL cp_fm_create(valence_state%evects(ispin, istate), matrix_struct)
601 CALL cp_fm_to_fm(evects(ispin, istate), valence_state%evects(ispin, istate))
605 matrix_struct=matrix_struct)
606 CALL cp_fm_create(valence_state%mos_active(ispin), matrix_struct)
607 CALL cp_fm_to_fm(gs_mos(ispin)%mos_active, valence_state%mos_active(ispin))
617 tddfpt_print_section, &
620 DEALLOCATE (evals, ostrength)
624 IF (tddfpt_control%do_lrigpw)
THEN
626 DEALLOCATE (kernel_env%full_kernel%lri_env)
628 DEALLOCATE (kernel_env%full_kernel%lri_density)
636 cpabort(
'Unknown kernel type')
643 DO ispin = nspins, 1, -1
648 IF (
ASSOCIATED(matrix_ks_oep))
THEN
652 CALL timestop(handle)
671 SUBROUTINE tddfpt_input(qs_env, tddfpt_section, tddfpt_control, do_hfx, do_admm, do_exck, &
672 do_hfxsr, do_hfxlr, xc_section, tddfpt_print_section, lri_section, &
677 LOGICAL,
INTENT(INOUT) :: do_hfx, do_admm, do_exck, do_hfxsr, &
680 lri_section, hfxsr_section
682 CHARACTER(len=20) :: nstates_str
683 LOGICAL :: exar, exf, exgcp, exhf, exhfxk, exk, &
684 explicit, explicit_root, expot, exvdw, &
685 exwfn, found, same_hfx, use_real_wfn
686 REAL(kind=
dp) :: c_hf
690 print_sub, xc_root, xc_sub
692 NULLIFY (dft_control, input, kpoints)
693 CALL get_qs_env(qs_env, dft_control=dft_control, input=input, kpoints=kpoints)
695 IF (dft_control%nimages > 1)
THEN
697 cpabort(
"TDDFPT with k-points currently supports only KERNEL NONE")
700 IF (use_real_wfn)
THEN
701 cpabort(
"K-point TDDFPT requires complex wavefunctions")
704 cpabort(
"Spin-flip TDDFPT is not implemented for k-points")
706 IF (tddfpt_control%do_smearing)
THEN
707 cpabort(
"Smeared-occupation TDDFPT is not implemented for k-points")
709 IF (tddfpt_control%oe_corr /=
oe_none)
THEN
710 cpabort(
"Orbital-energy-corrected TDDFPT is not implemented for k-points")
712 IF (tddfpt_control%dipole_form /= 0 .AND. &
715 cpabort(
"K-point TDDFPT supports only velocity-form or SCF_MOMENT transition dipoles")
719 IF (tddfpt_control%nstates <= 0)
THEN
721 CALL cp_warn(__location__,
"TDDFPT calculation was requested for "// &
722 trim(nstates_str)//
" excited states: nothing to do.")
726 NULLIFY (tddfpt_print_section)
729 IF (dft_control%nimages > 1)
THEN
730 IF (tddfpt_control%do_exciton_descriptors .OR. &
731 tddfpt_control%do_directional_exciton_descriptors)
THEN
732 cpabort(
"Exciton descriptors are not implemented for k-point TDDFPT")
736 IF (explicit) cpabort(
"NTO analysis is not implemented for k-point TDDFPT")
739 IF (explicit) cpabort(
"NAMD_PRINT is not implemented for k-point TDDFPT")
747 IF (explicit_root)
THEN
753 CALL cp_warn(__location__,
"TDDFPT Kernel with ADIABATIC_RESCALING not possible.")
754 cpabort(
"TDDFPT Input")
761 CALL cp_warn(__location__,
"TDDFPT Kernel with GCP_POTENTIAL not possible.")
762 cpabort(
"TDDFPT Input")
769 CALL cp_warn(__location__,
"TDDFPT Kernel with VDW_POTENTIAL not possible.")
770 cpabort(
"TDDFPT Input")
777 CALL cp_warn(__location__,
"TDDFPT Kernel with WF_CORRELATION not possible.")
778 cpabort(
"TDDFPT Input")
785 CALL cp_warn(__location__,
"TDDFPT Kernel with XC_POTENTIAL not possible.")
786 cpabort(
"TDDFPT Input")
795 IF ((exf .AND. exk) .OR. .NOT. (exf .OR. exk))
THEN
796 CALL cp_warn(__location__,
"TDDFPT Kernel needs XC_FUNCTIONAL or XC_KERNEL section.")
797 cpabort(
"TDDFPT Input")
806 xc_section => xc_root
811 do_hfx = (c_hf /= 0.0_dp)
817 IF (.NOT. same_hfx)
THEN
818 cpabort(
"TDDFPT Kernel must use the same HF section as DFT%XC or no HF at all.")
822 do_admm = do_hfx .AND. dft_control%do_admm
825 CALL cp_abort(__location__, &
826 "ADMM is not implemented for a TDDFT kernel XC-functional which is different from "// &
827 "the one used for the ground-state calculation. A ground-state 'admm_env' cannot be reused.")
850 do_hfx = (c_hf /= 0.0_dp)
852 do_admm = do_hfx .AND. dft_control%do_admm
866 IF (tddfpt_control%rks_triplets .AND. dft_control%nspins > 1)
THEN
867 tddfpt_control%rks_triplets = .false.
868 CALL cp_warn(__location__,
"Keyword RKS_TRIPLETS has been ignored for spin-polarised calculations")
872 IF (tddfpt_control%do_lrigpw)
THEN
877 NULLIFY (hfxsr_section)
881 IF (.NOT. found)
THEN
882 cpabort(
"HFXSR option needs &HF section defined")
884 CALL section_vals_val_get(hfxsr_section,
"INTERACTION_POTENTIAL%POTENTIAL_TYPE", explicit=found)
885 IF (.NOT. found)
THEN
890 IF (.NOT. found)
THEN
891 CALL section_vals_val_set(hfxsr_section,
"INTERACTION_POTENTIAL%CUTOFF_RADIUS", r_val=7.5589_dp)
895 CALL cp_abort(__location__,
"Short range TDA kernel with RI not possible")
908 SUBROUTINE kernel_info(log_unit, dft_control, tddfpt_control, xc_section)
909 INTEGER,
INTENT(IN) :: log_unit
914 CHARACTER(LEN=4) :: ktype
917 lsd = (dft_control%nspins > 1)
920 IF (log_unit > 0)
THEN
921 WRITE (log_unit,
"(T2,A,T77,A4)")
"KERNEL|", trim(ktype)
922 CALL xc_write(log_unit, xc_section, lsd)
923 IF (tddfpt_control%do_hfx)
THEN
924 IF (tddfpt_control%do_admm)
THEN
925 WRITE (log_unit,
"(T2,A,T62,A19)")
"KERNEL|",
"ADMM Exact Exchange"
926 IF (tddfpt_control%admm_xc_correction)
THEN
927 WRITE (log_unit,
"(T2,A,T60,A21)")
"KERNEL|",
"Apply ADMM Kernel XC Correction"
929 IF (tddfpt_control%admm_symm)
THEN
930 WRITE (log_unit,
"(T2,A,T60,A21)")
"KERNEL|",
"Symmetric ADMM Kernel"
933 WRITE (log_unit,
"(T2,A,T67,A14)")
"KERNEL|",
"Exact Exchange"
936 IF (tddfpt_control%do_hfxsr)
THEN
937 WRITE (log_unit,
"(T2,A,T43,A38)")
"KERNEL|",
"Short range HFX approximation"
939 IF (tddfpt_control%do_hfxlr)
THEN
940 WRITE (log_unit,
"(T2,A,T43,A38)")
"KERNEL|",
"Long range HFX approximation"
942 IF (tddfpt_control%do_lrigpw)
THEN
943 WRITE (log_unit,
"(T2,A,T42,A39)")
"KERNEL|",
"LRI approximation of transition density"
948 IF (log_unit > 0)
THEN
949 WRITE (log_unit,
"(T2,A,T77,A4)")
"KERNEL|", trim(ktype)
950 IF (tddfpt_control%stda_control%do_ewald)
THEN
951 WRITE (log_unit,
"(T2,A,T78,A3)")
"KERNEL| Coulomb term uses Ewald summation"
953 WRITE (log_unit,
"(T2,A,T78,A3)")
"KERNEL| Coulomb term uses direct summation (MIC)"
955 IF (tddfpt_control%stda_control%do_exchange)
THEN
956 WRITE (log_unit,
"(T2,A,T78,A3)")
"KERNEL| Exact exchange term",
"YES"
957 WRITE (log_unit,
"(T2,A,T71,F10.3)")
"KERNEL| Short range HFX fraction:", &
958 tddfpt_control%stda_control%hfx_fraction
960 WRITE (log_unit,
"(T2,A,T79,A2)")
"KERNEL| Exact exchange term",
"NO"
962 WRITE (log_unit,
"(T2,A,T66,E15.3)")
"KERNEL| Transition density filter", &
963 tddfpt_control%stda_control%eps_td_filter
967 IF (log_unit > 0)
THEN
968 WRITE (log_unit,
"(T2,A,T77,A4)")
"KERNEL|", trim(ktype)
974 IF (log_unit > 0)
THEN
975 IF (tddfpt_control%rks_triplets)
THEN
976 WRITE (log_unit,
"(T2,A,T74,A7)")
"KERNEL| Spin symmetry of excitations",
"Triplet"
980 WRITE (log_unit,
"(T2,A,T69,A12)")
"KERNEL| Spin symmetry of excitations",
"Unrestricted"
983 WRITE (log_unit,
"(T2,A,T72,A9)")
"KERNEL| Spin flip",
"Collinear"
986 WRITE (log_unit,
"(T2,A,T69,A12)")
"KERNEL| Spin flip",
"Noncollinear"
989 WRITE (log_unit,
"(T2,A,T74,A7)")
"KERNEL| Spin symmetry of excitations",
"Singlet"
991 WRITE (log_unit,
"(T2,A,T73,I8)")
"TDDFPT| Number of states calculated", tddfpt_control%nstates
992 WRITE (log_unit,
"(T2,A,T73,I8)")
"TDDFPT| Number of Davidson iterations", tddfpt_control%niters
993 WRITE (log_unit,
"(T2,A,T66,E15.3)")
"TDDFPT| Davidson iteration convergence", tddfpt_control%conv
994 WRITE (log_unit,
"(T2,A,T73,I8)")
"TDDFPT| Max. number of Krylov space vectors", tddfpt_control%nkvs
997 END SUBROUTINE kernel_info
1005 SUBROUTINE tddfpt_kpoint_independent_particle(qs_env, logger, tddfpt_control)
1010 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_kpoint_independent_particle'
1012 COMPLEX(KIND=dp) :: moment_element
1013 COMPLEX(KIND=dp),
ALLOCATABLE, &
1014 DIMENSION(:, :, :, :, :) :: kpoint_dipole
1015 INTEGER :: handle, ideriv, ikp, ikp_local, iocc, ispin, istate, itrans, ivirt, log_unit, &
1016 nao, nkp, nkp_local, nspins, nstates, ntrans_kpoint, ntrans_spin, ntrans_total, &
1017 spin_offset, trans_index
1018 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: inds
1019 INTEGER,
DIMENSION(2) :: kp_range
1020 INTEGER,
DIMENSION(:, :, :),
POINTER :: cell_to_index
1021 INTEGER,
DIMENSION(maxspins) :: homo_spin, nao_spin, nmo_spin, nvirt_spin
1022 LOGICAL :: my_kpgrp, use_real_wfn, &
1023 use_scf_moment_dipoles
1024 REAL(kind=
dp) :: checksum, dipole_im, dipole_re, fsum, &
1025 gap, oscillator_factor, spin_factor
1026 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigenvalues_kp, evals, &
1027 oscillator_strength, transition_energy
1028 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: transition_dipole_im, &
1029 transition_dipole_re
1030 REAL(kind=
dp),
DIMENSION(:),
POINTER :: eigenvalues, wkp
1031 REAL(kind=
dp),
DIMENSION(nderivs) :: transition_dipole_abs
1033 TYPE(
cp_cfm_type) :: cfm_empty, cfm_mo_coeff_global, &
1034 cfm_moment, cfm_operator, cfm_work
1037 TYPE(
cp_fm_type) :: fm_operator_imag, fm_operator_real
1038 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: overlap_deriv
1039 TYPE(
dbcsr_type),
POINTER :: cmatrix, rmatrix
1044 TYPE(
mo_set_type),
DIMENSION(:),
POINTER :: mos_kp
1045 TYPE(
mp_para_env_type),
POINTER :: para_env, para_env_inter_kp, para_env_kp
1047 POINTER :: sab_kp, sab_orb
1050 CALL timeset(routinen, handle)
1052 NULLIFY (blacs_env, blacs_env_all, cell_to_index, cmo_coeff_source, cmatrix, dft_control, &
1053 eigenvalues, fm_struct, kp, kp_env, kpoints, ks_env, &
1054 mos_kp, overlap_deriv, para_env, para_env_inter_kp, para_env_kp, &
1055 rmatrix, sab_kp, sab_orb, wkp)
1056 CALL get_qs_env(qs_env, dft_control=dft_control, kpoints=kpoints, ks_env=ks_env, &
1058 cpassert(
ASSOCIATED(kpoints))
1060 CALL get_kpoint_info(kpoints, nkp=nkp, kp_range=kp_range, kp_env=kp_env, &
1061 para_env=para_env, blacs_env_all=blacs_env_all, &
1062 para_env_inter_kp=para_env_inter_kp, para_env_kp=para_env_kp, &
1063 blacs_env=blacs_env, wkp=wkp, cell_to_index=cell_to_index, &
1064 sab_nl=sab_kp, use_real_wfn=use_real_wfn)
1065 IF (use_real_wfn) cpabort(
"K-point TDDFPT requires complex wavefunctions")
1066 cpassert(
ASSOCIATED(para_env))
1067 cpassert(
ASSOCIATED(para_env_inter_kp))
1068 cpassert(
ASSOCIATED(para_env_kp))
1069 cpassert(
ASSOCIATED(blacs_env_all))
1070 cpassert(
ASSOCIATED(blacs_env))
1071 cpassert(
ASSOCIATED(kp_env))
1072 cpassert(
ASSOCIATED(ks_env))
1073 cpassert(
ASSOCIATED(sab_orb))
1074 cpassert(
ASSOCIATED(sab_kp))
1075 cpassert(
ASSOCIATED(cell_to_index))
1077 nspins = dft_control%nspins
1081 nkp_local = max(0, kp_range(2) - kp_range(1) + 1)
1082 IF (nkp_local > 0)
THEN
1083 kp => kp_env(1)%kpoint_env
1085 cpassert(
ASSOCIATED(mos_kp))
1086 cpassert(
SIZE(mos_kp) == nspins)
1087 DO ispin = 1, nspins
1088 CALL get_mo_set(mos_kp(ispin), nmo=nmo_spin(ispin), homo=homo_spin(ispin), &
1089 nao=nao_spin(ispin))
1092 CALL para_env%max(nmo_spin)
1093 CALL para_env%max(homo_spin)
1094 CALL para_env%max(nao_spin)
1097 DO ispin = 1, nspins
1098 nvirt_spin(ispin) = nmo_spin(ispin) - homo_spin(ispin)
1099 IF (homo_spin(ispin) <= 0 .OR. nvirt_spin(ispin) <= 0)
THEN
1100 cpabort(
"At least one occupied and one unoccupied MO are required for k-point TDDFPT")
1102 ntrans_kpoint = ntrans_kpoint + homo_spin(ispin)*nvirt_spin(ispin)
1104 ntrans_total = nkp*ntrans_kpoint
1105 IF (ntrans_total <= 0)
THEN
1106 cpabort(
"No independent-particle k-point transitions available")
1109 ALLOCATE (transition_energy(ntrans_total), transition_dipole_re(ntrans_total, nderivs), &
1110 transition_dipole_im(ntrans_total, nderivs), oscillator_strength(ntrans_total), &
1112 transition_energy = 0.0_dp
1113 transition_dipole_re = 0.0_dp
1114 transition_dipole_im = 0.0_dp
1115 oscillator_strength = 0.0_dp
1117 IF (use_scf_moment_dipoles)
THEN
1118 CALL cp_warn(__location__,
"SCF_MOMENT k-point dipoles use direct SCF MO matrix "// &
1119 "elements; compare folded energy blocks, not individual degenerate states.")
1123 IF (.NOT. use_scf_moment_dipoles)
THEN
1125 basis_type_a=
"ORB", basis_type_b=
"ORB", sab_nl=sab_orb, &
1126 ext_kpoints=kpoints)
1128 ALLOCATE (rmatrix, cmatrix)
1129 CALL dbcsr_create(rmatrix, template=overlap_deriv(1, 1)%matrix, &
1130 matrix_type=dbcsr_type_symmetric)
1131 CALL dbcsr_create(cmatrix, template=overlap_deriv(1, 1)%matrix, &
1132 matrix_type=dbcsr_type_antisymmetric)
1138 my_kpgrp = (ikp >= kp_range(1) .AND. ikp <= kp_range(2))
1140 ikp_local = ikp - kp_range(1) + 1
1141 kp => kp_env(ikp_local)%kpoint_env
1144 NULLIFY (kp, mos_kp)
1147 DO ispin = 1, nspins
1148 nao = nao_spin(ispin)
1149 ALLOCATE (eigenvalues_kp(nmo_spin(ispin)))
1150 eigenvalues_kp = 0.0_dp
1152 IF (.NOT. use_scf_moment_dipoles)
THEN
1154 para_env=para_env, context=blacs_env_all)
1159 ncol_global=nmo_spin(ispin), para_env=para_env, &
1160 context=blacs_env_all)
1164 para_env=para_env, context=blacs_env_all)
1172 CALL get_mo_set(mos_kp(ispin), eigenvalues=eigenvalues)
1173 cpassert(
ASSOCIATED(eigenvalues))
1174 IF (para_env_kp%is_source())
THEN
1175 eigenvalues_kp(1:nmo_spin(ispin)) = eigenvalues(1:nmo_spin(ispin))
1177 IF (.NOT. use_scf_moment_dipoles)
THEN
1178 cmo_coeff_source => mos_kp(ispin)%cmo_coeff
1180 ELSE IF (.NOT. use_scf_moment_dipoles)
THEN
1181 NULLIFY (cmo_coeff_source)
1183 IF (.NOT. use_scf_moment_dipoles)
THEN
1184 IF (
ASSOCIATED(cmo_coeff_source))
THEN
1190 CALL para_env%sum(eigenvalues_kp)
1192 spin_factor = 1.0_dp
1193 IF (nspins == 1)
THEN
1194 IF (tddfpt_control%rks_triplets)
THEN
1195 spin_factor = 0.0_dp
1197 spin_factor = 2.0_dp
1201 DO ideriv = 1, nderivs
1202 IF (.NOT. use_scf_moment_dipoles)
THEN
1205 CALL rskp_transform(rmatrix=rmatrix, cmatrix=cmatrix, rsmat=overlap_deriv, &
1206 ispin=ideriv + 1, xkp=kpoints%xkp(:, ikp), &
1207 cell_to_index=cell_to_index, sab_nl=sab_kp)
1212 CALL cp_fm_to_cfm(fm_operator_real, fm_operator_imag, cfm_operator)
1214 cfm_mo_coeff_global,
z_zero, cfm_work)
1216 cfm_mo_coeff_global, cfm_work,
z_zero, cfm_moment)
1219 DO iocc = 1, homo_spin(ispin)
1220 DO ivirt = homo_spin(ispin) + 1, nmo_spin(ispin)
1221 trans_index = (ikp - 1)*ntrans_kpoint + spin_offset + &
1222 (iocc - 1)*nvirt_spin(ispin) + ivirt - homo_spin(ispin)
1223 gap = eigenvalues_kp(ivirt) - eigenvalues_kp(iocc)
1224 IF (gap <= 0.0_dp)
THEN
1225 cpabort(
"K-point TDDFPT requires positive occupied-virtual energy gaps")
1227 IF (use_scf_moment_dipoles)
THEN
1228 oscillator_factor = sqrt(spin_factor*wkp(ikp))
1229 dipole_re = real(kpoint_dipole(ispin, ikp, ideriv, iocc, ivirt), kind=
dp)
1230 dipole_im = aimag(kpoint_dipole(ispin, ikp, ideriv, iocc, ivirt))
1232 oscillator_factor = sqrt(spin_factor*wkp(ikp))/gap
1234 dipole_re = real(moment_element, kind=
dp)
1235 dipole_im = aimag(moment_element)
1237 transition_dipole_re(trans_index, ideriv) = oscillator_factor*dipole_re
1238 transition_dipole_im(trans_index, ideriv) = oscillator_factor*dipole_im
1243 DO iocc = 1, homo_spin(ispin)
1244 DO ivirt = homo_spin(ispin) + 1, nmo_spin(ispin)
1245 trans_index = (ikp - 1)*ntrans_kpoint + spin_offset + &
1246 (iocc - 1)*nvirt_spin(ispin) + ivirt - homo_spin(ispin)
1247 transition_energy(trans_index) = eigenvalues_kp(ivirt) - eigenvalues_kp(iocc)
1248 oscillator_strength(trans_index) = 2.0_dp/3.0_dp*transition_energy(trans_index)* &
1249 sum(transition_dipole_re(trans_index, :)**2 + &
1250 transition_dipole_im(trans_index, :)**2)
1253 IF (.NOT. use_scf_moment_dipoles)
THEN
1261 DEALLOCATE (eigenvalues_kp)
1262 spin_offset = spin_offset + homo_spin(ispin)*nvirt_spin(ispin)
1266 IF (any(transition_energy <= 0.0_dp))
THEN
1267 cpabort(
"K-point TDDFPT KERNEL NONE requires positive occupied-virtual energy gaps")
1270 CALL sort(transition_energy, ntrans_total, inds)
1271 nstates = min(tddfpt_control%nstates, ntrans_total)
1272 IF (tddfpt_control%nstates > ntrans_total)
THEN
1273 cpwarn(
"Requested more TDDFPT states than independent-particle k-point transitions")
1276 ALLOCATE (evals(nstates))
1277 evals(1:nstates) = transition_energy(1:nstates)
1278 checksum = sqrt(sum(evals**2))
1281 IF (log_unit > 0)
THEN
1282 WRITE (log_unit,
"(1X,A)")
"", &
1283 "-------------------------------------------------------------------------------", &
1284 "- TDDFPT K-point Independent-particle Transitions -", &
1285 "-------------------------------------------------------------------------------"
1286 WRITE (log_unit,
"(1X,A)") &
1287 "Only KERNEL NONE is active for k-point TDDFPT; transition dipole magnitudes are shown."
1288 WRITE (log_unit,
'(/,T10,A,T19,A,T37,A,T69,A)')
"State",
"Excitation", &
1289 "Transition dipole (a.u.)",
"Oscillator"
1290 WRITE (log_unit,
'(T10,A,T19,A,T37,A,T49,A,T61,A,T67,A)')
"number",
"energy (eV)", &
1291 "x",
"y",
"z",
"strength (a.u.)"
1292 WRITE (log_unit,
'(T10,72("-"))')
1296 DO istate = 1, nstates
1297 itrans = inds(istate) - 1
1298 ikp = itrans/ntrans_kpoint + 1
1299 itrans = mod(itrans, ntrans_kpoint)
1301 DO ispin = 1, nspins
1302 ntrans_spin = homo_spin(ispin)*nvirt_spin(ispin)
1303 IF (itrans < spin_offset + ntrans_spin)
THEN
1304 itrans = itrans - spin_offset
1305 iocc = itrans/nvirt_spin(ispin) + 1
1306 ivirt = mod(itrans, nvirt_spin(ispin)) + homo_spin(ispin) + 1
1309 spin_offset = spin_offset + ntrans_spin
1312 IF (log_unit > 0)
THEN
1313 transition_dipole_abs(1:nderivs) = &
1314 sqrt(transition_dipole_re(inds(istate), 1:nderivs)**2 + &
1315 transition_dipole_im(inds(istate), 1:nderivs)**2)
1316 WRITE (log_unit,
'(1X,A,T9,I7,T19,F11.5,T31,3(1X,ES11.4E2),T69,ES12.5E2)') &
1317 "TDDFPT|", istate, evals(istate)*
evolt, transition_dipole_abs, &
1318 oscillator_strength(inds(istate))
1319 fsum = fsum + oscillator_strength(inds(istate))**2
1320 WRITE (log_unit,
'(1X,A,T18,I7,T28,I7,T38,I7,T50,I7,T62,I7,T74,F10.5)') &
1321 "TDDFPT_KPOINT|", istate, ikp, ispin, iocc, ivirt, wkp(ikp)
1325 IF (log_unit > 0)
THEN
1326 WRITE (log_unit,
'(/,T2,A,E16.8)')
'TDDFPT : CheckSum E = ', checksum
1327 WRITE (log_unit,
'(T2,A,E16.8)')
'TDDFPT : CheckSum F = ', sqrt(fsum)
1328 WRITE (log_unit,
"(1X,A)") &
1329 "-------------------------------------------------------------------------------"
1332 IF (use_scf_moment_dipoles)
THEN
1333 DEALLOCATE (kpoint_dipole)
1340 DEALLOCATE (evals, inds, oscillator_strength, transition_dipole_im, transition_dipole_re, &
1343 CALL timestop(handle)
1345 END SUBROUTINE tddfpt_kpoint_independent_particle
1373 tddfpt_control, logger, tddfpt_print_section, evects, evals, &
1374 gs_mos, tddfpt_section, S_evects, matrix_s, kernel_env, matrix_ks, &
1375 sub_env, ostrength, dipole_op_mos_occ, mult, xc_section, full_kernel_env, &
1376 kernel_env_admm_aux)
1379 INTEGER :: nstates, nspins
1384 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: evects
1385 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals
1389 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: s_evects
1394 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: ostrength
1395 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: dipole_op_mos_occ
1400 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_energies'
1402 CHARACTER(len=20) :: nstates_str
1403 INTEGER :: energy_unit, handle, iter, log_unit, &
1404 niters, nocc, nstate_max, &
1406 LOGICAL :: do_admm, do_exck, do_soc, explicit
1407 REAL(kind=
dp) :: conv
1410 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_ks_oep
1416 CALL timeset(routinen, handle)
1418 CALL get_qs_env(qs_env, dft_control=dft_control)
1420 NULLIFY (admm_env, matrix_ks_oep)
1421 do_admm = tddfpt_control%do_admm
1422 IF (do_admm)
CALL get_qs_env(qs_env, admm_env=admm_env)
1428 rho_orb_struct=work_matrices%rho_orb_struct_sub, &
1429 rho_xc_struct=work_matrices%rho_xc_struct_sub, &
1430 is_rks_triplets=tddfpt_control%rks_triplets, &
1431 qs_env=qs_env, sub_env=sub_env, &
1432 wfm_rho_orb=work_matrices%rho_ao_orb_fm_sub)
1433 IF (dft_control%qs_control%gapw_xc)
THEN
1434 rho0_struct => work_matrices%rho_xc_struct_sub
1436 rho0_struct => work_matrices%rho_orb_struct_sub
1441 IF (tddfpt_control%admm_xc_correction)
THEN
1443 rho_struct_sub=rho0_struct, &
1444 xc_section=admm_env%xc_section_primary, &
1445 is_rks_triplets=tddfpt_control%rks_triplets, &
1446 sub_env=sub_env, qs_env=qs_env)
1449 rho_struct_sub=rho0_struct, &
1450 xc_section=xc_section, &
1451 is_rks_triplets=tddfpt_control%rks_triplets, &
1452 sub_env=sub_env, qs_env=qs_env)
1456 rho_orb_struct=work_matrices%rho_orb_struct_sub, &
1457 rho_aux_fit_struct=work_matrices%rho_aux_fit_struct_sub, &
1458 local_rho_set=sub_env%local_rho_set_admm, &
1459 qs_env=qs_env, sub_env=sub_env, &
1460 wfm_rho_orb=work_matrices%rho_ao_orb_fm_sub, &
1461 wfm_rho_aux_fit=work_matrices%rho_ao_aux_fit_fm_sub, &
1462 wfm_aux_orb=work_matrices%wfm_aux_orb_sub)
1465 rho_struct_sub=work_matrices%rho_aux_fit_struct_sub, &
1466 xc_section=admm_env%xc_section_aux, &
1467 is_rks_triplets=tddfpt_control%rks_triplets, &
1468 sub_env=sub_env, qs_env=qs_env)
1469 kernel_env%full_kernel => full_kernel_env
1470 kernel_env%admm_kernel => kernel_env_admm_aux
1474 rho_struct_sub=rho0_struct, &
1475 xc_section=xc_section, &
1476 is_rks_triplets=tddfpt_control%rks_triplets, &
1477 sub_env=sub_env, qs_env=qs_env)
1478 kernel_env%full_kernel => full_kernel_env
1479 NULLIFY (kernel_env%admm_kernel)
1482 do_exck = tddfpt_control%do_exck
1483 kernel_env%full_kernel%do_exck = do_exck
1486 CALL create_fxc_kernel(work_matrices%rho_orb_struct_sub, work_matrices%fxc_rspace_sub, &
1487 xc_section, tddfpt_control%rks_triplets, sub_env, qs_env)
1492 IF (tddfpt_control%do_lrigpw)
THEN
1495 tddfpt_print_section)
1507 nstate_max = nocc*nvirt
1508 IF ((
SIZE(gs_mos, 1) == 2) .AND. (tddfpt_control%spinflip ==
no_sf_tddfpt))
THEN
1511 nstate_max = nocc*nvirt + nstate_max
1513 IF (nstates > nstate_max)
THEN
1514 cpwarn(
"NUMBER OF EXCITED STATES COULD LEAD TO PROBLEMS!")
1515 cpwarn(
"Experimental: CHANGED NSTATES TO ITS MAXIMUM VALUE!")
1516 nstates = nstate_max
1523 IF (tddfpt_control%is_restart .AND. .NOT. do_soc)
THEN
1531 tddfpt_section=tddfpt_section, &
1532 tddfpt_print_section=tddfpt_print_section, &
1533 fm_pool_ao_mo_active=work_matrices%fm_pool_ao_mo_active, &
1534 blacs_env_global=blacs_env)
1542 "GUESS_VECTORS", extension=
".tddfptLog")
1544 gs_mos=gs_mos, log_unit=log_unit, tddfpt_control=tddfpt_control, &
1545 fm_pool_ao_mo_active=work_matrices%fm_pool_ao_mo_active, &
1546 qs_env=qs_env, nspins=nspins)
1548 tddfpt_print_section,
"GUESS_VECTORS")
1551 gs_mos, evals, tddfpt_control, work_matrices%S_C0)
1554 niters = tddfpt_control%niters
1555 IF (niters > 0)
THEN
1557 "ITERATION_INFO", extension=
".tddfptLog")
1559 tddfpt_print_section, &
1560 "DETAILED_ENERGY", &
1561 extension=
".tddfptLog")
1563 IF (log_unit > 0)
THEN
1564 WRITE (log_unit,
"(1X,A)")
"", &
1565 "-------------------------------------------------------------------------------", &
1566 "- TDDFPT WAVEFUNCTION OPTIMIZATION -", &
1567 "-------------------------------------------------------------------------------"
1569 WRITE (log_unit,
'(/,T11,A,T27,A,T40,A,T62,A)')
"Step",
"Time",
"Convergence",
"Conv. states"
1570 WRITE (log_unit,
'(1X,79("-"))')
1580 s_evects=s_evects, &
1582 tddfpt_control=tddfpt_control, &
1583 matrix_ks=matrix_ks, &
1585 kernel_env=kernel_env, &
1588 iter_unit=log_unit, &
1589 energy_unit=energy_unit, &
1590 tddfpt_print_section=tddfpt_print_section, &
1591 work_matrices=work_matrices)
1598 CALL cp_iterate(logger%iter_info, increment=0, iter_nr_out=iter)
1600 IF ((conv <= tddfpt_control%conv) .OR. iter >= niters)
EXIT
1604 IF (log_unit > 0)
THEN
1605 WRITE (log_unit,
'(1X,25("-"),1X,A,1X,25("-"))')
"Restart Davidson iterations"
1611 CALL cp_iterate(logger%iter_info, increment=0, last=.true.)
1616 tddfpt_print_section=tddfpt_print_section)
1621 IF (log_unit > 0)
THEN
1623 IF (conv <= tddfpt_control%conv)
THEN
1624 WRITE (log_unit,
"(1X,A)")
"", &
1625 "-------------------------------------------------------------------------------", &
1626 "- TDDFPT run converged in "//trim(nstates_str)//
" iteration(s) ", &
1627 "-------------------------------------------------------------------------------"
1629 WRITE (log_unit,
"(1X,A)")
"", &
1630 "-------------------------------------------------------------------------------", &
1631 "- TDDFPT run did NOT converge after "//trim(nstates_str)//
" iteration(s) ", &
1632 "-------------------------------------------------------------------------------"
1637 tddfpt_print_section,
"DETAILED_ENERGY")
1639 tddfpt_print_section,
"ITERATION_INFO")
1641 CALL cp_warn(__location__, &
1642 "Skipping TDDFPT wavefunction optimization")
1645 IF (
ASSOCIATED(matrix_ks_oep))
THEN
1647 CALL cp_warn(__location__, &
1648 "Transition dipole moments and oscillator strengths are likely to be incorrect "// &
1649 "when computed using an orbital energy correction XC-potential together with "// &
1650 "the velocity form of dipole transition integrals")
1658 tddfpt_print_section, &
1666 tddfpt_print_section, &
1667 matrix_s(1)%matrix, &
1671 ALLOCATE (ostrength(nstates))
1679 dipole_op_mos_occ, &
1680 tddfpt_control%dipole_form)
1686 matrix_s(1)%matrix, &
1687 tddfpt_control%spinflip, &
1688 min_amplitude=tddfpt_control%min_excitation_amplitude)
1693 matrix_s(1)%matrix, &
1694 tddfpt_print_section)
1695 IF (tddfpt_control%do_exciton_descriptors)
THEN
1700 matrix_s(1)%matrix, &
1701 tddfpt_control%do_directional_exciton_descriptors, &
1702 tddfpt_control%do_directional_exciton_crosscorrelation, &
1706 IF (tddfpt_control%do_lrigpw)
THEN
1709 tddfpt_lri_env=kernel_env%full_kernel%lri_env)
1712 CALL timestop(handle)
1744 SUBROUTINE tddfpt_soc_energies(qs_env, nstates, work_matrices, &
1745 tddfpt_control, logger, tddfpt_print_section, &
1746 evects, evals, ostrength, &
1747 gs_mos, tddfpt_section, S_evects, matrix_s, kernel_env, matrix_ks, &
1748 sub_env, dipole_op_mos_occ, lmult_tmp, xc_section, full_kernel_env, &
1749 kernel_env_admm_aux)
1752 INTEGER,
INTENT(in) :: nstates
1757 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: evects
1758 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals, ostrength
1762 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: s_evects
1767 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: dipole_op_mos_occ
1768 LOGICAL,
INTENT(in) :: lmult_tmp
1772 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_soc_energies'
1774 INTEGER :: handle, ispin, istate, log_unit, mult, &
1777 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals_mult, ostrength_mult
1778 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: evects_mult
1780 CALL timeset(routinen, handle)
1784 extension=
".tddfptLog")
1787 nspins =
SIZE(gs_mos)
1788 ALLOCATE (evects_mult(nspins, nstates))
1789 ALLOCATE (evals_mult(nstates))
1794 IF (log_unit > 0)
THEN
1795 WRITE (log_unit,
"(1X,A)")
"", &
1796 "-------------------------------------------------------------------------------", &
1797 "- TDDFPT SINGLET ENERGIES -", &
1798 "-------------------------------------------------------------------------------"
1802 IF (log_unit > 0)
THEN
1803 WRITE (log_unit,
"(1X,A)")
"", &
1804 "-------------------------------------------------------------------------------", &
1805 "- TDDFPT TRIPLET ENERGIES -", &
1806 "-------------------------------------------------------------------------------"
1811 CALL tddfpt_energies(qs_env, nstates, nspins, work_matrices, tddfpt_control, logger, &
1812 tddfpt_print_section, evects_mult, evals_mult, &
1813 gs_mos, tddfpt_section, s_evects, matrix_s, &
1814 kernel_env, matrix_ks, sub_env, ostrength_mult, &
1815 dipole_op_mos_occ, mult, xc_section, full_kernel_env, &
1816 kernel_env_admm_aux)
1824 tddfpt_control%do_hfx, &
1825 tddfpt_control%do_admm, tddfpt_control%do_hfxlr, &
1826 tddfpt_control%do_exck, do_sf, qs_env, sub_env)
1829 DO istate = 1, nstates
1830 DO ispin = 1, nspins
1835 DO istate = 1, nstates
1836 DO ispin = 1, nspins
1838 work_matrices%fm_pool_ao_mo_active(ispin)%pool, &
1839 s_evects(ispin, istate))
1843 tddfpt_control%rks_triplets = lmult_tmp
1847 IF (log_unit > 0)
THEN
1848 WRITE (log_unit,
"(1X,A)")
"", &
1849 " singlet excitations finished ", &
1851 "-------------------------------------------------------------------------------", &
1852 "- TDDFPT TRIPLET ENERGIES -", &
1853 "-------------------------------------------------------------------------------"
1857 IF (log_unit > 0)
THEN
1858 WRITE (log_unit,
"(1X,A)")
"", &
1859 " triplet excitations finished ", &
1861 "-------------------------------------------------------------------------------", &
1862 "- TDDFPT SINGLET ENERGIES -", &
1863 "-------------------------------------------------------------------------------"
1868 CALL tddfpt_energies(qs_env, nstates, nspins, work_matrices, tddfpt_control, logger, &
1869 tddfpt_print_section, evects, evals, &
1870 gs_mos, tddfpt_section, s_evects, matrix_s, &
1871 kernel_env, matrix_ks, sub_env, ostrength, &
1872 dipole_op_mos_occ, mult, xc_section, full_kernel_env, &
1873 kernel_env_admm_aux)
1878 CALL tddfpt_soc(qs_env, evals_mult, evals, evects_mult, evects, gs_mos)
1880 CALL tddfpt_soc(qs_env, evals, evals_mult, evects, evects_mult, gs_mos)
1884 DO ispin = 1,
SIZE(evects_mult, 1)
1885 DO istate = 1,
SIZE(evects_mult, 2)
1889 DEALLOCATE (evects_mult, evals_mult, ostrength_mult)
1891 CALL timestop(handle)
1893 END SUBROUTINE tddfpt_soc_energies
1903 SUBROUTINE init_res_method(qs_env, gs_mos, tddfpt_control, tddfpt_section, iounit)
1910 INTEGER,
INTENT(IN) :: iounit
1912 CHARACTER(LEN=*),
PARAMETER :: routinen =
'init_res_method'
1914 INTEGER :: handle, i, io, ispin, nao, nmo, nmol, &
1916 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: orblist
1917 INTEGER,
DIMENSION(:),
POINTER :: mollist
1918 LOGICAL :: do_res, do_sf, ew1, ew2, ew3, ewcut, lms
1919 REAL(kind=
dp) :: eclow, ecup, eint, emo
1920 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rvint
1925 CALL timeset(routinen, handle)
1937 nspins =
SIZE(gs_mos)
1938 IF (.NOT. do_res)
THEN
1939 DO ispin = 1, nspins
1940 nmo = gs_mos(ispin)%nmo_occ
1941 tddfpt_control%nactive(ispin) = nmo
1942 gs_mos(ispin)%nmo_active = nmo
1943 ALLOCATE (gs_mos(ispin)%index_active(nmo))
1945 gs_mos(ispin)%index_active(i) = i
1949 IF (iounit > 0)
THEN
1950 WRITE (iounit,
"(/,1X,27('='),A,26('='))")
' REDUCED EXCITATION SPACE '
1955 ewcut = (ew1 .OR. ew2 .OR. ew3)
1959 cpassert(
SIZE(rvint) == 2)
1963 ecup = min(ecup, eint)
1965 eclow = max(eclow, eint)
1966 IF (ewcut .AND. (iounit > 0))
THEN
1967 IF (eclow < -1.e8_dp .AND. ecup > 1.e8_dp)
THEN
1968 WRITE (iounit,
"(1X,A,T51,A10,T71,A10)") &
1969 'Orbital Energy Window [eV]',
" -Inf",
" Inf"
1970 ELSE IF (eclow < -1.e8_dp)
THEN
1971 WRITE (iounit,
"(1X,A,T51,A10,T71,F10.4)") &
1972 'Orbital Energy Window [eV]',
" -Inf",
evolt*ecup
1973 ELSE IF (ecup > 1.e8_dp)
THEN
1974 WRITE (iounit,
"(1X,A,T51,F10.4,T71,A10)") &
1975 'Orbital Energy Window [eV]',
evolt*eclow,
" Inf"
1977 WRITE (iounit,
"(1X,A,T51,F10.4,T71,F10.4)") &
1978 'Orbital Energy Window [eV]',
evolt*eclow,
evolt*ecup
1985 nmol =
SIZE(mollist)
1986 WRITE (iounit,
"(1X,A)")
'List of Selected Molecules'
1987 WRITE (iounit,
"(1X,15(I5))") mollist(1:nmol)
1990 DO ispin = 1, nspins
1991 tddfpt_control%nactive(ispin) = gs_mos(ispin)%nmo_occ
1993 nmo = maxval(tddfpt_control%nactive)
1994 ALLOCATE (orblist(nmo, nspins))
2000 DO ispin = 1, nspins
2001 cpassert(.NOT.
ASSOCIATED(gs_mos(ispin)%evals_occ_matrix))
2003 ELSE IF (ewcut)
THEN
2005 DO ispin = 1, nspins
2006 DO i = 1, gs_mos(ispin)%nmo_occ
2007 emo = gs_mos(ispin)%evals_occ(i)
2008 IF (emo > eclow .AND. emo < ecup) orblist(i, ispin) = 1
2018 cpabort(
"RSE TDA: no active orbitals selected.")
2020 DO ispin = 1, nspins
2021 nmo = sum(orblist(:, ispin))
2022 tddfpt_control%nactive(ispin) = nmo
2023 gs_mos(ispin)%nmo_active = nmo
2024 ALLOCATE (gs_mos(ispin)%index_active(nmo))
2026 DO i = 1,
SIZE(orblist, 1)
2027 IF (orblist(i, ispin) == 1)
THEN
2029 gs_mos(ispin)%index_active(io) = i
2033 DEALLOCATE (orblist)
2038 IF (iounit > 0)
THEN
2039 WRITE (iounit,
"(1X,A)")
'List of Selected States'
2040 IF (nspins == 1)
THEN
2041 WRITE (iounit,
"(A,T67,A)")
' Active State Orbital',
'Orbital Energy'
2042 DO i = 1, gs_mos(1)%nmo_active
2043 io = gs_mos(1)%index_active(i)
2044 WRITE (iounit,
"(T8,I6,T21,I6,T61,F20.4)") i, io, gs_mos(1)%evals_occ(io)*
evolt
2047 DO ispin = 1, nspins
2048 WRITE (iounit,
"(1X,A,I2)")
'Spin ', ispin
2049 WRITE (iounit,
"(A,T67,A)")
' Active State Orbital',
'Orbital Energy'
2050 DO i = 1, gs_mos(ispin)%nmo_active
2051 io = gs_mos(ispin)%index_active(i)
2052 WRITE (iounit,
"(T8,I6,T21,I6,T61,F20.4)") i, io, gs_mos(ispin)%evals_occ(io)*
evolt
2060 cpabort(
"Restricted Active Space with spin flip TDA NYA")
2063 IF (iounit > 0)
THEN
2064 WRITE (iounit,
"(1X,79('='))")
2069 DO ispin = 1, nspins
2072 nmo = gs_mos(ispin)%nmo_active
2073 CALL cp_fm_struct_create(fm_struct, template_fmstruct=gs_mos(ispin)%mos_occ%matrix_struct, &
2074 ncol_global=nmo, context=blacs_env)
2075 NULLIFY (gs_mos(ispin)%mos_active)
2076 ALLOCATE (gs_mos(ispin)%mos_active)
2080 IF (gs_mos(ispin)%nmo_active == gs_mos(ispin)%nmo_occ)
THEN
2081 DO i = 1, gs_mos(ispin)%nmo_active
2082 cpassert(i == gs_mos(ispin)%index_active(i))
2085 nao, nmo, 1, 1, 1, 1)
2087 DO i = 1, gs_mos(ispin)%nmo_active
2088 io = gs_mos(ispin)%index_active(i)
2090 nao, 1, 1, io, 1, i)
2095 CALL timestop(handle)
2097 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
Represents a complex full matrix distributed on many processors.
subroutine, public cp_cfm_get_element(matrix, irow_global, icol_global, alpha)
Get the matrix element by its global index.
subroutine, public cp_cfm_copy_general(source, destination, para_env)
General copy of a cfm matrix to another cfm matrix. Uses non-blocking MPI rather than ScaLAPACK.
subroutine, public cp_cfm_release(matrix)
Releases a full matrix.
subroutine, public cp_fm_to_cfm(msourcer, msourcei, mtarget)
Construct a complex full matrix by taking its real and imaginary parts from two separate real-value f...
subroutine, public cp_cfm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
Creates a new full matrix with the given structure.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_deallocate_matrix(matrix)
...
subroutine, public dbcsr_set(matrix, alpha)
...
Routines that link DBCSR and CP2K concepts together.
subroutine, public cp_dbcsr_alloc_block_from_nbl(matrix, sab_orb, desymmetrize)
allocate the blocks of a dbcsr based on the neighbor list
DBCSR operations in CP2K.
subroutine, public copy_dbcsr_to_fm(matrix, fm, plan, check_plan)
Copy a DBCSR matrix to a BLACS matrix.
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_to_fm_submat(msource, mtarget, nrow, ncol, s_firstrow, s_firstcol, t_firstrow, t_firstcol)
copy just a part ot the matrix
subroutine, public cp_fm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
creates a new full matrix with the given structure
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...
subroutine, public cp_add_iter_level(logger, level_name, n_rlevel_new)
Adds an iteration level.
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(logger, level_name, n_rlevel_att)
Removes an iteration level.
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, file_access)
...
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
Routines needed for kpoint calculation.
subroutine, public rskp_transform(rmatrix, cmatrix, rsmat, ispin, xkp, cell_to_index, sab_nl, is_complex, rs_sign)
Transformation of real space matrices to a kpoint.
Types and basic routines needed for a kpoint calculation.
subroutine, public get_kpoint_info(kpoint, kp_scheme, nkp_grid, kp_shift, symmetry, verbose, full_grid, use_real_wfn, eps_geo, parallel_group_size, kp_range, nkp, xkp, wkp, para_env, blacs_env_all, para_env_kp, para_env_inter_kp, blacs_env, kp_env, kp_aux_env, mpools, iogrp, nkp_groups, kp_dist, cell_to_index, index_to_cell, sab_nl, sab_nl_nosym, inversion_symmetry_only, symmetry_backend, symmetry_reduction_method, gamma_centered, lattice_fft)
Retrieve information from a kpoint environment.
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
Definition of mathematical constants and functions.
complex(kind=dp), parameter, public z_one
complex(kind=dp), parameter, public z_zero
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)
...
basic linear algebra operations for full matrixes
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, matrix_vhxc, 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_kernel_env(kernel_env, xc_section, is_rks_triplets, rho_struct_sub, sub_env, qs_env)
Create kernel 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 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.
subroutine, public get_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, mo_coeff, mo_coeff_b, uniform_occupation, kts, mu, flexible_electron_count, cmo_coeff)
Get the components of a MO set data structure.
Calculates the moment integrals <a|r^m|b> and <a|r x d/dr|b>.
subroutine, public qs_moment_kpoints_scf_mos(qs_env, dipole, rcc, nmo_spin_out)
Calculates interband k-point dipoles in the existing SCF MO basis.
Define the neighbor list data types and the corresponding functionality.
Calculation of overlap matrix, its derivatives and forces.
subroutine, public build_overlap_matrix(ks_env, matrix_s, matrixkp_s, matrix_name, nderivative, basis_type_a, basis_type_b, sab_nl, calculate_forces, matrix_p, matrixkp_p, ext_kpoints)
Calculation of the overlap matrix over Cartesian Gaussian functions.
superstucture that hold various representations of the density and keeps track of which ones are vali...
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_exciton_descriptors(log_unit, evects, gs_mos, matrix_s, do_directional_exciton_descriptors, do_directional_exciton_crosscorrelation, qs_env)
Print exciton descriptors, cf. Mewes et al., JCTC 14, 710-725 (2018).
subroutine, public tddfpt_print_excitation_analysis(log_unit, evects, evals, gs_mos, matrix_s, spinflip, min_amplitude)
Print excitation analysis.
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,...
All kind of helpful little routines.
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...
Represent a complex full matrix.
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.
Keeps information about a specific k-point.
Contains information about kpoints.
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.
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...
keeps the density in various representations, keeping track of which ones are valid.
Parallel (sub)group environment.
Ground state molecular orbitals.
Set of temporary ("work") matrices.
Valence state coming from the qs_tddfpt2 routine.