103 KiB
103 KiB
def basis_holomorphic_differentials_degree(f, m, p):
r = f.degree()
delta = GCD(r, m)
Rx.<x> = PolynomialRing(GF(p))
Rxy.<x, y> = PolynomialRing(GF(p), 2)
Fxy = FractionField(Rxy)
#########basis of holomorphic differentials and de Rham
basis_holo = []
degrees0 = {}
k = 0
for j in range(1, m):
for i in range(1, r):
if (r*j - m*i >= delta):
basis_holo += [Fxy(x^(i-1)/y^j)]
degrees0[k] = (i-1, j)
k = k+1
return(basis_holo, degrees0)
def holomorphic_differentials_basis(f, m, p):
basis_holo, degrees0 = basis_holomorphic_differentials_degree(f, m, p)
return basis_holo
def degrees_holomorphic_differentials(f, m, p):
basis_holo, degrees0 = basis_holomorphic_differentials_degree(f, m, p)
return degrees0
def basis_de_rham_degrees(f, m, p):
r = f.degree()
delta = GCD(r, m)
Rx.<x> = PolynomialRing(GF(p))
Rxy.<x, y> = PolynomialRing(GF(p), 2)
Fxy = FractionField(Rxy)
basis_holo = holomorphic_differentials_basis(f, m, p)
basis = []
for k in range(0, len(basis_holo)):
basis += [(basis_holo[k], Rx(0))]
## non-holomorphic elts of H^1_dR
t = len(basis)
degrees0 = {}
degrees1 = {}
for j in range(1, m):
for i in range(1, r):
if (r*(m-j) - m*i >= delta):
s = Rx(m-j)*Rx(x)*Rx(f.derivative()) - Rx(m)*Rx(i)*f
psi = Rx(cut(s, i))
basis += [(Fxy(psi/y^j), Fxy(m*y^(m-j)/x^i))]
degrees0[t] = (psi.degree(), j)
degrees1[t] = (-i, m-j)
t += 1
return basis, degrees0, degrees1
def de_rham_basis(f, m, p):
basis, degrees0, degrees1 = basis_de_rham_degrees(f, m, p)
return basis
def degrees_de_rham0(f, m, p):
basis, degrees0, degrees1 = basis_de_rham_degrees(f, m, p)
return degrees0
def degrees_de_rham1(f, m, p):
basis, degrees0, degrees1 = basis_de_rham_degrees(f, m, p)
return degrees1
class superelliptic:
def __init__(self, f, m, p):
Rx.<x> = PolynomialRing(GF(p))
Rxy.<x, y> = PolynomialRing(GF(p), 2)
Fxy = FractionField(Rxy)
self.polynomial = Rx(f)
self.exponent = m
self.characteristic = p
r = Rx(f).degree()
delta = GCD(r, m)
self.degree_holo = degrees_holomorphic_differentials(f, m, p)
self.degree_de_rham0 = degrees_de_rham0(f, m, p)
self.degree_de_rham1 = degrees_de_rham1(f, m, p)
holo_basis = holomorphic_differentials_basis(f, m, p)
holo_basis_converted = []
for a in holo_basis:
holo_basis_converted += [superelliptic_form(self, a)]
self.basis_holomorphic_differentials = holo_basis_converted
dr_basis = de_rham_basis(f, m, p)
dr_basis_converted = []
for (a, b) in dr_basis:
dr_basis_converted += [superelliptic_cech(self, superelliptic_form(self, a), superelliptic_function(self, b))]
self.basis_de_rham = dr_basis_converted
def __repr__(self):
f = self.polynomial
m = self.exponent
p = self.characteristic
return 'Superelliptic curve with the equation y^' + str(m) + ' = ' + str(f)+' over finite field with ' + str(p) + ' elements.'
def is_smooth(self):
f = self.polynomial
if f.discriminant() == 0:
return 0
return 1
def genus(self):
r = self.polynomial.degree()
m = self.exponent
delta = GCD(r, m)
return 1/2*((r-1)*(m-1) - delta + 1)
def verschiebung_matrix(self):
basis = self.basis_de_rham
g = self.genus()
p = self.characteristic
M = matrix(GF(p), 2*g, 2*g)
for i in range(0, len(basis)):
w = basis[i]
v = w.verschiebung().coordinates()
M[i, :] = v
return M
def frobenius_matrix(self):
basis = self.basis_de_rham
g = self.genus()
p = self.characteristic
M = matrix(GF(p), 2*g, 2*g)
for i in range(0, len(basis)):
w = basis[i]
v = w.frobenius().coordinates()
M[i, :] = v
return M
def cartier_matrix(self):
basis = self.basis_holomorphic_differentials
g = self.genus()
p = self.characteristic
M = matrix(GF(p), g, g)
for i in range(0, len(basis)):
w = basis[i]
v = w.cartier().coordinates()
M[i, :] = v
return M
def p_rank(self):
return self.cartier_matrix().rank()
def final_type(self, test = 0):
F = self.frobenius_matrix()
V = self.verschiebung_matrix()
p = self.characteristic
return flag(F, V, p, test)
def reduction(C, g):
p = C.characteristic
Rxy.<x, y> = PolynomialRing(GF(p), 2)
Fxy = FractionField(Rxy)
f = C.polynomial
r = f.degree()
m = C.exponent
g = Fxy(g)
g1 = g.numerator()
g2 = g.denominator()
Rx.<x> = PolynomialRing(GF(p))
Fx = FractionField(Rx)
FxRy.<y> = PolynomialRing(Fx)
(A, B, C) = xgcd(FxRy(g2), FxRy(y^m - f))
g = FxRy(g1*B/A)
while(g.degree(Rxy(y)) >= m):
d = g.degree(Rxy(y))
G = coff(g, d)
i = floor(d/m)
g = g - G*y^d + f^i * y^(d%m) *G
return(FxRy(g))
def reduction_form(C, g):
p = C.characteristic
Rxy.<x, y> = PolynomialRing(GF(p), 2)
Fxy = FractionField(Rxy)
f = C.polynomial
r = f.degree()
m = C.exponent
g = reduction(C, g)
g1 = Rxy(0)
Rx.<x> = PolynomialRing(GF(p))
Fx = FractionField(Rx)
FxRy.<y> = PolynomialRing(Fx)
g = FxRy(g)
for j in range(0, m):
if j==0:
G = coff(g, 0)
g1 += FxRy(G)
else:
G = coff(g, j)
g1 += Fxy(y^(j-m)*f*G)
return(g1)
class superelliptic_function:
def __init__(self, C, g):
p = C.characteristic
Rxy.<x, y> = PolynomialRing(GF(p), 2)
Fxy = FractionField(Rxy)
f = C.polynomial
r = f.degree()
m = C.exponent
self.curve = C
g = reduction(C, g)
self.function = g
def __repr__(self):
return str(self.function)
def jth_component(self, j):
g = self.function
C = self.curve
p = C.characteristic
Rx.<x> = PolynomialRing(GF(p))
Fx.<x> = FractionField(Rx)
FxRy.<y> = PolynomialRing(Fx)
g = FxRy(g)
return coff(g, j)
def __add__(self, other):
C = self.curve
g1 = self.function
g2 = other.function
g = reduction(C, g1 + g2)
return superelliptic_function(C, g)
def __sub__(self, other):
C = self.curve
g1 = self.function
g2 = other.function
g = reduction(C, g1 - g2)
return superelliptic_function(C, g)
def __mul__(self, other):
C = self.curve
g1 = self.function
g2 = other.function
g = reduction(C, g1 * g2)
return superelliptic_function(C, g)
def __truediv__(self, other):
C = self.curve
g1 = self.function
g2 = other.function
g = reduction(C, g1 / g2)
return superelliptic_function(C, g)
def diffn(self):
C = self.curve
f = C.polynomial
m = C.exponent
p = C.characteristic
g = self.function
Rxy.<x, y> = PolynomialRing(GF(p), 2)
Fxy = FractionField(Rxy)
g = Fxy(g)
A = g.derivative(x)
B = g.derivative(y)*f.derivative(x)/(m*y^(m-1))
return superelliptic_form(C, A+B)
class superelliptic_form:
def __init__(self, C, g):
p = C.characteristic
Rxy.<x, y> = PolynomialRing(GF(p), 2)
Fxy = FractionField(Rxy)
g = Fxy(reduction_form(C, g))
self.form = g
self.curve = C
def __add__(self, other):
C = self.curve
g1 = self.form
g2 = other.form
g = reduction(C, g1 + g2)
return superelliptic_form(C, g)
def __sub__(self, other):
C = self.curve
g1 = self.form
g2 = other.form
g = reduction(C, g1 - g2)
return superelliptic_form(C, g)
def __repr__(self):
g = self.form
if len(str(g)) == 1:
return str(g) + ' dx'
return '('+str(g) + ') dx'
def __rmul__(self, constant):
C = self.curve
omega = self.form
return superelliptic_form(C, constant*omega)
def cartier(self):
C = self.curve
m = C.exponent
p = C.characteristic
f = C.polynomial
Rx.<x> = PolynomialRing(GF(p))
Fx = FractionField(Rx)
FxRy.<y> = PolynomialRing(Fx)
Fxy = FractionField(FxRy)
result = superelliptic_form(C, FxRy(0))
mult_order = Integers(m)(p).multiplicative_order()
M = Integer((p^(mult_order)-1)/m)
for j in range(1, m):
fct_j = self.jth_component(j)
h = Rx(fct_j*f^(M*j))
j1 = (p^(mult_order-1)*j)%m
B = floor(p^(mult_order-1)*j/m)
result += superelliptic_form(C, polynomial_part(p, h)/(f^B*y^(j1)))
return result
def coordinates(self):
C = self.curve
p = C.characteristic
m = C.exponent
Rx.<x> = PolynomialRing(GF(p))
Fx = FractionField(Rx)
FxRy.<y> = PolynomialRing(Fx)
g = C.genus()
degrees_holo = C.degree_holo
degrees_holo_inv = {b:a for a, b in degrees_holo.items()}
basis = C.basis_holomorphic_differentials
for j in range(1, m):
omega_j = Fx(self.jth_component(j))
if omega_j != Fx(0):
d = degree_of_rational_fctn(omega_j, p)
index = degrees_holo_inv[(d, j)]
a = coeff_of_rational_fctn(omega_j, p)
a1 = coeff_of_rational_fctn(basis[index].jth_component(j), p)
elt = self - (a/a1)*basis[index]
return elt.coordinates() + a/a1*vector([GF(p)(i == index) for i in range(0, g)])
return vector(g*[0])
def jth_component(self, j):
g = self.form
C = self.curve
p = C.characteristic
Rx.<x> = PolynomialRing(GF(p))
Fx = FractionField(Rx)
FxRy.<y> = PolynomialRing(Fx)
Fxy = FractionField(FxRy)
Ryinv.<y_inv> = PolynomialRing(Fx)
g = Fxy(g)
g = g(y = 1/y_inv)
g = Ryinv(g)
return coff(g, j)
def is_regular_on_U0(self):
C = self.curve
p = C.characteristic
m = C.exponent
Rx.<x> = PolynomialRing(GF(p))
for j in range(1, m):
if self.jth_component(j) not in Rx:
return 0
return 1
def is_regular_on_Uinfty(self):
C = self.curve
p = C.characteristic
m = C.exponent
f = C.polynomial
r = f.degree()
delta = GCD(m, r)
M = m/delta
R = r/delta
for j in range(1, m):
A = self.jth_component(j)
d = degree_of_rational_fctn(A, p)
if(-d*M + j*R -(M+1)<0):
return 0
return 1
class superelliptic_cech:
def __init__(self, C, omega, fct):
self.omega0 = omega
self.omega8 = omega - diffn(fct)
self.f = fct
self.curve = C
def __add__(self, other):
C = self.curve
return superelliptic_cech(C, self.omega0 + other.omega0, self.f + other.f)
def __sub__(self, other):
C = self.curve
return superelliptic_cech(C, self.omega0 - other.omega0, self.f - other.f)
def __rmul__(self, constant):
C = self.curve
w1 = self.omega0.form
f1 = self.f.function
w2 = superelliptic_form(C, constant*w1)
f2 = superelliptic_function(C, constant*f1)
return superelliptic_cech(C, w2, f2)
def __repr__(self):
return "(" + str(self.omega0) + ", " + str(self.f) + ", " + str(self.omega8) + ")"
def verschiebung(self):
C = self.curve
omega = self.omega0
p = C.characteristic
Rx.<x> = PolynomialRing(GF(p))
return superelliptic_cech(C, omega.cartier(), superelliptic_function(C, Rx(0)))
def frobenius(self):
C = self.curve
fct = self.f.function
p = C.characteristic
Rx.<x> = PolynomialRing(GF(p))
return superelliptic_cech(C, superelliptic_form(C, Rx(0)), superelliptic_function(C, fct^p))
def coordinates(self):
C = self.curve
p = C.characteristic
m = C.exponent
Rx.<x> = PolynomialRing(GF(p))
Fx = FractionField(Rx)
FxRy.<y> = PolynomialRing(Fx)
g = C.genus()
degrees_holo = C.degree_holo
degrees_holo_inv = {b:a for a, b in degrees_holo.items()}
degrees0 = C.degree_de_rham0
degrees0_inv = {b:a for a, b in degrees0.items()}
degrees1 = C.degree_de_rham1
degrees1_inv = {b:a for a, b in degrees1.items()}
basis = C.basis_de_rham
omega = self.omega0
fct = self.f
if fct.function == Rx(0) and omega.form != Rx(0):
for j in range(1, m):
omega_j = Fx(omega.jth_component(j))
if omega_j != Fx(0):
d = degree_of_rational_fctn(omega_j, p)
index = degrees_holo_inv[(d, j)]
a = coeff_of_rational_fctn(omega_j, p)
a1 = coeff_of_rational_fctn(basis[index].omega0.jth_component(j), p)
elt = self - (a/a1)*basis[index]
return elt.coordinates() + a/a1*vector([GF(p)(i == index) for i in range(0, 2*g)])
for j in range(1, m):
fct_j = Fx(fct.jth_component(j))
if (fct_j != Rx(0)):
d = degree_of_rational_fctn(fct_j, p)
if (d, j) in degrees1.values():
index = degrees1_inv[(d, j)]
a = coeff_of_rational_fctn(fct_j, p)
elt = self - (a/m)*basis[index]
return elt.coordinates() + a/m*vector([GF(p)(i == index) for i in range(0, 2*g)])
if d<0:
a = coeff_of_rational_fctn(fct_j, p)
h = superelliptic_function(C, FxRy(a*y^j*x^d))
elt = superelliptic_cech(C, self.omega0, self.f - h)
return elt.coordinates()
if (fct_j != Rx(0)):
G = superelliptic_function(C, y^j*x^d)
a = coeff_of_rational_fctn(fct_j, p)
elt =self - a*superelliptic_cech(C, diffn(G), G)
return elt.coordinates()
return vector(2*g*[0])
def is_cocycle(self):
w0 = self.omega0
w8 = self.omega8
fct = self.f
if not w0.is_regular_on_U0() and not w8.is_regular_on_Uinfty():
return('w0 & w8')
if not w0.is_regular_on_U0():
return('w0')
if not w8.is_regular_on_Uinfty():
return('w8')
if w0.is_regular_on_U0() and w8.is_regular_on_Uinfty():
return 1
return 0
def degree_of_rational_fctn(f, p):
Rx.<x> = PolynomialRing(GF(p))
Fx = FractionField(Rx)
f = Fx(f)
f1 = f.numerator()
f2 = f.denominator()
d1 = f1.degree()
d2 = f2.degree()
return(d1 - d2)
def coeff_of_rational_fctn(f, p):
Rx.<x> = PolynomialRing(GF(p))
Fx = FractionField(Rx)
f = Fx(f)
if f == Rx(0):
return 0
f1 = f.numerator()
f2 = f.denominator()
d1 = f1.degree()
d2 = f2.degree()
a1 = f1.coefficients(sparse = false)[d1]
a2 = f2.coefficients(sparse = false)[d2]
return(a1/a2)
def coff(f, d):
lista = f.coefficients(sparse = false)
if len(lista) <= d:
return 0
return lista[d]
def cut(f, i):
R = f.parent()
coeff = f.coefficients(sparse = false)
return sum(R(x^(j-i-1)) * coeff[j] for j in range(i+1, f.degree() + 1))
def polynomial_part(p, h):
Rx.<x> = PolynomialRing(GF(p))
h = Rx(h)
result = Rx(0)
for i in range(0, h.degree()+1):
if (i%p) == p-1:
power = Integer((i-(p-1))/p)
result += Integer(h[i]) * x^(power)
return result
def preimage(U, V, M): #preimage of subspace U under M
basis_preimage = M.right_kernel().basis()
imageU = U.intersection(M.transpose().image())
basis = imageU.basis()
for v in basis:
w = M.solve_right(v)
basis_preimage = basis_preimage + [w]
return V.subspace(basis_preimage)
def image(U, V, M):
basis = U.basis()
basis_image = []
for v in basis:
basis_image += [M*v]
return V.subspace(basis_image)
def flag(F, V, p, test = 0):
dim = F.dimensions()[0]
space = VectorSpace(GF(p), dim)
flag_subspaces = (dim+1)*[0]
flag_used = (dim+1)*[0]
final_type = (dim+1)*['?']
flag_subspaces[dim] = space
flag_used[dim] = 1
while 1 in flag_used:
index = flag_used.index(1)
flag_used[index] = 0
U = flag_subspaces[index]
U_im = image(U, space, V)
d_im = U_im.dimension()
final_type[index] = d_im
U_pre = preimage(U, space, F)
d_pre = U_pre.dimension()
if flag_subspaces[d_im] == 0:
flag_subspaces[d_im] = U_im
flag_used[d_im] = 1
if flag_subspaces[d_pre] == 0:
flag_subspaces[d_pre] = U_pre
flag_used[d_pre] = 1
if test == 1:
print('(', final_type, ')')
for i in range(0, dim+1):
if final_type[i] == '?' and final_type[dim - i] != '?':
i1 = dim - i
final_type[i] = final_type[i1] - i1 + dim/2
final_type[0] = 0
for i in range(1, dim+1):
if final_type[i] == '?':
prev = final_type[i-1]
if prev != '?' and prev in final_type[i+1:]:
final_type[i] = prev
for i in range(1, dim+1):
if final_type[i] == '?':
final_type[i] = min(final_type[i-1] + 1, dim/2)
if is_final(final_type, dim/2):
return final_type[1:dim/2 + 1]
print('error:', final_type[1:dim/2 + 1])
def is_final(final_type, dim):
n = len(final_type)
if final_type[0] != 0:
return 0
if final_type[n-1] != dim:
return 0
for i in range(1, n):
if final_type[i] != final_type[i - 1] and final_type[i] != final_type[i - 1] + 1:
return 0
return 1
from datetime import datetime
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
print("Current Time =", current_time)
p = 17
Rx.<x> = PolynomialRing(GF(p))
C = superelliptic(x^13+x^8+x, 2, p)
print(C.final_type())
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
print("Current Time =", current_time)
Current Time = 18:11:00 [1, 2, 3, 4, 5, 6] Current Time = 18:11:21
def p_cov(C):
m = C.exponent
p = C.characteristic
f = C.polynomial
return superelliptic(f(x^p - x), m, p)
p = 3
Rx.<x> = PolynomialRing(GF(p))
C = superelliptic(2*x^9+x^8+x, 2, p)
C1 = p_cov(C)
print(C.final_type(), C1.final_type())
[1, 1, 2, 3] [1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11]
p = 5
Rx.<x> = PolynomialRing(GF(p))
C = superelliptic(x^9+x^8+x, 2, p)
C1 = p_cov(C)
print(C.final_type(1), C1.final_type(1))
( ['?', 1, 1, 2, 3, 3, 3, 4, 4] ) ( ['?', '?', '?', '?', '?', 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, '?', 18, 19, 19, '?', 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, '?', '?', '?', '?', 22] ) [1, 1, 2, 3] [1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, 19]
C1.genus()
22
p = 11
for a in range(0, p):
for b in range(0, p):
for c in range(0, p):
Rx.<x> = PolynomialRing(GF(p))
C = superelliptic(x^9+a*x^8+c*x, 2, p)
if C.is_smooth() and C.p_rank() == 3:
M = C.cartier_matrix()
print(C.polynomial, C.p_rank(), (M^4).rank(), 4 - (M-identity_matrix(4)).rank())
V = C.verschiebung_matrix()
F = C.frobenius_matrix()
print(flag(F, V, p))
x^9 + x^8 + x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 2*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 3*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 4*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 5*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 6*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 7*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 8*x 3 0 0 (( [0, 0, 1, 2, 3, 3, 3, 3, 4] )) [0, 1, 2, 3] x^9 + x^8 + 9*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 2*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 3*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 4*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 5*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 6*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 7*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 8*x 3 0 0 (( [0, 0, 1, 2, 3, 3, 3, 3, 4] )) [0, 1, 2, 3] x^9 + x^8 + 9*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 2*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 3*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 4*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 5*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 6*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 7*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 8*x 3 0 0 (( [0, 0, 1, 2, 3, 3, 3, 3, 4] )) [0, 1, 2, 3] x^9 + x^8 + 9*x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + x 3 2 0 (( ['?', '?', 2, 2, 3, 3, 4, '?', 4] )) [1, 2, 2, 3] x^9 + x^8 + 2*x 3 2 0
[0;31m---------------------------------------------------------------------------[0m [0;31mKeyboardInterrupt[0m Traceback (most recent call last) [0;32m<ipython-input-10-442b4b636bbb>[0m in [0;36m<module>[0;34m()[0m [1;32m 9[0m [0mprint[0m[0;34m([0m[0mC[0m[0;34m.[0m[0mpolynomial[0m[0;34m,[0m [0mC[0m[0;34m.[0m[0mp_rank[0m[0;34m([0m[0;34m)[0m[0;34m,[0m [0;34m([0m[0mM[0m[0;34m**[0m[0mInteger[0m[0;34m([0m[0;36m4[0m[0;34m)[0m[0;34m)[0m[0;34m.[0m[0mrank[0m[0;34m([0m[0;34m)[0m[0;34m,[0m [0mInteger[0m[0;34m([0m[0;36m4[0m[0;34m)[0m [0;34m-[0m [0;34m([0m[0mM[0m[0;34m-[0m[0midentity_matrix[0m[0;34m([0m[0mInteger[0m[0;34m([0m[0;36m4[0m[0;34m)[0m[0;34m)[0m[0;34m)[0m[0;34m.[0m[0mrank[0m[0;34m([0m[0;34m)[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 10[0m [0mV[0m [0;34m=[0m [0mC[0m[0;34m.[0m[0mverschiebung_matrix[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m---> 11[0;31m [0mF[0m [0;34m=[0m [0mC[0m[0;34m.[0m[0mfrobenius_matrix[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 12[0m [0mprint[0m[0;34m([0m[0mflag[0m[0;34m([0m[0mF[0m[0;34m,[0m [0mV[0m[0;34m,[0m [0mp[0m[0;34m)[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m<ipython-input-1-eeab6fc29dc6>[0m in [0;36mfrobenius_matrix[0;34m(self)[0m [1;32m 135[0m [0;32mfor[0m [0mi[0m [0;32min[0m [0mrange[0m[0;34m([0m[0mInteger[0m[0;34m([0m[0;36m0[0m[0;34m)[0m[0;34m,[0m [0mlen[0m[0;34m([0m[0mbasis[0m[0;34m)[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 136[0m [0mw[0m [0;34m=[0m [0mbasis[0m[0;34m[[0m[0mi[0m[0;34m][0m[0;34m[0m[0;34m[0m[0m [0;32m--> 137[0;31m [0mv[0m [0;34m=[0m [0mw[0m[0;34m.[0m[0mfrobenius[0m[0;34m([0m[0;34m)[0m[0;34m.[0m[0mcoordinates[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 138[0m [0mM[0m[0;34m[[0m[0mi[0m[0;34m,[0m [0;34m:[0m[0;34m][0m [0;34m=[0m [0mv[0m[0;34m[0m[0;34m[0m[0m [1;32m 139[0m [0;32mreturn[0m [0mM[0m[0;34m[0m[0;34m[0m[0m [0;32m<ipython-input-1-eeab6fc29dc6>[0m in [0;36mcoordinates[0;34m(self)[0m [1;32m 487[0m [0ma[0m [0;34m=[0m [0mcoeff_of_rational_fctn[0m[0;34m([0m[0mfct_j[0m[0;34m,[0m [0mp[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 488[0m [0melt[0m [0;34m=[0m[0mself[0m [0;34m-[0m [0ma[0m[0;34m*[0m[0msuperelliptic_cech[0m[0;34m([0m[0mC[0m[0;34m,[0m [0mdiffn[0m[0;34m([0m[0mG[0m[0;34m)[0m[0;34m,[0m [0mG[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 489[0;31m [0;32mreturn[0m [0melt[0m[0;34m.[0m[0mcoordinates[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 490[0m [0;34m[0m[0m [1;32m 491[0m [0;32mreturn[0m [0mvector[0m[0;34m([0m[0mInteger[0m[0;34m([0m[0;36m2[0m[0;34m)[0m[0;34m*[0m[0mg[0m[0;34m*[0m[0;34m[[0m[0mInteger[0m[0;34m([0m[0;36m0[0m[0;34m)[0m[0;34m][0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m<ipython-input-1-eeab6fc29dc6>[0m in [0;36mcoordinates[0;34m(self)[0m [1;32m 487[0m [0ma[0m [0;34m=[0m [0mcoeff_of_rational_fctn[0m[0;34m([0m[0mfct_j[0m[0;34m,[0m [0mp[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 488[0m [0melt[0m [0;34m=[0m[0mself[0m [0;34m-[0m [0ma[0m[0;34m*[0m[0msuperelliptic_cech[0m[0;34m([0m[0mC[0m[0;34m,[0m [0mdiffn[0m[0;34m([0m[0mG[0m[0;34m)[0m[0;34m,[0m [0mG[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 489[0;31m [0;32mreturn[0m [0melt[0m[0;34m.[0m[0mcoordinates[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 490[0m [0;34m[0m[0m [1;32m 491[0m [0;32mreturn[0m [0mvector[0m[0;34m([0m[0mInteger[0m[0;34m([0m[0;36m2[0m[0;34m)[0m[0;34m*[0m[0mg[0m[0;34m*[0m[0;34m[[0m[0mInteger[0m[0;34m([0m[0;36m0[0m[0;34m)[0m[0;34m][0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m<ipython-input-1-eeab6fc29dc6>[0m in [0;36mcoordinates[0;34m(self)[0m [1;32m 475[0m [0ma[0m [0;34m=[0m [0mcoeff_of_rational_fctn[0m[0;34m([0m[0mfct_j[0m[0;34m,[0m [0mp[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 476[0m [0melt[0m [0;34m=[0m [0mself[0m [0;34m-[0m [0;34m([0m[0ma[0m[0;34m/[0m[0mm[0m[0;34m)[0m[0;34m*[0m[0mbasis[0m[0;34m[[0m[0mindex[0m[0;34m][0m[0;34m[0m[0;34m[0m[0m [0;32m--> 477[0;31m [0;32mreturn[0m [0melt[0m[0;34m.[0m[0mcoordinates[0m[0;34m([0m[0;34m)[0m [0;34m+[0m [0ma[0m[0;34m/[0m[0mm[0m[0;34m*[0m[0mvector[0m[0;34m([0m[0;34m[[0m[0mGF[0m[0;34m([0m[0mp[0m[0;34m)[0m[0;34m([0m[0mi[0m [0;34m==[0m [0mindex[0m[0;34m)[0m [0;32mfor[0m [0mi[0m [0;32min[0m [0mrange[0m[0;34m([0m[0mInteger[0m[0;34m([0m[0;36m0[0m[0;34m)[0m[0;34m,[0m [0mInteger[0m[0;34m([0m[0;36m2[0m[0;34m)[0m[0;34m*[0m[0mg[0m[0;34m)[0m[0;34m][0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 478[0m [0;34m[0m[0m [1;32m 479[0m [0;32mif[0m [0md[0m[0;34m<[0m[0mInteger[0m[0;34m([0m[0;36m0[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m<ipython-input-1-eeab6fc29dc6>[0m in [0;36mcoordinates[0;34m(self)[0m [1;32m 475[0m [0ma[0m [0;34m=[0m [0mcoeff_of_rational_fctn[0m[0;34m([0m[0mfct_j[0m[0;34m,[0m [0mp[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 476[0m [0melt[0m [0;34m=[0m [0mself[0m [0;34m-[0m [0;34m([0m[0ma[0m[0;34m/[0m[0mm[0m[0;34m)[0m[0;34m*[0m[0mbasis[0m[0;34m[[0m[0mindex[0m[0;34m][0m[0;34m[0m[0;34m[0m[0m [0;32m--> 477[0;31m [0;32mreturn[0m [0melt[0m[0;34m.[0m[0mcoordinates[0m[0;34m([0m[0;34m)[0m [0;34m+[0m [0ma[0m[0;34m/[0m[0mm[0m[0;34m*[0m[0mvector[0m[0;34m([0m[0;34m[[0m[0mGF[0m[0;34m([0m[0mp[0m[0;34m)[0m[0;34m([0m[0mi[0m [0;34m==[0m [0mindex[0m[0;34m)[0m [0;32mfor[0m [0mi[0m [0;32min[0m [0mrange[0m[0;34m([0m[0mInteger[0m[0;34m([0m[0;36m0[0m[0;34m)[0m[0;34m,[0m [0mInteger[0m[0;34m([0m[0;36m2[0m[0;34m)[0m[0;34m*[0m[0mg[0m[0;34m)[0m[0;34m][0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 478[0m [0;34m[0m[0m [1;32m 479[0m [0;32mif[0m [0md[0m[0;34m<[0m[0mInteger[0m[0;34m([0m[0;36m0[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m<ipython-input-1-eeab6fc29dc6>[0m in [0;36mcoordinates[0;34m(self)[0m [1;32m 474[0m [0mindex[0m [0;34m=[0m [0mdegrees1_inv[0m[0;34m[[0m[0;34m([0m[0md[0m[0;34m,[0m [0mj[0m[0;34m)[0m[0;34m][0m[0;34m[0m[0;34m[0m[0m [1;32m 475[0m [0ma[0m [0;34m=[0m [0mcoeff_of_rational_fctn[0m[0;34m([0m[0mfct_j[0m[0;34m,[0m [0mp[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 476[0;31m [0melt[0m [0;34m=[0m [0mself[0m [0;34m-[0m [0;34m([0m[0ma[0m[0;34m/[0m[0mm[0m[0;34m)[0m[0;34m*[0m[0mbasis[0m[0;34m[[0m[0mindex[0m[0;34m][0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 477[0m [0;32mreturn[0m [0melt[0m[0;34m.[0m[0mcoordinates[0m[0;34m([0m[0;34m)[0m [0;34m+[0m [0ma[0m[0;34m/[0m[0mm[0m[0;34m*[0m[0mvector[0m[0;34m([0m[0;34m[[0m[0mGF[0m[0;34m([0m[0mp[0m[0;34m)[0m[0;34m([0m[0mi[0m [0;34m==[0m [0mindex[0m[0;34m)[0m [0;32mfor[0m [0mi[0m [0;32min[0m [0mrange[0m[0;34m([0m[0mInteger[0m[0;34m([0m[0;36m0[0m[0;34m)[0m[0;34m,[0m [0mInteger[0m[0;34m([0m[0;36m2[0m[0;34m)[0m[0;34m*[0m[0mg[0m[0;34m)[0m[0;34m][0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 478[0m [0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/element.pyx[0m in [0;36msage.structure.element.Element.__mul__ (build/cythonized/sage/structure/element.c:12169)[0;34m()[0m [1;32m 1527[0m [0;32mif[0m [0;32mnot[0m [0merr[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 1528[0m [0;32mreturn[0m [0;34m([0m[0;34m<[0m[0mElement[0m[0;34m>[0m[0mright[0m[0;34m)[0m[0;34m.[0m[0m_mul_long[0m[0;34m([0m[0mvalue[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m-> 1529[0;31m [0;32mreturn[0m [0mcoercion_model[0m[0;34m.[0m[0mbin_op[0m[0;34m([0m[0mleft[0m[0;34m,[0m [0mright[0m[0;34m,[0m [0mmul[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 1530[0m [0;32mexcept[0m [0mTypeError[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 1531[0m [0;32mreturn[0m [0mNotImplemented[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/coerce.pyx[0m in [0;36msage.structure.coerce.CoercionModel.bin_op (build/cythonized/sage/structure/coerce.c:11104)[0;34m()[0m [1;32m 1247[0m [0mmul_method[0m [0;34m=[0m [0mgetattr[0m[0;34m([0m[0my[0m[0;34m,[0m [0;34m'__r%s__'[0m[0;34m%[0m[0mop_name[0m[0;34m,[0m [0;32mNone[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 1248[0m [0;32mif[0m [0mmul_method[0m [0;32mis[0m [0;32mnot[0m [0;32mNone[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m-> 1249[0;31m [0mres[0m [0;34m=[0m [0mmul_method[0m[0;34m([0m[0mx[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 1250[0m [0;32mif[0m [0mres[0m [0;32mis[0m [0;32mnot[0m [0;32mNone[0m [0;32mand[0m [0mres[0m [0;32mis[0m [0;32mnot[0m [0mNotImplemented[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 1251[0m [0;32mreturn[0m [0mres[0m[0;34m[0m[0;34m[0m[0m [0;32m<ipython-input-1-eeab6fc29dc6>[0m in [0;36m__rmul__[0;34m(self, constant)[0m [1;32m 415[0m [0mw1[0m [0;34m=[0m [0mself[0m[0;34m.[0m[0momega0[0m[0;34m.[0m[0mform[0m[0;34m[0m[0;34m[0m[0m [1;32m 416[0m [0mf1[0m [0;34m=[0m [0mself[0m[0;34m.[0m[0mf[0m[0;34m.[0m[0mfunction[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 417[0;31m [0mw2[0m [0;34m=[0m [0msuperelliptic_form[0m[0;34m([0m[0mC[0m[0;34m,[0m [0mconstant[0m[0;34m*[0m[0mw1[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 418[0m [0mf2[0m [0;34m=[0m [0msuperelliptic_function[0m[0;34m([0m[0mC[0m[0;34m,[0m [0mconstant[0m[0;34m*[0m[0mf1[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 419[0m [0;32mreturn[0m [0msuperelliptic_cech[0m[0;34m([0m[0mC[0m[0;34m,[0m [0mw2[0m[0;34m,[0m [0mf2[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m<ipython-input-1-eeab6fc29dc6>[0m in [0;36m__init__[0;34m(self, C, g)[0m [1;32m 280[0m [0mRxy[0m [0;34m=[0m [0mPolynomialRing[0m[0;34m([0m[0mGF[0m[0;34m([0m[0mp[0m[0;34m)[0m[0;34m,[0m [0mInteger[0m[0;34m([0m[0;36m2[0m[0;34m)[0m[0;34m,[0m [0mnames[0m[0;34m=[0m[0;34m([0m[0;34m'x'[0m[0;34m,[0m [0;34m'y'[0m[0;34m,[0m[0;34m)[0m[0;34m)[0m[0;34m;[0m [0;34m([0m[0mx[0m[0;34m,[0m [0my[0m[0;34m,[0m[0;34m)[0m [0;34m=[0m [0mRxy[0m[0;34m.[0m[0m_first_ngens[0m[0;34m([0m[0;36m2[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 281[0m [0mFxy[0m [0;34m=[0m [0mFractionField[0m[0;34m([0m[0mRxy[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 282[0;31m [0mg[0m [0;34m=[0m [0mFxy[0m[0;34m([0m[0mreduction_form[0m[0;34m([0m[0mC[0m[0;34m,[0m [0mg[0m[0;34m)[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 283[0m [0mself[0m[0;34m.[0m[0mform[0m [0;34m=[0m [0mg[0m[0;34m[0m[0;34m[0m[0m [1;32m 284[0m [0mself[0m[0;34m.[0m[0mcurve[0m [0;34m=[0m [0mC[0m[0;34m[0m[0;34m[0m[0m [0;32m<ipython-input-1-eeab6fc29dc6>[0m in [0;36mreduction_form[0;34m(C, g)[0m [1;32m 205[0m [0;32melse[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 206[0m [0mG[0m [0;34m=[0m [0mcoff[0m[0;34m([0m[0mg[0m[0;34m,[0m [0mj[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 207[0;31m [0mg1[0m [0;34m+=[0m [0mFxy[0m[0;34m([0m[0my[0m[0;34m**[0m[0;34m([0m[0mj[0m[0;34m-[0m[0mm[0m[0;34m)[0m[0;34m*[0m[0mf[0m[0;34m*[0m[0mG[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 208[0m [0;32mreturn[0m[0;34m([0m[0mg1[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 209[0m [0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/element.pyx[0m in [0;36msage.structure.element.Element.__add__ (build/cythonized/sage/structure/element.c:10839)[0;34m()[0m [1;32m 1232[0m [0;31m# Left and right are Sage elements => use coercion model[0m[0;34m[0m[0;34m[0m[0;34m[0m[0m [1;32m 1233[0m [0;32mif[0m [0mBOTH_ARE_ELEMENT[0m[0;34m([0m[0mcl[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m-> 1234[0;31m [0;32mreturn[0m [0mcoercion_model[0m[0;34m.[0m[0mbin_op[0m[0;34m([0m[0mleft[0m[0;34m,[0m [0mright[0m[0;34m,[0m [0madd[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 1235[0m [0;34m[0m[0m [1;32m 1236[0m [0mcdef[0m [0mlong[0m [0mvalue[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/coerce.pyx[0m in [0;36msage.structure.coerce.CoercionModel.bin_op (build/cythonized/sage/structure/coerce.c:10120)[0;34m()[0m [1;32m 1205[0m [0;31m# Now coerce to a common parent and do the operation there[0m[0;34m[0m[0;34m[0m[0;34m[0m[0m [1;32m 1206[0m [0;32mtry[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m-> 1207[0;31m [0mxy[0m [0;34m=[0m [0mself[0m[0;34m.[0m[0mcanonical_coercion[0m[0;34m([0m[0mx[0m[0;34m,[0m [0my[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 1208[0m [0;32mexcept[0m [0mTypeError[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 1209[0m [0mself[0m[0;34m.[0m[0m_record_exception[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/coerce.pyx[0m in [0;36msage.structure.coerce.CoercionModel.canonical_coercion (build/cythonized/sage/structure/coerce.c:11635)[0;34m()[0m [1;32m 1320[0m [0mx_elt[0m [0;34m=[0m [0mx[0m[0;34m[0m[0;34m[0m[0m [1;32m 1321[0m [0;32mif[0m [0my_map[0m [0;32mis[0m [0;32mnot[0m [0;32mNone[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m-> 1322[0;31m [0my_elt[0m [0;34m=[0m [0;34m([0m[0;34m<[0m[0mMap[0m[0;34m>[0m[0my_map[0m[0;34m)[0m[0;34m.[0m[0m_call_[0m[0;34m([0m[0my[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 1323[0m [0;32melse[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 1324[0m [0my_elt[0m [0;34m=[0m [0my[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/coerce_maps.pyx[0m in [0;36msage.structure.coerce_maps.CallableConvertMap._call_ (build/cythonized/sage/structure/coerce_maps.c:7389)[0;34m()[0m [1;32m 430[0m [0my[0m [0;34m=[0m [0mself[0m[0;34m.[0m[0m_func[0m[0;34m([0m[0mC[0m[0;34m,[0m [0mx[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 431[0m [0;32melse[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 432[0;31m [0my[0m [0;34m=[0m [0mself[0m[0;34m.[0m[0m_func[0m[0;34m([0m[0mx[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 433[0m [0;32mexcept[0m [0mException[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 434[0m [0;32mif[0m [0mprint_warnings[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/rings/fraction_field.py[0m in [0;36mwrapper[0;34m(x)[0m [1;32m 316[0m [0;34m[0m[0m [1;32m 317[0m [0;32mdef[0m [0mwrapper[0m[0;34m([0m[0mx[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 318[0;31m [0;32mreturn[0m [0mself[0m[0;34m.[0m[0m_element_class[0m[0;34m([0m[0mself[0m[0;34m,[0m [0mx[0m[0;34m.[0m[0mnumerator[0m[0;34m([0m[0;34m)[0m[0;34m,[0m [0mx[0m[0;34m.[0m[0mdenominator[0m[0;34m([0m[0;34m)[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 319[0m [0;34m[0m[0m [1;32m 320[0m [0;31m# The case ``S`` being `\QQ` requires special handling since `\QQ` is[0m[0;34m[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/rings/fraction_field_element.pyx[0m in [0;36msage.rings.fraction_field_element.FractionFieldElement_1poly_field.__init__ (build/cythonized/sage/rings/fraction_field_element.c:11744)[0;34m()[0m [1;32m 1115[0m [0;36m1[0m[0;34m/[0m[0;36m2[0m[0;34m/[0m[0mx[0m[0;34m[0m[0;34m[0m[0m [1;32m 1116[0m """ [0;32m-> 1117[0;31m FractionFieldElement.__init__(self, parent, numerator, denominator, [0m[1;32m 1118[0m coerce, reduce) [1;32m 1119[0m [0;32mif[0m [0;32mnot[0m [0mreduce[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/rings/fraction_field_element.pyx[0m in [0;36msage.rings.fraction_field_element.FractionFieldElement.__init__ (build/cythonized/sage/rings/fraction_field_element.c:2966)[0;34m()[0m [1;32m 113[0m [0;32mif[0m [0mcoerce[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 114[0m [0mself[0m[0;34m.[0m[0m__numerator[0m [0;34m=[0m [0mparent[0m[0;34m.[0m[0mring[0m[0;34m([0m[0;34m)[0m[0;34m([0m[0mnumerator[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 115[0;31m [0mself[0m[0;34m.[0m[0m__denominator[0m [0;34m=[0m [0mparent[0m[0;34m.[0m[0mring[0m[0;34m([0m[0;34m)[0m[0;34m([0m[0mdenominator[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 116[0m [0;32melse[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 117[0m [0mself[0m[0;34m.[0m[0m__numerator[0m [0;34m=[0m [0mnumerator[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/parent.pyx[0m in [0;36msage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9218)[0;34m()[0m [1;32m 898[0m [0;32mif[0m [0mmor[0m [0;32mis[0m [0;32mnot[0m [0;32mNone[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 899[0m [0;32mif[0m [0mno_extra_args[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 900[0;31m [0;32mreturn[0m [0mmor[0m[0;34m.[0m[0m_call_[0m[0;34m([0m[0mx[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 901[0m [0;32melse[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 902[0m [0;32mreturn[0m [0mmor[0m[0;34m.[0m[0m_call_with_args[0m[0;34m([0m[0mx[0m[0;34m,[0m [0margs[0m[0;34m,[0m [0mkwds[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/coerce_maps.pyx[0m in [0;36msage.structure.coerce_maps.NamedConvertMap._call_ (build/cythonized/sage/structure/coerce_maps.c:5949)[0;34m()[0m [1;32m 285[0m [0;32mraise[0m [0mTypeError[0m[0;34m([0m[0;34m"Cannot coerce {} to {}"[0m[0;34m.[0m[0mformat[0m[0;34m([0m[0mx[0m[0;34m,[0m [0mC[0m[0;34m)[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 286[0m [0mcdef[0m [0mMap[0m [0mm[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 287[0;31m [0mcdef[0m [0mElement[0m [0me[0m [0;34m=[0m [0mmethod[0m[0;34m([0m[0mC[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 288[0m [0;32mif[0m [0me[0m [0;32mis[0m [0;32mNone[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 289[0m [0;32mraise[0m [0mRuntimeError[0m[0;34m([0m[0;34m"BUG in coercion model: {} method of {} returned None"[0m[0;34m.[0m[0mformat[0m[0;34m([0m[0mself[0m[0;34m.[0m[0mmethod_name[0m[0;34m,[0m [0mtype[0m[0;34m([0m[0mx[0m[0;34m)[0m[0;34m)[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/rings/polynomial/multi_polynomial.pyx[0m in [0;36msage.rings.polynomial.multi_polynomial.MPolynomial._polynomial_ (build/cythonized/sage/rings/polynomial/multi_polynomial.c:6311)[0;34m()[0m [1;32m 205[0m [0mvar[0m [0;34m=[0m [0mR[0m[0;34m.[0m[0mvariable_name[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 206[0m [0;32mif[0m [0mvar[0m [0;32min[0m [0mself[0m[0;34m.[0m[0m_parent[0m[0;34m.[0m[0mvariable_names[0m[0;34m([0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 207[0;31m [0;32mreturn[0m [0mR[0m[0;34m([0m[0mself[0m[0;34m.[0m[0mpolynomial[0m[0;34m([0m[0mself[0m[0;34m.[0m[0m_parent[0m[0;34m([0m[0mvar[0m[0;34m)[0m[0;34m)[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 208[0m [0;32melse[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 209[0m [0;32mreturn[0m [0mR[0m[0;34m([0m[0;34m[[0m[0mself[0m[0;34m][0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/rings/polynomial/multi_polynomial.pyx[0m in [0;36msage.rings.polynomial.multi_polynomial.MPolynomial.polynomial (build/cythonized/sage/rings/polynomial/multi_polynomial.c:8657)[0;34m()[0m [1;32m 485[0m w = {remove_from_tuple(e, ind): val [1;32m 486[0m for e, val in self.dict().iteritems() if not e[ind]} [0;32m--> 487[0;31m [0mv[0m [0;34m=[0m [0;34m[[0m[0mB[0m[0;34m([0m[0mw[0m[0;34m)[0m[0;34m][0m [0;31m# coefficients that don't involve var[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 488[0m [0mz[0m [0;34m=[0m [0mvar[0m[0;34m[0m[0;34m[0m[0m [1;32m 489[0m [0;32mfor[0m [0mi[0m [0;32min[0m [0mrange[0m[0;34m([0m[0;36m1[0m[0;34m,[0m[0md[0m[0;34m+[0m[0;36m1[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/parent.pyx[0m in [0;36msage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9218)[0;34m()[0m [1;32m 898[0m [0;32mif[0m [0mmor[0m [0;32mis[0m [0;32mnot[0m [0;32mNone[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 899[0m [0;32mif[0m [0mno_extra_args[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 900[0;31m [0;32mreturn[0m [0mmor[0m[0;34m.[0m[0m_call_[0m[0;34m([0m[0mx[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 901[0m [0;32melse[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 902[0m [0;32mreturn[0m [0mmor[0m[0;34m.[0m[0m_call_with_args[0m[0;34m([0m[0mx[0m[0;34m,[0m [0margs[0m[0;34m,[0m [0mkwds[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/coerce_maps.pyx[0m in [0;36msage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4448)[0;34m()[0m [1;32m 154[0m [0mcdef[0m [0mParent[0m [0mC[0m [0;34m=[0m [0mself[0m[0;34m.[0m[0m_codomain[0m[0;34m[0m[0;34m[0m[0m [1;32m 155[0m [0;32mtry[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 156[0;31m [0;32mreturn[0m [0mC[0m[0;34m.[0m[0m_element_constructor[0m[0;34m([0m[0mx[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 157[0m [0;32mexcept[0m [0mException[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 158[0m [0;32mif[0m [0mprint_warnings[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/rings/polynomial/polynomial_ring.py[0m in [0;36m_element_constructor_[0;34m(self, x, check, is_gen, construct, **kwds)[0m [1;32m 466[0m [0;32melif[0m [0misinstance[0m[0;34m([0m[0mx[0m[0;34m,[0m [0msage[0m[0;34m.[0m[0mrings[0m[0;34m.[0m[0mpower_series_ring_element[0m[0;34m.[0m[0mPowerSeries[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 467[0m [0mx[0m [0;34m=[0m [0mx[0m[0;34m.[0m[0mtruncate[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 468[0;31m [0;32mreturn[0m [0mC[0m[0;34m([0m[0mself[0m[0;34m,[0m [0mx[0m[0;34m,[0m [0mcheck[0m[0;34m,[0m [0mis_gen[0m[0;34m,[0m [0mconstruct[0m[0;34m=[0m[0mconstruct[0m[0;34m,[0m [0;34m**[0m[0mkwds[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 469[0m [0;34m[0m[0m [1;32m 470[0m [0;34m@[0m[0mclassmethod[0m[0;34m[0m[0;34m[0m[0m [0;32msrc/cysignals/signals.pyx[0m in [0;36mcysignals.signals.python_check_interrupt[0;34m()[0m [0;31mKeyboardInterrupt[0m:
C = superelliptic(x^9+x^8+x, 2, 11)
print(C.basis_holomorphic_differentials)
[(1/y) dx, (x/y) dx, (x^2/y) dx, (x^3/y) dx]
p = 5
Rx.<x> = PolynomialRing(GF(p))
C = superelliptic(x^3 - x, 2, p)
if (C.is_smooth()):
print(C.p_rank())
print(C.final_type())
1 [1]
C.frobenius_matrix()
[0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0] [0 0 0 4 2 3 3 2] [4 0 4 4 2 0 0 4] [0 0 4 3 0 0 1 2] [3 0 0 0 0 1 0 0]
flag(F, V, p)
test [0, -1, -1, -1, 4, -1, -1, -1, 4] poprawiony ft [0, 1, 2, 3, 4, 4, 4, 4, 4]
[1, 2, 3, 4]
f = x^9+3*x^3+x^2+x+1
r = f.degree()
i = 2
j = 1
m = 2
print(Rx(m-j)*Rx(x)*Rx(f.derivative()))
print(Rx(m)*Rx(i)*f)
4*x^9 + 4*x^3 + 2*x^2 + x 4*x^9 + 2*x^3 + 4*x^2 + 4*x + 4
print(r*(m-j))
print(m*i)
print(f.derivative())
9 4 4*x^8 + 4*x^2 + 2*x + 1
x*f.derivative() - 2*2*f
2*x^3 + 3*x^2 + 2*x + 1
M = matrix(QQ, [[1,2], [3,6]])
U = M.kernel()
V = VectorSpace(QQ,2)
M.transpose().image()
Vector space of degree 2 and dimension 1 over Rational Field Basis matrix: [1 3]
l = U.basis()
l = l +[(1, 1/3)]
###fragment kodu do obliczania residuuow w niesk - zaniechany
#def more_v(f, prec):
# C = f.curve
# f = f.vw
# g = C.polynomial8
# p = C.characteristic
# m = C.exponent
# r = C.polynomial.degree()
# delta, a, b = xgcd(m, r)
# a = -a
# M = m/delta
# R = r/delta
#
# Fpbar = GF(p).algebraic_closure()
# Ruv.<u, v> = PolynomialRing(Fpbar, 2)
# if prec == 0:
# return 0
# zeta = Fpbar.zeta(m)
# a = f(v = zeta, w = 0)
# f1 = f - a
# if w.divides(f1):
# return more_v(f1/w, prec-1)
p = 7
Rx.<x> = PolynomialRing(GF(p))
C = superelliptic(x^3 + x + 3, 5, p)
baza = C.basis_de_rham
print(C.genus())
#E = EllipticCurve(GF(p), [1, 2])
print(E.trace_of_frobenius())
#C.basis_holomorphic_differentials( )
4 2
C.degree_de_rham0
{0: (0, 2), 1: (0, 3), 2: (0, 4), 3: (1, 4), 4: (-1, 1), 5: (0, 1), 6: (1, 2), 7: (1, 3)}
C.basis_de_rham
{0: ((1/y^2) dx, 0, (1/y^2) dx), 1: ((1/y^3) dx, 0, (1/y^3) dx), 2: ((1/y^4) dx, 0, (1/y^4) dx), 3: ((x/y^4) dx, 0, (x/y^4) dx), 4: (0 dx, 5/x*y^4, ((x + 1)/(x^2*y)) dx), 5: ((2/y) dx, 5/x^2*y^4, ((-x + 2)/(x^3*y)) dx), 6: (((-3*x)/y^2) dx, 5/x*y^3, ((2*x + 1)/(x^2*y^2)) dx), 7: ((x/y^3) dx, 5/x*y^2, ((3*x + 1)/(x^2*y^3)) dx)}
A = C.frobenius_matrix()
B = C.verschiebung_matrix()
A.solve_right((0, 0, 0, 0, 4, 2, 5, 3))
(1, 0, 0, 4, 3, 0, 2, 0)
A*vector((1, 0, 0, 4, 3, 0, 2, 0))
(0, 0, 0, 0, 4, 2, 5, 3)
vector((1, 0, 0, 4, 5, 0, 0, 0)) - vector((0, 0, 0, 0, 2, 6, 5, 5))
(1, 0, 0, 4, 3, -6, -5, -5)
omega = diffn(superelliptic_function(C, y^2))
omega.jth_component(0)
3*x^2 + 1
R.<x, y> = PolynomialRing(GF(p), 2)
g1 = x^3*y^7 + x^2*y^9
g2 = x^2*y + y^6
R1.<x> = PolynomialRing(GF(p))
R2 = FractionField(R1)
R3.<y> = PolynomialRing(R2)
xgcd(R3(g1), R3(g2))[1]*R3(g1) + xgcd(R3(g1), R3(g2))[2]*R3(g2)
y
H = HyperellipticCurve(x^5 - x + 1)
H
Hyperelliptic Curve over Finite Field of size 5 defined by y^2 = x^5 + 4*x + 1
f = x^3 + x + 2
f.derivative(x)
-2*x^2 + 1
p = 5
R1.<x> = PolynomialRing(GF(p))
R2 = FractionField(R1)
R3.<y> = PolynomialRing(R2)
g = y^2/x + y/(x+1)
g = 1/y+x/y^2
R3.<z> = PolynomialRing(R2)
g(y = 1/z)
x*z^2 + z
f
x^3 + x + 4
f.coefficient()
[0;31m---------------------------------------------------------------------------[0m [0;31mAttributeError[0m Traceback (most recent call last) [0;32m<ipython-input-62-e054c182ec1a>[0m in [0;36m<module>[0;34m()[0m [0;32m----> 1[0;31m [0mf[0m[0;34m.[0m[0mcoefficient[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/element.pyx[0m in [0;36msage.structure.element.Element.__getattr__ (build/cythonized/sage/structure/element.c:4614)[0;34m()[0m [1;32m 485[0m [0mAttributeError[0m[0;34m:[0m [0;34m'LeftZeroSemigroup_with_category.element_class'[0m [0mobject[0m [0mhas[0m [0mno[0m [0mattribute[0m [0;34m'blah_blah'[0m[0;34m[0m[0;34m[0m[0m [1;32m 486[0m """ [0;32m--> 487[0;31m [0;32mreturn[0m [0mself[0m[0;34m.[0m[0mgetattr_from_category[0m[0;34m([0m[0mname[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 488[0m [0;34m[0m[0m [1;32m 489[0m [0mcdef[0m [0mgetattr_from_category[0m[0;34m([0m[0mself[0m[0;34m,[0m [0mname[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/element.pyx[0m in [0;36msage.structure.element.Element.getattr_from_category (build/cythonized/sage/structure/element.c:4723)[0;34m()[0m [1;32m 498[0m [0;32melse[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 499[0m [0mcls[0m [0;34m=[0m [0mP[0m[0;34m.[0m[0m_abstract_element_class[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 500[0;31m [0;32mreturn[0m [0mgetattr_from_other_class[0m[0;34m([0m[0mself[0m[0;34m,[0m [0mcls[0m[0;34m,[0m [0mname[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 501[0m [0;34m[0m[0m [1;32m 502[0m [0;32mdef[0m [0m__dir__[0m[0;34m([0m[0mself[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/cpython/getattr.pyx[0m in [0;36msage.cpython.getattr.getattr_from_other_class (build/cythonized/sage/cpython/getattr.c:2614)[0;34m()[0m [1;32m 392[0m [0mdummy_error_message[0m[0;34m.[0m[0mcls[0m [0;34m=[0m [0mtype[0m[0;34m([0m[0mself[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 393[0m [0mdummy_error_message[0m[0;34m.[0m[0mname[0m [0;34m=[0m [0mname[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 394[0;31m [0;32mraise[0m [0mAttributeError[0m[0;34m([0m[0mdummy_error_message[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 395[0m [0mattribute[0m [0;34m=[0m [0;34m<[0m[0mobject[0m[0;34m>[0m[0mattr[0m[0;34m[0m[0;34m[0m[0m [1;32m 396[0m [0;31m# Check for a descriptor (__get__ in Python)[0m[0;34m[0m[0;34m[0m[0;34m[0m[0m [0;31mAttributeError[0m: 'sage.rings.polynomial.polynomial_zmod_flint.Polynomial_zmod_flint' object has no attribute 'coefficient'
x^3+x+1
x^3 + x + 1
parent(x)
Symbolic Ring
R.<x> = PolynomialRing(GF(5))
R = (x^3+x).parent()
R.<x, y> = PolynomialRing(GF(5))
RR = FractionField(R)
A = RR(1/(x*y))
A.derivative(x)
(-1)/(x^2*y)
dict1 = {}
dict1[3] = 5
dict1[6] = 121
degrees1_inv = {b:a for a, b in dict1.items()}
degrees1_inv
{5: 3, 121: 6}
C
Superelliptic curve with the equation y^7 = x^3 + x + 2 over finite field with 5 elements.
basis = C.basis_de_rham()
basis.items()
dict_items([(0, ((x/y) dx, 2/x*y, ((x^3*y^5 - x^3 + x - 1)/(x^2*y^6)) dx)), (1, (((-1)/y) dx, 2/x^2*y, ((-x^3*y^5 + x^3 - 2*x - 2)/(x^3*y^6)) dx)), (2, (((-2*x)/y^2) dx, 2/x*y^2, ((-2*x^3*y^3 + x^3 - 1)/(x^2*y^5)) dx)), (3, ((1/y^2) dx, 2/x^2*y^2, ((x^3*y^3 - 2*x^3 + 2*x - 2)/(x^3*y^5)) dx)), (4, ((1/y^3) dx, 0, (1/y^3) dx)), (5, (0 dx, 2/x*y^3, ((-2*x^3 - x - 1)/(x^2*y^4)) dx)), (6, ((1/y^4) dx, 0, (1/y^4) dx)), (7, ((2*x/y^4) dx, 2/x*y^4, ((2*x^3 - 2*x*y - y)/(x^2*y^4)) dx)), (8, ((1/y^5) dx, 0, (1/y^5) dx)), (9, ((x/y^5) dx, 0, (x/y^5) dx)), (10, ((1/y^6) dx, 0, (1/y^6) dx)), (11, ((x/y^6) dx, 0, (x/y^6) dx))])
m = 9
r = 6
delta, a, b = xgcd(m, r)
a = -a
xgcd(9, 6)
(3, 1, -1)
b*r -a*m, delta
(3, 3)
Fpbar = GF(5).algebraic_closure()
z = Fpbar.zeta(7)
GF(5^6)(z)
[0;31m---------------------------------------------------------------------------[0m [0;31mTypeError[0m Traceback (most recent call last) [0;32m<ipython-input-23-42625790d9c3>[0m in [0;36m<module>[0;34m()[0m [0;32m----> 1[0;31m [0mGF[0m[0;34m([0m[0mInteger[0m[0;34m([0m[0;36m5[0m[0;34m)[0m[0;34m**[0m[0mInteger[0m[0;34m([0m[0;36m6[0m[0;34m)[0m[0;34m)[0m[0;34m([0m[0mz[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/parent.pyx[0m in [0;36msage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9218)[0;34m()[0m [1;32m 898[0m [0;32mif[0m [0mmor[0m [0;32mis[0m [0;32mnot[0m [0;32mNone[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 899[0m [0;32mif[0m [0mno_extra_args[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 900[0;31m [0;32mreturn[0m [0mmor[0m[0;34m.[0m[0m_call_[0m[0;34m([0m[0mx[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 901[0m [0;32melse[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 902[0m [0;32mreturn[0m [0mmor[0m[0;34m.[0m[0m_call_with_args[0m[0;34m([0m[0mx[0m[0;34m,[0m [0margs[0m[0;34m,[0m [0mkwds[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/coerce_maps.pyx[0m in [0;36msage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4556)[0;34m()[0m [1;32m 159[0m [0mprint[0m[0;34m([0m[0mtype[0m[0;34m([0m[0mC[0m[0;34m)[0m[0;34m,[0m [0mC[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 160[0m [0mprint[0m[0;34m([0m[0mtype[0m[0;34m([0m[0mC[0m[0;34m.[0m[0m_element_constructor[0m[0;34m)[0m[0;34m,[0m [0mC[0m[0;34m.[0m[0m_element_constructor[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 161[0;31m [0;32mraise[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 162[0m [0;34m[0m[0m [1;32m 163[0m [0mcpdef[0m [0mElement[0m [0m_call_with_args[0m[0;34m([0m[0mself[0m[0;34m,[0m [0mx[0m[0;34m,[0m [0margs[0m[0;34m=[0m[0;34m([0m[0;34m)[0m[0;34m,[0m [0mkwds[0m[0;34m=[0m[0;34m{[0m[0;34m}[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/structure/coerce_maps.pyx[0m in [0;36msage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4448)[0;34m()[0m [1;32m 154[0m [0mcdef[0m [0mParent[0m [0mC[0m [0;34m=[0m [0mself[0m[0;34m.[0m[0m_codomain[0m[0;34m[0m[0;34m[0m[0m [1;32m 155[0m [0;32mtry[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 156[0;31m [0;32mreturn[0m [0mC[0m[0;34m.[0m[0m_element_constructor[0m[0;34m([0m[0mx[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 157[0m [0;32mexcept[0m [0mException[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [1;32m 158[0m [0;32mif[0m [0mprint_warnings[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/rings/finite_rings/finite_field_givaro.py[0m in [0;36m_element_constructor_[0;34m(self, e)[0m [1;32m 368[0m [0;36m2[0m[0;34m*[0m[0ma4[0m[0;34m^[0m[0;36m3[0m [0;34m+[0m [0;36m2[0m[0;34m*[0m[0ma4[0m[0;34m^[0m[0;36m2[0m [0;34m+[0m [0;36m1[0m[0;34m[0m[0;34m[0m[0m [1;32m 369[0m """ [0;32m--> 370[0;31m [0;32mreturn[0m [0mself[0m[0;34m.[0m[0m_cache[0m[0;34m.[0m[0melement_from_data[0m[0;34m([0m[0me[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 371[0m [0;34m[0m[0m [1;32m 372[0m [0;32mdef[0m [0mgen[0m[0;34m([0m[0mself[0m[0;34m,[0m [0mn[0m[0;34m=[0m[0;36m0[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/rings/finite_rings/element_givaro.pyx[0m in [0;36msage.rings.finite_rings.element_givaro.Cache_givaro.element_from_data (build/cythonized/sage/rings/finite_rings/element_givaro.cpp:7458)[0;34m()[0m [1;32m 312[0m [0;32mreturn[0m [0mmake_FiniteField_givaroElement[0m[0;34m([0m[0mself[0m[0;34m,[0m[0mres[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [1;32m 313[0m [0;34m[0m[0m [0;32m--> 314[0;31m [0mcpdef[0m [0mFiniteField_givaroElement[0m [0melement_from_data[0m[0;34m([0m[0mself[0m[0;34m,[0m [0me[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 315[0m """ [1;32m 316[0m [0mCoerces[0m [0mseveral[0m [0mdata[0m [0mtypes[0m [0mto[0m[0;31m [0m[0;31m`[0m[0;31m`[0m[0mself[0m[0;31m`[0m[0;31m`[0m[0;34m.[0m[0;34m[0m[0;34m[0m[0m [0;32m/opt/sagemath-9.1/local/lib/python3.7/site-packages/sage/rings/finite_rings/element_givaro.pyx[0m in [0;36msage.rings.finite_rings.element_givaro.Cache_givaro.element_from_data (build/cythonized/sage/rings/finite_rings/element_givaro.cpp:7080)[0;34m()[0m [1;32m 451[0m [0;34m[0m[0m [1;32m 452[0m [0;32melse[0m[0;34m:[0m[0;34m[0m[0;34m[0m[0m [0;32m--> 453[0;31m [0;32mraise[0m [0mTypeError[0m[0;34m([0m[0;34m"unable to coerce %r"[0m [0;34m%[0m [0mtype[0m[0;34m([0m[0me[0m[0;34m)[0m[0;34m)[0m[0;34m[0m[0;34m[0m[0m [0m[1;32m 454[0m [0;34m[0m[0m [1;32m 455[0m [0mcdef[0m [0mGEN[0m [0mt[0m[0;34m[0m[0;34m[0m[0m [0;31mTypeError[0m: unable to coerce <class 'sage.rings.algebraic_closure_finite_field.AlgebraicClosureFiniteField_pseudo_conway_with_category.element_class'>
Integers(7)(5).multiplicative_order()
6
Rx.<x> = PolynomialRing(QQ)
f = sum((i+1)*x^i for i in range(0, 10))
cut(f, 5)
10*x^3 + 9*x^2 + 8*x + 7
f
10*x^9 + 9*x^8 + 8*x^7 + 7*x^6 + 6*x^5 + 5*x^4 + 4*x^3 + 3*x^2 + 2*x + 1
E = EllipticCurve(GF(2), [0,0,1,0,1])
print(E)
print(E.frobenius_polynomial())
Elliptic Curve defined by y^2 + y = x^3 + 1 over Finite Field of size 2 x^2 + 2
E
Elliptic Curve defined by y^2 + y = x^3 + x over Finite Field of size 2
x^2 + 2*x + 2