9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-23 20:13:42 +01:00
qp2/plugins/local/non_h_ints_mu/grad_squared.irp.f

126 lines
3.3 KiB
Fortran
Raw Normal View History

2023-02-06 19:00:35 +01:00
! ---
2024-01-15 12:02:38 +01:00
BEGIN_PROVIDER [double precision, grad12_j12, (ao_num, ao_num, n_points_final_grid)]
2023-03-17 19:23:07 +01:00
2023-02-06 19:00:35 +01:00
implicit none
integer :: ipoint, i, j, m, igauss
double precision :: r(3), delta, coef
double precision :: tmp1
double precision :: time0, time1
double precision, external :: overlap_gauss_r12_ao
print*, ' providing grad12_j12 ...'
call wall_time(time0)
2024-01-15 12:02:38 +01:00
PROVIDE int2_grad1u2_grad2u2_env2
2023-02-06 19:00:35 +01:00
2023-04-21 22:22:25 +02:00
do ipoint = 1, n_points_final_grid
2024-01-15 12:02:38 +01:00
tmp1 = env_val(ipoint)
2023-04-21 22:22:25 +02:00
tmp1 = tmp1 * tmp1
do j = 1, ao_num
do i = 1, ao_num
2024-01-15 12:02:38 +01:00
grad12_j12(i,j,ipoint) = tmp1 * int2_grad1u2_grad2u2_env2(i,j,ipoint)
2023-02-06 19:00:35 +01:00
enddo
enddo
2023-04-21 22:22:25 +02:00
enddo
2023-02-06 19:00:35 +01:00
2024-01-15 12:02:38 +01:00
FREE int2_grad1u2_grad2u2_env2
2023-02-06 19:00:35 +01:00
call wall_time(time1)
2024-01-15 12:02:38 +01:00
print*, ' Wall time for grad12_j12 (min) = ', (time1 - time0) / 60.d0
2023-02-06 19:00:35 +01:00
2023-03-17 19:23:07 +01:00
END_PROVIDER
2023-02-06 19:00:35 +01:00
! ---
2024-01-15 12:02:38 +01:00
BEGIN_PROVIDER [double precision, u12sq_envsq, (ao_num, ao_num, n_points_final_grid)]
2023-02-06 19:00:35 +01:00
implicit none
integer :: ipoint, i, j
double precision :: tmp_x, tmp_y, tmp_z
double precision :: tmp1
double precision :: time0, time1
2024-01-15 12:02:38 +01:00
print*, ' providing u12sq_envsq ...'
2023-02-06 19:00:35 +01:00
call wall_time(time0)
2023-06-01 19:59:25 +02:00
! do not free here
2024-01-15 12:02:38 +01:00
PROVIDE int2_u2_env2
2023-06-01 19:59:25 +02:00
2023-02-06 19:00:35 +01:00
do ipoint = 1, n_points_final_grid
2024-01-15 12:02:38 +01:00
tmp_x = env_grad(1,ipoint)
tmp_y = env_grad(2,ipoint)
tmp_z = env_grad(3,ipoint)
2023-02-06 19:00:35 +01:00
tmp1 = -0.5d0 * (tmp_x * tmp_x + tmp_y * tmp_y + tmp_z * tmp_z)
do j = 1, ao_num
do i = 1, ao_num
2024-01-15 12:02:38 +01:00
u12sq_envsq(i,j,ipoint) = tmp1 * int2_u2_env2(i,j,ipoint)
2023-02-06 19:00:35 +01:00
enddo
enddo
enddo
call wall_time(time1)
2024-01-15 12:02:38 +01:00
print*, ' Wall time for u12sq_envsq (min) = ', (time1 - time0) / 60.d0
2023-02-06 19:00:35 +01:00
2023-03-17 19:23:07 +01:00
END_PROVIDER
2023-02-06 19:00:35 +01:00
! ---
2024-01-15 12:02:38 +01:00
BEGIN_PROVIDER [double precision, u12_grad1_u12_env_grad1_env, (ao_num, ao_num, n_points_final_grid)]
2023-03-17 19:23:07 +01:00
2023-02-06 19:00:35 +01:00
implicit none
integer :: ipoint, i, j, m, igauss
double precision :: x, y, z
double precision :: tmp_v, tmp_x, tmp_y, tmp_z
double precision :: tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9
double precision :: time0, time1
double precision, external :: overlap_gauss_r12_ao
2024-01-15 12:02:38 +01:00
print*, ' providing u12_grad1_u12_env_grad1_env ...'
2023-02-06 19:00:35 +01:00
call wall_time(time0)
2024-01-15 12:02:38 +01:00
PROVIDE int2_u_grad1u_env2
PROVIDE int2_u_grad1u_x_env2
2023-06-01 19:59:25 +02:00
2023-02-06 19:00:35 +01:00
do ipoint = 1, n_points_final_grid
x = final_grid_points(1,ipoint)
y = final_grid_points(2,ipoint)
z = final_grid_points(3,ipoint)
2024-01-15 12:02:38 +01:00
tmp_v = env_val (ipoint)
tmp_x = env_grad(1,ipoint)
tmp_y = env_grad(2,ipoint)
tmp_z = env_grad(3,ipoint)
2023-02-06 19:00:35 +01:00
tmp3 = tmp_v * tmp_x
tmp4 = tmp_v * tmp_y
tmp5 = tmp_v * tmp_z
tmp6 = -x * tmp3
tmp7 = -y * tmp4
tmp8 = -z * tmp5
do j = 1, ao_num
do i = 1, ao_num
2024-01-15 12:02:38 +01:00
tmp9 = int2_u_grad1u_env2(i,j,ipoint)
2023-02-06 19:00:35 +01:00
2024-01-15 12:02:38 +01:00
u12_grad1_u12_env_grad1_env(i,j,ipoint) = tmp6 * tmp9 + tmp3 * int2_u_grad1u_x_env2(i,j,ipoint,1) &
+ tmp7 * tmp9 + tmp4 * int2_u_grad1u_x_env2(i,j,ipoint,2) &
+ tmp8 * tmp9 + tmp5 * int2_u_grad1u_x_env2(i,j,ipoint,3)
2023-02-06 19:00:35 +01:00
enddo
enddo
enddo
2024-01-15 12:02:38 +01:00
FREE int2_u_grad1u_env2
FREE int2_u_grad1u_x_env2
2023-02-06 19:00:35 +01:00
call wall_time(time1)
2024-01-15 12:02:38 +01:00
print*, ' Wall time for u12_grad1_u12_env_grad1_env (min) = ', (time1 - time0) / 60.d0
2023-02-06 19:00:35 +01:00
2023-03-17 19:23:07 +01:00
END_PROVIDER
2023-02-06 19:00:35 +01:00
! ---
2023-04-21 20:50:00 +02:00