41#include "./base/base_uses.f90"
47 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'bse_full_diag'
73 SUBROUTINE create_a(fm_mat_S_ia_bse, fm_mat_S_bar_ij_bse, fm_mat_S_ab_bse, &
74 fm_A, Eigenval, unit_nr, &
75 homo, virtual, dimen_RI, mp2_env, &
78 TYPE(
cp_fm_type),
INTENT(IN) :: fm_mat_s_ia_bse, fm_mat_s_bar_ij_bse, &
81 REAL(kind=
dp),
DIMENSION(:) :: eigenval
82 INTEGER,
INTENT(IN) :: unit_nr, homo, virtual, dimen_ri
83 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
86 CHARACTER(LEN=*),
PARAMETER :: routinen =
'create_A'
88 INTEGER :: a_virt_row, handle, i_occ_row, &
89 i_row_global, ii, j_col_global, jj, &
90 ncol_local_a, nrow_local_a
91 INTEGER,
DIMENSION(4) :: reordering
92 INTEGER,
DIMENSION(:),
POINTER :: col_indices_a, row_indices_a
93 REAL(kind=
dp) :: alpha, eigen_diff
98 CALL timeset(routinen, handle)
100 IF (unit_nr > 0 .AND. mp2_env%ri_g0w0%bse_debug_print)
THEN
101 WRITE (unit_nr,
'(T2,A10,T13,A10)')
'BSE|DEBUG|',
'Creating A'
105 SELECT CASE (mp2_env%ri_g0w0%bse_spin_config)
121 CALL cp_fm_struct_create(fm_struct_a, context=fm_mat_s_ia_bse%matrix_struct%context, nrow_global=homo*virtual, &
122 ncol_global=homo*virtual, para_env=fm_mat_s_ia_bse%matrix_struct%para_env)
126 CALL cp_fm_struct_create(fm_struct_w, context=fm_mat_s_ab_bse%matrix_struct%context, nrow_global=homo**2, &
127 ncol_global=virtual**2, para_env=fm_mat_s_ab_bse%matrix_struct%para_env)
134 CALL parallel_gemm(transa=
"T", transb=
"N", m=homo*virtual, n=homo*virtual, k=dimen_ri, alpha=alpha, &
135 matrix_a=fm_mat_s_ia_bse, matrix_b=fm_mat_s_ia_bse, beta=0.0_dp, &
138 IF (unit_nr > 0 .AND. mp2_env%ri_g0w0%bse_debug_print)
THEN
139 WRITE (unit_nr,
'(T2,A10,T13,A16)')
'BSE|DEBUG|',
'Allocated A_iajb'
143 CALL parallel_gemm(transa=
"T", transb=
"N", m=homo**2, n=virtual**2, k=dimen_ri, alpha=1.0_dp, &
144 matrix_a=fm_mat_s_bar_ij_bse, matrix_b=fm_mat_s_ab_bse, beta=0.0_dp, &
147 IF (unit_nr > 0 .AND. mp2_env%ri_g0w0%bse_debug_print)
THEN
148 WRITE (unit_nr,
'(T2,A10,T13,A16)')
'BSE|DEBUG|',
'Allocated W_ijab'
153 nrow_local=nrow_local_a, &
154 ncol_local=ncol_local_a, &
155 row_indices=row_indices_a, &
156 col_indices=col_indices_a)
160 reordering = (/1, 3, 2, 4/)
162 virtual, virtual, unit_nr, reordering, mp2_env)
169 DO ii = 1, nrow_local_a
171 i_row_global = row_indices_a(ii)
173 DO jj = 1, ncol_local_a
175 j_col_global = col_indices_a(jj)
177 IF (i_row_global == j_col_global)
THEN
178 i_occ_row = (i_row_global - 1)/virtual + 1
179 a_virt_row = mod(i_row_global - 1, virtual) + 1
180 eigen_diff = eigenval(a_virt_row + homo) - eigenval(i_occ_row)
181 fm_a%local_data(ii, jj) = fm_a%local_data(ii, jj) + eigen_diff
192 CALL timestop(handle)
211 SUBROUTINE create_b(fm_mat_S_ia_bse, fm_mat_S_bar_ia_bse, fm_B, &
212 homo, virtual, dimen_RI, unit_nr, mp2_env)
214 TYPE(
cp_fm_type),
INTENT(IN) :: fm_mat_s_ia_bse, fm_mat_s_bar_ia_bse
216 INTEGER,
INTENT(IN) :: homo, virtual, dimen_ri, unit_nr
217 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
219 CHARACTER(LEN=*),
PARAMETER :: routinen =
'create_B'
222 INTEGER,
DIMENSION(4) :: reordering
223 REAL(kind=
dp) :: alpha
227 CALL timeset(routinen, handle)
229 IF (unit_nr > 0 .AND. mp2_env%ri_g0w0%bse_debug_print)
THEN
230 WRITE (unit_nr,
'(T2,A10,T13,A10)')
'BSE|DEBUG|',
'Creating B'
234 SELECT CASE (mp2_env%ri_g0w0%bse_spin_config)
241 CALL cp_fm_struct_create(fm_struct_v, context=fm_mat_s_ia_bse%matrix_struct%context, nrow_global=homo*virtual, &
242 ncol_global=homo*virtual, para_env=fm_mat_s_ia_bse%matrix_struct%para_env)
249 IF (unit_nr > 0 .AND. mp2_env%ri_g0w0%bse_debug_print)
THEN
250 WRITE (unit_nr,
'(T2,A10,T13,A16)')
'BSE|DEBUG|',
'Allocated B_iajb'
253 CALL parallel_gemm(transa=
"T", transb=
"N", m=homo*virtual, n=homo*virtual, k=dimen_ri, alpha=alpha, &
254 matrix_a=fm_mat_s_ia_bse, matrix_b=fm_mat_s_ia_bse, beta=0.0_dp, &
258 CALL parallel_gemm(transa=
"T", transb=
"N", m=homo*virtual, n=homo*virtual, k=dimen_ri, alpha=1.0_dp, &
259 matrix_a=fm_mat_s_bar_ia_bse, matrix_b=fm_mat_s_ia_bse, beta=0.0_dp, &
265 reordering = (/1, 4, 3, 2/)
267 virtual, virtual, unit_nr, reordering, mp2_env)
271 CALL timestop(handle)
292 fm_sqrt_A_minus_B, fm_inv_sqrt_A_minus_B, &
293 homo, virtual, unit_nr, mp2_env, diag_est)
296 TYPE(
cp_fm_type),
INTENT(INOUT) :: fm_c, fm_sqrt_a_minus_b, &
297 fm_inv_sqrt_a_minus_b
298 INTEGER,
INTENT(IN) :: homo, virtual, unit_nr
299 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
300 REAL(kind=
dp),
INTENT(IN) :: diag_est
302 CHARACTER(LEN=*),
PARAMETER :: routinen =
'create_hermitian_form_of_ABBA'
304 INTEGER :: dim_mat, handle, n_dependent
305 REAL(kind=
dp),
DIMENSION(2) :: eigvals_ab_diff
306 TYPE(
cp_fm_type) :: fm_a_minus_b, fm_a_plus_b, fm_dummy, &
309 CALL timeset(routinen, handle)
311 IF (unit_nr > 0)
THEN
312 WRITE (unit_nr,
'(T2,A4,T7,A25,A39,ES6.0,A3)')
'BSE|',
'Diagonalizing aux. matrix', &
313 ' with size of A. This will take around ', diag_est,
" s."
330 CALL cp_fm_create(fm_sqrt_a_minus_b, fm_a%matrix_struct)
332 CALL cp_fm_create(fm_inv_sqrt_a_minus_b, fm_a%matrix_struct)
337 IF (unit_nr > 0 .AND. mp2_env%ri_g0w0%bse_debug_print)
THEN
338 WRITE (unit_nr,
'(T2,A10,T13,A19)')
'BSE|DEBUG|',
'Created work arrays'
346 CALL cp_fm_to_fm(fm_a_minus_b, fm_inv_sqrt_a_minus_b)
354 CALL cp_fm_power(fm_inv_sqrt_a_minus_b, fm_dummy, -0.5_dp, 0.0_dp, n_dependent, eigvals=eigvals_ab_diff)
358 IF (eigvals_ab_diff(1) < 0)
THEN
359 CALL cp_abort(__location__, &
360 "Matrix (A-B) is not positive definite. "// &
361 "Hermitian diagonalization of full BSE matrix is ill-defined.")
367 dim_mat = homo*virtual
368 CALL parallel_gemm(
"N",
"N", dim_mat, dim_mat, dim_mat, 1.0_dp, fm_inv_sqrt_a_minus_b, fm_a_minus_b, 0.0_dp, &
372 CALL parallel_gemm(
"N",
"N", dim_mat, dim_mat, dim_mat, 1.0_dp, fm_sqrt_a_minus_b, fm_a_plus_b, 0.0_dp, &
383 CALL parallel_gemm(
"N",
"N", dim_mat, dim_mat, dim_mat, 1.0_dp, fm_work_product, fm_sqrt_a_minus_b, 0.0_dp, &
387 IF (unit_nr > 0 .AND. mp2_env%ri_g0w0%bse_debug_print)
THEN
388 WRITE (unit_nr,
'(T2,A10,T13,A36)')
'BSE|DEBUG|',
'Filled C=(A-B)^0.5 (A+B) (A-B)^0.5'
391 CALL timestop(handle)
409 fm_sqrt_A_minus_B, fm_inv_sqrt_A_minus_B, &
410 unit_nr, diag_est, mp2_env)
413 INTEGER,
INTENT(IN) :: homo, virtual, homo_irred
414 TYPE(
cp_fm_type),
INTENT(INOUT) :: fm_sqrt_a_minus_b, fm_inv_sqrt_a_minus_b
415 INTEGER,
INTENT(IN) :: unit_nr
416 REAL(kind=
dp),
INTENT(IN) :: diag_est
417 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
419 CHARACTER(LEN=*),
PARAMETER :: routinen =
'diagonalize_C'
421 INTEGER :: diag_info, handle
422 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: exc_ens
423 TYPE(
cp_fm_type) :: fm_eigvec, fm_mat_eigvec_transform, &
424 fm_mat_eigvec_transform_neg
426 CALL timeset(routinen, handle)
428 IF (unit_nr > 0)
THEN
429 WRITE (unit_nr,
'(T2,A4,T7,A17,A22,ES6.0,A3)')
'BSE|',
'Diagonalizing C. ', &
430 'This will take around ', diag_est,
' s.'
437 ALLOCATE (exc_ens(homo*virtual))
440 cpassert(diag_info == 0)
441 exc_ens = sqrt(exc_ens)
452 CALL cp_fm_create(fm_mat_eigvec_transform, fm_c%matrix_struct)
454 CALL parallel_gemm(transa=
"N", transb=
"N", m=homo*virtual, n=homo*virtual, k=homo*virtual, alpha=1.0_dp, &
455 matrix_a=fm_sqrt_a_minus_b, matrix_b=fm_eigvec, beta=0.0_dp, &
456 matrix_c=fm_mat_eigvec_transform)
461 CALL cp_fm_create(fm_mat_eigvec_transform_neg, fm_c%matrix_struct)
463 CALL parallel_gemm(transa=
"N", transb=
"N", m=homo*virtual, n=homo*virtual, k=homo*virtual, alpha=1.0_dp, &
464 matrix_a=fm_inv_sqrt_a_minus_b, matrix_b=fm_eigvec, beta=0.0_dp, &
465 matrix_c=fm_mat_eigvec_transform_neg)
471 CALL cp_fm_scale_and_add(1.0_dp, fm_mat_eigvec_transform, 1.0_dp, fm_mat_eigvec_transform_neg)
476 CALL success_message(exc_ens, fm_mat_eigvec_transform, mp2_env, &
477 homo, virtual, homo_irred, unit_nr, .false.)
482 CALL timestop(handle)
497 unit_nr, diag_est, mp2_env)
500 INTEGER,
INTENT(IN) :: homo, virtual, homo_irred, unit_nr
501 REAL(kind=
dp),
INTENT(IN) :: diag_est
502 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
504 CHARACTER(LEN=*),
PARAMETER :: routinen =
'diagonalize_A'
506 INTEGER :: diag_info, handle
507 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: exc_ens
510 CALL timeset(routinen, handle)
513 IF (unit_nr > 0)
THEN
514 WRITE (unit_nr,
'(T2,A4,T7,A17,A22,ES6.0,A3)')
'BSE|',
'Diagonalizing A. ', &
515 'This will take around ', diag_est,
' s.'
522 ALLOCATE (exc_ens(homo*virtual))
525 cpassert(diag_info == 0)
526 CALL success_message(exc_ens, fm_eigvec, mp2_env, &
527 homo, virtual, homo_irred, unit_nr, .true.)
532 CALL timestop(handle)
547 SUBROUTINE success_message(Exc_ens, fm_eigvec, mp2_env, &
548 homo, virtual, homo_irred, unit_nr, flag_TDA)
550 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: exc_ens
552 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
553 INTEGER :: homo, virtual, homo_irred, unit_nr
554 LOGICAL,
OPTIONAL :: flag_tda
556 CHARACTER(LEN=*),
PARAMETER :: routinen =
'success_message'
558 CHARACTER(LEN=10) :: info_approximation, multiplet
559 INTEGER :: handle, i_exc, k, num_entries
560 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: idx_homo, idx_virt
561 REAL(kind=
dp) :: alpha
562 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigvec_entries
564 CALL timeset(routinen, handle)
567 IF (mp2_env%ri_g0w0%bse_spin_config == 0)
THEN
568 multiplet =
"Singlet"
571 multiplet =
"Triplet"
574 IF (.NOT.
PRESENT(flag_tda))
THEN
578 info_approximation =
" -TDA- "
580 info_approximation =
"-full-"
585 IF (unit_nr > 0)
THEN
586 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
587 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
589 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'**************************************************************************'
590 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'* Bethe Salpeter equation (BSE) with Tamm Dancoff approximation (TDA) *'
591 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'**************************************************************************'
592 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
593 WRITE (unit_nr,
'(T2,A4,T7,A48,A23)')
'BSE|',
'The excitations are calculated by diagonalizing ', &
594 'the BSE within the TDA:'
595 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
596 WRITE (unit_nr,
'(T2,A4,T29,A16)')
'BSE|', Ω
'A X^n = ^n X^n'
597 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
598 WRITE (unit_nr,
'(T2,A4,T7,A23)')
'BSE|',
'i.e. in index notation:'
599 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
600 WRITE (unit_nr,
'(T2,A4,T7,A41)')
'BSE|', Ω
'sum_jb ( A_ia,jb X_jb^n ) = ^n X_ia^n'
601 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
602 WRITE (unit_nr,
'(T2,A4,T7,A30)')
'BSE|',
'prelim Ref.: Eq. (36) with B=0'
603 WRITE (unit_nr,
'(T2,A4,T7,A71)')
'BSE|',
'in PRB 92,045209 (2015); http://dx.doi.org/10.1103/PhysRevB.92.045209 .'
605 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'**************************************************************************'
606 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'* Full Bethe Salpeter equation (BSE) (i.e. without TDA) *'
607 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'**************************************************************************'
608 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
609 WRITE (unit_nr,
'(T2,A4,T7,A48,A24)')
'BSE|',
'The excitations are calculated by diagonalizing ', &
610 'the BSE without the TDA:'
611 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
612 WRITE (unit_nr,
'(T2,A4,T22,A30)')
'BSE|',
'|A B| |X^n| |1 0| |X^n|'
613 WRITE (unit_nr,
'(T2,A4,T22,A31)')
'BSE|', Ω
'|B A| |Y^n| = ^n |0 -1| |Y^n|'
614 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
615 WRITE (unit_nr,
'(T2,A4,T7,A23)')
'BSE|',
'i.e. in index notation:'
616 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
617 WRITE (unit_nr,
'(T2,A4,T7,A62)')
'BSE|', Ω
' sum_jb ( A_ia,jb X_jb^n + B_ia,jb Y_jb^n ) = ^n X_ia^n'
618 WRITE (unit_nr,
'(T2,A4,T7,A62)')
'BSE|', Ω
'- sum_jb ( B_ia,jb X_jb^n + A_ia,jb Y_jb^n ) = ^n Y_ia^n'
620 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
621 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
622 WRITE (unit_nr,
'(T2,A4,T7,A4,T18,A42,T70,A1,I4,A1,I4,A1)')
'BSE|',
'i,j:', &
623 'occupied molecular orbitals, i.e. state in',
'[', homo_irred - homo + 1,
',', homo_irred,
']'
624 WRITE (unit_nr,
'(T2,A4,T7,A4,T18,A44,T70,A1,I4,A1,I4,A1)')
'BSE|',
'a,b:', &
625 'unoccupied molecular orbitals, i.e. state in',
'[', homo_irred + 1,
',', homo_irred + virtual,
']'
626 WRITE (unit_nr,
'(T2,A4,T7,A2,T18,A16)')
'BSE|',
'n:',
'Excitation index'
627 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
628 WRITE (unit_nr,
'(T2,A4,T7,A58)')
'BSE|', εεδδα
'A_ia,jb = (_a-_i) _ij _ab + * v_ia,jb - W_ij,ab'
629 IF (.NOT. flag_tda)
THEN
630 WRITE (unit_nr,
'(T2,A4,T7,A32)')
'BSE|', α
'B_ia,jb = * v_ia,jb - W_ib,aj'
631 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
632 WRITE (unit_nr,
'(T2,A4,T7,A35)')
'BSE|',
'prelim Ref.: Eqs. (24-27),(30),(35)'
633 WRITE (unit_nr,
'(T2,A4,T7,A71)')
'BSE|',
'in PRB 92,045209 (2015); http://dx.doi.org/10.1103/PhysRevB.92.045209 .'
635 IF (.NOT. flag_tda)
THEN
636 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
637 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|', Ω
'The BSE is solved for ^n and X_ia^n as a hermitian problem, e.g. Eq.(42)'
638 WRITE (unit_nr,
'(T2,A4,T7,A71)')
'BSE|',
'in PRB 92,045209 (2015); http://dx.doi.org/10.1103/PhysRevB.92.045209 .'
644 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
645 WRITE (unit_nr,
'(T2,A4,T7,A7,T19,A23)')
'BSE|', ε
'_...:',
'GW quasiparticle energy'
646 WRITE (unit_nr,
'(T2,A4,T7,A7,T19,A15)')
'BSE|', δ
'_...:',
'Kronecker delta'
647 WRITE (unit_nr,
'(T2,A4,T7,A3,T19,A21)')
'BSE|', α
':',
'spin-dependent factor (Singlet/Triplet)'
648 WRITE (unit_nr,
'(T2,A4,T7,A6,T18,A34)')
'BSE|',
'v_...:',
'Electron-hole exchange interaction'
649 WRITE (unit_nr,
'(T2,A4,T7,A6,T18,A27)')
'BSE|',
'W_...:',
'Screened direct interaction'
650 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
651 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
652 WRITE (unit_nr,
'(T2,A4,T7,A47,A7,A9,F3.1)')
'BSE|', &
653 'The spin-dependent factor is for the requested ', multiplet, α
" is = ", alpha
654 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
656 WRITE (unit_nr,
'(T2,A4,T7,A56)')
'BSE|',
'Excitation energies from solving the BSE within the TDA:'
658 WRITE (unit_nr,
'(T2,A4,T7,A57)')
'BSE|',
'Excitation energies from solving the BSE without the TDA:'
660 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
661 WRITE (unit_nr,
'(T2,A4,T13,A10,T27,A13,T42,A12,T59,A22)')
'BSE|', &
662 'Excitation',
"Multiplet",
'TDA/full BSE',
'Excitation energy (eV)'
665 IF (unit_nr > 0)
THEN
666 DO i_exc = 1, min(homo*virtual, mp2_env%ri_g0w0%num_print_exc)
667 WRITE (unit_nr,
'(T2,A4,T7,I16,T27,A7,A6,T48,A6,T59,F22.4)') &
668 'BSE|', i_exc, multiplet,
" State", info_approximation, exc_ens(i_exc)*
evolt
672 IF (unit_nr > 0)
THEN
673 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
675 WRITE (unit_nr,
'(T2,A4,T7,A70)') &
676 'BSE|',
"Excitations are built up by the following single-particle transitions,"
677 WRITE (unit_nr,
'(T2,A4,T7,A42,F5.2,A2)') &
678 'BSE|',
"neglecting contributions where |X_ia^n| < ", mp2_env%ri_g0w0%eps_x,
" :"
680 WRITE (unit_nr,
'(T2,A4,T15,A27,I5,A13,I5,A3)')
'BSE|',
'-- Quick reminder: HOMO i =', &
681 homo_irred,
' and LUMO a =', homo_irred + 1,
" --"
682 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
683 WRITE (unit_nr,
'(T2,A4,T7,A9,T20,A1,T22,A2,T29,A1,T42,A12,T71,A10)') &
684 "BSE|",
"n-th exc.",
"i",
"=>",
"a",
'TDA/full BSE',
"|X_ia^n|"
686 DO i_exc = 1, min(homo*virtual, mp2_env%ri_g0w0%num_print_exc)
689 i_exc, virtual, num_entries, mp2_env)
690 IF (unit_nr > 0)
THEN
691 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
692 DO k = 1, num_entries
693 WRITE (unit_nr,
'(T2,A4,T11,I5,T16,I5,T22,A2,T25,I5,T48,A6,T59,F22.4)') &
694 "BSE|", i_exc, homo_irred - homo + idx_homo(k),
"=>", &
695 homo_irred + idx_virt(k), info_approximation, abs(eigvec_entries(k))
699 DEALLOCATE (idx_homo)
700 DEALLOCATE (idx_virt)
701 DEALLOCATE (eigvec_entries)
703 IF (unit_nr > 0)
THEN
704 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
705 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
708 CALL timestop(handle)
709 END SUBROUTINE success_message
Routines for the full diagonalization of GW + Bethe-Salpeter for computing electronic excitations.
subroutine, public diagonalize_c(fm_c, homo, virtual, homo_irred, fm_sqrt_a_minus_b, fm_inv_sqrt_a_minus_b, unit_nr, diag_est, mp2_env)
Solving eigenvalue equation C Z^n = (Ω^n)^2 Z^n . Here, the eigenvectors Z^n relate to X^n via Eq....
subroutine, public diagonalize_a(fm_a, homo, virtual, homo_irred, unit_nr, diag_est, mp2_env)
Solving hermitian eigenvalue equation A X^n = Ω^n X^n.
subroutine, public create_a(fm_mat_s_ia_bse, fm_mat_s_bar_ij_bse, fm_mat_s_ab_bse, fm_a, eigenval, unit_nr, homo, virtual, dimen_ri, mp2_env, para_env)
Matrix A constructed from GW energies and 3c-B-matrices (cf. subroutine mult_B_with_W) A_ia,...
subroutine, public create_b(fm_mat_s_ia_bse, fm_mat_s_bar_ia_bse, fm_b, homo, virtual, dimen_ri, unit_nr, mp2_env)
Matrix B constructed from 3c-B-matrices (cf. subroutine mult_B_with_W) B_ia,jb = α * v_ia,...
subroutine, public create_hermitian_form_of_abba(fm_a, fm_b, fm_c, fm_sqrt_a_minus_b, fm_inv_sqrt_a_minus_b, homo, virtual, unit_nr, mp2_env, diag_est)
Construct Matrix C=(A-B)^0.5 (A+B) (A-B)^0.5 to solve full BSE matrix as a hermitian problem (cf....
Auxiliary routines for GW + Bethe-Salpeter for computing electronic excitations.
subroutine, public filter_eigvec_contrib(fm_eigvec, idx_homo, idx_virt, eigvec_entries, i_exc, virtual, num_entries, mp2_env)
Filters eigenvector entries above a given threshold to describe excitations in the singleparticle bas...
subroutine, public comp_eigvec_coeff_bse(fm_work, eig_vals, beta, gamma, do_transpose)
Routine for computing the coefficients of the eigenvectors of the BSE matrix from a multiplication wi...
subroutine, public fm_general_add_bse(fm_out, fm_in, beta, nrow_secidx_in, ncol_secidx_in, nrow_secidx_out, ncol_secidx_out, unit_nr, reordering, mp2_env)
Adds and reorders full matrices with a combined index structure, e.g. adding W_ij,...
methods related to the blacs parallel environment
subroutine, public cp_blacs_env_release(blacs_env)
releases the given blacs_env
subroutine, public cp_blacs_env_create(blacs_env, para_env, blacs_grid_layout, blacs_repeatable, row_major, grid_2d)
allocates and initializes a type that represent a blacs context
basic linear algebra operations for full matrices
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....
used for collecting some of the diagonalization schemes available for cp_fm_type. cp_fm_power also mo...
subroutine, public cp_fm_power(matrix, work, exponent, threshold, n_dependent, verbose, eigvals)
...
subroutine, public choose_eigv_solver(matrix, eigenvectors, eigenvalues, info)
Choose the Eigensolver depending on which library is available ELPA seems to be unstable for small sy...
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_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, use_sp)
creates a new full matrix with the given structure
Calculation of the incomplete Gamma function F_n(t) for multi-center integrals over Cartesian Gaussia...
Defines the basic variable types.
integer, parameter, public dp
Interface to the message passing library MPI.
Types needed for MP2 calculations.
basic linear algebra operations for full matrixes
Definition of physical constants:
real(kind=dp), parameter, public evolt
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
keeps the information about the structure of a full matrix
stores all the informations relevant to an mpi environment