(git:691081d)
Loading...
Searching...
No Matches
bse_main.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Main routines for GW + Bethe-Salpeter for computing electronic excitations
10!> \par History
11!> 04.2024 created [Maximilian Graml]
12! **************************************************************************************************
13
15
16 USE bse_full_diag, ONLY: create_a,&
17 create_b,&
32 USE cp_fm_types, ONLY: cp_fm_create,&
40 USE input_constants, ONLY: bse_abba,&
41 bse_both,&
47 USE kinds, ONLY: dp
49 USE mo_window, ONLY: combine_mo_windows,&
52 USE mp2_types, ONLY: mp2_type
55#include "./base/base_uses.f90"
56
57 IMPLICIT NONE
58
59 PRIVATE
60
61 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'bse_main'
62
63 PUBLIC :: start_bse_calculation
64
65CONTAINS
66
67! **************************************************************************************************
68!> \brief Main subroutine managing BSE calculations
69!> \param fm_mat_S_ia_bse ...
70!> \param fm_mat_S_ij_bse ...
71!> \param fm_mat_S_ab_bse ...
72!> \param fm_mat_Q_static_bse_gemm ...
73!> \param Eigenval ...
74!> \param Eigenval_scf ...
75!> \param homo ...
76!> \param virtual ...
77!> \param dimen_RI ...
78!> \param dimen_RI_red ...
79!> \param bse_lev_virt ...
80!> \param gd_array ...
81!> \param color_sub ...
82!> \param mp2_env ...
83!> \param qs_env ...
84!> \param mo_coeff ...
85!> \param unit_nr ...
86! **************************************************************************************************
87 SUBROUTINE start_bse_calculation(fm_mat_S_ia_bse, fm_mat_S_ij_bse, fm_mat_S_ab_bse, &
88 fm_mat_Q_static_bse_gemm, &
89 Eigenval, Eigenval_scf, &
90 homo, virtual, dimen_RI, dimen_RI_red, bse_lev_virt, &
91 gd_array, color_sub, mp2_env, qs_env, mo_coeff, unit_nr)
92
93 TYPE(cp_fm_type), DIMENSION(:), INTENT(IN) :: fm_mat_s_ia_bse, fm_mat_s_ij_bse, &
94 fm_mat_s_ab_bse
95 TYPE(cp_fm_type), INTENT(INOUT) :: fm_mat_q_static_bse_gemm
96 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :), &
97 INTENT(IN) :: eigenval, eigenval_scf
98 INTEGER, DIMENSION(:), INTENT(IN) :: homo, virtual
99 INTEGER, INTENT(IN) :: dimen_ri, dimen_ri_red
100 INTEGER, DIMENSION(:), INTENT(IN) :: bse_lev_virt
101 TYPE(group_dist_d1_type), INTENT(IN) :: gd_array
102 INTEGER, INTENT(IN) :: color_sub
103 TYPE(mp2_type) :: mp2_env
104 TYPE(qs_environment_type), POINTER :: qs_env
105 TYPE(cp_fm_type), DIMENSION(:), INTENT(IN) :: mo_coeff
106 INTEGER, INTENT(IN) :: unit_nr
107
108 CHARACTER(LEN=*), PARAMETER :: routinen = 'start_bse_calculation'
109
110 INTEGER :: handle, ispin, n_ov_joint, nspins
111 INTEGER, ALLOCATABLE, DIMENSION(:) :: homo_red_arr, n_ov_arr, offsets_arr, &
112 virt_red_arr
113 LOGICAL :: my_do_abba, my_do_fulldiag, &
114 my_do_iterat_diag, my_do_tda, &
115 spins_differ
116 REAL(kind=dp) :: diag_runtime_est
117 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: eigenval_reduced, eigenval_reduced_1, &
118 eigenval_reduced_2, &
119 eigenval_reduced_joint
120 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: b_abq_bse_local, b_bar_iaq_bse_local, &
121 b_bar_ijq_bse_local, b_iaq_bse_local
122 TYPE(cp_fm_type) :: fm_a_bse, fm_b_bse, fm_c_bse, &
123 fm_inv_sqrt_a_minus_b, fm_q_copy, &
124 fm_sqrt_a_minus_b
125 TYPE(cp_fm_type), ALLOCATABLE, DIMENSION(:) :: fm_mat_s_ab_trunc_arr, &
126 fm_mat_s_bar_ia_bse_arr, fm_mat_s_bar_ij_bse_arr, fm_mat_s_ia_trunc_arr, &
127 fm_mat_s_ij_trunc_arr
128 TYPE(cp_logger_type), POINTER :: logger
129 TYPE(dft_control_type), POINTER :: dft_control
130 TYPE(mo_window_type) :: combined_window
131 TYPE(mo_window_type), ALLOCATABLE, DIMENSION(:) :: spin_windows
132 TYPE(mp_para_env_type), POINTER :: para_env
133 TYPE(tddfpt2_control_type), POINTER :: tddfpt_control
134
135 CALL timeset(routinen, handle)
136
137 nspins = SIZE(homo)
138 para_env => fm_mat_s_ia_bse(1)%matrix_struct%para_env
139
140 my_do_fulldiag = .false.
141 my_do_iterat_diag = .false.
142 my_do_tda = .false.
143 my_do_abba = .false.
144 !Method: Iterative or full diagonalization
145 SELECT CASE (mp2_env%bse%bse_diag_method)
146 CASE (bse_iterdiag)
147 my_do_iterat_diag = .true.
148 !MG: Basics of the Davidson solver are implemented, but not rigorously checked.
149 cpabort("Iterative BSE not yet implemented")
150 CASE (bse_fulldiag)
151 my_do_fulldiag = .true.
152 END SELECT
153 !Approximation: TDA and/or full ABBA matrix
154 SELECT CASE (mp2_env%bse%flag_tda)
155 CASE (bse_tda)
156 my_do_tda = .true.
157 CASE (bse_abba)
158 my_do_abba = .true.
159 CASE (bse_both)
160 my_do_tda = .true.
161 my_do_abba = .true.
162 END SELECT
163
164 CALL print_bse_start_flag(my_do_tda, my_do_abba, unit_nr)
165
166 ! Link BSE debug flag against debug print level
167 logger => cp_get_default_logger()
168 IF (logger%iter_info%print_level == debug_print_level) THEN
169 mp2_env%bse%bse_debug_print = .true.
170 END IF
171
172 CALL fm_mat_s_ia_bse(1)%matrix_struct%para_env%sync()
173
174 ALLOCATE (homo_red_arr(nspins), virt_red_arr(nspins))
175 ALLOCATE (spin_windows(nspins))
176 ALLOCATE (fm_mat_s_ia_trunc_arr(nspins), fm_mat_s_ij_trunc_arr(nspins), fm_mat_s_ab_trunc_arr(nspins))
177 ALLOCATE (fm_mat_s_bar_ia_bse_arr(nspins), fm_mat_s_bar_ij_bse_arr(nspins))
178
179 DO ispin = 1, nspins
180 CALL determine_mo_window(eigenval_scf(:, 1, ispin), homo(ispin) + virtual(ispin), homo(ispin), &
181 mp2_env%bse%bse_cutoff_occ, mp2_env%bse%bse_cutoff_empty, &
182 spin_windows(ispin))
183 END DO
184
185 IF (nspins > 1) THEN
186 CALL cp_warn(__location__, &
187 "Open-shell (UKS/LSD) BSE is a recent addition and has not been "// &
188 "extensively validated. Verify results carefully before using them "// &
189 "for production calculations.")
190 ! === Open-shell path: combined-window cutoff, per-spin truncation, joint A (+B for ABBA) ===
191 CALL combine_mo_windows(spin_windows, combined_window, spins_differ)
192 IF (spins_differ) THEN
193 cpwarn("BSE: spin-resolved active MO cutoff candidates differ; using combined window.")
194 END IF
195 DO ispin = 1, nspins
196 CALL truncate_bse_matrices(fm_mat_s_ia_bse(ispin), fm_mat_s_ij_bse(ispin), &
197 fm_mat_s_ab_bse(ispin), &
198 fm_mat_s_ia_trunc_arr(ispin), fm_mat_s_ij_trunc_arr(ispin), &
199 fm_mat_s_ab_trunc_arr(ispin), &
200 eigenval_scf(:, 1, ispin), eigenval(:, 1, ispin), &
201 eigenval_reduced, homo(ispin), virtual(ispin), dimen_ri, &
202 unit_nr, bse_lev_virt(ispin), homo_red_arr(ispin), &
203 virt_red_arr(ispin), mp2_env, combined_window, .false.)
204 IF (ispin == 1) THEN
205 ALLOCATE (eigenval_reduced_1(SIZE(eigenval_reduced)))
206 eigenval_reduced_1(:) = eigenval_reduced(:)
207 ELSE
208 ALLOCATE (eigenval_reduced_2(SIZE(eigenval_reduced)))
209 eigenval_reduced_2(:) = eigenval_reduced(:)
210 END IF
211 DEALLOCATE (eigenval_reduced)
212 END DO
213 ! Flat eigenvalue layout: [sigma=1 levels, sigma=2 levels]
214 ALLOCATE (eigenval_reduced_joint(SIZE(eigenval_reduced_1) + SIZE(eigenval_reduced_2)))
215 eigenval_reduced_joint(1:SIZE(eigenval_reduced_1)) = eigenval_reduced_1
216 eigenval_reduced_joint(SIZE(eigenval_reduced_1) + 1:) = eigenval_reduced_2
217 DEALLOCATE (eigenval_reduced_1, eigenval_reduced_2)
218
219 ALLOCATE (n_ov_arr(nspins), offsets_arr(nspins))
220 CALL get_bse_spin_block_layout(homo_red_arr, virt_red_arr, n_ov_arr, offsets_arr, n_ov_joint)
221
222 CALL adapt_bse_input_params(n_ov_joint, 1, unit_nr, mp2_env, qs_env)
223
224 ! W: mult_B_with_W modifies Q in-place (Cholesky); copy the original Q for each spin call
225 DO ispin = 1, nspins
226 CALL cp_fm_create(fm_q_copy, fm_mat_q_static_bse_gemm%matrix_struct)
227 CALL cp_fm_to_fm(fm_mat_q_static_bse_gemm, fm_q_copy)
228 CALL mult_b_with_w(fm_mat_s_ij_trunc_arr(ispin), fm_mat_s_ia_trunc_arr(ispin), &
229 fm_mat_s_bar_ia_bse_arr(ispin), fm_mat_s_bar_ij_bse_arr(ispin), &
230 fm_q_copy, dimen_ri_red, homo_red_arr(ispin), virt_red_arr(ispin))
231 CALL cp_fm_release(fm_q_copy)
232 END DO
233 CALL cp_fm_release(fm_mat_q_static_bse_gemm)
234
235 IF (my_do_fulldiag) THEN
236 CALL estimate_bse_resources(n_ov_joint, unit_nr, my_do_abba, para_env, diag_runtime_est)
237 IF (mp2_env%bse%screening_method == bse_screening_tdhf .OR. &
238 mp2_env%bse%screening_method == bse_screening_alpha) THEN
239 CALL create_a(fm_mat_s_ia_trunc_arr, fm_mat_s_ij_trunc_arr, fm_mat_s_ab_trunc_arr, &
240 fm_a_bse, eigenval_reduced_joint, unit_nr, &
241 homo_red_arr, virt_red_arr, dimen_ri, mp2_env, para_env, qs_env)
242 ELSE
243 CALL create_a(fm_mat_s_ia_trunc_arr, fm_mat_s_bar_ij_bse_arr, fm_mat_s_ab_trunc_arr, &
244 fm_a_bse, eigenval_reduced_joint, unit_nr, &
245 homo_red_arr, virt_red_arr, dimen_ri, mp2_env, para_env, qs_env)
246 END IF
247 IF (my_do_abba) THEN
248 IF (mp2_env%bse%screening_method == bse_screening_tdhf .OR. &
249 mp2_env%bse%screening_method == bse_screening_alpha) THEN
250 CALL create_b(fm_mat_s_ia_trunc_arr, fm_mat_s_ia_trunc_arr, fm_b_bse, &
251 homo_red_arr, virt_red_arr, dimen_ri, unit_nr, mp2_env)
252 ELSE
253 CALL create_b(fm_mat_s_ia_trunc_arr, fm_mat_s_bar_ia_bse_arr, fm_b_bse, &
254 homo_red_arr, virt_red_arr, dimen_ri, unit_nr, mp2_env)
255 END IF
256 CALL create_hermitian_form_of_abba(fm_a_bse, fm_b_bse, fm_c_bse, &
257 fm_sqrt_a_minus_b, fm_inv_sqrt_a_minus_b, &
258 unit_nr, mp2_env, diag_runtime_est)
259 CALL cp_fm_release(fm_b_bse)
260 END IF
261 NULLIFY (dft_control, tddfpt_control)
262 CALL get_qs_env(qs_env, dft_control=dft_control)
263 tddfpt_control => dft_control%tddfpt2_control
264 ! 4th arg (homo_irred) = full per-spin occupied counts: per-spin absolute-MO labels for
265 ! the amplitude table, and N_e = SUM(homo_irred) for the TRK print.
266 IF (my_do_tda .AND. (.NOT. tddfpt_control%do_bse)) THEN
267 CALL diagonalize_a(fm_a_bse, homo_red_arr, virt_red_arr, homo, &
268 unit_nr, diag_runtime_est, mp2_env, qs_env, mo_coeff)
269 END IF
270 CALL cp_fm_release(fm_a_bse)
271 IF (my_do_abba) THEN
272 CALL diagonalize_c(fm_c_bse, homo_red_arr, virt_red_arr, homo, &
273 fm_sqrt_a_minus_b, fm_inv_sqrt_a_minus_b, &
274 unit_nr, diag_runtime_est, mp2_env, qs_env, mo_coeff)
275 CALL cp_fm_release(fm_c_bse)
276 END IF
277 END IF
278
279 DO ispin = 1, nspins
280 CALL cp_fm_release(fm_mat_s_bar_ia_bse_arr(ispin))
281 CALL cp_fm_release(fm_mat_s_bar_ij_bse_arr(ispin))
282 CALL cp_fm_release(fm_mat_s_ia_trunc_arr(ispin))
283 CALL cp_fm_release(fm_mat_s_ij_trunc_arr(ispin))
284 CALL cp_fm_release(fm_mat_s_ab_trunc_arr(ispin))
285 END DO
286 IF (mp2_env%bse%do_nto_analysis) DEALLOCATE (mp2_env%bse%bse_nto_state_list_final)
287 DEALLOCATE (eigenval_reduced_joint, n_ov_arr, offsets_arr)
288
289 ELSE
290 ! === Closed-shell n_spin=1 path (bit-identical) ===
291 CALL truncate_bse_matrices(fm_mat_s_ia_bse(1), fm_mat_s_ij_bse(1), fm_mat_s_ab_bse(1), &
292 fm_mat_s_ia_trunc_arr(1), fm_mat_s_ij_trunc_arr(1), &
293 fm_mat_s_ab_trunc_arr(1), &
294 eigenval_scf(:, 1, 1), eigenval(:, 1, 1), eigenval_reduced, &
295 homo(1), virtual(1), dimen_ri, unit_nr, &
296 bse_lev_virt(1), homo_red_arr(1), virt_red_arr(1), mp2_env, &
297 spin_windows(1), .true.)
298 CALL mult_b_with_w(fm_mat_s_ij_trunc_arr(1), fm_mat_s_ia_trunc_arr(1), &
299 fm_mat_s_bar_ia_bse_arr(1), fm_mat_s_bar_ij_bse_arr(1), &
300 fm_mat_q_static_bse_gemm, dimen_ri_red, homo_red_arr(1), virt_red_arr(1))
301
302 IF (my_do_iterat_diag) THEN
303 CALL fill_local_3c_arrays(fm_mat_s_ab_trunc_arr(1), fm_mat_s_ia_trunc_arr(1), &
304 fm_mat_s_bar_ia_bse_arr(1), fm_mat_s_bar_ij_bse_arr(1), &
305 b_bar_ijq_bse_local, b_abq_bse_local, b_bar_iaq_bse_local, &
306 b_iaq_bse_local, dimen_ri_red, homo_red_arr(1), &
307 virt_red_arr(1), gd_array, color_sub, para_env)
308 END IF
309
310 CALL adapt_bse_input_params(homo_red_arr(1), virt_red_arr(1), unit_nr, mp2_env, qs_env)
311
312 IF (my_do_fulldiag) THEN
313 n_ov_joint = homo_red_arr(1)*virt_red_arr(1)
314 CALL estimate_bse_resources(n_ov_joint, unit_nr, my_do_abba, para_env, diag_runtime_est)
315 IF (mp2_env%bse%screening_method == bse_screening_tdhf .OR. &
316 mp2_env%bse%screening_method == bse_screening_alpha) THEN
317 CALL create_a(fm_mat_s_ia_trunc_arr, fm_mat_s_ij_trunc_arr, fm_mat_s_ab_trunc_arr, &
318 fm_a_bse, eigenval_reduced, unit_nr, &
319 homo_red_arr, virt_red_arr, dimen_ri, mp2_env, para_env, qs_env)
320 ELSE
321 CALL create_a(fm_mat_s_ia_trunc_arr, fm_mat_s_bar_ij_bse_arr, fm_mat_s_ab_trunc_arr, &
322 fm_a_bse, eigenval_reduced, unit_nr, &
323 homo_red_arr, virt_red_arr, dimen_ri, mp2_env, para_env, qs_env)
324 END IF
325 IF (my_do_abba) THEN
326 IF (mp2_env%bse%screening_method == bse_screening_tdhf .OR. &
327 mp2_env%bse%screening_method == bse_screening_alpha) THEN
328 CALL create_b(fm_mat_s_ia_trunc_arr, fm_mat_s_ia_trunc_arr, fm_b_bse, &
329 homo_red_arr, virt_red_arr, dimen_ri, unit_nr, mp2_env)
330 ELSE
331 CALL create_b(fm_mat_s_ia_trunc_arr, fm_mat_s_bar_ia_bse_arr, fm_b_bse, &
332 homo_red_arr, virt_red_arr, dimen_ri, unit_nr, mp2_env)
333 END IF
334 CALL create_hermitian_form_of_abba(fm_a_bse, fm_b_bse, fm_c_bse, &
335 fm_sqrt_a_minus_b, fm_inv_sqrt_a_minus_b, &
336 unit_nr, mp2_env, diag_runtime_est)
337 END IF
338 CALL cp_fm_release(fm_b_bse)
339
340 NULLIFY (dft_control, tddfpt_control)
341 CALL get_qs_env(qs_env, dft_control=dft_control)
342 tddfpt_control => dft_control%tddfpt2_control
343 IF (my_do_tda .AND. (.NOT. tddfpt_control%do_bse)) THEN
344 CALL diagonalize_a(fm_a_bse, homo_red_arr, virt_red_arr, homo, &
345 unit_nr, diag_runtime_est, mp2_env, qs_env, mo_coeff)
346 END IF
347 CALL cp_fm_release(fm_a_bse)
348 IF (my_do_abba) THEN
349 CALL diagonalize_c(fm_c_bse, homo_red_arr, virt_red_arr, homo, &
350 fm_sqrt_a_minus_b, fm_inv_sqrt_a_minus_b, &
351 unit_nr, diag_runtime_est, mp2_env, qs_env, mo_coeff)
352 END IF
353 CALL cp_fm_release(fm_c_bse)
354 END IF
355
356 CALL deallocate_matrices_bse(fm_mat_s_bar_ia_bse_arr(1), fm_mat_s_bar_ij_bse_arr(1), &
357 fm_mat_s_ia_trunc_arr(1), fm_mat_s_ij_trunc_arr(1), &
358 fm_mat_s_ab_trunc_arr(1), fm_mat_q_static_bse_gemm, mp2_env)
359 DEALLOCATE (eigenval_reduced)
360 IF (my_do_iterat_diag) THEN
361 CALL do_subspace_iterations(b_bar_ijq_bse_local, b_abq_bse_local, b_bar_iaq_bse_local, &
362 b_iaq_bse_local, homo(1), virtual(1), &
363 mp2_env%bse%bse_spin_config, unit_nr, &
364 eigenval(:, 1, 1), para_env, mp2_env)
365 DEALLOCATE (b_bar_ijq_bse_local, b_abq_bse_local, b_bar_iaq_bse_local, b_iaq_bse_local)
366 END IF
367
368 END IF
369
370 DEALLOCATE (homo_red_arr, virt_red_arr)
371 DEALLOCATE (spin_windows)
372 DEALLOCATE (fm_mat_s_ia_trunc_arr, fm_mat_s_ij_trunc_arr, fm_mat_s_ab_trunc_arr)
373 DEALLOCATE (fm_mat_s_bar_ia_bse_arr, fm_mat_s_bar_ij_bse_arr)
374
375 IF (unit_nr > 0) THEN
376 WRITE (unit_nr, '(T2,A4,T7,A53)') 'BSE|', 'The BSE was successfully calculated. Have a nice day!'
377 END IF
378
379 CALL timestop(handle)
380
381 END SUBROUTINE start_bse_calculation
382
383END MODULE bse_main
Routines for the full diagonalization of GW + Bethe-Salpeter for computing electronic excitations.
subroutine, public diagonalize_a(fm_a, homo, virtual, homo_irred, unit_nr, diag_est, mp2_env, qs_env, mo_coeff)
Solving hermitian eigenvalue equation A X^n = Ω^n X^n.
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, qs_env, mo_coeff)
Solving eigenvalue equation C Z^n = (Ω^n)^2 Z^n . Here, the eigenvectors Z^n relate to X^n via Eq....
subroutine, public create_hermitian_form_of_abba(fm_a, fm_b, fm_c, fm_sqrt_a_minus_b, fm_inv_sqrt_a_minus_b, 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....
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_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, qs_env)
Matrix A constructed from GW energies and 3c-B-matrices (cf. subroutine mult_B_with_W) A_ia,...
Iterative routines for GW + Bethe-Salpeter for computing electronic excitations.
subroutine, public do_subspace_iterations(b_bar_ijq_bse_local, b_abq_bse_local, b_bar_iaq_bse_local, b_iaq_bse_local, homo, virtual, bse_spin_config, unit_nr, eigenval, para_env, mp2_env)
...
subroutine, public fill_local_3c_arrays(fm_mat_s_ab_bse, fm_mat_s, fm_mat_s_bar_ia_bse, fm_mat_s_bar_ij_bse, b_bar_ijq_bse_local, b_abq_bse_local, b_bar_iaq_bse_local, b_iaq_bse_local, dimen_ri, homo, virtual, gd_array, color_sub, para_env)
...
Main routines for GW + Bethe-Salpeter for computing electronic excitations.
Definition bse_main.F:14
subroutine, public start_bse_calculation(fm_mat_s_ia_bse, fm_mat_s_ij_bse, fm_mat_s_ab_bse, fm_mat_q_static_bse_gemm, eigenval, eigenval_scf, homo, virtual, dimen_ri, dimen_ri_red, bse_lev_virt, gd_array, color_sub, mp2_env, qs_env, mo_coeff, unit_nr)
Main subroutine managing BSE calculations.
Definition bse_main.F:92
Routines for printing information in context of the BSE calculation.
Definition bse_print.F:13
subroutine, public print_bse_start_flag(bse_tda, bse_abba, unit_nr)
...
Definition bse_print.F:56
Auxiliary routines for GW + Bethe-Salpeter for computing electronic excitations.
Definition bse_util.F:13
subroutine, public estimate_bse_resources(n_ov_joint, unit_nr, bse_abba, para_env, diag_runtime_est)
Roughly estimates the needed runtime and memory during the BSE run.
Definition bse_util.F:965
subroutine, public deallocate_matrices_bse(fm_mat_s_bar_ia_bse, fm_mat_s_bar_ij_bse, fm_mat_s_trunc, fm_mat_s_ij_trunc, fm_mat_s_ab_trunc, fm_mat_q_static_bse_gemm, mp2_env)
...
Definition bse_util.F:766
subroutine, public mult_b_with_w(fm_mat_s_ij_bse, fm_mat_s_ia_bse, fm_mat_s_bar_ia_bse, fm_mat_s_bar_ij_bse, fm_mat_q_static_bse_gemm, dimen_ri, homo, virtual)
Multiplies B-matrix (RI-3c-Integrals) with W (screening) to obtain \bar{B}.
Definition bse_util.F:115
subroutine, public adapt_bse_input_params(homo, virtual, unit_nr, mp2_env, qs_env)
Checks BSE input section and adapts them if necessary.
Definition bse_util.F:1538
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...
Definition bse_util.F:1180
subroutine, public truncate_bse_matrices(fm_mat_s_ia_bse, fm_mat_s_ij_bse, fm_mat_s_ab_bse, fm_mat_s_trunc, fm_mat_s_ij_trunc, fm_mat_s_ab_trunc, eigenval_scf, eigenval, eigenval_reduced, homo, virtual, dimen_ri, unit_nr, bse_lev_virt, homo_red, virt_red, mp2_env, window, print_window)
Determines indices within the given energy cutoffs and truncates Eigenvalues and matrices.
Definition bse_util.F:1225
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
represent a full matrix distributed on many processors
Definition cp_fm_types.F:15
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...
integer, parameter, public debug_print_level
Types to describe group distributions.
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public bse_screening_tdhf
integer, parameter, public bse_iterdiag
integer, parameter, public bse_fulldiag
integer, parameter, public bse_tda
integer, parameter, public bse_both
integer, parameter, public bse_screening_alpha
integer, parameter, public bse_abba
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Interface to the message passing library MPI.
Common selection and union operations for contiguous molecular-orbital windows.
Definition mo_window.F:11
subroutine, public combine_mo_windows(spin_windows, combined_window, windows_differ)
Forms the smallest contiguous window covering all supplied spin windows.
Definition mo_window.F:98
subroutine, public determine_mo_window(eigenvalues, n_mo, n_occ, cutoff_occ, cutoff_empty, window)
Selects one contiguous MO window from an ordered reference spectrum.
Definition mo_window.F:44
Types needed for MP2 calculations.
Definition mp2_types.F:14
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.
represent a full matrix
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment