mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-08-14 16:28:29 +02:00
Clean Cholesky MO
This commit is contained in:
parent
1b8e680c59
commit
b080a7a5e9
@ -17,12 +17,6 @@ interface: ezfio,provider,ocaml
|
|||||||
default: 1.e-15
|
default: 1.e-15
|
||||||
ezfio_name: threshold_mo
|
ezfio_name: threshold_mo
|
||||||
|
|
||||||
[no_vvvv_integrals]
|
|
||||||
type: logical
|
|
||||||
doc: If `True`, computes all integrals except for the integrals having 3 or 4 virtual indices
|
|
||||||
interface: ezfio,provider,ocaml
|
|
||||||
default: false
|
|
||||||
|
|
||||||
[io_mo_two_e_integrals_erf]
|
[io_mo_two_e_integrals_erf]
|
||||||
type: Disk_access
|
type: Disk_access
|
||||||
doc: Read/Write MO integrals with the long range interaction from/to disk [ Write | Read | None ]
|
doc: Read/Write MO integrals with the long range interaction from/to disk [ Write | Read | None ]
|
||||||
|
@ -68,7 +68,11 @@ BEGIN_PROVIDER [ double precision, cholesky_mo_transp, (cholesky_mo_num, mo_num,
|
|||||||
read(iunit) cholesky_mo_transp
|
read(iunit) cholesky_mo_transp
|
||||||
close(iunit)
|
close(iunit)
|
||||||
else
|
else
|
||||||
|
print *, ''
|
||||||
print *, 'AO->MO Transformation of Cholesky vectors'
|
print *, 'AO->MO Transformation of Cholesky vectors'
|
||||||
|
print *, '-----------------------------------------'
|
||||||
|
print *, ''
|
||||||
|
|
||||||
call wall_time(wall0)
|
call wall_time(wall0)
|
||||||
|
|
||||||
allocate(X(mo_num,cholesky_mo_num,ao_num), stat=ierr)
|
allocate(X(mo_num,cholesky_mo_num,ao_num), stat=ierr)
|
||||||
@ -87,7 +91,7 @@ BEGIN_PROVIDER [ double precision, cholesky_mo_transp, (cholesky_mo_num, mo_num,
|
|||||||
if (write_mo_cholesky) then
|
if (write_mo_cholesky) then
|
||||||
print *, 'Writing Cholesky MO vectors to disk...'
|
print *, 'Writing Cholesky MO vectors to disk...'
|
||||||
iunit = getUnitAndOpen(trim(ezfio_work_dir)//'cholesky_mo_transp', 'W')
|
iunit = getUnitAndOpen(trim(ezfio_work_dir)//'cholesky_mo_transp', 'W')
|
||||||
write(iunit) rank
|
write(iunit) cholesky_mo_num
|
||||||
write(iunit) cholesky_mo_transp
|
write(iunit) cholesky_mo_transp
|
||||||
close(iunit)
|
close(iunit)
|
||||||
call ezfio_set_mo_two_e_ints_io_mo_cholesky('Read')
|
call ezfio_set_mo_two_e_ints_io_mo_cholesky('Read')
|
||||||
|
@ -39,22 +39,10 @@ BEGIN_PROVIDER [ logical, mo_two_e_integrals_in_map ]
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if (.not. do_direct_integrals) then
|
|
||||||
PROVIDE ao_two_e_integrals_in_map
|
|
||||||
endif
|
|
||||||
|
|
||||||
print *, ''
|
|
||||||
print *, 'AO -> MO integrals transformation'
|
|
||||||
print *, '---------------------------------'
|
|
||||||
print *, ''
|
|
||||||
|
|
||||||
call wall_time(wall_1)
|
call wall_time(wall_1)
|
||||||
call cpu_time(cpu_1)
|
call cpu_time(cpu_1)
|
||||||
|
|
||||||
if(no_vvvv_integrals)then
|
if (do_mo_cholesky) then
|
||||||
call four_idx_novvvv_old
|
|
||||||
else
|
|
||||||
if (do_ao_cholesky) then
|
|
||||||
call add_integrals_to_map_cholesky
|
call add_integrals_to_map_cholesky
|
||||||
else
|
else
|
||||||
if (dble(ao_num)**4 * 32.d-9 < dble(qp_max_mem)) then
|
if (dble(ao_num)**4 * 32.d-9 < dble(qp_max_mem)) then
|
||||||
@ -63,7 +51,6 @@ BEGIN_PROVIDER [ logical, mo_two_e_integrals_in_map ]
|
|||||||
call add_integrals_to_map(full_ijkl_bitmask_4)
|
call add_integrals_to_map(full_ijkl_bitmask_4)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
call wall_time(wall_2)
|
call wall_time(wall_2)
|
||||||
call cpu_time(cpu_2)
|
call cpu_time(cpu_2)
|
||||||
@ -92,8 +79,15 @@ subroutine four_idx_dgemm
|
|||||||
double precision, allocatable :: a1(:,:,:,:)
|
double precision, allocatable :: a1(:,:,:,:)
|
||||||
double precision, allocatable :: a2(:,:,:,:)
|
double precision, allocatable :: a2(:,:,:,:)
|
||||||
|
|
||||||
|
PROVIDE ao_two_e_integrals_in_map mo_coef
|
||||||
|
|
||||||
|
print *, ''
|
||||||
|
print *, 'DGEMM-based AO->MO Transformation'
|
||||||
|
print *, '---------------------------------'
|
||||||
|
print *, ''
|
||||||
|
|
||||||
if (ao_num > 1289) then
|
if (ao_num > 1289) then
|
||||||
print *, irp_here, ': Integer overflow in ao_num**3'
|
print *, irp_here, ': Integer overflow in ao_num**3. Set do_ao_cholesky=.True.'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
allocate (a1(ao_num,ao_num,ao_num,ao_num))
|
allocate (a1(ao_num,ao_num,ao_num,ao_num))
|
||||||
@ -213,6 +207,12 @@ subroutine add_integrals_to_map(mask_ijkl)
|
|||||||
|
|
||||||
PROVIDE ao_two_e_integrals_in_map mo_coef
|
PROVIDE ao_two_e_integrals_in_map mo_coef
|
||||||
|
|
||||||
|
|
||||||
|
print *, ''
|
||||||
|
print *, 'Sparse AO->MO Transformation'
|
||||||
|
print *, '----------------------------'
|
||||||
|
print *, ''
|
||||||
|
|
||||||
!Get list of MOs for i,j,k and l
|
!Get list of MOs for i,j,k and l
|
||||||
!-------------------------------
|
!-------------------------------
|
||||||
|
|
||||||
@ -469,6 +469,7 @@ subroutine add_integrals_to_map_cholesky
|
|||||||
integer(key_kind) , allocatable :: buffer_i(:)
|
integer(key_kind) , allocatable :: buffer_i(:)
|
||||||
real(integral_kind), allocatable :: buffer_value(:)
|
real(integral_kind), allocatable :: buffer_value(:)
|
||||||
|
|
||||||
|
PROVIDE cholesky_mo_transp
|
||||||
call set_multiple_levels_omp(.False.)
|
call set_multiple_levels_omp(.False.)
|
||||||
|
|
||||||
!$OMP PARALLEL DEFAULT(SHARED) &
|
!$OMP PARALLEL DEFAULT(SHARED) &
|
||||||
|
@ -1,88 +0,0 @@
|
|||||||
|
|
||||||
subroutine four_idx_novvvv_old
|
|
||||||
use map_module
|
|
||||||
use bitmasks
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! Retransform MO integrals for next CAS-SCF step
|
|
||||||
END_DOC
|
|
||||||
integer(bit_kind) :: mask_ijkl(N_int,4)
|
|
||||||
integer(bit_kind) :: mask_ijk(N_int,3)
|
|
||||||
|
|
||||||
print*,'Using partial transformation'
|
|
||||||
print*,'It will not transform all integrals with at least 3 indices within the virtuals'
|
|
||||||
integer :: i,j,k,l
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I I I I !!!!!!!!!!!!!!!!!!!!
|
|
||||||
! (core+inact+act) ^ 4
|
|
||||||
! <ii|ii>
|
|
||||||
print*, ''
|
|
||||||
print*, '<ii|ii>'
|
|
||||||
do i = 1,N_int
|
|
||||||
mask_ijkl(i,1) = core_inact_act_bitmask_4(i,1)
|
|
||||||
mask_ijkl(i,2) = core_inact_act_bitmask_4(i,1)
|
|
||||||
mask_ijkl(i,3) = core_inact_act_bitmask_4(i,1)
|
|
||||||
mask_ijkl(i,4) = core_inact_act_bitmask_4(i,1)
|
|
||||||
enddo
|
|
||||||
call add_integrals_to_map(mask_ijkl)
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I I V V !!!!!!!!!!!!!!!!!!!!
|
|
||||||
! (core+inact+act) ^ 2 (virt) ^2
|
|
||||||
! <iv|iv> = J_iv
|
|
||||||
print*, ''
|
|
||||||
print*, '<iv|iv>'
|
|
||||||
do i = 1,N_int
|
|
||||||
mask_ijkl(i,1) = core_inact_act_bitmask_4(i,1)
|
|
||||||
mask_ijkl(i,2) = virt_bitmask(i,1)
|
|
||||||
mask_ijkl(i,3) = core_inact_act_bitmask_4(i,1)
|
|
||||||
mask_ijkl(i,4) = virt_bitmask(i,1)
|
|
||||||
enddo
|
|
||||||
call add_integrals_to_map(mask_ijkl)
|
|
||||||
|
|
||||||
! (core+inact+act) ^ 2 (virt) ^2
|
|
||||||
! <ii|vv> = (iv|iv)
|
|
||||||
print*, ''
|
|
||||||
print*, '<ii|vv>'
|
|
||||||
do i = 1,N_int
|
|
||||||
mask_ijkl(i,1) = core_inact_act_bitmask_4(i,1)
|
|
||||||
mask_ijkl(i,2) = core_inact_act_bitmask_4(i,1)
|
|
||||||
mask_ijkl(i,3) = virt_bitmask(i,1)
|
|
||||||
mask_ijkl(i,4) = virt_bitmask(i,1)
|
|
||||||
enddo
|
|
||||||
call add_integrals_to_map(mask_ijkl)
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! V V V !!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
! if(.not.no_vvv_integrals)then
|
|
||||||
print*, ''
|
|
||||||
print*, '<rv|sv> and <rv|vs>'
|
|
||||||
do i = 1,N_int
|
|
||||||
mask_ijk(i,1) = virt_bitmask(i,1)
|
|
||||||
mask_ijk(i,2) = virt_bitmask(i,1)
|
|
||||||
mask_ijk(i,3) = virt_bitmask(i,1)
|
|
||||||
enddo
|
|
||||||
call add_integrals_to_map_three_indices(mask_ijk)
|
|
||||||
! endif
|
|
||||||
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I I I V !!!!!!!!!!!!!!!!!!!!
|
|
||||||
! (core+inact+act) ^ 3 (virt) ^1
|
|
||||||
! <iv|ii>
|
|
||||||
print*, ''
|
|
||||||
print*, '<iv|ii>'
|
|
||||||
do i = 1,N_int
|
|
||||||
mask_ijkl(i,1) = core_inact_act_bitmask_4(i,1)
|
|
||||||
mask_ijkl(i,2) = core_inact_act_bitmask_4(i,1)
|
|
||||||
mask_ijkl(i,3) = core_inact_act_bitmask_4(i,1)
|
|
||||||
mask_ijkl(i,4) = virt_bitmask(i,1)
|
|
||||||
enddo
|
|
||||||
call add_integrals_to_map(mask_ijkl)
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I V V V !!!!!!!!!!!!!!!!!!!!
|
|
||||||
! (core+inact+act) ^ 1 (virt) ^3
|
|
||||||
! <iv|vv>
|
|
||||||
! if(.not.no_ivvv_integrals)then
|
|
||||||
print*, ''
|
|
||||||
print*, '<iv|vv>'
|
|
||||||
do i = 1,N_int
|
|
||||||
mask_ijkl(i,1) = core_inact_act_bitmask_4(i,1)
|
|
||||||
mask_ijkl(i,2) = virt_bitmask(i,1)
|
|
||||||
mask_ijkl(i,3) = virt_bitmask(i,1)
|
|
||||||
mask_ijkl(i,4) = virt_bitmask(i,1)
|
|
||||||
enddo
|
|
||||||
call add_integrals_to_map_no_exit_34(mask_ijkl)
|
|
||||||
end
|
|
Loading…
Reference in New Issue
Block a user