How to convert a powerseries to a vector

30 views
Skip to first unread message

Zhibin Liang

unread,
Oct 4, 2012, 8:51:06 AM10/4/12
to Sage-nt
Dear all,

F.<T>=PowerSeriesRing(ZZ)
f=(1+T^3).O(4)
f.coefficients()

Then it turns out : [0,1]

But I really want [1,0,0,1]

How to realize this?



--

Very best wishes
Zhibin Liang






Building 104 Room 103
Nanhudongyuanyiqu
Wangjing, Chaoyang District
Beijing China,
100102

John Cremona

unread,
Oct 4, 2012, 9:02:20 AM10/4/12
to sag...@googlegroups.com
On 4 October 2012 13:51, Zhibin Liang <lian...@gmail.com> wrote:
> Dear all,
>
> F.<T>=PowerSeriesRing(ZZ)
> f=(1+T^3).O(4)
> f.coefficients()
>
> Then it turns out : [0,1]
>
> But I really want [1,0,0,1]
>
> How to realize this?
>

sage: list(f)
[1, 0, 0, 1]

list() will use the iterator function which in turn uses the
subscripting operator:

sage: f[0], f[1], f[2], f[3]
(1, 0, 0, 1)

John

>
>
> --
>
> Very best wishes
> Zhibin Liang
>
>
>
>
>
>
> Building 104 Room 103
> Nanhudongyuanyiqu
> Wangjing, Chaoyang District
> Beijing China,
> 100102
>
> --
> You received this message because you are subscribed to the Google Groups "sage-nt" group.
> To post to this group, send an email to sag...@googlegroups.com.
> To unsubscribe from this group, send email to sage-nt+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sage-nt?hl=en-GB.
>
Reply all
Reply to author
Forward
0 new messages