tensornetwork.contractors.auto

tensornetwork.contractors.auto(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

Chooses one of the above algorithms according to network size.

Default behavior is based on opt_einsum’s auto contractor.

Parameters:
  • nodes – A collection of connected nodes.
  • output_edge_order – An optional list of edges. Edges of the final node in nodes_set are reordered into output_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:

Final node after full contraction.