Skip to content

Commit

Permalink
adapt show bond dims for zero blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Jun 13, 2023
1 parent 51ba6d6 commit ddf3c92
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyblock3/algebra/mps.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,12 @@ def show_bond_dims(self):
infos = [i if len(i) != 0 else (BondInfo(), ) for i in infos]
bonds.append(infos[0][0])
for i in range(self.n_sites - 1):
bonds.append(infos[i + 1][0] | infos[i][-1])
if len(infos[i + 1][0]) == 0:
bonds.append(infos[i][-1])
elif len(infos[i][-1]) == 0:
bonds.append(infos[i + 1][0])
else:
bonds.append(infos[i + 1][0] | infos[i][-1])
bonds.append(infos[-1][-1])
r = '|'.join([str(x.n_bonds) for x in bonds])
return r if self.const == 0 else r + " (%+12.5f)" % self.const
Expand Down

0 comments on commit ddf3c92

Please sign in to comment.