Opened 2 years ago
Last modified 23 months ago
#28784 closed enhancement
Adding multiple symmetries and multiple contractions to tensors — at Version 11
Reported by:  ghLBrunswic  Owned by:  ghLBrunswic 

Priority:  major  Milestone:  sage9.0 
Component:  linear algebra  Keywords:  tensor, contraction, symmetries, manifolds 
Cc:  egourgoulhon  Merged in:  
Authors:  Léo Brunswic  Reviewers:  
Report Upstream:  N/A  Work issues:  
Branch:  u/ghLBrunswic/adding_multiple_symmetries_and_multiple_contractions_to_tensors (Commits, GitHub, GitLab)  Commit:  4b9a565daccfb8312b00efa9a86a9c47080ffe41 
Dependencies:  Stopgaps: 
Description (last modified by )
As of sage9.0.beta6, applying multiple contractions or multiple symmetries to tensors in indices notation raises a NotImplementedError?.
This tickets aims at removing this error by implementing the adequate behavior as well as adding a convention check on the index notation.
The index notation should allow :
* Multiple contraction
* Multiple symmetries
* indices denoted by a nonaccentuated latin caracter {a,...,z,A,...,Z} and wild card "."
* covariant indices first notation as well as contravariant indices first
* Latex notations '{' and '}'
* if indices do not begin by ^
nor _
then contravariant indices first is assumed
The index notation should not allow :
* Repeated indices of the same type
* indices denoted by any other caracter
* nested symmetries
* unbalanced parentheses/brackets
NB : Usual index notations allows greek indices but their implementation seems more difficult and is not the goal of the ticket.
Change History (11)
comment:1 Changed 2 years ago by
 Cc egourgoulhon added
 Component changed from PLEASE CHANGE to linear algebra
 Description modified (diff)
 Keywords tensor contraction symmetries manifolds added
 Type changed from PLEASE CHANGE to enhancement
comment:2 Changed 2 years ago by
 Branch set to u/ghLBrunswic/adding_multiple_symmetries_and_multiple_contractions_to_tensors
comment:3 Changed 2 years ago by
 Commit set to 1d1e4eaee5ee42864bed95a9ce10f38f2a7a95d3
 Owner changed from (none) to ghLBrunswic
comment:4 Changed 2 years ago by
 Description modified (diff)
comment:5 Changed 2 years ago by
 Commit changed from 1d1e4eaee5ee42864bed95a9ce10f38f2a7a95d3 to 59c86e3ed784136ff1b9026a6b89b5625ec14052
comment:6 Changed 2 years ago by
 Status changed from new to needs_review
comment:7 followup: ↓ 9 Changed 2 years ago by
 Status changed from needs_review to needs_work
Thanks for this useful enhancement!
The patchbot reports some failures:
sage t long src/sage/manifolds/differentiable/tensorfield.py # 2 doctests failed sage t long src/sage/tensor/modules/free_module_tensor.py # 19 doctests failed sage t long src/sage/tensor/modules/tensor_with_indices.py # 39 doctests failed
Besides, could you add a few doctests to illustrate the new functionalities?
comment:8 Changed 2 years ago by
 Commit changed from 59c86e3ed784136ff1b9026a6b89b5625ec14052 to 4b9a565daccfb8312b00efa9a86a9c47080ffe41
Branch pushed to git repo; I updated commit sha1. New commits:
4b9a565  The convention without leading '^' for contravariant indices is now accepted as is used to. A regex corrected. doctest added to illustrate new functionalities.

comment:9 in reply to: ↑ 7 Changed 2 years ago by
@egourgoulhon
I needed it :)
I'm sorry I forgot to do a doctest :$...I corrected the features that are tested and added new doctest.
comment:10 Changed 2 years ago by
 Description modified (diff)
 Status changed from needs_work to needs_review
comment:11 Changed 2 years ago by
 Description modified (diff)
Branch pushed to git repo; I updated commit sha1. New commits:
Adding check to raise exception on repeated indices of same type. Implementation of multiple contractions