Amit commited on
Commit
5624d67
·
1 Parent(s): 2621518

Ipython notebook updated.

Browse files
Files changed (1) hide show
  1. plots_display_all.ipynb +122 -20
plots_display_all.ipynb CHANGED
@@ -8,7 +8,7 @@
8
  "outputs": [
9
  {
10
  "data": {
11
- "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-rand1db37b16\"\n}",
12
  "text/html": [
13
  "<h3>Mercury Application</h3><small>This output won't appear in the web app.</small>"
14
  ],
@@ -33,9 +33,9 @@
33
  "outputs": [
34
  {
35
  "data": {
36
- "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Compare all\",\n \"model_id\": \"385ef3109d1d4a44b0658c8ee014360e\",\n \"code_uid\": \"Checkbox.0.40.11.1-rand850c5ef8\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}",
37
  "application/vnd.jupyter.widget-view+json": {
38
- "model_id": "385ef3109d1d4a44b0658c8ee014360e",
39
  "version_major": 2,
40
  "version_minor": 0
41
  },
@@ -48,9 +48,9 @@
48
  },
49
  {
50
  "data": {
51
- "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Compare 1 vs 1\",\n \"model_id\": \"6b4174a4f1b24ffbb86e89b56d304750\",\n \"code_uid\": \"Checkbox.0.40.11.2-rand749ca0d6\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}",
52
  "application/vnd.jupyter.widget-view+json": {
53
- "model_id": "6b4174a4f1b24ffbb86e89b56d304750",
54
  "version_major": 2,
55
  "version_minor": 0
56
  },
@@ -63,9 +63,9 @@
63
  },
64
  {
65
  "data": {
66
- "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Compare between tasks\",\n \"model_id\": \"d4b4bedb893a43079b6303cb3487c007\",\n \"code_uid\": \"Checkbox.0.40.11.3-rand5a85fb82\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}",
67
  "application/vnd.jupyter.widget-view+json": {
68
- "model_id": "d4b4bedb893a43079b6303cb3487c007",
69
  "version_major": 2,
70
  "version_minor": 0
71
  },
@@ -78,9 +78,24 @@
78
  },
79
  {
80
  "data": {
81
- "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Multi-GPU\",\n \"model_id\": \"a07db403be6f46ebb3402692f2131361\",\n \"code_uid\": \"Checkbox.0.40.11.4-rand6dce6c97\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}",
82
  "application/vnd.jupyter.widget-view+json": {
83
- "model_id": "a07db403be6f46ebb3402692f2131361",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  "version_major": 2,
85
  "version_minor": 0
86
  },
@@ -94,7 +109,8 @@
94
  ],
95
  "source": [
96
  "all_flag = mr.Checkbox(value=False, label=\"Compare all\")\n",
97
- "ovo_flag = mr.Checkbox(value=False, label=\"Compare 1 vs 1\")\n",
 
98
  "com_task_flag = mr.Checkbox(value=False, label=\"Compare between tasks\")\n",
99
  "mgpu_flag = mr.Checkbox(value=False, label=\"Multi-GPU\")"
100
  ]
@@ -144,7 +160,19 @@
144
  {
145
  "data": {
146
  "text/markdown": [
147
- "- Compare 1 vs 1: Compare the performance by selecting two different set of parameters"
 
 
 
 
 
 
 
 
 
 
 
 
148
  ],
149
  "text/plain": [
150
  "<IPython.core.display.Markdown object>"
@@ -179,13 +207,14 @@
179
  }
180
  ],
181
  "source": [
182
- "flag_arr = [all_flag.value, ovo_flag.value, com_task_flag.value, mgpu_flag.value]\n",
183
  "\n",
184
  "if flag_arr.count(True) == 0 or flag_arr.count(True) > 1:\n",
185
  " mr.Md(\"### Performance Benchmarks of quantum simulators\")\n",
186
  " mr.Md(\"Options on the left include (please select only one):\")\n",
187
  " mr.Md(\"- Compare all: Compare the TtS of all packages and also the performance relative to a given package\")\n",
188
- " mr.Md(\"- Compare 1 vs 1: Compare the performance by selecting two different set of parameters\")\n",
 
189
  " mr.Md(\"- Compare between tasks: Compare the performance between two tasks with respect to ratio of gates applied\")\n",
190
  " mr.Md(\"- Multi-GPU: Compare the performance between different parameters as a function of the number of GPUs\")\n",
191
  "\n",
@@ -198,7 +227,6 @@
198
  " _p = os.getcwd()\n",
199
  " \n",
200
  " import sys\n",
201
- " \n",
202
  " sys.path.append(_p + '/plot_scripts/')\n",
203
  " from map_packages_colors_all import *\n",
204
  " from plot_scripts_all import *\n",
@@ -225,16 +253,90 @@
225
  " mr.Md(f\"Performance benchmarks of task: {task.value}, with compute capability: {com_cap.value}, precision: {prec.value}\")\n",
226
  " \n",
227
  " abs_time(task.value, com_cap.value, prec.value, com_pack.value, N_slider.value+2)\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  " \n",
 
 
 
 
 
 
 
 
 
 
 
229
  "elif ovo_flag.value == True:\n",
230
  " \n",
231
  " import numpy as np\n",
232
  " import h5py\n",
233
  " import os\n",
234
  "\n",
235
- " _p = os.getcwd()\n",
236
- " \n",
237
  " import sys\n",
 
238
  " sys.path.append(_p + '/plot_scripts/')\n",
239
  " from map_packages_colors_1v1 import *\n",
240
  " from plot_scripts_1v1 import *\n",
@@ -279,9 +381,8 @@
279
  " import h5py\n",
280
  " import os\n",
281
  "\n",
282
- " _p = os.getcwd()\n",
283
- " \n",
284
  " import sys\n",
 
285
  " sys.path.append(_p + '/plot_scripts/')\n",
286
  " from map_packages_colors_all import *\n",
287
  " from plot_scripts_all import *\n",
@@ -319,10 +420,11 @@
319
  " import h5py\n",
320
  " import os\n",
321
  "\n",
 
 
322
  " _p = os.getcwd()\n",
323
  " \n",
324
- " import sys\n",
325
- " sys.path.append(_p+'/plot_scripts/')\n",
326
  " from map_packages_colors_mgpu import *\n",
327
  " from plot_scripts_mgpu import *\n",
328
  " from plot_display_mgpu import *\n",
 
8
  "outputs": [
9
  {
10
  "data": {
11
+ "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-rand17eaaf72\"\n}",
12
  "text/html": [
13
  "<h3>Mercury Application</h3><small>This output won't appear in the web app.</small>"
14
  ],
 
33
  "outputs": [
34
  {
35
  "data": {
36
+ "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Compare all\",\n \"model_id\": \"406a1223c5dc49aa8f5a9728dd71dbae\",\n \"code_uid\": \"Checkbox.0.40.11.1-randec587946\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}",
37
  "application/vnd.jupyter.widget-view+json": {
38
+ "model_id": "406a1223c5dc49aa8f5a9728dd71dbae",
39
  "version_major": 2,
40
  "version_minor": 0
41
  },
 
48
  },
49
  {
50
  "data": {
51
+ "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Compare across compute capabilities\",\n \"model_id\": \"e18a97bcc4804f0db8f94cd574fc8e07\",\n \"code_uid\": \"Checkbox.0.40.11.2-rand31fb60f4\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}",
52
  "application/vnd.jupyter.widget-view+json": {
53
+ "model_id": "e18a97bcc4804f0db8f94cd574fc8e07",
54
  "version_major": 2,
55
  "version_minor": 0
56
  },
 
63
  },
64
  {
65
  "data": {
66
+ "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Compare one-on-one\",\n \"model_id\": \"589330926d0a4692af34ee4f72151b21\",\n \"code_uid\": \"Checkbox.0.40.11.3-randbb72fc68\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}",
67
  "application/vnd.jupyter.widget-view+json": {
68
+ "model_id": "589330926d0a4692af34ee4f72151b21",
69
  "version_major": 2,
70
  "version_minor": 0
71
  },
 
78
  },
79
  {
80
  "data": {
81
+ "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Compare between tasks\",\n \"model_id\": \"cd489a79a32e4d9284e42d3d4bc0433f\",\n \"code_uid\": \"Checkbox.0.40.11.4-rand66c69a3e\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}",
82
  "application/vnd.jupyter.widget-view+json": {
83
+ "model_id": "cd489a79a32e4d9284e42d3d4bc0433f",
84
+ "version_major": 2,
85
+ "version_minor": 0
86
+ },
87
+ "text/plain": [
88
+ "mercury.Checkbox"
89
+ ]
90
+ },
91
+ "metadata": {},
92
+ "output_type": "display_data"
93
+ },
94
+ {
95
+ "data": {
96
+ "application/mercury+json": "{\n \"widget\": \"Checkbox\",\n \"value\": false,\n \"label\": \"Multi-GPU\",\n \"model_id\": \"aeeb3e299fd54fc3b413fcba15796e43\",\n \"code_uid\": \"Checkbox.0.40.11.5-rand64f9bbd8\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}",
97
+ "application/vnd.jupyter.widget-view+json": {
98
+ "model_id": "aeeb3e299fd54fc3b413fcba15796e43",
99
  "version_major": 2,
100
  "version_minor": 0
101
  },
 
109
  ],
110
  "source": [
111
  "all_flag = mr.Checkbox(value=False, label=\"Compare all\")\n",
112
+ "cc_flag = mr.Checkbox(value=False, label=\"Compare across compute capabilities\")\n",
113
+ "ovo_flag = mr.Checkbox(value=False, label=\"Compare one-on-one\")\n",
114
  "com_task_flag = mr.Checkbox(value=False, label=\"Compare between tasks\")\n",
115
  "mgpu_flag = mr.Checkbox(value=False, label=\"Multi-GPU\")"
116
  ]
 
160
  {
161
  "data": {
162
  "text/markdown": [
163
+ "- Compare across compute capabilities: Compare the performance of package(s) with different compute capabilities"
164
+ ],
165
+ "text/plain": [
166
+ "<IPython.core.display.Markdown object>"
167
+ ]
168
+ },
169
+ "metadata": {},
170
+ "output_type": "display_data"
171
+ },
172
+ {
173
+ "data": {
174
+ "text/markdown": [
175
+ "- Compare one-on-one: Compare the performance by selecting two different set of parameters"
176
  ],
177
  "text/plain": [
178
  "<IPython.core.display.Markdown object>"
 
207
  }
208
  ],
209
  "source": [
210
+ "flag_arr = [all_flag.value, cc_flag.value, ovo_flag.value, com_task_flag.value, mgpu_flag.value]\n",
211
  "\n",
212
  "if flag_arr.count(True) == 0 or flag_arr.count(True) > 1:\n",
213
  " mr.Md(\"### Performance Benchmarks of quantum simulators\")\n",
214
  " mr.Md(\"Options on the left include (please select only one):\")\n",
215
  " mr.Md(\"- Compare all: Compare the TtS of all packages and also the performance relative to a given package\")\n",
216
+ " mr.Md(\"- Compare across compute capabilities: Compare the performance of package(s) with different compute capabilities\")\n",
217
+ " mr.Md(\"- Compare one-on-one: Compare the performance by selecting two different set of parameters\")\n",
218
  " mr.Md(\"- Compare between tasks: Compare the performance between two tasks with respect to ratio of gates applied\")\n",
219
  " mr.Md(\"- Multi-GPU: Compare the performance between different parameters as a function of the number of GPUs\")\n",
220
  "\n",
 
227
  " _p = os.getcwd()\n",
228
  " \n",
229
  " import sys\n",
 
230
  " sys.path.append(_p + '/plot_scripts/')\n",
231
  " from map_packages_colors_all import *\n",
232
  " from plot_scripts_all import *\n",
 
253
  " mr.Md(f\"Performance benchmarks of task: {task.value}, with compute capability: {com_cap.value}, precision: {prec.value}\")\n",
254
  " \n",
255
  " abs_time(task.value, com_cap.value, prec.value, com_pack.value, N_slider.value+2)\n",
256
+ " \n",
257
+ "elif cc_flag.value == True:\n",
258
+ " \n",
259
+ " import numpy as np\n",
260
+ " import h5py\n",
261
+ " import os\n",
262
+ " \n",
263
+ " cc_packages_flag = mr.Checkbox(value=False, label=\"Compare across packages\")\n",
264
+ " \n",
265
+ " cc_pack_flag = mr.Checkbox(value=False, label=\"Compare a single package\")\n",
266
+ " \n",
267
+ " 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",
268
+ " mr.Md(\"The options on the left include:\")\n",
269
+ " mr.Md(\"- Performance benchmark across packages with different compute capabilities\")\n",
270
+ " mr.Md(\"- Performance benchmark of a package with different compute capabilites\")\n",
271
+ " \n",
272
+ " elif cc_packages_flag.value == True:\n",
273
+ "\n",
274
+ " import sys\n",
275
+ " \n",
276
+ " _p = os.getcwd()\n",
277
+ " \n",
278
+ " sys.path.append(_p + '/plot_scripts/')\n",
279
+ " from map_packages_colors_all import *\n",
280
+ " from plot_scripts_all import *\n",
281
+ " from plot_display_com_cap_all import *\n",
282
+ " \n",
283
+ " # params = {'figure.figsize': (5, 5)}\n",
284
+ " # plt.rcParams.update(params)\n",
285
+ " \n",
286
+ " mr.Md(\"Ratio of different compute capabilities for different packages\")\n",
287
+ " \n",
288
+ " task = mr.Select(label=\"Select Task: \", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n",
289
+ " \n",
290
+ " prec = mr.Select(label=\"Select Precision : \", value=\"Single\", choices=[\"Single\", \"Double\"])\n",
291
+ " \n",
292
+ " N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n",
293
+ " \n",
294
+ " com_cap_1 = mr.Select(label=\"Select Compute Capability: \", value=\"Singlethread\", choices=[\"Singlethread\", \"Multithread\", \"GPU\"])\n",
295
+ " com_cap_2 = mr.Select(label=\"Select Compute Capability: \", value=\"Multithread\", choices=[\"Singlethread\", \"Multithread\", \"GPU\"]) \n",
296
+ " \n",
297
+ " abs_time_pack(task.value, prec.value, N_slider.value+2, com_cap_1.value, com_cap_2.value) \n",
298
+ " \n",
299
+ " compare_task_flag = mr.Checkbox(value=False, label=\"Compare to other task (ratio):\")\n",
300
+ " if compare_task_flag.value == True:\n",
301
+ " mr.Md(\"___\")\n",
302
+ " mr.Md(\"Comparison to different tasks\")\n",
303
+ " task2 = mr.Select(label=\"Select Task: \", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n",
304
+ " comp_time_pack(task.value, task2.value, prec.value, N_slider.value+2, com_cap_1.value, com_cap_2.value)\n",
305
+ " \n",
306
+ " elif cc_pack_flag.value == True:\n",
307
+ " \n",
308
+ " import sys\n",
309
+ " \n",
310
+ " _p = os.getcwd()\n",
311
+ " \n",
312
+ " sys.path.append(_p + '/plot_scripts/')\n",
313
+ " from map_packages_colors_1v1 import *\n",
314
+ " from plot_scripts_1v1 import *\n",
315
+ " from plot_display_com_cap import *\n",
316
+ " \n",
317
+ " task = mr.Select(label=\"Select Task: \", value=\"Heisenberg dynamics\", choices=[\"Heisenberg dynamics\", \"Random Quantum Circuit\", \"Quantum Fourier Transform\"])\n",
318
+ "\n",
319
+ " 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'])\n",
320
  " \n",
321
+ " prec = mr.Select(label=\"Select Precision : \", value=\"Single\", choices=[\"Single\", \"Double\"])\n",
322
+ " \n",
323
+ " N_slider = mr.Slider(value=36, min=6, max=36, label=\"Select System size: \", step=2)\n",
324
+ " \n",
325
+ " if task.value == \"Random Quantum Circuit\" and N_slider.value < 12:\n",
326
+ " mr.Md(\"### Please select a different final N value\")\n",
327
+ " else:\n",
328
+ " abs_time_pack(task.value, com_pack.value, prec.value, N_slider.value+2)\n",
329
+ " \n",
330
+ " \n",
331
+ " \n",
332
  "elif ovo_flag.value == True:\n",
333
  " \n",
334
  " import numpy as np\n",
335
  " import h5py\n",
336
  " import os\n",
337
  "\n",
 
 
338
  " import sys\n",
339
+ " _p = os.getcwd()\n",
340
  " sys.path.append(_p + '/plot_scripts/')\n",
341
  " from map_packages_colors_1v1 import *\n",
342
  " from plot_scripts_1v1 import *\n",
 
381
  " import h5py\n",
382
  " import os\n",
383
  "\n",
 
 
384
  " import sys\n",
385
+ " _p = os.getcwd()\n",
386
  " sys.path.append(_p + '/plot_scripts/')\n",
387
  " from map_packages_colors_all import *\n",
388
  " from plot_scripts_all import *\n",
 
420
  " import h5py\n",
421
  " import os\n",
422
  "\n",
423
+ " import sys\n",
424
+ " \n",
425
  " _p = os.getcwd()\n",
426
  " \n",
427
+ " sys.path.append(_p + '/plot_scripts/')\n",
 
428
  " from map_packages_colors_mgpu import *\n",
429
  " from plot_scripts_mgpu import *\n",
430
  " from plot_display_mgpu import *\n",