mirror of
https://github.com/LCPQ/quantum_package
synced 2024-10-20 06:48:20 +02:00
Fixed SOP
This commit is contained in:
parent
c78fde9523
commit
e251c2f147
@ -327,63 +327,37 @@ BEGIN_PROVIDER [ integer, det_to_occ_pattern, (N_det) ]
|
|||||||
|
|
||||||
key = occ_pattern_search_key(occ,N_int)
|
key = occ_pattern_search_key(occ,N_int)
|
||||||
|
|
||||||
! Binary search
|
! TODO: Binary search
|
||||||
l = 1
|
l = 1
|
||||||
r = N_occ_pattern
|
r = N_occ_pattern
|
||||||
do while(r-l > 1)
|
! do while(r-l > 32)
|
||||||
j = shiftr(r+l,1)
|
! j = shiftr(r+l,1)
|
||||||
if (bit_tmp(j) < key) then
|
! if (bit_tmp(j) < key) then
|
||||||
l = j
|
! l = j
|
||||||
else
|
! else
|
||||||
r = j
|
! r = j
|
||||||
endif
|
! endif
|
||||||
enddo
|
! enddo
|
||||||
|
do j=l,r
|
||||||
do while (bit_tmp(l) == key)
|
|
||||||
if (l == 0) then
|
|
||||||
print *, '1 bug in ', irp_here
|
|
||||||
stop -1
|
|
||||||
endif
|
|
||||||
found = .True.
|
found = .True.
|
||||||
do k=1,N_int
|
do k=1,N_int
|
||||||
if ( (occ(k,1) /= psi_occ_pattern(k,1,l)) &
|
if ( (occ(k,1) /= psi_occ_pattern(k,1,j)) &
|
||||||
.or. (occ(k,2) /= psi_occ_pattern(k,2,l)) ) then
|
.or. (occ(k,2) /= psi_occ_pattern(k,2,j)) ) then
|
||||||
found = .False.
|
found = .False.
|
||||||
exit
|
exit
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
if (found) then
|
if (found) then
|
||||||
det_to_occ_pattern(i) = l
|
det_to_occ_pattern(i) = j
|
||||||
r=1
|
|
||||||
exit
|
exit
|
||||||
endif
|
endif
|
||||||
l = l-1
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
do while (bit_tmp(r) == key)
|
|
||||||
if (r > N_occ_pattern) then
|
|
||||||
print *, '2 bug in ', irp_here
|
|
||||||
stop -1
|
|
||||||
endif
|
|
||||||
found = .True.
|
|
||||||
do k=1,N_int
|
|
||||||
if ( (occ(k,1) /= psi_occ_pattern(k,1,r)) &
|
|
||||||
.or. (occ(k,2) /= psi_occ_pattern(k,2,r)) ) then
|
|
||||||
found = .False.
|
|
||||||
exit
|
|
||||||
endif
|
|
||||||
enddo
|
|
||||||
if (found) then
|
|
||||||
det_to_occ_pattern(i) = r
|
|
||||||
exit
|
|
||||||
endif
|
|
||||||
r = r+1
|
|
||||||
if (.not.found) then
|
if (.not.found) then
|
||||||
print *, '3 bug in ', irp_here
|
print *, '3 bug in ', irp_here
|
||||||
stop -1
|
stop -1
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
enddo
|
|
||||||
!$OMP END PARALLEL DO
|
!$OMP END PARALLEL DO
|
||||||
deallocate(bit_tmp)
|
deallocate(bit_tmp)
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
Loading…
Reference in New Issue
Block a user