2021-08-18 15:44:03 +02:00
|
|
|
{
|
|
|
|
"cells": [
|
2021-08-18 16:08:25 +02:00
|
|
|
{
|
|
|
|
"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",
|
2021-08-18 20:37:06 +02:00
|
|
|
"execution_count": 3,
|
2021-08-18 16:08:25 +02:00
|
|
|
"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",
|
2021-08-18 20:37:06 +02:00
|
|
|
"execution_count": 4,
|
2021-08-18 16:08:25 +02:00
|
|
|
"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",
|
2021-08-18 20:37:06 +02:00
|
|
|
"execution_count": 92,
|
2021-08-18 16:08:25 +02:00
|
|
|
"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",
|
2021-08-18 20:37:06 +02:00
|
|
|
" print(elt)\n",
|
2021-08-18 16:08:25 +02:00
|
|
|
" R.<x> = PolynomialRing(GF(p))\n",
|
2021-08-18 20:37:06 +02:00
|
|
|
" f = R(f)\n",
|
2021-08-18 16:08:25 +02:00
|
|
|
" 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",
|
2021-08-18 20:37:06 +02:00
|
|
|
" print('p1')\n",
|
2021-08-18 16:08:25 +02:00
|
|
|
" return zapis\n",
|
|
|
|
" \n",
|
|
|
|
" if elt[1] == 0:\n",
|
2021-08-18 20:37:06 +02:00
|
|
|
" print('p2')\n",
|
|
|
|
" elt[0] = R(elt[0])\n",
|
2021-08-18 16:08:25 +02:00
|
|
|
" 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",
|
2021-08-18 20:37:06 +02:00
|
|
|
" print('p3')\n",
|
2021-08-18 16:08:25 +02:00
|
|
|
" elt1 = [R(0), R(0)]\n",
|
|
|
|
" elt1[0] = elt[0]\n",
|
|
|
|
" return zapis_w_bazie_dr(elt1, m, f, j, p)\n",
|
|
|
|
" \n",
|
2021-08-18 20:37:06 +02:00
|
|
|
" print('p4')\n",
|
2021-08-18 16:08:25 +02:00
|
|
|
" 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"
|
|
|
|
]
|
|
|
|
},
|
2021-08-18 20:37:06 +02:00
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"We have: $V(\\omega, f) = (C(\\omega), 0)$ and $F(\\omega, f) = (0, f^p)$, where C denotes the Cartier operator. Moreover:\n",
|
|
|
|
"\n",
|
|
|
|
"let $t = multord_m(p)$, $M := (p^t - 1)/m$. Then: $y^{p^t - 1} = f(x)^M$ and $1/y = f(x)^M/y^{p^t}$. Thus:\n",
|
|
|
|
"\n",
|
|
|
|
"\n",
|
|
|
|
"$$ C(P(x) \\, dx / y^j) = C(P(x) \\, f(x)^{M \\cdot j} \\, dx /y^{p^t \\cdot j}) = \\frac{1}{y^{p^{t - 1} \\cdot j}} C(P(x) \\, f(x)^{M \\cdot j} \\, dx) = \\frac{1}{y^{(p^{t - 1} \\cdot j) \\, mod \\, m}} \\cdot \\frac{1}{f(x)^{[p^{t - 1} \\cdot j/m]}} \\cdot C(P(x) \\, f(x)^{M \\cdot j} \\, dx)$$\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 93,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"def czesc_wielomianu(p, h):\n",
|
|
|
|
" R.<x> = PolynomialRing(GF(p))\n",
|
|
|
|
" h = R(h)\n",
|
|
|
|
" wynik = R(0)\n",
|
|
|
|
" for i in range(0, h.degree()+1):\n",
|
|
|
|
" if (i%p) == p-1:\n",
|
|
|
|
" potega = Integer((i-(p-1))/p)\n",
|
|
|
|
" wynik = wynik + Integer(h[i]) * x^(potega) \n",
|
|
|
|
" return wynik\n",
|
|
|
|
"\n",
|
|
|
|
"def cartier_dr(p, m, f, elt, j): #Cartier na y^m = f dla elt = [forma rozniczkowa, fkcja]\n",
|
|
|
|
" R.<x> = PolynomialRing(GF(p))\n",
|
|
|
|
" f = R(f)\n",
|
|
|
|
" r = f.degree()\n",
|
|
|
|
" delta = GCD(m, r)\n",
|
|
|
|
" rzad = Integers(m)(p).multiplicative_order()\n",
|
|
|
|
" M = Integer((p^(rzad)-1)/m)\n",
|
|
|
|
" W = R(elt[0])\n",
|
|
|
|
" h = R(W*f^(M*j))\n",
|
|
|
|
" B = floor(p^(rzad-1)*j/m)\n",
|
|
|
|
" g = czesc_wielomianu(p, h)/f^B\n",
|
|
|
|
" jj = (p^(rzad-1)*j)%m\n",
|
|
|
|
" #jj = Integers(m)(j/p)\n",
|
|
|
|
" return [g, 0] #jest to w czesci indeksowanej jj\n",
|
|
|
|
"\n",
|
|
|
|
"def macierz_cartier_dr(p, m, f, j):\n",
|
|
|
|
" baza = baza_dr(m, f, j, p)\n",
|
|
|
|
" A = matrix(GF(p), len(baza), len(baza))\n",
|
|
|
|
" for k in range(0, len(baza)):\n",
|
|
|
|
" cart = cartier_dr(p, m, f, baza[k], j)\n",
|
|
|
|
" v = zapis_w_bazie_dr(cart, m, f, j, p)\n",
|
|
|
|
" A[k, :] = matrix(v)\n",
|
|
|
|
" return A.transpose()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"$F((\\omega, P(x) \\cdot y^j)) = (0, P(x)^p \\cdot y^{p \\cdot j}) = (0, P(x)^p \\cdot f(x)^{[p \\cdot j/m]} \\cdot y^{(p \\cdot j) \\, mod \\, m})$"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 94,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"def frobenius_dr(p, m, f, elt, j): #Cartier na y^m = f dla elt = [forma rozniczkowa, fkcja]\n",
|
|
|
|
" R.<x> = PolynomialRing(GF(p))\n",
|
|
|
|
" RR = FractionField(R)\n",
|
|
|
|
" f = R(f)\n",
|
|
|
|
" M = floor(j*p/m)\n",
|
|
|
|
" return [0, f^M * RR(elt[1])^p] #eigenspace = j*p mod m\n",
|
|
|
|
"\n",
|
|
|
|
"def macierz_frob_dr(p, m, f, j):\n",
|
|
|
|
" baza = baza_dr(m, f, j, p)\n",
|
|
|
|
" A = matrix(GF(p), len(baza), len(baza))\n",
|
|
|
|
" for k in range(0, len(baza)):\n",
|
|
|
|
" frob = frobenius_dr(p, m, f, baza[k], j)\n",
|
|
|
|
" v = zapis_w_bazie_dr(frob, m, f, j, p)\n",
|
|
|
|
" A[k, :] = matrix(v)\n",
|
|
|
|
" return A.transpose()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 95,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"{0: [1, 0], 1: [x, 2/x]}"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 95,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"m = 2\n",
|
|
|
|
"j = 1\n",
|
|
|
|
"p = 5\n",
|
|
|
|
"f = x^3 + x+3\n",
|
|
|
|
"baza_dr(m, f, j, p)\n",
|
|
|
|
"#macierz_frob_dr(p, m, f, j)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 96,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"[0, (2*x^6 + 4*x^4 + 2*x^3 + 2*x^2 + 2*x + 3)/x^5]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 96,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"frobenius_dr(p, m, f, [x, 2/x], j)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 97,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"[0, (2*x^6 + 4*x^4 + 2*x^3 + 2*x^2 + 2*x + 3)/x^5]\n",
|
|
|
|
"p4\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"ename": "KeyError",
|
|
|
|
"evalue": "-1",
|
|
|
|
"output_type": "error",
|
|
|
|
"traceback": [
|
|
|
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
|
|
"\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)",
|
|
|
|
"\u001b[0;32m<ipython-input-97-b5994066838e>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mzapis_w_bazie_dr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m6\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m4\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m4\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mx\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m5\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mm\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mp\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
|
|
|
|
"\u001b[0;32m<ipython-input-92-50e115077f5c>\u001b[0m in \u001b[0;36mzapis_w_bazie_dr\u001b[0;34m(elt, m, f, j, p)\u001b[0m\n\u001b[1;32m 82\u001b[0m \u001b[0mstopnie2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstopnie_drugiej_wspolrzednej_bazy_dr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mm\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mp\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 83\u001b[0m \u001b[0minv_stopnie2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0mv\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mk\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mk\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mv\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mstopnie2\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mitems\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 84\u001b[0;31m \u001b[0mk\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minv_stopnie2\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0md\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 85\u001b[0m \u001b[0melt1\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mR\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mR\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[0melt1\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0melt\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mbaza\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mk\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mInteger\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
|
|
|
|
"\u001b[0;31mKeyError\u001b[0m: -1"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"zapis_w_bazie_dr([0, (2*x^6 + 4*x^4 + 2*x^3 + 2*x^2 + 2*x + 3)/x^5], m, f, j, p)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 19,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"4*x^4 + 4*x^3 + 4*x^2 + 4*x + 4"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 19,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"h = sum(i*x^i for i in range(0, p^2))\n",
|
|
|
|
"czesc_wielomianu(p, h)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 60,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"{0: [x^2, 0], 1: [x, 0], 2: [1, 0]}"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 60,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"m = 5\n",
|
|
|
|
"j = 1\n",
|
|
|
|
"p = 5\n",
|
|
|
|
"f = x^4 + x+2\n",
|
|
|
|
"baza_dr(m, f, j, p)"
|
|
|
|
]
|
|
|
|
},
|
2021-08-18 16:08:25 +02:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2021-08-18 20:37:06 +02:00
|
|
|
"execution_count": 61,
|
2021-08-18 16:08:25 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
2021-08-18 20:37:06 +02:00
|
|
|
"[0 0 0]\n",
|
|
|
|
"[0 0 0]\n",
|
|
|
|
"[0 0 0]"
|
2021-08-18 16:08:25 +02:00
|
|
|
]
|
|
|
|
},
|
2021-08-18 20:37:06 +02:00
|
|
|
"execution_count": 61,
|
2021-08-18 16:08:25 +02:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2021-08-18 20:37:06 +02:00
|
|
|
"macierz_frob_dr(p, m, f, j)"
|
2021-08-18 16:08:25 +02:00
|
|
|
]
|
|
|
|
},
|
2021-08-18 15:44:03 +02:00
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"kernelspec": {
|
|
|
|
"display_name": "SageMath 9.1",
|
|
|
|
"language": "sage",
|
|
|
|
"name": "sagemath"
|
|
|
|
},
|
|
|
|
"language_info": {
|
|
|
|
"codemirror_mode": {
|
|
|
|
"name": "ipython",
|
|
|
|
"version": 3
|
|
|
|
},
|
|
|
|
"file_extension": ".py",
|
|
|
|
"mimetype": "text/x-python",
|
|
|
|
"name": "python",
|
|
|
|
"nbconvert_exporter": "python",
|
|
|
|
"pygments_lexer": "ipython3",
|
|
|
|
"version": "3.7.3"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 2
|
|
|
|
}
|