Add plugings to read the Molecular integrals

This commit is contained in:
TApplencourt 2017-05-08 16:38:51 +00:00
parent 414aa32463
commit 7a455d8fd6
5 changed files with 158 additions and 0 deletions

View File

@ -0,0 +1 @@
Integrals_Monoelec Integrals_Bielec

View File

@ -0,0 +1,30 @@
=============
read_integral
=============
Warning: CAN NOT CHANGE THE NUMBER OF MO !
Needed Modules
==============
.. Do not edit this section It was auto-generated
.. by the `update_README.py` script.
.. image:: tree_dependency.png
* `Integrals_Monoelec <http://github.com/LCPQ/quantum_package/tree/master/src/Integrals_Monoelec>`_
* `Integrals_Bielec <http://github.com/LCPQ/quantum_package/tree/master/src/Integrals_Bielec>`_
Documentation
=============
.. Do not edit this section It was auto-generated
.. by the `update_README.py` script.
`print_integrals <http://github.com/LCPQ/quantum_package/tree/master/plugins/read_integral/read_integrals_mo.irp.f#L1>`_
Undocumented
`run <http://github.com/LCPQ/quantum_package/tree/master/plugins/read_integral/read_integrals_mo.irp.f#L8>`_
Undocumented

View File

@ -0,0 +1,61 @@
program print_integrals
implicit none
integer :: iunit
integer :: getunitandopen
integer ::i,j,k,l
double precision :: integral
iunit = getunitandopen('kinetic_mo','w')
do i=1,mo_tot_num
do j=1,mo_tot_num
write(iunit,*) i,j, mo_kinetic_integral(i,j)
enddo
enddo
close(iunit)
iunit = getunitandopen('overlap_mo','w')
do i=1,mo_tot_num
do j=1,mo_tot_num
write(iunit,*) i,j, mo_overlap(i,j)
enddo
enddo
close(iunit)
iunit = getunitandopen('nuclear_mo','w')
do i=1,mo_tot_num
do j=1,mo_tot_num
write(iunit,*) i,j, mo_nucl_elec_integral(i,j)
enddo
enddo
close(iunit)
!iunit = getunitandopen('pseudo_mo','w')
!do i=1,mo_tot_num
! do j=1,mo_tot_num
! write(iunit,*) i,j, mo_pseudo_integral(i,j)
! enddo
!enddo
!close(iunit)
PROVIDE mo_bielec_integrals_in_map
iunit = getunitandopen('bielec_mo','w')
do l=1,mo_tot_num
do k=1,mo_tot_num
do j=l,mo_tot_num
do i=k,mo_tot_num
!if (i>=j) then
double precision :: get_mo_bielec_integral
integral = get_mo_bielec_integral(i,j,k,l,mo_integrals_map)
if (dabs(integral) > mo_integrals_threshold) then
write (iunit,'(4(I5,X),D22.15)') i,j,k,l, integral
endif
!end if
enddo
enddo
enddo
enddo
close(iunit)
end

View File

@ -0,0 +1,66 @@
program print_integrals
call run
end
subroutine run
use map_module
implicit none
integer :: iunit
integer :: getunitandopen
integer ::i,j,k,l
double precision :: integral
double precision, allocatable :: A(:,:)
integer :: n_integrals
integer(key_kind), allocatable :: buffer_i(:)
real(integral_kind), allocatable :: buffer_values(:)
integer(key_kind) :: key
call ezfio_set_mo_basis_mo_tot_num(mo_tot_num)
allocate (A(mo_tot_num_align,mo_tot_num))
iunit = getunitandopen('kinetic_mo','r')
do
read (iunit,*,end=10) i,j, integral
A(i,j) = integral
enddo
10 continue
close(iunit)
call write_one_e_integrals('mo_kinetic_integral', A, size(A,1), size(A,2))
iunit = getunitandopen('nuclear_mo','r')
do
read (iunit,*,end=12) i,j, integral
A(i,j) = integral
enddo
12 continue
close(iunit)
call write_one_e_integrals('mo_ne_integral', A, size(A,1), size(A,2))
call ezfio_set_integrals_monoelec_disk_access_mo_one_integrals("Read")
allocate(buffer_i(mo_tot_num**4), buffer_values(mo_tot_num**4))
iunit = getunitandopen('bielec_mo','r')
n_integrals=0
do
read (iunit,*,end=13) i,j,k,l, integral
n_integrals += 1
call bielec_integrals_index(i, j, k, l, buffer_i(n_integrals) )
buffer_values(n_integrals) = integral
enddo
13 continue
close(iunit)
call insert_into_mo_integrals_map(n_integrals,buffer_i,buffer_values)
call map_sort(mo_integrals_map)
call map_save_to_disk(trim(ezfio_filename)//'/work/mo_ints',mo_integrals_map)
call ezfio_set_integrals_bielec_disk_access_mo_integrals("Read")
end