Skip to content

Evaluate quaternion exponential sequences elementwise - #311

Open
kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix-quaternion-exp-sequences-nov18
Open

kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix-quaternion-exp-sequences-nov18

Conversation

@kaushikgunasekaren

Copy link
Copy Markdown

Bug

Quaternion.exp() passes sequence-valued scalar and vector properties to scalar math functions. A two-element sequence raises TypeError, and q.log().exp() cannot round-trip a sequence.

Change

Use the existing scalar implementation for each stored quaternion, forwarding tol. Keep a UnitQuaternion result when every scalar result is unit; mixed/non-unit results stay Quaternion. Empty input returns an empty Quaternion. Singleton behavior is unchanged. Reading stored values directly avoids re-canonicalizing negative unit-quaternion signs before evaluation.

Validation

  • 27 regression/control cases: 23 fail before the fix; all 27 pass after it.
  • Covers pure, non-pure, mixed, empty, six-element, tolerance-boundary and stored-sign inputs, independent singleton and analytic controls, and logarithm/exponential round trips.
  • Full local suite: 593 passed, 3 skipped, 99 subtests passed (21 warnings), versus 566 passed on the unchanged base.
  • Black 23.10.0 and fatal flake8 checks pass for changed files. Full-repository fatal lint has two pre-existing undefined-name findings in tests/test_dualquaternion.py.

AI assistance was used for investigation, implementation and tests. Validation is local Python testing only; no hardware validation is claimed.

Apply the existing scalar exponential to each stored quaternion, preserving tolerance and scalar return types.
Cover pure, non-pure, mixed, empty, tolerance-sensitive and stored-sign cases against scalar and analytic controls.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant