10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-22 20:34:58 +01:00

Building mo cache from cholesky

This commit is contained in:
Anthony Scemama 2024-06-10 17:36:14 +02:00
parent 7e1ed69eef
commit bd534589e1
2 changed files with 43 additions and 26 deletions

View File

@ -59,6 +59,26 @@ BEGIN_PROVIDER [ double precision, mo_integrals_cache, (0_8:128_8*128_8*128_8*12
integer(key_kind) :: idx integer(key_kind) :: idx
real(integral_kind) :: integral real(integral_kind) :: integral
FREE ao_integrals_cache FREE ao_integrals_cache
if (do_mo_cholesky) then
call set_multiple_levels_omp(.False.)
!$OMP PARALLEL DO PRIVATE (k,l,ii)
do l=mo_integrals_cache_min_8,mo_integrals_cache_max_8
do k=mo_integrals_cache_min_8,mo_integrals_cache_max_8
ii = l-mo_integrals_cache_min_8
ii = ior( shiftl(ii,7), k-mo_integrals_cache_min_8)
ii = shiftl(ii,14)
call dgemm('T','N', mo_integrals_cache_max-mo_integrals_cache_min+1, &
mo_integrals_cache_max-mo_integrals_cache_min+1, &
cholesky_mo_num, 1.d0, &
cholesky_mo_transp(1,mo_integrals_cache_min,k), cholesky_mo_num, &
cholesky_mo_transp(1,mo_integrals_cache_min,l), cholesky_mo_num, 0.d0, &
mo_integrals_cache(ii), 128)
enddo
enddo
!$OMP END PARALLEL DO
else
!$OMP PARALLEL DO PRIVATE (i,j,k,l,i4,j4,k4,l4,idx,ii,integral) !$OMP PARALLEL DO PRIVATE (i,j,k,l,i4,j4,k4,l4,idx,ii,integral)
do l=mo_integrals_cache_min_8,mo_integrals_cache_max_8 do l=mo_integrals_cache_min_8,mo_integrals_cache_max_8
l4 = int(l,4) l4 = int(l,4)
@ -82,6 +102,7 @@ BEGIN_PROVIDER [ double precision, mo_integrals_cache, (0_8:128_8*128_8*128_8*12
enddo enddo
enddo enddo
!$OMP END PARALLEL DO !$OMP END PARALLEL DO
endif
END_PROVIDER END_PROVIDER
@ -119,16 +140,13 @@ double precision function get_two_e_integral(i,j,k,l,map)
ii = ior(ii, j-mo_integrals_cache_min) ii = ior(ii, j-mo_integrals_cache_min)
ii = ior(ii, i-mo_integrals_cache_min) ii = ior(ii, i-mo_integrals_cache_min)
! if (iand(ii, -128) /= 0) then if (iand(ii, -128) /= 0) then
if (.True.) then
! Integral is not in the cache ! Integral is not in the cache
if (do_mo_cholesky) then if (do_mo_cholesky) then
get_two_e_integral = 0.d0 double precision, external :: ddot
do kk=1,cholesky_mo_num get_two_e_integral = ddot(cholesky_mo_num, cholesky_mo_transp(1,i,k), 1, cholesky_mo_transp(1,j,l), 1)
get_two_e_integral = get_two_e_integral + cholesky_mo_transp(kk,i,k) * cholesky_mo_transp(kk,j,l)
enddo
else else
! Integrals is in the map ! Integrals is in the map

View File

@ -16,7 +16,6 @@
! - 1,2,3-index arrays are built from the map ! - 1,2,3-index arrays are built from the map
! !
! TODO: ! TODO:
! - build cache map from cholesky vectors
! - get_mo_integrals using cholesky ! - get_mo_integrals using cholesky
! - get_mo_integralss using cholesky ! - get_mo_integralss using cholesky
! - get_mo_integralss in PT2 ! - get_mo_integralss in PT2