Opened 8 months ago

Closed 3 months ago

#29248 closed defect (fixed)

Index notation for tensors should allow for unicode characters

Reported by: egourgoulhon Owned by:
Priority: major Milestone: sage-9.2
Component: geometry Keywords: tensor, indices
Cc: gh-LBrunswic, egourgoulhon, tscrim, gh-mjungmath Merged in:
Authors: Matthias Koeppe Reviewers: Eric Gourgoulhon
Report Upstream: N/A Work issues:
Branch: 4d8305f (Commits) Commit: 4d8305faf557774ff67bbb47cd0d76bb06fe71d0
Dependencies: Stopgaps:

Description (last modified by mkoeppe)

In Sage 9.0, we have:

sage: E.<x,y> = EuclideanSpace()
sage: t = E.tensor_field(1, 1, [[x, 1], [0, y]])
sage: t['^μ_μ']
...
ValueError: index conventions not satisfied

Now, after the Python 3 switch, any unicode non-digit word-constituent character should be accepted, see this discussion. This is especially pertinent for tensor indices, since Greek letters are often used to denote them.

Change History (12)

comment:1 Changed 8 months ago by egourgoulhon

  • Cc gh-LBrunswic added

comment:2 Changed 7 months ago by mkoeppe

  • Milestone changed from sage-9.1 to sage-9.2

Batch modifying tickets that will likely not be ready for 9.1, based on a review of the ticket title, branch/review status, and last modification date.

comment:3 Changed 3 months ago by mkoeppe

  • Branch set to u/mkoeppe/index_notation_for_tensors_should_allow_for_unicode_characters

comment:4 Changed 3 months ago by mkoeppe

  • Authors set to Matthias Koeppe
  • Cc egourgoulhon tscrim gh-mjungmath added
  • Commit set to ab2beb1e59cce64866e15d675fd88108fd8610ad
  • Status changed from new to needs_review

New commits:

ab2beb1sage.tensor.modules.tensor_with_indices: Allow unicode indices (non-digit word constituents)

comment:5 Changed 3 months ago by mkoeppe

  • Description modified (diff)

comment:6 Changed 3 months ago by egourgoulhon

  • Reviewers set to Eric Gourgoulhon
  • Status changed from needs_review to positive_review

Thanks for this improvement! LGTM.

comment:7 Changed 3 months ago by mkoeppe

Thanks!

comment:8 Changed 3 months ago by vbraun

  • Status changed from positive_review to needs_work

pdf docs don't build

comment:9 Changed 3 months ago by git

  • Commit changed from ab2beb1e59cce64866e15d675fd88108fd8610ad to 4d8305faf557774ff67bbb47cd0d76bb06fe71d0

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

4d8305fsrc/sage/tensor/modules/tensor_with_indices.py: Use unicode escapes instead of characters in docstrings, so that pdf doc builds

comment:10 Changed 3 months ago by mkoeppe

  • Status changed from needs_work to needs_review

comment:11 Changed 3 months ago by egourgoulhon

  • Status changed from needs_review to positive_review

Thanks for the fix.

comment:12 Changed 3 months ago by vbraun

  • Branch changed from u/mkoeppe/index_notation_for_tensors_should_allow_for_unicode_characters to 4d8305faf557774ff67bbb47cd0d76bb06fe71d0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.