Skip to content

Commit

Permalink
lassi op_o1 spin-sep h1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewRHermes committed Nov 2, 2023
1 parent 1f9e8b4 commit 3c3738a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion my_pyscf/lassi/op_o1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

Expand All @@ -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):
Expand Down

0 comments on commit 3c3738a

Please sign in to comment.