Opened 16 months ago
Closed 11 months ago
#31737 closed enhancement (fixed)
MatrixMorphism: add support for morphisms acting on the left
Reported by:  rud  Owned by:  

Priority:  major  Milestone:  sage9.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: 
Description (last modified by )
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 leftmorphisms between Glattices.
Change History (37)
comment:1 Changed 16 months ago by
 Component changed from PLEASE CHANGE to group theory
 Type changed from PLEASE CHANGE to enhancement
comment:2 Changed 16 months ago by
 Description modified (diff)
comment:3 Changed 16 months ago by
 Component changed from group theory to linear algebra
comment:4 Changed 15 months ago by
 Branch set to u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left
comment:5 Changed 15 months ago by
 Commit set to e3eb2f75208338f3e8809835a90fd99dff6730b2
comment:6 Changed 15 months ago by
 Commit changed from e3eb2f75208338f3e8809835a90fd99dff6730b2 to ffd5b1626f4d53edc59e76a04c3fd666a41dda0a
Branch pushed to git repo; I updated commit sha1. New commits:
ffd5b16  fixed typos

comment:7 Changed 15 months ago by
 Commit changed from ffd5b1626f4d53edc59e76a04c3fd666a41dda0a to b779f076e4b426d5090f5be7f9f945b2f543b745
Branch pushed to git repo; I updated commit sha1. New commits:
b779f07  free module morphisms are in a working state, vector space morphisms need to be modified to handle base ring extensions

comment:8 Changed 15 months ago by
 Commit changed from b779f076e4b426d5090f5be7f9f945b2f543b745 to d7e16664605fc55764b39b496c8826e5c35e682f
Branch pushed to git repo; I updated commit sha1. New commits:
d7e1666  added sides to vector space morphisms

comment:9 Changed 15 months ago by
 Commit changed from d7e16664605fc55764b39b496c8826e5c35e682f to f6071d1e408fd98bc0eceada17bbcd6d0d0e0aec
Branch pushed to git repo; I updated commit sha1. New commits:
f6071d1  fixed hom when codomains are not provided, changed basis and _matrix_space to cached methods

comment:10 Changed 15 months ago by
 Commit changed from f6071d1e408fd98bc0eceada17bbcd6d0d0e0aec to 4de01e3c7002feff1de75e46d10f672bacc58d97
Branch pushed to git repo; I updated commit sha1. New commits:
4de01e3  added 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 15 months ago by
 Status changed from new to needs_review
Setting to needs review for patchbot.
comment:12 Changed 15 months ago by
 Dependencies set to #31818
comment:13 Changed 14 months ago by
 Commit changed from 4de01e3c7002feff1de75e46d10f672bacc58d97 to a6898b00f7698940455163f45a68c0da0ba2cfd3
Branch pushed to git repo; I updated commit sha1. New commits:
443cf6a  first commit, added a pushout, now the example in the description works as intended

a209a54  commented the change

9a66ea5  changed the pushout to an error

67fb789  switched the fix to free modules homspaces

25c62c1  fixed bugs

4d9fd9a  changed the error type

8f17598  added a test for the fix

a6898b0  merged with t/31818

comment:14 Changed 14 months ago by
 Commit changed from a6898b00f7698940455163f45a68c0da0ba2cfd3 to 0548148b5680711abdfdaba37e35352e1bb7e0b1
Branch pushed to git repo; I updated commit sha1. New commits:
fa796d1  fixed a typo

15807ec  Merge 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

dd528ed  completed a test

da7a09b  Merge 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

0548148  changed the pushout to hom

comment:15 Changed 14 months ago by
 Reviewers set to David Roe
comment:16 Changed 14 months ago by
 Commit changed from 0548148b5680711abdfdaba37e35352e1bb7e0b1 to a19088c988ff3f3f807a665e3db440d842ff7cb3
Branch pushed to git repo; I updated commit sha1. New commits:
a19088c  fixed a test

comment:17 Changed 14 months ago by
 Commit changed from a19088c988ff3f3f807a665e3db440d842ff7cb3 to 4b66508e6dbe9a896d2dbb82c95374e89f54dafc
Branch pushed to git repo; I updated commit sha1. New commits:
4b66508  fixed typos

comment:18 Changed 14 months ago by
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?
comment:19 Changed 14 months ago by
Hi, it is indeed a little confusing. The "mathematical default" is indeed side='right'
, which corresponds to leftmultiplication. 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 14 months ago by
 Commit changed from 4b66508e6dbe9a896d2dbb82c95374e89f54dafc to 2f73c05ff275480d41c7a699accac906eb0af6d3
Branch pushed to git repo; I updated commit sha1. New commits:
2f73c05  fixed a typo

comment:21 Changed 14 months ago by
 Commit changed from 2f73c05ff275480d41c7a699accac906eb0af6d3 to 58315ffd2124aa2e09d66823377195e9b9f4c1a5
Branch pushed to git repo; I updated commit sha1. New commits:
58315ff  fixed some documentation

comment:22 Changed 14 months ago by
 Commit changed from 58315ffd2124aa2e09d66823377195e9b9f4c1a5 to b49d57c98ffcd51a2f0fa20360944798d9659ce7
Branch pushed to git repo; I updated commit sha1. New commits:
b49d57c  fixed more documentation

comment:23 Changed 14 months ago by
 Commit changed from b49d57c98ffcd51a2f0fa20360944798d9659ce7 to 550a3755cb9bd643a67b95c093d13cdefee14c68
Branch pushed to git repo; I updated commit sha1. New commits:
550a375  fixed a test in hom

comment:24 Changed 13 months ago by
 Commit changed from 550a3755cb9bd643a67b95c093d13cdefee14c68 to 299931508fadd7fede9dcbb346a68178e8f97440
Branch pushed to git repo; I updated commit sha1. New commits:
2999315  fixed some bugs by adding side arguments to hecke morphisms, and morphisms of abelian varieties

comment:26 Changed 13 months ago by
 Commit changed from 299931508fadd7fede9dcbb346a68178e8f97440 to cb41278de6c36b0c55172619871a8ce09e4411b1
Branch pushed to git repo; I updated commit sha1. New commits:
cb41278  merged with develop

comment:27 Changed 13 months ago by
 Status changed from needs_work to needs_review
comment:28 Changed 13 months ago by
 Commit changed from cb41278de6c36b0c55172619871a8ce09e4411b1 to 536aaff588e48418391db06f633b9f3adaf831f8
Branch pushed to git repo; I updated commit sha1. New commits:
536aaff  removed the pushout in hom

comment:29 Changed 13 months ago by
 Commit changed from 536aaff588e48418391db06f633b9f3adaf831f8 to c9fab37b158207eaec28dbf71533421c751dff5a
Branch pushed to git repo; I updated commit sha1. New commits:
c9fab37  fixed the restrict method

comment:30 Changed 13 months ago by
 Commit changed from c9fab37b158207eaec28dbf71533421c751dff5a to 178bac9eeaf22f48ddae267d9d24bf43afc394cf
Branch pushed to git repo; I updated commit sha1. New commits:
178bac9  fixed typo

comment:31 Changed 13 months ago by
 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 13 months ago by
 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 13 months ago by
 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 12 months ago by
 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:
37f25b3  Merge branch 'u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left' of git://trac.sagemath.org/sage into t/31737/matrix_morphism

0acd41a  Merge branch 'u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left' of git://trac.sagemath.org/sage into t/31737/matrix_morphism

b1aad89  Merge branch 'u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left' of git://trac.sagemath.org/sage into t/31737/matrix_morphism

9d62ddf  Fix some doctest failures, remove trailing whitespace, add pushout back in

3fb6c65  fixed blocks

c4ebbea  Merge 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 12 months ago by
 Milestone changed from sage9.4 to sage9.5
comment:36 Changed 12 months ago by
The build error doesn't seem to be from the changes in this ticket.
comment:37 Changed 11 months ago by
 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
Branch pushed to git repo; I updated commit sha1. New commits:
fixed typos