Hello, On Mar 20, 4:18 am, luisfe <lftab...@yahoo.es> wrote: > Hi all, > Mathematically, I have the following field: > Q(x,y,z,t,a) > > Where x,y,z,t are indeterminates and "a" is an algebraic number over > the > rationals (lets say degree 4). > > If I have some elements, let say f,g,h in this field I would like to:
The best way to work with this object is to do like you did: sage: K.<a>=NumberField(x^4+x+1) sage: R.<x,y,z,t>=K['x,y,z,t'] Then, we can construct some elements of this field: sage: f = (a^2*x + y)*(z+a*t); f (a^2)*x*z + y*z + (a^3)*x*t + (a)*y*t sage: g = f/(x+a) sage: g ((a^2)*x*z + y*z + (a^3)*x*t + (a)*y*t)/(x + (a)) > (1) Obtain a representation "in base a", that is, write f as > f0 + f1*a + f2*a^2 + f3*a^3 I can't think of a way to do this other than what the following function does: def powers_of_a(f): powers = {} for m, fc in zip(f.monomials(), f.coefficients()): for i, c in enumerate(fc): powers[i] = powers.get(i, 0) + c*m for i, p in powers.items(): print i, ":", p sage: powers_of_a(f) 0 : y*z 1 : y*t 2 : x*z 3 : x*t You can return the dictionary and do more programmatic things if you'd like. > (3) Extract a valid numerator and denominator of f, that is, compute > polynomials r,s in Q[x,y,z,t,a] such that f=r/s sage: g ((a^2)*x*z + y*z + (a^3)*x*t + (a)*y*t)/(x + (a)) sage: g.numerator() (a^2)*x*z + y*z + (a^3)*x*t + (a)*y*t sage: g.denominator() x + (a) > (4) Construct ideals and compute a Grobner basis of a series of > polynomials > extracted as numerators of rational fuctions sage: I = R.ideal(x+a + a*y*z, a^2*t+z); I Ideal ((a)*y*z + x + (a), z + (a^2)*t) of Multivariate Polynomial Ring in x, y, z, t over Number Field in a with defining polynomial x^4 + x + 1 sage: I.groebner_basis() [y*t + (a^3 - a^2 + a + 1)*x + (-a^3 + a^2 - 1), z + (a^2)*t] > (5) Factorize polynomials in Q[x,y,z,t,a] extracted from > numerators/denominatos of rational functions. We can do this via Maxima. First we convert f to Maxima and call the factor command passing in the defining polynomial for the number field. Then we extract each of the products and convert them back to polynomials in Sage: sage: ff = maxima(f).factor(K.defining_polynomial ().change_variable_name('a')) sage: ff (y+a^2*x)*(z+a*t) sage: map(R, map(repr, ff.args())) [(a^2)*x + y, z + (a)*t] Hope that helps, --Mike --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---