Opened 11 years ago

Closed 2 months ago

#2693 closed enhancement (fixed)

Sage should have generic resultant implementation for multivariate polynomials

Reported by: cwitty Owned by: was
Priority: major Milestone: sage-8.8
Component: algebraic geometry Keywords: resultant
Cc: tscrim, vdelecroix, vklein Merged in:
Authors: Frédéric Chapoton Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 30bd620 (Commits) Commit: 30bd620a157659e603c855c76e6d8f87701c69dc
Dependencies: Stopgaps:

Description

Consider this example, which fails:

R.<x,y> = RR[]
p = x + y
q = x*y
p.resultant(q)

(as reported here: http://groups.google.com/group/sage-support/browse_thread/thread/1d6289cead33d063#)

This is because multivariate resultants are implemented using the Singular pexpect interface, which does not support RR.

A workaround for this particular problem (and a possible basis for an improved version) is:

p.polynomial(x).resultant(q.polynomial(x)) 

That is, fall back to univariate resultants, which are implemented using Pari and are somewhat more generic. (This is still not truly generic, though, since there are Sage rings which have no Pari equivalent.)

Change History (14)

comment:1 Changed 6 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:2 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:3 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:4 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:5 Changed 5 years ago by mmarco

  • Report Upstream set to N/A

In fact, singular resultants are slow compared to other methods, so it would really be a good idea to write specific sage code for resultants.

See #16749 and #12174 for ideas about it.

Just something like:

def resultant(self, other, variable):
    m = self.sylvester_matrix(other, variable)
    return m.determinant()

Would be both general for any polynomial ring, and faster than the current implementation. And of course, there could be a lot of cases where things can be done much faster, using specific backends where they are better.

comment:6 Changed 3 months ago by chapoton

  • Keywords resultant added

comment:7 Changed 3 months ago by chapoton

  • Authors set to Frédéric Chapoton
  • Branch set to u/chapoton/2693
  • Commit set to add07d3bcb7521623ec1edd45f731213281f8b2d
  • Milestone changed from sage-6.4 to sage-8.8
  • Status changed from new to needs_review

New commits:

add07d3trac 2693 resultants for polynomials over inexact rings

comment:8 Changed 3 months ago by chapoton

  • Cc tscrim vdelecroix added

green bot, please review

comment:9 Changed 3 months ago by chapoton

hmm, the second doctest is more about univariate polynomials. Maybe it should go there ?

comment:10 Changed 2 months ago by git

  • Commit changed from add07d3bcb7521623ec1edd45f731213281f8b2d to 30bd620a157659e603c855c76e6d8f87701c69dc

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

30bd620trac 2693 resultants for polynomials over inexact rings

comment:11 Changed 2 months ago by chapoton

ok, test is now at the right place.

comment:12 Changed 2 months ago by chapoton

  • Cc vklein added

and the bot is green.

comment:13 Changed 2 months ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

LGTM.

comment:14 Changed 2 months ago by vbraun

  • Branch changed from u/chapoton/2693 to 30bd620a157659e603c855c76e6d8f87701c69dc
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.