15 coulomb_integral_cleanup, compute_coulomb_2c, compute_coulomb_3c, &
16 compute_coulomb_2c_derivs, compute_coulomb_3c_derivs
18 USE omp_lib,
ONLY: omp_get_max_threads, &
19 omp_get_num_threads, &
41 dbt_create, dbt_distribution_destroy, dbt_distribution_new, dbt_distribution_type, &
42 dbt_finalize, dbt_pgrid_create, dbt_pgrid_destroy, dbt_pgrid_type, dbt_put_block, &
43 dbt_reserve_blocks, dbt_type
92 USE iso_c_binding,
ONLY: c_loc
93 USE libxs,
ONLY: libxs_matcopy, &
96#include "./base/base_uses.f90"
101 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'xas_tdp_integrals'
125 blk_size_3, only_bc_same_center)
127 TYPE(dbt_type),
INTENT(OUT) :: pq_x
129 POINTER :: ab_nl, ac_nl
131 INTEGER,
DIMENSION(:),
INTENT(IN) :: blk_size_1, blk_size_2, blk_size_3
132 LOGICAL,
INTENT(IN),
OPTIONAL :: only_bc_same_center
134 CHARACTER(len=*),
PARAMETER :: routinen =
'create_pqX_tensor'
136 INTEGER :: a, b, group_handle, handle, i, iatom, &
137 ikind, jatom, katom, kkind, nblk, &
138 nblk_3, nblk_per_thread, nkind
139 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: idx1,
idx2,
idx3
140 INTEGER,
DIMENSION(3) :: pdims
141 INTEGER,
DIMENSION(:),
POINTER :: col_dist, row_dist
142 INTEGER,
DIMENSION(:, :),
POINTER :: mat_pgrid
143 LOGICAL :: my_sort_bc, symmetric
144 REAL(
dp),
DIMENSION(3) :: rab, rac, rbc
145 TYPE(dbt_distribution_type) :: t_dist
146 TYPE(dbt_pgrid_type) :: t_pgrid
149 DIMENSION(:),
POINTER :: ab_iter, ac_iter
151 NULLIFY (ab_iter, ac_iter, col_dist, row_dist, mat_pgrid)
153 CALL timeset(routinen, handle)
156 IF (
PRESENT(only_bc_same_center)) my_sort_bc = only_bc_same_center
163 row_dist=row_dist, col_dist=col_dist)
164 CALL group%set_handle(group_handle)
167 pdims(1) =
SIZE(mat_pgrid, 1); pdims(2) =
SIZE(mat_pgrid, 2); pdims(3) = 1
168 CALL dbt_pgrid_create(group, pdims, t_pgrid)
170 nblk_3 =
SIZE(blk_size_3)
171 CALL dbt_distribution_new(t_dist, t_pgrid, nd_dist_1=row_dist, nd_dist_2=col_dist, &
172 nd_dist_3=[(0, i=1, nblk_3)])
175 CALL dbt_create(pq_x, name=
"(pq|X)", dist=t_dist, map1_2d=[1, 2], map2_2d=[3], &
176 blk_size_1=blk_size_1, blk_size_2=blk_size_2, blk_size_3=blk_size_3)
193 rbc(:) = rac(:) - rab(:)
194 IF (.NOT. (all(abs(rbc) <= 1.0e-8_dp) .OR. all(abs(rac) <= 1.0e-8_dp))) cycle
205 ALLOCATE (idx1(nblk),
idx2(nblk),
idx3(nblk))
212 CALL get_iterator_info(ab_iter, ikind=ikind, iatom=iatom, jatom=jatom, nkind=nkind, r=rab)
223 rbc(:) = rac(:) - rab(:)
224 IF (.NOT. (all(abs(rbc) <= 1.0e-8_dp) .OR. all(abs(rac) <= 1.0e-8_dp))) cycle
242 nblk_per_thread = nblk/omp_get_num_threads() + 1
243 a = omp_get_thread_num()*nblk_per_thread + 1
244 b = min(a + nblk_per_thread, nblk)
245 CALL dbt_reserve_blocks(pq_x, idx1(a:b),
idx2(a:b),
idx3(a:b))
247 CALL dbt_finalize(pq_x)
250 CALL dbt_distribution_destroy(t_dist)
251 CALL dbt_pgrid_destroy(t_pgrid)
253 CALL timestop(handle)
273 basis_set_list_c, potential_parameter, qs_env, &
274 only_bc_same_center, eps_screen)
276 TYPE(dbt_type) :: pq_x
278 POINTER :: ab_nl, ac_nl
283 LOGICAL,
INTENT(IN),
OPTIONAL :: only_bc_same_center
284 REAL(
dp),
INTENT(IN),
OPTIONAL :: eps_screen
286 CHARACTER(len=*),
PARAMETER :: routinen =
'fill_pqX_tensor'
288 INTEGER :: egfa, egfb, egfc, handle, i, iatom, ibasis, ikind, ilist,
imax, iset, jatom, &
289 jkind, jset, katom, kkind, kset, m_max, max_nset, maxli, maxlj, maxlk, mepos, nbasis, &
290 ncoa, ncob, ncoc, ni, nj, nk, nseta, nsetb, nsetc, nthread, sgfa, sgfb, sgfc
291 INTEGER,
DIMENSION(:),
POINTER :: la_max, la_min, lb_max, lb_min, lc_max, &
292 lc_min, npgfa, npgfb, npgfc, nsgfa, &
294 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgfa, first_sgfb, first_sgfc
295 LOGICAL :: do_screen, my_sort_bc
296 REAL(
dp) :: dij, dik, djk, my_eps_screen, ri(3), &
297 rij(3), rik(3), rj(3), rjk(3), rk(3), &
298 sabc_ext, screen_radius
299 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: ccp_buffer, cpp_buffer
300 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: max_contr, max_contra, max_contrb, &
302 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: iabc, sabc, work
303 REAL(
dp),
DIMENSION(:),
POINTER :: set_radius_a, set_radius_b, set_radius_c
304 REAL(
dp),
DIMENSION(:, :),
POINTER :: rpgf_a, rpgf_b, rpgf_c, zeta, zetb, zetc
305 TYPE(coulomb_integral_context_type) :: integral_context
314 NULLIFY (basis_set, basis_set_list, para_env, la_max, la_min)
315 NULLIFY (lb_max, lb_min, lc_max, lc_min, npgfa, npgfb, npgfc, nsgfa, nsgfb, nsgfc)
316 NULLIFY (first_sgfa, first_sgfb, first_sgfc, set_radius_a, set_radius_b, set_radius_c)
317 NULLIFY (rpgf_a, rpgf_b, rpgf_c, zeta, zetb, zetc)
318 NULLIFY (basis_set_a, basis_set_b, basis_set_c, tspa, spb, spc)
320 CALL timeset(routinen, handle)
323 nbasis =
SIZE(basis_set_list_a)
326 DO ibasis = 1, nbasis
328 maxl=
imax, nset=iset, nsgf_set=nsgfa)
329 maxli = max(maxli,
imax)
330 max_nset = max(max_nset, iset)
333 DO ibasis = 1, nbasis
335 maxl=
imax, nset=iset, nsgf_set=nsgfb, npgf=npgfb)
336 maxlj = max(maxlj,
imax)
337 max_nset = max(max_nset, iset)
340 DO ibasis = 1, nbasis
342 maxl=
imax, nset=iset, npgf=npgfc)
343 maxlk = max(maxlk,
imax)
344 max_nset = max(max_nset, iset)
346 m_max = maxli + maxlj + maxlk
350 IF (
PRESENT(eps_screen))
THEN
352 my_eps_screen = eps_screen
354 screen_radius = 0.0_dp
361 screen_radius = 1000000.0_dp
368 ALLOCATE (max_contr(max_nset, nbasis), max_contra(max_nset, nbasis), &
369 max_contrb(max_nset, nbasis), max_contrc(max_nset, nbasis))
374 IF (ilist == 1) basis_set_list => basis_set_list_a
375 IF (ilist == 2) basis_set_list => basis_set_list_b
376 IF (ilist == 3) basis_set_list => basis_set_list_c
380 DO ibasis = 1, nbasis
381 basis_set => basis_set_list(ibasis)%gto_basis_set
383 DO iset = 1, basis_set%nset
385 ncoa = basis_set%npgf(iset)*
ncoset(basis_set%lmax(iset))
386 sgfa = basis_set%first_sgf(1, iset)
387 egfa = sgfa + basis_set%nsgf_set(iset) - 1
389 max_contr(iset, ibasis) = &
390 maxval([(sum(abs(basis_set%sphi(1:ncoa, i))), i=sgfa, egfa)])
395 IF (ilist == 1) max_contra(:, :) = max_contr(:, :)
396 IF (ilist == 2) max_contrb(:, :) = max_contr(:, :)
397 IF (ilist == 3) max_contrc(:, :) = max_contr(:, :)
399 DEALLOCATE (max_contr)
404 ALLOCATE (tspa(max_nset, nbasis), spb(max_nset, nbasis), spc(max_nset, nbasis))
405 DO ibasis = 1, nbasis
406 DO iset = 1, max_nset
407 NULLIFY (tspa(iset, ibasis)%array)
408 NULLIFY (spb(iset, ibasis)%array)
409 NULLIFY (spc(iset, ibasis)%array)
415 DO ibasis = 1, nbasis
416 IF (ilist == 1) basis_set => basis_set_list_a(ibasis)%gto_basis_set
417 IF (ilist == 2) basis_set => basis_set_list_b(ibasis)%gto_basis_set
418 IF (ilist == 3) basis_set => basis_set_list_c(ibasis)%gto_basis_set
420 DO iset = 1, basis_set%nset
422 ncoa = basis_set%npgf(iset)*
ncoset(basis_set%lmax(iset))
423 sgfa = basis_set%first_sgf(1, iset)
424 egfa = sgfa + basis_set%nsgf_set(iset) - 1
427 ALLOCATE (tspa(iset, ibasis)%array(basis_set%nsgf_set(iset), ncoa))
429 CALL libxs_otrans(c_loc(tspa(iset, ibasis)%array), &
430 c_loc(basis_set%sphi(1, sgfa)), &
431 8, ncoa, egfa - sgfa + 1, &
432 SIZE(basis_set%sphi, 1), &
433 basis_set%nsgf_set(iset))
435 tspa(iset, ibasis)%array(:, :) = transpose(basis_set%sphi(1:ncoa, sgfa:egfa))
437 ELSE IF (ilist == 2)
THEN
438 ALLOCATE (spb(iset, ibasis)%array(ncoa, basis_set%nsgf_set(iset)))
440 CALL libxs_matcopy(c_loc(spb(iset, ibasis)%array), &
441 c_loc(basis_set%sphi(1, sgfa)), &
442 8, ncoa, egfa - sgfa + 1, &
443 SIZE(basis_set%sphi, 1), ncoa)
445 spb(iset, ibasis)%array(:, :) = basis_set%sphi(1:ncoa, sgfa:egfa)
448 ALLOCATE (spc(iset, ibasis)%array(ncoa, basis_set%nsgf_set(iset)))
450 CALL libxs_matcopy(c_loc(spc(iset, ibasis)%array), &
451 c_loc(basis_set%sphi(1, sgfa)), &
452 8, ncoa, egfa - sgfa + 1, &
453 SIZE(basis_set%sphi, 1), ncoa)
455 spc(iset, ibasis)%array(:, :) = basis_set%sphi(1:ncoa, sgfa:egfa)
464 IF (
PRESENT(only_bc_same_center)) my_sort_bc = only_bc_same_center
476 CALL init_o3c_container(o3c, 1, basis_set_list_a, basis_set_list_b, basis_set_list_c, &
477 ab_nl, ac_nl, only_bc_same_center=my_sort_bc)
495 integral_context = coulomb_integral_context_type()
496 CALL coulomb_integral_init(integral_context, max_am_3c=max(maxli, maxlj, maxlk), &
499 DO WHILE (
o3c_iterate(o3c_iterator, mepos=mepos) == 0)
501 iatom=iatom, jatom=jatom, katom=katom, rij=rij, rik=rik)
504 basis_set_a => basis_set_list_a(ikind)%gto_basis_set
505 first_sgfa => basis_set_a%first_sgf
506 la_max => basis_set_a%lmax
507 la_min => basis_set_a%lmin
508 npgfa => basis_set_a%npgf
509 nseta = basis_set_a%nset
510 nsgfa => basis_set_a%nsgf_set
511 zeta => basis_set_a%zet
512 rpgf_a => basis_set_a%pgf_radius
513 set_radius_a => basis_set_a%set_radius
516 basis_set_b => basis_set_list_b(jkind)%gto_basis_set
517 first_sgfb => basis_set_b%first_sgf
518 lb_max => basis_set_b%lmax
519 lb_min => basis_set_b%lmin
520 npgfb => basis_set_b%npgf
521 nsetb = basis_set_b%nset
522 nsgfb => basis_set_b%nsgf_set
523 zetb => basis_set_b%zet
524 rpgf_b => basis_set_b%pgf_radius
525 set_radius_b => basis_set_b%set_radius
528 basis_set_c => basis_set_list_c(kkind)%gto_basis_set
529 first_sgfc => basis_set_c%first_sgf
530 lc_max => basis_set_c%lmax
531 lc_min => basis_set_c%lmin
532 npgfc => basis_set_c%npgf
533 nsetc = basis_set_c%nset
534 nsgfc => basis_set_c%nsgf_set
535 zetc => basis_set_c%zet
536 rpgf_c => basis_set_c%pgf_radius
537 set_radius_c => basis_set_c%set_radius
551 ALLOCATE (iabc(ni, nj, nk))
552 iabc(:, :, :) = 0.0_dp
555 ncoa = npgfa(iset)*
ncoset(la_max(iset))
556 sgfa = first_sgfa(1, iset)
557 egfa = sgfa + nsgfa(iset) - 1
560 ncob = npgfb(jset)*
ncoset(lb_max(jset))
561 sgfb = first_sgfb(1, jset)
562 egfb = sgfb + nsgfb(jset) - 1
565 IF (set_radius_a(iset) + set_radius_b(jset) < dij) cycle
568 ncoc = npgfc(kset)*
ncoset(lc_max(kset))
569 sgfc = first_sgfc(1, kset)
570 egfc = sgfc + nsgfc(kset) - 1
573 IF (set_radius_a(iset) + set_radius_c(kset) + screen_radius < dik) cycle
574 IF (set_radius_b(jset) + set_radius_c(kset) + screen_radius < djk) cycle
577 ALLOCATE (sabc(ncoa, ncob, ncoc))
578 sabc(:, :, :) = 0.0_dp
581 CALL compute_coulomb_3c(integral_context, la_min(iset), la_max(iset), lb_min(jset), &
582 lb_max(jset), lc_min(kset), lc_max(kset), npgfa(iset), npgfb(jset), npgfc(kset), &
583 zeta(:, iset), zetb(:, jset), zetc(:, kset), rpgf_a(:, iset), rpgf_b(:, jset), &
584 rpgf_c(:, kset), ri, rj, rk, sabc, potential_parameter, dab=dij, dac=dik, dbc=djk, &
585 int_abc_ext=sabc_ext)
586 IF (my_eps_screen > sabc_ext*(max_contra(iset, ikind)* &
587 max_contrb(jset, jkind)* &
588 max_contrc(kset, kkind)))
THEN
593 CALL compute_coulomb_3c(integral_context, la_min(iset), la_max(iset), lb_min(jset), &
594 lb_max(jset), lc_min(kset), lc_max(kset), npgfa(iset), npgfb(jset), npgfc(kset), &
595 zeta(:, iset), zetb(:, jset), zetc(:, kset), rpgf_a(:, iset), rpgf_b(:, jset), &
596 rpgf_c(:, kset), ri, rj, rk, sabc, potential_parameter, dab=dij, dac=dik, dbc=djk)
599 ALLOCATE (work(nsgfa(iset), nsgfb(jset), nsgfc(kset)))
601 CALL abc_contract_xsmm(work, sabc, tspa(iset, ikind)%array, spb(jset, jkind)%array, &
602 spc(kset, kkind)%array, ncoa, ncob, ncoc, nsgfa(iset), &
603 nsgfb(jset), nsgfc(kset), cpp_buffer, ccp_buffer)
605 iabc(sgfa:egfa, sgfb:egfb, sgfc:egfc) = work(:, :, :)
606 DEALLOCATE (sabc, work)
614 CALL dbt_put_block(pq_x, [iatom, jatom, katom], shape(iabc), iabc, summation=.true.)
620 IF (
ALLOCATED(ccp_buffer))
DEALLOCATE (ccp_buffer)
621 IF (
ALLOCATED(cpp_buffer))
DEALLOCATE (cpp_buffer)
623 CALL coulomb_integral_cleanup(integral_context)
630 DO iset = 1, max_nset
631 DO ibasis = 1, nbasis
632 IF (
ASSOCIATED(tspa(iset, ibasis)%array))
DEALLOCATE (tspa(iset, ibasis)%array)
633 IF (
ASSOCIATED(spb(iset, ibasis)%array))
DEALLOCATE (spb(iset, ibasis)%array)
634 IF (
ASSOCIATED(spc(iset, ibasis)%array))
DEALLOCATE (spc(iset, ibasis)%array)
637 DEALLOCATE (tspa, spb, spc)
639 CALL timestop(handle)
660 INTEGER,
DIMENSION(:),
INTENT(IN),
OPTIONAL :: excited_atoms
663 INTEGER :: ikind, nkind
664 LOGICAL :: my_restrictb
665 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: a_present, b_present
667 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: a_radius, b_radius
668 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: pair_radius
677 NULLIFY (atomic_kind_set, distribution_1d, distribution_2d, molecule_set, particle_set, cell)
683 my_restrictb = .false.
684 IF (
PRESENT(excited_atoms))
THEN
685 my_restrictb = .true.
688 ALLOCATE (a_present(nkind), b_present(nkind))
691 ALLOCATE (a_radius(nkind), b_radius(nkind))
697 IF (
ASSOCIATED(basis_a(ikind)%gto_basis_set))
THEN
698 a_present(ikind) = .true.
699 CALL get_gto_basis_set(basis_a(ikind)%gto_basis_set, kind_radius=a_radius(ikind))
702 IF (
ASSOCIATED(basis_b(ikind)%gto_basis_set))
THEN
703 b_present(ikind) = .true.
704 CALL get_gto_basis_set(basis_b(ikind)%gto_basis_set, kind_radius=b_radius(ikind))
708 ALLOCATE (pair_radius(nkind, nkind))
713 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, cell=cell, &
714 distribution_2d=distribution_2d, local_particles=distribution_1d, &
715 particle_set=particle_set, molecule_set=molecule_set)
718 IF (
PRESENT(ext_dist2d)) distribution_2d => ext_dist2d
720 ALLOCATE (atom2d(nkind))
721 CALL atom2d_build(atom2d, distribution_1d, distribution_2d, atomic_kind_set, &
722 molecule_set, .false., particle_set)
724 IF (my_restrictb)
THEN
727 atomb_to_keep=excited_atoms, nlname=
"XAS_TDP_ovlp_nl")
732 nlname=
"XAS_TDP_ovlp_nl")
759 INTEGER,
INTENT(IN) :: op_type
761 INTEGER,
DIMENSION(:),
INTENT(IN),
OPTIONAL :: excited_atoms
762 REAL(
dp),
INTENT(IN),
OPTIONAL :: x_range
765 INTEGER :: ikind, nkind
766 LOGICAL :: sort_atoms
767 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: a_present, c_present
769 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: a_radius, c_radius
770 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: pair_radius
779 NULLIFY (atomic_kind_set, distribution_1d, distribution_2d, molecule_set, particle_set, cell)
785 IF ((
PRESENT(excited_atoms))) sort_atoms = .true.
787 ALLOCATE (a_present(nkind), c_present(nkind))
790 ALLOCATE (a_radius(nkind), c_radius(nkind))
800 IF (
ASSOCIATED(basis_a(ikind)%gto_basis_set))
THEN
801 a_present(ikind) = .true.
802 CALL get_gto_basis_set(basis_a(ikind)%gto_basis_set, kind_radius=a_radius(ikind))
805 IF (
ASSOCIATED(basis_c(ikind)%gto_basis_set))
THEN
806 c_present(ikind) = .true.
807 CALL get_gto_basis_set(basis_c(ikind)%gto_basis_set, kind_radius=c_radius(ikind))
815 IF (
ASSOCIATED(basis_c(ikind)%gto_basis_set))
THEN
816 c_present(ikind) = .true.
817 c_radius(ikind) = 1000000.0_dp
819 IF (
ASSOCIATED(basis_a(ikind)%gto_basis_set)) a_present(ikind) = .true.
826 IF (
ASSOCIATED(basis_a(ikind)%gto_basis_set))
THEN
827 a_present(ikind) = .true.
828 CALL get_gto_basis_set(basis_a(ikind)%gto_basis_set, kind_radius=a_radius(ikind))
830 IF (
ASSOCIATED(basis_c(ikind)%gto_basis_set))
THEN
831 c_present(ikind) = .true.
832 CALL get_gto_basis_set(basis_c(ikind)%gto_basis_set, kind_radius=c_radius(ikind))
833 c_radius(ikind) = c_radius(ikind) + x_range
838 cpabort(
"Operator not known")
841 ALLOCATE (pair_radius(nkind, nkind))
846 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, cell=cell, &
847 distribution_2d=distribution_2d, local_particles=distribution_1d, &
848 particle_set=particle_set, molecule_set=molecule_set)
851 IF (
PRESENT(ext_dist2d)) distribution_2d => ext_dist2d
853 ALLOCATE (atom2d(nkind))
854 CALL atom2d_build(atom2d, distribution_1d, distribution_2d, atomic_kind_set, &
855 molecule_set, .false., particle_set)
859 operator_type=
"ABC", atomb_to_keep=excited_atoms, &
860 nlname=
"XAS_TDP_3c_nl")
863 operator_type=
"ABC", nlname=
"XAS_TDP_3c_nl")
884 basis_set_c, qs_env, only_bc_same_center)
888 POINTER :: ab_list, ac_list
891 LOGICAL,
INTENT(IN),
OPTIONAL :: only_bc_same_center
893 CHARACTER(len=*),
PARAMETER :: routinen =
'get_opt_3c_dist2d'
895 INTEGER :: handle, i, iatom, ikind, ip, jatom, &
896 jkind, kkind, mypcol, myprow, n, &
897 natom, nkind, npcol, nprow, nsgfa, &
899 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: nparticle_local_col, nparticle_local_row
900 INTEGER,
DIMENSION(:, :),
POINTER :: col_dist, row_dist
901 LOGICAL :: my_sort_bc
902 REAL(
dp) :: cost, rab(3), rac(3), rbc(3)
903 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: col_cost, col_proc_cost, row_cost, &
905 TYPE(
cp_1d_i_p_type),
DIMENSION(:),
POINTER :: local_particle_col, local_particle_row
909 DIMENSION(:),
POINTER :: ab_iter, ac_iter
911 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
913 NULLIFY (para_env, col_dist, row_dist, blacs_env, qs_kind_set, particle_set)
914 NULLIFY (local_particle_col, local_particle_row, ab_iter, ac_iter)
916 CALL timeset(routinen, handle)
923 IF (
PRESENT(only_bc_same_center)) my_sort_bc = only_bc_same_center
925 CALL get_qs_env(qs_env, natom=natom, para_env=para_env, blacs_env=blacs_env, &
926 qs_kind_set=qs_kind_set, particle_set=particle_set, nkind=nkind)
928 myprow = blacs_env%mepos(1) + 1
929 mypcol = blacs_env%mepos(2) + 1
930 nprow = blacs_env%num_pe(1)
931 npcol = blacs_env%num_pe(2)
933 ALLOCATE (col_cost(natom), row_cost(natom))
934 col_cost = 0.0_dp; row_cost = 0.0_dp
936 ALLOCATE (row_dist(natom, 2), col_dist(natom, 2))
937 row_dist = 1; col_dist = 1
942 CALL get_iterator_info(ab_iter, ikind=ikind, jkind=jkind, iatom=iatom, jatom=jatom, r=rab)
952 rbc(:) = rac(:) - rab(:)
953 IF (.NOT. (all(abs(rbc) <= 1.0e-8_dp) .OR. all(abs(rac) <= 1.0e-8_dp))) cycle
958 nsgfa = basis_set_a(ikind)%gto_basis_set%nsgf
959 nsgfb = basis_set_b(jkind)%gto_basis_set%nsgf
960 nsgfc = basis_set_c(kkind)%gto_basis_set%nsgf
962 cost = real(nsgfa*nsgfb*nsgfc,
dp)
964 row_cost(iatom) = row_cost(iatom) + cost
965 col_cost(jatom) = col_cost(jatom) + cost
973 CALL para_env%sum(row_cost)
974 CALL para_env%sum(col_cost)
977 ALLOCATE (col_proc_cost(npcol), row_proc_cost(nprow))
978 col_proc_cost = 0.0_dp; row_proc_cost = 0.0_dp
980 iatom = maxloc(row_cost, 1)
981 ip = minloc(row_proc_cost, 1)
982 row_proc_cost(ip) = row_proc_cost(ip) + row_cost(iatom)
983 row_dist(iatom, 1) = ip
984 row_cost(iatom) = 0.0_dp
986 iatom = maxloc(col_cost, 1)
987 ip = minloc(col_proc_cost, 1)
988 col_proc_cost(ip) = col_proc_cost(ip) + col_cost(iatom)
989 col_dist(iatom, 1) = ip
990 col_cost(iatom) = 0.0_dp
994 ALLOCATE (local_particle_col(nkind), local_particle_row(nkind))
995 ALLOCATE (nparticle_local_row(nkind), nparticle_local_col(nkind))
996 nparticle_local_row = 0; nparticle_local_col = 0
999 ikind = particle_set(iatom)%atomic_kind%kind_number
1001 IF (row_dist(iatom, 1) == myprow) nparticle_local_row(ikind) = nparticle_local_row(ikind) + 1
1002 IF (col_dist(iatom, 1) == mypcol) nparticle_local_col(ikind) = nparticle_local_col(ikind) + 1
1006 n = nparticle_local_row(ikind)
1007 ALLOCATE (local_particle_row(ikind)%array(n))
1009 n = nparticle_local_col(ikind)
1010 ALLOCATE (local_particle_col(ikind)%array(n))
1013 nparticle_local_row = 0; nparticle_local_col = 0
1015 ikind = particle_set(iatom)%atomic_kind%kind_number
1017 IF (row_dist(iatom, 1) == myprow)
THEN
1018 nparticle_local_row(ikind) = nparticle_local_row(ikind) + 1
1019 local_particle_row(ikind)%array(nparticle_local_row(ikind)) = iatom
1021 IF (col_dist(iatom, 1) == mypcol)
THEN
1022 nparticle_local_col(ikind) = nparticle_local_col(ikind) + 1
1023 local_particle_col(ikind)%array(nparticle_local_col(ikind)) = iatom
1028 row_dist(:, 1) = row_dist(:, 1) - 1
1029 col_dist(:, 1) = col_dist(:, 1) - 1
1031 col_distribution_ptr=col_dist, local_rows_ptr=local_particle_row, &
1032 local_cols_ptr=local_particle_col, blacs_env=blacs_env)
1034 CALL timestop(handle)
1050 INTEGER,
DIMENSION(:),
INTENT(IN) :: ex_atoms
1055 CHARACTER(len=*),
PARAMETER :: routinen =
'compute_ri_3c_exchange'
1057 INTEGER :: handle, natom, nkind
1058 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: blk_size_orb, blk_size_ri
1063 POINTER :: ab_list, ac_list
1065 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1067 NULLIFY (basis_set_ri, basis_set_orb, ac_list, ab_list, qs_kind_set, para_env, particle_set)
1069 CALL timeset(routinen, handle)
1072 CALL get_qs_env(qs_env, nkind=nkind, qs_kind_set=qs_kind_set, para_env=para_env, &
1073 natom=natom, particle_set=particle_set)
1076 ALLOCATE (basis_set_ri(nkind))
1077 ALLOCATE (basis_set_orb(nkind))
1084 xas_tdp_control%ri_m_potential%potential_type, qs_env, &
1085 excited_atoms=ex_atoms, x_range=xas_tdp_control%ri_m_potential%cutoff_radius)
1087 CALL get_opt_3c_dist2d(xas_tdp_env%opt_dist2d_ex, ab_list, ac_list, basis_set_orb, &
1088 basis_set_orb, basis_set_ri, qs_env)
1094 ext_dist2d=xas_tdp_env%opt_dist2d_ex)
1096 xas_tdp_control%ri_m_potential%potential_type, qs_env, &
1097 excited_atoms=ex_atoms, x_range=xas_tdp_control%ri_m_potential%cutoff_radius, &
1098 ext_dist2d=xas_tdp_env%opt_dist2d_ex)
1101 ALLOCATE (blk_size_orb(natom), blk_size_ri(natom))
1103 CALL get_particle_set(particle_set, qs_kind_set, nsgf=blk_size_orb, basis=basis_set_orb)
1104 CALL get_particle_set(particle_set, qs_kind_set, nsgf=blk_size_ri, basis=basis_set_ri)
1106 ALLOCATE (xas_tdp_env%ri_3c_ex)
1107 CALL create_pqx_tensor(xas_tdp_env%ri_3c_ex, ab_list, ac_list, opt_dbcsr_dist, blk_size_orb, &
1108 blk_size_orb, blk_size_ri)
1109 CALL fill_pqx_tensor(xas_tdp_env%ri_3c_ex, ab_list, ac_list, basis_set_orb, basis_set_orb, &
1110 basis_set_ri, xas_tdp_control%ri_m_potential, qs_env, &
1111 eps_screen=xas_tdp_control%eps_screen)
1117 DEALLOCATE (basis_set_ri, basis_set_orb)
1121 CALL para_env%sync()
1123 CALL timestop(handle)
1140 CHARACTER(len=*),
PARAMETER :: routinen =
'compute_ri_3c_coulomb'
1142 INTEGER :: handle, natom, nkind
1143 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: blk_size_orb, blk_size_ri
1149 POINTER :: ab_list, ac_list
1151 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1153 NULLIFY (basis_set_ri, basis_set_orb, ac_list, ab_list, qs_kind_set, para_env, particle_set)
1155 CALL timeset(routinen, handle)
1158 CALL get_qs_env(qs_env, nkind=nkind, qs_kind_set=qs_kind_set, para_env=para_env, &
1159 natom=natom, particle_set=particle_set)
1162 ALLOCATE (basis_set_ri(nkind))
1163 ALLOCATE (basis_set_orb(nkind))
1169 excited_atoms=xas_tdp_env%ex_atom_indices)
1171 qs_env, excited_atoms=xas_tdp_env%ex_atom_indices)
1172 CALL get_opt_3c_dist2d(xas_tdp_env%opt_dist2d_coul, ab_list, ac_list, basis_set_orb, &
1173 basis_set_orb, basis_set_ri, qs_env, only_bc_same_center=.true.)
1181 excited_atoms=xas_tdp_env%ex_atom_indices, &
1182 ext_dist2d=xas_tdp_env%opt_dist2d_coul)
1187 qs_env, excited_atoms=xas_tdp_env%ex_atom_indices, &
1188 ext_dist2d=xas_tdp_env%opt_dist2d_coul)
1191 ALLOCATE (blk_size_orb(natom), blk_size_ri(natom))
1193 CALL get_particle_set(particle_set, qs_kind_set, nsgf=blk_size_orb, basis=basis_set_orb)
1194 CALL get_particle_set(particle_set, qs_kind_set, nsgf=blk_size_ri, basis=basis_set_ri)
1197 ALLOCATE (xas_tdp_env%ri_3c_coul)
1198 CALL create_pqx_tensor(xas_tdp_env%ri_3c_coul, ab_list, ac_list, opt_dbcsr_dist, blk_size_orb, &
1199 blk_size_orb, blk_size_ri, only_bc_same_center=.true.)
1200 CALL fill_pqx_tensor(xas_tdp_env%ri_3c_coul, ab_list, ac_list, basis_set_orb, basis_set_orb, &
1201 basis_set_ri, pot, qs_env, only_bc_same_center=.true.)
1207 DEALLOCATE (basis_set_ri, basis_set_orb)
1211 CALL para_env%sync()
1213 CALL timestop(handle)
1232 INTEGER,
INTENT(IN) :: ex_kind
1237 INTEGER :: egfp, egfq, maxl, ncop, ncoq, nset, &
1238 nsgf, pset, qset, sgfp, sgfq
1239 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf_set, nsgf_set
1240 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgf
1242 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: metric, pq, work
1243 REAL(
dp),
DIMENSION(:, :),
POINTER :: rpgf, sphi, zet
1244 TYPE(coulomb_integral_context_type) :: integral_context
1247 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1249 NULLIFY (ri_basis, qs_kind_set, para_env, lmin, lmax, npgf_set, zet, rpgf, first_sgf)
1250 NULLIFY (sphi, nsgf_set)
1253 CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set, para_env=para_env)
1254 IF (
ASSOCIATED(xas_tdp_env%ri_inv_ex))
THEN
1255 DEALLOCATE (xas_tdp_env%ri_inv_ex)
1259 CALL get_qs_kind(qs_kind_set(ex_kind), basis_set=ri_basis, basis_type=
"RI_XAS")
1260 CALL get_gto_basis_set(ri_basis, nsgf=nsgf, maxl=maxl, npgf=npgf_set, lmin=lmin, &
1261 lmax=lmax, zet=zet, pgf_radius=rpgf, first_sgf=first_sgf, &
1262 nsgf_set=nsgf_set, sphi=sphi, nset=nset)
1263 ALLOCATE (metric(nsgf, nsgf))
1269 CALL coulomb_integral_init(integral_context, max_am_2c=maxl, &
1276 ncop = npgf_set(pset)*
ncoset(lmax(pset))
1277 sgfp = first_sgf(1, pset)
1278 egfp = sgfp + nsgf_set(pset) - 1
1281 ncoq = npgf_set(qset)*
ncoset(lmax(qset))
1282 sgfq = first_sgf(1, qset)
1283 egfq = sgfq + nsgf_set(qset) - 1
1285 ALLOCATE (work(ncop, ncoq))
1288 CALL compute_coulomb_2c(integral_context, lmin(pset), lmax(pset), lmin(qset), lmax(qset), &
1289 npgf_set(pset), npgf_set(qset), zet(:, pset), zet(:, qset), rpgf(:, pset), rpgf(:, qset), r, r, &
1290 work, xas_tdp_control%ri_m_potential, dab=0.0_dp)
1292 CALL ab_contract(metric(sgfp:egfp, sgfq:egfq), work, sphi(:, sgfp:), sphi(:, sgfq:), &
1293 ncop, ncoq, nsgf_set(pset), nsgf_set(qset))
1302 IF (.NOT. xas_tdp_control%do_ri_metric)
THEN
1305 ALLOCATE (xas_tdp_env%ri_inv_ex(nsgf, nsgf))
1306 xas_tdp_env%ri_inv_ex(:, :) = metric(:, :)
1307 CALL coulomb_integral_cleanup(integral_context)
1315 ALLOCATE (pq(nsgf, nsgf))
1319 ncop = npgf_set(pset)*
ncoset(lmax(pset))
1320 sgfp = first_sgf(1, pset)
1321 egfp = sgfp + nsgf_set(pset) - 1
1324 ncoq = npgf_set(qset)*
ncoset(lmax(qset))
1325 sgfq = first_sgf(1, qset)
1326 egfq = sgfq + nsgf_set(qset) - 1
1328 ALLOCATE (work(ncop, ncoq))
1331 CALL compute_coulomb_2c(integral_context, lmin(pset), lmax(pset), lmin(qset), lmax(qset), &
1332 npgf_set(pset), npgf_set(qset), zet(:, pset), zet(:, qset), rpgf(:, pset), rpgf(:, qset), r, r, &
1333 work, xas_tdp_control%x_potential, dab=0.0_dp)
1335 CALL ab_contract(pq(sgfp:egfp, sgfq:egfq), work, sphi(:, sgfp:), sphi(:, sgfq:), &
1336 ncop, ncoq, nsgf_set(pset), nsgf_set(qset))
1343 ALLOCATE (xas_tdp_env%ri_inv_ex(nsgf, nsgf))
1344 xas_tdp_env%ri_inv_ex = 0.0_dp
1346 CALL dgemm(
'N',
'N', nsgf, nsgf, nsgf, 1.0_dp, metric, nsgf, pq, nsgf, &
1347 0.0_dp, xas_tdp_env%ri_inv_ex, nsgf)
1348 CALL dgemm(
'N',
'N', nsgf, nsgf, nsgf, 1.0_dp, xas_tdp_env%ri_inv_ex, nsgf, metric, nsgf, &
1350 xas_tdp_env%ri_inv_ex(:, :) = pq(:, :)
1352 CALL coulomb_integral_cleanup(integral_context)
1367 INTEGER,
INTENT(IN) :: ex_kind
1374 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1376 NULLIFY (ri_basis, qs_kind_set)
1379 CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set)
1380 IF (
ASSOCIATED(xas_tdp_env%ri_inv_coul))
THEN
1381 DEALLOCATE (xas_tdp_env%ri_inv_coul)
1385 CALL get_qs_kind(qs_kind_set(ex_kind), basis_set=ri_basis, basis_type=
"RI_XAS")
1387 ALLOCATE (xas_tdp_env%ri_inv_coul(nsgf, nsgf))
1388 xas_tdp_env%ri_inv_coul = 0.0_dp
1390 IF (.NOT. xas_tdp_control%is_periodic)
THEN
1392 rab=[0.0_dp, 0.0_dp, 0.0_dp], fba=ri_basis, fbb=ri_basis, &
1393 calculate_forces=.false.)
1394 cpassert(
ASSOCIATED(xas_tdp_control))
1396 CALL periodic_ri_coulomb2(xas_tdp_env%ri_inv_coul, ri_basis, qs_env)
1410 SUBROUTINE periodic_ri_coulomb2(ri_coul2, ri_basis, qs_env)
1412 REAL(
dp),
DIMENSION(:, :),
INTENT(INOUT) :: ri_coul2
1416 INTEGER :: maxco, ncop, ncoq, nset, op, oq, ppgf, &
1417 pset, qpgf, qset, sgfp, sgfq
1418 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf, nsgf
1419 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgf
1421 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: hpq
1422 REAL(
dp),
DIMENSION(:, :),
POINTER :: sphi, zet
1426 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1428 NULLIFY (cell, qs_kind_set, lmin, lmax, nsgf, npgf, zet, sphi, first_sgf)
1433 CALL get_qs_env(qs_env, cell=cell, qs_kind_set=qs_kind_set, para_env=para_env)
1435 CALL eri_mme_init(mme_param%par, n_minimax=20, cutoff=300.0_dp, do_calib_cutoff=.true., &
1436 cutoff_min=10.0_dp, cutoff_max=10000.0_dp, cutoff_eps=0.01_dp, &
1437 cutoff_delta=0.9_dp, sum_precision=1.0e-12_dp, debug=.false., &
1438 debug_delta=1.0e-6_dp, debug_nsum=1000000, unit_nr=0, print_calib=.false., &
1439 do_error_est=.false.)
1440 mme_param%do_calib = .true.
1444 CALL get_gto_basis_set(ri_basis, lmax=lmax, npgf=npgf, zet=zet, lmin=lmin, nset=nset, &
1445 nsgf_set=nsgf, sphi=sphi, first_sgf=first_sgf, maxco=maxco)
1448 ALLOCATE (hpq(nset*maxco, nset*maxco))
1452 ncop = npgf(pset)*
ncoset(lmax(pset))
1453 sgfp = first_sgf(1, pset)
1456 ncoq = npgf(qset)*
ncoset(lmax(qset))
1457 sgfq = first_sgf(1, qset)
1459 DO ppgf = 1, npgf(pset)
1460 op = (pset - 1)*maxco + (ppgf - 1)*
ncoset(lmax(pset))
1461 DO qpgf = 1, npgf(qset)
1462 oq = (qset - 1)*maxco + (qpgf - 1)*
ncoset(lmax(qset))
1465 lmax(qset), zet(ppgf, pset), zet(qpgf, qset), r, hpq, &
1472 op = (pset - 1)*maxco + 1
1473 oq = (qset - 1)*maxco + 1
1475 CALL ab_contract(ri_coul2(sgfp:sgfp + nsgf(pset) - 1, sgfq:sgfq + nsgf(qset) - 1), &
1476 hpq(op:op + ncop - 1, oq:oq + ncoq - 1), sphi(:, sgfp:), sphi(:, sgfq:), &
1477 ncop, ncoq, nsgf(pset), nsgf(qset))
1485 END SUBROUTINE periodic_ri_coulomb2
static int imax(int x, int y)
Returns the larger of two given integers (missing from the C standard).
static void dgemm(const char transa, const char transb, const int m, const int n, const int k, const double alpha, const double *a, const int lda, const double *b, const int ldb, const double beta, double *c, const int ldc)
Convenient wrapper to hide Fortran nature of dgemm_, swapping a and b.
Contraction of integrals over primitive Cartesian Gaussians based on the contraction matrix sphi whic...
subroutine, public abc_contract_xsmm(abcint, sabc, sphi_a, sphi_b, sphi_c, ncoa, ncob, ncoc, nsgfa, nsgfb, nsgfc, cpp_buffer, ccp_buffer, prefac, pstfac)
3-center contraction routine from primitive cartesian Gaussians to spherical Gaussian functions using...
subroutine, public ab_contract(abint, sab, sphi_a, sphi_b, ncoa, ncob, nsgfa, nsgfb)
contract overlap integrals (a,b) and transfer to spherical Gaussians
Define the atomic kind types and their sub types.
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)
...
Handles all functions related to the CELL.
constants for the different operators of the 2c-integrals
integer, parameter, public operator_coulomb
Common interface for two- and three-center Coulomb integrals.
various utilities that regard array of different kinds: output, allocation,... maybe it is not a good...
methods related to the blacs parallel environment
subroutine, public dbcsr_distribution_release(dist)
...
subroutine, public dbcsr_distribution_get(dist, row_dist, col_dist, nrows, ncols, has_threads, group, mynode, numnodes, nprows, npcols, myprow, mypcol, pgrid, subgroups_defined, prow_group, pcol_group)
...
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_dist2d_to_dist(dist2d, dist)
Creates a DBCSR distribution from a distribution_2d.
Interface to Minimax-Ewald method for periodic ERI's to be used in CP2K.
Utility routines to open and close files.
subroutine, public open_file(file_name, unit_number, file_status, file_form, file_action, file_position, file_pad, file_access, debug)
Opens a file and returns its logical unit number.
subroutine, public close_file(unit_number, file_status)
Closes an open file given by its logical unit number.
This is the start of a dbt_api, all publically needed functions are exported here....
stores a lists of integer that are local to a processor. The idea is that these integers represent ob...
stores a mapping of 2D info (e.g. matrix) on a 2D processor distribution (i.e. blacs grid) where cpus...
subroutine, public distribution_2d_create(distribution_2d, blacs_env, local_rows_ptr, n_local_rows, local_cols_ptr, row_distribution_ptr, col_distribution_ptr, n_local_cols, n_row_distribution, n_col_distribution)
initializes the distribution_2d
Minimax-Ewald (MME) method for calculating 2-center and 3-center electron repulsion integrals (ERI) o...
subroutine, public eri_mme_2c_integrate(param, la_min, la_max, lb_min, lb_max, zeta, zetb, rab, hab, o1, o2, g_count, r_count, normalize, potential, pot_par)
Low-level integration routine for 2-center ERIs.
Types and initialization / release routines for Minimax-Ewald method for electron repulsion integrals...
subroutine, public eri_mme_release(param)
...
subroutine, public eri_mme_init(param, n_minimax, cutoff, do_calib_cutoff, do_error_est, cutoff_min, cutoff_max, cutoff_eps, cutoff_delta, sum_precision, debug, debug_delta, debug_nsum, unit_nr, print_calib)
...
Calculation of contracted, spherical Gaussian integrals using the (OS) integral scheme....
subroutine, public int_operators_r12_ab_os(r12_operator, vab, dvab, rab, fba, fbb, omega, r_cutoff, calculate_forces)
Calcululates the two-center integrals of the type (a|O(r12)|b) using the OS scheme.
Library choices for electronic integral APIs.
real(dp), parameter, public cutoff_screen_factor
integer, parameter, public library_libint
Defines the basic variable types.
integer, parameter, public dp
Collection of simple mathematical functions and subroutines.
subroutine, public invmat_symm(a, potrf, uplo)
returns inverse of real symmetric, positive definite matrix
Interface to the message passing library MPI.
Define the data structure for the molecule information.
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:), allocatable, public ncoset
Define methods related to particle_type.
subroutine, public get_particle_set(particle_set, qs_kind_set, first_sgf, last_sgf, nsgf, nmao, basis, ncgf)
Get the components of a particle set.
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.
Some utility functions for the calculation of integrals.
subroutine, public basis_set_list_setup(basis_set_list, basis_type, qs_kind_set)
Set up an easy accessible list of the basis sets for all kinds.
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.
Define the neighbor list data types and the corresponding functionality.
subroutine, public release_neighbor_list_sets(nlists)
releases an array of neighbor_list_sets
subroutine, public neighbor_list_iterator_create(iterator_set, nl, search, nthread)
Neighbor list iterator functions.
subroutine, public nl_set_sub_iterator(iterator_set, ikind, jkind, iatom, mepos)
...
subroutine, public neighbor_list_iterator_release(iterator_set)
...
subroutine, public get_neighbor_list_set_p(neighbor_list_sets, nlist, symmetric)
Return the components of the first neighbor list set.
integer function, public neighbor_list_iterate(iterator_set, mepos)
...
subroutine, public get_iterator_info(iterator_set, mepos, ikind, jkind, nkind, ilist, nlist, inode, nnode, iatom, jatom, r, cell)
...
Generate the atomic neighbor lists.
subroutine, public atom2d_cleanup(atom2d)
free the internals of atom2d
subroutine, public pair_radius_setup(present_a, present_b, radius_a, radius_b, pair_radius, prmin)
...
subroutine, public build_neighbor_lists(ab_list, particle_set, atom, cell, pair_radius, subcells, mic, symmetric, molecular, subset_of_mol, current_subset, operator_type, nlname, atomb_to_keep, stable_images)
Build simple pair neighbor lists.
subroutine, public atom2d_build(atom2d, distribution_1d, distribution_2d, atomic_kind_set, molecule_set, molecule_only, particle_set)
Build some distribution structure of atoms, refactored from build_qs_neighbor_lists.
3-center overlap type integrals containers
subroutine, public get_o3c_iterator_info(o3c_iterator, mepos, iatom, jatom, katom, ikind, jkind, kkind, rij, rik, cellj, cellk, integral, tvec, force_i, force_j, force_k)
...
subroutine, public o3c_iterator_create(o3c, o3c_iterator, nthread)
...
subroutine, public release_o3c_container(o3c_container)
...
subroutine, public o3c_iterator_release(o3c_iterator)
...
integer function, public o3c_iterate(o3c_iterator, mepos)
...
subroutine, public init_o3c_container(o3c, nspin, basis_set_list_a, basis_set_list_b, basis_set_list_c, sab_nl, sac_nl, only_bc_same_center)
...
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.
3-center integrals machinery for the XAS_TDP method
subroutine, public build_xas_tdp_3c_nl(ac_list, basis_a, basis_c, op_type, qs_env, excited_atoms, x_range, ext_dist2d)
Builds a neighbor lists set taylored for 3-center integral within XAS TDP, such that only excited ato...
subroutine, public compute_ri_coulomb2_int(ex_kind, xas_tdp_env, xas_tdp_control, qs_env)
Computes the two-center Coulomb integral needed for the RI in kernel calculation. Stores the integral...
subroutine, public build_xas_tdp_ovlp_nl(ab_list, basis_a, basis_b, qs_env, excited_atoms, ext_dist2d)
Builds a neighbor lists set for overlaping 2-center S_ab, where b is restricted on a a given list of ...
subroutine, public fill_pqx_tensor(pq_x, ab_nl, ac_nl, basis_set_list_a, basis_set_list_b, basis_set_list_c, potential_parameter, qs_env, only_bc_same_center, eps_screen)
Fills the given 3 dimensional (pq|X) tensor with integrals.
subroutine, public compute_ri_3c_coulomb(xas_tdp_env, qs_env)
Computes the RI Coulomb 3-center integrals (ab|c), where c is from the RI_XAS basis and centered on t...
subroutine, public compute_ri_exchange2_int(ex_kind, xas_tdp_env, xas_tdp_control, qs_env)
Computes the two-center Exchange integral needed for the RI in kernel calculation....
subroutine, public create_pqx_tensor(pq_x, ab_nl, ac_nl, matrix_dist, blk_size_1, blk_size_2, blk_size_3, only_bc_same_center)
Prepares a tensor to hold 3-center integrals (pq|X), where p,q are distributed according to the given...
subroutine, public get_opt_3c_dist2d(opt_3c_dist2d, ab_list, ac_list, basis_set_a, basis_set_b, basis_set_c, qs_env, only_bc_same_center)
Returns an optimized distribution_2d for the given neighbor lists based on an evaluation of the cost ...
subroutine, public compute_ri_3c_exchange(ex_atoms, xas_tdp_env, xas_tdp_control, qs_env)
Computes the RI exchange 3-center integrals (ab|c), where c is from the RI_XAS basis and centered on ...
Define XAS TDP control type and associated create, release, etc subroutines, as well as XAS TDP envir...
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
represent a pointer to a 1d array
represent a pointer to a 2d array
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
structure to store local (to a processor) ordered lists of integers.
distributes pairs on a 2d grid of processors
stores all the informations relevant to an mpi environment
Provides all information about a quickstep kind.
Type containing control information for TDP XAS calculations.
Type containing informations such as inputs and results for TDP XAS calculations.