Skip to content

Commit

Permalink
io: to block2 non-singlet
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Jul 10, 2024
1 parent 4490ade commit 58f6be3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pyblock2/algebra/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def from_block2(bmps):
return MPS(tensors=tensors)

@staticmethod
def to_block2(mps, basis, center=0, tag="KET"):
def to_block2(mps, basis, center=0, tag="KET", left_vacuum=None):
"""
Translate pyblock2 MPS to block2 MPS.
Expand All @@ -316,6 +316,8 @@ def to_block2(mps, basis, center=0, tag="KET"):
Phyiscal basis infomation at each site.
tag : str
Tag of the block2 MPS. Default is "KET".
left_vacuum : None or SU2
Left vacuum for singlet embedding
Returns:
bmps : block2 MPS
Expand All @@ -330,7 +332,8 @@ def to_block2(mps, basis, center=0, tag="KET"):
n_sites = len(mps.tensors)
ql = mps.tensors[0].blocks[0].q_labels
qr = mps.tensors[-1].blocks[0].q_labels
left_vacuum = (ql[1] - ql[0])[0]
if left_vacuum is None:
left_vacuum = (ql[1] - ql[0])[0]
target = (qr[0] + qr[1])[0]
vacuum = (target - target)[0]
for ib, x in enumerate(basis):
Expand Down

0 comments on commit 58f6be3

Please sign in to comment.