2014-05-27 17:30:44 +02:00
|
|
|
use bitmasks
|
|
|
|
|
|
|
|
BEGIN_PROVIDER [ integer, N_det_selectors]
|
2016-09-27 09:28:34 +02:00
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
|
|
|
! For Single reference wave functions, the number of selectors is 1 : the
|
|
|
|
! Hartree-Fock determinant
|
|
|
|
END_DOC
|
|
|
|
integer :: i
|
|
|
|
double precision :: norm, norm_max
|
2018-01-05 15:12:27 +01:00
|
|
|
call write_time(6)
|
2016-11-11 23:07:58 +01:00
|
|
|
N_det_selectors = N_det
|
2018-09-17 14:43:39 +02:00
|
|
|
norm = 1.d0
|
|
|
|
do i=1,N_det
|
|
|
|
norm = norm - psi_average_norm_contrib_sorted(i)
|
2018-09-18 00:03:39 +02:00
|
|
|
if (norm - 1.d-10 < 1.d0 - threshold_selectors) then
|
2018-09-17 14:43:39 +02:00
|
|
|
N_det_selectors = i
|
|
|
|
exit
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
N_det_selectors = max(N_det_selectors,N_det_generators)
|
2018-01-05 15:12:27 +01:00
|
|
|
call write_int(6,N_det_selectors,'Number of selectors')
|
2014-05-27 17:30:44 +02:00
|
|
|
END_PROVIDER
|
|
|
|
|
|
|
|
BEGIN_PROVIDER [ integer(bit_kind), psi_selectors, (N_int,2,psi_selectors_size) ]
|
|
|
|
&BEGIN_PROVIDER [ double precision, psi_selectors_coef, (psi_selectors_size,N_states) ]
|
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
2014-06-02 15:18:45 +02:00
|
|
|
! Determinants on which we apply <i|H|psi> for perturbation.
|
2014-05-27 17:30:44 +02:00
|
|
|
END_DOC
|
|
|
|
integer :: i,k
|
|
|
|
|
|
|
|
do i=1,N_det_selectors
|
|
|
|
do k=1,N_int
|
2014-06-02 15:18:45 +02:00
|
|
|
psi_selectors(k,1,i) = psi_det_sorted(k,1,i)
|
|
|
|
psi_selectors(k,2,i) = psi_det_sorted(k,2,i)
|
2014-05-27 17:30:44 +02:00
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
do k=1,N_states
|
|
|
|
do i=1,N_det_selectors
|
2014-06-02 15:18:45 +02:00
|
|
|
psi_selectors_coef(i,k) = psi_coef_sorted(i,k)
|
2014-05-27 17:30:44 +02:00
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
END_PROVIDER
|
|
|
|
|
2014-11-28 19:50:48 +01:00
|
|
|
|