Skip to content

Commit 0a62dc0

Browse files
committed
Rename remaining artifacts from peps_ad to varipeps
1 parent 1723ffa commit 0a62dc0

File tree

13 files changed

+84
-84
lines changed

13 files changed

+84
-84
lines changed

docs/source/api/ctmrg/routine.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
.. currentmodule:: varipeps.ctmrg
44

5-
Calculate the new converged CTMRG tensors (:func:`varipeps.ctmrg.calc_ctmrg_env` and :func:`peps_ad.ctmrg.calc_ctmrg_env_custom_rule`)
6-
======================================================================================================================================
5+
Calculate the new converged CTMRG tensors (:func:`varipeps.ctmrg.calc_ctmrg_env` and :func:`varipeps.ctmrg.calc_ctmrg_env_custom_rule`)
6+
=======================================================================================================================================
77

88
.. autofunction:: calc_ctmrg_env
99

varipeps/config.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from typing import TypeVar, Tuple, Any, Type
77

8-
T_PEPS_AD_Config = TypeVar("T_PEPS_AD_Config", bound="PEPS_AD_Config")
8+
T_VariPEPS_Config = TypeVar("T_VariPEPS_Config", bound="VariPEPS_Config")
99

1010

1111
@unique
@@ -38,7 +38,7 @@ class Wavevector_Type(IntEnum):
3838

3939
@dataclass
4040
@register_pytree_node_class
41-
class PEPS_AD_Config:
41+
class VariPEPS_Config:
4242
"""
4343
Config class for peps-ad module. Normally only the blow created instance
4444
:obj:`config` is used.
@@ -239,13 +239,13 @@ def tree_flatten(self) -> Tuple[Tuple[Any, ...], Tuple[Any, ...]]:
239239

240240
@classmethod
241241
def tree_unflatten(
242-
cls: Type[T_PEPS_AD_Config],
242+
cls: Type[T_VariPEPS_Config],
243243
aux_data: Tuple[Any, ...],
244244
children: Tuple[Any, ...],
245-
) -> T_PEPS_AD_Config:
245+
) -> T_VariPEPS_Config:
246246
(data_dict,) = aux_data
247247

248248
return cls(**data_dict)
249249

250250

251-
config = PEPS_AD_Config()
251+
config = VariPEPS_Config()

varipeps/contractions/apply.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from varipeps.peps import PEPS_Tensor
1414
from varipeps import varipeps_config
15-
from varipeps.config import PEPS_AD_Config
15+
from varipeps.config import VariPEPS_Config
1616
from varipeps.utils.func_cache import Checkpointing_Cache
1717

1818
from .definitions import Definitions, Definition
@@ -43,7 +43,7 @@ def apply_contraction(
4343
*,
4444
disable_identity_check: bool = False,
4545
custom_definition: Optional[Definition] = None,
46-
config: PEPS_AD_Config = varipeps_config,
46+
config: VariPEPS_Config = varipeps_config,
4747
_jitable: bool = False,
4848
) -> jnp.ndarray:
4949
"""
@@ -70,7 +70,7 @@ def apply_contraction(
7070
custom_definition (:obj:`~varipeps.contractions.apply.Definition`, optional):
7171
Use a custom definition for the contraction which is not defined in the
7272
:class:`varipeps.contractions.Definitions` class.
73-
config (:obj:`~varipeps.config.PEPS_AD_Config`):
73+
config (:obj:`~varipeps.config.VariPEPS_Config`):
7474
Global configuration object of the variPEPS library. Please see its
7575
class definition for details.
7676
Returns:

varipeps/ctmrg/absorption.py

+23-23
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
calc_bottom_projectors,
1919
)
2020
from varipeps.expectation.one_site import calc_one_site_single_gate_obj
21-
from varipeps.config import PEPS_AD_Config
22-
from varipeps.global_state import PEPS_AD_Global_State
21+
from varipeps.config import VariPEPS_Config
22+
from varipeps.global_state import VariPEPS_Global_State
2323

2424

2525
from typing import Sequence, Tuple, List, Dict, Literal
@@ -61,7 +61,7 @@ def _get_ctmrg_2x2_structure(
6161
return view_tensors, view_tensor_objs
6262

6363

64-
def _post_process_CTM_tensors(a: jnp.ndarray, config: PEPS_AD_Config) -> jnp.ndarray:
64+
def _post_process_CTM_tensors(a: jnp.ndarray, config: VariPEPS_Config) -> jnp.ndarray:
6565
a = a / jnp.linalg.norm(a)
6666
a_abs = jnp.abs(a)
6767
a_abs_max = jnp.max(a_abs)
@@ -98,8 +98,8 @@ def new_phase(ph, curr_x, curr_x_abs):
9898
def do_left_absorption(
9999
peps_tensors: Sequence[jnp.ndarray],
100100
unitcell: PEPS_Unit_Cell,
101-
config: PEPS_AD_Config,
102-
state: PEPS_AD_Global_State,
101+
config: VariPEPS_Config,
102+
state: VariPEPS_Global_State,
103103
) -> PEPS_Unit_Cell:
104104
"""
105105
Calculate the left CTMRG tensors after one absorption step and returns
@@ -110,10 +110,10 @@ def do_left_absorption(
110110
The sequence of unique PEPS tensors the unitcell consists of.
111111
unitcell (:obj:`~varipeps.peps.PEPS_Unit_Cell`):
112112
The unitcell to work on.
113-
config (:obj:`~varipeps.config.PEPS_AD_Config`):
113+
config (:obj:`~varipeps.config.VariPEPS_Config`):
114114
Global configuration object of the variPEPS library. Please see its
115115
class definition for details.
116-
state (:obj:`~varipeps.global_state.PEPS_AD_Global_State`):
116+
state (:obj:`~varipeps.global_state.VariPEPS_Global_State`):
117117
Global state object of the variPEPS library. It is used to transport
118118
a common state across different parts of the framework. Please see its
119119
class definition for details.
@@ -197,8 +197,8 @@ class definition for details.
197197
def do_right_absorption(
198198
peps_tensors: Sequence[jnp.ndarray],
199199
unitcell: PEPS_Unit_Cell,
200-
config: PEPS_AD_Config,
201-
state: PEPS_AD_Global_State,
200+
config: VariPEPS_Config,
201+
state: VariPEPS_Global_State,
202202
) -> PEPS_Unit_Cell:
203203
"""
204204
Calculate the right CTMRG tensors after one absorption step and returns
@@ -209,10 +209,10 @@ def do_right_absorption(
209209
The sequence of unique PEPS tensors the unitcell consists of.
210210
unitcell (:obj:`~varipeps.peps.PEPS_Unit_Cell`):
211211
The unitcell to work on.
212-
config (:obj:`~varipeps.config.PEPS_AD_Config`):
212+
config (:obj:`~varipeps.config.VariPEPS_Config`):
213213
Global configuration object of the variPEPS library. Please see its
214214
class definition for details.
215-
state (:obj:`~varipeps.global_state.PEPS_AD_Global_State`):
215+
state (:obj:`~varipeps.global_state.VariPEPS_Global_State`):
216216
Global state object of the variPEPS library. It is used to transport
217217
a common state across different parts of the framework. Please see its
218218
class definition for details.
@@ -300,8 +300,8 @@ class definition for details.
300300
def do_top_absorption(
301301
peps_tensors: Sequence[jnp.ndarray],
302302
unitcell: PEPS_Unit_Cell,
303-
config: PEPS_AD_Config,
304-
state: PEPS_AD_Global_State,
303+
config: VariPEPS_Config,
304+
state: VariPEPS_Global_State,
305305
) -> PEPS_Unit_Cell:
306306
"""
307307
Calculate the top CTMRG tensors after one absorption step and returns
@@ -312,10 +312,10 @@ def do_top_absorption(
312312
The sequence of unique PEPS tensors the unitcell consists of.
313313
unitcell (:obj:`~varipeps.peps.PEPS_Unit_Cell`):
314314
The unitcell to work on.
315-
config (:obj:`~varipeps.config.PEPS_AD_Config`):
315+
config (:obj:`~varipeps.config.VariPEPS_Config`):
316316
Global configuration object of the variPEPS library. Please see its
317317
class definition for details.
318-
state (:obj:`~varipeps.global_state.PEPS_AD_Global_State`):
318+
state (:obj:`~varipeps.global_state.VariPEPS_Global_State`):
319319
Global state object of the variPEPS library. It is used to transport
320320
a common state across different parts of the framework. Please see its
321321
class definition for details.
@@ -399,8 +399,8 @@ class definition for details.
399399
def do_bottom_absorption(
400400
peps_tensors: Sequence[jnp.ndarray],
401401
unitcell: PEPS_Unit_Cell,
402-
config: PEPS_AD_Config,
403-
state: PEPS_AD_Global_State,
402+
config: VariPEPS_Config,
403+
state: VariPEPS_Global_State,
404404
) -> PEPS_Unit_Cell:
405405
"""
406406
Calculate the bottom CTMRG tensors after one absorption step and returns
@@ -411,10 +411,10 @@ def do_bottom_absorption(
411411
The sequence of unique PEPS tensors the unitcell consists of.
412412
unitcell (:obj:`~varipeps.peps.PEPS_Unit_Cell`):
413413
The unitcell to work on.
414-
config (:obj:`~varipeps.config.PEPS_AD_Config`):
414+
config (:obj:`~varipeps.config.VariPEPS_Config`):
415415
Global configuration object of the variPEPS library. Please see its
416416
class definition for details.
417-
state (:obj:`~varipeps.global_state.PEPS_AD_Global_State`):
417+
state (:obj:`~varipeps.global_state.VariPEPS_Global_State`):
418418
Global state object of the variPEPS library. It is used to transport
419419
a common state across different parts of the framework. Please see its
420420
class definition for details.
@@ -599,8 +599,8 @@ def gauge_fix_ctmrg_tensors(
599599
def do_absorption_step(
600600
peps_tensors: Sequence[jnp.ndarray],
601601
unitcell: PEPS_Unit_Cell,
602-
config: PEPS_AD_Config,
603-
state: PEPS_AD_Global_State,
602+
config: VariPEPS_Config,
603+
state: VariPEPS_Global_State,
604604
) -> PEPS_Unit_Cell:
605605
"""
606606
Calculate the all CTMRG tensors after one absorption step and returns
@@ -611,10 +611,10 @@ def do_absorption_step(
611611
The sequence of unique PEPS tensors the unitcell consists of.
612612
unitcell (:obj:`~varipeps.peps.PEPS_Unit_Cell`):
613613
The unitcell to work on.
614-
config (:obj:`~varipeps.config.PEPS_AD_Config`):
614+
config (:obj:`~varipeps.config.VariPEPS_Config`):
615615
Global configuration object of the variPEPS library. Please see its
616616
class definition for details.
617-
state (:obj:`~varipeps.global_state.PEPS_AD_Global_State`):
617+
state (:obj:`~varipeps.global_state.VariPEPS_Global_State`):
618618
Global state object of the variPEPS library. It is used to transport
619619
a common state across different parts of the framework. Please see its
620620
class definition for details.

varipeps/ctmrg/projectors.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
Top_Projectors,
1616
Bottom_Projectors,
1717
)
18-
from varipeps.config import Projector_Method, PEPS_AD_Config
19-
from varipeps.global_state import PEPS_AD_Global_State
18+
from varipeps.config import Projector_Method, VariPEPS_Config
19+
from varipeps.global_state import VariPEPS_Global_State
2020

2121
from typing import Sequence, Tuple, TypeVar
2222

@@ -312,8 +312,8 @@ def _left_projectors_workhorse(
312312
def calc_left_projectors(
313313
peps_tensors: Sequence[Sequence[jnp.ndarray]],
314314
peps_tensor_objs: Sequence[Sequence[PEPS_Tensor]],
315-
config: PEPS_AD_Config,
316-
state: PEPS_AD_Global_State,
315+
config: VariPEPS_Config,
316+
state: VariPEPS_Global_State,
317317
) -> Left_Projectors:
318318
"""
319319
Calculate the left projectors for the CTMRG method.
@@ -324,10 +324,10 @@ def calc_left_projectors(
324324
to the x axis, the column (second) index to y.
325325
peps_tensor_objs (:term:`sequence` of :term:`sequence` of :obj:`~varipeps.peps.PEPS_Tensor`):
326326
Nested list of the PEPS tensor objects. Same format as for `peps_tensors`.
327-
config (:obj:`~varipeps.config.PEPS_AD_Config`):
327+
config (:obj:`~varipeps.config.VariPEPS_Config`):
328328
Global configuration object of the variPEPS library. Please see its
329329
class definition for details.
330-
state (:obj:`~varipeps.global_state.PEPS_AD_Global_State`):
330+
state (:obj:`~varipeps.global_state.VariPEPS_Global_State`):
331331
Global state object of the variPEPS library. It is used to transport
332332
a common state across different parts of the framework. Please see its
333333
class definition for details.
@@ -430,8 +430,8 @@ def _right_projectors_workhorse(
430430
def calc_right_projectors(
431431
peps_tensors: Sequence[Sequence[jnp.ndarray]],
432432
peps_tensor_objs: Sequence[Sequence[PEPS_Tensor]],
433-
config: PEPS_AD_Config,
434-
state: PEPS_AD_Global_State,
433+
config: VariPEPS_Config,
434+
state: VariPEPS_Global_State,
435435
) -> Right_Projectors:
436436
"""
437437
Calculate the right projectors for the CTMRG method.
@@ -442,10 +442,10 @@ def calc_right_projectors(
442442
to the x axis, the column (second) index to y.
443443
peps_tensor_objs (:term:`sequence` of :term:`sequence` of :obj:`~varipeps.peps.PEPS_Tensor`):
444444
Nested list of the PEPS tensor objects. Same format as for `peps_tensors`.
445-
config (:obj:`~varipeps.config.PEPS_AD_Config`):
445+
config (:obj:`~varipeps.config.VariPEPS_Config`):
446446
Global configuration object of the variPEPS library. Please see its
447447
class definition for details.
448-
state (:obj:`~varipeps.global_state.PEPS_AD_Global_State`):
448+
state (:obj:`~varipeps.global_state.VariPEPS_Global_State`):
449449
Global state object of the variPEPS library. It is used to transport
450450
a common state across different parts of the framework. Please see its
451451
class definition for details.
@@ -548,8 +548,8 @@ def _top_projectors_workhorse(
548548
def calc_top_projectors(
549549
peps_tensors: Sequence[Sequence[jnp.ndarray]],
550550
peps_tensor_objs: Sequence[Sequence[PEPS_Tensor]],
551-
config: PEPS_AD_Config,
552-
state: PEPS_AD_Global_State,
551+
config: VariPEPS_Config,
552+
state: VariPEPS_Global_State,
553553
) -> Top_Projectors:
554554
"""
555555
Calculate the top projectors for the CTMRG method.
@@ -560,10 +560,10 @@ def calc_top_projectors(
560560
to the x axis, the column (second) index to y.
561561
peps_tensor_objs (:term:`sequence` of :term:`sequence` of :obj:`~varipeps.peps.PEPS_Tensor`):
562562
Nested list of the PEPS tensor objects. Same format as for `peps_tensors`.
563-
config (:obj:`~varipeps.config.PEPS_AD_Config`):
563+
config (:obj:`~varipeps.config.VariPEPS_Config`):
564564
Global configuration object of the variPEPS library. Please see its
565565
class definition for details.
566-
state (:obj:`~varipeps.global_state.PEPS_AD_Global_State`):
566+
state (:obj:`~varipeps.global_state.VariPEPS_Global_State`):
567567
Global state object of the variPEPS library. It is used to transport
568568
a common state across different parts of the framework. Please see its
569569
class definition for details.
@@ -666,8 +666,8 @@ def _bottom_projectors_workhorse(
666666
def calc_bottom_projectors(
667667
peps_tensors: Sequence[Sequence[jnp.ndarray]],
668668
peps_tensor_objs: Sequence[Sequence[PEPS_Tensor]],
669-
config: PEPS_AD_Config,
670-
state: PEPS_AD_Global_State,
669+
config: VariPEPS_Config,
670+
state: VariPEPS_Global_State,
671671
) -> Bottom_Projectors:
672672
"""
673673
Calculate the bottom projectors for the CTMRG method.
@@ -678,10 +678,10 @@ def calc_bottom_projectors(
678678
to the x axis, the column (second) index to y.
679679
peps_tensor_objs (:term:`sequence` of :term:`sequence` of :obj:`~varipeps.peps.PEPS_Tensor`):
680680
Nested list of the PEPS tensor objects. Same format as for `peps_tensors`.
681-
config (:obj:`~varipeps.config.PEPS_AD_Config`):
681+
config (:obj:`~varipeps.config.VariPEPS_Config`):
682682
Global configuration object of the variPEPS library. Please see its
683683
class definition for details.
684-
state (:obj:`~varipeps.global_state.PEPS_AD_Global_State`):
684+
state (:obj:`~varipeps.global_state.VariPEPS_Global_State`):
685685
Global state object of the variPEPS library. It is used to transport
686686
a common state across different parts of the framework. Please see its
687687
class definition for details.

varipeps/global_state.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
from .config import Projector_Method
88

9-
T_PEPS_AD_Global_State = TypeVar("T_PEPS_AD_Global_State", bound="PEPS_AD_Global_State")
9+
T_VariPEPS_Global_State = TypeVar("T_VariPEPS_Global_State", bound="VariPEPS_Global_State")
1010

1111

1212
@dataclass
1313
@register_pytree_node_class
14-
class PEPS_AD_Global_State:
14+
class VariPEPS_Global_State:
1515
"""
1616
Class to track internal global state. Values of the instance of this
1717
class should not be modified by users.
@@ -30,13 +30,13 @@ def tree_flatten(self) -> Tuple[Tuple[Any, ...], Tuple[Any, ...]]:
3030

3131
@classmethod
3232
def tree_unflatten(
33-
cls: Type[T_PEPS_AD_Global_State],
33+
cls: Type[T_VariPEPS_Global_State],
3434
aux_data: Tuple[Any, ...],
3535
children: Tuple[Any, ...],
36-
) -> T_PEPS_AD_Global_State:
36+
) -> T_VariPEPS_Global_State:
3737
(data_dict,) = aux_data
3838

3939
return cls(**data_dict)
4040

4141

42-
global_state = PEPS_AD_Global_State()
42+
global_state = VariPEPS_Global_State()

varipeps/mapping/honeycomb.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def load_from_file(
506506
return_auxiliary_data: bool = False,
507507
) -> Union[
508508
Tuple[List[jnp.ndarray], PEPS_Unit_Cell],
509-
Tuple[List[jnp.ndarray], PEPS_Unit_Cell, varipeps.config.PEPS_AD_Config],
509+
Tuple[List[jnp.ndarray], PEPS_Unit_Cell, varipeps.config.VariPEPS_Config],
510510
]:
511511
"""
512512
Load Honeycomb PEPS tensors and unit cell from a HDF5 file.
@@ -528,7 +528,7 @@ def load_from_file(
528528
Return dictionary with string indexed auxiliary data which has been
529529
should be stored along the other data in the file.
530530
Returns:
531-
:obj:`tuple`\ (:obj:`list`\ (:obj:`jax.numpy.ndarray`), :obj:`~varipeps.peps.PEPS_Unit_Cell`) or :obj:`tuple`\ (:obj:`list`\ (:obj:`jax.numpy.ndarray`), :obj:`~varipeps.peps.PEPS_Unit_Cell`, :obj:`~varipeps.config.PEPS_AD_Config`):
531+
:obj:`tuple`\ (:obj:`list`\ (:obj:`jax.numpy.ndarray`), :obj:`~varipeps.peps.PEPS_Unit_Cell`) or :obj:`tuple`\ (:obj:`list`\ (:obj:`jax.numpy.ndarray`), :obj:`~varipeps.peps.PEPS_Unit_Cell`, :obj:`~varipeps.config.VariPEPS_Config`):
532532
The tuple with the list of the PESS tensors and the PEPS unitcell
533533
is returned. If ``return_config = True``. the config is returned
534534
as well. If ``return_auxiliary_data = True``. the auxiliary data is
@@ -570,7 +570,7 @@ def load_from_group(
570570
return_config: bool = False,
571571
) -> Union[
572572
Tuple[List[jnp.ndarray], PEPS_Unit_Cell],
573-
Tuple[List[jnp.ndarray], PEPS_Unit_Cell, varipeps.config.PEPS_AD_Config],
573+
Tuple[List[jnp.ndarray], PEPS_Unit_Cell, varipeps.config.VariPEPS_Config],
574574
]:
575575
"""
576576
Load the unit cell from a HDF5 group which is be passed to the method.
@@ -585,7 +585,7 @@ def load_from_group(
585585
Missing config flags in the file uses the default values from the
586586
config object.
587587
Returns:
588-
:obj:`tuple`\ (:obj:`list`\ (:obj:`jax.numpy.ndarray`), :obj:`~varipeps.peps.PEPS_Unit_Cell`) or :obj:`tuple`\ (:obj:`list`\ (:obj:`jax.numpy.ndarray`), :obj:`~varipeps.peps.PEPS_Unit_Cell`, :obj:`~varipeps.config.PEPS_AD_Config`):
588+
:obj:`tuple`\ (:obj:`list`\ (:obj:`jax.numpy.ndarray`), :obj:`~varipeps.peps.PEPS_Unit_Cell`) or :obj:`tuple`\ (:obj:`list`\ (:obj:`jax.numpy.ndarray`), :obj:`~varipeps.peps.PEPS_Unit_Cell`, :obj:`~varipeps.config.VariPEPS_Config`):
589589
The tuple with the list of the PESS tensors and the PEPS unitcell
590590
is returned. If ``return_config = True``. the config is returned
591591
as well.

0 commit comments

Comments
 (0)