Opened 8 years ago

Closed 8 years ago

#17859 closed defect (fixed)

Use coercion instead of pushout in matrix actions

Reported by: Vincent Delecroix Owned by:
Priority: major Milestone: sage-6.6
Component: coercion Keywords:
Cc: Merged in:
Authors: Jeroen Demeyer Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 9da3db6 (Commits, GitHub, GitLab) Commit: 9da3db64750114e4c230a83e96e2ab6544c3e104
Dependencies: Stopgaps:

Status badges

Description (last modified by Vincent Delecroix)

There is no coercion between QQ and finite rings

sage: cm = get_coercion_model()
sage: cm.get_action(Zmod(2), QQ, operator.mul) is None
True

This is right.

But we do have an action of matrices on vectors

sage: M = MatrixSpace(Zmod(2),2)
sage: V = VectorSpace(QQ,2)
sage: cm.get_action(M,V,operator.mul)
Left action by
  Full MatrixSpace of 2 by 2 dense matrices over Ring of integers modulo 2 on
  Vector space of dimension 2 over Rational Field

or

sage: M = MatrixSpace(QQ,2)
sage: V = VectorSpace(Zmod(2),2)
sage: cm.get_action(M,V,operator.mul)
Left action by
  Full MatrixSpace of 2 by 2 dense matrices over Rational Field on
  Vector space of dimension 2 over Ring of integers modulo 2

And this is wrong!

see also: #12865

Change History (9)

comment:1 Changed 8 years ago by Vincent Delecroix

Description: modified (diff)

comment:2 Changed 8 years ago by Jeroen Demeyer

Summary: Wrong coercion between QQ and finite ringsRemove action of Z/nZ matrices on QQ vectors

comment:3 Changed 8 years ago by Jeroen Demeyer

Summary: Remove action of Z/nZ matrices on QQ vectorsUse coercion instead of pushout in matrix actions

comment:4 Changed 8 years ago by Jeroen Demeyer

Authors: Jeroen Demeyer

comment:5 Changed 8 years ago by Jeroen Demeyer

Branch: u/jdemeyer/use_coercion_instead_of_pushout_in_matrix_actions
Commit: 437c4e8e481084a2b6414ce2878e2ae12cb98160
Status: newneeds_review

New commits:

437c4e8Use coercion instead of pushout for matrix actions

comment:6 Changed 8 years ago by Travis Scrimshaw

Reviewers: Travis Scrimshaw

LGTM, but could you add a linebreak to the doctest you added? Thanks.

comment:7 Changed 8 years ago by git

Commit: 437c4e8e481084a2b6414ce2878e2ae12cb981609da3db64750114e4c230a83e96e2ab6544c3e104

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

9da3db6Add line breaks in long doctest

comment:8 Changed 8 years ago by Travis Scrimshaw

Status: needs_reviewpositive_review

comment:9 Changed 8 years ago by Volker Braun

Branch: u/jdemeyer/use_coercion_instead_of_pushout_in_matrix_actions9da3db64750114e4c230a83e96e2ab6544c3e104
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.