sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.44k stars 480 forks source link

MatrixMorphism: add support for morphisms acting on the left #31737

Closed toadrush closed 3 years ago

toadrush commented 3 years ago

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 [ticket:25902] in which we build equivariant left-morphisms between G-lattices.

Depends on #31818

Component: linear algebra

Author: Thomas Rüd, David Roe

Branch/Commit: c4ebbea

Reviewer: David Roe, Thomas Rüd

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

toadrush commented 3 years ago

Description changed:

--- 
+++ 
@@ -1 +1,3 @@
+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 [ticket:25902] in which we build equivariant left-morphisms between G-lattices.
toadrush commented 3 years ago

Branch: u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

e3eb2f7fixed typos
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Commit: e3eb2f7

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from e3eb2f7 to ffd5b16

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

ffd5b16fixed typos
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from ffd5b16 to b779f07

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from b779f07 to d7e1666

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

d7e1666added sides to vector space morphisms
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from d7e1666 to f6071d1

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from f6071d1 to 4de01e3

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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
roed314 commented 3 years ago
comment:11

Setting to needs review for patchbot.

toadrush commented 3 years ago

Dependencies: #31818

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 4de01e3 to a6898b0

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from a6898b0 to 0548148

roed314 commented 3 years ago

Author: Thomas Rüd

roed314 commented 3 years ago

Reviewer: David Roe

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 0548148 to a19088c

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

a19088cfixed a test
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from a19088c to 4b66508

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

4b66508fixed typos
trevorkarn commented 3 years ago
comment:18

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?

toadrush commented 3 years ago
comment:19

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.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 4b66508 to 2f73c05

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

2f73c05fixed a typo
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

58315fffixed some documentation
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 2f73c05 to 58315ff

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 58315ff to b49d57c

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

b49d57cfixed more documentation
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from b49d57c to 550a375

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

550a375fixed a test in hom
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 550a375 to 2999315

mkoeppe commented 3 years ago
comment:25

Needs rebase

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 2999315 to cb41278

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

cb41278merged with develop
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

536aaffremoved the pushout in hom
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from cb41278 to 536aaff

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

c9fab37fixed the restrict method
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 536aaff to c9fab37

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

178bac9fixed typo
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from c9fab37 to 178bac9

roed314 commented 3 years ago

Changed branch from u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left to u/roed/matrixmorphism__add_support_for_morphisms_acting_on_the_left

toadrush commented 3 years ago

Changed branch from u/roed/matrixmorphism__add_support_for_morphisms_acting_on_the_left to u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left

roed314 commented 3 years ago

Changed branch from u/rud/matrixmorphism__add_support_for_morphisms_acting_on_the_left to u/roed/matrixmorphism__add_support_for_morphisms_acting_on_the_left