Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the right and left complement #215

Open
eric-wieser opened this issue Jan 3, 2020 · 2 comments
Open

Add support for the right and left complement #215

eric-wieser opened this issue Jan 3, 2020 · 2 comments
Milestone

Comments

@eric-wieser
Copy link
Member

eric-wieser commented Jan 3, 2020

The right complement of the basis blades can be found with

from galgebra.ga import GradedTuple

def right_complement_blades(ga):
    # relies on the lexicographic ordering of `ga.indices`
    blades = []
    for fwd_blades, rev_blades in zip(ga.blades, reversed(ga.blades)):
        blades_single_grade = []
        for fwd_blade, rev_blade in zip(fwd_blades, reversed(rev_blades)):
            sign = ga.wedge(fwd_blade, rev_blade) / ga.e.obj  # swap the order of the wedge for left complement
            blades_single_grade.append(sign * rev_blade)
        blades.append(tuple(blades_single_grade))
    return GradedTuple(blades)

With that in place, the complement of any multivector can be taken componentwise.

This would enable:

  • vee in PGA without incurring the metric
  • Generalized multivector derivatives
@utensil
Copy link
Member

utensil commented Jan 4, 2020

👍

@utensil utensil added this to the 0.6.0 milestone Jun 2, 2020
@eric-wieser
Copy link
Member Author

eric-wieser commented Mar 18, 2021

Just commenting to note that the above code still works in 0.5.0. The rest of the puzzle is something like

from galgebra import metric

ga = ...

lookup = dict(zip(ga.blades.flat, right_complement_blades(ga).flat))

def right_complement(e):
    return a.Ga.mv(sum([
        coef * lookup[base]
        for coef, base in metric.linear_expand_terms(e.obj)], S.Zero))

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

No branches or pull requests

2 participants