-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
minpoly of symbolic matrices is broken #5639
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
This is because the charpoly method needs to return a univariate polynomial rather than an Expression. |
Author: Mike Hansen |
comment:7
in the docstring, "polynomial" is misspelled "polynomail" |
comment:8
Consider applying #6936, which also implements a generic way to test this fix! |
comment:9
I think this patch broke charpoly. See the doctest around line 280 of matrix_symbolic_dense.pyx:
|
comment:10
Hey, might that last error be related to the ticket which implements getting variables out of polynomial rings (e.g. 1.00*t was a variable but t wasn't)? |
comment:11
Replying to @kcrisman:
That doesn't seem likely to me. I'm wondering if the error has to do with the variable in the symbolic expression coming from maxima being a different variable than what is requested in SR[var] (i.e., the "t"s in the TypeError are not the same object). This is just a guess, though. |
comment:12
I believe this shows the error more clearly, maybe:
|
comment:13
Yep, the problem is in this code in
Note that this does not allow for coefficients to have variables, but coefficients may have variables if the base ring is the symbolic ring! Note that the error message in the last comment is misleading: it should say that "s is not a variable of ...", but since the test uses "any", it doesn't know which variable is bad. |
comment:14
I've posted a patch which address the issues above. |
comment:15
Looks great! Doctests pass in matrix/*.py[x] |
Reviewer: Jason Grout |
Merged: sage-4.2.1.alpha0 |
Changed merged from sage-4.2.1.alpha0 to none |
comment:17
There were a few failures cauesed by this in wester and coerce_maps for example. I've backed out the patch. I'll post a new patch addressing these issues. |
comment:18
Attachment: trac_5639.patch.gz I've posted a new patch which takes care of these issues. |
comment:19
Hmmm, generating a new variable based on a name that is not likely to be used is questionable. Does symbolics not have a gensym-like function that generates a new variable that is not currently being used? |
comment:20
Not right now, but there's a patch on trac which adds that functionality. I'm just left the current behavior in this patch. |
apply on top of previous patch |
comment:21
Attachment: trac-5639-doctest.patch.gz Looks okay, doctests pass on affected files. I posted a patch with a doctest as well, as a reviewer patch. Positive review. |
Merged: sage-4.2.1.rc0 |
CC: @kcrisman
Component: calculus
Author: Mike Hansen
Reviewer: Jason Grout
Merged: sage-4.2.1.rc0
Issue created by migration from https://trac.sagemath.org/ticket/5639
The text was updated successfully, but these errors were encountered: