feat(ga): add Cl(p,q,r) kingdon-like interface for Clifford algebras#550
Conversation
Adds a Cl(p, q, r) convenience function that constructs a Clifford algebra Cl(p,q,r) from its signature: p positive, q negative, r degenerate basis vectors. This follows the interface popularized by ganja.js and kingdon. The function is importable from both galgebra.ga and the top-level galgebra package. Fixes #10
|
Thanks for this! A few things before merging:
|
- galgebra.interop.Cl: galgebra defaults (1-indexed, I+ dual) - galgebra.interop.kingdon.Cl: kingdon conventions (0-indexed, Iinv+ dual) - Remove Cl from ga.py (keep ga.py for core algebra only) - Document known incompatibilities (basis naming, dual convention)
|
Restructured per review. Pushed in 35026b6:
|
|
Thanks for the clean refactor! One note: |
|
Added a warning block in the kingdon.Cl docstring about the session-wide side effect and the save/restore pattern. Pushed in 524e3f2. |
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
* 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
Summary
Adds a
Cl(p, q, r)convenience function that creates a geometric algebra from its signature, following the convention popularized by ganja.js and kingdon. This provides an intuitive entry point for users coming from those libraries.Fixes #524
Changes
galgebra/ga.py: AddCl(p, q=0, r=0)function that:e_1, e_2, ...(Ga, *basis_vectors)tuplegalgebra/__init__.py: ExportCltest/test_test.py: Add tests forCl(3),Cl(1,3),Cl(2,0,1)with metric verificationExample
Test plan