9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2025-04-26 10:14:45 +02:00

ao_cart_two_e_ints compiles

This commit is contained in:
eginer 2025-04-25 12:27:43 +02:00
parent 6695444367
commit 77bc5143f5
5 changed files with 27 additions and 88 deletions

View File

@ -1,6 +1,6 @@
hamiltonian hamiltonian
ao_one_e_ints ao_one_e_ints
pseudo pseudo
bitmask
ao_basis ao_basis
two_e_ints_keywords two_e_ints_keywords
electrons

View File

@ -12,7 +12,7 @@ double precision function get_ao_cart$_erf_integ_chol(i,j,k,l)
end end
BEGIN_PROVIDER [ double precision, cholesky_ao_cart$_erf_transp, (cholesky_ao$_erf_cart_num, ao_cart_num, ao_cart_num) ] BEGIN_PROVIDER [ double precision, cholesky_ao_cart$_erf_transp, (cholesky_ao_cart$_erf_num, ao_cart_num, ao_cart_num) ]
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! Transposed of the Cholesky vectors in AO basis set ! Transposed of the Cholesky vectors in AO basis set
@ -86,14 +86,14 @@ END_PROVIDER
call wall_time(wall0) call wall_time(wall0)
! Will be reallocated at the end ! Will be reallocated at the end
deallocate(cholesky_ao) deallocate(cholesky_ao_cart$_erf)
if (read_ao_cart$_erf_cholesky) then if (read_ao_cart$_erf_cholesky) then
print *, 'Reading Cholesky AO$_erf vectors from disk...' print *, 'Reading Cholesky AO$_erf vectors from disk...'
iunit = getUnitAndOpen(trim(ezfio_work_dir)//'cholesky_ao_cart$_erf', 'R') iunit = getUnitAndOpen(trim(ezfio_work_dir)//'cholesky_ao_cart$_erf', 'R')
read(iunit) rank read(iunit) rank
allocate(cholesky_ao(ao_cart_num,ao_cart_num,rank), stat=ierr) allocate(cholesky_ao_cart$_erf(ao_cart_num,ao_cart_num,rank), stat=ierr)
read(iunit) cholesky_ao read(iunit) cholesky_ao_cart$_erf
close(iunit) close(iunit)
cholesky_ao_cart$_erf_num = rank cholesky_ao_cart$_erf_num = rank
@ -429,7 +429,7 @@ END_PROVIDER
deallocate( addr1, addr2, Delta_col, computed ) deallocate( addr1, addr2, Delta_col, computed )
allocate(cholesky_ao(ao_cart_num,ao_cart_num,rank), stat=ierr) allocate(cholesky_ao_cart$_erf(ao_cart_num,ao_cart_num,rank), stat=ierr)
if (ierr /= 0) then if (ierr /= 0) then
call print_memory_usage() call print_memory_usage()
@ -442,7 +442,7 @@ END_PROVIDER
!$OMP PARALLEL DO PRIVATE(k,j) !$OMP PARALLEL DO PRIVATE(k,j)
do k=1,rank do k=1,rank
do j=1,ao_cart_num do j=1,ao_cart_num
cholesky_ao(1:ao_cart_num,j,k) = L((j-1_8)*ao_cart_num+1_8:1_8*j*ao_cart_num,rank-k+1) cholesky_ao_cart$_erf(1:ao_cart_num,j,k) = L((j-1_8)*ao_cart_num+1_8:1_8*j*ao_cart_num,rank-k+1)
enddo enddo
enddo enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
@ -453,9 +453,9 @@ END_PROVIDER
if (write_ao_cart$_erf_cholesky) then if (write_ao_cart$_erf_cholesky) then
print *, 'Writing Cholesky AO$_erf vectors to disk...' print *, 'Writing Cholesky AO$_erf vectors to disk...'
iunit = getUnitAndOpen(trim(ezfio_work_dir)//'cholesky_ao_cart', 'W') iunit = getUnitAndOpen(trim(ezfio_work_dir)//'cholesky_ao_cart$_erf', 'W')
write(iunit) rank write(iunit) rank
write(iunit) cholesky_ao_cart write(iunit) cholesky_ao_cart$_erf
close(iunit) close(iunit)
call ezfio_set_ao_cart_two_e_ints_io_ao_cart$_erf_cholesky('Read') call ezfio_set_ao_cart_two_e_ints_io_ao_cart$_erf_cholesky('Read')
endif endif

View File

@ -1,4 +1,3 @@
! --- ! ---
logical function do_schwartz_accel(i,j,k,l) logical function do_schwartz_accel(i,j,k,l)
@ -360,41 +359,6 @@ integer function ao_cart_l4(i,j,k,l)
ao_cart_l4 = ao_cart_l(i)*ao_cart_l(j)*ao_cart_l(k)*ao_cart_l(l) ao_cart_l4 = ao_cart_l(i)*ao_cart_l(j)*ao_cart_l(k)*ao_cart_l(l)
end end
subroutine compute_ao_cart_two_e_integrals(j,k,l,sze,buffer_value)
implicit none
BEGIN_DOC
! Compute AO 1/r12 integrals for all i and fixed j,k,l
END_DOC
include 'utils/constants.include.F'
integer, intent(in) :: j,k,l,sze
real(integral_kind), intent(out) :: buffer_value(sze)
double precision :: ao_cart_two_e_integral
integer :: i
logical, external :: ao_cart_one_e_integral_zero
logical, external :: ao_cart_two_e_integral_zero
if (ao_cart_one_e_integral_zero(j,l)) then
buffer_value = 0._integral_kind
return
endif
do i = 1, ao_cart_num
if (ao_cart_two_e_integral_zero(i,j,k,l)) then
buffer_value(i) = 0._integral_kind
cycle
endif
!DIR$ FORCEINLINE
buffer_value(i) = ao_cart_two_e_integral(i,k,j,l)
enddo
end
BEGIN_PROVIDER [ double precision, ao_cart_two_e_integral_schwartz, (ao_cart_num, ao_cart_num) ] BEGIN_PROVIDER [ double precision, ao_cart_two_e_integral_schwartz, (ao_cart_num, ao_cart_num) ]
BEGIN_DOC BEGIN_DOC

View File

@ -276,48 +276,6 @@ double precision function ao_cart_two_e_integral_schwartz_accel_erf(i,j,k,l)
end end
subroutine compute_ao_cart_two_e_integrals_erf(j,k,l,sze,buffer_value)
implicit none
use map_module
BEGIN_DOC
! Compute AO 1/r12 integrals for all i and fixed j,k,l
END_DOC
include 'utils/constants.include.F'
integer, intent(in) :: j,k,l,sze
real(integral_kind), intent(out) :: buffer_value(sze)
double precision :: ao_cart_two_e_integral_erf
integer :: i
logical, external :: ao_cart_one_e_integral_zero
logical, external :: ao_cart_two_e_integral_zero
if (ao_cart_one_e_integral_zero(j,l)) then
buffer_value = 0._integral_kind
return
endif
if (ao_cart_two_e_integral_erf_schwartz(j,l) < thresh ) then
buffer_value = 0._integral_kind
return
endif
do i = 1, ao_cart_num
if (ao_cart_two_e_integral_zero(i,j,k,l)) then
buffer_value(i) = 0._integral_kind
cycle
endif
if (ao_cart_two_e_integral_erf_schwartz(i,k)*ao_cart_two_e_integral_erf_schwartz(j,l) < thresh ) then
buffer_value(i) = 0._integral_kind
cycle
endif
!DIR$ FORCEINLINE
buffer_value(i) = ao_cart_two_e_integral_erf(i,k,j,l)
enddo
end
double precision function general_primitive_integral_erf(dim, & double precision function general_primitive_integral_erf(dim, &
P_new,P_center,fact_p,p,p_inv,iorder_p, & P_new,P_center,fact_p,p,p_inv,iorder_p, &
Q_new,Q_center,fact_q,q,q_inv,iorder_q) Q_new,Q_center,fact_q,q,q_inv,iorder_q)

View File

@ -11,7 +11,6 @@ doc: If | (ii|jj) | < `ao_cholesky_threshold` then (ii|jj) is zero
interface: ezfio,provider,ocaml interface: ezfio,provider,ocaml
default: 1.e-12 default: 1.e-12
[do_ao_cholesky] [do_ao_cholesky]
type: logical type: logical
doc: Perform Cholesky decomposition of AO integrals doc: Perform Cholesky decomposition of AO integrals
@ -23,3 +22,21 @@ type: logical
doc: If true, use only the long range part of the two-electron integrals instead of 1/r12 doc: If true, use only the long range part of the two-electron integrals instead of 1/r12
interface: ezfio, provider, ocaml interface: ezfio, provider, ocaml
default: False default: False
[io_ao_cart_cholesky]
type: Disk_access
doc: Read/Write |AO| Cholesky integrals from/to disk [ Write | Read | None ]
interface: ezfio,provider,ocaml
default: None
[io_ao_cart_erf_cholesky]
type: Disk_access
doc: Read/Write |AO| Cholesky ERF integrals from/to disk [ Write | Read | None ]
interface: ezfio,provider,ocaml
default: None
[io_ao_cart_cgtos_cholesky]
type: Disk_access
doc: Read/Write |AO| Cholesky CGTOS integrals from/to disk [ Write | Read | None ]
interface: ezfio,provider,ocaml
default: None