# Basis of extension

Assume that $q$ is a power of a prime number. Consider the field extension $F_q \subset F_{q^n}$ . Both fields can be thought as subfields of the algebraic closure of $F_p$, defined with

```
K=GF(p).algebraic_closure()
```

The question is: Is it possible to compute a basis of $F_{q^n}$ over $F_{q}$ ? Or at least to have something in the spirit of

```
K.<x1,...,xn>=GF(q)[]
```

which can be done when $q$ is prime?

What do you mean by a basis? Suppose you have

`sage: K = GF(q,'a')`

. Then you can type`sage: (L,f) = K.extension(2,'b',map=True)`

to get in`L`

the finite field with q^2 elements, defined as an extension`K`

. And`f`

gives you the embedding of`K`

inside`L`

.I am interested in finding $n$ elements of $F_{q^n}$ linear-independent over $F_q$, even when $q$ is not prime.