feat(examples): validate galgebra against Goyder cheat sheet (#506)#557
Conversation
Adds examples/Terminal/cheatsheet_validation.py covering all 7 sections of the geometric algebra cheat sheet by Russell Goyder: 1. geometric product decomposition (ab = a.b + a^b) 2. vector-multivector grade raising/lowering 3. bivector identities (a.(b^c), (a^b).(c^d)) 4. commutator product (B x v = B.v, Jacobi identity) 5. pseudoscalar (I^2=-1, centrality in 3D, dual) 6. outermorphism (rotor normalization, rotation, det=1) 7. adjoint (a.F_bar(b) = F(a).b, det(FG) = det(F)det(G))
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #557 +/- ##
==========================================
+ Coverage 73.11% 73.32% +0.21%
==========================================
Files 22 22
Lines 4475 4458 -17
==========================================
- Hits 3272 3269 -3
+ Misses 1203 1189 -14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
utensil
left a comment
There was a problem hiding this comment.
Thanks for the cheatsheet validation script. Math across all 7 sections checks out — geometric product decomposition, vector-multivector products, bivector contraction identities, commutator/Jacobi identity, pseudoscalar properties, rotation outermorphism, and adjoint definition all verify correctly in G(3,0).
One significant issue: examples/Terminal/cheatsheet_validation.py is not collected by pytest. The CI config (setup.cfg: python_files = test_*.py) only collects files matching test_*.py. The pytest invocation covers test/ and nbval on examples/ipython|primer/ — examples/Terminal/ is not included. The codecov/patch passes vacuously because --cov=galgebra only measures galgebra/ source coverage, and this PR doesn't touch any galgebra source. The script runs zero assertions during CI.
Targeted tests belong in test/. Please move this to test/test_cheatsheet.py so the assertions actually run in CI. Notebooks in examples/ are fine as examples that happen to improve coverage, but new targeted tests go in test/.
Minor: section 5 uses the Iinv+ dual convention (dual(A) = A * I^{-1}) computed manually via I.inv(). That's mathematically correct, but galgebra's built-in dual() defaults to I+ (dual(A) = I*A). Worth a comment so readers don't assume dual() behaves this way.
…ae#506) Per review: examples/Terminal/ is not collected by CI (setup.cfg only collects test_*.py). Move to test/test_cheatsheet.py so assertions actually run in CI. Also adds a comment in section 5 clarifying that the dual is computed manually via I^{-1} (Iinv+ convention), which differs from galgebra's built-in dual() that uses I+ by default.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Groups new entries by: features, bug fixes, examples/docs, tests/maintenance. Features: Cl() kingdon interface (pygae#550, closes pygae#524), Mv.__rtruediv__ (pygae#543, closes pygae#512), shirokov_inverse/hitzer_inverse (pygae#530). Bugs: interop dual mode contamination (pygae#556, closes pygae#555), norm() Abs wrapping (pygae#554, closes pygae#522), is_versor() improvement (pygae#536, closes pygae#533). Examples/docs: sundial + cheatsheet tests (pygae#549+pygae#557, closes pygae#506), coords tutorial (pygae#551), README ops (pygae#548, closes pygae#523). Tests/maintenance: lt.matrix() regression tests (pygae#558, closes pygae#461), extra-cdot regression test (pygae#545), er_blade + ReciprocalFrame refactors (pygae#552+pygae#553), CI fix (pygae#535).
* docs: add 0.6.0 changelog entries Groups new entries by: features, bug fixes, examples/docs, tests/maintenance. Features: Cl() kingdon interface (#550, closes #524), Mv.__rtruediv__ (#543, closes #512), shirokov_inverse/hitzer_inverse (#530). Bugs: interop dual mode contamination (#556, closes #555), norm() Abs wrapping (#554, closes #522), is_versor() improvement (#536, closes #533). Examples/docs: sundial + cheatsheet tests (#549+#557, closes #506), coords tutorial (#551), README ops (#548, closes #523). Tests/maintenance: lt.matrix() regression tests (#558, closes #461), extra-cdot regression test (#545), er_blade + ReciprocalFrame refactors (#552+#553), CI fix (#535). * docs: add missing issue link for #551 entry * docs: add changelog entry for #560 (Lt callable zero fix) * docs: move Lt zero fix into bug group, use issue #540 as reference
…) (pygae#557) * feat(examples): validate galgebra against Goyder cheatsheet (pygae#506) Adds examples/Terminal/cheatsheet_validation.py covering all 7 sections of the geometric algebra cheat sheet by Russell Goyder: 1. geometric product decomposition (ab = a.b + a^b) 2. vector-multivector grade raising/lowering 3. bivector identities (a.(b^c), (a^b).(c^d)) 4. commutator product (B x v = B.v, Jacobi identity) 5. pseudoscalar (I^2=-1, centrality in 3D, dual) 6. outermorphism (rotor normalization, rotation, det=1) 7. adjoint (a.F_bar(b) = F(a).b, det(FG) = det(F)det(G)) * test(cheatsheet): move validation to test/ so pytest collects it (pygae#506) Per review: examples/Terminal/ is not collected by CI (setup.cfg only collects test_*.py). Move to test/test_cheatsheet.py so assertions actually run in CI. Also adds a comment in section 5 clarifying that the dual is computed manually via I^{-1} (Iinv+ convention), which differs from galgebra's built-in dual() that uses I+ by default. * chore: remove unused Symbol and Matrix imports Co-authored-by: utensil <utensilcandel@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: add 0.6.0 changelog entries Groups new entries by: features, bug fixes, examples/docs, tests/maintenance. Features: Cl() kingdon interface (pygae#550, closes pygae#524), Mv.__rtruediv__ (pygae#543, closes pygae#512), shirokov_inverse/hitzer_inverse (pygae#530). Bugs: interop dual mode contamination (pygae#556, closes pygae#555), norm() Abs wrapping (pygae#554, closes pygae#522), is_versor() improvement (pygae#536, closes pygae#533). Examples/docs: sundial + cheatsheet tests (pygae#549+pygae#557, closes pygae#506), coords tutorial (pygae#551), README ops (pygae#548, closes pygae#523). Tests/maintenance: lt.matrix() regression tests (pygae#558, closes pygae#461), extra-cdot regression test (pygae#545), er_blade + ReciprocalFrame refactors (pygae#552+pygae#553), CI fix (pygae#535). * docs: add missing issue link for pygae#551 entry * docs: add changelog entry for pygae#560 (Lt callable zero fix) * docs: move Lt zero fix into bug group, use issue pygae#540 as reference
Closes #506
Adds
examples/Terminal/cheatsheet_validation.pyvalidating galgebra against Russell Goyder's geometric algebra cheat sheet, covering all 7 sections:ab = a·b + a∧b, symmetric/antisymmetric partsa*B = a<B + a∧Ba·(b∧c) = (a·b)c - (a·c)b,(a∧b)·(c∧d)scalar formulaB×v = B·v, grade-preserving on bivectors, Jacobi identityI²=-1, centrality in 3D, dual viaI⁻¹det(rotation)=1a·F̄(b) = F(a)·b,det(FG) = det(F)·det(G)