# converting linear map to matrix representation

I have a linear map $\alpha$ from $F_{p^n} \longrightarrow F_{p^n}$, where we see $F_{p^n}$ as a vector space over $F_p$ with a $V_i$ as base elements. I want to create the matrix representation for $\alpha$. For that I have to calculate $\alpha(V_i)$ and then write it in the basis $V_i$ to get my values for the matrix. How exactly do I do the last in sage ? For eg. a polynomial ring it's easy because the elements are already written according to its base but in general thats not the case...

As you said for polynomials, it depends on the way your elements are represented. Could you please provide an example for $\alpha$ and $V_i$ (the one you are dealing with, with the code to produce them) ?

p=5

F.<c>=GF(p^p,modulus=x^p-x-1)

V=[c^i for i in [0..p-1]]

s=c^6+c^3+c^2+1

Now I want to get the coeffecients of s represented to the base V[i], how do i do that

(You can mark the code as code in the comment window, just mark it and click in the edit menu that icon with two rows, 101, and 010. This will indent everything by 4 spaces in the window comment, the markdown parser will recognize it and give syntax highlight...)

The following dialog with the sage interpreter (linux console) gives some ideas to proceed:

We can lift to $\mathbb Z$. (No sense, criptic. Apply then f.)

Of course, the list is to short. So:

With the above notations:

(You want

`M`

or`M.transpose()`

.)