-
-
Notifications
You must be signed in to change notification settings - Fork 600
random_diagonalizable_matrix silently ignores the base ring #24801
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
Labels
Comments
This comment has been minimized.
This comment has been minimized.
random_diagonalizable_matrix
silently ignores the base ring
Current Pull request is a draft. Needs some small changes. |
Made required changes to pull request. Can now be updated to s: needs review. |
Made changes suggested by @DaveWitteMorris. |
vbraun
pushed a commit
to vbraun/sage
that referenced
this issue
Feb 3, 2025
sagemathgh-39374: Updated random_diagonal_matrix function so it works for any ring Fixes sagemath#24801. Added functionality to random_diagonal_matrix that allows a random matrix to be generated using an arbitrary ring instead of only the rational numbers. If the matrix of rational numbers is requested the integer ring is used in place of the rational ring to keep most of the functionality the same. Also updated the function documentation to reflect this change and added and extra test with the example from issue sagemath#24801. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ X] The title is concise and informative. - [ X] The description explains in detail what this PR is about. - [ X] I have linked a relevant issue or discussion. - [ X] I have created tests covering the changes. - [ X] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies URL: sagemath#39374 Reported by: Noel-Roemmele Reviewer(s):
vbraun
pushed a commit
to vbraun/sage
that referenced
this issue
Feb 4, 2025
sagemathgh-39374: Updated random_diagonal_matrix function so it works for any ring Fixes sagemath#24801. Added functionality to random_diagonal_matrix that allows a random matrix to be generated using an arbitrary ring instead of only the rational numbers. If the matrix of rational numbers is requested the integer ring is used in place of the rational ring to keep most of the functionality the same. Also updated the function documentation to reflect this change and added and extra test with the example from issue sagemath#24801. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ X] The title is concise and informative. - [ X] The description explains in detail what this PR is about. - [ X] I have linked a relevant issue or discussion. - [ X] I have created tests covering the changes. - [ X] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies URL: sagemath#39374 Reported by: Noel-Roemmele Reviewer(s):
vbraun
pushed a commit
to vbraun/sage
that referenced
this issue
Feb 9, 2025
sagemathgh-39374: Updated random_diagonal_matrix function so it works for any ring Fixes sagemath#24801. Added functionality to random_diagonal_matrix that allows a random matrix to be generated using an arbitrary ring instead of only the rational numbers. If the matrix of rational numbers is requested the integer ring is used in place of the rational ring to keep most of the functionality the same. Also updated the function documentation to reflect this change and added and extra test with the example from issue sagemath#24801. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ X] The title is concise and informative. - [ X] The description explains in detail what this PR is about. - [ X] I have linked a relevant issue or discussion. - [ X] I have created tests covering the changes. - [ X] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies URL: sagemath#39374 Reported by: Noel-Roemmele Reviewer(s):
vbraun
pushed a commit
to vbraun/sage
that referenced
this issue
Feb 9, 2025
sagemathgh-39374: Updated random_diagonal_matrix function so it works for any ring Fixes sagemath#24801. Added functionality to random_diagonal_matrix that allows a random matrix to be generated using an arbitrary ring instead of only the rational numbers. If the matrix of rational numbers is requested the integer ring is used in place of the rational ring to keep most of the functionality the same. Also updated the function documentation to reflect this change and added and extra test with the example from issue sagemath#24801. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ X] The title is concise and informative. - [ X] The description explains in detail what this PR is about. - [ X] I have linked a relevant issue or discussion. - [ X] I have created tests covering the changes. - [ X] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies URL: sagemath#39374 Reported by: Noel-Roemmele Reviewer(s):
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A student of mine got surprised this morning :-)
Recommendations:
random_matrix
andrandom_diagonalizable_matrix
that algorithm="diagonalizable" is only implemented for the rational fieldNotImplementedError
if it's notQQ
.Alternatively: implement
random_diagonalizable_matrix
for any base ring/field. It sounds like the current algorithm would produce a reasonable answer; so this could boil down to just creating the matrix in the appropriate parent; and updating the documentation to say something like "if the parent is QQ, then the eigenvectors are guaranteed to ...".CC: @rbeezer
Component: linear algebra
Issue created by migration from https://trac.sagemath.org/ticket/24801
The text was updated successfully, but these errors were encountered: