Ask Your Question

# Relative finite field extension and element computations Hallo

I want to perform finite field multiplication in by using operation in one of its sub fields.

f4 = GF(4, 'x')
f16 =  GF(16, 'y')
ff = RelativeFiniteFieldExtension(f16, f4)


Now I am stuck:

1. How do I map element from ff to a vector over f4
2. After performing the computation in f4 map the element back in f?

The ideal will be that the mapping to ff just concatenate two element in f4.

edit retag close merge delete

## Comments

Where does RelativeFiniteFieldExtension comes from ?

Probably from coding theory.

sage: from sage.coding.relative_finite_field_extension import RelativeFiniteFieldExtension
sage: RelativeFiniteFieldExtension
<class 'sage.coding.relative_finite_field_extension.RelativeFiniteFieldExtension'>


## 1 Answer

Sort by » oldest newest most voted

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.

more

## Comments

Almost, v.apply_map(ff.embedding()) give an element in VectorSpace(f16,2). I want an element in f16, an isomorphism from VectorSpace(f4,2) to VectorSpace(f16,2). The purpose will be to verify an implementation of a finite field (f16) using a subfield (f4) for its computations.

I edited my answer with isomorphisms going both ways between VectorSpace(f4, 2) and f16.

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2016-11-18 10:19:10 +0200

Seen: 198 times

Last updated: Nov 22 '16