-
-
Notifications
You must be signed in to change notification settings - Fork 701
Open
Description
In Sage 9.7.beta1, we have
sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart()
sage: a = M.vector_field(1, 2, name='a')
sage: b = M.vector_field(-y, x, name='b')
sage: c = -(a + b)
sage: c.display()
-a+b = (y - 1) ∂/∂x + (-x - 2) ∂/∂y
The left-hand side should be -(a+b), not -a+b.
The culprit is FreeModuleTensor.__neg__, as defined in line 2022 of src/sage/tensor/modules/free_module_tensor.py: it should invoke sage.tensor.modules.format_utilities.format_unop_txt to set up the output name.
Component: manifolds
Keywords: tensor, unary negation
Issue created by migration from https://trac.sagemath.org/ticket/33938