Repository navigation
Preserve quaternion values during negation and coefficient export - #313
Open
kaushikgunasekaren wants to merge 2 commits into
Open
kaushikgunasekaren wants to merge 2 commits into
kaushikgunasekaren wants to merge 2 commits into
Conversation
Avoid constructor normalization when negating values and reading sequence coefficients.
Cover negation, magnitude, class, zero, empty sequences and stored coefficient exports.
kaushikgunasekaren
requested review from
petercorke and
taughz
as code owners
November 19, 2026 17:47
This branch has not been deployed
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.
Bug
Unary negation always constructs a
UnitQuaternion. For a generalQuaternion, that changes the type and magnitude, and negating a zero quaternion fails. For a unit quaternion, constructor sign canonicalization can undo the requested negation.The sequence coefficient properties (
s,v,vec,vec_xyzs) also reconstruct each element through indexing, which canonicalizes negative scalar signs. As a result, reading a signed sequence can return coefficients different from the stored values, unlike reading a singleton.Change
Negate the stored arrays into an empty result of the same class, without normalization. Read sequence coefficients directly from stored arrays. Constructor normalization policy and rotation equivalence are unchanged.
Validation
UnitQuaternion(Nx4, norm=False)constructor.tests/test_dualquaternion.py.AI assistance was used for investigation, implementation and tests. Validation is local Python testing only; no hardware validation is claimed.