@@ -452,13 +452,13 @@ def change_chi(
452
452
:obj:`~varipeps.peps.PEPS_Tensor`:
453
453
New instance of the class with the increased value.
454
454
"""
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 :
456
458
raise ValueError (
457
459
"Increase above the max value for environment bond dimension."
458
460
)
459
461
460
- new_max_chi = new_chi if reset_max_chi else self .max_chi
461
-
462
462
if new_chi < self .chi and reinitialize_env_as_identities :
463
463
return type (self )(
464
464
tensor = self .tensor ,
@@ -1407,13 +1407,13 @@ def change_chi(
1407
1407
:obj:`~varipeps.peps.PEPS_Tensor`:
1408
1408
New instance of the class with the increased value.
1409
1409
"""
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 :
1411
1413
raise ValueError (
1412
1414
"Increase above the max value for environment bond dimension."
1413
1415
)
1414
1416
1415
- new_max_chi = new_chi if reset_max_chi else self .max_chi
1416
-
1417
1417
if new_chi < self .chi and reinitialize_env_as_identities :
1418
1418
return type (self )(
1419
1419
tensor = self .tensor ,
@@ -2330,13 +2330,13 @@ def change_chi(
2330
2330
:obj:`~peps_ad.peps.PEPS_Tensor_Split_Transfer`:
2331
2331
New instance of the class with the increased value.
2332
2332
"""
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 :
2334
2336
raise ValueError (
2335
2337
"Increase above the max value for environment bond dimension."
2336
2338
)
2337
2339
2338
- new_max_chi = new_chi if reset_max_chi else self .max_chi
2339
-
2340
2340
new_interlayer_chi = new_chi if reset_interlayer_chi else self .interlayer_chi
2341
2341
2342
2342
if new_chi < self .chi and reinitialize_env_as_identities :
0 commit comments