1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-12-22 12:23:37 +01:00

Added Hmo.qp

This commit is contained in:
Anthony Scemama 2021-03-12 13:13:49 +01:00
parent 8371b5318f
commit 2399a3ecaa
3 changed files with 110 additions and 72 deletions

View File

@ -61,6 +61,7 @@ subroutine run
call write_2d('T_mo.qp',mo_kinetic_integrals) call write_2d('T_mo.qp',mo_kinetic_integrals)
call write_2d('P_mo.qp',mo_pseudo_integrals) call write_2d('P_mo.qp',mo_pseudo_integrals)
call write_2d('V_mo.qp',mo_integrals_n_e) call write_2d('V_mo.qp',mo_integrals_n_e)
call write_2d('H_mo.qp',mo_one_e_integrals)
iunit = getunitandopen('W_mo.qp','w') iunit = getunitandopen('W_mo.qp','w')
do l=1,mo_num do l=1,mo_num

View File

@ -19,29 +19,33 @@ subroutine run
! !
! Tmo.qp : kinetic energy integrals ! Tmo.qp : kinetic energy integrals
! !
! Smo.qp : overlap matrix
!
! Pmo.qp : pseudopotential integrals ! Pmo.qp : pseudopotential integrals
! !
! Vmo.qp : electron-nucleus potential ! Vmo.qp : electron-nucleus potential
! Hmo.qp : one-electron integrals. If Hmo is present, don't try to read V,P,T
! !
! Wmo.qp : electron repulsion integrals ! Wmo.qp : electron repulsion integrals
! !
END_DOC END_DOC
integer :: iunit integer :: iunit
integer :: getunitandopen integer :: getunitandopen
integer ::i,j,k,l integer :: i,j,k,l
double precision :: integral double precision :: integral
double precision, allocatable :: A(:,:) double precision, allocatable :: A(:,:)
integer :: n_integrals integer :: n_integrals
integer(key_kind), allocatable :: buffer_i(:) logical :: exists
integer(key_kind), allocatable :: buffer_i(:)
real(integral_kind), allocatable :: buffer_values(:) real(integral_kind), allocatable :: buffer_values(:)
allocate(buffer_i(mo_num**3), buffer_values(mo_num**3)) allocate(buffer_i(mo_num**3), buffer_values(mo_num**3))
allocate (A(mo_num,mo_num)) allocate (A(mo_num,mo_num))
PROVIDE mo_two_e_integrals_in_map
! Nuclear repulsion
A(1,1) = huge(1.d0) A(1,1) = huge(1.d0)
iunit = getunitandopen('E.qp','r') iunit = getunitandopen('E.qp','r')
@ -53,68 +57,102 @@ subroutine run
call ezfio_set_nuclei_io_nuclear_repulsion('Read') call ezfio_set_nuclei_io_nuclear_repulsion('Read')
endif endif
A = 0.d0
i = 1
j = 1
iunit = getunitandopen('Tmo.qp','r')
do
read (iunit,*,end=10) i,j, integral
if (i<0 .or. i>mo_num) then
print *, i
stop 'i out of bounds in Tmo.qp'
endif
if (j<0 .or. j>mo_num) then
print *, j
stop 'j out of bounds in Tmo.qp'
endif
A(i,j) = integral
enddo
10 continue
close(iunit)
call ezfio_set_mo_one_e_ints_mo_integrals_kinetic(A)
call ezfio_set_mo_one_e_ints_io_mo_integrals_kinetic('Read')
A = 0.d0 ! One-electron integrals
i = 1
j = 1
iunit = getunitandopen('Pmo.qp','r')
do
read (iunit,*,end=14) i,j, integral
if (i<0 .or. i>mo_num) then
print *, i
stop 'i out of bounds in Pmo.qp'
endif
if (j<0 .or. j>mo_num) then
print *, j
stop 'j out of bounds in Pmo.qp'
endif
A(i,j) = integral
enddo
14 continue
close(iunit)
call ezfio_set_mo_one_e_ints_mo_integrals_pseudo(A)
call ezfio_set_mo_one_e_ints_io_mo_integrals_pseudo('Read')
A = 0.d0 exists = .False.
i = 1 inquire(file='Hmo.qp',exist=exists)
j = 1 if (exists) then
iunit = getunitandopen('Vmo.qp','r')
do A = 0.d0
read (iunit,*,end=12) i,j, integral i = 1
if (i<0 .or. i>mo_num) then j = 1
print *, i iunit = getunitandopen('Hmo.qp','r')
stop 'i out of bounds in Vmo.qp' do
endif read (iunit,*,end=8) i,j, integral
if (j<0 .or. j>mo_num) then if (i<0 .or. i>mo_num) then
print *, j print *, i
stop 'j out of bounds in Vmo.qp' stop 'i out of bounds in Hmo.qp'
endif endif
A(i,j) = integral if (j<0 .or. j>mo_num) then
enddo print *, j
12 continue stop 'j out of bounds in Hmo.qp'
close(iunit) endif
call ezfio_set_mo_one_e_ints_mo_integrals_n_e(A) A(i,j) = integral
call ezfio_set_mo_one_e_ints_io_mo_integrals_n_e('Read') enddo
8 continue
close(iunit)
call ezfio_set_mo_one_e_ints_mo_one_e_integrals(A)
call ezfio_set_mo_one_e_ints_io_mo_one_e_integrals('Read')
else
A = 0.d0
i = 1
j = 1
iunit = getunitandopen('Tmo.qp','r')
do
read (iunit,*,end=10) i,j, integral
if (i<0 .or. i>mo_num) then
print *, i
stop 'i out of bounds in Tmo.qp'
endif
if (j<0 .or. j>mo_num) then
print *, j
stop 'j out of bounds in Tmo.qp'
endif
A(i,j) = integral
enddo
10 continue
close(iunit)
call ezfio_set_mo_one_e_ints_mo_integrals_kinetic(A)
call ezfio_set_mo_one_e_ints_io_mo_integrals_kinetic('Read')
A = 0.d0
i = 1
j = 1
iunit = getunitandopen('Pmo.qp','r')
do
read (iunit,*,end=14) i,j, integral
if (i<0 .or. i>mo_num) then
print *, i
stop 'i out of bounds in Pmo.qp'
endif
if (j<0 .or. j>mo_num) then
print *, j
stop 'j out of bounds in Pmo.qp'
endif
A(i,j) = integral
enddo
14 continue
close(iunit)
call ezfio_set_mo_one_e_ints_mo_integrals_pseudo(A)
call ezfio_set_mo_one_e_ints_io_mo_integrals_pseudo('Read')
A = 0.d0
i = 1
j = 1
iunit = getunitandopen('Vmo.qp','r')
do
read (iunit,*,end=12) i,j, integral
if (i<0 .or. i>mo_num) then
print *, i
stop 'i out of bounds in Vmo.qp'
endif
if (j<0 .or. j>mo_num) then
print *, j
stop 'j out of bounds in Vmo.qp'
endif
A(i,j) = integral
enddo
12 continue
close(iunit)
call ezfio_set_mo_one_e_ints_mo_integrals_n_e(A)
call ezfio_set_mo_one_e_ints_io_mo_integrals_n_e('Read')
end if
! Two-electron integrals
iunit = getunitandopen('Wmo.qp','r') iunit = getunitandopen('Wmo.qp','r')
n_integrals=0 n_integrals=0

View File

@ -158,10 +158,9 @@ subroutine run
enddo enddo
TOUCH psi_bilinear_matrix TOUCH psi_bilinear_matrix
call update_wf_of_psi_bilinear_matrix(.False.) call update_wf_of_psi_bilinear_matrix(.False.)
print*, r, PSI_energy(1) + nuclear_repulsion !CI_energy(1) print*, r, PSI_energy(1) + nuclear_repulsion, s2_values(1) !CI_energy(1)
call save_wavefunction()
enddo enddo
!!$OMP END DO
!!$OMP END PARALLEL
deallocate(U,D,V) deallocate(U,D,V)
! !!! ! !!!
end end