diff --git a/docs/manual/source/images/drawGraphs.ipynb b/docs/manual/source/images/drawGraphs.ipynb index 2f1a85253..c7dc9e1e8 100644 --- a/docs/manual/source/images/drawGraphs.ipynb +++ b/docs/manual/source/images/drawGraphs.ipynb @@ -1453,7 +1453,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 3, "id": "0fa781a1", "metadata": {}, "outputs": [], @@ -1467,7 +1467,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 4, "id": "15fd030b", "metadata": {}, "outputs": [], @@ -2025,7 +2025,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 5, "id": "2ff86b65", "metadata": {}, "outputs": [ @@ -2089,7 +2089,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -2155,7 +2155,7 @@ "\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -2174,8 +2174,8 @@ "# Hack to create a theory element from a string:\n", "sms = ExpSMS.from_string(sms, model=model)\n", "sms.draw(\n", - "# filename='sms_canon1b.png'\n", - " )" + " # filename='sms_example.png'\n", + " )\n" ] }, { @@ -4655,53 +4655,10 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 6, "id": "bd9b4678", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "WARNING in databaseObj.fetchFromScratch() in 691: downloading the database from https://smodels.github.io/database/official300-beta and caching in /home/lessa/.cache/smodels. If you want the pickled database file to be cached in a different location, set the environment variable SMODELS_CACHEDIR, e.g. to '/tmp'.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "loading >..." - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "ERROR in databaseObj.fetchFromScratch() in 714: error: downloaded file has different checksum 2f3c483272444bb47ab012f8b276255f6d61d634!=2661455793ef5f14f8ab1afd1dbdd600e4002879. This should not happen. Contact the smodels-developers \n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "done.\n" - ] - }, - { - "ename": "UnpicklingError", - "evalue": "pickle data was truncated", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mUnpicklingError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[30], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01msmodels\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mexperiment\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mdatabaseObj\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Database\n\u001b[0;32m----> 2\u001b[0m db \u001b[38;5;241m=\u001b[39m \u001b[43mDatabase\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mofficial\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/smodels-graphs/docs/manual/source/images/../../../../smodels/experiment/databaseObj.py:93\u001b[0m, in \u001b[0;36mDatabase.__init__\u001b[0;34m(self, base, force_load, progressbar, subpickle, combinationsmatrix)\u001b[0m\n\u001b[1;32m 91\u001b[0m sstrings \u001b[38;5;241m=\u001b[39m base\u001b[38;5;241m.\u001b[39msplit(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m+\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 92\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m ss \u001b[38;5;129;01min\u001b[39;00m sstrings:\n\u001b[0;32m---> 93\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msubs\u001b[38;5;241m.\u001b[39mappend(\u001b[43mSubDatabase\u001b[49m\u001b[43m(\u001b[49m\u001b[43mss\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mforce_load\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 94\u001b[0m \u001b[43m \u001b[49m\u001b[43mprogressbar\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msubpickle\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 95\u001b[0m \u001b[43m \u001b[49m\u001b[43mcombinationsmatrix\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[1;32m 98\u001b[0m \u001b[38;5;66;03m# Compute SMS dict with all results\u001b[39;00m\n\u001b[1;32m 99\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_allExpSMSDict \u001b[38;5;241m=\u001b[39m ExpSMSDict(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexpResultList)\n", - "File \u001b[0;32m~/smodels-graphs/docs/manual/source/images/../../../../smodels/experiment/databaseObj.py:383\u001b[0m, in \u001b[0;36mSubDatabase.__init__\u001b[0;34m(self, base, force_load, progressbar, subpickle, combinationsmatrix)\u001b[0m\n\u001b[1;32m 381\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[1;32m 382\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mforce_load \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpcl\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[0;32m--> 383\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloadBinaryFile\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 384\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_setParticles()\n\u001b[1;32m 385\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mpcl_meta\u001b[38;5;241m.\u001b[39mprintFastlimBanner()\n", - "File \u001b[0;32m~/smodels-graphs/docs/manual/source/images/../../../../smodels/experiment/databaseObj.py:531\u001b[0m, in \u001b[0;36mSubDatabase.loadBinaryFile\u001b[0;34m(self, lastm_only)\u001b[0m\n\u001b[1;32m 529\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexpResultList \u001b[38;5;241m=\u001b[39m serializer\u001b[38;5;241m.\u001b[39mload(f)\n\u001b[1;32m 530\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 531\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexpResultList \u001b[38;5;241m=\u001b[39m \u001b[43mserializer\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload\u001b[49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mencoding\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mlatin1\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 532\u001b[0m t1 \u001b[38;5;241m=\u001b[39m time\u001b[38;5;241m.\u001b[39mtime()\u001b[38;5;241m-\u001b[39mt0\n\u001b[1;32m 533\u001b[0m logger\u001b[38;5;241m.\u001b[39minfo(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mLoaded database from \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m in \u001b[39m\u001b[38;5;132;01m%.1f\u001b[39;00m\u001b[38;5;124m secs.\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m%\u001b[39m\n\u001b[1;32m 534\u001b[0m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mpcl_meta\u001b[38;5;241m.\u001b[39mpathname, t1))\n", - "\u001b[0;31mUnpicklingError\u001b[0m: pickle data was truncated" - ] - } - ], + "outputs": [], "source": [ "from smodels.experiment.databaseObj import Database\n", "db = Database('official')" @@ -5383,11 +5340,11 @@ "# Hack to create a theory element from a string:\n", "smsA = ExpSMS.from_string(smsA, model=model)\n", "smsA.draw(\n", - " filename='sms_coverage_sms1.png'\n", + " # filename='sms_coverage_sms1.png'\n", ")\n", "fsA = FinalStateSMS(smsA,missingX=1.0)\n", "fsA.draw(\n", - " filename='sms_coverage_sms1_simp.png'\n", + " # filename='sms_coverage_sms1_simp.png'\n", ")" ] }, @@ -5569,11 +5526,11 @@ "# Hack to create a theory element from a string:\n", "smsA = ExpSMS.from_string(smsA, model=model)\n", "smsA.draw(\n", - " filename='sms_coverage_sms2.png'\n", + " # filename='sms_coverage_sms2.png'\n", ")\n", "fsA = FinalStateSMS(smsA,missingX=1.0)\n", "fsA.draw(\n", - " filename='sms_coverage_sms2_simp.png'\n", + " # filename='sms_coverage_sms2_simp.png'\n", ")" ] }, @@ -5783,18 +5740,341 @@ "# Hack to create a theory element from a string:\n", "smsA = ExpSMS.from_string(smsA, model=model)\n", "smsA.draw(\n", - " filename='sms_coverage_sms3.png'\n", + " # filename='sms_coverage_sms3.png'\n", ")\n", "fsA = FinalStateSMS(smsA,missingX=1.0)\n", "fsA.draw(\n", - " filename='sms_coverage_sms3_simp.png'\n", + " # filename='sms_coverage_sms3_simp.png'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "d8eb0fe1-bbe1-4086-85bb-3b754f8b6e8a", + "metadata": {}, + "source": [ + "### Paper graphs" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "54568dbe-ac90-4809-9289-74d9d7b6793b", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "%3\n", + "\n", + "\n", + "\n", + "0\n", + "\n", + "PV\n", + "\n", + "\n", + "\n", + "1\n", + "\n", + "C1+\n", + "\n", + "\n", + "\n", + "0->1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "2\n", + "\n", + "N1\n", + "\n", + "\n", + "\n", + "0->2\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "3\n", + "\n", + "q\n", + "\n", + "\n", + "\n", + "1->3\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "4\n", + "\n", + "q\n", + "\n", + "\n", + "\n", + "1->4\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "5\n", + "\n", + "q\n", + "\n", + "\n", + "\n", + "1->5\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "6\n", + "\n", + "q\n", + "\n", + "\n", + "\n", + "2->6\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "7\n", + "\n", + "q\n", + "\n", + "\n", + "\n", + "2->7\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "8\n", + "\n", + "q\n", + "\n", + "\n", + "\n", + "2->8\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "from smodels.share.models.mssm import BSMList\n", + "model = Model(BSMList,SMList)\n", + "smsA = \"(PV > C1+(1),N1(2)), (C1+(1) > q(3),q(4),q(5)), (N1(2) > q(6),q(7),q(8))\"\n", + "# Hack to create a theory element from a string:\n", + "smsA = ExpSMS.from_string(smsA, model=model)\n", + "smsA.draw(\n", + " filename='sms_rpv_example1.png'\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "8ebb71d8-1eab-4fc0-bc64-411ad621695b", + "metadata": {}, + "outputs": [], + "source": [ + "from smodels.base import runtime\n", + "from smodels.particlesLoader import load,getParticlesFromSLHA\n", + "# Load the BSM model\n", + "runtime.modelFile = \"../../../../smodels/share/models/zprime.slha\"\n", + "# BSMList = load()\n", + "BSMList = getParticlesFromSLHA(runtime.modelFile)\n", + "model = Model(BSMList,SMList)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "81e86ab1-b34c-4658-9f23-39516b540dda", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "%3\n", + "\n", + "\n", + "\n", + "0\n", + "\n", + "PV\n", + "\n", + "\n", + "\n", + "1\n", + "\n", + "zprime\n", + "\n", + "\n", + "\n", + "0->1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "2\n", + "\n", + "dm\n", + "\n", + "\n", + "\n", + "1->2\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "3\n", + "\n", + "dm\n", + "\n", + "\n", + "\n", + "1->3\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "%3\n", + "\n", + "\n", + "\n", + "0\n", + "\n", + "PV\n", + "\n", + "\n", + "\n", + "1\n", + "\n", + "zprime\n", + "\n", + "\n", + "\n", + "0->1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "2\n", + "\n", + "q\n", + "\n", + "\n", + "\n", + "1->2\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "3\n", + "\n", + "q\n", + "\n", + "\n", + "\n", + "1->3\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "smsA = \"(PV > zprime(1)), (zprime(1) > dm(2),dm(3))\"\n", + "# Hack to create a theory element from a string:\n", + "smsA = ExpSMS.from_string(smsA, model=model)\n", + "smsA.draw(\n", + " filename='sms_zprime_example1.png'\n", + ")\n", + "\n", + "smsB = \"(PV > zprime(1)), (zprime(1) > q(2),q(3))\"\n", + "# Hack to create a theory element from a string:\n", + "smsB = ExpSMS.from_string(smsB, model=model)\n", + "smsB.draw(\n", + " filename='sms_zprime_example2.png'\n", ")" ] }, { "cell_type": "code", "execution_count": null, - "id": "79022119-b4f9-4459-8b80-2d63fce3503f", + "id": "46b3f939-3597-4d80-b806-42fa16e4a9a8", "metadata": {}, "outputs": [], "source": []