From 4ccaa8f695a4928be80bb214dd063a7b7e9d28a9 Mon Sep 17 00:00:00 2001 From: v1j4y Date: Mon, 6 Jun 2022 13:41:29 +0200 Subject: [PATCH] Open-Shell CSF: Fix bug in getbftodetfunction. --- src/csf/cfgCI_utils.c | 50 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/src/csf/cfgCI_utils.c b/src/csf/cfgCI_utils.c index 23b984a0..63172d14 100644 --- a/src/csf/cfgCI_utils.c +++ b/src/csf/cfgCI_utils.c @@ -68,10 +68,16 @@ void getBFIndexList(int NSOMO, int *BF1, int *IdxListBF1){ break; } } - BFcopy[Iidx] = -1; - BFcopy[Jidx] = -1; - IdxListBF1[Jidx] = Iidx; - IdxListBF1[Iidx] = Jidx; + if(countN1 <= 0){ + BFcopy[Iidx] = -1; + IdxListBF1[Iidx] = Iidx; + } + else{ + BFcopy[Iidx] = -1; + BFcopy[Jidx] = -1; + IdxListBF1[Jidx] = Iidx; + IdxListBF1[Iidx] = Jidx; + } } } @@ -1297,16 +1303,21 @@ void getbftodetfunction(Tree *dettree, int NSOMO, int MS, int *BF1, double *rowv double fac = 1.0; for(int i = 0; i < NSOMO; i++) donepq[i] = 0.0; + for(int i=0;i 0.0 || donepq[idxq] > 0.0) continue; + if(donepq[idxp] > 0.0 || donepq[idxq] > 0.0 || idxp == idxq) continue; fac *= 2.0; donepq[idxp] = 1.0; donepq[idxq] = 1.0; for(int j = 0; j < npairs; j = j + shft){ + printf("i=%d j=%d (%d,%d)\n",i,j,idxp,idxq); for(int k = 0; k < shft/2; k++){ detslist[(k+j)*NSOMO + idxp] = 1; detslist[(k+j)*NSOMO + idxq] = 0; @@ -1319,15 +1330,26 @@ void getbftodetfunction(Tree *dettree, int NSOMO, int MS, int *BF1, double *rowv } shft /= 2; } + for(int i=0;i