:py:mod:`cotengra.pathfinders.path_compressed_greedy` ===================================================== .. py:module:: cotengra.pathfinders.path_compressed_greedy .. autoapi-nested-parse:: Greedy contraction tree finders. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: cotengra.pathfinders.path_compressed_greedy.GreedyCompressed cotengra.pathfinders.path_compressed_greedy.GreedySpan Functions ~~~~~~~~~ .. autoapisummary:: cotengra.pathfinders.path_compressed_greedy._binary_combine cotengra.pathfinders.path_compressed_greedy.greedy_compressed cotengra.pathfinders.path_compressed_greedy.trial_greedy_compressed cotengra.pathfinders.path_compressed_greedy.greedy_span cotengra.pathfinders.path_compressed_greedy.trial_greedy_span Attributes ~~~~~~~~~~ .. autoapisummary:: cotengra.pathfinders.path_compressed_greedy._allowed_perms .. py:function:: _binary_combine(func, x, y) .. py:class:: 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) A greedy contraction path finder that takes into account the effect of compression, and can also make use of subgraph size and centrality. :param chi: The maximum bond size between nodes to compress to. :type chi: int :param coeff_size_compressed: When assessing contractions, how to weight the size of the output tensor, post compression. :type coeff_size_compressed: float, optional :param coeff_size: When assessing contractions, how to weight the size of the output tenor, pre compression. :type coeff_size: float, optional :param coeff_size_inputs: When assessing contractions, how to weight the maximum size of the inputs tensors. :type coeff_size_inputs: float, optional :param score_size_inputs: When assessing contractions, how to score the combination of the two input tensor sizes. :type score_size_inputs: {'sum', 'mean', 'max', 'min', 'diff'}, optional :param coeff_subgraph_size: When assessing contractions, how to weight the total subgraph size corresponding to the inputs tensors. :type coeff_subgraph_size: float, optional :param score_subgraph_size: When assessing contractions, how to score the combination of the two input subgraph sizes. :type score_subgraph_size: {'sum', 'mean', 'max', 'min', 'diff'}, optional :param coeff_centrality: When assessing contractions, how to weight the combined centrality of the inputs tensors. :type coeff_centrality: float, optional :param centrality_combine: When performing the contraction, how to combine the two input tensor centralities to produce a new one. :type centrality_combine: {'sum', 'mean', 'max', 'min'}, optional :param score_centrality: When assessing contractions, how to score the combination of the two input tensor centralities. :type score_centrality: {'sum', 'mean', 'max', 'min', 'diff'}, optional :param temperature: A noise level to apply to the scores when choosing nodes to expand to. :type temperature: float, optional .. py:method:: _score(i1, i2) .. py:method:: get_ssa_path(inputs, output, size_dict) .. py:method:: search(inputs, output, size_dict) .. py:method:: __call__(inputs, output, size_dict, memory_limit=None) .. py:function:: greedy_compressed(inputs, output, size_dict, memory_limit=None, **kwargs) .. py:function:: trial_greedy_compressed(inputs, output, size_dict, **kwargs) .. py:class:: 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) A contraction path optimizer that greedily generates spanning trees out of particular nodes, suitable for e.g. compressed contraction paths. :param start: Whether to start the span from the maximum or minimum centrality point. :type start: {'max', 'min'}, optional :param coeff_connectivity: When considering adding nodes to the span, how to weight the nodes connectivity to the current span. :type coeff_connectivity: float, optional :param coeff_ndim: When considering adding nodes to the span, how to weight the nodes total rank. :type coeff_ndim: float, optional :param coeff_distance: When considering adding nodes to the span, how to weight the nodes distance to the starting point. :type coeff_distance: float, optional :param coeff_next_centrality: When considering adding nodes to the span, how to weight the nodes centrality. :type coeff_next_centrality: float, optional :param weight_bonds: :param temperature: A noise level to apply to the scores when choosing nodes to expand to. :type temperature: float, optional :param score_perm: :param distance_p: :param distance_steal: .. py:method:: get_ssa_path(inputs, output, size_dict) .. py:method:: search(inputs, output, size_dict) .. py:method:: __call__(inputs, output, size_dict, memory_limit=None) .. py:function:: greedy_span(inputs, output, size_dict, memory_limit=None, **kwargs) .. py:function:: trial_greedy_span(inputs, output, size_dict, **kwargs) .. py:data:: _allowed_perms