Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sylvester matrix for polynomials #7458

Closed
sagetrac-carlohamalainen mannequin opened this issue Nov 14, 2009 · 11 comments
Closed

Sylvester matrix for polynomials #7458

sagetrac-carlohamalainen mannequin opened this issue Nov 14, 2009 · 11 comments

Comments

@sagetrac-carlohamalainen
Copy link
Mannequin

Small patch to add Sylvester matrix calculation for univariate and multivariate polynomials.

I think that my patch is a bit more general (and has doctests) compared to didier deshommes' patch here, which seems to have never been merged:

http://sage.math.washington.edu/home/dfdeshom/custom/patches/sylveste...

Component: commutative algebra

Keywords: Sylvester matrix

Author: Carlo Hamalainen, Luis Felipe Tabera Alonso

Reviewer: David Loeffler

Merged: sage-4.6.2.alpha3

Issue created by migration from https://trac.sagemath.org/ticket/7458

@lftabera
Copy link
Contributor

lftabera commented Nov 6, 2010

Attachment: sylvester.patch.gz

@lftabera
Copy link
Contributor

lftabera commented Nov 6, 2010

comment:1

Attachment: trac-7458-sylvester-rebase-4.6.patch.gz

This is a very basic feature that has to be in Sage.

I have rebased Carlo patch to 4.6 but have not touched the code.

I have some concerns that makes me mark the patch as needs work:

  • The univariate case should accept the same syntax as the multivariate case. In the univariate case, the preferred call is f.sylvester_matrix(g), but I do not want Sage to throw an error if I wrote f.sylvester_matrix(g, x)

  • Corner cases must be well documented.

sage: K.<x>=QQ[]
sage: K(1).sylvester_matrix(K(1))
[]

In particular, I am not sure how to deal with the sylvester matrix of 0 and constant or 0 and 0
Curretly it throws an error. My opinion is that this is not defined but should throw a more meaningful error.

Maple for instance return the empty matrix. So in maple:

Determinant(Sylvester_Matrix) != Resultant

In this corner cases.

I will try to check what other CAS do to get a wider picture.

  • An example explicitly relating Sylvester matrix and resultant should be added.

@lftabera
Copy link
Contributor

lftabera commented Nov 6, 2010

Changed keywords from none to Sylvester matrix

@lftabera
Copy link
Contributor

lftabera commented Nov 6, 2010

Changed author from carlohamalainen to Carlo Hamalainen

@lftabera
Copy link
Contributor

lftabera commented Nov 6, 2010

comment:2
  • I have added more documentation and doctest.

  • The variable argument is now optional in both univariate and multivariate. If it is not used, the first variable of the polynomial ring is used.

  • I have added coercion to be able to compute the Sylvester matrix of polynomials in different rings, for ex. ZZ[x] and QQ[x]

  • solved an issue for the dimension of the matrix of the sylvester matrix of (x**n, 0)

It is not ready for review because the sylvester matrix of (0,0) is not implemented.

@lftabera
Copy link
Contributor

comment:3

Attachment: trac-7458-sylvester-improvements.patch.gz

Finally, if one of the polynomials is zero, the code raises a ValueError.

@lftabera
Copy link
Contributor

lftabera commented Dec 4, 2010

Changed author from Carlo Hamalainen to Carlo Hamalainen, Luis Felipe Tabera Alonso

@lftabera
Copy link
Contributor

lftabera commented Dec 4, 2010

comment:4

Apply trac-7458-sylvester-rebase-4.6.patch, trac-7458-sylvester-improvements.patch

@loefflerd
Copy link
Mannequin

loefflerd mannequin commented Dec 16, 2010

comment:5

Very nice. I am impressed with the thoroughness of the testing of corner cases here. All doctests in sage/rings pass, and the reference manual builds OK.

@loefflerd
Copy link
Mannequin

loefflerd mannequin commented Dec 16, 2010

Reviewer: David Loeffler

@loefflerd loefflerd mannequin modified the milestones: sage-4.6.1, sage-4.6.2 Dec 16, 2010
@jdemeyer
Copy link

Merged: sage-4.6.2.alpha3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants