Relative finite field extensions¶
Considering a absolute field and a relative_field
, with
,
being a prime and
being integers, this file
contains a class to take care of the representation of
-elements
as
-elements.
Warning
As this code is experimental, a warning is thrown when a
relative finite field extension is created for the first time
in a session (see sage.misc.superseded.experimental
).
-
class
sage.coding.relative_finite_field_extension.
RelativeFiniteFieldExtension
(absolute_field, relative_field, embedding=None)¶ Bases:
sage.structure.sage_object.SageObject
Considering
a prime number, n an integer and three finite fields
,
and
, this class contains a set of methods to manage the representation of elements of the relative extension
over
.
INPUT:
absolute_field
,relative_field
– two finite fields,relative_field
being a subfield ofabsolute_field
embedding
– (default:None
) an homomorphism fromrelative_field
toabsolute_field
. IfNone
is provided, it will default to the first homomorphism of the list of homomorphisms Sage can build.
EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: RelativeFiniteFieldExtension(Fqm, Fq) Relative field extension between Finite Field in aa of size 2^4 and Finite Field in a of size 2^2
It is possible to specify the embedding to use from
relative_field
toabsolute_field
:sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq, embedding=Hom(Fq, Fqm)[1]) sage: FE.embedding() == Hom(Fq, Fqm)[1] True
-
absolute_field
()¶ Returns the absolute field of
self
.EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq) sage: FE.absolute_field() Finite Field in aa of size 2^4
-
absolute_field_basis
()¶ Returns a basis of the absolute field over the prime field.
EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq) sage: FE.absolute_field_basis() [1, aa, aa^2, aa^3]
-
absolute_field_degree
()¶ Let
be the base field of our absolute field
. Returns
where
EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq) sage: FE.absolute_field_degree() 4
-
absolute_field_representation
(a)¶ Returns an absolute field representation of the relative field vector
a
.INPUT:
a
– a vector in the relative extension field
EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq) sage: b = aa^3 + aa^2 + aa + 1 sage: rel = FE.relative_field_representation(b) sage: FE.absolute_field_representation(rel) == b True
-
cast_into_relative_field
(b, check=True)¶ Casts an absolute field element into the relative field (if possible). This is the inverse function of the field embedding.
INPUT:
b
– an element of the absolute field which also lies in the relative field.
EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq) sage: phi = FE.embedding() sage: b = aa^2 + aa sage: FE.is_in_relative_field(b) True sage: FE.cast_into_relative_field(b) a sage: phi(FE.cast_into_relative_field(b)) == b True
-
embedding
()¶ Returns the embedding which is used to go from the relative field to the absolute field.
EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq) sage: FE.embedding() Ring morphism: From: Finite Field in a of size 2^2 To: Finite Field in aa of size 2^4 Defn: a |--> aa^2 + aa
-
extension_degree
()¶ Returns
, teh extension degree of the absiolute field over the relative field.
EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(64) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq) sage: FE.extension_degree() 3
-
is_in_relative_field
(b)¶ Returns
True
ifb
is in the relative field.INPUT:
b
– an element of the absolute field.
EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq) sage: FE.is_in_relative_field(aa^2 + aa) True sage: FE.is_in_relative_field(aa^3) False
-
prime_field
()¶ Returns the base field of our absolute and relative fields.
EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq) sage: FE.prime_field() Finite Field of size 2
-
relative_field
()¶ Returns the relative field of
self
.EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq) sage: FE.relative_field() Finite Field in a of size 2^2
-
relative_field_basis
()¶ Returns a basis of the relative field over the prime field.
EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq) sage: FE.relative_field_basis() [1, a]
-
relative_field_degree
()¶ Let
be the base field of our relative field
. Returns
where
EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq) sage: FE.relative_field_degree() 2
-
relative_field_representation
(b)¶ Returns a vector representation of the field element
b
in the basis of the absolute field over the relative field.INPUT:
b
– an element of the absolute field
EXAMPLES:
sage: from sage.coding.relative_finite_field_extension import * sage: Fqm.<aa> = GF(16) sage: Fq.<a> = GF(4) sage: FE = RelativeFiniteFieldExtension(Fqm, Fq) sage: b = aa^3 + aa^2 + aa + 1 sage: FE.relative_field_representation(b) (1, a + 1)