ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 23 Jan 2019 15:12:45 +0100Declaring symbols in a Fieldhttps://ask.sagemath.org/question/45146/declaring-symbols-in-a-field/Lets define a field F.<t> = GF(2^n)
now i want to define a variable points of the form x1+x2*t+...+xn*t^(n-1) and then solving equation with this by comparing coefficients of t^i.
Now I am defining R= PolynomialRing(ZZ,'x',n)
c=R.gens()
R=R.quotient_ring([c[i]^2-c[i] for i in range(0,n)])
then i get n variables but if
I write x= sum(c[i]*t^i for i in (0,n)) I get the parent of x is R. and I am unable to collect the coefficients of t^i. after defining y and z in the same way. if I do X=x+y+z then I am getting the value as a Ring element with monomials in xi's and coefficients in F as X in a Ring element.
Can anyone suggest any way to get the results as f1+f2*t+f3*t^2+...+fn*t^(n-1) and then collect fi's where fi's are functions in the variables xi's.
suppose I want to solve for X,Y in GF(2^3) with X^2Y^2= X^2+(1+t)Y^2
sage: F.<t>=GF(2^3)
sage: R.<a1,a2,b1,b2,c1,c2>= PolynomialRing(ZZ)
sage: R.<a1,a2,b1,b2,c1,c2>= R.quotient_ring([a1^2-a1,a2^2-a2,b1^2-b1,b2^2-b2,c1^2-c1,c2^2-c2])
sage: X=R(a1)+R(b1)t+R(c1)t^2
sage: Y=R(a2)+R(b2)t+R(c2)t^2
sage: X^2*Y^2
Now i want to store this output as A+Bt+Ct^2(how to do this? )
then I do:
sage: X^2+(1+t)*Y^2
and I want to store this as E+Ft+Gt^2(is it possible to do?)
finally I want to solve for ai's and bi's from the eqns A=E, B=F,C=G,ai^2=ai,bi^2=bi,ci^2=ci for i=1,2BishwajitCWed, 23 Jan 2019 15:12:45 +0100https://ask.sagemath.org/question/45146/Reduction In Quotient Rings (x^2 - x = 0)https://ask.sagemath.org/question/44514/reduction-in-quotient-rings-x2-x-0/Hi,
Thank you for taking the time to read this, it is very much appreciated.
My question concerns how to ensure that a polynomial within a quotient ring has the following property:
(x^2)k = 0
whereby x is any variable in the quotient ring and k is a positive integer.
This is the way I tried to go about the situation: I created a polynomial ring
P.<x,y,z,w> = PolynomialRing(GF(2), 4, order = 'degrevlex')
Since I am not working within a quotient ring, x^2 (or any of the other three variables) does not 'become' 0. Since I would like the property of x^2 = 0, I decided to create a quotient ring with some field equations:
Q = P.quotient_ring(ideal([var**q - var for var in P.gens()]))
whereby `q = P.base_ring.order()` .
However, when I then created the following polynomial, its parent was still P, so I changed its ring:
f1 = y*z + y*w + w^2
f1 = f1.change_ring(Q)
However, when I print f1, it, w^2 is still w^2 and has not reduced down to 0. I was wondering if I am missing something, please? This gets annoying because I am going to be working with Macaulay Matrices and hence, it is essential that I work within a quotient ring. Maybe I am missing some mathematics since this is all very new to me...
This is my sage input:
sage: P.<x,y,z,w> = PolynomialRing(GF(2), 4, order = 'degrevlex')
sage: q = P.base_ring().order()
sage: Q = P.quotient_ring(ideal([var**q - var for var in P.gens()]))
sage: f1 = y*z + y*w + w^2
sage: f1
y*z + y*w + w^2
sage: f1 = f1.change_ring(Q)
sage: f1
y*z + y*w + w^2
How would go about to ensure that w^2 = 0? I've already tried adding the original polynomial to the field equations when creating the quotient ring and changing its ring afterwards, like so:
sage: P.<x,y,z,w> = PolynomialRing(GF(2), 4, order = 'degrevlex')
sage: q = P.base_ring().order()
sage: f1 = y*z + y*w + w^2
sage: Q = P.quotient_ring(ideal([f1] + [var**q - var for var in P.gens()]))
sage: f1 = f1.change_ring(Q)
sage: f1
y*z + y*w + w^2
But as you can see, nothing happened...
Thank you!JoaoDDuarteFri, 30 Nov 2018 02:06:30 +0100https://ask.sagemath.org/question/44514/Quadratic extension field of a finite fieldhttps://ask.sagemath.org/question/40568/quadratic-extension-field-of-a-finite-field/ I want to create a quadratic extension of a finite field via `x^2 + 1`, and for that purpose I have the following Sage code:
proof.arithmetic(False)
# Parameters
f = 1
lA = 2
lB = 3
eA = 372
eB = 239
# Define the prime p
p = f*lA**eA*lB**eB-1
assert p.is_prime()
# Prime field of order p
Fp = GF(p)
# The quadratic extension via x^2 + 1 since p = 3 mod 4
Fp2.<i> = Fp.extension(x^2+1)
Though, the above code throws a rather cryptic error `UnboundLocalError: local variable 'E' referenced before assignment`. Any ideas how to solve the problem and create a quadratic extension field.ninhoThu, 11 Jan 2018 16:22:01 +0100https://ask.sagemath.org/question/40568/field extension not implementedhttps://ask.sagemath.org/question/37467/field-extension-not-implemented/I'm trying to construct some field extenstions of GF(p), this is what I have
p=5
F=GF(p)
R1.<x> = F['x']
F1.<alpha1> = F.extension(x^p - x - 1)
R2.<x> = F1['x']
F2.<alpha2> = F1.extension(x^p - x - alpha1^(p-1))
R3.<x> = F2['x']
F3.<alpha3> = F2.extension(x^p - x - (alpha1*alpha2)^(p-1))
R4.<x> = F3['x']
F4.<alpha4> = F3.extension(x^p - x - (alpha1*alpha2*alpha3)^(p-1))
It creates F3 like it should but it doesn't create F4. I get a NotImplementedError... What did I do wrong?gelatine1Sat, 29 Apr 2017 19:39:32 +0200https://ask.sagemath.org/question/37467/