37#include "./base/base_uses.f90"
42 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'libint_2c_3c'
53 REAL(
dp) :: zetainv = 0.0_dp, etainv = 0.0_dp, zetapetainv = 0.0_dp, rho = 0.0_dp
54 REAL(
dp),
DIMENSION(3) :: w = 0.0_dp
55 REAL(
dp),
DIMENSION(prim_data_f_size) :: fm = 0.0_dp
60 REAL(
dp) :: zetainv = 0.0_dp, etainv = 0.0_dp, zetapetainv = 0.0_dp, rho = 0.0_dp
61 REAL(
dp),
DIMENSION(3) :: q = 0.0_dp, w = 0.0_dp
62 REAL(
dp),
DIMENSION(prim_data_f_size) :: fm = 0.0_dp
69 REAL(
dp) :: omega = 0.0_dp
70 REAL(
dp) :: cutoff_radius = 0.0_dp
71 CHARACTER(default_path_length) :: filename =
""
72 REAL(
dp) :: scale_coulomb = 0.0_dp
73 REAL(
dp) :: scale_longrange = 0.0_dp
110 SUBROUTINE eri_3center(int_abc, la_min, la_max, npgfa, zeta, rpgfa, ra, &
111 lb_min, lb_max, npgfb, zetb, rpgfb, rb, &
112 lc_min, lc_max, npgfc, zetc, rpgfc, rc, &
113 dab, dac, dbc, lib, potential_parameter, &
116 REAL(
dp),
DIMENSION(:, :, :),
INTENT(INOUT) :: int_abc
117 INTEGER,
INTENT(IN) :: la_min, la_max, npgfa
118 REAL(
dp),
DIMENSION(:),
INTENT(IN) :: zeta, rpgfa
119 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: ra
120 INTEGER,
INTENT(IN) :: lb_min, lb_max, npgfb
121 REAL(
dp),
DIMENSION(:),
INTENT(IN) :: zetb, rpgfb
122 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: rb
123 INTEGER,
INTENT(IN) :: lc_min, lc_max, npgfc
124 REAL(
dp),
DIMENSION(:),
INTENT(IN) :: zetc, rpgfc
125 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: rc
126 REAL(kind=
dp),
INTENT(IN) :: dab, dac, dbc
129 REAL(
dp),
INTENT(INOUT),
OPTIONAL :: int_abc_ext
131 INTEGER :: a_mysize(1), a_offset, a_start, b_offset, b_start, c_offset, c_start, i, ipgf, j, &
132 jpgf, k, kpgf, li, lj, lk, ncoa, ncob, ncoc, op, p1, p2, p3
133 REAL(
dp) :: dr_ab, dr_ac, dr_bc, zeti, zetj, zetk
134 REAL(
dp),
DIMENSION(:),
POINTER :: p_work
135 TYPE(params_3c),
POINTER :: params
137 NULLIFY (params, p_work)
144 op = potential_parameter%potential_type
155 IF (
PRESENT(int_abc_ext))
THEN
166 a_start = (ipgf - 1)*
ncoset(la_max)
171 IF (rpgfa(ipgf) + rpgfb(jpgf) + dr_ab < dab) cycle
174 b_start = (jpgf - 1)*
ncoset(lb_max)
179 IF (rpgfb(jpgf) + rpgfc(kpgf) + dr_bc < dbc) cycle
180 IF (rpgfa(ipgf) + rpgfc(kpgf) + dr_ac < dac) cycle
183 c_start = (kpgf - 1)*
ncoset(lc_max)
186 CALL set_params_3c(lib, ra, rb, rc, zeti, zetj, zetk, la_max, lb_max, lc_max, &
187 potential_parameter=potential_parameter, params_out=params)
189 DO li = la_min, la_max
190 a_offset = a_start +
ncoset(li - 1)
192 DO lj = max(li, lb_min), lb_max
193 b_offset = b_start +
ncoset(lj - 1)
195 DO lk = lc_min, lc_max
196 c_offset = c_start +
ncoset(lk - 1)
199 a_mysize(1) = ncoa*ncob*ncoc
202 IF (
PRESENT(int_abc_ext))
THEN
206 p2 = (p1 + j - 1)*ncoa
209 int_abc(a_offset + i, b_offset + j, c_offset + k) = p_work(p3)
210 int_abc_ext = max(int_abc_ext, abs(p_work(p3)))
218 p2 = (p1 + j - 1)*ncoa
221 int_abc(a_offset + i, b_offset + j, c_offset + k) = p_work(p3)
232 CALL set_params_3c(lib, rb, ra, rc, params_in=params)
234 DO lj = lb_min, lb_max
235 b_offset = b_start +
ncoset(lj - 1)
237 DO li = max(lj + 1, la_min), la_max
238 a_offset = a_start +
ncoset(li - 1)
240 DO lk = lc_min, lc_max
241 c_offset = c_start +
ncoset(lk - 1)
244 a_mysize(1) = ncoa*ncob*ncoc
247 IF (
PRESENT(int_abc_ext))
THEN
251 p2 = (p1 + i - 1)*ncob
254 int_abc(a_offset + i, b_offset + j, c_offset + k) = p_work(p3)
255 int_abc_ext = max(int_abc_ext, abs(p_work(p3)))
263 p2 = (p1 + i - 1)*ncob
266 int_abc(a_offset + i, b_offset + j, c_offset + k) = p_work(p3)
303 SUBROUTINE set_params_3c(lib, ri, rj, rk, zeti, zetj, zetk, li_max, lj_max, lk_max, &
304 potential_parameter, params_in, params_out)
307 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: ri, rj, rk
308 REAL(
dp),
INTENT(IN),
OPTIONAL :: zeti, zetj, zetk
309 INTEGER,
INTENT(IN),
OPTIONAL :: li_max, lj_max, lk_max
311 TYPE(params_3c),
OPTIONAL,
POINTER :: params_in, params_out
315 REAL(
dp) :: gammaq, omega2, omega_corr, omega_corr2, &
316 prefac, r, s1234, t, tmp
317 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: fm
318 TYPE(params_3c),
POINTER :: params
329 IF (
PRESENT(params_in))
THEN
338 params%m_max = li_max + lj_max + lk_max
340 params%ZetaInv = 1._dp/zetk; params%EtaInv = 1._dp/gammaq
341 params%ZetapEtaInv = 1._dp/(zetk + gammaq)
343 params%Q = (zeti*ri + zetj*rj)*params%EtaInv
344 params%W = (zetk*rk + gammaq*params%Q)*params%ZetapEtaInv
345 params%Rho = zetk*gammaq/(zetk + gammaq)
348 SELECT CASE (potential_parameter%potential_type)
350 t = params%Rho*sum((params%Q - rk)**2)
351 s1234 = exp(-zeti*zetj*params%EtaInv*sum((rj - ri)**2))
352 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)*s1234
354 CALL fgamma(params%m_max, t, params%Fm)
355 params%Fm = prefac*params%Fm
357 r = potential_parameter%cutoff_radius*sqrt(params%Rho)
358 t = params%Rho*sum((params%Q - rk)**2)
359 s1234 = exp(-zeti*zetj*params%EtaInv*sum((rj - ri)**2))
360 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)*s1234
363 CALL t_c_g0_n(params%Fm, use_gamma, r, t, params%m_max)
364 IF (use_gamma)
CALL fgamma(params%m_max, t, params%Fm)
365 params%Fm = prefac*params%Fm
367 t = params%Rho*sum((params%Q - rk)**2)
368 s1234 = exp(-zeti*zetj*params%EtaInv*sum((rj - ri)**2))
369 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)*s1234
371 CALL fgamma(params%m_max, t, params%Fm)
373 omega2 = potential_parameter%omega**2
374 omega_corr2 = omega2/(omega2 + params%Rho)
375 omega_corr = sqrt(omega_corr2)
379 CALL fgamma(params%m_max, t, fm)
381 DO l = 1, params%m_max + 1
382 params%Fm(l) = params%Fm(l) + fm(l)*tmp
383 tmp = tmp*omega_corr2
385 params%Fm = prefac*params%Fm
387 r = potential_parameter%cutoff_radius*sqrt(params%Rho)
388 t = params%Rho*sum((params%Q - rk)**2)
389 s1234 = exp(-zeti*zetj*params%EtaInv*sum((rj - ri)**2))
390 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)*s1234
393 CALL t_c_g0_n(params%Fm, use_gamma, r, t, params%m_max)
394 IF (use_gamma)
CALL fgamma(params%m_max, t, params%Fm)
397 CALL fgamma(params%m_max, t, fm)
398 DO l = 1, params%m_max + 1
399 params%Fm(l) = params%Fm(l) &
400 *(potential_parameter%scale_coulomb + potential_parameter%scale_longrange) &
401 - fm(l)*potential_parameter%scale_longrange
405 omega2 = potential_parameter%omega**2
406 omega_corr2 = omega2/(omega2 + params%Rho)
407 omega_corr = sqrt(omega_corr2)
411 CALL fgamma(params%m_max, t, fm)
413 DO l = 1, params%m_max + 1
414 params%Fm(l) = params%Fm(l) + fm(l)*tmp*potential_parameter%scale_longrange
415 tmp = tmp*omega_corr2
417 params%Fm = prefac*params%Fm
419 s1234 = exp(-zeti*zetj*params%EtaInv*sum((rj - ri)**2) &
420 - gammaq*zetk*params%ZetapEtaInv*sum((params%Q - rk)**2))
421 prefac = sqrt((
pi*params%ZetapEtaInv)**3)*s1234
423 params%Fm(:) = prefac
425 cpabort(
"Requested operator NYI")
431 params%ZetapEtaInv, params%Rho, rk, params%Q, params%W, &
432 params%m_max, params%Fm)
434 END SUBROUTINE set_params_3c
472 la_min, la_max, npgfa, zeta, rpgfa, ra, &
473 lb_min, lb_max, npgfb, zetb, rpgfb, rb, &
474 lc_min, lc_max, npgfc, zetc, rpgfc, rc, &
475 dab, dac, dbc, lib, potential_parameter, &
476 der_abc_1_ext, der_abc_2_ext)
478 REAL(
dp),
DIMENSION(:, :, :, :),
INTENT(INOUT) :: der_abc_1, der_abc_2
479 INTEGER,
INTENT(IN) :: la_min, la_max, npgfa
480 REAL(
dp),
DIMENSION(:),
INTENT(IN) :: zeta, rpgfa
481 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: ra
482 INTEGER,
INTENT(IN) :: lb_min, lb_max, npgfb
483 REAL(
dp),
DIMENSION(:),
INTENT(IN) :: zetb, rpgfb
484 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: rb
485 INTEGER,
INTENT(IN) :: lc_min, lc_max, npgfc
486 REAL(
dp),
DIMENSION(:),
INTENT(IN) :: zetc, rpgfc
487 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: rc
488 REAL(kind=
dp),
INTENT(IN) :: dab, dac, dbc
491 REAL(
dp),
DIMENSION(3),
INTENT(OUT),
OPTIONAL :: der_abc_1_ext, der_abc_2_ext
493 INTEGER :: a_mysize(1), a_offset, a_start, b_offset, b_start, c_offset, c_start, i, i_deriv, &
494 ipgf, j, jpgf, k, kpgf, li, lj, lk, ncoa, ncob, ncoc, op, p1, p2, p3
495 INTEGER,
DIMENSION(3) :: permute_1, permute_2
497 REAL(
dp) :: dr_ab, dr_ac, dr_bc, zeti, zetj, zetk
498 REAL(
dp),
DIMENSION(3) :: der_abc_1_ext_prv, der_abc_2_ext_prv
499 REAL(
dp),
DIMENSION(:, :),
POINTER :: p_deriv
500 TYPE(params_3c),
POINTER :: params
502 NULLIFY (params, p_deriv)
505 permute_1 = [4, 5, 6]
506 permute_2 = [7, 8, 9]
512 op = potential_parameter%potential_type
524 IF (
PRESENT(der_abc_1_ext) .OR.
PRESENT(der_abc_2_ext)) do_ext = .true.
525 der_abc_1_ext_prv = 0.0_dp
526 der_abc_2_ext_prv = 0.0_dp
535 a_start = (ipgf - 1)*
ncoset(la_max)
540 IF (rpgfa(ipgf) + rpgfb(jpgf) + dr_ab < dab) cycle
543 b_start = (jpgf - 1)*
ncoset(lb_max)
548 IF (rpgfb(jpgf) + rpgfc(kpgf) + dr_bc < dbc) cycle
549 IF (rpgfa(ipgf) + rpgfc(kpgf) + dr_ac < dac) cycle
552 c_start = (kpgf - 1)*
ncoset(lc_max)
555 CALL set_params_3c_deriv(lib, ra, rb, rc, zeti, zetj, zetk, la_max, lb_max, lc_max, &
556 potential_parameter=potential_parameter, params_out=params)
558 DO li = la_min, la_max
559 a_offset = a_start +
ncoset(li - 1)
561 DO lj = max(li, lb_min), lb_max
562 b_offset = b_start +
ncoset(lj - 1)
564 DO lk = lc_min, lc_max
565 c_offset = c_start +
ncoset(lk - 1)
568 a_mysize(1) = ncoa*ncob*ncoc
577 p2 = (p1 + j - 1)*ncoa
581 der_abc_1(a_offset + i, b_offset + j, c_offset + k, i_deriv) = &
582 p_deriv(p3, permute_2(i_deriv))
583 der_abc_1_ext_prv(i_deriv) = max(der_abc_1_ext_prv(i_deriv), &
584 abs(p_deriv(p3, permute_2(i_deriv))))
586 der_abc_2(a_offset + i, b_offset + j, c_offset + k, i_deriv) = &
587 p_deriv(p3, permute_1(i_deriv))
588 der_abc_2_ext_prv(i_deriv) = max(der_abc_2_ext_prv(i_deriv), &
589 abs(p_deriv(p3, permute_1(i_deriv))))
600 p2 = (p1 + j - 1)*ncoa
604 der_abc_1(a_offset + i, b_offset + j, c_offset + k, i_deriv) = &
605 p_deriv(p3, permute_2(i_deriv))
607 der_abc_2(a_offset + i, b_offset + j, c_offset + k, i_deriv) = &
608 p_deriv(p3, permute_1(i_deriv))
621 CALL set_params_3c_deriv(lib, rb, ra, rc, zetj, zeti, zetk, params_in=params)
623 DO lj = lb_min, lb_max
624 b_offset = b_start +
ncoset(lj - 1)
626 DO li = max(lj + 1, la_min), la_max
627 a_offset = a_start +
ncoset(li - 1)
629 DO lk = lc_min, lc_max
630 c_offset = c_start +
ncoset(lk - 1)
633 a_mysize(1) = ncoa*ncob*ncoc
641 p2 = (p1 + i - 1)*ncob
645 der_abc_1(a_offset + i, b_offset + j, c_offset + k, i_deriv) = &
646 p_deriv(p3, permute_1(i_deriv))
648 der_abc_1_ext_prv(i_deriv) = max(der_abc_1_ext_prv(i_deriv), &
649 abs(p_deriv(p3, permute_1(i_deriv))))
651 der_abc_2(a_offset + i, b_offset + j, c_offset + k, i_deriv) = &
652 p_deriv(p3, permute_2(i_deriv))
654 der_abc_2_ext_prv(i_deriv) = max(der_abc_2_ext_prv(i_deriv), &
655 abs(p_deriv(p3, permute_2(i_deriv))))
665 p2 = (p1 + i - 1)*ncob
669 der_abc_1(a_offset + i, b_offset + j, c_offset + k, i_deriv) = &
670 p_deriv(p3, permute_1(i_deriv))
672 der_abc_2(a_offset + i, b_offset + j, c_offset + k, i_deriv) = &
673 p_deriv(p3, permute_2(i_deriv))
689 IF (
PRESENT(der_abc_1_ext)) der_abc_1_ext = der_abc_1_ext_prv
690 IF (
PRESENT(der_abc_2_ext)) der_abc_2_ext = der_abc_2_ext_prv
715 SUBROUTINE set_params_3c_deriv(lib, ri, rj, rk, zeti, zetj, zetk, li_max, lj_max, lk_max, &
716 potential_parameter, params_in, params_out)
719 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: ri, rj, rk
720 REAL(
dp),
INTENT(IN) :: zeti, zetj, zetk
721 INTEGER,
INTENT(IN),
OPTIONAL :: li_max, lj_max, lk_max
723 TYPE(params_3c),
OPTIONAL,
POINTER :: params_in, params_out
727 REAL(
dp) :: gammaq, omega2, omega_corr, omega_corr2, &
728 prefac, r, s1234, t, tmp
729 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: fm
730 TYPE(params_3c),
POINTER :: params
732 IF (
PRESENT(params_in))
THEN
738 params%m_max = li_max + lj_max + lk_max + 1
740 params%ZetaInv = 1._dp/zetk; params%EtaInv = 1._dp/gammaq
741 params%ZetapEtaInv = 1._dp/(zetk + gammaq)
743 params%Q = (zeti*ri + zetj*rj)*params%EtaInv
744 params%W = (zetk*rk + gammaq*params%Q)*params%ZetapEtaInv
745 params%Rho = zetk*gammaq/(zetk + gammaq)
748 SELECT CASE (potential_parameter%potential_type)
750 t = params%Rho*sum((params%Q - rk)**2)
751 s1234 = exp(-zeti*zetj*params%EtaInv*sum((rj - ri)**2))
752 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)*s1234
754 CALL fgamma(params%m_max, t, params%Fm)
755 params%Fm = prefac*params%Fm
757 r = potential_parameter%cutoff_radius*sqrt(params%Rho)
758 t = params%Rho*sum((params%Q - rk)**2)
759 s1234 = exp(-zeti*zetj*params%EtaInv*sum((rj - ri)**2))
760 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)*s1234
763 CALL t_c_g0_n(params%Fm, use_gamma, r, t, params%m_max)
764 IF (use_gamma)
CALL fgamma(params%m_max, t, params%Fm)
765 params%Fm = prefac*params%Fm
767 t = params%Rho*sum((params%Q - rk)**2)
768 s1234 = exp(-zeti*zetj*params%EtaInv*sum((rj - ri)**2))
769 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)*s1234
771 CALL fgamma(params%m_max, t, params%Fm)
773 omega2 = potential_parameter%omega**2
774 omega_corr2 = omega2/(omega2 + params%Rho)
775 omega_corr = sqrt(omega_corr2)
779 CALL fgamma(params%m_max, t, fm)
781 DO l = 1, params%m_max + 1
782 params%Fm(l) = params%Fm(l) + fm(l)*tmp
783 tmp = tmp*omega_corr2
785 params%Fm = prefac*params%Fm
787 r = potential_parameter%cutoff_radius*sqrt(params%Rho)
788 t = params%Rho*sum((params%Q - rk)**2)
789 s1234 = exp(-zeti*zetj*params%EtaInv*sum((rj - ri)**2))
790 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)*s1234
793 CALL t_c_g0_n(params%Fm, use_gamma, r, t, params%m_max)
794 IF (use_gamma)
CALL fgamma(params%m_max, t, params%Fm)
797 CALL fgamma(params%m_max, t, fm)
798 DO l = 1, params%m_max + 1
799 params%Fm(l) = params%Fm(l) &
800 *(potential_parameter%scale_coulomb + potential_parameter%scale_longrange) &
801 - fm(l)*potential_parameter%scale_longrange
805 omega2 = potential_parameter%omega**2
806 omega_corr2 = omega2/(omega2 + params%Rho)
807 omega_corr = sqrt(omega_corr2)
811 CALL fgamma(params%m_max, t, fm)
813 DO l = 1, params%m_max + 1
814 params%Fm(l) = params%Fm(l) + fm(l)*tmp*potential_parameter%scale_longrange
815 tmp = tmp*omega_corr2
817 params%Fm = prefac*params%Fm
819 s1234 = exp(-zeti*zetj*params%EtaInv*sum((rj - ri)**2) &
820 - gammaq*zetk*params%ZetapEtaInv*sum((params%Q - rk)**2))
821 prefac = sqrt((
pi*params%ZetapEtaInv)**3)*s1234
823 params%Fm(:) = prefac
825 cpabort(
"Requested operator NYI")
831 params%Q, params%W, zetk, 0.0_dp, zetj, zeti, params%ZetaInv, &
832 params%EtaInv, params%ZetapEtaInv, params%Rho, params%m_max, params%Fm)
834 END SUBROUTINE set_params_3c_deriv
859 SUBROUTINE eri_2center(int_ab, la_min, la_max, npgfa, zeta, rpgfa, ra, &
860 lb_min, lb_max, npgfb, zetb, rpgfb, rb, &
861 dab, lib, potential_parameter)
863 REAL(
dp),
DIMENSION(:, :),
INTENT(INOUT) :: int_ab
864 INTEGER,
INTENT(IN) :: la_min, la_max, npgfa
865 REAL(
dp),
DIMENSION(:),
INTENT(IN) :: zeta, rpgfa
866 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: ra
867 INTEGER,
INTENT(IN) :: lb_min, lb_max, npgfb
868 REAL(
dp),
DIMENSION(:),
INTENT(IN) :: zetb, rpgfb
869 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: rb
870 REAL(
dp),
INTENT(IN) :: dab
874 INTEGER :: a_mysize(1), a_offset, a_start, &
875 b_offset, b_start, i, ipgf, j, jpgf, &
876 li, lj, ncoa, ncob, p1, p2
877 REAL(
dp) :: dr_ab, zeti, zetj
878 REAL(
dp),
DIMENSION(:),
POINTER :: p_work
895 a_start = (ipgf - 1)*
ncoset(la_max)
899 b_start = (jpgf - 1)*
ncoset(lb_max)
902 IF (rpgfa(ipgf) + rpgfb(jpgf) + dr_ab < dab) cycle
904 CALL set_params_2c(lib, ra, rb, zeti, zetj, la_max, lb_max, potential_parameter)
906 DO li = la_min, la_max
907 a_offset = a_start +
ncoset(li - 1)
909 DO lj = lb_min, lb_max
910 b_offset = b_start +
ncoset(lj - 1)
913 a_mysize(1) = ncoa*ncob
920 int_ab(a_offset + i, b_offset + j) = p_work(p2)
943 SUBROUTINE set_params_2c(lib, rj, rk, zetj, zetk, lj_max, lk_max, potential_parameter)
946 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: rj, rk
947 REAL(
dp),
INTENT(IN) :: zetj, zetk
948 INTEGER,
INTENT(IN) :: lj_max, lk_max
953 REAL(
dp) :: omega2, omega_corr, omega_corr2, prefac, &
955 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: fm
956 TYPE(params_2c) :: params
967 op = potential_parameter%potential_type
968 params%m_max = lj_max + lk_max
969 params%ZetaInv = 1._dp/zetk; params%EtaInv = 1._dp/zetj
970 params%ZetapEtaInv = 1._dp/(zetk + zetj)
972 params%W = (zetk*rk + zetj*rj)*params%ZetapEtaInv
973 params%Rho = zetk*zetj/(zetk + zetj)
978 t = params%Rho*sum((rj - rk)**2)
979 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)
980 CALL fgamma(params%m_max, t, params%Fm)
981 params%Fm = prefac*params%Fm
983 r = potential_parameter%cutoff_radius*sqrt(params%Rho)
984 t = params%Rho*sum((rj - rk)**2)
985 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)
988 CALL t_c_g0_n(params%Fm, use_gamma, r, t, params%m_max)
989 IF (use_gamma)
CALL fgamma(params%m_max, t, params%Fm)
990 params%Fm = prefac*params%Fm
992 t = params%Rho*sum((rj - rk)**2)
993 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)
995 CALL fgamma(params%m_max, t, params%Fm)
997 omega2 = potential_parameter%omega**2
998 omega_corr2 = omega2/(omega2 + params%Rho)
999 omega_corr = sqrt(omega_corr2)
1003 CALL fgamma(params%m_max, t, fm)
1005 DO l = 1, params%m_max + 1
1006 params%Fm(l) = params%Fm(l) + fm(l)*tmp
1007 tmp = tmp*omega_corr2
1009 params%Fm = prefac*params%Fm
1011 r = potential_parameter%cutoff_radius*sqrt(params%Rho)
1012 t = params%Rho*sum((rj - rk)**2)
1013 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)
1016 CALL t_c_g0_n(params%Fm, use_gamma, r, t, params%m_max)
1017 IF (use_gamma)
CALL fgamma(params%m_max, t, params%Fm)
1020 CALL fgamma(params%m_max, t, fm)
1021 DO l = 1, params%m_max + 1
1022 params%Fm(l) = params%Fm(l) &
1023 *(potential_parameter%scale_coulomb + potential_parameter%scale_longrange) &
1024 - fm(l)*potential_parameter%scale_longrange
1028 omega2 = potential_parameter%omega**2
1029 omega_corr2 = omega2/(omega2 + params%Rho)
1030 omega_corr = sqrt(omega_corr2)
1034 CALL fgamma(params%m_max, t, fm)
1036 DO l = 1, params%m_max + 1
1037 params%Fm(l) = params%Fm(l) + fm(l)*tmp*potential_parameter%scale_longrange
1038 tmp = tmp*omega_corr2
1040 params%Fm = prefac*params%Fm
1043 prefac = sqrt((
pi*params%ZetapEtaInv)**3)*exp(-zetj*zetk*params%ZetapEtaInv*sum((rk - rj)**2))
1044 params%Fm(:) = prefac
1046 cpabort(
"Requested operator NYI")
1050 params%ZetapEtaInv, params%Rho, rk, rj, params%W, &
1051 params%m_max, params%Fm)
1053 END SUBROUTINE set_params_2c
1065 IF (potential1%potential_type /= potential2%potential_type)
THEN
1069 SELECT CASE (potential1%potential_type)
1071 IF (potential1%omega /= potential2%omega) equals = .false.
1073 IF (potential1%cutoff_radius /= potential2%cutoff_radius) equals = .false.
1075 IF (potential1%cutoff_radius /= potential2%cutoff_radius) equals = .false.
1076 IF (potential1%omega /= potential2%omega) equals = .false.
1077 IF (potential1%scale_coulomb /= potential2%scale_coulomb) equals = .false.
1078 IF (potential1%scale_longrange /= potential2%scale_longrange) equals = .false.
1107 lb_min, lb_max, npgfb, zetb, rpgfb, rb, &
1108 dab, lib, potential_parameter)
1110 REAL(
dp),
DIMENSION(:, :, :),
INTENT(INOUT) :: der_ab
1111 INTEGER,
INTENT(IN) :: la_min, la_max, npgfa
1112 REAL(
dp),
DIMENSION(:),
INTENT(IN) :: zeta, rpgfa
1113 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: ra
1114 INTEGER,
INTENT(IN) :: lb_min, lb_max, npgfb
1115 REAL(
dp),
DIMENSION(:),
INTENT(IN) :: zetb, rpgfb
1116 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: rb
1117 REAL(
dp),
INTENT(IN) :: dab
1121 INTEGER :: a_mysize(1), a_offset, a_start, &
1122 b_offset, b_start, i, i_deriv, ipgf, &
1123 j, jpgf, li, lj, ncoa, ncob, p1, p2
1124 INTEGER,
DIMENSION(3) :: permute
1125 REAL(
dp) :: dr_ab, zeti, zetj
1126 REAL(
dp),
DIMENSION(:, :),
POINTER :: p_deriv
1139 dr_ab = 1000000.0_dp
1145 a_start = (ipgf - 1)*
ncoset(la_max)
1149 b_start = (jpgf - 1)*
ncoset(lb_max)
1152 IF (rpgfa(ipgf) + rpgfb(jpgf) + dr_ab < dab) cycle
1154 CALL set_params_2c_deriv(lib, ra, rb, zeti, zetj, la_max, lb_max, potential_parameter)
1156 DO li = la_min, la_max
1157 a_offset = a_start +
ncoset(li - 1)
1159 DO lj = lb_min, lb_max
1160 b_offset = b_start +
ncoset(lj - 1)
1163 a_mysize(1) = ncoa*ncob
1171 der_ab(a_offset + i, b_offset + j, i_deriv) = p_deriv(p2, permute(i_deriv))
1176 DEALLOCATE (p_deriv)
1196 SUBROUTINE set_params_2c_deriv(lib, rj, rk, zetj, zetk, lj_max, lk_max, potential_parameter)
1199 REAL(
dp),
DIMENSION(3),
INTENT(IN) :: rj, rk
1200 REAL(
dp),
INTENT(IN) :: zetj, zetk
1201 INTEGER,
INTENT(IN) :: lj_max, lk_max
1205 LOGICAL :: use_gamma
1206 REAL(
dp) :: omega2, omega_corr, omega_corr2, prefac, &
1208 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: fm
1209 TYPE(params_2c) :: params
1220 op = potential_parameter%potential_type
1221 params%m_max = lj_max + lk_max + 1
1222 params%ZetaInv = 1._dp/zetk; params%EtaInv = 1._dp/zetj
1223 params%ZetapEtaInv = 1._dp/(zetk + zetj)
1225 params%W = (zetk*rk + zetj*rj)*params%ZetapEtaInv
1226 params%Rho = zetk*zetj/(zetk + zetj)
1231 t = params%Rho*sum((rj - rk)**2)
1232 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)
1233 CALL fgamma(params%m_max, t, params%Fm)
1234 params%Fm = prefac*params%Fm
1236 r = potential_parameter%cutoff_radius*sqrt(params%Rho)
1237 t = params%Rho*sum((rj - rk)**2)
1238 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)
1241 CALL t_c_g0_n(params%Fm, use_gamma, r, t, params%m_max)
1242 IF (use_gamma)
CALL fgamma(params%m_max, t, params%Fm)
1243 params%Fm = prefac*params%Fm
1245 t = params%Rho*sum((rj - rk)**2)
1246 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)
1248 CALL fgamma(params%m_max, t, params%Fm)
1250 omega2 = potential_parameter%omega**2
1251 omega_corr2 = omega2/(omega2 + params%Rho)
1252 omega_corr = sqrt(omega_corr2)
1256 CALL fgamma(params%m_max, t, fm)
1258 DO l = 1, params%m_max + 1
1259 params%Fm(l) = params%Fm(l) + fm(l)*tmp
1260 tmp = tmp*omega_corr2
1262 params%Fm = prefac*params%Fm
1264 r = potential_parameter%cutoff_radius*sqrt(params%Rho)
1265 t = params%Rho*sum((rj - rk)**2)
1266 prefac = 2._dp*
pi/params%Rho*sqrt((
pi*params%ZetapEtaInv)**3)
1269 CALL t_c_g0_n(params%Fm, use_gamma, r, t, params%m_max)
1270 IF (use_gamma)
CALL fgamma(params%m_max, t, params%Fm)
1273 CALL fgamma(params%m_max, t, fm)
1274 DO l = 1, params%m_max + 1
1275 params%Fm(l) = params%Fm(l) &
1276 *(potential_parameter%scale_coulomb + potential_parameter%scale_longrange) &
1277 - fm(l)*potential_parameter%scale_longrange
1281 omega2 = potential_parameter%omega**2
1282 omega_corr2 = omega2/(omega2 + params%Rho)
1283 omega_corr = sqrt(omega_corr2)
1287 CALL fgamma(params%m_max, t, fm)
1289 DO l = 1, params%m_max + 1
1290 params%Fm(l) = params%Fm(l) + fm(l)*tmp*potential_parameter%scale_longrange
1291 tmp = tmp*omega_corr2
1293 params%Fm = prefac*params%Fm
1296 prefac = sqrt((
pi*params%ZetapEtaInv)**3)*exp(-zetj*zetk*params%ZetapEtaInv*sum((rk - rj)**2))
1297 params%Fm(:) = prefac
1299 cpabort(
"Requested operator NYI")
1302 CALL cp_libint_set_params_eri_deriv(lib, rk, rk, rj, rj, rk, rj, params%W, zetk, 0.0_dp, &
1303 zetj, 0.0_dp, params%ZetaInv, params%EtaInv, &
1304 params%ZetapEtaInv, params%Rho, &
1305 params%m_max, params%Fm)
1307 END SUBROUTINE set_params_2c_deriv
Calculation of the incomplete Gamma function F_n(t) for multi-center integrals over Cartesian Gaussia...
subroutine, public fgamma_0(nmax, t, f)
Calculation of the incomplete Gamma function F(t) for multicenter integrals over Gaussian functions....
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_path_length
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...
pure logical function, public compare_potential_types(potential1, potential2)
Helper function to compare libint_potential_types.
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
subroutine, public eri_2center_derivs(der_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 derivatives of the electron repulsion integrals (a|b) for a given set of cartes...
subroutine, public eri_3center_derivs(der_abc_1, der_abc_2, 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, der_abc_1_ext, der_abc_2_ext)
Computes the derivatives of the 3-center electron repulsion integrals (ab|c) for a given set of carte...
Interface to the Libint-Library or a c++ wrapper.
subroutine, public cp_libint_set_params_eri_deriv(libint, a, b, c, d, p, q, w, zeta_a, zeta_b, zeta_c, zeta_d, zetainv, etainv, zetapetainv, rho, m_max, f)
subroutine, public cp_libint_get_2eri_derivs(n_b, n_a, lib, p_work, a_mysize)
...
subroutine, public cp_libint_set_params_eri(libint, a, b, c, d, zetainv, etainv, zetapetainv, rho, p, q, w, m_max, f)
subroutine, public cp_libint_get_3eris(n_c, n_b, n_a, lib, p_work, a_mysize)
...
subroutine, public cp_libint_get_2eris(n_b, n_a, lib, p_work, a_mysize)
...
integer, parameter, public prim_data_f_size
subroutine, public cp_libint_get_3eri_derivs(n_c, n_b, n_a, lib, p_work, a_mysize)
...
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:), allocatable, public nco
integer, dimension(:), allocatable, public ncoset
This module computes the basic integrals for the truncated coulomb operator.
subroutine, public t_c_g0_n(res, use_gamma, r, t, nderiv)
...
integer function, public get_lmax_init()
Returns the value of nderiv_init so that one can check if opening the potential file is worhtwhile.