Opened 2 years ago

Last modified 2 years ago

#28562 closed enhancement

Tensor Fields: Better Zero Treatment — at Version 5

Reported by: gh-DeRhamSource Owned by:
Priority: major Milestone: sage-9.0
Component: geometry Keywords: manifolds, tensor fields, scalar fields, mixed forms
Cc: tscrim, egourgoulhon Merged in:
Authors: Michael Jung Reviewers:
Report Upstream: N/A Work issues:
Branch: u/gh-DeRhamSource/better_zero_treatment (Commits, GitHub, GitLab) Commit: 5094a3e802034be5916879a0225e5db2ccf9f0f8
Dependencies: Stopgaps:

Status badges

Description (last modified by gh-DeRhamSource)

The zero element is always a special element. Therefore it should be treated as such. It should shorten computations and certainly be immutable. This ticket is devoted to that topic. (Similarly for the one element in the scalar field and mixed form algebra).

This ticket is part of the metaticket #28519.


  • an assertion error arises when altering the fixed elements zero or one
  • a new attribute _is_zero is added to tensor fields and mixed form (similar to scalar fields)
  • computations with involved zero or one are shortened by using a simple check
  • due to immutability of algebra elements, no copies are returned anymore for scalar field operations
  • _is_zero attribute is applied for copies

Change History (5)

comment:1 Changed 2 years ago by gh-DeRhamSource

  • Branch set to u/gh-DeRhamSource/better_zero_treatment

comment:2 Changed 2 years ago by gh-DeRhamSource

  • Commit set to 9f91503dce5cbe14f52a6a77a34ae5a18f722f7d
  • Description modified (diff)

New commits:

9f91503'_is_zero' attribute added and modified

comment:3 Changed 2 years ago by git

  • Commit changed from 9f91503dce5cbe14f52a6a77a34ae5a18f722f7d to 5094a3e802034be5916879a0225e5db2ccf9f0f8

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

5094a3eReturn no copies for scalar field operations

comment:4 Changed 2 years ago by gh-DeRhamSource

  • Description modified (diff)

comment:5 Changed 2 years ago by gh-DeRhamSource

  • Description modified (diff)
Note: See TracTickets for help on using tickets.