36#include "./base/base_uses.f90"
42 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'bse_print'
59 INTEGER,
INTENT(IN) :: unit_nr
61 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_BSE_start_flag'
65 CALL timeset(routinen, handle)
69 WRITE (unit_nr, *)
' '
70 WRITE (unit_nr,
'(T2,A79)')
'*******************************************************************************'
71 WRITE (unit_nr,
'(T2,A79)')
'** **'
72 WRITE (unit_nr,
'(T2,A79)')
'** Bethe Salpeter equation (BSE) for excitation energies **'
74 WRITE (unit_nr,
'(T2,A79)')
'** solved with and without Tamm-Dancoff approximation (TDA) **'
76 WRITE (unit_nr,
'(T2,A79)')
'** solved with Tamm-Dancoff approximation (TDA) **'
78 WRITE (unit_nr,
'(T2,A79)')
'** solved without Tamm-Dancoff approximation (TDA) **'
81 WRITE (unit_nr,
'(T2,A79)')
'** **'
82 WRITE (unit_nr,
'(T2,A79)')
'*******************************************************************************'
83 WRITE (unit_nr, *)
' '
101 INTEGER,
INTENT(IN) :: homo, virtual, homo_irred
102 LOGICAL,
INTENT(IN) :: flag_tda
104 INTEGER,
INTENT(IN) :: unit_nr
106 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_output_header'
108 CHARACTER(LEN=10) :: multiplet
111 REAL(kind=
dp) :: alpha
113 CALL timeset(routinen, handle)
116 multiplet =
"Singlet"
119 multiplet =
"Triplet"
124 IF (unit_nr > 0)
THEN
125 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
126 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
128 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'**************************************************************************'
129 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'* Bethe Salpeter equation (BSE) with Tamm Dancoff approximation (TDA) *'
130 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'**************************************************************************'
131 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
133 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'The lowest excitations are obtained iteratively (block Davidson)'
134 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'from the BSE within the TDA:'
136 WRITE (unit_nr,
'(T2,A4,T7,A48,A23)')
'BSE|',
'The excitations are calculated by diagonalizing ', &
137 'the BSE within the TDA:'
139 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
140 WRITE (unit_nr,
'(T2,A4,T29,A16)')
'BSE|',
'A X^n = Ω^n X^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,A41)')
'BSE|',
'sum_jb ( A_ia,jb X_jb^n ) = Ω^n X_ia^n'
145 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
146 WRITE (unit_nr,
'(T2,A4,T7,A14)')
'BSE|',
'Ref.: Eq. (18)'
147 WRITE (unit_nr,
'(T2,A4,T7,A61)')
'BSE|',
'in PRB 113,205152 (2026); https://doi.org/10.1103/38k2-d55h .'
149 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'**************************************************************************'
150 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'* Full ("ABBA") Bethe Salpeter equation (BSE) (i.e. without TDA) *'
151 WRITE (unit_nr,
'(T2,A4,T7,A74)')
'BSE|',
'**************************************************************************'
152 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
154 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'The lowest excitations are obtained iteratively (block Davidson)'
155 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'from the BSE without the TDA:'
157 WRITE (unit_nr,
'(T2,A4,T7,A48,A24)')
'BSE|',
'The excitations are calculated by diagonalizing ', &
158 'the BSE without the TDA:'
160 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
161 WRITE (unit_nr,
'(T2,A4,T22,A30)')
'BSE|',
'|A B| |X^n| |1 0| |X^n|'
162 WRITE (unit_nr,
'(T2,A4,T22,A31)')
'BSE|',
'|B A| |Y^n| = Ω^n |0 -1| |Y^n|'
163 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
164 WRITE (unit_nr,
'(T2,A4,T7,A23)')
'BSE|',
'i.e. in index notation:'
165 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
166 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'
167 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'
168 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
169 WRITE (unit_nr,
'(T2,A4,T7,A13)')
'BSE|',
'Ref.: Eq. (8)'
170 WRITE (unit_nr,
'(T2,A4,T7,A61)')
'BSE|',
'in PRB 113,205152 (2026); https://doi.org/10.1103/38k2-d55h .'
172 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
173 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
174 WRITE (unit_nr,
'(T2,A4,T7,A4,T18,A42,T70,A1,I4,A1,I4,A1)')
'BSE|',
'i,j:', &
175 'occupied molecular orbitals, i.e. state in',
'[', homo_irred - homo + 1,
',', homo_irred,
']'
176 WRITE (unit_nr,
'(T2,A4,T7,A4,T18,A44,T70,A1,I4,A1,I4,A1)')
'BSE|',
'a,b:', &
177 'unoccupied molecular orbitals, i.e. state in',
'[', homo_irred + 1,
',', homo_irred + virtual,
']'
178 WRITE (unit_nr,
'(T2,A4,T7,A2,T18,A16)')
'BSE|',
'n:',
'Excitation index'
179 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
181 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'A_ia,jb = (ε_a-ε_i) δ_ij δ_ab + α * v_ia,jb - W_ij,ab'
183 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'A_ia,jb = (ε_a-ε_i) δ_ij δ_ab + α * v_ia,jb'
185 IF (.NOT. flag_tda)
THEN
187 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'B_ia,jb = α * v_ia,jb - W_ib,aj'
189 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'B_ia,jb = α * v_ia,jb'
191 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
192 WRITE (unit_nr,
'(T2,A4,T7,A14)')
'BSE|',
'Ref.: Eq. (10)'
193 WRITE (unit_nr,
'(T2,A4,T7,A61)')
'BSE|',
'in PRB 113,205152 (2026); https://doi.org/10.1103/38k2-d55h .'
196 CALL print_iterative_method(flag_tda, bse_env%abba_solver, unit_nr)
197 ELSE IF (.NOT. flag_tda)
THEN
198 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
199 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)'
200 WRITE (unit_nr,
'(T2,A4,T7,A71)')
'BSE|',
'in PRB 92,045209 (2015); http://dx.doi.org/10.1103/PhysRevB.92.045209 .'
202 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
203 WRITE (unit_nr,
'(T2,A4,T7,A7,T31,A23)')
'BSE|',
'ε_...:',
'GW quasiparticle energy'
204 WRITE (unit_nr,
'(T2,A4,T7,A7,T31,A15)')
'BSE|',
'δ_...:',
'Kronecker delta'
205 WRITE (unit_nr,
'(T2,A4,T7,A3,T31,A21)')
'BSE|',
'α:',
'spin-dependent factor (Singlet/Triplet)'
206 WRITE (unit_nr,
'(T2,A4,T7,A6,T30,A34)')
'BSE|',
'v_...:',
'Electron-hole exchange interaction'
208 WRITE (unit_nr,
'(T2,A4,T7,A,T31,A)')
'BSE|',
'W_... = 1/ϵ v_...:', &
209 'Direct interaction screened by '
210 WRITE (unit_nr,
'(T2,A4,T30,A)')
'BSE|', &
211 'dielectric function ϵ(ω=0)'
213 WRITE (unit_nr,
'(T2,A4,T7,A,T30,A)')
'BSE|',
'W_... = v_...:',
'Direct interaction without screening'
215 WRITE (unit_nr,
'(T2,A4,T7,A,T31,A,F5.2)')
'BSE|',
'W_... = γ v_...:', &
216 'Direct interaction with artificial screening γ=', bse_env%screening_factor
218 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
219 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
220 WRITE (unit_nr,
'(T2,A4,T7,A47,A7,A9,F3.1)')
'BSE|', &
221 'The spin-dependent factor is for the requested ', multiplet,
" is α = ", alpha
222 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
225 CALL timestop(handle)
235 SUBROUTINE print_iterative_method(flag_TDA, abba_solver, unit_nr)
237 LOGICAL,
INTENT(IN) :: flag_tda
238 INTEGER,
INTENT(IN) :: abba_solver, unit_nr
240 IF (unit_nr > 0)
THEN
241 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
243 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'Iterative solution (block Davidson); A is applied, never formed:'
244 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
245 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'Trial space'
246 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'Z_ia,m with sum_ia Z_ia,m Z_ia,n = δ_mn'
247 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
248 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'Reduced problem'
249 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'G_mn = sum_ia Z_ia,m sum_jb A_ia,jb Z_jb,n'
250 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'sum_n G_mn c_n^k = θ^k c_m^k'
251 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'Ω^k = θ^k'
252 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'X_ia^k = sum_m Z_ia,m c_m^k'
253 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
254 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'Residual and correction'
255 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'r_ia^k = sum_jb A_ia,jb X_jb^k - θ^k X_ia^k'
256 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
't_ia^k = r_ia^k / (d_ia - θ^k)'
258 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'Iterative solution (block Davidson); A and B are applied, never formed:'
259 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
260 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'Trial space, orthonormal in the (A-B) metric'
261 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'W_ia,m = sum_jb (A-B)_ia,jb T_jb,m'
262 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'sum_ia T_ia,m W_ia,n = δ_mn'
263 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
264 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'Reduced problem'
265 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'H_mn = sum_ia W_ia,m sum_jb (A+B)_ia,jb W_jb,n'
266 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'sum_n H_mn c_n^k = θ^k c_m^k'
267 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'Ω^k = (θ^k)^1/2'
268 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'X_ia^k - Y_ia^k = (Ω^k)^1/2 sum_m T_ia,m c_m^k'
269 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'X_ia^k + Y_ia^k = (Ω^k)^-1/2 sum_m W_ia,m c_m^k'
270 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
271 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'Residual and correction'
272 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'r_ia^k = sum_jb (A+B)_ia,jb (X_jb^k + Y_jb^k) - Ω^k (X_ia^k - Y_ia^k)'
273 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
't_ia^k = r_ia^k / ((d_ia)^2 - θ^k)'
275 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'Iterative solution (block Davidson); A and B are applied, never formed:'
276 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
277 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'Trial space'
278 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'b_ia,m with sum_ia b_ia,m b_ia,n = δ_mn'
279 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
280 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'Reduced pair'
281 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'Mr_mn = sum_ia b_ia,m sum_jb (A+B)_ia,jb b_jb,n'
282 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'Kr_mn = sum_ia b_ia,m sum_jb (A-B)_ia,jb b_jb,n'
283 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'sum_n Mr_mn R_n^k = Ω^k L_m^k'
284 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'sum_n Kr_mn L_n^k = Ω^k R_m^k'
285 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'X_ia^k + Y_ia^k = sum_m b_ia,m R_m^k'
286 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'X_ia^k - Y_ia^k = sum_m b_ia,m L_m^k'
287 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
288 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'Residuals and correction'
289 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'rR_ia^k = sum_jb (A+B)_ia,jb (X_jb^k + Y_jb^k) - Ω^k (X_ia^k - Y_ia^k)'
290 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'rL_ia^k = sum_jb (A-B)_ia,jb (X_jb^k - Y_jb^k) - Ω^k (X_ia^k + Y_ia^k)'
291 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
'|r^k| = max(|rR^k|, |rL^k|)'
292 WRITE (unit_nr,
'(T2,A4,T10,A)')
'BSE|',
't_ia^k = r_ia^k / (d_ia - Ω^k)'
294 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
295 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'd_ia from PRECONDITIONER, the trial space grows by the t_ia^k'
296 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|',
'convergence: |r^k| < EPS_RES, |ΔΩ^k| < EPS_ENERGY (CONVERGENCE_CRITERION)'
299 END SUBROUTINE print_iterative_method
313 info_approximation, bse_env, unit_nr)
315 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: exc_ens
316 INTEGER,
INTENT(IN) :: homo, virtual
317 LOGICAL,
INTENT(IN) :: flag_tda
318 CHARACTER(LEN=10),
INTENT(IN) :: multiplet, info_approximation
320 INTEGER,
INTENT(IN) :: unit_nr
322 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_excitation_energies'
324 INTEGER :: handle, i_exc
326 CALL timeset(routinen, handle)
328 IF (unit_nr > 0)
THEN
330 WRITE (unit_nr,
'(T2,A4,T7,A56)')
'BSE|',
'Excitation energies from solving the BSE within the TDA:'
332 WRITE (unit_nr,
'(T2,A4,T7,A57)')
'BSE|',
'Excitation energies from solving the BSE without the TDA:'
334 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
335 WRITE (unit_nr,
'(T2,A4,T11,A12,T30,A7,T44,A8,T55,A27)')
'BSE|', &
336 'Excitation n', multiplet,
'TDA/ABBA',
'Excitation energy Ω^n (eV)'
339 IF (unit_nr > 0)
THEN
340 DO i_exc = 1, min(homo*virtual, bse_env%num_print_exc)
341 WRITE (unit_nr,
'(T2,A4,T7,I16,T30,A7,T46,A6,T59,F22.4)') &
342 'BSE|', i_exc, multiplet, info_approximation, exc_ens(i_exc)*
evolt
346 CALL timestop(handle)
362 info_approximation, bse_env, unit_nr, fm_eigvec_Y)
365 INTEGER,
DIMENSION(:),
INTENT(IN) :: homo, virtual, homo_irred
366 CHARACTER(LEN=10),
INTENT(IN) :: info_approximation
368 INTEGER,
INTENT(IN) :: unit_nr
369 TYPE(
cp_fm_type),
INTENT(IN),
OPTIONAL :: fm_eigvec_y
371 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_transition_amplitudes'
373 INTEGER :: handle, i_exc, isp, n_ov_joint, nspins
374 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: n_ov, offsets
376 CALL timeset(routinen, handle)
379 ALLOCATE (n_ov(nspins), offsets(nspins))
382 IF (unit_nr > 0)
THEN
383 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
384 WRITE (unit_nr,
'(T2,A4,T7,A61)') &
385 'BSE|',
"Single-particle transitions are built up by (de-)excitations,"
386 WRITE (unit_nr,
'(T2,A4,T7,A18)') &
387 'BSE|',
"which we denote by"
388 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
389 WRITE (unit_nr,
'(T2,A4,T20,A2,T30,A40)') &
390 'BSE|',
"=>",
"for excitations, i.e. entries of X_ia^n,"
391 WRITE (unit_nr,
'(T2,A4,T20,A2,T30,A42)') &
392 'BSE|',
"<=",
"for deexcitations, i.e. entries of Y_ia^n."
393 WRITE (unit_nr,
'(T2,A4)') &
395 WRITE (unit_nr,
'(T2,A4,T7,A73)') &
396 'BSE|',
"The following single-particle transitions have significant contributions,"
397 WRITE (unit_nr,
'(T2,A4,T7,A16,F5.3,A15,F5.3,A16)') &
398 'BSE|',
"i.e. |X_ia^n| > ", bse_env%eps_x,
" or |Y_ia^n| > ", &
399 bse_env%eps_x,
", respectively :"
401 IF (nspins == 1)
THEN
402 WRITE (unit_nr,
'(T2,A4,T15,A27,I5,A13,I5,A3)')
'BSE|',
'-- Quick reminder: HOMO i =', &
403 homo_irred(1),
' and LUMO a =', homo_irred(1) + 1,
" --"
404 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
405 WRITE (unit_nr,
'(T2,A4,T7,A12,T30,A1,T32,A5,T42,A1,T49,A8,T64,A17)') &
406 "BSE|",
"Excitation n",
"i",
"=>/<=",
"a",
'TDA/ABBA',
"|X_ia^n|/|Y_ia^n|"
411 WRITE (unit_nr,
'(T2,A4,T15,A,I2,A,I5,A,I5,A)')
'BSE|', &
412 '-- Quick reminder: σ =', isp,
', HOMO i =', homo_irred(isp), &
413 ' and LUMO a =', homo_irred(isp) + 1,
" --"
415 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
416 WRITE (unit_nr,
'(T2,A4,T7,A12,T22,A,T30,A1,T32,A5,T42,A1,T49,A8,T64,A)') &
417 "BSE|",
"Excitation n",
"σ",
"i",
"=>/<=",
"a",
'TDA/ABBA',
"|X_iaσ^n|/|Y_iaσ^n|"
420 DO i_exc = 1, min(n_ov_joint, bse_env%num_print_exc)
421 IF (unit_nr > 0)
THEN
422 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
425 CALL print_transition_amplitudes_core(fm_eigvec_x,
"=>", info_approximation, &
426 i_exc, virtual, homo, homo_irred, &
427 unit_nr, bse_env, offsets)
428 IF (
PRESENT(fm_eigvec_y))
THEN
429 CALL print_transition_amplitudes_core(fm_eigvec_y,
"<=", info_approximation, &
430 i_exc, virtual, homo, homo_irred, &
431 unit_nr, bse_env, offsets)
435 DEALLOCATE (n_ov, offsets)
436 CALL timestop(handle)
456 homo, virtual, homo_irred, flag_TDA, &
457 info_approximation, bse_env, unit_nr, open_shell)
459 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: exc_ens, oscill_str
460 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: trans_mom_bse, polarizability_residues
461 INTEGER,
INTENT(IN) :: homo, virtual, homo_irred
462 LOGICAL,
INTENT(IN) :: flag_tda
463 CHARACTER(LEN=10),
INTENT(IN) :: info_approximation
465 INTEGER,
INTENT(IN) :: unit_nr
466 LOGICAL,
INTENT(IN),
OPTIONAL :: open_shell
468 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_optical_properties'
470 INTEGER :: handle, i_exc
471 LOGICAL :: my_open_shell
473 CALL timeset(routinen, handle)
475 my_open_shell = .false.
476 IF (
PRESENT(open_shell)) my_open_shell = open_shell
480 IF (bse_env%bse_spin_config == 0)
THEN
481 IF (unit_nr > 0)
THEN
482 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
483 WRITE (unit_nr,
'(T2,A4,T7,A60)') &
484 'BSE|',
"Transition moments d_r^n (with r∈(x,y,z), in atomic units)"
485 WRITE (unit_nr,
'(T2,A4,T7,A67)') &
486 'BSE|',
"and oscillator strength f^n of excitation level n are obtained from"
487 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
488 IF (my_open_shell)
THEN
490 WRITE (unit_nr,
'(T2,A4,T10,A)') &
491 'BSE|',
"d_r^n = sum_σ sum_ia < ψ_iσ | r | ψ_aσ > X_iaσ^n"
493 WRITE (unit_nr,
'(T2,A4,T10,A)') &
494 'BSE|',
"d_r^n = sum_σ sum_ia < ψ_iσ | r | ψ_aσ > ( X_iaσ^n + Y_iaσ^n )"
498 WRITE (unit_nr,
'(T2,A4,T10,A)') &
499 'BSE|',
"d_r^n = sqrt(2) sum_ia < ψ_i | r | ψ_a > X_ia^n"
501 WRITE (unit_nr,
'(T2,A4,T10,A)') &
502 'BSE|',
"d_r^n = sum_ia sqrt(2) < ψ_i | r | ψ_a > ( X_ia^n + Y_ia^n )"
505 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
506 WRITE (unit_nr,
'(T2,A4,T14,A)') &
507 'BSE|',
"f^n = 2/3 * Ω^n sum_r∈(x,y,z) ( d_r^n )^2"
508 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
509 WRITE (unit_nr,
'(T2,A4,T7,A19)') &
510 'BSE|',
"where we introduced"
511 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
512 WRITE (unit_nr,
'(T2,A4,T7,A5,T15,A28)') &
513 'BSE|',
"ψ_i:",
"occupied molecular orbitals,"
514 WRITE (unit_nr,
'(T2,A4,T7,A5,T15,A28)') &
515 'BSE|',
"ψ_a:",
"empty molecular orbitals and"
516 WRITE (unit_nr,
'(T2,A4,T9,A2,T14,A18)') &
517 'BSE|',
"r:",
"position operator."
518 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
519 WRITE (unit_nr,
'(T2,A4,T7,A21)') &
520 'BSE|',
"Ref.: Eqs. (21), (D3)"
521 WRITE (unit_nr,
'(T2,A4,T7,A69)') &
522 'BSE|',
"in Phys. Rev. B 113, 205152 (2026); https://doi.org/10.1103/38k2-d55h"
523 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
525 WRITE (unit_nr,
'(T2,A4,T7,A55)')
'BSE|', &
526 'Optical properties from solving the BSE within the TDA:'
528 WRITE (unit_nr,
'(T2,A4,T7,A56)')
'BSE|', &
529 'Optical properties from solving the BSE without the TDA:'
531 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
532 WRITE (unit_nr,
'(T2,A4,T8,A12,T22,A8,T38,A5,T48,A5,T58,A5,T64,A17)')
'BSE|', &
533 'Excitation n',
"TDA/ABBA",
"d_x^n",
"d_y^n",
"d_z^n",
'Osc. strength f^n'
534 DO i_exc = 1, min(homo*virtual, bse_env%num_print_exc)
535 WRITE (unit_nr,
'(T2,A4,T8,I12,T24,A6,T35,F8.3,T45,F8.3,T55,F8.3,T65,F16.3)') &
536 'BSE|', i_exc, info_approximation, trans_mom_bse(1, 1, i_exc), trans_mom_bse(2, 1, i_exc), &
537 trans_mom_bse(3, 1, i_exc), oscill_str(i_exc)
539 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
541 IF (
SIZE(oscill_str) == homo*virtual)
THEN
542 WRITE (unit_nr,
'(T2,A4,T7,A)')
'BSE|', &
543 'Check for Thomas-Reiche-Kuhn sum rule'
544 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
545 WRITE (unit_nr,
'(T2,A4,T35,A15)')
'BSE|', &
547 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
550 WRITE (unit_nr,
'(T2,A4,T7,A24,T65,I16)')
'BSE|', &
551 'Number of electrons N_e:', merge(homo_irred, homo_irred*2, my_open_shell)
552 WRITE (unit_nr,
'(T2,A4,T7,A40,T66,F16.3)')
'BSE|', &
553 'Sum over oscillator strengths Σ_n f^n :', sum(oscill_str)
554 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
555 IF (bse_env%bse_cutoff_occ > 0 .OR. bse_env%bse_cutoff_empty > 0)
THEN
556 CALL cp_warn(__location__, &
557 "Accuracy of TRK sum rule might suffer from cutoffs.")
563 IF (bse_env%bse_print_spectrum)
THEN
565 info_approximation, unit_nr, bse_env)
569 IF (unit_nr > 0)
THEN
570 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
571 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
572 CALL cp_warn(__location__, &
573 "Requested triplet excitation cannot couple to light. "// &
574 "Skipping calculation of transition moments, "// &
575 "oscillator strengths, and spectrum.")
579 CALL timestop(handle)
596 SUBROUTINE print_transition_amplitudes_core(fm_eigvec, direction_excitation, info_approximation, &
597 i_exc, virtual, homo, homo_irred, &
598 unit_nr, bse_env, offsets)
601 CHARACTER(LEN=2),
INTENT(IN) :: direction_excitation
602 CHARACTER(LEN=10),
INTENT(IN) :: info_approximation
603 INTEGER,
INTENT(IN) :: i_exc
604 INTEGER,
DIMENSION(:),
INTENT(IN) :: virtual, homo, homo_irred
605 INTEGER,
INTENT(IN) :: unit_nr
607 INTEGER,
DIMENSION(:),
INTENT(IN) :: offsets
609 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_transition_amplitudes_core'
610 CHARACTER(LEN=2),
DIMENSION(2),
PARAMETER :: spin_label = [
"α",
"β"]
612 INTEGER :: handle, isp, k, num_entries
613 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: idx_homo, idx_spin, idx_virt
614 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigvec_entries
618 CALL timeset(routinen, handle)
622 IF (
SIZE(homo) == 1)
THEN
624 i_exc, virtual(1), num_entries, bse_env)
625 IF (unit_nr > 0)
THEN
626 DO k = 1, num_entries
627 WRITE (unit_nr,
'(T2,A4,T14,I5,T26,I5,T35,A2,T38,I5,T51,A6,T65,F16.4)') &
628 "BSE|", i_exc, homo_irred(1) - homo(1) + idx_homo(k), direction_excitation, &
629 homo_irred(1) + idx_virt(k), info_approximation, abs(eigvec_entries(k))
634 i_exc, virtual(1), num_entries, bse_env, &
635 offsets=offsets, virtual_per_spin=virtual, idx_spin=idx_spin)
636 IF (unit_nr > 0)
THEN
637 DO k = 1, num_entries
639 WRITE (unit_nr,
'(T2,A4,T14,I5,T22,A2,T26,I5,T35,A2,T38,I5,T51,A6,T65,F16.4)') &
640 "BSE|", i_exc, spin_label(isp), &
641 homo_irred(isp) - homo(isp) + idx_homo(k), direction_excitation, &
642 homo_irred(isp) + idx_virt(k), info_approximation, abs(eigvec_entries(k))
645 DEALLOCATE (idx_spin)
647 DEALLOCATE (idx_homo)
648 DEALLOCATE (idx_virt)
649 DEALLOCATE (eigvec_entries)
650 CALL timestop(handle)
652 END SUBROUTINE print_transition_amplitudes_core
667 num_print_exc_descr, print_checkvalue, print_directional_exc_descr, &
668 print_directional_crosscorrelation, prefix_output, particle_set)
671 DIMENSION(:) :: exc_descr
672 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:), &
673 INTENT(IN) :: ref_point_multipole
674 INTEGER,
INTENT(IN) :: unit_nr, num_print_exc_descr
675 LOGICAL,
INTENT(IN) :: print_checkvalue, print_directional_exc_descr, &
676 print_directional_crosscorrelation
677 CHARACTER(LEN=4),
INTENT(IN) :: prefix_output
680 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_exciton_descriptors'
682 CHARACTER(LEN=1),
DIMENSION(3) :: array_direction_str
683 CHARACTER(LEN=5) :: method_name
684 INTEGER :: handle, i_dir, i_exc
686 IF (prefix_output ==
'BSE|')
THEN
689 method_name =
'TDDFT'
692 CALL timeset(routinen, handle)
693 IF (unit_nr > 0)
THEN
694 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
695 'Exciton descriptors for excitation level n are given by'
696 WRITE (unit_nr,
'(T2,A4)') prefix_output
697 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
698 'd_eh = | <r_h - r_e>_exc |'
699 WRITE (unit_nr,
'(T2,A4)') prefix_output
700 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
701 'σ_e = sqrt( <r_e^2>_exc - <r_e>_exc^2 )'
702 WRITE (unit_nr,
'(T2,A4)') prefix_output
703 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
704 'σ_h = sqrt( <r_h^2>_exc - <r_h>_exc^2 )'
705 WRITE (unit_nr,
'(T2,A4)') prefix_output
706 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
707 'COV_eh = <r_e r_h>_exc - <r_e>_exc <r_h>_exc'
708 WRITE (unit_nr,
'(T2,A4)') prefix_output
709 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
710 'd_exc = sqrt( | < |r_h - r_e|^2 >_exc )'
711 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
712 ' = sqrt( d_eh^2 + σ_e^2 + σ_h^2 - 2 * COV_eh )'
713 WRITE (unit_nr,
'(T2,A4)') prefix_output
714 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
715 'R_eh = COV_eh / (σ_e * σ_h)'
716 WRITE (unit_nr,
'(T2,A4)') prefix_output
717 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
718 'where the expectation values <.>_exc are taken with respect to the '
719 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
720 'exciton wavefunction of excitation n:'
721 WRITE (unit_nr,
'(T2,A4)') prefix_output
723 IF (exc_descr(1)%flag_TDA)
THEN
724 WRITE (unit_nr,
'(T2,A4,T20,A)') prefix_output, &
725 '𝚿_n(r_e,r_h) = Σ_{i,a} X_ia^n ψ_i(r_h) ψ_a(r_e) ,'
727 WRITE (unit_nr,
'(T2,A4,T20,A)') prefix_output, &
728 '𝚿_n(r_e,r_h) = Σ_{i,a} X_ia^n ψ_i(r_h) ψ_a(r_e)'
729 WRITE (unit_nr,
'(T2,A4,T40,A)') prefix_output, &
730 '+ Y_ia^n ψ_a(r_h) ψ_i(r_e) ,'
732 WRITE (unit_nr,
'(T2,A4)') prefix_output
733 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
735 WRITE (unit_nr,
'(T2,A4)') prefix_output
736 WRITE (unit_nr,
'(T2,A4,T20,A)') prefix_output, &
737 '< O >_exc = < 𝚿_n | O | 𝚿_n > / < 𝚿_n | 𝚿_n > ,'
738 WRITE (unit_nr,
'(T2,A4)') prefix_output
739 IF (exc_descr(1)%flag_TDA)
THEN
740 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
741 'where c_n = < 𝚿_n | 𝚿_n > = 1 within TDA.'
743 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
744 'where c_n = < 𝚿_n | 𝚿_n > ≥ 1 without TDA.'
746 WRITE (unit_nr,
'(T2,A4)') prefix_output
747 WRITE (unit_nr,
'(T2,A4)') prefix_output
748 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
749 'Here, we introduced'
750 WRITE (unit_nr,
'(T2,A4)') prefix_output
751 WRITE (unit_nr,
'(T2,A4,T7,A5,T15,A)') &
752 prefix_output,
"ψ_i:",
"occupied molecular orbitals,"
753 WRITE (unit_nr,
'(T2,A4,T7,A5,T15,A)') &
754 prefix_output,
"ψ_a:",
"empty molecular orbitals and"
755 WRITE (unit_nr,
'(T2,A4,T9,A2,T14,A)') &
756 prefix_output,
"r:",
"position operator."
757 WRITE (unit_nr,
'(T2,A4)') prefix_output
758 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
759 'Ref.: Eqs. (28)-(32)'
760 WRITE (unit_nr,
'(T2,A4,T7,A,A)') prefix_output, &
761 'Phys. Rev. B 113, 205152 (2026); ', &
762 'https://doi.org/10.1103/38k2-d55h'
763 WRITE (unit_nr,
'(T2,A4)') prefix_output
764 WRITE (unit_nr,
'(T2,A4)') prefix_output
765 IF (exc_descr(1)%flag_TDA)
THEN
766 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
767 'Exciton descriptors from solving the ', method_name,
' within the TDA:'
769 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
770 'Exciton descriptors from solving the ', method_name,
' without the TDA:'
772 WRITE (unit_nr,
'(T2,A4)') prefix_output
773 WRITE (unit_nr,
'(T2,A4,T10,A1,6X,A3,1X,4X,A10,5X,A10,5X,A10,3X,A11,8X,A4)') prefix_output, &
774 'n',
'c_n',
'd_eh [Å]',
'σ_e [Å]',
'σ_h [Å]',
'd_exc [Å]',
'R_eh'
775 DO i_exc = 1, num_print_exc_descr
776 WRITE (unit_nr,
'(T2,A4,T7,I4,4X,F5.3,1X,5(2X,F10.4))') &
777 prefix_output, i_exc, exc_descr(i_exc)%norm_XpY, &
778 exc_descr(i_exc)%diff_r_abs*
angstrom, &
780 exc_descr(i_exc)%diff_r_sqr*
angstrom, exc_descr(i_exc)%corr_e_h
782 WRITE (unit_nr,
'(T2,A4)') prefix_output
784 IF (print_checkvalue)
THEN
785 WRITE (unit_nr,
'(T2)')
786 WRITE (unit_nr,
'(T2,A28,T65,F16.4)')
'Checksum exciton descriptors', &
788 WRITE (unit_nr,
'(T2)')
790 WRITE (unit_nr,
'(T2,A4)') prefix_output
792 IF (print_directional_exc_descr)
THEN
793 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
794 'We can restrict the exciton descriptors to a specific direction,'
795 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
796 'e.g. the x-components are:'
797 WRITE (unit_nr,
'(T2,A4)') prefix_output
798 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
799 'd_eh^x = | <x_h - x_e>_exc |'
800 WRITE (unit_nr,
'(T2,A4)') prefix_output
801 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
802 'σ_e^x = sqrt( <x_e^2>_exc - <x_e>_exc^2 )'
803 WRITE (unit_nr,
'(T2,A4)') prefix_output
804 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
805 'σ_h^x = sqrt( <x_h^2>_exc - <x_h>_exc^2 )'
806 WRITE (unit_nr,
'(T2,A4)') prefix_output
807 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
808 "COV_eh^{μμ'} = <r^μ_e r^μ'_h>_exc - <r^μ_e>_exc <r^μ'_h>_exc"
809 WRITE (unit_nr,
'(T2,A4)') prefix_output
810 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
811 'd_exc^x = sqrt( | < |x_h - x_e|^2 >_exc )'
812 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
813 ' = sqrt( (d_eh^x)^2 + (σ_e^x)^2'
814 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
815 " + (σ_h^x)^2 - 2 * (COV_eh^{xx}) )"
816 WRITE (unit_nr,
'(T2,A4)') prefix_output
817 IF (print_directional_crosscorrelation)
THEN
818 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
819 "Subsequently, the cross-correlation matrix R_eh^{μμ'} is printed"
820 WRITE (unit_nr,
'(T2,A4)') prefix_output
821 WRITE (unit_nr,
'(T2,A4,T15,A)') prefix_output, &
822 "R_eh^{μμ'} = COV_eh^{μμ'}/(σ^μ_e σ^μ'_h)"
823 WRITE (unit_nr,
'(T2,A4)') prefix_output
824 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
825 "Rows: electron direction μ, columns: hole direction μ',"
826 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
827 "so in general R_eh^{μμ'} ≠ R_eh^{μ'μ}."
828 WRITE (unit_nr,
'(T2,A4)') prefix_output
830 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
831 'Ref.: Eqs. (33)-(36)'
832 WRITE (unit_nr,
'(T2,A4,T7,A,A)') prefix_output, &
833 'Phys. Rev. B 113, 205152 (2026); ', &
834 'https://doi.org/10.1103/38k2-d55h'
835 WRITE (unit_nr,
'(T2,A4)') prefix_output
836 WRITE (unit_nr,
'(T2,A4)') prefix_output
837 IF (exc_descr(1)%flag_TDA)
THEN
838 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
839 'Exciton descriptors per direction from solving the ', method_name,
' within the TDA:'
841 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
842 'Exciton descriptors per direction from solving the ', method_name,
' without the TDA:'
844 WRITE (unit_nr,
'(T2,A4)') prefix_output
845 WRITE (unit_nr,
'(T2,A4,T12,A1,2X,A9,5X,A12,5X,A12,5X,A12,3X,A13)') prefix_output, &
846 'n',
'r = x/y/z',
'd_eh^r [Å]',
'σ_e^r [Å]',
'σ_h^r [Å]',
'd_exc^r [Å]'
847 DO i_exc = 1, num_print_exc_descr
849 array_direction_str = [
"x",
"y",
"z"]
850 WRITE (unit_nr,
'(T2,A4,T9,I4,10X,A1,1X,4(4X,F10.4))') &
851 prefix_output, i_exc, array_direction_str(i_dir), &
852 exc_descr(i_exc)%d_eh_dir(i_dir)*
angstrom, &
853 exc_descr(i_exc)%sigma_e_dir(i_dir)*
angstrom, &
854 exc_descr(i_exc)%sigma_h_dir(i_dir)*
angstrom, &
855 exc_descr(i_exc)%d_exc_dir(i_dir)*
angstrom
857 WRITE (unit_nr,
'(T2,A4)') prefix_output
859 IF (print_directional_crosscorrelation)
THEN
860 WRITE (unit_nr,
'(T2,A4)') prefix_output
861 WRITE (unit_nr,
'(T2,A4)') prefix_output
862 IF (exc_descr(1)%flag_TDA)
THEN
863 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
864 'Crosscorrelation matrix from solving the ', method_name,
' within the TDA:'
866 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
867 'Crosscorrelation matrix from solving the ', method_name,
' without the TDA:'
869 WRITE (unit_nr,
'(T2,A4)') prefix_output
870 WRITE (unit_nr,
'(T2,A4,T12,A1,T23,A3,T44,A1,T62,A1,T80,A1)') prefix_output, &
871 'n',
'e\h',
'x',
'y',
'z'
873 DO i_exc = 1, num_print_exc_descr
874 WRITE (unit_nr,
'(T2,A4,T9,I4,T25,A1,1X,3(11X,F7.4))') prefix_output, i_exc, &
875 array_direction_str(1), exc_descr(i_exc)%corr_e_h_matrix(1, :)
877 WRITE (unit_nr,
'(T2,A4,T25,A1,1X,3(11X,F7.4))') prefix_output, &
878 array_direction_str(i_dir), exc_descr(i_exc)%corr_e_h_matrix(i_dir, :)
880 WRITE (unit_nr,
'(T2,A4)') prefix_output
885 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
886 'With the center of charge as reference point r_0,'
887 WRITE (unit_nr,
'(T2,A4,T15,A7,F10.4,A2,F10.4,A2,F10.4,A1)') prefix_output, &
888 'r_0 = (', ref_point_multipole(1)*
angstrom,
', ', ref_point_multipole(2)*
angstrom,
', ', &
889 ref_point_multipole(3)*
angstrom,
')'
890 IF (exc_descr(1)%flag_TDA)
THEN
891 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
892 'we further obtain r_e and r_h from solving the ', method_name,
' within the TDA'
894 WRITE (unit_nr,
'(T2,A4,T7,A,A,A)') prefix_output, &
895 'we further obtain r_e and r_h from solving the ', method_name,
' without the TDA'
897 WRITE (unit_nr,
'(T2,A4)') prefix_output
898 WRITE (unit_nr,
'(T2,A4,T8,A12,1X,13X,A9,13X,A9,13X,A9)') prefix_output, &
899 'Excitation n',
'x_e [Å]',
'y_e [Å]',
'z_e [Å]'
900 DO i_exc = 1, num_print_exc_descr
901 WRITE (unit_nr,
'(T2,A4,T8,I12,1X,3(5X,F15.4))') &
902 prefix_output, i_exc, &
903 exc_descr(i_exc)%r_e_shift(:)*
angstrom
905 WRITE (unit_nr,
'(T2,A4)') prefix_output
906 WRITE (unit_nr,
'(T2,A4,T8,A12,1X,13X,A9,13X,A9,13X,A9)') prefix_output, &
907 'Excitation n',
'x_h [Å]',
'y_h [Å]',
'z_h [Å]'
908 DO i_exc = 1, num_print_exc_descr
909 WRITE (unit_nr,
'(T2,A4,T8,I12,1X,3(5X,F15.4))') &
910 prefix_output, i_exc, &
911 exc_descr(i_exc)%r_h_shift(:)*
angstrom
913 WRITE (unit_nr,
'(T2,A4)') prefix_output
914 WRITE (unit_nr,
'(T2,A4,T7,A)') prefix_output, &
915 'The reference atomic geometry for these values is given by'
917 CALL write_qs_particle_coordinates_bse(particle_set, unit_nr, prefix_output)
918 IF (unit_nr > 0)
THEN
919 WRITE (unit_nr,
'(T2,A4)') prefix_output
921 CALL timestop(handle)
936 REAL(kind=
dp),
INTENT(IN) :: thresh
937 CHARACTER(LEN=*),
INTENT(IN) ::
header
938 INTEGER,
INTENT(IN) :: unit_nr
939 LOGICAL,
OPTIONAL :: abs_vals
941 CHARACTER(LEN=*),
PARAMETER :: my_footer =
" | ENDING WRITING OF MATRIX", &
942 routinen =
'fm_write_thresh'
944 INTEGER :: handle, i, j, ncol_local, nrow_local
945 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
946 LOGICAL :: my_abs_vals
948 CALL timeset(routinen, handle)
950 IF (
PRESENT(abs_vals))
THEN
951 my_abs_vals = abs_vals
953 my_abs_vals = .false.
957 nrow_local=nrow_local, &
958 ncol_local=ncol_local, &
959 row_indices=row_indices, &
960 col_indices=col_indices)
962 IF (unit_nr > 0)
THEN
965 IF (my_abs_vals)
THEN
968 IF (abs(fm%local_data(i, j)) > thresh)
THEN
969 IF (unit_nr > 0)
THEN
970 WRITE (unit_nr,
"(A7,T10,I5,T20,I5,T30,F13.5)")
header, row_indices(i), col_indices(j), &
971 abs(fm%local_data(i, j))
979 IF (abs(fm%local_data(i, j)) > thresh)
THEN
980 IF (unit_nr > 0)
THEN
981 WRITE (unit_nr,
"(A7,T10,I5,T20,I5,T30,F13.5)")
header, row_indices(i), col_indices(j), &
988 CALL fm%matrix_struct%para_env%sync()
989 IF (unit_nr > 0)
THEN
990 WRITE (unit_nr, *) my_footer
993 CALL timestop(handle)
1004 SUBROUTINE write_qs_particle_coordinates_bse(particle_set, unit_nr, prefix_output)
1007 INTEGER,
INTENT(IN) :: unit_nr
1008 CHARACTER(LEN=4),
INTENT(IN) :: prefix_output
1010 CHARACTER(len=*),
PARAMETER :: routinen =
'write_qs_particle_coordinates_bse'
1012 CHARACTER(LEN=2) :: element_symbol
1013 INTEGER :: handle, iatom, natom
1015 CALL timeset(routinen, handle)
1017 IF (unit_nr > 0)
THEN
1018 WRITE (unit_nr,
'(T2,A4)') prefix_output
1019 WRITE (unit_nr,
'(T2,A4,T13,A7,16X,A7,15X,A7,15X,A7)') prefix_output, &
1020 'Element',
'x [Å]',
'y [Å]',
'z [Å]'
1021 natom =
SIZE(particle_set)
1024 element_symbol=element_symbol)
1025 WRITE (unit_nr,
'(T2,A4,T8,A12,1X,3(5X,F15.4))') &
1026 prefix_output, element_symbol, particle_set(iatom)%r(1:3)*
angstrom
1030 CALL timestop(handle)
1032 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.
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public graml2026
Routines for printing information in context of the BSE calculation.
subroutine, public print_transition_amplitudes(fm_eigvec_x, homo, virtual, homo_irred, info_approximation, bse_env, unit_nr, fm_eigvec_y)
...
subroutine, public print_excitation_energies(exc_ens, homo, virtual, flag_tda, multiplet, info_approximation, bse_env, unit_nr)
...
subroutine, public print_output_header(homo, virtual, homo_irred, flag_tda, bse_env, unit_nr)
Banner, defining equations and legend of one BSE problem, printed before it is solved.
subroutine, public print_optical_properties(exc_ens, oscill_str, trans_mom_bse, polarizability_residues, homo, virtual, homo_irred, flag_tda, info_approximation, bse_env, unit_nr, open_shell)
...
subroutine, public print_bse_start_flag(bse_tda, bse_abba, unit_nr)
...
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_exciton_descriptors(exc_descr, ref_point_multipole, unit_nr, num_print_exc_descr, print_checkvalue, print_directional_exc_descr, print_directional_crosscorrelation, prefix_output, particle_set)
Prints exciton descriptors, cf. Mewes et al., JCTC 14, 710-725 (2018).
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, bse_env)
Computes and returns absorption spectrum for the frequency range and broadening provided by the user....
The BSE environment: the settings of the &BSE section and the state a GW path prepares for the solver...
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, bse_env, offsets, virtual_per_spin, idx_spin)
Filters eigenvector entries above a given threshold to describe excitations in the singleparticle bas...
subroutine, public get_bse_spin_block_layout(homo_red, virt_red, n_ov, offsets, n_ov_joint)
Spin-block layout for the open-shell (joint) BSE matrix: per-spin OV-pair counts and the block offset...
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
Define the data structure for the particle information.
Definition of physical constants:
real(kind=dp), parameter, public evolt
real(kind=dp), parameter, public angstrom
Settings of the &BSE section (read_bse_section, re-read before every BSE run, normalised in place by ...