Skip to content

Commit

Permalink
fix mpe eff when bra != ket
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Jul 28, 2023
1 parent c9c520a commit 444e474
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyblock3/algebra/mpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ def _effective_mpo(self, l=0, r=2):

def _effective_mps(self, mps, lid, rid, l=0, r=2):
"""Get mps in sub-system with sites [l, r)"""
tensors = [lid, *self.ket[l:r], rid]
tensors = [lid, *mps[l:r], rid]
tensors[:2] = [
reduce(lambda a, b: np.tensordot(a, b, axes=0), tensors[:2])]
tensors[-2:] = [reduce(lambda a, b: np.tensordot(a,
b, axes=0), tensors[-2:])]
return self.ket.__class__(tensors=tensors, opts=mps.opts)
return mps.__class__(tensors=tensors, opts=mps.opts)

def _effective_bra(self, l=0, r=2):
"""Get bra in sub-system with sites [l, r)"""
Expand Down

0 comments on commit 444e474

Please sign in to comment.