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

Cholesky MOs in TREXIO

This commit is contained in:
Anthony Scemama 2023-05-04 15:54:46 +02:00
parent 77600429a3
commit 5fd6574601

View File

@ -447,26 +447,24 @@ subroutine export_trexio
if (export_mo_two_e_ints_cholesky) then
print *, 'MO two-e integrals Cholesky'
PROVIDE mo_two_e_integrals_in_map
rc = trexio_write_mo_2e_int_eri_cholesky_num(f, cholesky_ao_num)
call trexio_assert(rc, TREXIO_SUCCESS)
icount = 0_8
offset = 0_8
do l=1,mo_num
do k=1,mo_num
do j=l,mo_num
do i=k,mo_num
if (i==j .and. k<l) cycle
if (i<j) cycle
integral = mo_two_e_integral(i,j,k,l)
do k=1,cholesky_ao_num
do j=1,mo_num
do i=1,mo_num
integral = cholesky_mo(i,j,k)
if (integral == 0.d0) cycle
icount += 1_8
eri_buffer(icount) = integral
eri_index(1,icount) = i
eri_index(2,icount) = j
eri_index(3,icount) = k
eri_index(4,icount) = l
if (icount == BUFSIZE) then
rc = trexio_write_mo_2e_int_eri(f, offset, icount, eri_index, eri_buffer)
rc = trexio_write_mo_2e_int_eri_cholesky(f, offset, icount, eri_index, eri_buffer)
call trexio_assert(rc, TREXIO_SUCCESS)
offset += icount
icount = 0_8
@ -474,16 +472,14 @@ subroutine export_trexio
end do
end do
end do
end do
if (icount > 0_8) then
rc = trexio_write_mo_2e_int_eri(f, offset, icount, eri_index, eri_buffer)
rc = trexio_write_mo_2e_int_eri_cholesky(f, offset, icount, eri_index, eri_buffer)
call trexio_assert(rc, TREXIO_SUCCESS)
end if
end if
! One-e RDM
! ---------