19#include "../base/base_uses.f90"
25 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .false.
27 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'eri_mme_gaussian'
51 REAL(kind=
dp),
INTENT(IN) :: zet
52 INTEGER,
INTENT(IN) :: l_max
53 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :), &
58 ALLOCATE (h_to_c(-1:l_max + 1, 0:l_max))
63 h_to_c(k, l + 1) = -(k + 1)*h_to_c(k + 1, l) + 2.0_dp*zet*h_to_c(k - 1, l)
76 REAL(kind=
dp),
INTENT(IN) :: zet
77 INTEGER,
DIMENSION(3),
INTENT(IN) :: l
80 norm = 1.0_dp/sqrt((2.0_dp*zet)**(sum(l) - 1.5_dp)*(
gamma1(l(1))*
gamma1(l(2))*
gamma1(l(3))))
99 INTEGER,
INTENT(IN) :: n_minimax
100 REAL(kind=
dp),
INTENT(IN) :: cutoff, g_min
101 REAL(kind=
dp),
DIMENSION(:),
INTENT(OUT) :: minimax_aw
102 INTEGER,
INTENT(IN),
OPTIONAL :: potential
103 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: pot_par
104 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: err_minimax
106 INTEGER :: potential_prv
107 REAL(kind=
dp) :: dg, g_max, minimax_rc
108 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: a, w
110 IF (
PRESENT(potential))
THEN
111 potential_prv = potential
116 IF (potential_prv > 3)
THEN
117 cpabort(
"unknown potential")
120 IF ((potential_prv >= 2) .AND. .NOT.
PRESENT(pot_par))
THEN
121 cpabort(
"potential parameter pot_par required for yukawa or long-range Coulomb")
132 g_max = sqrt(3.0_dp*2.0_dp*cutoff)
133 cpassert(g_max .GT. g_min)
135 minimax_rc = (g_max/g_min)**2
137 minimax_rc = (g_max**2 + pot_par**2)/(g_min**2 + pot_par**2)
142 ALLOCATE (a(n_minimax));
ALLOCATE (w(n_minimax))
143 a(:) = minimax_aw(:n_minimax)
144 w(:) = minimax_aw(n_minimax + 1:)
145 SELECT CASE (potential_prv)
153 w(:) = w*exp((-a*pot_par**2)/(g_min**2 + pot_par**2))/(g_min**2 + pot_par**2)
154 a(:) = a/(g_min**2 + pot_par**2)
161 a(:) = a + 1.0_dp/pot_par**2
163 minimax_aw = [a(:), w(:)]
165 IF (
PRESENT(err_minimax))
THEN
167 err_minimax = err_minimax/g_min**2
169 err_minimax = err_minimax/(g_min**2 + pot_par**2)
171 err_minimax = err_minimax/g_min**2
172 err_minimax = err_minimax*exp(-g_min**2/pot_par**2)
194 INTEGER,
INTENT(IN) :: l, m
195 REAL(kind=
dp),
INTENT(IN) :: a, b, r1, r2
196 INTEGER,
INTENT(IN) :: h_or_c_product
197 REAL(kind=
dp),
DIMENSION(-1:l+m+1, -1:l, -1:m), &
201 REAL(kind=
dp) :: c1, c2, c3
204 e(0, 0, 0) = exp(-a*b/(a + b)*(r1 - r2)**2)
207 c2 = (b/(a + b))*(r2 - r1)
208 c3 = (a/(a + b))*(r1 - r2)
210 IF (h_or_c_product .EQ. 1)
THEN
213 DO t = 0, ll + mm + 1
215 e(t, ll + 1, mm) = c1*e(t - 1, ll, mm) + &
217 (t + 1)*e(t + 1, ll, mm)
220 e(t, ll, mm + 1) = c1*e(t - 1, ll, mm) + &
222 (t + 1)*e(t + 1, ll, mm)
230 DO t = 0, ll + mm + 1
232 e(t, ll + 1, mm) = a*(2*c1*e(t - 1, ll, mm) + &
233 2*c2*e(t, ll, mm) + &
234 2*(t + 1)*e(t + 1, ll, mm) - &
235 2*ll*e(t, ll - 1, mm))
238 e(t, ll, mm + 1) = b*(2*c1*e(t - 1, ll, mm) + &
239 2*c3*e(t, ll, mm) + &
240 2*(t + 1)*e(t + 1, ll, mm) - &
241 2*mm*e(t, ll, mm - 1))
Methods related to properties of Hermite and Cartesian Gaussian functions.
pure real(kind=dp) function, public hermite_gauss_norm(zet, l)
Norm of 1d Hermite-Gauss functions.
pure subroutine, public create_hermite_to_cartesian(zet, l_max, h_to_c)
Create matrix to transform between cartesian and hermite gaussian basis functions.
integer, parameter, public eri_mme_longrange
integer, parameter, public eri_mme_coulomb
subroutine, public get_minimax_coeff_v_gspace(n_minimax, cutoff, g_min, minimax_aw, potential, pot_par, err_minimax)
Get minimax coefficient a_i and w_i for approximating 1/G^2 by sum_i w_i exp(-a_i G^2)
pure subroutine, public create_gaussian_overlap_dist_to_hermite(l, m, a, b, r1, r2, h_or_c_product, e)
Expand 1d product of cartesian (or hermite) gaussians into single hermite gaussians: Find E_t^{lm} s....
integer, parameter, public eri_mme_yukawa
Defines the basic variable types.
integer, parameter, public dp
Definition of mathematical constants and functions.
real(kind=dp), dimension(0:maxfac), parameter, public gamma1
Routines to calculate the minimax coefficients in order to approximate 1/x as a sum over exponential ...
subroutine, public get_exp_minimax_coeff(k, rc, aw, mm_error, which_coeffs)
Get best minimax approximation for given input parameters. Automatically chooses the most exact set o...