9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-25 21:03:32 +01:00

Fixed initialization in get_phase.

This commit is contained in:
v1j4y 2021-03-01 14:18:13 +01:00
parent 67f59ba52a
commit c1ef95cd60

View File

@ -74,6 +74,10 @@ subroutine get_phase_qp_to_cfg(Ialpha, Ibeta, phaseout)
integer :: nbetas integer :: nbetas
integer :: count, k integer :: count, k
! Initliaze deta and detb
deta = Ialpha
detb = Ibeta
! Find how many alpha electrons there are in all the N_ints ! Find how many alpha electrons there are in all the N_ints
integer :: Na(N_int) integer :: Na(N_int)
do k=1,N_int do k=1,N_int
@ -90,7 +94,7 @@ subroutine get_phase_qp_to_cfg(Ialpha, Ibeta, phaseout)
detb(k) = ibclr(detb(k),ipos) detb(k) = ibclr(detb(k),ipos)
! Create a mask will all MOs higher than the beta electron ! Create a mask will all MOs higher than the beta electron
mask = not(shiftl(1_bit_kind,ipos+1) - 1_bit_kind) mask = not(shiftl(1_bit_kind,ipos + 1) - 1_bit_kind)
! Apply the mask to the alpha string to count how many electrons to cross ! Apply the mask to the alpha string to count how many electrons to cross
nperm = popcnt( iand(mask, deta(k)) ) nperm = popcnt( iand(mask, deta(k)) )