mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-11-06 21:43:39 +01:00
Fix normalization factor in trexio
This commit is contained in:
parent
f0ad63966a
commit
ff5d62f840
@ -10,11 +10,17 @@ doc: Name of the exported TREXIO file
|
||||
interface: ezfio, ocaml, provider
|
||||
default: None
|
||||
|
||||
[export_rdm]
|
||||
[export_basis]
|
||||
type: logical
|
||||
doc: If True, export two-body reduced density matrix
|
||||
doc: If True, export basis set and AOs
|
||||
interface: ezfio, ocaml, provider
|
||||
default: False
|
||||
default: True
|
||||
|
||||
[export_mos]
|
||||
type: logical
|
||||
doc: If True, export basis set and AOs
|
||||
interface: ezfio, ocaml, provider
|
||||
default: True
|
||||
|
||||
[export_ao_one_e_ints]
|
||||
type: logical
|
||||
@ -22,12 +28,6 @@ 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
|
||||
@ -40,6 +40,12 @@ doc: If True, export Cholesky-decomposed two-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_mo_two_e_ints]
|
||||
type: logical
|
||||
doc: If True, export two-electron integrals in MO basis
|
||||
@ -52,3 +58,9 @@ doc: If True, export Cholesky-decomposed two-electron integrals in MO basis
|
||||
interface: ezfio, ocaml, provider
|
||||
default: False
|
||||
|
||||
[export_rdm]
|
||||
type: logical
|
||||
doc: If True, export two-body reduced density matrix
|
||||
interface: ezfio, ocaml, provider
|
||||
default: False
|
||||
|
||||
|
@ -2,6 +2,6 @@ program export_trexio_prog
|
||||
implicit none
|
||||
read_wf = .True.
|
||||
SOFT_TOUCH read_wf
|
||||
call export_trexio
|
||||
call export_trexio(.False.)
|
||||
end
|
||||
|
||||
|
@ -1,15 +1,17 @@
|
||||
subroutine export_trexio
|
||||
subroutine export_trexio(update)
|
||||
use trexio
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Exports the wave function in TREXIO format
|
||||
END_DOC
|
||||
|
||||
logical, intent(in) :: update
|
||||
integer(trexio_t) :: f(N_states) ! TREXIO file handle
|
||||
integer(trexio_exit_code) :: rc
|
||||
integer :: k
|
||||
double precision, allocatable :: factor(:)
|
||||
character*(256) :: filenames(N_states)
|
||||
character :: rw
|
||||
|
||||
filenames(1) = trexio_filename
|
||||
do k=2,N_states
|
||||
@ -18,15 +20,26 @@ subroutine export_trexio
|
||||
|
||||
do k=1,N_states
|
||||
print *, 'TREXIO file : ', trim(filenames(k))
|
||||
if (update) then
|
||||
call system('test -f '//trim(filenames(k))//' && cp -r '//trim(filenames(k))//' '//trim(filenames(k))//'.bak')
|
||||
else
|
||||
call system('test -f '//trim(filenames(k))//' && mv '//trim(filenames(k))//' '//trim(filenames(k))//'.bak')
|
||||
endif
|
||||
enddo
|
||||
print *, ''
|
||||
|
||||
if (update) then
|
||||
rw = 'u'
|
||||
else
|
||||
rw = 'w'
|
||||
endif
|
||||
|
||||
|
||||
do k=1,N_states
|
||||
if (backend == 0) then
|
||||
f(k) = trexio_open(filenames(k), 'u', TREXIO_HDF5, rc)
|
||||
f(k) = trexio_open(filenames(k), rw, TREXIO_HDF5, rc)
|
||||
else if (backend == 1) then
|
||||
f(k) = trexio_open(filenames(k), 'u', TREXIO_TEXT, rc)
|
||||
f(k) = trexio_open(filenames(k), rw, TREXIO_TEXT, rc)
|
||||
endif
|
||||
if (f(k) == 0_8) then
|
||||
print *, 'Unable to open TREXIO file for writing'
|
||||
@ -171,12 +184,13 @@ subroutine export_trexio
|
||||
endif
|
||||
|
||||
|
||||
if (export_basis) then
|
||||
|
||||
! Basis
|
||||
! -----
|
||||
|
||||
print *, 'Basis'
|
||||
|
||||
|
||||
rc = trexio_write_basis_type(f(1), 'Gaussian', len('Gaussian'))
|
||||
call trexio_assert(rc, TREXIO_SUCCESS)
|
||||
|
||||
@ -193,11 +207,11 @@ subroutine export_trexio
|
||||
call trexio_assert(rc, TREXIO_SUCCESS)
|
||||
|
||||
allocate(factor(shell_num))
|
||||
if (ao_normalized) then
|
||||
factor(1:shell_num) = shell_normalization_factor(1:shell_num)
|
||||
else
|
||||
! if (ao_normalized) then
|
||||
! factor(1:shell_num) = shell_normalization_factor(1:shell_num)
|
||||
! else
|
||||
factor(1:shell_num) = 1.d0
|
||||
endif
|
||||
! endif
|
||||
rc = trexio_write_basis_shell_factor(f(1), factor)
|
||||
call trexio_assert(rc, TREXIO_SUCCESS)
|
||||
|
||||
@ -258,6 +272,8 @@ subroutine export_trexio
|
||||
call trexio_assert(rc, TREXIO_SUCCESS)
|
||||
deallocate(factor)
|
||||
|
||||
endif
|
||||
|
||||
! One-e AO integrals
|
||||
! ------------------
|
||||
|
||||
@ -375,6 +391,7 @@ subroutine export_trexio
|
||||
! Molecular orbitals
|
||||
! ------------------
|
||||
|
||||
if (export_mos) then
|
||||
print *, 'MOs'
|
||||
|
||||
rc = trexio_write_mo_type(f(1), mo_label, len(trim(mo_label)))
|
||||
@ -396,6 +413,7 @@ subroutine export_trexio
|
||||
|
||||
rc = trexio_write_mo_class(f(1), mo_class, len(mo_class(1)))
|
||||
call trexio_assert(rc, TREXIO_SUCCESS)
|
||||
endif
|
||||
|
||||
! One-e MO integrals
|
||||
! ------------------
|
||||
|
Loading…
Reference in New Issue
Block a user