36#include "../base/base_uses.f90"
42 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'ai_overlap_ppl'
98 SUBROUTINE ppl_integral(la_max_set, la_min_set, npgfa, rpgfa, zeta, &
99 lb_max_set, lb_min_set, npgfb, rpgfb, zetb, nexp_ppl, alpha_ppl, nct_ppl, cexp_ppl, rpgfc, &
100 rab, dab, rac, dac, rbc, dbc, vab, s, pab, force_a, force_b, fs, &
101 hab2, hab2_work, deltaR, iatom, jatom, katom)
102 INTEGER,
INTENT(IN) :: la_max_set, la_min_set, npgfa
103 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: rpgfa, zeta
104 INTEGER,
INTENT(IN) :: lb_max_set, lb_min_set, npgfb
105 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: rpgfb, zetb
106 INTEGER,
INTENT(IN) :: nexp_ppl
107 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: alpha_ppl
108 INTEGER,
DIMENSION(:),
INTENT(IN) :: nct_ppl
109 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: cexp_ppl
110 REAL(kind=
dp),
INTENT(IN) :: rpgfc
111 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: rab
112 REAL(kind=
dp),
INTENT(IN) :: dab
113 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: rac
114 REAL(kind=
dp),
INTENT(IN) :: dac
115 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: rbc
116 REAL(kind=
dp),
INTENT(IN) :: dbc
117 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(INOUT) :: vab
118 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(INOUT) :: s
119 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN), &
121 REAL(kind=
dp),
DIMENSION(3),
INTENT(OUT),
OPTIONAL :: force_a, force_b
122 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(INOUT), &
123 OPTIONAL :: fs, hab2, hab2_work
124 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN), &
126 INTEGER,
INTENT(IN),
OPTIONAL :: iatom, jatom, katom
128 INTEGER :: iexp, ij, ipgf, jpgf, mmax, nexp
129 REAL(kind=
dp) :: rho, sab, t, zetc
130 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: auxint
131 REAL(kind=
dp),
DIMENSION(3) :: pci
133 IF (
PRESENT(pab))
THEN
134 cpassert(
PRESENT(force_a))
135 cpassert(
PRESENT(force_b))
136 cpassert(
PRESENT(fs))
137 mmax = la_max_set + lb_max_set + 2
140 ELSE IF (
PRESENT(hab2))
THEN
141 mmax = la_max_set + lb_max_set + 2
143 mmax = la_max_set + lb_max_set
146 ALLOCATE (auxint(0:mmax, npgfa*npgfb))
153 IF (rpgfa(ipgf) + rpgfc < dac) cycle
156 IF ((rpgfb(jpgf) + rpgfc < dbc) .OR. &
157 (rpgfa(ipgf) + rpgfb(jpgf) < dab)) cycle
158 ij = (ipgf - 1)*npgfb + jpgf
159 rho = zeta(ipgf) + zetb(jpgf)
160 pci(:) = -(zeta(ipgf)*rac(:) + zetb(jpgf)*rbc(:))/rho
161 sab = exp(-(zeta(ipgf)*zetb(jpgf)/rho*dab*dab))
162 t = rho*sum(pci(:)*pci(:))
164 DO iexp = 1, nexp_ppl
166 zetc = alpha_ppl(iexp)
167 CALL ppl_aux(auxint(0:mmax, ij), mmax, t, rho, nexp, cexp_ppl(:, iexp), zetc)
170 auxint(0:mmax, ij) = sab*auxint(0:mmax, ij)
175 CALL os_3center(la_max_set, la_min_set, npgfa, rpgfa, zeta, &
176 lb_max_set, lb_min_set, npgfb, rpgfb, zetb, auxint, rpgfc, &
177 rab, dab, rac, dac, rbc, dbc, vab, s, pab, force_a, force_b, fs, &
178 vab2=hab2, vab2_work=hab2_work, &
179 deltar=deltar, iatom=iatom, jatom=jatom, katom=katom)
231 lb_max_set, lb_min_set, npgfb, rpgfb, zetb, &
232 nexp_ppl, alpha_ppl, nct_ppl, cexp_ppl, rpgfc, &
233 rab, dab, rac, dac, rbc, dbc, vab, s, pab, &
234 force_a, force_b, fs, hab2, hab2_work, &
235 deltaR, iatom, jatom, katom)
236 INTEGER,
INTENT(IN) :: la_max_set, la_min_set, npgfa
237 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: rpgfa, zeta
238 INTEGER,
INTENT(IN) :: lb_max_set, lb_min_set, npgfb
239 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: rpgfb, zetb
240 INTEGER,
INTENT(IN) :: nexp_ppl
241 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: alpha_ppl
242 INTEGER,
DIMENSION(:),
INTENT(IN) :: nct_ppl
243 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: cexp_ppl
244 REAL(kind=
dp),
INTENT(IN) :: rpgfc
245 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: rab
246 REAL(kind=
dp),
INTENT(IN) :: dab
247 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: rac
248 REAL(kind=
dp),
INTENT(IN) :: dac
249 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: rbc
250 REAL(kind=
dp),
INTENT(IN) :: dbc
251 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(INOUT) :: vab
252 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(INOUT) :: s
253 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN), &
255 REAL(kind=
dp),
DIMENSION(3),
INTENT(OUT),
OPTIONAL :: force_a, force_b
256 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(INOUT), &
257 OPTIONAL :: fs, hab2, hab2_work
258 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN), &
260 INTEGER,
INTENT(IN),
OPTIONAL :: iatom, jatom, katom
262 INTEGER :: iexp, ij, ipgf, jpgf, mmax, nexp
263 REAL(kind=
dp) :: rho, sab, t, zetc
264 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: auxint
265 REAL(kind=
dp),
DIMENSION(3) :: pci
267 IF (
PRESENT(pab))
THEN
268 cpassert(
PRESENT(force_a))
269 cpassert(
PRESENT(force_b))
270 cpassert(
PRESENT(fs))
271 mmax = la_max_set + lb_max_set + 2
274 ELSE IF (
PRESENT(hab2))
THEN
275 mmax = la_max_set + lb_max_set + 2
277 mmax = la_max_set + lb_max_set
280 ALLOCATE (auxint(0:mmax, npgfa*npgfb))
287 IF (rpgfa(ipgf) + rpgfc < dac) cycle
290 IF ((rpgfb(jpgf) + rpgfc < dbc) .OR. &
291 (rpgfa(ipgf) + rpgfb(jpgf) < dab)) cycle
292 ij = (ipgf - 1)*npgfb + jpgf
293 rho = zeta(ipgf) + zetb(jpgf)
294 pci(:) = -(zeta(ipgf)*rac(:) + zetb(jpgf)*rbc(:))/rho
295 sab = exp(-(zeta(ipgf)*zetb(jpgf)/rho*dab*dab))
296 t = rho*sum(pci(:)*pci(:))
298 DO iexp = 1, nexp_ppl
300 zetc = alpha_ppl(iexp)
301 CALL ecploc_aux(auxint(0:mmax, ij), mmax, t, rho, nexp, cexp_ppl(1, iexp), zetc)
304 auxint(0:mmax, ij) = sab*auxint(0:mmax, ij)
309 CALL os_3center(la_max_set, la_min_set, npgfa, rpgfa, zeta, &
310 lb_max_set, lb_min_set, npgfb, rpgfb, zetb, auxint, rpgfc, &
311 rab, dab, rac, dac, rbc, dbc, vab, s, pab, force_a, force_b, fs, &
312 vab2=hab2, vab2_work=hab2_work, &
313 deltar=deltar, iatom=iatom, jatom=jatom, katom=katom)
347 nexp_ppl, alpha_ppl, nct_ppl, cexp_ppl, rpgfc, &
349 INTEGER,
INTENT(IN) :: la_max_set, la_min_set, npgfa
350 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: rpgfa, zeta
351 INTEGER,
INTENT(IN) :: nexp_ppl
352 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: alpha_ppl
353 INTEGER,
DIMENSION(:),
INTENT(IN) :: nct_ppl
354 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: cexp_ppl
355 REAL(kind=
dp),
INTENT(IN) :: rpgfc
356 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: rac
357 REAL(kind=
dp),
INTENT(IN) :: dac
358 REAL(kind=
dp),
DIMENSION(:),
INTENT(INOUT) :: va
359 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(INOUT), &
362 INTEGER :: iexp, ipgf, mmax, nexp
363 REAL(kind=
dp) :: rho, t, zetc
364 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: auxint
366 IF (
PRESENT(dva))
THEN
367 mmax = la_max_set + 1
372 ALLOCATE (auxint(0:mmax, npgfa))
377 IF (rpgfa(ipgf) + rpgfc < dac) cycle
381 DO iexp = 1, nexp_ppl
383 zetc = alpha_ppl(iexp)
384 CALL ppl_aux(auxint(0:mmax, ipgf), mmax, t, rho, nexp, cexp_ppl(:, iexp), zetc)
389 IF (
PRESENT(dva))
THEN
390 CALL os_2center(la_max_set, la_min_set, npgfa, rpgfa, zeta, &
391 auxint, rpgfc, rac, dac, va, dva)
393 CALL os_2center(la_max_set, la_min_set, npgfa, rpgfa, zeta, &
394 auxint, rpgfc, rac, dac, va)
411 SUBROUTINE ppl_aux(auxint, mmax, t, rho, nexp_ppl, cexp_ppl, zetc)
412 INTEGER,
INTENT(IN) :: mmax
413 REAL(kind=
dp),
DIMENSION(0:mmax) :: auxint
414 REAL(kind=
dp),
INTENT(IN) :: t, rho
415 INTEGER,
INTENT(IN) :: nexp_ppl
416 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: cexp_ppl
417 REAL(kind=
dp),
INTENT(IN) :: zetc
419 INTEGER :: i, j, ke, kp, pmax
420 REAL(kind=
dp) :: a2, a3, a4, cc, f, q, q2, q4, q6, rho2, &
422 REAL(kind=
dp),
DIMENSION(0:6) :: polder
423 REAL(kind=
dp),
DIMENSION(0:mmax) :: expder
425 cpassert(nexp_ppl > 0)
429 IF (nexp_ppl > 0)
THEN
430 polder(0) = polder(0) + cexp_ppl(1)
433 IF (nexp_ppl > 1)
THEN
435 a2 = 0.5_dp/q2*cexp_ppl(2)
436 polder(0) = polder(0) + a2*(2._dp*rho*t + 3._dp*q)
437 polder(1) = polder(1) - a2*2._dp*rho
440 IF (nexp_ppl > 2)
THEN
444 a3 = 0.25_dp/q4*cexp_ppl(3)
445 polder(0) = polder(0) + a3*(4._dp*rho2*t2 + 20._dp*rho*t*q + 15._dp*q2)
446 polder(1) = polder(1) - a3*(8._dp*rho2*t + 20._dp*rho*q)
447 polder(2) = polder(2) + a3*8._dp*rho2
450 IF (nexp_ppl > 3)
THEN
454 a4 = 0.125_dp/q6*cexp_ppl(4)
455 polder(0) = polder(0) + a4*(8._dp*rho3*t3 + 84._dp*rho2*t2*q + 210._dp*rho*t*q2 + 105._dp*q*q2)
456 polder(1) = polder(1) - a4*(24._dp*rho3*t2 + 168._dp*rho2*t*q + 210._dp*rho*q2)
457 polder(2) = polder(2) + a4*(48._dp*rho3*t + 168._dp*rho2*q)
458 polder(3) = polder(3) - a4*48_dp*rho3
461 IF (nexp_ppl > 4)
THEN
462 cpabort(
"nexp_ppl > 4")
466 cc = (
pi/q)**1.5_dp*exp(-t*f)
468 IF (mmax >= 0) expder(0) = cc
470 expder(i) = f*expder(i - 1)
474 DO j = 0, min(i, pmax)
477 auxint(i) = auxint(i) + expder(ke)*polder(kp)*
binomial(i, j)
481 END SUBROUTINE ppl_aux
492 SUBROUTINE ecploc_aux(auxint, mmax, t, rho, nexp, cexp, zetc)
493 INTEGER,
INTENT(IN) :: mmax
494 REAL(kind=
dp),
DIMENSION(0:mmax) :: auxint
495 REAL(kind=
dp),
INTENT(IN) :: t, rho
496 INTEGER,
INTENT(IN) :: nexp
497 REAL(kind=
dp),
INTENT(IN) :: cexp, zetc
499 INTEGER :: i, j, ke, kf
500 REAL(kind=
dp) :: c0, c1, cc, cval, fa, fr, q, ts
501 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: expder, fdiff, funder, gfund
507 ALLOCATE (expder(0:mmax), funder(0:mmax + 1))
511 cval = 2.0_dp*cexp/sqrt(q)*
pi**1.5_dp*exp(-t*fa)
514 expder(i) = fa*expder(i - 1)
517 ALLOCATE (gfund(0:mmax))
524 funder(i) = funder(i) + (-1)**j*
binomial(i, j)*gfund(j)
530 funder(i) = fr**i*funder(i)
536 auxint(i) = auxint(i) + expder(ke)*funder(kf)*
binomial(i, j)
540 cval = cexp*2._dp*
pi/q*exp(-t*fa)
543 expder(i) = fa*expder(i - 1)
546 CALL fgamma(mmax, ts, funder)
548 funder(i) = fr**i*funder(i)
554 auxint(i) = auxint(i) + expder(ke)*funder(kf)*
binomial(i, j)
558 cval = cexp*(
pi/q)**1.5_dp*exp(-t*fa)
561 expder(i) = fa*expder(i - 1)
563 auxint(0:mmax) = auxint(0:mmax) + expder(0:mmax)
565 cval =
twopi*cexp/q**2*exp(-t*fa)
568 expder(i) = fa*expder(i - 1)
571 CALL fgamma(mmax + 1, ts, funder)
572 ALLOCATE (fdiff(0:mmax))
573 fdiff(0) = (1.0_dp + ts)*funder(0) - ts*funder(1)
575 fdiff(i) = fr**i*(-i*funder(i - 1) + (1.0_dp + ts)*funder(i) &
576 + i*funder(i) - ts*funder(i + 1))
582 auxint(i) = auxint(i) + expder(ke)*fdiff(kf)*
binomial(i, j)
587 cval = cexp/(4._dp*q**2)*(
pi/q)**1.5_dp*exp(-t*fa)
590 expder(i) = fa*expder(i - 1)
593 c1 = 6._dp*q + 4._dp*rho*t
596 expder(i) = cc*expder(i)
598 auxint(0:mmax) = auxint(0:mmax) + expder(0:mmax)
600 cpabort(
"nexp out of range [1..4]")
603 DEALLOCATE (expder, funder)
605 END SUBROUTINE ecploc_aux
Calculation of general three-center integrals over Cartesian Gaussian-type functions and a spherical ...
subroutine, public os_3center(la_max_set, la_min_set, npgfa, rpgfa, zeta, lb_max_set, lb_min_set, npgfb, rpgfb, zetb, auxint, rpgfc, rab, dab, rac, dac, rbc, dbc, vab, s, pab, force_a, force_b, fs, vab2, vab2_work, deltar, iatom, jatom, katom)
Calculation of three-center integrals <a|c|b> over Cartesian Gaussian functions and a spherical poten...
subroutine, public os_2center(la_max_set, la_min_set, npgfa, rpgfa, zeta, auxint, rpgfc, rac, dac, va, dva)
Calculation of two-center integrals <a|c> over Cartesian Gaussian functions and a spherical potential...
Calculation of three-center overlap integrals over Cartesian Gaussian-type functions for the second t...
subroutine, public ppl_integral(la_max_set, la_min_set, npgfa, rpgfa, zeta, lb_max_set, lb_min_set, npgfb, rpgfb, zetb, nexp_ppl, alpha_ppl, nct_ppl, cexp_ppl, rpgfc, rab, dab, rac, dac, rbc, dbc, vab, s, pab, force_a, force_b, fs, hab2, hab2_work, deltar, iatom, jatom, katom)
Calculation of three-center overlap integrals <a|c|b> over Cartesian Gaussian functions for the local...
subroutine, public ecploc_integral(la_max_set, la_min_set, npgfa, rpgfa, zeta, lb_max_set, lb_min_set, npgfb, rpgfb, zetb, nexp_ppl, alpha_ppl, nct_ppl, cexp_ppl, rpgfc, rab, dab, rac, dac, rbc, dbc, vab, s, pab, force_a, force_b, fs, hab2, hab2_work, deltar, iatom, jatom, katom)
Calculation of three-center potential integrals <a|V(r)|b> over Cartesian Gaussian functions for the ...
subroutine, public ppl_integral_ri(la_max_set, la_min_set, npgfa, rpgfa, zeta, nexp_ppl, alpha_ppl, nct_ppl, cexp_ppl, rpgfc, rac, dac, va, dva)
Calculation of two-center overlap integrals <a|c> over Cartesian Gaussian functions for the local par...
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....
Calculation of the G function G_n(t) for 1/R^2 operators.
subroutine, public gfun_values(nmax, t, g)
...
Defines the basic variable types.
integer, parameter, public dp
Definition of mathematical constants and functions.
real(kind=dp), parameter, public pi
real(kind=dp), parameter, public twopi
Collection of simple mathematical functions and subroutines.
elemental real(kind=dp) function, public binomial(n, k)
The binomial coefficient n over k for 0 <= k <= n is calculated, otherwise zero is returned.