Mapping of Square-Kagome structures (varipeps.mapping.square_kagome)
- class varipeps.mapping.square_kagome.Square_Kagome_Expectation_Value(triangle_gates: Sequence[Array], square_gates: Sequence[Array], plus_gates: Sequence[Array], cross_gates: Sequence[Array], real_d: int, normalization_factor: int = 6, is_spiral_peps: bool = False, spiral_unitary_operator: Array | None = None)
Bases:
Expectation_ModelClass to calculate expectation values for a mapped Square-Kagome structure.
- Parameters:
triangle_gates (sequence of
jax.numpy.ndarray) – Sequence with the gates that should be applied to the triangles.square_gates (sequence of
jax.numpy.ndarray) – Sequence with the gates that should be applied to the squares.plus_gates (sequence of
jax.numpy.ndarray) – Sequence with the gates that should be applied to the plus term.cross_gates (sequence of
jax.numpy.ndarray) – Sequence with the gates that should be applied to the cross term.real_d (
int) – Physical dimension of a single site before mapping.normalization_factor (
int, optional) – Factor which should be used to normalize the calculated values. Likely will be 6 for the a single layer structure..Default:6- __call__(peps_tensors: Sequence[Array], unitcell: PEPS_Unit_Cell, spiral_vectors: Array | Sequence[Array] | None = None, *, normalize_by_size: bool = True, only_unique: bool = True) Array | List[Array]
Calculate the expectation value for PEPS unitcell depending on the gates set in the class.
- Parameters:
peps_tensors (sequence of
jax.numpy.ndarray) – The sequence of unique PEPS tensors in the unitcell.unitcell (
PEPS_Unit_Cell) – The PEPS unitcell.spiral_vectors (single or sequence of
jax.numpy.ndarray, optional) – If the expectation value is for a spiral iPEPS ansatz, in this argument the wavevectors are expected.Default:None- Keyword Arguments:
normalize_by_size (
bool, optional) – Flag if the expectation value should be normalized by the number of tensors in the unitcell.Default:Trueonly_unique (
bool, optional) – Flag if the expectation value should be calculated just once for each unique PEPS tensor in the unitcell.Default:True- Returns:
The expectation values for all gates. Single tensor if only one gate is applied.
- Return type:
- class varipeps.mapping.square_kagome.Square_Kagome_Map_4_1_1_To_PEPS(unitcell_structure: Sequence[Sequence[int]], chi: int, max_chi: int | None = None)
Bases:
Map_To_PEPS_ModelConvention for physical site tensors: * t1: [away from square, phys, square tensor] * t6: [away from square, phys, square tensot]
Convention for square tensor: [left, bottom, phys, phys, phys, phys, right, top]
- __call__(input_tensors: Sequence[Array], *, generate_unitcell: bool = True) List[Array] | Tuple[List[Array], PEPS_Unit_Cell]
Calculate the PEPS unitcell out of a list of input tensors depending on the original systems.
- Parameters:
input_tensors (sequence of
jax.numpy.ndarray) – The sequence of input tensors that should be converted.- Keyword Arguments:
generate_unitcell (
bool, optional) – Flag if the only the PEPS tensors or additionally the unitcell should be calculated.Default:True- Returns:
The mapped PEPS tensors and if
generate_unitcell = Truethe unitcell for these tensors.- Return type:
listofjax.numpy.ndarrayortupleoflistofjax.numpy.ndarrayandPEPS_Unit_Cell- classmethod autosave_wrapper(filename: PathLike, tensors: Array, unitcell: PEPS_Unit_Cell, counter: int | None = None, max_trunc_error_list: float | None = None) None
- classmethod load_from_file(path: PathLike, *, return_config: bool = False, return_max_trunc_error_list: bool = False) Tuple[List[Array], PEPS_Unit_Cell] | Tuple[List[Array], PEPS_Unit_Cell, PEPS_AD_Config]
Load unit cell from a HDF5 file.
This function read the group “square_kagome_semi_peps” from the file and pass this group to the method
load_from_groupthen.- Parameters:
path (
os.PathLike) – Path of the HDF5 file.return_config (
bool, optional) – Return a config object initialized with the values from the HDF5 files. If no config is stored in the file, just the data is returned. Missing config flags in the file uses the default values from the config object.Default:False- Returns:
The tuple with the list of the PESS tensors and the PEPS unitcell is returned. If
return_config = True. the config is returned as well.- Return type:
tuple(list(jax.numpy.ndarray),PEPS_Unit_Cell) ortuple(list(jax.numpy.ndarray),PEPS_Unit_Cell,PEPS_AD_Config)- static load_from_group(grp: Group, *, return_config: bool = False) Tuple[List[Array], PEPS_Unit_Cell] | Tuple[List[Array], PEPS_Unit_Cell, PEPS_AD_Config]
Load the unit cell from a HDF5 group which is be passed to the method.
- Parameters:
grp (
h5py.Group) – HDF5 group object to load the data from.return_config (
bool, optional) – Return a config object initialized with the values from the HDF5 files. If no config is stored in the file, just the data is returned. Missing config flags in the file uses the default values from the config object.Default:False- Returns:
The tuple with the list of the PESS tensors and the PEPS unitcell is returned. If
return_config = True. the config is returned as well.- Return type:
tuple(list(jax.numpy.ndarray),PEPS_Unit_Cell) ortuple(list(jax.numpy.ndarray),PEPS_Unit_Cell,PEPS_AD_Config)- classmethod random(structure: Sequence[Sequence[int]], d: int, D: int, chi: int | Sequence[int], dtype: Type[number], max_chi: int, *, seed: int | None = None, destroy_random_state: bool = True) Tuple[List[Array], T_Square_Kagome_Map_4_1_1_To_PEPS]
- classmethod save_to_file(path: PathLike, tensors: List[Array], unitcell: PEPS_Unit_Cell, *, store_config: bool = True, max_trunc_error_list: List[float] | None = None) None
Save unit cell to a HDF5 file.
This function creates a single group “square_kagome_semi_peps” in the file and pass this group to the method
save_to_groupthen.- Parameters:
path (
os.PathLike) – Path of the new file. Caution: The file will overwritten if existing.store_config (
bool, optional) – Store the current values of the global config object into the HDF5 file as attrs of an extra group.Default:True- static save_to_group(grp: Group, tensors: List[Array], unitcell: PEPS_Unit_Cell, *, store_config: bool = True) None
Save unit cell to a HDF5 group which is be passed to the method.
- Parameters:
grp (
h5py.Group) – HDF5 group object to store the data into.store_config (
bool, optional) – Store the current values of the global config object into the HDF5 file as attrs of an extra group.Default:True- class varipeps.mapping.square_kagome.Square_Kagome_Map_PESS_To_PEPS(unitcell_structure: Sequence[Sequence[int]], chi: int, max_chi: int | None = None)
Bases:
Map_To_PEPS_ModelMap a iPESS structure of the Square-Kagome to a PEPS unitcell. The convention for the input tensors is:
Convention for physical site tensors: * t1: [away from square, phys, bottom simplex] * t2: [bottom simplex, phys, left simplex] * t3: [left simplex, phys, top simplex] * t4: [right simplex, phys, bottom simplex] * t5: [top simplex, phys, right simplex] * t6: [away from square, phys, right simplex]
Convention for simplex tensors: * left: [away from square, t3, t2] * top: [away from square, t5, t3] * right: [t6, t4, t5] * bottom: [t1, t2, t4]
- Parameters:
unitcell_structure (sequence of sequence of
intor 2d array) – Two dimensional array modeling the structure of the unit cell. For details see the description ofPEPS_Unit_Cell.chi (
int) – Bond dimension of environment tensors which should be used for the unit cell generated.
- __call__(input_tensors: Sequence[Array], *, generate_unitcell: bool = True) List[Array] | Tuple[List[Array], PEPS_Unit_Cell]
Calculate the PEPS unitcell out of a list of input tensors depending on the original systems.
- Parameters:
input_tensors (sequence of
jax.numpy.ndarray) – The sequence of input tensors that should be converted.- Keyword Arguments:
generate_unitcell (
bool, optional) – Flag if the only the PEPS tensors or additionally the unitcell should be calculated.Default:True- Returns:
The mapped PEPS tensors and if
generate_unitcell = Truethe unitcell for these tensors.- Return type:
listofjax.numpy.ndarrayortupleoflistofjax.numpy.ndarrayandPEPS_Unit_Cell- classmethod autosave_wrapper(filename: PathLike, tensors: Array, unitcell: PEPS_Unit_Cell) None
- classmethod load_from_file(path: PathLike, *, return_config: bool = False) Tuple[List[Array], PEPS_Unit_Cell] | Tuple[List[Array], PEPS_Unit_Cell, PEPS_AD_Config]
Load unit cell from a HDF5 file.
This function read the group “square_kagome_pess” from the file and pass this group to the method
load_from_groupthen.- Parameters:
path (
os.PathLike) – Path of the HDF5 file.return_config (
bool, optional) – Return a config object initialized with the values from the HDF5 files. If no config is stored in the file, just the data is returned. Missing config flags in the file uses the default values from the config object.Default:False- Returns:
The tuple with the list of the PESS tensors and the PEPS unitcell is returned. If
return_config = True. the config is returned as well.- Return type:
tuple(list(jax.numpy.ndarray),PEPS_Unit_Cell) ortuple(list(jax.numpy.ndarray),PEPS_Unit_Cell,PEPS_AD_Config)- static load_from_group(grp: Group, *, return_config: bool = False) Tuple[List[Array], PEPS_Unit_Cell] | Tuple[List[Array], PEPS_Unit_Cell, PEPS_AD_Config]
Load the unit cell from a HDF5 group which is be passed to the method.
- Parameters:
grp (
h5py.Group) – HDF5 group object to load the data from.return_config (
bool, optional) – Return a config object initialized with the values from the HDF5 files. If no config is stored in the file, just the data is returned. Missing config flags in the file uses the default values from the config object.Default:False- Returns:
The tuple with the list of the PESS tensors and the PEPS unitcell is returned. If
return_config = True. the config is returned as well.- Return type:
tuple(list(jax.numpy.ndarray),PEPS_Unit_Cell) ortuple(list(jax.numpy.ndarray),PEPS_Unit_Cell,PEPS_AD_Config)- classmethod random(structure: Sequence[Sequence[int]], d: int, D: int, chi: int | Sequence[int], dtype: Type[number], max_chi: int, *, seed: int | None = None, destroy_random_state: bool = True) Tuple[List[Array], T_Square_Kagome_Map_PESS_To_PEPS]
- classmethod save_to_file(path: PathLike, tensors: List[Array], unitcell: PEPS_Unit_Cell, *, store_config: bool = True) None
Save unit cell to a HDF5 file.
This function creates a single group “square_kagome_pess” in the file and pass this group to the method
save_to_groupthen.- Parameters:
path (
os.PathLike) – Path of the new file. Caution: The file will overwritten if existing.store_config (
bool, optional) – Store the current values of the global config object into the HDF5 file as attrs of an extra group.Default:True- static save_to_group(grp: Group, tensors: List[Array], unitcell: PEPS_Unit_Cell, *, store_config: bool = True) None
Save unit cell to a HDF5 group which is be passed to the method.
- Parameters:
grp (
h5py.Group) – HDF5 group object to store the data into.store_config (
bool, optional) – Store the current values of the global config object into the HDF5 file as attrs of an extra group.Default:True- varipeps.mapping.square_kagome.square_kagome_density_matrix_horizontal(peps_tensors: Sequence[Array], peps_tensor_objs: Sequence[PEPS_Tensor], open_physical_indices: Tuple[Tuple[int], Tuple[int]]) Tuple[Array, Array]
Calculate the two parts of the horizontal two sites density matrix of the mapped Square Kagome lattice. Hereby, one can specify which physical indices should be open and which ones be traced before contracting the CTM structure.
- Parameters:
peps_tensors (sequence of
jax.numpy.ndarray) – Sequence of the PEPS tensors used for the density matrix.peps_tensor_objs (sequence of
varipeps.peps.PEPS_Tensor) – Sequence of the corresponding PEPS tensor objects.open_physical_indices (
tupleof twotupleofint) – Tuple with two tuples consisting of the physical indices which should be kept open for the left and right site.
- Returns:
Left and right part of the density matrix. Can be used for the two sites expectation value functions.
- Return type:
tupleof two:obj:jax.numpy.ndarray
- varipeps.mapping.square_kagome.square_kagome_density_matrix_vertical(peps_tensors: Sequence[Array], peps_tensor_objs: Sequence[PEPS_Tensor], open_physical_indices: Tuple[Tuple[int], Tuple[int]]) Tuple[Array, Array]
Calculate the two parts of the vertical two sites density matrix of the mapped Square Kagome lattice. Hereby, one can specify which physical indices should be open and which ones be traced before contracting the CTM structure.
- Parameters:
peps_tensors (sequence of
jax.numpy.ndarray) – Sequence of the PEPS tensors used for the density matrix.peps_tensor_objs (sequence of
varipeps.peps.PEPS_Tensor) – Sequence of the corresponding PEPS tensor objects.open_physical_indices (
tupleof twotupleofint) – Tuple with two tuples consisting of the physical indices which should be kept open for the top and bottom site.
- Returns:
Top and bottom part of the density matrix. Can be used for the two sites expectation value functions.
- Return type:
tupleof two:obj:jax.numpy.ndarray