Skip to content

Mv.__pow__ is not returning Mv instance as return value when raise to power of zero #518

@mammalwong

Description

@mammalwong

@utensil I have just realized there are another issue related to Mv.__pow__, in both primer-updates branch and version 0.5.1:

ga = Ga('e', g=[1,1,1], coords=S.symbols(f"0:{3}", real=True), wedge=False)
x,y,z = ga.mv()
(x**0).grade

I expect (x**0) returns ga.mv(1) and the .grade property will return [0]. However it raised this exception:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-4-97f54e720c11>](https://localhost:8080/#) in <cell line: 3>()
      1 ga = Ga('e', g=[1,1,1], coords=S.symbols(f"0:{3}", real=True), wedge=False)
      2 x,y,z = ga.mv()
----> 3 (x**0).grade

AttributeError: 'One' object has no attribute 'grade'

Clearly it is because the method returning sympy.S.One instead of an Mv instance in this case

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions