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

expression like 1/<Mv> raise exception #512

Open
mammalwong opened this issue Apr 23, 2024 · 2 comments
Open

expression like 1/<Mv> raise exception #512

mammalwong opened this issue Apr 23, 2024 · 2 comments
Labels
Milestone

Comments

@mammalwong
Copy link

mammalwong commented Apr 23, 2024

The current Mv class missing an implementation of the __ rtruediv __ method, it makes a simple expression like 1/I (where I is the pseudoscalar multivector) raise exception because the integer/float class clearly can't handle division by a Mv object. It is not a functional issue but a great QoL improvement if the Mv class implements the __ rtruediv __ method.

@utensil utensil added the bug label May 9, 2024
@utensil utensil added this to the 0.5.3 milestone May 9, 2024
@utensil
Copy link
Member

utensil commented May 9, 2024

@mammalwong Can you also post minimal working example for this issue? Thanks!

@mammalwong
Copy link
Author

To reproduce:

ga = Ga('e', g=[1,1,1], coords=S.symbols(f"0:{3}", real=True), wedge=False)
ex,ey,ez = ga.mv()
1/ex

throws exception:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-11-0aacfa68a149> in <cell line: 3>()
      1 ga = Ga('e', g=[1,1,1], coords=S.symbols(f"0:{3}", real=True), wedge=False)
      2 ex,ey,ez = ga.mv()
----> 3 1/ex

TypeError: unsupported operand type(s) for /: 'int' and 'Mv'

@utensil utensil added enhancement component: core Ga, Mv, Metric, etc and removed bug labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants