{ "cells": [ { "cell_type": "markdown", "id": "48ce60bb", "metadata": { "cq.autogen": "title_cell" }, "source": [ "# Factoring RSA\n", "\n", "Bloqs for breaking RSA cryptography systems via integer factorization.\n", "\n", "RSA cryptography is a form of public key cryptography based on the difficulty of\n", "factoring the product of two large prime numbers.\n", "\n", "Using RSA, the cryptographic scheme chooses two large prime numbers p, q, their product n,\n", "λ(n) = lcm(p - 1, q - 1) where λ is Carmichael's totient function, an integer e such that\n", "1 < e < λ(n), and finally d as d ≡ e^-1 (mod λ(n)). The public key consists of the modulus n and\n", "the public (or encryption) exponent e. The private key consists of the private (or decryption)\n", "exponent d, which must be kept secret. p, q, and λ(n) must also be kept secret because they can be\n", "used to calculate d.\n", "\n", "Using Shor's algorithm for factoring, we can find p and q (the factors of n) in polynomial time\n", "with a quantum algorithm.\n", "\n", "References:\n", " [RSA (cryptosystem)](https://en.wikipedia.org/wiki/RSA_(cryptosystem))." ] }, { "cell_type": "code", "execution_count": 1, "id": "d12766dd", "metadata": { "cq.autogen": "top_imports" }, "outputs": [], "source": [ "from qualtran import Bloq, CompositeBloq, BloqBuilder, Signature, Register\n", "from qualtran import QBit, QInt, QUInt, QAny\n", "from qualtran.drawing import show_bloq, show_call_graph, show_counts_sigma\n", "from typing import *\n", "import numpy as np\n", "import sympy\n", "import cirq" ] }, { "cell_type": "markdown", "id": "881834c3", "metadata": { "cq.autogen": "ModExp.bloq_doc.md" }, "source": [ "## `ModExp`\n", "Perform $b^e \\mod{m}$ for constant `base` $b$, `mod` $m$, and quantum `exponent` $e$.\n", "\n", "Modular exponentiation is the main computational primitive for quantum factoring algorithms.\n", "We follow [GE2019]'s \"reference implementation\" for factoring. See `ModExp.make_for_shor`\n", "to set the class attributes for a factoring run.\n", "\n", "This bloq decomposes into controlled modular exponentiation for each exponent bit.\n", "\n", "#### Parameters\n", " - `base`: The integer base of the exponentiation\n", " - `mod`: The integer modulus\n", " - `exp_bitsize`: The size of the `exponent` thru-register\n", " - `x_bitsize`: The size of the `x` right-register \n", "\n", "#### Registers\n", " - `exponent`: The exponent\n", " - `x [right]`: The output register containing the result of the exponentiation \n", "\n", "#### References\n", " - [How to factor 2048 bit RSA integers in 8 hours using 20 million noisy qubits](https://arxiv.org/abs/1905.09749). Gidney and Ekerå. 2019.\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "61062a3d", "metadata": { "cq.autogen": "ModExp.bloq_doc.py" }, "outputs": [], "source": [ "from qualtran.bloqs.cryptography.rsa import ModExp" ] }, { "cell_type": "markdown", "id": "6963ad94", "metadata": { "cq.autogen": "ModExp.example_instances.md" }, "source": [ "### Example Instances" ] }, { "cell_type": "code", "execution_count": 3, "id": "56d35af9", "metadata": { "cq.autogen": "ModExp.modexp_symb" }, "outputs": [], "source": [ "\"\"\"Modular exponentiation with symbolic attributes.\"\"\"\n", "g, N, n_e, n_x = sympy.symbols('g N n_e, n_x')\n", "modexp_symb = ModExp(base=g, mod=N, exp_bitsize=n_e, x_bitsize=n_x)" ] }, { "cell_type": "code", "execution_count": 4, "id": "7d3d90b4", "metadata": { "cq.autogen": "ModExp.modexp_small" }, "outputs": [], "source": [ "\"\"\"A small-exponent modular exponentiation demo.\"\"\"\n", "modexp_small = ModExp(base=4, mod=15, exp_bitsize=3, x_bitsize=2048)" ] }, { "cell_type": "code", "execution_count": 5, "id": "e3a004d3", "metadata": { "cq.autogen": "ModExp.modexp" }, "outputs": [], "source": [ "\"\"\"An example modular exponentiation to factor 13 * 17.\"\"\"\n", "modexp = ModExp.make_for_shor(big_n=13 * 17, g=9)" ] }, { "cell_type": "markdown", "id": "39422b45", "metadata": { "cq.autogen": "ModExp.graphical_signature.md" }, "source": [ "#### Graphical Signature" ] }, { "cell_type": "code", "execution_count": 6, "id": "83a891e2", "metadata": { "cq.autogen": "ModExp.graphical_signature.py" }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "94f131c5bf3c4fe8ab371afb617b1abd", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(Output(outputs=({'output_type': 'display_data', 'data': {'text/plain': '\n", "\n", "counts\n", "\n", "\n", "\n", "b0\n", "\n", "ModExp\n", "\n", "\n", "\n", "b1\n", "\n", "CModMulK\n", "\n", "\n", "\n", "b0->b1\n", "\n", "\n", "3\n", "\n", "\n", "\n", "b2\n", "\n", "|1>\n", "\n", "\n", "\n", "b0->b2\n", "\n", "\n", "1\n", "\n", "\n", "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "#### Counts totals:\n", " - `CModMulK`: 3\n", " - `|1>`: 1" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from qualtran.resource_counting.generalizers import ignore_split_join\n", "modexp_small_g, modexp_small_sigma = modexp_small.call_graph(max_depth=1, generalizer=ignore_split_join)\n", "show_call_graph(modexp_small_g)\n", "show_counts_sigma(modexp_small_sigma)" ] }, { "cell_type": "markdown", "id": "2603abbd", "metadata": { "cq.autogen": "RSAPhaseEstimate.bloq_doc.md" }, "source": [ "## `RSAPhaseEstimate`\n", "Perform a single phase estimation of the decomposition of Modular Exponentiation for the\n", "given base.\n", "\n", "The constructor requires a pre-set base, see the make_for_shor factory method for picking a\n", "random, valid base\n", "\n", "#### Parameters\n", " - `n`: The bitsize of the modulus N.\n", " - `mod`: The modulus N; a part of the public key for RSA.\n", " - `base`: A base for modular exponentiation. \n", "\n", "#### References\n", " - [Circuit for Shor's algorithm using 2n+3 qubits](https://arxiv.org/abs/quant-ph/0205095). Beauregard. 2003. Fig 1.\n" ] }, { "cell_type": "code", "execution_count": 8, "id": "5b838c20", "metadata": { "cq.autogen": "RSAPhaseEstimate.bloq_doc.py" }, "outputs": [], "source": [ "from qualtran.bloqs.cryptography.rsa import RSAPhaseEstimate" ] }, { "cell_type": "markdown", "id": "20426b03", "metadata": { "cq.autogen": "RSAPhaseEstimate.example_instances.md" }, "source": [ "### Example Instances" ] }, { "cell_type": "code", "execution_count": 9, "id": "f696c5fd", "metadata": { "cq.autogen": "RSAPhaseEstimate.rsa_pe" }, "outputs": [], "source": [ "n, p, g = sympy.symbols('n p g')\n", "rsa_pe = RSAPhaseEstimate(n=n, mod=p, base=g)" ] }, { "cell_type": "code", "execution_count": 10, "id": "b16e84a5", "metadata": { "cq.autogen": "RSAPhaseEstimate.rsa_pe_small" }, "outputs": [], "source": [ "rsa_pe_small = RSAPhaseEstimate.make_for_shor(big_n=13 * 17, g=9)" ] }, { "cell_type": "markdown", "id": "0c0078d5", "metadata": { "cq.autogen": "RSAPhaseEstimate.graphical_signature.md" }, "source": [ "#### Graphical Signature" ] }, { "cell_type": "code", "execution_count": 11, "id": "6b493a30", "metadata": { "cq.autogen": "RSAPhaseEstimate.graphical_signature.py" }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "85cd4729a3bb4abda164b8a42bc1f1ce", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(Output(outputs=({'output_type': 'display_data', 'data': {'text/plain': '\n", "\n", "counts\n", "\n", "\n", "\n", "b0\n", "\n", "RSAPhaseEstimate\n", "\n", "\n", "\n", "b1\n", "\n", "MeasureQFT\n", "\n", "\n", "\n", "b0->b1\n", "\n", "\n", "1\n", "\n", "\n", "\n", "b2\n", "\n", "CModMulK\n", "\n", "\n", "\n", "b0->b2\n", "\n", "\n", "16\n", "\n", "\n", "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "#### Counts totals:\n", " - `CModMulK`: 16\n", " - `MeasureQFT`: 1" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from qualtran.resource_counting.generalizers import ignore_split_join\n", "rsa_pe_small_g, rsa_pe_small_sigma = rsa_pe_small.call_graph(max_depth=1, generalizer=ignore_split_join)\n", "show_call_graph(rsa_pe_small_g)\n", "show_counts_sigma(rsa_pe_small_sigma)" ] }, { "cell_type": "code", "execution_count": 13, "id": "d72bc625", "metadata": { "cq.autogen": "RSAPhaseEstimate.rsa_pe_shor" }, "outputs": [], "source": [ "rsa_pe_shor = RSAPhaseEstimate.make_for_shor(big_n=13 * 17, g=9)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "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.8" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { "0046182a1d844a9086b20a5425b56c59": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "198937559ad04f7daeb5b3cba4315703": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "1a5f7366f5034853a0082ebcab4cb431": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "3556c79ea005483c8f34c53f74916deb": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "5df81d7b64434a29ac94711894bfbcff": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_198937559ad04f7daeb5b3cba4315703", "msg_id": "", "outputs": [ { "data": { "text/markdown": "`rsa_pe`", "text/plain": "" }, "metadata": {}, "output_type": "display_data" }, { "data": { "image/svg+xml": "\n\nmy_graph\n\n\n\nRSAPhaseEstimate\n\nRSAPhaseEstimate\n\n\n", "text/plain": "" }, "metadata": {}, "output_type": "display_data" } ], "tabbable": null, "tooltip": null } }, "85cd4729a3bb4abda164b8a42bc1f1ce": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_8e754af16ae249189440ec4a2a705496", "IPY_MODEL_5df81d7b64434a29ac94711894bfbcff" ], "layout": "IPY_MODEL_0046182a1d844a9086b20a5425b56c59", "tabbable": null, "tooltip": null } }, "887297eb74194c7996aaee249b57266f": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "8e754af16ae249189440ec4a2a705496": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_b98f00051256424f8454f9b6bc25a1fc", "msg_id": "", "outputs": [ { "data": { "text/markdown": "`rsa_pe_small`", "text/plain": "" }, "metadata": {}, "output_type": "display_data" }, { "data": { "image/svg+xml": "\n\nmy_graph\n\n\n\nRSAPhaseEstimate\n\nRSAPhaseEstimate\n\n\n", "text/plain": "" }, "metadata": {}, "output_type": "display_data" } ], "tabbable": null, "tooltip": null } }, "94f131c5bf3c4fe8ab371afb617b1abd": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_cff4acf041994181a1044ca7a21738a9", "IPY_MODEL_c4f6df3a2e064a7892e64bff62258350", "IPY_MODEL_aaa313fe3f6741eab249d46d5a4eae45" ], "layout": "IPY_MODEL_c6b20f1c5dd54704944ca2a734b9abe3", "tabbable": null, "tooltip": null } }, "aaa313fe3f6741eab249d46d5a4eae45": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_3556c79ea005483c8f34c53f74916deb", "msg_id": "", "outputs": [ { "data": { "text/markdown": "`modexp_symb`", "text/plain": "" }, "metadata": {}, "output_type": "display_data" }, { "data": { "image/svg+xml": "\n\nmy_graph\n\n\n\nexponent_G3\nexponent\n\n\n\nModExp\n\nModExp\n\nexponent\n\n\nx\n\n\n\nexponent_G3:e->ModExp:w\n\n\nn_e\n\n\n\nexponent_G1\nexponent\n\n\n\nModExp:e->exponent_G1:w\n\n\nn_e\n\n\n\nx_G0\nx\n\n\n\nModExp:e->x_G0:w\n\n\nn_x\n\n\n", "text/plain": "" }, "metadata": {}, "output_type": "display_data" } ], "tabbable": null, "tooltip": null } }, "b98f00051256424f8454f9b6bc25a1fc": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "c4f6df3a2e064a7892e64bff62258350": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_887297eb74194c7996aaee249b57266f", "msg_id": "", "outputs": [ { "data": { "text/markdown": "`modexp`", "text/plain": "" }, "metadata": {}, "output_type": "display_data" }, { "data": { "image/svg+xml": "\n\nmy_graph\n\n\n\nexponent_G2\nexponent\n\n\n\nModExp\n\nModExp\n\nexponent\n\n\nx\n\n\n\nexponent_G2:e->ModExp:w\n\n\n16\n\n\n\nexponent_G1\nexponent\n\n\n\nModExp:e->exponent_G1:w\n\n\n16\n\n\n\nx_G3\nx\n\n\n\nModExp:e->x_G3:w\n\n\n8\n\n\n", "text/plain": "" }, "metadata": {}, "output_type": "display_data" } ], "tabbable": null, "tooltip": null } }, "c6b20f1c5dd54704944ca2a734b9abe3": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "cff4acf041994181a1044ca7a21738a9": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/output", "_model_module_version": "1.0.0", "_model_name": "OutputModel", "_view_count": null, "_view_module": "@jupyter-widgets/output", "_view_module_version": "1.0.0", "_view_name": "OutputView", "layout": "IPY_MODEL_1a5f7366f5034853a0082ebcab4cb431", "msg_id": "", "outputs": [ { "data": { "text/markdown": "`modexp_small`", "text/plain": "" }, "metadata": {}, "output_type": "display_data" }, { "data": { "image/svg+xml": "\n\nmy_graph\n\n\n\nexponent_G3\nexponent\n\n\n\nModExp\n\nModExp\n\nexponent\n\n\nx\n\n\n\nexponent_G3:e->ModExp:w\n\n\n3\n\n\n\nexponent_G1\nexponent\n\n\n\nModExp:e->exponent_G1:w\n\n\n3\n\n\n\nx_G2\nx\n\n\n\nModExp:e->x_G2:w\n\n\n2048\n\n\n", "text/plain": "" }, "metadata": {}, "output_type": "display_data" } ], "tabbable": null, "tooltip": null } } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 5 }