@@ -1390,6 +1390,7 @@ def change_chi(
1390
1390
new_chi : int ,
1391
1391
* ,
1392
1392
reinitialize_env_as_identities : bool = True ,
1393
+ reset_max_chi : bool = False ,
1393
1394
) -> T_PEPS_Tensor :
1394
1395
"""
1395
1396
Change the environment bond dimension and returns new object of the class.
@@ -1400,6 +1401,8 @@ def change_chi(
1400
1401
Keyword args:
1401
1402
reinitialize_env_as_identities (:obj:`bool`):
1402
1403
Reinitialize the CTM tensors as identities if decreasing the dimension.
1404
+ reset_max_chi (:obj:`bool`):
1405
+ Set maximal bond dimension to the same new value.
1403
1406
Returns:
1404
1407
:obj:`~varipeps.peps.PEPS_Tensor`:
1405
1408
New instance of the class with the increased value.
@@ -1409,6 +1412,8 @@ def change_chi(
1409
1412
"Increase above the max value for environment bond dimension."
1410
1413
)
1411
1414
1415
+ new_max_chi = new_chi if reset_max_chi else self .max_chi
1416
+
1412
1417
if new_chi < self .chi and reinitialize_env_as_identities :
1413
1418
return type (self )(
1414
1419
tensor = self .tensor ,
@@ -1447,7 +1452,7 @@ def change_chi(
1447
1452
d = self .d ,
1448
1453
D = self .D ,
1449
1454
chi = new_chi ,
1450
- max_chi = self . max_chi ,
1455
+ max_chi = new_max_chi ,
1451
1456
)
1452
1457
else :
1453
1458
return type (self )(
@@ -1471,7 +1476,7 @@ def change_chi(
1471
1476
d = self .d ,
1472
1477
D = self .D ,
1473
1478
chi = new_chi ,
1474
- max_chi = self . max_chi ,
1479
+ max_chi = new_max_chi ,
1475
1480
)
1476
1481
1477
1482
def increase_max_chi (
@@ -2167,6 +2172,8 @@ def change_chi(
2167
2172
new_chi : int ,
2168
2173
* ,
2169
2174
reinitialize_env_as_identities : bool = True ,
2175
+ reset_max_chi : bool = False ,
2176
+ reset_interlayer_chi : bool = True ,
2170
2177
) -> T_PEPS_Tensor_Split_Transfer :
2171
2178
"""
2172
2179
Change the environment bond dimension and returns new object of the class.
@@ -2177,6 +2184,10 @@ def change_chi(
2177
2184
Keyword args:
2178
2185
reinitialize_env_as_identities (:obj:`bool`):
2179
2186
Reinitialize the CTM tensors as identities if decreasing the dimension.
2187
+ reset_max_chi (:obj:`bool`):
2188
+ Set maximal bond dimension to the same new value.
2189
+ reset_interlayer_chi (:obj:`bool`):
2190
+ Set interlayer bond dimension to the same new value.
2180
2191
Returns:
2181
2192
:obj:`~peps_ad.peps.PEPS_Tensor_Split_Transfer`:
2182
2193
New instance of the class with the increased value.
@@ -2186,6 +2197,10 @@ def change_chi(
2186
2197
"Increase above the max value for environment bond dimension."
2187
2198
)
2188
2199
2200
+ new_max_chi = new_chi if reset_max_chi else self .max_chi
2201
+
2202
+ new_interlayer_chi = new_chi if reset_interlayer_chi else self .interlayer_chi
2203
+
2189
2204
if new_chi < self .chi and reinitialize_env_as_identities :
2190
2205
return type (self )(
2191
2206
tensor = self .tensor ,
@@ -2208,8 +2223,8 @@ def change_chi(
2208
2223
d = self .d ,
2209
2224
D = self .D ,
2210
2225
chi = new_chi ,
2211
- max_chi = self . max_chi ,
2212
- interlayer_chi = self . interlayer_chi ,
2226
+ max_chi = new_max_chi ,
2227
+ interlayer_chi = new_interlayer_chi ,
2213
2228
)
2214
2229
else :
2215
2230
return type (self )(
@@ -2229,8 +2244,8 @@ def change_chi(
2229
2244
d = self .d ,
2230
2245
D = self .D ,
2231
2246
chi = new_chi ,
2232
- max_chi = self . max_chi ,
2233
- interlayer_chi = self . interlayer_chi ,
2247
+ max_chi = new_max_chi ,
2248
+ interlayer_chi = new_interlayer_chi ,
2234
2249
)
2235
2250
2236
2251
def increase_max_chi (
0 commit comments