cotengra.pathfinders.path_compressed_greedy¶
Greedy contraction tree finders.
Attributes¶
Classes¶
A greedy contraction path finder that takes into account the effect of |
|
A contraction path optimizer that greedily generates spanning trees out |
Functions¶
|
|
|
|
|
|
|
|
|
Module Contents¶
- class cotengra.pathfinders.path_compressed_greedy.GreedyCompressed(chi, coeff_size_compressed=1.0, coeff_size=0.0, coeff_size_inputs=0.0, score_size_inputs='max', coeff_subgraph=0.0, score_subgraph='sum', coeff_centrality=0.0, centrality_combine='max', score_centrality='diff', temperature=0.0, score_perm='', early_terminate_size=None, seed=None)[source]¶
A greedy contraction path finder that takes into account the effect of compression, and can also make use of subgraph size and centrality.
- Parameters:
chi (int) – The maximum bond size between nodes to compress to.
coeff_size_compressed (float, optional) – When assessing contractions, how to weight the size of the output tensor, post compression.
coeff_size (float, optional) – When assessing contractions, how to weight the size of the output tenor, pre compression.
coeff_size_inputs (float, optional) – When assessing contractions, how to weight the maximum size of the inputs tensors.
score_size_inputs ({'sum', 'mean', 'max', 'min', 'diff'}, optional) – When assessing contractions, how to score the combination of the two input tensor sizes.
coeff_subgraph_size (float, optional) – When assessing contractions, how to weight the total subgraph size corresponding to the inputs tensors.
score_subgraph_size ({'sum', 'mean', 'max', 'min', 'diff'}, optional) – When assessing contractions, how to score the combination of the two input subgraph sizes.
coeff_centrality (float, optional) – When assessing contractions, how to weight the combined centrality of the inputs tensors.
centrality_combine ({'sum', 'mean', 'max', 'min'}, optional) – When performing the contraction, how to combine the two input tensor centralities to produce a new one.
score_centrality ({'sum', 'mean', 'max', 'min', 'diff'}, optional) – When assessing contractions, how to score the combination of the two input tensor centralities.
temperature (float, optional) – A noise level to apply to the scores when choosing nodes to expand to.
- chi¶
- coeff_size_compressed¶
- coeff_size¶
- coeff_size_inputs¶
- score_size_inputs¶
- coeff_subgraph¶
- score_subgraph¶
- coeff_centrality¶
- centrality_combine¶
- score_centrality¶
- temperature¶
- score_perm¶
- early_terminate_size¶
- gumbel¶
- cotengra.pathfinders.path_compressed_greedy.greedy_compressed(inputs, output, size_dict, memory_limit=None, **kwargs)[source]¶
- cotengra.pathfinders.path_compressed_greedy.trial_greedy_compressed(inputs, output, size_dict, **kwargs)[source]¶
- class cotengra.pathfinders.path_compressed_greedy.GreedySpan(start='max', coeff_connectivity=1.0, coeff_ndim=1.0, coeff_distance=-1.0, coeff_next_centrality=0.0, weight_bonds=True, temperature=0.0, score_perm='CNDLTI', distance_p=1, distance_steal='abs', seed=None)[source]¶
A contraction path optimizer that greedily generates spanning trees out of particular nodes, suitable for e.g. compressed contraction paths.
- Parameters:
start ({'max', 'min'}, optional) – Whether to start the span from the maximum or minimum centrality point.
coeff_connectivity (float, optional) – When considering adding nodes to the span, how to weight the nodes connectivity to the current span.
coeff_ndim (float, optional) – When considering adding nodes to the span, how to weight the nodes total rank.
coeff_distance (float, optional) – When considering adding nodes to the span, how to weight the nodes distance to the starting point.
coeff_next_centrality (float, optional) – When considering adding nodes to the span, how to weight the nodes centrality.
weight_bonds
temperature (float, optional) – A noise level to apply to the scores when choosing nodes to expand to.
score_perm
distance_p
distance_steal
- start¶
- coeff_connectivity¶
- coeff_ndim¶
- coeff_distance¶
- coeff_next_centrality¶
- weight_bonds¶
- temperature¶
- score_perm¶
- distance_p¶
- distance_steal¶
- rng¶
- gumbel¶
- cotengra.pathfinders.path_compressed_greedy.greedy_span(inputs, output, size_dict, memory_limit=None, **kwargs)[source]¶
- cotengra.pathfinders.path_compressed_greedy.trial_greedy_span(inputs, output, size_dict, **kwargs)[source]¶
- cotengra.pathfinders.path_compressed_greedy._allowed_perms¶