1
0
mirror of https://github.com/TREX-CoE/irpjast.git synced 2024-12-22 20:36:08 +01:00

Jee derivatives fully functional

This commit is contained in:
Panadestein 2020-12-16 13:22:42 +01:00
parent fc0f30a804
commit 3fe41e7ba4
8 changed files with 43 additions and 65 deletions

View File

@ -1,11 +1,8 @@
IRPF90 = irpf90 #-a -d IRPF90 = irpf90 #-a -d
FC = gfortran -g FC = gfortran
FCFLAGS= -O2 -ffree-line-length-none -I . FCFLAGS= -O2 -ffree-line-length-none -I .
FC = ifort -C -traceback -g NINJA = ninja
#FCFLAGS= -O2 -ffree-line-length-none -I .
#NINJA = ninja
AR = ar AR = ar
ARCHIVE= ar crs
RANLIB = ranlib RANLIB = ranlib
SRC= SRC=

BIN
deriv_num Executable file

Binary file not shown.

View File

@ -1,35 +1,35 @@
program jastrow program jastrow
implicit none implicit none
print *, 'Nabla J1' print *, 'Nabla Jeen'
integer :: k integer :: k
double precision :: j1, j2, j0, deriv, dt, lapl double precision :: j1, j2, j0, deriv, dt, lapl
dt = 1.d-4 dt = 1.0d-5
BEGIN_TEMPLATE BEGIN_TEMPLATE
lapl = 0.d0 lapl = 0.0d0
j0 = $X $Y j0 = $X $Y
do k=1,3
do k = 1, 3
elec_coord(1, k) -= dt elec_coord(1, k) -= dt
TOUCH elec_coord TOUCH elec_coord
j1 = $X $Y j1 = $X $Y
elec_coord(1,k) += 2.d0*dt elec_coord(1, k) += 2.0d0*dt
TOUCH elec_coord TOUCH elec_coord
j2 = $X $Y j2 = $X $Y
deriv = (j2 - j1)/(2.d0*dt) deriv = (j2 - j1) / (2.0d0 * dt)
lapl += (j2 - 2.d0*j0 + j1)/(dt*dt) lapl += (j2 - 2.0d0*j0 + j1) / (dt*dt)
print *, 'deriv $X ' print *, 'Deriv $X '
print *, deriv print *, deriv
print *, $X_deriv_e(k, $Z) print *, $X_deriv_e(k, $Z)
print *, '' print *, ''
elec_coord(1, k) -= dt elec_coord(1, k) -= dt
TOUCH elec_coord TOUCH elec_coord
enddo enddo
print *, 'lapl $X '
print *, 'Lapl $X '
print *, lapl print *, lapl
print *, $X_deriv_e(4, $Z) print *, $X_deriv_e(4, $Z)
print *, '' print *, ''

View File

@ -28,9 +28,7 @@ BEGIN_PROVIDER [ double precision, factor_een ]
rial = rescale_een_n(i, a, l) rial = rescale_een_n(i, a, l)
riam = rescale_een_n(i, a, m) riam = rescale_een_n(i, a, m)
rijk = rescale_een_e(i, j, k) rijk = rescale_een_e(i, j, k)
factor_een = factor_een + & factor_een = factor_een + rijk * (rial + rjal) * riam * rjam_cn
! rijk * (rial + rjal) * riam * rjam_cn
rijk * rjam_cn
enddo enddo
enddo enddo
enddo enddo
@ -48,7 +46,7 @@ BEGIN_PROVIDER [ double precision, factor_een_deriv_e, (4, nelec) ]
END_DOC END_DOC
integer :: i, ii, j, a, p, k, l, lmax, m integer :: i, ii, j, a, p, k, l, lmax, m
double precision :: riam, rjam_cn, rial, rjal, rijk double precision :: riam, rjam_cn, rial, rjal, rijk
double precision, dimension(4) :: driam, drjam_cn, drial, drjal, drijk, x double precision, dimension(4) :: driam, drjam_cn, drial, drjal, drijk
double precision :: cn, v1, v2, d1, d2, lap double precision :: cn, v1, v2, d1, d2, lap
factor_een_deriv_e = 0.0d0 factor_een_deriv_e = 0.0d0
@ -86,28 +84,22 @@ BEGIN_PROVIDER [ double precision, factor_een_deriv_e, (4, nelec) ]
drijk(ii) = rescale_een_e_deriv_e(ii, j, i, k) drijk(ii) = rescale_een_e_deriv_e(ii, j, i, k)
enddo enddo
lap = 0.0d0
x(1:3) = 0.0d0
x(4) = 2.0d0
v1 = rijk * (rial + rjal) v1 = rijk * (rial + rjal)
v2 = rjam_cn * riam v2 = rjam_cn * riam
lap = 0.0d0
do ii = 1, 3 do ii = 1, 3
d1 = drijk(ii) * (rial + rjal) + rijk * (rial + drjal(ii)) d1 = drijk(ii) * (rial + rjal) + rijk * drjal(ii)
d2 = drjam_cn(ii) * riam d2 = drjam_cn(ii) * riam
factor_een_deriv_e(ii, j) = factor_een_deriv_e(ii, j) + &
v1 * d2 + d1 * v2
! factor_een_deriv_e(ii, j) = factor_een_deriv_e(ii, j) + &
! drijk(ii)
lap = lap + d1 * d2 lap = lap + d1 * d2
factor_een_deriv_e(ii, j) += v1 * d2 + d1 * v2
enddo enddo
ii = 4
d1 = drijk(ii) * (rial + rjal) + rijk * (rial + drjal(ii))
d2 = drjam_cn(ii) * riam
factor_een_deriv_e(ii, j) = factor_een_deriv_e(ii, j) + &
v1 * d2 + d1 * v2 + x(ii) * lap
! v(x) u''(x) + 2 * u'(x) v'(x) + u(x) v''(x) ! v(x) u''(x) + 2 * u'(x) v'(x) + u(x) v''(x)
ii = 4
d1 = drijk(ii) * (rial + rjal) + rijk * drjal(ii)
d2 = drjam_cn(ii) * riam
factor_een_deriv_e(ii, j) += v1 * d2 + d1 * v2 + 2.0d0 * lap
enddo enddo
enddo enddo

Binary file not shown.

BIN
jastrow Executable file

Binary file not shown.

View File

@ -132,19 +132,16 @@ BEGIN_PROVIDER [double precision, elnuc_dist_deriv_e, (4, nelec, nnuc)]
END_DOC END_DOC
implicit none implicit none
integer :: i, ii, a integer :: i, ii, a
double precision :: ria_inv, lap double precision :: ria_inv
do a = 1, nnuc do a = 1, nnuc
do i = 1, nelec do i = 1, nelec
ria_inv = 1.0d0 / elnuc_dist(i, a) ria_inv = 1.0d0 / elnuc_dist(i, a)
lap = 0.0d0
do ii = 1, 3 do ii = 1, 3
! \frac{x-x0}{\sqrt{c+(x-x0)^2}} ! \frac{x-x0}{\sqrt{c+(x-x0)^2}}
elnuc_dist_deriv_e(ii, i, a) = (elec_coord(i, ii) - nuc_coord(a, ii)) * ria_inv elnuc_dist_deriv_e(ii, i, a) = (elec_coord(i, ii) - nuc_coord(a, ii)) * ria_inv
! 1 / \sqrt{c+(x-x0)^2} - (x-x0)^2 /\left(c+(x-x0)^2\right)^{3/2}
lap = lap + ria_inv - elnuc_dist_deriv_e(ii, i, a) * elnuc_dist_deriv_e(ii, i, a) * ria_inv
end do end do
elnuc_dist_deriv_e(4, i, a) = lap elnuc_dist_deriv_e(4, i, a) = 2.0d0 * ria_inv
end do end do
end do end do
END_PROVIDER END_PROVIDER
@ -192,7 +189,7 @@ BEGIN_PROVIDER [double precision, elec_dist_deriv_e, (4, nelec, nelec)]
END_DOC END_DOC
implicit none implicit none
integer :: i, ii, j integer :: i, ii, j
double precision :: rij_inv, lap double precision :: rij_inv
do j = 1, nelec do j = 1, nelec
do i = 1, nelec do i = 1, nelec
@ -201,7 +198,7 @@ BEGIN_PROVIDER [double precision, elec_dist_deriv_e, (4, nelec, nelec)]
! \frac{x-x0}{\sqrt{c+(x-x0)^2}} ! \frac{x-x0}{\sqrt{c+(x-x0)^2}}
elec_dist_deriv_e(ii, i, j) = (elec_coord(i, ii) - elec_coord(j, ii)) * rij_inv elec_dist_deriv_e(ii, i, j) = (elec_coord(i, ii) - elec_coord(j, ii)) * rij_inv
end do end do
elec_dist_deriv_e(4, i, j) = 2.d0 * rij_inv elec_dist_deriv_e(4, i, j) = 2.0d0 * rij_inv
end do end do
elec_dist_deriv_e(:, j, j) = 0.0d0 elec_dist_deriv_e(:, j, j) = 0.0d0
end do end do

8
tt

File diff suppressed because one or more lines are too long