Opened 15 years ago
Closed 3 years ago
#2693 closed enhancement (fixed)
Sage should have generic resultant implementation for multivariate polynomials
Reported by:  Carl Witty  Owned by:  William Stein 

Priority:  major  Milestone:  sage8.8 
Component:  algebraic geometry  Keywords:  resultant 
Cc:  Travis Scrimshaw, Vincent Delecroix, vklein  Merged in:  
Authors:  Frédéric Chapoton  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  30bd620 (Commits, GitHub, GitLab)  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/sagesupport/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 9 years ago by
Milestone:  sage5.11 → sage5.12 

comment:2 Changed 9 years ago by
Milestone:  sage6.1 → sage6.2 

comment:3 Changed 8 years ago by
Milestone:  sage6.2 → sage6.3 

comment:4 Changed 8 years ago by
Milestone:  sage6.3 → sage6.4 

comment:5 Changed 8 years ago by
Report Upstream:  → N/A 

comment:6 Changed 3 years ago by
Keywords:  resultant added 

comment:7 Changed 3 years ago by
Authors:  → Frédéric Chapoton 

Branch:  → u/chapoton/2693 
Commit:  → add07d3bcb7521623ec1edd45f731213281f8b2d 
Milestone:  sage6.4 → sage8.8 
Status:  new → needs_review 
New commits:
add07d3  trac 2693 resultants for polynomials over inexact rings

comment:8 Changed 3 years ago by
Cc:  Travis Scrimshaw Vincent Delecroix added 

green bot, please review
comment:9 Changed 3 years ago by
hmm, the second doctest is more about univariate polynomials. Maybe it should go there ?
comment:10 Changed 3 years ago by
Commit:  add07d3bcb7521623ec1edd45f731213281f8b2d → 30bd620a157659e603c855c76e6d8f87701c69dc 

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
30bd620  trac 2693 resultants for polynomials over inexact rings

comment:13 Changed 3 years ago by
Reviewers:  → Travis Scrimshaw 

Status:  needs_review → positive_review 
LGTM.
comment:14 Changed 3 years ago by
Branch:  u/chapoton/2693 → 30bd620a157659e603c855c76e6d8f87701c69dc 

Resolution:  → fixed 
Status:  positive_review → closed 
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:
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.