Ejemplo n.º 1
0
def pgl2_a4_1(q, a):
    '''
    q is assumed to be 1 mod 6
    '''
    pgl2 = PGL(2, q)
    field = pgl2.get_field()
    identity = pgl2.identity()
    unity_3_roots = [
        x for x in field.get_all_elements()
        if x * x + x + field.one() == field.zero()
    ]
    zeta = unity_3_roots[0]
    field_two = field.one() + field.one()

    s2_1 = pgl2.create([[a, field.one()], [field_two * a * a, -a]])
    if s2_1.det() == field.zero():
        return []
    s3 = pgl2.create([[zeta, field.zero()], [field.zero(), field.one()]])

    s2_2 = s3 * s2_1 * s3.inverse()
    s2_3 = s2_1 * s2_2

    elements = [identity, s2_1, s2_2, s2_3]
    elements_addition = [x * s3 for x in elements]
    elements_addition += [x * s3 * s3 for x in elements]
    elements += elements_addition
    return elements
Ejemplo n.º 2
0
def pgl2_a4_2(q, a):
    '''
    q is assumed to be 5 mod 6
    '''
    pgl2 = PGL(2, q)
    field = pgl2.get_field()
    identity = pgl2.identity()
    two = field.one() + field.one()
    three = two + field.one()
    nonsquare = SquareExtensionField.get_non_square_element(field)
    nonsquare_3_roots = [
        x for x in field.get_all_elements() if three * x * x == -nonsquare
    ]
    x = nonsquare_3_roots[0]

    bs = [
        b for b in field.get_all_elements()
        if b * b - two * b * x * x + three * three * x * x * x * x +
        two * two * a * a * x * x == field.zero()
    ]

    if len(bs) == 0:
        return []
    s2_1 = pgl2.create([[a, bs[0]], [field.one(), -a]])
    s3 = pgl2.create([[x, -three * x * x], [field.one(), x]])

    s2_2 = s3 * s2_1 * s3.inverse()
    s2_3 = s2_1 * s2_2

    elements = [identity, s2_1, s2_2, s2_3]
    elements_addition = [x * s3 for x in elements]
    elements_addition += [x * s3 * s3 for x in elements]
    elements += elements_addition
    return elements
Ejemplo n.º 3
0
def pgl2_a4_0(q, a):
    '''
    q is assumed to be 3 ** k
    '''
    pgl2 = PGL(2, q)
    field = pgl2.get_field()
    identity = pgl2.identity()

    s2_1 = pgl2.create([[a, -a * a - field.one()], [field.one(), -a]])
    s3 = pgl2.create([[field.one(), field.one()], [field.zero(), field.one()]])

    s2_2 = s3 * s2_1 * s3.inverse()
    s2_3 = s2_1 * s2_2

    elements = [identity, s2_1, s2_2, s2_3]
    elements_addition = [x * s3 for x in elements]
    elements_addition += [x * s3 * s3 for x in elements]
    elements += elements_addition
    return elements