9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-22 19:43:32 +01:00

diagonalization before starting tc cisd(SC)2
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
eginer 2022-11-08 00:25:41 +01:00
parent 71104f081e
commit e2fe9169c1

View File

@ -9,7 +9,9 @@
allocate(leigvec_tc_bi_orth_tmp(N_det,N_det),reigvec_tc_bi_orth_tmp(N_det,N_det),eigval_right_tmp(N_det))
allocate(e_corr_dets(N_det),h0j(N_det),h_sc2(N_det,N_det),dressing_dets(N_det))
allocate(H_jj(N_det),vec_tmp(N_det,n_states_diag),eigval_tmp(N_states))
dressing_dets = 0.d0
do i = 1, N_det
call htilde_mu_mat_bi_ortho_tot(psi_det(1,1,i), psi_det(1,1,i), N_int, H_jj(i))
call get_excitation_degree(HF_bitmask,psi_det(1,1,i),degree,N_int)
if(degree == 1 .or. degree == 2)then
call htilde_mu_mat_bi_ortho(HF_bitmask,psi_det(1,1,i),N_int,hmono,htwoe,hthree,h0j(i))
@ -18,16 +20,20 @@
reigvec_tc_bi_orth_tmp = 0.d0
do i = 1, N_det
reigvec_tc_bi_orth_tmp(i,1) = psi_r_coef_bi_ortho(i,1)
enddo
vec_tmp = 0.d0
do istate = 1, N_states
vec_tmp(:,istate) = reigvec_tc_bi_orth_tmp(:,istate)
enddo
do istate = N_states+1, n_states_diag
vec_tmp(istate,istate) = 1.d0
enddo
print*,'Diagonalizing the TC CISD '
call davidson_general_diag_dressed_ext_rout_nonsym_b1space(vec_tmp, H_jj, dressing_dets,eigval_tmp, N_det, n_states, n_states_diag, converged, htc_bi_ortho_calc_tdav)
do i = 1, N_det
e_corr_dets(i) = reigvec_tc_bi_orth_tmp(i,1) * h0j(i)/reigvec_tc_bi_orth_tmp(1,1)
enddo
call htc_bi_ortho_calc_tdav(vec_tmp(1,1),reigvec_tc_bi_orth_tmp(1,1), n_states_diag, N_det)
E_before = 0.d0
accu = 0.d0
do i = 1, N_det
E_before = psi_l_coef_bi_ortho(i,1) * vec_tmp(i,1)
accu += psi_l_coef_bi_ortho(i,1) * psi_r_coef_bi_ortho(i,1)
enddo
E_before = E_before/accu
E_before = eigval_tmp(1)
print*,'Starting from ',E_before
e_current = 10.d0
@ -38,9 +44,6 @@
external htc_bi_ortho_calc_tdav
external htcdag_bi_ortho_calc_tdav
logical :: converged
do i = 1, N_det
call htilde_mu_mat_bi_ortho_tot(psi_det(1,1,i), psi_det(1,1,i), N_int, H_jj(i))
enddo
do while (dabs(E_before-E_current).gt.thr)
it += 1
E_before = E_current