Calculation of two sites expectation values

class varipeps.expectation.two_sites.Two_Sites_Expectation_Value(horizontal_gates: Sequence[jax.Array], vertical_gates: Sequence[jax.Array], is_spiral_peps: bool = False, spiral_unitary_operator: jax.Array | None = None)

Bases: Expectation_Model

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

horizontal_gates: Sequence[Array]
is_spiral_peps: bool = False
spiral_unitary_operator: Array | None = None
vertical_gates: Sequence[Array]
varipeps.expectation.two_sites.calc_two_sites_diagonal_top_left_bottom_right_multiple_gates(peps_tensors: Sequence[Array], peps_tensor_objs: Sequence[PEPS_Tensor], gates: Sequence[Array]) List[Array]

Calculate the two site expectation values for two from top left to bottom right diagonal ordered PEPS tensor and their environment.

The order of the PEPS sequence have to be [top-left, top-right, bottom-left, bottom-right].

Parameters:
  • peps_tensors (sequence of jax.numpy.ndarray) – The PEPS tensor arrays. Have to be the same objects as the tensor attribute of the peps_tensor_obj argument.

  • peps_tensor_objs (sequence of PEPS_Tensor) – PEPS tensor objects.

  • gates (sequence of jax.numpy.ndarray) – Sequence with the gates which should be applied to the PEPS tensors. Gates are expected to be a matrix with first axis corresponding to the Hilbert space and the second axis corresponding to the dual room.

Returns:

List with the calculated expectation values of each gate.

Return type:

list of jax.numpy.ndarray

varipeps.expectation.two_sites.calc_two_sites_diagonal_top_left_bottom_right_single_gate(peps_tensors: Sequence[Array], peps_tensor_objs: Sequence[PEPS_Tensor], gate: Array) Array

Calculate the two site expectation value for two from top left to bottom right diagonal ordered PEPS tensor and their environment.

The order of the PEPS sequence have to be [top-left, top-right, bottom-left, bottom-right].

This function just wraps calc_two_sites_diagonal_top_left_bottom_right_multiple_gates.

Parameters:
  • peps_tensors (sequence of jax.numpy.ndarray) – The PEPS tensor arrays. Have to be the same objects as the tensor attribute of the peps_tensor_obj argument.

  • peps_tensor_objs (sequence of PEPS_Tensor) – PEPS tensor objects.

  • gates (sequence of jax.numpy.ndarray) – Gate which should be applied to the PEPS tensors. The gate is expected to be a matrix with first axis corresponding to the Hilbert space and the second axis corresponding to the dual room.

Returns:

Calculated expectation value of the gate.

Return type:

jax.numpy.ndarray

varipeps.expectation.two_sites.calc_two_sites_diagonal_top_right_bottom_left_multiple_gates(peps_tensors: Sequence[Array], peps_tensor_objs: Sequence[PEPS_Tensor], gates: Sequence[Array]) List[Array]

Calculate the two site expectation values for two from top left to bottom right diagonal ordered PEPS tensor and their environment.

The order of the PEPS sequence have to be [top-left, top-right, bottom-left, bottom-right].

Parameters:
  • peps_tensors (sequence of jax.numpy.ndarray) – The PEPS tensor arrays. Have to be the same objects as the tensor attribute of the peps_tensor_obj argument.

  • peps_tensor_objs (sequence of PEPS_Tensor) – PEPS tensor objects.

  • gates (sequence of jax.numpy.ndarray) – Sequence with the gates which should be applied to the PEPS tensors. Gates are expected to be a matrix with first axis corresponding to the Hilbert space and the second axis corresponding to the dual room.

Returns:

List with the calculated expectation values of each gate.

Return type:

list of jax.numpy.ndarray

varipeps.expectation.two_sites.calc_two_sites_diagonal_top_right_bottom_left_single_gate(peps_tensors: Sequence[Array], peps_tensor_objs: Sequence[PEPS_Tensor], gate: Array) Array

Calculate the two site expectation value for two from top right to bottom left diagonal ordered PEPS tensor and their environment.

The order of the PEPS sequence have to be [top-left, top-right, bottom-left, bottom-right].

This function just wraps calc_two_sites_diagonal_top_right_bottom_left_multiple_gates.

Parameters:
  • peps_tensors (sequence of jax.numpy.ndarray) – The PEPS tensor arrays. Have to be the same objects as the tensor attribute of the peps_tensor_obj argument.

  • peps_tensor_objs (sequence of PEPS_Tensor) – PEPS tensor objects.

  • gates (sequence of jax.numpy.ndarray) – Gate which should be applied to the PEPS tensors. The gate is expected to be a matrix with first axis corresponding to the Hilbert space and the second axis corresponding to the dual room.

Returns:

Calculated expectation value of the gate.

Return type:

jax.numpy.ndarray

varipeps.expectation.two_sites.calc_two_sites_horizontal_multiple_gates(peps_tensors: Sequence[Array], peps_tensor_objs: Sequence[PEPS_Tensor], gates: Sequence[Array]) List[Array]

Calculate the two site expectation values for two horizontal ordered PEPS tensor and their environment.

Parameters:
  • peps_tensors (sequence of jax.numpy.ndarray) – The PEPS tensor arrays. Have to be the same objects as the tensor attribute of the peps_tensor_obj argument.

  • peps_tensor_objs (sequence of PEPS_Tensor) – PEPS tensor objects.

  • gates (sequence of jax.numpy.ndarray) – Sequence with the gates which should be applied to the PEPS tensors. Gates are expected to be a matrix with first axis corresponding to the Hilbert space and the second axis corresponding to the dual room.

Returns:

List with the calculated expectation values of each gate.

Return type:

list of jax.numpy.ndarray

varipeps.expectation.two_sites.calc_two_sites_horizontal_single_gate(peps_tensors: Sequence[Array], peps_tensor_objs: Sequence[PEPS_Tensor], gate: Array) Array

Calculate the two site expectation value for two horizontal ordered PEPS tensor and their environment.

This function just wraps calc_two_sites_horizontal_multiple_gates.

Parameters:
  • peps_tensors (sequence of jax.numpy.ndarray) – The PEPS tensor arrays. Have to be the same objects as the tensor attribute of the peps_tensor_obj argument.

  • peps_tensor_objs (sequence of PEPS_Tensor) – PEPS tensor objects.

  • gates (sequence of jax.numpy.ndarray) – Gate which should be applied to the PEPS tensors. The gate is expected to be a matrix with first axis corresponding to the Hilbert space and the second axis corresponding to the dual room.

Returns:

Calculated expectation value of the gate.

Return type:

list of jax.numpy.ndarray

varipeps.expectation.two_sites.calc_two_sites_vertical_multiple_gates(peps_tensors: Sequence[Array], peps_tensor_objs: Sequence[PEPS_Tensor], gates: Sequence[Array]) List[Array]

Calculate the two site expectation values for two vertical ordered PEPS tensor and their environment.

Parameters:
  • peps_tensors (sequence of jax.numpy.ndarray) – The PEPS tensor arrays. Have to be the same objects as the tensor attribute of the peps_tensor_obj argument.

  • peps_tensor_objs (sequence of PEPS_Tensor) – PEPS tensor objects.

  • gates (sequence of jax.numpy.ndarray) – Sequence with the gates which should be applied to the PEPS tensors. Gates are expected to be a matrix with first axis corresponding to the Hilbert space and the second axis corresponding to the dual room.

Returns:

List with the calculated expectation values of each gate.

Return type:

list of jax.numpy.ndarray

varipeps.expectation.two_sites.calc_two_sites_vertical_single_gate(peps_tensors: Sequence[Array], peps_tensor_objs: Sequence[PEPS_Tensor], gate: Array) Array

Calculate the two site expectation value for two vertical ordered PEPS tensor and their environment.

This function just wraps calc_two_sites_vertical_multiple_gates.

Parameters:
  • peps_tensors (sequence of jax.numpy.ndarray) – The PEPS tensor arrays. Have to be the same objects as the tensor attribute of the peps_tensor_obj argument.

  • peps_tensor_objs (sequence of PEPS_Tensor) – PEPS tensor objects.

  • gates (sequence of jax.numpy.ndarray) – Gate which should be applied to the PEPS tensors. The gate is expected to be a matrix with first axis corresponding to the Hilbert space and the second axis corresponding to the dual room.

Returns:

Calculated expectation value of the gate.

Return type:

list of jax.numpy.ndarray