Skip to content

Absolute value function for scalar fields #32396

@mjungmath

Description

@mjungmath

Currently, the abs operator cannot be applied to scalar fields:

sage: M = Manifold(2, 'M', structure='topological')
sage: X.<x,y> = M.chart()
sage: f = M.scalar_field({X: x*y}, name='f', latex_name=r"\Phi")
sage: abs(f)
Traceback (most recent call last)
...
TypeError: bad operand type for abs(): 'ScalarFieldAlgebra_with_category.element_class'

In this ticket, we add this feature.

CC: @egourgoulhon @tscrim

Component: manifolds

Author: Michael Jung

Branch/Commit: 2095de3

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/32396

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions