I have a loop where I need to generate all of the degree sequences
less than the current degree. Here is what I want to do.
<<CODE
# create polynomial ring
R.<x1,x2> = SR[]
xgens = R.gens()
# create a polynomial of interest
# (this will typically have more terms)
mu = x12 * x2
# loop over
diff_mu = {}
curr_mons = mu.monomials()
while len(curr_mons) > 0:
mon = curr_mons.pop()
deg = mon.degrees()
diff_mu[deg] = True
for x in xgens:
if mon.degree(x) > 0:
curr_mons.append(mon / x)
# this gives a FractionField element!!!
CODE
The tricky part is that I can't figure out how to get the monomial
with degree one less in a particular position. I tried mon.div_rem
(x), but that raised a different error (I think it was Singular
complaining about the SR coefficients). I also tried working directly
with the degree tuples instead of the monomials, but tuples aren't
mutable, subtraction isn't defined for them, and (x1**(-1)) gives a
FractionFieldElement again.
Any suggestions?
Thanks!
---
Ryan Hinton
PhD candidate, Electrical Engineering
University of Virginia
--~--~---------~--~----~------------~-------~--~----~
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
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---