1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-11-07 14:43:41 +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('P_mo.qp',mo_pseudo_integrals)
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')
do l=1,mo_num

View File

@ -19,11 +19,11 @@ subroutine run
!
! Tmo.qp : kinetic energy integrals
!
! Smo.qp : overlap matrix
!
! Pmo.qp : pseudopotential integrals
!
! 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
!
@ -32,16 +32,20 @@ subroutine run
integer :: iunit
integer :: getunitandopen
integer ::i,j,k,l
integer :: i,j,k,l
double precision :: integral
double precision, allocatable :: A(:,:)
integer :: n_integrals
logical :: exists
integer(key_kind), allocatable :: buffer_i(:)
real(integral_kind), allocatable :: buffer_values(:)
allocate(buffer_i(mo_num**3), buffer_values(mo_num**3))
allocate (A(mo_num,mo_num))
PROVIDE mo_two_e_integrals_in_map
! Nuclear repulsion
A(1,1) = huge(1.d0)
iunit = getunitandopen('E.qp','r')
@ -53,6 +57,36 @@ subroutine run
call ezfio_set_nuclei_io_nuclear_repulsion('Read')
endif
! One-electron integrals
exists = .False.
inquire(file='Hmo.qp',exist=exists)
if (exists) then
A = 0.d0
i = 1
j = 1
iunit = getunitandopen('Hmo.qp','r')
do
read (iunit,*,end=8) i,j, integral
if (i<0 .or. i>mo_num) then
print *, i
stop 'i out of bounds in Hmo.qp'
endif
if (j<0 .or. j>mo_num) then
print *, j
stop 'j out of bounds in Hmo.qp'
endif
A(i,j) = integral
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
@ -116,6 +150,10 @@ subroutine run
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')
n_integrals=0
i = 1

View File

@ -158,10 +158,9 @@ subroutine run
enddo
TOUCH psi_bilinear_matrix
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
!!$OMP END DO
!!$OMP END PARALLEL
deallocate(U,D,V)
! !!!
end