jet.bindings.TensorNetworkC128¶
-
class
TensorNetworkC128
¶ Bases:
pybind11_builtins.pybind11_object
TensorNetwork represents a tensor network.
Attributes
Mapping from indices to edges.
List of nodes in this tensor network.
Number of unique indices in this tensor network.
Number of tensors in this tensor network.
Path by which this tensor network was contracted.
Mapping from tags to node IDs.
-
dtype
¶
-
index_to_edge_map
¶ Mapping from indices to edges.
-
nodes
¶ List of nodes in this tensor network.
-
num_indices
¶ Number of unique indices in this tensor network.
-
num_tensors
¶ Number of tensors in this tensor network.
-
path
¶ Path by which this tensor network was contracted. Is empty if
Contract()
has not been called.
-
tag_to_node_id_map
¶ Mapping from tags to node IDs.
Methods
add_tensor
(self, tensor, tags)Adds a tensor to a tensor network.
contract
(self, path, int]] = [])Contracts a tensor network along an optionally-provided path.
slice_indices
(self, arg0, arg1)Slices a set of indices.
-
add_tensor
(self: jet.bindings.TensorNetworkC128, tensor: jet.bindings.TensorC128, tags: List[str] = []) → int¶ Adds a tensor to a tensor network.
- Parameters
tensor (Tensor) – Tensor to add.
tags (List[str]) – List of tags to associate with the tensor.
- Returns
Node ID assigned to the tensor.
- Return type
int
-
contract
(self: jet.bindings.TensorNetworkC128, path: List[Tuple[int, int]] = []) → jet.bindings.TensorC128¶ Contracts a tensor network along an optionally-provided path.
- Parameters
path (Optional[Tuple[str, str]]) – Optional contraction path specified as a list of node ID pairs.
- Returns
Tensor associated with the result of the final contraction.
- Return type
Tensor
-
slice_indices
(self: jet.bindings.TensorNetworkC128, arg0: List[str], arg1: int) → None¶ Slices a set of indices. The value taken along each axis is derived from the provided linear index.
- Parameters
indices (List[str]) – List of string indices to be sliced.
value (int) – Raveled index value representing the element to take along each of the indices.
-