(git:f7b9015)
Loading...
Searching...
No Matches
mp2_ri_libint.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 Routines to calculate the 3 and 2 center ERI's needed in the RI
10!> approximation using libint
11!> \par History
12!> 08.2013 created [Mauro Del Ben]
13!> \author Mauro Del Ben
14! **************************************************************************************************
21 USE cell_types, ONLY: cell_type
26 USE cp_files, ONLY: close_file,&
33 USE cp_fm_types, ONLY: cp_fm_create,&
40 USE gamma, ONLY: init_md_ftable
44 USE hfx_types, ONLY: &
46 hfx_pgf_product_list, hfx_potential_type, hfx_screen_coeff_type, hfx_type, log_zero, &
50 USE kinds, ONLY: dp,&
51 int_8
53 USE mp2_types, ONLY: init_tshpsc_lmax,&
55 mp2_type,&
57 USE orbital_pointers, ONLY: nco,&
58 ncoset,&
59 nso
63 USE qs_kind_types, ONLY: get_qs_kind,&
66 USE t_sh_p_s_c, ONLY: free_c0,&
67 init
68#include "./base/base_uses.f90"
69
70 IMPLICIT NONE
71 PRIVATE
72
74
75 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'mp2_ri_libint'
76
77!***
78
79CONTAINS
80
81! **************************************************************************************************
82!> \brief ...
83!> \param dimen ...
84!> \param RI_dimen ...
85!> \param occupied ...
86!> \param natom ...
87!> \param mp2_biel ...
88!> \param mp2_env ...
89!> \param C ...
90!> \param kind_of ...
91!> \param RI_basis_parameter ...
92!> \param RI_basis_info ...
93!> \param basis_S0 ...
94!> \param RI_index_table ...
95!> \param qs_env ...
96!> \param para_env ...
97!> \param Lai ...
98! **************************************************************************************************
99 SUBROUTINE libint_ri_mp2(dimen, RI_dimen, occupied, natom, mp2_biel, mp2_env, C, &
100 kind_of, &
101 RI_basis_parameter, RI_basis_info, basis_S0, RI_index_table, &
102 qs_env, para_env, &
103 Lai)
104 INTEGER :: dimen, ri_dimen, occupied, natom
105 TYPE(mp2_biel_type) :: mp2_biel
106 TYPE(mp2_type) :: mp2_env
107 REAL(kind=dp), DIMENSION(dimen, dimen) :: c
108 INTEGER, DIMENSION(:) :: kind_of
109 TYPE(hfx_basis_type), DIMENSION(:), POINTER :: ri_basis_parameter
110 TYPE(hfx_basis_info_type) :: ri_basis_info
111 TYPE(hfx_basis_type), DIMENSION(:), POINTER :: basis_s0
112 INTEGER, ALLOCATABLE, DIMENSION(:, :) :: ri_index_table
113 TYPE(qs_environment_type), POINTER :: qs_env
114 TYPE(mp_para_env_type), POINTER :: para_env
115 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: lai
116
117 CHARACTER(LEN=*), PARAMETER :: routinen = 'libint_ri_mp2'
118
119 INTEGER :: handle, nkind
120
121 CALL timeset(routinen, handle)
122
123 ! Get the RI basis set and store in to a nice form
124 IF (.NOT. (ASSOCIATED(ri_basis_parameter))) THEN
125 IF (ALLOCATED(ri_index_table)) DEALLOCATE (ri_index_table)
126 IF (ASSOCIATED(basis_s0)) DEALLOCATE (basis_s0)
127 CALL read_ri_basis_set(qs_env, ri_basis_parameter, ri_basis_info, &
128 natom, nkind, kind_of, ri_index_table, ri_dimen, &
129 basis_s0)
130 END IF
131
132 CALL calc_lai_libint(mp2_env, qs_env, para_env, &
133 mp2_biel, dimen, c, occupied, &
134 ri_basis_parameter, ri_basis_info, ri_index_table, ri_dimen, basis_s0, &
135 lai)
136
137 CALL timestop(handle)
138
139 END SUBROUTINE libint_ri_mp2
140
141! **************************************************************************************************
142!> \brief Read the auxiliary basis set for RI approxiamtion
143!> \param qs_env ...
144!> \param RI_basis_parameter ...
145!> \param RI_basis_info ...
146!> \param natom ...
147!> \param nkind ...
148!> \param kind_of ...
149!> \param RI_index_table ...
150!> \param RI_dimen ...
151!> \param basis_S0 ...
152!> \par History
153!> 08.2013 created [Mauro Del Ben]
154!> \author Mauro Del Ben
155! **************************************************************************************************
156 SUBROUTINE read_ri_basis_set(qs_env, RI_basis_parameter, RI_basis_info, &
157 natom, nkind, kind_of, RI_index_table, RI_dimen, &
158 basis_S0)
159 TYPE(qs_environment_type), POINTER :: qs_env
160 TYPE(hfx_basis_type), DIMENSION(:), POINTER :: ri_basis_parameter
161 TYPE(hfx_basis_info_type) :: ri_basis_info
162 INTEGER :: natom, nkind
163 INTEGER, DIMENSION(:) :: kind_of
164 INTEGER, ALLOCATABLE, DIMENSION(:, :) :: ri_index_table
165 INTEGER :: ri_dimen
166 TYPE(hfx_basis_type), DIMENSION(:), POINTER :: basis_s0
167
168 INTEGER :: co_counter, counter, i, iatom, ikind, ipgf, iset, j, k, la, max_am_kind, &
169 max_coeff, max_nsgfl, max_pgf, max_pgf_kind, max_set, nl_count, nset, nseta, offset_a, &
170 offset_a1, s_offset_nl_a, sgfa, so_counter
171 INTEGER, DIMENSION(:), POINTER :: la_max, la_min, npgfa, nshell
172 INTEGER, DIMENSION(:, :), POINTER :: first_sgfa, nl_a
173 REAL(dp), DIMENSION(:, :), POINTER :: sphi_a
174 TYPE(gto_basis_set_type), POINTER :: orb_basis_a
175 TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
176 TYPE(qs_kind_type), POINTER :: atom_kind
177
178 NULLIFY (ri_basis_parameter)
179
180 NULLIFY (qs_kind_set)
181 CALL get_qs_env(qs_env=qs_env, qs_kind_set=qs_kind_set)
182
183 nkind = SIZE(qs_kind_set, 1)
184 ALLOCATE (ri_basis_parameter(nkind))
185 ALLOCATE (basis_s0(nkind))
186 max_set = 0
187 DO ikind = 1, nkind
188 NULLIFY (atom_kind)
189 atom_kind => qs_kind_set(ikind)
190 ! here we reset the initial RI basis such that we can
191 ! work with non-normalized auxiliary basis functions
192 CALL get_qs_kind(qs_kind=atom_kind, &
193 basis_set=orb_basis_a, basis_type="RI_AUX")
194 IF (.NOT. (ASSOCIATED(orb_basis_a))) THEN
195 cpabort("Initial RI auxiliary basis not specified.")
196 END IF
197 orb_basis_a%gcc = 1.0_dp
198 orb_basis_a%norm_type = 1
199 CALL init_aux_basis_set(orb_basis_a)
200
201 CALL get_qs_kind_set(qs_kind_set=qs_kind_set, &
202 maxsgf=ri_basis_info%max_sgf, &
203 maxnset=ri_basis_info%max_set, &
204 maxlgto=ri_basis_info%max_am, &
205 basis_type="RI_AUX")
206 CALL get_gto_basis_set(gto_basis_set=orb_basis_a, &
207 lmax=ri_basis_parameter(ikind)%lmax, &
208 lmin=ri_basis_parameter(ikind)%lmin, &
209 npgf=ri_basis_parameter(ikind)%npgf, &
210 nset=ri_basis_parameter(ikind)%nset, &
211 zet=ri_basis_parameter(ikind)%zet, &
212 nsgf_set=ri_basis_parameter(ikind)%nsgf, &
213 first_sgf=ri_basis_parameter(ikind)%first_sgf, &
214 sphi=ri_basis_parameter(ikind)%sphi, &
215 nsgf=ri_basis_parameter(ikind)%nsgf_total, &
216 l=ri_basis_parameter(ikind)%nl, &
217 nshell=ri_basis_parameter(ikind)%nshell, &
218 set_radius=ri_basis_parameter(ikind)%set_radius, &
219 pgf_radius=ri_basis_parameter(ikind)%pgf_radius, &
220 kind_radius=ri_basis_parameter(ikind)%kind_radius)
221
222 max_set = max(max_set, ri_basis_parameter(ikind)%nset)
223
224 basis_s0(ikind)%kind_radius = ri_basis_parameter(ikind)%kind_radius
225 basis_s0(ikind)%nset = 1
226 basis_s0(ikind)%nsgf_total = 1
227 ALLOCATE (basis_s0(ikind)%set_radius(1))
228 basis_s0(ikind)%set_radius(1) = ri_basis_parameter(ikind)%kind_radius
229 ALLOCATE (basis_s0(ikind)%lmax(1))
230 basis_s0(ikind)%lmax(1) = 0
231 ALLOCATE (basis_s0(ikind)%lmin(1))
232 basis_s0(ikind)%lmin(1) = 0
233 ALLOCATE (basis_s0(ikind)%npgf(1))
234 basis_s0(ikind)%npgf(1) = 1
235 ALLOCATE (basis_s0(ikind)%nsgf(1))
236 basis_s0(ikind)%nsgf(1) = 1
237 ALLOCATE (basis_s0(ikind)%nshell(1))
238 basis_s0(ikind)%nshell(1) = 1
239 ALLOCATE (basis_s0(ikind)%pgf_radius(1, 1))
240 basis_s0(ikind)%pgf_radius(1, 1) = ri_basis_parameter(ikind)%kind_radius
241 ALLOCATE (basis_s0(ikind)%sphi(1, 1))
242 basis_s0(ikind)%sphi(1, 1) = 1.0_dp
243 ALLOCATE (basis_s0(ikind)%zet(1, 1))
244 basis_s0(ikind)%zet(1, 1) = 0.0_dp
245 ALLOCATE (basis_s0(ikind)%first_sgf(1, 1))
246 basis_s0(ikind)%first_sgf(1, 1) = 1
247 ALLOCATE (basis_s0(ikind)%nl(1, 1))
248 basis_s0(ikind)%nl(1, 1) = 0
249
250 ALLOCATE (basis_s0(ikind)%nsgfl(0:0, 1))
251 basis_s0(ikind)%nsgfl = 1
252 ALLOCATE (basis_s0(ikind)%sphi_ext(1, 0:0, 1, 1))
253 basis_s0(ikind)%sphi_ext(1, 0, 1, 1) = 1.0_dp
254
255 END DO
256 ri_basis_info%max_set = max_set
257
258 DO ikind = 1, nkind
259 ALLOCATE (ri_basis_parameter(ikind)%nsgfl(0:ri_basis_info%max_am, max_set))
260 ri_basis_parameter(ikind)%nsgfl = 0
261 nset = ri_basis_parameter(ikind)%nset
262 nshell => ri_basis_parameter(ikind)%nshell
263 DO iset = 1, nset
264 DO i = 0, ri_basis_info%max_am
265 nl_count = 0
266 DO j = 1, nshell(iset)
267 IF (ri_basis_parameter(ikind)%nl(j, iset) == i) nl_count = nl_count + 1
268 END DO
269 ri_basis_parameter(ikind)%nsgfl(i, iset) = nl_count
270 END DO
271 END DO
272 END DO
273
274 max_nsgfl = 0
275 max_pgf = 0
276 DO ikind = 1, nkind
277 max_coeff = 0
278 max_am_kind = 0
279 max_pgf_kind = 0
280 npgfa => ri_basis_parameter(ikind)%npgf
281 nseta = ri_basis_parameter(ikind)%nset
282 nl_a => ri_basis_parameter(ikind)%nsgfl
283 la_max => ri_basis_parameter(ikind)%lmax
284 la_min => ri_basis_parameter(ikind)%lmin
285 DO iset = 1, nseta
286 max_pgf_kind = max(max_pgf_kind, npgfa(iset))
287 max_pgf = max(max_pgf, npgfa(iset))
288 DO la = la_min(iset), la_max(iset)
289 max_nsgfl = max(max_nsgfl, nl_a(la, iset))
290 max_coeff = max(max_coeff, nso(la)*nl_a(la, iset)*nco(la))
291 max_am_kind = max(max_am_kind, la)
292 END DO
293 END DO
294 ALLOCATE (ri_basis_parameter(ikind)%sphi_ext(max_coeff, 0:max_am_kind, max_pgf_kind, nseta))
295 ri_basis_parameter(ikind)%sphi_ext = 0.0_dp
296 END DO
297
298 DO ikind = 1, nkind
299 sphi_a => ri_basis_parameter(ikind)%sphi
300 nseta = ri_basis_parameter(ikind)%nset
301 la_max => ri_basis_parameter(ikind)%lmax
302 la_min => ri_basis_parameter(ikind)%lmin
303 npgfa => ri_basis_parameter(ikind)%npgf
304 first_sgfa => ri_basis_parameter(ikind)%first_sgf
305 nl_a => ri_basis_parameter(ikind)%nsgfl
306 DO iset = 1, nseta
307 sgfa = first_sgfa(1, iset)
308 DO ipgf = 1, npgfa(iset)
309 offset_a1 = (ipgf - 1)*ncoset(la_max(iset))
310 s_offset_nl_a = 0
311 DO la = la_min(iset), la_max(iset)
312 offset_a = offset_a1 + ncoset(la - 1)
313 co_counter = 0
314 co_counter = co_counter + 1
315 so_counter = 0
316 DO k = sgfa + s_offset_nl_a, sgfa + s_offset_nl_a + nso(la)*nl_a(la, iset) - 1
317 DO i = offset_a + 1, offset_a + nco(la)
318 so_counter = so_counter + 1
319 ri_basis_parameter(ikind)%sphi_ext(so_counter, la, ipgf, iset) = sphi_a(i, k)
320 END DO
321 END DO
322 s_offset_nl_a = s_offset_nl_a + nso(la)*(nl_a(la, iset))
323 END DO
324 END DO
325 END DO
326 END DO
327
328 ALLOCATE (ri_index_table(natom, max_set))
329 ri_index_table = -huge(0)
330 counter = 0
331 ri_dimen = 0
332 DO iatom = 1, natom
333 ikind = kind_of(iatom)
334 nset = ri_basis_parameter(ikind)%nset
335 DO iset = 1, nset
336 ri_index_table(iatom, iset) = counter + 1
337 counter = counter + ri_basis_parameter(ikind)%nsgf(iset)
338 ri_dimen = ri_dimen + ri_basis_parameter(ikind)%nsgf(iset)
339 END DO
340 END DO
341
342 END SUBROUTINE read_ri_basis_set
343
344! **************************************************************************************************
345!> \brief Release the auxiliary basis set for RI approxiamtion (to be used
346!> only in the case of basis optimization)
347!> \param RI_basis_parameter ...
348!> \param basis_S0 ...
349!> \par History
350!> 08.2013 created [Mauro Del Ben]
351!> \author Mauro Del Ben
352! **************************************************************************************************
353 SUBROUTINE release_ri_basis_set(RI_basis_parameter, basis_S0)
354 TYPE(hfx_basis_type), DIMENSION(:), POINTER :: ri_basis_parameter, basis_s0
355
356 INTEGER :: i
357
358! RI basis
359
360 DO i = 1, SIZE(ri_basis_parameter)
361 DEALLOCATE (ri_basis_parameter(i)%nsgfl)
362 DEALLOCATE (ri_basis_parameter(i)%sphi_ext)
363 END DO
364 DEALLOCATE (ri_basis_parameter)
365
366 ! S0 basis
367 DO i = 1, SIZE(basis_s0)
368 DEALLOCATE (basis_s0(i)%set_radius)
369 DEALLOCATE (basis_s0(i)%lmax)
370 DEALLOCATE (basis_s0(i)%lmin)
371 DEALLOCATE (basis_s0(i)%npgf)
372 DEALLOCATE (basis_s0(i)%nsgf)
373 DEALLOCATE (basis_s0(i)%nshell)
374 DEALLOCATE (basis_s0(i)%pgf_radius)
375 DEALLOCATE (basis_s0(i)%sphi)
376 DEALLOCATE (basis_s0(i)%zet)
377 DEALLOCATE (basis_s0(i)%first_sgf)
378 DEALLOCATE (basis_s0(i)%nl)
379 DEALLOCATE (basis_s0(i)%nsgfl)
380 DEALLOCATE (basis_s0(i)%sphi_ext)
381 END DO
382 DEALLOCATE (basis_s0)
383
384 END SUBROUTINE release_ri_basis_set
385
386! **************************************************************************************************
387!> \brief ...
388!> \param mp2_env ...
389!> \param qs_env ...
390!> \param para_env ...
391!> \param mp2_biel ...
392!> \param dimen ...
393!> \param C ...
394!> \param occupied ...
395!> \param RI_basis_parameter ...
396!> \param RI_basis_info ...
397!> \param RI_index_table ...
398!> \param RI_dimen ...
399!> \param basis_S0 ...
400!> \param Lai ...
401!> \par History
402!> 08.2013 created [Mauro Del Ben]
403!> \author Mauro Del Ben
404! **************************************************************************************************
405 SUBROUTINE calc_lai_libint(mp2_env, qs_env, para_env, &
406 mp2_biel, dimen, C, occupied, &
407 RI_basis_parameter, RI_basis_info, RI_index_table, RI_dimen, basis_S0, &
408 Lai)
409
410 TYPE(mp2_type) :: mp2_env
411 TYPE(qs_environment_type), POINTER :: qs_env
412 TYPE(mp_para_env_type), POINTER :: para_env
413 TYPE(mp2_biel_type) :: mp2_biel
414 INTEGER :: dimen
415 REAL(kind=dp), DIMENSION(dimen, dimen) :: c
416 INTEGER :: occupied
417 TYPE(hfx_basis_type), DIMENSION(:), POINTER :: ri_basis_parameter
418 TYPE(hfx_basis_info_type) :: ri_basis_info
419 INTEGER, ALLOCATABLE, DIMENSION(:, :) :: ri_index_table
420 INTEGER :: ri_dimen
421 TYPE(hfx_basis_type), DIMENSION(:), POINTER :: basis_s0
422 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: lai
423
424 CHARACTER(LEN=*), PARAMETER :: routinen = 'calc_lai_libint'
425
426 INTEGER :: counter_l_blocks, handle, i, i_list_kl, i_set_list_kl, i_set_list_kl_start, &
427 i_set_list_kl_stop, iatom, iatom_end, iatom_start, iib, ikind, info_chol, iset, jatom, &
428 jatom_end, jatom_start, jjb, jkind, jset, katom, katom_end, katom_start, kkb, kkind, &
429 kset, kset_start, l_b_i_end, l_b_i_start, l_b_k_end, l_b_k_start, latom, latom_end, &
430 latom_start, lkind, llb, lset, max_pgf, max_set, natom, ncob, nints, nseta, nsetb, nsetc, &
431 nsetd, nsgf_max, nspins, orb_k_end, orb_k_start, orb_l_end, orb_l_start, &
432 primitive_counter, sphi_a_u1, sphi_a_u2, sphi_a_u3, sphi_b_u1, sphi_b_u2, sphi_b_u3
433 INTEGER :: sphi_c_u1, sphi_c_u2, sphi_c_u3, sphi_d_u1, sphi_d_u2, sphi_d_u3, virtual
434 INTEGER(int_8) :: estimate_to_store_int, neris_tmp, &
435 neris_total, nprim_ints
436 INTEGER, ALLOCATABLE, DIMENSION(:) :: kind_of, nimages
437 INTEGER, DIMENSION(:), POINTER :: la_max, la_min, lb_max, lb_min, lc_max, &
438 lc_min, ld_max, ld_min, npgfa, npgfb, &
439 npgfc, npgfd, nsgfa, nsgfb, nsgfc, &
440 nsgfd
441 INTEGER, DIMENSION(:, :), POINTER :: nsgfl_a, nsgfl_b, nsgfl_c, nsgfl_d
442 LOGICAL :: do_periodic
443 LOGICAL, DIMENSION(:, :), POINTER :: shm_atomic_pair_list
444 REAL(kind=dp) :: cartesian_estimate, coeffs_kind_max0, eps_schwarz, ln_10, &
445 log10_eps_schwarz, log10_pmax, max_contraction_val, pmax_atom, pmax_entry, ra(3), rb(3), &
446 rc(3), rd(3)
447 REAL(kind=dp), ALLOCATABLE, DIMENSION(:) :: ee_buffer1, ee_buffer2, &
448 ee_primitives_tmp, ee_work, ee_work2, &
449 primitive_integrals
450 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: l_block, l_full_matrix, max_contraction
451 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :, :) :: bi1, mnrs
452 REAL(kind=dp), DIMENSION(:, :), POINTER :: shm_pmax_block, zeta, zetb, zetc, zetd
453 REAL(kind=dp), DIMENSION(:, :, :), POINTER :: sphi_a_ext_set, sphi_b_ext_set, &
454 sphi_c_ext_set, sphi_d_ext_set
455 REAL(kind=dp), DIMENSION(:, :, :, :), POINTER :: sphi_a_ext, sphi_b_ext, sphi_c_ext, &
456 sphi_d_ext
457 TYPE(cell_type), POINTER :: cell
458 TYPE(cp_blacs_env_type), POINTER :: blacs_env
459 TYPE(cp_fm_struct_type), POINTER :: fm_struct_l
460 TYPE(cp_fm_type) :: fm_matrix_l
461 TYPE(four_center_integral_context_type) :: private_context
462 TYPE(hfx_basis_type), DIMENSION(:), POINTER :: basis_parameter
463 TYPE(hfx_pgf_list), ALLOCATABLE, DIMENSION(:) :: pgf_list_ij, pgf_list_kl
464 TYPE(hfx_pgf_product_list), ALLOCATABLE, &
465 DIMENSION(:) :: pgf_product_list
466 TYPE(hfx_potential_type) :: mp2_potential_parameter
467 TYPE(hfx_screen_coeff_type), ALLOCATABLE, &
468 DIMENSION(:, :), TARGET :: radii_pgf_large, screen_coeffs_pgf_large
469 TYPE(hfx_screen_coeff_type), DIMENSION(:, :), &
470 POINTER :: screen_coeffs_kind, tmp_r_1, tmp_r_2, &
471 tmp_screen_pgf1, tmp_screen_pgf2
472 TYPE(hfx_screen_coeff_type), &
473 DIMENSION(:, :, :, :), POINTER :: screen_coeffs_set
474 TYPE(hfx_screen_coeff_type), &
475 DIMENSION(:, :, :, :, :, :), POINTER :: radii_pgf, screen_coeffs_pgf
476 TYPE(hfx_type), POINTER :: actual_x_data
477 TYPE(pair_list_type_mp2) :: list_kl
478 TYPE(pair_set_list_type), ALLOCATABLE, &
479 DIMENSION(:) :: set_list_kl
480 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
481
482 CALL timeset(routinen, handle)
483
484 ln_10 = log(10.0_dp)
485
486 !! initialize some counters
487 neris_tmp = 0_int_8
488 neris_total = 0_int_8
489 nprim_ints = 0_int_8
490
491 CALL prepare_integral_calc(cell, qs_env, mp2_env, para_env, mp2_potential_parameter, actual_x_data, &
492 do_periodic, basis_parameter, max_set, particle_set, natom, kind_of, &
493 nsgf_max, primitive_integrals, ee_work, ee_work2, ee_buffer1, ee_buffer2, &
494 ee_primitives_tmp, nspins, max_contraction, max_pgf, pgf_list_ij, &
495 pgf_list_kl, pgf_product_list, nimages, eps_schwarz, log10_eps_schwarz, &
496 private_context, screen_coeffs_set, screen_coeffs_kind, screen_coeffs_pgf, &
497 radii_pgf, ri_basis_parameter, ri_basis_info)
498
499 ALLOCATE (radii_pgf_large(SIZE(radii_pgf, 1), SIZE(radii_pgf, 2)))
500 ALLOCATE (screen_coeffs_pgf_large(SIZE(screen_coeffs_pgf, 1), SIZE(screen_coeffs_pgf, 2)))
501 DO iib = 1, SIZE(radii_pgf, 1)
502 DO jjb = 1, SIZE(radii_pgf, 2)
503 radii_pgf_large(iib, jjb)%x = 100_dp
504 END DO
505 END DO
506 DO iib = 1, SIZE(screen_coeffs_pgf, 1)
507 DO jjb = 1, SIZE(screen_coeffs_pgf, 2)
508 screen_coeffs_pgf_large(iib, jjb)%x = 5000_dp
509 END DO
510 END DO
511 tmp_r_1 => radii_pgf_large(:, :)
512 tmp_r_2 => radii_pgf_large(:, :)
513 tmp_screen_pgf1 => screen_coeffs_pgf_large(:, :)
514 tmp_screen_pgf2 => screen_coeffs_pgf_large(:, :)
515
516 ! start computing the L matrix
517 ALLOCATE (l_full_matrix(ri_dimen, ri_dimen))
518 l_full_matrix = 0.0_dp
519
520 counter_l_blocks = 0
521 DO iatom = 1, natom
522 jatom = iatom
523
524 ikind = kind_of(iatom)
525 jkind = kind_of(jatom)
526 ra = particle_set(iatom)%r(:)
527 rb = particle_set(jatom)%r(:)
528
529 la_max => ri_basis_parameter(ikind)%lmax
530 la_min => ri_basis_parameter(ikind)%lmin
531 npgfa => ri_basis_parameter(ikind)%npgf
532 nseta = ri_basis_parameter(ikind)%nset
533 zeta => ri_basis_parameter(ikind)%zet
534 nsgfa => ri_basis_parameter(ikind)%nsgf
535 sphi_a_ext => ri_basis_parameter(ikind)%sphi_ext(:, :, :, :)
536 nsgfl_a => ri_basis_parameter(ikind)%nsgfl
537 sphi_a_u1 = ubound(sphi_a_ext, 1)
538 sphi_a_u2 = ubound(sphi_a_ext, 2)
539 sphi_a_u3 = ubound(sphi_a_ext, 3)
540
541 lb_max => basis_s0(jkind)%lmax
542 lb_min => basis_s0(jkind)%lmin
543 npgfb => basis_s0(jkind)%npgf
544 nsetb = basis_s0(jkind)%nset
545 zetb => basis_s0(jkind)%zet
546 nsgfb => basis_s0(jkind)%nsgf
547 sphi_b_ext => basis_s0(jkind)%sphi_ext(:, :, :, :)
548 nsgfl_b => basis_s0(jkind)%nsgfl
549 sphi_b_u1 = ubound(sphi_b_ext, 1)
550 sphi_b_u2 = ubound(sphi_b_ext, 2)
551 sphi_b_u3 = ubound(sphi_b_ext, 3)
552
553 DO katom = iatom, natom
554 latom = katom
555
556 kkind = kind_of(katom)
557 lkind = kind_of(latom)
558 rc = particle_set(katom)%r(:)
559 rd = particle_set(latom)%r(:)
560
561 lc_max => ri_basis_parameter(kkind)%lmax
562 lc_min => ri_basis_parameter(kkind)%lmin
563 npgfc => ri_basis_parameter(kkind)%npgf
564 nsetc = ri_basis_parameter(kkind)%nset
565 zetc => ri_basis_parameter(kkind)%zet
566 nsgfc => ri_basis_parameter(kkind)%nsgf
567 sphi_c_ext => ri_basis_parameter(kkind)%sphi_ext(:, :, :, :)
568 nsgfl_c => ri_basis_parameter(kkind)%nsgfl
569 sphi_c_u1 = ubound(sphi_c_ext, 1)
570 sphi_c_u2 = ubound(sphi_c_ext, 2)
571 sphi_c_u3 = ubound(sphi_c_ext, 3)
572
573 ld_max => basis_s0(lkind)%lmax
574 ld_min => basis_s0(lkind)%lmin
575 npgfd => basis_s0(lkind)%npgf
576 nsetd = ri_basis_parameter(lkind)%nset
577 zetd => basis_s0(lkind)%zet
578 nsgfd => basis_s0(lkind)%nsgf
579 sphi_d_ext => basis_s0(lkind)%sphi_ext(:, :, :, :)
580 nsgfl_d => basis_s0(lkind)%nsgfl
581 sphi_d_u1 = ubound(sphi_d_ext, 1)
582 sphi_d_u2 = ubound(sphi_d_ext, 2)
583 sphi_d_u3 = ubound(sphi_d_ext, 3)
584
585 jset = 1
586 lset = 1
587 DO iset = 1, nseta
588
589 ncob = npgfb(jset)*ncoset(lb_max(jset))
590 sphi_a_ext_set => sphi_a_ext(:, :, :, iset)
591 sphi_b_ext_set => sphi_b_ext(:, :, :, jset)
592
593 l_b_i_start = ri_index_table(iatom, iset)
594 l_b_i_end = ri_index_table(iatom, iset) + nsgfa(iset) - 1
595
596 kset_start = 1
597 IF (iatom == katom) kset_start = iset
598 DO kset = kset_start, nsetc
599
600 counter_l_blocks = counter_l_blocks + 1
601 IF (mod(counter_l_blocks, para_env%num_pe) /= para_env%mepos) cycle
602
603 sphi_c_ext_set => sphi_c_ext(:, :, :, kset)
604 sphi_d_ext_set => sphi_d_ext(:, :, :, lset)
605
606 l_b_k_start = ri_index_table(katom, kset)
607 l_b_k_end = ri_index_table(katom, kset) + nsgfc(kset) - 1
608
609 pmax_entry = 0.0_dp
610 log10_pmax = pmax_entry
611 log10_eps_schwarz = log_zero
612
613 max_contraction_val = 1.0000_dp
614
615 ALLOCATE (l_block(nsgfa(iset), nsgfc(kset)))
616
617 CALL coulomb4(private_context, ra, rb, rc, rd, npgfa(iset), npgfb(jset), npgfc(kset), npgfd(lset), &
618 la_min(iset), la_max(iset), lb_min(jset), lb_max(jset), &
619 lc_min(kset), lc_max(kset), ld_min(lset), ld_max(lset), &
620 nsgfa(iset), nsgfb(jset), nsgfc(kset), nsgfd(lset), &
621 sphi_a_u1, sphi_a_u2, sphi_a_u3, &
622 sphi_b_u1, sphi_b_u2, sphi_b_u3, &
623 sphi_c_u1, sphi_c_u2, sphi_c_u3, &
624 sphi_d_u1, sphi_d_u2, sphi_d_u3, &
625 zeta(1:npgfa(iset), iset), zetb(1:npgfb(jset), jset), &
626 zetc(1:npgfc(kset), kset), zetd(1:npgfd(lset), lset), &
627 primitive_integrals, &
628 mp2_potential_parameter, &
629 actual_x_data%neighbor_cells, screen_coeffs_set(1, 1, 1, 1)%x, &
630 screen_coeffs_set(1, 1, 1, 1)%x, eps_schwarz, &
631 max_contraction_val, cartesian_estimate, cell, neris_tmp, &
632 log10_pmax, log10_eps_schwarz, &
633 tmp_r_1, tmp_r_2, tmp_screen_pgf1, tmp_screen_pgf2, &
634 pgf_list_ij, pgf_list_kl, pgf_product_list, &
635 nsgfl_a(:, iset), nsgfl_b(:, jset), &
636 nsgfl_c(:, kset), nsgfl_d(:, lset), &
637 sphi_a_ext_set, &
638 sphi_b_ext_set, &
639 sphi_c_ext_set, &
640 sphi_d_ext_set, &
641 ee_work, ee_work2, ee_buffer1, ee_buffer2, ee_primitives_tmp, &
642 nimages, do_periodic)
643
644 primitive_counter = 0
645 DO llb = 1, nsgfd(lset)
646 DO kkb = 1, nsgfc(kset)
647 DO jjb = 1, nsgfb(jset)
648 DO iib = 1, nsgfa(iset)
649 primitive_counter = primitive_counter + 1
650 l_block(iib, kkb) = primitive_integrals(primitive_counter)
651 END DO
652 END DO
653 END DO
654 END DO
655
656 l_full_matrix(l_b_i_start:l_b_i_end, l_b_k_start:l_b_k_end) = l_block
657 l_full_matrix(l_b_k_start:l_b_k_end, l_b_i_start:l_b_i_end) = transpose(l_block)
658
659 DEALLOCATE (l_block)
660
661 END DO ! kset
662 END DO ! iset
663
664 END DO !katom
665 END DO !iatom
666
667 ! now create a fm_matrix for the L matrix
668 CALL para_env%sum(l_full_matrix)
669
670 ! create a sub blacs_env
671 NULLIFY (blacs_env)
672 CALL cp_blacs_env_create(blacs_env=blacs_env, para_env=para_env)
673
674 NULLIFY (fm_struct_l)
675 CALL cp_fm_struct_create(fm_struct_l, context=blacs_env, nrow_global=ri_dimen, &
676 ncol_global=ri_dimen, para_env=para_env)
677 CALL cp_fm_create(fm_matrix_l, fm_struct_l, name="fm_matrix_L")
678 CALL cp_fm_struct_release(fm_struct_l)
679 CALL cp_blacs_env_release(blacs_env)
680
681 CALL cp_fm_set_submatrix(fm=fm_matrix_l, new_values=l_full_matrix, start_row=1, start_col=1, &
682 n_rows=ri_dimen, n_cols=ri_dimen)
683
684 info_chol = 0
685 CALL cp_fm_cholesky_decompose(matrix=fm_matrix_l, n=ri_dimen, info_out=info_chol)
686 cpassert(info_chol == 0)
687
688 ! triangual invert
689 CALL cp_fm_triangular_invert(matrix_a=fm_matrix_l, uplo_tr='U')
690
691 ! replicate L matrix to each proc
692 l_full_matrix = 0.0_dp
693 CALL cp_fm_get_submatrix(fm_matrix_l, l_full_matrix, 1, 1, ri_dimen, ri_dimen, .false.)
694 CALL cp_fm_release(fm_matrix_l)
695
696 ! clean lower part
697 DO iib = 1, ri_dimen
698 l_full_matrix(iib + 1:ri_dimen, iib) = 0.0_dp
699 END DO
700
701 ALLOCATE (list_kl%elements(natom**2))
702
703 coeffs_kind_max0 = maxval(screen_coeffs_kind(:, :)%x(2))
704 ALLOCATE (set_list_kl((max_set*natom)**2))
705
706 !! precalculate maximum density matrix elements in blocks
707 actual_x_data%pmax_block = 0.0_dp
708 shm_pmax_block => actual_x_data%pmax_block
709
710 shm_atomic_pair_list => actual_x_data%atomic_pair_list
711
712 iatom_start = 1
713 iatom_end = natom
714 jatom_start = 1
715 jatom_end = natom
716 katom_start = 1
717 katom_end = natom
718 latom_start = 1
719 latom_end = natom
720
721 CALL build_pair_list_mp2(natom, list_kl, set_list_kl, katom_start, katom_end, &
722 latom_start, latom_end, &
723 kind_of, basis_parameter, particle_set, &
724 do_periodic, screen_coeffs_set, screen_coeffs_kind, &
725 coeffs_kind_max0, log10_eps_schwarz, cell, 0.d+00, &
726 shm_atomic_pair_list)
727
728 virtual = dimen - occupied
729
730 ALLOCATE (lai(ri_dimen, virtual, occupied))
731 lai = 0.0_dp
732
733 DO iatom = 1, natom
734 jatom = iatom
735
736 ikind = kind_of(iatom)
737 jkind = kind_of(jatom)
738 ra = particle_set(iatom)%r(:)
739 rb = particle_set(jatom)%r(:)
740
741 la_max => ri_basis_parameter(ikind)%lmax
742 la_min => ri_basis_parameter(ikind)%lmin
743 npgfa => ri_basis_parameter(ikind)%npgf
744 nseta = ri_basis_parameter(ikind)%nset
745 zeta => ri_basis_parameter(ikind)%zet
746 nsgfa => ri_basis_parameter(ikind)%nsgf
747 sphi_a_ext => ri_basis_parameter(ikind)%sphi_ext(:, :, :, :)
748 nsgfl_a => ri_basis_parameter(ikind)%nsgfl
749 sphi_a_u1 = ubound(sphi_a_ext, 1)
750 sphi_a_u2 = ubound(sphi_a_ext, 2)
751 sphi_a_u3 = ubound(sphi_a_ext, 3)
752
753 lb_max => basis_s0(jkind)%lmax
754 lb_min => basis_s0(jkind)%lmin
755 npgfb => basis_s0(jkind)%npgf
756 nsetb = basis_s0(jkind)%nset
757 zetb => basis_s0(jkind)%zet
758 nsgfb => basis_s0(jkind)%nsgf
759 sphi_b_ext => basis_s0(jkind)%sphi_ext(:, :, :, :)
760 nsgfl_b => basis_s0(jkind)%nsgfl
761 sphi_b_u1 = ubound(sphi_b_ext, 1)
762 sphi_b_u2 = ubound(sphi_b_ext, 2)
763 sphi_b_u3 = ubound(sphi_b_ext, 3)
764
765 jset = 1
766 DO iset = 1, nseta
767
768 counter_l_blocks = counter_l_blocks + 1
769 IF (mod(counter_l_blocks, para_env%num_pe) /= para_env%mepos) cycle
770
771 ncob = npgfb(jset)*ncoset(lb_max(jset))
772 sphi_a_ext_set => sphi_a_ext(:, :, :, iset)
773 sphi_b_ext_set => sphi_b_ext(:, :, :, jset)
774
775 l_b_i_start = ri_index_table(iatom, iset)
776 l_b_i_end = ri_index_table(iatom, iset) + nsgfa(iset) - 1
777
778 ALLOCATE (bi1(dimen, dimen, nsgfa(iset)))
779 bi1 = 0.0_dp
780
781 DO i_list_kl = 1, list_kl%n_element
782
783 katom = list_kl%elements(i_list_kl)%pair(1)
784 latom = list_kl%elements(i_list_kl)%pair(2)
785
786 i_set_list_kl_start = list_kl%elements(i_list_kl)%set_bounds(1)
787 i_set_list_kl_stop = list_kl%elements(i_list_kl)%set_bounds(2)
788 kkind = list_kl%elements(i_list_kl)%kind_pair(1)
789 lkind = list_kl%elements(i_list_kl)%kind_pair(2)
790 rc = list_kl%elements(i_list_kl)%r1
791 rd = list_kl%elements(i_list_kl)%r2
792
793 pmax_atom = 0.0_dp
794
795 lc_max => basis_parameter(kkind)%lmax
796 lc_min => basis_parameter(kkind)%lmin
797 npgfc => basis_parameter(kkind)%npgf
798 zetc => basis_parameter(kkind)%zet
799 nsgfc => basis_parameter(kkind)%nsgf
800 sphi_c_ext => basis_parameter(kkind)%sphi_ext(:, :, :, :)
801 nsgfl_c => basis_parameter(kkind)%nsgfl
802 sphi_c_u1 = ubound(sphi_c_ext, 1)
803 sphi_c_u2 = ubound(sphi_c_ext, 2)
804 sphi_c_u3 = ubound(sphi_c_ext, 3)
805
806 ld_max => basis_parameter(lkind)%lmax
807 ld_min => basis_parameter(lkind)%lmin
808 npgfd => basis_parameter(lkind)%npgf
809 zetd => basis_parameter(lkind)%zet
810 nsgfd => basis_parameter(lkind)%nsgf
811 sphi_d_ext => basis_parameter(lkind)%sphi_ext(:, :, :, :)
812 nsgfl_d => basis_parameter(lkind)%nsgfl
813 sphi_d_u1 = ubound(sphi_d_ext, 1)
814 sphi_d_u2 = ubound(sphi_d_ext, 2)
815 sphi_d_u3 = ubound(sphi_d_ext, 3)
816
817 DO i_set_list_kl = i_set_list_kl_start, i_set_list_kl_stop
818 kset = set_list_kl(i_set_list_kl)%pair(1)
819 lset = set_list_kl(i_set_list_kl)%pair(2)
820
821 IF (katom == latom .AND. lset < kset) cycle
822
823 orb_k_start = mp2_biel%index_table(katom, kset)
824 orb_k_end = orb_k_start + nsgfc(kset) - 1
825 orb_l_start = mp2_biel%index_table(latom, lset)
826 orb_l_end = orb_l_start + nsgfd(lset) - 1
827
828 !! get max_vals if we screen on initial density
829 pmax_entry = 0.0_dp
830
831 sphi_c_ext_set => sphi_c_ext(:, :, :, kset)
832 sphi_d_ext_set => sphi_d_ext(:, :, :, lset)
833
834 log10_pmax = pmax_entry
835 log10_eps_schwarz = log_zero
836
837 IF (ALLOCATED(mnrs)) DEALLOCATE (mnrs)
838 ALLOCATE (mnrs(nsgfd(lset), nsgfc(kset), nsgfa(iset)))
839
840 mnrs = 0.0_dp
841
842 max_contraction_val = max_contraction(kset, katom)*max_contraction(lset, latom)
843
844 CALL coulomb4(private_context, ra, rb, rc, rd, npgfa(iset), npgfb(jset), npgfc(kset), npgfd(lset), &
845 la_min(iset), la_max(iset), lb_min(jset), lb_max(jset), &
846 lc_min(kset), lc_max(kset), ld_min(lset), ld_max(lset), &
847 nsgfa(iset), nsgfb(jset), nsgfc(kset), nsgfd(lset), &
848 sphi_a_u1, sphi_a_u2, sphi_a_u3, &
849 sphi_b_u1, sphi_b_u2, sphi_b_u3, &
850 sphi_c_u1, sphi_c_u2, sphi_c_u3, &
851 sphi_d_u1, sphi_d_u2, sphi_d_u3, &
852 zeta(1:npgfa(iset), iset), zetb(1:npgfb(jset), jset), &
853 zetc(1:npgfc(kset), kset), zetd(1:npgfd(lset), lset), &
854 primitive_integrals, &
855 mp2_potential_parameter, &
856 actual_x_data%neighbor_cells, screen_coeffs_set(kset, kset, kkind, kkind)%x, &
857 screen_coeffs_set(kset, kset, kkind, kkind)%x, eps_schwarz, &
858 max_contraction_val, cartesian_estimate, cell, neris_tmp, &
859 log10_pmax, log10_eps_schwarz, &
860 tmp_r_1, tmp_r_2, tmp_screen_pgf1, tmp_screen_pgf2, &
861 pgf_list_ij, pgf_list_kl, pgf_product_list, &
862 nsgfl_a(:, iset), nsgfl_b(:, jset), &
863 nsgfl_c(:, kset), nsgfl_d(:, lset), &
864 sphi_a_ext_set, &
865 sphi_b_ext_set, &
866 sphi_c_ext_set, &
867 sphi_d_ext_set, &
868 ee_work, ee_work2, ee_buffer1, ee_buffer2, ee_primitives_tmp, &
869 nimages, do_periodic)
870
871 nints = nsgfa(iset)*nsgfb(jset)*nsgfc(kset)*nsgfd(lset)
872 neris_total = neris_total + nints
873 nprim_ints = nprim_ints + neris_tmp
874 IF (cartesian_estimate == 0.0_dp) cartesian_estimate = tiny(cartesian_estimate)
875 estimate_to_store_int = exponent(cartesian_estimate)
876 estimate_to_store_int = max(estimate_to_store_int, -15_int_8)
877 cartesian_estimate = set_exponent(1.0_dp, estimate_to_store_int + 1)
878
879 primitive_counter = 0
880 DO llb = 1, nsgfd(lset)
881 DO kkb = 1, nsgfc(kset)
882 DO jjb = 1, nsgfb(jset)
883 DO iib = 1, nsgfa(iset)
884 primitive_counter = primitive_counter + 1
885 mnrs(llb, kkb, iib) = primitive_integrals(primitive_counter)
886 END DO
887 END DO
888 END DO
889 END DO
890
891 DO iib = 1, nsgfa(iset)
892 bi1(orb_l_start:orb_l_end, orb_k_start:orb_k_end, iib) = mnrs(:, :, iib)
893 bi1(orb_k_start:orb_k_end, orb_l_start:orb_l_end, iib) = transpose(mnrs(:, :, iib))
894 END DO
895
896 END DO ! i_set_list_kl
897 END DO ! i_list_kl
898
899 DO iib = 1, nsgfa(iset)
900 bi1(1:virtual, 1:occupied, iib) = matmul(transpose(c(1:dimen, occupied + 1:dimen)), &
901 matmul(bi1(1:dimen, 1:dimen, iib), c(1:dimen, 1:occupied)))
902 lai(l_b_i_start + iib - 1, 1:virtual, 1:occupied) = bi1(1:virtual, 1:occupied, iib)
903 END DO
904
905 DEALLOCATE (bi1)
906
907 END DO
908 END DO
909
910 CALL para_env%sum(lai)
911
912 DO iib = 1, occupied
913 IF (mod(iib, para_env%num_pe) == para_env%mepos) THEN
914 lai(1:ri_dimen, 1:virtual, iib) = matmul(transpose(l_full_matrix), lai(1:ri_dimen, 1:virtual, iib))
915 ELSE
916 lai(:, :, iib) = 0.0_dp
917 END IF
918 END DO
919
920 CALL para_env%sum(lai)
921
922 DEALLOCATE (set_list_kl)
923
924 DO i = 1, max_pgf**2
925 DEALLOCATE (pgf_list_ij(i)%image_list)
926 DEALLOCATE (pgf_list_kl(i)%image_list)
927 END DO
928
929 DEALLOCATE (pgf_list_ij)
930 DEALLOCATE (pgf_list_kl)
931 DEALLOCATE (pgf_product_list)
932
933 DEALLOCATE (max_contraction, kind_of)
934
935 DEALLOCATE (ee_work, ee_work2, ee_buffer1, ee_buffer2, ee_primitives_tmp)
936
937 DEALLOCATE (nimages)
938
939 IF (mp2_env%potential_parameter%potential_type == do_potential_tshpsc) THEN
941 CALL free_c0()
942 END IF
943
944 CALL timestop(handle)
945
946 END SUBROUTINE calc_lai_libint
947
948! **************************************************************************************************
949!> \brief ...
950!> \param cell ...
951!> \param qs_env ...
952!> \param mp2_env ...
953!> \param para_env ...
954!> \param mp2_potential_parameter ...
955!> \param actual_x_data ...
956!> \param do_periodic ...
957!> \param basis_parameter ...
958!> \param max_set ...
959!> \param particle_set ...
960!> \param natom ...
961!> \param kind_of ...
962!> \param nsgf_max ...
963!> \param primitive_integrals ...
964!> \param ee_work ...
965!> \param ee_work2 ...
966!> \param ee_buffer1 ...
967!> \param ee_buffer2 ...
968!> \param ee_primitives_tmp ...
969!> \param nspins ...
970!> \param max_contraction ...
971!> \param max_pgf ...
972!> \param pgf_list_ij ...
973!> \param pgf_list_kl ...
974!> \param pgf_product_list ...
975!> \param nimages ...
976!> \param eps_schwarz ...
977!> \param log10_eps_schwarz ...
978!> \param private_context borrowed per-thread four-center integral context
979!> \param screen_coeffs_set ...
980!> \param screen_coeffs_kind ...
981!> \param screen_coeffs_pgf ...
982!> \param radii_pgf ...
983!> \param RI_basis_parameter ...
984!> \param RI_basis_info ...
985! **************************************************************************************************
986 SUBROUTINE prepare_integral_calc(cell, qs_env, mp2_env, para_env, mp2_potential_parameter, actual_x_data, &
987 do_periodic, basis_parameter, max_set, particle_set, natom, kind_of, &
988 nsgf_max, primitive_integrals, ee_work, ee_work2, ee_buffer1, ee_buffer2, &
989 ee_primitives_tmp, nspins, max_contraction, max_pgf, pgf_list_ij, &
990 pgf_list_kl, pgf_product_list, nimages, eps_schwarz, log10_eps_schwarz, &
991 private_context, screen_coeffs_set, screen_coeffs_kind, screen_coeffs_pgf, &
992 radii_pgf, RI_basis_parameter, RI_basis_info)
993
994 TYPE(cell_type), POINTER :: cell
995 TYPE(qs_environment_type), INTENT(IN), POINTER :: qs_env
996 TYPE(mp2_type), INTENT(INOUT) :: mp2_env
997 TYPE(mp_para_env_type), INTENT(IN) :: para_env
998 TYPE(hfx_potential_type), INTENT(OUT) :: mp2_potential_parameter
999 TYPE(hfx_type), POINTER :: actual_x_data
1000 LOGICAL, INTENT(OUT) :: do_periodic
1001 TYPE(hfx_basis_type), DIMENSION(:), POINTER :: basis_parameter
1002 INTEGER, INTENT(OUT) :: max_set
1003 TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
1004 INTEGER, INTENT(OUT) :: natom
1005 INTEGER, ALLOCATABLE, DIMENSION(:), INTENT(OUT) :: kind_of
1006 INTEGER, INTENT(OUT) :: nsgf_max
1007 REAL(kind=dp), ALLOCATABLE, DIMENSION(:), &
1008 INTENT(OUT) :: primitive_integrals, ee_work, ee_work2, &
1009 ee_buffer1, ee_buffer2, &
1010 ee_primitives_tmp
1011 INTEGER, INTENT(OUT) :: nspins
1012 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :), &
1013 INTENT(OUT) :: max_contraction
1014 INTEGER, INTENT(OUT) :: max_pgf
1015 TYPE(hfx_pgf_list), ALLOCATABLE, DIMENSION(:), &
1016 INTENT(OUT) :: pgf_list_ij, pgf_list_kl
1017 TYPE(hfx_pgf_product_list), ALLOCATABLE, &
1018 DIMENSION(:), INTENT(OUT) :: pgf_product_list
1019 INTEGER, ALLOCATABLE, DIMENSION(:), INTENT(OUT) :: nimages
1020 REAL(kind=dp), INTENT(OUT) :: eps_schwarz, log10_eps_schwarz
1022 INTENT(OUT) :: private_context
1023 TYPE(hfx_screen_coeff_type), &
1024 DIMENSION(:, :, :, :), POINTER :: screen_coeffs_set
1025 TYPE(hfx_screen_coeff_type), DIMENSION(:, :), &
1026 POINTER :: screen_coeffs_kind
1027 TYPE(hfx_screen_coeff_type), &
1028 DIMENSION(:, :, :, :, :, :), POINTER :: screen_coeffs_pgf, radii_pgf
1029 TYPE(hfx_basis_type), DIMENSION(:), OPTIONAL, &
1030 POINTER :: ri_basis_parameter
1031 TYPE(hfx_basis_info_type), INTENT(IN), OPTIONAL :: ri_basis_info
1032
1033 CHARACTER(LEN=*), PARAMETER :: routinen = 'prepare_integral_calc'
1034
1035 INTEGER :: handle, i_thread, ii, ikind, irep, &
1036 l_max, n_threads, ncos_max, nkind, &
1037 nneighbors
1038 TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
1039 TYPE(dft_control_type), POINTER :: dft_control
1040 TYPE(hfx_basis_info_type), POINTER :: basis_info
1041 TYPE(hfx_type), POINTER :: shm_master_x_data
1042
1043 CALL timeset(routinen, handle)
1044
1045 NULLIFY (dft_control)
1046
1047 irep = 1
1048
1049 CALL get_qs_env(qs_env, &
1050 atomic_kind_set=atomic_kind_set, &
1051 cell=cell, &
1052 dft_control=dft_control)
1053
1054 !! Calculate l_max used in fgamma , because init_md_ftable is definitely not thread safe
1055 nkind = SIZE(atomic_kind_set, 1)
1056 l_max = 0
1057 DO ikind = 1, nkind
1058 l_max = max(l_max, maxval(qs_env%x_data(1, 1)%basis_parameter(ikind)%lmax))
1059 END DO
1060 IF (PRESENT(ri_basis_parameter)) THEN
1061 DO ikind = 1, nkind
1062 l_max = max(l_max, maxval(ri_basis_parameter(ikind)%lmax))
1063 END DO
1064 END IF
1065 l_max = 4*l_max
1066 CALL init_md_ftable(l_max)
1067
1068 CALL get_potential_parameters(mp2_env, l_max, para_env, mp2_potential_parameter)
1069
1070 n_threads = 1
1071
1072 i_thread = 0
1073
1074 actual_x_data => qs_env%x_data(irep, i_thread + 1)
1075
1076 shm_master_x_data => qs_env%x_data(irep, 1)
1077
1078 do_periodic = actual_x_data%periodic_parameter%do_periodic
1079
1080 IF (do_periodic) THEN
1081 ! ** Rebuild neighbor lists in case the cell has changed (i.e. NPT MD)
1082 actual_x_data%periodic_parameter%number_of_shells = actual_x_data%periodic_parameter%mode
1083 CALL hfx_create_neighbor_cells(actual_x_data, actual_x_data%periodic_parameter%number_of_shells_from_input, &
1084 cell, i_thread)
1085 END IF
1086
1087 basis_parameter => actual_x_data%basis_parameter
1088 basis_info => actual_x_data%basis_info
1089
1090 max_set = basis_info%max_set
1091 IF (PRESENT(ri_basis_info)) max_set = max(max_set, ri_basis_info%max_set)
1092
1093 CALL get_qs_env(qs_env=qs_env, &
1094 atomic_kind_set=atomic_kind_set, &
1095 particle_set=particle_set)
1096
1097 natom = SIZE(particle_set, 1)
1098
1099 CALL get_atomic_kind_set(atomic_kind_set=atomic_kind_set, kind_of=kind_of)
1100
1101 !! precompute maximum nco and allocate scratch
1102 ncos_max = 0
1103 nsgf_max = 0
1104 CALL get_ncos_and_ncsgf(natom, kind_of, basis_parameter, ncos_max, nsgf_max)
1105 IF (PRESENT(ri_basis_parameter)) THEN
1106 CALL get_ncos_and_ncsgf(natom, kind_of, ri_basis_parameter, ncos_max, nsgf_max)
1107 END IF
1108
1109 !! Allocate the arrays for the integrals.
1110 ALLOCATE (primitive_integrals(nsgf_max**4))
1111 primitive_integrals = 0.0_dp
1112
1113 ALLOCATE (ee_work(ncos_max**4))
1114 ALLOCATE (ee_work2(ncos_max**4))
1115 ALLOCATE (ee_buffer1(ncos_max**4))
1116 ALLOCATE (ee_buffer2(ncos_max**4))
1117 ALLOCATE (ee_primitives_tmp(nsgf_max**4))
1118
1119 nspins = dft_control%nspins
1120
1121 CALL get_max_contraction(max_contraction, max_set, natom, max_pgf, kind_of, basis_parameter)
1122
1123 ! ** Allocate buffers for pgf_lists
1124 nneighbors = SIZE(actual_x_data%neighbor_cells)
1125 ALLOCATE (pgf_list_ij(max_pgf**2))
1126 ALLOCATE (pgf_list_kl(max_pgf**2))
1127 ALLOCATE (pgf_product_list(nneighbors**3))
1128 ALLOCATE (nimages(max_pgf**2))
1129
1130 DO ii = 1, max_pgf**2
1131 ALLOCATE (pgf_list_ij(ii)%image_list(nneighbors))
1132 ALLOCATE (pgf_list_kl(ii)%image_list(nneighbors))
1133 END DO
1134
1135 !!! Skipped part
1136
1137 !! Get screening parameter
1138 eps_schwarz = actual_x_data%screening_parameter%eps_schwarz
1139 IF (eps_schwarz <= 0.0_dp) THEN
1140 log10_eps_schwarz = log_zero
1141 ELSE
1142 log10_eps_schwarz = log10(eps_schwarz)
1143 END IF
1144
1145 !! The number of integrals that fit into the given MAX_MEMORY
1146
1147 private_context = actual_x_data%eri4_context
1148
1149 !!!!!!!! Missing part on the density matrix
1150
1151 !! Initialize schwarz screening matrices for near field estimates and boxing screening matrices
1152 !! for far field estimates. The update is only performed if the geomtry of the system changed.
1153 !! If the system is periodic, then the corresponding routines are called and some variables
1154 !! are initialized
1155
1156 IF (.NOT. shm_master_x_data%screen_funct_is_initialized) THEN
1157 CALL calc_pair_dist_radii(qs_env, basis_parameter, &
1158 shm_master_x_data%pair_dist_radii_pgf, max_set, max_pgf, eps_schwarz, &
1159 n_threads, i_thread)
1160 CALL calc_screening_functions(qs_env, basis_parameter, private_context, shm_master_x_data%potential_parameter, &
1161 shm_master_x_data%screen_funct_coeffs_set, &
1162 shm_master_x_data%screen_funct_coeffs_kind, &
1163 shm_master_x_data%screen_funct_coeffs_pgf, &
1164 shm_master_x_data%pair_dist_radii_pgf, &
1165 max_set, max_pgf, n_threads, i_thread)
1166
1167 shm_master_x_data%screen_funct_is_initialized = .true.
1168 END IF
1169
1170 screen_coeffs_set => shm_master_x_data%screen_funct_coeffs_set
1171 screen_coeffs_kind => shm_master_x_data%screen_funct_coeffs_kind
1172 screen_coeffs_pgf => shm_master_x_data%screen_funct_coeffs_pgf
1173 radii_pgf => shm_master_x_data%pair_dist_radii_pgf
1174
1175 CALL timestop(handle)
1176
1177 END SUBROUTINE prepare_integral_calc
1178
1179! **************************************************************************************************
1180!> \brief ...
1181!> \param mp2_env ...
1182!> \param l_max ...
1183!> \param para_env ...
1184!> \param mp2_potential_parameter ...
1185! **************************************************************************************************
1186 SUBROUTINE get_potential_parameters(mp2_env, l_max, para_env, mp2_potential_parameter)
1187
1188 TYPE(mp2_type) :: mp2_env
1189 INTEGER, INTENT(IN) :: l_max
1190 TYPE(mp_para_env_type), INTENT(IN) :: para_env
1191 TYPE(hfx_potential_type), INTENT(OUT) :: mp2_potential_parameter
1192
1193 INTEGER :: unit_id
1194
1195 IF (mp2_env%potential_parameter%potential_type == do_potential_tshpsc) THEN
1196 IF (l_max > init_tshpsc_lmax) THEN
1197 IF (para_env%is_source()) THEN
1198 CALL open_file(unit_number=unit_id, file_name=mp2_env%potential_parameter%filename)
1199 END IF
1200 CALL init(l_max, unit_id, para_env%mepos, para_env)
1201 IF (para_env%is_source()) THEN
1202 CALL close_file(unit_id)
1203 END IF
1204 init_tshpsc_lmax = l_max
1205 END IF
1206 mp2_potential_parameter%cutoff_radius = mp2_env%potential_parameter%cutoff_radius/2.0_dp
1207 ELSE IF (mp2_env%potential_parameter%potential_type == do_potential_long) THEN
1208 mp2_potential_parameter%omega = mp2_env%potential_parameter%omega
1209 END IF
1210
1211 mp2_potential_parameter%potential_type = mp2_env%potential_parameter%potential_type
1212
1213 END SUBROUTINE get_potential_parameters
1214
1215! **************************************************************************************************
1216!> \brief ...
1217!> \param natom ...
1218!> \param kind_of ...
1219!> \param basis_parameter ...
1220!> \param ncos_max ...
1221!> \param nsgf_max ...
1222! **************************************************************************************************
1223 SUBROUTINE get_ncos_and_ncsgf(natom, kind_of, basis_parameter, ncos_max, nsgf_max)
1224
1225 INTEGER, INTENT(IN) :: natom
1226 INTEGER, DIMENSION(:), INTENT(IN) :: kind_of
1227 TYPE(hfx_basis_type), DIMENSION(:), POINTER :: basis_parameter
1228 INTEGER, INTENT(INOUT) :: ncos_max, nsgf_max
1229
1230 INTEGER :: iatom, ikind, iset, nseta
1231 INTEGER, DIMENSION(:), POINTER :: la_max, npgfa, nsgfa
1232
1233 DO iatom = 1, natom
1234 ikind = kind_of(iatom)
1235 nseta = basis_parameter(ikind)%nset
1236 npgfa => basis_parameter(ikind)%npgf
1237 la_max => basis_parameter(ikind)%lmax
1238 nsgfa => basis_parameter(ikind)%nsgf
1239 DO iset = 1, nseta
1240 ncos_max = max(ncos_max, ncoset(la_max(iset)))
1241 nsgf_max = max(nsgf_max, nsgfa(iset))
1242 END DO
1243 END DO
1244
1245 END SUBROUTINE get_ncos_and_ncsgf
1246
1247! **************************************************************************************************
1248!> \brief ...
1249!> \param max_contraction ...
1250!> \param max_set ...
1251!> \param natom ...
1252!> \param max_pgf ...
1253!> \param kind_of ...
1254!> \param basis_parameter ...
1255! **************************************************************************************************
1256 SUBROUTINE get_max_contraction(max_contraction, max_set, natom, max_pgf, kind_of, basis_parameter)
1257
1258 REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :), &
1259 INTENT(OUT) :: max_contraction
1260 INTEGER, INTENT(IN) :: max_set, natom
1261 INTEGER, INTENT(OUT) :: max_pgf
1262 INTEGER, DIMENSION(:), INTENT(IN) :: kind_of
1263 TYPE(hfx_basis_type), DIMENSION(:), POINTER :: basis_parameter
1264
1265 INTEGER :: i, jatom, jkind, jset, ncob, nsetb, sgfb
1266 INTEGER, DIMENSION(:), POINTER :: lb_max, npgfb, nsgfb
1267 INTEGER, DIMENSION(:, :), POINTER :: first_sgfb
1268 REAL(kind=dp), DIMENSION(:, :), POINTER :: sphi_b
1269
1270 ALLOCATE (max_contraction(max_set, natom))
1271
1272 max_contraction = 0.0_dp
1273 max_pgf = 0
1274 DO jatom = 1, natom
1275 jkind = kind_of(jatom)
1276 lb_max => basis_parameter(jkind)%lmax
1277 nsetb = basis_parameter(jkind)%nset
1278 npgfb => basis_parameter(jkind)%npgf
1279 first_sgfb => basis_parameter(jkind)%first_sgf
1280 sphi_b => basis_parameter(jkind)%sphi
1281 nsgfb => basis_parameter(jkind)%nsgf
1282 DO jset = 1, nsetb
1283 ! takes the primitive to contracted transformation into account
1284 ncob = npgfb(jset)*ncoset(lb_max(jset))
1285 sgfb = first_sgfb(1, jset)
1286 ! if the primitives are assumed to be all of max_val2, max_val2*p2s_b becomes
1287 ! the maximum value after multiplication with sphi_b
1288 max_contraction(jset, jatom) = maxval([(sum(abs(sphi_b(1:ncob, i))), i=sgfb, sgfb + nsgfb(jset) - 1)])
1289 max_pgf = max(max_pgf, npgfb(jset))
1290 END DO
1291 END DO
1292
1293 END SUBROUTINE get_max_contraction
1294
1295END MODULE mp2_ri_libint
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind_set(atomic_kind_set, atom_of_kind, kind_of, natom_of_kind, maxatom, natom, nshell, fist_potential_present, shell_present, shell_adiabatic, shell_check_distance, damping_present)
Get attributes of an atomic kind set.
subroutine, public get_gto_basis_set(gto_basis_set, name, aliases, norm_type, kind_radius, ncgf, nset, nsgf, cgf_symbol, sgf_symbol, norm_cgf, set_radius, lmax, lmin, lx, ly, lz, m, ncgf_set, npgf, nsgf_set, nshell, cphi, pgf_radius, sphi, scon, zet, first_cgf, first_sgf, l, last_cgf, last_sgf, n, gcc, maxco, maxl, maxpgf, maxsgf_set, maxshell, maxso, nco_sum, npgf_sum, nshell_sum, maxder, short_kind_radius, npgf_seg_sum, ccon)
...
subroutine, public init_aux_basis_set(gto_basis_set)
...
Handles all functions related to the CELL.
Definition cell_types.F:15
methods related to the blacs parallel environment
subroutine, public cp_blacs_env_release(blacs_env)
releases the given blacs_env
subroutine, public cp_blacs_env_create(blacs_env, para_env, blacs_grid_layout, blacs_repeatable, row_major, grid_2d)
allocates and initializes a type that represent a blacs context
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
Utility routines to open and close files.
Definition cp_files.F:22
subroutine, public open_file(file_name, unit_number, file_status, file_form, file_action, file_position, file_pad, file_access, debug)
Opens a file and returns its logical unit number.
Definition cp_files.F:197
subroutine, public close_file(unit_number, file_status)
Closes an open file given by its logical unit number.
Definition cp_files.F:64
Basic linear algebra operations for full matrices.
subroutine, public cp_fm_triangular_invert(matrix_a, uplo_tr)
inverts a triangular matrix
various cholesky decomposition related routines
subroutine, public cp_fm_cholesky_decompose(matrix, n, info_out)
used to replace a symmetric positive def. matrix M with its cholesky decomposition U: M = U^T * U,...
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
Definition cp_fm_types.F:15
subroutine, public cp_fm_set_submatrix(fm, new_values, start_row, start_col, n_rows, n_cols, alpha, beta, transpose)
sets a submatrix of a full matrix fm(start_row:start_row+n_rows,start_col:start_col+n_cols) = alpha*o...
subroutine, public cp_fm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
creates a new full matrix with the given structure
subroutine, public cp_fm_get_submatrix(fm, target_m, start_row, start_col, n_rows, n_cols, transpose)
gets a submatrix of a full matrix op(target_m)(1:n_rows,1:n_cols) =fm(start_row:start_row+n_rows,...
Four-center integral evaluation with an encapsulated Libint backend.
Prepare and evaluate screened four-center Gaussian integrals and derivatives.
subroutine, public coulomb4(context, ra, rb, rc, rd, npgfa, npgfb, npgfc, npgfd, la_min, la_max, lb_min, lb_max, lc_min, lc_max, ld_min, ld_max, nsgfa, nsgfb, nsgfc, nsgfd, sphi_a_u1, sphi_a_u2, sphi_a_u3, sphi_b_u1, sphi_b_u2, sphi_b_u3, sphi_c_u1, sphi_c_u2, sphi_c_u3, sphi_d_u1, sphi_d_u2, sphi_d_u3, zeta, zetb, zetc, zetd, primitive_integrals, potential_parameter, neighbor_cells, screen1, screen2, eps_schwarz, max_contraction_val, cart_estimate, cell, neris_tmp, log10_pmax, log10_eps_schwarz, r1_pgf, r2_pgf, pgf1, pgf2, pgf_list_ij, pgf_list_kl, pgf_product_list, nsgfl_a, nsgfl_b, nsgfl_c, nsgfl_d, sphi_a_ext, sphi_b_ext, sphi_c_ext, sphi_d_ext, ee_work, ee_work2, ee_buffer1, ee_buffer2, ee_primitives_tmp, nimages, do_periodic)
calculates two-electron integrals of a quartet/shell using the library lib_int in the periodic case
Calculation of the incomplete Gamma function F_n(t) for multi-center integrals over Cartesian Gaussia...
Definition gamma.F:15
subroutine, public init_md_ftable(nmax)
Initialize a table of F_n(t) values in the range 0 <= t <= 12 with a stepsize of 0....
Definition gamma.F:540
Routines for optimizing load balance between processes in HFX calculations.
subroutine, public build_pair_list_mp2(natom, list, set_list, i_start, i_end, j_start, j_end, kind_of, basis_parameter, particle_set, do_periodic, coeffs_set, coeffs_kind, coeffs_kind_max0, log10_eps_schwarz, cell, pmax_blocks, atomic_pair_list, skip_atom_symmetry)
...
Several screening methods used in HFX calcualtions.
subroutine, public calc_screening_functions(qs_env, basis_parameter, context, potential_parameter, coeffs_set, coeffs_kind, coeffs_pgf, radii_pgf, max_set, max_pgf, n_threads, i_thread)
calculates screening functions for schwarz screening
subroutine, public calc_pair_dist_radii(qs_env, basis_parameter, radii_pgf, max_set, max_pgf, eps_schwarz, n_threads, i_thread)
calculates radius functions for longrange screening
Types and set/get functions for HFX.
Definition hfx_types.F:16
real(dp), parameter, public log_zero
Definition hfx_types.F:125
subroutine, public hfx_create_neighbor_cells(x_data, pbc_shells, cell, i_thread, nkp_grid)
This routine computes the neighbor cells that are taken into account in periodic runs
Definition hfx_types.F:2074
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_potential_long
integer, parameter, public do_potential_tshpsc
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
Interface to the message passing library MPI.
Routines to calculate the 3 and 2 center ERI's needed in the RI approximation using libint.
subroutine, public prepare_integral_calc(cell, qs_env, mp2_env, para_env, mp2_potential_parameter, actual_x_data, do_periodic, basis_parameter, max_set, particle_set, natom, kind_of, nsgf_max, primitive_integrals, ee_work, ee_work2, ee_buffer1, ee_buffer2, ee_primitives_tmp, nspins, max_contraction, max_pgf, pgf_list_ij, pgf_list_kl, pgf_product_list, nimages, eps_schwarz, log10_eps_schwarz, private_context, screen_coeffs_set, screen_coeffs_kind, screen_coeffs_pgf, radii_pgf, ri_basis_parameter, ri_basis_info)
...
subroutine, public libint_ri_mp2(dimen, ri_dimen, occupied, natom, mp2_biel, mp2_env, c, kind_of, ri_basis_parameter, ri_basis_info, basis_s0, ri_index_table, qs_env, para_env, lai)
...
subroutine, public read_ri_basis_set(qs_env, ri_basis_parameter, ri_basis_info, natom, nkind, kind_of, ri_index_table, ri_dimen, basis_s0)
Read the auxiliary basis set for RI approxiamtion.
subroutine, public release_ri_basis_set(ri_basis_parameter, basis_s0)
Release the auxiliary basis set for RI approxiamtion (to be used only in the case of basis optimizati...
Types needed for MP2 calculations.
Definition mp2_types.F:14
integer, save, public init_tshpsc_lmax
Definition mp2_types.F:72
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:), allocatable, public nco
integer, dimension(:), allocatable, public ncoset
integer, dimension(:), allocatable, public nso
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, mimic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_vhxc, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, xcint_weights, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, cneo_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, hund_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, proj_shell_charge, lr_atom, do_mtlr, u_j_loop, ao_coef, init_u_ramping_each_scf, reltmat, ghost, monovalent, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
subroutine, public get_qs_kind_set(qs_kind_set, all_potential_present, tnadd_potential_present, gth_potential_present, sgp_potential_present, paw_atom_present, dft_plus_u_atom_present, maxcgf, maxsgf, maxco, maxco_proj, maxgtops, maxlgto, maxlprj, maxnset, maxsgf_set, ncgf, npgf, nset, nsgf, nshell, maxpol, maxlppl, maxlppnl, maxppnl, nelectron, maxder, max_ngrid_rad, max_sph_harm, maxg_iso_not0, lmax_rho0, basis_rcut, do_mtlr_present, basis_type, total_zeff_corr, npgf_seg, cneo_potential_present, nkind_q, natom_q)
Get attributes of an atomic kind set.
subroutine, public free_c0()
...
subroutine, public init(nder, iunit, mepos, group)
...
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
Definition cell_types.F:60
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
keeps the information about the structure of a full matrix
represent a full matrix
Context owning the energy and first-derivative backend workspaces.
stores some data used in construction of Kohn-Sham matrix
Definition hfx_types.F:478
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.