10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-13 17:43:50 +01:00

working on 3->4

This commit is contained in:
Kevin Gasperich 2020-02-13 16:33:11 -06:00
parent 2cffbdcc9d
commit 07f09acd99
5 changed files with 65 additions and 61 deletions

View File

@ -116,6 +116,7 @@ subroutine ao_map_fill_from_df
do kl=1, kpt_num
do kj=1, kl
call idx2_tri_int(kj,kl,kjkl2)
print*,'kj,kl,kjkl2',kj,kl,kjkl2
ints_jl = df_ao_integrals_complex(:,:,:,kjkl2)
!$OMP PARALLEL PRIVATE(i,k,j,l,ki,kk,ii,ik,ij,il,kikk2,jl2,ik2, &
@ -142,12 +143,15 @@ subroutine ao_map_fill_from_df
ki=kconserv(kl,kk,kj)
if ((kl == kj) .and. (ki > kk)) cycle
call idx2_tri_int(ki,kk,kikk2)
print*,'ki,kk,kikk2',ki,kk,kikk2
if (kikk2 > kjkl2) cycle
if (ki >= kk) then
!if (ki < kk) then !this didn't fix the problem
do i_ao=1,ao_num_per_kpt
do j_ao=1,ao_num_per_kpt
do i_df=1,df_num
ints_ik(i_ao,j_ao,i_df) = dconjg(df_ao_integrals_complex(j_ao,i_ao,i_df,kikk2))
!ints_ik(j_ao,i_ao,i_df) = dconjg(df_ao_integrals_complex(j_ao,i_ao,i_df,kikk2))
enddo
enddo
enddo

View File

@ -78,12 +78,12 @@ ezfio.set_nuclei_nuclear_repulsion(nuclear_repulsion)
# Ao num
#ao_num = mo_num
ezfio.set_ao_basis_ao_basis("Dummy one. We read MO")
#ezfio.set_ao_basis_ao_basis("Dummy one. We read MO")
ezfio.set_ao_basis_ao_num(ao_num)
ezfio.set_ao_basis_ao_nucl([1]*ao_num) #Maybe put a realy incorrect stuff
#ezfio.set_ao_basis_ao_nucl([1]*ao_num) #Maybe put a realy incorrect stuff
#ezfio.set_ao_basis_ao_basis(qph5['ao_basis'].attrs['ao_basis'])
#ezfio.set_ao_basis_ao_nucl(qph5['ao_basis/ao_nucl'][()].tolist())
ezfio.set_ao_basis_ao_basis(qph5['ao_basis'].attrs['ao_basis'])
ezfio.set_ao_basis_ao_nucl(qph5['ao_basis/ao_nucl'][()].tolist())
#Just need one (can clean this up later)
@ -111,7 +111,7 @@ mo_coef_cmplx0 = np.stack((mo_coef_re0,mo_coef_im0),axis=-1).tolist()
ezfio.set_mo_basis_mo_coef_complex(mo_coef_cmplx0)
#maybe fix qp so we don't need this?
ezfio.set_mo_basis_mo_coef([[i for i in range(mo_num)] * ao_num])
#ezfio.set_mo_basis_mo_coef([[i for i in range(mo_num)] * ao_num])
ezfio.set_nuclei_is_complex(True)
@ -131,33 +131,21 @@ ne_ao_im0=qph5['ao_one_e_ints/ao_integrals_n_e_imag'][()].T
#test where to stack? (axis=0 or -1?)
ne_ao_cmplx0=np.stack((ne_ao_re0,ne_ao_im0),axis=-1).tolist()
kin_ao_re=kin_ao_re0.tolist()
kin_ao_im=kin_ao_im0.tolist()
ovlp_ao_re=ovlp_ao_re0.tolist()
ovlp_ao_im=ovlp_ao_im0.tolist()
ne_ao_re=ne_ao_re0.tolist()
ne_ao_im=ne_ao_im0.tolist()
#kin_ao_c = np.stack(kin_ao_re0,kin_ao_im0
#ezfio.set_ao_one_e_ints_ao_integrals_kinetic(kin_ao_re)
#ezfio.set_ao_one_e_ints_ao_integrals_kinetic_imag(kin_ao_im)
ezfio.set_ao_one_e_ints_ao_integrals_kinetic_complex(kin_ao_cmplx0)
#ezfio.set_ao_one_e_ints_ao_integrals_overlap(ovlp_ao_re)
#ezfio.set_ao_one_e_ints_ao_integrals_overlap_imag(ovlp_ao_im)
ezfio.set_ao_one_e_ints_ao_integrals_overlap_complex(ovlp_ao_cmplx0)
#ezfio.set_ao_one_e_ints_ao_integrals_n_e(ne_ao_re)
#ezfio.set_ao_one_e_ints_ao_integrals_n_e_imag(ne_ao_im)
ezfio.set_ao_one_e_ints_ao_integrals_n_e_complex(ne_ao_cmplx0)
ezfio.set_ao_one_e_ints_io_ao_integrals_kinetic('Read')
ezfio.set_ao_one_e_ints_io_ao_integrals_overlap('Read')
ezfio.set_ao_one_e_ints_io_ao_integrals_n_e('Read')
dfao_re0=qph5['ao_two_e_ints/df_ao_integrals_real'][()].transpose((3,2,1,0))
dfao_im0=qph5['ao_two_e_ints/df_ao_integrals_imag'][()].transpose((3,2,1,0))
#ezfio.set_ao_two_e_ints_df_ao_integrals_real(dfao_re.tolist())
#ezfio.set_ao_two_e_ints_df_ao_integrals_imag(dfao_im.tolist())
dfao_cmplx0 = np.stack((dfao_re0,dfao_im0),axis=-1).tolist()
ezfio.set_ao_two_e_ints_df_ao_integrals_complex(dfao_cmplx0)
ezfio.set_ao_two_e_ints_io_df_ao_integrals('Read')
#TODO: add check and only do this if ints exist

View File

@ -15,7 +15,7 @@ subroutine run
do k=1,ao_num
do l=1,ao_num
tmp_cmplx = get_ao_two_e_integral_complex(i,j,k,l,ao_integrals_map,ao_integrals_map_2)
print'(4(I4),2(E15.7))',i,j,k,l,tmp_cmplx
print'(4(I4),2(E23.15))',i,j,k,l,tmp_cmplx
enddo
enddo
enddo

View File

@ -0,0 +1,26 @@
program dump_df_ao
call run
end
subroutine run
use map_module
implicit none
integer ::i,j,k,mu
complex*16 :: integral
provide df_ao_integrals_complex
do k=1,kpt_pair_num
do mu=1,df_num
do i=1,ao_num_per_kpt
do j=1,ao_num_per_kpt
integral = df_ao_integrals_complex(i,j,mu,k)
if (cdabs(integral).gt.1.d-12) then
print'(4(I4),4(E15.7))',i,j,mu,k,integral,dble(integral),dimag(integral)
endif
enddo
enddo
enddo
enddo
end

View File

@ -11,7 +11,7 @@ subroutine run
integer ::i,j,k,l
double precision :: integral
double precision, allocatable :: A(:,:), B(:,:)
complex*16, allocatable :: C(:,:)
double precision :: tmp_re, tmp_im
integer :: n_integrals_1, n_integrals_2
@ -24,90 +24,76 @@ subroutine run
! call ezfio_set_ao_basis_ao_num(ao_num)
allocate (A(ao_num,ao_num), B(ao_num,ao_num) )
allocate (C(ao_num,ao_num))
A(1,1) = huge(1.d0)
integral = huge(1.d0)
iunit = getunitandopen('E.qp','r')
read (iunit,*,end=9) A(1,1)
read (iunit,*,end=9) integral
9 continue
close(iunit)
if (A(1,1) /= huge(1.d0)) then
call ezfio_set_nuclei_nuclear_repulsion(A(1,1))
if (integral /= huge(1.d0)) then
call ezfio_set_nuclei_nuclear_repulsion(integral)
call ezfio_set_nuclei_io_nuclear_repulsion("Read")
endif
A = 0.d0
B = 0.d0
C = (0.d0,0.d0)
iunit = getunitandopen('T.qp','r')
do
read (iunit,*,end=10) i,j, tmp_re, tmp_im
A(i,j) = tmp_re
B(i,j) = tmp_im
C(i,j) = dcmplx(tmp_re,tmp_im)
if (i.ne.j) then
A(j,i) = tmp_re
B(j,i) = -tmp_im
C(j,i) = dcmplx(tmp_re,-tmp_im)
endif
enddo
10 continue
close(iunit)
call ezfio_set_ao_one_e_ints_ao_integrals_kinetic(A(1:ao_num, 1:ao_num))
call ezfio_set_ao_one_e_ints_ao_integrals_kinetic_imag(B(1:ao_num, 1:ao_num))
call ezfio_set_ao_one_e_ints_ao_integrals_kinetic_complex(C)
call ezfio_set_ao_one_e_ints_io_ao_integrals_kinetic("Read")
A = 0.d0
B = 0.d0
C = (0.d0,0.d0)
iunit = getunitandopen('S.qp','r')
do
read (iunit,*,end=11) i,j, tmp_re, tmp_im
A(i,j) = tmp_re
B(i,j) = tmp_im
C(i,j) = dcmplx(tmp_re,tmp_im)
if (i.ne.j) then
A(j,i) = tmp_re
B(j,i) = -tmp_im
C(j,i) = dcmplx(tmp_re,-tmp_im)
endif
enddo
11 continue
close(iunit)
call ezfio_set_ao_one_e_ints_ao_integrals_overlap(A(1:ao_num, 1:ao_num))
call ezfio_set_ao_one_e_ints_ao_integrals_overlap_imag(B(1:ao_num, 1:ao_num))
call ezfio_set_ao_one_e_ints_ao_integrals_overlap_complex(C)
call ezfio_set_ao_one_e_ints_io_ao_integrals_overlap("Read")
A = 0.d0
B = 0.d0
C = (0.d0,0.d0)
iunit = getunitandopen('P.qp','r')
do
read (iunit,*,end=14) i,j, tmp_re, tmp_im
A(i,j) = tmp_re
B(i,j) = tmp_im
C(i,j) = dcmplx(tmp_re,tmp_im)
if (i.ne.j) then
A(j,i) = tmp_re
B(j,i) = -tmp_im
C(j,i) = dcmplx(tmp_re,-tmp_im)
endif
enddo
14 continue
close(iunit)
call ezfio_set_ao_one_e_ints_ao_integrals_pseudo(A(1:ao_num,1:ao_num))
call ezfio_set_ao_one_e_ints_ao_integrals_pseudo_imag(B(1:ao_num,1:ao_num))
call ezfio_set_ao_one_e_ints_ao_integrals_pseudo_complex(C)
call ezfio_set_ao_one_e_ints_io_ao_integrals_pseudo("Read")
A = 0.d0
B = 0.d0
C = (0.d0,0.d0)
iunit = getunitandopen('V.qp','r')
do
read (iunit,*,end=12) i,j, tmp_re, tmp_im
A(i,j) = tmp_re
B(i,j) = tmp_im
C(i,j) = dcmplx(tmp_re,tmp_im)
if (i.ne.j) then
A(j,i) = tmp_re
B(j,i) = -tmp_im
C(j,i) = dcmplx(tmp_re,-tmp_im)
endif
enddo
12 continue
close(iunit)
call ezfio_set_ao_one_e_ints_ao_integrals_n_e(A(1:ao_num, 1:ao_num))
call ezfio_set_ao_one_e_ints_ao_integrals_n_e_imag(B(1:ao_num, 1:ao_num))
call ezfio_set_ao_one_e_ints_ao_integrals_n_e_complex(C)
call ezfio_set_ao_one_e_ints_io_ao_integrals_n_e("Read")
deallocate(C)
allocate(buffer_i_1(ao_num**3), buffer_values_1(ao_num**3))
allocate(buffer_i_2(ao_num**3), buffer_values_2(ao_num**3))
iunit = getunitandopen('W.qp','r')