Changes between Initial Version and Version 3 of Ticket #28554


Ignore:
Timestamp:
10/04/19 18:43:36 (2 years ago)
Author:
gh-DeRhamSource
Comment:

New commits:

0c645ca'set_restriction' added + 'display' modified + naming modified

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28554

    • Property Commit changed from to 0c645ca987eb13c63cfc7841aac1c4d320eec253
    • Property Branch changed from to u/gh-DeRhamSource/scalar_field_restrictions
  • Ticket #28554 – Description

    initial v3  
    99This solution is quite unhandy and becomes even more so for more complicated scalar fields.
    1010
    11 In this ticket, I try to solve this issue by adding a `set_restriction` method (similar to tensor fields) and modifying the `display` method.
     11How is a scalar field implemented which is split into different expressions in one particular chart?
     12
     13Take for instance a scalar field `f` on the real line with standard "top" chart `x`, defined via `f(x)=0 for x<-1`, `f(x)=x+1 for -1<=x<0`, `f(x)=1-x for 0<=x<1` and `f(x)=0 for x>=1`. Currently, this is solved by using
     14{{{
     15f = M.scalar_field( unit_step(x + 1)*unit_step(1 - x)*(1 - abs(x)) )
     16}}}
     17(see https://trac.sagemath.org/ticket/28519#comment:46).
     18
     19This solution is quite unhandy and becomes even more so for more complicated scalar fields.
     20
     21**This ticket includes:**
     22
     23- modification of namings after algebraic operations, such as `f*g` (`f \cdot g` for LaTeX code), `f/g` and `f+g`
     24- `display` method modified in such a way that all distinct expressions are shown (a small slowdown in computation time)
     25- `set_restriction` method added smilar to tensor fields
     26- `_is_zero` attribute copied for a copy