First time here? Check out the FAQ!

Ask Your Question
1

Strange error with multivariate polynomials

asked 12 years ago

jdc gravatar image

updated 2 years ago

tmonteil gravatar image

Hi -

I'm trying to calculate the resultant (with respect to one variable, say x) of a pair of 2-variable polynomials. Following some advice I found in this trac ticket, I tried entering something like this:

R.<x,y> = RR[]
P = 4*x^3*y^2 + 7*x^5*y - 3*x*y^4
Q = 5*x^3*y^3 - 9*y^2
P.polynomial(x).resultant(Q.polynomial(x))

However, P.polynomial(x) returns the error:

ValueError: max() arg is an empty sequence

(Full error message pasted below.) Same problem with P.polynomial(y), etc. It seems to work okay if the coefficient ring is ZZ or QQ instead of RR.

Does anyone know why this is happening, or of a different workaround for calculating these resultants?

Thanks!

Full error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_28.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Ui48eCx5PiA9IFJSW10KcCA9IHggKyB5CnEgPSB4KnkKcC5wb2x5bm9taWFsKHgpLnJlc3VsdGFudChxLnBvbHlub21pYWwoeCkp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>

  File "/private/var/folders/5h/c6x89ch91fjgr43q99g8wbjw0000gn/T/tmpVUVLIc/___code___.py", line 5, in <module>
    exec compile(u'p.polynomial(x).resultant(q.polynomial(x))
  File "", line 1, in <module>

  File "multi_polynomial.pyx", line 452, in sage.rings.polynomial.multi_polynomial.MPolynomial.polynomial (sage/rings/polynomial/multi_polynomial.c:5376)
  File "parent.pyx", line 988, in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7355)
  File "coerce_maps.pyx", line 82, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3311)
  File "coerce_maps.pyx", line 77, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/structure/coerce_maps.c:3214)
  File "/Applications/Sage-4.8-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/rings/polynomial/polynomial_ring.py", line 407, in _element_constructor_
    return C(self, x, check, is_gen, construct=construct, **kwds)
  File "polynomial_real_mpfr_dense.pyx", line 87, in sage.rings.polynomial.polynomial_real_mpfr_dense.PolynomialRealDense.__init__ (sage/rings/polynomial/polynomial_real_mpfr_dense.c:3418)
ValueError: max() arg is an empty sequence
Preview: (hide)

2 Answers

Sort by » oldest newest most voted
1

answered 12 years ago

Volker Braun gravatar image

This is now Trac #12871

Preview: (hide)
link

Comments

Thanks for opening a ticket, Volker. By the way, I managed to get at the resultants I need by using "pari('polresultant(...))",

jdc gravatar imagejdc ( 12 years ago )
1

answered 9 years ago

B r u n o gravatar image

This is solved by #17190!

sage: R.<x,y> = RR[]
sage: P = 4*x^3*y^2 + 7*x^5*y - 3*x*y^4
sage: Q = 5*x^3*y^3 - 9*y^2
sage: P.polynomial(x)
7.00000000000000*y*x^5 + 4.00000000000000*y^2*x^3 - 3.00000000000000*y^4*x
sage: P.polynomial(x).resultant(Q.polynomial(x))
151875.000000000*y^26 - 4.59270000000000e6*y^19 - 1.16640000000000e6*y^18 - 2.02538070000000e7*y^13
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 12 years ago

Seen: 651 times

Last updated: Sep 25 '15