From 8e0bf363b0ffab0336e4218fa986fac3bcef4b48 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 27 Sep 2022 17:29:27 -0700 Subject: [PATCH] TensorFieldModule: Put it in the category Modules.TensorProducts --- src/sage/manifolds/differentiable/tensorfield.py | 4 ++-- src/sage/manifolds/differentiable/tensorfield_module.py | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/sage/manifolds/differentiable/tensorfield.py b/src/sage/manifolds/differentiable/tensorfield.py index a2aad4d4937..db4a2a05aa1 100644 --- a/src/sage/manifolds/differentiable/tensorfield.py +++ b/src/sage/manifolds/differentiable/tensorfield.py @@ -176,8 +176,8 @@ class TensorField(ModuleElementWithMutability): Module T^(0,2)(S^2) of type-(0,2) tensors fields on the 2-dimensional differentiable manifold S^2 sage: t.parent().category() - Category of modules over Algebra of differentiable scalar fields on the - 2-dimensional differentiable manifold S^2 + Category of tensor products of modules over Algebra of differentiable scalar fields + on the 2-dimensional differentiable manifold S^2 The parent of `t` is not a free module, for the sphere `S^2` is not parallelizable:: diff --git a/src/sage/manifolds/differentiable/tensorfield_module.py b/src/sage/manifolds/differentiable/tensorfield_module.py index 3c3aa7d71f2..4bb33109c25 100644 --- a/src/sage/manifolds/differentiable/tensorfield_module.py +++ b/src/sage/manifolds/differentiable/tensorfield_module.py @@ -125,8 +125,8 @@ class TensorFieldModule(VectorFieldModule_abstract): `T^{(2,0)}(M)` is a module over the algebra `C^k(M)`:: sage: T20.category() - Category of modules over Algebra of differentiable scalar fields on the - 2-dimensional differentiable manifold M + Category of tensor products of modules over Algebra of differentiable scalar fields + on the 2-dimensional differentiable manifold M sage: T20.base_ring() is M.scalar_field_algebra() True @@ -237,7 +237,7 @@ class TensorFieldModule(VectorFieldModule_abstract): """ Element = TensorField - def __init__(self, vector_field_module, tensor_type): + def __init__(self, vector_field_module, tensor_type, category=None): r""" Construct a module of tensor fields taking values on a (a priori) not parallelizable differentiable manifold. @@ -289,7 +289,8 @@ def __init__(self, vector_field_module, tensor_type): # the member self._ring is created for efficiency (to avoid calls to # self.base_ring()): self._ring = domain.scalar_field_algebra() - Parent.__init__(self, base=self._ring, category=Modules(self._ring)) + category = Modules(self._ring).TensorProducts().or_subcategory(category) + Parent.__init__(self, base=self._ring, category=category) self._domain = domain self._dest_map = dest_map self._ambient_domain = vector_field_module._ambient_domain