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

Commit

Permalink
Trac #29570: alternating_form returns correct element
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Jung committed Apr 24, 2020
1 parent 249fc90 commit 3b36f0d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
45 changes: 45 additions & 0 deletions src/sage/manifolds/differentiable/vectorfield_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -1762,6 +1762,51 @@ def exterior_power(self, p):
self._exterior_powers[p] = MultivectorFreeModule(self, p)
return self._exterior_powers[p]

def alternating_form(self, degree, name=None, latex_name=None):
r"""
Construct an alternating form on the free vector field module
``self``.
An alternating form on ``self`` is actually a differential form
along the differentiable manifold `U` over which ``self`` is
defined.
INPUT:
- ``degree`` -- the degree of the alternating form
(i.e. its tensor rank)
- ``name`` -- (string; optional) name given to the alternating
form
- ``latex_name`` -- (string; optional) LaTeX symbol to denote
the alternating form; if none is provided, the LaTeX symbol is
set to ``name``
OUTPUT:
- instance of
:class:`~sage.manifolds.differentiable.diff_form.DiffFormParal`
EXAMPLES::
sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart() # makes M parallelizable
sage: XM = M.vector_field_module()
sage: XM.alternating_form(2, name='a')
2-form a on the 2-dimensional differentiable manifold M
sage: XM.alternating_form(1, name='a')
1-form a on the 2-dimensional differentiable manifold M
.. SEEALSO::
:class:`~sage.manifolds.differentiable.diff_form.DiffFormParal`
for more examples and documentation.
"""
if degree == 0:
return self._domain.scalar_field(name=name, latex_name=latex_name)
return self.dual_exterior_power(degree).element_class(self,
degree, name=name, latex_name=latex_name)

def dual_exterior_power(self, p):
r"""
Return the `p`-th exterior power of the dual of ``self``.
Expand Down
4 changes: 3 additions & 1 deletion src/sage/tensor/modules/finite_rank_free_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ def dual_exterior_power(self, p):
See
:class:`~sage.tensor.modules.ext_pow_free_module.ExtPowerDualFreeModule`
for more documentation.
def dual_exterior_power
"""
from sage.tensor.modules.ext_pow_free_module import ExtPowerDualFreeModule
if p == 0:
Expand Down Expand Up @@ -1637,6 +1637,8 @@ def alternating_form(self, degree, name=None, latex_name=None):
for more documentation.
"""
if degree == 0:
return self._ring()
return self.dual_exterior_power(degree).element_class(self, degree,
name=name, latex_name=latex_name)

Expand Down

0 comments on commit 3b36f0d

Please sign in to comment.