10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-19 04:22:32 +01:00

fixed bug in laplacians

This commit is contained in:
Emmanuel Giner 2020-10-07 11:03:23 +02:00
parent ee267e27e9
commit 01b1ee3273
3 changed files with 27 additions and 49 deletions

View File

@ -121,42 +121,3 @@
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER[double precision, aos_lapl_in_r_array_transp, (n_points_final_grid,ao_num,3)]
implicit none
!
! aos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth ao on the ith grid point
!
! k = 1 : x, k= 2, y, k 3, z
integer :: i,j,m
do m = 1, 3
do i = 1, n_points_final_grid
do j = 1, ao_num
aos_lapl_in_r_array_transp(i,j,m) = aos_lapl_in_r_array(j,i,m)
enddo
enddo
enddo
END_PROVIDER
BEGIN_PROVIDER[double precision, aos_in_r_array_per_atom, (ao_num,n_pts_max_per_atom,nucl_num)]
&BEGIN_PROVIDER[double precision, aos_in_r_array_per_atom_transp, (n_pts_max_per_atom,ao_num,nucl_num)]
implicit none
BEGIN_DOC
! aos_in_r_array_per_atom(i,j,k) = value of the ith ao on the jth grid point attached on the kth atom
END_DOC
integer :: i,j,k
double precision :: aos_array(ao_num), r(3)
do k = 1, nucl_num
do i = 1, n_pts_per_atom(k)
r(1) = final_grid_points_per_atom(1,i,k)
r(2) = final_grid_points_per_atom(2,i,k)
r(3) = final_grid_points_per_atom(3,i,k)
call give_all_aos_at_r(r,aos_array)
do j = 1, ao_num
aos_in_r_array_per_atom(j,i,k) = aos_array(j)
aos_in_r_array_per_atom_transp(i,j,k) = aos_array(j)
enddo
enddo
enddo
END_PROVIDER

View File

@ -115,8 +115,6 @@
BEGIN_DOC BEGIN_DOC
! mos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith mo on the jth grid point ! mos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith mo on the jth grid point
! !
! mos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth mo on the ith grid point
!
! k = 1 : x, k= 2, y, k 3, z ! k = 1 : x, k= 2, y, k 3, z
END_DOC END_DOC
integer :: m integer :: m
@ -126,3 +124,22 @@
enddo enddo
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER[double precision, mos_lapl_in_r_array_tranp,(3,mo_num,n_points_final_grid)]
implicit none
BEGIN_DOC
! mos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplient of jth mo on the ith grid point
!
! k = 1 : x, k= 2, y, k 3, z
END_DOC
integer :: m
integer :: i,j
mos_lapl_in_r_array_tranp = 0.d0
do i = 1, n_points_final_grid
do j = 1, mo_num
do m = 1, 3
mos_lapl_in_r_array_tranp(m,j,i) = mos_lapl_in_r_array(j,i,m)
enddo
enddo
enddo
END_PROVIDER

View File

@ -33,9 +33,9 @@ subroutine give_all_mos_and_grad_and_lapl_at_r(r,mos_array,mos_grad_array,mos_la
implicit none implicit none
double precision, intent(in) :: r(3) double precision, intent(in) :: r(3)
double precision, intent(out) :: mos_array(mo_num) double precision, intent(out) :: mos_array(mo_num)
double precision, intent(out) :: mos_grad_array(mo_num,3),mos_lapl_array(mo_num,3) double precision, intent(out) :: mos_grad_array(3,mo_num),mos_lapl_array(3,mo_num)
integer :: i,j,k integer :: i,j,k
double precision :: aos_array(ao_num),aos_grad_array(ao_num,3),aos_lapl_array(ao_num,3) double precision :: aos_array(ao_num),aos_grad_array(3,ao_num),aos_lapl_array(3,ao_num)
call give_all_aos_and_grad_and_lapl_at_r(r,aos_array,aos_grad_array,aos_lapl_array) call give_all_aos_and_grad_and_lapl_at_r(r,aos_array,aos_grad_array,aos_lapl_array)
mos_array = 0.d0 mos_array = 0.d0
mos_grad_array = 0.d0 mos_grad_array = 0.d0
@ -43,12 +43,12 @@ subroutine give_all_mos_and_grad_and_lapl_at_r(r,mos_array,mos_grad_array,mos_la
do j = 1, mo_num do j = 1, mo_num
do k=1, ao_num do k=1, ao_num
mos_array(j) += mo_coef(k,j) * aos_array(k) mos_array(j) += mo_coef(k,j) * aos_array(k)
mos_grad_array(j,1) += mo_coef(k,j) * aos_grad_array(k,1) mos_grad_array(1,j) += mo_coef(k,j) * aos_grad_array(1,k)
mos_grad_array(j,2) += mo_coef(k,j) * aos_grad_array(k,2) mos_grad_array(2,j) += mo_coef(k,j) * aos_grad_array(2,k)
mos_grad_array(j,3) += mo_coef(k,j) * aos_grad_array(k,3) mos_grad_array(3,j) += mo_coef(k,j) * aos_grad_array(3,k)
mos_lapl_array(j,1) += mo_coef(k,j) * aos_lapl_array(k,1) mos_lapl_array(1,j) += mo_coef(k,j) * aos_lapl_array(1,k)
mos_lapl_array(j,2) += mo_coef(k,j) * aos_lapl_array(k,2) mos_lapl_array(2,j) += mo_coef(k,j) * aos_lapl_array(2,k)
mos_lapl_array(j,3) += mo_coef(k,j) * aos_lapl_array(k,3) mos_lapl_array(3,j) += mo_coef(k,j) * aos_lapl_array(3,k)
enddo enddo
enddo enddo
end end