On 9/4/07, David Joyner <[EMAIL PROTECTED]> wrote:
> > I have to define two functions below in order to
> > do this.  If people think something like this would be generally
> > useful, then it could be made "built in" to SAGE:
>
>
> I think it would be nice to have in_terms_of_normal_basis
> (of course you need to change "2" to "p" in general).
> However, I don't understand what to_V does that built-in
> coersion doesn't already do:
>
>
> sage: k.<a> = GF(2^5)
> sage: V = k.vector_space()
> sage: z = (1+a)^17; z
> a^3 + a + 1
> sage: V(z)
> (1, 1, 0, 1, 0)
>
>
> This seems to be the same output you gave for to_V(z),
> or am I missing something?

Hey, good point!

Just change to_V(z) to "V(z)" everywhere.  Here's a new worksheet:

ahmad -- sage-support
system:sage

{{{id=0|
k.<a> = GF(2^5)
}}}

{{{id=1|
k
///
Finite Field in a of size 2^5
}}}

{{{id=2|
V = k.vector_space()
}}}

{{{id=3|
z = (1+a)^17; z
///
a^3 + a + 1
}}}

{{{id=6|
B2 = [(a+1)^(2^i) for i in range(k.degree())]
}}}

{{{id=7|
W = [V(b) for b in B2]
}}}

{{{id=8|
V.span(W).dimension()
///
5
}}}

{{{id=9|
W0 = V.span_of_basis(W)
}}}

{{{id=10|
def in_terms_of_normal_basis(z):
   return W0.coordinates(z)
}}}

{{{id=11|
in_terms_of_normal_basis(a+1)
///
[1, 0, 0, 0, 0]
}}}

{{{id=12|
in_terms_of_normal_basis(1 + a + a^2 + a^3)
///
[1, 0, 0, 1, 0]
}}}

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to