DeRhamComputation/superelliptic_alpha.ipynb

1189 lines
53 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"def basis_holomorphic_differentials_degree(f, m, p):\n",
" r = f.degree()\n",
" delta = GCD(r, m)\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" Rxy.<x, y> = PolynomialRing(GF(p), 2)\n",
" Fxy = FractionField(Rxy)\n",
" #########basis of holomorphic differentials and de Rham\n",
" \n",
" basis_holo = []\n",
" degrees0 = {}\n",
" k = 0\n",
" \n",
" for j in range(1, m):\n",
" for i in range(1, r):\n",
" if (r*j - m*i >= delta):\n",
" basis_holo += [Fxy(x^(i-1)/y^j)]\n",
" degrees0[k] = (i-1, j)\n",
" k = k+1\n",
" \n",
" return(basis_holo, degrees0)\n",
"\n",
"def holomorphic_differentials_basis(f, m, p):\n",
" basis_holo, degrees0 = basis_holomorphic_differentials_degree(f, m, p)\n",
" return basis_holo\n",
" \n",
"def degrees_holomorphic_differentials(f, m, p):\n",
" basis_holo, degrees0 = basis_holomorphic_differentials_degree(f, m, p)\n",
" return degrees0\n",
" \n",
"def basis_de_rham_degrees(f, m, p):\n",
" r = f.degree()\n",
" delta = GCD(r, m)\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" Rxy.<x, y> = PolynomialRing(GF(p), 2)\n",
" Fxy = FractionField(Rxy)\n",
" basis_holo = holomorphic_differentials_basis(f, m, p)\n",
" basis = []\n",
" for k in range(0, len(basis_holo)):\n",
" basis += [(basis_holo[k], Rx(0))]\n",
"\n",
" ## non-holomorphic elts of H^1_dR\n",
" t = len(basis)\n",
" degrees0 = {}\n",
" degrees1 = {}\n",
" for j in range(1, m):\n",
" for i in range(1, r):\n",
" if (r*(m-j) - m*i >= delta): \n",
" s = Rx(m-j)*Rx(x)*Rx(f.derivative()) - Rx(m)*Rx(i)*f\n",
" psi = Rx(cut(s, i))\n",
" basis += [(Fxy(psi/y^j), Fxy(m*y^(m-j)/x^i))]\n",
" degrees0[t] = (psi.degree(), j)\n",
" degrees1[t] = (-i, m-j)\n",
" t += 1\n",
" return basis, degrees0, degrees1\n",
"\n",
"def de_rham_basis(f, m, p):\n",
" basis, degrees0, degrees1 = basis_de_rham_degrees(f, m, p)\n",
" return basis\n",
"\n",
"def degrees_de_rham0(f, m, p):\n",
" basis, degrees0, degrees1 = basis_de_rham_degrees(f, m, p)\n",
" return degrees0\n",
"\n",
"def degrees_de_rham1(f, m, p):\n",
" basis, degrees0, degrees1 = basis_de_rham_degrees(f, m, p)\n",
" return degrees1 \n",
"\n",
"\n",
"class superelliptic:\n",
" \n",
" def __init__(self, f, m, p):\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" Rxy.<x, y> = PolynomialRing(GF(p), 2)\n",
" Fxy = FractionField(Rxy)\n",
" self.polynomial = Rx(f)\n",
" self.exponent = m\n",
" self.characteristic = p\n",
" \n",
" r = Rx(f).degree()\n",
" delta = GCD(r, m)\n",
" self.degree_holo = degrees_holomorphic_differentials(f, m, p)\n",
" self.degree_de_rham0 = degrees_de_rham0(f, m, p)\n",
" self.degree_de_rham1 = degrees_de_rham1(f, m, p)\n",
" \n",
" holo_basis = holomorphic_differentials_basis(f, m, p)\n",
" holo_basis_converted = []\n",
" for a in holo_basis:\n",
" holo_basis_converted += [superelliptic_form(self, a)]\n",
" \n",
" self.basis_holomorphic_differentials = holo_basis_converted\n",
" \n",
"\n",
" dr_basis = de_rham_basis(f, m, p)\n",
" dr_basis_converted = []\n",
" for (a, b) in dr_basis:\n",
" dr_basis_converted += [superelliptic_cech(self, superelliptic_form(self, a), superelliptic_function(self, b))]\n",
" \n",
" self.basis_de_rham = dr_basis_converted\n",
" \n",
" def __repr__(self):\n",
" f = self.polynomial\n",
" m = self.exponent\n",
" p = self.characteristic\n",
" return 'Superelliptic curve with the equation y^' + str(m) + ' = ' + str(f)+' over finite field with ' + str(p) + ' elements.'\n",
" \n",
" def is_smooth(self):\n",
" f = self.polynomial\n",
" if f.discriminant() == 0:\n",
" return 0\n",
" return 1\n",
" \n",
" def genus(self):\n",
" r = self.polynomial.degree()\n",
" m = self.exponent\n",
" delta = GCD(r, m)\n",
" return 1/2*((r-1)*(m-1) - delta + 1)\n",
" \n",
" def verschiebung_matrix(self):\n",
" basis = self.basis_de_rham\n",
" g = self.genus()\n",
" p = self.characteristic\n",
" M = matrix(GF(p), 2*g, 2*g)\n",
" for i in range(0, len(basis)):\n",
" w = basis[i]\n",
" v = w.verschiebung().coordinates()\n",
" M[i, :] = v\n",
" return M\n",
" \n",
" def frobenius_matrix(self):\n",
" basis = self.basis_de_rham\n",
" g = self.genus()\n",
" p = self.characteristic\n",
" M = matrix(GF(p), 2*g, 2*g)\n",
" \n",
" for i in range(0, len(basis)):\n",
" w = basis[i]\n",
" v = w.frobenius().coordinates()\n",
" M[i, :] = v\n",
" return M\n",
"\n",
" def cartier_matrix(self):\n",
" basis = self.basis_holomorphic_differentials\n",
" g = self.genus()\n",
" p = self.characteristic\n",
" M = matrix(GF(p), g, g)\n",
" for i in range(0, len(basis)):\n",
" w = basis[i]\n",
" v = w.cartier().coordinates()\n",
" M[i, :] = v\n",
" return M \n",
" \n",
" def p_rank(self):\n",
" return self.cartier_matrix().rank()\n",
" \n",
" def final_type(self, test = 0):\n",
" F = self.frobenius_matrix()\n",
" V = self.verschiebung_matrix()\n",
" p = self.characteristic\n",
" return flag(F, V, p, test)\n",
" \n",
"def reduction(C, g):\n",
" p = C.characteristic\n",
" Rxy.<x, y> = PolynomialRing(GF(p), 2)\n",
" Fxy = FractionField(Rxy)\n",
" f = C.polynomial\n",
" r = f.degree()\n",
" m = C.exponent\n",
" g = Fxy(g)\n",
" g1 = g.numerator()\n",
" g2 = g.denominator()\n",
" \n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" Fx = FractionField(Rx)\n",
" FxRy.<y> = PolynomialRing(Fx) \n",
" (A, B, C) = xgcd(FxRy(g2), FxRy(y^m - f))\n",
" g = FxRy(g1*B/A)\n",
" \n",
" while(g.degree(Rxy(y)) >= m):\n",
" d = g.degree(Rxy(y))\n",
" G = coff(g, d)\n",
" i = floor(d/m)\n",
" g = g - G*y^d + f^i * y^(d%m) *G\n",
" \n",
" return(FxRy(g))\n",
"\n",
"def reduction_form(C, g):\n",
" p = C.characteristic\n",
" Rxy.<x, y> = PolynomialRing(GF(p), 2)\n",
" Fxy = FractionField(Rxy)\n",
" f = C.polynomial\n",
" r = f.degree()\n",
" m = C.exponent\n",
" g = reduction(C, g)\n",
"\n",
" g1 = Rxy(0)\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" Fx = FractionField(Rx)\n",
" FxRy.<y> = PolynomialRing(Fx)\n",
" \n",
" g = FxRy(g)\n",
" for j in range(0, m):\n",
" if j==0:\n",
" G = coff(g, 0)\n",
" g1 += FxRy(G)\n",
" else:\n",
" G = coff(g, j)\n",
" g1 += Fxy(y^(j-m)*f*G)\n",
" return(g1)\n",
" \n",
"class superelliptic_function:\n",
" def __init__(self, C, g):\n",
" p = C.characteristic\n",
" Rxy.<x, y> = PolynomialRing(GF(p), 2)\n",
" Fxy = FractionField(Rxy)\n",
" f = C.polynomial\n",
" r = f.degree()\n",
" m = C.exponent\n",
" \n",
" self.curve = C\n",
" g = reduction(C, g)\n",
" self.function = g\n",
" \n",
" def __repr__(self):\n",
" return str(self.function)\n",
" \n",
" def jth_component(self, j):\n",
" g = self.function\n",
" C = self.curve\n",
" p = C.characteristic\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" Fx.<x> = FractionField(Rx)\n",
" FxRy.<y> = PolynomialRing(Fx)\n",
" g = FxRy(g)\n",
" return coff(g, j)\n",
" \n",
" def __add__(self, other):\n",
" C = self.curve\n",
" g1 = self.function\n",
" g2 = other.function\n",
" g = reduction(C, g1 + g2)\n",
" return superelliptic_function(C, g)\n",
" \n",
" def __sub__(self, other):\n",
" C = self.curve\n",
" g1 = self.function\n",
" g2 = other.function\n",
" g = reduction(C, g1 - g2)\n",
" return superelliptic_function(C, g)\n",
" \n",
" def __mul__(self, other):\n",
" C = self.curve\n",
" g1 = self.function\n",
" g2 = other.function\n",
" g = reduction(C, g1 * g2)\n",
" return superelliptic_function(C, g)\n",
" \n",
" def __truediv__(self, other):\n",
" C = self.curve\n",
" g1 = self.function\n",
" g2 = other.function\n",
" g = reduction(C, g1 / g2)\n",
" return superelliptic_function(C, g)\n",
" \n",
"def diffn(self):\n",
" C = self.curve\n",
" f = C.polynomial\n",
" m = C.exponent\n",
" p = C.characteristic\n",
" g = self.function\n",
" Rxy.<x, y> = PolynomialRing(GF(p), 2)\n",
" Fxy = FractionField(Rxy)\n",
" g = Fxy(g)\n",
" A = g.derivative(x)\n",
" B = g.derivative(y)*f.derivative(x)/(m*y^(m-1))\n",
" return superelliptic_form(C, A+B)\n",
" \n",
"class superelliptic_form:\n",
" def __init__(self, C, g):\n",
" p = C.characteristic\n",
" Rxy.<x, y> = PolynomialRing(GF(p), 2)\n",
" Fxy = FractionField(Rxy)\n",
" g = Fxy(reduction_form(C, g))\n",
" self.form = g\n",
" self.curve = C \n",
" \n",
" def __add__(self, other):\n",
" C = self.curve\n",
" g1 = self.form\n",
" g2 = other.form\n",
" g = reduction(C, g1 + g2)\n",
" return superelliptic_form(C, g)\n",
" \n",
" def __sub__(self, other):\n",
" C = self.curve\n",
" g1 = self.form\n",
" g2 = other.form\n",
" g = reduction(C, g1 - g2)\n",
" return superelliptic_form(C, g)\n",
" \n",
" def __repr__(self):\n",
" g = self.form\n",
" if len(str(g)) == 1:\n",
" return str(g) + ' dx'\n",
" return '('+str(g) + ') dx'\n",
"\n",
" def __rmul__(self, constant):\n",
" C = self.curve\n",
" omega = self.form\n",
" return superelliptic_form(C, constant*omega) \n",
" \n",
" def cartier(self):\n",
" C = self.curve\n",
" m = C.exponent\n",
" p = C.characteristic\n",
" f = C.polynomial\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" Fx = FractionField(Rx)\n",
" FxRy.<y> = PolynomialRing(Fx)\n",
" Fxy = FractionField(FxRy)\n",
" result = superelliptic_form(C, FxRy(0))\n",
" mult_order = Integers(m)(p).multiplicative_order()\n",
" M = Integer((p^(mult_order)-1)/m)\n",
" \n",
" for j in range(1, m):\n",
" fct_j = self.jth_component(j)\n",
" h = Rx(fct_j*f^(M*j))\n",
" j1 = (p^(mult_order-1)*j)%m\n",
" B = floor(p^(mult_order-1)*j/m)\n",
" result += superelliptic_form(C, polynomial_part(p, h)/(f^B*y^(j1)))\n",
" return result \n",
" \n",
" def coordinates(self):\n",
" C = self.curve\n",
" p = C.characteristic\n",
" m = C.exponent\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" Fx = FractionField(Rx)\n",
" FxRy.<y> = PolynomialRing(Fx)\n",
" g = C.genus()\n",
" degrees_holo = C.degree_holo\n",
" degrees_holo_inv = {b:a for a, b in degrees_holo.items()}\n",
" basis = C.basis_holomorphic_differentials\n",
" \n",
" for j in range(1, m):\n",
" omega_j = Fx(self.jth_component(j))\n",
" if omega_j != Fx(0):\n",
" d = degree_of_rational_fctn(omega_j, p)\n",
" index = degrees_holo_inv[(d, j)]\n",
" a = coeff_of_rational_fctn(omega_j, p)\n",
" a1 = coeff_of_rational_fctn(basis[index].jth_component(j), p)\n",
" elt = self - (a/a1)*basis[index]\n",
" return elt.coordinates() + a/a1*vector([GF(p)(i == index) for i in range(0, g)])\n",
" \n",
" return vector(g*[0])\n",
" \n",
" def jth_component(self, j):\n",
" g = self.form\n",
" C = self.curve\n",
" p = C.characteristic\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" Fx = FractionField(Rx)\n",
" FxRy.<y> = PolynomialRing(Fx)\n",
" Fxy = FractionField(FxRy)\n",
" Ryinv.<y_inv> = PolynomialRing(Fx)\n",
" g = Fxy(g)\n",
" g = g(y = 1/y_inv)\n",
" g = Ryinv(g)\n",
" return coff(g, j)\n",
" \n",
" def is_regular_on_U0(self):\n",
" C = self.curve\n",
" p = C.characteristic\n",
" m = C.exponent\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" for j in range(1, m):\n",
" if self.jth_component(j) not in Rx:\n",
" return 0\n",
" return 1\n",
" \n",
" def is_regular_on_Uinfty(self):\n",
" C = self.curve\n",
" p = C.characteristic\n",
" m = C.exponent\n",
" f = C.polynomial\n",
" r = f.degree()\n",
" delta = GCD(m, r)\n",
" M = m/delta\n",
" R = r/delta\n",
" \n",
" for j in range(1, m):\n",
" A = self.jth_component(j)\n",
" d = degree_of_rational_fctn(A, p)\n",
" if(-d*M + j*R -(M+1)<0):\n",
" return 0\n",
" return 1\n",
" \n",
" \n",
"class superelliptic_cech:\n",
" def __init__(self, C, omega, fct):\n",
" self.omega0 = omega\n",
" self.omega8 = omega - diffn(fct)\n",
" self.f = fct\n",
" self.curve = C\n",
" \n",
" def __add__(self, other):\n",
" C = self.curve\n",
" return superelliptic_cech(C, self.omega0 + other.omega0, self.f + other.f)\n",
" \n",
" def __sub__(self, other):\n",
" C = self.curve\n",
" return superelliptic_cech(C, self.omega0 - other.omega0, self.f - other.f)\n",
"\n",
" def __rmul__(self, constant):\n",
" C = self.curve\n",
" w1 = self.omega0.form\n",
" f1 = self.f.function\n",
" w2 = superelliptic_form(C, constant*w1)\n",
" f2 = superelliptic_function(C, constant*f1)\n",
" return superelliptic_cech(C, w2, f2) \n",
" \n",
" def __repr__(self):\n",
" return \"(\" + str(self.omega0) + \", \" + str(self.f) + \", \" + str(self.omega8) + \")\" \n",
" \n",
" def verschiebung(self):\n",
" C = self.curve\n",
" omega = self.omega0\n",
" p = C.characteristic\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" return superelliptic_cech(C, omega.cartier(), superelliptic_function(C, Rx(0)))\n",
" \n",
" def frobenius(self):\n",
" C = self.curve\n",
" fct = self.f.function\n",
" p = C.characteristic\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" return superelliptic_cech(C, superelliptic_form(C, Rx(0)), superelliptic_function(C, fct^p))\n",
"\n",
" def coordinates(self):\n",
" C = self.curve\n",
" p = C.characteristic\n",
" m = C.exponent\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" Fx = FractionField(Rx)\n",
" FxRy.<y> = PolynomialRing(Fx)\n",
" g = C.genus()\n",
" degrees_holo = C.degree_holo\n",
" degrees_holo_inv = {b:a for a, b in degrees_holo.items()}\n",
" degrees0 = C.degree_de_rham0\n",
" degrees0_inv = {b:a for a, b in degrees0.items()}\n",
" degrees1 = C.degree_de_rham1\n",
" degrees1_inv = {b:a for a, b in degrees1.items()}\n",
" basis = C.basis_de_rham\n",
" \n",
" omega = self.omega0\n",
" fct = self.f\n",
" \n",
" if fct.function == Rx(0) and omega.form != Rx(0):\n",
" for j in range(1, m):\n",
" omega_j = Fx(omega.jth_component(j))\n",
" if omega_j != Fx(0):\n",
" d = degree_of_rational_fctn(omega_j, p)\n",
" index = degrees_holo_inv[(d, j)]\n",
" a = coeff_of_rational_fctn(omega_j, p)\n",
" a1 = coeff_of_rational_fctn(basis[index].omega0.jth_component(j), p)\n",
" elt = self - (a/a1)*basis[index]\n",
" return elt.coordinates() + a/a1*vector([GF(p)(i == index) for i in range(0, 2*g)])\n",
" \n",
" for j in range(1, m):\n",
" fct_j = Fx(fct.jth_component(j))\n",
" if (fct_j != Rx(0)):\n",
" d = degree_of_rational_fctn(fct_j, p)\n",
" \n",
" if (d, j) in degrees1.values():\n",
" index = degrees1_inv[(d, j)]\n",
" a = coeff_of_rational_fctn(fct_j, p)\n",
" elt = self - (a/m)*basis[index]\n",
" return elt.coordinates() + a/m*vector([GF(p)(i == index) for i in range(0, 2*g)])\n",
" \n",
" if d<0:\n",
" a = coeff_of_rational_fctn(fct_j, p)\n",
" h = superelliptic_function(C, FxRy(a*y^j*x^d))\n",
" elt = superelliptic_cech(C, self.omega0, self.f - h)\n",
" return elt.coordinates()\n",
" \n",
" if (fct_j != Rx(0)):\n",
" G = superelliptic_function(C, y^j*x^d)\n",
" a = coeff_of_rational_fctn(fct_j, p)\n",
" elt =self - a*superelliptic_cech(C, diffn(G), G)\n",
" return elt.coordinates()\n",
"\n",
" return vector(2*g*[0])\n",
" \n",
" def is_cocycle(self):\n",
" w0 = self.omega0\n",
" w8 = self.omega8\n",
" fct = self.f\n",
" if not w0.is_regular_on_U0() and not w8.is_regular_on_Uinfty():\n",
" return('w0 & w8')\n",
" if not w0.is_regular_on_U0():\n",
" return('w0')\n",
" if not w8.is_regular_on_Uinfty():\n",
" return('w8')\n",
" if w0.is_regular_on_U0() and w8.is_regular_on_Uinfty():\n",
" return 1\n",
" return 0\n",
" \n",
"def degree_of_rational_fctn(f, p):\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" Fx = FractionField(Rx)\n",
" f = Fx(f)\n",
" f1 = f.numerator()\n",
" f2 = f.denominator()\n",
" d1 = f1.degree()\n",
" d2 = f2.degree()\n",
" return(d1 - d2)\n",
"\n",
"def coeff_of_rational_fctn(f, p):\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" Fx = FractionField(Rx)\n",
" f = Fx(f)\n",
" if f == Rx(0):\n",
" return 0\n",
" f1 = f.numerator()\n",
" f2 = f.denominator()\n",
" d1 = f1.degree()\n",
" d2 = f2.degree()\n",
" a1 = f1.coefficients(sparse = false)[d1]\n",
" a2 = f2.coefficients(sparse = false)[d2]\n",
" return(a1/a2)\n",
"\n",
"def coff(f, d):\n",
" lista = f.coefficients(sparse = false)\n",
" if len(lista) <= d:\n",
" return 0\n",
" return lista[d]\n",
"\n",
"def cut(f, i):\n",
" R = f.parent()\n",
" coeff = f.coefficients(sparse = false)\n",
" return sum(R(x^(j-i-1)) * coeff[j] for j in range(i+1, f.degree() + 1))\n",
"\n",
"def polynomial_part(p, h):\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" h = Rx(h)\n",
" result = Rx(0)\n",
" for i in range(0, h.degree()+1):\n",
" if (i%p) == p-1:\n",
" power = Integer((i-(p-1))/p)\n",
" result += Integer(h[i]) * x^(power) \n",
" return result"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"def preimage(U, V, M): #preimage of subspace U under M\n",
" basis_preimage = M.right_kernel().basis()\n",
" imageU = U.intersection(M.transpose().image())\n",
" basis = imageU.basis()\n",
" for v in basis:\n",
" w = M.solve_right(v)\n",
" basis_preimage = basis_preimage + [w]\n",
" return V.subspace(basis_preimage)\n",
"\n",
"def image(U, V, M):\n",
" basis = U.basis()\n",
" basis_image = []\n",
" for v in basis:\n",
" basis_image += [M*v]\n",
" return V.subspace(basis_image)\n",
"\n",
"def flag(F, V, p, test = 0):\n",
" dim = F.dimensions()[0]\n",
" space = VectorSpace(GF(p), dim)\n",
" flag_subspaces = (dim+1)*[0]\n",
" flag_used = (dim+1)*[0]\n",
" final_type = (dim+1)*['?']\n",
" \n",
" flag_subspaces[dim] = space\n",
" flag_used[dim] = 1\n",
" \n",
" \n",
" while 1 in flag_used:\n",
" index = flag_used.index(1)\n",
" flag_used[index] = 0\n",
" U = flag_subspaces[index]\n",
" U_im = image(U, space, V)\n",
" d_im = U_im.dimension()\n",
" final_type[index] = d_im\n",
" U_pre = preimage(U, space, F)\n",
" d_pre = U_pre.dimension()\n",
" \n",
" if flag_subspaces[d_im] == 0:\n",
" flag_subspaces[d_im] = U_im\n",
" flag_used[d_im] = 1\n",
" \n",
" if flag_subspaces[d_pre] == 0:\n",
" flag_subspaces[d_pre] = U_pre\n",
" flag_used[d_pre] = 1\n",
" \n",
" if test == 1:\n",
" print('(', final_type, ')')\n",
" \n",
" for i in range(0, dim+1):\n",
" if final_type[i] == '?' and final_type[dim - i] != '?':\n",
" i1 = dim - i\n",
" final_type[i] = final_type[i1] - i1 + dim/2\n",
" \n",
" final_type[0] = 0\n",
" \n",
" for i in range(1, dim+1):\n",
" if final_type[i] == '?':\n",
" prev = final_type[i-1]\n",
" if prev != '?' and prev in final_type[i+1:]:\n",
" final_type[i] = prev\n",
" \n",
" for i in range(1, dim+1):\n",
" if final_type[i] == '?':\n",
" final_type[i] = min(final_type[i-1] + 1, dim/2)\n",
" \n",
" if is_final(final_type, dim/2):\n",
" return final_type[1:dim/2 + 1]\n",
" print('error:', final_type[1:dim/2 + 1])\n",
" \n",
"def is_final(final_type, dim):\n",
" n = len(final_type)\n",
" if final_type[0] != 0:\n",
" return 0\n",
" \n",
" if final_type[n-1] != dim:\n",
" return 0\n",
" \n",
" for i in range(1, n):\n",
" if final_type[i] != final_type[i - 1] and final_type[i] != final_type[i - 1] + 1:\n",
" return 0\n",
" return 1"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"def dzialanie(f, m, p):\n",
" Rx.<x> = PolynomialRing(GF(p))\n",
" fp = Rx(f(x^p))\n",
" C = superelliptic(fp, m, p)\n",
" holo = C.basis_holomorphic_differentials\n",
" \n",
" Rxy.<x, y> = PolynomialRing(GF(p), 2)\n",
" kxi1.<xi1> = PolynomialRing(FractionField(Rxy))\n",
" kxi = kxi1.quotient(xi1^p)\n",
" xi = kxi(xi1)\n",
" holo_forms = [a.form for a in holo]\n",
" holo_xi = [kxi(a(x = x+xi, y = y)) for a in holo_forms]\n",
" \n",
" N = matrix(kxi1, C.genus(), C.genus())\n",
" for i in range(0, p):\n",
" M = matrix(GF(p), C.genus(), C.genus())\n",
" for j in range(0, len(holo_xi)):\n",
" a = holo_xi[j]\n",
" omega = superelliptic_form(C, a[i])\n",
" v = omega.coordinates()\n",
" M[j, :] = v\n",
" N += xi1^i*M\n",
" return N\n",
"\n",
"def bloki(A):\n",
" B = A.jordan_form(subdivide=True)\n",
" lista = []\n",
" d = 0\n",
" i = 0\n",
" while d < B.dimensions()[1]:\n",
" lista.append(B.subdivision(i, i).dimensions()[1])\n",
" d = d + B.subdivision(i, i).dimensions()[1]\n",
" i = i+1\n",
" return lista\n",
"\n",
"def p_cov(C):\n",
" m = C.exponent\n",
" p = C.characteristic\n",
" f = C.polynomial\n",
" return superelliptic(f(x^p), m, p)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"# Testy"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {
"collapsed": false,
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"10 76\n"
]
}
],
"source": [
"p = 5\n",
"Rx.<x> = PolynomialRing(GF(p))\n",
"r = 3\n",
"f = x^(r) + x + 1\n",
"m = 12\n",
"A = dzialanie(f, m, p)\n",
"print(bloki(A))\n",
"C = superelliptic(f, m, p)\n",
"print(C.genus(), p_cov(C).genus())"
]
},
{
"cell_type": "code",
"execution_count": 79,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"omega = C.basis_holomorphic_differentials[2]"
]
},
{
"cell_type": "code",
"execution_count": 81,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"lista = [a.form for a in C.basis_holomorphic_differentials]"
]
},
{
"cell_type": "code",
"execution_count": 82,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"kxi1.<xi1> = PolynomialRing(FractionField(Rxy))\n",
"kxi = kxi1.quotient(xi1^p)\n",
"xi = kxi(xi1)"
]
},
{
"cell_type": "code",
"execution_count": 96,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"lista2 = [kxi(a(x = x+xi, y = y)) for a in lista]"
]
},
{
"cell_type": "code",
"execution_count": 92,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"x"
]
},
"execution_count": 92,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"kxi(x)"
]
},
{
"cell_type": "code",
"execution_count": 98,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"a = lista2[0]"
]
},
{
"cell_type": "code",
"execution_count": 99,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"1/y*xi1bar^2 + 2*x/y*xi1bar + x^2/y"
]
},
"execution_count": 99,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"omega.form(x = x+xi, y = y)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false,
"scrolled": true
},
"outputs": [
{
"ename": "TypeError",
"evalue": "cannot convert 1/y*xi1bar^2 + 2*x/y*xi1bar + x^2/y/1 to an element of Fraction Field of Multivariate Polynomial Ring in x, y over Finite Field of size 5",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/ext/sage/9.5/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/rings/fraction_field.py\u001b[0m in \u001b[0;36m_element_constructor_\u001b[0;34m(self, x, y, coerce)\u001b[0m\n\u001b[1;32m 695\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 696\u001b[0;31m \u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mresolve_fractions\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 697\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mAttributeError\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/ext/sage/9.5/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/rings/fraction_field.py\u001b[0m in \u001b[0;36mresolve_fractions\u001b[0;34m(x, y)\u001b[0m\n\u001b[1;32m 672\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mresolve_fractions\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 673\u001b[0;31m \u001b[0mxn\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnumerator\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 674\u001b[0m \u001b[0mxd\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdenominator\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/ext/sage/9.5/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/structure/element.pyx\u001b[0m in \u001b[0;36msage.structure.element.Element.__getattr__ (build/cythonized/sage/structure/element.c:4754)\u001b[0;34m()\u001b[0m\n\u001b[1;32m 493\u001b[0m \"\"\"\n\u001b[0;32m--> 494\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgetattr_from_category\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 495\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/ext/sage/9.5/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/structure/element.pyx\u001b[0m in \u001b[0;36msage.structure.element.Element.getattr_from_category (build/cythonized/sage/structure/element.c:4866)\u001b[0;34m()\u001b[0m\n\u001b[1;32m 506\u001b[0m \u001b[0mcls\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mP\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_abstract_element_class\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 507\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mgetattr_from_other_class\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 508\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/ext/sage/9.5/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/cpython/getattr.pyx\u001b[0m in \u001b[0;36msage.cpython.getattr.getattr_from_other_class (build/cythonized/sage/cpython/getattr.c:2566)\u001b[0;34m()\u001b[0m\n\u001b[1;32m 355\u001b[0m \u001b[0mdummy_error_message\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 356\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mAttributeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdummy_error_message\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 357\u001b[0m \u001b[0mcdef\u001b[0m \u001b[0mPyObject\u001b[0m\u001b[0;34m*\u001b[0m \u001b[0mattr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minstance_getattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcls\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mAttributeError\u001b[0m: 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular' object has no attribute '__custom_name'",
"\nDuring handling of the above exception, another exception occurred:\n",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/tmp/ipykernel_1899/916120484.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0momega1\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msuperelliptic_form\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mC\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0momega\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mform\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0mxi\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/tmp/ipykernel_1899/3188561669.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, C, g)\u001b[0m\n\u001b[1;32m 283\u001b[0m \u001b[0mRxy\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mPolynomialRing\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mGF\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mp\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnames\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'x'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'y'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mRxy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_first_ngens\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 284\u001b[0m \u001b[0mFxy\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mFractionField\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mRxy\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 285\u001b[0;31m \u001b[0mg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mFxy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mreduction_form\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mC\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 286\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mform\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mg\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 287\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcurve\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mC\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/tmp/ipykernel_1899/3188561669.py\u001b[0m in \u001b[0;36mreduction_form\u001b[0;34m(C, g)\u001b[0m\n\u001b[1;32m 194\u001b[0m \u001b[0mr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdegree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 195\u001b[0m \u001b[0mm\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mC\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexponent\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 196\u001b[0;31m \u001b[0mg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mreduction\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mC\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 197\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 198\u001b[0m \u001b[0mg1\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mRxy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/tmp/ipykernel_1899/3188561669.py\u001b[0m in \u001b[0;36mreduction\u001b[0;34m(C, g)\u001b[0m\n\u001b[1;32m 169\u001b[0m \u001b[0mr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdegree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 170\u001b[0m \u001b[0mm\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mC\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexponent\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 171\u001b[0;31m \u001b[0mg\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mFxy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mg\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 172\u001b[0m \u001b[0mg1\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mg\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnumerator\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 173\u001b[0m \u001b[0mg2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mg\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdenominator\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/ext/sage/9.5/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/structure/parent.pyx\u001b[0m in \u001b[0;36msage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9388)\u001b[0;34m()\u001b[0m\n\u001b[1;32m 896\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mmor\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 897\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mno_extra_args\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 898\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mmor\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_call_\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 899\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 900\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mmor\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_call_with_args\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwds\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/ext/sage/9.5/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/structure/coerce_maps.pyx\u001b[0m in \u001b[0;36msage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4665)\u001b[0;34m()\u001b[0m\n\u001b[1;32m 159\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtype\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mC\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mC\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 160\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtype\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mC\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_element_constructor\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mC\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_element_constructor\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 161\u001b[0;31m \u001b[0;32mraise\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 162\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 163\u001b[0m \u001b[0mcpdef\u001b[0m \u001b[0mElement\u001b[0m \u001b[0m_call_with_args\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0margs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkwds\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/ext/sage/9.5/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/structure/coerce_maps.pyx\u001b[0m in \u001b[0;36msage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4557)\u001b[0;34m()\u001b[0m\n\u001b[1;32m 154\u001b[0m \u001b[0mcdef\u001b[0m \u001b[0mParent\u001b[0m \u001b[0mC\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_codomain\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 155\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 156\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mC\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_element_constructor\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 157\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 158\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mprint_warnings\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/ext/sage/9.5/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/rings/fraction_field.py\u001b[0m in \u001b[0;36m_element_constructor_\u001b[0;34m(self, x, y, coerce)\u001b[0m\n\u001b[1;32m 696\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mresolve_fractions\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 697\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mAttributeError\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 698\u001b[0;31m raise TypeError(\"cannot convert {!r}/{!r} to an element of {}\".format(\n\u001b[0m\u001b[1;32m 699\u001b[0m x0, y0, self))\n\u001b[1;32m 700\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mTypeError\u001b[0m: cannot convert 1/y*xi1bar^2 + 2*x/y*xi1bar + x^2/y/1 to an element of Fraction Field of Multivariate Polynomial Ring in x, y over Finite Field of size 5"
]
}
],
"source": [
"omega1 = superelliptic_form(C, omega.form(x = x+xi, y = y))"
]
},
{
"cell_type": "code",
"execution_count": 68,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"kxi1.<xi> = PolynomialRing(GF(p))\n",
"kxi = FractionField(kxi1)\n",
"Rxy.<x, y> = PolynomialRing(kxi, 2)\n",
"Fxy = FractionField(Rxy)\n",
"\n",
"Rx.<x> = PolynomialRing(kxi)\n",
"Fx = FractionField(Rx)\n",
"FxRy.<y> = PolynomialRing(Fx)"
]
},
{
"cell_type": "code",
"execution_count": 69,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"x/y"
]
},
"execution_count": 69,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"C.basis_holomorphic_differentials"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
"[ xi1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
"[ xi1^2 2*xi1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
"[ xi1^3 -2*xi1^2 -2*xi1 1 0 0 0 0 0 0 0 0 0 0 0 0 0]\n",
"[ xi1^4 -xi1^3 xi1^2 -xi1 1 0 0 0 0 0 0 0 0 0 0 0 0]\n",
"[ 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0]\n",
"[ 0 0 0 0 0 xi1 1 0 0 0 0 0 0 0 0 0 0]\n",
"[ 0 0 0 0 0 xi1^2 2*xi1 1 0 0 0 0 0 0 0 0 0]\n",
"[ 0 0 0 0 0 xi1^3 -2*xi1^2 -2*xi1 1 0 0 0 0 0 0 0 0]\n",
"[ 0 0 0 0 0 xi1^4 -xi1^3 xi1^2 -xi1 1 0 0 0 0 0 0 0]\n",
"[ 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0]\n",
"[ 0 0 0 0 0 0 0 0 0 0 xi1 1 0 0 0 0 0]\n",
"[ 0 0 0 0 0 0 0 0 0 0 xi1^2 2*xi1 1 0 0 0 0]\n",
"[ 0 0 0 0 0 0 0 0 0 0 xi1^3 -2*xi1^2 -2*xi1 1 0 0 0]\n",
"[ 0 0 0 0 0 0 0 0 0 0 xi1^4 -xi1^3 xi1^2 -xi1 1 0 0]\n",
"[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0]\n",
"[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 xi1 1]\n"
]
}
],
"source": [
"p = 5\n",
"Rx.<x> = PolynomialRing(GF(p))\n",
"f = Rx(x^7 + x + 1)\n",
"m = 2\n",
"Rxy.<x, y> = PolynomialRing(GF(p), 2)\n",
"print(dzialanie(f, m, p))\n",
"A = dzialanie(f, m, p)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[1 1 0 0 0|0 0 0 0 0|0 0 0 0 0|0 0]\n",
"[0 1 1 0 0|0 0 0 0 0|0 0 0 0 0|0 0]\n",
"[0 0 1 1 0|0 0 0 0 0|0 0 0 0 0|0 0]\n",
"[0 0 0 1 1|0 0 0 0 0|0 0 0 0 0|0 0]\n",
"[0 0 0 0 1|0 0 0 0 0|0 0 0 0 0|0 0]\n",
"[---------+---------+---------+---]\n",
"[0 0 0 0 0|1 1 0 0 0|0 0 0 0 0|0 0]\n",
"[0 0 0 0 0|0 1 1 0 0|0 0 0 0 0|0 0]\n",
"[0 0 0 0 0|0 0 1 1 0|0 0 0 0 0|0 0]\n",
"[0 0 0 0 0|0 0 0 1 1|0 0 0 0 0|0 0]\n",
"[0 0 0 0 0|0 0 0 0 1|0 0 0 0 0|0 0]\n",
"[---------+---------+---------+---]\n",
"[0 0 0 0 0|0 0 0 0 0|1 1 0 0 0|0 0]\n",
"[0 0 0 0 0|0 0 0 0 0|0 1 1 0 0|0 0]\n",
"[0 0 0 0 0|0 0 0 0 0|0 0 1 1 0|0 0]\n",
"[0 0 0 0 0|0 0 0 0 0|0 0 0 1 1|0 0]\n",
"[0 0 0 0 0|0 0 0 0 0|0 0 0 0 1|0 0]\n",
"[---------+---------+---------+---]\n",
"[0 0 0 0 0|0 0 0 0 0|0 0 0 0 0|1 1]\n",
"[0 0 0 0 0|0 0 0 0 0|0 0 0 0 0|0 1]"
]
},
"execution_count": 11,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"A.jordan_form()"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"M = matrix(Rx, 3,3)"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"M = matrix(Rx, [[x, 1, 1], [1,2,3], [x+1,2,4]])"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"3"
]
},
"execution_count": 25,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"M.rank()"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"kxi1.<xi1> = PolynomialRing(FractionField(Rxy))\n",
"kxi = kxi1.quotient(xi1^p)\n",
"xi = kxi(xi1)"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"0"
]
},
"execution_count": 33,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"lift(xi^5)"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"E = EllipticCurve(GF(3), [1,1])"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[2 0]\n",
"[2 0]"
]
},
"execution_count": 2,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"p = 5\n",
"R.<x> = PolynomialRing(GF(p))\n",
"f = x^3 + x + 1\n",
"m = 2\n",
"C = superelliptic(f, m, p)\n",
"C.verschiebung_matrix()"
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
]
}
],
"metadata": {
"kernelspec": {
"display_name": "SageMath 9.5",
"language": "sagemath",
"metadata": {
"cocalc": {
"description": "Open-source mathematical software system",
"priority": 1,
"url": "https://www.sagemath.org/"
}
},
"name": "sage-9.5",
"resource_dir": "/ext/jupyter/kernels/sage-9.5"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.9"
}
},
"nbformat": 4,
"nbformat_minor": 4
}