-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Give more precise answer on symbolic power of a matrix #36845
Merged
vbraun
merged 10 commits into
sagemath:develop
from
RuchitJagodara:power_of_nilpotent_matrix
Dec 26, 2023
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
afa6a7c
Changed _matrix_power_symbolic function to condier mk=0 case
RuchitJagodara dc79089
Changed the _matrix_power_symbolic function to handle all the cases
RuchitJagodara 7139bb8
Created tests covering the changes
RuchitJagodara 42454c0
Give more precise answer by using kroncker_delta function
RuchitJagodara 96442fb
Rewriting tests for the PR
RuchitJagodara d40d348
Correct answers of the doctest for _matrix_power_symbolic function
RuchitJagodara 935a420
Corrected the doctest
RuchitJagodara 7955a51
Modified the doctest and changed the comment
RuchitJagodara ed4e712
Corrected lint errors
RuchitJagodara f95793b
Merge branch 'sagemath:develop' into power_of_nilpotent_matrix
RuchitJagodara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
In fact, I realize that after the computation, we can get a value even for negative n (or even also for non-integer n).
I think that, somehow, the system should raise an error if mk=0 but the evaluation is made at bad values of n. I have no idea on how to do that properly.
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.
This can be done by declaring variable with domain="integer", here when you do not give any domain to a variable it will consider it in complex plane by default.
But we can check whether the variable have an integer value of not at the time of evaluation.
I didn't get that, why system should give an error if mk=0 ?
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.
I'll implement this in a new PR as this topic is not concentrated on nilpotent matrices.
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.
great!
It should raise an error if mk=0 and n negative since the matrix is then non-invertible. For n positive non-integer, I don't know if it makes sense either.
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.
By the way, I already opened an other issue #36863 for general simplification of
0^n
.But the problem for matrices is somehow different since:
P(n)*0^{n-i}
(P polynomial) where the meaning of0^{n-i}
for0<i <=n
should be understood askronecker_delta(i,n)
in this special case (assuming that n is a *non-negative integer)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.
I checked what I can do to determine whether we are evaluating an integer power or not. I found that when evaluating the matrix, we only replace the variables with their values, and we cannot impose a condition that the variable should be an integer for obvious reasons because we are not sure that the variable is the symbolic power only. The only place where we can make a change is when calculating the power of the matrix (i.e., A^n). However, if we do so, it will not be ideal because we can define a real power of a matrix, and imposing a condition would not be appropriate. So, I think implementing a system for this is not practical. So it is better to use domain=integer while defining a variable.