1
0
mirror of https://github.com/TREX-CoE/irpjast.git synced 2024-11-03 20:54:10 +01:00

Jen gradient and laplacian working!

This commit is contained in:
Panadestein 2020-12-17 15:33:51 +01:00
parent 952c6696a5
commit bcc68c6e81
4 changed files with 45 additions and 13 deletions

BIN
deriv_num

Binary file not shown.

BIN
jastrow

Binary file not shown.

View File

@ -88,10 +88,12 @@ BEGIN_PROVIDER [double precision, factor_en_deriv_e, (4, nelec) ]
! Dimension 4 : d2x + d2y + d2z
END_DOC
integer :: i, ii, a, p, q
double precision :: x, x_inv, y, den, invden, lap1, lap2
double precision, dimension(4) :: dx, pow_ser_g
double precision :: x, x_inv, y, den, invden, lap1, lap2, lap3, third
double precision, dimension(3) :: pow_ser_g
double precision, dimension(4) :: dx
factor_en_deriv_e = 0.0d0
third = 1.0d0 / 3.0d0
do a = 1 , nnuc
do i = 1, nelec
@ -105,29 +107,34 @@ BEGIN_PROVIDER [double precision, factor_en_deriv_e, (4, nelec) ]
lap1 = 0.0d0
lap2 = 0.0d0
lap3 = 0.0d0
do ii = 1, 3
x = rescale_en(i, a)
x_inv = 1.0d0 / x
do p = 2, naord
pow_ser_g(ii) += p * aord_vect(p + 1, typenuc_arr(a)) * x * dx(ii)
pow_ser_g(4) += p * (p - 1) * aord_vect(p + 1, typenuc_arr(a)) * x * x_inv * dx(ii) * dx(ii)
lap2 += p * aord_vect(p + 1, typenuc_arr(a)) * x
x = x * rescale_en(i, a)
! p a_{p+1} r[i,a]^(p-1)
y = p * aord_vect(p + 1, typenuc_arr(a)) * x
pow_ser_g(ii) += y * dx(ii)
! (p-1) p a_{p+1} r[i,a]^(p-2) r'[i,a]^2
lap1 += (p - 1) * y * x_inv * dx(ii) * dx(ii)
! p a_{p+1} r[i,a]^(p-1) r''[i,a]
lap2 += y
x = x * rescale_en(i, a)
end do
! (a1 (-2 a2 r'[i,a]^2+(1+a2 r[i,a]) r''[i,a]))/(1+a2 r[i,a])^3
lap1 += -2.0d0 * aord_vect(2, typenuc_arr(a)) * dx(ii) * dx(ii)
lap3 += -2.0d0 * aord_vect(2, typenuc_arr(a)) * dx(ii) * dx(ii)
! \frac{\text{a1} r'(i,a)}{(\text{a2} r(i,a)+1)^2}
! \frac{a1 * r'(i,a)}{(a2 * r(i,a)+1)^2}
factor_en_deriv_e(ii, i) += aord_vect(1, typenuc_arr(a)) &
* dx(ii) * invden * invden + pow_ser_g(ii)
enddo
ii = 4
lap1 += den * dx(ii)
lap1 = lap1 * aord_vect(1, typenuc_arr(a)) * invden * invden * invden
pow_ser_g(ii) += lap1 + lap2 * dx(ii)
factor_en_deriv_e(ii, i) += pow_ser_g(ii)
lap2 *= dx(ii) * third
lap3 += den * dx(ii)
lap3 = lap3 * aord_vect(1, typenuc_arr(a)) * invden * invden * invden
factor_en_deriv_e(ii, i) += lap1 + lap2 + lap3
end do
end do

View File

@ -28,6 +28,32 @@ BEGIN_PROVIDER [ double precision, rescale_ee, (nelec, nelec) ]
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, rescale_ee_deriv_e, (4, nelec, nelec) ]
implicit none
BEGIN_DOC
! R = (1 - exp(-kappa r))/kappa derived wrt x
! Dimensions 1-3 : dx, dy, dz
! Dimension 4 : d2x + d2y + d2z
END_DOC
integer :: i, j, ii
do j = 1, nelec
do i = 1, nelec
do ii = 1, 4
rescale_ee_deriv_e(ii, i, j) = elec_dist_deriv_e(ii, i, j)
end do
rescale_ee_deriv_e(4, i, j) = rescale_ee_deriv_e(4, i, j) + &
(-kappa * rescale_ee_deriv_e(1, i, j) * rescale_ee_deriv_e(1, i, j)) + &
(-kappa * rescale_ee_deriv_e(2, i, j) * rescale_ee_deriv_e(2, i, j)) + &
(-kappa * rescale_ee_deriv_e(3, i, j) * rescale_ee_deriv_e(3, i, j))
do ii = 1, 4
rescale_ee_deriv_e(ii, i, j) = rescale_ee_deriv_e(ii, i, j) &
* dexp(-kappa * elec_dist(i, j))
enddo
enddo
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, rescale_en, (nelec, nnuc) ]
implicit none
BEGIN_DOC
@ -66,7 +92,6 @@ BEGIN_PROVIDER [ double precision, rescale_en_deriv_e, (4, nelec, nnuc) ]
enddo
enddo
enddo
END_PROVIDER
BEGIN_PROVIDER [double precision, rescale_een_e, (nelec, nelec, 0:ncord)]