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
Companion matrix constructor #11356
Comments
Attachment: trac_11356-companion-matrix.patch.gz |
This comment has been minimized.
This comment has been minimized.
Author: Rob Beezer |
comment:2
Note that Magma defaults to |
comment:3
|
comment:4
Replying to @jasongrout:
Everything I read about companion matrices and rational canonical form (Frobenius form) uses the "right" version. It is the natural thing to use when you put your basis vectors into a matrix as columns, as is done with QR, Jordan form, and maybe others. So I think "right" is the right default (pun intended), but "bottom" (and "top" and "left") are available for folks constructing less natural objects. |
comment:5
Replying to @rbeezer:
Yes, and my point is that since we follow the magma convention of putting basis vectors in rows, do we need to be consistent with their convention of format='bottom'? |
comment:6
Replying to @jasongrout:
And my point is that "follow the convention" is stronger than the reality. I like to say Sage has a "preference" for rows. The RDF/CDF decompositions return basis vectors in columns, Jordan form returns basis vectors in columns and I'm sure I can find more. So, if I can get a basis to convert to rational canonical form, then "right" will be the correct choice. I think this is a place where consistency for other decompositions is to be preferred. Besides the overwhelming use of "right" in the literature. I would rather not look oddball to newcomers, just to be consistent with a language with a miniscule audience. Rob |
Attachment: trac_11356-companion-matrix-v2.patch.gz |
comment:7
This needed rebasing, which is now the v2 patch. |
This comment has been minimized.
This comment has been minimized.
comment:8
Perhaps you should add a little suggestion for converting a symbolic polynomial to the kind of list this function needs; something like:
(One might be tempted to use |
comment:9
Replying to @dandrake:
Excellent idea. |
Changed keywords from none to sd31 |
comment:10
Replying to @dandrake:
Doctest section about symbolic polynomials has been expanded to reflect Dan's suggestion, and incorporated into a standalone v3 patch. Thanks for the suggestion, Dan. |
This comment has been minimized.
This comment has been minimized.
comment:11
Replying to @rbeezer:
Uh oh, your v2 and v3 patches seem identical... |
comment:12
Attachment: trac_11356-companion-matrix-v3.patch.gz Replying to @dandrake:
Must've forgotten an Replaced the v3 patch with one that should be different than v2. Thanks for the catch. |
comment:13
If you feed
Returning the empty matrix seems about right, but I can imagine people having strong opinions about the zero polynomial not being monic. I don't know about the conventions in this corner case, so do whatever seems best. |
This comment has been minimized.
This comment has been minimized.
comment:14
Attachment: trac_11356-companion-matrix-v4.patch.gz Replying to @dandrake: Thanks, Dan. Seems like an input list of So I made an input empty list fail in the v4 patch and added a test. In this case, |
comment:15
Forgot to set this as "needs review" when I put up the v4 patch. |
comment:16
This looks great -- code is very clear and thorough with full documentation and tests, all of which pass. Positive review. |
comment:17
Replying to @loefflerd: Thanks, David, for taking the time to look at this. -Rob |
Reviewer: David Loeffler |
Merged: sage-4.7.2.alpha1 |
This will be used to construct the output of an upcoming rational canonical form.
Apply:
CC: @sagetrac-fidelbarrera
Component: linear algebra
Keywords: sd31
Author: Rob Beezer
Reviewer: David Loeffler
Merged: sage-4.7.2.alpha1
Issue created by migration from https://trac.sagemath.org/ticket/11356
The text was updated successfully, but these errors were encountered: