9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-06-25 22:12:05 +02:00

Multi-state Exc_max

This commit is contained in:
Anthony Scemama 2020-12-22 00:27:09 +01:00
parent b3e9c49514
commit 23a96f54ac
2 changed files with 40 additions and 7 deletions

View File

@ -773,22 +773,35 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d
endif
integer :: degree
logical :: do_cycle
if (excitation_max >= 0) then
integer :: degree
call get_excitation_degree(ref_bitmask(1,1),det(1,1),degree,N_int)
if (degree > excitation_max) cycle
do_cycle = .True.
do k=1,N_states
call get_excitation_degree(psi_det(1,1,dominant_det(k)),det(1,1),degree,N_int)
do_cycle = do_cycle .and. (degree > excitation_max)
enddo
if (do_cycle) cycle
endif
if (excitation_alpha_max >= 0) then
call get_excitation_degree_spin(ref_bitmask(1,1),det(1,1),degree,N_int)
if (degree > excitation_alpha_max) cycle
do_cycle = .True.
do k=1,N_states
call get_excitation_degree_spin(psi_det(1,1,dominant_det(k)),det(1,1),degree,N_int)
do_cycle = do_cycle .and. (degree > excitation_alpha_max)
enddo
if (do_cycle) cycle
endif
if (excitation_beta_max >= 0) then
call get_excitation_degree_spin(ref_bitmask(1,2),det(1,2),degree,N_int)
if (degree > excitation_beta_max) cycle
do_cycle = .True.
do k=1,N_states
call get_excitation_degree_spin(psi_det(1,2,dominant_det(k)),det(1,2),degree,N_int)
do_cycle = do_cycle .and. (degree > excitation_beta_max)
enddo
if (do_cycle) cycle
endif

View File

@ -256,6 +256,26 @@ BEGIN_PROVIDER [ double precision, psi_average_norm_contrib, (psi_det_size) ]
enddo
END_PROVIDER
BEGIN_PROVIDER [ integer, dominant_det, (N_states) ]
implicit none
BEGIN_DOC
! Determinant with the largest weight, for each state
END_DOC
integer :: i, k
double precision :: wmax, c
do k=1,N_states
wmax = 0.d0
do i=1,N_det
c = psi_coef(i,k)*psi_coef(i,k)
if (c > wmax) then
dominant_det(k) = i
wmax = c
endif
enddo
enddo
END_PROVIDER
!==============================================================================!