From 32576e0221d9160b59075cee6300e2e74d6dd075 Mon Sep 17 00:00:00 2001 From: Panadestein Date: Tue, 17 Nov 2020 21:35:52 +0100 Subject: [PATCH] Initial commit --- .gitignore | 5 +++++ Makefile | 16 ++++++++++++++ README.org | 3 +++ el_nuc_el.irp.f | 0 electrons.irp.f | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ jastrow.irp.f | 8 +++++++ nuclei.irp.f | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ orders.irp.f | 53 +++++++++++++++++++++++++++++++++++++++++++++ rescale.irp.f | 41 +++++++++++++++++++++++++++++++++++ 9 files changed, 239 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.org create mode 100644 el_nuc_el.irp.f create mode 100644 electrons.irp.f create mode 100644 jastrow.irp.f create mode 100644 nuclei.irp.f create mode 100644 orders.irp.f create mode 100644 rescale.irp.f diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7ac9fbf --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +IRPF90_temp/ +IRPF90_man/ +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c94629d --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +IRPF90 = irpf90 -a -d +FC = gfortran +FCFLAGS= -O2 -ffree-line-length-none -I . +NINJA = ninja +AR = ar +RANLIB = ranlib + +SRC= +OBJ= +LIB= + +-include irpf90.make +export + +irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile + $(IRPF90) diff --git a/README.org b/README.org new file mode 100644 index 0000000..223b723 --- /dev/null +++ b/README.org @@ -0,0 +1,3 @@ +* IRPJAST + +CHAMP's Jastrow factor computation using the IRPF90 method diff --git a/el_nuc_el.irp.f b/el_nuc_el.irp.f new file mode 100644 index 0000000..e69de29 diff --git a/electrons.irp.f b/electrons.irp.f new file mode 100644 index 0000000..e165403 --- /dev/null +++ b/electrons.irp.f @@ -0,0 +1,56 @@ +BEGIN_PROVIDER [ integer, nelec ] + implicit none + BEGIN_DOC + ! Number of electrons + END_DOC + nelec = 2 +END_PROVIDER + + +BEGIN_PROVIDER [ double precision, elec_coord, (nelec, 3) ] + implicit none + BEGIN_DOC + ! Electron coordinates + END_DOC + integer :: i,j + do j = 1 , 3 + do i = 1, nelec + call random_number(elec_coord(i, j)) + enddo + enddo + +END_PROVIDER + +BEGIN_PROVIDER [ double precision, elec_dist, (nelec, nelec) ] + implicit none + BEGIN_DOC + ! e-e distance + END_DOC + integer :: i,j + double precision :: x,y,z + do j = 1, nelec + do i = 1, nelec + x = elec_coord(i, 1) - elec_coord(j, 1) + y = elec_coord(i, 2) - elec_coord(j, 2) + z = elec_coord(i, 3) - elec_coord(j, 3) + elec_dist(i, j) = dsqrt( x*x + y*y + z*z ) + enddo + enddo +END_PROVIDER + +BEGIN_PROVIDER [double precision, factor_ee] + implicit none + BEGIN_DOC + ! Electron-electron contribution to Jastrow factor + END_DOC + do j = 1 , nelec + do i = 1, nelec + do p = 2, nbord + pow_ser = pow_ser + bord_vect(p + 1) * rescale_ee(i, j) ** p + end do + factor_ee = factor_ee + bord_vect(1) * rescale_ee(i, j) & + / (1 + bord_vect(2) * rescale_ee(i, j)) + pow_ser + end do + end do + factor_ee = 0.5d0 * factor_ee +END_PROVIDER diff --git a/jastrow.irp.f b/jastrow.irp.f new file mode 100644 index 0000000..3851ff8 --- /dev/null +++ b/jastrow.irp.f @@ -0,0 +1,8 @@ +program jastrow + implicit none + print *, elec_coord + print *, '' + print *, elec_dist + print *, '' + print *, rescale_ee +end program diff --git a/nuclei.irp.f b/nuclei.irp.f new file mode 100644 index 0000000..34a514a --- /dev/null +++ b/nuclei.irp.f @@ -0,0 +1,57 @@ +BEGIN_PROVIDER [ integer, nnuc ] + implicit none + BEGIN_DOC + ! Number of nuclei + END_DOC + nnuc = 2 +END_PROVIDER + + +BEGIN_PROVIDER [ double precision, nuc_coord, (nnuc, 3) ] + implicit none + BEGIN_DOC + ! Nuclei coordinates + END_DOC + integer :: i, j + do j = 1 , 3 + do i = 1, nnuc + call random_number(nuc_coord(i, j)) + enddo + enddo + +END_PROVIDER + +BEGIN_PROVIDER [ double precision, elnuc_dist, (nnuc, nnuc) ] + implicit none + BEGIN_DOC + ! e-n distance + END_DOC + integer :: i, j + double precision :: x, y, z + do j = 1, nnuc + do i = 1, nelec + x = elec_coord(i, 1) - nuc_coord(j, 1) + y = elec_coord(i, 2) - nuc_coord(j, 2) + z = elec_coord(i, 3) - nuc_coord(j, 3) + elnuc_dist(i, j) = dsqrt( x*x + y*y + z*z ) + enddo + enddo +END_PROVIDER + +BEGIN_PROVIDER [double precision, factor_en] + implicit none + BEGIN_DOC + ! Electron-nuclei contribution to Jastrow factor + END_DOC + integer :: i, j, p + double precision :: pow_ser + do j = 1 , nnuc + do i = 1, nnuc + do p = 2, naord + pow_ser = pow_ser + aord_vect(p + 1) * rescale_en(i, j) ** p + end do + factor_en = factor_en + aord_vect(1) * rescale_en(i, j) & + / (1 + aord_vect(2) * rescale_en(i, j)) + pow_ser + end do + end do +END_PROVIDER diff --git a/orders.irp.f b/orders.irp.f new file mode 100644 index 0000000..0cf61a1 --- /dev/null +++ b/orders.irp.f @@ -0,0 +1,53 @@ +BEGIN_PROVIDER [integer, naord] + implicit none + BEGIN_DOC + ! Expansion order for f_en + END_DOC + naord = 5 +END_PROVIDER + +BEGIN_PROVIDER [integer, nbord] + implicit none + BEGIN_DOC + ! Expansion order for f_ee + END_DOC + nbord = 5 +END_PROVIDER + +BEGIN_PROVIDER [integer, ncord] + implicit none + BEGIN_DOC + ! Expansion order for f_een + END_DOC + ncord = 5 +END_PROVIDER + +BEGIN_PROVIDER [double precision, aord_vect, (naord)] + implicit none + BEGIN_DOC + ! Vector of the `a' coefficients + END_DOC + do i = 1, naord + call random_number(aord_vect) + end do +END_PROVIDER + +BEGIN_PROVIDER [double precision, bord_vect, (nbord)] + implicit none + BEGIN_DOC + ! Vector of the `b' coefficients + END_DOC + do i = 1, nbord + call random_number(bord_vect) + end do +END_PROVIDER + +BEGIN_PROVIDER [double precision, cord_vect, (ncord)] + implicit none + BEGIN_DOC + ! Vector of the `b' coefficients + END_DOC + do i = 1, ncord + call random_number(cord_vect) + end do +END_PROVIDER diff --git a/rescale.irp.f b/rescale.irp.f new file mode 100644 index 0000000..b5e6a80 --- /dev/null +++ b/rescale.irp.f @@ -0,0 +1,41 @@ +BEGIN_PROVIDER [ double precision, kappa ] + implicit none + BEGIN_DOC + ! Constant in rescaling + END_DOC + kappa = 1.5d0 +END_PROVIDER + +BEGIN_PROVIDER [ double precision, kappa_inv ] + implicit none + BEGIN_DOC + ! inverse of kappa + END_DOC + kappa_inv = 1.d0/kappa +END_PROVIDER + +BEGIN_PROVIDER [ double precision, rescale_ee, (nelec, nelec) ] + implicit none + BEGIN_DOC + ! R = (1 - exp(-kappa r))/kappa for electron-electron + END_DOC + integer :: i, j + do j=1,nelec + do i=1,nelec + rescale_ee(i, j) = (1.d0 - dexp(-kappa * elec_dist(i, j))) * kappa_inv + enddo + enddo +END_PROVIDER + +BEGIN_PROVIDER [ double precision, rescale_en, (nelec, nnuc) ] + implicit none + BEGIN_DOC + ! R = (1 - exp(-kappa r))/kappa for electron-nucleus + END_DOC + integer :: i, j + do j = 1, nnuc + do i = 1, nelec + rescale_en(i,j) = (1.d0 - dexp(-kappa * elnuc_dist(i,j))) * kappa_inv + enddo + enddo +END_PROVIDER