115 SUBROUTINE libgint_update_env(fac, memory_parameter, do_periodic, cell, actual_x_data, nneighbors, max_pgf, &
116 natom, kind_of, particle_set, basis_parameter)
120 LOGICAL :: do_periodic
122 TYPE(
hfx_type),
POINTER :: actual_x_data
123 INTEGER :: nneighbors, max_pgf, natom
124 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: kind_of
129 REAL(
dp),
DIMENSION(:, :),
ALLOCATABLE :: cell_r
130 REAL(
dp),
DIMENSION(:),
ALLOCATABLE :: flat_gcc
131 INTEGER,
DIMENSION(:),
POINTER :: la_min, la_max, npgfa, nsgfa
132 INTEGER,
DIMENSION(:, :),
POINTER :: nsgfl_a
133 INTEGER :: i, l, iset, jset, iatom, ikind, nseta, inla, nla
135 REAL(
dp),
DIMENSION(:, :),
POINTER :: zeta
136 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: gcc
137 TYPE(
bra_t),
POINTER :: bra_p, ket_p
140 CALL libgint_set_hf_fac(libgint_handle,
fac)
142 CALL libgint_set_max_mem(libgint_handle, memory_parameter%max_memory)
146 ALLOCATE (cell_r(3, nneighbors))
148 cell_r(:, i) = actual_x_data%neighbor_cells(i)%cell_r(:)
150 CALL libgint_set_cell(libgint_handle, do_pbc, cell%hmat, cell%h_inv)
151 CALL libgint_set_neighs(libgint_handle, cell_r, nneighbors)
161 IF (
ALLOCATED(first_set_of_atom))
DEALLOCATE (first_set_of_atom)
162 ALLOCATE (first_set_of_atom(natom))
164 ikind = kind_of(iatom)
165 ra = particle_set(iatom)%r(:)
166 nseta = basis_parameter(ikind)%nset
167 npgfa => basis_parameter(ikind)%npgf
168 la_min => basis_parameter(ikind)%lmin
169 la_max => basis_parameter(ikind)%lmax
170 zeta => basis_parameter(ikind)%zet
171 nsgfa => basis_parameter(ikind)%nsgf
172 nsgfl_a => basis_parameter(ikind)%nsgfl
173 gcc => basis_parameter(ikind)%gcc
174 first_set_of_atom(iatom) = jset
176 CALL libgint_set_atom(libgint_handle, jset - 1, ra, zeta(:, iset), npgfa(iset))
178 DO l = la_min(iset), la_max(iset)
179 nla = nsgfl_a(l, iset)
180 IF (
ALLOCATED(flat_gcc))
DEALLOCATE (flat_gcc)
181 ALLOCATE (flat_gcc(npgfa(iset)*nla))
182 flat_gcc(:) = pack(gcc(1:npgfa(iset), inla:inla + nla - 1, iset), .true.)
183 CALL libgint_set_atom_l(libgint_handle, jset - 1, l, nla, flat_gcc)
191 mark_used(memory_parameter)
192 mark_used(do_periodic)
194 mark_used(actual_x_data)
195 mark_used(nneighbors)
199 mark_used(particle_set)
200 mark_used(basis_parameter)
201 cpabort(
"This CP2K executable has not been linked against the required library libGint.")
314 ra, rb, rc, rd, npgfa, npgfb, npgfc, npgfd, &
315 potential_parameter, &
316 screen1, screen2, log10_pmax, log10_eps_schwarz, &
318 neighbor_cells, cell, do_periodic, screened)
320 INTEGER,
INTENT(in) :: iatom, jatom, katom, latom, iset, jset, kset, lset
321 REAL(
dp),
INTENT(IN) :: ra(3), rb(3), rc(3), rd(3)
322 INTEGER,
INTENT(IN) :: npgfa, npgfb, npgfc, npgfd
324 REAL(
dp),
INTENT(IN) :: screen1(2), screen2(2)
325 REAL(
dp),
INTENT(IN) :: log10_pmax, log10_eps_schwarz
327 POINTER :: pgf1, pgf2
330 LOGICAL,
INTENT(IN) :: do_periodic
331 LOGICAL,
INTENT(out) :: screened
334 TYPE(
bra_t),
POINTER :: bra_p, ket_p
335 LOGICAL :: cell_was_screened
336 INTEGER :: idx_n1, idx_n2, n1, n2, idx_ij, idx_kl, o_ij, n_ij, o_kl, n_kl
337 INTEGER :: ipgf, jpgf, kpgf, lpgf, iatom_set, jatom_set, katom_set, latom_set
338 REAL(
dp) :: pgf_max_1, pgf_max_2
339 INTEGER :: nelements_ij, nelements_kl
342 potential_parameter = potential_parameter
347 iatom_set = first_set_of_atom(iatom) + iset - 2
348 jatom_set = first_set_of_atom(jatom) + jset - 2
349 katom_set = first_set_of_atom(katom) + kset - 2
350 latom_set = first_set_of_atom(latom) + lset - 2
353 pgf1, log10_pmax, log10_eps_schwarz, ra, rb, &
354 nelements_ij, neighbor_cells, do_periodic)
357 pgf2, log10_pmax, log10_eps_schwarz, rc, rd, &
358 nelements_kl, neighbor_cells, do_periodic)
369 DO idx_n1 = 1, bra%cell_cnt
371 n1 = bra%cell_idx(1, idx_n1)
372 n_ij = bra%cell_idx(2, idx_n1)
373 o_ij = bra%cell_idx(3, idx_n1)
375 DO idx_n2 = 1, ket%cell_cnt
377 n2 = ket%cell_idx(1, idx_n2)
378 n_kl = ket%cell_idx(2, idx_n2)
379 o_kl = ket%cell_idx(3, idx_n2)
381 cell_was_screened = .true.
382 DO idx_ij = o_ij + 1, o_ij + n_ij
384 ipgf = bra%pgf_idx(1, idx_ij)
385 jpgf = bra%pgf_idx(2, idx_ij)
387 pgf_max_1 = bra%pgf_scr(1, idx_ij)
389 DO idx_kl = o_kl + 1, o_kl + n_kl
390 kpgf = ket%pgf_idx(1, idx_kl)
391 lpgf = ket%pgf_idx(2, idx_kl)
393 pgf_max_2 = ket%pgf_scr(1, idx_kl)
395 IF (pgf_max_1 + pgf_max_2 + log10_pmax < log10_eps_schwarz) cycle
397 CALL libgint_add_prm(libgint_handle, ipgf - 1, jpgf - 1, kpgf - 1, lpgf - 1)
398 cell_was_screened = .false.
403 IF (.NOT. cell_was_screened)
THEN
404 CALL libgint_add_shell(libgint_handle, iatom_set, jatom_set, katom_set, latom_set, n1 - 1, n2 - 1)
427 mark_used(potential_parameter)
430 mark_used(log10_pmax)
431 mark_used(log10_eps_schwarz)
434 mark_used(neighbor_cells)
436 mark_used(do_periodic)
438 cpabort(
"This CP2K executable has not been linked against the required library libGint.")
501 iatom, jatom, katom, latom, &
502 iset, jset, kset, lset, &
503 atomic_offset_ac, atomic_offset_ad, atomic_offset_bc, atomic_offset_bd, &
504 offset_ac_set, offset_ad_set, offset_bc_set, offset_bd_set, &
505 nsgfa, nsgfb, nsgfc, nsgfd, &
506 la_min, la_max, lb_min, lb_max, &
507 lc_min, lc_max, ld_min, ld_max, &
508 nsgfl_a, nsgfl_b, nsgfl_c, nsgfl_d)
511 INTEGER :: iatom, jatom, katom, latom
512 INTEGER :: iset, jset, kset, lset
513 INTEGER :: atomic_offset_ac, atomic_offset_ad, atomic_offset_bc, atomic_offset_bd
514 INTEGER,
DIMENSION(:, :),
POINTER :: offset_ac_set, offset_ad_set
515 INTEGER,
DIMENSION(:, :),
POINTER :: offset_bc_set, offset_bd_set
516 INTEGER :: nsgfa, nsgfb, nsgfc, nsgfd
517 INTEGER :: la_min, la_max, lb_min, lb_max
518 INTEGER :: lc_min, lc_max, ld_min, ld_max
519 INTEGER,
DIMENSION(:, :),
POINTER :: nsgfl_a, nsgfl_b, nsgfl_c, nsgfl_d
540 LOGICAL(1) :: tac, tad, tbc, tbd
541 INTEGER :: offset_ac_l_set, offset_ad_l_set, offset_bc_l_set, offset_bd_l_set
542 INTEGER :: s_offset_a, s_offset_b, s_offset_c, s_offset_d
543 INTEGER :: s_offset_a_l, s_offset_b_l, s_offset_c_l, s_offset_d_l
544 INTEGER :: s_offset_ac, s_offset_ad, s_offset_bc, s_offset_bd
545 INTEGER :: ld_ac_set, ld_ad_set, ld_bc_set, ld_bd_set
546 INTEGER :: la, lb, lc, ld, nla, nlb, nlc, nld, inla, inlb, inlc, inld
556 IF (jatom >= latom)
THEN
557 offset_bd_l_set = offset_bd_set(jset, lset) + atomic_offset_bd - 2
561 offset_bd_l_set = offset_bd_set(lset, jset) + atomic_offset_bd - 2
565 IF (jatom >= katom)
THEN
566 offset_bc_l_set = offset_bc_set(jset, kset) + atomic_offset_bc - 2
570 offset_bc_l_set = offset_bc_set(kset, jset) + atomic_offset_bc - 2
575 IF (iatom >= latom)
THEN
576 offset_ad_l_set = offset_ad_set(iset, lset) + atomic_offset_ad - 2
580 offset_ad_l_set = offset_ad_set(lset, iset) + atomic_offset_ad - 2
585 IF (iatom >= katom)
THEN
586 offset_ac_l_set = offset_ac_set(iset, kset) + atomic_offset_ac - 2
590 offset_ac_l_set = offset_ac_set(kset, iset) + atomic_offset_ac - 2
596 DO la = la_min, la_max
597 nla = nsgfl_a(la, iset)
599 DO lb = lb_min, lb_max
600 nlb = nsgfl_b(lb, jset)
602 DO lc = lc_min, lc_max
603 nlc = nsgfl_c(lc, kset)
605 ld_loop:
DO ld = ld_min, ld_max
606 nld = nsgfl_d(ld, lset)
607 CALL libgint_add_qrt(libgint_handle, la, lb, lc, ld, nla, nlb, nlc, nld)
609 s_offset_a = s_offset_a_l + (inla - 1)*(2*la + 1)
611 s_offset_b = s_offset_b_l + (inlb - 1)*(2*lb + 1)
613 s_offset_c = s_offset_c_l + (inlc - 1)*(2*lc + 1)
615 s_offset_d = s_offset_d_l + (inld - 1)*(2*ld + 1)
617 s_offset_ac = offset_ac_l_set + s_offset_c*ld_ac_set + s_offset_a
619 s_offset_ac = offset_ac_l_set + s_offset_a*ld_ac_set + s_offset_c
623 s_offset_ad = offset_ad_l_set + s_offset_d*ld_ad_set + s_offset_a
625 s_offset_ad = offset_ad_l_set + s_offset_a*ld_ad_set + s_offset_d
629 s_offset_bc = offset_bc_l_set + s_offset_c*ld_bc_set + s_offset_b
631 s_offset_bc = offset_bc_l_set + s_offset_b*ld_bc_set + s_offset_c
635 s_offset_bd = offset_bd_l_set + s_offset_d*ld_bd_set + s_offset_b
637 s_offset_bd = offset_bd_l_set + s_offset_b*ld_bd_set + s_offset_d
640 CALL libgint_add_qrtt(libgint_handle, symm_fac, &
641 la, lb, lc, ld, inla - 1, inlb - 1, inlc - 1, inld - 1, &
642 ld_ac_set, ld_ad_set, ld_bc_set, ld_bd_set, &
643 s_offset_ac, s_offset_ad, s_offset_bc, s_offset_bd, &
650 s_offset_d_l = s_offset_d_l + nld*(2*ld + 1)
652 s_offset_c_l = s_offset_c_l + nlc*(2*lc + 1)
654 s_offset_b_l = s_offset_b_l + nlb*(2*lb + 1)
656 s_offset_a_l = s_offset_a_l + nla*(2*la + 1)
659 CALL libgint_add_set(libgint_handle)
671 mark_used(atomic_offset_ac)
672 mark_used(atomic_offset_ad)
673 mark_used(atomic_offset_bc)
674 mark_used(atomic_offset_bd)
675 mark_used(offset_ac_set)
676 mark_used(offset_ad_set)
677 mark_used(offset_bc_set)
678 mark_used(offset_bd_set)
695 cpabort(
"This CP2K executable has not been linked against the required library libGint.")
subroutine, public libgint_update_fock_matrix(symm_fac, iatom, jatom, katom, latom, iset, jset, kset, lset, atomic_offset_ac, atomic_offset_ad, atomic_offset_bc, atomic_offset_bd, offset_ac_set, offset_ad_set, offset_bc_set, offset_bd_set, nsgfa, nsgfb, nsgfc, nsgfd, la_min, la_max, lb_min, lb_max, lc_min, lc_max, ld_min, ld_max, nsgfl_a, nsgfl_b, nsgfl_c, nsgfl_d)
The previous coulomb_4 function assigned an integral between primitive gaussian. Now we assign the ns...
subroutine, public libgint_coulomb4(iatom, jatom, katom, latom, iset, jset, kset, lset, ra, rb, rc, rd, npgfa, npgfb, npgfc, npgfd, potential_parameter, screen1, screen2, log10_pmax, log10_eps_schwarz, pgf1, pgf2, neighbor_cells, cell, do_periodic, screened)
Assign two-electron integrals of a quartet/shell to libGint.