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