aboutsummaryrefslogtreecommitdiff
path: root/epare/visualize.ipynb
blob: 5b61ca1ea1fdeec8bedf97b173a6b46da7dc2278 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "52a95c74-8fc0-4021-a8e9-8587ff6f1d9e",
   "metadata": {},
   "source": [
    "# Visualizing prob-maps"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3232df80-2a65-47ce-bc77-6a64f44d2404",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pickle\n",
    "import itertools\n",
    "import glob\n",
    "import gc\n",
    "\n",
    "import matplotlib\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "\n",
    "from tqdm.auto import tqdm, trange\n",
    "from statsmodels.stats.proportion import proportion_confint\n",
    "\n",
    "from pyecsca.ec.mult import *\n",
    "from pyecsca.misc.utils import TaskExecutor\n",
    "\n",
    "from common import *\n",
    "\n",
    "%matplotlib ipympl"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4273bd5e-0ec6-4e5c-b63e-74cc325a8ece",
   "metadata": {},
   "source": [
    "## Setup\n",
    "Setup some plotting and the computations of prob-maps out of the small scalar data and divisors."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e89e66dc-4a9b-4320-8612-a8fa9af04b69",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Setup the ticks and colors deterministically.\n",
    "mult_klasses = sorted(list(set(map(lambda mult: mult.klass, all_mults))), key=lambda klass: klass.__name__)\n",
    "mult_kwarg_map = {klass: 0 for klass in mult_klasses}\n",
    "mult_cm_map = {mult: 0 for mult in all_mults}\n",
    "mult_colors = matplotlib.cm.tab20(range(len(mult_klasses)))\n",
    "mult_styles = ['-', '--', '-.', ':', (5, (10, 3)), (0, (5, 1)), (0, (3, 1, 1, 1, 1, 1)), (0, (3, 1, 1, 1)), (0, (1, 1)), (0, (3, 10, 1, 10))]\n",
    "mult_markers = [None, \"o\", \"+\", \"*\", \"^\", \"s\"]\n",
    "colors = {}\n",
    "styles = {}\n",
    "markers = {}\n",
    "for mult in all_mults:\n",
    "    color = mult_colors[mult_klasses.index(mult.klass) % len(mult_colors)]\n",
    "    style = mult_styles[mult_kwarg_map[mult.klass] % len(mult_styles)]\n",
    "    mult_kwarg_map[mult.klass] += 1\n",
    "    for cm in (None, \"gsr\", \"additive\", \"multiplicative\", \"euclidean\", \"bt\"):\n",
    "        mwc = mult.with_countermeasure(cm)\n",
    "        colors[mwc] = color\n",
    "        styles[mwc] = style\n",
    "        markers[mwc] = mult_markers[mult_cm_map[mult] % len(mult_markers)]\n",
    "        mult_cm_map[mult] += 1\n",
    "\n",
    "majticks = np.arange(0, 1, 0.1)\n",
    "minticks = np.arange(0, 1, 0.05)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2df8cd8c-9528-4755-83b5-10ecabaead54",
   "metadata": {},
   "outputs": [],
   "source": [
    "def divides_any(l: int, small_scalars: set[int]) -> bool:\n",
    "    for s in small_scalars:\n",
    "        if s%l==0:\n",
    "            return True\n",
    "    return False\n",
    "\n",
    "def process_small_scalars(scalar_results: MultResults, divisors: set[int]) -> ProbMap:\n",
    "    result = {}\n",
    "    for divisor in divisors:\n",
    "        count = 0\n",
    "        for smult in scalar_results.multiplications:\n",
    "            if divides_any(divisor, smult):\n",
    "                count += 1\n",
    "        result[divisor] = count / scalar_results.samples\n",
    "    return ProbMap(result, scalar_results.samples)\n",
    "\n",
    "def load_chunk(fname: str, divisors: set[int]) -> dict[MultIdent, ProbMap]:\n",
    "    with open(fname, \"rb\") as f:\n",
    "        multiples = pickle.load(f)\n",
    "        res = {}\n",
    "        for mult, results in multiples.items():\n",
    "            res[mult] = process_small_scalars(results, divisors)\n",
    "    return res\n",
    "\n",
    "def conf_interval(p: float, samples: int, alpha: float = 0.05) -> tuple[float, float]:\n",
    "    return proportion_confint(round(p*samples), samples, alpha, method=\"wilson\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2596562f-8a6a-4a25-ae82-a6b9562d8a40",
   "metadata": {},
   "source": [
    "## Divisors\n",
    "The cell below contains some interesting divisors for distinguishing scalarmults."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bab2a086-8b3d-4e76-bf5c-46ea2b617708",
   "metadata": {},
   "outputs": [],
   "source": [
    "def powers_of(k, max_power=20):\n",
    "    return [k**i for i in range(1, max_power)]\n",
    "\n",
    "def prod_combine(one, other):\n",
    "    return [a * b for a, b in itertools.product(one, other)]\n",
    "\n",
    "small_primes = [3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199]\n",
    "medium_primes = [211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397]\n",
    "large_primes = [401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]\n",
    "all_integers = list(range(1, 400))\n",
    "all_even = list(range(2, 400, 2))\n",
    "all_odd = list(range(1, 400, 2))\n",
    "all_primes = small_primes + medium_primes + large_primes\n",
    "\n",
    "divisor_map = {\n",
    "    \"small_primes\": small_primes,\n",
    "    \"medium_primes\": medium_primes,\n",
    "    \"large_primes\": large_primes,\n",
    "    \"all_primes\": all_primes,\n",
    "    \"all_integers\": all_integers,\n",
    "    \"all_even\": all_even,\n",
    "    \"all_odd\": all_odd,\n",
    "    \"powers_of_2\": powers_of(2),\n",
    "    \"powers_of_2_large\": powers_of(2, 256),\n",
    "    \"powers_of_2_large_3\": [i * 3 for i in powers_of(2, 256)],\n",
    "    \"powers_of_2_large_p1\": [i + 1 for i in powers_of(2, 256)],\n",
    "    \"powers_of_2_large_m1\": [i - 1 for i in powers_of(2, 256)],\n",
    "    \"powers_of_2_large_pmautobus\": sorted(set([i + j for i in powers_of(2, 256) for j in range(-5,5) if i+j > 0])),\n",
    "    \"powers_of_3\": powers_of(3),\n",
    "}\n",
    "divisor_map[\"all\"] = list(sorted(set().union(*[v for v in divisor_map.values()])))\n",
    "for d, ds in divisor_map.items():\n",
    "    print(d, len(ds))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "638f8634-1f6e-4844-a796-096611dfbac2",
   "metadata": {},
   "outputs": [],
   "source": [
    "bits = 256\n",
    "num_workers = 28"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5b427252-a3ff-4a55-940c-3c8659caa799",
   "metadata": {},
   "source": [
    "Select the mults you want to compute the prob-maps for here as well as a set of divisors. It is good to set `all` here, compute the prob-maps for all the divisors, save them and they continue with visualizing them on subsets of divisors."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8b008248-a0aa-41fa-933c-f325f8eec31b",
   "metadata": {},
   "source": [
    "## Configuration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4d2a0f19-8275-4db8-b3fc-c930d8ba2177",
   "metadata": {},
   "outputs": [],
   "source": [
    "selected_mults = all_mults\n",
    "divisor_name = \"all\"\n",
    "kind = \"necessary\"\n",
    "showci = False\n",
    "selected_divisors = divisor_map[divisor_name]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4d2b0f1a-b50a-4548-b63e-c6507e95503d",
   "metadata": {},
   "outputs": [],
   "source": [
    "# This cell computes the probmaps from the multiplication result chunks. Only do this on small amount of chunks.\n",
    "# distributions_mults = {}\n",
    "# files = sorted(glob.glob(f\"multiples_{bits}_{kind}_chunk*.pickle\"))\n",
    "# with TaskExecutor(max_workers=num_workers) as pool:\n",
    "#     for fname in files:\n",
    "#         pool.submit_task(fname,\n",
    "#                          load_chunk,\n",
    "#                          fname, selected_divisors)\n",
    "#     for fname, future in tqdm(pool.as_completed(), leave=False, total=len(pool.tasks), smoothing=0):\n",
    "#         if error := future.exception():\n",
    "#             print(f\"Error {fname}, {error}\")\n",
    "#             continue\n",
    "#         new_distrs = future.result()\n",
    "#         for mult, prob_map in new_distrs.items():\n",
    "#             if mult in distributions_mults:\n",
    "#                 distributions_mults[mult].merge(prob_map)\n",
    "#             else:\n",
    "#                 distributions_mults[mult] = prob_map\n",
    "# Save\n",
    "# with open(f\"{divisor_name}_{kind}_distrs.pickle\", \"wb\") as f:\n",
    "#     pickle.dump(distributions_mults, f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "19d986ab-5fe7-4dd6-b5b5-4e75307217d6",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Optionally, load\n",
    "with open(f\"{divisor_name}_{kind}_distrs.pickle\", \"rb\") as f:\n",
    "    distributions_mults = pickle.load(f)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ef5b7a43-74b4-4e72-a3a1-955e175f5297",
   "metadata": {},
   "source": [
    "Now, go over all the divisor sets and visualize them (without the combs) into PNGs in the graphs/ directory."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5ccc28f6-3994-4a0d-8639-2f6df4dddd26",
   "metadata": {},
   "outputs": [],
   "source": [
    "for mult, probmap in distributions_mults.items():\n",
    "    for divisor in sorted(divisor_map[divisor_name]):\n",
    "        if divisor not in probmap.probs:\n",
    "            print(f\"Missing {mult}, {divisor}\")\n",
    "    if probmap.kind is not None and probmap.kind != kind:\n",
    "        print(\"Bad kind! Did you forget to load?\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9b6f169b-07b3-4b27-ba36-8b90418cd072",
   "metadata": {},
   "source": [
    "## Plots (nocomb)\n",
    "Let's visualize all the divisor groups while looking at the multipliers and countermeasures except the comb-like ones."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "906b5d78-b3a4-4cbb-8051-092d411ba735",
   "metadata": {},
   "outputs": [],
   "source": [
    "for divisor_name in divisor_map:\n",
    "    plot_mults = list(filter(lambda mult: mult in distributions_mults and mult.klass not in (CombMultiplier, BGMWMultiplier), all_mults_with_ctr))\n",
    "    print(divisor_name, \"nocomb\")\n",
    "    plot_divisors = sorted(divisor_map[divisor_name])\n",
    "    L = len(plot_divisors)\n",
    "    N = len(plot_mults)\n",
    "    x = list(range(L))\n",
    "    \n",
    "    fig = plt.figure(figsize=(L/4+10, 24))\n",
    "    ax = plt.subplot(111)\n",
    "    \n",
    "    vals = np.zeros((N, L))\n",
    "    n_samples = 0\n",
    "    for i, mult in enumerate(plot_mults):\n",
    "        probmap = distributions_mults[mult]\n",
    "        y_values = [probmap[l] for l in plot_divisors]\n",
    "        vals[i,] = y_values\n",
    "        ax.plot(x, y_values,\n",
    "                color=colors[mult],\n",
    "                linestyle=styles[mult],\n",
    "                marker=markers[mult],\n",
    "                label=str(mult) if mult.countermeasure is None else \"_nolegend_\")\n",
    "        if showci:\n",
    "            cis = [conf_interval(p, probmap.samples) for p in y_values]\n",
    "            ci_low = [ci[0] for ci in cis]\n",
    "            ci_high = [ci[1] for ci in cis]\n",
    "            ax.fill_between(x, ci_low, ci_high, color=\"black\", alpha=0.1)\n",
    "        n_samples += probmap.samples\n",
    "    \n",
    "    ax.set_title(f\"{divisor_name} ({kind})\\nSamples: \" + str(n_samples//N))\n",
    "    \n",
    "    #var = np.var(vals, axis=0)\n",
    "    #ax.plot(x, var / np.max(var), label=\"cross-mult variance (normalized)\", ls=\"--\", lw=2, color=\"black\")\n",
    "    \n",
    "    ax.set_xlabel(\"divisors\")\n",
    "    ax.set_ylabel(\"error probability\")\n",
    "    ax.set_yticks(majticks)\n",
    "    ax.set_yticks(minticks, minor=True)\n",
    "    ax.set_xticks(x, plot_divisors, rotation=90)\n",
    "    \n",
    "    ax.grid(axis=\"y\", which=\"major\", alpha=0.7)\n",
    "    ax.grid(axis=\"y\", which=\"minor\", alpha=0.3)\n",
    "    ax.grid(axis=\"x\", alpha=0.7)\n",
    "    plt.tight_layout()\n",
    "    box = ax.get_position()\n",
    "    ax.set_position([box.x0, box.y0, box.width * 0.9, box.height])\n",
    "    \n",
    "    ax.legend(loc='center left', bbox_to_anchor=(1, 0.5))\n",
    "\n",
    "    fig.savefig(f\"graphs/{kind}-kind/{divisor_name}-nocomb{'+ci' if showci else ''}.pdf\");\n",
    "    plt.close()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4068e7d0-addb-45d0-ba87-e572d4c82fbd",
   "metadata": {},
   "source": [
    "## Plots (allmults)\n",
    "Now, lets also do plots with allmults for all divisor groups."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9b9aa7a8-0d9d-4ce3-a936-8ced2948f562",
   "metadata": {},
   "outputs": [],
   "source": [
    "for divisor_name in divisor_map:\n",
    "    plot_mults = list(filter(lambda mult: mult in distributions_mults, all_mults_with_ctr))\n",
    "    print(divisor_name, \"allmults\")\n",
    "    plot_divisors = sorted(divisor_map[divisor_name])\n",
    "    L = len(plot_divisors)\n",
    "    N = len(plot_mults)\n",
    "    x = list(range(L))\n",
    "    \n",
    "    fig = plt.figure(figsize=(L/4+10, 26))\n",
    "    ax = plt.subplot(111)\n",
    "    \n",
    "    vals = np.zeros((N, L))\n",
    "    n_samples = 0\n",
    "    for i, mult in enumerate(plot_mults):\n",
    "        probmap = distributions_mults[mult]\n",
    "        y_values = [probmap[l] for l in plot_divisors]\n",
    "        vals[i,] = y_values\n",
    "        ax.plot(x, y_values,\n",
    "                color=colors[mult],\n",
    "                linestyle=styles[mult],\n",
    "                marker=markers[mult],\n",
    "                label=str(mult) if mult.countermeasure is None else \"_nolegend_\")\n",
    "        if showci:\n",
    "            cis = [conf_interval(p, probmap.samples) for p in y_values]\n",
    "            ci_low = [ci[0] for ci in cis]\n",
    "            ci_high = [ci[1] for ci in cis]\n",
    "            ax.fill_between(x, ci_low, ci_high, color=\"black\", alpha=0.1)\n",
    "        n_samples += probmap.samples\n",
    "    \n",
    "    ax.set_title(f\"{divisor_name} ({kind})\\nSamples(avg): \" + str(n_samples//N))\n",
    "    \n",
    "    #var = np.var(vals, axis=0)\n",
    "    #ax.plot(x, var / np.max(var), label=\"cross-mult variance (normalized)\", ls=\"--\", lw=2, color=\"black\")\n",
    "    \n",
    "    ax.set_xlabel(\"divisors\")\n",
    "    ax.set_ylabel(\"error probability\")\n",
    "    ax.set_yticks(majticks)\n",
    "    ax.set_yticks(minticks, minor=True)\n",
    "    ax.set_xticks(x, plot_divisors, rotation=90)\n",
    "    \n",
    "    ax.grid(axis=\"y\", which=\"major\", alpha=0.7)\n",
    "    ax.grid(axis=\"y\", which=\"minor\", alpha=0.3)\n",
    "    ax.grid(axis=\"x\", alpha=0.7)\n",
    "    plt.tight_layout()\n",
    "    box = ax.get_position()\n",
    "    ax.set_position([box.x0, box.y0, box.width * 0.9, box.height])\n",
    "    \n",
    "    ax.legend(loc='center left', bbox_to_anchor=(1, 0.5))\n",
    "\n",
    "    fig.savefig(f\"graphs/{kind}-kind/{divisor_name}-allmults{'+ci' if showci else ''}.pdf\")\n",
    "    plt.close()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "df2e236a-4540-4677-a7f1-563c4cc37a3e",
   "metadata": {},
   "source": [
    "## Interactive plot\n",
    "Below you can choose a concrete divisor set and visualize it with all the mults, or just some to your liking."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b464865d-b169-446e-a9e7-0cead699aee1",
   "metadata": {},
   "outputs": [],
   "source": [
    "#divisor_name = \"powers_of_2_large\"\n",
    "divisor_name = \"feature\"\n",
    "plot_mults = list(filter(lambda mult: mult in distributions_mults, all_mults_with_ctr))\n",
    "#plot_divisors = (61, 65, 111, 165, 1536, 12288) \n",
    "plot_divisors = (55, 65, 165, 248, 3072)\n",
    "L = len(plot_divisors)\n",
    "N = len(plot_mults)\n",
    "x = list(range(L))\n",
    "\n",
    "fig = plt.figure(figsize=(L/4+15, 24))\n",
    "ax = plt.subplot(111)\n",
    "\n",
    "vals = np.zeros((N, L))\n",
    "n_samples = 0\n",
    "for i, mult in enumerate(plot_mults):\n",
    "    probmap = distributions_mults[mult]\n",
    "    y_values = [probmap[l] for l in plot_divisors]\n",
    "    vals[i,] = y_values\n",
    "    ax.plot(x, y_values,\n",
    "            color=colors[mult],\n",
    "            linestyle=styles[mult],\n",
    "            marker=markers[mult],\n",
    "            label=str(mult) if mult.countermeasure is None else \"_nolegend_\")\n",
    "    if showci:\n",
    "        cis = [conf_interval(p, probmap.samples) for p in y_values]\n",
    "        ci_low = [ci[0] for ci in cis]\n",
    "        ci_high = [ci[1] for ci in cis]\n",
    "        ax.fill_between(x, ci_low, ci_high, color=\"black\", alpha=0.1)\n",
    "    n_samples += probmap.samples\n",
    "\n",
    "ax.set_title(f\"{divisor_name} ({kind})\\nSamples(avg): \" + str(n_samples//N))\n",
    "\n",
    "#var = np.var(vals, axis=0)\n",
    "#ax.plot(x, var / np.max(var), label=\"cross-mult variance (normalized)\", ls=\"--\", lw=2, color=\"black\")\n",
    "\n",
    "ax.set_xlabel(\"divisors\")\n",
    "ax.set_ylabel(\"error probability\")\n",
    "ax.set_yticks(majticks)\n",
    "ax.set_yticks(minticks, minor=True)\n",
    "ax.set_xticks(x, plot_divisors, rotation=90)\n",
    "\n",
    "ax.grid(axis=\"y\", which=\"major\", alpha=0.7)\n",
    "ax.grid(axis=\"y\", which=\"minor\", alpha=0.3)\n",
    "ax.grid(axis=\"x\", alpha=0.7)\n",
    "plt.tight_layout()\n",
    "box = ax.get_position()\n",
    "ax.set_position([box.x0, box.y0, box.width * 0.7, box.height])\n",
    "\n",
    "# Put a legend to the right of the current axis\n",
    "ax.legend(loc='center left', bbox_to_anchor=(1, 0.5))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d68f0bfc-cdf1-4891-b0e5-0b6d1b02ded7",
   "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.12.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}