Classification of Motions

This module implements the functionality for determining possible motions of a graph.

Methods

Constraints on edge lengths

equations_from_leading_coefs() Return equations for edge lengths from leading coefficients system.
four_cycles_ordered() Heuristic order of 4-cycles.
graph_with_same_edge_lengths() Return a graph with edge labels corresponding to same edge lengths.
lam() Return the variable for edge length in the ring of edge lengths.
motion_types2equations() Return equations enforced by edge lengths and singleton active NAC-colorings.
motion_types2same_edge_lenghts() Return the dictionary of same edge lengths enforced by given motion types.
motion_types2same_lengths_equations() Return the equations for edge lengths enforced by motion types.
singletons_table() Return table whether (active) NAC-colorings are singletons.

General methods

check_orthogonal_diagonals() Check the necessary conditions for orthogonal diagonals.
degenerate_triangle_equation() Return the equation for a degenerate triangle.
edge_lengths_dimension() Return the dimension of the variaty of edge lengths.
edge_lengths_satisfy_eqs() Check if a given dictionary of edge lengths satisfy given equations.
is_subcase() Return if eqs_a is a subcase of eqs_b, i.e., the ideal of eqs_a contains the ideal of eqs_b.
motion_types_equivalent_classes() Split a list of motion types into isomorphism classes.
possible_motion_types_and_active_NACs() Wraps the function for consistent motion types, conditions on orthogonality of diagonals and splitting into equivalence classes.

Motion types consistent with 4-cycles

NAC_coloring_restrictions() Return types of restrictions of NAC-colorings to 4-cycles.
consequences_of_nonnegative_solution_assumption() Return equations implied by the assumption of the existence of nonnegative solutions.
consistent_motion_types() Return the list of motion types consistent with 4-cycles.
motion_types2active_NACs() Return the active NAC-colorings for given motion types, if uniquely determined.
mu() Return the variable for a given NAC-coloring.
ramification_formula() Return ramification formula for a given 4-cycle and motion type.

Other

NAC_types2motion_type() Return the motion type for given types of NAC-colorings.
active_NAC_coloring_names() Return the names of active NAC-colorings for given motion types.
active_NACs2motion_types() Return the motion types of 4-cycles for a given set of active NAC-colorings.
cycle_edges() Return edges of a 4-cycle.
edge_lengts_dict2eqs() Return equations with asigned edge lengths.
four_cycle_normal_form() Return a 4-cycle with a motion type in the normal form.
motion_types2NAC_types() Return NAC-coloring types for a given motion type.
motion_types2tikz() Return TikZ code for the graph with edges colored according to the lengths enforced by motion types.
normalized_motion_types() Return motion types in the normal form.
show_factored_eqs() Show given equations factored.

System of equations for coordinates

edge_equations_ideal() Return the ideal of equations for coordinates of vertices and given edge constraints.
l() Return the variable for edge length in the ring with coordinates.
x() Return the variable for x coordinate of a vertex.
y() Return the variable for y coordinate of a vertex.

AUTHORS:

  • Jan Legerský (2019-02-18): initial version
  • Jan Legerský (2020-03-12): update to SageMath 9.0

MotionClassifier

class flexrilog.motion_classification.MotionClassifier(graph, four_cycles=[], separator='', edges_ordered=[])[source]

Bases: sage.structure.sage_object.SageObject

This class implements the functionality for determining possible motions of a graph.

NAC_coloring_restrictions()[source]

Return types of restrictions of NAC-colorings to 4-cycles.

EXAMPLE:

sage: from flexrilog import MotionClassifier, GraphGenerator
sage: MC = MotionClassifier(GraphGenerator.K33Graph())
sage: MC.NAC_coloring_restrictions()
{(1, 2, 3, 4): {'L': ['omega3', 'omega1', 'epsilon36', 'epsilon16'],
  'O': ['epsilon34', 'epsilon14', 'epsilon23', 'epsilon12'],
  'R': ['omega4', 'epsilon45', 'omega2', 'epsilon25']},
...
 (3, 4, 5, 6): {'L': ['omega5', 'omega3', 'epsilon25', 'epsilon23'],
  'O': ['epsilon56', 'epsilon36', 'epsilon45', 'epsilon34'],
  'R': ['omega6', 'epsilon16', 'omega4', 'epsilon14']}}
static NAC_types2motion_type(t)[source]

Return the motion type for given types of NAC-colorings.

active_NAC_coloring_names(motion_types)[source]

Return the names of active NAC-colorings for given motion types.

active_NACs2motion_types(active)[source]

Return the motion types of 4-cycles for a given set of active NAC-colorings.

check_orthogonal_diagonals(motion_types, active_NACs, extra_cycles_orthog_diag=[])[source]

Check the necessary conditions for orthogonal diagonals.

TODO:

return orthogonality_graph

consequences_of_nonnegative_solution_assumption(eqs)[source]

Return equations implied by the assumption of the existence of nonnegative solutions.

consistent_motion_types()[source]

Return the list of motion types consistent with 4-cycles.

static cycle_edges(cycle, sets=False)[source]

Return edges of a 4-cycle.

degenerate_triangle_equation(u, v, w)[source]

Return the equation for a degenerate triangle.

edge_equations_ideal(fixed_edge, eqs_lamdas=[], extra_eqs=[], show_input=False)[source]

Return the ideal of equations for coordinates of vertices and given edge constraints.

edge_lengths_dimension(eqs_lambdas)[source]

Return the dimension of the variaty of edge lengths.

edge_lengths_satisfy_eqs(eqs, edge_lengths, print_values=False)[source]

Check if a given dictionary of edge lengths satisfy given equations.

edge_lengts_dict2eqs(edge_lengths)[source]

Return equations with asigned edge lengths.

equations_from_leading_coefs(delta, extra_eqs=[], check=True)[source]

Return equations for edge lengths from leading coefficients system.

EXAMPLES:

sage: from flexrilog import GraphGenerator, MotionClassifier
sage: K33 = GraphGenerator.K33Graph()
sage: M = MotionClassifier(K33)
sage: M.equations_from_leading_coefs('epsilon56')
[lambda1_2^2 - lambda1_4^2 - lambda2_3^2 + lambda3_4^2]
sage: M.equations_from_leading_coefs('omega1')
Traceback (most recent call last):
...
ValueError: The NAC-coloring must be a singleton.
sage: M.equations_from_leading_coefs('omega1', check=False)
[lambda2_5^2*lambda3_4^2 - lambda2_5^2*lambda3_6^2 - lambda2_3^2*lambda4_5^2 + lambda3_6^2*lambda4_5^2 + lambda2_3^2*lambda5_6^2 - lambda3_4^2*lambda5_6^2]
static four_cycle_normal_form(cycle, motion_type)[source]

Return a 4-cycle with a motion type in the normal form.

four_cycles_ordered()[source]

Heuristic order of 4-cycles.

graph_with_same_edge_lengths(motion_types, plot=True)[source]

Return a graph with edge labels corresponding to same edge lengths.

INPUT:

  • plot – if True (default), then plot of the graph is returned.

OUTPUT:

The edge labels of the output graph are same for if the edge lengths are same due to motion_types.

static is_subcase(eqs_a, eqs_b)[source]

Return if eqs_a is a subcase of eqs_b, i.e., the ideal of eqs_a contains the ideal of eqs_b.

l(u, v)[source]

Return the variable for edge length in the ring with coordinates.

lam(u, v)[source]

Return the variable for edge length in the ring of edge lengths.

static motion_types2NAC_types(m)[source]

Return NAC-coloring types for a given motion type.

motion_types2active_NACs(motion_types)[source]

Return the active NAC-colorings for given motion types, if uniquely determined.

motion_types2equations(motion_types, active_NACs=None, groebner_basis=True, extra_eqs=[])[source]

Return equations enforced by edge lengths and singleton active NAC-colorings.

motion_types2same_edge_lenghts(motion_types)[source]

Return the dictionary of same edge lengths enforced by given motion types.

motion_types2same_lengths_equations(motion_types)[source]

Return the equations for edge lengths enforced by motion types.

motion_types2tikz(motion_types, color_names=[], vertex_style='lnodesmall', none_gray=False)[source]

Return TikZ code for the graph with edges colored according to the lengths enforced by motion types.

motion_types_equivalent_classes(motion_types_list)[source]

Split a list of motion types into isomorphism classes.

mu(delta)[source]

Return the variable for a given NAC-coloring.

static normalized_motion_types(motion_types)[source]

Return motion types in the normal form.

possible_motion_types_and_active_NACs(comments={}, show_table=True, one_representative=True, tab_rows=False, keep_orth_failed=False, equations=False)[source]

Wraps the function for consistent motion types, conditions on orthogonality of diagonals and splitting into equivalence classes.

ramification_formula(cycle, motion_type)[source]

Return ramification formula for a given 4-cycle and motion type.

EXAMPLES:

sage: from flexrilog import MotionClassifier, GraphGenerator
sage: MC = MotionClassifier(GraphGenerator.K33Graph())
sage: MC.ramification_formula((1,2,3,4), 'a')
[epsilon34,
 epsilon14,
 epsilon23,
 epsilon12,
 omega3 + omega1 + epsilon36 + epsilon16 - omega4 - epsilon45 - omega2 - epsilon25]
static show_factored_eqs(eqs, only_print=False, numbers=False, variables=False, print_latex=False, print_eqs=True)[source]

Show given equations factored.

singletons_table(active_NACs=None)[source]

Return table whether (active) NAC-colorings are singletons.

x(v)[source]

Return the variable for x coordinate of a vertex.

y(v)[source]

Return the variable for y coordinate of a vertex.