mirror of
https://github.com/TREX-CoE/irpjast.git
synced 2024-08-25 06:31:46 +02:00
Merge pull request #5 from Panadestein/as
BLAS for value, gradient and Laplacian
This commit is contained in:
commit
f8c9968105
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
|||||||
IRPF90 = irpf90 --codelet=jastrow_full:1000 #-s nelec:10 -s nnuc:2 -s ncord:5 #-a -d
|
IRPF90 = irpf90 --codelet=jastrow_full:1000 #-s nelec:10 -s nnuc:2 -s ncord:5 #-a -d
|
||||||
FC = ifort -xHost -g -mkl=sequential
|
FC = ifort -xHost -g -mkl=sequential
|
||||||
FCFLAGS= -O2 -ffree-line-length-none -I .
|
FCFLAGS= -O2 -ffree-line-length-none -I .
|
||||||
NINJA = ninja
|
NINJA = ninja
|
||||||
AR = ar
|
AR = ar
|
||||||
|
@ -51,6 +51,9 @@ BEGIN_PROVIDER [ double precision, factor_een_deriv_e, (4, nelec) ]
|
|||||||
integer :: i, j, a, p, k, l, lmax, m, n
|
integer :: i, j, a, p, k, l, lmax, m, n
|
||||||
double precision :: cn, accu, accu2, daccu(1:4), daccu2(1:4)
|
double precision :: cn, accu, accu2, daccu(1:4), daccu2(1:4)
|
||||||
|
|
||||||
|
factor_een_deriv_e(1:4,1:nelec) = factor_een_deriv_e_blas(1:4,1:nelec)
|
||||||
|
return
|
||||||
|
|
||||||
factor_een_deriv_e(1:4,1:nelec) = 0.0d0
|
factor_een_deriv_e(1:4,1:nelec) = 0.0d0
|
||||||
|
|
||||||
do p = 2, ncord
|
do p = 2, ncord
|
||||||
@ -76,14 +79,14 @@ BEGIN_PROVIDER [ double precision, factor_een_deriv_e, (4, nelec) ]
|
|||||||
accu = accu + &
|
accu = accu + &
|
||||||
rescale_een_e(i,j,k) * &
|
rescale_een_e(i,j,k) * &
|
||||||
rescale_een_n(i,a,m)
|
rescale_een_n(i,a,m)
|
||||||
accu2 = accu2 + &
|
accu2 = accu2 + &
|
||||||
rescale_een_e(i,j,k) * &
|
rescale_een_e(i,j,k) * &
|
||||||
rescale_een_n(i,a,m+l)
|
rescale_een_n(i,a,m+l)
|
||||||
daccu(1:4) = daccu(1:4) + &
|
daccu(1:4) = daccu(1:4) + &
|
||||||
rescale_een_e_deriv_e(1:4,j,i,k) * &
|
rescale_een_e_deriv_e_t(1:4,i,j,k) * &
|
||||||
rescale_een_n(i,a,m)
|
rescale_een_n(i,a,m)
|
||||||
daccu2(1:4) = daccu2(1:4) + &
|
daccu2(1:4) = daccu2(1:4) + &
|
||||||
rescale_een_e_deriv_e(1:4,j,i,k) * &
|
rescale_een_e_deriv_e_t(1:4,i,j,k) * &
|
||||||
rescale_een_n(i,a,m+l)
|
rescale_een_n(i,a,m+l)
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
|
@ -1,57 +1,5 @@
|
|||||||
BEGIN_PROVIDER [ double precision, factor_een_blas ]
|
BEGIN_PROVIDER [ double precision, factor_een_blas ]
|
||||||
implicit none
|
&BEGIN_PROVIDER [ double precision, factor_een_deriv_e_blas, (4, nelec) ]
|
||||||
BEGIN_DOC
|
|
||||||
! ElectronE-electron-nuclei contribution to Jastrow factor
|
|
||||||
!
|
|
||||||
! 4124.84239750000
|
|
||||||
END_DOC
|
|
||||||
integer :: i, j, a, p, k, l, lmax, m, n
|
|
||||||
double precision :: cn(nnuc), accu
|
|
||||||
double precision :: f(nnuc,0:ncord-2,0:ncord-2)
|
|
||||||
double precision :: tmp_c(nelec,nnuc,0:ncord,0:ncord-1)
|
|
||||||
|
|
||||||
factor_een_blas = 0.0d0
|
|
||||||
|
|
||||||
! r_{ij}^k . R_{ja}^l -> tmp_c_{ia}^{kl}
|
|
||||||
do k=0,ncord-1
|
|
||||||
call dgemm('N','N', nelec, nnuc*(ncord+1), nelec, 1.d0, &
|
|
||||||
rescale_een_e(1,1,k), size(rescale_een_e,1), &
|
|
||||||
rescale_een_n(1,1,0), size(rescale_een_n,1), 0.d0, &
|
|
||||||
tmp_c(1,1,0,k), size(tmp_c,1))
|
|
||||||
enddo
|
|
||||||
|
|
||||||
do p = 2, ncord
|
|
||||||
do k = 0, p - 1
|
|
||||||
m = p-k
|
|
||||||
if (k > 0) then
|
|
||||||
lmax = m
|
|
||||||
else
|
|
||||||
lmax = m - 2
|
|
||||||
endif
|
|
||||||
|
|
||||||
n = shiftr(m,1)
|
|
||||||
do l = iand(m, 1), lmax, 2
|
|
||||||
|
|
||||||
do a = 1, nnuc
|
|
||||||
cn(a) = cord_vect_lkp(l, k, p, typenuc_arr(a))
|
|
||||||
enddo
|
|
||||||
|
|
||||||
do a = 1, nnuc
|
|
||||||
accu = 0.d0
|
|
||||||
do i=1,nelec
|
|
||||||
accu = accu + rescale_een_n(i,a,n) * tmp_c(i,a,n+l,k)
|
|
||||||
enddo
|
|
||||||
factor_een_blas = factor_een_blas + accu * cn(a)
|
|
||||||
enddo
|
|
||||||
n = n-1
|
|
||||||
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, factor_een_deriv_e_blas, (4, nelec) ]
|
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Dimensions 1-3 : dx, dy, dz
|
! Dimensions 1-3 : dx, dy, dz
|
||||||
@ -59,12 +7,13 @@ BEGIN_PROVIDER [ double precision, factor_een_deriv_e_blas, (4, nelec) ]
|
|||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
integer :: i, j, a, p, k, l, lmax, m, n
|
integer :: i, j, a, p, k, l, lmax, m, n
|
||||||
double precision :: cn(nnuc), accu(4)
|
double precision :: cn(ncord), accu
|
||||||
double precision :: f(nnuc,0:ncord-2,0:ncord-2)
|
double precision :: f(nnuc,0:ncord-2,0:ncord-2)
|
||||||
double precision :: tmp_c(nelec,nnuc,0:ncord,0:ncord-1)
|
double precision :: tmp_c(nelec,nnuc,0:ncord,0:ncord-1)
|
||||||
double precision :: dtmp_c(4,nelec,nnuc,0:ncord,0:ncord-1)
|
double precision :: dtmp_c(4,nelec,nnuc,0:ncord,0:ncord-1)
|
||||||
|
|
||||||
factor_een_deriv_e_blas = 0.0d0
|
factor_een_blas = 0.0d0
|
||||||
|
factor_een_deriv_e_blas(1:4,1:nelec) = 0.0d0
|
||||||
|
|
||||||
! r_{ij}^k . R_{ja}^l -> tmp_c_{ia}^{kl}
|
! r_{ij}^k . R_{ja}^l -> tmp_c_{ia}^{kl}
|
||||||
do k=0,ncord-1
|
do k=0,ncord-1
|
||||||
@ -82,14 +31,15 @@ BEGIN_PROVIDER [ double precision, factor_een_deriv_e_blas, (4, nelec) ]
|
|||||||
dtmp_c(1,1,1,0,k), 4*size(dtmp_c,2))
|
dtmp_c(1,1,1,0,k), 4*size(dtmp_c,2))
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
|
||||||
do p = 2, ncord
|
do p = 2, ncord
|
||||||
do k = 0, p - 1
|
do k = 0, p - 1
|
||||||
m = p-k
|
m = p-k
|
||||||
if (k > 0) then
|
if (k > 0) then
|
||||||
lmax = m
|
lmax = m
|
||||||
else
|
else
|
||||||
lmax = m - 2
|
lmax = m - 2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
n = shiftr(m,1)
|
n = shiftr(m,1)
|
||||||
do l = iand(m, 1), lmax, 2
|
do l = iand(m, 1), lmax, 2
|
||||||
@ -99,11 +49,30 @@ BEGIN_PROVIDER [ double precision, factor_een_deriv_e_blas, (4, nelec) ]
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
do a = 1, nnuc
|
do a = 1, nnuc
|
||||||
do i=1,nelec
|
accu = 0.d0
|
||||||
accu(1:4) = rescale_een_n(i,a,n) * dtmp_c(1:4,i,a,n+l,k) &
|
|
||||||
+ rescale_een_n_deriv_e(1:4,i,a,n) * tmp_c(i,a,n+l,k)
|
do j=1,nelec
|
||||||
factor_een_deriv_e_blas(1:4,i) = factor_een_deriv_e_blas(1:4,i) + accu(1:4) * cn(a)
|
accu = accu + rescale_een_n(j,a,n) * tmp_c(j,a,n+l,k)
|
||||||
|
|
||||||
|
factor_een_deriv_e_blas(1:4,j) = factor_een_deriv_e_blas(1:4,j) + (&
|
||||||
|
tmp_c(j,a,n,k) * rescale_een_n_deriv_e(1:4,j,a,n+l) + &
|
||||||
|
dtmp_c(1:4,j,a,n,k) * rescale_een_n(j,a,n+l) + &
|
||||||
|
dtmp_c(1:4,j,a,n+l,k) * rescale_een_n(j,a,n) + &
|
||||||
|
tmp_c(j,a,n+l,k)*rescale_een_n_deriv_e(1:4,j,a,n) &
|
||||||
|
) * cn(a)
|
||||||
|
|
||||||
|
factor_een_deriv_e_blas(4,j) = factor_een_deriv_e_blas(4,j) + (&
|
||||||
|
dtmp_c(1,j,a,n ,k) * rescale_een_n_deriv_e(1,j,a,n+l) +&
|
||||||
|
dtmp_c(2,j,a,n ,k) * rescale_een_n_deriv_e(2,j,a,n+l) +&
|
||||||
|
dtmp_c(3,j,a,n ,k) * rescale_een_n_deriv_e(3,j,a,n+l) +&
|
||||||
|
dtmp_c(1,j,a,n+l,k) * rescale_een_n_deriv_e(1,j,a,n ) +&
|
||||||
|
dtmp_c(2,j,a,n+l,k) * rescale_een_n_deriv_e(2,j,a,n ) +&
|
||||||
|
dtmp_c(3,j,a,n+l,k) * rescale_een_n_deriv_e(3,j,a,n )&
|
||||||
|
)*cn(a)*2.d0
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
|
factor_een_blas = factor_een_blas + accu * cn(a)
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
n = n-1
|
n = n-1
|
||||||
|
|
||||||
|
@ -279,6 +279,21 @@ BEGIN_PROVIDER [double precision, rescale_een_e_deriv_e, (4, nelec, nelec, 0:nco
|
|||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [double precision, rescale_een_e_deriv_e_t, (4, nelec, nelec, 0:ncord)]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Transposed rescale_een_e_deriv_e
|
||||||
|
END_DOC
|
||||||
|
integer :: i,j,k,l
|
||||||
|
do l=0,ncord
|
||||||
|
do j=1,nelec
|
||||||
|
do i=1,nelec
|
||||||
|
rescale_een_e_deriv_e_t(1:4,j,i,l) = rescale_een_e_deriv_e(1:4,i,j,l)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [double precision, elec_dist_deriv_e, (4, nelec, nelec)]
|
BEGIN_PROVIDER [double precision, elec_dist_deriv_e, (4, nelec, nelec)]
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
|
Loading…
Reference in New Issue
Block a user