Skip to content

Commit 34b692a

Browse files
committedFeb 27, 2025
Correctly check when to enter the CTMRG while loop
1 parent da4d3de commit 34b692a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎varipeps/ctmrg/routine.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -538,12 +538,15 @@ def calc_ctmrg_env(
538538
corner_singular_vals = None
539539

540540
while any(
541-
i.C1.shape[0] != i.chi for i in working_unitcell.get_unique_tensors()
541+
getattr(i, j).shape[0] != i.chi or getattr(i, j).shape[1] != i.chi
542+
for i in working_unitcell.get_unique_tensors()
543+
for j in ("C1", "C2", "C3", "C4")
542544
) or (
543545
hasattr(working_unitcell.get_unique_tensors()[0], "T4_ket")
544546
and any(
545-
i.T4_ket.shape[0] != i.interlayer_chi
547+
getattr(i, j).shape[0] != i.interlayer_chi
546548
for i in working_unitcell.get_unique_tensors()
549+
for j in ("T1_bra", "T2_ket", "T3_bra", "T4_ket")
547550
)
548551
):
549552
(

0 commit comments

Comments
 (0)
Please sign in to comment.