Skip to content

Commit 1bdbc0f

Browse files
umer066orsa-classiq
authored andcommitted
Update variable name from x_logarithm to x_element in the functions.
1 parent 8a681e5 commit 1bdbc0f

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

algorithms/algebraic/discrete_log/discrete_log.ipynb

+9-9
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
},
6666
{
6767
"cell_type": "code",
68-
"execution_count": 7,
68+
"execution_count": 5,
6969
"id": "2bbc4aa3-8f61-433d-a1cd-c58df445a2fd",
7070
"metadata": {
7171
"execution": {
@@ -93,7 +93,7 @@
9393
"@qfunc\n",
9494
"def discrete_log_oracle(\n",
9595
" g_generator: CInt,\n",
96-
" x_logarithm: CInt,\n",
96+
" x_element: CInt,\n",
9797
" N_modulus: CInt,\n",
9898
" order: CInt,\n",
9999
" x1: QArray[QBit],\n",
@@ -104,7 +104,7 @@
104104
" allocate(ceiling(log(N_modulus, 2)), func_res)\n",
105105
"\n",
106106
" inplace_prepare_int(1, func_res)\n",
107-
" modular_exp(N_modulus, x_logarithm, func_res, x1)\n",
107+
" modular_exp(N_modulus, x_element, func_res, x1)\n",
108108
" modular_exp(N_modulus, g_generator, func_res, x2)"
109109
]
110110
},
@@ -122,7 +122,7 @@
122122
},
123123
{
124124
"cell_type": "code",
125-
"execution_count": 8,
125+
"execution_count": 6,
126126
"id": "d7fb63ac-023d-40ac-9395-13c1274d446f",
127127
"metadata": {
128128
"execution": {
@@ -141,7 +141,7 @@
141141
"@qfunc\n",
142142
"def discrete_log(\n",
143143
" g_generator: CInt,\n",
144-
" x_logarithm: CInt,\n",
144+
" x_element: CInt,\n",
145145
" N_modulus: CInt,\n",
146146
" order: CInt,\n",
147147
" x1: Output[QArray[QBit]],\n",
@@ -155,7 +155,7 @@
155155
" hadamard_transform(x1)\n",
156156
" hadamard_transform(x2)\n",
157157
"\n",
158-
" discrete_log_oracle(g_generator, x_logarithm, N_modulus, order, x1, x2, func_res)\n",
158+
" discrete_log_oracle(g_generator, x_element, N_modulus, order, x1, x2, func_res)\n",
159159
"\n",
160160
" invert(lambda: qft(x1))\n",
161161
" invert(lambda: qft(x2))"
@@ -209,7 +209,7 @@
209209
},
210210
{
211211
"cell_type": "code",
212-
"execution_count": 9,
212+
"execution_count": 7,
213213
"id": "8ef24bb4-b063-42d6-a5ea-ddcd5310ae13",
214214
"metadata": {
215215
"execution": {
@@ -240,7 +240,7 @@
240240
},
241241
{
242242
"cell_type": "code",
243-
"execution_count": 10,
243+
"execution_count": 8,
244244
"id": "8e9d0b08-f3f8-4e95-a468-bfeec010d97c",
245245
"metadata": {
246246
"execution": {
@@ -272,7 +272,7 @@
272272
},
273273
{
274274
"cell_type": "code",
275-
"execution_count": 11,
275+
"execution_count": null,
276276
"id": "0aef2760-aa9a-4710-8c60-08333a0a9b0b",
277277
"metadata": {
278278
"execution": {

algorithms/algebraic/discrete_log/discrete_log.qmod

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
qfunc discrete_log_oracle<g_generator: int, x_logarithm: int, N_modulus: int, order: int>(x1: qbit[], x2: qbit[], output func_res: qbit[]) {
1+
qfunc discrete_log_oracle<g_generator: int, x_element: int, N_modulus: int, order: int>(x1: qbit[], x2: qbit[], output func_res: qbit[]) {
22
allocate<ceiling(log(N_modulus, 2))>(func_res);
33
inplace_prepare_int<1>(func_res);
4-
modular_exp<N_modulus, x_logarithm>(func_res, x1);
4+
modular_exp<N_modulus, x_element>(func_res, x1);
55
modular_exp<N_modulus, g_generator>(func_res, x2);
66
}
77

8-
qfunc discrete_log<g_generator: int, x_logarithm: int, N_modulus: int, order: int>(output x1: qbit[], output x2: qbit[], output func_res: qbit[]) {
8+
qfunc discrete_log<g_generator: int, x_element: int, N_modulus: int, order: int>(output x1: qbit[], output x2: qbit[], output func_res: qbit[]) {
99
allocate<ceiling(log(order, 2))>(x1);
1010
allocate<ceiling(log(order, 2))>(x2);
1111
hadamard_transform(x1);
1212
hadamard_transform(x2);
13-
discrete_log_oracle<g_generator, x_logarithm, N_modulus, order>(x1, x2, func_res);
13+
discrete_log_oracle<g_generator, x_element, N_modulus, order>(x1, x2, func_res);
1414
invert {
1515
qft(x1);
1616
}

0 commit comments

Comments
 (0)