Opened 2 years ago

Last modified 23 months ago

#28784 closed enhancement

Adding multiple symmetries and multiple contractions to tensors — at Version 10

Reported by: gh-LBrunswic Owned by: gh-LBrunswic
Priority: major Milestone: sage-9.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/gh-LBrunswic/adding_multiple_symmetries_and_multiple_contractions_to_tensors (Commits, GitHub, GitLab) Commit: 4b9a565daccfb8312b00efa9a86a9c47080ffe41
Dependencies: Stopgaps:

Status badges

Description (last modified by gh-LBrunswic)

As of sage-9.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 non-accentuated 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 '' or '_' 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 (10)

comment:1 Changed 2 years ago by gh-LBrunswic

  • Authors set to Léo Brunswic
  • 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 gh-LBrunswic

  • Branch set to u/gh-LBrunswic/adding_multiple_symmetries_and_multiple_contractions_to_tensors

comment:3 Changed 2 years ago by gh-LBrunswic

  • Commit set to 1d1e4eaee5ee42864bed95a9ce10f38f2a7a95d3
  • Owner changed from (none) to gh-LBrunswic

comment:4 Changed 2 years ago by gh-LBrunswic

  • Description modified (diff)

comment:5 Changed 2 years ago by git

  • Commit changed from 1d1e4eaee5ee42864bed95a9ce10f38f2a7a95d3 to 59c86e3ed784136ff1b9026a6b89b5625ec14052

Branch pushed to git repo; I updated commit sha1. New commits:

59c86e3Adding check to raise exception on repeated indices of same type. Implementation of multiple contractions

comment:6 Changed 2 years ago by gh-LBrunswic

  • Status changed from new to needs_review

comment:7 follow-up: Changed 2 years ago by egourgoulhon

  • 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 git

  • Commit changed from 59c86e3ed784136ff1b9026a6b89b5625ec14052 to 4b9a565daccfb8312b00efa9a86a9c47080ffe41

Branch pushed to git repo; I updated commit sha1. New commits:

4b9a565The 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 gh-LBrunswic

@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 gh-LBrunswic

  • Description modified (diff)
  • Status changed from needs_work to needs_review
Note: See TracTickets for help on using tickets.