(git:6344619)
Loading...
Searching...
No Matches
gw_ri_rs_chi_sigma_kernels.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 Shared RI-RS polarizability and self-energy assembly.
10! **************************************************************************************************
12 USE cp_dbcsr_api, ONLY: dbcsr_create,&
19 dbcsr_type_no_symmetry
22 USE cp_fm_types, ONLY: cp_fm_create,&
26 USE gw_utils, ONLY: g_occ_vir
27 USE kinds, ONLY: dp
28 USE machine, ONLY: m_flush,&
38#include "./base/base_uses.f90"
39
40 IMPLICIT NONE
41 PRIVATE
42 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'gw_ri_rs_chi_sigma_kernels'
44CONTAINS
45
46! **************************************************************************************************
47!> \brief Computes χ_PQ(iτ) from the occupied and virtual Green's functions.
48!> \param bs_env ...
49!> \param mat_chi_Gamma_tau Response matrices χ_PQ(iτ) to be computed
50!> \param cutoff grid-centroid distance cutoff; zero disables geometric truncation
51! **************************************************************************************************
52 SUBROUTINE get_mat_chi_gamma_tau(bs_env, mat_chi_Gamma_tau, cutoff)
53
54 TYPE(post_scf_bandstructure_type), POINTER :: bs_env
55 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: mat_chi_gamma_tau
56 REAL(kind=dp), INTENT(IN) :: cutoff
57
58 CHARACTER(LEN=*), PARAMETER :: routinen = 'get_mat_chi_Gamma_tau'
59
60 INTEGER :: handle, i_t, ispin, n_panels
61 INTEGER, ALLOCATABLE, DIMENSION(:) :: pan_first, pan_last
62 REAL(kind=dp) :: first_grid_occ, t1, tau
63 TYPE(dbcsr_type) :: matrix_g_occ_ao(1), matrix_g_vir_ao
64
65 CALL timeset(routinen, handle)
66
67 ! Panel boundaries for the grid-streaming contraction.
68 ! The panels are identical for χ, Σ^x and Σ^c, so the count is reported once here for all three stages.
69
70 CALL resolve_grid_panels(bs_env%ri_rs, bs_env%para_env, bs_env%dbcsr_msg_elem_limit, &
71 pan_first, pan_last, cutoff)
72
73 n_panels = SIZE(pan_first)
74 IF (bs_env%unit_nr > 0) THEN
75 WRITE (bs_env%unit_nr, '(T2,A,T74,I9)') &
76 'Number of batches for χ, Σ matrices', n_panels
77 WRITE (bs_env%unit_nr, '(A)') ' '
78 CALL m_flush(bs_env%unit_nr)
79 END IF
80
81 ! =========================================================================
82 ! IMAGINARY TIME LOOP
83 ! χ_PQ(iτ) = Σ_s g_s · Z^T ( (ϕ G^occ_s ϕ^T) ∘ (ϕ G^vir_s ϕ^T) ) Z
84 ! (g_s = spin degeneracy)
85 ! =========================================================================
86 DO i_t = 1, bs_env%num_time_freq_points
87 t1 = m_walltime()
88 tau = bs_env%time_frequency_grid%imaginary_time(i_t)
89
90 DO ispin = 1, bs_env%n_spin
91
92 ! AO-space Green's functions G^occ_µν, G^vir_µν (dense AO x AO, small)
93 CALL build_g_ao(bs_env, tau, ispin, .true., .false., &
94 bs_env%ri_rs%mat_phi_mu_l, matrix_g_occ_ao(1))
95 CALL build_g_ao(bs_env, tau, ispin, .false., .true., &
96 bs_env%ri_rs%mat_phi_mu_l, matrix_g_vir_ao)
97
98 ! χ_PQ += g_s · Z^T ( (ϕ G^occ ϕ^T) ∘ (ϕ G^vir ϕ^T) ) Z
99 IF (i_t == 1) THEN
100 CALL contract_grid_panels(l_a=bs_env%ri_rs%mat_phi_mu_l, m_a=matrix_g_occ_ao, &
101 l_b=bs_env%ri_rs%mat_phi_mu_l, m_b=matrix_g_vir_ao, &
102 l_out=bs_env%ri_rs%mat_Z_lP, mat_out=mat_chi_gamma_tau(i_t:i_t), &
103 scale=bs_env%spin_degeneracy, eps=bs_env%eps_filter, &
104 para_env=bs_env%para_env, &
105 pan_first=pan_first, pan_last=pan_last, &
106 lb_eq_la=.true., lout_eq_la=.false., &
107 zero_out=(ispin == 1), &
108 centroids=bs_env%ri_rs%chunk_centroids, &
109 cutoff=cutoff, grid_occupation=first_grid_occ)
110 ELSE
111 CALL contract_grid_panels(l_a=bs_env%ri_rs%mat_phi_mu_l, m_a=matrix_g_occ_ao, &
112 l_b=bs_env%ri_rs%mat_phi_mu_l, m_b=matrix_g_vir_ao, &
113 l_out=bs_env%ri_rs%mat_Z_lP, mat_out=mat_chi_gamma_tau(i_t:i_t), &
114 scale=bs_env%spin_degeneracy, eps=bs_env%eps_filter, &
115 para_env=bs_env%para_env, &
116 pan_first=pan_first, pan_last=pan_last, &
117 lb_eq_la=.true., lout_eq_la=.false., &
118 zero_out=(ispin == 1), &
119 centroids=bs_env%ri_rs%chunk_centroids, &
120 cutoff=cutoff)
121 END IF
122
123 CALL dbcsr_release(matrix_g_occ_ao(1))
124 CALL dbcsr_release(matrix_g_vir_ao)
125
126 END DO ! ispin
127
128 ! Sparsity reports
129 IF (i_t == 1) THEN
130 CALL print_matrix_occupation(bs_env%ri_rs%mat_Z_lP, 'Z_lP', bs_env%para_env, bs_env%unit_nr, &
131 bs_env%dbcsr_msg_elem_limit)
132 IF (bs_env%unit_nr > 0) THEN
133 WRITE (bs_env%unit_nr, '(T2,A,T73,F7.2,A)') &
134 'Percentage of non-zero matrix elements in G_ll'', χ_ll'', W_ll''', &
135 first_grid_occ*100.0_dp, ' %'
136 CALL m_flush(bs_env%unit_nr)
137 END IF
138 CALL print_matrix_occupation(mat_chi_gamma_tau(i_t)%matrix, 'χ_PQ', &
139 bs_env%para_env, bs_env%unit_nr, bs_env%dbcsr_msg_elem_limit, &
140 suffix=' for time point 1')
141 IF (bs_env%unit_nr > 0) WRITE (bs_env%unit_nr, '(A)') ' '
142 END IF
143
144 IF (bs_env%unit_nr > 0) THEN
145 WRITE (bs_env%unit_nr, '(T2,A,I13,A,I3,A,F7.1,A)') &
146 'Computed χ(iτ,k=0) for time point', i_t, ' /', bs_env%num_time_freq_points, &
147 ', Execution time', m_walltime() - t1, ' s'
148 END IF
149
150 END DO ! i_t
151
152 IF (bs_env%unit_nr > 0) WRITE (bs_env%unit_nr, '(A)') ' '
153
154 CALL timestop(handle)
155
156 END SUBROUTINE get_mat_chi_gamma_tau
157
158! **************************************************************************************************
159!> \brief Computes the exact-exchange part of the GW self-energy:
160!> D_μν = Σ_n^occ C_μn C_νn (density matrix = G^occ at τ=0)
161!> V^tr_PQ = M^-1 (P|Q)_trunc M^-1 (truncated Coulomb, RI basis)
162!> Σ^x_λσ(k=0) = -Σ_ll' ϕ_λ(r_l) [ (ϕ D ϕ^T)_ll' ∘ (Z V^tr Z^T)_ll' ] ϕ_σ(r_l')
163!> \param bs_env ...
164!> \param qs_env ...
165!> \param fm_Sigma_x_Gamma ...
166!> \param cutoff grid-centroid distance cutoff; zero disables geometric truncation
167! **************************************************************************************************
168 SUBROUTINE compute_sigma_x(bs_env, qs_env, fm_Sigma_x_Gamma, cutoff)
169
170 TYPE(post_scf_bandstructure_type), POINTER :: bs_env
171 TYPE(qs_environment_type), POINTER :: qs_env
172 TYPE(cp_fm_type), ALLOCATABLE, DIMENSION(:) :: fm_sigma_x_gamma
173 REAL(kind=dp), INTENT(IN) :: cutoff
174
175 CHARACTER(LEN=*), PARAMETER :: routinen = 'compute_Sigma_x'
176
177 INTEGER :: handle, ispin
178 INTEGER, ALLOCATABLE, DIMENSION(:) :: pan_first, pan_last
179 REAL(kind=dp) :: t1
180 TYPE(dbcsr_p_type) :: mat_sigma_x_gamma(1)
181 TYPE(dbcsr_type) :: matrix_d_ao(1), matrix_v_aux
182 TYPE(dbcsr_type), TARGET :: matrix_sigma_x
183
184 CALL timeset(routinen, handle)
185
186 t1 = m_walltime()
187
188 ALLOCATE (fm_sigma_x_gamma(bs_env%n_spin))
189 DO ispin = 1, bs_env%n_spin
190 CALL cp_fm_create(fm_sigma_x_gamma(ispin), bs_env%fm_s_Gamma%matrix_struct)
191 END DO
192
193 mat_sigma_x_gamma(1)%matrix => matrix_sigma_x
194 CALL dbcsr_create(matrix_sigma_x, template=bs_env%mat_ao_ao%matrix)
195
196 CALL resolve_grid_panels(bs_env%ri_rs, bs_env%para_env, bs_env%dbcsr_msg_elem_limit, &
197 pan_first, pan_last, cutoff)
198
199 ! =========================================================================
200 ! 1. COMPUTE V^tr_PQ (RI x RI)
201 ! =========================================================================
202 CALL build_ri_rs_bare_aux_interaction(qs_env, bs_env%fm_Minv_Gamma, bs_env%trunc_coulomb, &
203 bs_env%auto_ri, bs_env%ri_rs%mat_Z_lP, matrix_v_aux)
204 CALL dbcsr_filter(matrix_v_aux, bs_env%eps_filter)
205
206 ! =========================================================================
207 ! 2. SPIN LOOP FOR EXACT EXCHANGE
208 ! Σ^x_λσ = -Σ_ll' ϕ_λ(r_l) ( D_ll' V^tr_ll' ) ϕ_σ(r_l')
209 ! = -ϕ^T ( (ϕ D ϕ^T) ∘ (Z V^tr Z^T) ) ϕ
210 ! =========================================================================
211 DO ispin = 1, bs_env%n_spin
212
213 ! AO-space density matrix D_µν = G^occ at τ = 0
214 CALL build_g_ao(bs_env, 0.0_dp, ispin, .true., .false., &
215 bs_env%ri_rs%mat_phi_mu_l, matrix_d_ao(1))
216
217 CALL contract_grid_panels(l_a=bs_env%ri_rs%mat_phi_mu_l, m_a=matrix_d_ao, &
218 l_b=bs_env%ri_rs%mat_Z_lP, m_b=matrix_v_aux, &
219 l_out=bs_env%ri_rs%mat_phi_mu_l, mat_out=mat_sigma_x_gamma, &
220 scale=1.0_dp, eps=bs_env%eps_filter, &
221 para_env=bs_env%para_env, &
222 pan_first=pan_first, pan_last=pan_last, &
223 lb_eq_la=.false., lout_eq_la=.true., zero_out=.true., &
224 centroids=bs_env%ri_rs%chunk_centroids, &
225 cutoff=cutoff)
226 CALL dbcsr_scale(matrix_sigma_x, -1.0_dp)
227
228 CALL dbcsr_release(matrix_d_ao(1))
229
230 ! Data I/O and Export to CP2K Full Matrices
231 CALL copy_dbcsr_to_fm(matrix_sigma_x, fm_sigma_x_gamma(ispin))
232
233 END DO ! ispin
234
235 IF (bs_env%unit_nr > 0) THEN
236 WRITE (bs_env%unit_nr, '(T2,A,T58,A,F7.1,A)') &
237 'Computed Σ^x(k=0),', ' Execution time', m_walltime() - t1, ' s'
238 WRITE (bs_env%unit_nr, '(A)') ' '
239 END IF
240
241 ! =========================================================================
242 ! 3. CLEANUP
243 ! =========================================================================
244 CALL dbcsr_release(matrix_v_aux)
245 CALL dbcsr_release(matrix_sigma_x)
246
247 CALL timestop(handle)
248
249 END SUBROUTINE compute_sigma_x
250
251! **************************************************************************************************
252!> \brief Computes the correlation part of the GW self-energy on the imaginary-time grid:
253!> Σ^c_λσ(iτ<0) = -Σ_ll' ϕ_λ(r_l) [ (ϕ G^occ ϕ^T)_ll' ∘ (Z W^MIC Z^T)_ll' ] ϕ_σ(r_l')
254!> Σ^c_λσ(iτ>0) = +Σ_ll' ϕ_λ(r_l) [ (ϕ G^vir ϕ^T)_ll' ∘ (Z W^MIC Z^T)_ll' ] ϕ_σ(r_l')
255!> \param bs_env ...
256!> \param fm_W_time ...
257!> \param fm_Sigma_c_Gamma_time ...
258!> \param cutoff grid-centroid distance cutoff; zero disables geometric truncation
259!> \param keep_w_and_files keep W and scratch files for another Sigma_c evaluation
260! **************************************************************************************************
261 SUBROUTINE compute_sigma_c(bs_env, fm_W_time, fm_Sigma_c_Gamma_time, cutoff, keep_w_and_files)
262
263 TYPE(post_scf_bandstructure_type), POINTER :: bs_env
264 TYPE(cp_fm_type), ALLOCATABLE, DIMENSION(:) :: fm_w_time
265 TYPE(cp_fm_type), ALLOCATABLE, DIMENSION(:, :, :) :: fm_sigma_c_gamma_time
266 REAL(kind=dp), INTENT(IN) :: cutoff
267 LOGICAL, INTENT(IN), OPTIONAL :: keep_w_and_files
268
269 CHARACTER(LEN=*), PARAMETER :: routinen = 'compute_Sigma_c'
270
271 CHARACTER(LEN=32) :: sigma_label
272 INTEGER :: handle, i_sector, i_t, ispin
273 INTEGER, ALLOCATABLE, DIMENSION(:) :: pan_first, pan_last
274 INTEGER, DIMENSION(:), POINTER :: blk_aux, dist_row_aux
275 LOGICAL :: retain_work
276 REAL(kind=dp) :: t1, tau
277 TYPE(dbcsr_distribution_type) :: dist_aux_aux
278 TYPE(dbcsr_p_type) :: mat_sigma_tau(2)
279 TYPE(dbcsr_type) :: matrix_g_ao(2), matrix_w_aux
280 TYPE(dbcsr_type), TARGET :: matrix_sigma_tau(2)
281
282 CALL timeset(routinen, handle)
283
284 retain_work = .false.
285 IF (PRESENT(keep_w_and_files)) retain_work = keep_w_and_files
286
287 ! =========================================================================
288 ! 1. SETUP AUXILIARY TOPOLOGY AND PRE-ALLOCATE OUTPUT ARRAYS
289 ! =========================================================================
290 CALL setup_square_topology(bs_env%ri_rs%mat_Z_lP, 'COL', dist_aux_aux, blk_aux, dist_row_aux)
291
292 CALL resolve_grid_panels(bs_env%ri_rs, bs_env%para_env, bs_env%dbcsr_msg_elem_limit, &
293 pan_first, pan_last, cutoff)
294
295 ! Only the final FM time array persists; DBCSR outputs are streamed one time/spin at a time.
296 ALLOCATE (fm_sigma_c_gamma_time(bs_env%num_time_freq_points, 2, bs_env%n_spin))
297 DO i_sector = 1, 2
298 mat_sigma_tau(i_sector)%matrix => matrix_sigma_tau(i_sector)
299 END DO
300
301 ! =========================================================================
302 ! 2. IMAGINARY TIME LOOP
303 ! Σ^c_neg_λσ(iτ) = -ϕ^T ( (ϕ G^occ ϕ^T) ∘ (Z W^MIC Z^T) ) ϕ
304 ! Σ^c_pos_λσ(iτ) = ϕ^T ( (ϕ G^vir ϕ^T) ∘ (Z W^MIC Z^T) ) ϕ
305 ! =========================================================================
306 DO i_t = 1, bs_env%num_time_freq_points
307 tau = bs_env%time_frequency_grid%imaginary_time(i_t)
308
309 CALL dbcsr_create(matrix_w_aux, "W_aux", dist_aux_aux, dbcsr_type_no_symmetry, &
310 blk_aux, blk_aux)
311 CALL copy_fm_to_dbcsr(fm_w_time(i_t), matrix_w_aux, keep_sparsity=.false.)
312 CALL dbcsr_filter(matrix_w_aux, bs_env%eps_filter)
313
314 DO ispin = 1, bs_env%n_spin
315 t1 = m_walltime()
316
317 ! AO-space Green's functions G^occ_µν, G^vir_µν (dense AO x AO, small)
318 CALL build_g_ao(bs_env, tau, ispin, .true., .false., &
319 bs_env%ri_rs%mat_phi_mu_l, matrix_g_ao(1))
320 CALL build_g_ao(bs_env, tau, ispin, .false., .true., &
321 bs_env%ri_rs%mat_phi_mu_l, matrix_g_ao(2))
322
323 DO i_sector = 1, 2
324 CALL dbcsr_create(matrix_sigma_tau(i_sector), template=bs_env%mat_ao_ao%matrix)
325 END DO
326
327 ! Σ^c_neg and Σ^c_pos in a single panel loop: W_pan = Z_panel × W × Z^T built once
328 CALL contract_grid_panels(l_a=bs_env%ri_rs%mat_phi_mu_l, m_a=matrix_g_ao, &
329 l_b=bs_env%ri_rs%mat_Z_lP, m_b=matrix_w_aux, &
330 l_out=bs_env%ri_rs%mat_phi_mu_l, &
331 mat_out=mat_sigma_tau, &
332 scale=1.0_dp, eps=bs_env%eps_filter, para_env=bs_env%para_env, &
333 pan_first=pan_first, pan_last=pan_last, &
334 lb_eq_la=.false., lout_eq_la=.true., zero_out=.true., &
335 centroids=bs_env%ri_rs%chunk_centroids, cutoff=cutoff)
336 CALL dbcsr_scale(matrix_sigma_tau(1), -1.0_dp)
337
338 ! FM time sector 1 is positive, sector 2 is negative.
339 DO i_sector = 1, 2
340 CALL dbcsr_release(matrix_g_ao(i_sector))
341 CALL cp_fm_create(fm_sigma_c_gamma_time(i_t, 3 - i_sector, ispin), &
342 bs_env%fm_s_Gamma%matrix_struct)
343 CALL copy_dbcsr_to_fm(matrix_sigma_tau(i_sector), &
344 fm_sigma_c_gamma_time(i_t, 3 - i_sector, ispin))
345 END DO
346
347 ! Report the first-time outputs before releasing the current DBCSR pair.
348 IF (i_t == 1) THEN
349 sigma_label = 'Σ^c'
350 IF (bs_env%n_spin == 2 .AND. ispin == 1) sigma_label = 'Σ^c_α'
351 IF (bs_env%n_spin == 2 .AND. ispin == 2) sigma_label = 'Σ^c_β'
352 CALL print_matrix_occupation(matrix_sigma_tau(2), &
353 trim(sigma_label)//'(iτ)', bs_env%para_env, bs_env%unit_nr, &
354 bs_env%dbcsr_msg_elem_limit, suffix=' for time point 1')
355 CALL print_matrix_occupation(matrix_sigma_tau(1), &
356 trim(sigma_label)//'(-iτ)', bs_env%para_env, bs_env%unit_nr, &
357 bs_env%dbcsr_msg_elem_limit, suffix=' for time point 1')
358 END IF
359 DO i_sector = 1, 2
360 CALL dbcsr_release(matrix_sigma_tau(i_sector))
361 END DO
362
363 IF (bs_env%unit_nr > 0) THEN
364 WRITE (bs_env%unit_nr, '(T2,A,I15,A,I3,A,F7.1,A)') &
365 'Computed Σ^c(iτ) for time point', i_t, ' /', bs_env%num_time_freq_points, &
366 ', Execution time', m_walltime() - t1, ' s'
367 END IF
368
369 END DO ! ispin
370
371 CALL dbcsr_release(matrix_w_aux)
372
373 END DO ! i_t
374
375 ! The DBCSR topology is local to this contraction.
376 CALL release_dbcsr_topology_and_matrices(dist=dist_aux_aux, mapped_dist=dist_row_aux)
377
378 ! The non-periodic evGW0 path keeps these across Sigma_c evaluations.
379 IF (.NOT. retain_work) THEN
380 CALL cp_fm_release(fm_w_time)
381 CALL delete_unnecessary_files(bs_env)
382 END IF
383
384 CALL timestop(handle)
385
386 END SUBROUTINE compute_sigma_c
387
388! **************************************************************************************************
389!> \brief Builds the AO-space Green's function operator G^occ/vir_µν (AO x AO DBCSR)
390!> \param bs_env ...
391!> \param tau ...
392!> \param ispin ...
393!> \param occ ...
394!> \param vir ...
395!> \param template ...
396!> \param matrix_G_ao ...
397! **************************************************************************************************
398 SUBROUTINE build_g_ao(bs_env, tau, ispin, occ, vir, template, matrix_G_ao)
399
400 TYPE(post_scf_bandstructure_type), POINTER :: bs_env
401 REAL(kind=dp), INTENT(IN) :: tau
402 INTEGER, INTENT(IN) :: ispin
403 LOGICAL, INTENT(IN) :: occ, vir
404 TYPE(dbcsr_type), INTENT(INOUT) :: template
405 TYPE(dbcsr_type), INTENT(OUT) :: matrix_g_ao
406
407 CHARACTER(LEN=*), PARAMETER :: routinen = 'build_G_ao'
408
409 INTEGER :: handle
410 INTEGER, DIMENSION(:), POINTER :: blk_ao, dist_row_ao
411 TYPE(cp_fm_type), POINTER :: fm_g
412 TYPE(dbcsr_distribution_type) :: dist_ao_ao
413
414 CALL timeset(routinen, handle)
415
416 IF (occ) THEN
417 fm_g => bs_env%fm_Gocc
418 ELSE
419 fm_g => bs_env%fm_Gvir
420 END IF
421
422 CALL g_occ_vir(bs_env, tau, fm_g, ispin, occ=occ, vir=vir)
423
424 CALL setup_square_topology(template, 'COL', dist_ao_ao, blk_ao, dist_row_ao)
425 CALL dbcsr_create(matrix_g_ao, name="G_ao", dist=dist_ao_ao, &
426 matrix_type=dbcsr_type_no_symmetry, &
427 row_blk_size=blk_ao, col_blk_size=blk_ao)
428
429 CALL copy_fm_to_dbcsr(fm_g, matrix_g_ao, keep_sparsity=.false.)
430 CALL dbcsr_filter(matrix_g_ao, bs_env%eps_filter)
431
432 ! release only the topology; keep matrix_G_ao for the caller
433 CALL release_dbcsr_topology_and_matrices(dist=dist_ao_ao, mapped_dist=dist_row_ao)
434
435 CALL timestop(handle)
436
437 END SUBROUTINE build_g_ao
438
subroutine, public dbcsr_scale(matrix, alpha_scalar)
...
subroutine, public dbcsr_filter(matrix, eps)
...
subroutine, public dbcsr_release(matrix)
...
DBCSR operations in CP2K.
subroutine, public copy_dbcsr_to_fm(matrix, fm, plan, check_plan)
Copy a DBCSR matrix to a BLACS matrix.
subroutine, public copy_fm_to_dbcsr(fm, matrix, keep_sparsity)
Copy a BLACS matrix to a dbcsr matrix.
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
Shared RI-RS polarizability and self-energy assembly.
subroutine, public compute_sigma_c(bs_env, fm_w_time, fm_sigma_c_gamma_time, cutoff, keep_w_and_files)
Computes the correlation part of the GW self-energy on the imaginary-time grid: Σ^c_λσ(iτ<0) = -Σ_ll'...
subroutine, public get_mat_chi_gamma_tau(bs_env, mat_chi_gamma_tau, cutoff)
Computes χ_PQ(iτ) from the occupied and virtual Green's functions.
subroutine, public compute_sigma_x(bs_env, qs_env, fm_sigma_x_gamma, cutoff)
Computes the exact-exchange part of the GW self-energy: D_μν = Σ_n^occ C_μn C_νn (density matrix = G^...
Routines from paper [Graml2024].
subroutine, public delete_unnecessary_files(bs_env)
...
subroutine, public g_occ_vir(bs_env, tau, fm_g_gamma, ispin, occ, vir)
Build the real Gamma occupied or virtual one-particle propagator.
Definition gw_utils.F:3619
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
Machine interface based on Fortran 2003 and POSIX.
Definition machine.F:17
subroutine, public m_flush(lunit)
flushes units if the &GLOBAL flag is set accordingly
Definition machine.F:127
real(kind=dp) function, public m_walltime()
returns time from a real-time clock, protected against rolling early/easily
Definition machine.F:144
DBCSR collocation, layouts and panel contractions for real-space resolution of the identity.
subroutine, public release_dbcsr_topology_and_matrices(dist, mapped_dist, m1, m2, m3, m4)
Releases RI-RS topology mappings and temporary DBCSR matrices.
subroutine, public resolve_grid_panels(ri_rs, para_env, msg_elem_limit, pan_first, pan_last, cutoff)
Resolve and cache grid-panel boundaries for RI-RS streaming contractions.
subroutine, public setup_square_topology(matrix_template, dim_type, square_dist, blk_sizes, mapped_dist)
Creates a square topology from a selected row or column layout.
subroutine, public print_matrix_occupation(matrix, label, para_env, unit_nr, msg_elem_limit, suffix)
Prints the percentage of non-zero elements in a distributed RI-RS matrix.
subroutine, public build_ri_rs_bare_aux_interaction(qs_env, metric_inverse, trunc_coulomb, auto_ri, mat_z_lp, matrix_v_aux)
Build the unfiltered auxiliary interaction M^-1 V^tr M^-1 in the Z-column layout. AUTO_RI uses its al...
subroutine, public contract_grid_panels(l_a, m_a, l_b, m_b, l_out, mat_out, scale, eps, para_env, pan_first, pan_last, lb_eq_la, lout_eq_la, zero_out, centroids, cutoff, grid_occupation)
Projects two operators onto grid panels, takes their Hadamard product, and back-projects it: out += s...
represent a full matrix