10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-25 05:43:47 +01:00

Comment to clarify Selectors_CASSD

This commit is contained in:
Anthony Scemama 2018-02-28 16:12:46 +01:00
parent 005137061e
commit c9416a5a68
2 changed files with 7 additions and 15 deletions

View File

@ -29,7 +29,7 @@ END_PROVIDER
END_DOC END_DOC
integer :: i, k, l, m integer :: i, k, l, m
logical :: good logical :: good
integer :: number_of_holes,number_of_particles integer, external :: number_of_holes,number_of_particles
m=0 m=0
do i=1,N_det do i=1,N_det
good = ( number_of_holes(psi_det_sorted(1,1,i)) ==0).and.(number_of_particles(psi_det_sorted(1,1,i))==0 ) good = ( number_of_holes(psi_det_sorted(1,1,i)) ==0).and.(number_of_particles(psi_det_sorted(1,1,i))==0 )

View File

@ -14,9 +14,13 @@ END_PROVIDER
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! Determinants on which we apply <i|H|psi> for perturbation. ! Determinants on which we apply <i|H|psi> for perturbation.
! The selectors are equivalent to Selectors_full, but in a different
! order. The Generators_CAS determinants appear first, then all the
! others.
END_DOC END_DOC
integer :: i, k, l, m integer :: i, k, l, m
logical :: good logical :: good
integer, external :: number_of_holes,number_of_particles
do i=1,N_det_generators do i=1,N_det_generators
do k=1,N_int do k=1,N_int
@ -33,19 +37,7 @@ END_PROVIDER
m=N_det_generators m=N_det_generators
do i=1,N_det do i=1,N_det
do l=1,n_cas_bitmask good = ( number_of_holes(psi_det_sorted(1,1,i)) ==0).and.(number_of_particles(psi_det_sorted(1,1,i))==0 )
good = .True.
do k=1,N_int
good = good .and. ( &
iand(not(cas_bitmask(k,1,l)), psi_det_sorted(k,1,i)) == &
iand(not(cas_bitmask(k,1,l)), HF_bitmask(k,1)) .and. ( &
iand(not(cas_bitmask(k,2,l)), psi_det_sorted(k,2,i)) == &
iand(not(cas_bitmask(k,2,l)), HF_bitmask(k,2) )) )
enddo
if (good) then
exit
endif
enddo
if (.not.good) then if (.not.good) then
m = m+1 m = m+1
do k=1,N_int do k=1,N_int
@ -57,7 +49,7 @@ END_PROVIDER
enddo enddo
if (N_det /= m) then if (N_det /= m) then
print *, N_det, m print *, N_det, m
stop 'N_det /= m' stop 'Selectors_CASSD : N_det /= m'
endif endif
END_PROVIDER END_PROVIDER