9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-21 11:03:29 +01:00

Message for S2 eigenvalues

This commit is contained in:
Anthony Scemama 2020-03-17 16:14:55 +01:00
parent d9e2024554
commit 1a1d73cd6c
3 changed files with 22 additions and 21 deletions

View File

@ -95,6 +95,7 @@ qp set_file $ezfio
if [[ $dets -eq 1 ]] ; then if [[ $dets -eq 1 ]] ; then
rm --force -- ${ezfio}/determinants/n_det rm --force -- ${ezfio}/determinants/n_det
rm --force -- ${ezfio}/determinants/psi_{det,coef}.gz rm --force -- ${ezfio}/determinants/psi_{det,coef}.gz
rm --force -- ${ezfio}/determinants/psi_{det,coef}_qp_edit.gz
fi fi
if [[ $mos -eq 1 ]] ; then if [[ $mos -eq 1 ]] ; then

View File

@ -118,22 +118,22 @@ END_PROVIDER
call u_0_S2_u_0(s2_eigvalues,eigenvectors,N_det,psi_det,N_int,& call u_0_S2_u_0(s2_eigvalues,eigenvectors,N_det,psi_det,N_int,&
N_det,size(eigenvectors,1)) N_det,size(eigenvectors,1))
if (only_expected_s2) then if (only_expected_s2) then
do j=1,N_det do j=1,N_det
! Select at least n_states states with S^2 values closed to "expected_s2" ! Select at least n_states states with S^2 values closed to "expected_s2"
if(dabs(s2_eigvalues(j)-expected_s2).le.0.5d0)then if(dabs(s2_eigvalues(j)-expected_s2).le.0.5d0)then
i_state +=1 i_state +=1
index_good_state_array(i_state) = j index_good_state_array(i_state) = j
good_state_array(j) = .True.
endif
if(i_state.eq.N_states) then
exit
endif
enddo
else
do j=1,N_det
index_good_state_array(j) = j
good_state_array(j) = .True. good_state_array(j) = .True.
enddo endif
if(i_state.eq.N_states) then
exit
endif
enddo
else
do j=1,N_det
index_good_state_array(j) = j
good_state_array(j) = .True.
enddo
endif endif
if(i_state .ne.0)then if(i_state .ne.0)then
! Fill the first "i_state" states that have a correct S^2 value ! Fill the first "i_state" states that have a correct S^2 value
@ -163,7 +163,7 @@ END_PROVIDER
print*,'!!!!!!!! WARNING !!!!!!!!!' print*,'!!!!!!!! WARNING !!!!!!!!!'
print*,' Within the ',N_det,'determinants selected' print*,' Within the ',N_det,'determinants selected'
print*,' and the ',N_states_diag,'states requested' print*,' and the ',N_states_diag,'states requested'
print*,' We did not find any state with S^2 values close to ',expected_s2 print*,' We did not find only states with S^2 values close to ',expected_s2
print*,' We will then set the first N_states eigenvectors of the H matrix' print*,' We will then set the first N_states eigenvectors of the H matrix'
print*,' as the CI_eigenvectors' print*,' as the CI_eigenvectors'
print*,' You should consider more states and maybe ask for s2_eig to be .True. or just enlarge the CI space' print*,' You should consider more states and maybe ask for s2_eig to be .True. or just enlarge the CI space'
@ -179,11 +179,11 @@ END_PROVIDER
deallocate(index_good_state_array,good_state_array) deallocate(index_good_state_array,good_state_array)
deallocate(s2_eigvalues) deallocate(s2_eigvalues)
else else
call lapack_diag(eigenvalues,eigenvectors, & call lapack_diag(eigenvalues,eigenvectors, &
H_matrix_all_dets,size(H_matrix_all_dets,1),N_det) H_matrix_all_dets,size(H_matrix_all_dets,1),N_det)
CI_electronic_energy(:) = 0.d0 CI_electronic_energy(:) = 0.d0
call u_0_S2_u_0(CI_s2,eigenvectors,N_det,psi_det,N_int,& call u_0_S2_u_0(CI_s2,eigenvectors,N_det,psi_det,N_int, &
min(N_det,N_states_diag),size(eigenvectors,1)) min(N_det,N_states_diag),size(eigenvectors,1))
! Select the "N_states_diag" states of lowest energy ! Select the "N_states_diag" states of lowest energy
do j=1,min(N_det,N_states_diag) do j=1,min(N_det,N_states_diag)
do i=1,N_det do i=1,N_det
@ -213,7 +213,7 @@ subroutine diagonalize_CI
! Replace the coefficients of the |CI| states by the coefficients of the ! Replace the coefficients of the |CI| states by the coefficients of the
! eigenstates of the |CI| matrix. ! eigenstates of the |CI| matrix.
END_DOC END_DOC
integer :: i,j integer :: i,j
do j=1,N_states do j=1,N_states
do i=1,N_det do i=1,N_det
psi_coef(i,j) = CI_eigenvectors(i,j) psi_coef(i,j) = CI_eigenvectors(i,j)

View File

@ -771,7 +771,7 @@ subroutine apply_excitation(det, exc, res, ok, Nint)
case default case default
print *, degree print *, degree
print *, "apply ex" print *, "apply ex"
! print *, 1.d0/0.d0 ! For traceback print *, 1.d0/0.d0 ! For traceback
STOP STOP
end select end select
! END INLINE ! END INLINE