dodalem_klase fraction polynomial - x oraz X razem

This commit is contained in:
jgarnek 2022-05-05 11:09:44 +00:00
parent 4bc545d6ab
commit bb63124a4c
1 changed files with 101 additions and 18 deletions

View File

@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 61, "execution_count": 83,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
@ -47,15 +47,31 @@
" def __sub__(self, other):\n", " def __sub__(self, other):\n",
" return self + (-1)*other\n", " return self + (-1)*other\n",
"\n", "\n",
"class fraction_pol:\n",
" def __init__(self, g):\n",
" RxX.<x, X> = PolynomialRing(QQ)\n",
" g = RxX(g)\n",
" result = 0\n",
" for a in g.monomials():\n",
" c = g.coefficient(a)\n",
" c = c%9\n",
" dX = a.degree(X)\n",
" dx = a.degree(x)\n",
" if dX%p == 0:\n",
" result += c*x^(dX//p + dx)\n",
" else:\n",
" result += c*X^(dX + dx*p)\n",
" self.function = result\n",
" \n",
"def teichmuller(f):\n", "def teichmuller(f):\n",
" Rx.<x> = PolynomialRing(QQ)\n", " Rx.<x> = PolynomialRing(QQ)\n",
" RXp.<Xp> = PolynomialRing(QQ)\n", " RxX.<x, X> = PolynomialRing(QQ, 2)\n",
" f = Rx(f)\n", " f = Rx(f)\n",
" ff = witt([f, 0])\n", " ff = witt([f, 0])\n",
" coeffs = f.coefficients(sparse=false)\n", " coeffs = f.coefficients(sparse=false)\n",
" for i in range(0, len(coeffs)):\n", " for i in range(0, len(coeffs)):\n",
" ff -= coeffs[i]*witt([Rx(x^i), 0])\n", " ff -= coeffs[i]*witt([Rx(x^i), 0])\n",
" f1 = sum(coeffs[i]*RXp(Xp^(3*i)) for i in range(0, len(coeffs))) + p*RXp(ff.coordinates[1](x = Xp))\n", " f1 = sum(coeffs[i]*RxX(x^(i)) for i in range(0, len(coeffs))) + p*RxX(ff.coordinates[1](x = X))\n",
" #RXp.<Xp> = PolynomialRing(Integers(p^2))\n", " #RXp.<Xp> = PolynomialRing(Integers(p^2))\n",
" #f1 = RXp(f1)\n", " #f1 = RXp(f1)\n",
" return f1" " return f1"
@ -63,7 +79,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 72, "execution_count": 74,
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
@ -94,9 +110,6 @@
" degrees0[t] = (psi.degree(), j)\n", " degrees0[t] = (psi.degree(), j)\n",
" degrees1[t] = (-i, m-j)\n", " degrees1[t] = (-i, m-j)\n",
" t += 1\n", " t += 1\n",
" RXpy.<Xp, y> = PolynomialRing(QQ, 2)\n",
" FXpy = FractionField(RXpy)\n",
" basis = [(a[0](x = Xp^p, y = y), a[1](x = Xp^p, y = y)) for a in basis]\n",
" return basis, degrees0, degrees1\n", " return basis, degrees0, degrees1\n",
"\n", "\n",
"def de_rham_basis(f, m, p):\n", "def de_rham_basis(f, m, p):\n",
@ -164,8 +177,8 @@
"class superelliptic_function:\n", "class superelliptic_function:\n",
" def __init__(self, C, g):\n", " def __init__(self, C, g):\n",
" p = C.characteristic\n", " p = C.characteristic\n",
" RXpy.<Xp, y> = PolynomialRing(QQ, 2)\n", " RxXy.<x, X, y> = PolynomialRing(QQ, 3)\n",
" FXpy = FractionField(RXpy)\n", " FxXy = FractionField(RXy)\n",
" f = C.polynomial\n", " f = C.polynomial\n",
" r = f.degree()\n", " r = f.degree()\n",
" m = C.exponent\n", " m = C.exponent\n",
@ -180,10 +193,10 @@
" g = self.function\n", " g = self.function\n",
" C = self.curve\n", " C = self.curve\n",
" p = C.characteristic\n", " p = C.characteristic\n",
" RXp.<Xp> = PolynomialRing(GF(p))\n", " RxX.<x,X> = PolynomialRing(QQ, 2)\n",
" FXp.<x> = FractionField(RXp)\n", " FxX.<x> = FractionField(RxX)\n",
" FXpRy.<y> = PolynomialRing(FXp)\n", " FxXRy.<y> = PolynomialRing(FxX)\n",
" g = FXpRy(g)\n", " g = FxXRy(g)\n",
" return coff(g, j)\n", " return coff(g, j)\n",
" \n", " \n",
" def __add__(self, other):\n", " def __add__(self, other):\n",
@ -219,12 +232,12 @@
" m = C.exponent\n", " m = C.exponent\n",
" p = C.characteristic\n", " p = C.characteristic\n",
" g = self.function\n", " g = self.function\n",
" RXpy.<Xp, y> = PolynomialRing(QQ, 2)\n", " RXy.<X, y> = PolynomialRing(QQ, 2)\n",
" FXpy = FractionField(RXpy)\n", " FXy = FractionField(RXy)\n",
" g = RXpy(g)\n", " g = RXy(g)\n",
" A = g.derivative(Xp)*Xp^(-(p-1))/p\n", " A = g.derivative(X)*X^(-(p-1))/p\n",
" t = teichmuller(f)\n", " t = teichmuller(f)\n",
" B = g.derivative(y)*t.derivative()/(m*y^(m-1))*Xp^(-(p-1))/p\n", " B = g.derivative(y)*t.derivative()/(m*y^(m-1))*X^(-(p-1))/p\n",
" return superelliptic_form(C, A+B)\n", " return superelliptic_form(C, A+B)\n",
" \n", " \n",
"class superelliptic_form:\n", "class superelliptic_form:\n",
@ -662,6 +675,76 @@
"t.differentiate(Xp)" "t.differentiate(Xp)"
] ]
}, },
{
"cell_type": "code",
"execution_count": 75,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"RxX.<x, X> = PolynomialRing(QQ)"
]
},
{
"cell_type": "code",
"execution_count": 76,
"metadata": {
"collapsed": false
},
"outputs": [
],
"source": [
"g = RxX(x*X + 2*x*X^3)"
]
},
{
"cell_type": "code",
"execution_count": 82,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"3"
]
},
"execution_count": 82,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"g.monomials()[0].degree(X)"
]
},
{
"cell_type": "code",
"execution_count": 78,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"2"
]
},
"execution_count": 78,
"metadata": {
},
"output_type": "execute_result"
}
],
"source": [
"g.coefficient(x*X^3)"
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 0, "execution_count": 0,