112 SUBROUTINE libgint_update_env(fac, memory_parameter, do_periodic, cell, actual_x_data, nneighbors, max_pgf, &
113 natom, kind_of, particle_set, basis_parameter)
117 LOGICAL :: do_periodic
119 TYPE(
hfx_type),
POINTER :: actual_x_data
120 INTEGER :: nneighbors, max_pgf, natom
121 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: kind_of
126 REAL(
dp),
DIMENSION(:, :),
ALLOCATABLE :: cell_r
127 REAL(
dp),
DIMENSION(:),
ALLOCATABLE :: flat_gcc
128 INTEGER,
DIMENSION(:),
POINTER :: la_min, la_max, npgfa, nsgfa
129 INTEGER,
DIMENSION(:, :),
POINTER :: nsgfl_a
130 INTEGER :: i, l, iset, jset, iatom, ikind, nseta, inla, nla
132 REAL(
dp),
DIMENSION(:, :),
POINTER :: zeta
133 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: gcc
134 TYPE(
bra_t),
POINTER :: bra_p, ket_p
137 CALL libgint_set_hf_fac(libgint_handle,
fac)
139 CALL libgint_set_max_mem(libgint_handle, memory_parameter%max_memory)
143 ALLOCATE (cell_r(3, nneighbors))
145 cell_r(:, i) = actual_x_data%neighbor_cells(i)%cell_r(:)
147 CALL libgint_set_cell(libgint_handle, do_pbc, cell%hmat, cell%h_inv)
148 CALL libgint_set_neighs(libgint_handle, cell_r, nneighbors)
158 IF (
ALLOCATED(first_set_of_atom))
DEALLOCATE (first_set_of_atom)
159 ALLOCATE (first_set_of_atom(natom))
161 ikind = kind_of(iatom)
162 ra = particle_set(iatom)%r(:)
163 nseta = basis_parameter(ikind)%nset
164 npgfa => basis_parameter(ikind)%npgf
165 la_min => basis_parameter(ikind)%lmin
166 la_max => basis_parameter(ikind)%lmax
167 zeta => basis_parameter(ikind)%zet
168 nsgfa => basis_parameter(ikind)%nsgf
169 nsgfl_a => basis_parameter(ikind)%nsgfl
170 gcc => basis_parameter(ikind)%gcc
171 first_set_of_atom(iatom) = jset
173 CALL libgint_set_atom(libgint_handle, jset - 1, ra, zeta(:, iset), npgfa(iset))
175 DO l = la_min(iset), la_max(iset)
176 nla = nsgfl_a(l, iset)
177 IF (
ALLOCATED(flat_gcc))
DEALLOCATE (flat_gcc)
178 ALLOCATE (flat_gcc(npgfa(iset)*nla))
179 flat_gcc = pack(gcc(1:npgfa(iset), inla:inla + nla - 1, iset), .true.)
180 CALL libgint_set_atom_l(libgint_handle, jset - 1, l, nla, flat_gcc)
188 mark_used(memory_parameter)
189 mark_used(do_periodic)
191 mark_used(actual_x_data)
192 mark_used(nneighbors)
196 mark_used(particle_set)
197 mark_used(basis_parameter)
198 cpabort(
"This CP2K executable has not been linked against the required library libGint.")
311 ra, rb, rc, rd, npgfa, npgfb, npgfc, npgfd, &
312 potential_parameter, &
313 screen1, screen2, log10_pmax, log10_eps_schwarz, &
315 neighbor_cells, cell, do_periodic, screened)
317 INTEGER,
INTENT(in) :: iatom, jatom, katom, latom, iset, jset, kset, lset
318 REAL(
dp),
INTENT(IN) :: ra(3), rb(3), rc(3), rd(3)
319 INTEGER,
INTENT(IN) :: npgfa, npgfb, npgfc, npgfd
321 REAL(
dp),
INTENT(IN) :: screen1(2), screen2(2)
322 REAL(
dp),
INTENT(IN) :: log10_pmax, log10_eps_schwarz
324 POINTER :: pgf1, pgf2
327 LOGICAL,
INTENT(IN) :: do_periodic
328 LOGICAL,
INTENT(out) :: screened
331 TYPE(
bra_t),
POINTER :: bra_p, ket_p
332 LOGICAL :: cell_was_screened
333 INTEGER :: idx_n1, idx_n2, n1, n2, idx_ij, idx_kl, o_ij, n_ij, o_kl, n_kl
334 INTEGER :: ipgf, jpgf, kpgf, lpgf, iatom_set, jatom_set, katom_set, latom_set
335 REAL(
dp) :: pgf_max_1, pgf_max_2
336 INTEGER :: nelements_ij, nelements_kl
339 potential_parameter = potential_parameter
344 iatom_set = first_set_of_atom(iatom) + iset - 2
345 jatom_set = first_set_of_atom(jatom) + jset - 2
346 katom_set = first_set_of_atom(katom) + kset - 2
347 latom_set = first_set_of_atom(latom) + lset - 2
350 pgf1, log10_pmax, log10_eps_schwarz, ra, rb, &
351 nelements_ij, neighbor_cells, do_periodic)
354 pgf2, log10_pmax, log10_eps_schwarz, rc, rd, &
355 nelements_kl, neighbor_cells, do_periodic)
366 DO idx_n1 = 1, bra%cell_cnt
368 n1 = bra%cell_idx(1, idx_n1)
369 n_ij = bra%cell_idx(2, idx_n1)
370 o_ij = bra%cell_idx(3, idx_n1)
372 DO idx_n2 = 1, ket%cell_cnt
374 n2 = ket%cell_idx(1, idx_n2)
375 n_kl = ket%cell_idx(2, idx_n2)
376 o_kl = ket%cell_idx(3, idx_n2)
378 cell_was_screened = .true.
379 DO idx_ij = o_ij + 1, o_ij + n_ij
381 ipgf = bra%pgf_idx(1, idx_ij)
382 jpgf = bra%pgf_idx(2, idx_ij)
384 pgf_max_1 = bra%pgf_scr(1, idx_ij)
386 DO idx_kl = o_kl + 1, o_kl + n_kl
387 kpgf = ket%pgf_idx(1, idx_kl)
388 lpgf = ket%pgf_idx(2, idx_kl)
390 pgf_max_2 = ket%pgf_scr(1, idx_kl)
392 IF (pgf_max_1 + pgf_max_2 + log10_pmax < log10_eps_schwarz) cycle
394 CALL libgint_add_prm(libgint_handle, ipgf - 1, jpgf - 1, kpgf - 1, lpgf - 1)
395 cell_was_screened = .false.
400 IF (.NOT. cell_was_screened)
THEN
401 CALL libgint_add_shell(libgint_handle, iatom_set, jatom_set, katom_set, latom_set, n1 - 1, n2 - 1)
424 mark_used(potential_parameter)
427 mark_used(log10_pmax)
428 mark_used(log10_eps_schwarz)
431 mark_used(neighbor_cells)
433 mark_used(do_periodic)
435 cpabort(
"This CP2K executable has not been linked against the required library libGint.")
498 iatom, jatom, katom, latom, &
499 iset, jset, kset, lset, &
500 atomic_offset_ac, atomic_offset_ad, atomic_offset_bc, atomic_offset_bd, &
501 offset_ac_set, offset_ad_set, offset_bc_set, offset_bd_set, &
502 nsgfa, nsgfb, nsgfc, nsgfd, &
503 la_min, la_max, lb_min, lb_max, &
504 lc_min, lc_max, ld_min, ld_max, &
505 nsgfl_a, nsgfl_b, nsgfl_c, nsgfl_d)
508 INTEGER :: iatom, jatom, katom, latom
509 INTEGER :: iset, jset, kset, lset
510 INTEGER :: atomic_offset_ac, atomic_offset_ad, atomic_offset_bc, atomic_offset_bd
511 INTEGER,
DIMENSION(:, :),
POINTER :: offset_ac_set, offset_ad_set
512 INTEGER,
DIMENSION(:, :),
POINTER :: offset_bc_set, offset_bd_set
513 INTEGER :: nsgfa, nsgfb, nsgfc, nsgfd
514 INTEGER :: la_min, la_max, lb_min, lb_max
515 INTEGER :: lc_min, lc_max, ld_min, ld_max
516 INTEGER,
DIMENSION(:, :),
POINTER :: nsgfl_a, nsgfl_b, nsgfl_c, nsgfl_d
537 LOGICAL(1) :: tac, tad, tbc, tbd
538 INTEGER :: offset_ac_l_set, offset_ad_l_set, offset_bc_l_set, offset_bd_l_set
539 INTEGER :: s_offset_a, s_offset_b, s_offset_c, s_offset_d
540 INTEGER :: s_offset_a_l, s_offset_b_l, s_offset_c_l, s_offset_d_l
541 INTEGER :: s_offset_ac, s_offset_ad, s_offset_bc, s_offset_bd
542 INTEGER :: ld_ac_set, ld_ad_set, ld_bc_set, ld_bd_set
543 INTEGER :: la, lb, lc, ld, nla, nlb, nlc, nld, inla, inlb, inlc, inld
553 IF (jatom >= latom)
THEN
554 offset_bd_l_set = offset_bd_set(jset, lset) + atomic_offset_bd - 2
558 offset_bd_l_set = offset_bd_set(lset, jset) + atomic_offset_bd - 2
562 IF (jatom >= katom)
THEN
563 offset_bc_l_set = offset_bc_set(jset, kset) + atomic_offset_bc - 2
567 offset_bc_l_set = offset_bc_set(kset, jset) + atomic_offset_bc - 2
572 IF (iatom >= latom)
THEN
573 offset_ad_l_set = offset_ad_set(iset, lset) + atomic_offset_ad - 2
577 offset_ad_l_set = offset_ad_set(lset, iset) + atomic_offset_ad - 2
582 IF (iatom >= katom)
THEN
583 offset_ac_l_set = offset_ac_set(iset, kset) + atomic_offset_ac - 2
587 offset_ac_l_set = offset_ac_set(kset, iset) + atomic_offset_ac - 2
593 DO la = la_min, la_max
594 nla = nsgfl_a(la, iset)
596 DO lb = lb_min, lb_max
597 nlb = nsgfl_b(lb, jset)
599 DO lc = lc_min, lc_max
600 nlc = nsgfl_c(lc, kset)
602 ld_loop:
DO ld = ld_min, ld_max
603 nld = nsgfl_d(ld, lset)
604 CALL libgint_add_qrt(libgint_handle, la, lb, lc, ld, nla, nlb, nlc, nld)
606 s_offset_a = s_offset_a_l + (inla - 1)*(2*la + 1)
608 s_offset_b = s_offset_b_l + (inlb - 1)*(2*lb + 1)
610 s_offset_c = s_offset_c_l + (inlc - 1)*(2*lc + 1)
612 s_offset_d = s_offset_d_l + (inld - 1)*(2*ld + 1)
614 s_offset_ac = offset_ac_l_set + s_offset_c*ld_ac_set + s_offset_a
616 s_offset_ac = offset_ac_l_set + s_offset_a*ld_ac_set + s_offset_c
620 s_offset_ad = offset_ad_l_set + s_offset_d*ld_ad_set + s_offset_a
622 s_offset_ad = offset_ad_l_set + s_offset_a*ld_ad_set + s_offset_d
626 s_offset_bc = offset_bc_l_set + s_offset_c*ld_bc_set + s_offset_b
628 s_offset_bc = offset_bc_l_set + s_offset_b*ld_bc_set + s_offset_c
632 s_offset_bd = offset_bd_l_set + s_offset_d*ld_bd_set + s_offset_b
634 s_offset_bd = offset_bd_l_set + s_offset_b*ld_bd_set + s_offset_d
637 CALL libgint_add_qrtt(libgint_handle, symm_fac, &
638 la, lb, lc, ld, inla - 1, inlb - 1, inlc - 1, inld - 1, &
639 ld_ac_set, ld_ad_set, ld_bc_set, ld_bd_set, &
640 s_offset_ac, s_offset_ad, s_offset_bc, s_offset_bd, &
647 s_offset_d_l = s_offset_d_l + nld*(2*ld + 1)
649 s_offset_c_l = s_offset_c_l + nlc*(2*lc + 1)
651 s_offset_b_l = s_offset_b_l + nlb*(2*lb + 1)
653 s_offset_a_l = s_offset_a_l + nla*(2*la + 1)
656 CALL libgint_add_set(libgint_handle)
668 mark_used(atomic_offset_ac)
669 mark_used(atomic_offset_ad)
670 mark_used(atomic_offset_bc)
671 mark_used(atomic_offset_bd)
672 mark_used(offset_ac_set)
673 mark_used(offset_ad_set)
674 mark_used(offset_bc_set)
675 mark_used(offset_bd_set)
692 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.