Comments (5)
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.
@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, whilea**0
exceptionally returnsympy.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 currentGa
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.
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.
Thanks for fixing this issue 👍
from galgebra.
Thank you, @mammalwong , the fix should be in master now as #510 is now merged.
from galgebra.
Related Issues (20)
- Run tests on latest sympy HOT 1
- Extra `\cdot` since SymPy 1.10 HOT 2
- Broken `MatrixFunction` since SymPy 1.11 HOT 2
- Broken doc since #487 HOT 2
- Sync upstream updates HOT 2
- The sundial problem and a cheat sheet by Russell Goyder
- Mv class return 1 for all negative integer power HOT 20
- expression like 1/<Mv> raise exception HOT 2
- diff and pdiff method of class Mv throws exception when differentiate by a coordinate symbol HOT 4
- Mv.dual() method return wrong result HOT 7
- The wedge product operator ^ returns wrong result HOT 1
- Mv.grades return None under some situations HOT 1
- Make `__pow__` more performant
- Make `__pow__` support rational powers as well
- Sort out scattered LaTeX preambles HOT 1
- `norm` has no abs bar for even grades
- Improve doc on available GA operations in README
- Provide a kingdon-like interface, and run cross-library test cases
- Improve Migrating guide for readers of LAGA&VAGC
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from galgebra.