Opened 3 years ago

Closed 2 years ago

#29248 closed defect (fixed)

Index notation for tensors should allow for unicode characters

Reported by: Eric Gourgoulhon Owned by:
Priority: major Milestone: sage-9.2
Component: geometry Keywords: tensor, indices
Cc: Léo Brunswic, Eric Gourgoulhon, Travis Scrimshaw, Michael Jung Merged in:
Authors: Matthias Koeppe Reviewers: Eric Gourgoulhon
Report Upstream: N/A Work issues:
Branch: 4d8305f (Commits, GitHub, GitLab) Commit: 4d8305faf557774ff67bbb47cd0d76bb06fe71d0
Dependencies: Stopgaps:

Status badges

Description (last modified by Matthias Köppe)

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 3 years ago by Eric Gourgoulhon

Cc: Léo Brunswic added

comment:2 Changed 3 years ago by Matthias Köppe

Milestone: sage-9.1sage-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 2 years ago by Matthias Köppe

Branch: u/mkoeppe/index_notation_for_tensors_should_allow_for_unicode_characters

comment:4 Changed 2 years ago by Matthias Köppe

Authors: Matthias Koeppe
Cc: Eric Gourgoulhon Travis Scrimshaw Michael Jung added
Commit: ab2beb1e59cce64866e15d675fd88108fd8610ad
Status: newneeds_review

New commits:

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

comment:5 Changed 2 years ago by Matthias Köppe

Description: modified (diff)

comment:6 Changed 2 years ago by Eric Gourgoulhon

Reviewers: Eric Gourgoulhon
Status: needs_reviewpositive_review

Thanks for this improvement! LGTM.

comment:7 Changed 2 years ago by Matthias Köppe

Thanks!

comment:8 Changed 2 years ago by Volker Braun

Status: positive_reviewneeds_work

pdf docs don't build

comment:9 Changed 2 years ago by git

Commit: ab2beb1e59cce64866e15d675fd88108fd8610ad4d8305faf557774ff67bbb47cd0d76bb06fe71d0

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 2 years ago by Matthias Köppe

Status: needs_workneeds_review

comment:11 Changed 2 years ago by Eric Gourgoulhon

Status: needs_reviewpositive_review

Thanks for the fix.

comment:12 Changed 2 years ago by Volker Braun

Branch: u/mkoeppe/index_notation_for_tensors_should_allow_for_unicode_characters4d8305faf557774ff67bbb47cd0d76bb06fe71d0
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.