mirror of
https://github.com/LCPQ/quantum_package
synced 2024-10-19 22:41:48 +02:00
Fixed multi-state selection
This commit is contained in:
parent
3529637c32
commit
b1f17b91f8
@ -88,11 +88,20 @@ IRPF90
|
|||||||
|
|
||||||
The code can be automatically indented with :command:`irp_indent`.
|
The code can be automatically indented with :command:`irp_indent`.
|
||||||
|
|
||||||
Mathematical formulas in the `BEGIN_DOC...END_DOC` sections sould be written
|
Lines sould not be longer than 80 characters.
|
||||||
in LaTeX format, between `$` symbols.
|
|
||||||
|
Mathematical formulas in the `BEGIN_DOC...END_DOC` sections sould be written in
|
||||||
|
LaTeX format, between `$` symbols.
|
||||||
|
|
||||||
|
All the providers, subroutines and functions should have a
|
||||||
|
`BEGIN_DOC...END_DOC` block.
|
||||||
|
|
||||||
Providers should never be present in the same file as a main program.
|
Providers should never be present in the same file as a main program.
|
||||||
|
|
||||||
|
String must not use double quotes (`"`) but single quotes (`'`).
|
||||||
|
|
||||||
|
After a `read` statement there should be no comma.
|
||||||
|
|
||||||
|
Only standard Fortran is allowed : Intel or GNU extensions are forbidden.
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,6 +116,11 @@ subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm, N_in)
|
|||||||
integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket
|
integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket
|
||||||
type(selection_buffer) :: b
|
type(selection_buffer) :: b
|
||||||
|
|
||||||
|
PROVIDE psi_bilinear_matrix_columns_loc psi_det_alpha_unique psi_det_beta_unique
|
||||||
|
PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order
|
||||||
|
PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns
|
||||||
|
PROVIDE psi_bilinear_matrix_transp_order psi_selectors_coef_transp psi_det_sorted
|
||||||
|
|
||||||
|
|
||||||
if (N_det < max(10,N_states)) then
|
if (N_det < max(10,N_states)) then
|
||||||
pt2=0.d0
|
pt2=0.d0
|
||||||
|
@ -26,6 +26,8 @@ subroutine run_selection_slave(thread,iproc,energy)
|
|||||||
PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order
|
PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order
|
||||||
PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns
|
PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns
|
||||||
PROVIDE psi_bilinear_matrix_transp_order N_int pt2_F
|
PROVIDE psi_bilinear_matrix_transp_order N_int pt2_F
|
||||||
|
PROVIDE psi_selectors_coef_transp psi_det_sorted
|
||||||
|
|
||||||
|
|
||||||
zmq_to_qp_run_socket = new_zmq_to_qp_run_socket()
|
zmq_to_qp_run_socket = new_zmq_to_qp_run_socket()
|
||||||
|
|
||||||
|
@ -3,23 +3,9 @@ use bitmasks
|
|||||||
BEGIN_PROVIDER [ double precision, selection_weight, (N_states) ]
|
BEGIN_PROVIDER [ double precision, selection_weight, (N_states) ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Weights in the state-average calculation of the density matrix
|
! Weights used in the selection criterion
|
||||||
END_DOC
|
END_DOC
|
||||||
logical :: exists
|
selection_weight(1:N_states) = c0_weight(1:N_states)
|
||||||
|
|
||||||
selection_weight(:) = 1.d0
|
|
||||||
if (used_weight == 0) then
|
|
||||||
selection_weight(:) = c0_weight(:)
|
|
||||||
else if (used_weight == 1) then
|
|
||||||
selection_weight(:) = 1./N_states
|
|
||||||
else
|
|
||||||
call ezfio_has_determinants_state_average_weight(exists)
|
|
||||||
if (exists) then
|
|
||||||
call ezfio_get_determinants_state_average_weight(selection_weight)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
selection_weight(:) = selection_weight(:)+1.d-31
|
|
||||||
selection_weight(:) = selection_weight(:)/(sum(selection_weight(:)))
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
@ -171,9 +157,25 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d
|
|||||||
double precision :: rss
|
double precision :: rss
|
||||||
double precision, external :: memory_of_double, memory_of_int
|
double precision, external :: memory_of_double, memory_of_int
|
||||||
|
|
||||||
rss = memory_of_int( (8*N_int+5)*N_det + N_det_alpha_unique + 4*N_int*N_det_selectors)
|
PROVIDE psi_bilinear_matrix_columns_loc psi_det_alpha_unique psi_det_beta_unique
|
||||||
rss += memory_of_double(mo_num*mo_num*(N_states+1))
|
PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order
|
||||||
|
PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns
|
||||||
|
PROVIDE psi_bilinear_matrix_transp_order psi_selectors_coef_transp
|
||||||
|
|
||||||
|
rss = memory_of_double( &
|
||||||
|
N_int*2*N_det & ! preinteresting_det
|
||||||
|
+ N_int*2*N_det & ! fullminilist
|
||||||
|
+ N_int*2*N_det_selectors & ! minilist
|
||||||
|
+ N_states*mo_num*mo_num & ! mat
|
||||||
|
) + memory_of_int( &
|
||||||
|
+ (N_det+1)*2 & ! preinteresting, prefullinteresting,
|
||||||
|
+ (N_det+1)*2 & ! interesting, fullinteresting
|
||||||
|
+ mo_num*mo_num/2 & ! banned
|
||||||
|
+ mo_num/2 & ! bannedOrb
|
||||||
|
)
|
||||||
|
|
||||||
call check_mem(rss,irp_here)
|
call check_mem(rss,irp_here)
|
||||||
|
|
||||||
allocate (preinteresting_det(N_int,2,N_det))
|
allocate (preinteresting_det(N_int,2,N_det))
|
||||||
|
|
||||||
monoAdo = .true.
|
monoAdo = .true.
|
||||||
@ -200,11 +202,6 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d
|
|||||||
allocate (indices(N_det), &
|
allocate (indices(N_det), &
|
||||||
exc_degree(max(N_det_alpha_unique,N_det_beta_unique)))
|
exc_degree(max(N_det_alpha_unique,N_det_beta_unique)))
|
||||||
|
|
||||||
PROVIDE psi_bilinear_matrix_columns_loc psi_det_alpha_unique psi_det_beta_unique
|
|
||||||
PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order
|
|
||||||
PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns
|
|
||||||
PROVIDE psi_bilinear_matrix_transp_order
|
|
||||||
|
|
||||||
k=1
|
k=1
|
||||||
do i=1,N_det_alpha_unique
|
do i=1,N_det_alpha_unique
|
||||||
call get_excitation_degree_spin(psi_det_alpha_unique(1,i), &
|
call get_excitation_degree_spin(psi_det_alpha_unique(1,i), &
|
||||||
@ -561,11 +558,11 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d
|
|||||||
variance(istate) = variance(istate) + alpha_h_psi * alpha_h_psi
|
variance(istate) = variance(istate) + alpha_h_psi * alpha_h_psi
|
||||||
norm(istate) = norm(istate) + coef * coef
|
norm(istate) = norm(istate) + coef * coef
|
||||||
|
|
||||||
if (h0_type == "Variance") then
|
! if (h0_type == "Variance") then
|
||||||
sum_e_pert = sum_e_pert - alpha_h_psi * alpha_h_psi * selection_weight(istate)
|
! sum_e_pert = sum_e_pert - alpha_h_psi * alpha_h_psi * selection_weight(istate)
|
||||||
else
|
! else
|
||||||
sum_e_pert = sum_e_pert + e_pert * selection_weight(istate)
|
sum_e_pert = sum_e_pert + e_pert * selection_weight(istate)
|
||||||
endif
|
! endif
|
||||||
end do
|
end do
|
||||||
|
|
||||||
if(sum_e_pert <= buf%mini) then
|
if(sum_e_pert <= buf%mini) then
|
||||||
@ -590,7 +587,7 @@ subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, mat, intere
|
|||||||
integer(bit_kind) :: perMask(N_int, 2), mobMask(N_int, 2), negMask(N_int, 2)
|
integer(bit_kind) :: perMask(N_int, 2), mobMask(N_int, 2), negMask(N_int, 2)
|
||||||
integer(bit_kind) :: phasemask(N_int,2)
|
integer(bit_kind) :: phasemask(N_int,2)
|
||||||
|
|
||||||
PROVIDE psi_selectors_coef_transp
|
PROVIDE psi_selectors_coef_transp psi_det_sorted
|
||||||
mat = 0d0
|
mat = 0d0
|
||||||
|
|
||||||
do i=1,N_int
|
do i=1,N_int
|
||||||
|
@ -9,7 +9,7 @@ subroutine run_stochastic_cipsi
|
|||||||
|
|
||||||
double precision :: rss
|
double precision :: rss
|
||||||
double precision, external :: memory_of_double
|
double precision, external :: memory_of_double
|
||||||
threshold_generators = 1.d0
|
threshold_generators = 2.d0
|
||||||
SOFT_TOUCH threshold_generators
|
SOFT_TOUCH threshold_generators
|
||||||
|
|
||||||
rss = memory_of_double(N_states)*4.d0
|
rss = memory_of_double(N_states)*4.d0
|
||||||
|
@ -36,9 +36,9 @@ default: True
|
|||||||
|
|
||||||
[used_weight]
|
[used_weight]
|
||||||
type: integer
|
type: integer
|
||||||
doc: 0: 1./(c_0^2), 1: 1/N_states, 2: input state-average weight, 3: 1/(Norm_L3(Psi))
|
doc: Weight used in the calculation of the one-electron density matrix. 0: 1./(c_0^2), 1: 1/N_states, 2: input state-average weight, 3: 1/(Norm_L3(Psi))
|
||||||
interface: ezfio,provider,ocaml
|
interface: ezfio,provider,ocaml
|
||||||
default: 0
|
default: 1
|
||||||
|
|
||||||
[threshold_generators]
|
[threshold_generators]
|
||||||
type: Threshold
|
type: Threshold
|
||||||
|
@ -24,9 +24,4 @@ doc: The selection process stops at a fixed correlation ratio (useful for gettin
|
|||||||
interface: ezfio,provider,ocaml
|
interface: ezfio,provider,ocaml
|
||||||
default: 1.00
|
default: 1.00
|
||||||
|
|
||||||
[h0_type]
|
|
||||||
type: Perturbation
|
|
||||||
doc: Type of zeroth-order Hamiltonian [ EN | Barycentric | Variance | SOP ]
|
|
||||||
interface: ezfio,provider,ocaml
|
|
||||||
default: EN
|
|
||||||
|
|
||||||
|
12
src/perturbation/h0_type.irp.f
Normal file
12
src/perturbation/h0_type.irp.f
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
BEGIN_PROVIDER [ character*32,h0_type ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Type of zeroth-order Hamiltonian
|
||||||
|
END_DOC
|
||||||
|
if (s2_eig) then
|
||||||
|
h0_type = 'SOP'
|
||||||
|
else
|
||||||
|
h0_type = 'EN'
|
||||||
|
endif
|
||||||
|
END_PROVIDER
|
||||||
|
|
Loading…
Reference in New Issue
Block a user