On Sep 29, 2008, at 10:51 AM, David Møller Hansen wrote:

>
> Thank you for you answer Justin and I should also apologize for my
> badly formulated question but you understood it correctly.
>
> I just can't get SAGE to eat the line you write f=x^2+x+F1(1), it
> complains with: TypeError: unsupported operand parent(s) for '+':
> 'Symbolic Ring' and 'Finite Field in a of size 2^7'

Any time you see 'Symbolic Ring', or something similar, in an error  
message, you have run afoul of some short-cuts built into sage to  
make things simple for those who are "new" to sage, or are just using  
it as a quick and dirty calculator.

The issue is that 'x' is predeclared as a symbolic calculus variable,  
and you want it to be an indeterminate for use in a polynomial ring.

My reply earlier finessed the problem by not mentioning that I  
actually had this between defining F1 and defining f:

sage: P1.<x>=PolynomialRing(F1)

When you do this, your polynomial will actually be an element in F1 
[x], and not some strange symbolic thing that doesn't play well with  
others :-}

In short, the correct way to do what I showed earlier is

sage: F1.<a> = GF(2^7)
sage: P1.<x>=PolynomialRing(F1)
sage: f=x^2+x+F1(1)
sage: F2=F1.extension(f,'u')
sage: F2
Univariate Quotient Polynomial Ring in u over Finite Field in a of
size 2^7 with modulus u^2 + u + 1
sage: a in F2
True

(which I just verified in a fresh run of sage 3.1.1).

Sorry for the confusion.

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Director
Institute for the Enhancement of the Director's Income
--------
Here lies Lester Moore
Two bullets from a .44
No less, no more
--------



--~--~---------~--~----~------------~-------~--~----~
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://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to