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

Commit

Permalink
ScalarField.codomain: New, put scalar fields in category of continuou…
Browse files Browse the repository at this point in the history
…s maps
  • Loading branch information
Matthias Koeppe committed May 31, 2021
1 parent 6aa4ece commit 1942c71
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/sage/manifolds/differentiable/manifold.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
Algebra of differentiable scalar fields on the 2-dimensional differentiable
manifold S^2
sage: f.parent().category()
Category of commutative algebras over Symbolic Ring
Join of Category of commutative algebras over Symbolic Ring and Category of homsets of topological spaces
A differentiable manifold has a default vector frame, which, unless otherwise
specified, is the coordinate frame associated with the first defined chart::
Expand Down Expand Up @@ -376,7 +376,7 @@
Algebra of differentiable scalar fields on the 1-dimensional complex
manifold C*
sage: f.parent().category()
Category of commutative algebras over Symbolic Ring
Join of Category of commutative algebras over Symbolic Ring and Category of homsets of topological spaces
A vector field on the Riemann sphere::
Expand Down
6 changes: 3 additions & 3 deletions src/sage/manifolds/manifold.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
sage: f.parent()
Algebra of scalar fields on the 2-dimensional topological manifold S^2
sage: f.parent().category()
Category of commutative algebras over Symbolic Ring
Join of Category of commutative algebras over Symbolic Ring and Category of homsets of topological spaces
.. RUBRIC:: Example 2: the Riemann sphere as a topological manifold of
Expand Down Expand Up @@ -295,7 +295,7 @@
Algebra of scalar fields on the Complex 1-dimensional topological
manifold C*
sage: f.parent().category()
Category of commutative algebras over Symbolic Ring
Join of Category of commutative algebras over Symbolic Ring and Category of homsets of topological spaces
AUTHORS:
Expand Down Expand Up @@ -1833,7 +1833,7 @@ def scalar_field_algebra(self):
sage: CU = U.scalar_field_algebra() ; CU
Algebra of scalar fields on the Open subset U of the 3-dimensional topological manifold M
sage: CU.category()
Category of commutative algebras over Symbolic Ring
Join of Category of commutative algebras over Symbolic Ring and Category of homsets of topological spaces
sage: CU.zero()
Scalar field zero on the Open subset U of the 3-dimensional topological manifold M
Expand Down
15 changes: 15 additions & 0 deletions src/sage/manifolds/scalarfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -1580,6 +1580,21 @@ def domain(self):
"""
return self._domain

def codomain(self):
r"""
Return the codomain of the scalar field.
EXAMPLES::
sage: M = Manifold(2, 'M', structure='topological')
sage: c_xy.<x,y> = M.chart()
sage: f = M.scalar_field(x+2*y)
sage: f.codomain()
Real Field with 53 bits of precision
"""
return self._domain.base_field()

def copy(self, name=None, latex_name=None):
r"""
Return an exact copy of the scalar field.
Expand Down
7 changes: 4 additions & 3 deletions src/sage/manifolds/scalarfield_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from sage.structure.unique_representation import UniqueRepresentation
from sage.misc.cachefunc import cached_method
from sage.categories.commutative_algebras import CommutativeAlgebras
from sage.categories.topological_spaces import TopologicalSpaces
from sage.symbolic.ring import SR
from sage.manifolds.scalarfield import ScalarField

Expand Down Expand Up @@ -86,11 +87,11 @@ class ScalarFieldAlgebra(UniqueRepresentation, Parent):
:class:`~sage.symbolic.ring.SymbolicRing`)::
sage: CM.category()
Category of commutative algebras over Symbolic Ring
Join of Category of commutative algebras over Symbolic Ring and Category of homsets of topological spaces
sage: CM.base_ring()
Symbolic Ring
sage: CW.category()
Category of commutative algebras over Symbolic Ring
Join of Category of commutative algebras over Symbolic Ring and Category of homsets of topological spaces
sage: CW.base_ring()
Symbolic Ring
Expand Down Expand Up @@ -383,7 +384,7 @@ def __init__(self, domain):
if domain.base_field_type() in ['real', 'complex']:
base_field = SR
Parent.__init__(self, base=base_field,
category=CommutativeAlgebras(base_field))
category=CommutativeAlgebras(base_field) & TopologicalSpaces().Homsets())
self._domain = domain
self._populate_coercion_lists_()

Expand Down

0 comments on commit 1942c71

Please sign in to comment.