-
Notifications
You must be signed in to change notification settings - Fork 62
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
Mv.dual is very slow #41
Comments
Thanks for report this, I'll do a profiling ASAP. |
Are you sure you wanted to calculate it for a completely general metric and not g=[1,1,1] and use GA = Ga('e*1|2|3',g=[1,1,1]). |
If an exercise doesn't require a metric (like an euclidean one), I don't provide one. The exercise using the snippet is about proving bac cab formula. Maybe providing a metric is general enough. Even if Mv.dual is slow, I'm able to derive bac cab which is nice. Anyways, this seems very expensive. I was able to find an expression string of 20k characters when I tried to debug the Mv.dual method. |
The problem is the normalized I for a general metric. Look at following code and output which executes rapidly - You don't have xtex available in your version of galgebra yet. Use what you would for LaTeX output. |
I tried to remove the normalization of I but timings doesn't change much. |
Sorry for the late reply, I finally get to do a profiling at https://nbviewer.jupyter.org/github/utensil/julia-playground/blob/master/py/profile_mv_dual.ipynb with reproducible steps if you're also on a Mac. I think the reason is irrelevant to the normalized I since I also tried set As shown in the call graph, most of the time is spent on constructing 1k of SymPy objects in |
When I say normalization in this case I mean how I is expressed that is Let J = e1^e2^e3 then evaluate - J*(a^(J*(b^c)) and see how long it takes. I think any expression with a square root really slows down sympy.simplify |
Here is my code and output. Takes about 3 sec to run - ` def cross(x, y): Format() print('I =',GA.i) xtex(paper=(30,11)) |
Yes, it took around 3 seconds on my workstation too. |
We can close this issue. galgebra isn't designed to make geometric proof but calculus. If I want to achieve some kind of proofs, I need to reduce the expression lenght myself by fixing things, ignoring norms if useless, using the right basis... :) |
Hi,
I was trying this version of galgebra and I found Mv.dual method is very slow for low dimension geometric algebras. I hoped the issue was fixed there (This issue is reproducible with brombo version).
A short snippet :
I only profile :
xx = cross(a, cross(b, c))
cProfile reports :
Regards
The text was updated successfully, but these errors were encountered: