Hi David,

Thank you very much for your solution. I think it is enough for me as
finally I want to see the result in normal basis. However, I changed
the code a little to suite my purpose but it failed. Could you please
tell me what should I use instead of "list" property in multivariate
case (maybe we need some ordering like grobner basis):

sage: k = GF(7)   # any coefficient ring here is okay
sage: R = MPolynomialRing(k,2,x)     # create polynomial ring over k
in variable x
sage: x = R.gens()
sage: g = x[0]^3 + 2*x[1] + 5    # create some polynomial
sage: print g.list()             # list of coefficients of polynomial
sage: [2*u for u in g.list()]   # multiplies every elements of
g.list() by 2 (mod 7), returns result as a list
Traceback (most recent call last):
...
AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular'
object has no attribute 'list'

I hope that you don't get the feeling that I just naging and
challenging you for nothing. It is almost exactly the computation I
need for my thesis as I'm working on GHS attack. I should look at a
curve when its parameters and variables is represented in base field
(so one equation become many equations) and then I should pass some
hyper-plane through it in its base field.

Thanx again.
Ahmad

On Nov 30, 8:20 am, David Harvey <[EMAIL PROTECTED]> wrote:
> 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