Skip to content

test: add correctness and round-trip tests for fast rotation functions#63

Open
brosequist wants to merge 1 commit intoTheTom:mainfrom
brosequist:test/rotation-round-trip
Open

test: add correctness and round-trip tests for fast rotation functions#63
brosequist wants to merge 1 commit intoTheTom:mainfrom
brosequist:test/rotation-round-trip

Conversation

@brosequist
Copy link
Copy Markdown

Summary

  • Adds TestFastRotationExtended with three property tests for fast_rotate / fast_unrotate:
    1. Round-trip: fast_unrotate(fast_rotate(x)) ≈ x (invertibility)
    2. Batch consistency: rotating a matrix row-by-row matches rotating all rows at once
    3. Energy distribution: rotated vector has roughly uniform per-coordinate variance

Test plan

  • pytest tests/test_rotation.py

🤖 Generated with Claude Code

TestFastRotationExtended covers: round-trip invertibility (x → rotate → unrotate = x),
batch vs single-vector consistency, and energy distribution uniformity after rotation.
All three property tests were previously untested.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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