finitefield.py
FiniteExtendedField class †
FiniteExtendedField is a class for finite field, whose cardinality
q = p**n with a prime p and n>1. It is usually called F_q or GF(q).
The class is a subclass of FiniteField.
Constructor †
FiniteExtendedField(characteristic, n_or_modulus) †
Create a finite field. characteristic must be prime.
n_or_modulus can be:
- an integer greater than 1, or
- a polynomial in a polynomial ring of F_p with degree greater than 1.
- an ideal of the polynomial ring F_p[#1] with degree greater than 1.
Methods †
createElement(seed) †
Create an element of the field from seed. The result is an instance of FiniteExtendedFieldElement.
The seed can be:
- a OneVariablePolynomialCharNonZero
- an integer, which will be p-adically expanded and interpreted as a polynomial.
- a list of integers, which will be coefficients of a polynomial.
getCharacteristic() †
Return the characteristic of the field.
issubring(other) †
Test whether the field is a subring of the other.
issuperring(other) †
Test whether the field is a superring of the other.
Methods inherited from ring.Field. †
gcd(a, b), getQuotientField(), isfield()
Methods inherited from ring.CommutativeRing. †
isdomain(), iseuclidean(), isnoetherian(), ispid(), isufd()
Operators †
len | cardinality |
repr | repr string |
str | str string |
Properties †
- one (read only) The multiplicative unit of the field.
- zero (read only) The additive unit of the field.
(These properties are new in 0.4.1)