[sage-support] Re: Constructing subsapces of vector spaces

2012-12-03 Thread John Cremona
Try mat.kernel_on(V). Also, if v is a vector in the ambient space which happens to lie in V then V.coordinates(v) will give its coordinates w.r.t. the basis of V. John Cremona On Monday, December 3, 2012 1:38:38 AM UTC, Andrew Mathas wrote: > > Hi All, > > I have been playing with some code

[sage-support] Re: Constructing subsapces of vector spaces

2012-12-03 Thread Andrew Mathas
Hi John, Thanks for the reply, but you have my problem "upside down" as I don't need to restrict from the ambient space to the subspace but rather to extend from the subspace to the ambient space. For example, I could have: sage: V Free module of degree 4 and rank 3 over Integer Ring User bas

[sage-support] Re: Constructing subsapces of vector spaces

2012-12-03 Thread Nils Bruin
On Monday, December 3, 2012 5:09:40 PM UTC-8, Andrew Mathas wrote: > > Hi John, > > Thanks for the reply, but you have my problem "upside down" as I don't > need to restrict from the ambient space to the subspace but rather to > extend from the subspace to the ambient space. > > For example, I

[sage-support] Re: Constructing subsapces of vector spaces

2012-12-04 Thread Andrew Mathas
Thanks Nils. I this is similar to, but more elegant than, what I tried earlier. I went back to the solution above, however, I thought that there was probably a lot of overhead in creating the space ZZ^3 and the homomorphism. Indeed, %timeit V.hom([(ZZ^3)(v) for v in [[1,2,3],[2,1,4],[3,3,7]]]).

[sage-support] Re: Constructing subsapces of vector spaces

2012-12-04 Thread Nils Bruin
On Tuesday, December 4, 2012 3:14:27 AM UTC-8, Andrew Mathas wrote: > > Thanks Nils. I this is similar to, but more elegant than, what I tried > earlier. I went back to the solution above, however, I thought that there > was probably a lot of overhead in creating the space ZZ^3 and the > homomo