Esempio n. 1
0
def get_sn_up_to_conjugation_data(q, is_unitary):
    representation_class = get_representation_class(is_unitary)
    action = SNGroupAction(q + 1)
    elements_generator = action.get_elements_generator()
    conjugation_classes = get_sn_conjugation_classes(q + 1)
    labelling = UpToConjugationGraphLabelling(conjugation_classes,
                                              elements_generator)
    representation = representation_class(action, q)
    return representation, labelling
Esempio n. 2
0
def get_pgl2_up_to_conjugation_data(q, is_unitary):
    representation_class = get_representation_class(is_unitary)
    pgl2 = PGL2(q)
    action = PGLGroupAction(pgl2)
    elements_generator = pgl2
    conjugation_classes = pgl2.get_conjugation_classes()
    labelling = UpToConjugationGraphLabelling(conjugation_classes,
                                              elements_generator)
    representation = representation_class(action, pgl2.get_pf().infinity())
    return representation, labelling
Esempio n. 3
0
def get_cn_up_to_conjugation_data(q, is_unitary):
    representation_class = get_representation_class(is_unitary)
    action = CNGroupAction(q + 1)
    elements_generator = action.get_elements_generator()
    conjugation_classes = {0: 1}
    for i in range(1, q + 1):
        d = math.gcd(i, q + 1)
        if d not in conjugation_classes:
            conjugation_classes[d] = 0
        conjugation_classes[d] += 1
    labelling = UpToConjugationGraphLabelling(conjugation_classes,
                                              elements_generator)
    representation = representation_class(action, q)
    return representation, labelling
Esempio n. 4
0
def get_pgl2_up_to_conjugation_filtered_data(
        q, is_unitary, pgl_filter: Callable[[PGL2Element], bool]):
    representation_class = get_representation_class(is_unitary)
    pgl2 = PGL2(q)
    action = PGLGroupAction(pgl2)
    elements_generator = ConditionalElementsGenerator(pgl2, pgl_filter)
    conjugation_classes = pgl2.get_conjugation_classes()
    conjugation_classes = {
        element: conjugation_classes[element]
        for element in conjugation_classes if pgl_filter(element)
    }
    labelling = UpToConjugationGraphLabelling(conjugation_classes,
                                              elements_generator)
    representation = representation_class(action, pgl2.get_pf().infinity())
    return representation, labelling
Esempio n. 5
0
number_of_elements = sum(conjugation_classes.values())

triangular_subset = pgl2_upper_triangular(q)
number_of_triangular_elements = len(triangular_subset)

elements_generator = IterableElementsGenerator(triangular_subset)
projective_zero = pgl2.get_pf().zero()
action = StabilizedPGLGroupAction(pgl2, [projective_zero], elements_generator)
representation = PermutationRepresentation(action)
up_to_conjugation_elements = {}
for element in triangular_subset:
    conjugation_class = pgl2.get_conjugation_class(element)
    if conjugation_class not in up_to_conjugation_elements:
        up_to_conjugation_elements[conjugation_class] = 0
    up_to_conjugation_elements[conjugation_class] += 1
graph_labelling = UpToConjugationGraphLabelling(up_to_conjugation_elements, elements_generator)
graph_covering = GraphCovering(graph, representation)

action2 = PGLGroupAction(pgl2)
representation2 = TransitiveActionUnitaryStandardRepresentation(action2, pgl2.get_pf().infinity())
graph_labelling2 = UpToConjugationGraphLabelling(conjugation_classes, pgl2)
graph_covering2 = GraphCovering(graph, representation2)

matching_polynomials = {}
characteristic_polynomials = {}

for labelling, weight in graph_labelling.weighted_labellings(graph):
    adjacency = graph_covering.adjacency(labelling).astype(int)
    lifted_graph = from_numpy_matrix(adjacency, create_using=nx.MultiGraph, parallel_edges=True)
    polynomial = get_matching_polynomial(lifted_graph)
    matching_polynomials[list(labelling.values())[0]] = (polynomial, weight)
    return minimizing_function


graph = nx.configuration_model((2, ))

q = 5
pgl2 = PGL2(q)
conjugation_classes = pgl2.get_conjugation_classes()
number_of_elements = sum(conjugation_classes.values())

action2 = PGLGroupAction(pgl2)
representation = TransitiveActionUnitaryStandardRepresentation(
    action2,
    pgl2.get_pf().infinity())
graph_labelling = UpToConjugationGraphLabelling(conjugation_classes, pgl2)
graph_covering = GraphCovering(graph, representation)

characteristic_polynomials = {}

for labelling, weight in graph_labelling.weighted_labellings(graph):
    polynomial = graph_covering.get_polynomial(labelling)
    characteristic_polynomials[list(labelling.values())[0]] = (polynomial,
                                                               weight)

m = []

elements = list(characteristic_polynomials.keys())

for g in characteristic_polynomials:
    m.append(characteristic_polynomials[g][1] *
Esempio n. 7
0
from representations import PermutationRepresentation
from projective_sets.pxl2_subsets import *
from group_actions.pgl2_group_action import PGLGroupAction

graph = nx.random_regular_graph(2, 3)
# graph = nx.configuration_model((2,))

q = 7
pgl2 = PGL2(q)
conjugation_classes = pgl2.get_conjugation_classes()

elements_generator = pgl2
action = PGLGroupAction(pgl2)
representation = PermutationRepresentation(action)
up_to_conjugation_elements = pgl2.get_conjugation_classes()
graph_labelling = UpToConjugationGraphLabelling(up_to_conjugation_elements,
                                                elements_generator)
graph_covering = GraphCovering(graph, representation)

matching_polynomials = []
matching_polynomials2 = {}
weights = []

for labelling, weight in graph_labelling.weighted_labellings(graph):
    adjacency = graph_covering.adjacency(labelling).astype(int)
    lifted_graph = from_numpy_matrix(adjacency,
                                     create_using=nx.MultiGraph,
                                     parallel_edges=True)
    polynomial = get_matching_polynomial(lifted_graph)
    matching_polynomials.append(polynomial)
    matching_polynomials2[list(labelling.values())[0]] = polynomial
    weights.append(weight)