1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-11-07 22:53:42 +01:00

Merge branch 'master' of gitlab.com:scemama/qp_plugins_scemama

This commit is contained in:
Anthony Scemama 2021-03-17 14:01:00 +01:00
commit 564ac4b089
3 changed files with 31 additions and 22 deletions

View File

@ -63,6 +63,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,31 +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 : core hamiltonian. If hmo exists, the other 1-e files are not read ! Hmo.qp : core hamiltonian. If hmo exists, the other 1-e files are not read
! !
! 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')
@ -55,31 +57,35 @@ subroutine run
call ezfio_set_nuclei_io_nuclear_repulsion('Read') call ezfio_set_nuclei_io_nuclear_repulsion('Read')
endif endif
logical :: exists ! One-electron integrals
inquire(file='hmo.qp',exist=exists)
exists = .False.
inquire(file='Hmo.qp',exist=exists)
if (exists) then if (exists) then
A = 0.d0 A = 0.d0
i = 1 i = 1
j = 1 j = 1
iunit = getunitandopen('hmo.qp','r') iunit = getunitandopen('Hmo.qp','r')
do while(.true.) do
read (iunit,*,end=23) i,j, integral read (iunit,*,end=8) i,j, integral
if (i<0 .or. i>mo_num) then if (i<0 .or. i>mo_num) then
print *, i print *, i
stop 'i out of bounds in hmo.qp' stop 'i out of bounds in Hmo.qp'
endif endif
if (j<0 .or. j>mo_num) then if (j<0 .or. j>mo_num) then
print *, j print *, j
stop 'j out of bounds in hmo.qp' stop 'j out of bounds in Hmo.qp'
endif endif
A(i,j) = integral A(i,j) = integral
enddo enddo
23 continue 8 continue
close(iunit) close(iunit)
call ezfio_set_mo_one_e_ints_mo_one_e_integrals(A) 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') call ezfio_set_mo_one_e_ints_io_mo_one_e_integrals('Read')
else else
A = 0.d0 A = 0.d0
i = 1 i = 1
j = 1 j = 1
@ -143,7 +149,10 @@ subroutine run
call ezfio_set_mo_one_e_ints_mo_integrals_n_e(A) 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') call ezfio_set_mo_one_e_ints_io_mo_integrals_n_e('Read')
endif 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