10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-26 15:12:14 +02:00
quantum_package/src/CISD_SC2_selected/cisd_sc2_selection.irp.f

74 lines
2.2 KiB
FortranFixed
Raw Normal View History

2014-05-30 18:07:04 +02:00
program cisd_sc2_selected
implicit none
integer :: i,k
use bitmasks
2014-05-30 18:07:04 +02:00
double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:),E_old(:)
integer :: N_st, iter,degree
2014-05-30 18:07:04 +02:00
character*(64) :: perturbation
N_st = N_states
allocate (pt2(N_st), norm_pert(N_st), H_pert_diag(N_st),E_old(N_st))
pt2 = 1.d0
perturbation = "epstein_nesbet_sc2_projected"
E_old(1) = HF_energy
2014-06-04 21:28:43 +02:00
davidson_threshold = 1.d-4
do while (maxval(abs(pt2(1:N_st))) > 1.d-6)
2014-05-30 18:07:04 +02:00
print*,'----'
print*,''
call H_apply_cisd_selection(perturbation,pt2, norm_pert, H_pert_diag, N_st)
2014-06-04 21:28:43 +02:00
! soft_touch det_connections
2014-05-30 18:07:04 +02:00
call diagonalize_CI_SC2
print *, 'N_det = ', N_det
2014-05-31 11:35:44 +02:00
do i = 1, N_st
print*,'state ',i
2014-05-31 11:35:44 +02:00
print *, 'PT2(SC2) = ', pt2(i)
print *, 'E(SC2) = ', CI_SC2_energy(i)
print *, 'E_before(SC2)+PT2(SC2) = ', (E_old(i)+pt2(i))
2014-05-31 11:35:44 +02:00
if(i==1)then
print *, 'E(SC2)+PT2(projctd)SC2 = ', (E_old(i)+H_pert_diag(i))
endif
E_old(i) = CI_SC2_energy(i)
2014-05-31 11:35:44 +02:00
enddo
2014-05-30 18:07:04 +02:00
! print *, 'E corr = ', (E_old(1)) - HF_energy
if (abort_all) then
exit
endif
enddo
2014-06-05 02:45:31 +02:00
pt2 = 0.d0
call H_apply_PT2(pt2, norm_pert, H_pert_diag, N_st)
2014-06-04 21:28:43 +02:00
davidson_threshold = 1.d-8
touch davidson_threshold davidson_criterion
do i = 1, N_st
max = 0.d0
print*,''
print*,'-------------'
print*,'for state ',i
print*,''
do k = 1, N_det
if(dabs(psi_coef(k,i)).gt.max)then
max = dabs(psi_coef(k,i))
imax = k
endif
enddo
double precision :: max
integer :: imax
print *, 'PT2(SC2) = ', pt2(i)
print *, 'E(SC2) = ', CI_SC2_energy(i)
2014-06-05 02:45:31 +02:00
print *, 'E_before(SC2)+PT2(SC2) = ', (CI_SC2_energy(i)+pt2(i))
if(i==1)then
2014-06-05 02:45:31 +02:00
print *, 'E(SC2)+PT2(projctd)SC2 = ', (CI_SC2_energy(i)+H_pert_diag(i))
endif
print*,'greater coeficient of the state : ',dabs(psi_coef(imax,i))
call get_excitation_degree(ref_bitmask,psi_det(1,1,imax),degree,N_int)
print*,'degree of excitation of such determinant : ',degree
enddo
2014-06-05 02:45:31 +02:00
print*,'coucou'
2014-05-30 18:07:04 +02:00
deallocate(pt2,norm_pert,H_pert_diag)
end