14 USE omp_lib,
ONLY: omp_get_max_threads,&
37 dbt_create, dbt_distribution_destroy, dbt_distribution_new, dbt_distribution_type, &
38 dbt_finalize, dbt_pgrid_create, dbt_pgrid_destroy, dbt_pgrid_type, dbt_put_block, &
39 dbt_reserve_blocks, dbt_type
98#include "./base/base_uses.f90"
103 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'xas_tdp_integrals'
127 blk_size_3, only_bc_same_center)
129 TYPE(dbt_type),
INTENT(OUT) :: pq_x
131 POINTER :: ab_nl, ac_nl
133 INTEGER,
DIMENSION(:),
INTENT(IN) :: blk_size_1, blk_size_2, blk_size_3
134 LOGICAL,
INTENT(IN),
OPTIONAL :: only_bc_same_center
136 CHARACTER(len=*),
PARAMETER :: routinen =
'create_pqX_tensor'
138 INTEGER :: a, b, group_handle, handle, i, iatom, &
139 ikind, jatom, katom, kkind, nblk, &
140 nblk_3, nblk_per_thread, nkind
141 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: idx1,
idx2,
idx3
142 INTEGER,
DIMENSION(3) :: pdims
143 INTEGER,
DIMENSION(:),
POINTER :: col_dist, row_dist
144 INTEGER,
DIMENSION(:, :),
POINTER :: mat_pgrid
145 LOGICAL :: my_sort_bc, symmetric
146 REAL(
dp),
DIMENSION(3) :: rab, rac, rbc
147 TYPE(dbt_distribution_type) :: t_dist
148 TYPE(dbt_pgrid_type) :: t_pgrid
151 DIMENSION(:),
POINTER :: ab_iter, ac_iter
153 NULLIFY (ab_iter, ac_iter, col_dist, row_dist, mat_pgrid)
155 CALL timeset(routinen, handle)
158 IF (
PRESENT(only_bc_same_center)) my_sort_bc = only_bc_same_center
165 row_dist=row_dist, col_dist=col_dist)
166 CALL group%set_handle(group_handle)
169 pdims(1) =
SIZE(mat_pgrid, 1); pdims(2) =
SIZE(mat_pgrid, 2); pdims(3) = 1
170 CALL dbt_pgrid_create(group, pdims, t_pgrid)
172 nblk_3 =
SIZE(blk_size_3)
173 CALL dbt_distribution_new(t_dist, t_pgrid, nd_dist_1=row_dist, nd_dist_2=col_dist, &
174 nd_dist_3=[(0, i=1, nblk_3)])
177 CALL dbt_create(pq_x, name=
"(pq|X)", dist=t_dist, map1_2d=[1, 2], map2_2d=[3], &
178 blk_size_1=blk_size_1, blk_size_2=blk_size_2, blk_size_3=blk_size_3)
195 rbc(:) = rac(:) - rab(:)
196 IF (.NOT. (all(abs(rbc) .LE. 1.0e-8_dp) .OR. all(abs(rac) .LE. 1.0e-8_dp))) cycle
207 ALLOCATE (idx1(nblk),
idx2(nblk),
idx3(nblk))
214 CALL get_iterator_info(ab_iter, ikind=ikind, iatom=iatom, jatom=jatom, nkind=nkind, r=rab)
225 rbc(:) = rac(:) - rab(:)
226 IF (.NOT. (all(abs(rbc) .LE. 1.0e-8_dp) .OR. all(abs(rac) .LE. 1.0e-8_dp))) cycle
244 nblk_per_thread = nblk/omp_get_num_threads() + 1
245 a = omp_get_thread_num()*nblk_per_thread + 1
246 b = min(a + nblk_per_thread, nblk)
247 CALL dbt_reserve_blocks(pq_x, idx1(a:b),
idx2(a:b),
idx3(a:b))
249 CALL dbt_finalize(pq_x)
252 CALL dbt_distribution_destroy(t_dist)
253 CALL dbt_pgrid_destroy(t_pgrid)
255 CALL timestop(handle)
275 basis_set_list_c, potential_parameter, qs_env, &
276 only_bc_same_center, eps_screen)
278 TYPE(dbt_type) :: pq_x
280 POINTER :: ab_nl, ac_nl
285 LOGICAL,
INTENT(IN),
OPTIONAL :: only_bc_same_center
286 REAL(
dp),
INTENT(IN),
OPTIONAL :: eps_screen
288 CHARACTER(len=*),
PARAMETER :: routinen =
'fill_pqX_tensor'
290 INTEGER :: egfa, egfb, egfc, handle, i, iatom, ibasis, ikind, ilist,
imax, iset, jatom, &
291 jkind, jset, katom, kkind, kset, m_max, max_nset, maxli, maxlj, maxlk, mepos, nbasis, &
292 ncoa, ncob, ncoc, ni, nj, nk, nseta, nsetb, nsetc, nthread, sgfa, sgfb, sgfc, unit_id
293 INTEGER,
DIMENSION(:),
POINTER :: la_max, la_min, lb_max, lb_min, lc_max, &
294 lc_min, npgfa, npgfb, npgfc, nsgfa, &
296 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgfa, first_sgfb, first_sgfc
297 LOGICAL :: do_screen, my_sort_bc
298 REAL(
dp) :: dij, dik, djk, my_eps_screen, ri(3), &
299 rij(3), rik(3), rj(3), rjk(3), rk(3), &
300 sabc_ext, screen_radius
301 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: ccp_buffer, cpp_buffer
302 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: max_contr, max_contra, max_contrb, &
304 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :, :) :: iabc, sabc, work
305 REAL(
dp),
DIMENSION(:),
POINTER :: set_radius_a, set_radius_b, set_radius_c
306 REAL(
dp),
DIMENSION(:, :),
POINTER :: rpgf_a, rpgf_b, rpgf_c, zeta, zetb, zetc
316 NULLIFY (basis_set, basis_set_list, para_env, la_max, la_min)
317 NULLIFY (lb_max, lb_min, lc_max, lc_min, npgfa, npgfb, npgfc, nsgfa, nsgfb, nsgfc)
318 NULLIFY (first_sgfa, first_sgfb, first_sgfc, set_radius_a, set_radius_b, set_radius_c)
319 NULLIFY (rpgf_a, rpgf_b, rpgf_c, zeta, zetb, zetc)
320 NULLIFY (basis_set_a, basis_set_b, basis_set_c, tspa, spb, spc)
322 CALL timeset(routinen, handle)
325 nbasis =
SIZE(basis_set_list_a)
328 DO ibasis = 1, nbasis
330 maxl=
imax, nset=iset, nsgf_set=nsgfa)
331 maxli = max(maxli,
imax)
332 max_nset = max(max_nset, iset)
335 DO ibasis = 1, nbasis
337 maxl=
imax, nset=iset, nsgf_set=nsgfb, npgf=npgfb)
338 maxlj = max(maxlj,
imax)
339 max_nset = max(max_nset, iset)
342 DO ibasis = 1, nbasis
344 maxl=
imax, nset=iset, npgf=npgfc)
345 maxlk = max(maxlk,
imax)
346 max_nset = max(max_nset, iset)
348 m_max = maxli + maxlj + maxlk
352 IF (
PRESENT(eps_screen))
THEN
354 my_eps_screen = eps_screen
356 screen_radius = 0.0_dp
363 screen_radius = 1000000.0_dp
370 ALLOCATE (max_contr(max_nset, nbasis), max_contra(max_nset, nbasis), &
371 max_contrb(max_nset, nbasis), max_contrc(max_nset, nbasis))
376 IF (ilist == 1) basis_set_list => basis_set_list_a
377 IF (ilist == 2) basis_set_list => basis_set_list_b
378 IF (ilist == 3) basis_set_list => basis_set_list_c
382 DO ibasis = 1, nbasis
383 basis_set => basis_set_list(ibasis)%gto_basis_set
385 DO iset = 1, basis_set%nset
387 ncoa = basis_set%npgf(iset)*
ncoset(basis_set%lmax(iset))
388 sgfa = basis_set%first_sgf(1, iset)
389 egfa = sgfa + basis_set%nsgf_set(iset) - 1
391 max_contr(iset, ibasis) = &
392 maxval((/(sum(abs(basis_set%sphi(1:ncoa, i))), i=sgfa, egfa)/))
397 IF (ilist == 1) max_contra(:, :) = max_contr(:, :)
398 IF (ilist == 2) max_contrb(:, :) = max_contr(:, :)
399 IF (ilist == 3) max_contrc(:, :) = max_contr(:, :)
401 DEALLOCATE (max_contr)
406 ALLOCATE (tspa(max_nset, nbasis), spb(max_nset, nbasis), spc(max_nset, nbasis))
407 DO ibasis = 1, nbasis
408 DO iset = 1, max_nset
409 NULLIFY (tspa(iset, ibasis)%array)
410 NULLIFY (spb(iset, ibasis)%array)
411 NULLIFY (spc(iset, ibasis)%array)
417 DO ibasis = 1, nbasis
418 IF (ilist == 1) basis_set => basis_set_list_a(ibasis)%gto_basis_set
419 IF (ilist == 2) basis_set => basis_set_list_b(ibasis)%gto_basis_set
420 IF (ilist == 3) basis_set => basis_set_list_c(ibasis)%gto_basis_set
422 DO iset = 1, basis_set%nset
424 ncoa = basis_set%npgf(iset)*
ncoset(basis_set%lmax(iset))
425 sgfa = basis_set%first_sgf(1, iset)
426 egfa = sgfa + basis_set%nsgf_set(iset) - 1
429 ALLOCATE (tspa(iset, ibasis)%array(basis_set%nsgf_set(iset), ncoa))
430 tspa(iset, ibasis)%array(:, :) = transpose(basis_set%sphi(1:ncoa, sgfa:egfa))
431 ELSE IF (ilist == 2)
THEN
432 ALLOCATE (spb(iset, ibasis)%array(ncoa, basis_set%nsgf_set(iset)))
433 spb(iset, ibasis)%array(:, :) = basis_set%sphi(1:ncoa, sgfa:egfa)
435 ALLOCATE (spc(iset, ibasis)%array(ncoa, basis_set%nsgf_set(iset)))
436 spc(iset, ibasis)%array(:, :) = basis_set%sphi(1:ncoa, sgfa:egfa)
444 IF (
PRESENT(only_bc_same_center)) my_sort_bc = only_bc_same_center
452 IF (para_env%mepos == 0)
THEN
453 CALL open_file(unit_number=unit_id, file_name=potential_parameter%filename)
455 CALL init(m_max, unit_id, para_env%mepos, para_env)
456 IF (para_env%mepos == 0)
THEN
472 CALL init_o3c_container(o3c, 1, basis_set_list_a, basis_set_list_b, basis_set_list_c, &
473 ab_nl, ac_nl, only_bc_same_center=my_sort_bc)
494 DO WHILE (
o3c_iterate(o3c_iterator, mepos=mepos) == 0)
496 iatom=iatom, jatom=jatom, katom=katom, rij=rij, rik=rik)
499 basis_set_a => basis_set_list_a(ikind)%gto_basis_set
500 first_sgfa => basis_set_a%first_sgf
501 la_max => basis_set_a%lmax
502 la_min => basis_set_a%lmin
503 npgfa => basis_set_a%npgf
504 nseta = basis_set_a%nset
505 nsgfa => basis_set_a%nsgf_set
506 zeta => basis_set_a%zet
507 rpgf_a => basis_set_a%pgf_radius
508 set_radius_a => basis_set_a%set_radius
511 basis_set_b => basis_set_list_b(jkind)%gto_basis_set
512 first_sgfb => basis_set_b%first_sgf
513 lb_max => basis_set_b%lmax
514 lb_min => basis_set_b%lmin
515 npgfb => basis_set_b%npgf
516 nsetb = basis_set_b%nset
517 nsgfb => basis_set_b%nsgf_set
518 zetb => basis_set_b%zet
519 rpgf_b => basis_set_b%pgf_radius
520 set_radius_b => basis_set_b%set_radius
523 basis_set_c => basis_set_list_c(kkind)%gto_basis_set
524 first_sgfc => basis_set_c%first_sgf
525 lc_max => basis_set_c%lmax
526 lc_min => basis_set_c%lmin
527 npgfc => basis_set_c%npgf
528 nsetc = basis_set_c%nset
529 nsgfc => basis_set_c%nsgf_set
530 zetc => basis_set_c%zet
531 rpgf_c => basis_set_c%pgf_radius
532 set_radius_c => basis_set_c%set_radius
546 ALLOCATE (iabc(ni, nj, nk))
547 iabc(:, :, :) = 0.0_dp
550 ncoa = npgfa(iset)*
ncoset(la_max(iset))
551 sgfa = first_sgfa(1, iset)
552 egfa = sgfa + nsgfa(iset) - 1
555 ncob = npgfb(jset)*
ncoset(lb_max(jset))
556 sgfb = first_sgfb(1, jset)
557 egfb = sgfb + nsgfb(jset) - 1
560 IF (set_radius_a(iset) + set_radius_b(jset) < dij) cycle
563 ncoc = npgfc(kset)*
ncoset(lc_max(kset))
564 sgfc = first_sgfc(1, kset)
565 egfc = sgfc + nsgfc(kset) - 1
568 IF (set_radius_a(iset) + set_radius_c(kset) + screen_radius < dik) cycle
569 IF (set_radius_b(jset) + set_radius_c(kset) + screen_radius < djk) cycle
572 ALLOCATE (sabc(ncoa, ncob, ncoc))
573 sabc(:, :, :) = 0.0_dp
576 CALL eri_3center(sabc, la_min(iset), la_max(iset), npgfa(iset), zeta(:, iset), &
577 rpgf_a(:, iset), ri, lb_min(jset), lb_max(jset), npgfb(jset), &
578 zetb(:, jset), rpgf_b(:, jset), rj, lc_min(kset), lc_max(kset), &
579 npgfc(kset), zetc(:, kset), rpgf_c(:, kset), rk, dij, dik, &
580 djk, lib, potential_parameter, int_abc_ext=sabc_ext)
581 IF (my_eps_screen > sabc_ext*(max_contra(iset, ikind)* &
582 max_contrb(jset, jkind)* &
583 max_contrc(kset, kkind)))
THEN
588 CALL eri_3center(sabc, la_min(iset), la_max(iset), npgfa(iset), zeta(:, iset), &
589 rpgf_a(:, iset), ri, lb_min(jset), lb_max(jset), npgfb(jset), &
590 zetb(:, jset), rpgf_b(:, jset), rj, lc_min(kset), lc_max(kset), &
591 npgfc(kset), zetc(:, kset), rpgf_c(:, kset), rk, dij, dik, &
592 djk, lib, potential_parameter)
595 ALLOCATE (work(nsgfa(iset), nsgfb(jset), nsgfc(kset)))
597 CALL abc_contract_xsmm(work, sabc, tspa(iset, ikind)%array, spb(jset, jkind)%array, &
598 spc(kset, kkind)%array, ncoa, ncob, ncoc, nsgfa(iset), &
599 nsgfb(jset), nsgfc(kset), cpp_buffer, ccp_buffer)
601 iabc(sgfa:egfa, sgfb:egfb, sgfc:egfc) = work(:, :, :)
602 DEALLOCATE (sabc, work)
610 CALL dbt_put_block(pq_x, [iatom, jatom, katom], shape(iabc), iabc, summation=.true.)
616 IF (
ALLOCATED(ccp_buffer))
DEALLOCATE (ccp_buffer)
617 IF (
ALLOCATED(cpp_buffer))
DEALLOCATE (cpp_buffer)
626 DO iset = 1, max_nset
627 DO ibasis = 1, nbasis
628 IF (
ASSOCIATED(tspa(iset, ibasis)%array))
DEALLOCATE (tspa(iset, ibasis)%array)
629 IF (
ASSOCIATED(spb(iset, ibasis)%array))
DEALLOCATE (spb(iset, ibasis)%array)
630 IF (
ASSOCIATED(spc(iset, ibasis)%array))
DEALLOCATE (spc(iset, ibasis)%array)
633 DEALLOCATE (tspa, spb, spc)
635 CALL timestop(handle)
656 INTEGER,
DIMENSION(:),
INTENT(IN),
OPTIONAL :: excited_atoms
659 INTEGER :: ikind, nkind
660 LOGICAL :: my_restrictb
661 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: a_present, b_present
663 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: a_radius, b_radius
664 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: pair_radius
673 NULLIFY (atomic_kind_set, distribution_1d, distribution_2d, molecule_set, particle_set, cell)
679 my_restrictb = .false.
680 IF (
PRESENT(excited_atoms))
THEN
681 my_restrictb = .true.
684 ALLOCATE (a_present(nkind), b_present(nkind))
687 ALLOCATE (a_radius(nkind), b_radius(nkind))
693 IF (
ASSOCIATED(basis_a(ikind)%gto_basis_set))
THEN
694 a_present(ikind) = .true.
695 CALL get_gto_basis_set(basis_a(ikind)%gto_basis_set, kind_radius=a_radius(ikind))
698 IF (
ASSOCIATED(basis_b(ikind)%gto_basis_set))
THEN
699 b_present(ikind) = .true.
700 CALL get_gto_basis_set(basis_b(ikind)%gto_basis_set, kind_radius=b_radius(ikind))
704 ALLOCATE (pair_radius(nkind, nkind))
709 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, cell=cell, &
710 distribution_2d=distribution_2d, local_particles=distribution_1d, &
711 particle_set=particle_set, molecule_set=molecule_set)
714 IF (
PRESENT(ext_dist2d)) distribution_2d => ext_dist2d
716 ALLOCATE (atom2d(nkind))
717 CALL atom2d_build(atom2d, distribution_1d, distribution_2d, atomic_kind_set, &
718 molecule_set, .false., particle_set)
720 IF (my_restrictb)
THEN
723 atomb_to_keep=excited_atoms, nlname=
"XAS_TDP_ovlp_nl")
728 nlname=
"XAS_TDP_ovlp_nl")
755 INTEGER,
INTENT(IN) :: op_type
757 INTEGER,
DIMENSION(:),
INTENT(IN),
OPTIONAL :: excited_atoms
758 REAL(
dp),
INTENT(IN),
OPTIONAL :: x_range
761 INTEGER :: ikind, nkind
762 LOGICAL :: sort_atoms
763 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: a_present, c_present
765 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: a_radius, c_radius
766 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: pair_radius
775 NULLIFY (atomic_kind_set, distribution_1d, distribution_2d, molecule_set, particle_set, cell)
781 IF ((
PRESENT(excited_atoms))) sort_atoms = .true.
783 ALLOCATE (a_present(nkind), c_present(nkind))
786 ALLOCATE (a_radius(nkind), c_radius(nkind))
796 IF (
ASSOCIATED(basis_a(ikind)%gto_basis_set))
THEN
797 a_present(ikind) = .true.
798 CALL get_gto_basis_set(basis_a(ikind)%gto_basis_set, kind_radius=a_radius(ikind))
801 IF (
ASSOCIATED(basis_c(ikind)%gto_basis_set))
THEN
802 c_present(ikind) = .true.
803 CALL get_gto_basis_set(basis_c(ikind)%gto_basis_set, kind_radius=c_radius(ikind))
811 IF (
ASSOCIATED(basis_c(ikind)%gto_basis_set))
THEN
812 c_present(ikind) = .true.
813 c_radius(ikind) = 1000000.0_dp
815 IF (
ASSOCIATED(basis_a(ikind)%gto_basis_set)) a_present(ikind) = .true.
822 IF (
ASSOCIATED(basis_a(ikind)%gto_basis_set))
THEN
823 a_present(ikind) = .true.
824 CALL get_gto_basis_set(basis_a(ikind)%gto_basis_set, kind_radius=a_radius(ikind))
826 IF (
ASSOCIATED(basis_c(ikind)%gto_basis_set))
THEN
827 c_present(ikind) = .true.
828 CALL get_gto_basis_set(basis_c(ikind)%gto_basis_set, kind_radius=c_radius(ikind))
829 c_radius(ikind) = c_radius(ikind) + x_range
834 cpabort(
"Operator not known")
837 ALLOCATE (pair_radius(nkind, nkind))
842 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, cell=cell, &
843 distribution_2d=distribution_2d, local_particles=distribution_1d, &
844 particle_set=particle_set, molecule_set=molecule_set)
847 IF (
PRESENT(ext_dist2d)) distribution_2d => ext_dist2d
849 ALLOCATE (atom2d(nkind))
850 CALL atom2d_build(atom2d, distribution_1d, distribution_2d, atomic_kind_set, &
851 molecule_set, .false., particle_set)
855 operator_type=
"ABC", atomb_to_keep=excited_atoms, &
856 nlname=
"XAS_TDP_3c_nl")
859 operator_type=
"ABC", nlname=
"XAS_TDP_3c_nl")
880 basis_set_c, qs_env, only_bc_same_center)
884 POINTER :: ab_list, ac_list
887 LOGICAL,
INTENT(IN),
OPTIONAL :: only_bc_same_center
889 CHARACTER(len=*),
PARAMETER :: routinen =
'get_opt_3c_dist2d'
891 INTEGER :: handle, i, iatom, ikind, ip, jatom, &
892 jkind, kkind, mypcol, myprow, n, &
893 natom, nkind, npcol, nprow, nsgfa, &
895 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: nparticle_local_col, nparticle_local_row
896 INTEGER,
DIMENSION(:, :),
POINTER :: col_dist, row_dist
897 LOGICAL :: my_sort_bc
898 REAL(
dp) :: cost, rab(3), rac(3), rbc(3)
899 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: col_cost, col_proc_cost, row_cost, &
901 TYPE(
cp_1d_i_p_type),
DIMENSION(:),
POINTER :: local_particle_col, local_particle_row
905 DIMENSION(:),
POINTER :: ab_iter, ac_iter
907 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
909 NULLIFY (para_env, col_dist, row_dist, blacs_env, qs_kind_set, particle_set)
910 NULLIFY (local_particle_col, local_particle_row, ab_iter, ac_iter)
912 CALL timeset(routinen, handle)
919 IF (
PRESENT(only_bc_same_center)) my_sort_bc = only_bc_same_center
921 CALL get_qs_env(qs_env, natom=natom, para_env=para_env, blacs_env=blacs_env, &
922 qs_kind_set=qs_kind_set, particle_set=particle_set, nkind=nkind)
924 myprow = blacs_env%mepos(1) + 1
925 mypcol = blacs_env%mepos(2) + 1
926 nprow = blacs_env%num_pe(1)
927 npcol = blacs_env%num_pe(2)
929 ALLOCATE (col_cost(natom), row_cost(natom))
930 col_cost = 0.0_dp; row_cost = 0.0_dp
932 ALLOCATE (row_dist(natom, 2), col_dist(natom, 2))
933 row_dist = 1; col_dist = 1
938 CALL get_iterator_info(ab_iter, ikind=ikind, jkind=jkind, iatom=iatom, jatom=jatom, r=rab)
948 rbc(:) = rac(:) - rab(:)
949 IF (.NOT. (all(abs(rbc) .LE. 1.0e-8_dp) .OR. all(abs(rac) .LE. 1.0e-8_dp))) cycle
954 nsgfa = basis_set_a(ikind)%gto_basis_set%nsgf
955 nsgfb = basis_set_b(jkind)%gto_basis_set%nsgf
956 nsgfc = basis_set_c(kkind)%gto_basis_set%nsgf
958 cost = real(nsgfa*nsgfb*nsgfc,
dp)
960 row_cost(iatom) = row_cost(iatom) + cost
961 col_cost(jatom) = col_cost(jatom) + cost
969 CALL para_env%sum(row_cost)
970 CALL para_env%sum(col_cost)
973 ALLOCATE (col_proc_cost(npcol), row_proc_cost(nprow))
974 col_proc_cost = 0.0_dp; row_proc_cost = 0.0_dp
976 iatom = maxloc(row_cost, 1)
977 ip = minloc(row_proc_cost, 1)
978 row_proc_cost(ip) = row_proc_cost(ip) + row_cost(iatom)
979 row_dist(iatom, 1) = ip
980 row_cost(iatom) = 0.0_dp
982 iatom = maxloc(col_cost, 1)
983 ip = minloc(col_proc_cost, 1)
984 col_proc_cost(ip) = col_proc_cost(ip) + col_cost(iatom)
985 col_dist(iatom, 1) = ip
986 col_cost(iatom) = 0.0_dp
990 ALLOCATE (local_particle_col(nkind), local_particle_row(nkind))
991 ALLOCATE (nparticle_local_row(nkind), nparticle_local_col(nkind))
992 nparticle_local_row = 0; nparticle_local_col = 0
995 ikind = particle_set(iatom)%atomic_kind%kind_number
997 IF (row_dist(iatom, 1) == myprow) nparticle_local_row(ikind) = nparticle_local_row(ikind) + 1
998 IF (col_dist(iatom, 1) == mypcol) nparticle_local_col(ikind) = nparticle_local_col(ikind) + 1
1002 n = nparticle_local_row(ikind)
1003 ALLOCATE (local_particle_row(ikind)%array(n))
1005 n = nparticle_local_col(ikind)
1006 ALLOCATE (local_particle_col(ikind)%array(n))
1009 nparticle_local_row = 0; nparticle_local_col = 0
1011 ikind = particle_set(iatom)%atomic_kind%kind_number
1013 IF (row_dist(iatom, 1) == myprow)
THEN
1014 nparticle_local_row(ikind) = nparticle_local_row(ikind) + 1
1015 local_particle_row(ikind)%array(nparticle_local_row(ikind)) = iatom
1017 IF (col_dist(iatom, 1) == mypcol)
THEN
1018 nparticle_local_col(ikind) = nparticle_local_col(ikind) + 1
1019 local_particle_col(ikind)%array(nparticle_local_col(ikind)) = iatom
1024 row_dist(:, 1) = row_dist(:, 1) - 1
1025 col_dist(:, 1) = col_dist(:, 1) - 1
1027 col_distribution_ptr=col_dist, local_rows_ptr=local_particle_row, &
1028 local_cols_ptr=local_particle_col, blacs_env=blacs_env)
1030 CALL timestop(handle)
1046 INTEGER,
DIMENSION(:),
INTENT(IN) :: ex_atoms
1051 CHARACTER(len=*),
PARAMETER :: routinen =
'compute_ri_3c_exchange'
1053 INTEGER :: handle, natom, nkind
1054 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: blk_size_orb, blk_size_ri
1059 POINTER :: ab_list, ac_list
1061 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1063 NULLIFY (basis_set_ri, basis_set_orb, ac_list, ab_list, qs_kind_set, para_env, particle_set)
1065 CALL timeset(routinen, handle)
1068 CALL get_qs_env(qs_env, nkind=nkind, qs_kind_set=qs_kind_set, para_env=para_env, &
1069 natom=natom, particle_set=particle_set)
1072 ALLOCATE (basis_set_ri(nkind))
1073 ALLOCATE (basis_set_orb(nkind))
1080 xas_tdp_control%ri_m_potential%potential_type, qs_env, &
1081 excited_atoms=ex_atoms, x_range=xas_tdp_control%ri_m_potential%cutoff_radius)
1083 CALL get_opt_3c_dist2d(xas_tdp_env%opt_dist2d_ex, ab_list, ac_list, basis_set_orb, &
1084 basis_set_orb, basis_set_ri, qs_env)
1090 ext_dist2d=xas_tdp_env%opt_dist2d_ex)
1092 xas_tdp_control%ri_m_potential%potential_type, qs_env, &
1093 excited_atoms=ex_atoms, x_range=xas_tdp_control%ri_m_potential%cutoff_radius, &
1094 ext_dist2d=xas_tdp_env%opt_dist2d_ex)
1097 ALLOCATE (blk_size_orb(natom), blk_size_ri(natom))
1099 CALL get_particle_set(particle_set, qs_kind_set, nsgf=blk_size_orb, basis=basis_set_orb)
1100 CALL get_particle_set(particle_set, qs_kind_set, nsgf=blk_size_ri, basis=basis_set_ri)
1102 ALLOCATE (xas_tdp_env%ri_3c_ex)
1103 CALL create_pqx_tensor(xas_tdp_env%ri_3c_ex, ab_list, ac_list, opt_dbcsr_dist, blk_size_orb, &
1104 blk_size_orb, blk_size_ri)
1105 CALL fill_pqx_tensor(xas_tdp_env%ri_3c_ex, ab_list, ac_list, basis_set_orb, basis_set_orb, &
1106 basis_set_ri, xas_tdp_control%ri_m_potential, qs_env, &
1107 eps_screen=xas_tdp_control%eps_screen)
1113 DEALLOCATE (basis_set_ri, basis_set_orb)
1117 CALL para_env%sync()
1119 CALL timestop(handle)
1136 CHARACTER(len=*),
PARAMETER :: routinen =
'compute_ri_3c_coulomb'
1138 INTEGER :: handle, natom, nkind
1139 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: blk_size_orb, blk_size_ri
1145 POINTER :: ab_list, ac_list
1147 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1149 NULLIFY (basis_set_ri, basis_set_orb, ac_list, ab_list, qs_kind_set, para_env, particle_set)
1151 CALL timeset(routinen, handle)
1154 CALL get_qs_env(qs_env, nkind=nkind, qs_kind_set=qs_kind_set, para_env=para_env, &
1155 natom=natom, particle_set=particle_set)
1158 ALLOCATE (basis_set_ri(nkind))
1159 ALLOCATE (basis_set_orb(nkind))
1165 excited_atoms=xas_tdp_env%ex_atom_indices)
1167 qs_env, excited_atoms=xas_tdp_env%ex_atom_indices)
1168 CALL get_opt_3c_dist2d(xas_tdp_env%opt_dist2d_coul, ab_list, ac_list, basis_set_orb, &
1169 basis_set_orb, basis_set_ri, qs_env, only_bc_same_center=.true.)
1177 excited_atoms=xas_tdp_env%ex_atom_indices, &
1178 ext_dist2d=xas_tdp_env%opt_dist2d_coul)
1183 qs_env, excited_atoms=xas_tdp_env%ex_atom_indices, &
1184 ext_dist2d=xas_tdp_env%opt_dist2d_coul)
1187 ALLOCATE (blk_size_orb(natom), blk_size_ri(natom))
1189 CALL get_particle_set(particle_set, qs_kind_set, nsgf=blk_size_orb, basis=basis_set_orb)
1190 CALL get_particle_set(particle_set, qs_kind_set, nsgf=blk_size_ri, basis=basis_set_ri)
1193 ALLOCATE (xas_tdp_env%ri_3c_coul)
1194 CALL create_pqx_tensor(xas_tdp_env%ri_3c_coul, ab_list, ac_list, opt_dbcsr_dist, blk_size_orb, &
1195 blk_size_orb, blk_size_ri, only_bc_same_center=.true.)
1196 CALL fill_pqx_tensor(xas_tdp_env%ri_3c_coul, ab_list, ac_list, basis_set_orb, basis_set_orb, &
1197 basis_set_ri, pot, qs_env, only_bc_same_center=.true.)
1203 DEALLOCATE (basis_set_ri, basis_set_orb)
1207 CALL para_env%sync()
1209 CALL timestop(handle)
1228 INTEGER,
INTENT(IN) :: ex_kind
1233 INTEGER :: egfp, egfq, maxl, ncop, ncoq, nset, &
1234 nsgf, pset, qset, sgfp, sgfq, unit_id
1235 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf_set, nsgf_set
1236 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgf
1238 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: metric, pq, work
1239 REAL(
dp),
DIMENSION(:, :),
POINTER :: rpgf, sphi, zet
1243 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1245 NULLIFY (ri_basis, qs_kind_set, para_env, lmin, lmax, npgf_set, zet, rpgf, first_sgf)
1246 NULLIFY (sphi, nsgf_set)
1249 CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set, para_env=para_env)
1250 IF (
ASSOCIATED(xas_tdp_env%ri_inv_ex))
THEN
1251 DEALLOCATE (xas_tdp_env%ri_inv_ex)
1255 CALL get_qs_kind(qs_kind_set(ex_kind), basis_set=ri_basis, basis_type=
"RI_XAS")
1256 CALL get_gto_basis_set(ri_basis, nsgf=nsgf, maxl=maxl, npgf=npgf_set, lmin=lmin, &
1257 lmax=lmax, zet=zet, pgf_radius=rpgf, first_sgf=first_sgf, &
1258 nsgf_set=nsgf_set, sphi=sphi, nset=nset)
1259 ALLOCATE (metric(nsgf, nsgf))
1272 IF (para_env%mepos == 0)
THEN
1273 CALL open_file(unit_number=unit_id, file_name=xas_tdp_control%ri_m_potential%filename)
1275 CALL init(2*maxl + 1, unit_id, para_env%mepos, para_env)
1276 IF (para_env%mepos == 0)
THEN
1284 ncop = npgf_set(pset)*
ncoset(lmax(pset))
1285 sgfp = first_sgf(1, pset)
1286 egfp = sgfp + nsgf_set(pset) - 1
1289 ncoq = npgf_set(qset)*
ncoset(lmax(qset))
1290 sgfq = first_sgf(1, qset)
1291 egfq = sgfq + nsgf_set(qset) - 1
1293 ALLOCATE (work(ncop, ncoq))
1296 CALL eri_2center(work, lmin(pset), lmax(pset), npgf_set(pset), zet(:, pset), rpgf(:, pset), &
1297 r, lmin(qset), lmax(qset), npgf_set(qset), zet(:, qset), rpgf(:, qset), &
1298 r, 0.0_dp, lib, xas_tdp_control%ri_m_potential)
1300 CALL ab_contract(metric(sgfp:egfp, sgfq:egfq), work, sphi(:, sgfp:), sphi(:, sgfq:), &
1301 ncop, ncoq, nsgf_set(pset), nsgf_set(qset))
1310 IF (.NOT. xas_tdp_control%do_ri_metric)
THEN
1313 ALLOCATE (xas_tdp_env%ri_inv_ex(nsgf, nsgf))
1314 xas_tdp_env%ri_inv_ex(:, :) = metric(:, :)
1324 IF (para_env%mepos == 0)
THEN
1325 CALL open_file(unit_number=unit_id, file_name=xas_tdp_control%x_potential%filename)
1327 CALL init(2*maxl + 1, unit_id, para_env%mepos, para_env)
1328 IF (para_env%mepos == 0)
THEN
1335 ALLOCATE (pq(nsgf, nsgf))
1339 ncop = npgf_set(pset)*
ncoset(lmax(pset))
1340 sgfp = first_sgf(1, pset)
1341 egfp = sgfp + nsgf_set(pset) - 1
1344 ncoq = npgf_set(qset)*
ncoset(lmax(qset))
1345 sgfq = first_sgf(1, qset)
1346 egfq = sgfq + nsgf_set(qset) - 1
1348 ALLOCATE (work(ncop, ncoq))
1351 CALL eri_2center(work, lmin(pset), lmax(pset), npgf_set(pset), zet(:, pset), rpgf(:, pset), &
1352 r, lmin(qset), lmax(qset), npgf_set(qset), zet(:, qset), rpgf(:, qset), &
1353 r, 0.0_dp, lib, xas_tdp_control%x_potential)
1355 CALL ab_contract(pq(sgfp:egfp, sgfq:egfq), work, sphi(:, sgfp:), sphi(:, sgfq:), &
1356 ncop, ncoq, nsgf_set(pset), nsgf_set(qset))
1363 ALLOCATE (xas_tdp_env%ri_inv_ex(nsgf, nsgf))
1364 xas_tdp_env%ri_inv_ex = 0.0_dp
1366 CALL dgemm(
'N',
'N', nsgf, nsgf, nsgf, 1.0_dp, metric, nsgf, pq, nsgf, &
1367 0.0_dp, xas_tdp_env%ri_inv_ex, nsgf)
1368 CALL dgemm(
'N',
'N', nsgf, nsgf, nsgf, 1.0_dp, xas_tdp_env%ri_inv_ex, nsgf, metric, nsgf, &
1370 xas_tdp_env%ri_inv_ex(:, :) = pq(:, :)
1387 INTEGER,
INTENT(IN) :: ex_kind
1394 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1396 NULLIFY (ri_basis, qs_kind_set)
1399 CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set)
1400 IF (
ASSOCIATED(xas_tdp_env%ri_inv_coul))
THEN
1401 DEALLOCATE (xas_tdp_env%ri_inv_coul)
1405 CALL get_qs_kind(qs_kind_set(ex_kind), basis_set=ri_basis, basis_type=
"RI_XAS")
1407 ALLOCATE (xas_tdp_env%ri_inv_coul(nsgf, nsgf))
1408 xas_tdp_env%ri_inv_coul = 0.0_dp
1410 IF (.NOT. xas_tdp_control%is_periodic)
THEN
1412 rab=(/0.0_dp, 0.0_dp, 0.0_dp/), fba=ri_basis, fbb=ri_basis, &
1413 calculate_forces=.false.)
1414 cpassert(
ASSOCIATED(xas_tdp_control))
1416 CALL periodic_ri_coulomb2(xas_tdp_env%ri_inv_coul, ri_basis, qs_env)
1430 SUBROUTINE periodic_ri_coulomb2(ri_coul2, ri_basis, qs_env)
1432 REAL(
dp),
DIMENSION(:, :),
INTENT(INOUT) :: ri_coul2
1436 INTEGER :: maxco, ncop, ncoq, nset, op, oq, ppgf, &
1437 pset, qpgf, qset, sgfp, sgfq
1438 INTEGER,
DIMENSION(:),
POINTER :: lmax, lmin, npgf, nsgf
1439 INTEGER,
DIMENSION(:, :),
POINTER :: first_sgf
1441 REAL(
dp),
ALLOCATABLE,
DIMENSION(:, :) :: hpq
1442 REAL(
dp),
DIMENSION(:, :),
POINTER :: sphi, zet
1446 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1448 NULLIFY (cell, qs_kind_set, lmin, lmax, nsgf, npgf, zet, sphi, first_sgf)
1453 CALL get_qs_env(qs_env, cell=cell, qs_kind_set=qs_kind_set, para_env=para_env)
1455 CALL eri_mme_init(mme_param%par, n_minimax=20, cutoff=300.0_dp, do_calib_cutoff=.true., &
1456 cutoff_min=10.0_dp, cutoff_max=10000.0_dp, cutoff_eps=0.01_dp, &
1457 cutoff_delta=0.9_dp, sum_precision=1.0e-12_dp, debug=.false., &
1458 debug_delta=1.0e-6_dp, debug_nsum=1000000, unit_nr=0, print_calib=.false., &
1459 do_error_est=.false.)
1460 mme_param%do_calib = .true.
1464 CALL get_gto_basis_set(ri_basis, lmax=lmax, npgf=npgf, zet=zet, lmin=lmin, nset=nset, &
1465 nsgf_set=nsgf, sphi=sphi, first_sgf=first_sgf, maxco=maxco)
1468 ALLOCATE (hpq(nset*maxco, nset*maxco))
1472 ncop = npgf(pset)*
ncoset(lmax(pset))
1473 sgfp = first_sgf(1, pset)
1476 ncoq = npgf(qset)*
ncoset(lmax(qset))
1477 sgfq = first_sgf(1, qset)
1479 DO ppgf = 1, npgf(pset)
1480 op = (pset - 1)*maxco + (ppgf - 1)*
ncoset(lmax(pset))
1481 DO qpgf = 1, npgf(qset)
1482 oq = (qset - 1)*maxco + (qpgf - 1)*
ncoset(lmax(qset))
1485 lmax(qset), zet(ppgf, pset), zet(qpgf, qset), r, hpq, &
1492 op = (pset - 1)*maxco + 1
1493 oq = (qset - 1)*maxco + 1
1495 CALL ab_contract(ri_coul2(sgfp:sgfp + nsgf(pset) - 1, sgfq:sgfq + nsgf(qset) - 1), &
1496 hpq(op:op + ncop - 1, oq:oq + ncoq - 1), sphi(:, sgfp:), sphi(:, sgfq:), &
1497 ncop, ncoq, nsgf(pset), nsgf(qset))
1505 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; can ...
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)
...
Handles all functions related to the CELL.
constants for the different operators of the 2c-integrals
integer, parameter, public operator_coulomb
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. Tracking of preconnections.
subroutine, public open_file(file_name, file_status, file_form, file_action, file_position, file_pad, unit_number, debug, skip_get_unit_number, file_access)
Opens the requested file using a free unit number.
subroutine, public close_file(unit_number, file_status, keep_preconnection)
Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.
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 the incomplete Gamma function F_n(t) for multi-center integrals over Cartesian Gaussia...
subroutine, public init_md_ftable(nmax)
Initialize a table of F_n(t) values in the range 0 <= t <= 12 with a stepsize of 0....
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.
Defines the basic variable types.
integer, parameter, public dp
2- and 3-center electron repulsion integral routines based on libint2 Currently available operators: ...
subroutine, public eri_2center(int_ab, la_min, la_max, npgfa, zeta, rpgfa, ra, lb_min, lb_max, npgfb, zetb, rpgfb, rb, dab, lib, potential_parameter)
Computes the 2-center electron repulsion integrals (a|b) for a given set of cartesian gaussian orbita...
subroutine, public eri_3center(int_abc, la_min, la_max, npgfa, zeta, rpgfa, ra, lb_min, lb_max, npgfb, zetb, rpgfb, rb, lc_min, lc_max, npgfc, zetc, rpgfc, rc, dab, dac, dbc, lib, potential_parameter, int_abc_ext)
Computes the 3-center electron repulsion integrals (ab|c) for a given set of cartesian gaussian orbit...
real(kind=dp), parameter, public cutoff_screen_factor
Interface to the Libint-Library or a c++ wrapper.
subroutine, public cp_libint_init_2eri(lib, max_am)
subroutine, public cp_libint_init_3eri(lib, max_am)
subroutine, public cp_libint_cleanup_3eri(lib)
subroutine, public cp_libint_set_contrdepth(lib, contrdepth)
subroutine, public cp_libint_cleanup_2eri(lib)
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)
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, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs)
Get the QUICKSTEP environment.
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, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, init_u_ramping_each_scf, reltmat, ghost, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
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)
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)
...
This module computes the basic integrals for the truncated coulomb operator.
subroutine, public init(nder, iunit, mepos, group)
...
integer function, public get_lmax_init()
Returns the value of nderiv_init so that one can check if opening the potential file is worhtwhile.
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.