Fix convention of PolynomialTensor basis change#805
Open
aoowweenn wants to merge 6 commits into
Open
Conversation
In general, we rotate a matrix M to M' is to apply a rotation matrix R:
M' = R @ M @ R.T
The corresponding Einstein notation is
M'^{p_1p_2} = R^{p_1}_{a_1} R^{p_2}_{b_1} M^{a_1a_2}
Collaborator
|
@arettig Would you be able to take a look at this and check the technical correctness? (No rush.) |
arettig
requested changes
Jun 5, 2026
arettig
left a comment
Contributor
There was a problem hiding this comment.
This is a good catch. The PolynomialTensor rotation code currently does not match the expression in the documentation. We should change this to match standard convention (and our own documentation), but this is a potentially breaking change for anyone using this function currently.
It would also be a good idea to change the 90 degree rotation test added in this PR to some different rotation as this test actually passes with the current (incorrect) implementation.
The 90 degree rotation test passed even with previous erroneous code. This new cyclical rotation (0->1, 1->2, 2->0) test will correctly test the fixed bug.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In general, we rotate a matrix M to M' is to apply a rotation matrix R: M' = R @ M @ R.T
The corresponding Einstein notation is
M'^{p_1p_2} = R^{p_1}{a_1} R^{p_2}{b_1} M^{a_1a_2}