Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add
is_nilpotent(::MatrixElem)
#1783Add
is_nilpotent(::MatrixElem)
#1783Changes from 3 commits
e0bd091
28f6068
553bb9b
1bbf5b6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, is this algorithm even correct when$A^n\neq0$ but still $A^k=0$ for some $k>n$ .
A
contains zero divisors? I normally think about matrices over integral domains, and then of courseA
is nilpotent iffA^n=0
. But over a ring with zero-divisors, we could have a triangularizable matrix with nilpotent eigenvalues whereAdmittedly this is somewhat fringe, but we should still handle it right? For starters we could add$\mathbb{Z}/n\mathbb{Z}$ takes the modulus $n$ into account)
is_domain_type(T) || error("Only supported over integral domains")
? (AFAIK there is nois_domain
/is_integral_domain
which for e.g.Then if someone needs this over non-domains, they at least get a helpful error and can provide an implementation for their use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Thanks for mentioning this. I added the suggested error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might or might not be faster to compute the minimal or characteristic polynomial (if there are dedicated optimized methods for this and the given matrix type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that's true. but for that one would need to know which specialized methods exist in which cases, which I honestly don't