Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11555 closed enhancement (fixed)

Expand print representation of free module morphisms

Reported by: rbeezer Owned by: jason, was
Priority: minor Milestone: sage-4.8
Component: linear algebra Keywords: beginner
Cc: novoselt Merged in: sage-4.8.alpha1
Authors: Rob Beezer Reviewers: Julian Rueth
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by rbeezer)

Morphisms between free modules are basically represented by matrices. Here is how they sometimes print:

sage: V = ZZ^6
sage: W = ZZ^4
sage: m = matrix(QQ, [[1, 0, 0 ,0], [0]*4, [0]*4, [0]*4, [0]*4, [0]*4])
sage: phi = V.hom(m, W)
sage: rho = phi.restrict_codomain(W.span([W.0]))
sage: rho
Free module morphism defined by the matrix
(not printing 6 x 1 matrix)
Domain: Ambient free module of rank 6 over the principal ideal domain ...
Codomain: Free module of degree 4 and rank 1 over Integer Ring
Echelon ...

The cutoff (...) on the domains is totally arbitrary, at 60 characters.

Here is the new output with upcoming patch:

Free module morphism defined by the matrix
[1]
[0]
[0]
[0]
[0]
[0]
Domain: Ambient free module of rank 6 over the principal ideal domain Integer Ring
Codomain: Free module of degree 4 and rank 1 over Integer Ring
Echelon basis matrix:
[1 0 0 0]

Apply:

  1. trac_11555-free-module-morphism-printing.patch

Attachments (1)

trac_11555-free-module-morphism-printing.patch (4.4 KB) - added by rbeezer 10 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 10 years ago by rbeezer

  • Authors set to Rob Beezer
  • Description modified (diff)
  • Keywords beginner added
  • Status changed from new to needs_review

Passes all long tests for 4.7.1.alpha3

Small chance this will bitrot, relative to some other patches I have up for related files. I'll try to stay on top of it, but let me know if this causes doctests failures.

comment:2 Changed 10 years ago by novoselt

  • Cc novoselt added

comment:3 Changed 10 years ago by saraedum

  • Status changed from needs_review to positive_review

patch applies (with fuzz) to 4.7.2.alpha3 and all long tests pass.

comment:4 follow-up: Changed 10 years ago by saraedum

  • Reviewers set to Julian Rueth

comment:5 Changed 10 years ago by jdemeyer

  • Milestone changed from sage-4.7.2 to sage-4.7.3

comment:6 in reply to: ↑ 4 Changed 10 years ago by rbeezer

Replying to saraedum:

Julian,

Thanks for the review!

Rob

comment:7 Changed 10 years ago by jdemeyer

  • Merged in set to sage-4.7.3.alpha1
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:8 Changed 10 years ago by jdemeyer

  • Milestone sage-4.7.3 deleted

Milestone sage-4.7.3 deleted

comment:9 Changed 10 years ago by jdemeyer

  • Merged in changed from sage-4.7.3.alpha1 to sage-4.8.alpha1
  • Milestone set to sage-4.8
Note: See TracTickets for help on using tickets.