From 63f93db5849fce0f62c9379ec35b8d949770c0d2 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 5 May 2022 13:26:51 +0200 Subject: [PATCH] Improve trexio module --- devel/trexio/EZFIO.cfg | 18 +++++++-- devel/trexio/export_trexio.irp.f | 65 ++++++++++++++++++-------------- devel/trexio/qp_import_trexio.py | 3 +- 3 files changed, 53 insertions(+), 33 deletions(-) diff --git a/devel/trexio/EZFIO.cfg b/devel/trexio/EZFIO.cfg index e99dba9..396fa5c 100644 --- a/devel/trexio/EZFIO.cfg +++ b/devel/trexio/EZFIO.cfg @@ -16,15 +16,27 @@ doc: If True, export two-body reduced density matrix interface: ezfio, ocaml, provider default: False -[export_ao_ints] +[export_ao_one_e_ints] +type: logical +doc: If True, export one-electron integrals in AO basis +interface: ezfio, ocaml, provider +default: False + +[export_mo_one_e_ints] +type: logical +doc: If True, export one-electron integrals in MO basis +interface: ezfio, ocaml, provider +default: False + +[export_ao_two_e_ints] type: logical doc: If True, export two-electron integrals in AO basis interface: ezfio, ocaml, provider default: False -[export_mo_ints] +[export_mo_two_e_ints] type: logical doc: If True, export two-electron integrals in MO basis interface: ezfio, ocaml, provider -default: True +default: False diff --git a/devel/trexio/export_trexio.irp.f b/devel/trexio/export_trexio.irp.f index 8a04862..082806a 100644 --- a/devel/trexio/export_trexio.irp.f +++ b/devel/trexio/export_trexio.irp.f @@ -257,29 +257,32 @@ subroutine run ! One-e AO integrals ! ------------------ - print *, 'AO integrals' + if (export_ao_one_e_ints) then + print *, 'AO one-e integrals' - rc = trexio_write_ao_1e_int_overlap(f,ao_overlap) - call trexio_assert(rc, TREXIO_SUCCESS) - - rc = trexio_write_ao_1e_int_kinetic(f,ao_kinetic_integrals) - call trexio_assert(rc, TREXIO_SUCCESS) - - rc = trexio_write_ao_1e_int_potential_n_e(f,ao_integrals_n_e) - call trexio_assert(rc, TREXIO_SUCCESS) - - if (do_pseudo) then - rc = trexio_write_ao_1e_int_ecp(f, ao_pseudo_integrals_local + ao_pseudo_integrals_non_local) + rc = trexio_write_ao_1e_int_overlap(f,ao_overlap) call trexio_assert(rc, TREXIO_SUCCESS) - endif - rc = trexio_write_ao_1e_int_core_hamiltonian(f,ao_one_e_integrals) - call trexio_assert(rc, TREXIO_SUCCESS) + rc = trexio_write_ao_1e_int_kinetic(f,ao_kinetic_integrals) + call trexio_assert(rc, TREXIO_SUCCESS) + + rc = trexio_write_ao_1e_int_potential_n_e(f,ao_integrals_n_e) + call trexio_assert(rc, TREXIO_SUCCESS) + + if (do_pseudo) then + rc = trexio_write_ao_1e_int_ecp(f, ao_pseudo_integrals_local + ao_pseudo_integrals_non_local) + call trexio_assert(rc, TREXIO_SUCCESS) + endif + + rc = trexio_write_ao_1e_int_core_hamiltonian(f,ao_one_e_integrals) + call trexio_assert(rc, TREXIO_SUCCESS) + end if ! Two-e AO integrals ! ------------------ - if (export_ao_ints) then + if (export_ao_two_e_ints) then + print *, 'AO two-e integrals' PROVIDE ao_two_e_integrals_in_map integer(8), parameter :: BUFSIZE=10000_8 @@ -342,26 +345,29 @@ subroutine run ! One-e MO integrals ! ------------------ - print *, 'MO integrals' + if (export_mo_two_e_ints) then + print *, 'MO one-e integrals' - rc = trexio_write_mo_1e_int_kinetic(f,mo_kinetic_integrals) - call trexio_assert(rc, TREXIO_SUCCESS) - - rc = trexio_write_mo_1e_int_potential_n_e(f,mo_integrals_n_e) - call trexio_assert(rc, TREXIO_SUCCESS) - - if (do_pseudo) then - rc = trexio_write_mo_1e_int_ecp(f,mo_pseudo_integrals_local) + rc = trexio_write_mo_1e_int_kinetic(f,mo_kinetic_integrals) call trexio_assert(rc, TREXIO_SUCCESS) - endif - rc = trexio_write_mo_1e_int_core_hamiltonian(f,mo_one_e_integrals) - call trexio_assert(rc, TREXIO_SUCCESS) + rc = trexio_write_mo_1e_int_potential_n_e(f,mo_integrals_n_e) + call trexio_assert(rc, TREXIO_SUCCESS) + + if (do_pseudo) then + rc = trexio_write_mo_1e_int_ecp(f,mo_pseudo_integrals_local) + call trexio_assert(rc, TREXIO_SUCCESS) + endif + + rc = trexio_write_mo_1e_int_core_hamiltonian(f,mo_one_e_integrals) + call trexio_assert(rc, TREXIO_SUCCESS) + end if ! Two-e MO integrals ! ------------------ - if (export_mo_ints) then + if (export_mo_two_e_ints) then + print *, 'MO two-e integrals' PROVIDE mo_two_e_integrals_in_map double precision, external :: mo_two_e_integral @@ -420,6 +426,7 @@ subroutine run if (export_rdm) then PROVIDE two_e_dm_mo + print *, 'Two-e RDM' icount = 0_8 offset = 0_8 diff --git a/devel/trexio/qp_import_trexio.py b/devel/trexio/qp_import_trexio.py index 6457df4..9de0940 100755 --- a/devel/trexio/qp_import_trexio.py +++ b/devel/trexio/qp_import_trexio.py @@ -373,7 +373,8 @@ def get_full_path(file_path): if __name__ == '__main__': ARGUMENTS = docopt(__doc__) - trexio_filename = get_full_path(ARGUMENTS['FILE']) + FILE = get_full_path(ARGUMENTS['FILE']) + trexio_filename = FILE if ARGUMENTS["--output"]: EZFIO_FILE = get_full_path(ARGUMENTS["--output"])