10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-03 20:53:54 +01:00

it does not work that well

This commit is contained in:
eginer 2023-01-31 09:52:23 +01:00
parent 33a6b33a76
commit 81e2d38431
3 changed files with 18 additions and 11 deletions

View File

@ -778,7 +778,7 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d
delta_E = E0(istate) - Hii + E_shift 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
if(debug_tc_pt2 == 2)then !! Using the old version if(debug_tc_pt2 == 1)then !! Using the old version
psi_h_alpha = 0.d0 psi_h_alpha = 0.d0
alpha_h_psi = 0.d0 alpha_h_psi = 0.d0
do iii = 1, N_det do iii = 1, N_det
@ -787,7 +787,7 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d
psi_h_alpha += i_h_alpha * psi_selectors_coef_tc(iii,2,1) ! left 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 alpha_h_psi += alpha_h_i * psi_selectors_coef_tc(iii,1,1) ! right function
enddo enddo
else if(debug_tc_pt2 == 1)then !! debugging the new version else if(debug_tc_pt2 == 2)then !! debugging the new version
psi_h_alpha_tmp = mat_l(istate, p1, p2) ! new version psi_h_alpha_tmp = mat_l(istate, p1, p2) ! new version
alpha_h_psi_tmp = mat_r(istate, p1, p2) ! new version alpha_h_psi_tmp = mat_r(istate, p1, p2) ! new version
psi_h_alpha = 0.d0 psi_h_alpha = 0.d0
@ -795,25 +795,32 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d
do iii = 1, N_det ! old version 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(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) 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 ! 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 ! 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 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).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-10 .or. dabs(alpha_h_psi - alpha_h_psi_tmp).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) call debug_det(det,N_int)
print*,'psi_h_alpha,alpha_h_psi' print*,'psi_h_alpha,alpha_h_psi'
print*,psi_h_alpha,alpha_h_psi print*,psi_h_alpha,alpha_h_psi
print*,psi_h_alpha_tmp,alpha_h_psi_tmp 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) 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 do iii = 1, N_det
call get_excitation_degree( psi_det(1,1,iii), det, degree, N_int) 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(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) 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 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) call debug_det(psi_det(1,1,iii),N_int)
print*,iii,degree,i_h_alpha,alpha_h_i print*,iii,degree,i_h_alpha,alpha_h_i
print*,leigvec_tc_bi_orth(iii,1),reigvec_tc_bi_orth(iii,1) print*,psi_h_alpha,alpha_h_psi
! print*,leigvec_tc_bi_orth(iii,1),reigvec_tc_bi_orth(iii,1)
endif endif
enddo enddo
stop stop

View File

@ -90,7 +90,7 @@ subroutine run_stochastic_cipsi
call pt2_alloc(pt2_data, N_states) call pt2_alloc(pt2_data, N_states)
call pt2_alloc(pt2_data_err, N_states) call pt2_alloc(pt2_data_err, N_states)
call ZMQ_pt2(E_denom, pt2_data, pt2_data_err, relative_error,to_select) ! Stochastic PT2 and selection call ZMQ_pt2(E_denom, pt2_data, pt2_data_err, relative_error,to_select) ! Stochastic PT2 and selection
stop ! stop
N_iter += 1 N_iter += 1

View File

@ -48,10 +48,10 @@ END_PROVIDER
do k=1,N_states do k=1,N_states
do i=1,N_det_selectors do i=1,N_det_selectors
psi_selectors_coef(i,k) = psi_coef_sorted_tc_gen(i,k) 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,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,2,k) = psi_r_coef_sorted_bi_ortho(i,k)
! psi_selectors_coef_tc(i,1,k) = 1.d0 psi_selectors_coef_tc(i,1,k) = 1.d0
! psi_selectors_coef_tc(i,2,k) = 1.d0 psi_selectors_coef_tc(i,2,k) = 1.d0
enddo enddo
enddo enddo