35
35
from sage .structure .unique_representation import UniqueRepresentation
36
36
from sage .categories .commutative_algebras import CommutativeAlgebras
37
37
from sage .symbolic .ring import SR
38
- from sage .manifolds .abstract import AbstractNamedObject
39
38
from sage .manifolds .scalarfield import ScalarField
40
39
41
- class ScalarFieldAlgebra (AbstractNamedObject , UniqueRepresentation , Parent ):
40
+ class ScalarFieldAlgebra (UniqueRepresentation , Parent ):
42
41
r"""
43
42
Commutative algebra of scalar fields on a topological manifold.
44
43
@@ -385,9 +384,6 @@ def __init__(self, domain):
385
384
sage: TestSuite(CM).run()
386
385
387
386
"""
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 )
391
387
base_field = domain .base_field ()
392
388
if domain .base_field_type () in ['real' , 'complex' ]:
393
389
base_field = SR
@@ -398,7 +394,6 @@ def __init__(self, domain):
398
394
self ._zero = None # zero element (to be set by method zero())
399
395
self ._one = None # unit element (to be set by method one())
400
396
401
-
402
397
#### Methods required for any Parent
403
398
def _element_constructor_ (self , coord_expression = None , chart = None ,
404
399
name = None , latex_name = None ):
@@ -548,6 +543,22 @@ def _repr_(self):
548
543
"""
549
544
return "Algebra of scalar fields on the {}" .format (self ._domain )
550
545
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
+
551
562
def zero (self ):
552
563
r"""
553
564
Return the zero element of the algebra.
0 commit comments