Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit ed4aa58

Browse files
committed
ScalarFieldAlgebra does not longer inherit from AbstractNamedObject
1 parent 9d25aa0 commit ed4aa58

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

src/sage/manifolds/scalarfield_algebra.py

+17-6
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@
3535
from sage.structure.unique_representation import UniqueRepresentation
3636
from sage.categories.commutative_algebras import CommutativeAlgebras
3737
from sage.symbolic.ring import SR
38-
from sage.manifolds.abstract import AbstractNamedObject
3938
from sage.manifolds.scalarfield import ScalarField
4039

41-
class ScalarFieldAlgebra(AbstractNamedObject, UniqueRepresentation, Parent):
40+
class ScalarFieldAlgebra(UniqueRepresentation, Parent):
4241
r"""
4342
Commutative algebra of scalar fields on a topological manifold.
4443
@@ -385,9 +384,6 @@ def __init__(self, domain):
385384
sage: TestSuite(CM).run()
386385
387386
"""
388-
name = "C^0(" + domain._name + ")"
389-
latex_name = r"C^0 \left(" + domain._latex_() + r"\right)"
390-
AbstractNamedObject.__init__(self, name, latex_name=latex_name)
391387
base_field = domain.base_field()
392388
if domain.base_field_type() in ['real', 'complex']:
393389
base_field = SR
@@ -398,7 +394,6 @@ def __init__(self, domain):
398394
self._zero = None # zero element (to be set by method zero())
399395
self._one = None # unit element (to be set by method one())
400396

401-
402397
#### Methods required for any Parent
403398
def _element_constructor_(self, coord_expression=None, chart=None,
404399
name=None, latex_name=None):
@@ -548,6 +543,22 @@ def _repr_(self):
548543
"""
549544
return "Algebra of scalar fields on the {}".format(self._domain)
550545

546+
def _latex_(self):
547+
r"""
548+
LaTeX representation of the object.
549+
550+
TESTS::
551+
552+
sage: M = Manifold(2, 'M', structure='topological')
553+
sage: CM = M.scalar_field_algebra()
554+
sage: CM._latex_()
555+
'C^0 \\left(M\\right)'
556+
sage: latex(CM) # indirect doctest
557+
C^0 \left(M\right)
558+
559+
"""
560+
return r"C^0 \left(" + self._domain._latex_() + r"\right)"
561+
551562
def zero(self):
552563
r"""
553564
Return the zero element of the algebra.

0 commit comments

Comments
 (0)