10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-23 12:55:37 +01:00

cleaning up 2e ints; added placeholders for missing periodic functions

This commit is contained in:
Kevin Gasperich 2020-02-06 13:59:02 -06:00
parent a64be70911
commit df2295206f
3 changed files with 36 additions and 324 deletions

View File

@ -424,7 +424,9 @@ subroutine get_ao_two_e_integrals_non_zero_periodic(j,k,l,sze,out_val,out_val_in
end
!subroutine get_ao_two_e_integrals_non_zero_jl_periodic(j,l,thresh,sze_max,sze,out_val,out_val_index,non_zero_int)
subroutine get_ao_two_e_integrals_non_zero_jl_periodic(j,l,thresh,sze_max,sze,out_val,out_val_index,non_zero_int)
print*,'not implemented for periodic',irp_here
stop -1
! use map_module
! implicit none
! BEGIN_DOC
@ -469,11 +471,13 @@ end
! out_val(non_zero_int) = tmp
! enddo
! enddo
!
!end
end
!subroutine get_ao_two_e_integrals_non_zero_jl_from_list_periodic(j,l,thresh,list,n_list,sze_max,out_val,out_val_index,non_zero_int)
subroutine get_ao_two_e_integrals_non_zero_jl_from_list_periodic(j,l,thresh,list,n_list,sze_max,out_val,out_val_index,non_zero_int)
print*,'not implemented for periodic',irp_here
stop -1
! use map_module
! implicit none
! BEGIN_DOC
@ -520,8 +524,8 @@ end
! out_val_index(2,non_zero_int) = k
! out_val(non_zero_int) = tmp
! enddo
!
!end
end
subroutine insert_into_ao_integrals_map_2(n_integrals,buffer_i, buffer_values)
use map_module

View File

@ -851,313 +851,3 @@ subroutine add_integrals_to_map_no_exit_34_complex(mask_ijkl)
end
! BEGIN_PROVIDER [ double precision, mo_two_e_integral_jj_from_ao, (mo_num,mo_num) ]
!&BEGIN_PROVIDER [ double precision, mo_two_e_integrals_jj_exchange_from_ao, (mo_num,mo_num) ]
!&BEGIN_PROVIDER [ double precision, mo_two_e_integrals_jj_anti_from_ao, (mo_num,mo_num) ]
! implicit none
! BEGIN_DOC
! ! mo_two_e_integral_jj_from_ao(i,j) = J_ij
! ! mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij
! ! mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij
! END_DOC
!
! integer :: i,j,p,q,r,s
! double precision :: c
! real(integral_kind) :: integral
! integer :: n, pp
! real(integral_kind), allocatable :: int_value(:)
! integer, allocatable :: int_idx(:)
!
! double precision, allocatable :: iqrs(:,:), iqsr(:,:), iqis(:), iqri(:)
!
! if (.not.do_direct_integrals) then
! PROVIDE ao_two_e_integrals_in_map mo_coef
! endif
!
! mo_two_e_integral_jj_from_ao = 0.d0
! mo_two_e_integrals_jj_exchange_from_ao = 0.d0
!
! !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: iqrs, iqsr
!
!
! !$OMP PARALLEL DEFAULT(NONE) &
! !$OMP PRIVATE (i,j,p,q,r,s,integral,c,n,pp,int_value,int_idx, &
! !$OMP iqrs, iqsr,iqri,iqis) &
! !$OMP SHARED(mo_num,mo_coef_transp,ao_num, &
! !$OMP ao_integrals_threshold,do_direct_integrals) &
! !$OMP REDUCTION(+:mo_two_e_integral_jj_from_ao,mo_two_e_integrals_jj_exchange_from_ao)
!
! allocate( int_value(ao_num), int_idx(ao_num), &
! iqrs(mo_num,ao_num), iqis(mo_num), iqri(mo_num), &
! iqsr(mo_num,ao_num) )
!
! !$OMP DO SCHEDULE (guided)
! do s=1,ao_num
! do q=1,ao_num
!
! do j=1,ao_num
! do i=1,mo_num
! iqrs(i,j) = 0.d0
! iqsr(i,j) = 0.d0
! enddo
! enddo
!
! if (do_direct_integrals) then
! double precision :: ao_two_e_integral
! do r=1,ao_num
! call compute_ao_two_e_integrals(q,r,s,ao_num,int_value)
! do p=1,ao_num
! integral = int_value(p)
! if (abs(integral) > ao_integrals_threshold) then
! do i=1,mo_num
! iqrs(i,r) += mo_coef_transp(i,p) * integral
! enddo
! endif
! enddo
! call compute_ao_two_e_integrals(q,s,r,ao_num,int_value)
! do p=1,ao_num
! integral = int_value(p)
! if (abs(integral) > ao_integrals_threshold) then
! do i=1,mo_num
! iqsr(i,r) += mo_coef_transp(i,p) * integral
! enddo
! endif
! enddo
! enddo
!
! else
!
! do r=1,ao_num
! call get_ao_two_e_integrals_non_zero(q,r,s,ao_num,int_value,int_idx,n)
! do pp=1,n
! p = int_idx(pp)
! integral = int_value(pp)
! if (abs(integral) > ao_integrals_threshold) then
! do i=1,mo_num
! iqrs(i,r) += mo_coef_transp(i,p) * integral
! enddo
! endif
! enddo
! call get_ao_two_e_integrals_non_zero(q,s,r,ao_num,int_value,int_idx,n)
! do pp=1,n
! p = int_idx(pp)
! integral = int_value(pp)
! if (abs(integral) > ao_integrals_threshold) then
! do i=1,mo_num
! iqsr(i,r) += mo_coef_transp(i,p) * integral
! enddo
! endif
! enddo
! enddo
! endif
! iqis = 0.d0
! iqri = 0.d0
! do r=1,ao_num
! do i=1,mo_num
! iqis(i) += mo_coef_transp(i,r) * iqrs(i,r)
! iqri(i) += mo_coef_transp(i,r) * iqsr(i,r)
! enddo
! enddo
! do i=1,mo_num
! do j=1,mo_num
! c = mo_coef_transp(j,q)*mo_coef_transp(j,s)
! mo_two_e_integral_jj_from_ao(j,i) += c * iqis(i)
! mo_two_e_integrals_jj_exchange_from_ao(j,i) += c * iqri(i)
! enddo
! enddo
!
! enddo
! enddo
! !$OMP END DO NOWAIT
! deallocate(iqrs,iqsr,int_value,int_idx)
! !$OMP END PARALLEL
!
! mo_two_e_integrals_jj_anti_from_ao = mo_two_e_integral_jj_from_ao - mo_two_e_integrals_jj_exchange_from_ao
!
!
!END_PROVIDER
!
! BEGIN_PROVIDER [ double precision, mo_two_e_integrals_vv_from_ao, (mo_num,mo_num) ]
!&BEGIN_PROVIDER [ double precision, mo_two_e_integrals_vv_exchange_from_ao, (mo_num,mo_num) ]
!&BEGIN_PROVIDER [ double precision, mo_two_e_integrals_vv_anti_from_ao, (mo_num,mo_num) ]
! implicit none
! BEGIN_DOC
! ! mo_two_e_integrals_vv_from_ao(i,j) = J_ij
! ! mo_two_e_integrals_vv_exchange_from_ao(i,j) = J_ij
! ! mo_two_e_integrals_vv_anti_from_ao(i,j) = J_ij - K_ij
! ! but only for the virtual orbitals
! END_DOC
!
! integer :: i,j,p,q,r,s
! integer :: i0,j0
! double precision :: c
! real(integral_kind) :: integral
! integer :: n, pp
! real(integral_kind), allocatable :: int_value(:)
! integer, allocatable :: int_idx(:)
!
! double precision, allocatable :: iqrs(:,:), iqsr(:,:), iqis(:), iqri(:)
!
! if (.not.do_direct_integrals) then
! PROVIDE ao_two_e_integrals_in_map mo_coef
! endif
!
! mo_two_e_integrals_vv_from_ao = 0.d0
! mo_two_e_integrals_vv_exchange_from_ao = 0.d0
!
! !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: iqrs, iqsr
!
!
! !$OMP PARALLEL DEFAULT(NONE) &
! !$OMP PRIVATE (i0,j0,i,j,p,q,r,s,integral,c,n,pp,int_value,int_idx, &
! !$OMP iqrs, iqsr,iqri,iqis) &
! !$OMP SHARED(n_virt_orb,mo_num,list_virt,mo_coef_transp,ao_num, &
! !$OMP ao_integrals_threshold,do_direct_integrals) &
! !$OMP REDUCTION(+:mo_two_e_integrals_vv_from_ao,mo_two_e_integrals_vv_exchange_from_ao)
!
! allocate( int_value(ao_num), int_idx(ao_num), &
! iqrs(mo_num,ao_num), iqis(mo_num), iqri(mo_num),&
! iqsr(mo_num,ao_num) )
!
! !$OMP DO SCHEDULE (guided)
! do s=1,ao_num
! do q=1,ao_num
!
! do j=1,ao_num
! do i0=1,n_virt_orb
! i = list_virt(i0)
! iqrs(i,j) = 0.d0
! iqsr(i,j) = 0.d0
! enddo
! enddo
!
! if (do_direct_integrals) then
! double precision :: ao_two_e_integral
! do r=1,ao_num
! call compute_ao_two_e_integrals(q,r,s,ao_num,int_value)
! do p=1,ao_num
! integral = int_value(p)
! if (abs(integral) > ao_integrals_threshold) then
! do i0=1,n_virt_orb
! i = list_virt(i0)
! iqrs(i,r) += mo_coef_transp(i,p) * integral
! enddo
! endif
! enddo
! call compute_ao_two_e_integrals(q,s,r,ao_num,int_value)
! do p=1,ao_num
! integral = int_value(p)
! if (abs(integral) > ao_integrals_threshold) then
! do i0=1,n_virt_orb
! i =list_virt(i0)
! iqsr(i,r) += mo_coef_transp(i,p) * integral
! enddo
! endif
! enddo
! enddo
!
! else
!
! do r=1,ao_num
! call get_ao_two_e_integrals_non_zero(q,r,s,ao_num,int_value,int_idx,n)
! do pp=1,n
! p = int_idx(pp)
! integral = int_value(pp)
! if (abs(integral) > ao_integrals_threshold) then
! do i0=1,n_virt_orb
! i =list_virt(i0)
! iqrs(i,r) += mo_coef_transp(i,p) * integral
! enddo
! endif
! enddo
! call get_ao_two_e_integrals_non_zero(q,s,r,ao_num,int_value,int_idx,n)
! do pp=1,n
! p = int_idx(pp)
! integral = int_value(pp)
! if (abs(integral) > ao_integrals_threshold) then
! do i0=1,n_virt_orb
! i = list_virt(i0)
! iqsr(i,r) += mo_coef_transp(i,p) * integral
! enddo
! endif
! enddo
! enddo
! endif
! iqis = 0.d0
! iqri = 0.d0
! do r=1,ao_num
! do i0=1,n_virt_orb
! i = list_virt(i0)
! iqis(i) += mo_coef_transp(i,r) * iqrs(i,r)
! iqri(i) += mo_coef_transp(i,r) * iqsr(i,r)
! enddo
! enddo
! do i0=1,n_virt_orb
! i= list_virt(i0)
! do j0=1,n_virt_orb
! j = list_virt(j0)
! c = mo_coef_transp(j,q)*mo_coef_transp(j,s)
! mo_two_e_integrals_vv_from_ao(j,i) += c * iqis(i)
! mo_two_e_integrals_vv_exchange_from_ao(j,i) += c * iqri(i)
! enddo
! enddo
!
! enddo
! enddo
! !$OMP END DO NOWAIT
! deallocate(iqrs,iqsr,int_value,int_idx)
! !$OMP END PARALLEL
!
! mo_two_e_integrals_vv_anti_from_ao = mo_two_e_integrals_vv_from_ao - mo_two_e_integrals_vv_exchange_from_ao
! ! print*, '**********'
! ! do i0 =1, n_virt_orb
! ! i = list_virt(i0)
! ! print*, mo_two_e_integrals_vv_from_ao(i,i)
! ! enddo
! ! print*, '**********'
!
!
!END_PROVIDER
!
!
! BEGIN_PROVIDER [ double precision, mo_two_e_integrals_jj, (mo_num,mo_num) ]
!&BEGIN_PROVIDER [ double precision, mo_two_e_integrals_jj_exchange, (mo_num,mo_num) ]
!&BEGIN_PROVIDER [ double precision, mo_two_e_integrals_jj_anti, (mo_num,mo_num) ]
! implicit none
! BEGIN_DOC
! ! mo_two_e_integrals_jj(i,j) = J_ij
! ! mo_two_e_integrals_jj_exchange(i,j) = K_ij
! ! mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij
! END_DOC
!
! integer :: i,j
! double precision :: get_two_e_integral
!
! PROVIDE mo_two_e_integrals_in_map
! mo_two_e_integrals_jj = 0.d0
! mo_two_e_integrals_jj_exchange = 0.d0
!
! do j=1,mo_num
! do i=1,mo_num
! mo_two_e_integrals_jj(i,j) = get_two_e_integral(i,j,i,j,mo_integrals_map)
! mo_two_e_integrals_jj_exchange(i,j) = get_two_e_integral(i,j,j,i,mo_integrals_map)
! mo_two_e_integrals_jj_anti(i,j) = mo_two_e_integrals_jj(i,j) - mo_two_e_integrals_jj_exchange(i,j)
! enddo
! enddo
!
!END_PROVIDER
!
!
!subroutine clear_mo_map
! implicit none
! BEGIN_DOC
! ! Frees the memory of the MO map
! END_DOC
! call map_deinit(mo_integrals_map)
! FREE mo_integrals_map mo_two_e_integrals_jj mo_two_e_integrals_jj_anti
! FREE mo_two_e_integrals_jj_exchange mo_two_e_integrals_in_map
!end
!

View File

@ -30,28 +30,46 @@ MO 2e ints:
mapping:
changed so that all real ints (Jij, Kij, Jii) are in map2
<ij|ij>, <ij|ji>, <ii|ii>
some places in code assume that map1 ints can be real
(can remove once we are sure we like this mapping)
translational symmetry:
kconserv array gives quartets <ij|kl> which are symmetry-allowed
k_i + k_j = k_k + k_l
I + J = K + L
kconserv(I,J,K)=L
TODO:
symmetry
add provider for kconserv
restructure arrays?
mo coef and mo 1e ints already separate from real part of code (easy to add extra dimension)
ao 1e ints could also be handled in same way as mo 1e ints
ao_ints
ao_overlap_abs for complex
ao_integrals_n_e_per_atom_complex?
not implemented for periodic:
ao_one_e_ints
ao_overlap_abs for complex? <abs(i)|abs(j)> vs abs(<i|j>)
ao_integrals_n_e_per_atom_complex (should be simple, but currently we only use dummy nuclei)
ao_two_e_ints (todo)
get_ao_two_e_integrals_non_zero_periodic
get_ao_two_e_integrals_non_zero_jl_periodic
get_ao_two_e_integrals_non_zero_jl_from_list_periodic
mo_two_e_ints (todo)
get_mo_two_e_integrals_ij_periodic
add_integrals_to_map_complex
add_integrals_to_map_three_indices_complex
add_integrals_to_map_no_exit_34_complex
later:
calculation of pbc integrals in QP
ao_two_e_integral
ao_two_e_integral_schwartz_accel
compute_ao_two_e_integrals
[ double precision, ao_two_e_integral_schwartz,(ao_num,ao_num) ]
compute_ao_integrals_jl
...
mo_two_e_ints
incomplete
NOTES: