sagemath / sage

Main repository of SageMath. Now open for Issues and Pull Requests.
https://www.sagemath.org
Other
1.08k stars 394 forks source link

`FreeModule`, `FiniteDimensionalModulesWithBasis` disagree on what 'left' and 'right' mean #37877

Open mkoeppe opened 2 weeks ago

mkoeppe commented 2 weeks ago

We have

class FiniteDimensionalModulesWithBasis(CategoryWithAxiom_over_base_ring):
...
    class MorphismMethods:
...
        def matrix(self, base_ring=None, side="left"):
            r"""
...
            INPUT:
...
            - ``side`` -- "left" or "right" (default: "left")

            If ``side`` is "left", this morphism is considered as
            acting on the left; i.e. each column of the matrix
            represents the image of an element of the basis of the
            domain.

.... but ....

class MatrixMorphism(MatrixMorphism_abstract):
...
    def __init__(self, parent, A, copy_matrix=True, side='left'):
...
    def matrix(self, side=None):
        r"""
        Return a matrix that defines this morphism.

        INPUT:

        - ``side`` -- (default: ``'None'``) the side of the matrix
          where a vector is placed to effect the morphism (function)

        OUTPUT:
...
        Internally, Sage represents a matrix morphism with the
        matrix multiplying a row vector placed to the left of the
        matrix.  If the option ``side='right'`` is used, then a
        matrix is returned that acts on a vector to the right of
        the matrix.