mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 03:23:29 +01:00
Fixed save_natorb
This commit is contained in:
parent
d1c0d179dc
commit
cc2e58448e
@ -269,7 +269,6 @@ subroutine save_natural_mos
|
|||||||
END_DOC
|
END_DOC
|
||||||
call set_natural_mos
|
call set_natural_mos
|
||||||
call save_mos
|
call save_mos
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -515,13 +515,15 @@ subroutine save_wavefunction_general(ndet,nstates,psidet,dim_psicoef,psicoef)
|
|||||||
double precision, allocatable :: psi_coef_save(:,:)
|
double precision, allocatable :: psi_coef_save(:,:)
|
||||||
|
|
||||||
double precision :: accu_norm
|
double precision :: accu_norm
|
||||||
integer :: i,j,k
|
integer :: i,j,k, ndet_qp_edit
|
||||||
|
|
||||||
if (mpi_master) then
|
if (mpi_master) then
|
||||||
|
ndet_qp_edit = min(ndet,N_det_qp_edit)
|
||||||
|
|
||||||
call ezfio_set_determinants_N_int(N_int)
|
call ezfio_set_determinants_N_int(N_int)
|
||||||
call ezfio_set_determinants_bit_kind(bit_kind)
|
call ezfio_set_determinants_bit_kind(bit_kind)
|
||||||
call ezfio_set_determinants_N_det(ndet)
|
call ezfio_set_determinants_N_det(ndet)
|
||||||
call ezfio_set_determinants_N_det_qp_edit(N_det_qp_edit)
|
call ezfio_set_determinants_N_det_qp_edit(ndet_qp_edit)
|
||||||
call ezfio_set_determinants_n_states(nstates)
|
call ezfio_set_determinants_n_states(nstates)
|
||||||
call ezfio_set_determinants_mo_label(mo_label)
|
call ezfio_set_determinants_mo_label(mo_label)
|
||||||
|
|
||||||
@ -548,12 +550,12 @@ subroutine save_wavefunction_general(ndet,nstates,psidet,dim_psicoef,psicoef)
|
|||||||
call ezfio_set_determinants_psi_coef(psi_coef_save)
|
call ezfio_set_determinants_psi_coef(psi_coef_save)
|
||||||
deallocate (psi_coef_save)
|
deallocate (psi_coef_save)
|
||||||
|
|
||||||
allocate (psi_coef_save(N_det_qp_edit,nstates))
|
allocate (psi_coef_save(ndet_qp_edit,nstates))
|
||||||
do k=1,nstates
|
do k=1,nstates
|
||||||
do i=1,N_det_qp_edit
|
do i=1,ndet_qp_edit
|
||||||
psi_coef_save(i,k) = psicoef(i,k)
|
psi_coef_save(i,k) = psicoef(i,k)
|
||||||
enddo
|
enddo
|
||||||
call normalize(psi_coef_save(1,k),N_det_qp_edit)
|
call normalize(psi_coef_save(1,k),ndet_qp_edit)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
call ezfio_set_determinants_psi_coef_qp_edit(psi_coef_save)
|
call ezfio_set_determinants_psi_coef_qp_edit(psi_coef_save)
|
||||||
@ -583,11 +585,14 @@ subroutine save_wavefunction_specified(ndet,nstates,psidet,psicoef,ndetsave,inde
|
|||||||
integer :: N_int2
|
integer :: N_int2
|
||||||
equivalence (det_8, det_bk)
|
equivalence (det_8, det_bk)
|
||||||
|
|
||||||
integer :: i,k
|
integer :: i,j,k, ndet_qp_edit
|
||||||
|
|
||||||
|
if (mpi_master) then
|
||||||
|
ndet_qp_edit = min(ndetsave,N_det_qp_edit)
|
||||||
call ezfio_set_determinants_N_int(N_int)
|
call ezfio_set_determinants_N_int(N_int)
|
||||||
call ezfio_set_determinants_bit_kind(bit_kind)
|
call ezfio_set_determinants_bit_kind(bit_kind)
|
||||||
call ezfio_set_determinants_N_det(ndetsave)
|
call ezfio_set_determinants_N_det(ndetsave)
|
||||||
|
call ezfio_set_determinants_N_det_qp_edit(ndet_qp_edit)
|
||||||
call ezfio_set_determinants_n_states(nstates)
|
call ezfio_set_determinants_n_states(nstates)
|
||||||
call ezfio_set_determinants_mo_label(mo_label)
|
call ezfio_set_determinants_mo_label(mo_label)
|
||||||
|
|
||||||
@ -608,6 +613,7 @@ subroutine save_wavefunction_specified(ndet,nstates,psidet,psicoef,ndetsave,inde
|
|||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
call ezfio_set_determinants_psi_det(psi_det_save)
|
call ezfio_set_determinants_psi_det(psi_det_save)
|
||||||
|
call ezfio_set_determinants_psi_det_qp_edit(psi_det_save)
|
||||||
deallocate (psi_det_save)
|
deallocate (psi_det_save)
|
||||||
|
|
||||||
allocate (psi_coef_save(ndetsave,nstates))
|
allocate (psi_coef_save(ndetsave,nstates))
|
||||||
@ -629,8 +635,30 @@ subroutine save_wavefunction_specified(ndet,nstates,psidet,psicoef,ndetsave,inde
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
call ezfio_set_determinants_psi_coef(psi_coef_save)
|
call ezfio_set_determinants_psi_coef(psi_coef_save)
|
||||||
call write_int(6,ndet,'Saved determinants')
|
|
||||||
deallocate (psi_coef_save)
|
deallocate (psi_coef_save)
|
||||||
|
|
||||||
|
allocate (psi_coef_save(ndet_qp_edit,nstates))
|
||||||
|
accu_norm = 0.d0
|
||||||
|
do k=1,nstates
|
||||||
|
do i=1,ndet_qp_edit
|
||||||
|
accu_norm(k) = accu_norm(k) + psicoef(index_det_save(i),k) * psicoef(index_det_save(i),k)
|
||||||
|
psi_coef_save(i,k) = psicoef(index_det_save(i),k)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
do k = 1, nstates
|
||||||
|
accu_norm(k) = 1.d0/dsqrt(accu_norm(k))
|
||||||
|
enddo
|
||||||
|
do k=1,nstates
|
||||||
|
do i=1,ndet_qp_edit
|
||||||
|
psi_coef_save(i,k) = psi_coef_save(i,k) * accu_norm(k)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
|
||||||
|
call ezfio_set_determinants_psi_coef(psi_coef_save)
|
||||||
|
deallocate (psi_coef_save)
|
||||||
|
|
||||||
|
call write_int(6,ndet,'Saved determinants')
|
||||||
|
endif
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user