File tree 2 files changed +16
-4
lines changed
2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -399,6 +399,7 @@ def change_chi(
399
399
new_chi : int ,
400
400
* ,
401
401
reinitialize_env_as_identities : bool = True ,
402
+ reset_max_chi : bool = False ,
402
403
) -> T_PEPS_Tensor :
403
404
"""
404
405
Change the environment bond dimension and returns new object of the class.
@@ -409,6 +410,8 @@ def change_chi(
409
410
Keyword args:
410
411
reinitialize_env_as_identities (:obj:`bool`):
411
412
Reinitialize the CTM tensors as identities if decreasing the dimension.
413
+ reset_max_chi (:obj:`bool`):
414
+ Set maximal bond dimension to the same new value.
412
415
Returns:
413
416
:obj:`~varipeps.peps.PEPS_Tensor`:
414
417
New instance of the class with the increased value.
@@ -418,6 +421,8 @@ def change_chi(
418
421
"Increase above the max value for environment bond dimension."
419
422
)
420
423
424
+ new_max_chi = new_chi if reset_max_chi else self .max_chi
425
+
421
426
if new_chi < self .chi and reinitialize_env_as_identities :
422
427
return type (self )(
423
428
tensor = self .tensor ,
@@ -440,7 +445,7 @@ def change_chi(
440
445
d = self .d ,
441
446
D = self .D ,
442
447
chi = new_chi ,
443
- max_chi = self . max_chi ,
448
+ max_chi = new_max_chi ,
444
449
)
445
450
else :
446
451
return type (self )(
@@ -456,7 +461,7 @@ def change_chi(
456
461
d = self .d ,
457
462
D = self .D ,
458
463
chi = new_chi ,
459
- max_chi = self . max_chi ,
464
+ max_chi = new_max_chi ,
460
465
)
461
466
462
467
def increase_max_chi (
Original file line number Diff line number Diff line change @@ -450,19 +450,26 @@ def replace_unique_tensors(
450
450
sanity_checks = False ,
451
451
)
452
452
453
- def change_chi (self : T_PEPS_Unit_Cell , new_chi : int ) -> T_PEPS_Unit_Cell :
453
+ def change_chi (
454
+ self : T_PEPS_Unit_Cell ,
455
+ new_chi : int ,
456
+ reset_max_chi : bool = False ,
457
+ ) -> T_PEPS_Unit_Cell :
454
458
"""
455
459
Change environment bond dimension of all tensors in the unit cell.
456
460
457
461
Args:
458
462
new_chi (:obj:`int`):
459
463
New value for the environment bond dimension.
464
+ reset_max_chi (:obj:`bool`):
465
+ Set maximal bond dimension to the same new value.
460
466
Returns:
461
467
PEPS_Unit_Cell:
462
468
New instance of PEPS unit cell with the new tensor list.
463
469
"""
464
470
new_unique_tensors = type (self .data .peps_tensors )(
465
- t .change_chi (new_chi ) for t in self .data .peps_tensors
471
+ t .change_chi (new_chi , reset_max_chi = reset_max_chi )
472
+ for t in self .data .peps_tensors
466
473
)
467
474
468
475
new_data = self .data .replace_peps_tensors (new_unique_tensors )
You can’t perform that action at this time.
0 commit comments