@@ -452,13 +452,13 @@ def change_chi(
452452 :obj:`~varipeps.peps.PEPS_Tensor`:
453453 New instance of the class with the increased value.
454454 """
455- if new_chi > self .max_chi :
455+ new_max_chi = new_chi if reset_max_chi else self .max_chi
456+
457+ if new_chi > new_max_chi :
456458 raise ValueError (
457459 "Increase above the max value for environment bond dimension."
458460 )
459461
460- new_max_chi = new_chi if reset_max_chi else self .max_chi
461-
462462 if new_chi < self .chi and reinitialize_env_as_identities :
463463 return type (self )(
464464 tensor = self .tensor ,
@@ -1407,13 +1407,13 @@ def change_chi(
14071407 :obj:`~varipeps.peps.PEPS_Tensor`:
14081408 New instance of the class with the increased value.
14091409 """
1410- if new_chi > self .max_chi :
1410+ new_max_chi = new_chi if reset_max_chi else self .max_chi
1411+
1412+ if new_chi > new_max_chi :
14111413 raise ValueError (
14121414 "Increase above the max value for environment bond dimension."
14131415 )
14141416
1415- new_max_chi = new_chi if reset_max_chi else self .max_chi
1416-
14171417 if new_chi < self .chi and reinitialize_env_as_identities :
14181418 return type (self )(
14191419 tensor = self .tensor ,
@@ -2330,13 +2330,13 @@ def change_chi(
23302330 :obj:`~peps_ad.peps.PEPS_Tensor_Split_Transfer`:
23312331 New instance of the class with the increased value.
23322332 """
2333- if new_chi > self .max_chi :
2333+ new_max_chi = new_chi if reset_max_chi else self .max_chi
2334+
2335+ if new_chi > new_max_chi :
23342336 raise ValueError (
23352337 "Increase above the max value for environment bond dimension."
23362338 )
23372339
2338- new_max_chi = new_chi if reset_max_chi else self .max_chi
2339-
23402340 new_interlayer_chi = new_chi if reset_interlayer_chi else self .interlayer_chi
23412341
23422342 if new_chi < self .chi and reinitialize_env_as_identities :
0 commit comments