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

Tests (broken)

This commit is contained in:
Anthony Scemama 2020-11-26 16:12:33 +01:00
parent 900bf125e6
commit 247b84f2d2
9 changed files with 57 additions and 34 deletions

View File

@ -1,6 +1,8 @@
IRPF90 = irpf90 -a -d IRPF90 = irpf90 --codelet factor_een:100
FC = gfortran #FC = gfortran
FCFLAGS= -O2 -ffree-line-length-none -I . #FCFLAGS= -g -msse4.2 -fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising -Wintrinsics-std -Wno-tabs -Wintrinsic-shadow -Wline-truncation -Wreal-q-constant -Wuninitialized -fbacktrace -ffpe-trap=zero,overflow,underflow -finit-real=nan
FC = ifort -g
FCFLAGS= -O2 -xHost -I .
NINJA = ninja NINJA = ninja
AR = ar AR = ar
RANLIB = ranlib RANLIB = ranlib

View File

@ -4,24 +4,33 @@ BEGIN_PROVIDER [double precision, factor_een]
! 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 = 0 integer :: i, j, alpha, p, k, l, lmax = 0
double precision :: x, y, z, t, t_inv
factor_een = 0.0d0 factor_een = 0.0d0
do alpha = 1, nnuc do alpha = 1, nnuc
do j = 1, nelec do j = 1, nelec
do i = 1, nelec do i = 1, nelec
t_inv = 1.d0/(rescale_een_n(i, alpha) * rescale_een_n(j, alpha))
do p = 2, ncord do p = 2, ncord
do k = p - 1, 0 do k = p - 1, 0, -1
if ( k == 0 ) then if ( k == 0 ) then
lmax = p - k - 2 lmax = p - k - 2
else else
lmax = p - k lmax = p - k
end if end if
do l = lmax, 0 x = 1.d0
if ( mod(p - k - l, 2) == 0 ) then y = 1.d0
factor_een = factor_een + cord_vect(p, k, l) * rescale_een_e(i, j) ** k & z = 1.d0
* (rescale_een_n(i, alpha) ** l + rescale_een_n(j, alpha) ** l) * & t = (rescale_een_n(i, alpha) * rescale_een_n(j, alpha)) ** (rshift(p - k,1))
(rescale_een_n(i, alpha) * rescale_een_n(j, alpha)) ** ((p - k - l) * 0.5d0) do l = 0, lmax
if ( iand(p - k - l, 1) == 0 ) then
factor_een = factor_een + cord_vect(l, k, p, alpha) * x &
* (y + z) * t
t = t * t_inv
end if end if
x = x * rescale_een_e(i, j)
y = y * rescale_een_n(i, alpha)
z = z * rescale_een_n(j, alpha)
end do end do
end do end do
end do end do

View File

@ -3,7 +3,7 @@ BEGIN_PROVIDER [ integer, nelec ]
BEGIN_DOC BEGIN_DOC
! Number of electrons ! Number of electrons
END_DOC END_DOC
nelec = 2 nelec = 100
END_PROVIDER END_PROVIDER
@ -43,14 +43,14 @@ BEGIN_PROVIDER [double precision, factor_ee]
BEGIN_DOC BEGIN_DOC
! Electron-electron contribution to Jastrow factor ! Electron-electron contribution to Jastrow factor
END_DOC END_DOC
integer :: i, j integer :: i, j, p
double precision :: pow_ser = 0.0d0 double precision :: pow_ser = 0.0d0
factor_ee = 0.0d0 factor_ee = 0.0d0
do j = 1 , nelec do j = 1 , nelec
do i = 1, nelec do i = 1, nelec
do p = 2, nbord do p = 2, nbord
pow_ser = pow_ser + bord_vect(p + 1) * rescale_ee(i, j) ** p pow_ser = pow_ser + bord_vect(p) * rescale_ee(i, j) ** p
end do end do
factor_ee = factor_ee + bord_vect(1) * rescale_ee(i, j) & factor_ee = factor_ee + bord_vect(1) * rescale_ee(i, j) &
/ (1 + bord_vect(2) * rescale_ee(i, j)) + pow_ser / (1 + bord_vect(2) * rescale_ee(i, j)) + pow_ser

BIN
jastrow

Binary file not shown.

View File

@ -1,6 +1,6 @@
program jastrow program jastrow
implicit none implicit none
print *, 'The total Jastrow factor' print *, 'The total Jastrow factor'
print *, dexp(factor_ee + factor_en + factor_een) print *, jastrow_full
end program end program

13
jastrow_provider.irp.f Normal file
View File

@ -0,0 +1,13 @@
BEGIN_PROVIDER [ double precision, jastrow_full ]
implicit none
BEGIN_DOC
! Complete jastrow factor
END_DOC
print *, factor_ee
print *, factor_en
print *, factor_een
jastrow_full = dexp(factor_ee + factor_en + factor_een)
END_PROVIDER

View File

@ -3,7 +3,7 @@ BEGIN_PROVIDER [ integer, nnuc ]
BEGIN_DOC BEGIN_DOC
! Number of nuclei ! Number of nuclei
END_DOC END_DOC
nnuc = 2 nnuc = 10
END_PROVIDER END_PROVIDER
@ -21,7 +21,7 @@ BEGIN_PROVIDER [ double precision, nuc_coord, (nnuc, 3) ]
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [ double precision, elnuc_dist, (nnuc, nnuc) ] BEGIN_PROVIDER [ double precision, elnuc_dist, (nelec, nnuc) ]
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! e-n distance ! e-n distance
@ -50,7 +50,7 @@ BEGIN_PROVIDER [double precision, factor_en]
do j = 1 , nnuc do j = 1 , nnuc
do i = 1, nnuc do i = 1, nnuc
do p = 2, naord do p = 2, naord
pow_ser = pow_ser + aord_vect(p + 1) * rescale_en(i, j) ** p pow_ser = pow_ser + aord_vect(p) * rescale_en(i, j) ** p
end do end do
factor_en = factor_en + aord_vect(1) * rescale_en(i, j) & factor_en = factor_en + aord_vect(1) * rescale_en(i, j) &
/ (1 + aord_vect(2) * rescale_en(i, j)) + pow_ser / (1 + aord_vect(2) * rescale_en(i, j)) + pow_ser

View File

@ -27,9 +27,9 @@ BEGIN_PROVIDER [double precision, aord_vect, (naord)]
BEGIN_DOC BEGIN_DOC
! Vector of the `a' coefficients ! Vector of the `a' coefficients
END_DOC END_DOC
do i = 1, naord integer :: i
call random_number(aord_vect) call random_number(aord_vect)
end do aord_vect = aord_vect*.1e-2
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [double precision, bord_vect, (nbord)] BEGIN_PROVIDER [double precision, bord_vect, (nbord)]
@ -37,17 +37,16 @@ BEGIN_PROVIDER [double precision, bord_vect, (nbord)]
BEGIN_DOC BEGIN_DOC
! Vector of the `b' coefficients ! Vector of the `b' coefficients
END_DOC END_DOC
do i = 1, nbord integer :: i
call random_number(bord_vect) call random_number(bord_vect)
end do bord_vect = bord_vect*.1e-6
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [double precision, cord_vect, (ncord)] BEGIN_PROVIDER [double precision, cord_vect, (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
do i = 1, ncord
call random_number(cord_vect) call random_number(cord_vect)
end do cord_vect = cord_vect*.1e-4
END_PROVIDER END_PROVIDER

View File

@ -40,7 +40,7 @@ BEGIN_PROVIDER [ double precision, rescale_en, (nelec, nnuc) ]
enddo enddo
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [double precision, rescale_een_e, (nelec, 3)] BEGIN_PROVIDER [double precision, rescale_een_e, (nelec, nelec)]
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! R = exp(-kappa r) for electron-electron for $J_{een}$ ! R = exp(-kappa r) for electron-electron for $J_{een}$
@ -53,7 +53,7 @@ BEGIN_PROVIDER [double precision, rescale_een_e, (nelec, 3)]
enddo enddo
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [double precision, rescale_een_n, (nnuc, 3)] BEGIN_PROVIDER [double precision, rescale_een_n, (nelec, nnuc)]
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! R = exp(-kappa r) for electron-electron for $J_{een}$ ! R = exp(-kappa r) for electron-electron for $J_{een}$