Computing explicit galois actions in Magma In the computational algebra system Magma, given an (irreducible) univariate polynomial $f$ (defined over the rationals $\mathbb{Q}$, say), can one compute the action of an element $g$ of the galois group of $f$ on an element $a$ of a splitting field of $f$? If yes, how?
For example, in the framework of the Magma code
Q := RationalField();
P<T> := PolynomialRing(Q);
f := T^4 - 10 * T^2 + 1;
Galf := GaloisGroup(f);
L<a> := SplittingField(f);

I would like to have Magma compute something like
for g in Galf do
    print Evaluate(g,a);
end for;

with output as elements of the given splitting field $L$ of $f$. (Here, Evaluate(g,a) denotes the action of $g$ on $a$; in Magma, this produces a runtime error.)
Remarks


*

*This question is related to Math Stack Exchange Question 2822027.

*Magma Documentation, Example H39E5 appears to explain an approach to this question. See especially the final paragraph of the example. I do not yet understand how to implement it.

 A:       P<x> := PolynomialRing(Rationals());
      f := x^2+1;
      K<i> := NumberField(f);
      G,r,m := AutomorphismGroup(K);
      m(G.1)(2+i);
      m(G.1^2)(2+i)


    2-i
    2+i 


A: Here is the code by @reuns, applied to the original example (additional print statements included for clarity in output):
Q := RationalField();
P<T> := PolynomialRing(Q);
f := T^4 - 10 * T^2 + 1;
printf "f = %o\n",f;
printf "(f defined in %o.)\n",Parent(f);
printf "f is irreducible? %o\n",IsIrreducible(f);
L<a> := SplittingField(f);
AutGf,PMapf,TMapf := AutomorphismGroup(L);
printf "\nGenerator(s) of Aut(L/Q):\n%o\n",Generators(AutGf);
print "\nGalois action of each automorphism on a primitive element a of L/Q:";
for g in AutGf do
    printf "g = %-12o : g(a) = %o\n",g,TMapf(g)(a);
end for;

(You can run the code for yourself at the online Magma Calculator.) This outputs

f = T^4 - 10*T^2 + 1
(f defined in Univariate Polynomial Ring in T over Rational Field.)
f is irreducible? true

Generator(s) of Aut(L/Q):
{
(1, 2)(3, 4),
(1, 3)(2, 4)
}

Galois action of each automorphism on a primitive element a of L/Q:
g = Id(AutGf)    : g(a) = a
g = (1, 2)(3, 4) : g(a) = a^3 - 10*a
g = (1, 3)(2, 4) : g(a) = -a
g = (1, 4)(2, 3) : g(a) = -a^3 + 10*a


If we think of everything as happening inside (a subfield of) the complex numbers $\mathbb{C}$, and the primitive element as $a = \sqrt{2} + \sqrt{3}$, then one can check that the final four outputs equal $\pm{}\sqrt{2} \pm{} \sqrt{3}$ -- the four roots of $f$ in $\mathbb{C}$.
