Opened 6 years ago
Closed 6 years ago
#22520 closed defect (fixed)
Fix display of tensors on free modules of finite rank
Reported by: | Eric Gourgoulhon | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-7.6 |
Component: | linear algebra | Keywords: | tensor |
Cc: | Travis Scrimshaw | Merged in: | |
Authors: | Eric Gourgoulhon | Reviewers: | Travis Scrimshaw |
Report Upstream: | N/A | Work issues: | |
Branch: | 7c02ed8 (Commits, GitHub, GitLab) | Commit: | 7c02ed84fdce8c7c6fb2b1a9518c26a215f932c6 |
Dependencies: | Stopgaps: |
Description
The following is a bug:
sage: M = FiniteRankFreeModule(SR, 3, name='M') sage: e = M.basis('e') sage: t = SR.var('t', domain='real') sage: (2*e[0]).display() 2 e_0 sage: (t*e[0]).display() 0
The outcome of the last line should be t e_0
. This bug arises because of the nonzero check performed to avoid displaying zero components. This check is written as t != 0
, which returns False
. The fix proposed in this ticket is to replace it by not (t==0)
, which returns True
.
Change History (4)
comment:1 Changed 6 years ago by
Branch: | → public/manifolds/bug-display-tensor-22520 |
---|---|
Cc: | Travis Scrimshaw added |
Commit: | → 7c02ed84fdce8c7c6fb2b1a9518c26a215f932c6 |
Status: | new → needs_review |
comment:2 follow-up: 3 Changed 6 years ago by
Reviewers: | → Travis Scrimshaw |
---|---|
Status: | needs_review → positive_review |
It's somewhat ugly, but a necessary evil because of how symbolic works (i.e., t could be 0).
comment:3 Changed 6 years ago by
Replying to tscrim:
It's somewhat ugly, but a necessary evil because of how symbolic works (i.e., t could be 0).
I agree. Thanks for the review!
comment:4 Changed 6 years ago by
Branch: | public/manifolds/bug-display-tensor-22520 → 7c02ed84fdce8c7c6fb2b1a9518c26a215f932c6 |
---|---|
Resolution: | → fixed |
Status: | positive_review → closed |
Note: See
TracTickets for help on using
tickets.
New commits:
Fix display of tensors on free modules of finite rank (#22520)