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

Use flattened array

This commit is contained in:
Panadestein 2020-12-04 13:59:10 +01:00
parent bcef333c60
commit 66db010d0e
6 changed files with 2421 additions and 52 deletions

View File

@ -3,55 +3,62 @@ BEGIN_PROVIDER [double precision, factor_een]
BEGIN_DOC BEGIN_DOC
! Electron-electron nucleus contribution to Jastrow factor ! Electron-electron nucleus contribution to Jastrow factor
END_DOC END_DOC
integer :: i, j, alpha, p, k, l, lmax integer :: i, j, alpha, p, k, l, lmax, cidx
double precision :: x, y, z, t, c_inv, u, a, b, a2, b2, c, t0 double precision :: x, y, z, t, c_inv, u, a, b, a2, b2, c, t0
PROVIDE cord_vect PROVIDE cord_vect
factor_een = 0.0d0 factor_een = 0.0d0
cidx = 0
do alpha = 1, nnuc do alpha = 1, nnuc
do j = 1, nelec do j = 1, nelec
b = rescale_een_n(j, alpha) b = rescale_een_n(j, alpha)
do i = 1, nelec do i = 1, nelec
u = rescale_een_e(i, j) u = rescale_een_e(i, j)
a = rescale_een_n(i, alpha) a = rescale_een_n(i, alpha)
a2 = a * a a2 = a * a
b2 = b * b b2 = b * b
c = rescale_een_n(i, alpha) * rescale_een_n(j, alpha) c = rescale_een_n(i, alpha) * rescale_een_n(j, alpha)
c_inv = 1.0d0 / c c_inv = 1.0d0 / c
do p = 2, ncord do p = 2, ncord
x = 1.0d0 x = 1.0d0
do k = 0, p - 1 do k = 0, p - 1
if ( k /= 0 ) then if ( k /= 0 ) then
lmax = p - k lmax = p - k
else else
lmax = p - k - 2 lmax = p - k - 2
end if end if
t = x t = x
do l = 1, rshift(p - k, 1) do l = 1, rshift(p - k, 1)
t = t * c t = t * c
end do end do
! We have suppressed this from the following loop: ! We have suppressed this from the following loop:
! if ( iand(p - k - l, 1) == 0 ) then ! if ( iand(p - k - l, 1) == 0 ) then
! !
! Start from l=0 when p-k is even ! Start from l=0 when p-k is even
! Start from l=1 when p-k is odd ! Start from l=1 when p-k is odd
if (iand(p - k, 1) == 0) then if (iand(p - k, 1) == 0) then
y = 1.0d0 y = 1.0d0
z = 1.0d0 z = 1.0d0
else else
y = a y = a
z = b z = b
endif endif
do l = iand(p - k, 1), lmax, 2 do l = iand(p - k, 1), lmax, 2
! factor_een = factor_een + cord_vect(l, k, p, alpha) * (y + z) * t ! factor_een = factor_een + cord_vect(l, k, p, alpha) * (y + z) * t
factor_een = factor_een + cord_vect(l + k + p + alpha) * (y + z) * t ! cidx = l + (ncord + 1) * k + (ncord + 1) * (ncord + 1) * p + &
t = t * c_inv ! (ncord + 1) * (ncord + 1) * ncord * alpha
y = y * a2 ! here I try to use the flattened version of the array
z = z * b2 cidx = l + 6 * k + 6 * 6 * p + 6 * 6 * 5 * alpha
end do print *, cidx
x = x * u factor_een = factor_een + cord_vect(cidx) * (y + z) * t
end do t = t * c_inv
end do y = y * a2
z = z * b2
end do
x = x * u
end do
end do
end do end do
end do end do
end do end do

BIN
jastrow

Binary file not shown.

View File

@ -3,6 +3,18 @@ BEGIN_PROVIDER [ double precision, jastrow_full ]
BEGIN_DOC BEGIN_DOC
! Complete jastrow factor ! Complete jastrow factor
END_DOC END_DOC
! integer :: i, j, k, l
! do l = 1, nnuc
! do k = 1, ncord
! do j = 0, ncord
! do i = 0, ncord
! write(*, *) cord_vect_0(i, j, k, l)
! end do
! end do
! end do
! end do
print *, factor_ee print *, factor_ee
print *, factor_en print *, factor_en

View File

@ -74,13 +74,13 @@ END_PROVIDER
! FREE seed ! FREE seed
! END_PROVIDER ! END_PROVIDER
! !
! BEGIN_PROVIDER [double precision, cord_vect, (0:ncord,0:ncord,ncord,nnuc)] BEGIN_PROVIDER [double precision, cord_vect_0, (0:ncord,0:ncord,ncord,nnuc)]
! implicit none implicit none
! BEGIN_DOC BEGIN_DOC
! ! Vector of the `c' coefficients ! Vector of the `c' coefficients
! END_DOC END_DOC
! PROVIDE seed PROVIDE seed
! call random_number(cord_vect) call random_number(cord_vect_0)
! cord_vect = cord_vect*.1d-4 cord_vect_0 = cord_vect_0 * .1d-4
! FREE seed FREE seed
! END_PROVIDER END_PROVIDER

File diff suppressed because it is too large Load Diff

1800
tt Normal file

File diff suppressed because it is too large Load Diff