In MAGMA, I want to do computations in $\bar{\mathbb{Q}}[x,y]$. Say I want to form elements such as $\zeta x$, where $\zeta$ is some root of unity. MAGMA doesn't automatically regard $\zeta$ as an element of $\bar{\mathbb{Q}}$, and so I will need to tell it to do it. I tried
P := PolynomialRing(AlgebraicClosure(), 2, "grevlex");
P!RootOfUnity(3);
RootOfUnity(3)*x
but I get
Runtime error in '!': Illegal coercion
Runtime error in '*': Bad argument types
Argument types given: FldCycElt[FldRat], RngMPolElt
What would be the best way to make this work?
(RootOfUnity(n,F) is implemented for the fields containing one, not for the polynomial rings)