Opened 8 months ago

Closed 3 months ago

#31737 closed enhancement (fixed)

MatrixMorphism: add support for morphisms acting on the left

Reported by: rud Owned by:
Priority: major Milestone: sage-9.5
Component: linear algebra Keywords:
Cc: Merged in:
Authors: Thomas Rüd, David Roe Reviewers: David Roe, Thomas Rüd
Report Upstream: N/A Work issues:
Branch: c4ebbea (Commits, GitHub, GitLab) Commit: c4ebbea1816b90b904e540eb1a2979a91f324a94
Dependencies: #31818 Stopgaps:

Status badges

Description (last modified by rud)

Morphisms between free modules over PIDs are always represented by matrices acting on the right.

The goal of this ticket is to modify matrix morphisms (sage/modules/matrix_morphism.py) by adding an optional keyword for left actions. This will have applications Ticket 25902 in which we build equivariant left-morphisms between G-lattices.

Change History (37)

comment:1 Changed 8 months ago by rud

  • Component changed from PLEASE CHANGE to group theory
  • Type changed from PLEASE CHANGE to enhancement

comment:2 Changed 8 months ago by rud

  • Description modified (diff)

comment:3 Changed 7 months ago by roed

  • Component changed from group theory to linear algebra

comment:4 Changed 7 months ago by rud

  • Branch set to u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left

comment:5 Changed 7 months ago by git

  • Commit set to e3eb2f75208338f3e8809835a90fd99dff6730b2

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

e3eb2f7fixed typos

comment:6 Changed 7 months ago by git

  • Commit changed from e3eb2f75208338f3e8809835a90fd99dff6730b2 to ffd5b1626f4d53edc59e76a04c3fd666a41dda0a

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

ffd5b16fixed typos

comment:7 Changed 7 months ago by git

  • Commit changed from ffd5b1626f4d53edc59e76a04c3fd666a41dda0a to b779f076e4b426d5090f5be7f9f945b2f543b745

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

b779f07free module morphisms are in a working state, vector space morphisms need to be modified to handle base ring extensions

comment:8 Changed 7 months ago by git

  • Commit changed from b779f076e4b426d5090f5be7f9f945b2f543b745 to d7e16664605fc55764b39b496c8826e5c35e682f

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

d7e1666added sides to vector space morphisms

comment:9 Changed 7 months ago by git

  • Commit changed from d7e16664605fc55764b39b496c8826e5c35e682f to f6071d1e408fd98bc0eceada17bbcd6d0d0e0aec

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

f6071d1fixed hom when codomains are not provided, changed basis and _matrix_space to cached methods

comment:10 Changed 7 months ago by git

  • Commit changed from f6071d1e408fd98bc0eceada17bbcd6d0d0e0aec to 4de01e3c7002feff1de75e46d10f672bacc58d97

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

4de01e3added a method to switch sides, finished adapting methods, fixed a bug in hom where it could guess the wrong base ring if no codomain is specified, added tests

comment:11 Changed 7 months ago by roed

  • Status changed from new to needs_review

Setting to needs review for patchbot.

comment:12 Changed 7 months ago by rud

  • Dependencies set to #31818

comment:13 Changed 6 months ago by git

  • Commit changed from 4de01e3c7002feff1de75e46d10f672bacc58d97 to a6898b00f7698940455163f45a68c0da0ba2cfd3

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

443cf6afirst commit, added a pushout, now the example in the description works as intended
a209a54commented the change
9a66ea5changed the pushout to an error
67fb789switched the fix to free modules homspaces
25c62c1fixed bugs
4d9fd9achanged the error type
8f17598added a test for the fix
a6898b0merged with t/31818

comment:14 Changed 6 months ago by git

  • Commit changed from a6898b00f7698940455163f45a68c0da0ba2cfd3 to 0548148b5680711abdfdaba37e35352e1bb7e0b1

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

fa796d1fixed a typo
15807ecMerge branch 'u/rud/creating_a_module_homomorphism_with_a_matrix_may_build_the_wrong_codomain' of git://trac.sagemath.org/sage into t/31737/matrixmorphism__add_support_for_morphisms_acting_on_the_left
dd528edcompleted a test
da7a09bMerge branch 'u/rud/creating_a_module_homomorphism_with_a_matrix_may_build_the_wrong_codomain' of git://trac.sagemath.org/sage into t/31737/matrixmorphism__add_support_for_morphisms_acting_on_the_left
0548148changed the pushout to hom

comment:15 Changed 6 months ago by roed

  • Authors set to Thomas Rüd
  • Reviewers set to David Roe

comment:16 Changed 6 months ago by git

  • Commit changed from 0548148b5680711abdfdaba37e35352e1bb7e0b1 to a19088c988ff3f3f807a665e3db440d842ff7cb3

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

a19088cfixed a test

comment:17 Changed 6 months ago by git

  • Commit changed from a19088c988ff3f3f807a665e3db440d842ff7cb3 to 4b66508e6dbe9a896d2dbb82c95374e89f54dafc

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

4b66508fixed typos

comment:18 Changed 6 months ago by tkarn

Thanks for this! I'm a bit confused by the default side argument on line 72. I see that it defaults to side='left', but based on the description, it seems like side='right' might be "mathematical default." Does this make sense or am I missing something?

Last edited 6 months ago by tkarn (previous) (diff)

comment:19 Changed 6 months ago by rud

Hi, it is indeed a little confusing. The "mathematical default" is indeed side='right', which corresponds to left-multiplication. The reason being that sage's side is the side of the vector relative to the matrix, whereas in mathematics we almost always refer to the side of the matrix relative to the vector.

The side argument already existed in the MatrixMorphism.matrix method, with this choice of left/right. The methods left_kernel/right_kernel, left_eigenspaces/right_eigenspaces also work with that convention.

Now the small problem that remains is that the default is side="left", but the way some methods are coded are done the other way and taking the transpose. For instance, matrix.kernel takes the transpose and calls the right_kernel method, which feels a little off. After this ticket, methods of MatrixMorphism? will call the appropriate one.

I realise this text might sound confusing, that's because it is somewhat confusing.

comment:20 Changed 6 months ago by git

  • Commit changed from 4b66508e6dbe9a896d2dbb82c95374e89f54dafc to 2f73c05ff275480d41c7a699accac906eb0af6d3

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

2f73c05fixed a typo

comment:21 Changed 6 months ago by git

  • Commit changed from 2f73c05ff275480d41c7a699accac906eb0af6d3 to 58315ffd2124aa2e09d66823377195e9b9f4c1a5

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

58315fffixed some documentation

comment:22 Changed 6 months ago by git

  • Commit changed from 58315ffd2124aa2e09d66823377195e9b9f4c1a5 to b49d57c98ffcd51a2f0fa20360944798d9659ce7

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

b49d57cfixed more documentation

comment:23 Changed 6 months ago by git

  • Commit changed from b49d57c98ffcd51a2f0fa20360944798d9659ce7 to 550a3755cb9bd643a67b95c093d13cdefee14c68

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

550a375fixed a test in hom

comment:24 Changed 5 months ago by git

  • Commit changed from 550a3755cb9bd643a67b95c093d13cdefee14c68 to 299931508fadd7fede9dcbb346a68178e8f97440

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

2999315fixed some bugs by adding side arguments to hecke morphisms, and morphisms of abelian varieties

comment:25 Changed 5 months ago by mkoeppe

  • Status changed from needs_review to needs_work

Needs rebase

comment:26 Changed 5 months ago by git

  • Commit changed from 299931508fadd7fede9dcbb346a68178e8f97440 to cb41278de6c36b0c55172619871a8ce09e4411b1

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

cb41278merged with develop

comment:27 Changed 5 months ago by rud

  • Status changed from needs_work to needs_review

comment:28 Changed 5 months ago by git

  • Commit changed from cb41278de6c36b0c55172619871a8ce09e4411b1 to 536aaff588e48418391db06f633b9f3adaf831f8

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

536aaffremoved the pushout in hom

comment:29 Changed 5 months ago by git

  • Commit changed from 536aaff588e48418391db06f633b9f3adaf831f8 to c9fab37b158207eaec28dbf71533421c751dff5a

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

c9fab37fixed the restrict method

comment:30 Changed 5 months ago by git

  • Commit changed from c9fab37b158207eaec28dbf71533421c751dff5a to 178bac9eeaf22f48ddae267d9d24bf43afc394cf

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

178bac9fixed typo

comment:31 Changed 5 months ago by roed

  • Branch changed from u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left to u/roed/matrixmorphism__add_support_for_morphisms_acting_on_the_left

comment:32 Changed 5 months ago by rud

  • Branch changed from u/roed/matrixmorphism__add_support_for_morphisms_acting_on_the_left to u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left

comment:33 Changed 5 months ago by roed

  • Branch changed from u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left to u/roed/matrixmorphism__add_support_for_morphisms_acting_on_the_left

comment:34 Changed 4 months ago by roed

  • Authors changed from Thomas Rüd to Thomas Rüd, David Roe
  • Commit changed from 178bac9eeaf22f48ddae267d9d24bf43afc394cf to c4ebbea1816b90b904e540eb1a2979a91f324a94
  • Reviewers changed from David Roe to David Roe, Thomas Rüd
  • Status changed from needs_review to positive_review

New commits:

37f25b3Merge branch 'u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left' of git://trac.sagemath.org/sage into t/31737/matrix_morphism
0acd41aMerge branch 'u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left' of git://trac.sagemath.org/sage into t/31737/matrix_morphism
b1aad89Merge branch 'u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left' of git://trac.sagemath.org/sage into t/31737/matrix_morphism
9d62ddfFix some doctest failures, remove trailing whitespace, add pushout back in
3fb6c65fixed blocks
c4ebbeaMerge branch 'u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left' of git://trac.sagemath.org/sage into t/31737/matrix_morphism

comment:35 Changed 4 months ago by mkoeppe

  • Milestone changed from sage-9.4 to sage-9.5

comment:36 Changed 4 months ago by roed

The build error doesn't seem to be from the changes in this ticket.

comment:37 Changed 3 months ago by vbraun

  • Branch changed from u/roed/matrixmorphism__add_support_for_morphisms_acting_on_the_left to c4ebbea1816b90b904e540eb1a2979a91f324a94
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.