Open craigcitro opened 16 years ago
Craig, since homomorphisms between vector spaces are implemented (as I explained to you in irc last week), could you change the title of this trac ticket and explain what you are actually proposing be implemented? Thanks.
sage: V = QQ^3; W = QQ^2
sage: H = V.Hom(W)
sage: H([1..6])
Free module morphism defined by the matrix
[1 2]
[3 4]
[5 6]
Domain: Vector space of dimension 3 over Rational Field
Codomain: Vector space of dimension 2 over Rational Field
Note that my first title for this ticket was ridiculous -- Sage has homomorphisms between vector spaces. The issue is to have homomorphisms over vector spaces V --> W when V and W are over different fields, but one has a map from the base field of V to the base field of W.
Works now, but may be worth a few tests:
sage: Hom(QQ^3, RR^2)([[1,2],[3,4],[5,6]])
Vector space morphism represented by the matrix:
[1 2]
[3 4]
[5 6]
Domain: Vector space of dimension 3 over Rational Field
Codomain: Vector space of dimension 2 over Real Field with 53 bits of precision
Where should such documentation and tests go?
Branch: u/gh-black-stones/1947
Commit: 81d3a4f
Branch pushed to git repo; I updated commit sha1. New commits:
81d3a4f | Added documentation and tests |
Author: Alex Sun
Replying to @mezzarobba:
Works now, but may be worth a few tests:
sage: Hom(QQ^3, RR^2)([[1,2],[3,4],[5,6]]) Vector space morphism represented by the matrix: [1 2] [3 4] [5 6] Domain: Vector space of dimension 3 over Rational Field Codomain: Vector space of dimension 2 over Real Field with 53 bits of precision
I took this example and turned it into two doctests. Nothing new was added, just wanted to close this decade-old ticket.
It seems odd that the following also works. Is there a reason that this is not prevented?
sage: f = Hom(RR^2, QQ^2)([[1,2],[3,4]]); f
Vector space morphism represented by the matrix:
[1 2]
[3 4]
Domain: Vector space of dimension 2 over Real Field with 53 bits of precision
Codomain: Vector space of dimension 2 over Rational Field
sage: f(vector(RR, [1,2]))
(7, 10)
Moving tickets from the Sage 8.8 milestone that have been actively worked on in the last six months to the next release milestone (optimistically).
Ticket retargeted after milestone closed
Please:
Reviewer: Vincent Delecroix
Batch modifying tickets that will likely not be ready for 9.1, based on a review of the ticket title, branch/review status, and last modification date.
Setting new milestone based on a cursory review of ticket status, priority, and last modification date.
Setting a new milestone for this ticket based on a cursory review.
It's surprising that this isn't already done -- it should be easy, since the morphisms don't have to do too much, and one already has the more complicated ring homomorphism code to use as a guide. I'll do this at SD7, if no one beats me to it.
CC: @mezzarobba @slel @jplab
Component: linear algebra
Author: Alex Sun
Branch/Commit: u/gh-black-stones/1947 @
81d3a4f
Reviewer: Vincent Delecroix
Issue created by migration from https://trac.sagemath.org/ticket/1947