From 3c3738a776a15abbcededc260c78231790c6794e Mon Sep 17 00:00:00 2001 From: Matthew R Hermes Date: Thu, 2 Nov 2023 13:19:50 -0500 Subject: [PATCH] lassi op_o1 spin-sep h1 support --- my_pyscf/lassi/op_o1.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/my_pyscf/lassi/op_o1.py b/my_pyscf/lassi/op_o1.py index ff1677d9..670aa160 100644 --- a/my_pyscf/lassi/op_o1.py +++ b/my_pyscf/lassi/op_o1.py @@ -953,6 +953,7 @@ class HamS2ovlpint (LSTDMint2): def __init__(self, ints, nlas, hopping_index, lroots, h1, h2, dtype=np.float64): LSTDMint2.__init__(self, ints, nlas, hopping_index, lroots, dtype=dtype) + if h1.ndim==2: h1 = np.stack ([h1,h1], axis=0) self.h1 = h1.ravel () self.h2 = h2.ravel () @@ -965,9 +966,9 @@ def _get_D2_(self, bra, ket): return self.d2 def _put_D1_(self, bra, ket, D1): + self.ham[bra,ket] += np.dot (self.h1, D1.ravel ()) M1 = D1[0] - D1[1] D1 = D1.sum (0) - self.ham[bra,ket] += np.dot (self.h1, D1.ravel ()) self.s2[bra,ket] += (np.trace (M1)/2)**2 + np.trace (D1)/2 def _put_D2_(self, bra, ket, D2):