GithubHelp home page GithubHelp logo

Comments (5)

utensil avatar utensil commented on July 18, 2024

IIUC, this behavior is by design. In such cases, the result should downgrade to scalars naturally, so a Mv is no longer expected.

This is also a recurring theme during maintenance, where you could be dealing with a Mv then suddenly you are dealing with a SymPy expression like a Mul, or suddenly it's just a symbol that the result is simplified to.

This phenomenon is also responsible for the oversight you spot in #513 .

So, this is a non-issue for maintenance, though I agree with you on the UX aspect as a user.

from galgebra.

mammalwong avatar mammalwong commented on July 18, 2024

@utensil It sounds like a very weird design choice, I have multiple points to support that is weird:

  • lets say there is a non-scalar Mv instance $a$, when $a a$ is a scalar, a**2 returns a Mv instance of scalar value under the current implementation, while a**0 exceptionally return sympy.S.One instead of a Mv instance
  • in terms of math pow should be a mapping $Cl(p,q,r) \times Cl(p,q,r) \rightarrow Cl(p,q,r)$ even if the result is a scalar, that scalar should still have properties like its grade under the current Ga instance
  • in terms of coding it is a very error prone design, there are no documentation or return value type hint to indicate this exceptional case

from galgebra.

utensil avatar utensil commented on July 18, 2024

For __pow__, a fix is pushed, and the existing tests are passing. So it would be fixed for this specific case, unless I find out that it causes other regressions. In general, this remains a wontfix, as you can find S.one usage everywhere in GAlgebra.

from galgebra.

mammalwong avatar mammalwong commented on July 18, 2024

Thanks for fixing this issue 👍

from galgebra.

utensil avatar utensil commented on July 18, 2024

Thank you, @mammalwong , the fix should be in master now as #510 is now merged.

from galgebra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.