(git:ed6f26b)
Loading...
Searching...
No Matches
rpa_gw_im_time_util.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Utility routines for GW with imaginary time
10!> \par History
11!> 06.2019 split from rpa_im_time.F [Frederick Stein]
12! **************************************************************************************************
14
17 USE cell_types, ONLY: cell_type,&
18 pbc
19 USE cp_dbcsr_api, ONLY: &
25 dbcsr_type, dbcsr_type_no_symmetry
32 USE cp_fm_types, ONLY: cp_fm_create,&
37 USE dbt_api, ONLY: &
38 dbt_contract, dbt_copy, dbt_copy_matrix_to_tensor, dbt_create, dbt_default_distvec, &
39 dbt_destroy, dbt_get_info, dbt_pgrid_create, dbt_pgrid_destroy, dbt_pgrid_type, dbt_type
40 USE hfx_types, ONLY: alloc_containers,&
43 USE kinds, ONLY: dp,&
44 int_8
45 USE mathconstants, ONLY: twopi
56 USE qs_tensors, ONLY: compress_tensor,&
64#include "./base/base_uses.f90"
65
66 IMPLICIT NONE
67
68 PRIVATE
69
70 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'rpa_gw_im_time_util'
71
73
74CONTAINS
75
76! **************************************************************************************************
77!> \brief ...
78!> \param t_3c_overl_int ...
79!> \param t_3c_O_compressed ...
80!> \param t_3c_O_ind ...
81!> \param t_3c_overl_int_ao_mo ...
82!> \param t_3c_O_mo_compressed ...
83!> \param t_3c_O_mo_ind ...
84!> \param t_3c_overl_int_gw_RI ...
85!> \param t_3c_overl_int_gw_AO ...
86!> \param starts_array_mc ...
87!> \param ends_array_mc ...
88!> \param mo_coeff ...
89!> \param matrix_s ...
90!> \param gw_corr_lev_occ ...
91!> \param gw_corr_lev_virt ...
92!> \param homo ...
93!> \param nmo ...
94!> \param para_env ...
95!> \param do_ic_model ...
96!> \param t_3c_overl_nnP_ic ...
97!> \param t_3c_overl_nnP_ic_reflected ...
98!> \param qs_env ...
99!> \param unit_nr ...
100!> \param do_alpha ...
101! **************************************************************************************************
102 SUBROUTINE get_tensor_3c_overl_int_gw(t_3c_overl_int, t_3c_O_compressed, t_3c_O_ind, &
103 t_3c_overl_int_ao_mo, t_3c_O_mo_compressed, t_3c_O_mo_ind, &
104 t_3c_overl_int_gw_RI, t_3c_overl_int_gw_AO, &
105 starts_array_mc, ends_array_mc, &
106 mo_coeff, matrix_s, &
107 gw_corr_lev_occ, gw_corr_lev_virt, homo, nmo, &
108 para_env, &
109 do_ic_model, &
110 t_3c_overl_nnP_ic, t_3c_overl_nnP_ic_reflected, &
111 qs_env, unit_nr, do_alpha)
112
113 TYPE(dbt_type), DIMENSION(:, :) :: t_3c_overl_int
114 TYPE(hfx_compression_type), DIMENSION(:, :, :) :: t_3c_o_compressed
115 TYPE(block_ind_type), DIMENSION(:, :, :) :: t_3c_o_ind
116 TYPE(dbt_type) :: t_3c_overl_int_ao_mo
117 TYPE(hfx_compression_type) :: t_3c_o_mo_compressed
118 INTEGER, ALLOCATABLE, DIMENSION(:, :) :: t_3c_o_mo_ind
119 TYPE(dbt_type) :: t_3c_overl_int_gw_ri, &
120 t_3c_overl_int_gw_ao
121 INTEGER, DIMENSION(:), INTENT(IN) :: starts_array_mc, ends_array_mc
122 TYPE(cp_fm_type), INTENT(IN) :: mo_coeff
123 TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_s
124 INTEGER, INTENT(IN) :: gw_corr_lev_occ, gw_corr_lev_virt, homo, &
125 nmo
126 TYPE(mp_para_env_type), INTENT(IN) :: para_env
127 LOGICAL, INTENT(IN) :: do_ic_model
128 TYPE(dbt_type) :: t_3c_overl_nnp_ic, &
129 t_3c_overl_nnp_ic_reflected
130 TYPE(qs_environment_type), POINTER :: qs_env
131 INTEGER, INTENT(IN) :: unit_nr
132 LOGICAL, INTENT(IN), OPTIONAL :: do_alpha
133
134 CHARACTER(LEN=*), PARAMETER :: routinen = 'get_tensor_3c_overl_int_gw'
135
136 INTEGER :: cut_memory, handle, i_mem, icol_global, imo, irow_global, min_bsize, &
137 min_bsize_mo, nkind, nmo_blk_gw, npcols, nprows, size_mo, unit_nr_prv
138 INTEGER(int_8) :: nze
139 INTEGER, ALLOCATABLE, DIMENSION(:) :: dist1, dist2, dist3, sizes_ao, &
140 sizes_ao_split, sizes_mo, sizes_mo_1, &
141 sizes_ri, sizes_ri_split, tmp
142 INTEGER, DIMENSION(2) :: pdims_2d
143 INTEGER, DIMENSION(2, 1) :: bounds
144 INTEGER, DIMENSION(2, 3) :: ibounds
145 INTEGER, DIMENSION(3) :: bounds_3c, pdims
146 INTEGER, DIMENSION(:), POINTER :: distp_1, distp_2, sizes_mo_blocked, &
147 sizes_mo_p1, sizes_mo_p2
148 LOGICAL :: memory_info, my_do_alpha
149 REAL(dp) :: compression_factor, memory_3c, occ
150 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: norm
151 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
152 TYPE(cp_fm_type) :: fm_mat_mo_coeff_gw
153 TYPE(dbcsr_distribution_type) :: dist, dist_templ
154 TYPE(dbcsr_type) :: mat_mo_coeff_gw_reflected_norm, &
155 mat_norm, mat_norm_diag, mat_work
156 TYPE(dbcsr_type), POINTER :: mat_mo_coeff_gw, &
157 mat_mo_coeff_gw_reflected
158 TYPE(dbt_pgrid_type) :: pgrid_2d, pgrid_ao, pgrid_ic, pgrid_mo
159 TYPE(dbt_type) :: mo_coeff_gw_t, mo_coeff_gw_t_tmp, &
160 t_3c_overl_int_ao_ao, &
161 t_3c_overl_int_mo_ao, &
162 t_3c_overl_int_mo_mo
163 TYPE(gto_basis_set_p_type), DIMENSION(:), POINTER :: basis_set_ao, basis_set_ri_aux
164 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
165 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
166
167 memory_info = qs_env%mp2_env%ri_rpa_im_time%memory_info
168 IF (memory_info) THEN
169 unit_nr_prv = unit_nr
170 ELSE
171 unit_nr_prv = 0
172 END IF
173
174 my_do_alpha = .false.
175 IF (PRESENT(do_alpha)) my_do_alpha = do_alpha
176
177 CALL timeset(routinen, handle)
178
179 CALL get_qs_env(qs_env, nkind=nkind, qs_kind_set=qs_kind_set, particle_set=particle_set, atomic_kind_set=atomic_kind_set)
180
181 CALL cp_fm_create(fm_mat_mo_coeff_gw, mo_coeff%matrix_struct)
182 CALL cp_fm_to_fm(mo_coeff, fm_mat_mo_coeff_gw)
183
184 ! set MO coeffs to zero where
185 DO irow_global = 1, nmo
186 DO icol_global = 1, homo - gw_corr_lev_occ
187 CALL cp_fm_set_element(fm_mat_mo_coeff_gw, irow_global, icol_global, 0.0_dp)
188 END DO
189 DO icol_global = homo + gw_corr_lev_virt + 1, nmo
190 CALL cp_fm_set_element(fm_mat_mo_coeff_gw, irow_global, icol_global, 0.0_dp)
191 END DO
192 END DO
193
194 NULLIFY (mat_mo_coeff_gw)
195 CALL dbcsr_init_p(mat_mo_coeff_gw)
196
197 CALL cp_dbcsr_m_by_n_from_row_template(mat_mo_coeff_gw, template=matrix_s(1)%matrix, n=nmo, &
198 sym=dbcsr_type_no_symmetry)
199
200 CALL copy_fm_to_dbcsr(fm_mat_mo_coeff_gw, &
201 mat_mo_coeff_gw, &
202 keep_sparsity=.false.)
203
204 ! just remove the blocks which have been set to zero
205 CALL dbcsr_filter(mat_mo_coeff_gw, 1.0e-20_dp)
206
207 min_bsize = qs_env%mp2_env%ri_rpa_im_time%min_bsize
208 min_bsize_mo = qs_env%mp2_env%ri_rpa_im_time%min_bsize_mo
209
210 CALL split_block_sizes([gw_corr_lev_occ + gw_corr_lev_virt], sizes_mo, min_bsize_mo)
211 ALLOCATE (sizes_mo_1(nmo))
212 sizes_mo_1(:) = 1
213
214 nmo_blk_gw = SIZE(sizes_mo)
215 CALL move_alloc(sizes_mo, tmp)
216 ALLOCATE (sizes_mo(nmo_blk_gw + 2))
217 sizes_mo(1) = homo - gw_corr_lev_occ
218 sizes_mo(2:SIZE(tmp) + 1) = tmp(:)
219 sizes_mo(SIZE(tmp) + 2) = nmo - (homo + gw_corr_lev_virt)
220
221 ALLOCATE (basis_set_ri_aux(nkind), basis_set_ao(nkind))
222 CALL basis_set_list_setup(basis_set_ri_aux, "RI_AUX", qs_kind_set)
223 CALL get_particle_set(particle_set, qs_kind_set, nsgf=sizes_ri, basis=basis_set_ri_aux)
224 CALL basis_set_list_setup(basis_set_ao, "ORB", qs_kind_set)
225 CALL get_particle_set(particle_set, qs_kind_set, nsgf=sizes_ao, basis=basis_set_ao)
226
227 CALL pgf_block_sizes(atomic_kind_set, basis_set_ao, min_bsize, sizes_ao_split)
228 CALL pgf_block_sizes(atomic_kind_set, basis_set_ri_aux, min_bsize, sizes_ri_split)
229
230 DEALLOCATE (basis_set_ao, basis_set_ri_aux)
231
232 pdims = 0
233 CALL dbt_pgrid_create(para_env, pdims, pgrid_ao, &
234 tensor_dims=[SIZE(sizes_ri_split), SIZE(sizes_ao_split), SIZE(sizes_ao_split)])
235
236 pdims_2d = 0
237 CALL mp_dims_create(para_env%num_pe, pdims_2d)
238
239 ! we iterate over MO blocks for saving memory during contraction, thus we should not parallelize over MO dimension
240 pdims = [pdims_2d(1), pdims_2d(2), 1]
241 CALL dbt_pgrid_create(para_env, pdims, pgrid_mo, &
242 tensor_dims=[SIZE(sizes_ri_split), SIZE(sizes_ao_split), 1])
243
244 pdims_2d = 0
245 CALL dbt_pgrid_create(para_env, pdims_2d, pgrid_2d, &
246 tensor_dims=[SIZE(sizes_ao_split), nmo])
247
248 CALL create_3c_tensor(t_3c_overl_int_ao_ao, dist1, dist2, dist3, pgrid_ao, &
249 sizes_ri_split, sizes_ao_split, sizes_ao_split, [1, 2], [3], name="(RI AO | AO)")
250 DEALLOCATE (dist1, dist2, dist3)
251
252 IF (.NOT. qs_env%mp2_env%ri_g0w0%do_kpoints_Sigma) THEN
253 CALL create_3c_tensor(t_3c_overl_int_ao_mo, dist1, dist2, dist3, pgrid_ao, &
254 sizes_ri_split, sizes_ao_split, sizes_mo_1, [1, 2], [3], name="(RI AO | MO)")
255 DEALLOCATE (dist1, dist2, dist3)
256 END IF
257
258 CALL create_3c_tensor(t_3c_overl_int_gw_ri, dist1, dist2, dist3, pgrid_mo, &
259 sizes_ri_split, sizes_ao_split, sizes_mo, [1], [2, 3], name="(RI | AO MO)")
260 DEALLOCATE (dist1, dist2, dist3)
261
262 CALL create_3c_tensor(t_3c_overl_int_gw_ao, dist1, dist2, dist3, pgrid_mo, &
263 sizes_ao_split, sizes_ri_split, sizes_mo, [1], [2, 3], name="(AO | RI MO)")
264 DEALLOCATE (dist1, dist2, dist3)
265
266 CALL dbt_pgrid_destroy(pgrid_ao)
267 CALL dbt_pgrid_destroy(pgrid_mo)
268
269 CALL create_2c_tensor(mo_coeff_gw_t, dist1, dist2, pgrid_2d, sizes_ao_split, sizes_mo_1, name="(AO|MO)")
270 DEALLOCATE (dist1, dist2)
271 CALL dbt_pgrid_destroy(pgrid_2d)
272
273 CALL dbt_create(mat_mo_coeff_gw, mo_coeff_gw_t_tmp, name="MO coeffs")
274 CALL dbt_copy_matrix_to_tensor(mat_mo_coeff_gw, mo_coeff_gw_t_tmp)
275
276 CALL dbt_copy(mo_coeff_gw_t_tmp, mo_coeff_gw_t)
277
278 bounds(1, 1) = homo - gw_corr_lev_occ + 1
279 bounds(2, 1) = homo + gw_corr_lev_virt
280
281 CALL dbt_get_info(t_3c_overl_int_ao_ao, nfull_total=bounds_3c)
282
283 ibounds(:, 1) = [1, bounds_3c(1)]
284 ibounds(:, 3) = [1, bounds_3c(3)]
285
286 cut_memory = SIZE(starts_array_mc)
287
288 IF (.NOT. qs_env%mp2_env%ri_g0w0%do_kpoints_Sigma) THEN
289 DO i_mem = 1, cut_memory
290 CALL decompress_tensor(t_3c_overl_int(1, 1), t_3c_o_ind(1, 1, i_mem)%ind, t_3c_o_compressed(1, 1, i_mem), &
291 qs_env%mp2_env%ri_rpa_im_time%eps_compress)
292
293 ibounds(:, 2) = [starts_array_mc(i_mem), ends_array_mc(i_mem)]
294
295 CALL dbt_copy(t_3c_overl_int(1, 1), t_3c_overl_int_ao_ao, move_data=.true.)
296
297 CALL dbt_contract(1.0_dp, mo_coeff_gw_t, t_3c_overl_int_ao_ao, 1.0_dp, &
298 t_3c_overl_int_ao_mo, contract_1=[1], notcontract_1=[2], &
299 contract_2=[3], notcontract_2=[1, 2], map_1=[3], map_2=[1, 2], &
300 bounds_2=ibounds, move_data=.false., unit_nr=unit_nr_prv)
301
302 END DO
303 END IF
304
305 CALL cp_fm_release(fm_mat_mo_coeff_gw)
306
307 IF (do_ic_model) THEN
308 pdims = 0
309 CALL dbt_pgrid_create(para_env, pdims, pgrid_ic, &
310 tensor_dims=[SIZE(sizes_ri_split), nmo, nmo])
311
312 CALL create_3c_tensor(t_3c_overl_int_mo_ao, dist1, dist2, dist3, pgrid_ic, &
313 sizes_ri_split, sizes_mo_1, sizes_ao_split, [1, 2], [3], name="(RI MO | AO)")
314 DEALLOCATE (dist1, dist2, dist3)
315 CALL create_3c_tensor(t_3c_overl_int_mo_mo, dist1, dist2, dist3, pgrid_ic, &
316 sizes_ri_split, sizes_mo_1, sizes_mo_1, [1, 2], [3], name="(RI MO | MO)")
317 DEALLOCATE (dist1, dist2, dist3)
318 CALL dbt_create(t_3c_overl_int_mo_mo, t_3c_overl_nnp_ic)
319 CALL create_3c_tensor(t_3c_overl_nnp_ic_reflected, dist1, dist2, dist3, pgrid_ic, &
320 sizes_ri_split, sizes_mo_1, sizes_mo_1, [1], [2, 3], name="(RI | MO MO)")
321 DEALLOCATE (dist1, dist2, dist3)
322
323 CALL dbt_pgrid_destroy(pgrid_ic)
324
325 CALL dbt_copy(t_3c_overl_int_ao_mo, t_3c_overl_int_mo_ao, order=[1, 3, 2])
326 CALL dbt_contract(1.0_dp, mo_coeff_gw_t, t_3c_overl_int_mo_ao, 0.0_dp, &
327 t_3c_overl_int_mo_mo, contract_1=[1], notcontract_1=[2], &
328 contract_2=[3], notcontract_2=[1, 2], map_1=[3], map_2=[1, 2], &
329 bounds_2=bounds, move_data=.false., unit_nr=unit_nr_prv)
330 CALL dbt_copy(t_3c_overl_int_mo_mo, t_3c_overl_nnp_ic)
331
332 NULLIFY (mat_mo_coeff_gw_reflected)
333 CALL dbcsr_init_p(mat_mo_coeff_gw_reflected)
334
335 CALL cp_dbcsr_m_by_n_from_row_template(mat_mo_coeff_gw_reflected, template=matrix_s(1)%matrix, n=nmo, &
336 sym=dbcsr_type_no_symmetry)
337
338 CALL reflect_mat_row(mat_mo_coeff_gw_reflected, mat_mo_coeff_gw, para_env, qs_env, unit_nr, do_alpha=my_do_alpha)
339
340 ! normalize reflected MOs (they are not properly normalized since high angular momentum basis functions
341 ! of the image molecule are not exactly reflected at the image plane (sign problem in p_z function)
342 CALL dbcsr_create(matrix=mat_work, template=mat_mo_coeff_gw_reflected, matrix_type=dbcsr_type_no_symmetry)
343
344 CALL dbcsr_get_info(mat_work, distribution=dist_templ, nblkcols_total=size_mo, col_blk_size=sizes_mo_blocked)
345
346 CALL dbcsr_distribution_get(dist_templ, nprows=nprows, npcols=npcols)
347
348 ALLOCATE (distp_1(size_mo), distp_2(size_mo))
349 CALL dbt_default_distvec(size_mo, nprows, sizes_mo_blocked, distp_1)
350 CALL dbt_default_distvec(size_mo, npcols, sizes_mo_blocked, distp_2)
351 CALL dbcsr_distribution_new(dist, template=dist_templ, row_dist=distp_1, col_dist=distp_2, reuse_arrays=.true.)
352
353 ALLOCATE (sizes_mo_p1(size_mo))
354 ALLOCATE (sizes_mo_p2(size_mo))
355 sizes_mo_p1(:) = sizes_mo_blocked
356 sizes_mo_p2(:) = sizes_mo_blocked
357 CALL dbcsr_create(mat_norm, "mo norm", dist, dbcsr_type_no_symmetry, sizes_mo_p1, sizes_mo_p2, &
358 reuse_arrays=.true.)
360
361 CALL dbcsr_multiply("N", "N", 1.0_dp, matrix_s(1)%matrix, mat_mo_coeff_gw_reflected, 0.0_dp, mat_work)
362 CALL dbcsr_multiply("T", "N", 1.0_dp, mat_mo_coeff_gw_reflected, mat_work, 0.0_dp, mat_norm)
363
364 CALL dbcsr_release(mat_work)
365
366 ALLOCATE (norm(nmo))
367 norm = 0.0_dp
368
369 CALL dbcsr_get_diag(mat_norm, norm)
370 CALL para_env%sum(norm)
371
372 DO imo = bounds(1, 1), bounds(2, 1)
373 norm(imo) = 1.0_dp/sqrt(norm(imo))
374 END DO
375
376 CALL dbcsr_create(mat_norm_diag, template=mat_norm)
377 CALL dbcsr_release(mat_norm)
378
379 CALL dbcsr_add_on_diag(mat_norm_diag, 1.0_dp)
380
381 CALL dbcsr_set_diag(mat_norm_diag, norm)
382
383 CALL dbcsr_create(mat_mo_coeff_gw_reflected_norm, template=mat_mo_coeff_gw_reflected)
384 CALL dbcsr_multiply("N", "N", 1.0_dp, mat_mo_coeff_gw_reflected, mat_norm_diag, 0.0_dp, mat_mo_coeff_gw_reflected_norm)
385 CALL dbcsr_release(mat_norm_diag)
386
387 CALL dbcsr_filter(mat_mo_coeff_gw_reflected_norm, 1.0e-20_dp)
388
389 CALL dbt_copy_matrix_to_tensor(mat_mo_coeff_gw_reflected_norm, mo_coeff_gw_t_tmp)
390 CALL dbcsr_release(mat_mo_coeff_gw_reflected_norm)
391 CALL dbt_copy(mo_coeff_gw_t_tmp, mo_coeff_gw_t)
392
393 CALL dbt_contract(1.0_dp, mo_coeff_gw_t, t_3c_overl_int_ao_ao, 0.0_dp, &
394 t_3c_overl_int_ao_mo, contract_1=[1], notcontract_1=[2], &
395 contract_2=[3], notcontract_2=[1, 2], map_1=[3], map_2=[1, 2], &
396 bounds_2=bounds, move_data=.false., unit_nr=unit_nr_prv)
397
398 CALL dbt_copy(t_3c_overl_int_ao_mo, t_3c_overl_int_mo_ao, order=[1, 3, 2])
399 CALL dbt_contract(1.0_dp, mo_coeff_gw_t, t_3c_overl_int_mo_ao, 0.0_dp, &
400 t_3c_overl_int_mo_mo, contract_1=[1], notcontract_1=[2], &
401 contract_2=[3], notcontract_2=[1, 2], map_1=[3], map_2=[1, 2], &
402 bounds_2=bounds, move_data=.false., unit_nr=unit_nr_prv)
403 CALL dbt_copy(t_3c_overl_int_mo_mo, t_3c_overl_nnp_ic_reflected)
404 CALL dbt_destroy(t_3c_overl_int_mo_ao)
405 CALL dbt_destroy(t_3c_overl_int_mo_mo)
406
407 CALL dbcsr_release_p(mat_mo_coeff_gw_reflected)
408
409 END IF
410
411 IF (.NOT. qs_env%mp2_env%ri_g0w0%do_kpoints_Sigma) THEN
412 CALL alloc_containers(t_3c_o_mo_compressed, 1)
413 CALL get_tensor_occupancy(t_3c_overl_int_ao_mo, nze, occ)
414 memory_3c = 0.0_dp
415
416 CALL compress_tensor(t_3c_overl_int_ao_mo, t_3c_o_mo_ind, t_3c_o_mo_compressed, &
417 qs_env%mp2_env%ri_rpa_im_time%eps_compress, memory_3c)
418
419 CALL para_env%sum(memory_3c)
420 compression_factor = real(nze, dp)*1.0e-06*8.0_dp/memory_3c
421
422 IF (unit_nr > 0) THEN
423 WRITE (unit=unit_nr, fmt="((T3,A,T66,F11.2,A4))") &
424 "MEMORY_INFO| Memory of MO-contracted tensor (compressed):", memory_3c, ' MiB'
425
426 WRITE (unit=unit_nr, fmt="((T3,A,T60,F21.2))") &
427 "MEMORY_INFO| Compression factor: ", compression_factor
428 END IF
429 END IF
430
431 CALL dbcsr_release_p(mat_mo_coeff_gw)
432
433 CALL dbt_destroy(t_3c_overl_int_ao_ao)
434 CALL dbt_destroy(mo_coeff_gw_t)
435 CALL dbt_destroy(mo_coeff_gw_t_tmp)
436
437 CALL timestop(handle)
438
439 END SUBROUTINE
440
441! **************************************************************************************************
442!> \brief reflect from V = (A,B|B,A) to V_reflected = (B,A|A,B) where A belongs to the block of the molecule
443!> and B to the off diagonal block between molecule and image of the molecule
444!> \param mat_reflected ...
445!> \param mat_orig ...
446!> \param para_env ...
447!> \param qs_env ...
448!> \param unit_nr ...
449!> \param do_alpha ...
450! **************************************************************************************************
451 SUBROUTINE reflect_mat_row(mat_reflected, mat_orig, para_env, qs_env, unit_nr, do_alpha)
452 TYPE(dbcsr_type), INTENT(INOUT) :: mat_reflected
453 TYPE(dbcsr_type), INTENT(IN) :: mat_orig
454 TYPE(mp_para_env_type), INTENT(IN) :: para_env
455 TYPE(qs_environment_type), POINTER :: qs_env
456 INTEGER, INTENT(IN) :: unit_nr
457 LOGICAL, INTENT(IN) :: do_alpha
458
459 CHARACTER(LEN=*), PARAMETER :: routinen = 'reflect_mat_row'
460
461 INTEGER :: block, block_size, col, col_rec, col_size, handle, i_atom, i_block, imepos, &
462 j_atom, natom, nblkcols_total, nblkrows_total, offset, row, row_rec, row_reflected, &
463 row_size
464 INTEGER, ALLOCATABLE, DIMENSION(:) :: block_counter, entry_counter, image_atom, &
465 num_blocks_rec, num_blocks_send, num_entries_rec, num_entries_send, sizes_rec, sizes_send
466 INTEGER, DIMENSION(:), POINTER :: col_blk_sizes, row_blk_sizes
467 LOGICAL :: found_image_atom
468 REAL(kind=dp) :: avg_z_dist, delta, eps_dist2, &
469 min_z_dist, ra(3), rb(3), sum_z, &
470 z_reflection
471 REAL(kind=dp), DIMENSION(:, :), POINTER :: data_block
472 TYPE(cell_type), POINTER :: cell
473 TYPE(dbcsr_iterator_type) :: iter
474 TYPE(integ_mat_buffer_type), ALLOCATABLE, &
475 DIMENSION(:) :: buffer_rec, buffer_send
476 TYPE(mp_request_type), DIMENSION(:, :), POINTER :: req_array
477 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
478
479 CALL timeset(routinen, handle)
480
481 CALL dbcsr_reserve_all_blocks(mat_reflected)
482
483 CALL get_qs_env(qs_env, cell=cell, &
484 particle_set=particle_set)
485
486 ! first check, whether we have an image molecule
487 CALL dbcsr_get_info(mat_orig, &
488 nblkrows_total=nblkrows_total, &
489 nblkcols_total=nblkcols_total, &
490 row_blk_size=row_blk_sizes, &
491 col_blk_size=col_blk_sizes)
492
493 natom = SIZE(particle_set)
494 cpassert(natom == nblkrows_total)
495
496 eps_dist2 = qs_env%mp2_env%ri_g0w0%eps_dist
497 eps_dist2 = eps_dist2*eps_dist2
498
499 sum_z = 0.0_dp
500
501 DO i_atom = 1, natom
502
503 ra(:) = pbc(particle_set(i_atom)%r, cell)
504
505 sum_z = sum_z + ra(3)
506
507 END DO
508
509 z_reflection = sum_z/real(natom, kind=dp)
510
511 sum_z = 0.0_dp
512
513 DO i_atom = 1, natom
514
515 ra(:) = pbc(particle_set(i_atom)%r, cell)
516
517 sum_z = sum_z + abs(ra(3) - z_reflection)
518
519 END DO
520
521 avg_z_dist = sum_z/real(natom, kind=dp)
522
523 min_z_dist = avg_z_dist
524
525 DO i_atom = 1, natom
526
527 ra(:) = pbc(particle_set(i_atom)%r, cell)
528
529 IF (abs(ra(3) - z_reflection) < min_z_dist) THEN
530 min_z_dist = abs(ra(3) - z_reflection)
531 END IF
532
533 END DO
534
535 IF (unit_nr > 0 .AND. do_alpha) THEN
536 WRITE (unit_nr, '(T3,A,T70,F9.2,A2)') 'IC_MODEL| Average distance of the molecule to the image plane:', &
537 avg_z_dist*0.529_dp, ' A'
538 WRITE (unit_nr, '(T3,A,T70,F9.2,A2)') 'IC_MODEL| Minimum distance of the molecule to the image plane:', &
539 min_z_dist*0.529_dp, ' A'
540 END IF
541
542 ALLOCATE (image_atom(nblkrows_total))
543 image_atom = 0
544
545 DO i_atom = 1, natom
546
547 found_image_atom = .false.
548
549 ra(:) = pbc(particle_set(i_atom)%r, cell)
550
551 DO j_atom = 1, natom
552
553 rb(:) = pbc(particle_set(j_atom)%r, cell)
554
555 delta = (ra(1) - rb(1))**2 + (ra(2) - rb(2))**2 + (ra(3) + rb(3) - 2.0_dp*z_reflection)**2
556
557 ! SQRT(delta) < eps_dist
558 IF (delta < eps_dist2) THEN
559 ! this CPASSERT ensures that there is at most one image atom for each atom
560 cpassert(.NOT. found_image_atom)
561 image_atom(i_atom) = j_atom
562 found_image_atom = .true.
563 ! check whether we have the same basis at the image atom
564 ! if this is wrong, check whether you have the same basis sets for the molecule and the image
565 cpassert(row_blk_sizes(i_atom) == row_blk_sizes(j_atom))
566 END IF
567
568 END DO
569
570 ! this CPASSERT ensures that there is at least one image atom for each atom
571 cpassert(found_image_atom)
572
573 END DO
574
575 ALLOCATE (buffer_rec(0:para_env%num_pe - 1))
576 ALLOCATE (buffer_send(0:para_env%num_pe - 1))
577
578 ALLOCATE (num_entries_rec(0:para_env%num_pe - 1))
579 ALLOCATE (num_blocks_rec(0:para_env%num_pe - 1))
580 ALLOCATE (num_entries_send(0:para_env%num_pe - 1))
581 ALLOCATE (num_blocks_send(0:para_env%num_pe - 1))
582 num_entries_rec = 0
583 num_blocks_rec = 0
584 num_entries_send = 0
585 num_blocks_send = 0
586
587 CALL dbcsr_iterator_readonly_start(iter, mat_orig)
588 DO WHILE (dbcsr_iterator_blocks_left(iter))
589
590 CALL dbcsr_iterator_next_block(iter, row, col, row_size=row_size, col_size=col_size)
591
592 row_reflected = image_atom(row)
593
594 CALL dbcsr_get_stored_coordinates(mat_reflected, row_reflected, col, imepos)
595
596 num_entries_send(imepos) = num_entries_send(imepos) + row_size*col_size
597 num_blocks_send(imepos) = num_blocks_send(imepos) + 1
598
599 END DO
600
601 CALL dbcsr_iterator_stop(iter)
602
603 IF (para_env%num_pe > 1) THEN
604
605 ALLOCATE (sizes_rec(0:2*para_env%num_pe - 1))
606 ALLOCATE (sizes_send(0:2*para_env%num_pe - 1))
607
608 DO imepos = 0, para_env%num_pe - 1
609
610 sizes_send(2*imepos) = num_entries_send(imepos)
611 sizes_send(2*imepos + 1) = num_blocks_send(imepos)
612
613 END DO
614
615 CALL para_env%alltoall(sizes_send, sizes_rec, 2)
616
617 DO imepos = 0, para_env%num_pe - 1
618 num_entries_rec(imepos) = sizes_rec(2*imepos)
619 num_blocks_rec(imepos) = sizes_rec(2*imepos + 1)
620 END DO
621
622 DEALLOCATE (sizes_rec, sizes_send)
623
624 ELSE
625
626 num_entries_rec(0) = num_entries_send(0)
627 num_blocks_rec(0) = num_blocks_send(0)
628
629 END IF
630
631 ! allocate data message and corresponding indices
632 DO imepos = 0, para_env%num_pe - 1
633
634 ALLOCATE (buffer_rec(imepos)%msg(num_entries_rec(imepos)))
635 buffer_rec(imepos)%msg = 0.0_dp
636
637 ALLOCATE (buffer_send(imepos)%msg(num_entries_send(imepos)))
638 buffer_send(imepos)%msg = 0.0_dp
639
640 ALLOCATE (buffer_rec(imepos)%indx(num_blocks_rec(imepos), 3))
641 buffer_rec(imepos)%indx = 0
642
643 ALLOCATE (buffer_send(imepos)%indx(num_blocks_send(imepos), 3))
644 buffer_send(imepos)%indx = 0
645
646 END DO
647
648 ALLOCATE (block_counter(0:para_env%num_pe - 1))
649 block_counter(:) = 0
650
651 ALLOCATE (entry_counter(0:para_env%num_pe - 1))
652 entry_counter(:) = 0
653
654 CALL dbcsr_iterator_readonly_start(iter, mat_orig)
655 DO WHILE (dbcsr_iterator_blocks_left(iter))
656
657 CALL dbcsr_iterator_next_block(iter, row, col, data_block, &
658 row_size=row_size, col_size=col_size)
659
660 row_reflected = image_atom(row)
661
662 CALL dbcsr_get_stored_coordinates(mat_reflected, row_reflected, col, imepos)
663
664 block_size = row_size*col_size
665
666 offset = entry_counter(imepos)
667
668 buffer_send(imepos)%msg(offset + 1:offset + block_size) = &
669 reshape(data_block(1:row_size, 1:col_size), (/block_size/))
670
671 block = block_counter(imepos) + 1
672
673 buffer_send(imepos)%indx(block, 1) = row_reflected
674 buffer_send(imepos)%indx(block, 2) = col
675 buffer_send(imepos)%indx(block, 3) = offset
676
677 entry_counter(imepos) = entry_counter(imepos) + block_size
678
679 block_counter(imepos) = block_counter(imepos) + 1
680
681 END DO
682
683 CALL dbcsr_iterator_stop(iter)
684
685 ALLOCATE (req_array(1:para_env%num_pe, 4))
686
687 CALL communicate_buffer(para_env, num_entries_rec, num_entries_send, buffer_rec, buffer_send, req_array)
688
689 DEALLOCATE (req_array)
690
691 ! fill the reflected matrix
692 DO imepos = 0, para_env%num_pe - 1
693
694 DO i_block = 1, num_blocks_rec(imepos)
695
696 row_rec = buffer_rec(imepos)%indx(i_block, 1)
697 col_rec = buffer_rec(imepos)%indx(i_block, 2)
698
699 CALL dbcsr_iterator_start(iter, mat_reflected)
700 DO WHILE (dbcsr_iterator_blocks_left(iter))
701
702 CALL dbcsr_iterator_next_block(iter, row, col, data_block, &
703 row_size=row_size, col_size=col_size)
704
705 IF (row_rec == row .AND. col_rec == col) THEN
706
707 offset = buffer_rec(imepos)%indx(i_block, 3)
708
709 data_block(:, :) = reshape(buffer_rec(imepos)%msg(offset + 1:offset + row_size*col_size), &
710 (/row_size, col_size/))
711
712 END IF
713
714 END DO
715
716 CALL dbcsr_iterator_stop(iter)
717
718 END DO
719
720 END DO
721
722 DO imepos = 0, para_env%num_pe - 1
723 DEALLOCATE (buffer_rec(imepos)%msg)
724 DEALLOCATE (buffer_rec(imepos)%indx)
725 DEALLOCATE (buffer_send(imepos)%msg)
726 DEALLOCATE (buffer_send(imepos)%indx)
727 END DO
728
729 DEALLOCATE (buffer_rec, buffer_send)
730 DEALLOCATE (block_counter, entry_counter)
731 DEALLOCATE (num_entries_rec)
732 DEALLOCATE (num_blocks_rec)
733 DEALLOCATE (num_entries_send)
734 DEALLOCATE (num_blocks_send)
735
736 CALL timestop(handle)
737
738 END SUBROUTINE
739
740! **************************************************************************************************
741!> \brief ...
742!> \param qs_env ...
743!> \param atom_from_basis_index ...
744!> \param basis_size ...
745!> \param basis_type ...
746!> \param first_bf_from_atom ...
747! **************************************************************************************************
748 SUBROUTINE get_atom_index_from_basis_function_index(qs_env, atom_from_basis_index, basis_size, &
749 basis_type, first_bf_from_atom)
750 TYPE(qs_environment_type), POINTER :: qs_env
751 INTEGER, ALLOCATABLE, DIMENSION(:) :: atom_from_basis_index
752 INTEGER :: basis_size
753 CHARACTER(LEN=*) :: basis_type
754 INTEGER, ALLOCATABLE, DIMENSION(:), OPTIONAL :: first_bf_from_atom
755
756 INTEGER :: iatom, lll, natom, nkind
757 INTEGER, DIMENSION(:), POINTER :: row_blk_end, row_blk_start
758 TYPE(gto_basis_set_p_type), DIMENSION(:), POINTER :: basis_set
759 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
760 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
761
762 NULLIFY (qs_kind_set, particle_set)
763 CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set, natom=natom, nkind=nkind, &
764 particle_set=particle_set)
765
766 ALLOCATE (row_blk_start(natom))
767 ALLOCATE (row_blk_end(natom))
768 ALLOCATE (basis_set(nkind))
769 CALL basis_set_list_setup(basis_set, basis_type, qs_kind_set)
770 CALL get_particle_set(particle_set, qs_kind_set, first_sgf=row_blk_start, last_sgf=row_blk_end, &
771 basis=basis_set)
772 DO lll = 1, basis_size
773 DO iatom = 1, natom
774 IF (lll >= row_blk_start(iatom) .AND. lll <= row_blk_end(iatom)) THEN
775 atom_from_basis_index(lll) = iatom
776 END IF
777 END DO
778 END DO
779
780 IF (PRESENT(first_bf_from_atom)) first_bf_from_atom(1:natom) = row_blk_start(:)
781
782 DEALLOCATE (basis_set)
783 DEALLOCATE (row_blk_start)
784 DEALLOCATE (row_blk_end)
785
787
788! **************************************************************************************************
789!> \brief ...
790!> \param weight_re ...
791!> \param weight_im ...
792!> \param num_cells ...
793!> \param iatom ...
794!> \param jatom ...
795!> \param xkp ...
796!> \param wkp_W ...
797!> \param cell ...
798!> \param index_to_cell ...
799!> \param hmat ...
800!> \param particle_set ...
801! **************************************************************************************************
802 SUBROUTINE compute_weight_re_im(weight_re, weight_im, &
803 num_cells, iatom, jatom, xkp, wkp_W, &
804 cell, index_to_cell, hmat, particle_set)
805
806 REAL(kind=dp) :: weight_re, weight_im
807 INTEGER :: num_cells, iatom, jatom
808 REAL(kind=dp), DIMENSION(3) :: xkp
809 REAL(kind=dp) :: wkp_w
810 TYPE(cell_type), POINTER :: cell
811 INTEGER, DIMENSION(:, :), POINTER :: index_to_cell
812 REAL(kind=dp), DIMENSION(3, 3) :: hmat
813 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
814
815 CHARACTER(LEN=*), PARAMETER :: routinen = 'compute_weight_re_im'
816
817 INTEGER :: handle, icell, n_equidistant_cells, &
818 xcell, ycell, zcell
819 REAL(kind=dp) :: abs_rab_cell, abs_rab_cell_min, arg
820 REAL(kind=dp), DIMENSION(3) :: cell_vector, rab_cell_i
821
822 CALL timeset(routinen, handle)
823
824 weight_re = 0.0_dp
825 weight_im = 0.0_dp
826
827 abs_rab_cell_min = 1.0e10_dp
828
829 n_equidistant_cells = 0
830
831 DO icell = 1, num_cells
832
833 xcell = index_to_cell(1, icell)
834 ycell = index_to_cell(2, icell)
835 zcell = index_to_cell(3, icell)
836
837 cell_vector(1:3) = matmul(hmat, real((/xcell, ycell, zcell/), dp))
838
839 rab_cell_i(1:3) = pbc(particle_set(iatom)%r(1:3), cell) - &
840 (pbc(particle_set(jatom)%r(1:3), cell) + cell_vector(1:3))
841
842 abs_rab_cell = sqrt(rab_cell_i(1)**2 + rab_cell_i(2)**2 + rab_cell_i(3)**2)
843
844 IF (abs_rab_cell < abs_rab_cell_min) THEN
845 abs_rab_cell_min = abs_rab_cell
846 END IF
847
848 END DO
849
850 DO icell = 1, num_cells
851
852 xcell = index_to_cell(1, icell)
853 ycell = index_to_cell(2, icell)
854 zcell = index_to_cell(3, icell)
855
856 cell_vector(1:3) = matmul(hmat, real((/xcell, ycell, zcell/), dp))
857
858 rab_cell_i(1:3) = pbc(particle_set(iatom)%r(1:3), cell) - &
859 (pbc(particle_set(jatom)%r(1:3), cell) + cell_vector(1:3))
860
861 abs_rab_cell = sqrt(rab_cell_i(1)**2 + rab_cell_i(2)**2 + rab_cell_i(3)**2)
862
863 IF (abs_rab_cell < abs_rab_cell_min + 0.1_dp) THEN
864
865 arg = real(xcell, dp)*xkp(1) + real(ycell, dp)*xkp(2) + real(zcell, dp)*xkp(3)
866
867 weight_re = weight_re + wkp_w*cos(twopi*arg)
868 weight_im = weight_im + wkp_w*sin(twopi*arg)
869
870 n_equidistant_cells = n_equidistant_cells + 1
871
872 END IF
873
874 END DO
875
876 weight_re = weight_re/real(n_equidistant_cells, kind=dp)
877 weight_im = weight_im/real(n_equidistant_cells, kind=dp)
878
879 CALL timestop(handle)
880
881 END SUBROUTINE compute_weight_re_im
882
883END MODULE rpa_gw_im_time_util
Define the atomic kind types and their sub types.
Handles all functions related to the CELL.
Definition cell_types.F:15
subroutine, public dbcsr_distribution_release(dist)
...
subroutine, public dbcsr_release_p(matrix)
...
subroutine, public dbcsr_distribution_new(dist, template, group, pgrid, row_dist, col_dist, reuse_arrays)
...
subroutine, public dbcsr_iterator_next_block(iterator, row, column, block, block_number_argument_has_been_removed, row_size, col_size, row_offset, col_offset)
...
logical function, public dbcsr_iterator_blocks_left(iterator)
...
subroutine, public dbcsr_iterator_stop(iterator)
...
subroutine, public dbcsr_multiply(transa, transb, alpha, matrix_a, matrix_b, beta, matrix_c, first_row, last_row, first_column, last_column, first_k, last_k, retain_sparsity, filter_eps, flop)
...
subroutine, public dbcsr_get_info(matrix, nblkrows_total, nblkcols_total, nfullrows_total, nfullcols_total, nblkrows_local, nblkcols_local, nfullrows_local, nfullcols_local, my_prow, my_pcol, local_rows, local_cols, proc_row_dist, proc_col_dist, row_blk_size, col_blk_size, row_blk_offset, col_blk_offset, distribution, name, matrix_type, group)
...
subroutine, public dbcsr_get_stored_coordinates(matrix, row, column, processor)
...
subroutine, public dbcsr_init_p(matrix)
...
subroutine, public dbcsr_filter(matrix, eps)
...
subroutine, public dbcsr_iterator_start(iterator, matrix, shared, dynamic, dynamic_byrows)
...
subroutine, public dbcsr_release(matrix)
...
subroutine, public dbcsr_iterator_readonly_start(iterator, matrix, shared, dynamic, dynamic_byrows)
Like dbcsr_iterator_start() but with matrix being INTENT(IN). When invoking this routine,...
subroutine, public dbcsr_distribution_get(dist, row_dist, col_dist, nrows, ncols, has_threads, group, mynode, numnodes, nprows, npcols, myprow, mypcol, pgrid, subgroups_defined, prow_group, pcol_group)
...
subroutine, public dbcsr_set_diag(matrix, diag)
Copies the diagonal elements from the given array into the given matrix.
subroutine, public dbcsr_get_diag(matrix, diag)
Copies the diagonal elements from the given matrix into the given array.
subroutine, public dbcsr_add_on_diag(matrix, alpha)
Adds the given scalar to the diagonal of the matrix. Reserves any missing diagonal blocks.
subroutine, public dbcsr_reserve_all_blocks(matrix)
Reserves all blocks.
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_m_by_n_from_row_template(matrix, template, n, sym)
Utility function to create dbcsr matrix, m x n matrix (n arbitrary) with the same processor grid and ...
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_set_element(matrix, irow_global, icol_global, alpha)
sets an element of a matrix
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp)
creates a new full matrix with the given structure
This is the start of a dbt_api, all publically needed functions are exported here....
Definition dbt_api.F:17
Types and set/get functions for HFX.
Definition hfx_types.F:15
subroutine, public alloc_containers(data, bin_size)
...
Definition hfx_types.F:2905
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public int_8
Definition kinds.F:54
integer, parameter, public dp
Definition kinds.F:34
Definition of mathematical constants and functions.
real(kind=dp), parameter, public twopi
Interface to the message passing library MPI.
subroutine, public mp_dims_create(nodes, dims)
wrapper to MPI_Dims_create
Types needed for MP2 calculations.
Definition mp2_types.F:14
Define methods related to particle_type.
subroutine, public get_particle_set(particle_set, qs_kind_set, first_sgf, last_sgf, nsgf, nmao, basis)
Get the components of a particle set.
Define the data structure for the particle information.
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, 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, ecoul_1c, rho0_s_rs, rho0_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)
Get the QUICKSTEP environment.
Some utility functions for the calculation of integrals.
subroutine, public basis_set_list_setup(basis_set_list, basis_type, qs_kind_set)
Set up an easy accessible list of the basis sets for all kinds.
Define the quickstep kind type and their sub types.
Utility methods to build 3-center integral tensors of various types.
subroutine, public create_2c_tensor(t2c, dist_1, dist_2, pgrid, sizes_1, sizes_2, order, name)
...
subroutine, public split_block_sizes(blk_sizes, blk_sizes_split, max_size)
...
subroutine, public pgf_block_sizes(atomic_kind_set, basis, min_blk_size, pgf_blk_sizes)
...
subroutine, public create_3c_tensor(t3c, dist_1, dist_2, dist_3, pgrid, sizes_1, sizes_2, sizes_3, map1, map2, name)
...
Utility methods to build 3-center integral tensors of various types.
Definition qs_tensors.F:11
subroutine, public compress_tensor(tensor, blk_indices, compressed, eps, memory)
...
subroutine, public decompress_tensor(tensor, blk_indices, compressed, eps)
...
subroutine, public get_tensor_occupancy(tensor, nze, occ)
...
Auxiliary routines necessary to redistribute an fm_matrix from a given blacs_env to another.
subroutine, public communicate_buffer(para_env, num_entries_rec, num_entries_send, buffer_rec, buffer_send, req_array, do_indx, do_msg)
...
Utility routines for GW with imaginary time.
subroutine, public compute_weight_re_im(weight_re, weight_im, num_cells, iatom, jatom, xkp, wkp_w, cell, index_to_cell, hmat, particle_set)
...
subroutine, public get_tensor_3c_overl_int_gw(t_3c_overl_int, t_3c_o_compressed, t_3c_o_ind, t_3c_overl_int_ao_mo, t_3c_o_mo_compressed, t_3c_o_mo_ind, t_3c_overl_int_gw_ri, t_3c_overl_int_gw_ao, starts_array_mc, ends_array_mc, mo_coeff, matrix_s, gw_corr_lev_occ, gw_corr_lev_virt, homo, nmo, para_env, do_ic_model, t_3c_overl_nnp_ic, t_3c_overl_nnp_ic_reflected, qs_env, unit_nr, do_alpha)
...
subroutine, public get_atom_index_from_basis_function_index(qs_env, atom_from_basis_index, basis_size, basis_type, first_bf_from_atom)
...
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
Definition cell_types.F:55
represent a full matrix
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.