Skip to content

Add shirokov_inverse and hitzer_inverse#530

Merged
utensil merged 4 commits intopygae:masterfrom
spinjo:more_inverse
Dec 26, 2024
Merged

Add shirokov_inverse and hitzer_inverse#530
utensil merged 4 commits intopygae:masterfrom
spinjo:more_inverse

Conversation

@spinjo
Copy link
Copy Markdown
Contributor

@spinjo spinjo commented Dec 24, 2024

Add shirokov_inverse and hitzer_inverse functions, based on the clifford package implementation of the shirokov_inverse and hitzer_inverse.

closes #529

@spinjo
Copy link
Copy Markdown
Contributor Author

spinjo commented Dec 24, 2024

I did a few tests on dim=3 and dim=4, but not on dim>=5 because the code was so slow. Happy about ideas on how to speed it up! Plus I think it would make sense to add unit tests for the inverse.

@utensil
Copy link
Copy Markdown
Member

utensil commented Dec 25, 2024

For a first PR, dim 3 to 4 tests suffice. Slowness of GAlgebra above 4 dims are observed in other cases too.

There are a few issues to explore the possibilities to speed up GAlgebra, but none is sufficiently mature.

I'll take a look at the code ASAP. Thanks for the PR! ❤️

Comment thread galgebra/mv.py
Uk = self
for k in range(1, N):
Ck = (N / k) * Uk.scalar()
adjU = Ck - Uk
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't immediately see why you negated it here and negated it back below.

Copy link
Copy Markdown
Contributor Author

@spinjo spinjo Dec 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats not in line with the clifford code, but in line with the Shirokov paper. The variables adjU and Uk sometimes differ by a sign in the clifford code for some reason.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@utensil
Copy link
Copy Markdown
Member

utensil commented Dec 25, 2024

Looks correct and good to me (cross-checked with clifford and the papers), except for one comment.

Can you add your tests for dim 3-4 as tests in CI? It's fine to add them as notebooks or vanilla tests.

@utensil utensil added enhancement component: core Ga, Mv, Metric, etc state: needs changelog Needs a changelog entry before the next release. Remove this label when the changelog is done. labels Dec 26, 2024
@utensil utensil merged commit b071b8d into pygae:master Dec 26, 2024
@EelcoHoogendoorn
Copy link
Copy Markdown

I did a few tests on dim=3 and dim=4, but not on dim>=5 because the code was so slow. Happy about ideas on how to speed it up! Plus I think it would make sense to add unit tests for the inverse.

Doing the hitzer ops recursively, rather than greedily forming the product of all involutions, can be much faster. When working recursively the number of components tends to drop dramatically at each step.

@koraxkorakos koraxkorakos mentioned this pull request Dec 27, 2024
@utensil utensil mentioned this pull request Mar 24, 2025
@utensil utensil added this to the 0.6.0 milestone Mar 31, 2026
utiberious added a commit to utiberious/galgebra that referenced this pull request Apr 1, 2026
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).
utensil pushed a commit that referenced this pull request Apr 1, 2026
* 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
utiberious added a commit to utiberious/galgebra that referenced this pull request Apr 2, 2026
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: core Ga, Mv, Metric, etc enhancement state: needs changelog Needs a changelog entry before the next release. Remove this label when the changelog is done.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shirokov inverse?

3 participants