Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #30180: Category Modules should provide a parent method module_m…
…orphism compatible with ModulesWithBasis.module_morphism Because there is no distinguished basis, it would only support the option `function` of `ModulesWithBasis.module_morphism`: {{{ def module_morphism(self, on_basis=None, matrix=None, function=None, diagonal=None, triangular=None, unitriangular=False, **keywords): r""" Construct a module morphism from ``self`` to ``codomain``. Let ``self`` be a module `X` with a basis indexed by `I`. This constructs a morphism `f: X \to Y` by linearity from a map `I \to Y` which is to be its restriction to the basis `(x_i)_{i \in I}` of `X`. Some variants are possible too. INPUT: - ``self`` -- a parent `X` in ``ModulesWithBasis(R)`` with basis `x=(x_i)_{i\in I}`. Exactly one of the four following options must be specified in order to define the morphism: - ``on_basis`` -- a function `f` from `I` to `Y` - ``diagonal`` -- a function `d` from `I` to `R` *KEEP* - ``function`` -- a function `f` from `X` to `Y` - ``matrix`` -- a matrix of size `\dim Y \times \dim X` (if the keyword ``side`` is set to ``'left'``) or `\dim Y \times \dim X` (if this keyword is ``'right'``) Further options include: *KEEP* - ``codomain`` -- the codomain `Y` of the morphism (default: ``f.codomain()`` if it's defined; otherwise it must be specified) *KEEP* - ``category`` -- a category or ``None`` (default: `None``) - ``zero`` -- the zero of the codomain (default: ``codomain.zero()``); can be used (with care) to define affine maps. Only meaningful with ``on_basis``. - ``position`` -- a non-negative integer specifying which positional argument is used as the input of the function `f` (default: 0); this is currently only used with ``on_basis``. - ``triangular`` -- (default: ``None``) ``"upper"`` or ``"lower"`` or ``None``: * ``"upper"`` - if the :meth:`~ModulesWithBasis.ElementMethods.leading_support` of the image of the basis vector `x_i` is `i`, or * ``"lower"`` - if the :meth:`~ModulesWithBasis.ElementMethods.trailing_support` of the image of the basis vector `x_i` is `i`. - ``unitriangular`` -- (default: ``False``) a boolean. Only meaningful for a triangular morphism. As a shorthand, one may use ``unitriangular="lower"`` for ``triangular="lower", unitriangular=True``. - ``side`` -- "left" or "right" (default: "left") Only meaningful for a morphism built from a matrix. }}} URL: https://trac.sagemath.org/30180 Reported by: mkoeppe Ticket author(s): Matthias Koeppe Reviewer(s): Eric Gourgoulhon
- Loading branch information