9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-09 06:53:38 +01:00

Merge branch 'dev' of github.com:QuantumPackage/qp2 into dev

This commit is contained in:
Anthony Scemama 2023-02-02 14:19:37 +01:00
commit f4de97a71d
3 changed files with 41 additions and 37 deletions

View File

@ -777,7 +777,7 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d
call diag_htilde_mu_mat_fock_bi_ortho(N_int, det, hmono, htwoe, hthree, hii)
delta_E = E0(istate) - Hii + E_shift
double precision :: alpha_h_psi_tmp, psi_h_alpha_tmp
double precision :: alpha_h_psi_tmp, psi_h_alpha_tmp, error
if(debug_tc_pt2 == 1)then !! Using the old version
psi_h_alpha = 0.d0
alpha_h_psi = 0.d0
@ -795,36 +795,40 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d
do iii = 1, N_det ! old version
call htilde_mu_mat_opt_bi_ortho_no_3e(psi_selectors(1,1,iii), det, N_int, i_h_alpha)
call htilde_mu_mat_opt_bi_ortho_no_3e(det, psi_selectors(1,1,iii), N_int, alpha_h_i)
! psi_h_alpha += i_h_alpha * psi_selectors_coef_tc(iii,2,1) ! left function
! alpha_h_psi += alpha_h_i * psi_selectors_coef_tc(iii,1,1) ! right function
psi_h_alpha += i_h_alpha * 1.d0 ! left function
alpha_h_psi += alpha_h_i * 1.d0 ! right function
psi_h_alpha += i_h_alpha * psi_selectors_coef_tc(iii,2,1) ! left function
alpha_h_psi += alpha_h_i * psi_selectors_coef_tc(iii,1,1) ! right function
! psi_h_alpha += i_h_alpha * 1.d0 ! left function
! alpha_h_psi += alpha_h_i * 1.d0 ! right function
enddo
if(dabs(psi_h_alpha).gt.1.d-10.or.dabs(alpha_h_psi).gt.1.d-10)then
if(dabs(psi_h_alpha - psi_h_alpha_tmp).gt.1.d-08 .or. dabs(alpha_h_psi - alpha_h_psi_tmp).gt.1.d-08)then
call debug_det(det,N_int)
print*,'psi_h_alpha,alpha_h_psi'
print*,psi_h_alpha,alpha_h_psi
print*,psi_h_alpha_tmp,alpha_h_psi_tmp
print*,dabs(psi_h_alpha - psi_h_alpha_tmp),dabs(alpha_h_psi - alpha_h_psi_tmp)
alpha_h_psi = 0.d0
psi_h_alpha = 0.d0
do iii = 1, N_det
call get_excitation_degree( psi_det(1,1,iii), det, degree, N_int)
call htilde_mu_mat_bi_ortho_tot(psi_det(1,1,iii), det, N_int, i_h_alpha)
call htilde_mu_mat_bi_ortho_tot(det, psi_det(1,1,iii), N_int, alpha_h_i)
alpha_h_psi += alpha_h_i
psi_h_alpha += i_h_alpha
if(dabs(i_h_alpha).gt.1.d-10.or.dabs(alpha_h_i).gt.1.d-10)then
call debug_det(psi_det(1,1,iii),N_int)
print*,iii,degree,i_h_alpha,alpha_h_i
print*,psi_h_alpha,alpha_h_psi
if(dabs(psi_h_alpha*alpha_h_psi/delta_E).gt.1.d-10)then
error = dabs(psi_h_alpha * alpha_h_psi - psi_h_alpha_tmp * alpha_h_psi_tmp)/dabs(psi_h_alpha * alpha_h_psi)
if(error.gt.1.d-2)then
print*,'error =',error,psi_h_alpha * alpha_h_psi/delta_E,psi_h_alpha_tmp * alpha_h_psi_tmp/delta_E
endif
! if(dabs(psi_h_alpha - psi_h_alpha_tmp).gt.1.d-08 .or. dabs(alpha_h_psi - alpha_h_psi_tmp).gt.1.d-08)then
! call debug_det(det,N_int)
! print*,'psi_h_alpha,alpha_h_psi'
! print*,psi_h_alpha,alpha_h_psi
! print*,psi_h_alpha_tmp,alpha_h_psi_tmp
! print*,dabs(psi_h_alpha - psi_h_alpha_tmp),dabs(alpha_h_psi - alpha_h_psi_tmp)
! alpha_h_psi = 0.d0
! psi_h_alpha = 0.d0
! do iii = 1, N_det
!
! call get_excitation_degree( psi_det(1,1,iii), det, degree, N_int)
! call htilde_mu_mat_bi_ortho_tot(psi_det(1,1,iii), det, N_int, i_h_alpha)
! call htilde_mu_mat_bi_ortho_tot(det, psi_det(1,1,iii), N_int, alpha_h_i)
! alpha_h_psi += alpha_h_i
! psi_h_alpha += i_h_alpha
! if(dabs(i_h_alpha).gt.1.d-10.or.dabs(alpha_h_i).gt.1.d-10)then
! call debug_det(psi_det(1,1,iii),N_int)
! print*,iii,degree,i_h_alpha,alpha_h_i
! print*,psi_h_alpha,alpha_h_psi
! print*,leigvec_tc_bi_orth(iii,1),reigvec_tc_bi_orth(iii,1)
endif
enddo
stop
endif
! endif
! enddo
! stop
! endif
endif
else
psi_h_alpha = mat_l(istate, p1, p2)

View File

@ -128,10 +128,10 @@ subroutine davidson_general_ext_rout_nonsym_b1space(u_in, H_jj, energies, sze, N
if(itermax > 4) then
itermax = itermax - 1
else if (m==1.and.disk_based_davidson) then
m = 0
disk_based = .True.
itermax = 6
! else if (m==1.and.disk_based_davidson) then
! m = 0
! disk_based = .True.
! itermax = 6
else
nproc_target = nproc_target - 1
endif

View File

@ -48,10 +48,10 @@ END_PROVIDER
do k=1,N_states
do i=1,N_det_selectors
psi_selectors_coef(i,k) = psi_coef_sorted_tc_gen(i,k)
! psi_selectors_coef_tc(i,1,k) = psi_l_coef_sorted_bi_ortho(i,k)
! psi_selectors_coef_tc(i,2,k) = psi_r_coef_sorted_bi_ortho(i,k)
psi_selectors_coef_tc(i,1,k) = 1.d0
psi_selectors_coef_tc(i,2,k) = 1.d0
psi_selectors_coef_tc(i,1,k) = psi_l_coef_sorted_bi_ortho(i,k)
psi_selectors_coef_tc(i,2,k) = psi_r_coef_sorted_bi_ortho(i,k)
! psi_selectors_coef_tc(i,1,k) = 1.d0
! psi_selectors_coef_tc(i,2,k) = 1.d0
enddo
enddo