William, I can factor polynomials with coefficients in QQ fine. Here are the examples I mentioned in greater detail:
# define the coefficient field K and R=K[x,y] K.<a>=PolynomialRing(QQ,1) K=FractionField(K) R.<x,y>=PolynomialRing(K,2) # the following works: (x^2-y^2).factor() # answer: (x - y) * (x + y) # this one also works: (x^2-a^2*y^2).factor() # answer: (x + (-a)*y) * (x + a*y) # the following two are the simplest ones that fail: x.factor() # raises NotImplementedError R(1).factor() # raises IndexError: list index out of range If x^2-y^2 can be factored correctly, wouldn't I expect that factoring just x is also implemented? Maybe it's also just a bug. If I replace the definition of the ring R by R.<x,y,a>=PolynomialRing(QQ,3) then all four examples work correctly. Stefan Am 28.11.2009 um 17:17 schrieb William Stein: > On Sat, Nov 28, 2009 at 3:06 PM, Stefan Boettner > <sboet...@tulane.edu> wrote: >> Hello, >> >> I would like to factor multivariate polynomials that have parameters >> in the coefficient field, for example: >> >> K.<a>=PolynomialRing(QQ,1) >> K=FractionField(K) >> R.<x,y>=PolynomialRing(K,2) >> >> Now I would like to factor elements in R, such as x^2-m^2*y^2, which >> actually works. However, when I ask to have "more trivial" elements >> such as x or 1 factored, it fails with a NotImplementedError (for x) >> or IndexError ("list index out of range" for 1). What's wrong? > > Please give the simplest explicit example that raise IndexError, as > that might be a bug. Regarding NotImplementedError, it means what it > sounds like -- the capability you want isn't > implemented. That said, can't you just factor over a polynomial > ring in x,y,a? > > -- William > > -- > 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 > URL: http://www.sagemath.org -- 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 URL: http://www.sagemath.org