From 148a6fc671e4ba17f64ef3ff74e5676c8de2cb8b Mon Sep 17 00:00:00 2001 From: Qiming Sun Date: Thu, 30 Nov 2023 14:16:56 -0800 Subject: [PATCH] Fix a bug in ci string function --- pyscf/lib/mcscf/fci_contract.c | 6 ++---- pyscf/lib/mcscf/fci_string.c | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pyscf/lib/mcscf/fci_contract.c b/pyscf/lib/mcscf/fci_contract.c index fe4af02261..045eb2fed9 100644 --- a/pyscf/lib/mcscf/fci_contract.c +++ b/pyscf/lib/mcscf/fci_contract.c @@ -119,9 +119,8 @@ void FCIprog_b_t1(double *ci0, double *t1, sign = EXTRACT_SIGN(tab[j]); if (sign == 0) { break; - } else { - t1[ia*bcount+str0] += sign * pci[str1]; } + t1[ia*bcount+str0] += sign * pci[str1]; } tab += nlinkb; } @@ -176,9 +175,8 @@ void FCIspread_b_t1(double *ci1, double *t1, sign = EXTRACT_SIGN(tab[j]); if (sign == 0) { break; - } else { - pci[str1] += sign * t1[ia*bcount+str0]; } + pci[str1] += sign * t1[ia*bcount+str0]; } tab += nlinkb; } diff --git a/pyscf/lib/mcscf/fci_string.c b/pyscf/lib/mcscf/fci_string.c index 2110c493aa..adae90da46 100644 --- a/pyscf/lib/mcscf/fci_string.c +++ b/pyscf/lib/mcscf/fci_string.c @@ -136,6 +136,7 @@ static int binomial(int n, int m) val *= i; val /= i - m; } + return val; } }