question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate whether the left and right contraction overloads are safe

See original GitHub issue

galgebra uses a < b to mean left_contract(a, b). I’m worried that this doesn’t work properly:

Quoting the python docs about the comparison ops:

There are no swapped-argument versions of these methods (to be used when the left argument does not support the operation but the right argument does); rather, lt()` and gt() are each other’s reflection

If the operands are of different types, and right operand’s type is a direct or indirect subclass of the left operand’s type, the reflected method of the right operand has priority, otherwise the left operand’s method has priority.

What this means is that obj < mv and mv > obj are indistinguishable if obj does not take part in the comparison.

From dorst, the rule for converting a left to right contraction is:

image

So by identity, left_contract(obj, mv) == right_contract(mv.rev(), obj.rev()).rev()

However, the python rules allow the rewrite left_contract(obj, mv) == right_contract(mv, obj).

Can we guarantee this is always true?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
eric-wiesercommented, Nov 22, 2019

At this point I suggest we continue this conversation at the Grassman.jl repository.

The intent of this issue was to flag a potentially dangerous use of python operator overload semantics, not to question the operators of geometric Algebra.

1reaction
Orbotscommented, Nov 22, 2019

I haven’t read the John Browne book, looks interesting though. I’ll add it to my stack.

@chakravala it seems your definition of contraction in Grassmann.jl is different from the one used in Geometric Algebra. Nothing wrong with that and I don’t want to get into a discussion about which one is “right”.

This particular issue we are discussing here is for a Geometric Algebra library, galgebra.

The current Geometric Algebra definition of contractions should be used here, not the Grassmann Algebra/Grassmann.jl/John Browne’s definition. Unless the contributers to galgebra decide otherwise.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Right ventricular pressure overload directly affects left ... - NCBI
Right ventricular pressure overload directly affects left ventricular torsion mechanics in patients with precapillary pulmonary hypertension.
Read more >
Heart Failure Flashcards | Quizlet
Volume overload (excess fluid) e.g excess intravenous fluids or blood ... Symptoms depend on whether the patient has failure of the left, right...
Read more >
Evaluation and Management of Premature Ventricular ...
Whenever possible, investigating the cause of the PVCs is ... of a right bundle-branch block with left anterior hemiblock if exiting the ...
Read more >
ELECTRICAL SAFETY – Applied Industrial Electricity
For those who are left-handed, this advice may not be the best. If such a person is sufficiently uncoordinated with their right hand,...
Read more >
Muscle Strain - Physiopedia
It is a contraction-induced injury in which muscle fibers tear due to ... grip measures is considered normal a difference of 20% between...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found