def mul(self, a, b):
    '\n        field operation: multiplication of field elements\n        '
    '\n        if isinstance(a,FieldElem) and isinstance(b, FieldElem) and not a.F == b.F :\n            raise Exception("multiplication between elements of different fields")\n        '
    if (not isinstance(b, FieldElem)):
        if (b < 0):
            return self.smul((- a), (- b))
        return self.smul(a, b)
    else:
        return self.pmul(a, b)
field operation: multiplication of field elements
def mul(self, a, b):
    '\n        \n        '
    '\n        if isinstance(a,FieldElem) and isinstance(b, FieldElem) and not a.F == b.F :\n            raise Exception("multiplication between elements of different fields")\n        '
    if (not isinstance(b, FieldElem)):
        if (b < 0):
            return self.smul((- a), (- b))
        return self.smul(a, b)
    else:
        return self.pmul(a, b)