From 64d80fd2737b6995723b1583ca2ebfac16a59ec3 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 7 Feb 2022 11:02:54 +0100 Subject: [PATCH] Fix CSF --- src/csf/conversion.irp.f | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/csf/conversion.irp.f b/src/csf/conversion.irp.f index 7d6a9ca8..f6f12ba9 100644 --- a/src/csf/conversion.irp.f +++ b/src/csf/conversion.irp.f @@ -58,19 +58,19 @@ subroutine convertWFfromDETtoCSF(N_st,psi_coef_det_in, psi_coef_cfg_out) enddo enddo - s = 0 + s = 0 ! s == total number of SOMOs do k=1,N_int if (psi_configuration(k,1,i) == 0_bit_kind) cycle s = s + popcnt(psi_configuration(k,1,i)) enddo - bfIcfg = max(1,nint((binom(s,(s+1)/2)-binom(s,((s+1)/2)+1)))) -! ! Test 1 -! if(iand(MS,1) .EQ. 0) then -! bfIcfg = max(1,nint((binom(s,s/2)-binom(s,s/2+1)))) -! else -! bfIcfg = max(1,nint((binom(s,(s+1)/2)-binom(s,((s+1)/2)+1)))) -! endif + bfIcfg = max(1,nint((binom(s,(s+1)/2)-binom(s,((s+1)/2)+1)))) + + if(iand(s,1) .EQ. 0) then + bfIcfg = max(1,nint((binom(s,s/2)-binom(s,(s/2)+1)))) + else + bfIcfg = max(1,nint((binom(s,(s+1)/2)-binom(s,((s+1)/2)+1)))) + endif ! perhaps blocking with CFGs of same seniority ! can be more efficient