added src/tools/save_natorb_no_ref.irp.f

This commit is contained in:
FiletoRodriguez 2021-11-30 15:35:19 +01:00
parent 5b67fbd810
commit 8c52190648
2 changed files with 62 additions and 0 deletions

View File

@ -268,6 +268,44 @@ subroutine set_natural_mos
soft_touch mo_occ
end
subroutine save_natural_mos_canon_label
implicit none
BEGIN_DOC
! Save natural orbitals, obtained by diagonalization of the one-body density matrix in
! the |MO| basis
END_DOC
call set_natural_mos_canon_label
call nullify_small_elements(ao_num,mo_num,mo_coef,size(mo_coef,1),1.d-10)
call orthonormalize_mos
call save_mos
end
subroutine set_natural_mos_canon_label
implicit none
BEGIN_DOC
! Set natural orbitals, obtained by diagonalization of the one-body density matrix
! in the |MO| basis
END_DOC
character*(64) :: label
double precision, allocatable :: tmp(:,:)
label = "Canonical"
integer :: i,j,iorb,jorb
do i = 1, n_virt_orb
iorb = list_virt(i)
do j = 1, n_core_inact_act_orb
jorb = list_core_inact_act(j)
enddo
enddo
call mo_as_svd_vectors_of_mo_matrix_eig(one_e_dm_mo,size(one_e_dm_mo,1),mo_num,mo_num,mo_occ,label)
soft_touch mo_occ
end
subroutine set_natorb_no_ov_rot
implicit none
BEGIN_DOC

View File

@ -0,0 +1,24 @@
program save_natorb
implicit none
BEGIN_DOC
! Save natural |MOs| into the |EZFIO|.
!
! This program reads the wave function stored in the |EZFIO| directory,
! extracts the corresponding natural orbitals and setd them as the new
! |MOs|.
!
! If this is a multi-state calculation, the density matrix that produces
! the natural orbitals is obtained from an average of the density
! matrices of each state with the corresponding
! :option:`determinants state_average_weight`
END_DOC
read_wf = .True.
touch read_wf
call save_natural_mos_canon_label
call ezfio_set_mo_two_e_ints_io_mo_two_e_integrals('None')
call ezfio_set_mo_one_e_ints_io_mo_one_e_integrals('None')
call ezfio_set_mo_one_e_ints_io_mo_integrals_kinetic('None')
call ezfio_set_mo_one_e_ints_io_mo_integrals_n_e('None')
call ezfio_set_mo_one_e_ints_io_mo_integrals_pseudo('None')
end