In your particular, where case char(basering)=p>0, it holds:
raising the polynomial f to the p-th power commutes with
raising the variables to the p-th power.
This is, f^p is obtained instantly by:
Code:
> int p = char(basering);
> subst(f,x,x^p,y,y^p,z,z^p);
(In any case, at most, you have to cycle in a for-loop over var(1),...,var(n),
n=nvars(basering) but not over the single terms N=size(f)).
Don't care too much about the warnings (about possible overflow in the expont) which may appear.
(The warning refers to the total degree but not to the degree of the individual variables.)
You may also use the command substitite, which can be used for simultaneous substitution.
Here (at the moment) the warning does not occur.
Code:
> LIB "poly.linb";
> substitute(f,maxideal(1),ideal(x^p,y^p,z^p));
However, if your polynomial is huge with respect to the number of
monomials, then substitute may be a bit slower than subst,
since substitute is a proc and for this function-call the input
will be copied. If this is critical for you, then use map directly as substiute does.