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

Commit

Permalink
src/sage/manifolds/differentiable/vectorfield_module.py (VectorFieldM…
Browse files Browse the repository at this point in the history
…odule_abstract): New
  • Loading branch information
mkoeppe committed Sep 27, 2022
1 parent ff00c11 commit 8d753dc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
8 changes: 2 additions & 6 deletions src/sage/manifolds/differentiable/diff_form_module.py
Expand Up @@ -47,10 +47,10 @@
from sage.manifolds.differentiable.diff_form import DiffForm, DiffFormParal
from sage.manifolds.differentiable.tensorfield import TensorField
from sage.manifolds.differentiable.tensorfield_paral import TensorFieldParal
from sage.manifolds.differentiable.vectorfield_module import VectorFieldModule
from sage.manifolds.differentiable.vectorfield_module import VectorFieldModule_abstract


class DiffFormModule(UniqueRepresentation, Parent):
class DiffFormModule(VectorFieldModule_abstract):
r"""
Module of differential forms of a given degree `p` (`p`-forms) along a
differentiable manifold `U` with values on a differentiable manifold `M`.
Expand Down Expand Up @@ -558,10 +558,6 @@ def tensor_type(self):
return (0, 1)
raise NotImplementedError

tensor_power = VectorFieldModule.tensor_power

tensor = tensor_product = VectorFieldModule.tensor_product

def degree(self):
r"""
Return the degree of the differential forms in ``self``.
Expand Down
8 changes: 2 additions & 6 deletions src/sage/manifolds/differentiable/tensorfield_module.py
Expand Up @@ -50,10 +50,10 @@
MultivectorFieldParal)
from sage.manifolds.differentiable.automorphismfield import (AutomorphismField,
AutomorphismFieldParal)
from sage.manifolds.differentiable.vectorfield_module import VectorFieldModule
from sage.manifolds.differentiable.vectorfield_module import VectorFieldModule_abstract


class TensorFieldModule(UniqueRepresentation, Parent):
class TensorFieldModule(VectorFieldModule_abstract):
r"""
Module of tensor fields of a given type `(k,l)` along a differentiable
manifold `U` with values on a differentiable manifold `M`, via a
Expand Down Expand Up @@ -563,10 +563,6 @@ def tensor_type(self):
"""
return self._tensor_type

tensor_power = VectorFieldModule.tensor_power

tensor = tensor_product = VectorFieldModule.tensor_product

@cached_method
def zero(self):
"""
Expand Down
23 changes: 17 additions & 6 deletions src/sage/manifolds/differentiable/vectorfield_module.py
Expand Up @@ -53,14 +53,29 @@
from sage.rings.integer import Integer
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.tensor.modules.finite_rank_free_module import FiniteRankFreeModule
from sage.tensor.modules.finite_rank_free_module import (
FiniteRankFreeModule_abstract,
FiniteRankFreeModule,
)

if TYPE_CHECKING:
from sage.manifolds.differentiable.diff_map import DiffMap
from sage.manifolds.differentiable.manifold import DifferentiableManifold


class VectorFieldModule(UniqueRepresentation, Parent):
class VectorFieldModule_abstract(UniqueRepresentation, Parent):
r"""
Abstract base class for modules of vector fields.
"""

tensor_power = FiniteRankFreeModule_abstract.tensor_power

tensor_product = FiniteRankFreeModule_abstract.tensor_product

tensor = FiniteRankFreeModule_abstract.tensor


class VectorFieldModule(VectorFieldModule_abstract):
r"""
Module of vector fields along a differentiable manifold `U`
with values on a differentiable manifold `M`, via a differentiable
Expand Down Expand Up @@ -848,10 +863,6 @@ def _tensor(self, tensor_type, name=None, latex_name=None, sym=None,
self, tensor_type, name=name, latex_name=latex_name,
sym=sym, antisym=antisym)

tensor_power = FiniteRankFreeModule.tensor_power

tensor_product = FiniteRankFreeModule.tensor_product

def tensor(self, *args, **kwds):
r"""
Construct a tensor field on the domain of ``self`` or a tensor product of ``self`` with other modules.
Expand Down

0 comments on commit 8d753dc

Please sign in to comment.