Revision history [back]

I would suggest to work on the polynomial ring with coefficient in the algebraic number field since you will have exact representations and your computations will be reliable:

sage: R.<x> = PolynomialRing(QQbar)
sage: R
Univariate Polynomial Ring in x over Algebraic Field

sage: a = QQbar(1)
sage: w = a.nth_root(3, all=True)[1]
sage: w.parent()
Algebraic Field

sage: L = 3
sage: A = (1+x)^L + 1
sage: B = (1+w*x)^L +1
sage: C = (1+w^2*x)^L +1

sage: A.parent()
Univariate Polynomial Ring in x over Algebraic Field


Apparently, those polynomials are coprime to eachother:

sage: gcd(A,gcd(B,C))
1


I would suggest to work on the polynomial ring with coefficient in the algebraic number field since you will have exact representations and your computations will be reliable:

sage: R.<x> = PolynomialRing(QQbar)
sage: R
Univariate Polynomial Ring in x over Algebraic Field

sage: a = QQbar(1)
sage: w = a.nth_root(3, all=True)[1]
sage: w.parent()
Algebraic Field

sage: L = 3
sage: A = (1+x)^L + 1
sage: B = (1+w*x)^L +1
sage: C = (1+w^2*x)^L +1

sage: A.parent()
Univariate Polynomial Ring in x over Algebraic Field


Apparently, those polynomials are coprime to eachother:

sage: gcd(A,gcd(B,C))
1


EDIT regarding the comment, if you want to work in the algebraic closure of the finite field with two elements, you can do:

sage: F = GF(2).algebraic_closure()
sage: R.<x> = PolynomialRing(F) ; R
Univariate Polynomial Ring in x over Algebraic closure of Finite Field of size 2
sage: P = x^3-1
sage: P.roots()
[(z2 + 1, 1), (z2, 1), (1, 1)]
sage: P.roots(multiplicities=False)
[z2 + 1, z2, 1]

sage: L = 3
sage: [(1+w*x)^L +1 for w in P.roots(multiplicities=False)]
sage: polys = [(1+w*x)^L +1 for w in P.roots(multiplicities=False)] ; polys
[x^3 + z2*x^2 + (z2 + 1)*x, x^3 + (z2 + 1)*x^2 + z2*x, x^3 + x^2 + x]
sage: reduce(gcd, polys)
x

sage: L = 2
sage: polys = [(1+w*x)^L +1 for w in P.roots(multiplicities=False)] ; polys
[z2*x^2, (z2 + 1)*x^2, x^2]
sage: reduce(gcd, polys)
x^2