General Framework Functions

This module provides some general functionality for frameworks.

pyrigi.framework._general.edge_lengths(framework, numerical=False)[source]

Return the dictionary of the edge lengths.

Parameters:
  • framework (FrameworkBase)

  • numerical (bool) – If True, numerical positions are used for the computation of the edge lengths.

Return type:

dict[Edge, Number]

Examples

>>> G = Graph([(0,1), (1,2), (2,3), (0,3)])
>>> F = Framework(G, {0:[0,0], 1:[1,0], 2:[1,'1/2 * sqrt(5)'], 3:['1/2','4/3']})
>>> edge_lengths(F, numerical=False)
{(0, 1): 1, (0, 3): sqrt(73)/6, (1, 2): sqrt(5)/2, (2, 3): sqrt((-4/3 + sqrt(5)/2)**2 + 1/4)}
>>> edge_lengths(F, numerical=True)
{(0, 1): 1.0, (0, 3): 1.4240006242195884, (1, 2): 1.118033988749895, (2, 3): 0.5443838790578374}
pyrigi.framework._general.is_congruent(framework, other_framework, numerical=False, tolerance=1e-09)[source]

Return whether the given framework is congruent to the framework.

Definitions

Congruent frameworks

Parameters:
  • framework (FrameworkBase)

  • other_framework (FrameworkBase) – The framework for checking the congruence.

  • numerical (bool) – Whether the check is symbolic (default) or numerical.

  • tolerance (float) – Used tolerance when checking numerically.

Return type:

bool

pyrigi.framework._general.is_congruent_realization(framework, other_realization, numerical=False, tolerance=1e-09)[source]

Return whether the given realization is congruent to the framework.

Definitions

Congruent frameworks

Parameters:
Return type:

bool

pyrigi.framework._general.is_equivalent(framework, other_framework, numerical=False, tolerance=1e-09)[source]

Return whether the given framework is equivalent to the framework.

Definitions

Equivalent frameworks

Parameters:
  • framework (FrameworkBase)

  • other_framework (FrameworkBase) – The framework for checking the equivalence.

  • numerical (bool) – Whether the check is symbolic (default) or numerical.

  • tolerance (float) – Used tolerance when checking numerically.

Return type:

bool

pyrigi.framework._general.is_equivalent_realization(framework, other_realization, numerical=False, tolerance=1e-09)[source]

Return whether the given realization is equivalent to the framework.

Definitions

Equivalent frameworks

Parameters:
Return type:

bool

pyrigi.framework._general.is_injective(framework, numerical=False, tolerance=1e-09)[source]

Return whether the realization is injective.

Parameters:
  • framework (FrameworkBase)

  • numerical (bool) – Whether the check is symbolic (default) or numerical.

  • tolerance (float) – Used tolerance when checking numerically.

Return type:

bool

Notes

For comparing whether two vectors are the same, misc.is_zero_vector() is used. See its documentation for the description of the parameters.

pyrigi.framework._general.is_quasi_injective(framework, numerical=False, tolerance=1e-09)[source]

Return whether the realization is quasi-injective.

Definitions

Quasi-injectivity

Parameters:
  • framework (FrameworkBase)

  • numerical (bool) – Whether the check is symbolic (default) or numerical.

  • tolerance (float) – Used tolerance when checking numerically.

Return type:

bool

Notes

For comparing whether two vectors are the same, misc.is_zero_vector() is used. See its documentation for the description of the parameters.