Skip to content

Commit 4066bbc

Browse files
AnnePicusNadav Ben Ami
authored andcommitted
English suggestions for hidden_shift
1 parent 67063af commit 4066bbc

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

algorithms/algebraic/hidden_shift/hidden_shift.ipynb

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77
"tags": []
88
},
99
"source": [
10-
"# Hidden-Shift problem for bent functions using the classiq platform"
10+
"# Hidden-Shift Problem for Bent Functions"
1111
]
1212
},
1313
{
1414
"cell_type": "markdown",
1515
"id": "450fbc3a-2837-44e7-90bc-e695a87ba220",
1616
"metadata": {},
1717
"source": [
18-
"Here we implement the hidden shift algorithm for the familty of boolean bent functions."
18+
"Here we implement the hidden shift algorithm for the family of Boolean bent functions using the Classiq platform."
1919
]
2020
},
2121
{
2222
"cell_type": "markdown",
2323
"id": "a13a1783-065a-46aa-9967-ba2d5affd33e",
2424
"metadata": {},
2525
"source": [
26-
"First, make sure we have all necessary packages:"
26+
"Make sure we have all necessary packages:"
2727
]
2828
},
2929
{
@@ -51,7 +51,7 @@
5151
"tags": []
5252
},
5353
"source": [
54-
"On the first part, we assume we know how to implement the dual of $f$, and get $s$ according to the algorithm in [[1](#first)]:![Screen Shot 2023-06-27 at 18.05.48.png](attachment:663333d5-eb52-4150-a00d-8683e816d860.png)"
54+
"We assume we know how to implement the dual of $f$ and get $s$ according to the algorithm in [[1](#first)]:![Screen Shot 2023-06-27 at 18.05.48.png](attachment:663333d5-eb52-4150-a00d-8683e816d860.png)"
5555
]
5656
},
5757
{
@@ -63,9 +63,7 @@
6363
{
6464
"name": "stdout",
6565
"output_type": "stream",
66-
"text": [
67-
""
68-
]
66+
"text": []
6967
}
7068
],
7169
"source": [
@@ -143,7 +141,7 @@
143141
"id": "64d54218-7d9c-420a-92ff-1f719d2aa638",
144142
"metadata": {},
145143
"source": [
146-
"# More complex functions"
144+
"## More Complex Functions"
147145
]
148146
},
149147
{
@@ -239,7 +237,7 @@
239237
"id": "c27a578d-5380-460d-9833-15557d4e292a",
240238
"metadata": {},
241239
"source": [
242-
"## Now create the ciruit:"
240+
"## Creating the Circuit"
243241
]
244242
},
245243
{
@@ -253,8 +251,7 @@
253251
"output_type": "stream",
254252
"text": [
255253
"f_dual: (((((((((x[5]) & (y[0])) ^ ((x[2]) & (y[1]))) ^ ((x[7]) & (y[2]))) ^ ((x[0]) & (y[3]))) ^ ((x[6]) & (y[4]))) ^ ((x[3]) & (y[5]))) ^ ((x[1]) & (y[6]))) ^ ((x[4]) & (y[7]))) ^ ((((((((x[5]) & (x[2])) & (x[7])) & (x[0])) & (x[6])) & (x[3])) & (x[1])) & (x[4]))\n",
256-
"g: (((((((((x[0]) & (y[3])) ^ (((x[1]) ^ 1) & (y[6]))) ^ ((x[2]) & ((y[1]) ^ 1))) ^ (((x[3]) ^ 1) & (y[5]))) ^ ((x[4]) & (y[7]))) ^ ((x[5]) & (y[0]))) ^ ((x[6]) & (y[4]))) ^ ((x[7]) & (y[2]))) ^ ((((((((y[0]) & ((y[1]) ^ 1)) & (y[2])) & (y[3])) & (y[4])) & (y[5])) & (y[6])) & (y[7]))\n",
257-
""
254+
"g: (((((((((x[0]) & (y[3])) ^ (((x[1]) ^ 1) & (y[6]))) ^ ((x[2]) & ((y[1]) ^ 1))) ^ (((x[3]) ^ 1) & (y[5]))) ^ ((x[4]) & (y[7]))) ^ ((x[5]) & (y[0]))) ^ ((x[6]) & (y[4]))) ^ ((x[7]) & (y[2]))) ^ ((((((((y[0]) & ((y[1]) ^ 1)) & (y[2])) & (y[3])) & (y[4])) & (y[5])) & (y[6])) & (y[7]))\n"
258255
]
259256
}
260257
],
@@ -359,7 +356,7 @@
359356
"tags": []
360357
},
361358
"source": [
362-
"# Hidden Shift without the dual function"
359+
"## Hidden Shift Without the Dual Function"
363360
]
364361
},
365362
{
@@ -372,7 +369,7 @@
372369
"id": "0bf70e08-3ea7-43b8-afc2-0271f124323f",
373370
"metadata": {},
374371
"source": [
375-
"We now use the second algorithm described in [[2](#second)]. This algorithm only requires to implement $f$ and not its dual, however requires $O(n)$ samples from the circuit.\n",
372+
"We now use the second algorithm described in [[2](#second)]. This algorithm only requires implementing $f$ and not its dual; however, it requires $O(n)$ samples from the circuit.\n",
376373
"![Screen Shot 2023-06-27 at 18.08.23.png](attachment:e8a93a2f-8965-4181-9083-78e12dc0f48b.png)"
377374
]
378375
},
@@ -389,8 +386,7 @@
389386
"output_type": "stream",
390387
"text": [
391388
"f: (((((((((x[0]) & (y[3])) ^ ((x[1]) & (y[6]))) ^ ((x[2]) & (y[1]))) ^ ((x[3]) & (y[5]))) ^ ((x[4]) & (y[7]))) ^ ((x[5]) & (y[0]))) ^ ((x[6]) & (y[4]))) ^ ((x[7]) & (y[2]))) ^ ((((((((y[0]) & (y[1])) & (y[2])) & (y[3])) & (y[4])) & (y[5])) & (y[6])) & (y[7]))\n",
392-
"g: (((((((((x[0]) & (y[3])) ^ (((x[1]) ^ 1) & (y[6]))) ^ ((x[2]) & ((y[1]) ^ 1))) ^ (((x[3]) ^ 1) & (y[5]))) ^ ((x[4]) & (y[7]))) ^ ((x[5]) & (y[0]))) ^ ((x[6]) & (y[4]))) ^ ((x[7]) & (y[2]))) ^ ((((((((y[0]) & ((y[1]) ^ 1)) & (y[2])) & (y[3])) & (y[4])) & (y[5])) & (y[6])) & (y[7]))\n",
393-
""
389+
"g: (((((((((x[0]) & (y[3])) ^ (((x[1]) ^ 1) & (y[6]))) ^ ((x[2]) & ((y[1]) ^ 1))) ^ (((x[3]) ^ 1) & (y[5]))) ^ ((x[4]) & (y[7]))) ^ ((x[5]) & (y[0]))) ^ ((x[6]) & (y[4]))) ^ ((x[7]) & (y[2]))) ^ ((((((((y[0]) & ((y[1]) ^ 1)) & (y[2])) & (y[3])) & (y[4])) & (y[5])) & (y[6])) & (y[7]))\n"
394390
]
395391
}
396392
],
@@ -451,7 +447,7 @@
451447
"metadata": {},
452448
"source": [
453449
"Out of the sampled results, we look for $n$ independent samples, from which we can extract s.\n",
454-
"1000 samples should be enough with a very high probability."
450+
"One thousand samples should be enough with a very high probability."
455451
]
456452
},
457453
{
@@ -464,10 +460,10 @@
464460
"outputs": [],
465461
"source": [
466462
"# The galois library is a package that extends NumPy arrays to operate over finite fields.\n",
467-
"# we wlll use it as our equations are binary equations\n",
463+
"# we will use it as our equations are binary equations\n",
468464
"import galois\n",
469465
"\n",
470-
"# here we work over boolean arithmetics - F(2)\n",
466+
"# here we work over Boolean arithmetics - F(2)\n",
471467
"GF = galois.GF(2)\n",
472468
"\n",
473469
"\n",
@@ -507,7 +503,7 @@
507503
"tags": []
508504
},
509505
"source": [
510-
"We now left with solving the equation and extracting $s$:"
506+
"We now solve the equation and extract $s$:"
511507
]
512508
},
513509
{
@@ -543,7 +539,7 @@
543539
"id": "2e47bb31-04e8-4698-b42e-13ca9722018e",
544540
"metadata": {},
545541
"source": [
546-
"And we got successfully the same shift."
542+
"And we successfully received the same shift."
547543
]
548544
},
549545
{

0 commit comments

Comments
 (0)