It seems that the reference manual for GAP never mentions how to construct a representation by sending generators to specified matrices. Yet I cannot help but feel that such a basic task must be achievable. How does one do it?
As a concrete example, I want to consider the $5$-dimensional $\mathbb{F}_3$-representation $\rho$ of $C_8$ sending a generator $g$ to $$ \rho(g) = \begin{pmatrix} 1 & 0 & 1 & 2 & 2 \\ 2 & 1 & 1 & 2 & 2 \\ 1 & 0 & 2 & 1 & 0 \\ 1 & 1 & 1 & 1 & 0 \\ 2 & 1 & 1 & 0 & 2 \end{pmatrix} $$ How do I feed this representation to GAP?
Edit. Thanks to Olexandr Konovalov and Derek Holt, I got the following to work:
G := CyclicGroup(8);
gen := GeneratorsOfGroup(G)[1];
GLn := GeneralLinearGroup(5, GF(3));
img := Z(3)^0 * [[1, 0, 1, 2, 2],
[2, 1, 1, 2, 2],
[1, 0, 2, 1, 0],
[1, 1, 1, 1, 0],
[2, 1, 1, 0, 2]];
rep := GroupHomomorphismByImages(G, GLn, [gen], [img]);
However, I'm still a bit confused about how to feed the resulting representation into the functions that are of relevance to representation theory. I've asked a follow-up question on this here.
Edit 2. It turns out that GeneralLinearGroup() is a function that works only works for finite fields. It works for the example that I gave for the purpose of being concrete, but of course I look for an answer that captures representations over a general base. As such, this question is still unsolved.