# Create Morphism's between Finite Fields and VectorSpaces

Hallo,

I am interested in creating morphims between $GF(2^{n+1}) \stackrel{h_1}{\longrightarrow} H_u \stackrel{h_2}\longrightarrow GF(2^n)$ where $H_u={x^{2^i} + x : x \in GF(2^{n+1})}$ where $gcd(i,n+1) =1$. I am interested in constructing $h_1$ and $h_2$,

My attempt to create $h_1$ is:

```
n = 4
i = 1
f = lambda x : x^(2^i) + x
Kn_1 = GF(2^(n+1),'x')
H_u = map(f, Kn_1)
hs = Hom(Kn_1,H_u)
pi = SetMorphism(Hom(Kn_1,Kn), lambda y : y^(2^i) + y)
pi(Kn_1.random_element()) in Kn
```

now $hs$ is a set of morphism and $h_1 \in hs$. Can I get a (the) specific $h_1$ from $hs$? My attempt is $pi$ but 'pi(Kn_1.random_element()) in Kn' fails.

To construct $h_2$ I have more success.

```
n = 4
i = 2
f = lambda x: x^(2^i) + x
Kn_1 = GF(2^(n+1),'x1')
Vn_1 = Kn_1.vector_space()
Sn_1 = Vn_1.subspace([Vn_1(f(u)) for u in Kn_1])
Kn = GF(2^n,'x')
Vn = Kn.vector_space()
h_a = Sn_1.basis_matrix().transpose()
```

Now $h_a : Vn\rightarrow Sn_1$ where $Vn$ and $Sn_1$ is vector space representation of $GF(2^n)$ and $H_u$. To get from $GF(2^n)$ to $Vn$ and back I am good with But to create $h_2$ I have no luck. My attempts to use

```
MatrixMorphism(Hom(Vn,Sn_1), Sn_1.basis_matrix().transpose())
```

but get errors with regards to the dimensions of the matrix.

Regards

It is a morphism for which structure? Vector space? If so, is that clear that $H_u$ is a vector space?

The curly brackets got lost in the definition of H_u. The function $l(x)=x^(2^i)+x$ is linear over GF(2^(n+1)) and H_u is image of $l(x)$ giving that H_u is a subgroup of GF and can also be seen as a vector space.

Your first code excerpt does not work for me: on `Hom(Kn_1, H_u)` it complains that `H_u` is a list. Set morphisms forget a lot of structure about you vector spaces. Have you considered using `Kn_1.vector_space()` and working with matrices?

H_u was suppose to the a multiplicative subgroup of Kn_1 and now can't get away to generate a subgroup in sage. The reason I want to use a morphism is that I am only interested in the Range and Domain and the mapping. This will also help met to learn a functionality of sage.

Did you mean "additive" instead of "multiplicative"? Vector spaces are additive groups, so you may be happy with them.