Revision history [back]

Is this what you are looking for?

Import RelativeFiniteFieldExtension and define the fields and the relative finite field extension.

sage: from sage.coding.relative_finite_field_extension import RelativeFiniteFieldExtension
sage: f4 = GF(4, 'x')
sage: f16 = GF(16, 'y')
sage: ff = RelativeFiniteFieldExtension(f16, f4)
sage: ff.embedding()
Ring morphism:
From: Finite Field in x of size 2^2
To:   Finite Field in y of size 2^4
Defn: x |--> y^2 + y

Apply to a vector.

sage: V = VectorSpace(f4, 2)
sage: v = V.random_element(); v
(x, x + 1)
sage: v.apply_map(ff.embedding())
(y^2 + y, y^2 + y + 1)

Is this what you are looking for?

Import RelativeFiniteFieldExtension and define the fields and the relative finite field extension.

sage: from sage.coding.relative_finite_field_extension import RelativeFiniteFieldExtension
sage: f4 = GF(4, 'x')
sage: f16 = GF(16, 'y')
sage: ff = RelativeFiniteFieldExtension(f16, f4)
sage: ff.embedding()
Ring morphism:
From: Finite Field in x of size 2^2
To:   Finite Field in y of size 2^4
Defn: x |--> y^2 + y

Apply to a vector.

sage: V = VectorSpace(f4, 2)
sage: v = V.random_element(); v
(x, x + 1)
sage: v.apply_map(ff.embedding())
(y^2 + y, y^2 + y + 1)

Edit: the absolute_field_representation method may be what you are looking for.

This example is taken from the documentation.

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: rel
(1, a + 1)

Is this what you are looking for?

Import RelativeFiniteFieldExtension and define the fields and the relative finite field extension.

sage: from sage.coding.relative_finite_field_extension import RelativeFiniteFieldExtension
sage: f4 = GF(4, 'x')
sage: f16 = GF(16, 'y')
sage: ff = RelativeFiniteFieldExtension(f16, f4)
sage: ff.embedding()
Ring morphism:
From: Finite Field in x of size 2^2
To:   Finite Field in y of size 2^4
Defn: x |--> y^2 + y

Apply to a vector.

sage: V = VectorSpace(f4, 2)
sage: v = V.random_element(); v
(x, x + 1)
sage: v.apply_map(ff.embedding())
(y^2 + y, y^2 + y + 1)

Edit: the absolute_field_representation method and relative_field_reprensentation methods may be what you are looking for.

sage: from sage.coding.relative_finite_field_extension import *
sage: Fqm.<aa> RelativeFiniteFieldExtension
sage: f4.<x> = GF(4)
sage: f16.<y> = GF(16)
sage: Fq.<a> = GF(4)
sage: FE = RelativeFiniteFieldExtension(Fqm, Fq)
ff = RelativeFiniteFieldExtension(f16, f4)
sage: b = aa^3 + aa^2 + aa y^3 + y^2 + y + 1
sage: rel = FE.relative_field_representation(b)
sage: rel
bb = ff.relative_field_representation(b)
sage: bb
(1, a x + 1)
sage: ff.absolute_field_representation(bb)
y^3 + y^2 + y + 1

This shows the isomorphism you want, going both ways.

Is this what you are looking for?

Import RelativeFiniteFieldExtension and define the fields and the relative finite field extension.

sage: from sage.coding.relative_finite_field_extension import RelativeFiniteFieldExtension
sage: f4 = GF(4, 'x')
sage: f16 = GF(16, 'y')
sage: ff = RelativeFiniteFieldExtension(f16, f4)
sage: ff.embedding()
Ring morphism:
From: Finite Field in x of size 2^2
To:   Finite Field in y of size 2^4
Defn: x |--> y^2 + y

Apply to a vector.

sage: V = VectorSpace(f4, 2)
sage: v = V.random_element(); v
(x, x + 1)
sage: v.apply_map(ff.embedding())
(y^2 + y, y^2 + y + 1)

Edit: the absolute_field_representation and relative_field_reprensentation methods may be what you are looking for.

They are documented here: - here:

sage: from sage.coding.relative_finite_field_extension import RelativeFiniteFieldExtension
sage: f4.<x> = GF(4)
sage: f16.<y> = GF(16)
sage: ff = RelativeFiniteFieldExtension(f16, f4)
sage: b = y^3 + y^2 + y + 1
sage: bb = ff.relative_field_representation(b)
sage: bb
(1, x + 1)
sage: ff.absolute_field_representation(bb)
y^3 + y^2 + y + 1

This shows the isomorphism you want, going both ways.

Is this what you are looking for?

Import RelativeFiniteFieldExtension and define the fields and the relative finite field extension.

sage: from sage.coding.relative_finite_field_extension import RelativeFiniteFieldExtension
sage: f4 = GF(4, 'x')
sage: f16 = GF(16, 'y')
sage: ff = RelativeFiniteFieldExtension(f16, f4)
sage: ff.embedding()
Ring morphism:
From: Finite Field in x of size 2^2
To:   Finite Field in y of size 2^4
Defn: x |--> y^2 + y

Apply to a vector.

sage: V = VectorSpace(f4, 2)
sage: v = V.random_element(); v
(x, x + 1)
sage: v.apply_map(ff.embedding())
(y^2 + y, y^2 + y + 1)

Edit: the absolute_field_representation and relative_field_reprensentation methods may be what you are looking for.

They are documented here:

Following and expanding the examples from the documentation and adapting to your notation.

sage: from sage.coding.relative_finite_field_extension import RelativeFiniteFieldExtension
sage: f4.<x> = GF(4)
sage: f16.<y> = GF(16)
sage: ff = RelativeFiniteFieldExtension(f16, f4)
sage: b = y^3 + y^2 + y + 1
sage: bb = ff.relative_field_representation(b)
sage: bb
(1, x + 1)
sage: bb.parent()
Vector space of dimension 2 over Finite Field in x of size 2^2
sage: ff.absolute_field_representation(bb)
y^3 + y^2 + y + 1

sage: V = VectorSpace(f4, 2)
sage: cc = V((x, x+1))
sage: cc
(x, x + 1)
sage: c = ff.absolute_field_representation(cc)
sage: c
y^3
sage: c.parent()
Finite Field in y of size 2^4
sage: ff.relative_field_representation(c)
sage: ff.relative_field_representation(c)
(x, x + 1)

This shows the isomorphism you want, going both ways.