mirror of
https://github.com/TREX-CoE/irpjast.git
synced 2025-01-03 10:06:11 +01:00
Tabulating. Broken
This commit is contained in:
parent
e184163d6f
commit
f5e1f8487c
140
el_nuc_el.irp.f
140
el_nuc_el.irp.f
@ -71,17 +71,17 @@ BEGIN_PROVIDER [double precision, factor_een_naive]
|
||||
! Electron-electron nucleus contribution to Jastrow factor in a naive way
|
||||
END_DOC
|
||||
integer :: i, j, alpha, p, k, l, lmax, cindex
|
||||
double precision :: ria, rja, rij
|
||||
!double precision :: ria, rja, rij
|
||||
|
||||
PROVIDE cord_vect
|
||||
factor_een_naive = 0.0d0
|
||||
|
||||
do alpha = 1, nnuc
|
||||
do j = 2, nelec
|
||||
rja = rescale_een_n(j, alpha)
|
||||
!rja = rescale_een_n(j, alpha)
|
||||
do i = 1, j - 1
|
||||
ria = rescale_een_n(i, alpha)
|
||||
rij = rescale_een_e(i, j)
|
||||
!ria = rescale_een_n(i, alpha)
|
||||
!rij = rescale_een_e(i, j)
|
||||
cindex = 0
|
||||
do p = 2, ncord
|
||||
do k = p - 1, 0, -1
|
||||
@ -93,10 +93,13 @@ BEGIN_PROVIDER [double precision, factor_een_naive]
|
||||
do l = lmax, 0, -1
|
||||
if ( iand(p - k - l, 1) == 0 ) then
|
||||
cindex = cindex + 1
|
||||
!factor_een_naive = factor_een_naive + &
|
||||
! cord_vect(cindex, typenuc_arr(alpha)) * &
|
||||
! rij ** k * (ria ** l + rja ** l) * (ria * rja) ** rshift(p - k - l, 1)
|
||||
factor_een_naive = factor_een_naive + &
|
||||
cord_vect(cindex, typenuc_arr(alpha)) * &
|
||||
rij ** k * (ria ** l + rja ** l) * (ria * rja) ** rshift(p - k - l, 1)
|
||||
print *, "a", (ria * rja) ** rshift(p - k - l, 1)
|
||||
rij(i, j, k) * (ria(i, alpha, l) + rja(j, alpha, l)) &
|
||||
* (ria(i, alpha, l) * rja(j, alpha, l)) ** rshift(p - k - l, 1)
|
||||
end if
|
||||
end do
|
||||
end do
|
||||
@ -107,60 +110,99 @@ BEGIN_PROVIDER [double precision, factor_een_naive]
|
||||
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [double precision, factor_een_prog]
|
||||
implicit none
|
||||
!BEGIN_PROVIDER [double precision, factor_een_prog]
|
||||
! implicit none
|
||||
! BEGIN_DOC
|
||||
! ! Electron-electron nucleus contribution to Jastrow factor in a naive way
|
||||
! END_DOC
|
||||
! integer :: alpha, i, j, p, k, l, lmax, m, cindex
|
||||
! double precision :: ria, rja, rij, rij_inv
|
||||
! double precision :: c, c_inv, t, x, y, z ! Placeholders for optimization
|
||||
!
|
||||
! PROVIDE cord_vect
|
||||
! factor_een_prog = 0.0d0
|
||||
!
|
||||
! do alpha = 1, nnuc
|
||||
! do j = 2, nelec
|
||||
! rja = rescale_een_n(j, alpha)
|
||||
! do i = 1, j - 1
|
||||
! ria = rescale_een_n(i, alpha)
|
||||
! rij = rescale_een_e(i, j)
|
||||
! rij_inv = 1.0d0 / (rij * rij)
|
||||
! c = ria * rja
|
||||
! c_inv = 1.0d0 / c
|
||||
! cindex = 0
|
||||
! do p = 2, ncord
|
||||
!
|
||||
! x = 1.0d0
|
||||
! do l = 1, p
|
||||
! x = x * rij
|
||||
! end do
|
||||
!
|
||||
! do k = p - 1, 0, -1
|
||||
! if ( k /= 0 ) then
|
||||
! lmax = p - k
|
||||
! else
|
||||
! lmax = p - k - 2
|
||||
! end if
|
||||
!
|
||||
! t = 1.0d0
|
||||
! do l = 1, rshift(p - k, 1)
|
||||
! t = t * c
|
||||
! end do
|
||||
!
|
||||
! do l = lmax, iand(p - k, 1), -2
|
||||
! cindex = cindex + 1
|
||||
! factor_een_prog = factor_een_prog + &
|
||||
! cord_vect(cindex, typenuc_arr(alpha)) * &
|
||||
! x * (ria ** l + rja ** l) * t
|
||||
! t = t * c_inv
|
||||
! x = x * rij_inv
|
||||
! end do
|
||||
!
|
||||
! end do
|
||||
! end do
|
||||
! end do
|
||||
! end do
|
||||
! end do
|
||||
!
|
||||
!END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [double precision, rij, (nelec, nelec, ncord)]
|
||||
&BEGIN_PROVIDER [double precision, ria, (nelec, nnuc, ncord)]
|
||||
&BEGIN_PROVIDER [double precision, rja, (nelec, nnuc, ncord)]
|
||||
BEGIN_DOC
|
||||
! Electron-electron nucleus contribution to Jastrow factor in a naive way
|
||||
! Tables with powers
|
||||
END_DOC
|
||||
integer :: alpha, i, j, p, k, l, lmax, m, cindex
|
||||
double precision :: ria, rja, rij, rij_inv
|
||||
double precision :: c, c_inv, t, x, y, z ! Placeholders for optimization
|
||||
integer :: i, j, k, alpha
|
||||
double precision :: x, y, z
|
||||
|
||||
PROVIDE cord_vect
|
||||
factor_een_prog = 0.0d0
|
||||
rij(:, :, :) = 0.0d0
|
||||
ria(:, :, :) = 0.0d0
|
||||
rja(:, :, :) = 0.0d0
|
||||
|
||||
implicit none
|
||||
do alpha = 1, nnuc
|
||||
do j = 2, nelec
|
||||
rja = rescale_een_n(j, alpha)
|
||||
z = 1.0d0
|
||||
do k = 1, ncord
|
||||
rja(j, alpha, k) = z
|
||||
z = z * rescale_een_n(j, alpha)
|
||||
end do
|
||||
do i = 1, j - 1
|
||||
ria = rescale_een_n(i, alpha)
|
||||
rij = rescale_een_e(i, j)
|
||||
rij_inv = 1.0d0 / (rij * rij)
|
||||
c = ria * rja
|
||||
c_inv = 1.0d0 / c
|
||||
cindex = 0
|
||||
do p = 2, ncord
|
||||
|
||||
y = 1.0d0
|
||||
do k = 1, ncord
|
||||
ria(i, alpha, k) = y
|
||||
y = y * rescale_een_n(i, alpha)
|
||||
end do
|
||||
x = 1.0d0
|
||||
do l = 1, p - 1
|
||||
x = x * rij
|
||||
end do
|
||||
|
||||
do k = p - 1, 0, -1
|
||||
if ( k /= 0 ) then
|
||||
lmax = p - k
|
||||
else
|
||||
lmax = p - k - 2
|
||||
end if
|
||||
|
||||
t = 1.0d0
|
||||
do l = 1, rshift(p - k, 1)
|
||||
t = t * c
|
||||
end do
|
||||
|
||||
do l = lmax, iand(p - k, 1), -2
|
||||
cindex = cindex + 1
|
||||
factor_een_prog = factor_een_prog + &
|
||||
cord_vect(cindex, typenuc_arr(alpha)) * &
|
||||
x * (ria ** l + rja ** l) * t
|
||||
t = t * c_inv
|
||||
x = x * rij_inv
|
||||
end do
|
||||
|
||||
end do
|
||||
do k = 1, ncord
|
||||
rij(i, j, k) = x
|
||||
x = x * rescale_een_e(i, j)
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
|
||||
END_PROVIDER
|
||||
|
||||
|
@ -7,10 +7,11 @@ BEGIN_PROVIDER [ double precision, jastrow_full ]
|
||||
|
||||
print *, "J_ee = ", factor_ee
|
||||
print *, "J_en = ", factor_en
|
||||
print *, "J_een = ", factor_een
|
||||
print *, "J_enn_naive = ", factor_een_naive
|
||||
print *, "J_enn_prog = ", factor_een_prog
|
||||
print *, "J_een = ", factor_een
|
||||
print *, "J = J_ee + J_en + J_een = ", factor_ee + factor_en + factor_een
|
||||
print *, "J = J_ee + J_en + J_een_naive = ", factor_ee + factor_en + factor_een_naive
|
||||
!print *, "J_enn_prog = ", factor_een_prog
|
||||
|
||||
jastrow_full = dexp(factor_ee + factor_en + factor_een)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user