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,43 +447,39 @@ subroutine export_trexio
if (export_mo_two_e_ints_cholesky) then if (export_mo_two_e_ints_cholesky) then
print *, 'MO two-e integrals Cholesky' 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 icount = 0_8
offset = 0_8 offset = 0_8
do l=1,mo_num do k=1,cholesky_ao_num
do k=1,mo_num do j=1,mo_num
do j=l,mo_num do i=1,mo_num
do i=k,mo_num integral = cholesky_mo(i,j,k)
if (i==j .and. k<l) cycle if (integral == 0.d0) cycle
if (i<j) cycle icount += 1_8
integral = mo_two_e_integral(i,j,k,l) eri_buffer(icount) = integral
if (integral == 0.d0) cycle eri_index(1,icount) = i
icount += 1_8 eri_index(2,icount) = j
eri_buffer(icount) = integral eri_index(3,icount) = k
eri_index(1,icount) = i if (icount == BUFSIZE) then
eri_index(2,icount) = j rc = trexio_write_mo_2e_int_eri_cholesky(f, offset, icount, eri_index, eri_buffer)
eri_index(3,icount) = k call trexio_assert(rc, TREXIO_SUCCESS)
eri_index(4,icount) = l offset += icount
if (icount == BUFSIZE) then icount = 0_8
rc = trexio_write_mo_2e_int_eri(f, offset, icount, eri_index, eri_buffer) end if
call trexio_assert(rc, TREXIO_SUCCESS)
offset += icount
icount = 0_8
end if
end do
end do
end do end do
end do
end do end do
if (icount > 0_8) then 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) call trexio_assert(rc, TREXIO_SUCCESS)
end if end if
end if end if
! One-e RDM ! One-e RDM
! --------- ! ---------