10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-18 20:12:57 +01:00
QuantumPackage/plugins/local/jastrow/listj1b.irp.f

372 lines
9.5 KiB
Fortran
Raw Normal View History

! ---
2024-01-15 12:02:38 +01:00
BEGIN_PROVIDER [integer, List_env1s_size]
implicit none
2024-01-15 12:02:38 +01:00
PROVIDE env_type
2023-05-07 15:07:51 +02:00
2024-01-16 23:10:44 +01:00
if(env_type .eq. "None") then
List_env1s_size = 1
elseif(env_type .eq. "Prod_Gauss") then
2023-05-07 15:07:51 +02:00
2024-01-15 12:02:38 +01:00
List_env1s_size = 2**nucl_num
2023-05-07 15:07:51 +02:00
2024-01-16 19:07:20 +01:00
elseif(env_type .eq. "Sum_Gauss") then
2023-05-07 15:07:51 +02:00
2024-01-15 12:02:38 +01:00
List_env1s_size = nucl_num + 1
2023-05-07 15:07:51 +02:00
else
2024-01-15 12:02:38 +01:00
print *, ' Error in List_env1s_size: Unknown env_type = ', env_type
2023-05-07 15:07:51 +02:00
stop
endif
2024-01-15 12:02:38 +01:00
print *, ' nb of 1s-Gaussian in the envelope = ', List_env1s_size
END_PROVIDER
! ---
2024-01-15 12:02:38 +01:00
BEGIN_PROVIDER [integer, List_env1s, (nucl_num, List_env1s_size)]
implicit none
integer :: i, j
if(nucl_num .gt. 32) then
print *, ' nucl_num = ', nucl_num, '> 32'
stop
endif
2024-01-15 12:02:38 +01:00
List_env1s = 0
2024-01-15 12:02:38 +01:00
do i = 0, List_env1s_size-1
do j = 0, nucl_num-1
if (btest(i,j)) then
2024-01-15 12:02:38 +01:00
List_env1s(j+1,i+1) = 1
endif
enddo
enddo
END_PROVIDER
! ---
2024-01-15 12:02:38 +01:00
BEGIN_PROVIDER [ double precision, List_env1s_coef, ( List_env1s_size)]
&BEGIN_PROVIDER [ double precision, List_env1s_expo, ( List_env1s_size)]
&BEGIN_PROVIDER [ double precision, List_env1s_cent, (3, List_env1s_size)]
implicit none
integer :: i, j, k, phase
double precision :: tmp_alphaj, tmp_alphak
double precision :: tmp_cent_x, tmp_cent_y, tmp_cent_z
2024-01-15 12:02:38 +01:00
provide env_type env_expo env_coef
2024-01-16 23:10:44 +01:00
if(env_type .eq. "None") then
List_env1s_coef( 1) = 1.d0
List_env1s_expo( 1) = 0.d0
List_env1s_cent(1:3,1) = 0.d0
2024-01-16 23:10:44 +01:00
elseif(env_type .eq. "Prod_Gauss") then
List_env1s_coef = 0.d0
List_env1s_expo = 0.d0
List_env1s_cent = 0.d0
2024-01-15 12:02:38 +01:00
do i = 1, List_env1s_size
2023-05-07 15:07:51 +02:00
tmp_cent_x = 0.d0
tmp_cent_y = 0.d0
tmp_cent_z = 0.d0
do j = 1, nucl_num
2024-01-15 12:02:38 +01:00
tmp_alphaj = dble(List_env1s(j,i)) * env_expo(j)
List_env1s_expo(i) += tmp_alphaj
2023-05-07 15:07:51 +02:00
tmp_cent_x += tmp_alphaj * nucl_coord(j,1)
tmp_cent_y += tmp_alphaj * nucl_coord(j,2)
tmp_cent_z += tmp_alphaj * nucl_coord(j,3)
enddo
2024-01-15 12:02:38 +01:00
if(List_env1s_expo(i) .lt. 1d-10) cycle
2023-05-07 15:07:51 +02:00
2024-01-15 12:02:38 +01:00
List_env1s_cent(1,i) = tmp_cent_x / List_env1s_expo(i)
List_env1s_cent(2,i) = tmp_cent_y / List_env1s_expo(i)
List_env1s_cent(3,i) = tmp_cent_z / List_env1s_expo(i)
2023-05-07 15:07:51 +02:00
enddo
2023-05-07 15:07:51 +02:00
! ---
2024-01-15 12:02:38 +01:00
do i = 1, List_env1s_size
2023-05-07 15:07:51 +02:00
do j = 2, nucl_num, 1
2024-01-15 12:02:38 +01:00
tmp_alphaj = dble(List_env1s(j,i)) * env_expo(j)
2023-05-07 15:07:51 +02:00
do k = 1, j-1, 1
2024-01-15 12:02:38 +01:00
tmp_alphak = dble(List_env1s(k,i)) * env_expo(k)
2024-01-15 12:02:38 +01:00
List_env1s_coef(i) += tmp_alphaj * tmp_alphak * ( (nucl_coord(j,1) - nucl_coord(k,1)) * (nucl_coord(j,1) - nucl_coord(k,1)) &
2023-05-07 15:07:51 +02:00
+ (nucl_coord(j,2) - nucl_coord(k,2)) * (nucl_coord(j,2) - nucl_coord(k,2)) &
+ (nucl_coord(j,3) - nucl_coord(k,3)) * (nucl_coord(j,3) - nucl_coord(k,3)) )
enddo
enddo
2023-05-07 15:07:51 +02:00
2024-01-15 12:02:38 +01:00
if(List_env1s_expo(i) .lt. 1d-10) cycle
2023-05-07 15:07:51 +02:00
2024-01-15 12:02:38 +01:00
List_env1s_coef(i) = List_env1s_coef(i) / List_env1s_expo(i)
enddo
2023-05-07 15:07:51 +02:00
! ---
2024-01-15 12:02:38 +01:00
do i = 1, List_env1s_size
2023-05-07 15:07:51 +02:00
phase = 0
do j = 1, nucl_num
2024-01-15 12:02:38 +01:00
phase += List_env1s(j,i)
2023-05-07 15:07:51 +02:00
enddo
2024-01-15 12:02:38 +01:00
List_env1s_coef(i) = (-1.d0)**dble(phase) * dexp(-List_env1s_coef(i))
2023-05-07 15:07:51 +02:00
enddo
2024-01-16 19:07:20 +01:00
elseif(env_type .eq. "Sum_Gauss") then
2023-05-07 15:07:51 +02:00
2024-01-15 12:02:38 +01:00
List_env1s_coef( 1) = 1.d0
List_env1s_expo( 1) = 0.d0
List_env1s_cent(1:3,1) = 0.d0
2023-05-07 15:07:51 +02:00
do i = 1, nucl_num
2024-01-15 12:02:38 +01:00
List_env1s_coef( i+1) = -1.d0 * env_coef(i)
List_env1s_expo( i+1) = env_expo(i)
List_env1s_cent(1,i+1) = nucl_coord(i,1)
List_env1s_cent(2,i+1) = nucl_coord(i,2)
List_env1s_cent(3,i+1) = nucl_coord(i,3)
enddo
2023-05-07 15:07:51 +02:00
else
2024-01-15 12:02:38 +01:00
print *, ' Error in List_env1s: Unknown env_type = ', env_type
2023-05-07 15:07:51 +02:00
stop
endif
END_PROVIDER
! ---
2024-01-15 12:02:38 +01:00
BEGIN_PROVIDER [integer, List_env1s_square_size]
implicit none
2023-05-07 15:07:51 +02:00
double precision :: tmp
2024-01-16 23:10:44 +01:00
if(env_type .eq. "None") then
List_env1s_square_size = 1
elseif(env_type .eq. "Prod_Gauss") then
2023-05-07 15:07:51 +02:00
2024-01-15 12:02:38 +01:00
List_env1s_square_size = 3**nucl_num
2023-05-07 15:07:51 +02:00
2024-01-16 19:07:20 +01:00
elseif(env_type .eq. "Sum_Gauss") then
2023-05-07 15:07:51 +02:00
tmp = 0.5d0 * dble(nucl_num) * (dble(nucl_num) + 3.d0)
2024-01-15 12:02:38 +01:00
List_env1s_square_size = int(tmp) + 1
2023-05-07 15:07:51 +02:00
else
2024-01-15 12:02:38 +01:00
print *, ' Error in List_env1s_square_size: Unknown env_type = ', env_type
2023-05-07 15:07:51 +02:00
stop
endif
2024-01-15 12:02:38 +01:00
print *, ' nb of 1s-Gaussian in the square of envelope = ', List_env1s_square_size
END_PROVIDER
! ---
2024-01-15 12:02:38 +01:00
BEGIN_PROVIDER [integer, List_env1s_square, (nucl_num, List_env1s_square_size)]
implicit none
integer :: i, j, ii, jj
integer, allocatable :: M(:,:), p(:)
if(nucl_num .gt. 32) then
print *, ' nucl_num = ', nucl_num, '> 32'
stop
endif
2024-01-15 12:02:38 +01:00
List_env1s_square(:,:) = 0
List_env1s_square(:,List_env1s_square_size) = 2
allocate(p(nucl_num))
p = 0
2024-01-15 12:02:38 +01:00
do i = 2, List_env1s_square_size-1
do j = 1, nucl_num
ii = 0
do jj = 1, j-1, 1
ii = ii + p(jj) * 3**(jj-1)
enddo
p(j) = modulo(i-1-ii, 3**j) / 3**(j-1)
2024-01-15 12:02:38 +01:00
List_env1s_square(j,i) = p(j)
enddo
enddo
END_PROVIDER
! ---
2024-01-15 12:02:38 +01:00
BEGIN_PROVIDER [ double precision, List_env1s_square_coef, ( List_env1s_square_size)]
&BEGIN_PROVIDER [ double precision, List_env1s_square_expo, ( List_env1s_square_size)]
&BEGIN_PROVIDER [ double precision, List_env1s_square_cent, (3, List_env1s_square_size)]
implicit none
integer :: i, j, k, phase
2023-05-07 15:07:51 +02:00
integer :: ii
double precision :: tmp_alphaj, tmp_alphak, facto
2023-05-07 15:07:51 +02:00
double precision :: tmp1, tmp2, tmp3, tmp4
double precision :: xi, yi, zi, xj, yj, zj
double precision :: dx, dy, dz, r2
2024-01-15 12:02:38 +01:00
provide env_type env_expo env_coef
2024-01-16 23:10:44 +01:00
if(env_type .eq. "None") then
List_env1s_square_coef( 1) = 1.d0
List_env1s_square_expo( 1) = 0.d0
List_env1s_square_cent(1:3,1) = 0.d0
elseif(env_type .eq. "Prod_Gauss") then
2024-01-16 23:10:44 +01:00
List_env1s_square_coef = 0.d0
List_env1s_square_expo = 0.d0
List_env1s_square_cent = 0.d0
2024-01-15 12:02:38 +01:00
do i = 1, List_env1s_square_size
2023-05-07 15:07:51 +02:00
do j = 1, nucl_num
2024-01-15 12:02:38 +01:00
tmp_alphaj = dble(List_env1s_square(j,i)) * env_expo(j)
List_env1s_square_expo(i) += tmp_alphaj
List_env1s_square_cent(1,i) += tmp_alphaj * nucl_coord(j,1)
List_env1s_square_cent(2,i) += tmp_alphaj * nucl_coord(j,2)
List_env1s_square_cent(3,i) += tmp_alphaj * nucl_coord(j,3)
2023-05-07 15:07:51 +02:00
enddo
2024-01-15 12:02:38 +01:00
if(List_env1s_square_expo(i) .lt. 1d-10) cycle
2023-05-07 15:07:51 +02:00
2024-01-15 12:02:38 +01:00
List_env1s_square_cent(1,i) = List_env1s_square_cent(1,i) / List_env1s_square_expo(i)
List_env1s_square_cent(2,i) = List_env1s_square_cent(2,i) / List_env1s_square_expo(i)
List_env1s_square_cent(3,i) = List_env1s_square_cent(3,i) / List_env1s_square_expo(i)
enddo
2023-05-07 15:07:51 +02:00
! ---
2024-01-15 12:02:38 +01:00
do i = 1, List_env1s_square_size
2023-05-07 15:07:51 +02:00
do j = 2, nucl_num, 1
2024-01-15 12:02:38 +01:00
tmp_alphaj = dble(List_env1s_square(j,i)) * env_expo(j)
2023-05-07 15:07:51 +02:00
do k = 1, j-1, 1
2024-01-15 12:02:38 +01:00
tmp_alphak = dble(List_env1s_square(k,i)) * env_expo(k)
2023-05-07 15:07:51 +02:00
2024-01-15 12:02:38 +01:00
List_env1s_square_coef(i) += tmp_alphaj * tmp_alphak * ( (nucl_coord(j,1) - nucl_coord(k,1)) * (nucl_coord(j,1) - nucl_coord(k,1)) &
2023-05-07 15:07:51 +02:00
+ (nucl_coord(j,2) - nucl_coord(k,2)) * (nucl_coord(j,2) - nucl_coord(k,2)) &
+ (nucl_coord(j,3) - nucl_coord(k,3)) * (nucl_coord(j,3) - nucl_coord(k,3)) )
enddo
enddo
2024-01-15 12:02:38 +01:00
if(List_env1s_square_expo(i) .lt. 1d-10) cycle
2023-05-07 15:07:51 +02:00
2024-01-15 12:02:38 +01:00
List_env1s_square_coef(i) = List_env1s_square_coef(i) / List_env1s_square_expo(i)
2023-05-07 15:07:51 +02:00
enddo
2023-05-07 15:07:51 +02:00
! ---
2024-01-15 12:02:38 +01:00
do i = 1, List_env1s_square_size
2023-05-07 15:07:51 +02:00
facto = 1.d0
phase = 0
do j = 1, nucl_num
2024-01-15 12:02:38 +01:00
tmp_alphaj = dble(List_env1s_square(j,i))
2023-05-07 15:07:51 +02:00
facto *= 2.d0 / (gamma(tmp_alphaj+1.d0) * gamma(3.d0-tmp_alphaj))
2024-01-15 12:02:38 +01:00
phase += List_env1s_square(j,i)
enddo
2023-05-07 15:07:51 +02:00
2024-01-15 12:02:38 +01:00
List_env1s_square_coef(i) = (-1.d0)**dble(phase) * facto * dexp(-List_env1s_square_coef(i))
enddo
2024-01-16 19:07:20 +01:00
elseif(env_type .eq. "Sum_Gauss") then
2023-05-07 15:07:51 +02:00
ii = 1
2024-01-15 12:02:38 +01:00
List_env1s_square_coef( ii) = 1.d0
List_env1s_square_expo( ii) = 0.d0
List_env1s_square_cent(1:3,ii) = 0.d0
2023-05-07 15:07:51 +02:00
do i = 1, nucl_num
ii = ii + 1
2024-01-15 12:02:38 +01:00
List_env1s_square_coef( ii) = -2.d0 * env_coef(i)
List_env1s_square_expo( ii) = env_expo(i)
List_env1s_square_cent(1,ii) = nucl_coord(i,1)
List_env1s_square_cent(2,ii) = nucl_coord(i,2)
List_env1s_square_cent(3,ii) = nucl_coord(i,3)
2023-05-07 15:07:51 +02:00
enddo
2023-05-07 15:07:51 +02:00
do i = 1, nucl_num
ii = ii + 1
2024-01-15 12:02:38 +01:00
List_env1s_square_coef( ii) = 1.d0 * env_coef(i) * env_coef(i)
List_env1s_square_expo( ii) = 2.d0 * env_expo(i)
List_env1s_square_cent(1,ii) = nucl_coord(i,1)
List_env1s_square_cent(2,ii) = nucl_coord(i,2)
List_env1s_square_cent(3,ii) = nucl_coord(i,3)
2023-05-07 15:07:51 +02:00
enddo
2023-05-07 15:07:51 +02:00
do i = 1, nucl_num-1
2024-01-15 12:02:38 +01:00
tmp1 = env_expo(i)
2023-05-07 15:07:51 +02:00
xi = nucl_coord(i,1)
yi = nucl_coord(i,2)
zi = nucl_coord(i,3)
do j = i+1, nucl_num
2024-01-15 12:02:38 +01:00
tmp2 = env_expo(j)
2023-05-07 15:07:51 +02:00
tmp3 = tmp1 + tmp2
tmp4 = 1.d0 / tmp3
xj = nucl_coord(j,1)
yj = nucl_coord(j,2)
zj = nucl_coord(j,3)
dx = xi - xj
dy = yi - yj
dz = zi - zj
r2 = dx*dx + dy*dy + dz*dz
ii = ii + 1
! x 2 to avoid doing integrals twice
2024-01-15 12:02:38 +01:00
List_env1s_square_coef( ii) = 2.d0 * dexp(-tmp1*tmp2*tmp4*r2) * env_coef(i) * env_coef(j)
List_env1s_square_expo( ii) = tmp3
List_env1s_square_cent(1,ii) = tmp4 * (tmp1 * xi + tmp2 * xj)
List_env1s_square_cent(2,ii) = tmp4 * (tmp1 * yi + tmp2 * yj)
List_env1s_square_cent(3,ii) = tmp4 * (tmp1 * zi + tmp2 * zj)
2023-05-07 15:07:51 +02:00
enddo
enddo
2023-05-07 15:07:51 +02:00
else
2024-01-15 12:02:38 +01:00
print *, ' Error in List_env1s_square: Unknown env_type = ', env_type
2023-05-07 15:07:51 +02:00
stop
endif
END_PROVIDER
! ---