sorry for the late reply. Your code works just fine Marshall, thanks ! I was thinking of writing something similar, but i didn't know the shorthand elimination_ideal, sweet.
speaking of shorthands, does SAGE have a ready-made function that computes the kernel of a ring map from a quotient of a polynomial ring to another such quotient ? (straightforward groebner basis computation again) writing the elementary symmetric functions thing in terms of a kernel would be short and elegant. On Oct 19, 6:30 pm, Marshall Hampton <[email protected]> wrote: > Groebner bases seem to do this relatively quickly. Here's your last > example done in a crude way, seems almost instantaneous. > > R.<x0,x1,x2,x3,e1,e2,e3> = PolynomialRing(QQ,order = TermOrder > ('degrevlex',4)+TermOrder('degrevlex',3)) > foo= (x0 + x1 + x2 + x3)^3 > sym = [] > xvars = [x0,x1,x2,x3] > for i in range(1,4): > temp = 0 > for p in combinations([0,1,2,3],i): > temp = temp + prod([xvars[p[j]] for j in range(i)]) > sym.append(sage_eval('e'+str(i), locals=locals())-temp) > symid = R.ideal(sym+[foo]).elimination_ideal([x0,x1,x2,x3]) > list(symid.gens()) > [e1^3] > > -Marshall > > On Oct 19, 9:47 am, Pierre <[email protected]> wrote: > > > Thanks. This works, but it is sooooo very slow : > > > sage: foo= (x0 + x1 + x2 + x3)^1; > > sage.libs.symmetrica.all.t_POLYNOM_ELMSYM( foo ) > > e[1] #immediate > > > sage: foo= (x0 + x1 + x2 + x3)^2; > > sage.libs.symmetrica.all.t_POLYNOM_ELMSYM( foo ) > > e[1, 1] #also immediate > > > sage: foo= (x0 + x1 + x2 + x3)^3; > > sage.libs.symmetrica.all.t_POLYNOM_ELMSYM( foo ) > > #nothing after several minutes, i had to go C-c (on a macbook) > > > My original polynomial just about fits on the screen, so needless to > > say after 30 minutes i had nothing. > > > Is this normal ? Using groebner basis techniques my guess is that > > things should not quite be that slow. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
