FiniteFieldPolynomialPackage GF¶
ffdoms.spad line 301 [edit on github]
This package provides a number of functions for generating, counting and testing irreducible, normal, primitive, random polynomials over finite fields.
- clexSmaller?: (SparseUnivariatePolynomial GF, SparseUnivariatePolynomial GF) -> Boolean
clexSmaller?(f, g)compares monicfandgof the same degree in the following order. Error: ifforgis not monic or iffandghave different degrees or if common degree is 0.f < gif the constant term offis zero and constant term ofgis nonzero. If both constant term offandgare nonzero thenf < gif the lookup of the constant term offis less than this number forg. If these values are equal, thenlexSmaller?is used as ordering predicate.
- cnlexSmaller?: (SparseUnivariatePolynomial GF, SparseUnivariatePolynomial GF) -> Boolean
cnlexSmaller?(f, g)compares monicfandgof the same degree pdad{n} in the following order. Error: ifforgis not monic or iffandghave different degrees or if common degree is 0.f < gif the constant term offis zero and constant term ofgis nonzero. If both constant term offandgare nonzero thenf < gif the lookup of the constant term offis less than this number forg. If constant terms are equal thennlexSmaller?is used as ordering predicate.
- createIrreduciblePoly: PositiveInteger -> SparseUnivariatePolynomial GF
createIrreduciblePoly(n)$FFPOLY(GF) generates a monic irreducible univariate polynomial of degreenover the finite field GF.
- createNormalPoly: PositiveInteger -> SparseUnivariatePolynomial GF
createNormalPoly(n)$FFPOLY(GF) generates a normal polynomial of degreenover the finite field GF.
- createNormalPrimitivePoly: PositiveInteger -> SparseUnivariatePolynomial GF
createNormalPrimitivePoly(n)$FFPOLY(GF) generates a normal and primitive polynomial of degreenover the field GF. Note: this function is equivalent to createPrimitiveNormalPoly(n)
- createPrimitiveNormalPoly: PositiveInteger -> SparseUnivariatePolynomial GF
createPrimitiveNormalPoly(n)$FFPOLY(GF) generates a normal and primitive polynomial of degreenover the field GF.
- createPrimitivePoly: PositiveInteger -> SparseUnivariatePolynomial GF
createPrimitivePoly(n)$FFPOLY(GF) generates a primitive polynomial of degreenover the finite field GF.
- leastAffineMultiple: SparseUnivariatePolynomial GF -> SparseUnivariatePolynomial GF
leastAffineMultiple(f)computes the least affine polynomial which is divisible by the polynomialfover the finite field GF, i.e. a polynomial whose exponents are 0 or a power ofq, the size of GF.
- lexSmaller?: (SparseUnivariatePolynomial GF, SparseUnivariatePolynomial GF) -> Boolean
lexSmaller?(f, g)compares monicfandgof the same degree in the following order. Error: ifforgis not monic or iffandghave different degrees or if common degree is 0.f < gif the number of monomials offis less than this number forg. Iffandghave the same number of monomials, the lists of exponents are compared lexicographically. If these lists are also equal, the lists of coefficients are compared according to the lexicographic ordering induced by the ordering of the elements of GF given by lookup.
- nextIrreduciblePoly: SparseUnivariatePolynomial GF -> Union(SparseUnivariatePolynomial GF, failed)
nextIrreduciblePoly(f)yields the next monic irreducible polynomial over a finite field GF of the same degree asfin the following order, or “failed” if there are no greater ones. Error: iffhas degree 0. Note: the input polynomialfis made monic.lexSmaller?is used as ordering predicate.
- nextNormalPoly: SparseUnivariatePolynomial GF -> Union(SparseUnivariatePolynomial GF, failed)
nextNormalPoly(f)yields the next normal polynomial over a finite field GF of the same degree asfin the following order, or “failed” if there are no greater ones. Error: iffhas degree 0. Note: the input polynomialfis made monic.nlexSmaller?is used as ordering predicate.
- nextNormalPrimitivePoly: SparseUnivariatePolynomial GF -> Union(SparseUnivariatePolynomial GF, failed)
nextNormalPrimitivePoly(f)yields the next normal primitive polynomial over a finite field GF of the same degree asfin the following order, or “failed” if there are no greater ones. Error: iffhas degree 0. Note: the input polynomialfis made monic.cnlexSmaller?is used as ordering predicate. This operation is equivalent to nextPrimitiveNormalPoly(f).
- nextPrimitiveNormalPoly: SparseUnivariatePolynomial GF -> Union(SparseUnivariatePolynomial GF, failed)
nextPrimitiveNormalPoly(f)yields the next primitive normal polynomial over a finite field GF of the same degree asfin the following order, or “failed” if there are no greater ones. Error: iffhas degree 0. Note: the input polynomialfis made monic.cnlexSmaller?is used as ordering predicate. This operation is equivalent to nextNormalPrimitivePoly(f).
- nextPrimitivePoly: SparseUnivariatePolynomial GF -> Union(SparseUnivariatePolynomial GF, failed)
nextPrimitivePoly(f)yields the next primitive polynomial over a finite field GF of the same degree asfin the following order, or “failed” if there are no greater ones. Error: iffhas degree 0. Note: the input polynomialfis made monic.clexSmaller?is used as ordering predicate.
- nlexSmaller?: (SparseUnivariatePolynomial GF, SparseUnivariatePolynomial GF) -> Boolean
nlexSmaller?(f, g)compares monicfandgof the same degree pdad{n} in the following order. Error: ifforgis not monic or iffandghave different degrees or if common degree is 0.f < gif the coefficient of the term of degree n-1 offis zero and than that forgis nonzero. Also,f < gif both coefficients are nonzero and lookup of the coefficient offis less than that forg. In case those coefficients are equal, thenlexSmaller?is used as ordering predicate.
- normal?: SparseUnivariatePolynomial GF -> Boolean
normal?(f)tests whether the polynomialfover a finite field is normal, i.e. its roots are linearly independent over the field.
- numberOfIrreduciblePoly: PositiveInteger -> PositiveInteger
numberOfIrreduciblePoly(n)$FFPOLY(GF) yields the number of monic irreducible univariate polynomials of degreenover the finite field GF.
- numberOfNormalPoly: PositiveInteger -> PositiveInteger
numberOfNormalPoly(n)$FFPOLY(GF) yields the number of normal polynomials of degreenover the finite field GF.
- numberOfPrimitivePoly: PositiveInteger -> PositiveInteger
numberOfPrimitivePoly(n)$FFPOLY(GF) yields the number of primitive polynomials of degreenover the finite field GF.
- primitive?: SparseUnivariatePolynomial GF -> Boolean
primitive?(f)tests whether the polynomialfover a finite field is primitive, i.e. all its roots are primitive.
- random: (PositiveInteger, PositiveInteger) -> SparseUnivariatePolynomial GF
random(m, n)$FFPOLY(GF) generates a random monic polynomial of degreedover the finite field GF,dbetweenmandn.
- random: PositiveInteger -> SparseUnivariatePolynomial GF
random(n)$FFPOLY(GF) generates a random monic polynomial of degreenover the finite field GF.
- reducedQPowers: SparseUnivariatePolynomial GF -> PrimitiveArray SparseUnivariatePolynomial GF
reducedQPowers(f)generates[x, x^q, x^(q^2), ..., x^(q^(n-1))]reduced modulofwhereq = size()\$GFandn = degree f.