{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "059090e2-2eb8-4534-8e67-fb0b78e28b93", "metadata": {}, "outputs": [], "source": [ "from IPython.display import Math\n", "import numpy as np\n", "import pandas as pd\n", "from IPython.display import HTML" ] }, { "cell_type": "code", "execution_count": 2, "id": "33ded6d8-8fc7-4f3f-8c38-40f57aaf4abc", "metadata": {}, "outputs": [], "source": [ "Z = IntegralLattice( Matrix(ZZ, [1] ) )\n", "Z2 = Z.twist(2)\n", "\n", "H = IntegralLattice(\"H\")\n", "U = H\n", "\n", "H_2 = H.twist(2)\n", "U_2 = H_2\n", "\n", "A1 = IntegralLattice(\"A1\").twist(-1)\n", "A2 = IntegralLattice(\"A2\").twist(-1)\n", "A3 = IntegralLattice(\"A3\").twist(-1)\n", "A4 = IntegralLattice(\"A4\").twist(-1)\n", "A5 = IntegralLattice(\"A5\").twist(-1)\n", "\n", "D4 = IntegralLattice(\"D4\").twist(-1)\n", "D5 = IntegralLattice(\"D5\").twist(-1)\n", "D6 = IntegralLattice(\"D6\").twist(-1)\n", "D7 = IntegralLattice(\"D7\").twist(-1)\n", "D8 = IntegralLattice(\"D8\").twist(-1)\n", "D16 = IntegralLattice(\"D16\").twist(-1)\n", "D17 = IntegralLattice(\"D17\").twist(-1)\n", "D19 = IntegralLattice(\"D19\").twist(-1)\n", "\n", "\n", "E6 = IntegralLattice(\"E6\").twist(-1)\n", "E7 = IntegralLattice(\"E7\").twist(-1)\n", "E8 = IntegralLattice(\"E8\").twist(-1)\n", "\n", "E8_2 = E8.twist(2)\n", "\n", "E10 = E8.direct_sum(U)\n", "E10_2 = E10.twist(2)\n", "\n", "A1_7 = A1.direct_sum(A1).direct_sum(A1).direct_sum(A1).direct_sum(A1).direct_sum(A1).direct_sum(A1)\n", "A1_8 = A1.direct_sum(A1).direct_sum(A1).direct_sum(A1).direct_sum(A1).direct_sum(A1).direct_sum(A1).direct_sum(A1)\n", "\n", "def Ipq(p, q):\n", " return reduce(lambda a, b: a.direct_sum(b),\n", " ([Z] * p) \n", " + ([Z.twist(-1)] * q)\n", " )" ] }, { "cell_type": "code", "execution_count": 3, "id": "16ecb31e-5a19-4d96-843f-be936c84a719", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(2, 18)" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L = U.direct_sum(U).direct_sum(D16)\n", "L.signature_pair()\n", "#binomial(3+4, 3)" ] }, { "cell_type": "code", "execution_count": 4, "id": "6ec14c35-dae9-483d-9279-08e92b5cd23d", "metadata": {}, "outputs": [], "source": [ "Ten = U.direct_sum(U.twist(2)).direct_sum(E8.twist(2))\n", "Tco = Z2.direct_sum(U.twist(2)).direct_sum(E8.twist(2))\n", "TdP = U.direct_sum(U_2).direct_sum(E8).direct_sum(E8)\n", "Lk3 = U.direct_sum(U).direct_sum(U).direct_sum(E8).direct_sum(E8)" ] }, { "cell_type": "code", "execution_count": 5, "id": "0537d918-8349-4b44-bd1d-bd6bbad76566", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Finite quadratic module over Integer Ring with invariants (2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2)\n", "Gram matrix of the quadratic form with values in Q/2Z:\n", "[1/2 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 1/2 0 0 0 0 0 0 0 0]\n", "[ 0 1/2 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 1 0 1/2 0 0 0 0 0]\n", "[ 0 0 0 0 1 0 1/2 0 0 0 0]\n", "[ 0 0 0 1/2 0 1 1/2 0 0 0 0]\n", "[ 0 0 0 0 1/2 1/2 1 1/2 0 0 0]\n", "[ 0 0 0 0 0 0 1/2 1 1/2 0 0]\n", "[ 0 0 0 0 0 0 0 1/2 1 1/2 0]\n", "[ 0 0 0 0 0 0 0 0 1/2 1 1/2]\n", "[ 0 0 0 0 0 0 0 0 0 1/2 1]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Aen = Tco.discriminant_group()\n", "Aen" ] }, { "cell_type": "code", "execution_count": 5, "id": "dc2fed35-7146-45d0-892b-54e2e5842b73", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(11, 11)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "[1/2 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 1/2 0 0 0 0 0 0 0 0]\n", "[ 0 1/2 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 1 0 1/2 0 0 0 0 0]\n", "[ 0 0 0 0 1 0 1/2 0 0 0 0]\n", "[ 0 0 0 1/2 0 1 1/2 0 0 0 0]\n", "[ 0 0 0 0 1/2 1/2 1 1/2 0 0 0]\n", "[ 0 0 0 0 0 0 1/2 1 1/2 0 0]\n", "[ 0 0 0 0 0 0 0 1/2 1 1/2 0]\n", "[ 0 0 0 0 0 0 0 0 1/2 1 1/2]\n", "[ 0 0 0 0 0 0 0 0 0 1/2 1]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Qen = Aen.gram_matrix_quadratic()\n", "display(Qen.dimensions())\n", "Qen" ] }, { "cell_type": "code", "execution_count": 6, "id": "50527d67-3fee-4556-829a-7c033e6242bd", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1/2 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 1/2 0 0 0 0 0 0 0 0]\n", "[ 0 1/2 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 0 0 1/2 0 0 0 0 0]\n", "[ 0 0 0 0 0 0 1/2 0 0 0 0]\n", "[ 0 0 0 1/2 0 0 1/2 0 0 0 0]\n", "[ 0 0 0 0 1/2 1/2 0 1/2 0 0 0]\n", "[ 0 0 0 0 0 0 1/2 0 1/2 0 0]\n", "[ 0 0 0 0 0 0 0 1/2 0 1/2 0]\n", "[ 0 0 0 0 0 0 0 0 1/2 0 1/2]\n", "[ 0 0 0 0 0 0 0 0 0 1/2 0]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Aen.gram_matrix_bilinear()" ] }, { "cell_type": "code", "execution_count": 7, "id": "3dc7891e-3bc9-4010-b7aa-77dde24c13fb", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1/2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1]" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Qen = Aen.gram_matrix_quadratic()\n", "quad_Aen = lambda x: vector(x) * Qen * vector(x)\n", "#a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 = [Aen.gens_vector(x) for x in Aen.gens()]\n", "#a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11 = Aen.gens()\n", "[quad_Aen(x) for x in Aen.gens() ]" ] }, { "cell_type": "code", "execution_count": 64, "id": "bdbb1023-b6d2-48d1-9a27-1f04f7b272f2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2048" ] }, "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Aen.cardinality()" ] }, { "cell_type": "code", "execution_count": 68, "id": "9a3035b1-1bce-4624-8bd8-bb57ff5d99bb", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "n = 3/2\n", "n.is_integer()" ] }, { "cell_type": "code", "execution_count": 77, "id": "c4d958aa-98fd-4c76-a012-57d1fc18c597", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "528" ] }, "execution_count": 77, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ls = [(x, quad_Aen(x)) for x in Aen]\n", "#display(ls)\n", "lsp = [x for x in ls if x[1].is_integer() ]\n", "len(lsp)\n", "lspp = [x for x in lsp if x[1] % 2 == 0]\n", "len(lspp)" ] }, { "cell_type": "code", "execution_count": 53, "id": "3b155dc7-a2d1-44f0-9989-9ebcef1ec96c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "528" ] }, "execution_count": 53, "metadata": {}, "output_type": "execute_result" } ], "source": [ "isotrops = [x for x in Aen if quad_Aen(x) % 2 == 0]\n", "len(isotrops)" ] }, { "cell_type": "code", "execution_count": 14, "id": "91bd9234-6209-4616-be5e-57e5a57067e0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Finite quadratic module over Integer Ring with invariants (2, 2, 2, 2, 2, 2, 2, 2, 2, 2)\n", "Gram matrix of the quadratic form with values in Q/2Z:\n", "[ 0 1/2 0 0 0 0 0 0 0 0]\n", "[1/2 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 1 0 1/2 0 0 0 0 0]\n", "[ 0 0 0 1 0 1/2 0 0 0 0]\n", "[ 0 0 1/2 0 1 1/2 0 0 0 0]\n", "[ 0 0 0 1/2 1/2 1 1/2 0 0 0]\n", "[ 0 0 0 0 0 1/2 1 1/2 0 0]\n", "[ 0 0 0 0 0 0 1/2 1 1/2 0]\n", "[ 0 0 0 0 0 0 0 1/2 1 1/2]\n", "[ 0 0 0 0 0 0 0 0 1/2 1]" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Aen" ] }, { "cell_type": "code", "execution_count": 15, "id": "20e26446-89f9-409d-a46b-db8ba00d6f9b", "metadata": { "scrolled": true }, "outputs": [ { "ename": "KeyboardInterrupt", "evalue": "", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)", "File \u001b[0;32m~/gitclones/sage/src/sage/structure/category_object.pyx:855\u001b[0m, in \u001b[0;36msage.structure.category_object.CategoryObject.getattr_from_category\u001b[0;34m()\u001b[0m\n\u001b[1;32m 854\u001b[0m try:\n\u001b[0;32m--> 855\u001b[0m return self._cached_methods[name]\n\u001b[1;32m 856\u001b[0m except KeyError:\n", "\u001b[0;31mKeyError\u001b[0m: '_orthogonal_group_gens'", "\nDuring handling of the above exception, another exception occurred:\n", "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", "File \u001b[0;32m~/gitclones/sage/src/sage/modules/torsion_quadratic_module.py:880\u001b[0m, in \u001b[0;36mTorsionQuadraticModule.orthogonal_group\u001b[0;34m(self, gens, check)\u001b[0m\n\u001b[1;32m 879\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 880\u001b[0m gens \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_orthogonal_group_gens\u001b[49m\n\u001b[1;32m 881\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m:\n", "File \u001b[0;32m~/gitclones/sage/src/sage/structure/category_object.pyx:849\u001b[0m, in \u001b[0;36msage.structure.category_object.CategoryObject.__getattr__\u001b[0;34m()\u001b[0m\n\u001b[1;32m 848\u001b[0m \"\"\"\n\u001b[0;32m--> 849\u001b[0m return self.getattr_from_category(name)\n\u001b[1;32m 850\u001b[0m \n", "File \u001b[0;32m~/gitclones/sage/src/sage/structure/category_object.pyx:864\u001b[0m, in \u001b[0;36msage.structure.category_object.CategoryObject.getattr_from_category\u001b[0;34m()\u001b[0m\n\u001b[1;32m 863\u001b[0m \n\u001b[0;32m--> 864\u001b[0m attr = getattr_from_other_class(self, cls, name)\n\u001b[1;32m 865\u001b[0m self._cached_methods[name] = attr\n", "File \u001b[0;32m~/gitclones/sage/src/sage/cpython/getattr.pyx:357\u001b[0m, in \u001b[0;36msage.cpython.getattr.getattr_from_other_class\u001b[0;34m()\u001b[0m\n\u001b[1;32m 356\u001b[0m dummy_error_message.name = name\n\u001b[0;32m--> 357\u001b[0m raise AttributeError(dummy_error_message)\n\u001b[1;32m 358\u001b[0m cdef PyObject* attr = instance_getattr(cls, name)\n", "\u001b[0;31mAttributeError\u001b[0m: 'QmodnZ_with_category' object has no attribute '_SageObject__custom_name'", "\nDuring handling of the above exception, another exception occurred:\n", "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[15], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m O_Aen \u001b[38;5;241m=\u001b[39m \u001b[43mAen\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43morthogonal_group\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2\u001b[0m O_Aen\u001b[38;5;241m.\u001b[39mcardinality()\n\u001b[1;32m 3\u001b[0m \u001b[38;5;66;03m#[g for g in O_Aen]\u001b[39;00m\n", "File \u001b[0;32m~/gitclones/sage/src/sage/modules/torsion_quadratic_module.py:882\u001b[0m, in \u001b[0;36mTorsionQuadraticModule.orthogonal_group\u001b[0;34m(self, gens, check)\u001b[0m\n\u001b[1;32m 880\u001b[0m gens \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_orthogonal_group_gens\n\u001b[1;32m 881\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m:\n\u001b[0;32m--> 882\u001b[0m gens \u001b[38;5;241m=\u001b[39m \u001b[43m_isom_fqf\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 883\u001b[0m gens \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mtuple\u001b[39m(ambient(g) \u001b[38;5;28;01mfor\u001b[39;00m g \u001b[38;5;129;01min\u001b[39;00m gens)\n\u001b[1;32m 884\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_orthogonal_group_gens \u001b[38;5;241m=\u001b[39m gens\n", "File \u001b[0;32m~/gitclones/sage/src/sage/groups/fqf_orthogonal.py:565\u001b[0m, in \u001b[0;36m_isom_fqf\u001b[0;34m(A, B)\u001b[0m\n\u001b[1;32m 563\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m g \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m G:\n\u001b[1;32m 564\u001b[0m G \u001b[38;5;241m=\u001b[39m B\u001b[38;5;241m.\u001b[39morthogonal_group(\u001b[38;5;28mtuple\u001b[39m(ambient(s\u001b[38;5;241m.\u001b[39mmatrix()) \u001b[38;5;28;01mfor\u001b[39;00m s \u001b[38;5;129;01min\u001b[39;00m G\u001b[38;5;241m.\u001b[39mgens())\u001b[38;5;241m+\u001b[39m(g,))\n\u001b[0;32m--> 565\u001b[0m waiting \u001b[38;5;241m=\u001b[39m \u001b[43morbits\u001b[49m\u001b[43m(\u001b[49m\u001b[43mG\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mwaiting\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 566\u001b[0m \u001b[38;5;28;01mcontinue\u001b[39;00m\n\u001b[1;32m 567\u001b[0m \u001b[38;5;66;03m# extend f to an i+1 - partial isometry in all possible ways\u001b[39;00m\n", "File \u001b[0;32m~/gitclones/sage/src/sage/groups/fqf_orthogonal.py:535\u001b[0m, in \u001b[0;36m_isom_fqf..orbits\u001b[0;34m(G, L)\u001b[0m\n\u001b[1;32m 533\u001b[0m A \u001b[38;5;241m=\u001b[39m G\u001b[38;5;241m.\u001b[39mdomain()\n\u001b[1;32m 534\u001b[0m L \u001b[38;5;241m=\u001b[39m libgap([[A(g)\u001b[38;5;241m.\u001b[39mgap() \u001b[38;5;28;01mfor\u001b[39;00m g \u001b[38;5;129;01min\u001b[39;00m f] \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m L])\n\u001b[0;32m--> 535\u001b[0m orb \u001b[38;5;241m=\u001b[39m \u001b[43mG\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mgap\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mOrbits\u001b[49m\u001b[43m(\u001b[49m\u001b[43mL\u001b[49m\u001b[43m,\u001b[49m\u001b[43mlibgap\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mOnTuples\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 536\u001b[0m orb \u001b[38;5;241m=\u001b[39m [g[\u001b[38;5;241m0\u001b[39m] \u001b[38;5;28;01mfor\u001b[39;00m g \u001b[38;5;129;01min\u001b[39;00m orb]\n\u001b[1;32m 537\u001b[0m orb \u001b[38;5;241m=\u001b[39m [[D\u001b[38;5;241m.\u001b[39mlinear_combination_of_smith_form_gens(A(g)\u001b[38;5;241m.\u001b[39mexponents()) \u001b[38;5;28;01mfor\u001b[39;00m g \u001b[38;5;129;01min\u001b[39;00m f] \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m orb]\n", "File \u001b[0;32m~/gitclones/sage/src/sage/libs/gap/element.pyx:2645\u001b[0m, in \u001b[0;36msage.libs.gap.element.GapElement_MethodProxy.__call__\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2643\u001b[0m \"\"\"\n\u001b[1;32m 2644\u001b[0m if len(args) > 0:\n\u001b[0;32m-> 2645\u001b[0m return GapElement_Function.__call__(self, * ([self.first_argument] + list(args)))\n\u001b[1;32m 2646\u001b[0m else:\n\u001b[1;32m 2647\u001b[0m return GapElement_Function.__call__(self, self.first_argument)\n", "File \u001b[0;32m~/gitclones/sage/src/sage/libs/gap/element.pyx:2514\u001b[0m, in \u001b[0;36msage.libs.gap.element.GapElement_Function.__call__\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2512\u001b[0m try:\n\u001b[1;32m 2513\u001b[0m sig_GAP_Enter()\n\u001b[0;32m-> 2514\u001b[0m sig_on()\n\u001b[1;32m 2515\u001b[0m if n == 0:\n\u001b[1;32m 2516\u001b[0m result = GAP_CallFunc0Args(self.value)\n", "\u001b[0;31mKeyboardInterrupt\u001b[0m: " ] } ], "source": [ "O_Aen = Aen.orthogonal_group()\n", "O_Aen.cardinality()\n", "#[g for g in O_Aen]" ] }, { "cell_type": "code", "execution_count": 24, "id": "89dcad6a-6cdf-4fbb-9828-1e03caebb8f2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "9999360" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "G = GL(5, GF(2)); \n", "display(G.cardinality())" ] }, { "cell_type": "code", "execution_count": 31, "id": "08606359-110a-488f-b924-491676fe8c9f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "9999360" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "720" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "720" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "display( SL(5, GF(2)).cardinality() )\n", "display( GO(5, GF(2)).cardinality() )\n", "display( SO(5, GF(2)).cardinality() )\n" ] }, { "cell_type": "code", "execution_count": 27, "id": "0a567d29-3010-4a8c-abaa-de3dc75df503", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'/tmp/tmp3apuq0sk.sobj'" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "[1 0 0 0 0]\n", "[0 1 0 0 0]\n", "[0 0 1 0 0]\n", "[0 0 0 1 0]\n", "[0 0 0 0 1]" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#test_set = [g for g in G][0:10]\n", "from tempfile import NamedTemporaryFile\n", "with NamedTemporaryFile(suffix=\".sobj\") as t:\n", " G.save(t.name)\n", " display(t.name)\n", "G[0]" ] }, { "cell_type": "code", "execution_count": 26, "id": "a708c177-a0a9-429e-a8f3-8a2d0e984ebc", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0 1 0 0 0]\n", "[0 0 1 0 0]\n", "[0 0 0 1 0]\n", "[0 0 0 0 1]\n", "[1 0 0 0 0]" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "G[1]" ] }, { "cell_type": "code", "execution_count": null, "id": "872466ba-3a5d-4172-a495-ca7bddafbd84", "metadata": {}, "outputs": [], "source": [ "import multiprocessing\n", "\n", "try:\n", " cpus = multiprocessing.cpu_count()\n", "except NotImplementedError:\n", " cpus = 2 # arbitrary default\n", "\n", "\n", "def square(n):\n", " return n * n\n", "\n", "pool = multiprocessing.Pool(processes=cpus)\n", "#print(pool.map(square, range(100000000))[0:100])\n", "\n", "def check_quad(g):\n", " return quad_Aen( vector(QQ, g*vector(GF(2), a1)) ) == quad_Aen(a1)\n", " \n", "#g = G.random_element()\n", "#quad_Aen(a1)\n", "#g * vector(a1)\n", "#quad_Aen( vector(QQ, g*vector(GF(2), a1)) )\n", "P = pool.map(check_quad, test_set)\n", "P[0]" ] }, { "cell_type": "code", "execution_count": null, "id": "c265bc15-8152-4541-a8c8-eaf967620f55", "metadata": {}, "outputs": [], "source": [ "S = Set([ Set([M(v) for M in O_Aen]) for v in isotrops])\n", "for s in S:\n", " display(s)" ] }, { "cell_type": "code", "execution_count": null, "id": "2682de21-7182-4a7a-8571-3cc3b6003a53", "metadata": {}, "outputs": [], "source": [ "G = GO(4, GF(2), 1); \n", "display(G.cardinality())\n", "display(O_Aen.cardinality())\n", "# display(G.random_element())\n", "# while true:\n", "# g = G.random_element()\n", "# if g in O_Aen:\n", "# display(g)\n", "# break\n", "Set(O_Aen)[0] in G\n", "Matrix(QQ, 4, [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]) in O_Aen\n", "g = O_Aen.random_element()\n", "matrix(GF(2), 4, g.matrix()) in G\n", "quad_Aen(g(a1)) == quad_Aen(a1)\n", "g = G[1]\n", "gp = g * vector(a1)\n", "display(gp)\n", "quad_Aen(vector(QQ, gp))\n", "Ls = [g for g in G if quad_Aen(vector(QQ, g * vector(a1))) == quad_Aen(a1)]\n", "len(Ls)" ] }, { "cell_type": "code", "execution_count": null, "id": "69af9b53-6a4a-4861-90a3-a4dcc4bf79fe", "metadata": {}, "outputs": [], "source": [ "G = SO(10, GF(2), 1); G\n", "\n", "v1\n", "a1\n", "while True:\n", " g = G.random_element()\n", " v1 = vector(QQ, matrix(g) * vector(a1) )\n", " if quad_Aen(v1) == quad_Aen(a1):\n", " display(a1)\n", " display(v1)\n", " display(g)\n", " break\n" ] }, { "cell_type": "code", "execution_count": null, "id": "91ef9816-f330-496c-b77b-6ee448e2630d", "metadata": {}, "outputs": [], "source": [ "TdP.signature_pair()\n", "U_2.direct_sum(E8_2).signature_pair()\n", "U_2.signature_pair()\n", "#rad(Lk3)" ] }, { "cell_type": "code", "execution_count": null, "id": "63ab7d03-71fe-4737-bfe6-d453314220ef", "metadata": {}, "outputs": [], "source": [ "Sco = Z2.twist(-1).direct_sum(U.twist(2)).direct_sum(E8.twist(2))\n", "ASco = Sco.discriminant_group()\n", "len( ASco.gens() )\n", "Sco.genus()" ] }, { "cell_type": "code", "execution_count": null, "id": "34a2095d-a963-4d1e-8431-718ee45003bc", "metadata": {}, "outputs": [], "source": [ "e,f, ep, fp, a1, a2, a3, a4, a5, a6, a7, a8, b1, b2, b3, b4, b5, b6, b7, b8 = TdP.gens()\n", "dot_dP = lambda x,y : x * TdP.gram_matrix() * y\n", "nm_dP = lambda x: dot_dP(x, x)\n", "\n", "def divisibility(v, L):\n", " dot_L = lambda x,y : x * L.gram_matrix() * y\n", " nm_L = lambda x: dot_L(x, x)\n", " dots = [ abs( dot_L(v, x) ) for x in L.gens() ]\n", " #print(dots)\n", " nonzero_dots = [abs(l) for l in dots if l != 0]\n", " return ( min(nonzero_dots), dots)\n", "\n", "w = 2*e + 2*f + a1 + a2 + b1 + b2\n", "\n", "dots = [ abs( dot_dP(w, x) ) for x in TdP.gens() ]\n", "print(dots)\n", "nonzero_dots = [l for l in dots if l != 0]\n", "min(nonzero_dots)\n", "\n", "divisibility(w, TdP)" ] }, { "cell_type": "code", "execution_count": null, "id": "f20bcb85-0481-4b61-8ce4-1fe9b3ac4cbb", "metadata": {}, "outputs": [], "source": [ "nm_dP(w)" ] }, { "cell_type": "code", "execution_count": null, "id": "3ff31649-0f4b-43a8-8565-64cf4258532e", "metadata": {}, "outputs": [], "source": [ "def rad(L):\n", " r = L.rank()\n", "\n", " D_L = L.discriminant_group()\n", " a = len( list( filter( lambda x: x == 2, list( D_L.invariants() ) ) ) )\n", "\n", " MQ = D_L.gram_matrix_quadratic()\n", " MQ_diag = [ MQ[z, z] for z in range(MQ.nrows()) ]\n", " diags_are_integers = list( map(lambda x: x.is_integer(), [ MQ[z, z] for z in range(MQ.nrows()) ] ) )\n", " if False in diags_are_integers:\n", " delta = 1\n", " else:\n", " delta = 0\n", " return (r,a, delta)" ] }, { "cell_type": "code", "execution_count": null, "id": "570e7adc-15bd-468c-9bc9-0636f5802829", "metadata": {}, "outputs": [], "source": [ "L = U_2.direct_sum(U_2).direct_sum(A1_7)\n", "display( rad(L) )\n", "L.signature_pair()" ] }, { "cell_type": "code", "execution_count": null, "id": "a546ef3a-875e-42bb-a861-5bf0803549c6", "metadata": {}, "outputs": [], "source": [ "S_nod = Z.twist(-4).direct_sum(E10_2)\n", "rad(S_nod)\n", "S_nod.discriminant_group()" ] }, { "cell_type": "code", "execution_count": null, "id": "98c0e0b6-661d-44b0-acaf-caaacdfe124e", "metadata": {}, "outputs": [], "source": [ "T_nod = Z.twist(-4).direct_sum(U).direct_sum(E8.twist(2))\n", "rad(T_nod)\n", "T_nod.discriminant_group()" ] }, { "cell_type": "code", "execution_count": null, "id": "bd90ce13-1dbb-454f-8da5-fd0bb90f96d8", "metadata": {}, "outputs": [], "source": [ "S_nod.discriminant_group()" ] }, { "cell_type": "code", "execution_count": null, "id": "30bec075-0126-4ea1-9eb7-c180f1941dc0", "metadata": {}, "outputs": [], "source": [ "rad(U)" ] }, { "cell_type": "code", "execution_count": null, "id": "83ffd266-097b-488e-b49e-d69077b19884", "metadata": {}, "outputs": [], "source": [ "rad(U_2)" ] }, { "cell_type": "code", "execution_count": null, "id": "97ec6ec5-375e-433d-9c49-9d27dd1ef305", "metadata": {}, "outputs": [], "source": [ "rad(E8)" ] }, { "cell_type": "code", "execution_count": null, "id": "0a006fe2-cbb6-4325-ad22-12c4bd2ed9c3", "metadata": {}, "outputs": [], "source": [ "rad(E8_2)" ] }, { "cell_type": "code", "execution_count": null, "id": "81b7d9b8-4509-4738-b53a-9f2ae0d5faaf", "metadata": {}, "outputs": [], "source": [ "rad(U.direct_sum(E8_2))" ] }, { "cell_type": "code", "execution_count": null, "id": "733a58d5-a229-43cd-b90a-bc6020cbb554", "metadata": {}, "outputs": [], "source": [ "rad(D6)" ] }, { "cell_type": "code", "execution_count": null, "id": "5f7f99d4-0e1b-4a75-9972-ee0d9b837b94", "metadata": {}, "outputs": [], "source": [ "rad(A1_7)" ] }, { "cell_type": "code", "execution_count": null, "id": "f7a0e61e-9504-4ddd-96a6-2b5f8c68b43d", "metadata": {}, "outputs": [], "source": [ "rad(E10_2)" ] }, { "cell_type": "code", "execution_count": null, "id": "db132ed3-fa15-4308-a266-d179dbfafba9", "metadata": {}, "outputs": [], "source": [ "L = Tco\n", "L" ] }, { "cell_type": "code", "execution_count": null, "id": "aa4e98fa-aacc-4533-b627-9837ddc98364", "metadata": {}, "outputs": [], "source": [ "rad(Tco)" ] }, { "cell_type": "code", "execution_count": null, "id": "26ba0464-da6a-4b23-af82-ae68eb13f793", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "4f5a470a-b0a9-4bb1-a2da-3fb392b4df5f", "metadata": {}, "outputs": [], "source": [ "h, e, f, a1, a2, a3, a4, a5, a6, a7, a8 = Tco.basis()\n", "dot_co = lambda x,y : x * Tco.gram_matrix() * y\n", "nm_co = lambda x: dot_co(x, x)\n", "Tco" ] }, { "cell_type": "code", "execution_count": null, "id": "26202239-444c-4d65-a393-a0d2e17cb94c", "metadata": {}, "outputs": [], "source": [ "v1 = e\n", "display( nm_co(v1) )\n", "display( divisibility(v1, Tco) )" ] }, { "cell_type": "code", "execution_count": null, "id": "c53eadfa-7fe5-4a59-883e-2e9bcf7dc334", "metadata": {}, "outputs": [], "source": [ "v2 = a2 + a3 + 2*h\n", "display ( nm_co(v2) )\n", "display( dot_co(v1, v2) )\n", "display( divisibility(v2, Tco) )" ] }, { "cell_type": "code", "execution_count": null, "id": "439f51aa-b1c1-42ee-95ce-bed52a85f1cc", "metadata": {}, "outputs": [], "source": [ "Ten = U.direct_sum(U.twist(2)).direct_sum(E8.twist(2))\n", "te, tf, tep, tfp, ta1, ta2, ta3, ta4, ta5, ta6, ta7, ta8 = Ten.basis()\n", "teb, tfb, tepb, tfpb, ta1b, ta2b, ta3b, ta4b, ta5b, ta6b, ta7b, ta8b = Ten.gram_matrix().inverse().columns()\n", "dot_en = lambda x,y : x * Ten.gram_matrix() * y\n", "nm_en = lambda x: dot_en(x, x)" ] }, { "cell_type": "code", "execution_count": null, "id": "d3ed66f9-ed45-4c5f-96de-6c8c6efd336b", "metadata": {}, "outputs": [], "source": [ "alpha = 2*ta1b\n", "isov1 = te\n", "isov2 = tep\n", "isov3 = 2*te + 2*tf + alpha\n", "\n", "display( [nm_en(x) for x in [isov1, isov2, isov3]] )\n", "\n", "dot_en(tep, te-tf)\n", "#nm_en(te-tf)\n", "[nm_en(x) for x in Ten.basis() ] " ] }, { "cell_type": "code", "execution_count": null, "id": "3e69f90a-9167-4760-b14d-96a7359691c3", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "6b92ed07-c1e5-4e38-9434-59fc6f4fe985", "metadata": {}, "outputs": [], "source": [ "I_1_10_2 = Ipq(1, 10).twist(2)\n", "I_1_10_2" ] }, { "cell_type": "code", "execution_count": null, "id": "e5df804d-7ff2-45f8-bf9a-9771edf26bee", "metadata": {}, "outputs": [], "source": [ "rad(I_1_10_2)" ] }, { "cell_type": "code", "execution_count": null, "id": "d02d01e3-a5ff-4976-8051-8886a6b91c7c", "metadata": {}, "outputs": [], "source": [ "rad(Tco)" ] }, { "cell_type": "code", "execution_count": null, "id": "8bd0c55c-5d2c-4ed4-8a60-27dbdcf811ee", "metadata": {}, "outputs": [], "source": [ "display( [nm_en(x) for x in Ten.basis() ] )\n", "display( [nm_en(x) for x in [teb, tfb, tepb, tfpb, ta1b, ta2b, ta3b, ta4b, ta5b, ta6b, ta7b, ta8b]] )" ] }, { "cell_type": "code", "execution_count": null, "id": "fe875308-485f-43d5-b13d-cd1fc0aa83bf", "metadata": {}, "outputs": [], "source": [ "# Sterk vectors\n", "s1 = te\n", "s2 = tep\n", "s3 = tep + tfp + ta1\n", "s4 = 2*tep + tfp + 2*ta1b\n", "s5 = 2*te + 2*tf + 2*ta1b\n", "[nm_en(x) for x in [s1, s2, s3, s4, s5] ]" ] }, { "cell_type": "code", "execution_count": null, "id": "f4cd694c-47e9-4ed3-a8cf-7b4f35a39708", "metadata": {}, "outputs": [], "source": [ "h, ep, fp, a1, a2, a3, a4, a5, a6, a7, a8 = Tco.basis()\n", "\n", "dot_co = lambda x,y : x * Tco.gram_matrix() * y\n", "nm_co = lambda x: dot_co(x, x)\n", "\n", "coble_isotropics = [\n", " ep,\n", " fp,\n", " 2*h + a1 + a2,\n", " ep + fp + a1, \n", " # 2*e + f + 2*a1b,\n", " # e + 2*f + 2*a1b,\n", " 2*h - fp - a1 - a6 - a7 - a8,\n", " 8*ep + fp + a4 - 2*a5 - a8,\n", " 2*h + ep - a1 - a2,\n", " 2*h + ep - a2 - a3,\n", " 2*h - a1 + a2 - a3,\n", " 2*ep + fp - a1 - a8,\n", " 5*ep + fp + a2 + 2*a3,\n", " 2*h + a1 - a4,\n", " 2*h + a2 - a5,\n", " 2*h + a3 - a6,\n", " 2*h + a4 - a7,\n", " 2*h + a5 - a8,\n", " 2*h - a6 - a8\n", "]\n", "\n", "display( [nm_co(x) for x in coble_isotropics ] )\n", "\n", "display( [divisibility(x, Tco) for x in coble_isotropics] )" ] }, { "cell_type": "code", "execution_count": null, "id": "7da06fba-47d7-4444-ba33-8d2c77f6caf8", "metadata": {}, "outputs": [], "source": [ "Ten = U.direct_sum(U.twist(2)).direct_sum(E8.twist(2))\n", "e, f, ep, fp, a1, a2, a3, a4, a5, a6, a7, a8 = Ten.basis()\n", "\n", "dot_en = lambda x,y : x * Ten.gram_matrix() * y\n", "nm_en = lambda x: dot_en(x, x)\n", "\n", "enriques_isotropics = [\n", " ep,\n", " fp,\n", " 2*(e+f) + a1 + a2,\n", " ep + fp + a1, \n", " # 2*e + f + 2*a1b,\n", " # e + 2*f + 2*a1b,\n", " 2*(e+f) - fp - a1 - a6 - a7 - a8,\n", " 8*ep + fp + a4 - 2*a5 - a8,\n", " 2*(e+f) + ep - a1 - a2,\n", " 2*(e+f) + ep - a2 - a3,\n", " 2*(e+f) - a1 + a2 - a3,\n", " 2*ep + fp - a1 - a8,\n", " 5*ep + fp + a2 + 2*a3,\n", " 2*(e+f) + a1 - a4,\n", " 2*(e+f) + a2 - a5,\n", " 2*(e+f) + a3 - a6,\n", " 2*(e+f) + a4 - a7,\n", " 2*(e+f) + a5 - a8,\n", " 2*(e+f) - a6 - a8\n", "]\n", "\n", "display( [nm_en(x) for x in enriques_isotropics ] )\n", "\n", "display( [divisibility(x, Ten) for x in enriques_isotropics] )" ] }, { "cell_type": "code", "execution_count": null, "id": "8a2a71cd-7453-4dd1-b49d-021b8d01bfe0", "metadata": {}, "outputs": [], "source": [ "e, f, ep, fp, a1, a2, a3, a4, a5, a6, a7, a8, b1, b2, b3, b4, b5, b6, b7, b8 = TdP.gens()\n", "dot_dP = lambda x,y : x * TdP.gram_matrix() * y\n", "nm_dP = lambda x: dot_dP(x, x)\n", "\n", "dp_isotropics = [\n", " ep,\n", " fp,\n", " 2*(e+f) + (a1+b1) + (a2+b2),\n", " ep + fp + (a1+b1), \n", " # 2*e + f + 2*a1b,\n", " # e + 2*f + 2*a1b,\n", " 2*(e+f) - fp - (a1+b1) - (a6+b6) - (a7+b7) - (a8+b8),\n", " 8*ep + fp + (a4+b4) - 2*(a5+b5) - (a8+b8),\n", " 2*(e+f) + ep - (a1+b1) - (a2+b2),\n", " 2*(e+f) + ep - (a2+b2) - (a3+b3),\n", " 2*(e+f) - (a1+b1) + (a2+b2) - (a3+b3),\n", " 2*ep + fp - (a1+b1) - (a8+b8),\n", " 5*ep + fp + (a2+b2) + 2*(a3+b3),\n", " 2*(e+f) + (a1+b1) - (a4+b4),\n", " 2*(e+f) + (a2+b2) - (a5+b5),\n", " 2*(e+f) + (a3+b3) - (a6+b6),\n", " 2*(e+f) + (a4+b4) - (a7+b7),\n", " 2*(e+f) + (a5+b5) - (a8+b8),\n", " 2*(e+f) - (a6+b6) - (a8+b8)\n", "]\n", "\n", "display( [nm_dP(x) for x in dp_isotropics ] )\n", "\n", "display( [divisibility(x, TdP) for x in dp_isotropics] )" ] }, { "cell_type": "code", "execution_count": null, "id": "f4817b4e-8515-4ac5-865e-52213d454c20", "metadata": {}, "outputs": [], "source": [ "# x = 5*ep + fp + (a2+b2) + 2*(a3+b3)\n", "x = 2*(e+f) + (a1+b1) + (a2+b2)\n", "divisibility(x, TdP)" ] }, { "cell_type": "code", "execution_count": null, "id": "4991316c-e558-45b3-bada-49e9dfdc40c2", "metadata": {}, "outputs": [], "source": [ "dot_dP(x, a3)" ] }, { "cell_type": "code", "execution_count": null, "id": "04bb680d-53f1-42ce-8018-b07adffd59bb", "metadata": {}, "outputs": [], "source": [ "perp = U.direct_sum(E8).direct_sum(E8)\n", "perp" ] }, { "cell_type": "code", "execution_count": null, "id": "493e8d55-d322-4eb8-8a43-8df17d4aff80", "metadata": {}, "outputs": [], "source": [ "rad(perp)" ] }, { "cell_type": "code", "execution_count": null, "id": "3ec1919d-aa73-4750-8561-599ceaf2da78", "metadata": {}, "outputs": [], "source": [ "perp.signature_pair()" ] }, { "cell_type": "code", "execution_count": null, "id": "f394e7da-79a1-4860-9e79-a32da3fd4f19", "metadata": {}, "outputs": [], "source": [ "U.signature_pair()" ] }, { "cell_type": "code", "execution_count": null, "id": "6ae67c1e-1bd5-4e4c-a118-5ed41595a0c7", "metadata": {}, "outputs": [], "source": [ "i = 0\n", "isotrops = []\n", "for i in range(10000):\n", " v = Tco.random_element()\n", " nm = nm_co(v)\n", " if nm == 0 and len([x for x in v if x==0]) > 7:\n", " isotrops.append(v)\n", "isotrops" ] }, { "cell_type": "code", "execution_count": null, "id": "28498c33-63b9-4005-9ef8-288baba26c41", "metadata": {}, "outputs": [], "source": [ "divisibility(2*e + 2*f + 2*a1, TdP)" ] }, { "cell_type": "code", "execution_count": null, "id": "1b38a7e5-db0d-4b6d-b012-eef631a329a1", "metadata": {}, "outputs": [], "source": [ "v = (-2, -1, 1, 0, 0, 0, -1, 0, 0, 0, 0)\n", "len([x for x in v if x==0])" ] }, { "cell_type": "code", "execution_count": null, "id": "4557bc84-548a-4b25-88ff-46e381456745", "metadata": {}, "outputs": [], "source": [ "eta_v1 = tep\n", "eta_v2 = ta1 + ta2 + 2*te + 2*tf\n", "\n", "display( nm_en(eta_v1) )\n", "display( nm_en(eta_v2) )\n", "display( dot_en(eta_v1, eta_v2) )\n", "display( divisibility(eta_v1, Ten) )\n", "display( divisibility(eta_v2, Ten) )" ] }, { "cell_type": "code", "execution_count": null, "id": "23327a8b-defb-41d0-b9f4-f1e4adb681c8", "metadata": {}, "outputs": [], "source": [ "[dot_co(v, x) for x in [h, e, f, a1, a2, a3, a4, a5, a6, a7, a8] ]" ] }, { "cell_type": "code", "execution_count": null, "id": "06bc2a1f-2069-49c0-8566-28245c596a9f", "metadata": {}, "outputs": [], "source": [ "[dot_co(v, x) for x in [e, f, 2*a1+a2, a2+h, a3+h, a4-h, a5, a6, a7, a8] ]" ] }, { "cell_type": "code", "execution_count": null, "id": "2a692b40-2327-4bef-b199-6879189bfe3e", "metadata": {}, "outputs": [], "source": [ "w = 2*a1 + 3*a2 + 4*a3 + 6*a4 + 5*a5 + 4*a6 + 3*a7 + 2*a8 + 1*(e+f)\n", "display( nm_co(w) )\n", "display( dot_co(e, w) )" ] }, { "cell_type": "code", "execution_count": null, "id": "0ff4b638-9d2a-469d-80ef-ae82b434c982", "metadata": {}, "outputs": [], "source": [ "M1 = Matrix(ZZ, 1, 11, [e] ).T\n", "M2 = Matrix(ZZ, 11, 11, [ h, e, f, a1, a2, a3, a4, a5, a6, a7, a8 ] ).T\n", "display(M1)\n", "display(M2)\n", "M2.augment(M1)\n", "#M.rref()" ] }, { "cell_type": "code", "execution_count": null, "id": "8d8afb7e-5689-41d2-b3ae-cc8622475c82", "metadata": {}, "outputs": [], "source": [ "Mco = Tco.gram_matrix()\n", "#Tco.is_primitive()" ] }, { "cell_type": "code", "execution_count": null, "id": "072e87bb-631a-420a-add9-3a4a1099b6f7", "metadata": {}, "outputs": [], "source": [ "e,f = H.gens()\n", "e,f" ] }, { "cell_type": "code", "execution_count": null, "id": "18460e40-2768-446a-ae12-c969b2dc0c59", "metadata": {}, "outputs": [], "source": [ "# U \\leq V is a subspace\n", "# A has columns that span U, and B has columns that span V\n", "# Row-reduce the augmented matrix [A | B], locate pivots\n", "# The pivots among the a_i span U\n", "# The pivots among the b_i span V/U\n", "A = Matrix(ZZ, 1, [e]).T\n", "B = Matrix(ZZ, 2, [e,f]).T\n", "MAug = A.augment(B)\n", "display( A, \"---------\")\n", "display( B, \"---------\" )\n", "display( MAug, \"----------\" )\n", "display( MAug.rref(), \"-------------\" )\n", "display( MAug.pivots() )\n", "# Pivot 0 => U = \n", "# Pivot 2 => V/U = ... this only computes the complement in the standard lattice Z^n" ] }, { "cell_type": "code", "execution_count": null, "id": "bdf80d9c-4009-46a2-95fb-ca13f4396163", "metadata": {}, "outputs": [], "source": [ "( U.gram_matrix() * A ).kernel()" ] }, { "cell_type": "code", "execution_count": null, "id": "35d1699d-c4b1-40d8-a3f6-046572aaf8e9", "metadata": {}, "outputs": [], "source": [ "C = Matrix(ZZ, 1, [f])\n", "( U.gram_matrix() * C.T ).kernel()" ] }, { "cell_type": "code", "execution_count": null, "id": "5afbb0f0-37c0-4be7-a058-d295f2f978ff", "metadata": {}, "outputs": [], "source": [ "e1p, f1p, e2p, f2p, a1p, a2p, a3p, a4p, a5p, a6p, a7p, a8p = Ten.basis()\n", "dot_en = lambda x,y : x * Ten.gram_matrix() * y\n", "nm_en = lambda x: dot_en(x, x)\n", "Ten" ] }, { "cell_type": "code", "execution_count": null, "id": "4109ee79-e48d-4ab8-a092-bc7cc31e31ac", "metadata": {}, "outputs": [], "source": [ "vp = a2p + a3p + 2*(e1p + f1p)\n", "nm_en(vp)\n", "display ( nm_en(vp) )\n", "display( dot_en(e2p, vp) )" ] }, { "cell_type": "code", "execution_count": null, "id": "ff5cc764-837d-4f07-af1c-cb5d24fd2a9b", "metadata": {}, "outputs": [], "source": [ "U" ] }, { "cell_type": "code", "execution_count": null, "id": "0098542e-f9d4-4934-898a-8d7fb1bf45c3", "metadata": {}, "outputs": [], "source": [ "e,f = U_2.gens()" ] }, { "cell_type": "code", "execution_count": null, "id": "b11774d2-1165-421f-b1f2-6bc822f857a3", "metadata": {}, "outputs": [], "source": [ "display(e, f)" ] }, { "cell_type": "code", "execution_count": null, "id": "64363cda-01b6-4b01-8764-84508c8aa9dc", "metadata": {}, "outputs": [], "source": [ "S = U.span([e])\n", "S" ] }, { "cell_type": "code", "execution_count": null, "id": "63abc2f0-7a58-4244-a5eb-e5f613501e77", "metadata": {}, "outputs": [], "source": [ " (e-f) * U_2.gram_matrix() * (e-f)" ] }, { "cell_type": "code", "execution_count": null, "id": "a32e8125-6ac7-4adf-8b3a-70452d7fa846", "metadata": {}, "outputs": [], "source": [ "V = VectorSpace(QQ, 2, inner_product_matrix = U.gram_matrix() )\n", "V" ] }, { "cell_type": "code", "execution_count": null, "id": "a3c76b5e-b0b4-4bd5-a04e-03c565931e34", "metadata": {}, "outputs": [], "source": [ "e,f = V.basis()" ] }, { "cell_type": "code", "execution_count": null, "id": "7bafeb72-d800-40e0-94ea-71de46f495ed", "metadata": {}, "outputs": [], "source": [ "S = V.span([e])\n", "S" ] }, { "cell_type": "code", "execution_count": null, "id": "f1f7337c-0c0e-4beb-83e1-7b0543a1edfe", "metadata": {}, "outputs": [], "source": [ "S.complement()" ] }, { "cell_type": "code", "execution_count": null, "id": "6c211d29-68cb-412d-9809-f788296f8765", "metadata": {}, "outputs": [], "source": [ "OTen = Tco.orthogonal_group()" ] }, { "cell_type": "code", "execution_count": null, "id": "81bb612c-d091-42c5-ac1c-79cec7031d92", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "ff77f98a-972f-40f8-9852-df603d7a2028", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "9c341341-9aa9-4710-8cb8-a1cbc3d857b1", "metadata": {}, "outputs": [], "source": [ "L = U.direct_sum(E8)\n", "e,f,a1,a2,a3,a4,a5,a6,a7,a8 = L.gens()\n", "L" ] }, { "cell_type": "code", "execution_count": null, "id": "4c8b2c44-b481-4cc8-b1c6-1ec6aea75a97", "metadata": {}, "outputs": [], "source": [ "dot_L = lambda x,y: x * L.gram_matrix() * y\n", "nm_L = lambda x: dot_L(x, x)" ] }, { "cell_type": "code", "execution_count": null, "id": "0d285442-b0af-4865-ba86-a9e94d561d8e", "metadata": {}, "outputs": [], "source": [ "v = e + f + a1 + a3\n", "nm_L(v)" ] }, { "cell_type": "code", "execution_count": null, "id": "76818d7f-6580-4352-8bac-8109ab796307", "metadata": {}, "outputs": [], "source": [ "ips = [ dot_L(v, x) for x in [e,f,a1,a2,a3,a4,a5,a6,a7,a8] ]\n", "display(ips)\n", "display(\"--------\", \"v = e + f + a1 + a3\", \"-------------\")\n", "display(\"v.e = \" + str(ips[0]))\n", "display(\"v.f = \" + str(ips[1]))\n", "display(\"v.a1 = \" + str(ips[2]))\n", "display(\"v.a2 = \" + str(ips[3]))\n", "display(\"v.a3 = \" + str(ips[4]))\n", "display(\"v.a4 = \" + str(ips[5]))\n", "display(\"v.a5 = \" + str(ips[6]))\n", "display(\"v.a6 = \" + str(ips[7]))\n", "display(\"v.a7 = \" + str(ips[8]))\n", "display(\"v.a8 = \" + str(ips[9]))" ] }, { "cell_type": "code", "execution_count": null, "id": "6b847063-9249-4d78-884f-f6c5b9432ba8", "metadata": {}, "outputs": [], "source": [ "dot_L(v, f)" ] }, { "cell_type": "code", "execution_count": null, "id": "c48a7bc7-a8fe-4c39-9f19-a1c3b5a120e9", "metadata": {}, "outputs": [], "source": [ "v" ] }, { "cell_type": "code", "execution_count": null, "id": "3d403e7b-76d6-429e-898b-ad5dedca90dc", "metadata": {}, "outputs": [], "source": [ "A = L.gram_matrix()\n", "A" ] }, { "cell_type": "code", "execution_count": null, "id": "5a787578-5b59-4442-95e4-0de747871389", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "0b217da0-7ee0-41a9-a245-a13e37912215", "metadata": {}, "outputs": [], "source": [ "M1 = A.T * matrix([e]).T\n", "M1" ] }, { "cell_type": "code", "execution_count": null, "id": "74c373dd-03f3-4be2-a4cb-439bc65818fc", "metadata": {}, "outputs": [], "source": [ "M1.kernel()" ] }, { "cell_type": "code", "execution_count": null, "id": "328264b2-2365-42c6-a76f-66be85040331", "metadata": {}, "outputs": [], "source": [ "M2 = A * matrix([f]).T\n", "M2" ] }, { "cell_type": "code", "execution_count": null, "id": "1cf62ccd-3f8e-45df-8403-fc643ca8c492", "metadata": {}, "outputs": [], "source": [ "M2.kernel()" ] }, { "cell_type": "code", "execution_count": null, "id": "eba721ef-1b27-4359-9382-752edfc59a76", "metadata": {}, "outputs": [], "source": [ "M3 = A.T * matrix([e, f]).T\n", "M3" ] }, { "cell_type": "code", "execution_count": null, "id": "80cedad4-7afc-4e5c-9401-f1f1317ec24d", "metadata": {}, "outputs": [], "source": [ "K = M3.kernel()\n", "M = K.matrix()\n", "K" ] }, { "cell_type": "code", "execution_count": null, "id": "7dfe4c87-f407-4664-b5ea-d5e4db072ec5", "metadata": {}, "outputs": [], "source": [ "M.dimensions()" ] }, { "cell_type": "code", "execution_count": null, "id": "2d0902cd-4e42-4e1b-a0cf-d099c7e76972", "metadata": {}, "outputs": [], "source": [ "len(L.gens() )" ] }, { "cell_type": "code", "execution_count": null, "id": "dbc95410-c4ac-4548-8050-c8a8dd740743", "metadata": {}, "outputs": [], "source": [ "L = U.direct_sum(E8)\n", "e,f,a1,a2,a3,a4,a5,a6,a7,a8 = L.gens()\n", "(A.T * matrix([e]).T).kernel()" ] }, { "cell_type": "code", "execution_count": null, "id": "f5033996-fdad-4f87-8ed5-714087100636", "metadata": {}, "outputs": [], "source": [ "L = U.direct_sum(E8)\n", "e,f,a1,a2,a3,a4,a5,a6,a7,a8 = L.gens()\n", "(A.T * matrix([f]).T).kernel()" ] }, { "cell_type": "code", "execution_count": null, "id": "335490b0-2996-4f63-9393-65109f832b10", "metadata": {}, "outputs": [], "source": [ "L = U.direct_sum(E8)\n", "e,f,a1,a2,a3,a4,a5,a6,a7,a8 = L.gens()\n", "(A.T * matrix([e, f]).T).kernel()" ] }, { "cell_type": "code", "execution_count": null, "id": "18f58d7a-b979-4170-9963-3720322310b1", "metadata": {}, "outputs": [], "source": [ "L = U.direct_sum(E8)\n", "e,f,a1,a2,a3,a4,a5,a6,a7,a8 = L.gens()\n", "\n", "v = e + f + a1 + a3\n", "display(\"Norm of v: \" + str( v * L.gram_matrix() * v ) )\n", "\n", "(A.T * matrix([v]).T).kernel()" ] }, { "cell_type": "code", "execution_count": null, "id": "dcd01427-f0c3-4e21-a2ce-b062fd951c55", "metadata": {}, "outputs": [], "source": [ "[ v * L.gram_matrix() * x for x in \n", " [\n", " e - a4,\n", " f - a4,\n", " a1 + a4,\n", " a2,\n", " a3 + a4,\n", " a5,\n", " a6,\n", " a7,\n", " a8\n", " ]\n", "]" ] }, { "cell_type": "code", "execution_count": null, "id": "7bc440ba-22f1-4bb7-ba7b-5211171f4a47", "metadata": {}, "outputs": [], "source": [ "(A.T * matrix([v]).T).kernel().matrix().dimensions()" ] }, { "cell_type": "code", "execution_count": null, "id": "77412e07-0bf6-4069-a91b-9ea2881767a2", "metadata": {}, "outputs": [], "source": [ "L = U.direct_sum(E8_2)\n", "e,f,a1,a2,a3,a4,a5,a6,a7,a8 = L.basis()\n", "dot_L = lambda x,y: x * L.gram_matrix() * y\n", "nm_L = lambda x: dot_L(x, x)\n", "L" ] }, { "cell_type": "code", "execution_count": null, "id": "5de54c87-883f-4876-afac-c38b9c9a0a7f", "metadata": {}, "outputs": [], "source": [ "w2 = 2*e + 2*f + a1 + a2\n", "w2" ] }, { "cell_type": "code", "execution_count": null, "id": "1153dced-4f27-433e-92de-c5a564ae4558", "metadata": {}, "outputs": [], "source": [ "divisibility(w2, L)" ] }, { "cell_type": "code", "execution_count": null, "id": "c60eba09-d34a-4440-9da2-320c11bab707", "metadata": {}, "outputs": [], "source": [ "L = U.direct_sum(E8).direct_sum(E8)\n", "e,f,a1,a2,a3,a4,a5,a6,a7,a8,ta1,ta2,ta3,ta4,ta5,ta6,ta7,ta8 = L.gens()\n", "dot_L = lambda x,y: x * L.gram_matrix() * y\n", "nm_L = lambda x: dot_L(x, x)\n", "L" ] }, { "cell_type": "code", "execution_count": null, "id": "56fcfdb6-1e10-4d76-90ee-94227e6e16b6", "metadata": {}, "outputs": [], "source": [ "[ dot_L(a1, x) for x in L.gens() ]" ] }, { "cell_type": "code", "execution_count": null, "id": "071bc21b-ae38-402e-be6d-fd6e9676be29", "metadata": {}, "outputs": [], "source": [ "L = U.direct_sum(E8)\n", "e,f,a1,a2,a3,a4,a5,a6,a7,a8 = L.gens()\n", "dot_L = lambda x,y: x * L.gram_matrix() * y\n", "nm_L = lambda x: dot_L(x, x)\n", "L" ] }, { "cell_type": "code", "execution_count": null, "id": "6f00af77-68de-4801-98ad-8fe28c01bc78", "metadata": {}, "outputs": [], "source": [ "dot_L(a1+a2, a3)" ] }, { "cell_type": "code", "execution_count": null, "id": "f95f7d56-3fc7-426e-875f-c06297dd74f0", "metadata": {}, "outputs": [], "source": [ "L" ] }, { "cell_type": "code", "execution_count": null, "id": "58e6e256-2d90-4810-b286-3c059e4f3b42", "metadata": {}, "outputs": [], "source": [ "Sterk2Vectors = [\n", " vector([-1, 2]),\n", " vector([0, 1]),\n", " vector([-1, 4]),\n", " vector([-1, 3]),\n", " vector([-2, 5]),\n", " vector([-1, 2]),\n", " vector([-2, 3]),\n", " vector([-1, 1]),\n", " vector([-2, 1]),\n", " vector([-1, 0]),\n", " vector([-2,-1]),\n", " vector([-1, -1]),\n", " vector([-2, -3]),\n", " vector([-1, -2]),\n", " vector([-2, -5]),\n", " vector([-1, -3]),\n", " vector([-1, -4]),\n", " vector([0, -1]),\n", " vector([1, 2]),\n", "]" ] }, { "cell_type": "code", "execution_count": null, "id": "80cc595d-6d0f-4e44-a2c2-3b5f6935269b", "metadata": {}, "outputs": [], "source": [ "len(Sterk2Vectors)" ] }, { "cell_type": "code", "execution_count": null, "id": "7120ecc2-a474-4c20-b66f-27c632b0bc3d", "metadata": {}, "outputs": [], "source": [ "l = [0, 1, 0,0,0,0,0,0,0, 2, 0,0,0,0,0,0,0, 1, 0]" ] }, { "cell_type": "code", "execution_count": null, "id": "e8ddea1f-296c-4478-b8e0-423112eb1a8c", "metadata": {}, "outputs": [], "source": [ "nonzero_inds = [i[0] for i in enumerate(l) if l[i[0]] != 0]\n", "nonzero_inds" ] }, { "cell_type": "code", "execution_count": null, "id": "1a4791e5-a6fd-430b-94aa-6f02b9955768", "metadata": {}, "outputs": [], "source": [ "nonzero_vecs = [l[1] for l in enumerate(Sterk2Vectors) if l[0] in nonzero_inds]\n", "nonzero_vecs" ] }, { "cell_type": "code", "execution_count": null, "id": "0392d223-5d07-4ccf-b661-e7167583f1ba", "metadata": {}, "outputs": [], "source": [ "2*nonzero_vecs[0] + 4*nonzero_vecs[1] + 2*nonzero_vecs[2]" ] }, { "cell_type": "code", "execution_count": null, "id": "18d6934d-52f3-475d-89e1-832566b16dfa", "metadata": {}, "outputs": [], "source": [ "Sterk2Vectors[9]" ] }, { "cell_type": "code", "execution_count": null, "id": "e3fbad74-f5b1-450c-869f-489bcab5a120", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "3d541f52-2031-402d-8016-e6a059dbdd07", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 3, "id": "48bb3591-4258-478a-bcfb-5efd25590a21", "metadata": {}, "outputs": [], "source": [ "M = lambda x,y,xp,yp: Matrix(ZZ, 2, [x, xp, -yp, y])\n", "qM = lambda m: 4*m.det()\n", "bM = lambda m,n: 1/2 * (qM(m+n) - qM(m) - qM(n))" ] }, { "cell_type": "code", "execution_count": 4, "id": "d2ee6dff-b08e-46e7-99c0-708a442f0241", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[\n", "[1 0] [0 0] [0 1] [ 0 0]\n", "[0 0], [0 1], [0 0], [-1 0]\n", "]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "e = M(1,0,0,0)\n", "f = M(0,1,0,0)\n", "ep = M(0,0,1,0)\n", "fp = M(0,0,0,1)\n", "[e,f,ep, fp]" ] }, { "cell_type": "code", "execution_count": 5, "id": "dd834ef5-0f20-416b-bdbc-1c8a3028825e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0, 0, 0, 0]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "[qM(e), qM(f), qM(ep), qM(fp)]" ] }, { "cell_type": "code", "execution_count": 6, "id": "df96c0ba-e608-488f-8df8-4a0b654e5d1d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[2, 2]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "[bM(e, f), bM(ep, fp)]" ] }, { "cell_type": "code", "execution_count": 91, "id": "e677eebe-afe1-442b-a1d4-22fc068af62b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(x, y)" ] }, "execution_count": 91, "metadata": {}, "output_type": "execute_result" } ], "source": [ "var('x,y')" ] }, { "cell_type": "code", "execution_count": 96, "id": "d2294992-6be8-428b-8ac0-241e1bd19715", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0 1]\n", "[1 0]" ] }, "execution_count": 96, "metadata": {}, "output_type": "execute_result" } ], "source": [ "h = M(0,0,1,-1)\n", "h" ] }, { "cell_type": "code", "execution_count": 97, "id": "32f88dc3-8481-4fb4-b323-439bed63a5a0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-2" ] }, "execution_count": 97, "metadata": {}, "output_type": "execute_result" } ], "source": [ "qM(h)" ] }, { "cell_type": "code", "execution_count": 98, "id": "4dc009b3-a46f-4f6f-930a-a5029d0c28d4", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1 0]\n", "[0 1]" ] }, "execution_count": 98, "metadata": {}, "output_type": "execute_result" } ], "source": [ "h.smith_form(transformation=False)" ] }, { "cell_type": "code", "execution_count": 74, "id": "b7c92006-47fe-4ab1-8e69-4577994d652a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1 0]\n", "[0 1]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "2" ] }, "execution_count": 74, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m = M(1,1,0,0)\n", "display(m)\n", "qM(m)" ] }, { "cell_type": "code", "execution_count": 75, "id": "265b3e2b-cb36-43a5-846c-a89825077c07", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1 0]\n", "[0 1]" ] }, "execution_count": 75, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m.smith_form(transformation=False)" ] }, { "cell_type": "code", "execution_count": 108, "id": "88869601-7490-4d7a-b10e-e263ccc496fc", "metadata": {}, "outputs": [], "source": [ "N = lambda x1,y1,x2: Matrix(ZZ, 2, [x1, x2, -x2, 2*y1])\n", "qN = lambda m: 2*m.det()\n", "bN = lambda m,n: 1/2 * (qM(m+n) - qM(m) - qM(n))" ] }, { "cell_type": "code", "execution_count": 111, "id": "632847f1-d3fd-4b0e-bd4c-0327be8c5d4d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[ 0 1]\n", "[-1 0]" ] }, "execution_count": 111, "metadata": {}, "output_type": "execute_result" } ], "source": [ "n = N(0,0,1)\n", "n" ] }, { "cell_type": "code", "execution_count": 110, "id": "dbd34ec9-e9b6-4b74-93bd-753eb693bdd6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 110, "metadata": {}, "output_type": "execute_result" } ], "source": [ "qN(n)" ] }, { "cell_type": "code", "execution_count": 106, "id": "252b3756-480b-4e3f-9dd2-9563fb674afd", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(\n", "[1 0] [1 0] [ 0 -1]\n", "[0 1], [0 1], [ 1 0]\n", ")" ] }, "execution_count": 106, "metadata": {}, "output_type": "execute_result" } ], "source": [ "n.smith_form()" ] }, { "cell_type": "code", "execution_count": 117, "id": "89327b77-2be4-42ef-8d62-adc94f69bcef", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "0" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "2" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "display( qN(N(1,0,0)) )\n", "display( qN(N(0,1,0)) )\n", "#display( qN(N(0,0,1)) )\n", "#display( qN(N(1,1,0)) )\n", "display( bN(N(1,0,0), N(0,1,0)) )" ] }, { "cell_type": "code", "execution_count": 120, "id": "86010df1-eb9c-4f64-8b7e-d85727bb5354", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(\n", "[1 0] [1 0] [1 0]\n", "[0 2], [0 1], [0 1]\n", ")" ] }, "execution_count": 120, "metadata": {}, "output_type": "execute_result" } ], "source": [ "N(1,1,0).smith_form()" ] }, { "cell_type": "code", "execution_count": 62, "id": "dcb25ba0-6b4d-4fd7-abf2-798187040ef2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "128" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "Finite quadratic module over Integer Ring with invariants (2, 2, 2, 2, 2, 2, 2)\n", "Gram matrix of the quadratic form with values in Q/2Z:\n", "[3/2 0 0 0 0 0 0]\n", "[ 0 3/2 0 0 0 0 0]\n", "[ 0 0 3/2 0 0 0 0]\n", "[ 0 0 0 3/2 0 0 0]\n", "[ 0 0 0 0 3/2 0 0]\n", "[ 0 0 0 0 0 3/2 0]\n", "[ 0 0 0 0 0 0 3/2]" ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L = Ipq(0, 7).twist(2)\n", "GL = L.discriminant_group()\n", "display(GL.cardinality())\n", "GL" ] }, { "cell_type": "code", "execution_count": 74, "id": "ffbaccd6-900d-472e-b1cb-bcf88cae5876", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "128" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "36" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "[((0, 0, 0, 0, 0, 0, 0), 0),\n", " ((0, 0, 0, 1, 1, 1, 1), 0),\n", " ((0, 0, 1, 0, 1, 1, 1), 0),\n", " ((0, 0, 1, 1, 0, 1, 1), 0),\n", " ((0, 0, 1, 1, 1, 0, 1), 0),\n", " ((0, 0, 1, 1, 1, 1, 0), 0),\n", " ((0, 1, 0, 0, 1, 1, 1), 0),\n", " ((0, 1, 0, 1, 0, 1, 1), 0),\n", " ((0, 1, 0, 1, 1, 0, 1), 0),\n", " ((0, 1, 0, 1, 1, 1, 0), 0),\n", " ((0, 1, 1, 0, 0, 1, 1), 0),\n", " ((0, 1, 1, 0, 1, 0, 1), 0),\n", " ((0, 1, 1, 0, 1, 1, 0), 0),\n", " ((0, 1, 1, 1, 0, 0, 1), 0),\n", " ((0, 1, 1, 1, 0, 1, 0), 0),\n", " ((0, 1, 1, 1, 1, 0, 0), 0),\n", " ((1, 0, 0, 0, 1, 1, 1), 0),\n", " ((1, 0, 0, 1, 0, 1, 1), 0),\n", " ((1, 0, 0, 1, 1, 0, 1), 0),\n", " ((1, 0, 0, 1, 1, 1, 0), 0),\n", " ((1, 0, 1, 0, 0, 1, 1), 0),\n", " ((1, 0, 1, 0, 1, 0, 1), 0),\n", " ((1, 0, 1, 0, 1, 1, 0), 0),\n", " ((1, 0, 1, 1, 0, 0, 1), 0),\n", " ((1, 0, 1, 1, 0, 1, 0), 0),\n", " ((1, 0, 1, 1, 1, 0, 0), 0),\n", " ((1, 1, 0, 0, 0, 1, 1), 0),\n", " ((1, 1, 0, 0, 1, 0, 1), 0),\n", " ((1, 1, 0, 0, 1, 1, 0), 0),\n", " ((1, 1, 0, 1, 0, 0, 1), 0),\n", " ((1, 1, 0, 1, 0, 1, 0), 0),\n", " ((1, 1, 0, 1, 1, 0, 0), 0),\n", " ((1, 1, 1, 0, 0, 0, 1), 0),\n", " ((1, 1, 1, 0, 0, 1, 0), 0),\n", " ((1, 1, 1, 0, 1, 0, 0), 0),\n", " ((1, 1, 1, 1, 0, 0, 0), 0)]" ] }, "execution_count": 74, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#quad_GL = lambda x: (vector(x) * GL.gram_matrix_bilinear() * vector(x))\n", "quad_GL = lambda x: ((2*(vector(x) * GL.gram_matrix_bilinear() * vector(x))) % 4) / 2\n", "display(GL.cardinality())\n", "ls = [(x, quad_GL(x)) for x in GL if quad_GL(x) == 0 ]\n", "display( len( ls ) )\n", "ls" ] }, { "cell_type": "code", "execution_count": 59, "id": "40efd576-28f6-496b-a319-eadd90556978", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "256" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "Finite quadratic module over Integer Ring with invariants (2, 2, 2, 2, 2, 2, 2, 2)\n", "Gram matrix of the quadratic form with values in Q/2Z:\n", "[ 1 0 1/2 0 0 0 0 0]\n", "[ 0 1 0 1/2 0 0 0 0]\n", "[1/2 0 1 1/2 0 0 0 0]\n", "[ 0 1/2 1/2 1 1/2 0 0 0]\n", "[ 0 0 0 1/2 1 1/2 0 0]\n", "[ 0 0 0 0 1/2 1 1/2 0]\n", "[ 0 0 0 0 0 1/2 1 1/2]\n", "[ 0 0 0 0 0 0 1/2 1]" ] }, "execution_count": 59, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L = E8_2\n", "GL = L.discriminant_group()\n", "display(GL.cardinality())\n", "GL" ] }, { "cell_type": "code", "execution_count": 6, "id": "91a3ec37-e705-49da-986b-f4d65247a8b5", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[ 1 0 1/2 0 0 0 0 0]\n", "[ 0 1 0 1/2 0 0 0 0]\n", "[1/2 0 1 1/2 0 0 0 0]\n", "[ 0 1/2 1/2 1 1/2 0 0 0]\n", "[ 0 0 0 1/2 1 1/2 0 0]\n", "[ 0 0 0 0 1/2 1 1/2 0]\n", "[ 0 0 0 0 0 1/2 1 1/2]\n", "[ 0 0 0 0 0 0 1/2 1]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "GL.gram_matrix_quadratic()" ] }, { "cell_type": "code", "execution_count": 4, "id": "71e4fa69-4159-483b-953a-2f6c63b1b586", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(1, 0, 0, 0, 0, 0, 0, 0),\n", " (0, 1, 0, 0, 0, 0, 0, 0),\n", " (0, 0, 1, 0, 0, 0, 0, 0),\n", " (0, 0, 0, 1, 0, 0, 0, 0),\n", " (0, 0, 0, 0, 1, 0, 0, 0),\n", " (0, 0, 0, 0, 0, 1, 0, 0),\n", " (0, 0, 0, 0, 0, 0, 1, 0),\n", " (0, 0, 0, 0, 0, 0, 0, 1)]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "[x for x in GL.gens()]" ] }, { "cell_type": "code", "execution_count": 57, "id": "b5671c45-7a18-42d6-b2a7-337ed6a3a28a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "136" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "[((0, 0, 0, 0, 0, 0, 0, 0), 0),\n", " ((0, 0, 0, 0, 0, 1, 0, 1), 0),\n", " ((0, 0, 0, 0, 1, 0, 0, 1), 0),\n", " ((0, 0, 0, 0, 1, 0, 1, 0), 0),\n", " ((0, 0, 0, 0, 1, 0, 1, 1), 0),\n", " ((0, 0, 0, 0, 1, 1, 0, 1), 0),\n", " ((0, 0, 0, 1, 0, 0, 0, 1), 0),\n", " ((0, 0, 0, 1, 0, 0, 1, 0), 0),\n", " ((0, 0, 0, 1, 0, 0, 1, 1), 0),\n", " ((0, 0, 0, 1, 0, 1, 0, 0), 0),\n", " ((0, 0, 0, 1, 0, 1, 1, 0), 0),\n", " ((0, 0, 0, 1, 0, 1, 1, 1), 0),\n", " ((0, 0, 0, 1, 1, 0, 0, 1), 0),\n", " ((0, 0, 0, 1, 1, 0, 1, 0), 0),\n", " ((0, 0, 0, 1, 1, 0, 1, 1), 0),\n", " ((0, 0, 0, 1, 1, 1, 0, 1), 0),\n", " ((0, 0, 1, 0, 0, 0, 0, 1), 0),\n", " ((0, 0, 1, 0, 0, 0, 1, 0), 0),\n", " ((0, 0, 1, 0, 0, 0, 1, 1), 0),\n", " ((0, 0, 1, 0, 0, 1, 0, 0), 0),\n", " ((0, 0, 1, 0, 0, 1, 1, 0), 0),\n", " ((0, 0, 1, 0, 0, 1, 1, 1), 0),\n", " ((0, 0, 1, 0, 1, 0, 0, 0), 0),\n", " ((0, 0, 1, 0, 1, 1, 0, 0), 0),\n", " ((0, 0, 1, 0, 1, 1, 1, 0), 0),\n", " ((0, 0, 1, 0, 1, 1, 1, 1), 0),\n", " ((0, 0, 1, 1, 0, 0, 0, 1), 0),\n", " ((0, 0, 1, 1, 0, 0, 1, 0), 0),\n", " ((0, 0, 1, 1, 0, 0, 1, 1), 0),\n", " ((0, 0, 1, 1, 0, 1, 0, 0), 0),\n", " ((0, 0, 1, 1, 0, 1, 1, 0), 0),\n", " ((0, 0, 1, 1, 0, 1, 1, 1), 0),\n", " ((0, 0, 1, 1, 1, 0, 0, 1), 0),\n", " ((0, 0, 1, 1, 1, 0, 1, 0), 0),\n", " ((0, 0, 1, 1, 1, 0, 1, 1), 0),\n", " ((0, 0, 1, 1, 1, 1, 0, 1), 0),\n", " ((0, 1, 0, 0, 0, 0, 0, 1), 0),\n", " ((0, 1, 0, 0, 0, 0, 1, 0), 0),\n", " ((0, 1, 0, 0, 0, 0, 1, 1), 0),\n", " ((0, 1, 0, 0, 0, 1, 0, 0), 0),\n", " ((0, 1, 0, 0, 0, 1, 1, 0), 0),\n", " ((0, 1, 0, 0, 0, 1, 1, 1), 0),\n", " ((0, 1, 0, 0, 1, 0, 0, 0), 0),\n", " ((0, 1, 0, 0, 1, 1, 0, 0), 0),\n", " ((0, 1, 0, 0, 1, 1, 1, 0), 0),\n", " ((0, 1, 0, 0, 1, 1, 1, 1), 0),\n", " ((0, 1, 0, 1, 0, 0, 0, 1), 0),\n", " ((0, 1, 0, 1, 0, 0, 1, 0), 0),\n", " ((0, 1, 0, 1, 0, 0, 1, 1), 0),\n", " ((0, 1, 0, 1, 0, 1, 0, 0), 0),\n", " ((0, 1, 0, 1, 0, 1, 1, 0), 0),\n", " ((0, 1, 0, 1, 0, 1, 1, 1), 0),\n", " ((0, 1, 0, 1, 1, 0, 0, 1), 0),\n", " ((0, 1, 0, 1, 1, 0, 1, 0), 0),\n", " ((0, 1, 0, 1, 1, 0, 1, 1), 0),\n", " ((0, 1, 0, 1, 1, 1, 0, 1), 0),\n", " ((0, 1, 1, 0, 0, 0, 0, 0), 0),\n", " ((0, 1, 1, 0, 0, 1, 0, 1), 0),\n", " ((0, 1, 1, 0, 1, 0, 0, 1), 0),\n", " ((0, 1, 1, 0, 1, 0, 1, 0), 0),\n", " ((0, 1, 1, 0, 1, 0, 1, 1), 0),\n", " ((0, 1, 1, 0, 1, 1, 0, 1), 0),\n", " ((0, 1, 1, 1, 0, 0, 0, 1), 0),\n", " ((0, 1, 1, 1, 0, 0, 1, 0), 0),\n", " ((0, 1, 1, 1, 0, 0, 1, 1), 0),\n", " ((0, 1, 1, 1, 0, 1, 0, 0), 0),\n", " ((0, 1, 1, 1, 0, 1, 1, 0), 0),\n", " ((0, 1, 1, 1, 0, 1, 1, 1), 0),\n", " ((0, 1, 1, 1, 1, 0, 0, 1), 0),\n", " ((0, 1, 1, 1, 1, 0, 1, 0), 0),\n", " ((0, 1, 1, 1, 1, 0, 1, 1), 0),\n", " ((0, 1, 1, 1, 1, 1, 0, 1), 0),\n", " ((1, 0, 0, 0, 0, 0, 0, 1), 0),\n", " ((1, 0, 0, 0, 0, 0, 1, 0), 0),\n", " ((1, 0, 0, 0, 0, 0, 1, 1), 0),\n", " ((1, 0, 0, 0, 0, 1, 0, 0), 0),\n", " ((1, 0, 0, 0, 0, 1, 1, 0), 0),\n", " ((1, 0, 0, 0, 0, 1, 1, 1), 0),\n", " ((1, 0, 0, 0, 1, 0, 0, 0), 0),\n", " ((1, 0, 0, 0, 1, 1, 0, 0), 0),\n", " ((1, 0, 0, 0, 1, 1, 1, 0), 0),\n", " ((1, 0, 0, 0, 1, 1, 1, 1), 0),\n", " ((1, 0, 0, 1, 0, 0, 0, 0), 0),\n", " ((1, 0, 0, 1, 0, 1, 0, 1), 0),\n", " ((1, 0, 0, 1, 1, 0, 0, 0), 0),\n", " ((1, 0, 0, 1, 1, 1, 0, 0), 0),\n", " ((1, 0, 0, 1, 1, 1, 1, 0), 0),\n", " ((1, 0, 0, 1, 1, 1, 1, 1), 0),\n", " ((1, 0, 1, 0, 0, 0, 0, 1), 0),\n", " ((1, 0, 1, 0, 0, 0, 1, 0), 0),\n", " ((1, 0, 1, 0, 0, 0, 1, 1), 0),\n", " ((1, 0, 1, 0, 0, 1, 0, 0), 0),\n", " ((1, 0, 1, 0, 0, 1, 1, 0), 0),\n", " ((1, 0, 1, 0, 0, 1, 1, 1), 0),\n", " ((1, 0, 1, 0, 1, 0, 0, 0), 0),\n", " ((1, 0, 1, 0, 1, 1, 0, 0), 0),\n", " ((1, 0, 1, 0, 1, 1, 1, 0), 0),\n", " ((1, 0, 1, 0, 1, 1, 1, 1), 0),\n", " ((1, 0, 1, 1, 0, 0, 0, 1), 0),\n", " ((1, 0, 1, 1, 0, 0, 1, 0), 0),\n", " ((1, 0, 1, 1, 0, 0, 1, 1), 0),\n", " ((1, 0, 1, 1, 0, 1, 0, 0), 0),\n", " ((1, 0, 1, 1, 0, 1, 1, 0), 0),\n", " ((1, 0, 1, 1, 0, 1, 1, 1), 0),\n", " ((1, 0, 1, 1, 1, 0, 0, 1), 0),\n", " ((1, 0, 1, 1, 1, 0, 1, 0), 0),\n", " ((1, 0, 1, 1, 1, 0, 1, 1), 0),\n", " ((1, 0, 1, 1, 1, 1, 0, 1), 0),\n", " ((1, 1, 0, 0, 0, 0, 0, 0), 0),\n", " ((1, 1, 0, 0, 0, 1, 0, 1), 0),\n", " ((1, 1, 0, 0, 1, 0, 0, 1), 0),\n", " ((1, 1, 0, 0, 1, 0, 1, 0), 0),\n", " ((1, 1, 0, 0, 1, 0, 1, 1), 0),\n", " ((1, 1, 0, 0, 1, 1, 0, 1), 0),\n", " ((1, 1, 0, 1, 0, 0, 0, 0), 0),\n", " ((1, 1, 0, 1, 0, 1, 0, 1), 0),\n", " ((1, 1, 0, 1, 1, 0, 0, 0), 0),\n", " ((1, 1, 0, 1, 1, 1, 0, 0), 0),\n", " ((1, 1, 0, 1, 1, 1, 1, 0), 0),\n", " ((1, 1, 0, 1, 1, 1, 1, 1), 0),\n", " ((1, 1, 1, 0, 0, 0, 0, 0), 0),\n", " ((1, 1, 1, 0, 0, 1, 0, 1), 0),\n", " ((1, 1, 1, 0, 1, 0, 0, 1), 0),\n", " ((1, 1, 1, 0, 1, 0, 1, 0), 0),\n", " ((1, 1, 1, 0, 1, 0, 1, 1), 0),\n", " ((1, 1, 1, 0, 1, 1, 0, 1), 0),\n", " ((1, 1, 1, 1, 0, 0, 0, 1), 0),\n", " ((1, 1, 1, 1, 0, 0, 1, 0), 0),\n", " ((1, 1, 1, 1, 0, 0, 1, 1), 0),\n", " ((1, 1, 1, 1, 0, 1, 0, 0), 0),\n", " ((1, 1, 1, 1, 0, 1, 1, 0), 0),\n", " ((1, 1, 1, 1, 0, 1, 1, 1), 0),\n", " ((1, 1, 1, 1, 1, 0, 0, 1), 0),\n", " ((1, 1, 1, 1, 1, 0, 1, 0), 0),\n", " ((1, 1, 1, 1, 1, 0, 1, 1), 0),\n", " ((1, 1, 1, 1, 1, 1, 0, 1), 0)]" ] }, "execution_count": 57, "metadata": {}, "output_type": "execute_result" } ], "source": [ "quad_GL = lambda x: (1/2) * ((vector(x) * GL.gram_matrix_quadratic() * vector(x)) % 2)\n", "#a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 = [Aen.gens_vector(x) for x in Aen.gens()]\n", "#a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11 = Aen.gens()\n", "ls = [(x, quad_GL(x)) for x in GL if quad_GL(x) == 0]\n", "display( len( ls ) )\n", "ls" ] }, { "cell_type": "code", "execution_count": 49, "id": "d5b5e713-0d54-433e-bcad-42754915bb0f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ls = [(x, quad_GL(x)) for x in GL]\n", "ls\n", "x = GL[12]\n", "(vector(x) * GL.gram_matrix_quadratic() * vector(x)) % 2\n" ] }, { "cell_type": "code", "execution_count": 31, "id": "f045fa10-6eee-40e8-a4c6-5dcabff95529", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "S = QQ.quotient(2)\n", "(3).mod(2)" ] }, { "cell_type": "code", "execution_count": 5, "id": "1cfe9db1-324e-466f-9638-ad3fc7d0d2e5", "metadata": {}, "outputs": [], "source": [ "Tco2 = Z.direct_sum(U).direct_sum(E8)\n" ] }, { "cell_type": "code", "execution_count": 6, "id": "ae176fcb-c267-4599-87c3-c7ee15eda2a2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2048" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Tco.discriminant_group().cardinality()" ] }, { "cell_type": "code", "execution_count": 7, "id": "906905bd-14bb-449e-9863-89217ed4ff94", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Tco2.discriminant_group().cardinality()" ] }, { "cell_type": "code", "execution_count": 8, "id": "864b063b-69c6-4303-aed6-21a58e97e49c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Lattice of degree 11 and rank 11 over Integer Ring\n", "Standard basis \n", "Inner product matrix:\n", "[ 1 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 1 0 0 0 0 0 0 0 0]\n", "[ 0 1 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 -2 0 1 0 0 0 0 0]\n", "[ 0 0 0 0 -2 0 1 0 0 0 0]\n", "[ 0 0 0 1 0 -2 1 0 0 0 0]\n", "[ 0 0 0 0 1 1 -2 1 0 0 0]\n", "[ 0 0 0 0 0 0 1 -2 1 0 0]\n", "[ 0 0 0 0 0 0 0 1 -2 1 0]\n", "[ 0 0 0 0 0 0 0 0 1 -2 1]\n", "[ 0 0 0 0 0 0 0 0 0 1 -2]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Tco2" ] }, { "cell_type": "code", "execution_count": 5, "id": "52018f60-b2c1-4287-98ae-0458957dcd65", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Lattice of degree 3 and rank 3 over Integer Ring\n", "Standard basis \n", "Inner product matrix:\n", "[ 1 0 0]\n", "[ 0 -1 0]\n", "[ 0 0 -1]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L = Ipq(1, 2)\n", "L" ] }, { "cell_type": "code", "execution_count": 6, "id": "d155ad29-9264-4b2c-b8f1-b39182460c94", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L.discriminant_group().cardinality()" ] }, { "cell_type": "code", "execution_count": 8, "id": "25a566d8-8ad3-403b-93bb-e74661a33ed0", "metadata": {}, "outputs": [ { "ename": "NotImplementedError", "evalue": "currently, we can only compute generators for orthogonal groups over definite lattices.", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mNotImplementedError\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[8], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mL\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mautomorphisms\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", "File \u001b[0;32m~/gitclones/sage/src/sage/modules/free_quadratic_module_integer_symmetric.py:1292\u001b[0m, in \u001b[0;36mFreeQuadraticModule_integer_symmetric.orthogonal_group\u001b[0;34m(self, gens, is_finite)\u001b[0m\n\u001b[1;32m 1290\u001b[0m gens\u001b[38;5;241m.\u001b[39mappend(g)\n\u001b[1;32m 1291\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m: \u001b[38;5;66;03m# indefinite\u001b[39;00m\n\u001b[0;32m-> 1292\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mNotImplementedError\u001b[39;00m(\n\u001b[1;32m 1293\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcurrently, we can only compute generators \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1294\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfor orthogonal groups over definite lattices.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 1295\u001b[0m deg \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdegree()\n\u001b[1;32m 1296\u001b[0m base \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mambient_vector_space()\u001b[38;5;241m.\u001b[39mbase_ring()\n", "\u001b[0;31mNotImplementedError\u001b[0m: currently, we can only compute generators for orthogonal groups over definite lattices." ] } ], "source": [ "L.automorphisms()" ] }, { "cell_type": "code", "execution_count": 9, "id": "f5806840-3de1-49d3-a92a-845dc6759b9b", "metadata": {}, "outputs": [], "source": [ "L = U.direct_sum(U)" ] }, { "cell_type": "code", "execution_count": 10, "id": "47343ba8-d9f2-48ca-94dc-6bcd10db9030", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Lattice of degree 4 and rank 4 over Integer Ring\n", "Standard basis \n", "Inner product matrix:\n", "[0 1 0 0]\n", "[1 0 0 0]\n", "[0 0 0 1]\n", "[0 0 1 0]" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L" ] }, { "cell_type": "code", "execution_count": 11, "id": "212cd25b-cf6b-4ca3-92e9-81738fd276c2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Finite quadratic module over Integer Ring with invariants ()\n", "Gram matrix of the quadratic form with values in Q/2Z:\n", "[]" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L.discriminant_group()" ] }, { "cell_type": "code", "execution_count": 12, "id": "e141e455-5e52-4ff5-bf99-85b67260bd9e", "metadata": {}, "outputs": [], "source": [ "D = L.discriminant_group()" ] }, { "cell_type": "code", "execution_count": 15, "id": "91d98263-b6a2-4a01-9ba4-7b13273b3ee7", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Quadratic form in 4 variables over Integer Ring with coefficients: \n", "[ 0 2 0 0 ]\n", "[ * 0 0 0 ]\n", "[ * * 0 2 ]\n", "[ * * * 0 ]" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Q = L.quadratic_form()\n", "Q" ] }, { "cell_type": "code", "execution_count": 16, "id": "6b6862bc-cff1-4402-bf01-04cb1c6caff0", "metadata": {}, "outputs": [ { "ename": "PariError", "evalue": "domain error in minim0: form is not positive definite", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mPariError\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[16], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mQ\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtheta_series\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", "File \u001b[0;32m~/gitclones/sage/src/sage/quadratic_forms/quadratic_form__theta.py:68\u001b[0m, in \u001b[0;36mtheta_series\u001b[0;34m(self, Max, var_str, safe_flag)\u001b[0m\n\u001b[1;32m 65\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mNotImplementedError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mwe have to figure out the correct number of Fourier coefficients to use\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 66\u001b[0m \u001b[38;5;66;03m# return self.theta_by_pari(sturm_bound(self.level(), self.dim() / ZZ(2)) + 1, var_str, safe_flag)\u001b[39;00m\n\u001b[1;32m 67\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m---> 68\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtheta_by_pari\u001b[49m\u001b[43m(\u001b[49m\u001b[43mM\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mvar_str\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msafe_flag\u001b[49m\u001b[43m)\u001b[49m\n", "File \u001b[0;32m~/gitclones/sage/src/sage/quadratic_forms/quadratic_form__theta.py:112\u001b[0m, in \u001b[0;36mtheta_by_pari\u001b[0;34m(self, Max, var_str, safe_flag)\u001b[0m\n\u001b[1;32m 110\u001b[0m theta_vec \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__theta_vec[:Max]\n\u001b[1;32m 111\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 112\u001b[0m theta_vec \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrepresentation_number_list\u001b[49m\u001b[43m(\u001b[49m\u001b[43mMax\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 113\u001b[0m \u001b[38;5;66;03m# Cache the theta vector\u001b[39;00m\n\u001b[1;32m 114\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__theta_vec \u001b[38;5;241m=\u001b[39m theta_vec\n", "File \u001b[0;32m~/gitclones/sage/src/sage/quadratic_forms/quadratic_form__ternary_Tornaria.py:544\u001b[0m, in \u001b[0;36mrepresentation_number_list\u001b[0;34m(self, B)\u001b[0m\n\u001b[1;32m 533\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 534\u001b[0m \u001b[38;5;124;03mReturn the vector of representation numbers < B.\u001b[39;00m\n\u001b[1;32m 535\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 540\u001b[0m \u001b[38;5;124;03m [1, 16, 112, 448, 1136, 2016, 3136, 5504, 9328, 12112]\u001b[39;00m\n\u001b[1;32m 541\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 542\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01msage\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mlibs\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mpari\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mall\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m pari\n\u001b[0;32m--> 544\u001b[0m ans \u001b[38;5;241m=\u001b[39m pari(\u001b[38;5;241m1\u001b[39m)\u001b[38;5;241m.\u001b[39mconcat(\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m__pari__\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mqfrep\u001b[49m\u001b[43m(\u001b[49m\u001b[43mB\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m \u001b[38;5;241m*\u001b[39m \u001b[38;5;241m2\u001b[39m)\n\u001b[1;32m 545\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m ans\u001b[38;5;241m.\u001b[39msage()\n", "File \u001b[0;32m~/gitclones/sage/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/cypari2/gen.pyx:4279\u001b[0m, in \u001b[0;36mcypari2.gen.Gen.qfrep\u001b[0;34m()\u001b[0m\n\u001b[1;32m 4277\u001b[0m cdef Gen t0 = objtogen(B)\n\u001b[1;32m 4278\u001b[0m cdef GEN r\n\u001b[0;32m-> 4279\u001b[0m sig_on()\n\u001b[1;32m 4280\u001b[0m r = qfrep0(self.g, t0.g, flag & 1)\n\u001b[1;32m 4281\u001b[0m if (flag & 2) == 0:\n", "File \u001b[0;32m~/gitclones/sage/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/cypari2/handle_error.pyx:211\u001b[0m, in \u001b[0;36mcypari2.handle_error._pari_err_handle\u001b[0;34m()\u001b[0m\n\u001b[1;32m 209\u001b[0m pari_error_string = s.decode('ascii') + \": \" + pari_error_string\n\u001b[1;32m 210\u001b[0m \n\u001b[0;32m--> 211\u001b[0m raise PariError(errnum, pari_error_string, clone_gen_noclear(E))\n\u001b[1;32m 212\u001b[0m \n\u001b[1;32m 213\u001b[0m \n", "\u001b[0;31mPariError\u001b[0m: domain error in minim0: form is not positive definite" ] } ], "source": [ "Q.theta_series()" ] }, { "cell_type": "code", "execution_count": 18, "id": "1af3cc07-2435-4d4f-ba49-7c4decfe3a60", "metadata": {}, "outputs": [], "source": [ "L = Z.twist(-20).direct_sum(H).direct_sum(H).direct_sum(E8).direct_sum(E8)" ] }, { "cell_type": "code", "execution_count": 19, "id": "983c32a3-f390-459e-b0df-beee252a9b44", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Finite quadratic module over Integer Ring with invariants (20,)\n", "Gram matrix of the quadratic form with values in Q/2Z:\n", "[39/20]" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L.discriminant_group()" ] }, { "cell_type": "code", "execution_count": 20, "id": "50c0cbc3-4626-4a4b-ada2-0c4990931270", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Lattice of degree 21 and rank 21 over Integer Ring\n", "Standard basis \n", "Inner product matrix:\n", "[-20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 0 0 -2 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 0 0 0 -2 0 1 0 0 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 0 0 1 0 -2 1 0 0 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 0 0 0 1 1 -2 1 0 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 0 0 0 0 0 1 -2 1 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 0 0 0 0 0 0 1 -2 1 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 0 0 0 0 0 0 0 1 -2 1 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 0 0 0 0 0 0 0 0 1 -2 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 0 0 0 0 0 0 0 0 0 0 -2 0 1 0 0 0 0 0]\n", "[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2 0 1 0 0 0 0]\n", "[ 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 -2 1 0 0 0 0]\n", "[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 -2 1 0 0 0]\n", "[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -2 1 0 0]\n", "[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -2 1 0]\n", "[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -2 1]\n", "[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -2]" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L" ] }, { "cell_type": "code", "execution_count": 21, "id": "37b0623d-229f-48c4-9609-60b415b0faf3", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "20" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L.discriminant_group().cardinality()" ] }, { "cell_type": "code", "execution_count": 22, "id": "d09265cf-7beb-4393-8702-0125424f2be5", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[39/20]" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "D_L = L.discriminant_group()\n", "#Qen = Aen.gram_matrix_quadratic()\n", "quad_L = lambda x: vector(x) * D_L.gram_matrix_quadratic() * vector(x)\n", "#a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 = [Aen.gens_vector(x) for x in Aen.gens()]\n", "#a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11 = Aen.gens()\n", "[quad_L(x) for x in D_L.gens() ]" ] }, { "cell_type": "code", "execution_count": 27, "id": "343461db-1740-443b-ad1d-793df3275280", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Lattice of degree 11 and rank 11 over Integer Ring\n", "Standard basis \n", "Inner product matrix:\n", "[ 2 0 0 0 0 0 0 0 0 0 0]\n", "[ 0 2 0 0 0 0 0 0 0 0 0]\n", "[ 0 0 -2 0 0 0 0 0 0 0 0]\n", "[ 0 0 0 -2 0 0 0 0 0 0 0]\n", "[ 0 0 0 0 -2 0 0 0 0 0 0]\n", "[ 0 0 0 0 0 -2 0 0 0 0 0]\n", "[ 0 0 0 0 0 0 -2 0 0 0 0]\n", "[ 0 0 0 0 0 0 0 -2 0 0 0]\n", "[ 0 0 0 0 0 0 0 0 -2 0 0]\n", "[ 0 0 0 0 0 0 0 0 0 -2 0]\n", "[ 0 0 0 0 0 0 0 0 0 0 -2]" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L = Ipq(2, 9).twist(2)\n", "L" ] }, { "cell_type": "code", "execution_count": 29, "id": "9d76eca2-45d1-4b4b-aabd-5df48889aad2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2048" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L.discriminant_group().cardinality()" ] }, { "cell_type": "code", "execution_count": 34, "id": "97b70170-f757-4755-afc5-c314bef023ba", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2048" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Tco.discriminant_group().cardinality()" ] }, { "cell_type": "code", "execution_count": 35, "id": "e0933cae-1b7f-483f-9023-5effcee02ae0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Lattice of degree 7 and rank 7 over Integer Ring\n", "Standard basis \n", "Inner product matrix:\n", "[-2 0 0 0 0 0 0]\n", "[ 0 -2 0 0 0 0 0]\n", "[ 0 0 -2 0 0 0 0]\n", "[ 0 0 0 -2 0 0 0]\n", "[ 0 0 0 0 -2 0 0]\n", "[ 0 0 0 0 0 -2 0]\n", "[ 0 0 0 0 0 0 -2]" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L = Ipq(0, 7).twist(2)\n", "L" ] }, { "cell_type": "code", "execution_count": 38, "id": "31e0e2f4-ba38-4010-9e12-e1fef74fb691", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Group of isometries of \n", "Finite quadratic module over Integer Ring with invariants (2, 2, 2, 2, 2, 2, 2)\n", "Gram matrix of the quadratic form with values in Q/2Z:\n", "[3/2 0 0 0 0 0 0]\n", "[ 0 3/2 0 0 0 0 0]\n", "[ 0 0 3/2 0 0 0 0]\n", "[ 0 0 0 3/2 0 0 0]\n", "[ 0 0 0 0 3/2 0 0]\n", "[ 0 0 0 0 0 3/2 0]\n", "[ 0 0 0 0 0 0 3/2]\n", "generated by 3 elements" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "G = L.discriminant_group().orthogonal_group()\n", "G" ] }, { "cell_type": "code", "execution_count": 39, "id": "3b149460-9ffc-4376-be57-3d2543cd4a4c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "([0 1 1 1 1 0 1]\n", " [1 1 1 1 1 0 0]\n", " [1 1 1 1 0 0 1]\n", " [1 1 1 0 1 0 1]\n", " [1 1 0 1 1 0 1]\n", " [1 0 1 1 1 0 1]\n", " [0 0 0 0 0 1 0],\n", " [1 1 1 1 1 0 0]\n", " [1 1 1 1 0 1 0]\n", " [1 1 1 0 1 1 0]\n", " [1 1 0 1 1 1 0]\n", " [1 0 1 1 1 1 0]\n", " [0 1 1 1 1 1 0]\n", " [0 0 0 0 0 0 1],\n", " [1 1 1 1 1 0 0]\n", " [1 1 1 1 0 1 0]\n", " [1 1 0 1 1 1 0]\n", " [1 1 1 0 1 1 0]\n", " [1 0 1 1 1 1 0]\n", " [0 1 1 1 1 1 0]\n", " [0 0 0 0 0 0 1])" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "G.gens()" ] }, { "cell_type": "code", "execution_count": 41, "id": "a9afa16a-e817-4278-992e-97c30f87dafc", "metadata": {}, "outputs": [], "source": [ "L = U_2.direct_sum(U_2).direct_sum( Ipq(0, 7).twist(2) )" ] }, { "cell_type": "code", "execution_count": 43, "id": "a2997c79-d3c3-4de0-95ce-63989ac7f754", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2048" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "L.discriminant_group().cardinality()" ] }, { "cell_type": "code", "execution_count": null, "id": "250f0b3f-e253-4480-b83c-9c3110164360", "metadata": {}, "outputs": [], "source": [ "L.discriminant_group().orthogonal_group()" ] }, { "cell_type": "code", "execution_count": 26, "id": "bc2baaf4-d3c2-4bec-86f6-d569d97d72ac", "metadata": {}, "outputs": [], "source": [ "L = U.direct_sum(U)\n", "e1, f1, e2, f2 = L.gens()\n", "dot_L = lambda x,y: x * L.gram_matrix() * y\n", "nm_L = lambda x: dot_L(x, x)\n", "\n", "def E(a,b):\n", " f = lambda x: x - (dot_L(x, a) * b) + (dot_L(x, b) - (1/2)*dot_L(b, b)*dot_L(x, a) )*a\n", " return f" ] }, { "cell_type": "code", "execution_count": 38, "id": "3e7aaa19-f4cf-4c81-83bf-7f4b47760125", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(1, 2, -1, 0)" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v = e1 + 2*f1\n", "f1 = E(e2, -f1)\n", "f1(v)" ] }, { "cell_type": "code", "execution_count": 36, "id": "faa51c88-3979-4209-b943-d6723620d019", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(1, 2, -1, 0)" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "x - e2" ] }, { "cell_type": "code", "execution_count": 39, "id": "12708289-59b6-4b00-a310-439f1daee98a", "metadata": {}, "outputs": [], "source": [ "f2 = E(f2, -2*v)" ] }, { "cell_type": "code", "execution_count": 40, "id": "f8a58aaa-5ba9-40ce-85c6-30ab1b6d4278", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(-1, -2, -1, 0)" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f2(f1(v))" ] }, { "cell_type": "code", "execution_count": 42, "id": "e73074fc-791f-4268-ab96-aa0f64a49886", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(-1, -2, -1, 0)" ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "-v-e2" ] }, { "cell_type": "code", "execution_count": null, "id": "8b857e91-3e08-4f9c-b390-6e17a71e1244", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "SageMath 10.4.beta5", "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.11.1" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 5 }