Helper to calculate perodic indices (varipeps.utils.periodic_indices)

varipeps.utils.periodic_indices.calculate_periodic_indices(key: Tuple[int | slice, int | slice], structure: Tuple[Tuple[int, ...], ...], real_ix: int, real_iy: int) Sequence[Sequence[int]][source]

Get indices according to unit cell structure.

Parameters:
  • key (tuple of 2 int or slice elements) – x and y coordinates to select. Can be either integers or slices. Negative numbers as selectors are supported.

  • structure (2d jax.numpy.ndarray) – Two dimensional array modeling the structure of the unit cell. For details see the description of PEPS_Unit_Cell.

  • real_ix (int) – Which real x index of structure correspond to x = 0.

  • real_iy (int) – Which real y index of structure correspond to y = 0.

Returns:

2d sequence with the indices of the selected objects.

Return type:

sequence of sequence of int