def __init__(self, F, irpoly, g=None, rep=None):
    "Define the base Field or extension Field and the irreducible polynomial\n           F is the base field on top of which the extension\n        field is built\n           irpoly is the irreducible polynomial used to build\n        the extension field as F/irpoly\n           g is a non quadratic residue used to compute square\n        roots, if it is set to None, computing a square root\n        will initialize g\n           rep is the representation of the root of irpoly\n        (note that letter 'A' is reserved for the Complex extension field)\n        "
    self.F = F
    self.irpoly = irpoly
    self.deg = len(irpoly.coef)
    assert (self.deg > 0)
    self.q = (self.F.q ** (self.deg - 1))
    self.tabular = self.table()
    if (rep == None):
        self.rep = rd.choice(['B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L'])
    else:
        self.rep = rep
    self.char = F.char
    self.primefield = gmpy.is_prime(self.char)
    self.g = g
    self.to_fingerprint = ['F', 'irpoly']
    self.to_export = {'fingerprint': [], 'value': ['F', 'irpoly']}
Define the base Field or extension Field and the irreducible polynomial
   F is the base field on top of which the extension
field is built
   irpoly is the irreducible polynomial used to build
the extension field as F/irpoly
   g is a non quadratic residue used to compute square
roots, if it is set to None, computing a square root
will initialize g
   rep is the representation of the root of irpoly
(note that letter 'A' is reserved for the Complex extension field)
def __init__(self, F, irpoly, g=None, rep=None):
    "Define the base Field or extension Field and the irreducible polynomial\n           F is the base field on top of which the extension\n        field is built\n           irpoly is the irreducible polynomial used to build\n        the extension field as F/irpoly\n           g is a non quadratic residue used to compute square\n        roots, if it is set to None, computing a square root\n        will initialize g\n           rep is the representation of the root of irpoly\n        (note that letter 'A' is reserved for the Complex extension field)\n        "
    self.F = F
    self.irpoly = irpoly
    self.deg = len(irpoly.coef)
    assert (self.deg > 0)
    self.q = (self.F.q ** (self.deg - 1))
    self.tabular = self.table()
    if (rep == None):
        self.rep = rd.choice(['B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L'])
    else:
        self.rep = rep
    self.char = F.char
    self.primefield = gmpy.is_prime(self.char)
    self.g = g
    self.to_fingerprint = ['F', 'irpoly']
    self.to_export = {'fingerprint': [], 'value': ['F', 'irpoly']}