Miscellaneous

This module provides various following miscellaneous functions.

pyrigi.misc.is_isomorphic_graph_list(list1, list2)[source]

Return whether two lists of graphs are the same up to graph isomorphism.

Return type:

bool

pyrigi.misc.is_zero(expr, numerical=False, tolerance=1e-09)[source]

Return if the given expression is zero.

Parameters:
  • expr (int | float | str) – Expression that is checked.

  • numerical (bool) – If True, then the check is done only numerically with the given tolerance. If False (default), the check is done symbolically, sympy method equals is used.

  • tolerance (float) – The tolerance that is used in the numerical check coordinate-wise.

Return type:

bool

pyrigi.misc.is_zero_vector(vector, numerical=False, tolerance=1e-09)[source]

Return if the given vector is zero.

Parameters:
  • vector (Sequence[int | float | str]) – Vector that is checked.

  • numerical (bool) – If True, then the check is done only numerically with the given tolerance. If False (default), the check is done symbolically, sympy attribute is_zero is used.

  • tolerance (float) – The tolerance that is used in the numerical check coordinate-wise.

Return type:

bool

pyrigi.misc.point_to_vector(point)[source]

Return point as single column sympy Matrix.

Return type:

MutableDenseMatrix

Parameters:

point (Sequence[int | float | str])

pyrigi.misc.sympy_expr_to_float(expression, tolerance=1e-09)[source]

Convert a sympy expression to (numerical) floats.

If the given expression is a Sequence of Numbers or a Matrix, then each individual element is evaluated and a list of float is returned. If the input is just a single sympy expression, it is evaluated and returned as a float.

Parameters:
Return type:

list[float] | float

Notes

The method data_type.point_to_vector() is used to ensure that the input is consistent with the sympy format.