tensornetwork.contractors.greedy¶
-
tensornetwork.contractors.
greedy
(nodes: Iterable[tensornetwork.network_components.AbstractNode], output_edge_order: Optional[Sequence[tensornetwork.network_components.Edge]] = None, memory_limit: Optional[int] = None, ignore_edge_order: bool = False) → tensornetwork.network_components.AbstractNode¶ Greedy contraction path via
opt_einsum
.This provides a more efficient strategy than
optimal
for finding contraction paths in large networks. First contracts pairs of tensors by finding the pair with the lowest cost at each step. Then it performs the outer products. More details on greedy path.Parameters: - nodes – an iterable of Nodes
- output_edge_order – An optional list of edges.
Edges of the final node in
nodes_set
are reordered intooutput_edge_order
; if final node has more than one edge,output_edge_order
must be provided. - memory_limit – Maximum number of elements in an array during contractions.
- ignore_edge_order – An option to ignore the output edge order.
Returns: The final node after full contraction.