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

Compare commits

..

4 Commits

3 changed files with 90 additions and 1 deletions

View File

@ -34,9 +34,21 @@ doc: If True, export two-electron integrals in AO basis
interface: ezfio, ocaml, provider interface: ezfio, ocaml, provider
default: False default: False
[export_ao_two_e_ints_cholesky]
type: logical
doc: If True, export Cholesky-decomposed two-electron integrals in AO basis
interface: ezfio, ocaml, provider
default: False
[export_mo_two_e_ints] [export_mo_two_e_ints]
type: logical type: logical
doc: If True, export two-electron integrals in MO basis doc: If True, export two-electron integrals in MO basis
interface: ezfio, ocaml, provider interface: ezfio, ocaml, provider
default: False default: False
[export_mo_two_e_ints_cholesky]
type: logical
doc: If True, export Cholesky-decomposed two-electron integrals in MO basis
interface: ezfio, ocaml, provider
default: False

View File

@ -319,6 +319,47 @@ subroutine export_trexio
end if end if
end if end if
! Two-e AO integrals - Cholesky
! -----------------------------
integer(4) :: chol_index(3,BUFSIZE)
double precision :: chol_buffer(BUFSIZE)
if (export_ao_two_e_ints_cholesky) then
print *, 'AO two-e integrals Cholesky'
rc = trexio_write_ao_2e_int_eri_cholesky_num(f, cholesky_ao_num)
call trexio_assert(rc, TREXIO_SUCCESS)
icount = 0_8
offset = 0_8
do k=1,cholesky_ao_num
do j=1,ao_num
do i=1,ao_num
integral = cholesky_ao(i,j,k)
if (integral == 0.d0) cycle
icount += 1_8
chol_buffer(icount) = integral
chol_index(1,icount) = i
chol_index(2,icount) = j
chol_index(3,icount) = k
if (icount == BUFSIZE) then
rc = trexio_write_ao_2e_int_eri_cholesky(f, offset, icount, chol_index, chol_buffer)
call trexio_assert(rc, TREXIO_SUCCESS)
offset += icount
icount = 0_8
end if
end do
end do
end do
if (icount > 0_8) then
rc = trexio_write_ao_2e_int_eri_cholesky(f, offset, icount, chol_index, chol_buffer)
call trexio_assert(rc, TREXIO_SUCCESS)
end if
end if
! Molecular orbitals ! Molecular orbitals
! ------------------ ! ------------------
@ -404,6 +445,42 @@ subroutine export_trexio
end if end if
end if end if
! Two-e MO integrals - Cholesky
! -----------------------------
if (export_mo_two_e_ints_cholesky) then
print *, 'MO two-e integrals Cholesky'
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 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
chol_buffer(icount) = integral
chol_index(1,icount) = i
chol_index(2,icount) = j
chol_index(3,icount) = k
if (icount == BUFSIZE) then
rc = trexio_write_mo_2e_int_eri_cholesky(f, offset, icount, chol_index, chol_buffer)
call trexio_assert(rc, TREXIO_SUCCESS)
offset += icount
icount = 0_8
end if
end do
end do
end do
if (icount > 0_8) then
rc = trexio_write_mo_2e_int_eri_cholesky(f, offset, icount, chol_index, chol_buffer)
call trexio_assert(rc, TREXIO_SUCCESS)
end if
end if
! One-e RDM ! One-e RDM

View File

@ -16,7 +16,7 @@ scripts_list="qp_import_trexio.py"
# ${QP_ROOT}/scripts/ directory. # ${QP_ROOT}/scripts/ directory.
for i in $scripts_list for i in $scripts_list
do do
find ${QP_ROOT}/scripts/$i -type l -delete find ${QP_ROOT}/scripts/$i -type l -delete 2> /dev/null
done done
# Create symlink in scripts # Create symlink in scripts