Skip to content

Commit

Permalink
MPS._scale_axis_B: use 1./S instead of S**(-1.)
Browse files Browse the repository at this point in the history
Thanks to Ruben for suggesting this!
  • Loading branch information
jhauschild committed Mar 11, 2021
1 parent 2ed1f59 commit d9821b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tenpy/networks/mps.py
Expand Up @@ -3363,7 +3363,9 @@ def _scale_axis_B(self, B, S, form_diff, axis_B, cutoff):
return B # nothing to do
if not isinstance(S, npc.Array):
# the usual case: S is a 1D array with singular values
if form_diff != 1.:
if form_diff == -1.:
S = 1. / S
elif form_diff != 1.:
S = S**form_diff
return B.scale_axis(S, axis_B)
else:
Expand Down

0 comments on commit d9821b8

Please sign in to comment.