Opened 15 years ago

Closed 4 years ago

# Sage should have generic resultant implementation for multivariate polynomials

Reported by: Owned by: cwitty was major sage-8.8 algebraic geometry resultant tscrim, vdelecroix, vklein Frédéric Chapoton Travis Scrimshaw N/A 30bd620 30bd620a157659e603c855c76e6d8f87701c69dc

### Description

Consider this example, which fails:

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

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.)

### comment:1 Changed 9 years ago by jdemeyer

Milestone: sage-5.11 → sage-5.12

### comment:2 Changed 9 years ago by vbraun_spam

Milestone: sage-6.1 → sage-6.2

### comment:3 Changed 9 years ago by vbraun_spam

Milestone: sage-6.2 → sage-6.3

### comment:4 Changed 8 years ago by vbraun_spam

Milestone: sage-6.3 → sage-6.4

### comment:5 Changed 8 years ago by mmarco

Report Upstream: → 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:7 Changed 4 years ago by chapoton

Authors: → Frédéric Chapoton → u/chapoton/2693 → add07d3bcb7521623ec1edd45f731213281f8b2d sage-6.4 → sage-8.8 new → needs_review

New commits:

 ​add07d3 `trac 2693 resultants for polynomials over inexact rings`

### comment:9 Changed 4 years ago by chapoton

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

### comment:10 Changed 4 years ago by git

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:11 Changed 4 years ago by chapoton

ok, test is now at the right place.