145#include "./base/base_uses.f90"
151 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_tddfpt2_methods'
153 LOGICAL,
PARAMETER,
PRIVATE :: debug_this_module = .false.
155 INTEGER,
PARAMETER,
PRIVATE :: nderivs = 3
156 INTEGER,
PARAMETER,
PRIVATE :: maxspins = 2
176 SUBROUTINE tddfpt(qs_env, calc_forces, rixs_env)
178 LOGICAL,
INTENT(IN) :: calc_forces
181 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt'
183 INTEGER :: handle, ispin, istate, log_unit, mult, &
184 my_state, nao, nocc, nspins, &
185 nstate_max, nstates, nvirt, old_state
186 INTEGER,
DIMENSION(maxspins) :: nactive
187 LOGICAL :: do_admm, do_exck, do_hfx, do_hfxlr, &
188 do_hfxsr, do_kpoints, do_rixs, do_sf, &
189 do_soc, lmult_tmp, state_change
190 REAL(kind=
dp) :: gsmin, gsval, xsval
191 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals, ostrength
196 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: my_active, my_mos
197 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: dipole_op_mos_occ, evects, s_evects
199 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_ks, matrix_ks_oep, matrix_s, &
201 matrix_s_aux_fit_vs_orb
206 TYPE(
mo_set_type),
DIMENSION(:),
POINTER :: mos, mos_aux_fit
209 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
213 lri_section, soc_section, &
214 tddfpt_print_section, tddfpt_section, &
224 CALL timeset(routinen, handle)
229 NULLIFY (tddfpt_section, tddfpt_control)
232 dft_control=dft_control, &
234 do_kpoints = dft_control%nimages > 1
238 NULLIFY (rixs_control, valence_state)
239 rixs_control => dft_control%rixs_control
240 tddfpt_control => rixs_control%tddfpt2_control
241 valence_state => rixs_env%valence_state
244 tddfpt_control => dft_control%tddfpt2_control
248 CALL tddfpt_input(qs_env, tddfpt_section, tddfpt_control, do_hfx, do_admm, do_exck, &
249 do_hfxsr, do_hfxlr, xc_section, tddfpt_print_section, &
250 lri_section, hfxsr_section)
253 extension=
".tddfptLog")
255 tddfpt_control%do_hfx = do_hfx
256 tddfpt_control%do_admm = do_admm
257 tddfpt_control%do_hfxsr = do_hfxsr
258 tddfpt_control%hfxsr_primbas = 0
259 tddfpt_control%hfxsr_re_int = .true.
260 tddfpt_control%do_hfxlr = do_hfxlr
261 tddfpt_control%do_exck = do_exck
264 IF (tddfpt_control%do_hfxlr)
THEN
276 lmult_tmp = tddfpt_control%rks_triplets
277 tddfpt_control%rks_triplets = .NOT. (tddfpt_control%rks_triplets)
287 CALL kernel_info(log_unit, dft_control, tddfpt_control, xc_section)
290 IF (calc_forces)
THEN
291 cpabort(
"TDDFPT forces are not implemented for k-points")
294 cpabort(
"RIXS/TDDFPT is not implemented for k-points")
297 cpabort(
"TDDFPT-SOC is not implemented for k-points")
299 CALL tddfpt_kpoint_independent_particle(qs_env, logger, tddfpt_control)
302 tddfpt_print_section, &
304 CALL timestop(handle)
309 blacs_env=blacs_env, &
311 matrix_ks=matrix_ks, &
321 IF (tddfpt_control%do_smearing)
THEN
328 IF ((tddfpt_control%do_lrigpw) .AND. &
330 CALL cp_abort(__location__,
"LRI only implemented for full kernel")
333 IF (
ASSOCIATED(matrix_ks_oep)) matrix_ks => matrix_ks_oep
337 CALL init_res_method(qs_env, gs_mos, tddfpt_control, tddfpt_section, log_unit)
345 nspins =
SIZE(gs_mos)
348 mult = abs(
SIZE(gs_mos(1)%evals_occ) -
SIZE(gs_mos(2)%evals_occ)) + 1
350 CALL cp_warn(__location__,
"There is a convergence issue for multiplicity >= 3")
353 IF (tddfpt_control%rks_triplets)
THEN
361 ALLOCATE (my_mos(nspins), my_active(nspins))
363 my_mos(ispin) = gs_mos(ispin)%mos_occ
364 my_active(ispin) = gs_mos(ispin)%mos_active
367 mos_occ=my_mos(:), mos_active=my_active(:), &
368 kernel=tddfpt_control%kernel)
369 DEALLOCATE (my_mos, my_active)
373 IF (dft_control%qs_control%xtb)
THEN
374 cpabort(
"TDDFPT: xTB only works with sTDA Kernel")
377 IF (tddfpt_control%do_hfxsr)
THEN
380 i_val=tddfpt_control%hfxsr_primbas)
383 primitive=tddfpt_control%hfxsr_primbas)
385 ALLOCATE (full_kernel_env%admm_control)
391 full_kernel_env%hfxsr_section => hfxsr_section
394 full_kernel_env%admm_control,
"TDA_HFX")
395 CALL get_admm_env(full_kernel_env%admm_env, mos_aux_fit=mos_aux_fit, &
396 matrix_s_aux_fit=matrix_s_aux_fit, &
397 matrix_s_aux_fit_vs_orb=matrix_s_aux_fit_vs_orb)
399 matrix_s_aux_fit_vs_orb, mos, mos_aux_fit, .true.)
401 CALL get_qs_env(qs_env, cell=cell, atomic_kind_set=atomic_kind_set, &
402 qs_kind_set=qs_kind_set, particle_set=particle_set, &
404 CALL hfx_create(full_kernel_env%x_data, para_env, hfxsr_section, atomic_kind_set, &
405 qs_kind_set, particle_set, dft_control, cell, orb_basis=
"TDA_HFX")
409 nstates = tddfpt_control%nstates
419 nstate_max = nocc*nvirt
420 IF (nstates > nstate_max)
THEN
421 cpwarn(
"NUMBER OF EXCITED STATES COULD LEAD TO PROBLEMS!")
422 cpwarn(
"Experimental: CHANGED NSTATES TO ITS MAXIMUM VALUE!")
424 tddfpt_control%nstates = nstate_max
427 do_hfx, do_admm, do_hfxlr, do_exck, do_sf, qs_env, sub_env)
430 kernel_env%full_kernel => full_kernel_env
431 kernel_env%admm_kernel => kernel_env_admm_aux
432 NULLIFY (kernel_env%stda_kernel)
444 nactive = tddfpt_control%nactive
449 nstates = tddfpt_control%nstates
453 work_matrices, tddfpt_control)
455 kernel_env%stda_kernel => stda_kernel
456 NULLIFY (kernel_env%full_kernel)
457 NULLIFY (kernel_env%admm_kernel)
460 nstates = tddfpt_control%nstates
462 NULLIFY (kernel_env%full_kernel)
463 NULLIFY (kernel_env%admm_kernel)
464 NULLIFY (kernel_env%stda_kernel)
469 ALLOCATE (evects(1, nstates))
471 ALLOCATE (evects(nspins, nstates))
473 ALLOCATE (evals(nstates))
474 ALLOCATE (s_evects(
SIZE(evects, 1), nstates))
476 DO istate = 1, nstates
477 DO ispin = 1,
SIZE(evects, 1)
479 work_matrices%fm_pool_ao_mo_active(ispin)%pool, &
480 s_evects(ispin, istate))
484 IF (.NOT. do_soc)
THEN
487 tddfpt_control, logger, tddfpt_print_section, evects, evals, &
488 gs_mos, tddfpt_section, s_evects, matrix_s, kernel_env, matrix_ks, &
489 sub_env, ostrength, dipole_op_mos_occ, mult, xc_section, full_kernel_env, &
492 CALL tddfpt_soc_energies(qs_env, nstates, work_matrices, &
493 tddfpt_control, logger, tddfpt_print_section, &
494 evects, evals, ostrength, &
495 gs_mos, tddfpt_section, s_evects, matrix_s, kernel_env, matrix_ks, &
496 sub_env, dipole_op_mos_occ, lmult_tmp, xc_section, full_kernel_env, &
501 IF (calc_forces)
THEN
503 tddfpt_print_section, gs_mos, &
504 kernel_env, sub_env, work_matrices)
508 IF (qs_env%excited_state)
THEN
509 IF (sub_env%is_split)
THEN
510 CALL cp_abort(__location__, &
511 "Excited state forces not possible when states"// &
512 " are distributed to different CPU pools.")
515 IF (
ASSOCIATED(matrix_ks_oep))
CALL get_qs_env(qs_env, matrix_ks=matrix_ks)
517 state_change = .false.
518 IF (ex_env%state > 0)
THEN
519 my_state = ex_env%state
520 ELSE IF (ex_env%state < 0)
THEN
522 ALLOCATE (my_mos(nspins))
524 my_mos(ispin) = gs_mos(ispin)%mos_occ
526 my_state = abs(ex_env%state)
527 CALL assign_state(qs_env, matrix_s, evects, my_mos, ex_env%wfn_history, my_state)
529 IF (my_state /= abs(ex_env%state))
THEN
530 state_change = .true.
531 old_state = abs(ex_env%state)
533 ex_env%state = -my_state
535 CALL cp_warn(__location__, &
536 "Active excited state not assigned. Use the first state.")
539 cpassert(my_state > 0)
540 IF (my_state > nstates)
THEN
541 CALL cp_warn(__location__, &
542 "There were not enough excited states calculated.")
543 cpabort(
"excited state potential energy surface")
547 ex_env%evalue = evals(my_state)
550 ALLOCATE (ex_env%evect(
SIZE(evects, 1)))
551 DO ispin = 1,
SIZE(evects, 1)
553 matrix_struct=matrix_struct)
555 CALL cp_fm_to_fm(evects(ispin, my_state), ex_env%evect(ispin))
558 IF (log_unit > 0)
THEN
559 gsval = ex_env%wfn_history%gsval
560 gsmin = ex_env%wfn_history%gsmin
561 xsval = ex_env%wfn_history%xsval
562 WRITE (log_unit,
"(1X,A,T40,F10.6,A,T62,F10.6,A)")
"Ground state orbital alignment:", &
563 gsmin,
"[MinVal]", gsval,
"[Average]"
564 WRITE (log_unit,
"(1X,A,T71,F10.6)")
"Excitation vector alignment:", xsval
565 IF (state_change)
THEN
566 WRITE (log_unit,
"(1X,A,I5,T60,A14,T76,I5)") &
567 "Target state has been changed from state ", &
568 old_state,
" to new state ", my_state
570 WRITE (log_unit,
"(1X,A,I4,A,F12.5,A)")
"Calculate properties for state:", &
571 my_state,
" with excitation energy ", ex_env%evalue*
evolt,
" eV"
575 IF (calc_forces)
THEN
577 sub_env, work_matrices)
584 valence_state%nstates = nstates
585 ALLOCATE (valence_state%evals(
SIZE(evals)))
586 valence_state%evals(:) = evals(:)
588 ALLOCATE (valence_state%evects(nspins, nstates))
589 ALLOCATE (valence_state%mos_active(nspins))
592 DO istate = 1, nstates
594 matrix_struct=matrix_struct)
595 CALL cp_fm_create(valence_state%evects(ispin, istate), matrix_struct)
596 CALL cp_fm_to_fm(evects(ispin, istate), valence_state%evects(ispin, istate))
600 matrix_struct=matrix_struct)
601 CALL cp_fm_create(valence_state%mos_active(ispin), matrix_struct)
602 CALL cp_fm_to_fm(gs_mos(ispin)%mos_active, valence_state%mos_active(ispin))
612 tddfpt_print_section, &
615 DEALLOCATE (evals, ostrength)
619 IF (tddfpt_control%do_lrigpw)
THEN
621 DEALLOCATE (kernel_env%full_kernel%lri_env)
623 DEALLOCATE (kernel_env%full_kernel%lri_density)
631 cpabort(
'Unknown kernel type')
638 DO ispin = nspins, 1, -1
643 IF (
ASSOCIATED(matrix_ks_oep))
THEN
647 CALL timestop(handle)
666 SUBROUTINE tddfpt_input(qs_env, tddfpt_section, tddfpt_control, do_hfx, do_admm, do_exck, &
667 do_hfxsr, do_hfxlr, xc_section, tddfpt_print_section, lri_section, &
672 LOGICAL,
INTENT(INOUT) :: do_hfx, do_admm, do_exck, do_hfxsr, &
675 lri_section, hfxsr_section
677 CHARACTER(len=20) :: nstates_str
678 LOGICAL :: exar, exf, exgcp, exhf, exhfxk, exk, &
679 explicit, explicit_root, expot, exvdw, &
680 exwfn, found, same_hfx, use_real_wfn
681 REAL(kind=
dp) :: c_hf
685 print_sub, xc_root, xc_sub
687 NULLIFY (dft_control, input, kpoints)
688 CALL get_qs_env(qs_env, dft_control=dft_control, input=input, kpoints=kpoints)
690 IF (dft_control%nimages > 1)
THEN
692 cpabort(
"TDDFPT with k-points currently supports only KERNEL NONE")
695 IF (use_real_wfn)
THEN
696 cpabort(
"K-point TDDFPT requires complex wavefunctions")
699 cpabort(
"Spin-flip TDDFPT is not implemented for k-points")
701 IF (tddfpt_control%do_smearing)
THEN
702 cpabort(
"Smeared-occupation TDDFPT is not implemented for k-points")
704 IF (tddfpt_control%oe_corr /=
oe_none)
THEN
705 cpabort(
"Orbital-energy-corrected TDDFPT is not implemented for k-points")
707 IF (tddfpt_control%dipole_form /= 0 .AND. &
710 cpabort(
"K-point TDDFPT supports only velocity-form or SCF_MOMENT transition dipoles")
714 IF (tddfpt_control%nstates <= 0)
THEN
716 CALL cp_warn(__location__,
"TDDFPT calculation was requested for "// &
717 trim(nstates_str)//
" excited states: nothing to do.")
721 NULLIFY (tddfpt_print_section)
724 IF (dft_control%nimages > 1)
THEN
725 IF (tddfpt_control%do_exciton_descriptors .OR. &
726 tddfpt_control%do_directional_exciton_descriptors)
THEN
727 cpabort(
"Exciton descriptors are not implemented for k-point TDDFPT")
731 IF (explicit) cpabort(
"NTO analysis is not implemented for k-point TDDFPT")
734 IF (explicit) cpabort(
"NAMD_PRINT is not implemented for k-point TDDFPT")
742 IF (explicit_root)
THEN
748 CALL cp_warn(__location__,
"TDDFPT Kernel with ADIABATIC_RESCALING not possible.")
749 cpabort(
"TDDFPT Input")
756 CALL cp_warn(__location__,
"TDDFPT Kernel with GCP_POTENTIAL not possible.")
757 cpabort(
"TDDFPT Input")
764 CALL cp_warn(__location__,
"TDDFPT Kernel with VDW_POTENTIAL not possible.")
765 cpabort(
"TDDFPT Input")
772 CALL cp_warn(__location__,
"TDDFPT Kernel with WF_CORRELATION not possible.")
773 cpabort(
"TDDFPT Input")
780 CALL cp_warn(__location__,
"TDDFPT Kernel with XC_POTENTIAL not possible.")
781 cpabort(
"TDDFPT Input")
790 IF ((exf .AND. exk) .OR. .NOT. (exf .OR. exk))
THEN
791 CALL cp_warn(__location__,
"TDDFPT Kernel needs XC_FUNCTIONAL or XC_KERNEL section.")
792 cpabort(
"TDDFPT Input")
801 xc_section => xc_root
806 do_hfx = (c_hf /= 0.0_dp)
812 IF (.NOT. same_hfx)
THEN
813 cpabort(
"TDDFPT Kernel must use the same HF section as DFT%XC or no HF at all.")
817 do_admm = do_hfx .AND. dft_control%do_admm
820 CALL cp_abort(__location__, &
821 "ADMM is not implemented for a TDDFT kernel XC-functional which is different from "// &
822 "the one used for the ground-state calculation. A ground-state 'admm_env' cannot be reused.")
845 do_hfx = (c_hf /= 0.0_dp)
847 do_admm = do_hfx .AND. dft_control%do_admm
861 IF (tddfpt_control%rks_triplets .AND. dft_control%nspins > 1)
THEN
862 tddfpt_control%rks_triplets = .false.
863 CALL cp_warn(__location__,
"Keyword RKS_TRIPLETS has been ignored for spin-polarised calculations")
867 IF (tddfpt_control%do_lrigpw)
THEN
872 NULLIFY (hfxsr_section)
876 IF (.NOT. found)
THEN
877 cpabort(
"HFXSR option needs &HF section defined")
879 CALL section_vals_val_get(hfxsr_section,
"INTERACTION_POTENTIAL%POTENTIAL_TYPE", explicit=found)
880 IF (.NOT. found)
THEN
885 IF (.NOT. found)
THEN
886 CALL section_vals_val_set(hfxsr_section,
"INTERACTION_POTENTIAL%CUTOFF_RADIUS", r_val=7.5589_dp)
890 CALL cp_abort(__location__,
"Short range TDA kernel with RI not possible")
903 SUBROUTINE kernel_info(log_unit, dft_control, tddfpt_control, xc_section)
904 INTEGER,
INTENT(IN) :: log_unit
909 CHARACTER(LEN=4) :: ktype
912 lsd = (dft_control%nspins > 1)
915 IF (log_unit > 0)
THEN
916 WRITE (log_unit,
"(T2,A,T77,A4)")
"KERNEL|", trim(ktype)
917 CALL xc_write(log_unit, xc_section, lsd)
918 IF (tddfpt_control%do_hfx)
THEN
919 IF (tddfpt_control%do_admm)
THEN
920 WRITE (log_unit,
"(T2,A,T62,A19)")
"KERNEL|",
"ADMM Exact Exchange"
921 IF (tddfpt_control%admm_xc_correction)
THEN
922 WRITE (log_unit,
"(T2,A,T60,A21)")
"KERNEL|",
"Apply ADMM Kernel XC Correction"
924 IF (tddfpt_control%admm_symm)
THEN
925 WRITE (log_unit,
"(T2,A,T60,A21)")
"KERNEL|",
"Symmetric ADMM Kernel"
928 WRITE (log_unit,
"(T2,A,T67,A14)")
"KERNEL|",
"Exact Exchange"
931 IF (tddfpt_control%do_hfxsr)
THEN
932 WRITE (log_unit,
"(T2,A,T43,A38)")
"KERNEL|",
"Short range HFX approximation"
934 IF (tddfpt_control%do_hfxlr)
THEN
935 WRITE (log_unit,
"(T2,A,T43,A38)")
"KERNEL|",
"Long range HFX approximation"
937 IF (tddfpt_control%do_lrigpw)
THEN
938 WRITE (log_unit,
"(T2,A,T42,A39)")
"KERNEL|",
"LRI approximation of transition density"
943 IF (log_unit > 0)
THEN
944 WRITE (log_unit,
"(T2,A,T77,A4)")
"KERNEL|", trim(ktype)
945 IF (tddfpt_control%stda_control%do_ewald)
THEN
946 WRITE (log_unit,
"(T2,A,T78,A3)")
"KERNEL| Coulomb term uses Ewald summation"
948 WRITE (log_unit,
"(T2,A,T78,A3)")
"KERNEL| Coulomb term uses direct summation (MIC)"
950 IF (tddfpt_control%stda_control%do_exchange)
THEN
951 WRITE (log_unit,
"(T2,A,T78,A3)")
"KERNEL| Exact exchange term",
"YES"
952 WRITE (log_unit,
"(T2,A,T71,F10.3)")
"KERNEL| Short range HFX fraction:", &
953 tddfpt_control%stda_control%hfx_fraction
955 WRITE (log_unit,
"(T2,A,T79,A2)")
"KERNEL| Exact exchange term",
"NO"
957 WRITE (log_unit,
"(T2,A,T66,E15.3)")
"KERNEL| Transition density filter", &
958 tddfpt_control%stda_control%eps_td_filter
962 IF (log_unit > 0)
THEN
963 WRITE (log_unit,
"(T2,A,T77,A4)")
"KERNEL|", trim(ktype)
969 IF (log_unit > 0)
THEN
970 IF (tddfpt_control%rks_triplets)
THEN
971 WRITE (log_unit,
"(T2,A,T74,A7)")
"KERNEL| Spin symmetry of excitations",
"Triplet"
975 WRITE (log_unit,
"(T2,A,T69,A12)")
"KERNEL| Spin symmetry of excitations",
"Unrestricted"
978 WRITE (log_unit,
"(T2,A,T72,A9)")
"KERNEL| Spin flip",
"Collinear"
981 WRITE (log_unit,
"(T2,A,T69,A12)")
"KERNEL| Spin flip",
"Noncollinear"
984 WRITE (log_unit,
"(T2,A,T74,A7)")
"KERNEL| Spin symmetry of excitations",
"Singlet"
986 WRITE (log_unit,
"(T2,A,T73,I8)")
"TDDFPT| Number of states calculated", tddfpt_control%nstates
987 WRITE (log_unit,
"(T2,A,T73,I8)")
"TDDFPT| Number of Davidson iterations", tddfpt_control%niters
988 WRITE (log_unit,
"(T2,A,T66,E15.3)")
"TDDFPT| Davidson iteration convergence", tddfpt_control%conv
989 WRITE (log_unit,
"(T2,A,T73,I8)")
"TDDFPT| Max. number of Krylov space vectors", tddfpt_control%nkvs
992 END SUBROUTINE kernel_info
1000 SUBROUTINE tddfpt_kpoint_independent_particle(qs_env, logger, tddfpt_control)
1005 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_kpoint_independent_particle'
1007 COMPLEX(KIND=dp) :: moment_element
1008 COMPLEX(KIND=dp),
ALLOCATABLE, &
1009 DIMENSION(:, :, :, :, :) :: kpoint_dipole
1010 INTEGER :: handle, ideriv, ikp, ikp_local, iocc, ispin, istate, itrans, ivirt, log_unit, &
1011 nao, nkp, nkp_local, nspins, nstates, ntrans_kpoint, ntrans_spin, ntrans_total, &
1012 spin_offset, trans_index
1013 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: inds
1014 INTEGER,
DIMENSION(2) :: kp_range
1015 INTEGER,
DIMENSION(maxspins) :: homo_spin, nao_spin, nmo_spin, nvirt_spin
1016 LOGICAL :: my_kpgrp, use_real_wfn, &
1017 use_scf_moment_dipoles
1018 REAL(kind=
dp) :: checksum, dipole_im, dipole_re, fsum, &
1019 gap, oscillator_factor, spin_factor
1020 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigenvalues_kp, evals, &
1021 oscillator_strength, transition_energy
1022 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: transition_dipole_im, &
1023 transition_dipole_re
1024 REAL(kind=
dp),
DIMENSION(:),
POINTER :: eigenvalues, wkp
1025 REAL(kind=
dp),
DIMENSION(nderivs) :: transition_dipole_abs
1027 TYPE(
cp_cfm_type) :: cfm_empty, cfm_mo_coeff_global, &
1028 cfm_moment, cfm_operator, cfm_work
1031 TYPE(
cp_fm_type) :: fm_operator_imag, fm_operator_real
1032 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: overlap_deriv
1037 TYPE(
mo_set_type),
DIMENSION(:),
POINTER :: mos_kp
1038 TYPE(
mp_para_env_type),
POINTER :: para_env, para_env_inter_kp, para_env_kp
1040 POINTER :: sab_kp, sab_orb
1044 CALL timeset(routinen, handle)
1046 NULLIFY (blacs_env, blacs_env_all, cmo_coeff_source, dft_control, &
1047 eigenvalues, fm_struct, kp, kp_env, kpoints, ks_env, &
1048 mos_kp, overlap_deriv, para_env, para_env_inter_kp, para_env_kp, &
1049 sab_kp, sab_orb, wkp)
1050 CALL get_qs_env(qs_env, dft_control=dft_control, kpoints=kpoints, ks_env=ks_env, &
1052 cpassert(
ASSOCIATED(kpoints))
1054 CALL get_kpoint_info(kpoints, nkp=nkp, kp_range=kp_range, kp_env=kp_env, &
1055 para_env=para_env, blacs_env_all=blacs_env_all, &
1056 para_env_inter_kp=para_env_inter_kp, para_env_kp=para_env_kp, &
1057 blacs_env=blacs_env, wkp=wkp, sab_nl=sab_kp, use_real_wfn=use_real_wfn)
1058 IF (use_real_wfn) cpabort(
"K-point TDDFPT requires complex wavefunctions")
1059 cpassert(
ASSOCIATED(para_env))
1060 cpassert(
ASSOCIATED(para_env_inter_kp))
1061 cpassert(
ASSOCIATED(para_env_kp))
1062 cpassert(
ASSOCIATED(blacs_env_all))
1063 cpassert(
ASSOCIATED(blacs_env))
1064 cpassert(
ASSOCIATED(kp_env))
1065 cpassert(
ASSOCIATED(ks_env))
1066 cpassert(
ASSOCIATED(sab_orb))
1067 cpassert(
ASSOCIATED(sab_kp))
1069 nspins = dft_control%nspins
1073 nkp_local = max(0, kp_range(2) - kp_range(1) + 1)
1074 IF (nkp_local > 0)
THEN
1075 kp => kp_env(1)%kpoint_env
1077 cpassert(
ASSOCIATED(mos_kp))
1078 cpassert(
SIZE(mos_kp) == nspins)
1079 DO ispin = 1, nspins
1080 CALL get_mo_set(mos_kp(ispin), nmo=nmo_spin(ispin), homo=homo_spin(ispin), &
1081 nao=nao_spin(ispin))
1084 CALL para_env%max(nmo_spin)
1085 CALL para_env%max(homo_spin)
1086 CALL para_env%max(nao_spin)
1089 DO ispin = 1, nspins
1090 nvirt_spin(ispin) = nmo_spin(ispin) - homo_spin(ispin)
1091 IF (homo_spin(ispin) <= 0 .OR. nvirt_spin(ispin) <= 0)
THEN
1092 cpabort(
"At least one occupied and one unoccupied MO are required for k-point TDDFPT")
1094 ntrans_kpoint = ntrans_kpoint + homo_spin(ispin)*nvirt_spin(ispin)
1096 ntrans_total = nkp*ntrans_kpoint
1097 IF (ntrans_total <= 0)
THEN
1098 cpabort(
"No independent-particle k-point transitions available")
1101 ALLOCATE (transition_energy(ntrans_total), transition_dipole_re(ntrans_total, nderivs), &
1102 transition_dipole_im(ntrans_total, nderivs), oscillator_strength(ntrans_total), &
1104 transition_energy = 0.0_dp
1105 transition_dipole_re = 0.0_dp
1106 transition_dipole_im = 0.0_dp
1107 oscillator_strength = 0.0_dp
1109 IF (use_scf_moment_dipoles)
THEN
1110 CALL cp_warn(__location__,
"SCF_MOMENT k-point dipoles use direct SCF MO matrix "// &
1111 "elements; compare folded energy blocks, not individual degenerate states.")
1115 IF (.NOT. use_scf_moment_dipoles)
THEN
1117 basis_type_a=
"ORB", basis_type_b=
"ORB", sab_nl=sab_orb, &
1118 ext_kpoints=kpoints)
1120 ncol_global=maxval(nao_spin), para_env=para_env, context=blacs_env_all)
1122 fm_struct, para_env, para_env_kp, para_env_inter_kp, &
1123 kpoints%rskp_transform, kpoints%xkp, kpoints%nkp_grid, kpoints%kp_dist)
1128 my_kpgrp = (ikp >= kp_range(1) .AND. ikp <= kp_range(2))
1130 ikp_local = ikp - kp_range(1) + 1
1131 kp => kp_env(ikp_local)%kpoint_env
1134 NULLIFY (kp, mos_kp)
1137 DO ispin = 1, nspins
1138 nao = nao_spin(ispin)
1139 ALLOCATE (eigenvalues_kp(nmo_spin(ispin)))
1140 eigenvalues_kp = 0.0_dp
1142 IF (.NOT. use_scf_moment_dipoles)
THEN
1144 para_env=para_env, context=blacs_env_all)
1149 ncol_global=nmo_spin(ispin), para_env=para_env, &
1150 context=blacs_env_all)
1154 para_env=para_env, context=blacs_env_all)
1162 CALL get_mo_set(mos_kp(ispin), eigenvalues=eigenvalues)
1163 cpassert(
ASSOCIATED(eigenvalues))
1164 IF (para_env_kp%is_source())
THEN
1165 eigenvalues_kp(1:nmo_spin(ispin)) = eigenvalues(1:nmo_spin(ispin))
1167 IF (.NOT. use_scf_moment_dipoles)
THEN
1168 cmo_coeff_source => mos_kp(ispin)%cmo_coeff
1170 ELSE IF (.NOT. use_scf_moment_dipoles)
THEN
1171 NULLIFY (cmo_coeff_source)
1173 IF (.NOT. use_scf_moment_dipoles)
THEN
1174 IF (
ASSOCIATED(cmo_coeff_source))
THEN
1180 CALL para_env%sum(eigenvalues_kp)
1182 spin_factor = 1.0_dp
1183 IF (nspins == 1)
THEN
1184 IF (tddfpt_control%rks_triplets)
THEN
1185 spin_factor = 0.0_dp
1187 spin_factor = 2.0_dp
1191 DO ideriv = 1, nderivs
1192 IF (.NOT. use_scf_moment_dipoles)
THEN
1195 fm_operator_real, fm_operator_imag)
1196 CALL cp_fm_to_cfm(fm_operator_real, fm_operator_imag, cfm_operator)
1198 cfm_mo_coeff_global,
z_zero, cfm_work)
1200 cfm_mo_coeff_global, cfm_work,
z_zero, cfm_moment)
1203 DO iocc = 1, homo_spin(ispin)
1204 DO ivirt = homo_spin(ispin) + 1, nmo_spin(ispin)
1205 trans_index = (ikp - 1)*ntrans_kpoint + spin_offset + &
1206 (iocc - 1)*nvirt_spin(ispin) + ivirt - homo_spin(ispin)
1207 gap = eigenvalues_kp(ivirt) - eigenvalues_kp(iocc)
1208 IF (gap <= 0.0_dp)
THEN
1209 cpabort(
"K-point TDDFPT requires positive occupied-virtual energy gaps")
1211 IF (use_scf_moment_dipoles)
THEN
1212 oscillator_factor = sqrt(spin_factor*wkp(ikp))
1213 dipole_re = real(kpoint_dipole(ispin, ikp, ideriv, iocc, ivirt), kind=
dp)
1214 dipole_im = aimag(kpoint_dipole(ispin, ikp, ideriv, iocc, ivirt))
1216 oscillator_factor = sqrt(spin_factor*wkp(ikp))/gap
1218 dipole_re = real(moment_element, kind=
dp)
1219 dipole_im = aimag(moment_element)
1221 transition_dipole_re(trans_index, ideriv) = oscillator_factor*dipole_re
1222 transition_dipole_im(trans_index, ideriv) = oscillator_factor*dipole_im
1227 DO iocc = 1, homo_spin(ispin)
1228 DO ivirt = homo_spin(ispin) + 1, nmo_spin(ispin)
1229 trans_index = (ikp - 1)*ntrans_kpoint + spin_offset + &
1230 (iocc - 1)*nvirt_spin(ispin) + ivirt - homo_spin(ispin)
1231 transition_energy(trans_index) = eigenvalues_kp(ivirt) - eigenvalues_kp(iocc)
1232 oscillator_strength(trans_index) = 2.0_dp/3.0_dp*transition_energy(trans_index)* &
1233 sum(transition_dipole_re(trans_index, :)**2 + &
1234 transition_dipole_im(trans_index, :)**2)
1237 IF (.NOT. use_scf_moment_dipoles)
THEN
1245 DEALLOCATE (eigenvalues_kp)
1246 spin_offset = spin_offset + homo_spin(ispin)*nvirt_spin(ispin)
1250 IF (any(transition_energy <= 0.0_dp))
THEN
1251 cpabort(
"K-point TDDFPT KERNEL NONE requires positive occupied-virtual energy gaps")
1254 CALL sort(transition_energy, ntrans_total, inds)
1255 nstates = min(tddfpt_control%nstates, ntrans_total)
1256 IF (tddfpt_control%nstates > ntrans_total)
THEN
1257 cpwarn(
"Requested more TDDFPT states than independent-particle k-point transitions")
1260 ALLOCATE (evals(nstates))
1261 evals(1:nstates) = transition_energy(1:nstates)
1262 checksum = sqrt(sum(evals**2))
1265 IF (log_unit > 0)
THEN
1266 WRITE (log_unit,
"(1X,A)")
"", &
1267 "-------------------------------------------------------------------------------", &
1268 "- TDDFPT K-point Independent-particle Transitions -", &
1269 "-------------------------------------------------------------------------------"
1270 WRITE (log_unit,
"(1X,A)") &
1271 "Only KERNEL NONE is active for k-point TDDFPT; transition dipole magnitudes are shown."
1272 WRITE (log_unit,
'(/,T10,A,T19,A,T37,A,T69,A)')
"State",
"Excitation", &
1273 "Transition dipole (a.u.)",
"Oscillator"
1274 WRITE (log_unit,
'(T10,A,T19,A,T37,A,T49,A,T61,A,T67,A)')
"number",
"energy (eV)", &
1275 "x",
"y",
"z",
"strength (a.u.)"
1276 WRITE (log_unit,
'(T10,72("-"))')
1280 DO istate = 1, nstates
1281 itrans = inds(istate) - 1
1282 ikp = itrans/ntrans_kpoint + 1
1283 itrans = mod(itrans, ntrans_kpoint)
1285 DO ispin = 1, nspins
1286 ntrans_spin = homo_spin(ispin)*nvirt_spin(ispin)
1287 IF (itrans < spin_offset + ntrans_spin)
THEN
1288 itrans = itrans - spin_offset
1289 iocc = itrans/nvirt_spin(ispin) + 1
1290 ivirt = mod(itrans, nvirt_spin(ispin)) + homo_spin(ispin) + 1
1293 spin_offset = spin_offset + ntrans_spin
1296 IF (log_unit > 0)
THEN
1297 transition_dipole_abs(1:nderivs) = &
1298 sqrt(transition_dipole_re(inds(istate), 1:nderivs)**2 + &
1299 transition_dipole_im(inds(istate), 1:nderivs)**2)
1300 WRITE (log_unit,
'(1X,A,T9,I7,T19,F11.5,T31,3(1X,ES11.4E2),T69,ES12.5E2)') &
1301 "TDDFPT|", istate, evals(istate)*
evolt, transition_dipole_abs, &
1302 oscillator_strength(inds(istate))
1303 fsum = fsum + oscillator_strength(inds(istate))**2
1304 WRITE (log_unit,
'(1X,A,T18,I7,T28,I7,T38,I7,T50,I7,T62,I7,T74,F10.5)') &
1305 "TDDFPT_KPOINT|", istate, ikp, ispin, iocc, ivirt, wkp(ikp)
1309 IF (log_unit > 0)
THEN
1310 WRITE (log_unit,
'(/,T2,A,E16.8)')
'TDDFPT : CheckSum E = ', checksum
1311 WRITE (log_unit,
'(T2,A,E16.8)')
'TDDFPT : CheckSum F = ', sqrt(fsum)
1312 WRITE (log_unit,
"(1X,A)") &
1313 "-------------------------------------------------------------------------------"
1316 IF (use_scf_moment_dipoles)
THEN
1317 DEALLOCATE (kpoint_dipole)
1323 DEALLOCATE (evals, inds, oscillator_strength, transition_dipole_im, transition_dipole_re, &
1326 CALL timestop(handle)
1328 END SUBROUTINE tddfpt_kpoint_independent_particle
1356 tddfpt_control, logger, tddfpt_print_section, evects, evals, &
1357 gs_mos, tddfpt_section, S_evects, matrix_s, kernel_env, matrix_ks, &
1358 sub_env, ostrength, dipole_op_mos_occ, mult, xc_section, full_kernel_env, &
1359 kernel_env_admm_aux)
1362 INTEGER :: nstates, nspins
1367 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: evects
1368 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals
1372 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: s_evects
1377 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: ostrength
1378 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: dipole_op_mos_occ
1383 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_energies'
1385 CHARACTER(len=20) :: nstates_str
1386 INTEGER :: energy_unit, handle, iter, log_unit, &
1387 niters, nocc, nstate_max, &
1389 LOGICAL :: do_admm, do_exck, do_soc, explicit
1390 REAL(kind=
dp) :: conv
1393 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_ks_oep
1399 CALL timeset(routinen, handle)
1401 CALL get_qs_env(qs_env, dft_control=dft_control)
1403 NULLIFY (admm_env, matrix_ks_oep)
1404 do_admm = tddfpt_control%do_admm
1405 IF (do_admm)
CALL get_qs_env(qs_env, admm_env=admm_env)
1411 rho_orb_struct=work_matrices%rho_orb_struct_sub, &
1412 rho_xc_struct=work_matrices%rho_xc_struct_sub, &
1413 is_rks_triplets=tddfpt_control%rks_triplets, &
1414 qs_env=qs_env, sub_env=sub_env, &
1415 wfm_rho_orb=work_matrices%rho_ao_orb_fm_sub)
1416 IF (dft_control%qs_control%gapw_xc)
THEN
1417 rho0_struct => work_matrices%rho_xc_struct_sub
1419 rho0_struct => work_matrices%rho_orb_struct_sub
1424 IF (tddfpt_control%admm_xc_correction)
THEN
1426 rho_struct_sub=rho0_struct, &
1427 xc_section=admm_env%xc_section_primary, &
1428 is_rks_triplets=tddfpt_control%rks_triplets, &
1429 sub_env=sub_env, qs_env=qs_env)
1432 rho_struct_sub=rho0_struct, &
1433 xc_section=xc_section, &
1434 is_rks_triplets=tddfpt_control%rks_triplets, &
1435 sub_env=sub_env, qs_env=qs_env)
1439 rho_orb_struct=work_matrices%rho_orb_struct_sub, &
1440 rho_aux_fit_struct=work_matrices%rho_aux_fit_struct_sub, &
1441 local_rho_set=sub_env%local_rho_set_admm, &
1442 qs_env=qs_env, sub_env=sub_env, &
1443 wfm_rho_orb=work_matrices%rho_ao_orb_fm_sub, &
1444 wfm_rho_aux_fit=work_matrices%rho_ao_aux_fit_fm_sub, &
1445 wfm_aux_orb=work_matrices%wfm_aux_orb_sub)
1448 rho_struct_sub=work_matrices%rho_aux_fit_struct_sub, &
1449 xc_section=admm_env%xc_section_aux, &
1450 is_rks_triplets=tddfpt_control%rks_triplets, &
1451 sub_env=sub_env, qs_env=qs_env)
1452 kernel_env%full_kernel => full_kernel_env
1453 kernel_env%admm_kernel => kernel_env_admm_aux
1457 rho_struct_sub=rho0_struct, &
1458 xc_section=xc_section, &
1459 is_rks_triplets=tddfpt_control%rks_triplets, &
1460 sub_env=sub_env, qs_env=qs_env)
1461 kernel_env%full_kernel => full_kernel_env
1462 NULLIFY (kernel_env%admm_kernel)
1465 do_exck = tddfpt_control%do_exck
1466 kernel_env%full_kernel%do_exck = do_exck
1469 CALL create_fxc_kernel(work_matrices%rho_orb_struct_sub, work_matrices%fxc_rspace_sub, &
1470 xc_section, tddfpt_control%rks_triplets, sub_env, qs_env)
1475 IF (tddfpt_control%do_lrigpw)
THEN
1478 tddfpt_print_section)
1490 nstate_max = nocc*nvirt
1491 IF ((
SIZE(gs_mos, 1) == 2) .AND. (tddfpt_control%spinflip ==
no_sf_tddfpt))
THEN
1494 nstate_max = nocc*nvirt + nstate_max
1496 IF (nstates > nstate_max)
THEN
1497 cpwarn(
"NUMBER OF EXCITED STATES COULD LEAD TO PROBLEMS!")
1498 cpwarn(
"Experimental: CHANGED NSTATES TO ITS MAXIMUM VALUE!")
1499 nstates = nstate_max
1506 IF (tddfpt_control%is_restart .AND. .NOT. do_soc)
THEN
1514 tddfpt_section=tddfpt_section, &
1515 tddfpt_print_section=tddfpt_print_section, &
1516 fm_pool_ao_mo_active=work_matrices%fm_pool_ao_mo_active, &
1517 blacs_env_global=blacs_env)
1525 "GUESS_VECTORS", extension=
".tddfptLog")
1527 gs_mos=gs_mos, log_unit=log_unit, tddfpt_control=tddfpt_control, &
1528 fm_pool_ao_mo_active=work_matrices%fm_pool_ao_mo_active, &
1529 qs_env=qs_env, nspins=nspins)
1531 tddfpt_print_section,
"GUESS_VECTORS")
1534 gs_mos, evals, tddfpt_control, work_matrices%S_C0)
1537 niters = tddfpt_control%niters
1538 IF (niters > 0)
THEN
1540 "ITERATION_INFO", extension=
".tddfptLog")
1542 tddfpt_print_section, &
1543 "DETAILED_ENERGY", &
1544 extension=
".tddfptLog")
1546 IF (log_unit > 0)
THEN
1547 WRITE (log_unit,
"(1X,A)")
"", &
1548 "-------------------------------------------------------------------------------", &
1549 "- TDDFPT WAVEFUNCTION OPTIMIZATION -", &
1550 "-------------------------------------------------------------------------------"
1552 WRITE (log_unit,
'(/,T11,A,T27,A,T40,A,T62,A)')
"Step",
"Time",
"Convergence",
"Conv. states"
1553 WRITE (log_unit,
'(1X,79("-"))')
1563 s_evects=s_evects, &
1565 tddfpt_control=tddfpt_control, &
1566 matrix_ks=matrix_ks, &
1568 kernel_env=kernel_env, &
1571 iter_unit=log_unit, &
1572 energy_unit=energy_unit, &
1573 tddfpt_print_section=tddfpt_print_section, &
1574 work_matrices=work_matrices)
1581 CALL cp_iterate(logger%iter_info, increment=0, iter_nr_out=iter)
1583 IF ((conv <= tddfpt_control%conv) .OR. iter >= niters)
EXIT
1587 IF (log_unit > 0)
THEN
1588 WRITE (log_unit,
'(1X,25("-"),1X,A,1X,25("-"))')
"Restart Davidson iterations"
1594 CALL cp_iterate(logger%iter_info, increment=0, last=.true.)
1599 tddfpt_print_section=tddfpt_print_section)
1604 IF (log_unit > 0)
THEN
1606 IF (conv <= tddfpt_control%conv)
THEN
1607 WRITE (log_unit,
"(1X,A)")
"", &
1608 "-------------------------------------------------------------------------------", &
1609 "- TDDFPT run converged in "//trim(nstates_str)//
" iteration(s) ", &
1610 "-------------------------------------------------------------------------------"
1612 WRITE (log_unit,
"(1X,A)")
"", &
1613 "-------------------------------------------------------------------------------", &
1614 "- TDDFPT run did NOT converge after "//trim(nstates_str)//
" iteration(s) ", &
1615 "-------------------------------------------------------------------------------"
1620 tddfpt_print_section,
"DETAILED_ENERGY")
1622 tddfpt_print_section,
"ITERATION_INFO")
1624 CALL cp_warn(__location__, &
1625 "Skipping TDDFPT wavefunction optimization")
1628 IF (
ASSOCIATED(matrix_ks_oep))
THEN
1630 CALL cp_warn(__location__, &
1631 "Transition dipole moments and oscillator strengths are likely to be incorrect "// &
1632 "when computed using an orbital energy correction XC-potential together with "// &
1633 "the velocity form of dipole transition integrals")
1641 tddfpt_print_section, &
1649 tddfpt_print_section, &
1650 matrix_s(1)%matrix, &
1654 ALLOCATE (ostrength(nstates))
1662 dipole_op_mos_occ, &
1663 tddfpt_control%dipole_form)
1669 matrix_s(1)%matrix, &
1670 tddfpt_control%spinflip, &
1671 min_amplitude=tddfpt_control%min_excitation_amplitude)
1676 matrix_s(1)%matrix, &
1677 tddfpt_print_section)
1678 IF (tddfpt_control%do_exciton_descriptors)
THEN
1683 matrix_s(1)%matrix, &
1684 tddfpt_control%do_directional_exciton_descriptors, &
1685 tddfpt_control%do_directional_exciton_crosscorrelation, &
1689 IF (tddfpt_control%do_lrigpw)
THEN
1692 tddfpt_lri_env=kernel_env%full_kernel%lri_env)
1695 CALL timestop(handle)
1727 SUBROUTINE tddfpt_soc_energies(qs_env, nstates, work_matrices, &
1728 tddfpt_control, logger, tddfpt_print_section, &
1729 evects, evals, ostrength, &
1730 gs_mos, tddfpt_section, S_evects, matrix_s, kernel_env, matrix_ks, &
1731 sub_env, dipole_op_mos_occ, lmult_tmp, xc_section, full_kernel_env, &
1732 kernel_env_admm_aux)
1735 INTEGER,
INTENT(in) :: nstates
1740 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: evects
1741 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals, ostrength
1745 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: s_evects
1750 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: dipole_op_mos_occ
1751 LOGICAL,
INTENT(in) :: lmult_tmp
1755 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tddfpt_soc_energies'
1757 INTEGER :: handle, ispin, istate, log_unit, mult, &
1760 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: evals_mult, ostrength_mult
1761 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:, :) :: evects_mult
1763 CALL timeset(routinen, handle)
1767 extension=
".tddfptLog")
1770 nspins =
SIZE(gs_mos)
1771 ALLOCATE (evects_mult(nspins, nstates))
1772 ALLOCATE (evals_mult(nstates))
1777 IF (log_unit > 0)
THEN
1778 WRITE (log_unit,
"(1X,A)")
"", &
1779 "-------------------------------------------------------------------------------", &
1780 "- TDDFPT SINGLET ENERGIES -", &
1781 "-------------------------------------------------------------------------------"
1785 IF (log_unit > 0)
THEN
1786 WRITE (log_unit,
"(1X,A)")
"", &
1787 "-------------------------------------------------------------------------------", &
1788 "- TDDFPT TRIPLET ENERGIES -", &
1789 "-------------------------------------------------------------------------------"
1794 CALL tddfpt_energies(qs_env, nstates, nspins, work_matrices, tddfpt_control, logger, &
1795 tddfpt_print_section, evects_mult, evals_mult, &
1796 gs_mos, tddfpt_section, s_evects, matrix_s, &
1797 kernel_env, matrix_ks, sub_env, ostrength_mult, &
1798 dipole_op_mos_occ, mult, xc_section, full_kernel_env, &
1799 kernel_env_admm_aux)
1807 tddfpt_control%do_hfx, &
1808 tddfpt_control%do_admm, tddfpt_control%do_hfxlr, &
1809 tddfpt_control%do_exck, do_sf, qs_env, sub_env)
1812 DO istate = 1, nstates
1813 DO ispin = 1, nspins
1818 DO istate = 1, nstates
1819 DO ispin = 1, nspins
1821 work_matrices%fm_pool_ao_mo_active(ispin)%pool, &
1822 s_evects(ispin, istate))
1826 tddfpt_control%rks_triplets = lmult_tmp
1830 IF (log_unit > 0)
THEN
1831 WRITE (log_unit,
"(1X,A)")
"", &
1832 " singlet excitations finished ", &
1834 "-------------------------------------------------------------------------------", &
1835 "- TDDFPT TRIPLET ENERGIES -", &
1836 "-------------------------------------------------------------------------------"
1840 IF (log_unit > 0)
THEN
1841 WRITE (log_unit,
"(1X,A)")
"", &
1842 " triplet excitations finished ", &
1844 "-------------------------------------------------------------------------------", &
1845 "- TDDFPT SINGLET ENERGIES -", &
1846 "-------------------------------------------------------------------------------"
1851 CALL tddfpt_energies(qs_env, nstates, nspins, work_matrices, tddfpt_control, logger, &
1852 tddfpt_print_section, evects, evals, &
1853 gs_mos, tddfpt_section, s_evects, matrix_s, &
1854 kernel_env, matrix_ks, sub_env, ostrength, &
1855 dipole_op_mos_occ, mult, xc_section, full_kernel_env, &
1856 kernel_env_admm_aux)
1861 CALL tddfpt_soc(qs_env, evals_mult, evals, evects_mult, evects, gs_mos)
1863 CALL tddfpt_soc(qs_env, evals, evals_mult, evects, evects_mult, gs_mos)
1867 DO ispin = 1,
SIZE(evects_mult, 1)
1868 DO istate = 1,
SIZE(evects_mult, 2)
1872 DEALLOCATE (evects_mult, evals_mult, ostrength_mult)
1874 CALL timestop(handle)
1876 END SUBROUTINE tddfpt_soc_energies
1886 SUBROUTINE init_res_method(qs_env, gs_mos, tddfpt_control, tddfpt_section, iounit)
1893 INTEGER,
INTENT(IN) :: iounit
1895 CHARACTER(LEN=*),
PARAMETER :: routinen =
'init_res_method'
1897 INTEGER :: handle, i, io, ispin, nao, nmo, nmol, &
1899 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: orblist
1900 INTEGER,
DIMENSION(:),
POINTER :: mollist
1901 LOGICAL :: do_res, do_sf, ew1, ew2, ew3, ewcut, lms
1902 REAL(kind=
dp) :: eclow, ecup, eint, emo
1903 REAL(kind=
dp),
DIMENSION(:),
POINTER :: rvint
1908 CALL timeset(routinen, handle)
1920 nspins =
SIZE(gs_mos)
1921 IF (.NOT. do_res)
THEN
1922 DO ispin = 1, nspins
1923 nmo = gs_mos(ispin)%nmo_occ
1924 tddfpt_control%nactive(ispin) = nmo
1925 gs_mos(ispin)%nmo_active = nmo
1926 ALLOCATE (gs_mos(ispin)%index_active(nmo))
1928 gs_mos(ispin)%index_active(i) = i
1932 IF (iounit > 0)
THEN
1933 WRITE (iounit,
"(/,1X,27('='),A,26('='))")
' REDUCED EXCITATION SPACE '
1938 ewcut = (ew1 .OR. ew2 .OR. ew3)
1942 cpassert(
SIZE(rvint) == 2)
1946 ecup = min(ecup, eint)
1948 eclow = max(eclow, eint)
1949 IF (ewcut .AND. (iounit > 0))
THEN
1950 IF (eclow < -1.e8_dp .AND. ecup > 1.e8_dp)
THEN
1951 WRITE (iounit,
"(1X,A,T51,A10,T71,A10)") &
1952 'Orbital Energy Window [eV]',
" -Inf",
" Inf"
1953 ELSE IF (eclow < -1.e8_dp)
THEN
1954 WRITE (iounit,
"(1X,A,T51,A10,T71,F10.4)") &
1955 'Orbital Energy Window [eV]',
" -Inf",
evolt*ecup
1956 ELSE IF (ecup > 1.e8_dp)
THEN
1957 WRITE (iounit,
"(1X,A,T51,F10.4,T71,A10)") &
1958 'Orbital Energy Window [eV]',
evolt*eclow,
" Inf"
1960 WRITE (iounit,
"(1X,A,T51,F10.4,T71,F10.4)") &
1961 'Orbital Energy Window [eV]',
evolt*eclow,
evolt*ecup
1968 nmol =
SIZE(mollist)
1969 WRITE (iounit,
"(1X,A)")
'List of Selected Molecules'
1970 WRITE (iounit,
"(1X,15(I5))") mollist(1:nmol)
1973 DO ispin = 1, nspins
1974 tddfpt_control%nactive(ispin) = gs_mos(ispin)%nmo_occ
1976 nmo = maxval(tddfpt_control%nactive)
1977 ALLOCATE (orblist(nmo, nspins))
1983 DO ispin = 1, nspins
1984 cpassert(.NOT.
ASSOCIATED(gs_mos(ispin)%evals_occ_matrix))
1986 ELSE IF (ewcut)
THEN
1988 DO ispin = 1, nspins
1989 DO i = 1, gs_mos(ispin)%nmo_occ
1990 emo = gs_mos(ispin)%evals_occ(i)
1991 IF (emo > eclow .AND. emo < ecup) orblist(i, ispin) = 1
2001 cpabort(
"RSE TDA: no active orbitals selected.")
2003 DO ispin = 1, nspins
2004 nmo = sum(orblist(:, ispin))
2005 tddfpt_control%nactive(ispin) = nmo
2006 gs_mos(ispin)%nmo_active = nmo
2007 ALLOCATE (gs_mos(ispin)%index_active(nmo))
2009 DO i = 1,
SIZE(orblist, 1)
2010 IF (orblist(i, ispin) == 1)
THEN
2012 gs_mos(ispin)%index_active(io) = i
2016 DEALLOCATE (orblist)
2021 IF (iounit > 0)
THEN
2022 WRITE (iounit,
"(1X,A)")
'List of Selected States'
2023 IF (nspins == 1)
THEN
2024 WRITE (iounit,
"(A,T67,A)")
' Active State Orbital',
'Orbital Energy'
2025 DO i = 1, gs_mos(1)%nmo_active
2026 io = gs_mos(1)%index_active(i)
2027 WRITE (iounit,
"(T8,I6,T21,I6,T61,F20.4)") i, io, gs_mos(1)%evals_occ(io)*
evolt
2030 DO ispin = 1, nspins
2031 WRITE (iounit,
"(1X,A,I2)")
'Spin ', ispin
2032 WRITE (iounit,
"(A,T67,A)")
' Active State Orbital',
'Orbital Energy'
2033 DO i = 1, gs_mos(ispin)%nmo_active
2034 io = gs_mos(ispin)%index_active(i)
2035 WRITE (iounit,
"(T8,I6,T21,I6,T61,F20.4)") i, io, gs_mos(ispin)%evals_occ(io)*
evolt
2043 cpabort(
"Restricted Active Space with spin flip TDA NYA")
2046 IF (iounit > 0)
THEN
2047 WRITE (iounit,
"(1X,79('='))")
2052 DO ispin = 1, nspins
2055 nmo = gs_mos(ispin)%nmo_active
2056 CALL cp_fm_struct_create(fm_struct, template_fmstruct=gs_mos(ispin)%mos_occ%matrix_struct, &
2057 ncol_global=nmo, context=blacs_env)
2058 NULLIFY (gs_mos(ispin)%mos_active)
2059 ALLOCATE (gs_mos(ispin)%mos_active)
2063 IF (gs_mos(ispin)%nmo_active == gs_mos(ispin)%nmo_occ)
THEN
2064 DO i = 1, gs_mos(ispin)%nmo_active
2065 cpassert(i == gs_mos(ispin)%index_active(i))
2068 nao, nmo, 1, 1, 1, 1)
2070 DO i = 1, gs_mos(ispin)%nmo_active
2071 io = gs_mos(ispin)%index_active(i)
2073 nao, 1, 1, io, 1, i)
2078 CALL timestop(handle)
2080 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...
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_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
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, rskp_transform)
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.