9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-18 11:23:38 +01:00

Optimized get_all_spin_singles

This commit is contained in:
Anthony Scemama 2021-03-26 00:26:31 +01:00
parent 610304c37a
commit d217a6b9f1

View File

@ -1193,16 +1193,10 @@ subroutine get_all_spin_singles_and_doubles_$N_int(buffer, idx, spindet, size_bu
xorvec(k) = xor( spindet(k), buffer(k,i) ) xorvec(k) = xor( spindet(k), buffer(k,i) )
enddo enddo
if (xorvec(1) /= 0_8) then
degree = popcnt(xorvec(1))
else
degree = 0 degree = 0
endif
do k=2,$N_int do k=1,$N_int
if ( (degree <= 4).and.(xorvec(k) /= 0_8) ) then
degree = degree + popcnt(xorvec(k)) degree = degree + popcnt(xorvec(k))
endif
enddo enddo
if ( degree == 4 ) then if ( degree == 4 ) then
@ -1247,22 +1241,18 @@ subroutine get_all_spin_singles_$N_int(buffer, idx, spindet, size_buffer, single
xorvec(k) = xor( spindet(k), buffer(k,i) ) xorvec(k) = xor( spindet(k), buffer(k,i) )
enddo enddo
if (xorvec(1) /= 0_8) then
degree = popcnt(xorvec(1))
else
degree = 0 degree = 0
endif
do k=2,$N_int do k=1,$N_int
if ( (degree <= 2).and.(xorvec(k) /= 0_8) ) then
degree = degree + popcnt(xorvec(k)) degree = degree + popcnt(xorvec(k))
endif
enddo enddo
if ( degree == 2 ) then if ( degree /= 2 ) then
cycle
endif
singles(n_singles) = idx(i) singles(n_singles) = idx(i)
n_singles = n_singles+1 n_singles = n_singles+1
endif
enddo enddo
n_singles = n_singles-1 n_singles = n_singles-1
@ -1296,22 +1286,18 @@ subroutine get_all_spin_doubles_$N_int(buffer, idx, spindet, size_buffer, double
xorvec(k) = xor( spindet(k), buffer(k,i) ) xorvec(k) = xor( spindet(k), buffer(k,i) )
enddo enddo
if (xorvec(1) /= 0_8) then
degree = popcnt(xorvec(1))
else
degree = 0 degree = 0
endif
do k=2,$N_int do k=1,$N_int
if ( (degree <= 4).and.(xorvec(k) /= 0_8) ) then
degree = degree + popcnt(xorvec(k)) degree = degree + popcnt(xorvec(k))
endif
enddo enddo
if ( degree == 4 ) then if ( degree /= 4 ) then
cycle
endif
doubles(n_doubles) = idx(i) doubles(n_doubles) = idx(i)
n_doubles = n_doubles+1 n_doubles = n_doubles+1
endif
enddo enddo