32#include "./base/base_uses.f90"
38 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'bse_print'
55 INTEGER,
INTENT(IN) :: unit_nr
57 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_BSE_start_flag'
61 CALL timeset(routinen, handle)
64 WRITE (unit_nr, *)
' '
65 WRITE (unit_nr,
'(T2,A79)')
'*******************************************************************************'
66 WRITE (unit_nr,
'(T2,A79)')
'** **'
67 WRITE (unit_nr,
'(T2,A79)')
'** Bethe Salpeter equation (BSE) for excitation energies **'
69 WRITE (unit_nr,
'(T2,A79)')
'** solved with and without Tamm-Dancoff approximation (TDA) **'
71 WRITE (unit_nr,
'(T2,A79)')
'** solved with Tamm-Dancoff approximation (TDA) **'
73 WRITE (unit_nr,
'(T2,A79)')
'** solved without Tamm-Dancoff approximation (TDA) **'
76 WRITE (unit_nr,
'(T2,A79)')
'** **'
77 WRITE (unit_nr,
'(T2,A79)')
'*******************************************************************************'
78 WRITE (unit_nr, *)
' '
97 multiplet, alpha, mp2_env, unit_nr)
99 INTEGER,
INTENT(IN) :: homo, virtual, homo_irred
100 LOGICAL,
INTENT(IN) :: flag_tda
101 CHARACTER(LEN=10),
INTENT(IN) :: multiplet
102 REAL(kind=
dp),
INTENT(IN) :: alpha
103 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
104 INTEGER,
INTENT(IN) :: unit_nr
106 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_output_header'
110 CALL timeset(routinen, handle)
112 IF (unit_nr > 0)
THEN
113 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
114 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
116 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'**************************************************************************'
117 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'* Bethe Salpeter equation (BSE) with Tamm Dancoff approximation (TDA) *'
118 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'**************************************************************************'
119 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
120 WRITE (unit_nr,
'(T2,A4,T7,A48,A23)')
'BSE|',
'The excitations are calculated by diagonalizing ', &
121 'the BSE within the TDA:'
122 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
123 WRITE (unit_nr,
'(T2,A4,T29,A16)')
'BSE|', Ω
'A X^n = ^n X^n'
124 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
125 WRITE (unit_nr,
'(T2,A4,T7,A23)')
'BSE|',
'i.e. in index notation:'
126 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
127 WRITE (unit_nr,
'(T2,A4,T7,A41)')
'BSE|', Ω
'sum_jb ( A_ia,jb X_jb^n ) = ^n X_ia^n'
128 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
129 WRITE (unit_nr,
'(T2,A4,T7,A30)')
'BSE|',
'prelim Ref.: Eq. (36) with B=0'
130 WRITE (unit_nr,
'(T2,A4,T7,A71)')
'BSE|',
'in PRB 92,045209 (2015); http://dx.doi.org/10.1103/PhysRevB.92.045209 .'
132 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'**************************************************************************'
133 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'* Full ("ABBA") Bethe Salpeter equation (BSE) (i.e. without TDA) *'
134 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'**************************************************************************'
135 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
136 WRITE (unit_nr,
'(T2,A4,T7,A48,A24)')
'BSE|',
'The excitations are calculated by diagonalizing ', &
137 'the BSE without the TDA:'
138 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
139 WRITE (unit_nr,
'(T2,A4,T22,A30)')
'BSE|',
'|A B| |X^n| |1 0| |X^n|'
140 WRITE (unit_nr,
'(T2,A4,T22,A31)')
'BSE|', Ω
'|B A| |Y^n| = ^n |0 -1| |Y^n|'
141 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
142 WRITE (unit_nr,
'(T2,A4,T7,A23)')
'BSE|',
'i.e. in index notation:'
143 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
144 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'
145 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'
147 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
148 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
149 WRITE (unit_nr,
'(T2,A4,T7,A4,T18,A42,T70,A1,I4,A1,I4,A1)')
'BSE|',
'i,j:', &
150 'occupied molecular orbitals, i.e. state in',
'[', homo_irred - homo + 1,
',', homo_irred,
']'
151 WRITE (unit_nr,
'(T2,A4,T7,A4,T18,A44,T70,A1,I4,A1,I4,A1)')
'BSE|',
'a,b:', &
152 'unoccupied molecular orbitals, i.e. state in',
'[', homo_irred + 1,
',', homo_irred + virtual,
']'
153 WRITE (unit_nr,
'(T2,A4,T7,A2,T18,A16)')
'BSE|',
'n:',
'Excitation index'
154 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
156 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|', εεδδα
'A_ia,jb = (_a-_i) _ij _ab + * v_ia,jb - W_ij,ab'
158 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|', εεδδα
'A_ia,jb = (_a-_i) _ij _ab + * v_ia,jb'
160 IF (.NOT. flag_tda)
THEN
162 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|', α
'B_ia,jb = * v_ia,jb - W_ib,aj'
164 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|', α
'B_ia,jb = * v_ia,jb'
166 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
167 WRITE (unit_nr,
'(T2,A4,T7,A35)')
'BSE|',
'prelim Ref.: Eqs. (24-27),(30),(35)'
168 WRITE (unit_nr,
'(T2,A4,T7,A71)')
'BSE|',
'in PRB 92,045209 (2015); http://dx.doi.org/10.1103/PhysRevB.92.045209 .'
170 IF (.NOT. flag_tda)
THEN
171 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
172 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)'
173 WRITE (unit_nr,
'(T2,A4,T7,A71)')
'BSE|',
'in PRB 92,045209 (2015); http://dx.doi.org/10.1103/PhysRevB.92.045209 .'
175 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
176 WRITE (unit_nr,
'(T2,A4,T7,A7,T31,A23)')
'BSE|', ε
'_...:',
'GW quasiparticle energy'
177 WRITE (unit_nr,
'(T2,A4,T7,A7,T31,A15)')
'BSE|', δ
'_...:',
'Kronecker delta'
178 WRITE (unit_nr,
'(T2,A4,T7,A3,T31,A21)')
'BSE|', α
':',
'spin-dependent factor (Singlet/Triplet)'
179 WRITE (unit_nr,
'(T2,A4,T7,A6,T30,A34)')
'BSE|',
'v_...:',
'Electron-hole exchange interaction'
181 WRITE (unit_nr,
'(T2,A4,T7,A,T31,A)')
'BSE|', ϵ
'W_... = 1/ v_...:', &
182 'Direct interaction screened by '
183 WRITE (unit_nr,
'(T2,A4,T30,A)')
'BSE|', &
184 ϵω
'dielectric function (=0)'
186 WRITE (unit_nr,
'(T2,A4,T7,A,T30,A)')
'BSE|',
'W_... = v_...:',
'Direct interaction without screening'
188 WRITE (unit_nr,
'(T2,A4,T7,A,T31,A,F5.2)')
'BSE|', γ
'W_... = v_...:', &
189 γ
'Direct interaction with artificial screening =', mp2_env%bse%screening_factor
191 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
192 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
193 WRITE (unit_nr,
'(T2,A4,T7,A47,A7,A9,F3.1)')
'BSE|', &
194 'The spin-dependent factor is for the requested ', multiplet, α
" is = ", alpha
195 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
198 CALL timestop(handle)
214 info_approximation, mp2_env, unit_nr)
216 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: exc_ens
217 INTEGER,
INTENT(IN) :: homo, virtual
218 LOGICAL,
INTENT(IN) :: flag_tda
219 CHARACTER(LEN=10),
INTENT(IN) :: multiplet, info_approximation
220 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
221 INTEGER,
INTENT(IN) :: unit_nr
223 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_excitation_energies'
225 INTEGER :: handle, i_exc
227 CALL timeset(routinen, handle)
229 IF (unit_nr > 0)
THEN
231 WRITE (unit_nr,
'(T2,A4,T7,A56)')
'BSE|',
'Excitation energies from solving the BSE within the TDA:'
233 WRITE (unit_nr,
'(T2,A4,T7,A57)')
'BSE|',
'Excitation energies from solving the BSE without the TDA:'
235 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
236 WRITE (unit_nr,
'(T2,A4,T11,A12,T26,A11,T44,A8,T55,A27)')
'BSE|', &
237 'Excitation n',
"Spin Config",
'TDA/ABBA', Ω
'Excitation energy ^n (eV)'
240 IF (unit_nr > 0)
THEN
241 DO i_exc = 1, min(homo*virtual, mp2_env%bse%num_print_exc)
242 WRITE (unit_nr,
'(T2,A4,T7,I16,T30,A7,T46,A6,T59,F22.4)') &
243 'BSE|', i_exc, multiplet, info_approximation, exc_ens(i_exc)*
evolt
247 CALL timestop(handle)
263 info_approximation, mp2_env, unit_nr, fm_eigvec_Y)
266 INTEGER,
INTENT(IN) :: homo, virtual, homo_irred
267 CHARACTER(LEN=10),
INTENT(IN) :: info_approximation
268 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
269 INTEGER,
INTENT(IN) :: unit_nr
270 TYPE(
cp_fm_type),
INTENT(IN),
OPTIONAL :: fm_eigvec_y
272 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_transition_amplitudes'
274 INTEGER :: handle, i_exc
276 CALL timeset(routinen, handle)
278 IF (unit_nr > 0)
THEN
279 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
280 WRITE (unit_nr,
'(T2,A4,T7,A61)') &
281 'BSE|',
"Single-particle transitions are built up by (de-)excitations,"
282 WRITE (unit_nr,
'(T2,A4,T7,A18)') &
283 'BSE|',
"which we denote by"
284 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
285 WRITE (unit_nr,
'(T2,A4,T20,A2,T30,A40)') &
286 'BSE|',
"=>",
"for excitations, i.e. entries of X_ia^n,"
287 WRITE (unit_nr,
'(T2,A4,T20,A2,T30,A42)') &
288 'BSE|',
"<=",
"for deexcitations, i.e. entries of Y_ia^n."
289 WRITE (unit_nr,
'(T2,A4)') &
291 WRITE (unit_nr,
'(T2,A4,T7,A73)') &
292 'BSE|',
"The following single-particle transitions have significant contributions,"
293 WRITE (unit_nr,
'(T2,A4,T7,A16,F5.3,A15,F5.3,A16)') &
294 'BSE|',
"i.e. |X_ia^n| > ", mp2_env%bse%eps_x,
" or |Y_ia^n| > ", &
295 mp2_env%bse%eps_x,
", respectively :"
297 WRITE (unit_nr,
'(T2,A4,T15,A27,I5,A13,I5,A3)')
'BSE|',
'-- Quick reminder: HOMO i =', &
298 homo_irred,
' and LUMO a =', homo_irred + 1,
" --"
299 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
300 WRITE (unit_nr,
'(T2,A4,T7,A12,T30,A1,T32,A5,T42,A1,T49,A8,T64,A17)') &
301 "BSE|",
"Excitation n",
"i",
"=>/<=",
"a",
'TDA/ABBA',
"|X_ia^n|/|Y_ia^n|"
303 DO i_exc = 1, min(homo*virtual, mp2_env%bse%num_print_exc)
304 IF (unit_nr > 0)
THEN
305 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
308 CALL print_transition_amplitudes_core(fm_eigvec_x,
"=>", info_approximation, &
309 i_exc, virtual, homo, homo_irred, &
311 IF (
PRESENT(fm_eigvec_y))
THEN
312 CALL print_transition_amplitudes_core(fm_eigvec_y,
"<=", info_approximation, &
313 i_exc, virtual, homo, homo_irred, &
318 CALL timestop(handle)
337 homo, virtual, homo_irred, flag_TDA, &
338 info_approximation, mp2_env, unit_nr)
340 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: exc_ens, oscill_str
341 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: trans_mom_bse, polarizability_residues
342 INTEGER,
INTENT(IN) :: homo, virtual, homo_irred
343 LOGICAL,
INTENT(IN) :: flag_tda
344 CHARACTER(LEN=10),
INTENT(IN) :: info_approximation
345 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
346 INTEGER,
INTENT(IN) :: unit_nr
348 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_optical_properties'
350 INTEGER :: handle, i_exc
352 CALL timeset(routinen, handle)
356 IF (mp2_env%bse%bse_spin_config == 0)
THEN
357 IF (unit_nr > 0)
THEN
358 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
359 WRITE (unit_nr,
'(T2,A4,T7,A60)') &
360 'BSE|', ∈
"Transition moments d_r^n (with r(x,y,z), in atomic units)"
361 WRITE (unit_nr,
'(T2,A4,T7,A67)') &
362 'BSE|',
"and oscillator strength f^n of excitation level n are obtained from"
363 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
365 WRITE (unit_nr,
'(T2,A4,T10,A)') &
366 'BSE|', ψψ
"d_r^n = sqrt(2) sum_ia < _i | r | _a > X_ia^n"
368 WRITE (unit_nr,
'(T2,A4,T10,A)') &
369 'BSE|', ψψ
"d_r^n = sum_ia sqrt(2) < _i | r | _a > ( X_ia^n + Y_ia^n )"
371 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
372 WRITE (unit_nr,
'(T2,A4,T14,A)') &
373 'BSE|', Ω∈
"f^n = 2/3 * ^n sum_r(x,y,z) ( d_r^n )^2"
374 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
375 WRITE (unit_nr,
'(T2,A4,T7,A19)') &
376 'BSE|',
"where we introduced"
377 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
378 WRITE (unit_nr,
'(T2,A4,T7,A5,T15,A28)') &
379 'BSE|', ψ
"_i:",
"occupied molecular orbitals,"
380 WRITE (unit_nr,
'(T2,A4,T7,A5,T15,A28)') &
381 'BSE|', ψ
"_a:",
"empty molecular orbitals and"
382 WRITE (unit_nr,
'(T2,A4,T9,A2,T14,A18)') &
383 'BSE|',
"r:",
"position operator."
384 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
385 WRITE (unit_nr,
'(T2,A4,T7,A28)') &
386 'BSE|',
"prelim Ref.: Eqs. (23), (24)"
387 WRITE (unit_nr,
'(T2,A4,T7,A71)') &
388 'BSE|',
"in J. Chem. Phys. 152, 044105 (2020); https://doi.org/10.1063/1.5123290"
389 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
391 WRITE (unit_nr,
'(T2,A4,T7,A55)')
'BSE|', &
392 'Optical properties from solving the BSE within the TDA:'
394 WRITE (unit_nr,
'(T2,A4,T7,A56)')
'BSE|', &
395 'Optical properties from solving the BSE without the TDA:'
397 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
398 WRITE (unit_nr,
'(T2,A4,T8,A12,T22,A8,T38,A5,T48,A5,T58,A5,T64,A17)')
'BSE|', &
399 'Excitation n',
"TDA/ABBA",
"d_x^n",
"d_y^n",
"d_z^n",
'Osc. strength f^n'
400 DO i_exc = 1, min(homo*virtual, mp2_env%bse%num_print_exc)
401 WRITE (unit_nr,
'(T2,A4,T8,I12,T24,A6,T35,F8.3,T45,F8.3,T55,F8.3,T65,F16.3)') &
402 'BSE|', i_exc, info_approximation, trans_mom_bse(1, 1, i_exc), trans_mom_bse(2, 1, i_exc), &
403 trans_mom_bse(3, 1, i_exc), oscill_str(i_exc)
405 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
406 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|', &
407 'Check for Thomas-Reiche-Kuhn sum rule'
408 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
409 WRITE (unit_nr,
'(T2,A4,T35,A15)')
'BSE|', &
411 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
412 WRITE (unit_nr,
'(T2,A4,T7,A24,T65,I16)')
'BSE|', &
413 'Number of electrons N_e:', homo_irred*2
414 WRITE (unit_nr,
'(T2,A4,T7,A40,T66,F16.3)')
'BSE|', &
415 Σ
'Sum over oscillator strengths _n f^n :', sum(oscill_str)
416 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
417 IF (mp2_env%bse%bse_cutoff_occ > 0 .OR. mp2_env%bse%bse_cutoff_empty > 0)
THEN
418 CALL cp_warn(__location__, &
419 "Accuracy of TRK sum rule might suffer from cutoffs.")
424 IF (mp2_env%bse%bse_print_spectrum)
THEN
426 info_approximation, unit_nr, mp2_env)
430 IF (unit_nr > 0)
THEN
431 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
432 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
433 CALL cp_warn(__location__, &
434 "Requested triplet excitation cannot couple to light. "// &
435 "Skipping calculation of transition moments, "// &
436 "oscillator strengths, and spectrum.")
440 CALL timestop(handle)
456 SUBROUTINE print_transition_amplitudes_core(fm_eigvec, direction_excitation, info_approximation, &
457 i_exc, virtual, homo, homo_irred, &
461 CHARACTER(LEN=2),
INTENT(IN) :: direction_excitation
462 CHARACTER(LEN=10),
INTENT(IN) :: info_approximation
463 INTEGER :: i_exc, virtual, homo, homo_irred
464 INTEGER,
INTENT(IN) :: unit_nr
465 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
467 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_transition_amplitudes_core'
469 INTEGER :: handle, k, num_entries
470 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: idx_homo, idx_virt
471 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigvec_entries
473 CALL timeset(routinen, handle)
476 i_exc, virtual, num_entries, mp2_env)
479 IF (unit_nr > 0)
THEN
480 DO k = 1, num_entries
481 WRITE (unit_nr,
'(T2,A4,T14,I5,T26,I5,T35,A2,T38,I5,T51,A6,T65,F16.4)') &
482 "BSE|", i_exc, homo_irred - homo + idx_homo(k), direction_excitation, &
483 homo_irred + idx_virt(k), info_approximation, abs(eigvec_entries(k))
486 DEALLOCATE (idx_homo)
487 DEALLOCATE (idx_virt)
488 DEALLOCATE (eigvec_entries)
489 CALL timestop(handle)
505 num_print_exc_descr, print_checkvalue, print_directional_exc_descr, &
506 prefix_output, qs_env)
509 DIMENSION(:) :: exc_descr
510 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:), &
511 INTENT(IN) :: ref_point_multipole
512 INTEGER,
INTENT(IN) :: unit_nr, num_print_exc_descr
513 LOGICAL,
INTENT(IN) :: print_checkvalue, &
514 print_directional_exc_descr
515 CHARACTER(LEN=4),
INTENT(IN) :: prefix_output
518 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_exciton_descriptors'
520 CHARACTER(LEN=1),
DIMENSION(3) :: array_direction_str
521 CHARACTER(LEN=5) :: method_name
522 INTEGER :: handle, i_dir, i_exc
525 IF (prefix_output ==
'BSE|')
THEN
528 method_name =
'TDDFT'
531 CALL timeset(routinen, handle)
532 CALL get_qs_env(qs_env, particle_set=particle_set)
533 IF (unit_nr > 0)
THEN
534 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
535 'Exciton descriptors for excitation level n are given by'
536 WRITE (unit_nr,
'(T2,A4)') prefix_output
537 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
538 'd_eh = | <r_h - r_e>_exc |'
539 WRITE (unit_nr,
'(T2,A4)') prefix_output
540 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
541 σ
'_e = sqrt( <r_e^2>_exc - <r_e>_exc^2 )'
542 WRITE (unit_nr,
'(T2,A4)') prefix_output
543 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
544 σ
'_h = sqrt( <r_h^2>_exc - <r_h>_exc^2 )'
545 WRITE (unit_nr,
'(T2,A4)') prefix_output
546 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
547 'COV_eh = <r_e r_h>_exc - <r_e>_exc <r_h>_exc'
548 WRITE (unit_nr,
'(T2,A4)') prefix_output
549 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
550 'd_exc = sqrt( | < |r_h - r_e|^2 >_exc )'
551 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
552 σσ
' = sqrt( d_eh^2 + _e^2 + _h^2 - 2 * COV_eh )'
553 WRITE (unit_nr,
'(T2,A4)') prefix_output
554 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
555 σσ
'R_eh = COV_eh / (_e * _h)'
556 WRITE (unit_nr,
'(T2,A4)') prefix_output
557 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
558 'where the expectation values <.>_exc are taken with respect to the '
559 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
560 'exciton wavefunction of excitation n:'
561 WRITE (unit_nr,
'(T2,A4)') prefix_output
563 IF (exc_descr(1)%flag_TDA)
THEN
564 WRITE (unit_nr,
'(T2,A4,T20,A)') prefix_output, &
565 𝚿Σψψ
'_n(r_e,r_h) = _{i,a} X_ia^n _i(r_h) _a(r_e) ,'
567 WRITE (unit_nr,
'(T2,A4,T20,A)') prefix_output, &
568 𝚿Σψψ
'_n(r_e,r_h) = _{i,a} X_ia^n _i(r_h) _a(r_e)'
569 WRITE (unit_nr,
'(T2,A4,T40,A)') prefix_output, &
570 ψψ
'+ Y_ia^n _a(r_h) _i(r_e) ,'
572 WRITE (unit_nr,
'(T2,A4)') prefix_output
573 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
575 WRITE (unit_nr,
'(T2,A4)') prefix_output
576 WRITE (unit_nr,
'(T2,A4,T20,A)') prefix_output, &
577 𝚿𝚿𝚿𝚿
'< O >_exc = < _n | O | _n > / < _n | _n > ,'
578 WRITE (unit_nr,
'(T2,A4)') prefix_output
579 IF (exc_descr(1)%flag_TDA)
THEN
580 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
581 𝚿𝚿
'where c_n = < _n | _n > = 1 within TDA.'
583 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
584 𝚿𝚿
'where c_n = < _n | _n > deviates from 1 without TDA.'
586 WRITE (unit_nr,
'(T2,A4)') prefix_output
587 WRITE (unit_nr,
'(T2,A4)') prefix_output
588 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
589 'Here, we introduced'
590 WRITE (unit_nr,
'(T2,A4)') prefix_output
591 WRITE (unit_nr,
'(T2,A4,T7,A5,T15,A)') &
592 prefix_output, ψ
"_i:",
"occupied molecular orbitals,"
593 WRITE (unit_nr,
'(T2,A4,T7,A5,T15,A)') &
594 prefix_output, ψ
"_a:",
"empty molecular orbitals and"
595 WRITE (unit_nr,
'(T2,A4,T9,A2,T14,A)') &
596 prefix_output,
"r:",
"position operator."
597 WRITE (unit_nr,
'(T2,A4)') prefix_output
598 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
599 'prelim Ref.: Eqs. (15)-(22)'
600 WRITE (unit_nr,
'(T2,A4,T7,A,A)') prefix_output, &
601 'JCTC 2018, 14, 710-725; ', &
602 'http://doi.org/10.1021/acs.jctc.7b01145'
603 WRITE (unit_nr,
'(T2,A4)') prefix_output
604 WRITE (unit_nr,
'(T2,A4)') prefix_output
605 IF (exc_descr(1)%flag_TDA)
THEN
606 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
607 'Exciton descriptors from solving the ', method_name,
' within the TDA:'
609 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
610 'Exciton descriptors from solving the ', method_name,
' without the TDA:'
612 WRITE (unit_nr,
'(T2,A4)') prefix_output
613 WRITE (unit_nr,
'(T2,A4,T10,A1,6X,A3,1X,4X,A10,5X,A10,5X,A10,3X,A11,8X,A4)') prefix_output, &
614 'n',
'c_n', Å
'd_eh []', σÅ
'_e []', σÅ
'_h []', Å
'd_exc []',
'R_eh'
615 DO i_exc = 1, num_print_exc_descr
616 WRITE (unit_nr,
'(T2,A4,T7,I4,4X,F5.3,1X,5(2X,F10.4))') &
617 prefix_output, i_exc, exc_descr(i_exc)%norm_XpY, &
618 exc_descr(i_exc)%diff_r_abs*
angstrom, &
620 exc_descr(i_exc)%diff_r_sqr*
angstrom, exc_descr(i_exc)%corr_e_h
622 WRITE (unit_nr,
'(T2,A4)') prefix_output
624 IF (print_checkvalue)
THEN
625 WRITE (unit_nr,
'(T2)')
626 WRITE (unit_nr,
'(T2,A28,T65,F16.4)')
'Checksum exciton descriptors', &
628 WRITE (unit_nr,
'(T2)')
630 WRITE (unit_nr,
'(T2,A4)') prefix_output
632 IF (print_directional_exc_descr)
THEN
633 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
634 'We can restrict the exciton descriptors to a specific direction,'
635 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
636 'e.g. the x-components are:'
637 WRITE (unit_nr,
'(T2,A4)') prefix_output
638 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
639 'd_eh^x = | <x_h - x_e>_exc |'
640 WRITE (unit_nr,
'(T2,A4)') prefix_output
641 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
642 σ
'_e^x = sqrt( <x_e^2>_exc - <x_e>_exc^2 )'
643 WRITE (unit_nr,
'(T2,A4)') prefix_output
644 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
645 σ
'_h^x = sqrt( <x_h^2>_exc - <x_h>_exc^2 )'
646 WRITE (unit_nr,
'(T2,A4)') prefix_output
647 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
648 μμμμμμ
"COV_eh^{'} = <r^_e r^'_h>_exc - <r^_e>_exc <r^'_h>_exc"
649 WRITE (unit_nr,
'(T2,A4)') prefix_output
650 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
651 'd_exc^x = sqrt( | < |x_h - x_e|^2 >_exc )'
652 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
653 σ
' = sqrt( (d_eh^x)^2 + (_e^x)^2'
654 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
655 σ
" + (_h^x)^2 - 2 * (COV_eh^{xx}) )"
656 WRITE (unit_nr,
'(T2,A4)') prefix_output
657 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
658 μμ
"Subsequently, the cross-correlation matrix R_eh^{'} is printed"
659 WRITE (unit_nr,
'(T2,A4)') prefix_output
660 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
661 μμμμσμσμ
"R_eh^{'} = COV_eh^{'}/(^_e ^_h) "
662 WRITE (unit_nr,
'(T2,A4)') prefix_output
663 WRITE (unit_nr,
'(T2,A4)') prefix_output
664 IF (exc_descr(1)%flag_TDA)
THEN
665 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
666 'Exciton descriptors per direction from solving the ', method_name,
' within the TDA:'
668 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
669 'Exciton descriptors per direction from solving the ', method_name,
' without the TDA:'
671 WRITE (unit_nr,
'(T2,A4)') prefix_output
672 WRITE (unit_nr,
'(T2,A4,T12,A1,2X,A9,5X,A12,5X,A12,5X,A12,3X,A13)') prefix_output, &
673 'n',
'r = x/y/z', Å
'd_eh^r []', σÅ
'_e^r []', σÅ
'_h^r []', Å
'd_exc^r []'
674 DO i_exc = 1, num_print_exc_descr
676 array_direction_str = (/
"x",
"y",
"z"/)
677 WRITE (unit_nr,
'(T2,A4,T9,I4,10X,A1,1X,4(4X,F10.4))') &
678 prefix_output, i_exc, array_direction_str(i_dir), &
679 exc_descr(i_exc)%d_eh_dir(i_dir)*
angstrom, &
680 exc_descr(i_exc)%sigma_e_dir(i_dir)*
angstrom, &
681 exc_descr(i_exc)%sigma_h_dir(i_dir)*
angstrom, &
682 exc_descr(i_exc)%d_exc_dir(i_dir)*
angstrom
684 WRITE (unit_nr,
'(T2,A4)') prefix_output
686 WRITE (unit_nr,
'(T2,A4)') prefix_output
687 WRITE (unit_nr,
'(T2,A4)') prefix_output
688 IF (exc_descr(1)%flag_TDA)
THEN
689 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
690 'Crosscorrelation matrix from solving the ', method_name,
' within the TDA:'
692 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
693 'Crosscorrelation matrix from solving the ', method_name,
' without the TDA:'
695 WRITE (unit_nr,
'(T2,A4)') prefix_output
696 WRITE (unit_nr,
'(T2,A4,T12,A1,8X,6(8X,A2))') prefix_output, &
697 'n',
'xx',
'yy',
'zz',
'xy',
'xz',
'yz'
698 DO i_exc = 1, num_print_exc_descr
699 WRITE (unit_nr,
'(T2,A4,T9,I4,8X,6(3X,F7.4),3X,F7.4)') &
700 prefix_output, i_exc, &
701 exc_descr(i_exc)%corr_e_h_matrix(1, 1), &
702 exc_descr(i_exc)%corr_e_h_matrix(2, 2), &
703 exc_descr(i_exc)%corr_e_h_matrix(3, 3), &
704 exc_descr(i_exc)%corr_e_h_matrix(1, 2), &
705 exc_descr(i_exc)%corr_e_h_matrix(1, 3), &
706 exc_descr(i_exc)%corr_e_h_matrix(2, 3)
708 WRITE (unit_nr,
'(T2,A4)') prefix_output
711 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
712 'With the center of charge as reference point r_0,'
713 WRITE (unit_nr,
'(T2,A4,T15,A7,F10.4,A2,F10.4,A2,F10.4,A1)') prefix_output, &
714 'r_0 = (', ref_point_multipole(1)*
angstrom,
', ', ref_point_multipole(2)*
angstrom,
', ', &
715 ref_point_multipole(3)*
angstrom,
')'
716 IF (exc_descr(1)%flag_TDA)
THEN
717 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
718 'we further obtain r_e and r_h from solving the ', method_name,
' within the TDA'
720 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
721 'we further obtain r_e and r_h from solving the ', method_name,
' without the TDA'
723 WRITE (unit_nr,
'(T2,A4)') prefix_output
724 WRITE (unit_nr,
'(T2,A4,T8,A12,1X,13X,A9,13X,A9,13X,A9)') prefix_output, &
725 'Excitation n', Å
'x_e []', Å
'y_e []', Å
'z_e []'
726 DO i_exc = 1, num_print_exc_descr
727 WRITE (unit_nr,
'(T2,A4,T8,I12,1X,3(5X,F15.4))') &
728 prefix_output, i_exc, &
729 exc_descr(i_exc)%r_e_shift(:)*
angstrom
731 WRITE (unit_nr,
'(T2,A4)') prefix_output
732 WRITE (unit_nr,
'(T2,A4,T8,A12,1X,13X,A9,13X,A9,13X,A9)') prefix_output, &
733 'Excitation n', Å
'x_h []', Å
'y_h []', Å
'z_h []'
734 DO i_exc = 1, num_print_exc_descr
735 WRITE (unit_nr,
'(T2,A4,T8,I12,1X,3(5X,F15.4))') &
736 prefix_output, i_exc, &
737 exc_descr(i_exc)%r_h_shift(:)*
angstrom
739 WRITE (unit_nr,
'(T2,A4)') prefix_output
740 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
741 'The reference atomic geometry for these values is given by'
743 CALL write_qs_particle_coordinates_bse(particle_set, unit_nr, prefix_output)
744 IF (unit_nr > 0)
THEN
745 WRITE (unit_nr,
'(T2,A4)') prefix_output
747 CALL timestop(handle)
762 REAL(kind=
dp),
INTENT(IN) :: thresh
763 CHARACTER(LEN=*),
INTENT(IN) ::
header
764 INTEGER,
INTENT(IN) :: unit_nr
765 LOGICAL,
OPTIONAL :: abs_vals
767 CHARACTER(LEN=*),
PARAMETER :: my_footer =
" | ENDING WRITING OF MATRIX", &
768 routinen =
'fm_write_thresh'
770 INTEGER :: handle, i, j, ncol_local, nrow_local
771 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
772 LOGICAL :: my_abs_vals
774 CALL timeset(routinen, handle)
776 IF (
PRESENT(abs_vals))
THEN
777 my_abs_vals = abs_vals
779 my_abs_vals = .false.
783 nrow_local=nrow_local, &
784 ncol_local=ncol_local, &
785 row_indices=row_indices, &
786 col_indices=col_indices)
788 IF (unit_nr > 0)
THEN
791 IF (my_abs_vals)
THEN
794 IF (abs(fm%local_data(i, j)) > thresh)
THEN
795 IF (unit_nr > 0)
THEN
796 WRITE (unit_nr,
"(A7,T10,I5,T20,I5,T30,F13.5)")
header, row_indices(i), col_indices(j), &
797 abs(fm%local_data(i, j))
805 IF (abs(fm%local_data(i, j)) > thresh)
THEN
806 IF (unit_nr > 0)
THEN
807 WRITE (unit_nr,
"(A7,T10,I5,T20,I5,T30,F13.5)")
header, row_indices(i), col_indices(j), &
814 CALL fm%matrix_struct%para_env%sync()
815 IF (unit_nr > 0)
THEN
816 WRITE (unit_nr, *) my_footer
819 CALL timestop(handle)
830 SUBROUTINE write_qs_particle_coordinates_bse(particle_set, unit_nr, prefix_output)
833 INTEGER,
INTENT(IN) :: unit_nr
834 CHARACTER(LEN=4),
INTENT(IN) :: prefix_output
836 CHARACTER(len=*),
PARAMETER :: routinen =
'write_qs_particle_coordinates_bse'
838 CHARACTER(LEN=2) :: element_symbol
839 INTEGER :: handle, iatom, natom
841 CALL timeset(routinen, handle)
843 IF (unit_nr > 0)
THEN
844 WRITE (unit_nr,
'(T2,A4)') prefix_output
845 WRITE (unit_nr,
'(T2,A4,T13,A7,16X,A7,15X,A7,15X,A7)') prefix_output, &
846 'Element', Å
'x []', Å
'y []', Å
'z []'
847 natom =
SIZE(particle_set)
850 element_symbol=element_symbol)
851 WRITE (unit_nr,
'(T2,A4,T8,A12,1X,3(5X,F15.4))') &
852 prefix_output, element_symbol, particle_set(iatom)%r(1:3)*
angstrom
856 CALL timestop(handle)
858 END SUBROUTINE write_qs_particle_coordinates_bse
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
Routines for printing information in context of the BSE calculation.
subroutine, public print_output_header(homo, virtual, homo_irred, flag_tda, multiplet, alpha, mp2_env, unit_nr)
...
subroutine, public print_optical_properties(exc_ens, oscill_str, trans_mom_bse, polarizability_residues, homo, virtual, homo_irred, flag_tda, info_approximation, mp2_env, unit_nr)
...
subroutine, public print_bse_start_flag(bse_tda, bse_abba, unit_nr)
...
subroutine, public print_exciton_descriptors(exc_descr, ref_point_multipole, unit_nr, num_print_exc_descr, print_checkvalue, print_directional_exc_descr, prefix_output, qs_env)
Prints exciton descriptors, cf. Mewes et al., JCTC 14, 710-725 (2018)
subroutine, public print_transition_amplitudes(fm_eigvec_x, homo, virtual, homo_irred, info_approximation, mp2_env, unit_nr, fm_eigvec_y)
...
subroutine, public fm_write_thresh(fm, thresh, header, unit_nr, abs_vals)
Debug function to write elements of a full matrix to file, if they are larger than a given threshold.
subroutine, public print_excitation_energies(exc_ens, homo, virtual, flag_tda, multiplet, info_approximation, mp2_env, unit_nr)
...
Routines for computing excitonic properties, e.g. exciton diameter, from the BSE.
subroutine, public compute_and_print_absorption_spectrum(oscill_str, polarizability_residues, exc_ens, info_approximation, unit_nr, mp2_env)
Computes and returns absorption spectrum for the frequency range and broadening provided by the user....
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...
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
Defines the basic variable types.
integer, parameter, public dp
Types needed for MP2 calculations.
Define the data structure for the particle information.
Definition of physical constants:
real(kind=dp), parameter, public evolt
real(kind=dp), parameter, public angstrom
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, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, 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.