przepisane. Dodawanie teorii, cz 1

This commit is contained in:
jgarnek 2021-08-18 16:08:25 +02:00
parent 00cd535d37
commit e200f87e73

View File

@ -1,5 +1,213 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Theory\n",
"Let $C : y^m = f(x)$. Then:\n",
"\n",
" - the basis of $H^0(C, \\Omega_{C/k})$ is given by:\n",
" $$x^{i-1} dx/y^j,$$\n",
" where $1 \\le i \\le r-1$, $1 \\le j \\le m-1$, $-mi + rj \\ge \\delta$ and $\\delta := GCD(m, r)$, $r := \\deg f$.\n",
" \n",
" - "
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# The program computes the basis of holomorphic differentials of y^m = f(x) in char p.\n",
"# The coefficient j means that we compute the j-th eigenpart, i.e.\n",
"# forms y^j * f(x) dx. Output is [f(x), 0]\n",
"\n",
"def baza_holo(m, f, j, p):\n",
" R.<x> = PolynomialRing(GF(p))\n",
" f = R(f)\n",
" r = f.degree()\n",
" delta = GCD(m, r)\n",
" baza = {}\n",
" k = 0\n",
" for i in range(1, r):\n",
" if (r*j - m*i >= delta):\n",
" baza[k] = [x^(i-1), R(0)]\n",
" k = k+1\n",
" return baza"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"# The program computes the basis of de Rham cohomology of y^m = f(x) in char p.\n",
"# We treat them as pairs [omega, f], where omega is regular on the affine part\n",
"# and omega - df is regular on the second atlas.\n",
"# The coefficient j means that we compute the j-th eigenpart, i.e.\n",
"# [y^j * f(x) dx, g(x)/y^j]. Output is [f(x), g(x)]\n",
"\n",
"def baza_dr(m, f, j, p):\n",
" R.<x> = PolynomialRing(GF(p))\n",
" f = R(f) \n",
" r = f.degree()\n",
" delta = GCD(m, r)\n",
" baza = {}\n",
" holo = baza_holo(m, f, j, p)\n",
" for k in range(0, len(holo)):\n",
" baza[k] = holo[k]\n",
" \n",
" k = len(baza)\n",
" \n",
" for i in range(1, r):\n",
" if (r*(m-j) - m*i >= delta):\n",
" s = R(m-j)*R(x)*R(f.derivative()) - R(m)*R(i)*f\n",
" psi = R(obciecie(s, i, p))\n",
" baza[k] = [psi, R(m)/x^i]\n",
" k = k+1\n",
" return baza"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"#auxiliary programs\n",
"def stopnie_bazy_holo(m, f, j, p):\n",
" baza = baza_holo(m, f, j, p)\n",
" stopnie = {}\n",
" for k in range(0, len(baza)):\n",
" stopnie[k] = baza[k][0].degree()\n",
" return stopnie\n",
"\n",
"def stopnie_bazy_dr(m, f, j, p):\n",
" baza = baza_dr(m, f, j, p)\n",
" stopnie = {}\n",
" for k in range(0, len(baza)):\n",
" stopnie[k] = baza[k][0].degree()\n",
" return stopnie\n",
"\n",
"def stopnie_drugiej_wspolrzednej_bazy_dr(m, f, j, p):\n",
" baza = baza_dr(m, f, j, p)\n",
" stopnie = {}\n",
" for k in range(0, len(baza)):\n",
" if baza[k][1] != 0:\n",
" stopnie[k] = baza[k][1].denominator().degree()\n",
" return stopnie\n",
"\n",
"def obciecie(f, i, p):\n",
" R.<x> = PolynomialRing(GF(p))\n",
" f = R(f)\n",
" coeff = f.coefficients(sparse = false)\n",
" return sum(x^(j-i-1) * coeff[j] for j in range(i+1, f.degree() + 1))\n",
"\n",
"\n",
"#Any element [f dx, g] is represented as a combination of the basis vectors.\n",
"\n",
"def zapis_w_bazie_dr(elt, m, f, j, p):\n",
" R.<x> = PolynomialRing(GF(p))\n",
" f = R(f) \n",
" r = f.degree()\n",
" delta = GCD(m, r)\n",
" baza = baza_dr(m, f, j, p)\n",
" wymiar = len(baza)\n",
" zapis = vector([GF(p)(0) for i in baza])\n",
" stopnie = stopnie_bazy_dr(m, f, j, p)\n",
" inv_stopnie = {v: k for k, v in stopnie.items()}\n",
" stopnie_holo = stopnie_bazy_holo(m, f, j, p)\n",
" inv_stopnie_holo = {v: k for k, v in stopnie_holo.items()} \n",
" \n",
" ## zmiana\n",
" if elt[0]== 0 and elt[1] == 0:\n",
" return zapis\n",
" \n",
" if elt[1] == 0:\n",
" d = elt[0].degree()\n",
" a = elt[0].coefficients(sparse = false)[d]\n",
" k = inv_stopnie_holo[d] #ktory element bazy jest stopnia d? ten o indeksie k\n",
" \n",
" a1 = baza[k][0].coefficients(sparse = false)[d]\n",
" elt1 = [R(0),R(0)]\n",
" elt1[0] = elt[0] - a/a1 * baza[k][0]\n",
" elt1[1] = R(0)\n",
" return zapis_w_bazie_dr(elt1, m, f, j, p) + vector([a/a1*GF(p)(i == k) for i in range(0, len(baza))])\n",
"\n",
" g = elt[1]\n",
" g1 = R(elt[1].numerator())\n",
" g2 = R(elt[1].denominator())\n",
" d1 = g1.degree()\n",
" d2 = g2.degree()\n",
" a1 = g1.coefficients(sparse = false)[d1]\n",
" a2 = g2.coefficients(sparse = false)[d2]\n",
" a = a1/a2\n",
" d = d2 - d1\n",
" \n",
" if (d*m - (m-j)*r >= 0):\n",
" elt1 = [R(0), R(0)]\n",
" elt1[0] = elt[0]\n",
" return zapis_w_bazie_dr(elt1, m, f, j, p)\n",
" \n",
" \n",
" stopnie2 = stopnie_drugiej_wspolrzednej_bazy_dr(m, f, j, p)\n",
" inv_stopnie2 = {v: k for k, v in stopnie2.items()} \n",
" k = inv_stopnie2[d]\n",
" elt1 = [R(0), R(0)]\n",
" elt1[0] = elt[0] - a*baza[k][0]\n",
" elt1[1] = elt[1] - a*baza[k][1]\n",
" return zapis_w_bazie_dr(elt1, m, f, j, p) + vector([a*GF(p)(i == k) for i in range(0, len(baza))])\n",
" \n",
" \n",
"def zapis_w_bazie_holo(elt, m, f, j, p):\n",
" R.<x> = PolynomialRing(GF(p))\n",
" f = R(f) \n",
" r = f.degree()\n",
" delta = GCD(m, r)\n",
" baza = baza_holo(m, f, j, p)\n",
" wymiar = len(baza)\n",
" zapis = vector([GF(p)(0) for i in baza])\n",
" stopnie = stopnie_bazy_holo(m, f, j, p)\n",
" inv_stopnie = {v: k for k, v in stopnie.items()}\n",
" \n",
" if elt[0] == 0:\n",
" return zapis\n",
" \n",
" d = elt[0].degree()\n",
" a = elt[0].coefficients(sparse = false)[d]\n",
" \n",
" k = inv_stopnie[d] #ktory element bazy jest stopnia d? ten o indeksie k\n",
" \n",
" a1 = baza[k][0].coefficients(sparse = false)[d]\n",
" elt1 = [R(0),R(0)]\n",
" elt1[0] = elt[0] - a/a1 * baza[k][0]\n",
" \n",
" return zapis_w_bazie_holo(elt1, m, f, j, p) + vector([a/a1 * GF(p)(i == k) for i in range(0, len(baza))])\n"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{0: [x, 2/x], 1: [2, 2/x^2]}"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"baza_dr(2, x^3 + 1, 0, 3)"
]
},
{
"cell_type": "code",
"execution_count": null,