On Nov 30, 2007, at 2:45 AM, Ahmad wrote:

>
> Dear Sage Supporters,
>
> As nobody continued to pay attention to the question I asked in sept 3
> about how I want to change the field basis "permanently", I am using
> john Cremona's idea to ask my question in another way, in hope to
> attract more attention:
>
> Suppose k is a field. Let define ring k[x]. I extend this ring by
> adding variable 't' and taking quotient by polynomial 't^4 + t^3 + t^2
> + t + 1'. So, I have the ring k[x][t]/(t^4 + t^3 + t^2 + t + 1) which
> is a free module over k[x]. But again sage use default basis (1, t,
> t^2, t^3) to represent this ring over k[x]:
>
> sage: k = GF(2);
> sage: R = k['x']; x = R.gen()
> sage: S = R['t']; t = S.gen()
> sage: SBar = S.quotient(t^4 + t^3 + t^2 + t + 1, 'a'); a = SBar.gen()
> sage: print x*a^4
> x*a^3 + x*a^2 + x*a + x
>
> How can I change this basis to normal basis, so I get:
>
> sage: print x*a^4
> x*a^4

Hi Ahmad,

I looked over the september thread, and the problem is that William's  
solution won't work in this more general case, since you can't create  
a polynomial ring with coefficients in a vector space, it just  
doesn't make sense.

But if all you need is a list of the coordinates, then maybe we can  
make this work. All you need to be able to do is apply a function to  
each coefficient of a polynomial. Here's how you do that:

sage: k = GF(7)   # any coefficient ring here is okay
sage: R.<x> = PolynomialRing(k)     # create polynomial ring over k  
in variable x
sage: g = x^3 + 2*x + 5    # create some polynomial
sage: g.list()             # list of coefficients of polynomial
[5, 2, 0, 1]
sage: [2*u for u in g.list()]   # multiplies every elements of g.list 
() by 2 (mod 7), returns result as a list
[3, 4, 0, 2]

So you just need to replace "2*u" with whatever function William gave  
you to change basis representation.

Of course, what you *really* want is to be able to create a field  
that prints elements of itself with respect to a different basis, but  
I don't think this is implemented in sage (yet). That sounds like it  
could be a useful thing to have.

david


--~--~---------~--~----~------------~-------~--~----~
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