From d30ead5c7d3fcd9d553fc44af7ce679a4f549dd4 Mon Sep 17 00:00:00 2001 From: jgarnek Date: Tue, 11 Oct 2022 19:17:22 +0000 Subject: [PATCH] dodane rozwiniecie w niesk --- superelliptic.ipynb | 304 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 269 insertions(+), 35 deletions(-) diff --git a/superelliptic.ipynb b/superelliptic.ipynb index 5b97fcf..d035a55 100644 --- a/superelliptic.ipynb +++ b/superelliptic.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 54, + "execution_count": 55, "metadata": { "collapsed": false }, @@ -271,20 +271,66 @@ " 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", + " F = C.base_ring\n", + " g = self.function\n", + " Rxy. = PolynomialRing(F, 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", " \n", - "def diffn(self):\n", - " C = self.curve\n", - " f = C.polynomial\n", - " m = C.exponent\n", - " F = C.base_ring\n", - " g = self.function\n", - " Rxy. = PolynomialRing(F, 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", + " def expansion_at_infty(self, i = 0, prec=10):\n", + " C = self.curve\n", + " f = C.polynomial\n", + " m = C.exponent\n", + " F = C.base_ring\n", + " Rx. = PolynomialRing(F)\n", + " f = Rx(f)\n", + " Rt. = LaurentSeriesRing(F, default_prec=prec)\n", + " RptW. = PolynomialRing(Rt)\n", + " RptWQ = FractionField(RptW)\n", + " Rxy. = PolynomialRing(F)\n", + " RxyQ = FractionField(Rxy)\n", + " fct = self.function\n", + " fct = RxyQ(fct)\n", + " r = f.degree()\n", + " delta, a, b = xgcd(m, r)\n", + " b = -b\n", + " M = m/delta\n", + " R = r/delta\n", + " while a<0:\n", + " a += R\n", + " b += M\n", " \n", + " g = (x^r*f(x = 1/x))\n", + " gW = RptWQ(g(x = t^M * W^b)) - W^(delta)\n", + " ww = naive_hensel(gW, F, start = root_of_unity(F, delta), prec = prec)\n", + " xx = Rt(1/(t^M*ww^b))\n", + " yy = 1/(t^R*ww^a)\n", + " return Rt(fct(x = Rt(xx), y = Rt(yy)))\n", + " \n", + "def naive_hensel(fct, F, start = 1, prec=10):\n", + " Rt. = LaurentSeriesRing(F, default_prec=prec)\n", + " RtQ = FractionField(Rt)\n", + " RptW. = PolynomialRing(RtQ)\n", + " fct = RptW(fct)\n", + " alpha = (fct.derivative())(W = start)\n", + " w0 = Rt(1)\n", + " i = 1\n", + " while(i < prec):\n", + " a = 0\n", + " while(Rt(fct(W = w0)).valuation()) <= i:\n", + " w0 = w0 - fct(W = w0)/alpha\n", + " i += 1\n", + " return w0\n", + "\n", "class superelliptic_form:\n", " def __init__(self, C, g):\n", " F = C.base_ring\n", @@ -405,12 +451,20 @@ " if(-d*M + j*R -(M+1)<0):\n", " return 0\n", " return 1\n", - " \n", - " \n", + "\n", + " def expansion_at_infty(self, i = 0, prec=10):\n", + " g = self.form\n", + " C = self.curve\n", + " g = superelliptic_function(C, g)\n", + " g = g.expansion_at_infty(i = i, prec=prec)\n", + " x_series = superelliptic_function(C, x).expansion_at_infty(i = i, prec=prec)\n", + " dx_series = x_series.derivative()\n", + " return g*dx_series\n", + " \n", "class superelliptic_cech:\n", " def __init__(self, C, omega, fct):\n", " self.omega0 = omega\n", - " self.omega8 = omega - diffn(fct)\n", + " self.omega8 = omega - fct.diffn()\n", " self.f = fct\n", " self.curve = C\n", " \n", @@ -560,18 +614,17 @@ " 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": 55, - "metadata": { - "collapsed": false - }, - "outputs": [ - ], - "source": [ + " return result\n", + "\n", + "#Find delta-th root of unity in field F\n", + "def root_of_unity(F, delta):\n", + " Rx. = PolynomialRing(F)\n", + " cyclotomic = x^(delta) - 1\n", + " for root, a in cyclotomic.roots():\n", + " powers = [root^d for d in delta.divisors() if d!= delta]\n", + " if 1 not in powers:\n", + " return root\n", + " \n", "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", @@ -657,7 +710,18 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 0, + "metadata": { + "collapsed": false + }, + "outputs": [ + ], + "source": [ + ] + }, + { + "cell_type": "code", + "execution_count": 56, "metadata": { "collapsed": false }, @@ -671,7 +735,19 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 58, + "metadata": { + "collapsed": false + }, + "outputs": [ + ], + "source": [ + "omega = C.de_rham_basis()[3]" + ] + }, + { + "cell_type": "code", + "execution_count": 51, "metadata": { "collapsed": false }, @@ -679,19 +755,176 @@ { "data": { "text/plain": [ - "[0 0 1]\n", - "[0 2 0]\n", - "[1 2 0]" + "3*t^2 + 3*t^14 + t^16 + 3*t^26 + 3*t^28 + 3*t^30 + 3*t^38 + t^40 + 3*t^50 + 3*t^62 + t^72 + t^74 + 2*t^76 + 4*t^84 + 2*t^86 + 4*t^88 + 4*t^90 + 2*t^96 + 4*t^98 + t^100 + O(t^114)" ] }, - "execution_count": 59, + "execution_count": 51, "metadata": { }, "output_type": "execute_result" } ], "source": [ - "C.cartier_matrix()" + "omega.omega8().exp" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + ], + "source": [ + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + ], + "source": [ + "F = QQ\n", + "Rt. = LaurentSeriesRing(F, default_prec=20)\n", + "RtQ = FractionField(Rt)\n", + "RptW. = PolynomialRing(RtQ)\n", + "fct = W^2 - (1+t)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + ], + "source": [ + "A = naive_hensel(fct, F, start = 1, prec=10)" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "WARNING: Some output was deleted.\n" + ] + } + ], + "source": [ + "A^2 - (1+t)" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + ], + "source": [ + "FF = GF(5^6)" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[(4, 1),\n", + " (1, 1),\n", + " (3*z6^5 + 4*z6^4 + 3*z6^2 + 2*z6 + 2, 1),\n", + " (3*z6^5 + 4*z6^4 + 3*z6^2 + 2*z6 + 1, 1),\n", + " (2*z6^5 + z6^4 + 2*z6^2 + 3*z6 + 4, 1),\n", + " (2*z6^5 + z6^4 + 2*z6^2 + 3*z6 + 3, 1)]" + ] + }, + "execution_count": 56, + "metadata": { + }, + "output_type": "execute_result" + } + ], + "source": [ + "Rx. = PolynomialRing(FF)\n", + "(x^6 - 1).roots()" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "3*z2 + 3" + ] + }, + "execution_count": 57, + "metadata": { + }, + "output_type": "execute_result" + } + ], + "source": [ + "root_of_unity(GF(5^2), 3)" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "x^2 + x + 1" + ] + }, + "execution_count": 52, + "metadata": { + }, + "output_type": "execute_result" + } + ], + "source": [ + "Rx. = PolynomialRing(GF(5^3))\n", + "Rx(x^2 + x + 1).factor()" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ + ], + "source": [ + "a = GF(5^3).random_element()" ] }, { @@ -703,6 +936,7 @@ "outputs": [ ], "source": [ + "a" ] } ],