2014-05-29 01:46:50 +02:00
|
|
|
use bitmasks
|
|
|
|
|
|
|
|
BEGIN_PROVIDER [ integer, N_det_generators ]
|
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
|
|
|
! For Single reference wave functions, the number of generators is 1 : the
|
|
|
|
! Hartree-Fock determinant
|
|
|
|
END_DOC
|
|
|
|
integer :: i
|
|
|
|
double precision :: norm
|
2018-01-05 15:12:27 +01:00
|
|
|
call write_time(6)
|
2014-05-29 01:46:50 +02:00
|
|
|
norm = 0.d0
|
|
|
|
N_det_generators = N_det
|
|
|
|
do i=1,N_det
|
|
|
|
norm = norm + psi_average_norm_contrib_sorted(i)
|
2018-09-06 15:19:51 +02:00
|
|
|
if (norm > threshold_generators+1d-10) then
|
2014-06-03 19:14:12 +02:00
|
|
|
N_det_generators = i
|
2014-05-29 01:46:50 +02:00
|
|
|
exit
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
N_det_generators = max(N_det_generators,1)
|
2018-01-05 15:12:27 +01:00
|
|
|
call write_int(6,N_det_generators,'Number of generators')
|
2014-05-29 01:46:50 +02:00
|
|
|
END_PROVIDER
|
|
|
|
|
2015-04-02 11:40:16 +02:00
|
|
|
BEGIN_PROVIDER [ integer(bit_kind), psi_det_generators, (N_int,2,psi_det_size) ]
|
|
|
|
&BEGIN_PROVIDER [ double precision, psi_coef_generators, (psi_det_size,N_states) ]
|
2014-05-29 01:46:50 +02:00
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
|
|
|
! For Single reference wave functions, the generator is the
|
|
|
|
! Hartree-Fock determinant
|
|
|
|
END_DOC
|
2018-01-10 18:11:49 +01:00
|
|
|
psi_det_generators(1:N_int,1:2,1:N_det) = psi_det_sorted(1:N_int,1:2,1:N_det)
|
|
|
|
psi_coef_generators(1:N_det,1:N_states) = psi_coef_sorted(1:N_det,1:N_states)
|
2014-05-29 01:46:50 +02:00
|
|
|
|
|
|
|
END_PROVIDER
|
|
|
|
|
2018-05-25 17:40:27 +02:00
|
|
|
BEGIN_PROVIDER [ integer(bit_kind), psi_det_sorted_gen, (N_int,2,psi_det_size) ]
|
|
|
|
&BEGIN_PROVIDER [ double precision, psi_coef_sorted_gen, (psi_det_size,N_states) ]
|
|
|
|
&BEGIN_PROVIDER [ integer, psi_det_sorted_gen_order, (psi_det_size) ]
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
|
|
|
! For Single reference wave functions, the generator is the
|
|
|
|
! Hartree-Fock determinant
|
|
|
|
END_DOC
|
|
|
|
psi_det_sorted_gen = psi_det_sorted
|
|
|
|
psi_coef_sorted_gen = psi_coef_sorted
|
2018-06-25 14:18:46 +02:00
|
|
|
psi_det_sorted_gen_order = psi_det_sorted_order
|
2018-05-25 17:40:27 +02:00
|
|
|
END_PROVIDER
|
|
|
|
|
|
|
|
|
2015-03-19 21:14:52 +01:00
|
|
|
BEGIN_PROVIDER [integer, degree_max_generators]
|
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
|
|
|
! Max degree of excitation (respect to HF) of the generators
|
|
|
|
END_DOC
|
|
|
|
integer :: i,degree
|
|
|
|
degree_max_generators = 0
|
|
|
|
do i = 1, N_det_generators
|
2015-04-02 10:26:45 +02:00
|
|
|
call get_excitation_degree(HF_bitmask,psi_det_generators(1,1,i),degree,N_int)
|
2015-03-19 21:14:52 +01:00
|
|
|
if(degree .gt. degree_max_generators)then
|
|
|
|
degree_max_generators = degree
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
END_PROVIDER
|
|
|
|
|
2014-06-25 14:58:58 +02:00
|
|
|
BEGIN_PROVIDER [ integer, size_select_max]
|
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
|
|
|
! Size of the select_max array
|
|
|
|
END_DOC
|
|
|
|
size_select_max = 10000
|
|
|
|
END_PROVIDER
|
|
|
|
|
2014-06-26 09:30:06 +02:00
|
|
|
BEGIN_PROVIDER [ double precision, select_max, (size_select_max) ]
|
2014-06-02 21:43:55 +02:00
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
|
|
|
! Memo to skip useless selectors
|
|
|
|
END_DOC
|
|
|
|
select_max = huge(1.d0)
|
|
|
|
END_PROVIDER
|
2014-05-29 01:46:50 +02:00
|
|
|
|