10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-02 11:25:26 +02:00

Introduced provider for psi_ref_coef_normalized

This commit is contained in:
Anthony Scemama 2016-04-01 01:31:11 +02:00
parent 3b2735886e
commit dd8647d5aa
3 changed files with 19 additions and 5 deletions

View File

@ -1,7 +1,8 @@
program mrcc_noiter
implicit none
read_wf = .True.
SOFT_TOUCH read_wf
threshold_generators = .9999d0
SOFT_TOUCH read_wf threshold_generators
call print_cas_coefs
call set_generators_bitmasks_as_holes_and_particles
call run

View File

@ -12,7 +12,7 @@ BEGIN_PROVIDER [ double precision, lambda_mrcc, (N_states,psi_det_size) ]
lambda_mrcc = 0.d0
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_normalized, N_int, N_det_ref,&
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
@ -21,8 +21,7 @@ BEGIN_PROVIDER [ double precision, lambda_mrcc, (N_states,psi_det_size) ]
endif
lambda_mrcc(k,i) = min(0.d0,psi_non_ref_coef(i,k)/ihpsi_current(k) )
lambda_pert = 1.d0 / (psi_ref_energy_diagonalized(k)-hii)
if ((lambda_pert < 0.5d0 * lambda_mrcc(k,i)).or. &
(lambda_pert > 2.0d0 * lambda_mrcc(k,i)) ) then
if (lambda_pert / lambda_mrcc(k,i) < 0.5d0) then
i_pert_count += 1
lambda_mrcc(k,i) = 0.d0
endif

View File

@ -23,7 +23,21 @@ use bitmasks
psi_ref_coef(i,k) = psi_cas_coef(i,k)
enddo
enddo
call normalize(psi_ref_coef, N_det_ref)
END_PROVIDER
BEGIN_PROVIDER [ double precision, psi_ref_coef_normalized, (psi_det_size,n_states) ]
implicit none
BEGIN_DOC
! Normalized coefficients of the reference
END_DOC
integer :: i,j,k
do k=1,N_states
do j=1,N_det_ref
psi_ref_coef_normalized(j,k) = psi_ref_coef(j,k)
enddo
call normalize(psi_ref_coef_normalized(1,k), N_det_ref)
enddo
END_PROVIDER