obliczanie bazy C przy inicjacji

This commit is contained in:
jgarnek 2021-08-23 16:46:01 +02:00
parent 15c6350fb7
commit 535f4650dd

View File

@ -2,17 +2,56 @@
"cells": [
{
"cell_type": "code",
"execution_count": 137,
"execution_count": 206,
"metadata": {},
"outputs": [],
"source": [
"class superelliptic:\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",
" #########basis of holomorphic differentials and de Rham\n",
" \n",
" basis_holo = {}\n",
" basis = {}\n",
" degrees0 = {}\n",
" degrees1 = {}\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[k] = superelliptic_form(self, Fxy(x^(i-1)/y^j))\n",
" basis[k] = superelliptic_cech(self, basis_holo[k], superelliptic_function(self, Rx(0))) \n",
" degrees0[k] = (i-1, j)\n",
" k = k+1\n",
" self.basis_holomorphic_differentials=basis_holo\n",
" ## non-holomorphic elts of H^1_dR\n",
" t = len(basis)\n",
" \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[t] = superelliptic_cech(self, superelliptic_form(self, Fxy(psi/y^j)), superelliptic_function(self, Fxy(m*y^(m-j)/x^i)))\n",
" if psi != Rx(0):\n",
" degrees0[t] = (psi.degree(), j)\n",
" else:\n",
" degrees0[t] = (0, j)\n",
" degrees1[t] = (-i, m-j)\n",
" t += 1\n",
" self.degree_de_rham0 = degrees0\n",
" self.degree_de_rham1 = degrees1\n",
" self.basis_de_rham = basis\n",
" \n",
" def __repr__(self):\n",
" f = self.polynomial\n",
" m = self.exponent\n",
@ -31,70 +70,9 @@
" p = self.characteristic\n",
" r = f.degree()\n",
" delta = GCD(r, m)\n",
" Rxy.<x, y> = PolynomialRing(GF(p), 2)\n",
" Fxy = FractionField(Rxy)\n",
" \n",
" basis = {}\n",
" k = 0\n",
" if j == 'all':\n",
" for j in range(1, m):\n",
" for i in range(1, r):\n",
" if (r*j - m*i >= delta):\n",
" basis[k] = superelliptic_form(self, Fxy(x^(i-1)/y^j))\n",
" k = k+1\n",
" return basis\n",
" else:\n",
" for i in range(1, r):\n",
" if (r*j - m*i >= delta):\n",
" basis[k] = superelliptic_form(self, Fxy(x^(i-1)/y^j))\n",
" k = k+1\n",
" return basis\n",
" \n",
" def degree_and_basis_de_rham(self, j = 'all'):\n",
" f = self.polynomial\n",
" m = self.exponent\n",
" p = self.characteristic\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 = {}\n",
" degrees0 = {}\n",
" degrees1 = {}\n",
" t = 0\n",
" if j == 'all':\n",
" for j in range(1, m):\n",
" holo = C.basis_holomorphic_differentials(j)\n",
" for k in range(0, len(holo)):\n",
" basis[t] = superelliptic_cech(self, holo[k], superelliptic_function(self, Rx(0))) \n",
" g = Rx(holo[k].jth_component(j))\n",
" degrees0[t] = (g.degree(), j)\n",
" t += 1\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[t] = 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 degree_de_rham(self, i, j='all'):\n",
" basis, degrees0, degrees1 = self.degree_and_basis_de_rham(j)\n",
" if i==0:\n",
" return degrees0\n",
" \n",
" if i==1:\n",
" return degrees1\n",
" \n",
" def basis_de_rham(self, j = 'all'): \n",
" basis, degrees0, degrees1 = self.degree_and_basis_de_rham(j)\n",
" return basis\n",
" \n",
" def verschiebung_matrix(self):\n",
" basis = self.basis_de_rham()\n",
" basis = self.basis_de_rham\n",
" g = self.genus()\n",
" p = self.characteristic\n",
" M = matrix(GF(p), 2*g, 2*g)\n",
@ -104,7 +82,7 @@
" return M\n",
" \n",
" def frobenius_matrix(self):\n",
" basis = self.basis_de_rham()\n",
" basis = self.basis_de_rham\n",
" g = self.genus()\n",
" p = self.characteristic\n",
" M = matrix(GF(p), 2*g, 2*g)\n",
@ -369,11 +347,11 @@
" Fx = FractionField(Rx)\n",
" FxRy.<y> = PolynomialRing(Fx)\n",
" g = C.genus()\n",
" degrees0 = C.degree_de_rham(0)\n",
" degrees0 = C.degree_de_rham0\n",
" degrees0_inv = {b:a for a, b in degrees0.items()} \n",
" degrees1 = C.degree_de_rham(1)\n",
" degrees1 = C.degree_de_rham1\n",
" degrees1_inv = {b:a for a, b in degrees1.items()}\n",
" basis = C.basis_de_rham()\n",
" basis = C.basis_de_rham\n",
" \n",
" omega = self.omega0\n",
" fct = self.f\n",
@ -476,71 +454,134 @@
},
{
"cell_type": "code",
"execution_count": 146,
"execution_count": 207,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1\n"
"4\n",
"2\n"
]
}
],
"source": [
"p = 5\n",
"C = superelliptic(x^3 + x + 2, 2, p)\n",
"baza = C.basis_de_rham()\n",
"p = 7\n",
"Rx.<x> = PolynomialRing(GF(p))\n",
"C = superelliptic(x^3 + x + 3, 5, p)\n",
"baza = C.basis_de_rham\n",
"print(C.genus())\n",
"#E = EllipticCurve(GF(p), [1, 2])\n",
"print(E.trace_of_frobenius())\n",
"#C.basis_holomorphic_differentials()"
]
},
{
"cell_type": "code",
"execution_count": 147,
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"A = C.frobenius_matrix()\n",
"B = C.verschiebung_matrix()"
]
},
{
"cell_type": "code",
"execution_count": 148,
"execution_count": 208,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[0 0]\n",
"[1 2]"
"{0: (-1, 1), 1: (0, 1), 2: (1, 2), 3: (1, 3)}"
]
},
"execution_count": 148,
"execution_count": 208,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"A"
"C.degree_de_rham0"
]
},
{
"cell_type": "code",
"execution_count": 149,
"execution_count": 209,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"text/plain": [
"{0: (0 dx, 5/x*y^4, ((x + 1)/(x^2*y)) dx),\n",
" 1: ((2/y) dx, 5/x^2*y^4, ((-x + 2)/(x^3*y)) dx),\n",
" 2: (((-3*x)/y^2) dx, 5/x*y^3, ((2*x + 1)/(x^2*y^2)) dx),\n",
" 3: ((x/y^3) dx, 5/x*y^2, ((3*x + 1)/(x^2*y^3)) dx)}"
]
},
"execution_count": 209,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"C.basis_de_rham"
]
},
{
"cell_type": "code",
"execution_count": 181,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"False\n",
"False\n",
"False\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n",
"True\n"
]
}
],
"source": [
"for i in range(0, 30):\n",
" print((B^i).image() == (B^(i+1)).image())"
]
},
{
"cell_type": "code",
"execution_count": 157,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[2 0]\n",
"[4 0]"
"[7 0]\n",
"[6 0]"
]
},
"execution_count": 149,
"execution_count": 157,
"metadata": {},
"output_type": "execute_result"
}
@ -554,20 +595,25 @@
"execution_count": 150,
"metadata": {},
"outputs": [],
"source": [
"E = EllipticCurve(GF(p), [1, 2])"
]
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 151,
"metadata": {},
"outputs": [],
"source": [
"p = 5\n",
"R.<x, y> = PolynomialRing(GF(p), 2)\n",
"g = x^6*y^2 + y^2"
]
"outputs": [
{
"data": {
"text/plain": [
"2"
]
},
"execution_count": 151,
"metadata": {},
"output_type": "execute_result"
}
],
"source": []
},
{
"cell_type": "code",