Opened 5 years ago

Closed 5 years ago

#17859 closed defect (fixed)

Use coercion instead of pushout in matrix actions

Reported by: vdelecroix 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) Commit: 9da3db64750114e4c230a83e96e2ab6544c3e104
Dependencies: Stopgaps:

Description (last modified by vdelecroix)

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 5 years ago by vdelecroix

  • Description modified (diff)

comment:2 Changed 5 years ago by jdemeyer

  • Summary changed from Wrong coercion between QQ and finite rings to Remove action of Z/nZ matrices on QQ vectors

comment:3 Changed 5 years ago by jdemeyer

  • Summary changed from Remove action of Z/nZ matrices on QQ vectors to Use coercion instead of pushout in matrix actions

comment:4 Changed 5 years ago by jdemeyer

  • Authors set to Jeroen Demeyer

comment:5 Changed 5 years ago by jdemeyer

  • Branch set to u/jdemeyer/use_coercion_instead_of_pushout_in_matrix_actions
  • Commit set to 437c4e8e481084a2b6414ce2878e2ae12cb98160
  • Status changed from new to needs_review

New commits:

437c4e8Use coercion instead of pushout for matrix actions

comment:6 Changed 5 years ago by tscrim

  • Reviewers set to Travis Scrimshaw

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

comment:7 Changed 5 years ago by git

  • Commit changed from 437c4e8e481084a2b6414ce2878e2ae12cb98160 to 9da3db64750114e4c230a83e96e2ab6544c3e104

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

9da3db6Add line breaks in long doctest

comment:8 Changed 5 years ago by tscrim

  • Status changed from needs_review to positive_review

comment:9 Changed 5 years ago by vbraun

  • Branch changed from u/jdemeyer/use_coercion_instead_of_pushout_in_matrix_actions to 9da3db64750114e4c230a83e96e2ab6544c3e104
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.