-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
Bug in multiple tensor contractions with scalar result #32355
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
The culprit is line 2187 of
|
comment:3
The bug is fixed in the above branch. Some slight clean up of the code for parallelized contractions has also been performed. New commits:
|
Commit: |
Author: Eric Gourgoulhon |
comment:5
Here are some comments.
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:7
Replying to @mjungmath:
Thanks for taking a look into this.
Yes indeed! (this is needed for the generic case, but not for the specific case of a scalar output). The latest commit implement this change.
I would prefer to keep the original version, since it is more efficient from a computational point of view: there is no need to sort a list. Granted: in most use cases, the list contains only a few elements and sorting shall be fast. So it is more a matter of taste... |
comment:8
Replying to @egourgoulhon:
You're right, this is faster! Then I still have one last comment: - ind_o = [None for i in range(ncontr)]
+ ind_o = [None] * ncontr This is indeed faster. If that is done, and patchbot is happy -> positive review. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:10
Replying to @mjungmath:
Done in the above commit. |
Reviewer: Michael Jung |
comment:12
Thank you for the review! |
Changed branch from public/manifolds/contraction_bug-32355 to |
Tensor contractions on multiple indices give wrong results when the outcome is a scalar and the index positions in each tensor do not have the same order. For instance, let us consider
The double contraction aij bij is obtained via
which is correct. However, asking for the double contraction aij bji
leads to
which is obviously wrong: the result should be -2, since b is antisymmetric.
If the outcome is not a scalar field, there is no issue:
This bug has been reported in https://ask.sagemath.org/question/58379.
CC: @tscrim @mjungmath @mkoeppe
Component: manifolds
Keywords: tensor contraction
Author: Eric Gourgoulhon
Branch/Commit:
48f5523
Reviewer: Michael Jung
Issue created by migration from https://trac.sagemath.org/ticket/32355
The text was updated successfully, but these errors were encountered: