51 dbt_copy_matrix_to_tensor, &
52 dbt_copy_tensor_to_matrix, &
108#include "../base/base_uses.f90"
114 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
"rt_bse"
135 MODULE PROCEDURE get_sigma_complex, &
141 MODULE PROCEDURE get_hartree_env, &
153 CHARACTER(len=*),
PARAMETER :: routinen =
'run_propagation_bse'
155 INTEGER :: i, j, k, handle
157 REAL(kind=
dp) :: metric, enum_re, enum_im, &
158 idempotence_dev, a_metric_1, a_metric_2
161 CALL timeset(routinen, handle)
180 CALL initialize_moments(rtbse_env)
186 CALL initialize_density_matrix(rtbse_env)
188 CALL read_moments(rtbse_env%moments_section, rtbse_env%sim_start_orig, &
189 rtbse_env%sim_start, rtbse_env%moments_trace, rtbse_env%time_trace)
200 rtbse_env%sim_time = real(rtbse_env%sim_start,
dp)*rtbse_env%sim_dt
202 IF (.NOT. rtbse_env%restart_extracted)
THEN
208 IF (rtbse_env%dft_control%rtp_control%apply_delta_pulse .AND. (.NOT. rtbse_env%restart_extracted))
THEN
209 CALL apply_delta_pulse(rtbse_env)
214 DO i = rtbse_env%sim_start, rtbse_env%sim_nsteps - 1
217 rtbse_env%sim_time = real(i,
dp)*rtbse_env%sim_dt
218 rtbse_env%sim_step = i
220 CALL etrs_scf_loop(rtbse_env, rtbse_env%rho, rtbse_env%rho_M, rtbse_env%rho_new, converged, k, metric)
226 DO j = 1, rtbse_env%n_spin
227 CALL cp_cfm_to_fm(rtbse_env%sigma_SEX(j), rtbse_env%real_workspace(1), rtbse_env%real_workspace(2))
228 CALL antiherm_metric(real_fm=rtbse_env%real_workspace(1), imag_fm=rtbse_env%real_workspace(2), &
229 workspace=rtbse_env%rho_workspace, metric=a_metric_1)
231 workspace=rtbse_env%rho_workspace, metric=a_metric_2)
235 IF (.NOT. converged) cpabort(
"ETRS did not converge")
236 CALL cp_iterate(logger%iter_info, iter_nr=i, last=(i == rtbse_env%sim_nsteps))
237 DO j = 1, rtbse_env%n_spin
254 CALL print_ft(rtbse_env%rtp_section, &
255 rtbse_env%moments_trace, &
256 rtbse_env%time_trace, &
257 rtbse_env%field_trace, &
258 rtbse_env%dft_control%rtp_control, &
259 info_opt=rtbse_env%unit_nr)
264 CALL timestop(handle)
274 CHARACTER(len=*),
PARAMETER :: routinen =
"initialize_rtbse_env"
279 CALL timeset(routinen, handle)
282 CALL get_qs_env(rtbse_env%qs_env, bs_env=bs_env, matrix_s=matrix_s)
286 CALL cp_fm_to_cfm(msourcer=rtbse_env%S_fm, mtarget=rtbse_env%S_cfm)
290 CALL timestop(handle)
299 SUBROUTINE initialize_moments(rtbse_env)
301 CHARACTER(len=*),
PARAMETER :: routinen =
"initialize_moments"
303 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: moments_dbcsr_p
304 INTEGER :: i, k, handle
306 REAL(kind=
dp),
DIMENSION(3) :: rpoint
308 CALL timeset(routinen, handle)
310 CALL get_qs_env(rtbse_env%qs_env, bs_env=bs_env, matrix_s=matrix_s)
314 NULLIFY (moments_dbcsr_p)
315 ALLOCATE (moments_dbcsr_p(3))
318 NULLIFY (moments_dbcsr_p(k)%matrix)
320 ALLOCATE (moments_dbcsr_p(k)%matrix)
322 CALL dbcsr_copy(moments_dbcsr_p(k)%matrix, matrix_s(1)%matrix)
328 reference=rtbse_env%moment_ref_type, ref_point=rtbse_env%user_moment_ref_point)
331 DO i = 1, rtbse_env%n_spin
341 DO i = 1, rtbse_env%n_spin
343 CALL copy_dbcsr_to_fm(moments_dbcsr_p(k)%matrix, rtbse_env%moments_field(k, i))
350 DEALLOCATE (moments_dbcsr_p(k)%matrix)
352 DEALLOCATE (moments_dbcsr_p)
355 CALL timestop(handle)
356 END SUBROUTINE initialize_moments
364 SUBROUTINE initialize_density_matrix(rtbse_env)
366 CHARACTER(len=*),
PARAMETER :: routinen =
"initialize_density_matrix"
368 REAL(kind=
dp),
DIMENSION(:),
POINTER :: occupations
371 CALL timeset(routinen, handle)
373 CALL get_qs_env(rtbse_env%qs_env, bs_env=bs_env)
378 ALLOCATE (occupations(rtbse_env%n_ao))
380 DO i = 1, rtbse_env%n_spin
381 occupations(:) = 0.0_dp
382 occupations(1:rtbse_env%n_occ(i)) = 1.0_dp
384 CALL cp_fm_to_fm(bs_env%fm_mo_coeff_Gamma(i), rtbse_env%real_workspace(1))
386 CALL parallel_gemm(
"N",
"T", rtbse_env%n_ao, rtbse_env%n_ao, rtbse_env%n_ao, &
387 1.0_dp, rtbse_env%real_workspace(1), bs_env%fm_mo_coeff_Gamma(i), &
388 0.0_dp, rtbse_env%real_workspace(2))
390 CALL cp_fm_to_cfm(msourcer=rtbse_env%real_workspace(2), mtarget=rtbse_env%rho(i))
394 DEALLOCATE (occupations)
396 IF (rtbse_env%dft_control%rtp_control%initial_wfn ==
use_rt_restart)
THEN
401 CALL timestop(handle)
402 END SUBROUTINE initialize_density_matrix
412 CHARACTER(len=*),
PARAMETER :: routinen =
"initialize_singleparticle_hamiltonian"
416 CALL timeset(routinen, handle)
418 CALL get_qs_env(rtbse_env%qs_env, bs_env=bs_env)
421 DO i = 1, rtbse_env%n_spin
424 CALL cp_fm_to_fm(bs_env%fm_mo_coeff_Gamma(i), rtbse_env%real_workspace(1))
429 CALL parallel_gemm(
"N",
"T", rtbse_env%n_ao, rtbse_env%n_ao, rtbse_env%n_ao, &
430 1.0_dp, rtbse_env%real_workspace(1), bs_env%fm_mo_coeff_Gamma(i), &
431 0.0_dp, rtbse_env%real_workspace(2))
433 CALL parallel_gemm(
"N",
"N", rtbse_env%n_ao, rtbse_env%n_ao, rtbse_env%n_ao, &
434 1.0_dp, rtbse_env%S_fm, rtbse_env%real_workspace(2), &
435 0.0_dp, rtbse_env%real_workspace(1))
437 CALL parallel_gemm(
"N",
"N", rtbse_env%n_ao, rtbse_env%n_ao, rtbse_env%n_ao, &
438 1.0_dp, rtbse_env%real_workspace(1), rtbse_env%S_fm, &
439 0.0_dp, rtbse_env%real_workspace(2))
440 CALL cp_fm_to_cfm(msourcer=rtbse_env%real_workspace(2), mtarget=rtbse_env%ham_reference(i))
443 CALL cp_fm_to_cfm(msourcer=bs_env%fm_ks_Gamma(i), mtarget=rtbse_env%ham_reference(i))
448 CALL timestop(handle)
459 CHARACTER(len=*),
PARAMETER :: routinen =
"initialize_hartree_potential"
463 CALL timeset(routinen, handle)
465 CALL get_qs_env(rtbse_env%qs_env, bs_env=bs_env)
472 DO i = 1, rtbse_env%n_spin
473 CALL get_hartree(rtbse_env, rtbse_env%rho_orig(i), rtbse_env%hartree_curr(i))
475 CALL cp_fm_scale(rtbse_env%spin_degeneracy, rtbse_env%hartree_curr(i))
477 CALL cp_fm_to_cfm(msourcer=rtbse_env%hartree_curr(i), mtarget=rtbse_env%ham_workspace(1))
479 cmplx(-1.0, 0.0, kind=
dp), rtbse_env%ham_workspace(1))
483 CALL timestop(handle)
494 CHARACTER(len=*),
PARAMETER :: routinen =
"initialize_cohsex_selfenergy"
498 CALL timeset(routinen, handle)
500 CALL get_qs_env(rtbse_env%qs_env, bs_env=bs_env)
508 CALL dbcsr_set(rtbse_env%w_dbcsr, 0.0_dp)
511 CALL dbcsr_add(rtbse_env%w_dbcsr, rtbse_env%v_dbcsr, 1.0_dp, 1.0_dp)
512 CALL dbt_copy_matrix_to_tensor(rtbse_env%w_dbcsr, rtbse_env%screened_dbt)
514 DO i = 1, rtbse_env%n_spin
518 CALL get_sigma(rtbse_env, rtbse_env%sigma_COH(i), -0.5_dp, rtbse_env%S_inv_fm)
520 CALL cp_fm_to_cfm(msourcer=rtbse_env%sigma_COH(i), mtarget=rtbse_env%ham_workspace(1))
522 cmplx(-1.0, 0.0, kind=
dp), rtbse_env%ham_workspace(1))
528 CALL get_sigma(rtbse_env, rtbse_env%sigma_SEX(i), -1.0_dp, rtbse_env%rho_orig(i))
531 cmplx(-1.0, 0.0, kind=
dp), rtbse_env%sigma_SEX(i))
535 CALL timestop(handle)
543 SUBROUTINE apply_delta_pulse(rtbse_env)
545 CHARACTER(len=*),
PARAMETER :: routinen =
"apply_delta_pulse"
546 REAL(kind=
dp) :: intensity, metric
547 REAL(kind=
dp),
DIMENSION(3) :: kvec
548 INTEGER :: i, k, handle
550 CALL timeset(routinen, handle)
553 IF (rtbse_env%unit_nr > 0)
WRITE (rtbse_env%unit_nr,
'(A28)')
' RTBSE| Applying delta pulse'
555 intensity = -rtbse_env%dft_control%rtp_control%delta_pulse_scale
557 kvec(:) = rtbse_env%dft_control%rtp_control%delta_pulse_direction(:)
558 IF (rtbse_env%unit_nr > 0)
WRITE (rtbse_env%unit_nr,
'(A38,E14.4E3,E14.4E3,E14.4E3)') &
559 " RTBSE| Delta pulse elements (a.u.) : ", intensity*kvec(:)
564 kvec(k), rtbse_env%moments_field(k, 1))
567 CALL cp_fm_transpose(rtbse_env%real_workspace(1), rtbse_env%real_workspace(2))
569 0.5_dp, rtbse_env%real_workspace(2))
571 IF (rtbse_env%mat_exp_method ==
do_bch)
THEN
573 CALL parallel_gemm(
"N",
"N", rtbse_env%n_ao, rtbse_env%n_ao, rtbse_env%n_ao, &
574 intensity, rtbse_env%S_inv_fm, rtbse_env%real_workspace(1), &
575 0.0_dp, rtbse_env%real_workspace(2))
576 DO i = 1, rtbse_env%n_spin
578 CALL cp_fm_to_cfm(msourcei=rtbse_env%real_workspace(2), mtarget=rtbse_env%ham_workspace(i))
580 ELSE IF (rtbse_env%mat_exp_method ==
do_exact)
THEN
581 DO i = 1, rtbse_env%n_spin
582 CALL cp_fm_to_cfm(msourcer=rtbse_env%real_workspace(1), mtarget=rtbse_env%ham_effective(i))
583 CALL cp_cfm_gexp(rtbse_env%ham_effective(i), rtbse_env%S_cfm, rtbse_env%ham_workspace(i), &
584 cmplx(0.0, intensity, kind=
dp), rtbse_env%rho_workspace)
588 CALL propagate_density(rtbse_env, rtbse_env%ham_workspace, rtbse_env%rho, rtbse_env%rho_new)
589 metric =
rho_metric(rtbse_env%rho_new, rtbse_env%rho, rtbse_env%n_spin)
590 IF (rtbse_env%unit_nr > 0)
WRITE (rtbse_env%unit_nr, (
'(A42,E38.8E3)'))
" RTBSE| Metric difference after delta kick", metric
592 DO i = 1, rtbse_env%n_spin
596 CALL timestop(handle)
597 END SUBROUTINE apply_delta_pulse
605 FUNCTION rho_metric(rho_new, rho_old, nspin, workspace_opt)
RESULT(metric)
606 TYPE(
cp_cfm_type),
DIMENSION(:),
POINTER,
INTENT(IN):: rho_new, &
608 INTEGER,
INTENT(IN) :: nspin
609 TYPE(
cp_cfm_type),
POINTER,
OPTIONAL :: workspace_opt
611 REAL(kind=
dp) :: metric
612 REAL(kind=
dp),
DIMENSION(:),
ALLOCATABLE :: partial_metric
614 COMPLEX(kind=dp) :: scale_factor
616 ALLOCATE (partial_metric(nspin))
619 IF (
PRESENT(workspace_opt))
THEN
620 workspace = workspace_opt
635 metric = metric + partial_metric(j)*partial_metric(j)
637 metric = sqrt(metric)
640 DEALLOCATE (partial_metric)
650 TYPE(
cp_fm_type),
INTENT(IN),
OPTIONAL :: imag_fm
651 REAL(kind=
dp),
INTENT(OUT) :: metric
652 TYPE(
cp_cfm_type),
DIMENSION(:),
POINTER :: workspace
653 COMPLEX(kind=dp) :: complex_one
656 IF (
PRESENT(imag_fm))
THEN
659 CALL cp_fm_to_cfm(msourcer=real_fm, mtarget=workspace(1))
663 complex_one = cmplx(1.0, 0.0, kind=
dp)
676 SUBROUTINE ham_to_exp(rtbse_env, ham, ham_exp)
680 CHARACTER(len=*),
PARAMETER :: routinen =
"ham_to_exp"
682 CALL timeset(routinen, handle)
683 DO j = 1, rtbse_env%n_spin
684 IF (rtbse_env%mat_exp_method ==
do_bch)
THEN
687 CALL multiply_fm_cfm(
"N",
"N", rtbse_env%n_ao, rtbse_env%n_ao, rtbse_env%n_ao, &
688 1.0_dp, rtbse_env%S_inv_fm, ham(j), &
689 0.0_dp, rtbse_env%rho_workspace(1))
693 CALL cp_cfm_scale(cmplx(0.0, -rtbse_env%sim_dt/2, kind=
dp), rtbse_env%rho_workspace(1))
696 ELSE IF (rtbse_env%mat_exp_method ==
do_exact)
THEN
697 CALL cp_cfm_gexp(ham(j), rtbse_env%S_cfm, ham_exp(j), &
698 cmplx(0.0, -rtbse_env%sim_dt/2, kind=
dp), rtbse_env%rho_workspace)
700 cpabort(
"Only BCH and Taylor matrix exponentiation implemented")
704 CALL timestop(handle)
705 END SUBROUTINE ham_to_exp
712 SUBROUTINE update_effective_ham(rtbse_env, rho)
715 CHARACTER(len=*),
PARAMETER :: routinen =
"update_effective_ham"
716 INTEGER :: k, j, nspin, handle
718 CALL timeset(routinen, handle)
720 nspin = rtbse_env%n_spin
724 CALL cp_cfm_to_cfm(rtbse_env%ham_reference(j), rtbse_env%ham_effective(j))
727 IF (rtbse_env%dft_control%apply_efield_field)
THEN
728 CALL make_field(rtbse_env%dft_control, rtbse_env%field, rtbse_env%sim_step, rtbse_env%sim_time)
731 rtbse_env%field(:) = 0.0_dp
736 CALL cp_fm_to_cfm(msourcer=rtbse_env%moments_field(k, 1), mtarget=rtbse_env%ham_workspace(1))
738 cmplx(rtbse_env%field(k), 0.0, kind=
dp), rtbse_env%ham_workspace(1))
742 CALL get_sigma(rtbse_env, rtbse_env%sigma_COH(j), -0.5_dp, rtbse_env%S_inv_fm)
743 CALL cp_fm_to_cfm(msourcer=rtbse_env%sigma_COH(j), mtarget=rtbse_env%ham_workspace(1))
745 cmplx(1.0, 0.0, kind=
dp), rtbse_env%ham_workspace(1))
749 CALL get_sigma(rtbse_env, rtbse_env%sigma_SEX(j), -1.0_dp, rho(j))
751 cmplx(1.0, 0.0, kind=
dp), rtbse_env%sigma_SEX(j))
755 rtbse_env%hartree_curr(j))
756 CALL cp_fm_to_cfm(msourcer=rtbse_env%hartree_curr(j), mtarget=rtbse_env%ham_workspace(1))
758 cmplx(rtbse_env%spin_degeneracy, 0.0, kind=
dp), rtbse_env%ham_workspace(1))
762 CALL cp_cfm_transpose(rtbse_env%ham_effective(j),
'C', rtbse_env%ham_workspace(1))
764 cmplx(0.5, 0.0, kind=
dp), rtbse_env%ham_workspace(1))
766 CALL timestop(handle)
767 END SUBROUTINE update_effective_ham
778 SUBROUTINE etrs_scf_loop(rtbse_env, rho_start, rho_mid, rho_end, converged, k, metric)
780 TYPE(
cp_cfm_type),
DIMENSION(:),
POINTER :: rho_start, &
785 REAL(kind=
dp) :: metric
786 CHARACTER(len=*),
PARAMETER :: routinen =
"etrs_scf_loop"
789 CALL timeset(routinen, handle)
805 CALL update_effective_ham(rtbse_env, rho_start)
807 CALL ham_to_exp(rtbse_env, rtbse_env%ham_effective, rtbse_env%ham_workspace)
811 CALL propagate_density(rtbse_env, rtbse_env%ham_workspace, rho_mid, rtbse_env%rho_new_last)
813 rtbse_env%sim_step = rtbse_env%sim_step + 1
814 rtbse_env%sim_time = rtbse_env%sim_time + rtbse_env%sim_dt
817 DO k = 1, rtbse_env%etrs_max_iter
819 CALL update_effective_ham(rtbse_env, rtbse_env%rho_new_last)
820 CALL ham_to_exp(rtbse_env, rtbse_env%ham_effective, rtbse_env%ham_workspace)
824 metric =
rho_metric(rho_end, rtbse_env%rho_new_last, rtbse_env%n_spin)
827 IF (metric < rtbse_env%etrs_threshold)
THEN
832 DO j = 1, rtbse_env%n_spin
839 CALL timestop(handle)
840 END SUBROUTINE etrs_scf_loop
851 SUBROUTINE bch_propagate(propagator_matrix, target_matrix, result_matrix, workspace, threshold_opt, max_iter_opt)
855 TYPE(
cp_cfm_type),
DIMENSION(:),
POINTER :: propagator_matrix
857 TYPE(
cp_cfm_type),
DIMENSION(:),
POINTER :: target_matrix
859 TYPE(
cp_cfm_type),
DIMENSION(:),
POINTER :: result_matrix, workspace
861 REAL(kind=
dp),
OPTIONAL :: threshold_opt
862 INTEGER,
OPTIONAL :: max_iter_opt
863 CHARACTER(len=*),
PARAMETER :: routinen =
"bch_propagate"
864 REAL(kind=
dp) :: threshold, prefactor, metric
865 INTEGER :: max_iter, i, n_spin, n_ao, k, &
868 CHARACTER(len=77) :: error
870 CALL timeset(routinen, handle)
874 IF (
PRESENT(threshold_opt))
THEN
875 threshold = threshold_opt
877 threshold = 1.0e-10_dp
880 IF (
PRESENT(max_iter_opt))
THEN
881 max_iter = max_iter_opt
886 n_spin =
SIZE(target_matrix)
900 prefactor = 1.0_dp/real(k, kind=
dp)
903 cmplx(prefactor, 0.0, kind=
dp), propagator_matrix(i), workspace(i), &
904 cmplx(0.0, 0.0, kind=
dp), workspace(i + w_stride))
906 cmplx(prefactor, 0.0, kind=
dp), workspace(i), propagator_matrix(i), &
907 cmplx(1.0, 0.0, kind=
dp), workspace(i + w_stride))
910 cmplx(1.0, 0.0, kind=
dp), workspace(i + w_stride))
912 metric =
rho_metric(workspace(w_stride + 1:), workspace(1:w_stride), n_spin)
913 IF (metric <= threshold)
THEN
922 IF (.NOT. converged)
THEN
923 WRITE (error,
'(A35,E13.4E3,A16,E13.4E3)')
"BCH did not converge, BCH Metric : ", &
924 metric,
"BCH Threshold : ", threshold
928 CALL timestop(handle)
929 END SUBROUTINE bch_propagate
939 TYPE(
cp_cfm_type),
DIMENSION(:),
POINTER :: exponential, &
942 CHARACTER(len=*),
PARAMETER :: routinen =
"propagate_density"
945 CALL timeset(routinen, handle)
946 IF (rtbse_env%mat_exp_method ==
do_exact)
THEN
948 DO j = 1, rtbse_env%n_spin
950 CALL parallel_gemm(
"N",
"C", rtbse_env%n_ao, rtbse_env%n_ao, rtbse_env%n_ao, &
951 cmplx(1.0, 0.0, kind=
dp), rho_old(j), exponential(j), &
952 cmplx(0.0, 0.0, kind=
dp), rtbse_env%rho_workspace(1))
954 CALL parallel_gemm(
"N",
"N", rtbse_env%n_ao, rtbse_env%n_ao, rtbse_env%n_ao, &
955 cmplx(1.0, 0.0, kind=
dp), exponential(j), rtbse_env%rho_workspace(1), &
956 cmplx(0.0, 0.0, kind=
dp), rho_new(j))
958 ELSE IF (rtbse_env%mat_exp_method ==
do_bch .OR. rtbse_env%linearized)
THEN
960 CALL bch_propagate(exponential, rho_old, rho_new, rtbse_env%rho_workspace, threshold_opt=rtbse_env%exp_accuracy, &
961 max_iter_opt=rtbse_env%etrs_max_iter)
963 cpabort(
"Only BCH and exact matrix exponentiation implemented.")
966 CALL timestop(handle)
980 REAL(kind=
dp),
INTENT(OUT) :: electron_n_re, electron_n_im
981 COMPLEX(kind=dp) :: electron_n_buffer
984 electron_n_re = 0.0_dp
985 electron_n_im = 0.0_dp
986 CALL cp_fm_to_cfm(msourcer=rtbse_env%S_fm, mtarget=rtbse_env%rho_workspace(1))
987 DO j = 1, rtbse_env%n_spin
988 CALL cp_cfm_trace(rtbse_env%rho_workspace(1), rho(j), electron_n_buffer)
989 electron_n_re = electron_n_re + real(electron_n_buffer, kind=
dp)
990 electron_n_im = electron_n_im + real(aimag(electron_n_buffer), kind=
dp)
993 electron_n_re = electron_n_re*rtbse_env%spin_degeneracy
994 electron_n_im = electron_n_im*rtbse_env%spin_degeneracy
1007 REAL(kind=
dp),
INTENT(OUT) :: deviation_metric
1008 COMPLEX(kind=dp) :: buffer_1, buffer_2
1009 REAL(kind=
dp) :: buffer_dev
1012 deviation_metric = 0.0_dp
1015 CALL cp_fm_to_cfm(msourcer=rtbse_env%S_fm, mtarget=rtbse_env%rho_workspace(1))
1016 DO j = 1, rtbse_env%n_spin
1017 CALL cp_cfm_trace(rtbse_env%rho_workspace(1), rho(j), buffer_1)
1018 buffer_dev = buffer_dev + real(abs(buffer_1)*abs(buffer_1), kind=
dp)
1021 DO j = 1, rtbse_env%n_spin
1023 CALL multiply_fm_cfm(
"N",
"N", rtbse_env%n_ao, rtbse_env%n_ao, rtbse_env%n_ao, &
1024 1.0_dp, rtbse_env%S_fm, rho(j), &
1025 0.0_dp, rtbse_env%rho_workspace(2))
1027 CALL parallel_gemm(
"N",
"N", rtbse_env%n_ao, rtbse_env%n_ao, rtbse_env%n_ao, &
1028 cmplx(1.0, 0.0, kind=
dp), rho(j), rtbse_env%rho_workspace(2), &
1029 cmplx(0.0, 0.0, kind=
dp), rtbse_env%rho_workspace(3))
1031 CALL cp_cfm_trace(rtbse_env%rho_workspace(1), rtbse_env%rho_workspace(3), buffer_2)
1032 deviation_metric = deviation_metric + real(abs(buffer_2)*abs(buffer_2), kind=
dp)
1034 deviation_metric = sqrt(deviation_metric) - sqrt(buffer_dev)
1049 SUBROUTINE get_sigma_complex(rtbse_env, sigma_cfm, prefactor_opt, greens_cfm, &
1050 grid_diag_re_accum, grid_diag_im_accum)
1053 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: prefactor_opt
1055 REAL(kind=
dp),
INTENT(INOUT),
OPTIONAL :: grid_diag_re_accum(:), grid_diag_im_accum(:)
1056 REAL(kind=
dp) :: prefactor
1059 IF (
PRESENT(prefactor_opt)) prefactor = prefactor_opt
1065 IF (rtbse_env%rirs_kernel)
THEN
1067 grid_diag_re_accum=grid_diag_re_accum, &
1068 grid_diag_im_accum=grid_diag_im_accum)
1074 CALL cp_cfm_to_fm(msource=greens_cfm, mtargetr=rtbse_env%real_workspace(1))
1075 CALL get_sigma(rtbse_env, rtbse_env%real_workspace(2), prefactor, rtbse_env%real_workspace(1))
1076 CALL cp_fm_to_cfm(msourcer=rtbse_env%real_workspace(2), mtarget=rtbse_env%sigma_complex_workspace(1))
1078 CALL cp_cfm_to_fm(msource=greens_cfm, mtargeti=rtbse_env%real_workspace(1))
1079 CALL get_sigma(rtbse_env, rtbse_env%real_workspace(2), prefactor, rtbse_env%real_workspace(1))
1080 CALL cp_fm_to_cfm(msourcei=rtbse_env%real_workspace(2), mtarget=sigma_cfm)
1083 cmplx(1.0, 0.0, kind=
dp), rtbse_env%sigma_complex_workspace(1))
1085 END SUBROUTINE get_sigma_complex
1095 SUBROUTINE get_sigma_real(rtbse_env, sigma_fm, prefactor_opt, greens_fm)
1098 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: prefactor_opt
1100 REAL(kind=
dp) :: prefactor
1105 IF (
PRESENT(prefactor_opt)) prefactor = prefactor_opt
1112 CALL get_qs_env(rtbse_env%qs_env, bs_env=bs_env)
1113 CALL dbcsr_create(greens_dbcsr_scratch, name=
"get_sigma greens scratch", &
1114 template=bs_env%mat_ao_ao%matrix)
1117 CALL get_sigma_dbcsr(rtbse_env, sigma_fm, prefactor, greens_dbcsr_scratch)
1120 END SUBROUTINE get_sigma_real
1129 SUBROUTINE get_sigma_dbcsr(rtbse_env, sigma_fm, prefactor_opt, greens_dbcsr)
1132 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: prefactor_opt
1134 REAL(kind=
dp) :: prefactor
1137 IF (
PRESENT(prefactor_opt)) prefactor = prefactor_opt
1139 CALL get_sigma_noenv(sigma_fm, prefactor_opt, greens_dbcsr, &
1140 rtbse_env%screened_dbt, rtbse_env%t_3c_w, &
1141 rtbse_env%t_3c_work_RI_AO__AO, rtbse_env%t_3c_work2_RI_AO__AO, &
1142 rtbse_env%greens_dbt)
1143 END SUBROUTINE get_sigma_dbcsr
1159 SUBROUTINE get_sigma_noenv(sigma_fm, prefactor_opt, greens_dbcsr, screened_dbt, &
1160 int_3c_dbt, work_dbt_3c_1, work_dbt_3c_2, work_dbt_2c)
1162 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: prefactor_opt
1164 TYPE(dbt_type) :: screened_dbt, &
1169 CHARACTER(len=*),
PARAMETER :: routineN =
'get_sigma'
1170 REAL(kind=
dp) :: prefactor
1174 CALL timeset(routinen, handle)
1176 IF (
PRESENT(prefactor_opt))
THEN
1177 prefactor = prefactor_opt
1188 CALL dbt_contract(alpha=1.0_dp, &
1189 tensor_1=screened_dbt, &
1190 tensor_2=int_3c_dbt, &
1192 tensor_3=work_dbt_3c_1, &
1193 contract_1=[2], notcontract_1=[1], map_1=[1], &
1194 contract_2=[1], notcontract_2=[2, 3], map_2=[2, 3])
1198 CALL dbt_copy_matrix_to_tensor(greens_dbcsr, work_dbt_2c)
1201 CALL dbt_contract(alpha=1.0_dp, &
1202 tensor_1=work_dbt_3c_1, &
1203 tensor_2=work_dbt_2c, &
1205 tensor_3=work_dbt_3c_2, &
1206 contract_1=[2], notcontract_1=[1, 3], map_1=[1, 3], &
1207 contract_2=[2], notcontract_2=[1], map_2=[2])
1209 CALL dbt_contract(alpha=prefactor, &
1210 tensor_1=int_3c_dbt, &
1211 tensor_2=work_dbt_3c_2, &
1213 tensor_3=work_dbt_2c, &
1214 contract_1=[1, 3], notcontract_1=[2], map_1=[1], &
1215 contract_2=[1, 2], notcontract_2=[3], map_2=[2])
1219 CALL dbcsr_create(sigma_dbcsr, name=
"sigma", template=greens_dbcsr)
1220 CALL dbt_copy_tensor_to_matrix(work_dbt_2c, sigma_dbcsr)
1224 CALL dbt_clear(work_dbt_3c_1)
1225 CALL dbt_clear(work_dbt_3c_2)
1226 CALL dbt_clear(work_dbt_2c)
1227 CALL timestop(handle)
1229 END SUBROUTINE get_sigma_noenv
1246 TYPE(
dbcsr_type),
DIMENSION(:),
ALLOCATABLE :: v_dbcsr_a, &
1251 bs_env => rtbse_env%bs_env
1254 ALLOCATE (v_dbcsr_a(1))
1255 ALLOCATE (metric_dbcsr(1))
1256 CALL dbcsr_create(v_dbcsr_a(1), name=
"Hartree_dbcsr", template=bs_env%mat_RI_RI%matrix)
1257 CALL dbcsr_create(metric_dbcsr(1), name=
"RI_metric_dbcsr", template=bs_env%mat_RI_RI%matrix)
1262 coulomb_op,
"Coulomb_neighbor_2c_list", rtbse_env%qs_env, &
1263 sym_ij=.false., molecular=.true.)
1265 bs_env%basis_set_RI, bs_env%basis_set_RI, coulomb_op, &
1266 do_kpoints=.false., regularization_ri=bs_env%regularization_RI)
1270 bs_env%ri_metric,
"Metric_neighbor_2c_list", rtbse_env%qs_env, &
1271 sym_ij=.false., molecular=.true.)
1273 bs_env%basis_set_RI, bs_env%basis_set_RI, bs_env%ri_metric, &
1274 do_kpoints=.false., regularization_ri=bs_env%regularization_RI)
1277 CALL cp_fm_create(metric_fm, bs_env%fm_RI_RI%matrix_struct)
1279 CALL cp_fm_create(metric_inv_fm, bs_env%fm_RI_RI%matrix_struct)
1281 CALL cp_fm_create(work_fm, bs_env%fm_RI_RI%matrix_struct)
1289 work_fm, bs_env%n_RI)
1290 CALL parallel_gemm(
"N",
"N", bs_env%n_RI, bs_env%n_RI, bs_env%n_RI, &
1291 1.0_dp, metric_inv_fm, work_fm, 0.0_dp, v_fm)
1302 DEALLOCATE (v_dbcsr_a)
1303 DEALLOCATE (metric_dbcsr)
1321 SUBROUTINE get_hartree_env(rtbse_env, rho_fm, v_fm)
1328 CALL get_qs_env(rtbse_env%qs_env, para_env=para_env, bs_env=bs_env)
1330 CALL get_hartree_noenv(v_fm, rho_fm, rtbse_env%int_3c_array, rtbse_env%v_dbcsr, &
1331 rtbse_env%n_RI, bs_env%sizes_RI, &
1332 para_env, rtbse_env%rho_dbcsr, rtbse_env%v_ao_dbcsr)
1333 END SUBROUTINE get_hartree_env
1349 SUBROUTINE get_hartree_noenv(v_fm, rho_fm, int_3c, v_dbcsr, n_RI, sizes_RI, para_env, rho_dbcsr, v_ao_dbcsr)
1352 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: int_3c
1355 INTEGER,
DIMENSION(:) :: sizes_ri
1358 CHARACTER(len=*),
PARAMETER :: routineN =
"get_hartree"
1360 INTEGER :: i, j, k, n, nblocks, ind_1, ind_2, row_offset, col_offset, &
1361 row_size, col_size, j_n_AO, k_n_AO, i_n_RI, &
1362 ri_offset, ind_i, handle
1363 REAL(kind=
dp),
DIMENSION(:),
ALLOCATABLE :: pvector, qvector
1364 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: block_matrix
1365 INTEGER :: nblkrows_local, nblkcols_local, j_blk, k_blk, j_offset, k_offset
1366 INTEGER,
DIMENSION(:),
POINTER :: local_blk_rows, local_blk_cols
1370 mark_used(ri_offset)
1377 CALL timeset(routinen, handle)
1380 ALLOCATE (qvector(n_ri), source=0.0_dp)
1381 ALLOCATE (pvector(n_ri), source=0.0_dp)
1390 CALL dbcsr_get_info(rho_dbcsr, nblkrows_local=nblkrows_local, nblkcols_local=nblkcols_local, &
1391 local_rows=local_blk_rows, local_cols=local_blk_cols)
1392 DO j_blk = 1, nblkrows_local
1394 DO k_blk = 1, nblkcols_local
1397 CALL dbcsr_get_block_p(rho_dbcsr, local_blk_rows(j_blk), local_blk_cols(k_blk), &
1398 block=block_matrix, found=found, row_size=row_size, col_size=col_size)
1400 IF (.NOT. found) cycle
1407 qvector(i) = qvector(i) + int_3c(j_offset + j, k_offset + k, i)*block_matrix(j, k)
1413 k_offset = k_offset + col_size
1416 j_offset = j_offset + row_size
1420 CALL para_env%sum(qvector)
1428 row_offset=row_offset, col_offset=col_offset, row_size=row_size, col_size=col_size)
1430 j_n_ao = sizes_ri(ind_1)
1431 k_n_ao = sizes_ri(ind_2)
1437 pvector(j + row_offset - 1) = pvector(j + row_offset - 1) + block_matrix(j, k)*qvector(k + col_offset - 1)
1444 CALL para_env%sum(pvector)
1449 DO j_blk = 1, nblkrows_local
1451 DO k_blk = 1, nblkcols_local
1454 CALL dbcsr_get_block_p(v_ao_dbcsr, local_blk_rows(j_blk), local_blk_cols(k_blk), &
1455 block=block_matrix, found=found, row_size=row_size, col_size=col_size)
1457 IF (.NOT. found)
THEN
1459 CALL dbcsr_reserve_blocks(v_ao_dbcsr, local_blk_rows(j_blk:j_blk), local_blk_cols(k_blk:k_blk))
1461 CALL dbcsr_get_block_p(v_ao_dbcsr, local_blk_rows(j_blk), local_blk_cols(k_blk), &
1462 block=block_matrix, found=found, row_size=row_size, col_size=col_size)
1469 block_matrix(j, k) = 0.0_dp
1471 block_matrix(j, k) = block_matrix(j, k) + pvector(i)*int_3c(j_offset + j, k_offset + k, i)
1477 k_offset = k_offset + col_size
1480 j_offset = j_offset + row_size
1485 DEALLOCATE (qvector)
1486 DEALLOCATE (pvector)
1488 CALL timestop(handle)
1489 END SUBROUTINE get_hartree_noenv
1503 SUBROUTINE cp_cfm_gexp(amatrix, bmatrix, exponential, eig_scale_opt, work_opt)
1508 COMPLEX(kind=dp),
INTENT(IN),
OPTIONAL :: eig_scale_opt
1509 TYPE(
cp_cfm_type),
DIMENSION(:),
POINTER,
OPTIONAL :: work_opt
1510 CHARACTER(len=*),
PARAMETER :: routinen =
"cp_cfm_gexp"
1511 COMPLEX(kind=dp) :: eig_scale
1512 REAL(kind=
dp),
DIMENSION(:),
ALLOCATABLE :: eigenvalues
1513 COMPLEX(kind=dp),
DIMENSION(:),
ALLOCATABLE :: expvalues
1515 LOGICAL :: deallocate_work
1516 INTEGER :: nrow, i, handle
1518 CALL timeset(routinen, handle)
1521 IF (
PRESENT(eig_scale_opt))
THEN
1522 eig_scale = eig_scale_opt
1524 eig_scale = cmplx(1.0, 0.0, kind=
dp)
1528 deallocate_work = .true.
1529 IF (
PRESENT(work_opt))
THEN
1530 deallocate_work =
SIZE(work_opt) < 4
1532 IF (.NOT. deallocate_work)
THEN
1542 nrow = amatrix%matrix_struct%nrow_global
1544 ALLOCATE (eigenvalues(nrow))
1545 ALLOCATE (expvalues(nrow))
1552 CALL cp_cfm_geeig(work(1), work(2), work(3), eigenvalues, work(4))
1555 expvalues(:) = exp(eigenvalues(:)*eig_scale)
1565 cmplx(1.0, 0.0, kind=
dp), work(1), work(3), &
1566 cmplx(0.0, 0.0, kind=
dp), work(2))
1569 cmplx(1.0, 0.0, kind=
dp), work(2), bmatrix, &
1570 cmplx(0.0, 0.0, kind=
dp), exponential)
1573 IF (deallocate_work)
THEN
1580 DEALLOCATE (eigenvalues)
1581 DEALLOCATE (expvalues)
1583 CALL timestop(handle)
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public marek2025
Basic linear algebra operations for complex full matrices.
subroutine, public cp_cfm_scale_and_add(alpha, matrix_a, beta, matrix_b)
Scale and add two BLACS matrices (a = alpha*a + beta*b).
real(kind=dp) function, public cp_cfm_norm(matrix, mode)
Norm of matrix using (p)zlange.
subroutine, public cp_cfm_transpose(matrix, trans, matrixt)
Transposes a BLACS distributed complex matrix.
subroutine, public cp_cfm_column_scale(matrix_a, scaling, first_col, source)
Scales columns of the full matrix by corresponding factors.
subroutine, public cp_cfm_trace(matrix_a, matrix_b, trace, conjugate_a, local)
By default, returns the trace of matrix_a^T matrix_b, i.e sum_{i,j}(matrix_a(i,j)*matrix_b(i,...
used for collecting diagonalization schemes available for cp_cfm_type
subroutine, public cp_cfm_geeig(amatrix, bmatrix, eigenvectors, eigenvalues, work, lowest_subset)
General Eigenvalue Problem AX = BXE Single option version: Cholesky decomposition of B.
Represents a complex full matrix distributed on many processors.
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.
subroutine, public cp_cfm_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, matrix_struct, para_env)
Returns information about a full matrix.
subroutine, public cp_cfm_to_fm(msource, mtargetr, mtargeti)
Copy real and imaginary parts of a complex full matrix into separate real-value full matrices.
subroutine, public dbcsr_iterator_stop(iterator)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_get_block_p(matrix, row, col, block, found, row_size, col_size)
...
subroutine, public dbcsr_get_info(matrix, nblkrows_total, nblkcols_total, nfullrows_total, nfullcols_total, nblkrows_local, nblkcols_local, nfullrows_local, nfullcols_local, my_prow, my_pcol, local_rows, local_cols, proc_row_dist, proc_col_dist, row_blk_size, col_blk_size, row_blk_offset, col_blk_offset, distribution, name, matrix_type, group)
...
subroutine, public dbcsr_reserve_blocks(matrix, rows, cols)
...
subroutine, public dbcsr_iterator_next_block(iterator, row, column, block, block_number_argument_has_been_removed, row_size, col_size, row_offset, col_offset, transposed)
...
subroutine, public dbcsr_iterator_start(iterator, matrix, shared, dynamic, dynamic_byrows)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_release(matrix)
...
integer function, public dbcsr_get_num_blocks(matrix)
...
subroutine, public dbcsr_clear(matrix)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_sm_fm_multiply(matrix, fm_in, fm_out, ncol, alpha, beta)
multiply a dbcsr with a fm matrix
subroutine, public copy_dbcsr_to_fm(matrix, fm, plan, check_plan)
Copy a DBCSR matrix to a BLACS matrix.
subroutine, public copy_fm_to_dbcsr(fm, matrix, keep_sparsity)
Copy a BLACS matrix to a dbcsr matrix.
Basic linear algebra operations for full matrices.
subroutine, public cp_fm_transpose(matrix, matrixt)
transposes a matrix matrixt = matrix ^ T
subroutine, public cp_fm_scale_and_add(alpha, matrix_a, beta, matrix_b)
calc A <- alpha*A + beta*B optimized for alpha == 1.0 (just add beta*B) and beta == 0....
subroutine, public cp_fm_invert(matrix_a, matrix_inverse, det_a, eps_svd, eigval)
Inverts a cp_fm_type matrix, optionally returning the determinant of the input matrix.
subroutine, public cp_fm_scale(alpha, matrix_a)
scales a matrix matrix_a = alpha * matrix_b
subroutine, public cp_fm_column_scale(matrixa, scaling, first_col, source)
Scales columns of the full matrix by corresponding factors.
represent a full matrix distributed on many processors
subroutine, public cp_fm_set_all(matrix, alpha, beta)
set all elements of a matrix to the same value, and optionally the diagonal to a different one
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 ...
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_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.
This is the start of a dbt_api, all publically needed functions are exported here....
all routins needed for a nonperiodic electric field
subroutine, public make_field(dft_control, field, sim_step, sim_time)
computes the amplitude of the efield within a given envelop
Interface for the force calculations.
recursive subroutine, public force_env_calc_energy_force(force_env, calc_force, consistent_energies, skip_external_control, eval_energy_forces, require_consistent_energy_force, linres, calc_stress_tensor)
Interface routine for force and energy calculations.
Interface for the force calculations.
Library choices for electronic integral APIs.
Defines the basic variable types.
integer, parameter, public dp
Interface to the message passing library MPI.
Calculates the moment integrals <a|r^m|b>.
subroutine, public get_reference_point(rpoint, drpoint, qs_env, fist_env, reference, ref_point, ifirst, ilast)
...
basic linear algebra operations for full matrixes
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.
Calculates the moment integrals <a|r^m|b> and <a|r x d/dr|b>.
subroutine, public build_local_moment_matrix(qs_env, moments, nmoments, ref_point, ref_points, basis_type, all_images, minimum_image, neighbor_image, first_component)
...
Define the neighbor list data types and the corresponding functionality.
subroutine, public release_neighbor_list_sets(nlists)
releases an array of neighbor_list_sets
Utility methods to build 3-center integral tensors of various types.
subroutine, public build_2c_integrals(t2c, filter_eps, qs_env, nl_2c, basis_i, basis_j, potential_parameter, do_kpoints, do_hfx_kpoints, ext_kpoints, regularization_ri)
...
subroutine, public build_2c_neighbor_lists(ij_list, basis_i, basis_j, potential_parameter, name, qs_env, sym_ij, molecular, dist_2d, pot_to_rad)
Build 2-center neighborlists adapted to different operators This mainly wraps build_neighbor_lists fo...
Input/output from the propagation via RT-BSE method.
subroutine, public print_rtbse_header_info(rtbse_env)
Writes the header and basic info to the standard output.
subroutine, public output_restart(rtbse_env, rho, time_index)
Outputs the restart info (last finished iteration step) + restard density matrix.
subroutine, public print_etrs_info(rtbse_env, step, metric)
Writes the update after single etrs iteration - only for log level > medium.
subroutine, public read_field(rtbse_env)
Reads the field from the files provided by input - useful for the continuation run.
subroutine, public print_etrs_info_header(rtbse_env)
Writes the header for the etrs iteration updates - only for log level > medium.
subroutine, public output_mos_contravariant(rtbse_env, rho, print_key_section)
Outputs the matrix in MO basis for matrix coefficients corresponding to contravariant operator,...
subroutine, public output_field(rtbse_env, append_opt)
Prints the current field components into a file provided by input.
subroutine, public print_timestep_info(rtbse_env, step, electron_num_re, convergence, etrs_num, step_walltime)
Writes the summary line of a completed propagation timestep.
subroutine, public read_restart(rtbse_env)
Reads the density matrix from restart files and updates the starting time.
subroutine, public output_moments(rtbse_env, rho)
Outputs the expectation value of moments from a given density matrix.
RT-BSE RI-RS kernels: SEX and Hartree evaluated by collocation on grid points r_l....
subroutine, public compute_sigma_ri_rs_complex(bs_env, sigma_ao_cfm, prefactor, rho_ao_cfm, grid_diag_re_accum, grid_diag_im_accum)
Complex-input AO SEX via Re/Im split: the kernel is real, so complex linearity holds as Σ[Δρ] = Σ[Re ...
Data storage and other types for propagation via RT-BSE method.
subroutine, public create_rtbse_env(rtbse_env, force_env, linearized)
Allocates structures and prepares rtbse_env for run.
subroutine, public release_rtbse_env(rtbse_env)
Releases the environment allocated structures.
subroutine, public multiply_fm_cfm(trans_r, trans_c, na, nb, nc, alpha, matrix_r, matrix_c, beta, res)
Multiplies real matrix by a complex matrix from the right.
Routines for the propagation via RT-BSE method.
subroutine, public antiherm_metric(real_fm, imag_fm, workspace, metric)
Determines the metric of the antihermitian part of the matrix.
subroutine, public initialize_cohsex_selfenergy(rtbse_env)
Calculates the COHSEX reference self-energy.
subroutine, public propagate_density(rtbse_env, exponential, rho_old, rho_new)
Updates the density in rtbse_env, using the provided exponential The new density is saved to a differ...
subroutine, public get_electron_number(rtbse_env, rho, electron_n_re, electron_n_im)
Outputs the number of electrons in the system from the density matrix.
subroutine, public initialize_rtbse_env(rtbse_env)
Calculates the initial values, based on restart/scf density, and other non-trivial values.
subroutine, public get_idempotence_deviation(rtbse_env, rho, deviation_metric)
Outputs the deviation from idempotence of density matrix.
real(kind=dp) function, public rho_metric(rho_new, rho_old, nspin, workspace_opt)
Determines the metric for the density matrix, used for convergence criterion.
subroutine, public initialize_hartree_potential(rtbse_env)
Calculates the Hartree potential.
subroutine, public cp_cfm_gexp(amatrix, bmatrix, exponential, eig_scale_opt, work_opt)
Calculates the exponential of a matrix in a generalized eigenvalue problem. Specifically,...
subroutine, public initialize_singleparticle_hamiltonian(rtbse_env)
Calculates the single particle Hamiltonian.
subroutine, public init_hartree(rtbse_env, v_dbcsr)
Creates the RI matrix and populates it with correct values.
subroutine, public run_propagation_bse(force_env)
Runs the electron-only real time BSE propagation.
Routine for the real time propagation output.
subroutine, public print_ft(rtp_section, moments, times, fields, rtc, info_opt, cell)
Calculate and print the Fourier transforms + polarizabilites from moment trace.
subroutine, public read_moments(moments_section, orig_start, current_start, moments, times, mom_read)
Attempt to read the moments from a previously written file.
Represent a complex full matrix.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
wrapper to abstract the force evaluation of the various methods
stores all the informations relevant to an mpi environment