homomorphisms between free modules over different rings

50 views
Skip to first unread message

Maarten Derickx

unread,
Jul 7, 2012, 10:52:26 AM7/7/12
to sage-...@googlegroups.com
Dear All,

Today I ran into some strange things concerning homomorphisms between free modules over different rings (QQ vs ZZ).
Please geuss which two of the following commands execute without error (using sage 5.0):
(ZZ^2).hom([[2,3],[3,6]],QQ^2)
(QQ^2).hom([[1/3,1/4],[1/3,1/6]],ZZ^2)
(ZZ^2).hom([[1/3,1/4],[1/3,1/6]],QQ^2)

Here are the answers:

sage: (ZZ^2).hom([[2,3],[3,6]],QQ^2) #ok
Free module morphism defined by the matrix
[2 3]
[3 6]
Domain: Ambient free module of rank 2 over the principal ideal domain Integer Ring
Codomain: Vector space of dimension 2 over Rational Field
sage: (QQ^2).hom([[1/3,1/4],[1/3,1/6]],ZZ^2) #should not be possible
Free module morphism defined by the matrix
[1/3 1/4]
[1/3 1/6]
Domain: Vector space of dimension 2 over Rational Field
Codomain: Ambient free module of rank 2 over the principal ideal domain Integer Ring
sage: (ZZ^2).hom([[1/3,1/4],[1/3,1/6]],QQ^2) #goes boom with an error you might have excpected in the previous example
Traceback (most recent call last):
...
TypeError: no conversion of this rational to integer

I wonder if anybody ran into similar things. And whether people are working on this. I tried to search trac but the most related ticket I could find is http://trac.sagemath.org/sage_trac/ticket/1947 which it about morphisms between vectorspaces over different fields.

Maarten Derickx

unread,
Jul 7, 2012, 11:02:40 AM7/7/12
to sage-...@googlegroups.com
And the following is even more worrying:

sage: (GF(7)^2).hom([[20,0],[0,21]],ZZ^2)
Free module morphism defined by the matrix
[6 0]
[0 0]
Domain: Vector space of dimension 2 over Finite Field of size 7
Codomain: Ambient free module of rank 2 over the principal ideal domain Integer Ring

Maarten Derickx

unread,
Aug 1, 2012, 9:09:20 AM8/1/12
to sage-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages