68#include "./base/base_uses.f90"
75 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'mp2_ri_libint'
99 SUBROUTINE libint_ri_mp2(dimen, RI_dimen, occupied, natom, mp2_biel, mp2_env, C, &
101 RI_basis_parameter, RI_basis_info, basis_S0, RI_index_table, &
104 INTEGER :: dimen, ri_dimen, occupied, natom
107 REAL(kind=
dp),
DIMENSION(dimen, dimen) :: c
108 INTEGER,
DIMENSION(:) :: kind_of
112 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: ri_index_table
115 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: lai
117 CHARACTER(LEN=*),
PARAMETER :: routinen =
'libint_ri_mp2'
119 INTEGER :: handle, nkind
121 CALL timeset(routinen, handle)
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)
128 natom, nkind, kind_of, ri_index_table, ri_dimen, &
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, &
137 CALL timestop(handle)
157 natom, nkind, kind_of, RI_index_table, RI_dimen, &
162 INTEGER :: natom, nkind
163 INTEGER,
DIMENSION(:) :: kind_of
164 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: ri_index_table
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
175 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
178 NULLIFY (ri_basis_parameter)
180 NULLIFY (qs_kind_set)
181 CALL get_qs_env(qs_env=qs_env, qs_kind_set=qs_kind_set)
183 nkind =
SIZE(qs_kind_set, 1)
184 ALLOCATE (ri_basis_parameter(nkind))
185 ALLOCATE (basis_s0(nkind))
189 atom_kind => qs_kind_set(ikind)
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.")
197 orb_basis_a%gcc = 1.0_dp
198 orb_basis_a%norm_type = 1
202 maxsgf=ri_basis_info%max_sgf, &
203 maxnset=ri_basis_info%max_set, &
204 maxlgto=ri_basis_info%max_am, &
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)
222 max_set = max(max_set, ri_basis_parameter(ikind)%nset)
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
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
256 ri_basis_info%max_set = max_set
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
264 DO i = 0, ri_basis_info%max_am
266 DO j = 1, nshell(iset)
267 IF (ri_basis_parameter(ikind)%nl(j, iset) == i) nl_count = nl_count + 1
269 ri_basis_parameter(ikind)%nsgfl(i, iset) = nl_count
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
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)
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
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
307 sgfa = first_sgfa(1, iset)
308 DO ipgf = 1, npgfa(iset)
309 offset_a1 = (ipgf - 1)*
ncoset(la_max(iset))
311 DO la = la_min(iset), la_max(iset)
312 offset_a = offset_a1 +
ncoset(la - 1)
314 co_counter = co_counter + 1
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)
322 s_offset_nl_a = s_offset_nl_a +
nso(la)*(nl_a(la, iset))
328 ALLOCATE (ri_index_table(natom, max_set))
329 ri_index_table = -huge(0)
333 ikind = kind_of(iatom)
334 nset = ri_basis_parameter(ikind)%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)
354 TYPE(
hfx_basis_type),
DIMENSION(:),
POINTER :: ri_basis_parameter, basis_s0
360 DO i = 1,
SIZE(ri_basis_parameter)
361 DEALLOCATE (ri_basis_parameter(i)%nsgfl)
362 DEALLOCATE (ri_basis_parameter(i)%sphi_ext)
364 DEALLOCATE (ri_basis_parameter)
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)
382 DEALLOCATE (basis_s0)
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, &
415 REAL(kind=
dp),
DIMENSION(dimen, dimen) :: c
419 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: ri_index_table
422 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: lai
424 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calc_lai_libint'
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, &
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), &
447 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: ee_buffer1, ee_buffer2, &
448 ee_primitives_tmp, ee_work, ee_work2, &
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 :: p_work
453 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: shm_pmax_block, zeta, zetb, zetc, zetd
454 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: sphi_a_ext_set, sphi_b_ext_set, &
455 sphi_c_ext_set, sphi_d_ext_set
456 REAL(kind=
dp),
DIMENSION(:, :, :, :),
POINTER :: sphi_a_ext, sphi_b_ext, sphi_c_ext, &
464 TYPE(
hfx_pgf_list),
ALLOCATABLE,
DIMENSION(:) :: pgf_list_ij, pgf_list_kl
466 DIMENSION(:) :: pgf_product_list
469 DIMENSION(:, :),
TARGET :: radii_pgf_large, screen_coeffs_pgf_large
471 POINTER :: screen_coeffs_kind, tmp_r_1, tmp_r_2, &
472 tmp_screen_pgf1, tmp_screen_pgf2
474 DIMENSION(:, :, :, :),
POINTER :: screen_coeffs_set
476 DIMENSION(:, :, :, :, :, :),
POINTER :: radii_pgf, screen_coeffs_pgf
477 TYPE(
hfx_type),
POINTER :: actual_x_data
480 DIMENSION(:) :: set_list_kl
483 CALL timeset(routinen, handle)
489 neris_total = 0_int_8
492 CALL prepare_integral_calc(cell, qs_env, mp2_env, para_env, mp2_potential_parameter, actual_x_data, &
493 do_periodic, basis_parameter, max_set, particle_set, natom, kind_of, &
494 nsgf_max, primitive_integrals, ee_work, ee_work2, ee_buffer1, ee_buffer2, &
495 ee_primitives_tmp, nspins, max_contraction, max_pgf, pgf_list_ij, &
496 pgf_list_kl, pgf_product_list, nimages, eps_schwarz, log10_eps_schwarz, &
497 private_lib, p_work, screen_coeffs_set, screen_coeffs_kind, screen_coeffs_pgf, &
498 radii_pgf, ri_basis_parameter, ri_basis_info)
500 ALLOCATE (radii_pgf_large(
SIZE(radii_pgf, 1),
SIZE(radii_pgf, 2)))
501 ALLOCATE (screen_coeffs_pgf_large(
SIZE(screen_coeffs_pgf, 1),
SIZE(screen_coeffs_pgf, 2)))
502 DO iib = 1,
SIZE(radii_pgf, 1)
503 DO jjb = 1,
SIZE(radii_pgf, 2)
504 radii_pgf_large(iib, jjb)%x = 100_dp
507 DO iib = 1,
SIZE(screen_coeffs_pgf, 1)
508 DO jjb = 1,
SIZE(screen_coeffs_pgf, 2)
509 screen_coeffs_pgf_large(iib, jjb)%x = 5000_dp
512 tmp_r_1 => radii_pgf_large(:, :)
513 tmp_r_2 => radii_pgf_large(:, :)
514 tmp_screen_pgf1 => screen_coeffs_pgf_large(:, :)
515 tmp_screen_pgf2 => screen_coeffs_pgf_large(:, :)
518 ALLOCATE (l_full_matrix(ri_dimen, ri_dimen))
519 l_full_matrix = 0.0_dp
525 ikind = kind_of(iatom)
526 jkind = kind_of(jatom)
527 ra = particle_set(iatom)%r(:)
528 rb = particle_set(jatom)%r(:)
530 la_max => ri_basis_parameter(ikind)%lmax
531 la_min => ri_basis_parameter(ikind)%lmin
532 npgfa => ri_basis_parameter(ikind)%npgf
533 nseta = ri_basis_parameter(ikind)%nset
534 zeta => ri_basis_parameter(ikind)%zet
535 nsgfa => ri_basis_parameter(ikind)%nsgf
536 sphi_a_ext => ri_basis_parameter(ikind)%sphi_ext(:, :, :, :)
537 nsgfl_a => ri_basis_parameter(ikind)%nsgfl
538 sphi_a_u1 = ubound(sphi_a_ext, 1)
539 sphi_a_u2 = ubound(sphi_a_ext, 2)
540 sphi_a_u3 = ubound(sphi_a_ext, 3)
542 lb_max => basis_s0(jkind)%lmax
543 lb_min => basis_s0(jkind)%lmin
544 npgfb => basis_s0(jkind)%npgf
545 nsetb = basis_s0(jkind)%nset
546 zetb => basis_s0(jkind)%zet
547 nsgfb => basis_s0(jkind)%nsgf
548 sphi_b_ext => basis_s0(jkind)%sphi_ext(:, :, :, :)
549 nsgfl_b => basis_s0(jkind)%nsgfl
550 sphi_b_u1 = ubound(sphi_b_ext, 1)
551 sphi_b_u2 = ubound(sphi_b_ext, 2)
552 sphi_b_u3 = ubound(sphi_b_ext, 3)
554 DO katom = iatom, natom
557 kkind = kind_of(katom)
558 lkind = kind_of(latom)
559 rc = particle_set(katom)%r(:)
560 rd = particle_set(latom)%r(:)
562 lc_max => ri_basis_parameter(kkind)%lmax
563 lc_min => ri_basis_parameter(kkind)%lmin
564 npgfc => ri_basis_parameter(kkind)%npgf
565 nsetc = ri_basis_parameter(kkind)%nset
566 zetc => ri_basis_parameter(kkind)%zet
567 nsgfc => ri_basis_parameter(kkind)%nsgf
568 sphi_c_ext => ri_basis_parameter(kkind)%sphi_ext(:, :, :, :)
569 nsgfl_c => ri_basis_parameter(kkind)%nsgfl
570 sphi_c_u1 = ubound(sphi_c_ext, 1)
571 sphi_c_u2 = ubound(sphi_c_ext, 2)
572 sphi_c_u3 = ubound(sphi_c_ext, 3)
574 ld_max => basis_s0(lkind)%lmax
575 ld_min => basis_s0(lkind)%lmin
576 npgfd => basis_s0(lkind)%npgf
577 nsetd = ri_basis_parameter(lkind)%nset
578 zetd => basis_s0(lkind)%zet
579 nsgfd => basis_s0(lkind)%nsgf
580 sphi_d_ext => basis_s0(lkind)%sphi_ext(:, :, :, :)
581 nsgfl_d => basis_s0(lkind)%nsgfl
582 sphi_d_u1 = ubound(sphi_d_ext, 1)
583 sphi_d_u2 = ubound(sphi_d_ext, 2)
584 sphi_d_u3 = ubound(sphi_d_ext, 3)
590 ncob = npgfb(jset)*
ncoset(lb_max(jset))
591 sphi_a_ext_set => sphi_a_ext(:, :, :, iset)
592 sphi_b_ext_set => sphi_b_ext(:, :, :, jset)
594 l_b_i_start = ri_index_table(iatom, iset)
595 l_b_i_end = ri_index_table(iatom, iset) + nsgfa(iset) - 1
598 IF (iatom == katom) kset_start = iset
599 DO kset = kset_start, nsetc
601 counter_l_blocks = counter_l_blocks + 1
602 IF (mod(counter_l_blocks, para_env%num_pe) /= para_env%mepos) cycle
604 sphi_c_ext_set => sphi_c_ext(:, :, :, kset)
605 sphi_d_ext_set => sphi_d_ext(:, :, :, lset)
607 l_b_k_start = ri_index_table(katom, kset)
608 l_b_k_end = ri_index_table(katom, kset) + nsgfc(kset) - 1
611 log10_pmax = pmax_entry
614 max_contraction_val = 1.0000_dp
616 ALLOCATE (l_block(nsgfa(iset), nsgfc(kset)))
618 CALL coulomb4(private_lib, ra, rb, rc, rd, npgfa(iset), npgfb(jset), npgfc(kset), npgfd(lset), &
619 la_min(iset), la_max(iset), lb_min(jset), lb_max(jset), &
620 lc_min(kset), lc_max(kset), ld_min(lset), ld_max(lset), &
621 nsgfa(iset), nsgfb(jset), nsgfc(kset), nsgfd(lset), &
622 sphi_a_u1, sphi_a_u2, sphi_a_u3, &
623 sphi_b_u1, sphi_b_u2, sphi_b_u3, &
624 sphi_c_u1, sphi_c_u2, sphi_c_u3, &
625 sphi_d_u1, sphi_d_u2, sphi_d_u3, &
626 zeta(1:npgfa(iset), iset), zetb(1:npgfb(jset), jset), &
627 zetc(1:npgfc(kset), kset), zetd(1:npgfd(lset), lset), &
628 primitive_integrals, &
629 mp2_potential_parameter, &
630 actual_x_data%neighbor_cells, screen_coeffs_set(1, 1, 1, 1)%x, &
631 screen_coeffs_set(1, 1, 1, 1)%x, eps_schwarz, &
632 max_contraction_val, cartesian_estimate, cell, neris_tmp, &
633 log10_pmax, log10_eps_schwarz, &
634 tmp_r_1, tmp_r_2, tmp_screen_pgf1, tmp_screen_pgf2, &
635 pgf_list_ij, pgf_list_kl, pgf_product_list, &
636 nsgfl_a(:, iset), nsgfl_b(:, jset), &
637 nsgfl_c(:, kset), nsgfl_d(:, lset), &
642 ee_work, ee_work2, ee_buffer1, ee_buffer2, ee_primitives_tmp, &
643 nimages, do_periodic, p_work)
645 primitive_counter = 0
646 DO llb = 1, nsgfd(lset)
647 DO kkb = 1, nsgfc(kset)
648 DO jjb = 1, nsgfb(jset)
649 DO iib = 1, nsgfa(iset)
650 primitive_counter = primitive_counter + 1
651 l_block(iib, kkb) = primitive_integrals(primitive_counter)
657 l_full_matrix(l_b_i_start:l_b_i_end, l_b_k_start:l_b_k_end) = l_block
658 l_full_matrix(l_b_k_start:l_b_k_end, l_b_i_start:l_b_i_end) = transpose(l_block)
669 CALL para_env%sum(l_full_matrix)
675 NULLIFY (fm_struct_l)
677 ncol_global=ri_dimen, para_env=para_env)
678 CALL cp_fm_create(fm_matrix_l, fm_struct_l, name=
"fm_matrix_L")
682 CALL cp_fm_set_submatrix(fm=fm_matrix_l, new_values=l_full_matrix, start_row=1, start_col=1, &
683 n_rows=ri_dimen, n_cols=ri_dimen)
687 cpassert(info_chol == 0)
693 l_full_matrix = 0.0_dp
699 l_full_matrix(iib + 1:ri_dimen, iib) = 0.0_dp
702 ALLOCATE (list_kl%elements(natom**2))
704 coeffs_kind_max0 = maxval(screen_coeffs_kind(:, :)%x(2))
705 ALLOCATE (set_list_kl((max_set*natom)**2))
708 actual_x_data%pmax_block = 0.0_dp
709 shm_pmax_block => actual_x_data%pmax_block
711 shm_atomic_pair_list => actual_x_data%atomic_pair_list
723 latom_start, latom_end, &
724 kind_of, basis_parameter, particle_set, &
725 do_periodic, screen_coeffs_set, screen_coeffs_kind, &
726 coeffs_kind_max0, log10_eps_schwarz, cell, 0.d+00, &
727 shm_atomic_pair_list)
729 virtual = dimen - occupied
731 ALLOCATE (lai(ri_dimen, virtual, occupied))
737 ikind = kind_of(iatom)
738 jkind = kind_of(jatom)
739 ra = particle_set(iatom)%r(:)
740 rb = particle_set(jatom)%r(:)
742 la_max => ri_basis_parameter(ikind)%lmax
743 la_min => ri_basis_parameter(ikind)%lmin
744 npgfa => ri_basis_parameter(ikind)%npgf
745 nseta = ri_basis_parameter(ikind)%nset
746 zeta => ri_basis_parameter(ikind)%zet
747 nsgfa => ri_basis_parameter(ikind)%nsgf
748 sphi_a_ext => ri_basis_parameter(ikind)%sphi_ext(:, :, :, :)
749 nsgfl_a => ri_basis_parameter(ikind)%nsgfl
750 sphi_a_u1 = ubound(sphi_a_ext, 1)
751 sphi_a_u2 = ubound(sphi_a_ext, 2)
752 sphi_a_u3 = ubound(sphi_a_ext, 3)
754 lb_max => basis_s0(jkind)%lmax
755 lb_min => basis_s0(jkind)%lmin
756 npgfb => basis_s0(jkind)%npgf
757 nsetb = basis_s0(jkind)%nset
758 zetb => basis_s0(jkind)%zet
759 nsgfb => basis_s0(jkind)%nsgf
760 sphi_b_ext => basis_s0(jkind)%sphi_ext(:, :, :, :)
761 nsgfl_b => basis_s0(jkind)%nsgfl
762 sphi_b_u1 = ubound(sphi_b_ext, 1)
763 sphi_b_u2 = ubound(sphi_b_ext, 2)
764 sphi_b_u3 = ubound(sphi_b_ext, 3)
769 counter_l_blocks = counter_l_blocks + 1
770 IF (mod(counter_l_blocks, para_env%num_pe) /= para_env%mepos) cycle
772 ncob = npgfb(jset)*
ncoset(lb_max(jset))
773 sphi_a_ext_set => sphi_a_ext(:, :, :, iset)
774 sphi_b_ext_set => sphi_b_ext(:, :, :, jset)
776 l_b_i_start = ri_index_table(iatom, iset)
777 l_b_i_end = ri_index_table(iatom, iset) + nsgfa(iset) - 1
779 ALLOCATE (bi1(dimen, dimen, nsgfa(iset)))
782 DO i_list_kl = 1, list_kl%n_element
784 katom = list_kl%elements(i_list_kl)%pair(1)
785 latom = list_kl%elements(i_list_kl)%pair(2)
787 i_set_list_kl_start = list_kl%elements(i_list_kl)%set_bounds(1)
788 i_set_list_kl_stop = list_kl%elements(i_list_kl)%set_bounds(2)
789 kkind = list_kl%elements(i_list_kl)%kind_pair(1)
790 lkind = list_kl%elements(i_list_kl)%kind_pair(2)
791 rc = list_kl%elements(i_list_kl)%r1
792 rd = list_kl%elements(i_list_kl)%r2
796 lc_max => basis_parameter(kkind)%lmax
797 lc_min => basis_parameter(kkind)%lmin
798 npgfc => basis_parameter(kkind)%npgf
799 zetc => basis_parameter(kkind)%zet
800 nsgfc => basis_parameter(kkind)%nsgf
801 sphi_c_ext => basis_parameter(kkind)%sphi_ext(:, :, :, :)
802 nsgfl_c => basis_parameter(kkind)%nsgfl
803 sphi_c_u1 = ubound(sphi_c_ext, 1)
804 sphi_c_u2 = ubound(sphi_c_ext, 2)
805 sphi_c_u3 = ubound(sphi_c_ext, 3)
807 ld_max => basis_parameter(lkind)%lmax
808 ld_min => basis_parameter(lkind)%lmin
809 npgfd => basis_parameter(lkind)%npgf
810 zetd => basis_parameter(lkind)%zet
811 nsgfd => basis_parameter(lkind)%nsgf
812 sphi_d_ext => basis_parameter(lkind)%sphi_ext(:, :, :, :)
813 nsgfl_d => basis_parameter(lkind)%nsgfl
814 sphi_d_u1 = ubound(sphi_d_ext, 1)
815 sphi_d_u2 = ubound(sphi_d_ext, 2)
816 sphi_d_u3 = ubound(sphi_d_ext, 3)
818 DO i_set_list_kl = i_set_list_kl_start, i_set_list_kl_stop
819 kset = set_list_kl(i_set_list_kl)%pair(1)
820 lset = set_list_kl(i_set_list_kl)%pair(2)
822 IF (katom == latom .AND. lset < kset) cycle
824 orb_k_start = mp2_biel%index_table(katom, kset)
825 orb_k_end = orb_k_start + nsgfc(kset) - 1
826 orb_l_start = mp2_biel%index_table(latom, lset)
827 orb_l_end = orb_l_start + nsgfd(lset) - 1
832 sphi_c_ext_set => sphi_c_ext(:, :, :, kset)
833 sphi_d_ext_set => sphi_d_ext(:, :, :, lset)
835 log10_pmax = pmax_entry
838 IF (
ALLOCATED(mnrs))
DEALLOCATE (mnrs)
839 ALLOCATE (mnrs(nsgfd(lset), nsgfc(kset), nsgfa(iset)))
843 max_contraction_val = max_contraction(kset, katom)*max_contraction(lset, latom)
845 CALL coulomb4(private_lib, ra, rb, rc, rd, npgfa(iset), npgfb(jset), npgfc(kset), npgfd(lset), &
846 la_min(iset), la_max(iset), lb_min(jset), lb_max(jset), &
847 lc_min(kset), lc_max(kset), ld_min(lset), ld_max(lset), &
848 nsgfa(iset), nsgfb(jset), nsgfc(kset), nsgfd(lset), &
849 sphi_a_u1, sphi_a_u2, sphi_a_u3, &
850 sphi_b_u1, sphi_b_u2, sphi_b_u3, &
851 sphi_c_u1, sphi_c_u2, sphi_c_u3, &
852 sphi_d_u1, sphi_d_u2, sphi_d_u3, &
853 zeta(1:npgfa(iset), iset), zetb(1:npgfb(jset), jset), &
854 zetc(1:npgfc(kset), kset), zetd(1:npgfd(lset), lset), &
855 primitive_integrals, &
856 mp2_potential_parameter, &
857 actual_x_data%neighbor_cells, screen_coeffs_set(kset, kset, kkind, kkind)%x, &
858 screen_coeffs_set(kset, kset, kkind, kkind)%x, eps_schwarz, &
859 max_contraction_val, cartesian_estimate, cell, neris_tmp, &
860 log10_pmax, log10_eps_schwarz, &
861 tmp_r_1, tmp_r_2, tmp_screen_pgf1, tmp_screen_pgf2, &
862 pgf_list_ij, pgf_list_kl, pgf_product_list, &
863 nsgfl_a(:, iset), nsgfl_b(:, jset), &
864 nsgfl_c(:, kset), nsgfl_d(:, lset), &
869 ee_work, ee_work2, ee_buffer1, ee_buffer2, ee_primitives_tmp, &
870 nimages, do_periodic, p_work)
872 nints = nsgfa(iset)*nsgfb(jset)*nsgfc(kset)*nsgfd(lset)
873 neris_total = neris_total + nints
874 nprim_ints = nprim_ints + neris_tmp
875 IF (cartesian_estimate == 0.0_dp) cartesian_estimate = tiny(cartesian_estimate)
876 estimate_to_store_int = exponent(cartesian_estimate)
877 estimate_to_store_int = max(estimate_to_store_int, -15_int_8)
878 cartesian_estimate = set_exponent(1.0_dp, estimate_to_store_int + 1)
880 primitive_counter = 0
881 DO llb = 1, nsgfd(lset)
882 DO kkb = 1, nsgfc(kset)
883 DO jjb = 1, nsgfb(jset)
884 DO iib = 1, nsgfa(iset)
885 primitive_counter = primitive_counter + 1
886 mnrs(llb, kkb, iib) = primitive_integrals(primitive_counter)
892 DO iib = 1, nsgfa(iset)
893 bi1(orb_l_start:orb_l_end, orb_k_start:orb_k_end, iib) = mnrs(:, :, iib)
894 bi1(orb_k_start:orb_k_end, orb_l_start:orb_l_end, iib) = transpose(mnrs(:, :, iib))
900 DO iib = 1, nsgfa(iset)
901 bi1(1:virtual, 1:occupied, iib) = matmul(transpose(c(1:dimen, occupied + 1:dimen)), &
902 matmul(bi1(1:dimen, 1:dimen, iib), c(1:dimen, 1:occupied)))
903 lai(l_b_i_start + iib - 1, 1:virtual, 1:occupied) = bi1(1:virtual, 1:occupied, iib)
911 CALL para_env%sum(lai)
914 IF (mod(iib, para_env%num_pe) == para_env%mepos)
THEN
915 lai(1:ri_dimen, 1:virtual, iib) = matmul(transpose(l_full_matrix), lai(1:ri_dimen, 1:virtual, iib))
917 lai(:, :, iib) = 0.0_dp
921 CALL para_env%sum(lai)
923 DEALLOCATE (set_list_kl)
926 DEALLOCATE (pgf_list_ij(i)%image_list)
927 DEALLOCATE (pgf_list_kl(i)%image_list)
930 DEALLOCATE (pgf_list_ij)
931 DEALLOCATE (pgf_list_kl)
932 DEALLOCATE (pgf_product_list)
934 DEALLOCATE (max_contraction, kind_of)
936 DEALLOCATE (ee_work, ee_work2, ee_buffer1, ee_buffer2, ee_primitives_tmp)
945 CALL timestop(handle)
947 END SUBROUTINE calc_lai_libint
989 do_periodic, basis_parameter, max_set, particle_set, natom, kind_of, &
990 nsgf_max, primitive_integrals, ee_work, ee_work2, ee_buffer1, ee_buffer2, &
991 ee_primitives_tmp, nspins, max_contraction, max_pgf, pgf_list_ij, &
992 pgf_list_kl, pgf_product_list, nimages, eps_schwarz, log10_eps_schwarz, &
993 private_lib, p_work, screen_coeffs_set, screen_coeffs_kind, screen_coeffs_pgf, &
994 radii_pgf, RI_basis_parameter, RI_basis_info)
998 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
1001 TYPE(
hfx_type),
POINTER :: actual_x_data
1002 LOGICAL,
INTENT(OUT) :: do_periodic
1004 INTEGER,
INTENT(OUT) :: max_set
1006 INTEGER,
INTENT(OUT) :: natom
1007 INTEGER,
ALLOCATABLE,
DIMENSION(:),
INTENT(OUT) :: kind_of
1008 INTEGER,
INTENT(OUT) :: nsgf_max
1009 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:), &
1010 INTENT(OUT) :: primitive_integrals, ee_work, ee_work2, &
1011 ee_buffer1, ee_buffer2, &
1013 INTEGER,
INTENT(OUT) :: nspins
1014 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :), &
1015 INTENT(OUT) :: max_contraction
1016 INTEGER,
INTENT(OUT) :: max_pgf
1018 INTENT(OUT) :: pgf_list_ij, pgf_list_kl
1020 DIMENSION(:),
INTENT(OUT) :: pgf_product_list
1021 INTEGER,
ALLOCATABLE,
DIMENSION(:),
INTENT(OUT) :: nimages
1022 REAL(kind=
dp),
INTENT(OUT) :: eps_schwarz, log10_eps_schwarz
1024 REAL(kind=
dp),
DIMENSION(:),
POINTER :: p_work
1026 DIMENSION(:, :, :, :),
POINTER :: screen_coeffs_set
1028 POINTER :: screen_coeffs_kind
1030 DIMENSION(:, :, :, :, :, :),
POINTER :: screen_coeffs_pgf, radii_pgf
1032 POINTER :: ri_basis_parameter
1035 CHARACTER(LEN=*),
PARAMETER :: routinen =
'prepare_integral_calc'
1037 INTEGER :: handle, i_thread, ii, ikind, irep, &
1038 l_max, n_threads, ncos_max, nkind, &
1043 TYPE(
hfx_type),
POINTER :: shm_master_x_data
1045 CALL timeset(routinen, handle)
1047 NULLIFY (dft_control)
1052 atomic_kind_set=atomic_kind_set, &
1054 dft_control=dft_control)
1057 nkind =
SIZE(atomic_kind_set, 1)
1060 l_max = max(l_max, maxval(qs_env%x_data(1, 1)%basis_parameter(ikind)%lmax))
1062 IF (
PRESENT(ri_basis_parameter))
THEN
1064 l_max = max(l_max, maxval(ri_basis_parameter(ikind)%lmax))
1070 CALL get_potential_parameters(mp2_env, l_max, para_env, mp2_potential_parameter)
1076 actual_x_data => qs_env%x_data(irep, i_thread + 1)
1078 shm_master_x_data => qs_env%x_data(irep, 1)
1080 do_periodic = actual_x_data%periodic_parameter%do_periodic
1082 IF (do_periodic)
THEN
1084 actual_x_data%periodic_parameter%number_of_shells = actual_x_data%periodic_parameter%mode
1089 basis_parameter => actual_x_data%basis_parameter
1090 basis_info => actual_x_data%basis_info
1092 max_set = basis_info%max_set
1093 IF (
PRESENT(ri_basis_info)) max_set = max(max_set, ri_basis_info%max_set)
1096 atomic_kind_set=atomic_kind_set, &
1097 particle_set=particle_set)
1099 natom =
SIZE(particle_set, 1)
1106 CALL get_ncos_and_ncsgf(natom, kind_of, basis_parameter, ncos_max, nsgf_max)
1107 IF (
PRESENT(ri_basis_parameter))
THEN
1108 CALL get_ncos_and_ncsgf(natom, kind_of, ri_basis_parameter, ncos_max, nsgf_max)
1112 ALLOCATE (primitive_integrals(nsgf_max**4))
1113 primitive_integrals = 0.0_dp
1115 ALLOCATE (ee_work(ncos_max**4))
1116 ALLOCATE (ee_work2(ncos_max**4))
1117 ALLOCATE (ee_buffer1(ncos_max**4))
1118 ALLOCATE (ee_buffer2(ncos_max**4))
1119 ALLOCATE (ee_primitives_tmp(nsgf_max**4))
1121 nspins = dft_control%nspins
1123 CALL get_max_contraction(max_contraction, max_set, natom, max_pgf, kind_of, basis_parameter)
1126 nneighbors =
SIZE(actual_x_data%neighbor_cells)
1127 ALLOCATE (pgf_list_ij(max_pgf**2))
1128 ALLOCATE (pgf_list_kl(max_pgf**2))
1129 ALLOCATE (pgf_product_list(nneighbors**3))
1130 ALLOCATE (nimages(max_pgf**2))
1132 DO ii = 1, max_pgf**2
1133 ALLOCATE (pgf_list_ij(ii)%image_list(nneighbors))
1134 ALLOCATE (pgf_list_kl(ii)%image_list(nneighbors))
1140 eps_schwarz = actual_x_data%screening_parameter%eps_schwarz
1141 IF (eps_schwarz <= 0.0_dp)
THEN
1144 log10_eps_schwarz = log10(eps_schwarz)
1149 private_lib = actual_x_data%lib
1158 IF (.NOT. shm_master_x_data%screen_funct_is_initialized)
THEN
1160 shm_master_x_data%pair_dist_radii_pgf, max_set, max_pgf, eps_schwarz, &
1161 n_threads, i_thread)
1163 shm_master_x_data%screen_funct_coeffs_set, &
1164 shm_master_x_data%screen_funct_coeffs_kind, &
1165 shm_master_x_data%screen_funct_coeffs_pgf, &
1166 shm_master_x_data%pair_dist_radii_pgf, &
1167 max_set, max_pgf, n_threads, i_thread, p_work)
1169 shm_master_x_data%screen_funct_is_initialized = .true.
1172 screen_coeffs_set => shm_master_x_data%screen_funct_coeffs_set
1173 screen_coeffs_kind => shm_master_x_data%screen_funct_coeffs_kind
1174 screen_coeffs_pgf => shm_master_x_data%screen_funct_coeffs_pgf
1175 radii_pgf => shm_master_x_data%pair_dist_radii_pgf
1177 CALL timestop(handle)
1188 SUBROUTINE get_potential_parameters(mp2_env, l_max, para_env, mp2_potential_parameter)
1191 INTEGER,
INTENT(IN) :: l_max
1199 IF (para_env%is_source())
THEN
1200 CALL open_file(unit_number=unit_id, file_name=mp2_env%potential_parameter%filename)
1202 CALL init(l_max, unit_id, para_env%mepos, para_env)
1203 IF (para_env%is_source())
THEN
1208 mp2_potential_parameter%cutoff_radius = mp2_env%potential_parameter%cutoff_radius/2.0_dp
1210 mp2_potential_parameter%omega = mp2_env%potential_parameter%omega
1213 mp2_potential_parameter%potential_type = mp2_env%potential_parameter%potential_type
1215 END SUBROUTINE get_potential_parameters
1225 SUBROUTINE get_ncos_and_ncsgf(natom, kind_of, basis_parameter, ncos_max, nsgf_max)
1227 INTEGER,
INTENT(IN) :: natom
1228 INTEGER,
DIMENSION(:),
INTENT(IN) :: kind_of
1230 INTEGER,
INTENT(INOUT) :: ncos_max, nsgf_max
1232 INTEGER :: iatom, ikind, iset, nseta
1233 INTEGER,
DIMENSION(:),
POINTER :: la_max, npgfa, nsgfa
1236 ikind = kind_of(iatom)
1237 nseta = basis_parameter(ikind)%nset
1238 npgfa => basis_parameter(ikind)%npgf
1239 la_max => basis_parameter(ikind)%lmax
1240 nsgfa => basis_parameter(ikind)%nsgf
1242 ncos_max = max(ncos_max,
ncoset(la_max(iset)))
1243 nsgf_max = max(nsgf_max, nsgfa(iset))
1247 END SUBROUTINE get_ncos_and_ncsgf
1258 SUBROUTINE get_max_contraction(max_contraction, max_set, natom, max_pgf, kind_of, basis_parameter)
1260 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :), &
1261 INTENT(OUT) :: max_contraction
1262 INTEGER,
INTENT(IN) :: max_set, natom
1263 INTEGER,
INTENT(OUT) :: max_pgf
1264 INTEGER,
DIMENSION(:),
INTENT(IN) :: kind_of
1267 INTEGER :: i, jatom, jkind, jset, ncob, nsetb, sgfb
1268 INTEGER,
DIMENSION(:),
POINTER :: lb_max, npgfb, nsgfb
1269 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgfb
1270 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: sphi_b
1272 ALLOCATE (max_contraction(max_set, natom))
1274 max_contraction = 0.0_dp
1277 jkind = kind_of(jatom)
1278 lb_max => basis_parameter(jkind)%lmax
1279 nsetb = basis_parameter(jkind)%nset
1280 npgfb => basis_parameter(jkind)%npgf
1281 first_sgfb => basis_parameter(jkind)%first_sgf
1282 sphi_b => basis_parameter(jkind)%sphi
1283 nsgfb => basis_parameter(jkind)%nsgf
1286 ncob = npgfb(jset)*
ncoset(lb_max(jset))
1287 sgfb = first_sgfb(1, jset)
1290 max_contraction(jset, jatom) = maxval((/(sum(abs(sphi_b(1:ncob, i))), i=sgfb, sgfb + nsgfb(jset) - 1)/))
1291 max_pgf = max(max_pgf, npgfb(jset))
1295 END SUBROUTINE get_max_contraction
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)
...
subroutine, public init_aux_basis_set(gto_basis_set)
...
Handles all functions related to the CELL.
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. Tracking of preconnections.
subroutine, public open_file(file_name, file_status, file_form, file_action, file_position, file_pad, unit_number, debug, skip_get_unit_number, file_access)
Opens the requested file using a free unit number.
subroutine, public close_file(unit_number, file_status, keep_preconnection)
Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.
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
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_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,...
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp)
creates a new full matrix with the given structure
Calculation of the incomplete Gamma function F_n(t) for multi-center integrals over Cartesian Gaussia...
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....
Routines to calculate HFX energy and potential.
subroutine, public coulomb4(lib, 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, p_work)
calculates two-electron integrals of a quartet/shell using the library lib_int in the periodic case
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, lib, potential_parameter, coeffs_set, coeffs_kind, coeffs_pgf, radii_pgf, max_set, max_pgf, n_threads, i_thread, p_work)
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.
real(dp), parameter, public log_zero
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
Defines the basic variable types.
integer, parameter, public int_8
integer, parameter, public dp
Interface to the Libint-Library or a c++ wrapper.
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_lib, p_work, 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.
integer, save, public init_tshpsc_lmax
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, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs)
Get the QUICKSTEP environment.
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, 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, 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, init_u_ramping_each_scf, reltmat, ghost, 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, basis_type, total_zeff_corr, npgf_seg)
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.
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
keeps the information about the structure of a full matrix
stores some data used in construction of Kohn-Sham matrix
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.