po powrocie obliczania bazy do srodka klasy

This commit is contained in:
jgarnek 2022-10-10 16:38:16 +00:00
parent 4277b74355
commit 91df146a40
1 changed files with 89 additions and 115 deletions

View File

@ -2,81 +2,13 @@
"cells": [
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 44,
"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",
@ -89,30 +21,84 @@
" \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",
" \n",
" def basis_holomorphic_differentials_degree(self):\n",
" f = self.polynomial\n",
" m = self.exponent\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 += [superelliptic_form(self, 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(self):\n",
" basis_holo, degrees0 = self.basis_holomorphic_differentials_degree()\n",
" return basis_holo\n",
" \n",
" def degrees_holomorphic_differentials(self):\n",
" basis_holo, degrees0 = self.basis_holomorphic_differentials_degree()\n",
" return degrees0\n",
"\n",
" def basis_de_rham_degrees(self):\n",
" f = self.polynomial\n",
" m = self.exponent\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 = self.holomorphic_differentials_basis()\n",
" basis = []\n",
" for k in range(0, len(basis_holo)):\n",
" basis += [superelliptic_cech(self, basis_holo[k], superelliptic_function(self, 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 += [superelliptic_cech(self, superelliptic_form(self, Fxy(psi/y^j)), superelliptic_function(self, 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(self):\n",
" basis, degrees0, degrees1 = self.basis_de_rham_degrees()\n",
" return basis\n",
"\n",
" def degrees_de_rham0(self):\n",
" basis, degrees0, degrees1 = self.basis_de_rham_degrees()\n",
" return degrees0\n",
"\n",
" def degrees_de_rham1(self):\n",
" basis, degrees0, degrees1 = self.basis_de_rham_degrees()\n",
" return degrees1 \n",
" \n",
" def is_smooth(self):\n",
" f = self.polynomial\n",
@ -127,7 +113,7 @@
" return 1/2*((r-1)*(m-1) - delta + 1)\n",
" \n",
" def verschiebung_matrix(self):\n",
" basis = self.basis_de_rham\n",
" basis = self.de_rham_basis()\n",
" g = self.genus()\n",
" p = self.characteristic\n",
" M = matrix(GF(p), 2*g, 2*g)\n",
@ -138,7 +124,7 @@
" return M\n",
" \n",
" def frobenius_matrix(self):\n",
" basis = self.basis_de_rham\n",
" basis = self.de_rham_basis()\n",
" g = self.genus()\n",
" p = self.characteristic\n",
" M = matrix(GF(p), 2*g, 2*g)\n",
@ -150,7 +136,7 @@
" return M\n",
"\n",
" def cartier_matrix(self):\n",
" basis = self.basis_holomorphic_differentials\n",
" basis = self.basis_holomorphic_differentials()\n",
" g = self.genus()\n",
" p = self.characteristic\n",
" M = matrix(GF(p), g, g)\n",
@ -159,7 +145,7 @@
" v = w.cartier().coordinates()\n",
" M[i, :] = v\n",
" return M \n",
" \n",
"\n",
"# def p_rank(self):\n",
"# return self.cartier_matrix().rank()\n",
" \n",
@ -352,9 +338,9 @@
" Fx = FractionField(Rx)\n",
" FxRy.<y> = PolynomialRing(Fx)\n",
" g = C.genus()\n",
" degrees_holo = C.degree_holo\n",
" degrees_holo = C.degrees_holomorphic_differentials()\n",
" degrees_holo_inv = {b:a for a, b in degrees_holo.items()}\n",
" basis = C.basis_holomorphic_differentials\n",
" basis = C.basis_holomorphic_differentials()\n",
" \n",
" for j in range(1, m):\n",
" omega_j = Fx(self.jth_component(j))\n",
@ -458,13 +444,13 @@
" Fx = FractionField(Rx)\n",
" FxRy.<y> = PolynomialRing(Fx)\n",
" g = C.genus()\n",
" degrees_holo = C.degree_holo\n",
" degrees_holo = C.degrees_holomorphic_differentials()\n",
" degrees_holo_inv = {b:a for a, b in degrees_holo.items()}\n",
" degrees0 = C.degree_de_rham0\n",
" degrees0 = C.degrees_de_rham0()\n",
" degrees0_inv = {b:a for a, b in degrees0.items()}\n",
" degrees1 = C.degree_de_rham1\n",
" degrees1 = C.degrees_de_rham1()\n",
" degrees1_inv = {b:a for a, b in degrees1.items()}\n",
" basis = C.basis_de_rham\n",
" basis = C.de_rham_basis()\n",
" \n",
" omega = self.omega0\n",
" fct = self.f\n",
@ -567,7 +553,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 45,
"metadata": {
"collapsed": false
},
@ -659,19 +645,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"from datetime import datetime"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 46,
"metadata": {
"collapsed": false
},
@ -687,7 +661,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 47,
"metadata": {
"collapsed": false
},
@ -695,17 +669,17 @@
{
"data": {
"text/plain": [
"1/y"
"[1]"
]
},
"execution_count": 7,
"execution_count": 47,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"C.basis_holomorphic_differentials[0].form"
"C.final_type()"
]
},
{