61#include "./base/base_uses.f90"
68 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'mp2_ri_libint'
92 SUBROUTINE libint_ri_mp2(dimen, RI_dimen, occupied, natom, mp2_biel, mp2_env, C, &
94 RI_basis_parameter, RI_basis_info, basis_S0, RI_index_table, &
97 INTEGER :: dimen, ri_dimen, occupied, natom
100 REAL(kind=
dp),
DIMENSION(dimen, dimen) :: c
101 INTEGER,
DIMENSION(:) :: kind_of
105 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: ri_index_table
108 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: lai
110 CHARACTER(LEN=*),
PARAMETER :: routinen =
'libint_ri_mp2'
112 INTEGER :: handle, nkind
114 CALL timeset(routinen, handle)
117 IF (.NOT. (
ASSOCIATED(ri_basis_parameter)))
THEN
118 IF (
ALLOCATED(ri_index_table))
DEALLOCATE (ri_index_table)
119 IF (
ASSOCIATED(basis_s0))
DEALLOCATE (basis_s0)
121 natom, nkind, kind_of, ri_index_table, ri_dimen, &
125 CALL calc_lai_libint(mp2_env, qs_env, para_env, &
126 mp2_biel, dimen, c, occupied, &
127 ri_basis_parameter, ri_basis_info, ri_index_table, ri_dimen, basis_s0, &
130 CALL timestop(handle)
150 natom, nkind, kind_of, RI_index_table, RI_dimen, &
155 INTEGER :: natom, nkind
156 INTEGER,
DIMENSION(:) :: kind_of
157 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: ri_index_table
161 INTEGER :: co_counter, counter, i, iatom, ikind, ipgf, iset, j, k, la, max_am_kind, &
162 max_coeff, max_nsgfl, max_pgf, max_pgf_kind, max_set, nl_count, nset, nseta, offset_a, &
163 offset_a1, s_offset_nl_a, sgfa, so_counter
164 INTEGER,
DIMENSION(:),
POINTER :: la_max, la_min, npgfa, nshell
165 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgfa, nl_a
166 REAL(
dp),
DIMENSION(:, :),
POINTER :: sphi_a
168 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
171 NULLIFY (ri_basis_parameter)
173 NULLIFY (qs_kind_set)
174 CALL get_qs_env(qs_env=qs_env, qs_kind_set=qs_kind_set)
176 nkind =
SIZE(qs_kind_set, 1)
177 ALLOCATE (ri_basis_parameter(nkind))
178 ALLOCATE (basis_s0(nkind))
182 atom_kind => qs_kind_set(ikind)
186 basis_set=orb_basis_a, basis_type=
"RI_AUX")
187 IF (.NOT. (
ASSOCIATED(orb_basis_a)))
THEN
188 cpabort(
"Initial RI auxiliary basis not specified.")
190 orb_basis_a%gcc = 1.0_dp
191 orb_basis_a%norm_type = 1
195 maxsgf=ri_basis_info%max_sgf, &
196 maxnset=ri_basis_info%max_set, &
197 maxlgto=ri_basis_info%max_am, &
200 lmax=ri_basis_parameter(ikind)%lmax, &
201 lmin=ri_basis_parameter(ikind)%lmin, &
202 npgf=ri_basis_parameter(ikind)%npgf, &
203 nset=ri_basis_parameter(ikind)%nset, &
204 zet=ri_basis_parameter(ikind)%zet, &
205 nsgf_set=ri_basis_parameter(ikind)%nsgf, &
206 first_sgf=ri_basis_parameter(ikind)%first_sgf, &
207 sphi=ri_basis_parameter(ikind)%sphi, &
208 nsgf=ri_basis_parameter(ikind)%nsgf_total, &
209 l=ri_basis_parameter(ikind)%nl, &
210 nshell=ri_basis_parameter(ikind)%nshell, &
211 set_radius=ri_basis_parameter(ikind)%set_radius, &
212 pgf_radius=ri_basis_parameter(ikind)%pgf_radius, &
213 kind_radius=ri_basis_parameter(ikind)%kind_radius)
215 max_set = max(max_set, ri_basis_parameter(ikind)%nset)
217 basis_s0(ikind)%kind_radius = ri_basis_parameter(ikind)%kind_radius
218 basis_s0(ikind)%nset = 1
219 basis_s0(ikind)%nsgf_total = 1
220 ALLOCATE (basis_s0(ikind)%set_radius(1))
221 basis_s0(ikind)%set_radius(1) = ri_basis_parameter(ikind)%kind_radius
222 ALLOCATE (basis_s0(ikind)%lmax(1))
223 basis_s0(ikind)%lmax(1) = 0
224 ALLOCATE (basis_s0(ikind)%lmin(1))
225 basis_s0(ikind)%lmin(1) = 0
226 ALLOCATE (basis_s0(ikind)%npgf(1))
227 basis_s0(ikind)%npgf(1) = 1
228 ALLOCATE (basis_s0(ikind)%nsgf(1))
229 basis_s0(ikind)%nsgf(1) = 1
230 ALLOCATE (basis_s0(ikind)%nshell(1))
231 basis_s0(ikind)%nshell(1) = 1
232 ALLOCATE (basis_s0(ikind)%pgf_radius(1, 1))
233 basis_s0(ikind)%pgf_radius(1, 1) = ri_basis_parameter(ikind)%kind_radius
234 ALLOCATE (basis_s0(ikind)%sphi(1, 1))
235 basis_s0(ikind)%sphi(1, 1) = 1.0_dp
236 ALLOCATE (basis_s0(ikind)%zet(1, 1))
237 basis_s0(ikind)%zet(1, 1) = 0.0_dp
238 ALLOCATE (basis_s0(ikind)%first_sgf(1, 1))
239 basis_s0(ikind)%first_sgf(1, 1) = 1
240 ALLOCATE (basis_s0(ikind)%nl(1, 1))
241 basis_s0(ikind)%nl(1, 1) = 0
243 ALLOCATE (basis_s0(ikind)%nsgfl(0:0, 1))
244 basis_s0(ikind)%nsgfl = 1
245 ALLOCATE (basis_s0(ikind)%sphi_ext(1, 0:0, 1, 1))
246 basis_s0(ikind)%sphi_ext(1, 0, 1, 1) = 1.0_dp
249 ri_basis_info%max_set = max_set
252 ALLOCATE (ri_basis_parameter(ikind)%nsgfl(0:ri_basis_info%max_am, max_set))
253 ri_basis_parameter(ikind)%nsgfl = 0
254 nset = ri_basis_parameter(ikind)%nset
255 nshell => ri_basis_parameter(ikind)%nshell
257 DO i = 0, ri_basis_info%max_am
259 DO j = 1, nshell(iset)
260 IF (ri_basis_parameter(ikind)%nl(j, iset) == i) nl_count = nl_count + 1
262 ri_basis_parameter(ikind)%nsgfl(i, iset) = nl_count
273 npgfa => ri_basis_parameter(ikind)%npgf
274 nseta = ri_basis_parameter(ikind)%nset
275 nl_a => ri_basis_parameter(ikind)%nsgfl
276 la_max => ri_basis_parameter(ikind)%lmax
277 la_min => ri_basis_parameter(ikind)%lmin
279 max_pgf_kind = max(max_pgf_kind, npgfa(iset))
280 max_pgf = max(max_pgf, npgfa(iset))
281 DO la = la_min(iset), la_max(iset)
282 max_nsgfl = max(max_nsgfl, nl_a(la, iset))
283 max_coeff = max(max_coeff,
nso(la)*nl_a(la, iset)*
nco(la))
284 max_am_kind = max(max_am_kind, la)
287 ALLOCATE (ri_basis_parameter(ikind)%sphi_ext(max_coeff, 0:max_am_kind, max_pgf_kind, nseta))
288 ri_basis_parameter(ikind)%sphi_ext = 0.0_dp
292 sphi_a => ri_basis_parameter(ikind)%sphi
293 nseta = ri_basis_parameter(ikind)%nset
294 la_max => ri_basis_parameter(ikind)%lmax
295 la_min => ri_basis_parameter(ikind)%lmin
296 npgfa => ri_basis_parameter(ikind)%npgf
297 first_sgfa => ri_basis_parameter(ikind)%first_sgf
298 nl_a => ri_basis_parameter(ikind)%nsgfl
300 sgfa = first_sgfa(1, iset)
301 DO ipgf = 1, npgfa(iset)
302 offset_a1 = (ipgf - 1)*
ncoset(la_max(iset))
304 DO la = la_min(iset), la_max(iset)
305 offset_a = offset_a1 +
ncoset(la - 1)
307 co_counter = co_counter + 1
309 DO k = sgfa + s_offset_nl_a, sgfa + s_offset_nl_a +
nso(la)*nl_a(la, iset) - 1
310 DO i = offset_a + 1, offset_a +
nco(la)
311 so_counter = so_counter + 1
312 ri_basis_parameter(ikind)%sphi_ext(so_counter, la, ipgf, iset) = sphi_a(i, k)
315 s_offset_nl_a = s_offset_nl_a +
nso(la)*(nl_a(la, iset))
321 ALLOCATE (ri_index_table(natom, max_set))
322 ri_index_table = -huge(0)
326 ikind = kind_of(iatom)
327 nset = ri_basis_parameter(ikind)%nset
329 ri_index_table(iatom, iset) = counter + 1
330 counter = counter + ri_basis_parameter(ikind)%nsgf(iset)
331 ri_dimen = ri_dimen + ri_basis_parameter(ikind)%nsgf(iset)
347 TYPE(
hfx_basis_type),
DIMENSION(:),
POINTER :: ri_basis_parameter, basis_s0
353 DO i = 1,
SIZE(ri_basis_parameter)
354 DEALLOCATE (ri_basis_parameter(i)%nsgfl)
355 DEALLOCATE (ri_basis_parameter(i)%sphi_ext)
357 DEALLOCATE (ri_basis_parameter)
360 DO i = 1,
SIZE(basis_s0)
361 DEALLOCATE (basis_s0(i)%set_radius)
362 DEALLOCATE (basis_s0(i)%lmax)
363 DEALLOCATE (basis_s0(i)%lmin)
364 DEALLOCATE (basis_s0(i)%npgf)
365 DEALLOCATE (basis_s0(i)%nsgf)
366 DEALLOCATE (basis_s0(i)%nshell)
367 DEALLOCATE (basis_s0(i)%pgf_radius)
368 DEALLOCATE (basis_s0(i)%sphi)
369 DEALLOCATE (basis_s0(i)%zet)
370 DEALLOCATE (basis_s0(i)%first_sgf)
371 DEALLOCATE (basis_s0(i)%nl)
372 DEALLOCATE (basis_s0(i)%nsgfl)
373 DEALLOCATE (basis_s0(i)%sphi_ext)
375 DEALLOCATE (basis_s0)
398 SUBROUTINE calc_lai_libint(mp2_env, qs_env, para_env, &
399 mp2_biel, dimen, C, occupied, &
400 RI_basis_parameter, RI_basis_info, RI_index_table, RI_dimen, basis_S0, &
408 REAL(kind=
dp),
DIMENSION(dimen, dimen) :: c
412 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: ri_index_table
415 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: lai
417 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calc_lai_libint'
419 INTEGER :: counter_l_blocks, handle, i, i_list_kl, i_set_list_kl, i_set_list_kl_start, &
420 i_set_list_kl_stop, iatom, iatom_end, iatom_start, iib, ikind, info_chol, iset, jatom, &
421 jatom_end, jatom_start, jjb, jkind, jset, katom, katom_end, katom_start, kkb, kkind, &
422 kset, kset_start, l_b_i_end, l_b_i_start, l_b_k_end, l_b_k_start, latom, latom_end, &
423 latom_start, lkind, llb, lset, max_pgf, max_set, natom, ncob, nints, nseta, nsetb, nsetc, &
424 nsetd, nsgf_max, nspins, orb_k_end, orb_k_start, orb_l_end, orb_l_start, &
425 primitive_counter, sphi_a_u1, sphi_a_u2, sphi_a_u3, sphi_b_u1, sphi_b_u2, sphi_b_u3
426 INTEGER :: sphi_c_u1, sphi_c_u2, sphi_c_u3, sphi_d_u1, sphi_d_u2, sphi_d_u3, virtual
427 INTEGER(int_8) :: estimate_to_store_int, neris_tmp, &
428 neris_total, nprim_ints
429 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: kind_of, nimages
430 INTEGER,
DIMENSION(:),
POINTER :: la_max, la_min, lb_max, lb_min, lc_max, &
431 lc_min, ld_max, ld_min, npgfa, npgfb, &
432 npgfc, npgfd, nsgfa, nsgfb, nsgfc, &
434 INTEGER,
DIMENSION(:, :),
POINTER :: nsgfl_a, nsgfl_b, nsgfl_c, nsgfl_d
435 LOGICAL :: do_periodic
436 LOGICAL,
DIMENSION(:, :),
POINTER :: shm_atomic_pair_list
437 REAL(kind=
dp) :: cartesian_estimate, coeffs_kind_max0, eps_schwarz, ln_10, &
438 log10_eps_schwarz, log10_pmax, max_contraction_val, pmax_atom, pmax_entry, ra(3), rb(3), &
440 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: ee_buffer1, ee_buffer2, &
441 ee_primitives_tmp, ee_work2, &
443 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: l_block, l_full_matrix, max_contraction
444 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: bi1, mnrs
445 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: shm_pmax_block, zeta, zetb, zetc, zetd
446 REAL(kind=
dp),
DIMENSION(:, :, :),
POINTER :: sphi_a_ext_set, sphi_b_ext_set, &
447 sphi_c_ext_set, sphi_d_ext_set
448 REAL(kind=
dp),
DIMENSION(:, :, :, :),
POINTER :: sphi_a_ext, sphi_b_ext, sphi_c_ext, &
455 TYPE(hfx_pgf_list),
ALLOCATABLE,
DIMENSION(:) :: pgf_list_ij, pgf_list_kl
456 TYPE(hfx_potential_type) :: mp2_potential_parameter
457 TYPE(hfx_screen_coeff_type),
ALLOCATABLE, &
458 DIMENSION(:, :),
TARGET :: radii_pgf_large, screen_coeffs_pgf_large
459 TYPE(hfx_screen_coeff_type),
DIMENSION(:, :), &
460 POINTER :: screen_coeffs_kind, tmp_r_1, tmp_r_2, &
461 tmp_screen_pgf1, tmp_screen_pgf2
462 TYPE(hfx_screen_coeff_type), &
463 DIMENSION(:, :, :, :),
POINTER :: screen_coeffs_set
464 TYPE(hfx_screen_coeff_type), &
465 DIMENSION(:, :, :, :, :, :),
POINTER :: radii_pgf, screen_coeffs_pgf
466 TYPE(
hfx_type),
POINTER :: actual_x_data
469 DIMENSION(:) :: set_list_kl
472 CALL timeset(routinen, handle)
478 neris_total = 0_int_8
481 CALL prepare_integral_calc(cell, qs_env, mp2_env, para_env, mp2_potential_parameter, actual_x_data, &
482 do_periodic, basis_parameter, max_set, particle_set, natom, kind_of, &
483 nsgf_max, primitive_integrals, ee_work2, ee_buffer1, ee_buffer2, &
484 ee_primitives_tmp, nspins, max_contraction, max_pgf, pgf_list_ij, &
485 pgf_list_kl, nimages, eps_schwarz, log10_eps_schwarz, &
486 screen_coeffs_set, screen_coeffs_kind, screen_coeffs_pgf, &
487 radii_pgf, ri_basis_parameter, ri_basis_info)
489 ALLOCATE (radii_pgf_large(
SIZE(radii_pgf, 1),
SIZE(radii_pgf, 2)))
490 ALLOCATE (screen_coeffs_pgf_large(
SIZE(screen_coeffs_pgf, 1),
SIZE(screen_coeffs_pgf, 2)))
491 DO iib = 1,
SIZE(radii_pgf, 1)
492 DO jjb = 1,
SIZE(radii_pgf, 2)
493 radii_pgf_large(iib, jjb)%x = 100_dp
496 DO iib = 1,
SIZE(screen_coeffs_pgf, 1)
497 DO jjb = 1,
SIZE(screen_coeffs_pgf, 2)
498 screen_coeffs_pgf_large(iib, jjb)%x = 5000_dp
501 tmp_r_1 => radii_pgf_large(:, :)
502 tmp_r_2 => radii_pgf_large(:, :)
503 tmp_screen_pgf1 => screen_coeffs_pgf_large(:, :)
504 tmp_screen_pgf2 => screen_coeffs_pgf_large(:, :)
507 ALLOCATE (l_full_matrix(ri_dimen, ri_dimen))
508 l_full_matrix = 0.0_dp
514 ikind = kind_of(iatom)
515 jkind = kind_of(jatom)
516 ra = particle_set(iatom)%r(:)
517 rb = particle_set(jatom)%r(:)
519 la_max => ri_basis_parameter(ikind)%lmax
520 la_min => ri_basis_parameter(ikind)%lmin
521 npgfa => ri_basis_parameter(ikind)%npgf
522 nseta = ri_basis_parameter(ikind)%nset
523 zeta => ri_basis_parameter(ikind)%zet
524 nsgfa => ri_basis_parameter(ikind)%nsgf
525 sphi_a_ext => ri_basis_parameter(ikind)%sphi_ext(:, :, :, :)
526 nsgfl_a => ri_basis_parameter(ikind)%nsgfl
527 sphi_a_u1 = ubound(sphi_a_ext, 1)
528 sphi_a_u2 = ubound(sphi_a_ext, 2)
529 sphi_a_u3 = ubound(sphi_a_ext, 3)
531 lb_max => basis_s0(jkind)%lmax
532 lb_min => basis_s0(jkind)%lmin
533 npgfb => basis_s0(jkind)%npgf
534 nsetb = basis_s0(jkind)%nset
535 zetb => basis_s0(jkind)%zet
536 nsgfb => basis_s0(jkind)%nsgf
537 sphi_b_ext => basis_s0(jkind)%sphi_ext(:, :, :, :)
538 nsgfl_b => basis_s0(jkind)%nsgfl
539 sphi_b_u1 = ubound(sphi_b_ext, 1)
540 sphi_b_u2 = ubound(sphi_b_ext, 2)
541 sphi_b_u3 = ubound(sphi_b_ext, 3)
543 DO katom = iatom, natom
546 kkind = kind_of(katom)
547 lkind = kind_of(latom)
548 rc = particle_set(katom)%r(:)
549 rd = particle_set(latom)%r(:)
551 lc_max => ri_basis_parameter(kkind)%lmax
552 lc_min => ri_basis_parameter(kkind)%lmin
553 npgfc => ri_basis_parameter(kkind)%npgf
554 nsetc = ri_basis_parameter(kkind)%nset
555 zetc => ri_basis_parameter(kkind)%zet
556 nsgfc => ri_basis_parameter(kkind)%nsgf
557 sphi_c_ext => ri_basis_parameter(kkind)%sphi_ext(:, :, :, :)
558 nsgfl_c => ri_basis_parameter(kkind)%nsgfl
559 sphi_c_u1 = ubound(sphi_c_ext, 1)
560 sphi_c_u2 = ubound(sphi_c_ext, 2)
561 sphi_c_u3 = ubound(sphi_c_ext, 3)
563 ld_max => basis_s0(lkind)%lmax
564 ld_min => basis_s0(lkind)%lmin
565 npgfd => basis_s0(lkind)%npgf
566 nsetd = ri_basis_parameter(lkind)%nset
567 zetd => basis_s0(lkind)%zet
568 nsgfd => basis_s0(lkind)%nsgf
569 sphi_d_ext => basis_s0(lkind)%sphi_ext(:, :, :, :)
570 nsgfl_d => basis_s0(lkind)%nsgfl
571 sphi_d_u1 = ubound(sphi_d_ext, 1)
572 sphi_d_u2 = ubound(sphi_d_ext, 2)
573 sphi_d_u3 = ubound(sphi_d_ext, 3)
579 ncob = npgfb(jset)*
ncoset(lb_max(jset))
580 sphi_a_ext_set => sphi_a_ext(:, :, :, iset)
581 sphi_b_ext_set => sphi_b_ext(:, :, :, jset)
583 l_b_i_start = ri_index_table(iatom, iset)
584 l_b_i_end = ri_index_table(iatom, iset) + nsgfa(iset) - 1
587 IF (iatom == katom) kset_start = iset
588 DO kset = kset_start, nsetc
590 counter_l_blocks = counter_l_blocks + 1
591 IF (mod(counter_l_blocks, para_env%num_pe) /= para_env%mepos) cycle
593 sphi_c_ext_set => sphi_c_ext(:, :, :, kset)
594 sphi_d_ext_set => sphi_d_ext(:, :, :, lset)
596 l_b_k_start = ri_index_table(katom, kset)
597 l_b_k_end = ri_index_table(katom, kset) + nsgfc(kset) - 1
600 log10_pmax = pmax_entry
603 max_contraction_val = 1.0000_dp
605 ALLOCATE (l_block(nsgfa(iset), nsgfc(kset)))
607 CALL coulomb4(actual_x_data%eri4_context, ra, rb, rc, rd, npgfa(iset), npgfb(jset), npgfc(kset), npgfd(lset), &
608 la_min(iset), la_max(iset), lb_min(jset), lb_max(jset), &
609 lc_min(kset), lc_max(kset), ld_min(lset), ld_max(lset), &
610 nsgfa(iset), nsgfb(jset), nsgfc(kset), nsgfd(lset), &
611 sphi_a_u1, sphi_a_u2, sphi_a_u3, &
612 sphi_b_u1, sphi_b_u2, sphi_b_u3, &
613 sphi_c_u1, sphi_c_u2, sphi_c_u3, &
614 sphi_d_u1, sphi_d_u2, sphi_d_u3, &
615 zeta(1:npgfa(iset), iset), zetb(1:npgfb(jset), jset), &
616 zetc(1:npgfc(kset), kset), zetd(1:npgfd(lset), lset), &
617 primitive_integrals, &
618 mp2_potential_parameter, &
619 actual_x_data%neighbor_cells, screen_coeffs_set(1, 1, 1, 1)%x, &
620 screen_coeffs_set(1, 1, 1, 1)%x, eps_schwarz, &
621 max_contraction_val, cartesian_estimate, cell, neris_tmp, &
622 log10_pmax, log10_eps_schwarz, &
623 tmp_r_1, tmp_r_2, tmp_screen_pgf1, tmp_screen_pgf2, &
624 pgf_list_ij, pgf_list_kl, nsgfl_a(:, iset), nsgfl_b(:, jset), &
625 nsgfl_c(:, kset), nsgfl_d(:, lset), &
630 ee_work2, ee_buffer1, ee_buffer2, ee_primitives_tmp, &
631 nimages, do_periodic)
633 primitive_counter = 0
634 DO llb = 1, nsgfd(lset)
635 DO kkb = 1, nsgfc(kset)
636 DO jjb = 1, nsgfb(jset)
637 DO iib = 1, nsgfa(iset)
638 primitive_counter = primitive_counter + 1
639 l_block(iib, kkb) = primitive_integrals(primitive_counter)
645 l_full_matrix(l_b_i_start:l_b_i_end, l_b_k_start:l_b_k_end) = l_block
646 l_full_matrix(l_b_k_start:l_b_k_end, l_b_i_start:l_b_i_end) = transpose(l_block)
657 CALL para_env%sum(l_full_matrix)
663 NULLIFY (fm_struct_l)
665 ncol_global=ri_dimen, para_env=para_env)
666 CALL cp_fm_create(fm_matrix_l, fm_struct_l, name=
"fm_matrix_L")
670 CALL cp_fm_set_submatrix(fm=fm_matrix_l, new_values=l_full_matrix, start_row=1, start_col=1, &
671 n_rows=ri_dimen, n_cols=ri_dimen)
675 cpassert(info_chol == 0)
681 l_full_matrix = 0.0_dp
687 l_full_matrix(iib + 1:ri_dimen, iib) = 0.0_dp
690 ALLOCATE (list_kl%elements(natom**2))
692 coeffs_kind_max0 = maxval(screen_coeffs_kind(:, :)%x(2))
693 ALLOCATE (set_list_kl((max_set*natom)**2))
696 actual_x_data%pmax_block = 0.0_dp
697 shm_pmax_block => actual_x_data%pmax_block
699 shm_atomic_pair_list => actual_x_data%atomic_pair_list
711 latom_start, latom_end, &
712 kind_of, basis_parameter, particle_set, &
713 do_periodic, screen_coeffs_set, screen_coeffs_kind, &
714 coeffs_kind_max0, log10_eps_schwarz, cell, 0.d+00, &
715 shm_atomic_pair_list)
717 virtual = dimen - occupied
719 ALLOCATE (lai(ri_dimen, virtual, occupied))
725 ikind = kind_of(iatom)
726 jkind = kind_of(jatom)
727 ra = particle_set(iatom)%r(:)
728 rb = particle_set(jatom)%r(:)
730 la_max => ri_basis_parameter(ikind)%lmax
731 la_min => ri_basis_parameter(ikind)%lmin
732 npgfa => ri_basis_parameter(ikind)%npgf
733 nseta = ri_basis_parameter(ikind)%nset
734 zeta => ri_basis_parameter(ikind)%zet
735 nsgfa => ri_basis_parameter(ikind)%nsgf
736 sphi_a_ext => ri_basis_parameter(ikind)%sphi_ext(:, :, :, :)
737 nsgfl_a => ri_basis_parameter(ikind)%nsgfl
738 sphi_a_u1 = ubound(sphi_a_ext, 1)
739 sphi_a_u2 = ubound(sphi_a_ext, 2)
740 sphi_a_u3 = ubound(sphi_a_ext, 3)
742 lb_max => basis_s0(jkind)%lmax
743 lb_min => basis_s0(jkind)%lmin
744 npgfb => basis_s0(jkind)%npgf
745 nsetb = basis_s0(jkind)%nset
746 zetb => basis_s0(jkind)%zet
747 nsgfb => basis_s0(jkind)%nsgf
748 sphi_b_ext => basis_s0(jkind)%sphi_ext(:, :, :, :)
749 nsgfl_b => basis_s0(jkind)%nsgfl
750 sphi_b_u1 = ubound(sphi_b_ext, 1)
751 sphi_b_u2 = ubound(sphi_b_ext, 2)
752 sphi_b_u3 = ubound(sphi_b_ext, 3)
757 counter_l_blocks = counter_l_blocks + 1
758 IF (mod(counter_l_blocks, para_env%num_pe) /= para_env%mepos) cycle
760 ncob = npgfb(jset)*
ncoset(lb_max(jset))
761 sphi_a_ext_set => sphi_a_ext(:, :, :, iset)
762 sphi_b_ext_set => sphi_b_ext(:, :, :, jset)
764 l_b_i_start = ri_index_table(iatom, iset)
765 l_b_i_end = ri_index_table(iatom, iset) + nsgfa(iset) - 1
767 ALLOCATE (bi1(dimen, dimen, nsgfa(iset)))
770 DO i_list_kl = 1, list_kl%n_element
772 katom = list_kl%elements(i_list_kl)%pair(1)
773 latom = list_kl%elements(i_list_kl)%pair(2)
775 i_set_list_kl_start = list_kl%elements(i_list_kl)%set_bounds(1)
776 i_set_list_kl_stop = list_kl%elements(i_list_kl)%set_bounds(2)
777 kkind = list_kl%elements(i_list_kl)%kind_pair(1)
778 lkind = list_kl%elements(i_list_kl)%kind_pair(2)
779 rc = list_kl%elements(i_list_kl)%r1
780 rd = list_kl%elements(i_list_kl)%r2
784 lc_max => basis_parameter(kkind)%lmax
785 lc_min => basis_parameter(kkind)%lmin
786 npgfc => basis_parameter(kkind)%npgf
787 zetc => basis_parameter(kkind)%zet
788 nsgfc => basis_parameter(kkind)%nsgf
789 sphi_c_ext => basis_parameter(kkind)%sphi_ext(:, :, :, :)
790 nsgfl_c => basis_parameter(kkind)%nsgfl
791 sphi_c_u1 = ubound(sphi_c_ext, 1)
792 sphi_c_u2 = ubound(sphi_c_ext, 2)
793 sphi_c_u3 = ubound(sphi_c_ext, 3)
795 ld_max => basis_parameter(lkind)%lmax
796 ld_min => basis_parameter(lkind)%lmin
797 npgfd => basis_parameter(lkind)%npgf
798 zetd => basis_parameter(lkind)%zet
799 nsgfd => basis_parameter(lkind)%nsgf
800 sphi_d_ext => basis_parameter(lkind)%sphi_ext(:, :, :, :)
801 nsgfl_d => basis_parameter(lkind)%nsgfl
802 sphi_d_u1 = ubound(sphi_d_ext, 1)
803 sphi_d_u2 = ubound(sphi_d_ext, 2)
804 sphi_d_u3 = ubound(sphi_d_ext, 3)
806 DO i_set_list_kl = i_set_list_kl_start, i_set_list_kl_stop
807 kset = set_list_kl(i_set_list_kl)%pair(1)
808 lset = set_list_kl(i_set_list_kl)%pair(2)
810 IF (katom == latom .AND. lset < kset) cycle
812 orb_k_start = mp2_biel%index_table(katom, kset)
813 orb_k_end = orb_k_start + nsgfc(kset) - 1
814 orb_l_start = mp2_biel%index_table(latom, lset)
815 orb_l_end = orb_l_start + nsgfd(lset) - 1
820 sphi_c_ext_set => sphi_c_ext(:, :, :, kset)
821 sphi_d_ext_set => sphi_d_ext(:, :, :, lset)
823 log10_pmax = pmax_entry
826 IF (
ALLOCATED(mnrs))
DEALLOCATE (mnrs)
827 ALLOCATE (mnrs(nsgfd(lset), nsgfc(kset), nsgfa(iset)))
831 max_contraction_val = max_contraction(kset, katom)*max_contraction(lset, latom)
833 CALL coulomb4(actual_x_data%eri4_context, ra, rb, rc, rd, npgfa(iset), npgfb(jset), npgfc(kset), npgfd(lset), &
834 la_min(iset), la_max(iset), lb_min(jset), lb_max(jset), &
835 lc_min(kset), lc_max(kset), ld_min(lset), ld_max(lset), &
836 nsgfa(iset), nsgfb(jset), nsgfc(kset), nsgfd(lset), &
837 sphi_a_u1, sphi_a_u2, sphi_a_u3, &
838 sphi_b_u1, sphi_b_u2, sphi_b_u3, &
839 sphi_c_u1, sphi_c_u2, sphi_c_u3, &
840 sphi_d_u1, sphi_d_u2, sphi_d_u3, &
841 zeta(1:npgfa(iset), iset), zetb(1:npgfb(jset), jset), &
842 zetc(1:npgfc(kset), kset), zetd(1:npgfd(lset), lset), &
843 primitive_integrals, &
844 mp2_potential_parameter, &
845 actual_x_data%neighbor_cells, screen_coeffs_set(kset, kset, kkind, kkind)%x, &
846 screen_coeffs_set(kset, kset, kkind, kkind)%x, eps_schwarz, &
847 max_contraction_val, cartesian_estimate, cell, neris_tmp, &
848 log10_pmax, log10_eps_schwarz, &
849 tmp_r_1, tmp_r_2, tmp_screen_pgf1, tmp_screen_pgf2, &
850 pgf_list_ij, pgf_list_kl, nsgfl_a(:, iset), nsgfl_b(:, jset), &
851 nsgfl_c(:, kset), nsgfl_d(:, lset), &
856 ee_work2, ee_buffer1, ee_buffer2, ee_primitives_tmp, &
857 nimages, do_periodic)
859 nints = nsgfa(iset)*nsgfb(jset)*nsgfc(kset)*nsgfd(lset)
860 neris_total = neris_total + nints
861 nprim_ints = nprim_ints + neris_tmp
862 IF (cartesian_estimate == 0.0_dp) cartesian_estimate = tiny(cartesian_estimate)
863 estimate_to_store_int = exponent(cartesian_estimate)
864 estimate_to_store_int = max(estimate_to_store_int, -15_int_8)
865 cartesian_estimate = set_exponent(1.0_dp, estimate_to_store_int + 1)
867 primitive_counter = 0
868 DO llb = 1, nsgfd(lset)
869 DO kkb = 1, nsgfc(kset)
870 DO jjb = 1, nsgfb(jset)
871 DO iib = 1, nsgfa(iset)
872 primitive_counter = primitive_counter + 1
873 mnrs(llb, kkb, iib) = primitive_integrals(primitive_counter)
879 DO iib = 1, nsgfa(iset)
880 bi1(orb_l_start:orb_l_end, orb_k_start:orb_k_end, iib) = mnrs(:, :, iib)
881 bi1(orb_k_start:orb_k_end, orb_l_start:orb_l_end, iib) = transpose(mnrs(:, :, iib))
887 DO iib = 1, nsgfa(iset)
888 bi1(1:virtual, 1:occupied, iib) = matmul(transpose(c(1:dimen, occupied + 1:dimen)), &
889 matmul(bi1(1:dimen, 1:dimen, iib), c(1:dimen, 1:occupied)))
890 lai(l_b_i_start + iib - 1, 1:virtual, 1:occupied) = bi1(1:virtual, 1:occupied, iib)
898 CALL para_env%sum(lai)
901 IF (mod(iib, para_env%num_pe) == para_env%mepos)
THEN
902 lai(1:ri_dimen, 1:virtual, iib) = matmul(transpose(l_full_matrix), lai(1:ri_dimen, 1:virtual, iib))
904 lai(:, :, iib) = 0.0_dp
908 CALL para_env%sum(lai)
910 DEALLOCATE (set_list_kl)
913 DEALLOCATE (pgf_list_ij(i)%image_list)
914 DEALLOCATE (pgf_list_kl(i)%image_list)
917 DEALLOCATE (pgf_list_ij)
918 DEALLOCATE (pgf_list_kl)
920 DEALLOCATE (max_contraction, kind_of)
922 DEALLOCATE (ee_work2, ee_buffer1, ee_buffer2, ee_primitives_tmp)
926 CALL timestop(handle)
928 END SUBROUTINE calc_lai_libint
966 do_periodic, basis_parameter, max_set, particle_set, natom, kind_of, &
967 nsgf_max, primitive_integrals, ee_work2, ee_buffer1, ee_buffer2, &
968 ee_primitives_tmp, nspins, max_contraction, max_pgf, pgf_list_ij, &
969 pgf_list_kl, nimages, eps_schwarz, log10_eps_schwarz, &
970 screen_coeffs_set, screen_coeffs_kind, screen_coeffs_pgf, &
971 radii_pgf, RI_basis_parameter, RI_basis_info)
975 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
977 TYPE(hfx_potential_type),
INTENT(OUT) :: mp2_potential_parameter
978 TYPE(
hfx_type),
POINTER :: actual_x_data
979 LOGICAL,
INTENT(OUT) :: do_periodic
981 INTEGER,
INTENT(OUT) :: max_set
983 INTEGER,
INTENT(OUT) :: natom
984 INTEGER,
ALLOCATABLE,
DIMENSION(:),
INTENT(OUT) :: kind_of
985 INTEGER,
INTENT(OUT) :: nsgf_max
986 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:), &
987 INTENT(OUT) :: primitive_integrals, ee_work2, &
988 ee_buffer1, ee_buffer2, &
990 INTEGER,
INTENT(OUT) :: nspins
991 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :), &
992 INTENT(OUT) :: max_contraction
993 INTEGER,
INTENT(OUT) :: max_pgf
994 TYPE(hfx_pgf_list),
ALLOCATABLE,
DIMENSION(:), &
995 INTENT(OUT) :: pgf_list_ij, pgf_list_kl
996 INTEGER,
ALLOCATABLE,
DIMENSION(:),
INTENT(OUT) :: nimages
997 REAL(kind=
dp),
INTENT(OUT) :: eps_schwarz, log10_eps_schwarz
998 TYPE(hfx_screen_coeff_type), &
999 DIMENSION(:, :, :, :),
POINTER :: screen_coeffs_set
1000 TYPE(hfx_screen_coeff_type),
DIMENSION(:, :), &
1001 POINTER :: screen_coeffs_kind
1002 TYPE(hfx_screen_coeff_type), &
1003 DIMENSION(:, :, :, :, :, :),
POINTER :: screen_coeffs_pgf, radii_pgf
1005 POINTER :: ri_basis_parameter
1008 CHARACTER(LEN=*),
PARAMETER :: routinen =
'prepare_integral_calc'
1010 INTEGER :: handle, i_thread, ii, ikind, irep, &
1011 l_max, n_threads, ncos_max, nkind, &
1016 TYPE(
hfx_type),
POINTER :: shm_master_x_data
1018 CALL timeset(routinen, handle)
1020 NULLIFY (dft_control)
1025 atomic_kind_set=atomic_kind_set, &
1027 dft_control=dft_control)
1030 nkind =
SIZE(atomic_kind_set, 1)
1033 l_max = max(l_max, maxval(qs_env%x_data(1, 1)%basis_parameter(ikind)%lmax))
1035 IF (
PRESENT(ri_basis_parameter))
THEN
1037 l_max = max(l_max, maxval(ri_basis_parameter(ikind)%lmax))
1044 mp2_potential_parameter%cutoff_radius = mp2_env%potential_parameter%cutoff_radius/2.0_dp
1046 mp2_potential_parameter%omega = mp2_env%potential_parameter%omega
1048 mp2_potential_parameter%potential_type = mp2_env%potential_parameter%potential_type
1054 actual_x_data => qs_env%x_data(irep, i_thread + 1)
1056 shm_master_x_data => qs_env%x_data(irep, 1)
1058 do_periodic = actual_x_data%periodic_parameter%do_periodic
1060 IF (do_periodic)
THEN
1062 actual_x_data%periodic_parameter%number_of_shells = actual_x_data%periodic_parameter%mode
1067 basis_parameter => actual_x_data%basis_parameter
1068 basis_info => actual_x_data%basis_info
1070 max_set = basis_info%max_set
1071 IF (
PRESENT(ri_basis_info)) max_set = max(max_set, ri_basis_info%max_set)
1074 atomic_kind_set=atomic_kind_set, &
1075 particle_set=particle_set)
1077 natom =
SIZE(particle_set, 1)
1084 CALL get_ncos_and_ncsgf(natom, kind_of, basis_parameter, ncos_max, nsgf_max)
1085 IF (
PRESENT(ri_basis_parameter))
THEN
1086 CALL get_ncos_and_ncsgf(natom, kind_of, ri_basis_parameter, ncos_max, nsgf_max)
1090 ALLOCATE (primitive_integrals(nsgf_max**4))
1091 primitive_integrals = 0.0_dp
1093 ALLOCATE (ee_work2(ncos_max**4))
1094 ALLOCATE (ee_buffer1(ncos_max**4))
1095 ALLOCATE (ee_buffer2(ncos_max**4))
1096 ALLOCATE (ee_primitives_tmp(nsgf_max**4))
1098 nspins = dft_control%nspins
1100 CALL get_max_contraction(max_contraction, max_set, natom, max_pgf, kind_of, basis_parameter)
1103 nneighbors =
SIZE(actual_x_data%neighbor_cells)
1104 ALLOCATE (pgf_list_ij(max_pgf**2))
1105 ALLOCATE (pgf_list_kl(max_pgf**2))
1106 ALLOCATE (nimages(max_pgf**2))
1108 DO ii = 1, max_pgf**2
1109 ALLOCATE (pgf_list_ij(ii)%image_list(nneighbors))
1110 ALLOCATE (pgf_list_kl(ii)%image_list(nneighbors))
1116 eps_schwarz = actual_x_data%screening_parameter%eps_schwarz
1117 IF (eps_schwarz <= 0.0_dp)
THEN
1120 log10_eps_schwarz = log10(eps_schwarz)
1132 IF (.NOT. shm_master_x_data%screen_funct_is_initialized)
THEN
1134 shm_master_x_data%pair_dist_radii_pgf, max_set, max_pgf, eps_schwarz, &
1135 n_threads, i_thread)
1136 CALL calc_screening_functions(qs_env, basis_parameter, actual_x_data%eri4_context, shm_master_x_data%potential_parameter, &
1137 shm_master_x_data%screen_funct_coeffs_set, &
1138 shm_master_x_data%screen_funct_coeffs_kind, &
1139 shm_master_x_data%screen_funct_coeffs_pgf, &
1140 shm_master_x_data%pair_dist_radii_pgf, &
1141 max_set, max_pgf, n_threads, i_thread)
1143 shm_master_x_data%screen_funct_is_initialized = .true.
1146 screen_coeffs_set => shm_master_x_data%screen_funct_coeffs_set
1147 screen_coeffs_kind => shm_master_x_data%screen_funct_coeffs_kind
1148 screen_coeffs_pgf => shm_master_x_data%screen_funct_coeffs_pgf
1149 radii_pgf => shm_master_x_data%pair_dist_radii_pgf
1151 CALL timestop(handle)
1163 SUBROUTINE get_ncos_and_ncsgf(natom, kind_of, basis_parameter, ncos_max, nsgf_max)
1165 INTEGER,
INTENT(IN) :: natom
1166 INTEGER,
DIMENSION(:),
INTENT(IN) :: kind_of
1168 INTEGER,
INTENT(INOUT) :: ncos_max, nsgf_max
1170 INTEGER :: iatom, ikind, iset, nseta
1171 INTEGER,
DIMENSION(:),
POINTER :: la_max, npgfa, nsgfa
1174 ikind = kind_of(iatom)
1175 nseta = basis_parameter(ikind)%nset
1176 npgfa => basis_parameter(ikind)%npgf
1177 la_max => basis_parameter(ikind)%lmax
1178 nsgfa => basis_parameter(ikind)%nsgf
1180 ncos_max = max(ncos_max,
ncoset(la_max(iset)))
1181 nsgf_max = max(nsgf_max, nsgfa(iset))
1185 END SUBROUTINE get_ncos_and_ncsgf
1196 SUBROUTINE get_max_contraction(max_contraction, max_set, natom, max_pgf, kind_of, basis_parameter)
1198 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :), &
1199 INTENT(OUT) :: max_contraction
1200 INTEGER,
INTENT(IN) :: max_set, natom
1201 INTEGER,
INTENT(OUT) :: max_pgf
1202 INTEGER,
DIMENSION(:),
INTENT(IN) :: kind_of
1205 INTEGER :: i, jatom, jkind, jset, ncob, nsetb, sgfb
1206 INTEGER,
DIMENSION(:),
POINTER :: lb_max, npgfb, nsgfb
1207 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgfb
1208 REAL(kind=
dp),
DIMENSION(:, :),
POINTER :: sphi_b
1210 ALLOCATE (max_contraction(max_set, natom))
1212 max_contraction = 0.0_dp
1215 jkind = kind_of(jatom)
1216 lb_max => basis_parameter(jkind)%lmax
1217 nsetb = basis_parameter(jkind)%nset
1218 npgfb => basis_parameter(jkind)%npgf
1219 first_sgfb => basis_parameter(jkind)%first_sgf
1220 sphi_b => basis_parameter(jkind)%sphi
1221 nsgfb => basis_parameter(jkind)%nsgf
1224 ncob = npgfb(jset)*
ncoset(lb_max(jset))
1225 sgfb = first_sgfb(1, jset)
1228 max_contraction(jset, jatom) = maxval([(sum(abs(sphi_b(1:ncob, i))), i=sgfb, sgfb + nsgfb(jset) - 1)])
1229 max_pgf = max(max_pgf, npgfb(jset))
1233 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, ccon)
...
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...
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_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,...
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, nsgfl_a, nsgfl_b, nsgfl_c, nsgfl_d, sphi_a_ext, sphi_b_ext, sphi_c_ext, sphi_d_ext, 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
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.
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 message passing library MPI.
Routines to calculate the 3 and 2 center ERI's needed in the RI approximation using libint.
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...
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_work2, ee_buffer1, ee_buffer2, ee_primitives_tmp, nspins, max_contraction, max_pgf, pgf_list_ij, pgf_list_kl, nimages, eps_schwarz, log10_eps_schwarz, screen_coeffs_set, screen_coeffs_kind, screen_coeffs_pgf, radii_pgf, ri_basis_parameter, ri_basis_info)
...
Types needed for MP2 calculations.
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.
Radial fundamentals for Gaussian two-electron integrals. Entry m+1 stores order m....
subroutine, public r12_fundamentals_init(m_max, potential_parameter, para_env)
Prepare shared radial evaluator tables before entering a threaded evaluation region.
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.