9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-22 03:23:29 +01:00

Fixed schwartz screening when integrals are read

This commit is contained in:
Michel Caffarel 2020-05-12 22:46:39 +02:00
parent a62456b238
commit 329bcf805b
7 changed files with 137 additions and 153 deletions

View File

@ -3,7 +3,6 @@ BEGIN_PROVIDER [ integer, ao_prim_num_max ]
BEGIN_DOC BEGIN_DOC
! Max number of primitives. ! Max number of primitives.
END_DOC END_DOC
print *, 'XXXX', irp_here
ao_prim_num_max = maxval(ao_prim_num) ao_prim_num_max = maxval(ao_prim_num)
END_PROVIDER END_PROVIDER
@ -20,7 +19,6 @@ END_PROVIDER
C_A(1) = 0.d0 C_A(1) = 0.d0
C_A(2) = 0.d0 C_A(2) = 0.d0
C_A(3) = 0.d0 C_A(3) = 0.d0
print *, 'XXXX', irp_here
ao_coef_normalized = 0.d0 ao_coef_normalized = 0.d0
do i=1,ao_num do i=1,ao_num
@ -67,7 +65,6 @@ BEGIN_PROVIDER [ double precision, ao_coef_normalization_libint_factor, (ao_num)
integer :: l, powA(3), nz integer :: l, powA(3), nz
integer :: i,j,k integer :: i,j,k
nz=100 nz=100
print *, 'XXXX', irp_here
C_A(1) = 0.d0 C_A(1) = 0.d0
C_A(2) = 0.d0 C_A(2) = 0.d0
C_A(3) = 0.d0 C_A(3) = 0.d0
@ -102,7 +99,6 @@ END_PROVIDER
integer :: iorder(ao_prim_num_max) integer :: iorder(ao_prim_num_max)
double precision :: d(ao_prim_num_max,2) double precision :: d(ao_prim_num_max,2)
integer :: i,j integer :: i,j
print *, 'XXXX', irp_here
do i=1,ao_num do i=1,ao_num
do j=1,ao_prim_num(i) do j=1,ao_prim_num(i)
iorder(j) = j iorder(j) = j
@ -125,7 +121,6 @@ BEGIN_PROVIDER [ double precision, ao_coef_normalized_ordered_transp, (ao_prim_n
! Transposed :c:data:`ao_coef_normalized_ordered` ! Transposed :c:data:`ao_coef_normalized_ordered`
END_DOC END_DOC
integer :: i,j integer :: i,j
print *, 'XXXX', irp_here
do j=1, ao_num do j=1, ao_num
do i=1, ao_prim_num_max do i=1, ao_prim_num_max
ao_coef_normalized_ordered_transp(i,j) = ao_coef_normalized_ordered(j,i) ao_coef_normalized_ordered_transp(i,j) = ao_coef_normalized_ordered(j,i)
@ -140,7 +135,6 @@ BEGIN_PROVIDER [ double precision, ao_expo_ordered_transp, (ao_prim_num_max,ao_n
! Transposed :c:data:`ao_expo_ordered` ! Transposed :c:data:`ao_expo_ordered`
END_DOC END_DOC
integer :: i,j integer :: i,j
print *, 'XXXX', irp_here
do j=1, ao_num do j=1, ao_num
do i=1, ao_prim_num_max do i=1, ao_prim_num_max
ao_expo_ordered_transp(i,j) = ao_expo_ordered(j,i) ao_expo_ordered_transp(i,j) = ao_expo_ordered(j,i)
@ -157,7 +151,6 @@ END_PROVIDER
! :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c` ! :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c`
END_DOC END_DOC
integer :: i integer :: i
print *, 'XXXX', irp_here
do i=1,ao_num do i=1,ao_num
ao_l(i) = ao_power(i,1) + ao_power(i,2) + ao_power(i,3) ao_l(i) = ao_power(i,1) + ao_power(i,2) + ao_power(i,3)
ao_l_char(i) = l_to_character(ao_l(i)) ao_l_char(i) = l_to_character(ao_l(i))
@ -174,7 +167,6 @@ integer function ao_power_index(nx,ny,nz)
! :math:`\frac{1}{2} (l-n_x) (l-n_x+1) + n_z + 1` ! :math:`\frac{1}{2} (l-n_x) (l-n_x+1) + n_z + 1`
END_DOC END_DOC
integer :: l integer :: l
print *, 'XXXX', irp_here
l = nx + ny + nz l = nx + ny + nz
ao_power_index = ((l-nx)*(l-nx+1))/2 + nz + 1 ao_power_index = ((l-nx)*(l-nx+1))/2 + nz + 1
end end
@ -185,7 +177,6 @@ BEGIN_PROVIDER [ character*(128), l_to_character, (0:7)]
! Character corresponding to the "l" value of an |AO| ! Character corresponding to the "l" value of an |AO|
END_DOC END_DOC
implicit none implicit none
print *, 'XXXX', irp_here
l_to_character(0)='s' l_to_character(0)='s'
l_to_character(1)='p' l_to_character(1)='p'
l_to_character(2)='d' l_to_character(2)='d'
@ -204,7 +195,6 @@ END_PROVIDER
! Number of |AOs| per atom ! Number of |AOs| per atom
END_DOC END_DOC
integer :: i integer :: i
print *, 'XXXX', irp_here
Nucl_N_Aos = 0 Nucl_N_Aos = 0
do i = 1, ao_num do i = 1, ao_num
Nucl_N_Aos(ao_nucl(i)) +=1 Nucl_N_Aos(ao_nucl(i)) +=1
@ -219,7 +209,6 @@ END_PROVIDER
END_DOC END_DOC
integer :: i integer :: i
integer, allocatable :: nucl_tmp(:) integer, allocatable :: nucl_tmp(:)
print *, 'XXXX', irp_here
allocate(nucl_tmp(nucl_num)) allocate(nucl_tmp(nucl_num))
nucl_tmp = 0 nucl_tmp = 0
Nucl_Aos = 0 Nucl_Aos = 0
@ -240,7 +229,6 @@ END_PROVIDER
! By convention, for p,d,f and g |AOs|, we take the index ! By convention, for p,d,f and g |AOs|, we take the index
! of the |AO| with the the corresponding power in the x axis ! of the |AO| with the the corresponding power in the x axis
END_DOC END_DOC
print *, 'XXXX', irp_here
do i = 1, nucl_num do i = 1, nucl_num
Nucl_num_shell_Aos(i) = 0 Nucl_num_shell_Aos(i) = 0
@ -288,7 +276,6 @@ BEGIN_PROVIDER [ character*(4), ao_l_char_space, (ao_num) ]
END_DOC END_DOC
integer :: i integer :: i
character*(4) :: give_ao_character_space character*(4) :: give_ao_character_space
print *, 'XXXX', irp_here
do i=1,ao_num do i=1,ao_num
if(ao_l(i)==0)then if(ao_l(i)==0)then

View File

@ -109,7 +109,6 @@ BEGIN_PROVIDER [ double precision, ao_overlap_abs,(ao_num,ao_num) ]
double precision :: A_center(3), B_center(3) double precision :: A_center(3), B_center(3)
integer :: power_A(3), power_B(3) integer :: power_A(3), power_B(3)
double precision :: lower_exp_val, dx double precision :: lower_exp_val, dx
print *, "XXX---", irp_here
if (is_periodic) then if (is_periodic) then
do j=1,ao_num do j=1,ao_num
do i= 1,ao_num do i= 1,ao_num

View File

@ -3,6 +3,8 @@ BEGIN_PROVIDER [ double precision, ao_integrals_n_e, (ao_num,ao_num)]
! Nucleus-electron interaction, in the |AO| basis set. ! Nucleus-electron interaction, in the |AO| basis set.
! !
! :math:`\langle \chi_i | -\sum_A \frac{1}{|r-R_A|} | \chi_j \rangle` ! :math:`\langle \chi_i | -\sum_A \frac{1}{|r-R_A|} | \chi_j \rangle`
!
! These integrals also contain the pseudopotential integrals.
END_DOC END_DOC
implicit none implicit none
double precision :: alpha, beta, gama, delta double precision :: alpha, beta, gama, delta
@ -75,12 +77,12 @@ BEGIN_PROVIDER [ double precision, ao_integrals_n_e, (ao_num,ao_num)]
!$OMP END DO !$OMP END DO
!$OMP END PARALLEL !$OMP END PARALLEL
endif
IF (DO_PSEUDO) THEN IF (DO_PSEUDO) THEN
ao_integrals_n_e += ao_pseudo_integrals ao_integrals_n_e += ao_pseudo_integrals
ENDIF ENDIF
endif
if (write_ao_integrals_n_e) then if (write_ao_integrals_n_e) then
call ezfio_set_ao_one_e_ints_ao_integrals_n_e(ao_integrals_n_e) call ezfio_set_ao_one_e_ints_ao_integrals_n_e(ao_integrals_n_e)

View File

@ -3,14 +3,11 @@ logical function ao_one_e_integral_zero(i,k)
integer, intent(in) :: i,k integer, intent(in) :: i,k
ao_one_e_integral_zero = .False. ao_one_e_integral_zero = .False.
if (.not.(read_ao_one_e_integrals.or.is_periodic)) then if (.not.((io_ao_integrals_overlap/='None').or.is_periodic)) then
if (ao_overlap_abs(i,k) < ao_integrals_threshold) then if (ao_overlap_abs(i,k) < ao_integrals_threshold) then
ao_one_e_integral_zero = .True. ao_one_e_integral_zero = .True.
return return
endif endif
endif endif
if (ao_two_e_integral_schwartz(i,k) < ao_integrals_threshold) then
ao_one_e_integral_zero = .True.
endif
end end

View File

@ -8,8 +8,8 @@ logical function ao_two_e_integral_zero(i,j,k,l)
ao_two_e_integral_zero = .True. ao_two_e_integral_zero = .True.
return return
endif endif
endif
if (ao_two_e_integral_schwartz(j,l)*ao_two_e_integral_schwartz(i,k) < ao_integrals_threshold) then if (ao_two_e_integral_schwartz(j,l)*ao_two_e_integral_schwartz(i,k) < ao_integrals_threshold) then
ao_two_e_integral_zero = .True. ao_two_e_integral_zero = .True.
endif endif
endif
end end

View File

@ -18,8 +18,7 @@ double precision function ao_two_e_integral(i,j,k,l)
if (ao_prim_num(i) * ao_prim_num(j) * ao_prim_num(k) * ao_prim_num(l) > 1024 ) then if (ao_prim_num(i) * ao_prim_num(j) * ao_prim_num(k) * ao_prim_num(l) > 1024 ) then
ao_two_e_integral = ao_two_e_integral_schwartz_accel(i,j,k,l) ao_two_e_integral = ao_two_e_integral_schwartz_accel(i,j,k,l)
return else
endif
dim1 = n_pt_max_integrals dim1 = n_pt_max_integrals
@ -101,6 +100,7 @@ double precision function ao_two_e_integral(i,j,k,l)
endif endif
endif
end end
double precision function ao_two_e_integral_schwartz_accel(i,j,k,l) double precision function ao_two_e_integral_schwartz_accel(i,j,k,l)
@ -350,8 +350,7 @@ BEGIN_PROVIDER [ logical, ao_two_e_integrals_in_map ]
call map_load_from_disk(trim(ezfio_filename)//'/work/ao_ints',ao_integrals_map) call map_load_from_disk(trim(ezfio_filename)//'/work/ao_ints',ao_integrals_map)
print*, 'AO integrals provided' print*, 'AO integrals provided'
ao_two_e_integrals_in_map = .True. ao_two_e_integrals_in_map = .True.
return else
endif
print*, 'Providing the AO integrals' print*, 'Providing the AO integrals'
call wall_time(wall_0) call wall_time(wall_0)
@ -417,6 +416,8 @@ BEGIN_PROVIDER [ logical, ao_two_e_integrals_in_map ]
call ezfio_set_ao_two_e_ints_io_ao_two_e_integrals('Read') call ezfio_set_ao_two_e_ints_io_ao_two_e_integrals('Read')
endif endif
endif
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [ double precision, ao_two_e_integral_schwartz,(ao_num,ao_num) ] BEGIN_PROVIDER [ double precision, ao_two_e_integral_schwartz,(ao_num,ao_num) ]

View File

@ -189,7 +189,6 @@ subroutine add_integrals_to_map(mask_ijkl)
two_e_tmp_2 = 0.d0 two_e_tmp_2 = 0.d0
do j1 = 1,ao_num do j1 = 1,ao_num
call get_ao_two_e_integrals(j1,k1,l1,ao_num,two_e_tmp_0(1,j1)) call get_ao_two_e_integrals(j1,k1,l1,ao_num,two_e_tmp_0(1,j1))
! call compute_ao_two_e_integrals(j1,k1,l1,ao_num,two_e_tmp_0(1,j1))
enddo enddo
do j1 = 1,ao_num do j1 = 1,ao_num
kmax = 0 kmax = 0
@ -747,7 +746,6 @@ subroutine add_integrals_to_map_no_exit_34(mask_ijkl)
two_e_tmp_2 = 0.d0 two_e_tmp_2 = 0.d0
do j1 = 1,ao_num do j1 = 1,ao_num
call get_ao_two_e_integrals(j1,k1,l1,ao_num,two_e_tmp_0(1,j1)) call get_ao_two_e_integrals(j1,k1,l1,ao_num,two_e_tmp_0(1,j1))
! call compute_ao_two_e_integrals(j1,k1,l1,ao_num,two_e_tmp_0(1,j1))
enddo enddo
do j1 = 1,ao_num do j1 = 1,ao_num
kmax = 0 kmax = 0