[sage-support] Re: quotient poly ring and field
TO W. Stein: Thanks. That was what I needed. SAGE is a great piece of software. I'm using it in some adv math and cryptography classes. TO J. Palmieri: Yes I know you can do that. But you get into minor annoyances (which you can code around) such as E.points(). On 5/4/09, William Stein wrote: > > > On Mon, May 4, 2009 at 1:07 PM, gtg wrote: > > > > Hi I'm new to sage. Can you tell me how to construct finite fields > > using quotient of poly ring? For instance suppose I want to construct > > GF(5^2) using a GF(5) poly ring mod out by x^2 + x + 1 how do I do > > that? I can construct the quotient like this: > > > > p = 5 > > F = GF(p) > > R. = F['x'] > > f = x * x + x + 1 > > S = R.quotient(f, 'a') > > > > How do I force S to a field so that I can use it with elliptic curves? > > I know that I can simply do GF(5^2) but I want to be able to specify > > the modulus explicitly. > > Use the modulus option to GF: > > sage: p = 5 > sage: F = GF(p) > sage: R. = F['x'] > sage: S. = GF(p^2,modulus=x^2+x+1) > sage: S > Finite Field in a of size 5^2 > sage: a^2 + a + 1 > 0 > > sage: GF? # get more help! > > > > --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: quotient poly ring and field
On Mon, May 4, 2009 at 1:07 PM, gtg wrote: > > Hi I'm new to sage. Can you tell me how to construct finite fields > using quotient of poly ring? For instance suppose I want to construct > GF(5^2) using a GF(5) poly ring mod out by x^2 + x + 1 how do I do > that? I can construct the quotient like this: > > p = 5 > F = GF(p) > R. = F['x'] > f = x * x + x + 1 > S = R.quotient(f, 'a') > > How do I force S to a field so that I can use it with elliptic curves? > I know that I can simply do GF(5^2) but I want to be able to specify > the modulus explicitly. Use the modulus option to GF: sage: p = 5 sage: F = GF(p) sage: R. = F['x'] sage: S. = GF(p^2,modulus=x^2+x+1) sage: S Finite Field in a of size 5^2 sage: a^2 + a + 1 0 sage: GF? # get more help! --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: quotient poly ring and field
On May 4, 1:07 pm, gtg wrote: > Hi I'm new to sage. Can you tell me how to construct finite fields > using quotient of poly ring? For instance suppose I want to construct > GF(5^2) using a GF(5) poly ring mod out by x^2 + x + 1 how do I do > that? I can construct the quotient like this: > > p = 5 > F = GF(p) > R. = F['x'] > f = x * x + x + 1 > S = R.quotient(f, 'a') > > How do I force S to a field so that I can use it with elliptic curves? Can't you just do it? sage: S.is_field() True sage: EllipticCurve(S, [2, 4]) Elliptic Curve defined by y^2 = x^3 + 2*x + 4 over Univariate Quotient Polynomial Ring in a over Finite Field of size 5 with modulus x^2 + x + 1 What exactly are you trying to do, and where are you having problems? --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---