Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Category Modules should provide a parent method module_morphism compatible with ModulesWithBasis.module_morphism #30180

Closed
mkoeppe opened this issue Jul 20, 2020 · 12 comments

Comments

@mkoeppe
Copy link
Member

mkoeppe commented Jul 20, 2020

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.

CC: @tscrim @egourgoulhon @mjungmath

Component: linear algebra

Author: Matthias Koeppe

Branch/Commit: e2fc5d5

Reviewer: Eric Gourgoulhon

Issue created by migration from https://trac.sagemath.org/ticket/30180

@mkoeppe mkoeppe added this to the sage-9.2 milestone Jul 20, 2020
@mkoeppe
Copy link
Member Author

mkoeppe commented Jul 20, 2020

comment:1

Providing this method would allow us to simplify #30094 a tiny bit.

@mkoeppe
Copy link
Member Author

mkoeppe commented Jul 21, 2020

Author: Matthias Koeppe

@mkoeppe
Copy link
Member Author

mkoeppe commented Jul 21, 2020

New commits:

0afa01cModules: Add parent method module_morphism
3c8d080Fix docstring markup

@mkoeppe
Copy link
Member Author

mkoeppe commented Jul 21, 2020

Commit: 3c8d080

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 21, 2020

Changed commit from 3c8d080 to e2fc5d5

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 21, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

e2fc5d5Make sure that we only create a module morphism

@egourgoulhon
Copy link
Member

comment:5

LGTM, except maybe for some pyflakes error reported by the patchbot, which are not clear to me.

@egourgoulhon
Copy link
Member

Reviewer: Eric Gourgoulhon

@tscrim
Copy link
Collaborator

tscrim commented Jul 22, 2020

comment:6

You can ignore the pyflakes errors since they are unrelated to this ticket.

@mkoeppe
Copy link
Member Author

mkoeppe commented Jul 22, 2020

comment:7

Thanks!

@vbraun
Copy link
Member

vbraun commented Jul 28, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants