On Thursday, June 4, 2015 at 2:53:50 PM UTC-7, Phoenix wrote:
>
>
> Thanks!
>
> Is there otherwise any standard operation in SAGE to create such vectors?
>
>
sage: def elem(i,n):
....: return VectorSpace( QQ, n ).basis()[i]
....:
sage: elem( 1, 5 )
(0, 1, 0, 0, 0)
or if you need it to return a list rather than a tuple:
sage: def elem(i,n):
return list( VectorSpace( QQ, n ).basis()[i] )
....:
sage: elem( 1, 5 )
[0, 1, 0, 0, 0]
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.