Mapping of Maple leaf structures (varipeps.mapping.maple_leaf)

class varipeps.mapping.maple_leaf.Maple_Leaf_Expectation_Value(green_gates: Sequence[Array], blue_gates: Sequence[Array], red_gates: Sequence[Array], real_d: int, normalization_factor: int = 6, is_spiral_peps: bool = False, spiral_unitary_operator: Array | None = None)[source]

Bases: Expectation_Model

Class to calculate expectation values for a mapped Maple-Leaf structure.

Structure of the Maple-Leaf lattice with the smallest possible unit cell marked by dashed lines, the different interaction types marked by color and the numbering of the single sites inside one unit cell block shown.

Structure of the Maple-Leaf lattice with the smallest possible unit cell marked by dashed lines, the different interaction types marked by color and the numbering of the single sites inside one unit cell block shown.

Parameters:
  • green_gates (sequence of jax.numpy.ndarray) – Sequence with the gates that should be applied to the green bonds as shown in the image above.

  • blue_gates (sequence of jax.numpy.ndarray) – Sequence with the gates that should be applied to the green bonds as shown in the image above.

  • red_gates (sequence of jax.numpy.ndarray) – Sequence with the gates that should be applied to the green bonds as shown in the image above.

  • 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

  • is_spiral_peps (bool, optional) – Flag if the expectation value is for a spiral iPEPS ansatz.

    Default: False

  • spiral_unitary_operator (jax.numpy.ndarray, optional) – Operator used to generate unitary for spiral iPEPS ansatz. Required if spiral iPEPS ansatz is used.

    Default: None

__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, return_single_gate_results: bool = False) Array | List[Array][source]

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: True

  • only_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:

jax.numpy.ndarray or list of jax.numpy.ndarray

blue_gates: Sequence[Array]
green_gates: Sequence[Array]
is_spiral_peps: bool = False
normalization_factor: int = 6
real_d: int
red_gates: Sequence[Array]
spiral_unitary_operator: Array | None = None
class varipeps.mapping.maple_leaf.Maple_Leaf_Map_PESS_To_PEPS(unitcell_structure: Sequence[Sequence[int]], chi: int, max_chi: int | None = None)[source]

Bases: Map_To_PEPS_Model

Map a iPESS structure of the Maple Leaf to a PEPS unitcell. The convention for the input tensors is:

Convention for physical site tensors: * t1: [physical, down simplex, up simplex] * t2: [physical, down simplex, up simplex] * t3: [physical, up simplex, down simplex]

Convention for simplex tensors: * up: [t1, t2, t3] * down: [t3, t2, t1]

Parameters:
  • unitcell_structure (sequence of sequence of int or 2d array) – Two dimensional array modeling the structure of the unit cell. For details see the description of PEPS_Unit_Cell.

  • chi (int) – Bond dimension of environment tensors which should be used for the unit cell generated.

  • max_chi (int, optional) – Maximal allowed bond dimension of environment tensors which should be used for the unit cell generated.

    Default: None

__call__(input_tensors: Sequence[Array], *, generate_unitcell: bool = True) List[Array] | Tuple[List[Array], PEPS_Unit_Cell][source]

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 = True the unitcell for these tensors.

Return type:

list of jax.numpy.ndarray or tuple of list of jax.numpy.ndarray and PEPS_Unit_Cell

classmethod autosave_wrapper(filename: PathLike, tensors: Array, unitcell: PEPS_Unit_Cell, counter: int | None = None, auxiliary_data: Dict[str, Any] | None = None) None[source]
chi: int
classmethod load_from_file(path: PathLike, *, return_config: bool = False, return_auxiliary_data: bool = False) Tuple[List[Array], PEPS_Unit_Cell] | Tuple[List[Array], PEPS_Unit_Cell, VariPEPS_Config][source]

Load Maple-Leaf PESS tensors and unit cell from a HDF5 file.

This function read the group “maple_leaf_pess” from the file and pass this group to the method load_from_group then.

Parameters:

path (os.PathLike) – Path of the HDF5 file.

Keyword Arguments:
  • 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

  • return_auxiliary_data (bool, optional) – Return dictionary with string indexed auxiliary data which has been should be stored along the other data in the file.

    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. If return_auxiliary_data = True. the auxiliary data is returned as well.

Return type:

tuple(list(jax.numpy.ndarray), PEPS_Unit_Cell) or tuple(list(jax.numpy.ndarray), PEPS_Unit_Cell, VariPEPS_Config)

static load_from_group(grp: Group, *, return_config: bool = False) Tuple[List[Array], PEPS_Unit_Cell] | Tuple[List[Array], PEPS_Unit_Cell, VariPEPS_Config][source]

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.

Keyword Arguments:

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) or tuple(list(jax.numpy.ndarray), PEPS_Unit_Cell, VariPEPS_Config)

max_chi: int | None = None
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_Maple_Leaf_Map_PESS_To_PEPS][source]
classmethod save_to_file(path: PathLike, tensors: List[Array], unitcell: PEPS_Unit_Cell, *, store_config: bool = True, auxiliary_data: Dict[str, Any] | None = None) None[source]

Save Maple-Leaf PESS tensors and unit cell to a HDF5 file.

This function creates a single group “maple_leaf_pess” in the file and pass this group to the method save_to_group then.

Parameters:
  • path (os.PathLike) – Path of the new file. Caution: The file will overwritten if existing.

  • tensors (list of jax.numpy.ndarray) – List with the PEPS tensors which should be stored in the file.

  • unitcell (PEPS_Unit_Cell) – Full unit cell object which should be stored in the file.

Keyword Arguments:
  • 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

  • auxiliary_data (dict with str to storable objects, optional) – Dictionary with string indexed auxiliary HDF5-storable entries which should be stored along the other data in the file.

    Default: None

static save_to_group(grp: Group, tensors: List[Array], unitcell: PEPS_Unit_Cell, *, store_config: bool = True) None[source]

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.

  • tensors (list of jax.numpy.ndarray) – List with the PEPS tensors which should be stored in the file.

  • unitcell (PEPS_Unit_Cell) – Full unit cell object which should be stored in the file.

Keyword Arguments:

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

unitcell_structure: Sequence[Sequence[int]]
varipeps.mapping.maple_leaf.get_diagonal_gates(b_e, r_e, d)[source]
varipeps.mapping.maple_leaf.get_down_gates(b_e, r_e, d)[source]
varipeps.mapping.maple_leaf.get_onsite_gates(g_e, b_e, r_e, d)[source]
varipeps.mapping.maple_leaf.get_right_gates(b_e, r_e, d)[source]
varipeps.mapping.maple_leaf.maple_leaf_density_matrix_diagonal(peps_tensors: Sequence[Array], peps_tensor_objs: Sequence[PEPS_Tensor], open_physical_indices: Tuple[Tuple[int], Tuple[int]]) Tuple[Array, Array][source]

Calculate the two parts of the diagxonal two sites density matrix of the mapped maple leaf 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 (tuple of two tuple of int) – Tuple with two tuples consisting of the physical indices which should be kept open for the top left and bottom right site.

Returns:

Top left and bottom right part of the density matrix. Can be used for the two sites expectation value functions.

Return type:

tuple of two:obj:jax.numpy.ndarray