def pgl2_conjugation_class(q, square_trace_to_det_ratio) -> Iterable[PGLElement]: pgl2 = PGL2(q) field = pgl2.get_field() field_elements = field.get_all_elements() field_two = field.one() + field.one() field_four = field_two + field_two s = square_trace_to_det_ratio assert (s != field_four and s != field.zero()) results = [ pgl2.create([[field.zero(), field.one()], [-d * d / s, d]]) for d in field_elements if d != field.zero() ] results += [ pgl2.create( [[field.one(), b], [-(d * d + (field_two - s) * d + field.one()) / (b * s), d]]) for b, d in product(field_elements, repeat=2) if b != field.zero() and d != -field.one() ] discriminant_square = s * s - field_four * s if discriminant_square.legendre() > 0: discriminant = discriminant_square.sqrt() ds = [(s - field_two + discriminant) / field_two, (s - field_two - discriminant) / field_two] results += [ pgl2.create([[field.one(), field.zero()], [c, d]]) for c, d in product(field_elements, ds) ] return results
def pgl2_s4(q) -> Iterable[PGL2Element]: assert (q % 8 == 3 or q % 8 == 5) pgl2 = PGL2(q) field = pgl2.get_field() r = pgl2.create2(field.zero(), field.one(), -field.one(), field.one()) if q % 8 == 3: minus_two = -field.one() - field.one() a = minus_two.sqrt() s = pgl2.create2(field.one(), minus_two, field.one() + a, -field.one()) else: minus_one = -field.one() i = minus_one.sqrt() s = pgl2.create2(field.zero(), i, field.one(), field.zero()) elements = [ pgl2.identity(), r, r * r, r * s, r * r * s, r * s * r, r * s * r * r, r * r * s * r, r * r * s * r * r, r * s * r * r * s, r * r * s * r * s, r * r * s * r * r * s, r * s * r * r * s * r ] elements += [ s, s * r, s * r * r, s * r * s, s * r * r * s, s * r * s * r * r, s * r * r * s * r, s * r * r * s * r * r, s * r * s * r * r * s, s * r * r * s * r * s, s * r * s * r * r * s * r ] return elements
def get_pgl2_data(q, is_unitary): representation_class = get_representation_class(is_unitary) pgl2 = PGL2(q) action = PGLGroupAction(pgl2) elements_generator = pgl2 labelling = GraphLabelling(elements_generator) representation = representation_class(action, pgl2.get_pf().infinity()) return representation, labelling
def pgl2_upper_triangular(q) -> Iterable[PGL2Element]: pgl2 = PGL2(q) field = pgl2.get_field() field_elements = field.get_all_elements() elements = [ pgl2.create2(a, b, field.zero(), field.one()) for a, b in product(field_elements, repeat=2) if a != field.zero() ] return elements
def get_pgl2_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) labelling = GraphLabelling(elements_generator) representation = representation_class(action, pgl2.get_pf().infinity()) return representation, labelling
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
def get_pgl2_partial_elements_data(q, is_unitary, elements): representation_class = get_representation_class(is_unitary) pgl2 = PGL2(q) action = PGLGroupAction(pgl2) if isinstance(elements, ElementsGenerator): elements_generator = elements else: elements_generator = IterableElementsGenerator(elements) labelling = GraphLabelling(elements_generator) representation = representation_class(action, pgl2.get_pf().infinity()) return representation, labelling
def pgl2_zero_infinity_stabilizer(q) -> Iterable[PGL2Element]: pgl2 = PGL2(q) field = pgl2.get_field() field_elements = field.get_all_elements() elements = [ pgl2.create2(a, field.zero(), field.zero(), field.one()) for a in field_elements if a != field.zero() ] elements += [ pgl2.create2(field.zero(), a, field.one(), field.zero()) for a in field_elements if a != field.zero() ] return elements
def main(): for q in [3, 5, 7, 9, 11, 13, 17, 19, 23, 25]: print('q=%d' % q) pgl = PGL2(q) action1 = PGLGroupAction(pgl) action = ActionOnTuple(action1, 2) representation = PermutationRepresentation(action) trace_calculations = PGL2CharacterProductsCalculator(pgl) decomposition_string = trace_calculations.get_decomposed_representation_string(representation) print(str(representation) + '=' + decomposition_string) measure_dictionary = get_measure_mapping() print("Done!")
def get_pgl2_up_to_conjugation_with_determinant_data(q, is_unitary, determinant_data): representation_class = get_representation_class(is_unitary) pgl2 = PGL2(q) action = PGLGroupAction(pgl2) elements_generator = pgl2 conjugation_classes = pgl2.get_conjugation_classes() conjugation_classes = { element: conjugation_classes[element] for element in conjugation_classes } labelling = DeterminantDataUpToConjugationGraphLabelling( conjugation_classes, elements_generator, determinant_data) representation = representation_class(action, pgl2.get_pf().infinity()) return representation, labelling
def __init__(self, q): self._q = q self._pgl2 = PGL2(q) self._pgl2_action = PGLGroupAction(self._pgl2) one = self._pgl2.get_field().one() self._fixed_values = [ self._pgl2.get_pf().zero(), self._pgl2.get_pf().create([one, one]), self._pgl2.get_pf().infinity() ] self._acted_upon_elements = list(permutations(range(2, self._q))) self._inverse_integral_value = { self._pgl2_action.get_integral_value(x): x for x in self._pgl2_action.get_acted_upon_elements() }
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
def pgl2_diagonal_conjugation_class(q) -> Iterable[PGLElement]: pgl2 = PGL2(q) field = pgl2.get_field() field_elements = field.get_all_elements() results = [ pgl2.create([[field.one(), b], [c, -field.one()]]) for b, c in product(field.get_all_elements(), repeat=2) if (field.one() + b * c).legendre() > 0 ] results += [ pgl2.create([[field.zero(), b], [field.one(), field.zero()]]) for b in field_elements if b.legendre() > 0 ] return results
def pgl2_dihedral_imaginary_stabilizer(q) -> Iterable[PGL2Element]: pgl2 = PGL2(q) field = pgl2.get_field() non_square = SquareExtensionField.get_non_square_element(field) field_elements = field.get_all_elements() elements = [ pgl2.create2(field.one(), b, b * non_square, field.one()) for b in field_elements if b != field.zero() ] elements.append( pgl2.create2(field.zero(), field.one(), non_square, field.zero())) elements.extend([ pgl2.create2(field.one(), b, -b * non_square, -field.one()) for b in field_elements ]) elements.append( pgl2.create2(field.zero(), field.one(), -non_square, field.zero())) elements.append(pgl2.identity()) return elements
def get_po2_data(q, is_unitary): representation_class = get_representation_class(is_unitary) pgl2 = PGL2(q) action = PGLGroupAction(pgl2) field = pgl2.get_field() elements = [ pgl2.create2(field.one(), b, -b, field.one()) for b in field.get_all_elements() ] elements.extend([ pgl2.create2(field.zero(), field.one(), b, field.zero()) for b in [field.one(), -field.one()] ]) elements.extend([ pgl2.create2(field.one(), b, b, -field.one()) for b in field.get_all_elements() ]) elements_generator = IterableElementsGenerator(elements) labelling = GraphLabelling(elements_generator) representation = representation_class(action, pgl2.get_pf().infinity()) return representation, labelling
def pgl2_unipotent_conjugation_class(q) -> Iterable[PGLElement]: pgl2 = PGL2(q) field = pgl2.get_field() field_elements = field.get_all_elements() results = [ pgl2.create([[field.one(), x], [field.zero(), field.one()]]) for x in field_elements if x != field.zero() ] results += [ pgl2.create([[field.one(), field.zero()], [x, field.one()]]) for x in field_elements if x != field.zero() ] results += [ pgl2.create([[a, b], [ -(a - field.one()) * (a - field.one()) / b, field.one() + field.one() - a ]]) for a, b in product(field_elements, repeat=2) if a != field.one() and b != field.zero() ] return results
def get_maximal_subgroups_up_to_conjugation( q) -> Iterable[ElementsGenerator[PGL2Element]]: p, k = get_prime_base_and_exponent(q) pgl2 = PGL2(q) prime_powers_inverses = [] if k % 2 == 0: prime_powers_inverses += [k // 2] prime_powers_inverses += [ k // i for i in odd_primes_up_to(k) if k % i == 0 ] subgroups = [ IterableElementsGenerator(pgl2_zero_infinity_stabilizer(q), "Stab(0, ∞)"), IterableElementsGenerator(pgl2_dihedral_imaginary_stabilizer(q), "Stab(𝛿, -𝛿)"), IterableElementsGenerator(pgl2_upper_triangular(q), "Stab(0)"), ] subgroups += [pgl2.smaller_pgl2(p**i) for i in prime_powers_inverses] if q > 3 and k == 1 and q % 8 == 3 or q % 8 == 5: subgroups.append(IterableElementsGenerator(pgl2_s4(q), "S4")) subgroups += [PSL2(q)] return subgroups
def __init__(self, pgl2: PGL2, k): self._pgl2 = pgl2 self._base_field = pgl2.get_field() self._q = self._base_field.size() assert (0 < k < self._q / 2) self.square_field = SquareExtensionField.from_base_field( self._base_field) self.square_field_character = FieldCharacter(self.square_field, k, self._q + 1) self.multiplicative_group = FieldMultiplicativeGroup.from_field( self.square_field) self.representatives_by_index = [ self.multiplicative_group.get_element(i) for i in range(self._q - 1) ] self.representative_index_by_field_element = {} for i in range(self._q - 1): self.representative_index_by_field_element[self.square_field.norm( self.representatives_by_index[i])] = i self.norm_one_elements = [ self.multiplicative_group.get_element(i) for i in range(0, self._q**2 - 1, self._q - 1) ]
def __init__(self, pgl: PGL2): self.q = pgl.q() self.conjugation_classes = pgl.get_conjugation_classes() self.characters = get_pgl2q_characters(self.q) self.elements = pgl.get_all_elements()
from group_actions import PGLGroupAction from projective_sets.pgl2 import PGL2 from utilities.my_polynomial import MyPolynomial from copy import copy from itertools import product, combinations, combinations_with_replacement from operator import mul from functools import reduce from math import log from representations.characters.wedge_character import WedgeCharacter q = 5 graph = nx.configuration_model((2, )) graph2 = nx.configuration_model((4, )) pgl2 = PGL2(q) action = PGLGroupAction(pgl2) representation = TransitiveActionUnitaryStandardRepresentation( action, pgl2.get_pf().infinity()) characters = [ WedgeCharacter.create_wedge_character(representation, i) for i in range(q + 1) ] conjugation_classes = list(pgl2.get_conjugation_classes().keys()) graph_covering = GraphCovering(graph, representation) graph_covering2 = GraphCovering(graph2, representation) graph_labelling = UpToConjugationGraphLabelling(pgl2.get_conjugation_classes(), pgl2)
def get_action_average_polynomial(action, conjugation_classes): orbit_lengths = find_orbits(action, conjugation_classes) return get_average_polynomial(orbit_lengths) def pop_if_found(dict, key): if key in dict: dict.pop(key) qs = [11] for q in qs: print('q = %d' % q) group = PGL2(q) action = PGLGroupAction(group) conjugation_classes = group.get_conjugation_classes() sn_average_polynomial = get_action_average_polynomial( SNGroupAction(q + 1), get_sn_conjugation_classes(q + 1)) orbit_lengths = find_orbits(action, conjugation_classes) polynomials = get_polynomials(orbit_lengths) polynomials2 = np.asarray(polynomials) polynomials.append(sn_average_polynomial) polynomials3 = np.asarray(polynomials) r1 = matrix_rank(polynomials2) r2 = matrix_rank(polynomials3) poly_number = len(polynomials2) print(poly_number, r1, r2)