cotengra.path_flowcutter#

Module Contents#

Classes#

FlowCutterOptimizer

Base class for different path optimizers to inherit from.

Functions#

optimize_flowcutter(inputs, output, size_dict[, ...])

trial_flowcutter(inputs, output, size_dict[, ...])

class cotengra.path_flowcutter.FlowCutterOptimizer(max_time=10, seed=None, executable='flow_cutter_pace17')#

Bases: opt_einsum.paths.PathOptimizer

Base class for different path optimizers to inherit from.

Subclassed optimizers should define a call method with signature:

def __call__(self, inputs, output, size_dict, memory_limit=None):
    """
    Parameters
    ----------
    inputs : list[set[str]]
        The indices of each input array.
    outputs : set[str]
        The output indices
    size_dict : dict[str, int]
        The size of each index
    memory_limit : int, optional
        If given, the maximum allowed memory.
    """
    # ... compute path here ...
    return path

where path is a list of int-tuples specifiying a contraction order.

run_flowcutter(file, max_time=None)#
compute_edge_path(lg)#
build_tree(inputs, output, size_dict, memory_limit=None)#
__call__(inputs, output, size_dict, memory_limit=None)#
cotengra.path_flowcutter.optimize_flowcutter(inputs, output, size_dict, memory_limit=None, max_time=10, seed=None)#
cotengra.path_flowcutter.trial_flowcutter(inputs, output, size_dict, max_time=10, seed=None)#