{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "050758e0-be1e-497b-b19b-2daf03d253f2", "metadata": {}, "outputs": [], "source": [ "load('zetas_triples_general.py')" ] }, { "cell_type": "code", "execution_count": 2, "id": "7d68f9ce-8bfb-4a97-9cff-c79fa4295bcd", "metadata": {}, "outputs": [], "source": [ "R3. = PolynomialRing(QQ, order='negdeglex')\n", "R2. = PolynomialRing(QQ, order='negdeglex')\n", "def surface(f, g):\n", " sb = {u: x, v: y}\n", " return z^3 - 3 * f.subs(sb) * z + 2 * g.subs(sb)\n", "\n", "def discrim3(f, g):\n", " return f^3 - g^2\n", "\n", "def milnor(F):\n", " return F.jacobian_ideal().vector_space_dimension()\n", "\n", "def factoresNewton(f):\n", " return [p.factor() for p in ZetaFunctions(f).get_polyfaces_dictionary(compact=True)\n", " if p.number_of_terms() > 1]" ] }, { "cell_type": "code", "execution_count": 20, "id": "a13a69d1-427f-4cba-984f-04cfd3e3f733", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# f = ((v^2 + u^3)^2 + u^5*v) * ((u^2 + v^3)^2 + v^5*u)\n", "f = (v^6 + u^7) * (u^6 + v^7)\n", "# g = (v^4 + u^6) * (u^4 + v^6)\n", "g = ((v^2 + u^3)^2 + u^5*v) * ((u^2 + v^3)^2 + v^5*u)\n", "hs = []\n", "ks = [((u^2 + v^3) * (v^2 + u^3), 4)]\n", "ff = f * prod(p^j for p, j in hs) * prod(p for p, j in ks)\n", "gg = g * prod(p^j for p, j in ks) * prod(p for p, j in hs)\n", "d = R2(discrim3(ff, gg) / prod(p^2 for p, j in hs) / prod(p^3 for p, j in ks))\n", "[(f, j) for f, j in d.factor() if j > 1]#, milnor(surface(f, g))" ] }, { "cell_type": "code", "execution_count": 21, "id": "6bb64d4a-4731-4902-8408-61e08a19bc5f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[u^25 * (3*v^12 + 3*u^7*v^6 + u^14),\n", " v^25 * (3*u^12 + 3*u^6*v^7 + v^14),\n", " (3) * (u + v) * v^12 * u^12 * (u^12 - u^11*v + u^10*v^2 - u^9*v^3 - 2*u^8*v^4 + 2*u^7*v^5 - 2*u^6*v^6 + 2*u^5*v^7 - 2*u^4*v^8 - u^3*v^9 + u^2*v^10 - u*v^11 + v^12)]" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "factoresNewton(d)" ] }, { "cell_type": "code", "execution_count": 34, "id": "c25f0826-7206-4767-883c-8e9c164a18c2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# f = ((v^2 + u^3)^2 + u^5 * v) * ((u^2 + v^3)^2 + v^5 * u)\n", "f = (v^4 + u^5) * (v^5 + u^4)\n", "g = (v^6 + u^8) * (u^6 + v^8)\n", "# g = ((v^3 + u^5)^2 + u^2 * v^5) * ((u^3 + v^5)^2 + v^2 * u^5)\n", "hs = []\n", "ks = []\n", "ff = f * prod(p^j for p, j in hs) * prod(p for p, j in ks)\n", "gg = g * prod(p^j for p, j in ks) * prod(p for p, j in hs)\n", "d = R2(discrim3(ff, gg) / prod(p^2 for p, j in hs) / prod(p^3 for p, j in ks))\n", "[(f, j) for f, j in d.factor() if j > 1]#, milnor(surface(f, g))" ] }, { "cell_type": "code", "execution_count": 33, "id": "949563f9-dd7e-4db3-9101-a4f3a2003481", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(-1) * v^19 * (2*u^6 + v^7),\n", " (-1) * u^19 * (2*v^6 + u^7),\n", " (-1) * (u + v) * v^6 * u^6 * (2*u^12 - 2*u^11*v - u^10*v^2 + u^9*v^3 - u^8*v^4 + u^7*v^5 - u^6*v^6 + u^5*v^7 - u^4*v^8 + u^3*v^9 - u^2*v^10 - 2*u*v^11 + 2*v^12)]" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "factoresNewton(d)" ] }, { "cell_type": "code", "execution_count": 14, "id": "66f80ac9-aef5-4ea7-8770-335fbdce37d0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(-1) * (49*v^2 + u^13)]" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d1 = R2(d(u=u^7, v=u^6 * (v - 1))/ u^156)\n", "factoresNewton(d)" ] }, { "cell_type": "code", "execution_count": 127, "id": "1acb3dcb-8044-4672-8c44-2ec5c4173fa0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "((-1) * (-u^4*v^3 + 3*u^6*v^2 + 3*u^3*v^5 - 3*u^8*v - 6*u^5*v^4 + u^4*v^5 - 3*u^2*v^7 + u^10 + u^7*v^3 + 3*u^4*v^6 - 2*u^2*v^8 + u*v^9 + u^10*v + 2*u^5*v^6 + v^11),)" ] }, "execution_count": 127, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f = u * v - u^3 - v^3\n", "g = u^2 * v^2 - u^5 - v^5\n", "hs = [(u, 1)]\n", "ks = [(v, 2)]\n", "ff = f * prod(p^j for p, j in hs) * prod(p for p, j in ks)\n", "gg = g * prod(p^j for p, j in ks) * prod(p for p, j in hs)\n", "d = R2(discrim3(ff, gg) / prod(p^2 for p, j in hs) / prod(p^3 for p, j in ks))\n", "d.factor(), # milnor(surface(ff, gg))" ] }, { "cell_type": "code", "execution_count": 128, "id": "f9fb1d7b-9e33-46ce-bf7b-776c7d04f6fa", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(-1) * v^3 * (-u^4 + 3*u^3*v^2 - 3*u^2*v^4 + u*v^6 + v^8), u^4 * (v - u^2)^3]" ] }, "execution_count": 128, "metadata": {}, "output_type": "execute_result" } ], "source": [ "factoresNewton(d)" ] }, { "cell_type": "code", "execution_count": 132, "id": "b32d46f1-1e18-403e-b813-e2221188c9ea", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(-1) * (-1 + 4*u) * (-1 + u)^2" ] }, "execution_count": 132, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(-u^4 + 3*u^3*v^2 - 3*u^2*v^4 + u*v^6 + v^8)(v=1).derivative(u).factor()" ] }, { "cell_type": "code", "execution_count": 143, "id": "51b8b296-2523-47c5-a5bb-b1f559d897f6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 143, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(-u^4 + 3*u^3*v^2 - 3*u^2*v^4 + u*v^6 + v^8)(v=1).derivative(u)(u=1 / 4)" ] }, { "cell_type": "code", "execution_count": 136, "id": "51298dd8-ab45-4244-a5d4-30cbaaabd783", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-1 * 7^6 * 31^-4" ] }, "execution_count": 136, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(ff(u=1 / 4, v=1)^3/gg(u=1 / 4, v=1)^2).factor()" ] }, { "cell_type": "code", "execution_count": 151, "id": "7fc67ac3-d76e-4c24-98b5-6c0d6057e37a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(-1/6912) * v^3 * (-4*u + v^2)^2 * (16*u^2 - 40*u*v^2 + 27*v^4),\n", " (-1/27) * u^4 * (v - u^2)^3]" ] }, "execution_count": 151, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dd = R2(discrim3(-ff / 3, gg / 16) / prod(p^2 for p, j in hs) / prod(p^3 for p, j in ks))\n", "factoresNewton(dd)" ] }, { "cell_type": "code", "execution_count": 153, "id": "788a5bda-775a-4001-a390-4adfecd1450f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(1/6144) * v^7 * (-256*u^2 + 3*v^5),\n", " (-1/27) * u^4 * (v - u^2)^3,\n", " (-1/216) * u^2 * v^3 * (8*u^2 - 16*u*v^2 + 9*v^4)]" ] }, "execution_count": 153, "metadata": {}, "output_type": "execute_result" } ], "source": [ "factoresNewton(dd(u=u + v^2 / 4))" ] }, { "cell_type": "code", "execution_count": 121, "id": "1acc71df-f964-4acd-ba7c-11f98c3c4f02", "metadata": {}, "outputs": [], "source": [ "d1 = R2(d(v=v^2, u=v^3 * (u + 1)) / v^22)\n", "g1 = R2(g(v=v^2, u=v^3 * (u + 1)) / v^10)" ] }, { "cell_type": "code", "execution_count": 122, "id": "7be2ed6b-2bdd-418a-8b14-6f6baf147c27", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[-4*u^2 + v^5]" ] }, "execution_count": 122, "metadata": {}, "output_type": "execute_result" } ], "source": [ "factoresNewton(d1)" ] }, { "cell_type": "code", "execution_count": 123, "id": "2546d6ca-f3d1-4425-b6b8-54205f2af7c9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(-1) * (-2*u + v^5)]" ] }, "execution_count": 123, "metadata": {}, "output_type": "execute_result" } ], "source": [ "factoresNewton(g1)" ] }, { "cell_type": "code", "execution_count": 106, "id": "ef51632f-a8a0-4655-b471-76a4b975e9d7", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(\\begin{array}{rrrrr}\n", "-5 & 0 & 1 & 0 & 1 \\\\\n", "0 & -2 & 1 & 0 & 0 \\\\\n", "1 & 1 & -1 & 0 & 0 \\\\\n", "0 & 0 & 0 & -2 & 1 \\\\\n", "1 & 0 & 0 & 1 & -1\n", "\\end{array}\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(\\begin{array}{rrrrr}\n", "-5 & 0 & 1 & 0 & 1 \\\\\n", "0 & -2 & 1 & 0 & 0 \\\\\n", "1 & 1 & -1 & 0 & 0 \\\\\n", "0 & 0 & 0 & -2 & 1 \\\\\n", "1 & 0 & 0 & 1 & -1\n", "\\end{array}\\right)$" ], "text/plain": [ "[-5 0 1 0 1]\n", "[ 0 -2 1 0 0]\n", "[ 1 1 -1 0 0]\n", "[ 0 0 0 -2 1]\n", "[ 1 0 0 1 -1]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A = Matrix(QQ, 5)\n", "for i, j in ((0, 2), (0, 4), (1, 2), (3, 4)):\n", " A[i, j] = A[j, i] = 1\n", "A[0, 0] = -5\n", "A[1, 1] = A[3, 3] = -2\n", "A[2, 2] = A[4, 4] = -1\n", "show(A)\n", "Vf = vector(QQ, [0, 1, 0, 1, 0])\n", "Vg = vector(QQ, [0, 0, 1, 0, 1])\n", "Vd = vector(QQ, [5, 0, 1, 0, 1])\n", "Vhs = ((vector(QQ, [0, 1, 0, 1, 0]), 1),)\n", "Vks = ()" ] }, { "cell_type": "code", "execution_count": 107, "id": "30f4affd-a57c-4c4a-b6a4-dc34bb42245e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(5,\n", " (2, 3, 5, 3, 5),\n", " (4, 5, 10, 5, 10),\n", " (9, 10, 20, 10, 20),\n", " [((1, 2, 3, 1, 2), 1), ((1, 1, 2, 2, 3), 1)],\n", " [],\n", " (-5, -1, -2, -1, -2),\n", " (2, 3, 5, 3, 5),\n", " False)" ] }, "execution_count": 107, "metadata": {}, "output_type": "execute_result" } ], "source": [ "n, Nf, Ng, Nd, Nhs, Nks, euler, nus, pols == trinomiales_general(A, Vf, Vg, Vhs, Vks, Vd, total=True)" ] }, { "cell_type": "code", "execution_count": 81, "id": "9947139a-5e98-478e-b649-971f96b3a5d1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(4, 6, 10, 6, 10)" ] }, "execution_count": 81, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Nf + sum(j * V0 for V0, j in Nhs) + sum(V0 for V0, j in Nks)" ] }, { "cell_type": "code", "execution_count": 82, "id": "5e717f0e-d183-4791-b92d-eb709b7b7452", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(6, 8, 15, 8, 15)" ] }, "execution_count": 82, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Ng + sum(j * V0 for V0, j in Nks) + sum(V0 for V0, j in Nhs)" ] }, { "cell_type": "code", "execution_count": 83, "id": "b54c5c8b-04e8-4c45-b82b-caeb3d73252e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(13, 16, 30, 16, 30)" ] }, "execution_count": 83, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Nd + 3 * sum(V0 for V0, j in Nks) + 2 * sum(V0 for V0, j in Nhs)" ] }, { "cell_type": "code", "execution_count": 84, "id": "a1544358-9d8c-411a-b30c-18630767a9c1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0\n", "(z^3 + x^2*z^2 + x^7, (2, 1, 1), -5)\n", "===\n", "1\n", "(z^3 + x^6*z + x^8, (3, 1, 1), -1)\n", "===\n", "2\n", "(z^3 + x^10*z + x^15, (5, 1, 1), -2)\n", "===\n", "3\n", "(z^3 + x^6*z + x^8, (3, 1, 1), -1)\n", "===\n", "4\n", "(z^3 + x^10*z + x^15, (5, 1, 1), -2)\n", "===\n", "(0, 2)\n", "(z^3 + x^2*y^5*z^2 + x^7*y^15, (2, 5, 1), 1)\n", "===\n", "(0, 4)\n", "(z^3 + x^2*y^5*z^2 + x^7*y^15, (2, 5, 1), 1)\n", "===\n", "(1, 2)\n", "(z^3 + x^6*y^10*z + x^8*y^15, (3, 5, 1), 1)\n", "===\n", "(3, 4)\n", "(z^3 + x^6*y^10*z + x^8*y^15, (3, 5, 1), 1)\n", "===\n", "(0, 'd')\n", "(z^3 + x^2*z^2 + x^7*y, (2, 1, 1), 5)\n", "===\n", "(1, 'f')\n", "(z^3 + x^8 + x^6*y*z, (3, 1, 1), 1)\n", "===\n", "(2, 'g')\n", "(z^3 + x^10*z + x^15*y, (5, 1, 1), 1)\n", "===\n", "(2, 'd')\n", "(z^3 + x^5*z^2 + x^15*y, (5, 1, 1), 1)\n", "===\n", "(3, 'f')\n", "(z^3 + x^8 + x^6*y*z, (3, 1, 1), 1)\n", "===\n", "(4, 'g')\n", "(z^3 + x^10*z + x^15*y, (5, 1, 1), 1)\n", "===\n", "(4, 'd')\n", "(z^3 + x^5*z^2 + x^15*y, (5, 1, 1), 1)\n", "===\n", "(1, ('h', 0))\n", "(z^3 + x^6*y*z + x^8*y, (3, 1, 1), 1)\n", "===\n", "(3, ('h', 1))\n", "(z^3 + x^6*y*z + x^8*y, (3, 1, 1), 1)\n", "===\n" ] } ], "source": [ "for k in pols:\n", " print(k)\n", " print(pols[k])\n", " print(\"===\")" ] }, { "cell_type": "code", "execution_count": 86, "id": "e1d42c5c-80cf-4298-8026-31f8bfc2d5bb", "metadata": {}, "outputs": [], "source": [ "zt, zm, dic = zetas(n, pols, info=True)" ] }, { "cell_type": "code", "execution_count": 90, "id": "3f0385d7-0397-485e-a870-09e9d7f65e27", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0\n", "(1737/350) * (s + 9/14)^-1\n", "(-56/15) * (s + 2/3)^-1\n", "(-28/25) * (s + 1)^-1\n" ] } ], "source": [ "quo, L = zt.partial_fraction_decomposition()\n", "print(quo)\n", "for p in L:\n", " print(p.factor())" ] }, { "cell_type": "code", "execution_count": 94, "id": "196d3a0c-81cb-4fc3-b2ab-aa36016ae5b1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "El ciclotómico de orden 1 tiene multiplicidad 3\n", "El ciclotómico de orden 2 tiene multiplicidad 5\n", "El ciclotómico de orden 3 tiene multiplicidad 3\n", "El ciclotómico de orden 5 tiene multiplicidad 2\n", "El ciclotómico de orden 14 tiene multiplicidad 5\n", "El ciclotómico de orden 15 tiene multiplicidad 2\n" ] } ], "source": [ "for j in dic:\n", " print(\"El ciclotómico de orden \", j, \" tiene multiplicidad \", dic[j])" ] }, { "cell_type": "code", "execution_count": 108, "id": "e9c684cd-c9fa-473a-bb3c-397bfc664735", "metadata": {}, "outputs": [], "source": [ "n1a, Nf1a, Ng1a, Nd1a, Nhs1a, Nks1a, euler1a, nus1a, pols1a = trinomiales_general(A, Vf, Vg, Vhs, Vks, Vd, total=False)" ] }, { "cell_type": "code", "execution_count": 110, "id": "6bde71ac-74ea-414e-9ac2-7a2e62b07b16", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 110, "metadata": {}, "output_type": "execute_result" } ], "source": [ "n1 == n1a and Nf1 == Nf1a and Ng1 == Ng1a and nus1 == nus1a and euler1 == euler1a" ] }, { "cell_type": "code", "execution_count": 111, "id": "659bc2d8-84bd-4098-ad64-c7efbc6c32f2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[((1, 2, 3, 1, 2), 1), ((1, 1, 2, 2, 3), 1)]" ] }, "execution_count": 111, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Nhs1" ] }, { "cell_type": "code", "execution_count": 112, "id": "a3337a8f-82e7-48a2-ae1d-2b6c08f02b52", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[((2, 3, 5, 3, 5), 1)]" ] }, "execution_count": 112, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Nhs1a" ] }, { "cell_type": "code", "execution_count": 113, "id": "7af9041a-217d-4350-8f0f-4f99be179258", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "dict_keys([0, 1, 2, 3, 4, (0, 2), (0, 4), (1, 2), (3, 4), (0, 'd'), (2, 'd'), (4, 'd'), (1, ('h', 0)), (3, ('h', 0))])" ] }, "execution_count": 113, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pols1a.keys()" ] }, { "cell_type": "code", "execution_count": null, "id": "4bf1a1e5-e264-44fa-bd70-50345b91a7cc", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "SageMath 10.3.rc4", "language": "sage", "name": "sagemath-devel" }, "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.11.1" } }, "nbformat": 4, "nbformat_minor": 5 }