mirror of
https://github.com/LCPQ/quantum_package
synced 2024-11-18 12:03:57 +01:00
Official Lambda_MRCC
This commit is contained in:
parent
39d4186d28
commit
1ae3e9b5f4
@ -6,6 +6,7 @@ BEGIN_PROVIDER [ double precision, lambda_mrcc, (N_states,psi_det_size) ]
|
|||||||
integer :: i,k
|
integer :: i,k
|
||||||
double precision :: ihpsi_current(N_states)
|
double precision :: ihpsi_current(N_states)
|
||||||
integer :: i_pert_count
|
integer :: i_pert_count
|
||||||
|
double precision :: hii, lambda_pert
|
||||||
|
|
||||||
i_pert_count = 0
|
i_pert_count = 0
|
||||||
lambda_mrcc = 0.d0
|
lambda_mrcc = 0.d0
|
||||||
@ -13,40 +14,32 @@ BEGIN_PROVIDER [ double precision, lambda_mrcc, (N_states,psi_det_size) ]
|
|||||||
do i=1,N_det_non_ref
|
do i=1,N_det_non_ref
|
||||||
call i_h_psi(psi_non_ref(1,1,i), psi_ref, psi_ref_coef, N_int, N_det_ref,&
|
call i_h_psi(psi_non_ref(1,1,i), psi_ref, psi_ref_coef, N_int, N_det_ref,&
|
||||||
size(psi_ref_coef,1), N_states,ihpsi_current)
|
size(psi_ref_coef,1), N_states,ihpsi_current)
|
||||||
|
call i_H_j(psi_non_ref(1,1,i),psi_non_ref(1,1,i),N_int,hii)
|
||||||
do k=1,N_states
|
do k=1,N_states
|
||||||
if (ihpsi_current(k) == 0.d0) then
|
if (ihpsi_current(k) == 0.d0) then
|
||||||
ihpsi_current(k) = 1.d-32
|
ihpsi_current(k) = 1.d-32
|
||||||
endif
|
endif
|
||||||
lambda_mrcc(k,i) = psi_non_ref_coef(i,k)/ihpsi_current(k)
|
lambda_mrcc(k,i) = min(0.d0,psi_non_ref_coef(i,k)/ihpsi_current(k) )
|
||||||
if ( dabs(psi_non_ref_coef(i,k)*ihpsi_current(k)) < 1.d-6 ) then
|
lambda_pert = 1.d0 / (psi_ref_energy_diagonalized(k)-hii)
|
||||||
|
if (lambda_pert / lambda_mrcc(k,i) < 0.5d0 ) then
|
||||||
i_pert_count += 1
|
i_pert_count += 1
|
||||||
lambda_mrcc(k,i) = 0.d0
|
lambda_mrcc(k,i) = 0.d0
|
||||||
endif
|
endif
|
||||||
! double precision, parameter :: x = 2.d0
|
|
||||||
! if (lambda_mrcc(k,i) > x) then
|
|
||||||
! lambda_mrcc(k,i) = x
|
|
||||||
! else if (lambda_mrcc(k,i) < -x) then
|
|
||||||
! lambda_mrcc(k,i) = -x
|
|
||||||
! endif
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
print*,'N_det_non_ref = ',N_det_non_ref
|
print*,'N_det_non_ref = ',N_det_non_ref
|
||||||
print*,'Number of ignored determinants = ',i_pert_count
|
print*,'Number of ignored determinants = ',i_pert_count
|
||||||
print*,'psi_coef_ref_ratio = ',psi_ref_coef(2,1)/psi_ref_coef(1,1)
|
print*,'psi_coef_ref_ratio = ',psi_ref_coef(2,1)/psi_ref_coef(1,1)
|
||||||
print*,'lambda min/max = ',maxval(dabs(lambda_mrcc)), minval(dabs(lambda_mrcc))
|
print*,'lambda max = ',maxval(dabs(lambda_mrcc))
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
!BEGIN_PROVIDER [ double precision, delta_ij_non_ref, (N_det_non_ref, N_det_non_ref,N_states) ]
|
|
||||||
!implicit none
|
|
||||||
!BEGIN_DOC
|
|
||||||
!! Dressing matrix in SD basis
|
|
||||||
!END_DOC
|
|
||||||
!delta_ij_non_ref = 0.d0
|
|
||||||
!call H_apply_mrcc_simple(delta_ij_non_ref,N_det_non_ref)
|
|
||||||
!END_PROVIDER
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, hij_mrcc, (N_det_non_ref,N_det_ref) ]
|
BEGIN_PROVIDER [ double precision, hij_mrcc, (N_det_non_ref,N_det_ref) ]
|
||||||
implicit none
|
implicit none
|
||||||
|
@ -23,6 +23,7 @@ use bitmasks
|
|||||||
psi_ref_coef(i,k) = psi_cas_coef(i,k)
|
psi_ref_coef(i,k) = psi_cas_coef(i,k)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
call normalize(psi_ref_coef, N_det_ref)
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user