cotengra.presets¶
Preset configured optimizers.
Attributes¶
Classes¶
An optimizer that automatically chooses between optimal and |
|
An optimizer that automatically chooses between optimal and |
Functions¶
|
Provides a very rough estimate of how long it would take to find the |
Cache and reuse for speed. But only construct dynamically. |
|
|
|
|
Get a contraction tree using the auto optimizer. |
Cache and reuse for speed. But only construct dynamically. |
|
|
|
|
Get a contraction tree using the auto optimizer. |
Module Contents¶
- cotengra.presets.estimate_optimal_hardness(inputs)[source]¶
Provides a very rough estimate of how long it would take to find the optimal contraction order for a given set of inputs. The runtime is very approximately exponential in this number:
\[T \propto \exp {n^2 * k^0.5}\]Where \(n\) is the number of tensors and \(k\) is the average degree of the hypergraph.
- class cotengra.presets.AutoOptimizer(optimal_cutoff=250, minimize='combo', cache=True, **hyperoptimizer_kwargs)[source]¶
Bases:
cotengra.oe.PathOptimizerAn optimizer that automatically chooses between optimal and hyper-optimization, designed for everyday use.
- minimize = 'combo'¶
- optimal_cutoff = 250¶
- _optimize_optimal_fn¶
- kwargs¶
- _hyperoptimizers_by_thread¶
- class cotengra.presets.AutoHQOptimizer(**kwargs)[source]¶
Bases:
AutoOptimizerAn optimizer that automatically chooses between optimal and hyper-optimization, designed for everyday use on harder contractions or those that will be repeated many times, and thus warrant a more extensive search.
- cotengra.presets.get_auto_optimizer()[source]¶
Cache and reuse for speed. But only construct dynamically.
- cotengra.presets.auto_optimize_tree(inputs, output, size_dict, **kwargs)[source]¶
Get a contraction tree using the auto optimizer.
- cotengra.presets.get_auto_hq_optimizer()[source]¶
Cache and reuse for speed. But only construct dynamically.
- cotengra.presets.auto_optimize_hq_tree(inputs, output, size_dict, **kwargs)[source]¶
Get a contraction tree using the auto optimizer.
- cotengra.presets.greedy_optimize¶
- cotengra.presets.optimal_optimize¶
- cotengra.presets.optimal_outer_optimize¶
- cotengra.presets.edgesort_optimize¶