{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "4f22a659", "metadata": {}, "outputs": [ { "data": { "application/mercury+json": "{\n \"widget\": \"App\",\n \"title\": \"Performance Benchmarks\",\n \"description\": \"Collated Performance Benchmarks\",\n \"show_code\": false,\n \"show_prompt\": false,\n \"output\": \"app\",\n \"schedule\": \"\",\n \"notify\": \"{}\",\n \"continuous_update\": true,\n \"static_notebook\": false,\n \"show_sidebar\": true,\n \"full_screen\": true,\n \"allow_download\": true,\n \"model_id\": \"mercury-app\",\n \"code_uid\": \"App.0.40.24.2-rand6ab06af5\"\n}", "text/html": [ "

Mercury Application

This output won't appear in the web app." ], "text/plain": [ "mercury.App" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import mercury as mr\n", "app = mr.App(title=\"Performance Benchmarks\", description=\"Collated Performance Benchmarks\", show_code=False)" ] }, { "cell_type": "code", "execution_count": 2, "id": "5f385b19", "metadata": {}, "outputs": [ { "data": { "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Compare all\",\n \"model_id\": \"7835f9036ce3498f97e52ea76c23d024\",\n \"code_uid\": \"Checkbox.0.40.11.1-rand3a52d4f8\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", "application/vnd.jupyter.widget-view+json": { "model_id": "7835f9036ce3498f97e52ea76c23d024", "version_major": 2, "version_minor": 0 }, "text/plain": [ "mercury.Checkbox" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Compare across compute capabilities\",\n \"model_id\": \"4b9f0bc68f2f4c018ec4be0fb41b5ea8\",\n \"code_uid\": \"Checkbox.0.40.11.2-rand96a14bb7\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", "application/vnd.jupyter.widget-view+json": { "model_id": "4b9f0bc68f2f4c018ec4be0fb41b5ea8", "version_major": 2, "version_minor": 0 }, "text/plain": [ "mercury.Checkbox" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Compare across precision\",\n \"model_id\": \"e3381e5e2c4f4c63a284230d2f69055f\",\n \"code_uid\": \"Checkbox.0.40.11.3-rand4bc78cbc\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", "application/vnd.jupyter.widget-view+json": { "model_id": "e3381e5e2c4f4c63a284230d2f69055f", "version_major": 2, "version_minor": 0 }, "text/plain": [ "mercury.Checkbox" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Compare one-on-one\",\n \"model_id\": \"2a39943b849c453f81cf513c5af87efd\",\n \"code_uid\": \"Checkbox.0.40.11.4-rand4b127455\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", "application/vnd.jupyter.widget-view+json": { "model_id": "2a39943b849c453f81cf513c5af87efd", "version_major": 2, "version_minor": 0 }, "text/plain": [ "mercury.Checkbox" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Compare between tasks\",\n \"model_id\": \"2cb81fd3152f46ea8605df67ecc39f6f\",\n \"code_uid\": \"Checkbox.0.40.11.5-rand852c5407\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", "application/vnd.jupyter.widget-view+json": { "model_id": "2cb81fd3152f46ea8605df67ecc39f6f", "version_major": 2, "version_minor": 0 }, "text/plain": [ "mercury.Checkbox" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Multi-GPU\",\n \"model_id\": \"5135bd3a7fff4a22889496727aa63f11\",\n \"code_uid\": \"Checkbox.0.40.11.6-rand5c1d04aa\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", "application/vnd.jupyter.widget-view+json": { "model_id": "5135bd3a7fff4a22889496727aa63f11", "version_major": 2, "version_minor": 0 }, "text/plain": [ "mercury.Checkbox" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "all_flag = mr.Checkbox(value=False, label=\"Compare all\")\n", "cc_flag = mr.Checkbox(value=False, label=\"Compare across compute capabilities\")\n", "pr_flag = mr.Checkbox(value=False, label=\"Compare across precision\")\n", "ovo_flag = mr.Checkbox(value=False, label=\"Compare one-on-one\")\n", "com_task_flag = mr.Checkbox(value=False, label=\"Compare between tasks\")\n", "mgpu_flag = mr.Checkbox(value=False, label=\"Multi-GPU\")" ] }, { "cell_type": "code", "execution_count": 3, "id": "2ce780ab", "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "### Performance Benchmarks of quantum simulators" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "Options on the left include (please select only one):" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "- Compare all: Compare the TtS of all packages and also the performance relative to a given package" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "- Compare across compute capabilities: Compare the performance of package(s) with different compute capabilities" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "- Compare across different precision: Compare the performance of package(s) with different precision with fixed compute capability" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "- Compare one-on-one: Compare the performance by selecting two different set of parameters" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "- Compare between tasks: Compare the performance between two tasks with respect to ratio of gates applied" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "- Multi-GPU: Compare the performance between different parameters as a function of the number of GPUs" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "flag_arr = [all_flag.value, cc_flag.value, pr_flag.value, ovo_flag.value, com_task_flag.value, mgpu_flag.value]\n", "\n", "if flag_arr.count(True) == 0 or flag_arr.count(True) > 1:\n", " mr.Md(\"### Performance Benchmarks of quantum simulators\")\n", " mr.Md(\"Options on the left include (please select only one):\")\n", " mr.Md(\"- Compare all: Compare the TtS of all packages and also the performance relative to a given package\")\n", " mr.Md(\"- Compare across compute capabilities: Compare the performance of package(s) with different compute capabilities\")\n", " mr.Md(\"- Compare across different precision: Compare the performance of package(s) with different precision with fixed compute capability\")\n", " mr.Md(\"- Compare one-on-one: Compare the performance by selecting two different set of parameters\")\n", " mr.Md(\"- Compare between tasks: Compare the performance between two tasks with respect to ratio of gates applied\")\n", " mr.Md(\"- Multi-GPU: Compare the performance between different parameters as a function of the number of GPUs\")\n", "\n", "elif all_flag.value == True:\n", " \n", " import numpy as np\n", " import h5py\n", " import os\n", "\n", " _p = os.getcwd()\n", " \n", " import sys\n", " sys.path.append(_p + '/plot_scripts/')\n", " from map_packages_colors_all import *\n", " from plot_scripts_all import *\n", " from plot_display_all import *\n", " \n", " task = mr.Select(label=\"Select Task: \", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n", " \n", " com_cap = mr.Select(label=\"Select Compute Capability: \", value=\"Singlethread\", choices=[\"Singlethread\", \"Multithread\", \"GPU\"])\n", " \n", " prec = mr.Select(label=\"Select Precision : \", value=\"Single\", choices=[\"Single\", \"Double\"])\n", " \n", " com_pack = mr.Select(label=\"Select Package to compare: \", value=\"qsimcirq\", choices=['qiskit' , 'cirq', 'qsimcirq', 'pennylane', 'pennylane_l', 'qibo', 'qibojit', 'yao', 'quest', 'qulacs', 'intel_qs_cpp', 'projectq', 'svsim', 'hybridq', 'hiq', 'qcgpu', 'qrack_sch', 'cuquantum_qiskit', 'cuquantum_qsimcirq', 'qpanda', 'qpp', 'myqlm', 'myqlm_cpp', 'braket'])\n", " \n", " # if task.value == \"Heisenberg dynamics\" or task.value == \"Quantum Fourier Transform\":\n", " # N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " # elif task.value == \"Random Quantum Circuit\":\n", " # N_slider = mr.Slider(value=N_slider.value, min=12, max=36, label=\"Select System size: \", step=2)\n", " N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " if task.value == \"Random Quantum Circuit\" and N_slider.value < 12:\n", " # print(\"Please select a different final N value\")\n", " mr.Md(\"### Please select a different final N value\")\n", " else:\n", " # print('Performance benchmarks of task: {}, with compute capability: {}, precision: {}'.format(task.value, com_cap.value, prec.value))\n", " mr.Md(f\"Performance benchmarks of task: {task.value}, with compute capability: {com_cap.value}, precision: {prec.value}\")\n", " \n", " abs_time(task.value, com_cap.value, prec.value, com_pack.value, N_slider.value+2)\n", " \n", "elif cc_flag.value == True:\n", " \n", " import numpy as np\n", " import h5py\n", " import os\n", " \n", " cc_packages_flag = mr.Checkbox(value=False, label=\"Compare across packages\")\n", " \n", " cc_pack_flag = mr.Checkbox(value=False, label=\"Compare a single package\")\n", " \n", " if (cc_packages_flag.value == False and cc_pack_flag.value == False) or (cc_packages_flag.value == True and cc_pack_flag.value == True):\n", " mr.Md(\"The options on the left include:\")\n", " mr.Md(\"- Performance benchmark across packages with different compute capabilities\")\n", " mr.Md(\"- Performance benchmark of a package with different compute capabilites\")\n", " \n", " elif cc_packages_flag.value == True:\n", "\n", " import sys\n", " \n", " _p = os.getcwd()\n", " \n", " sys.path.append(_p + '/plot_scripts/')\n", " from map_packages_colors_all import *\n", " from plot_scripts_all import *\n", " from plot_display_com_cap_all import *\n", " \n", " # params = {'figure.figsize': (5, 5)}\n", " # plt.rcParams.update(params)\n", " \n", " mr.Md(\"Ratio of different compute capabilities for different packages\")\n", " \n", " task = mr.Select(label=\"Select Task: \", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n", " \n", " prec = mr.Select(label=\"Select Precision : \", value=\"Single\", choices=[\"Single\", \"Double\"])\n", " \n", " N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " \n", " com_cap_1 = mr.Select(label=\"Select Compute Capability: \", value=\"Singlethread\", choices=[\"Singlethread\", \"Multithread\", \"GPU\"])\n", " com_cap_2 = mr.Select(label=\"Select Compute Capability: \", value=\"Multithread\", choices=[\"Singlethread\", \"Multithread\", \"GPU\"]) \n", " \n", " abs_time_pack(task.value, prec.value, N_slider.value+2, com_cap_1.value, com_cap_2.value) \n", " \n", " compare_task_flag = mr.Checkbox(value=False, label=\"Compare to other task (ratio):\")\n", " if compare_task_flag.value == True:\n", " mr.Md(\"___\")\n", " mr.Md(\"Comparison to different tasks\")\n", " task2 = mr.Select(label=\"Select Task: \", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n", " comp_time_pack(task.value, task2.value, prec.value, N_slider.value+2, com_cap_1.value, com_cap_2.value)\n", " \n", " elif cc_pack_flag.value == True:\n", " \n", " import sys\n", " \n", " _p = os.getcwd()\n", " \n", " sys.path.append(_p + '/plot_scripts/')\n", " from map_packages_colors_1v1 import *\n", " from plot_scripts_1v1 import *\n", " from plot_display_com_cap import *\n", " \n", " task = mr.Select(label=\"Select Task: \", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n", "\n", " com_pack = mr.Select(label=\"Select Package to compare: \", value=\"qsimcirq\", choices=['qiskit' , 'cirq', 'qsimcirq', 'pennylane', 'pennylane_l', 'qibo', 'qibojit', 'yao', 'quest', 'qulacs', 'intel_qs_cpp', 'projectq', 'svsim', 'hybridq', 'hiq', 'qcgpu', 'qrack_sch', 'cuquantum_qiskit', 'cuquantum_qsimcirq', 'qpanda', 'qpp', 'myqlm', 'myqlm_cpp', 'braket'])\n", " \n", " prec = mr.Select(label=\"Select Precision : \", value=\"Single\", choices=[\"Single\", \"Double\"])\n", " \n", " N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " \n", " if task.value == \"Random Quantum Circuit\" and N_slider.value < 12:\n", " mr.Md(\"### Please select a different final N value\")\n", " else:\n", " abs_time_pack(task.value, com_pack.value, prec.value, N_slider.value+2)\n", " \n", "\n", "elif pr_flag.value == True:\n", " \n", " import numpy as np\n", " import h5py\n", " import os\n", " \n", " pr_packages_flag = mr.Checkbox(value=False, label=\"Compare across packages\")\n", " \n", " pr_pack_flag = mr.Checkbox(value=False, label=\"Compare a single package\")\n", " \n", " if (pr_packages_flag.value == False and pr_pack_flag.value == False) or (pr_packages_flag.value == True and pr_pack_flag.value == True):\n", " mr.Md(\"The options on the left include:\")\n", " mr.Md(\"- Performance benchmark across packages with different precision\")\n", " mr.Md(\"- Performance benchmark of a package with different precision\")\n", " \n", " elif pr_packages_flag.value == True:\n", "\n", " import sys\n", " \n", " _p = os.getcwd()\n", " \n", " sys.path.append(_p + '/plot_scripts/')\n", " from map_packages_colors_all import *\n", " from plot_scripts_all import *\n", " from plot_display_com_prec_all import *\n", " \n", " # params = {'figure.figsize': (5, 5)}\n", " # plt.rcParams.update(params)\n", " \n", " mr.Md(\"Ratio of different precision for different packages\")\n", " \n", " task = mr.Select(label=\"Select Task: \", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n", " \n", " cc = mr.Select(label=\"Select Compute Capability : \", value=\"Singlethread\", choices=[\"Singlethread\", \"Multithread\", \"GPU\"])\n", " \n", " N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " \n", " com_pr_1 = mr.Select(label=\"Select Precision I: \", value=\"Double\", choices=[\"Single\", \"Double\"])\n", " com_pr_2 = mr.Select(label=\"Select Precision II: \", value=\"Single\", choices=[\"Single\", \"Double\"]) \n", " \n", " abs_time_pack(task.value, cc.value, N_slider.value+2, com_pr_1.value, com_pr_2.value) \n", " \n", " compare_task_flag = mr.Checkbox(value=False, label=\"Compare to other task (ratio):\")\n", " if compare_task_flag.value == True:\n", " mr.Md(\"___\")\n", " mr.Md(\"Comparison to different tasks\")\n", " task2 = mr.Select(label=\"Select Task: \", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n", " comp_time_pack(task.value, task2.value, cc.value, N_slider.value+2, com_pr_1.value, com_pr_2.value)\n", " \n", " elif pr_pack_flag.value == True:\n", " \n", " import sys\n", " \n", " _p = os.getcwd()\n", " \n", " sys.path.append(_p + '/plot_scripts/')\n", " from map_packages_colors_1v1 import *\n", " from plot_scripts_1v1 import *\n", " from plot_display_com_prec import *\n", " \n", " task = mr.Select(label=\"Select Task: \", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n", "\n", " com_pack = mr.Select(label=\"Select Package to compare: \", value=\"qsimcirq\", choices=['qiskit' , 'cirq', 'qsimcirq', 'pennylane', 'pennylane_l', 'qibo', 'qibojit', 'yao', 'quest', 'qulacs', 'intel_qs_cpp', 'projectq', 'svsim', 'hybridq', 'hiq', 'qcgpu', 'qrack_sch', 'cuquantum_qiskit', 'cuquantum_qsimcirq', 'qpanda', 'qpp', 'myqlm', 'myqlm_cpp', 'braket'])\n", " \n", " cc = mr.Select(label=\"Select Compute Capability : \", value=\"Singlethread\", choices=[\"Singlethread\", \"Multithread\", \"GPU\"])\n", " \n", " N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " \n", " if task.value == \"Random Quantum Circuit\" and N_slider.value < 12:\n", " mr.Md(\"### Please select a different final N value\")\n", " else:\n", " abs_time_pack(task.value, com_pack.value, cc.value, N_slider.value+2)\n", " \n", " \n", "elif ovo_flag.value == True:\n", " \n", " import numpy as np\n", " import h5py\n", " import os\n", "\n", " import sys\n", " _p = os.getcwd()\n", " sys.path.append(_p + '/plot_scripts/')\n", " from map_packages_colors_1v1 import *\n", " from plot_scripts_1v1 import *\n", " from plot_display_1v1 import *\n", " \n", " task = mr.Select(label=\"Select Task I:\", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n", " \n", " pack = mr.Select(label=\"Select Package I:\", value=\"qsimcirq\", choices=['qiskit' , 'cirq', 'qsimcirq', 'pennylane', 'pennylane_l', 'qibo', 'qibojit', 'yao', 'quest', 'qulacs', 'intel_qs_cpp', 'projectq', 'svsim', 'hybridq', 'hiq', 'qcgpu', 'qrack_sch', 'cuquantum_qiskit', 'cuquantum_qsimcirq', 'qpanda', 'qpp', 'myqlm', 'myqlm_cpp', 'braket'])\n", " \n", " com_cap = mr.Select(label=\"Select Compute Capability I:\", value=\"Singlethread\", choices=[\"Singlethread\", \"Multithread\", \"GPU\"])\n", " \n", " prec = mr.Select(label=\"Select Precision I:\", value=\"Single\", choices=[\"Single\", \"Double\"])\n", " \n", " # print(\"----------------------------------------------------------------\")\n", " \n", " task_2 = mr.Select(label=\"Select Task II:\", value=\"Random Quantum Circuit\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n", "\n", " pack_2 = mr.Select(label=\"Select Package to compare: \", value=\"qsimcirq\", choices=['qiskit' , 'cirq', 'qsimcirq', 'pennylane', 'pennylane_l', 'qibo', 'qibojit', 'yao', 'quest', 'qulacs', 'intel_qs_cpp', 'projectq', 'svsim', 'hybridq', 'hiq', 'qcgpu', 'qrack_sch', 'cuquantum_qiskit', 'cuquantum_qsimcirq', 'qpanda', 'qpp', 'myqlm', 'myqlm_cpp', 'braket'])\n", " \n", " com_cap_2 = mr.Select(label=\"Select Compute Capability II:\", value=\"Singlethread\", choices=[\"Singlethread\", \"Multithread\", \"GPU\"])\n", " \n", " prec_2 = mr.Select(label=\"Select Precision II:\", value=\"Single\", choices=[\"Single\", \"Double\"])\n", " \n", " # if task.value == \"Heisenberg dynamics\" or task.value == \"Quantum Fourier Transform\":\n", " # N_slider = mr.Slider(value=slider_glob, min=6, max=36, label=\"Select System size: \", step=2)\n", " # elif task.value == \"Random Quantum Circuit\":\n", " # N_slider = mr.Slider(value=slider_glob, min=12, max=36, label=\"Select System size: \", step=2)\n", "\n", " N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " if (task.value == \"Random Quantum Circuit\" or task_2.value == \"Random Quantum Circuit\") and N_slider.value < 12:\n", " # print(\"Please select a different final N value\")\n", " mr.Md(\"### Please select a different final N value\")\n", " else:\n", " # print(\"Absolute Time\")\n", " abs_time(task.value, pack.value, com_cap.value, prec.value, task_2.value, pack_2.value, com_cap_2.value, prec_2.value, N_slider.value+2)\n", " # print(\"Relative Time\")\n", " relative_time_wrt_pack(task.value, pack.value, com_cap.value, prec.value, task_2.value, pack_2.value, com_cap_2.value, prec_2.value, N_slider.value+2)\n", " \n", "elif com_task_flag.value == True:\n", " \n", " import numpy as np\n", " import h5py\n", " import os\n", "\n", " import sys\n", " _p = os.getcwd()\n", " sys.path.append(_p + '/plot_scripts/')\n", " from map_packages_colors_all import *\n", " from plot_scripts_all import *\n", " from plot_display_com_pack import *\n", " \n", " task_1 = mr.Select(label=\"Select Task I:\", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"]) \n", " task_2 = mr.Select(label=\"Select Task II:\", value=\"Random Quantum Circuit\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n", " \n", " # print(task_1.value)\n", " # print(task_2.value)\n", " \n", " com_cap = mr.Select(label=\"Select Compute Capability:\", value=\"Singlethread\", choices=[\"Singlethread\", \"Multithread\", \"GPU\"]) \n", " \n", " prec = mr.Select(label=\"Select Precision:\", value=\"Single\", choices=[\"Single\", \"Double\"])\n", " \n", " # if task_1.value == \"Heisenberg dynamics\" or task_1.value == \"Quantum Fourier Transform\":\n", " # N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " # elif task_1.value == \"Random Quantum Circuit\":\n", " # N_slider = mr.Slider(value=36, min=12, max=36, label=\"Select System size: \", step=2)\n", " \n", " # if task_2.value == \"Heisenberg dynamics\" or task_2.value == \"Quantum Fourier Transform\":\n", " # N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " # elif task_2.value == \"Random Quantum Circuit\":\n", " # N_slider = mr.Slider(value=N_slider.value, min=12, max=36, label=\"Select System size: \", step=2)\n", " \n", " N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " if task_2.value == \"Random Quantum Circuit\" and N_slider.value < 12:\n", " mr.Md(\"### Please select a different final N value\")\n", " else: \n", " abs_time_pack(task_1.value, task_2.value, com_cap.value, prec.value, N_slider.value+2)\n", " \n", "elif mgpu_flag.value == True:\n", " \n", " import numpy as np\n", " import h5py\n", " import os\n", "\n", " import sys\n", " \n", " _p = os.getcwd()\n", " \n", " sys.path.append(_p + '/plot_scripts/')\n", " from map_packages_colors_mgpu import *\n", " from plot_scripts_mgpu import *\n", " from plot_display_mgpu import *\n", " \n", " mr.Md(\"### Performance Benchmarks of quantum simulators using multiple GPUs\")\n", " mr.Md(\"Options on the left include (please select only one):\")\n", " mr.Md(\"- Compare all: Compare the TtS of all packages and also the performance relative to a given package\")\n", " mr.Md(\"- Scaling with N GPUs: Compare the TtS with respect to different number of GPUs and also the relative performace with respect to a given number of GPUs\")\n", " \n", " gpu_all_flag = mr.Checkbox(value=False, label=\"Compare all\")\n", " ngpu_flag = mr.Checkbox(value=False, label=\"Scaling with N GPUs\")\n", "\n", " if gpu_all_flag.value == True and ngpu_flag.value == True:\n", " mr.Md(\"### Performance Benchmarks of quantum simulators using multiple GPUs\")\n", " mr.Md(\"Options on the left include (please select only one):\")\n", " mr.Md(\"- Compare all: Compare the TtS of all packages and also the performance relative to a given package\")\n", " mr.Md(\"- Scaling with N GPUs: Compare the TtS with respect to different number of GPUs and also the relative performace with respect to a given number of GPUs\")\n", " \n", " elif gpu_all_flag.value == True:\n", " \n", " task = mr.Select(label=\"Select Task:\", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n", " prec = mr.Select(label=\"Select Precision:\", value=\"Single\", choices=[\"Single\", \"Double\"])\n", " n_gpu = mr.Select(label=\"Select no. of GPUs:\", value=1, choices=[1, 2, 4, 8])\n", " \n", " compare_to = mr.Select(label=\"Select package to compare to:\", choices=[\"cuquantum_qiskit\", \"cuquantum_qsimcirq\", \"qibojit\"])\n", "\n", " # if task.value == \"Heisenberg dynamics\" or task.value == \"Quantum Fourier Transform\":\n", " # N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " # elif task.value == \"Random Quantum Circuit\":\n", " # N_slider = mr.Slider(value=N_slider.value, min=12, max=36, label=\"Select System size: \", step=2)\n", "\n", " N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " if task.value == \"Random Quantum Circuit\" and N_slider.value < 12:\n", " print(\"Please select a different final N value\")\n", " else:\n", " abs_time(task.value, prec.value, n_gpu.value, compare_to.value, N_slider.value+2)\n", " \n", " \n", " elif ngpu_flag.value == True:\n", " pack = mr.Select(label=\"Select package:\", value=\"cuquantum_qiskit\", choices=[\"cuquantum_qiskit\", \"cuquantum_qsimcirq\", \"qibojit\"])\n", " task = mr.Select(label=\"Select Task:\", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n", " prec = mr.Select(label=\"Select Precision:\", value=\"Single\", choices=[\"Single\", \"Double\"])\n", " \n", " compare_n_gpu = mr.Select(label=\"Compare to no. of GPUs:\", value=1, choices=[1, 2, 4, 8])\n", "\n", " # if task.value == \"Heisenberg dynamics\" or task.value == \"Quantum Fourier Transform\":\n", " # N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " # elif task.value == \"Random Quantum Circuit\":\n", " # N_slider = mr.Slider(value=N_slider.value, min=12, max=36, label=\"Select System size: \", step=2)\n", " \n", " N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n", " if task.value == \"Random Quantum Circuit\" and N_slider.value < 12:\n", " print(\"Please select a different final N value\")\n", " else:\n", " abs_time_ngpus(task.value, prec.value, pack.value, compare_n_gpu.value, N_slider.value+2)\n" ] }, { "cell_type": "code", "execution_count": null, "id": "e41b2e81", "metadata": {}, "outputs": [], "source": [] } ], "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.9.12" } }, "nbformat": 4, "nbformat_minor": 5 }