# Homset for finite fields#

This is the set of all field homomorphisms between two finite fields.

EXAMPLES:

```sage: R.<t> = ZZ[]
sage: E.<a> = GF(25, modulus = t^2 - 2)
sage: F.<b> = GF(625)
sage: H = Hom(E, F)
sage: f = H([4*b^3 + 4*b^2 + 4*b]); f
Ring morphism:
From: Finite Field in a of size 5^2
To:   Finite Field in b of size 5^4
Defn: a |--> 4*b^3 + 4*b^2 + 4*b
sage: f(2)
2
sage: f(a)
4*b^3 + 4*b^2 + 4*b
sage: len(H)
2
sage: [phi(2*a)^2 for phi in Hom(E, F)]
[3, 3]
```

We can also create endomorphisms:

```sage: End(E)
Automorphism group of Finite Field in a of size 5^2
sage: End(GF(7))
Ring endomorphism of Finite Field of size 7
Defn: 1 |--> 1
sage: H = Hom(GF(7), GF(49, 'c'))
sage: H(2)
2
```
class sage.rings.finite_rings.homset.FiniteFieldHomset(R, S, category=None)#

Set of homomorphisms with domain a given finite field.

index(item)#

Return the index of `self`.

EXAMPLES:

```sage: K.<z> = GF(1024)
sage: g = End(K)
sage: End(K).index(g) == 3
True
```
is_aut()#

Check if `self` is an automorphism

EXAMPLES:

```sage: Hom(GF(4, 'a'), GF(16, 'b')).is_aut()
False
sage: Hom(GF(4, 'a'), GF(4, 'c')).is_aut()
False
sage: Hom(GF(4, 'a'), GF(4, 'a')).is_aut()
True
```
list()#

Return a list of all the elements in this set of field homomorphisms.

EXAMPLES:

```sage: K.<a> = GF(25)
sage: End(K)
Automorphism group of Finite Field in a of size 5^2
sage: list(End(K))
[Ring endomorphism of Finite Field in a of size 5^2
Defn: a |--> 4*a + 1,
Ring endomorphism of Finite Field in a of size 5^2
Defn: a |--> a]
sage: L.<z> = GF(7^6)
sage: [g for g in End(L) if (g^3)(z) == z]
[Ring endomorphism of Finite Field in z of size 7^6
Defn: z |--> z,
Ring endomorphism of Finite Field in z of size 7^6
Defn: z |--> 5*z^4 + 5*z^3 + 4*z^2 + 3*z + 1,
Ring endomorphism of Finite Field in z of size 7^6
Defn: z |--> 3*z^5 + 5*z^4 + 5*z^2 + 2*z + 3]
```

Between isomorphic fields with different moduli:

```sage: k1 = GF(1009)
sage: k2 = GF(1009, modulus="primitive")
sage: Hom(k1, k2).list()
[
Ring morphism:
From: Finite Field of size 1009
To:   Finite Field of size 1009
Defn: 1 |--> 1
]
sage: Hom(k2, k1).list()
[
Ring morphism:
From: Finite Field of size 1009
To:   Finite Field of size 1009
Defn: 11 |--> 11
]

sage: k1.<a> = GF(1009^2, modulus="first_lexicographic")
sage: k2.<b> = GF(1009^2, modulus="conway")
sage: Hom(k1, k2).list()
[
Ring morphism:
From: Finite Field in a of size 1009^2
To:   Finite Field in b of size 1009^2
Defn: a |--> 290*b + 864,
Ring morphism:
From: Finite Field in a of size 1009^2
To:   Finite Field in b of size 1009^2
Defn: a |--> 719*b + 145
]
```
order()#

Return the order of this set of field homomorphisms.

EXAMPLES:

```sage: K.<a> = GF(125)
sage: End(K)
Automorphism group of Finite Field in a of size 5^3
sage: End(K).order()
3
sage: L.<b> = GF(25)
sage: Hom(L, K).order() == Hom(K, L).order() == 0
True
```