classiq 0.40.0__py3-none-any.whl → 0.41.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- classiq/__init__.py +4 -2
- classiq/_internals/api_wrapper.py +3 -21
- classiq/applications/chemistry/chemistry_model_constructor.py +86 -100
- classiq/applications/combinatorial_helpers/combinatorial_problem_utils.py +6 -24
- classiq/applications/combinatorial_helpers/pauli_helpers/pauli_utils.py +33 -45
- classiq/applications/combinatorial_optimization/__init__.py +2 -0
- classiq/applications/combinatorial_optimization/combinatorial_optimization_model_constructor.py +29 -26
- classiq/applications/finance/finance_model_constructor.py +23 -26
- classiq/applications/grover/grover_model_constructor.py +37 -38
- classiq/applications/qsvm/qsvm.py +1 -2
- classiq/applications/qsvm/qsvm_model_constructor.py +15 -16
- classiq/execution/__init__.py +4 -0
- classiq/execution/execution_session.py +151 -0
- classiq/execution/qnn.py +80 -0
- classiq/executor.py +2 -109
- classiq/interface/_version.py +1 -1
- classiq/interface/analyzer/analysis_params.py +11 -0
- classiq/interface/applications/qsvm.py +0 -8
- classiq/interface/ast_node.py +12 -2
- classiq/interface/backend/backend_preferences.py +25 -1
- classiq/interface/backend/quantum_backend_providers.py +4 -4
- classiq/interface/executor/execution_preferences.py +4 -59
- classiq/interface/executor/execution_result.py +22 -1
- classiq/interface/generator/arith/arithmetic_expression_validator.py +0 -2
- classiq/interface/generator/arith/binary_ops.py +88 -25
- classiq/interface/generator/arith/unary_ops.py +28 -19
- classiq/interface/generator/expressions/atomic_expression_functions.py +6 -2
- classiq/interface/generator/expressions/enums/__init__.py +10 -0
- classiq/interface/generator/expressions/enums/classical_enum.py +5 -1
- classiq/interface/generator/expressions/expression.py +9 -2
- classiq/interface/generator/expressions/qmod_qarray_proxy.py +7 -0
- classiq/interface/generator/expressions/qmod_qscalar_proxy.py +0 -1
- classiq/interface/generator/expressions/sympy_supported_expressions.py +10 -1
- classiq/interface/generator/functions/builtins/internal_operators.py +7 -62
- classiq/interface/generator/functions/builtins/open_lib_functions.py +810 -2
- classiq/interface/generator/functions/classical_type.py +1 -3
- classiq/interface/generator/synthesis_metadata/synthesis_duration.py +0 -4
- classiq/interface/model/bind_operation.py +3 -1
- classiq/interface/model/call_synthesis_data.py +2 -13
- classiq/interface/model/classical_if.py +3 -1
- classiq/interface/model/classical_parameter_declaration.py +13 -0
- classiq/interface/model/control.py +3 -101
- classiq/interface/model/inplace_binary_operation.py +3 -1
- classiq/interface/model/invert.py +3 -1
- classiq/interface/model/port_declaration.py +8 -1
- classiq/interface/model/power.py +3 -1
- classiq/interface/model/quantum_expressions/amplitude_loading_operation.py +4 -2
- classiq/interface/model/quantum_expressions/arithmetic_operation.py +3 -1
- classiq/interface/model/quantum_expressions/quantum_expression.py +11 -1
- classiq/interface/model/quantum_function_call.py +4 -10
- classiq/interface/model/quantum_function_declaration.py +26 -4
- classiq/interface/model/quantum_lambda_function.py +1 -20
- classiq/interface/model/quantum_statement.py +9 -2
- classiq/interface/model/repeat.py +3 -1
- classiq/interface/model/statement_block.py +19 -13
- classiq/interface/model/validations/handles_validator.py +8 -2
- classiq/interface/model/variable_declaration_statement.py +3 -1
- classiq/interface/model/within_apply_operation.py +3 -1
- classiq/interface/server/routes.py +0 -5
- classiq/qmod/__init__.py +1 -2
- classiq/qmod/builtins/classical_execution_primitives.py +22 -2
- classiq/qmod/builtins/functions.py +51 -1
- classiq/qmod/builtins/operations.py +6 -36
- classiq/qmod/declaration_inferrer.py +8 -15
- classiq/qmod/native/__init__.py +9 -0
- classiq/qmod/native/expression_to_qmod.py +12 -9
- classiq/qmod/native/pretty_printer.py +4 -4
- classiq/qmod/pretty_print/__init__.py +9 -0
- classiq/qmod/pretty_print/expression_to_python.py +221 -0
- classiq/qmod/pretty_print/pretty_printer.py +421 -0
- classiq/qmod/qmod_parameter.py +7 -4
- classiq/qmod/quantum_callable.py +2 -1
- classiq/qmod/quantum_expandable.py +4 -3
- classiq/qmod/quantum_function.py +4 -16
- classiq/qmod/symbolic.py +1 -6
- classiq/synthesis.py +15 -16
- {classiq-0.40.0.dist-info → classiq-0.41.0.dist-info}/METADATA +5 -4
- {classiq-0.40.0.dist-info → classiq-0.41.0.dist-info}/RECORD +79 -76
- classiq/interface/model/common_model_types.py +0 -23
- classiq/interface/model/quantum_expressions/control_state.py +0 -38
- {classiq-0.40.0.dist-info → classiq-0.41.0.dist-info}/WHEEL +0 -0
@@ -12,6 +12,7 @@ QFT_STEP = QuantumFunctionDeclaration.parse_raw(
|
|
12
12
|
"port_declarations": {
|
13
13
|
"target": {
|
14
14
|
"name": "target",
|
15
|
+
"kind": "PortDeclaration",
|
15
16
|
"direction": "inout"
|
16
17
|
}
|
17
18
|
},
|
@@ -28,6 +29,7 @@ QFT = QuantumFunctionDeclaration.parse_raw(
|
|
28
29
|
"port_declarations": {
|
29
30
|
"target": {
|
30
31
|
"name": "target",
|
32
|
+
"kind": "PortDeclaration",
|
31
33
|
"direction": "inout"
|
32
34
|
}
|
33
35
|
},
|
@@ -47,6 +49,7 @@ QPE_FLEXIBLE = QuantumFunctionDeclaration.parse_raw(
|
|
47
49
|
"quantum_type": {
|
48
50
|
"kind": "qnum"
|
49
51
|
},
|
52
|
+
"kind": "PortDeclaration",
|
50
53
|
"direction": "inout"
|
51
54
|
}
|
52
55
|
},
|
@@ -55,12 +58,14 @@ QPE_FLEXIBLE = QuantumFunctionDeclaration.parse_raw(
|
|
55
58
|
"name": "unitary_with_power",
|
56
59
|
"positional_arg_declarations": [
|
57
60
|
{
|
61
|
+
"kind": "ClassicalParameterDeclaration",
|
58
62
|
"name": "arg0",
|
59
63
|
"classical_type": {
|
60
64
|
"kind": "int"
|
61
65
|
}
|
62
66
|
}
|
63
67
|
],
|
68
|
+
"kind": "QuantumOperandDeclaration",
|
64
69
|
"is_list": false
|
65
70
|
}
|
66
71
|
},
|
@@ -69,12 +74,14 @@ QPE_FLEXIBLE = QuantumFunctionDeclaration.parse_raw(
|
|
69
74
|
"name": "unitary_with_power",
|
70
75
|
"positional_arg_declarations": [
|
71
76
|
{
|
77
|
+
"kind": "ClassicalParameterDeclaration",
|
72
78
|
"name": "arg0",
|
73
79
|
"classical_type": {
|
74
80
|
"kind": "int"
|
75
81
|
}
|
76
82
|
}
|
77
83
|
],
|
84
|
+
"kind": "QuantumOperandDeclaration",
|
78
85
|
"is_list": false
|
79
86
|
},
|
80
87
|
{
|
@@ -82,6 +89,7 @@ QPE_FLEXIBLE = QuantumFunctionDeclaration.parse_raw(
|
|
82
89
|
"quantum_type": {
|
83
90
|
"kind": "qnum"
|
84
91
|
},
|
92
|
+
"kind": "PortDeclaration",
|
85
93
|
"direction": "inout"
|
86
94
|
}
|
87
95
|
]
|
@@ -99,6 +107,7 @@ QPE = QuantumFunctionDeclaration.parse_raw(
|
|
99
107
|
"quantum_type": {
|
100
108
|
"kind": "qnum"
|
101
109
|
},
|
110
|
+
"kind": "PortDeclaration",
|
102
111
|
"direction": "inout"
|
103
112
|
}
|
104
113
|
},
|
@@ -106,6 +115,7 @@ QPE = QuantumFunctionDeclaration.parse_raw(
|
|
106
115
|
"unitary": {
|
107
116
|
"name": "unitary",
|
108
117
|
"positional_arg_declarations": [],
|
118
|
+
"kind": "QuantumOperandDeclaration",
|
109
119
|
"is_list": false
|
110
120
|
}
|
111
121
|
},
|
@@ -113,6 +123,7 @@ QPE = QuantumFunctionDeclaration.parse_raw(
|
|
113
123
|
{
|
114
124
|
"name": "unitary",
|
115
125
|
"positional_arg_declarations": [],
|
126
|
+
"kind": "QuantumOperandDeclaration",
|
116
127
|
"is_list": false
|
117
128
|
},
|
118
129
|
{
|
@@ -120,6 +131,7 @@ QPE = QuantumFunctionDeclaration.parse_raw(
|
|
120
131
|
"quantum_type": {
|
121
132
|
"kind": "qnum"
|
122
133
|
},
|
134
|
+
"kind": "PortDeclaration",
|
123
135
|
"direction": "inout"
|
124
136
|
}
|
125
137
|
]
|
@@ -141,6 +153,7 @@ SINGLE_PAULI = QuantumFunctionDeclaration.parse_raw(
|
|
141
153
|
"port_declarations": {
|
142
154
|
"x": {
|
143
155
|
"name": "x",
|
156
|
+
"kind": "PortDeclaration",
|
144
157
|
"direction": "inout"
|
145
158
|
},
|
146
159
|
"q": {
|
@@ -148,6 +161,7 @@ SINGLE_PAULI = QuantumFunctionDeclaration.parse_raw(
|
|
148
161
|
"size": {
|
149
162
|
"expr": "1"
|
150
163
|
},
|
164
|
+
"kind": "PortDeclaration",
|
151
165
|
"direction": "inout"
|
152
166
|
}
|
153
167
|
},
|
@@ -165,9 +179,11 @@ SINGLE_PAULI = QuantumFunctionDeclaration.parse_raw(
|
|
165
179
|
"size": {
|
166
180
|
"expr": "1"
|
167
181
|
},
|
182
|
+
"kind": "PortDeclaration",
|
168
183
|
"direction": "inout"
|
169
184
|
}
|
170
|
-
}
|
185
|
+
},
|
186
|
+
"kind": "QuantumOperandDeclaration"
|
171
187
|
}
|
172
188
|
},
|
173
189
|
"positional_arg_declarations": []
|
@@ -201,10 +217,12 @@ LINEAR_PAULI_ROTATIONS = QuantumFunctionDeclaration.parse_raw(
|
|
201
217
|
"port_declarations": {
|
202
218
|
"x": {
|
203
219
|
"name": "x",
|
220
|
+
"kind": "PortDeclaration",
|
204
221
|
"direction": "inout"
|
205
222
|
},
|
206
223
|
"q": {
|
207
224
|
"name": "q",
|
225
|
+
"kind": "PortDeclaration",
|
208
226
|
"direction": "inout"
|
209
227
|
}
|
210
228
|
},
|
@@ -224,6 +242,7 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
224
242
|
"quantum_type": {
|
225
243
|
"kind": "qnum"
|
226
244
|
},
|
245
|
+
"kind": "PortDeclaration",
|
227
246
|
"direction": "inout"
|
228
247
|
},
|
229
248
|
"packed_vars": {
|
@@ -232,6 +251,7 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
232
251
|
"kind": "qvec",
|
233
252
|
"length": null
|
234
253
|
},
|
254
|
+
"kind": "PortDeclaration",
|
235
255
|
"direction": "inout"
|
236
256
|
}
|
237
257
|
},
|
@@ -245,9 +265,11 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
245
265
|
"kind": "qvec",
|
246
266
|
"length": null
|
247
267
|
},
|
268
|
+
"kind": "PortDeclaration",
|
248
269
|
"direction": "inout"
|
249
270
|
}
|
250
271
|
],
|
272
|
+
"kind": "QuantumOperandDeclaration",
|
251
273
|
"is_list": false
|
252
274
|
},
|
253
275
|
"space_transform": {
|
@@ -259,9 +281,11 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
259
281
|
"kind": "qvec",
|
260
282
|
"length": null
|
261
283
|
},
|
284
|
+
"kind": "PortDeclaration",
|
262
285
|
"direction": "inout"
|
263
286
|
}
|
264
287
|
],
|
288
|
+
"kind": "QuantumOperandDeclaration",
|
265
289
|
"is_list": false
|
266
290
|
}
|
267
291
|
},
|
@@ -275,9 +299,11 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
275
299
|
"kind": "qvec",
|
276
300
|
"length": null
|
277
301
|
},
|
302
|
+
"kind": "PortDeclaration",
|
278
303
|
"direction": "inout"
|
279
304
|
}
|
280
305
|
],
|
306
|
+
"kind": "QuantumOperandDeclaration",
|
281
307
|
"is_list": false
|
282
308
|
},
|
283
309
|
{
|
@@ -289,9 +315,11 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
289
315
|
"kind": "qvec",
|
290
316
|
"length": null
|
291
317
|
},
|
318
|
+
"kind": "PortDeclaration",
|
292
319
|
"direction": "inout"
|
293
320
|
}
|
294
321
|
],
|
322
|
+
"kind": "QuantumOperandDeclaration",
|
295
323
|
"is_list": false
|
296
324
|
},
|
297
325
|
{
|
@@ -299,6 +327,7 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
299
327
|
"quantum_type": {
|
300
328
|
"kind": "qnum"
|
301
329
|
},
|
330
|
+
"kind": "PortDeclaration",
|
302
331
|
"direction": "inout"
|
303
332
|
},
|
304
333
|
{
|
@@ -307,6 +336,7 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
307
336
|
"kind": "qvec",
|
308
337
|
"length": null
|
309
338
|
},
|
339
|
+
"kind": "PortDeclaration",
|
310
340
|
"direction": "inout"
|
311
341
|
}
|
312
342
|
]
|
@@ -325,6 +355,7 @@ PHASE_ORACLE = QuantumFunctionDeclaration.parse_raw(
|
|
325
355
|
"kind": "qvec",
|
326
356
|
"length": null
|
327
357
|
},
|
358
|
+
"kind": "PortDeclaration",
|
328
359
|
"direction": "inout"
|
329
360
|
}
|
330
361
|
},
|
@@ -338,6 +369,7 @@ PHASE_ORACLE = QuantumFunctionDeclaration.parse_raw(
|
|
338
369
|
"kind": "qvec",
|
339
370
|
"length": null
|
340
371
|
},
|
372
|
+
"kind": "PortDeclaration",
|
341
373
|
"direction": "inout"
|
342
374
|
},
|
343
375
|
{
|
@@ -345,9 +377,11 @@ PHASE_ORACLE = QuantumFunctionDeclaration.parse_raw(
|
|
345
377
|
"quantum_type": {
|
346
378
|
"kind": "qbit"
|
347
379
|
},
|
380
|
+
"kind": "PortDeclaration",
|
348
381
|
"direction": "inout"
|
349
382
|
}
|
350
383
|
],
|
384
|
+
"kind": "QuantumOperandDeclaration",
|
351
385
|
"is_list": false
|
352
386
|
}
|
353
387
|
},
|
@@ -361,6 +395,7 @@ PHASE_ORACLE = QuantumFunctionDeclaration.parse_raw(
|
|
361
395
|
"kind": "qvec",
|
362
396
|
"length": null
|
363
397
|
},
|
398
|
+
"kind": "PortDeclaration",
|
364
399
|
"direction": "inout"
|
365
400
|
},
|
366
401
|
{
|
@@ -368,9 +403,11 @@ PHASE_ORACLE = QuantumFunctionDeclaration.parse_raw(
|
|
368
403
|
"quantum_type": {
|
369
404
|
"kind": "qbit"
|
370
405
|
},
|
406
|
+
"kind": "PortDeclaration",
|
371
407
|
"direction": "inout"
|
372
408
|
}
|
373
409
|
],
|
410
|
+
"kind": "QuantumOperandDeclaration",
|
374
411
|
"is_list": false
|
375
412
|
},
|
376
413
|
{
|
@@ -379,6 +416,7 @@ PHASE_ORACLE = QuantumFunctionDeclaration.parse_raw(
|
|
379
416
|
"kind": "qvec",
|
380
417
|
"length": null
|
381
418
|
},
|
419
|
+
"kind": "PortDeclaration",
|
382
420
|
"direction": "inout"
|
383
421
|
}
|
384
422
|
]
|
@@ -397,6 +435,7 @@ REFLECT_ABOUT_ZERO = QuantumFunctionDeclaration.parse_raw(
|
|
397
435
|
"kind": "qvec",
|
398
436
|
"length": null
|
399
437
|
},
|
438
|
+
"kind": "PortDeclaration",
|
400
439
|
"direction": "inout"
|
401
440
|
}
|
402
441
|
},
|
@@ -408,6 +447,7 @@ REFLECT_ABOUT_ZERO = QuantumFunctionDeclaration.parse_raw(
|
|
408
447
|
"kind": "qvec",
|
409
448
|
"length": null
|
410
449
|
},
|
450
|
+
"kind": "PortDeclaration",
|
411
451
|
"direction": "inout"
|
412
452
|
}
|
413
453
|
]
|
@@ -426,6 +466,7 @@ GROVER_DIFFUSER = QuantumFunctionDeclaration.parse_raw(
|
|
426
466
|
"kind": "qvec",
|
427
467
|
"length": null
|
428
468
|
},
|
469
|
+
"kind": "PortDeclaration",
|
429
470
|
"direction": "inout"
|
430
471
|
}
|
431
472
|
},
|
@@ -439,9 +480,11 @@ GROVER_DIFFUSER = QuantumFunctionDeclaration.parse_raw(
|
|
439
480
|
"kind": "qvec",
|
440
481
|
"length": null
|
441
482
|
},
|
483
|
+
"kind": "PortDeclaration",
|
442
484
|
"direction": "inout"
|
443
485
|
}
|
444
486
|
],
|
487
|
+
"kind": "QuantumOperandDeclaration",
|
445
488
|
"is_list": false
|
446
489
|
}
|
447
490
|
},
|
@@ -455,9 +498,11 @@ GROVER_DIFFUSER = QuantumFunctionDeclaration.parse_raw(
|
|
455
498
|
"kind": "qvec",
|
456
499
|
"length": null
|
457
500
|
},
|
501
|
+
"kind": "PortDeclaration",
|
458
502
|
"direction": "inout"
|
459
503
|
}
|
460
504
|
],
|
505
|
+
"kind": "QuantumOperandDeclaration",
|
461
506
|
"is_list": false
|
462
507
|
},
|
463
508
|
{
|
@@ -466,6 +511,7 @@ GROVER_DIFFUSER = QuantumFunctionDeclaration.parse_raw(
|
|
466
511
|
"kind": "qvec",
|
467
512
|
"length": null
|
468
513
|
},
|
514
|
+
"kind": "PortDeclaration",
|
469
515
|
"direction": "inout"
|
470
516
|
}
|
471
517
|
]
|
@@ -484,6 +530,7 @@ GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
|
|
484
530
|
"kind": "qvec",
|
485
531
|
"length": null
|
486
532
|
},
|
533
|
+
"kind": "PortDeclaration",
|
487
534
|
"direction": "inout"
|
488
535
|
}
|
489
536
|
},
|
@@ -497,9 +544,11 @@ GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
|
|
497
544
|
"kind": "qvec",
|
498
545
|
"length": null
|
499
546
|
},
|
547
|
+
"kind": "PortDeclaration",
|
500
548
|
"direction": "inout"
|
501
549
|
}
|
502
550
|
],
|
551
|
+
"kind": "QuantumOperandDeclaration",
|
503
552
|
"is_list": false
|
504
553
|
},
|
505
554
|
"space_transform": {
|
@@ -511,9 +560,11 @@ GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
|
|
511
560
|
"kind": "qvec",
|
512
561
|
"length": null
|
513
562
|
},
|
563
|
+
"kind": "PortDeclaration",
|
514
564
|
"direction": "inout"
|
515
565
|
}
|
516
566
|
],
|
567
|
+
"kind": "QuantumOperandDeclaration",
|
517
568
|
"is_list": false
|
518
569
|
}
|
519
570
|
},
|
@@ -527,9 +578,11 @@ GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
|
|
527
578
|
"kind": "qvec",
|
528
579
|
"length": null
|
529
580
|
},
|
581
|
+
"kind": "PortDeclaration",
|
530
582
|
"direction": "inout"
|
531
583
|
}
|
532
584
|
],
|
585
|
+
"kind": "QuantumOperandDeclaration",
|
533
586
|
"is_list": false
|
534
587
|
},
|
535
588
|
{
|
@@ -541,9 +594,11 @@ GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
|
|
541
594
|
"kind": "qvec",
|
542
595
|
"length": null
|
543
596
|
},
|
597
|
+
"kind": "PortDeclaration",
|
544
598
|
"direction": "inout"
|
545
599
|
}
|
546
600
|
],
|
601
|
+
"kind": "QuantumOperandDeclaration",
|
547
602
|
"is_list": false
|
548
603
|
},
|
549
604
|
{
|
@@ -552,6 +607,7 @@ GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
|
|
552
607
|
"kind": "qvec",
|
553
608
|
"length": null
|
554
609
|
},
|
610
|
+
"kind": "PortDeclaration",
|
555
611
|
"direction": "inout"
|
556
612
|
}
|
557
613
|
]
|
@@ -574,6 +630,7 @@ GROVER_SEARCH = QuantumFunctionDeclaration.parse_raw(
|
|
574
630
|
"kind": "qvec",
|
575
631
|
"length": null
|
576
632
|
},
|
633
|
+
"kind": "PortDeclaration",
|
577
634
|
"direction": "inout"
|
578
635
|
}
|
579
636
|
},
|
@@ -587,14 +644,17 @@ GROVER_SEARCH = QuantumFunctionDeclaration.parse_raw(
|
|
587
644
|
"kind": "qvec",
|
588
645
|
"length": null
|
589
646
|
},
|
647
|
+
"kind": "PortDeclaration",
|
590
648
|
"direction": "inout"
|
591
649
|
}
|
592
650
|
],
|
651
|
+
"kind": "QuantumOperandDeclaration",
|
593
652
|
"is_list": false
|
594
653
|
}
|
595
654
|
},
|
596
655
|
"positional_arg_declarations": [
|
597
656
|
{
|
657
|
+
"kind": "ClassicalParameterDeclaration",
|
598
658
|
"name": "reps",
|
599
659
|
"classical_type": {
|
600
660
|
"kind": "int"
|
@@ -609,9 +669,11 @@ GROVER_SEARCH = QuantumFunctionDeclaration.parse_raw(
|
|
609
669
|
"kind": "qvec",
|
610
670
|
"length": null
|
611
671
|
},
|
672
|
+
"kind": "PortDeclaration",
|
612
673
|
"direction": "inout"
|
613
674
|
}
|
614
675
|
],
|
676
|
+
"kind": "QuantumOperandDeclaration",
|
615
677
|
"is_list": false
|
616
678
|
},
|
617
679
|
{
|
@@ -620,6 +682,7 @@ GROVER_SEARCH = QuantumFunctionDeclaration.parse_raw(
|
|
620
682
|
"kind": "qvec",
|
621
683
|
"length": null
|
622
684
|
},
|
685
|
+
"kind": "PortDeclaration",
|
623
686
|
"direction": "inout"
|
624
687
|
}
|
625
688
|
]
|
@@ -634,6 +697,7 @@ HADAMARD_TRANSFORM = QuantumFunctionDeclaration.parse_raw(
|
|
634
697
|
"port_declarations": {
|
635
698
|
"target": {
|
636
699
|
"name": "target",
|
700
|
+
"kind": "PortDeclaration",
|
637
701
|
"direction": "inout"
|
638
702
|
}
|
639
703
|
},
|
@@ -650,6 +714,7 @@ APPLY_TO_ALL = QuantumFunctionDeclaration.parse_raw(
|
|
650
714
|
"port_declarations": {
|
651
715
|
"target": {
|
652
716
|
"name": "target",
|
717
|
+
"kind": "PortDeclaration",
|
653
718
|
"direction": "inout"
|
654
719
|
}
|
655
720
|
},
|
@@ -662,9 +727,11 @@ APPLY_TO_ALL = QuantumFunctionDeclaration.parse_raw(
|
|
662
727
|
"size": {
|
663
728
|
"expr": "1"
|
664
729
|
},
|
730
|
+
"kind": "PortDeclaration",
|
665
731
|
"direction": "inout"
|
666
732
|
}
|
667
|
-
}
|
733
|
+
},
|
734
|
+
"kind": "QuantumOperandDeclaration"
|
668
735
|
}
|
669
736
|
},
|
670
737
|
"positional_arg_declarations": []
|
@@ -683,6 +750,7 @@ QFT_NO_SWAP = QuantumFunctionDeclaration.parse_raw(
|
|
683
750
|
"kind": "qvec",
|
684
751
|
"length": null
|
685
752
|
},
|
753
|
+
"kind": "PortDeclaration",
|
686
754
|
"direction": "inout"
|
687
755
|
}
|
688
756
|
},
|
@@ -694,6 +762,7 @@ QFT_NO_SWAP = QuantumFunctionDeclaration.parse_raw(
|
|
694
762
|
"kind": "qvec",
|
695
763
|
"length": null
|
696
764
|
},
|
765
|
+
"kind": "PortDeclaration",
|
697
766
|
"direction": "inout"
|
698
767
|
}
|
699
768
|
]
|
@@ -716,6 +785,7 @@ _CHECK_MSB = QuantumFunctionDeclaration.parse_raw(
|
|
716
785
|
"kind": "qvec",
|
717
786
|
"length": null
|
718
787
|
},
|
788
|
+
"kind": "PortDeclaration",
|
719
789
|
"direction": "inout"
|
720
790
|
},
|
721
791
|
"aux": {
|
@@ -723,12 +793,14 @@ _CHECK_MSB = QuantumFunctionDeclaration.parse_raw(
|
|
723
793
|
"quantum_type": {
|
724
794
|
"kind": "qbit"
|
725
795
|
},
|
796
|
+
"kind": "PortDeclaration",
|
726
797
|
"direction": "inout"
|
727
798
|
}
|
728
799
|
},
|
729
800
|
"operand_declarations": {},
|
730
801
|
"positional_arg_declarations": [
|
731
802
|
{
|
803
|
+
"kind": "ClassicalParameterDeclaration",
|
732
804
|
"name": "ref",
|
733
805
|
"classical_type": {
|
734
806
|
"kind": "int"
|
@@ -740,6 +812,7 @@ _CHECK_MSB = QuantumFunctionDeclaration.parse_raw(
|
|
740
812
|
"kind": "qvec",
|
741
813
|
"length": null
|
742
814
|
},
|
815
|
+
"kind": "PortDeclaration",
|
743
816
|
"direction": "inout"
|
744
817
|
},
|
745
818
|
{
|
@@ -747,6 +820,7 @@ _CHECK_MSB = QuantumFunctionDeclaration.parse_raw(
|
|
747
820
|
"quantum_type": {
|
748
821
|
"kind": "qbit"
|
749
822
|
},
|
823
|
+
"kind": "PortDeclaration",
|
750
824
|
"direction": "inout"
|
751
825
|
}
|
752
826
|
]
|
@@ -768,6 +842,7 @@ _CTRL_X = QuantumFunctionDeclaration.parse_raw(
|
|
768
842
|
"quantum_type": {
|
769
843
|
"kind": "qnum"
|
770
844
|
},
|
845
|
+
"kind": "PortDeclaration",
|
771
846
|
"direction": "inout"
|
772
847
|
},
|
773
848
|
"aux": {
|
@@ -775,12 +850,14 @@ _CTRL_X = QuantumFunctionDeclaration.parse_raw(
|
|
775
850
|
"quantum_type": {
|
776
851
|
"kind": "qbit"
|
777
852
|
},
|
853
|
+
"kind": "PortDeclaration",
|
778
854
|
"direction": "inout"
|
779
855
|
}
|
780
856
|
},
|
781
857
|
"operand_declarations": {},
|
782
858
|
"positional_arg_declarations": [
|
783
859
|
{
|
860
|
+
"kind": "ClassicalParameterDeclaration",
|
784
861
|
"name": "ref",
|
785
862
|
"classical_type": {
|
786
863
|
"kind": "int"
|
@@ -791,6 +868,7 @@ _CTRL_X = QuantumFunctionDeclaration.parse_raw(
|
|
791
868
|
"quantum_type": {
|
792
869
|
"kind": "qnum"
|
793
870
|
},
|
871
|
+
"kind": "PortDeclaration",
|
794
872
|
"direction": "inout"
|
795
873
|
},
|
796
874
|
{
|
@@ -798,6 +876,7 @@ _CTRL_X = QuantumFunctionDeclaration.parse_raw(
|
|
798
876
|
"quantum_type": {
|
799
877
|
"kind": "qbit"
|
800
878
|
},
|
879
|
+
"kind": "PortDeclaration",
|
801
880
|
"direction": "inout"
|
802
881
|
}
|
803
882
|
]
|
@@ -820,12 +899,14 @@ QFT_SPACE_ADD_CONST = QuantumFunctionDeclaration.parse_raw(
|
|
820
899
|
"kind": "qvec",
|
821
900
|
"length": null
|
822
901
|
},
|
902
|
+
"kind": "PortDeclaration",
|
823
903
|
"direction": "inout"
|
824
904
|
}
|
825
905
|
},
|
826
906
|
"operand_declarations": {},
|
827
907
|
"positional_arg_declarations": [
|
828
908
|
{
|
909
|
+
"kind": "ClassicalParameterDeclaration",
|
829
910
|
"name": "value",
|
830
911
|
"classical_type": {
|
831
912
|
"kind": "int"
|
@@ -837,6 +918,7 @@ QFT_SPACE_ADD_CONST = QuantumFunctionDeclaration.parse_raw(
|
|
837
918
|
"kind": "qvec",
|
838
919
|
"length": null
|
839
920
|
},
|
921
|
+
"kind": "PortDeclaration",
|
840
922
|
"direction": "inout"
|
841
923
|
}
|
842
924
|
]
|
@@ -862,6 +944,7 @@ CC_MODULAR_ADD = QuantumFunctionDeclaration.parse_raw(
|
|
862
944
|
"kind": "qvec",
|
863
945
|
"length": null
|
864
946
|
},
|
947
|
+
"kind": "PortDeclaration",
|
865
948
|
"direction": "inout"
|
866
949
|
},
|
867
950
|
"c1": {
|
@@ -869,6 +952,7 @@ CC_MODULAR_ADD = QuantumFunctionDeclaration.parse_raw(
|
|
869
952
|
"quantum_type": {
|
870
953
|
"kind": "qbit"
|
871
954
|
},
|
955
|
+
"kind": "PortDeclaration",
|
872
956
|
"direction": "inout"
|
873
957
|
},
|
874
958
|
"c2": {
|
@@ -876,6 +960,7 @@ CC_MODULAR_ADD = QuantumFunctionDeclaration.parse_raw(
|
|
876
960
|
"quantum_type": {
|
877
961
|
"kind": "qbit"
|
878
962
|
},
|
963
|
+
"kind": "PortDeclaration",
|
879
964
|
"direction": "inout"
|
880
965
|
},
|
881
966
|
"aux": {
|
@@ -883,18 +968,21 @@ CC_MODULAR_ADD = QuantumFunctionDeclaration.parse_raw(
|
|
883
968
|
"quantum_type": {
|
884
969
|
"kind": "qbit"
|
885
970
|
},
|
971
|
+
"kind": "PortDeclaration",
|
886
972
|
"direction": "inout"
|
887
973
|
}
|
888
974
|
},
|
889
975
|
"operand_declarations": {},
|
890
976
|
"positional_arg_declarations": [
|
891
977
|
{
|
978
|
+
"kind": "ClassicalParameterDeclaration",
|
892
979
|
"name": "n",
|
893
980
|
"classical_type": {
|
894
981
|
"kind": "int"
|
895
982
|
}
|
896
983
|
},
|
897
984
|
{
|
985
|
+
"kind": "ClassicalParameterDeclaration",
|
898
986
|
"name": "a",
|
899
987
|
"classical_type": {
|
900
988
|
"kind": "int"
|
@@ -906,6 +994,7 @@ CC_MODULAR_ADD = QuantumFunctionDeclaration.parse_raw(
|
|
906
994
|
"kind": "qvec",
|
907
995
|
"length": null
|
908
996
|
},
|
997
|
+
"kind": "PortDeclaration",
|
909
998
|
"direction": "inout"
|
910
999
|
},
|
911
1000
|
{
|
@@ -913,6 +1002,7 @@ CC_MODULAR_ADD = QuantumFunctionDeclaration.parse_raw(
|
|
913
1002
|
"quantum_type": {
|
914
1003
|
"kind": "qbit"
|
915
1004
|
},
|
1005
|
+
"kind": "PortDeclaration",
|
916
1006
|
"direction": "inout"
|
917
1007
|
},
|
918
1008
|
{
|
@@ -920,6 +1010,7 @@ CC_MODULAR_ADD = QuantumFunctionDeclaration.parse_raw(
|
|
920
1010
|
"quantum_type": {
|
921
1011
|
"kind": "qbit"
|
922
1012
|
},
|
1013
|
+
"kind": "PortDeclaration",
|
923
1014
|
"direction": "inout"
|
924
1015
|
},
|
925
1016
|
{
|
@@ -927,6 +1018,7 @@ CC_MODULAR_ADD = QuantumFunctionDeclaration.parse_raw(
|
|
927
1018
|
"quantum_type": {
|
928
1019
|
"kind": "qbit"
|
929
1020
|
},
|
1021
|
+
"kind": "PortDeclaration",
|
930
1022
|
"direction": "inout"
|
931
1023
|
}
|
932
1024
|
]
|
@@ -952,6 +1044,7 @@ C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
952
1044
|
"kind": "qvec",
|
953
1045
|
"length": null
|
954
1046
|
},
|
1047
|
+
"kind": "PortDeclaration",
|
955
1048
|
"direction": "inout"
|
956
1049
|
},
|
957
1050
|
"x": {
|
@@ -960,6 +1053,7 @@ C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
960
1053
|
"kind": "qvec",
|
961
1054
|
"length": null
|
962
1055
|
},
|
1056
|
+
"kind": "PortDeclaration",
|
963
1057
|
"direction": "inout"
|
964
1058
|
},
|
965
1059
|
"ctrl": {
|
@@ -967,6 +1061,7 @@ C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
967
1061
|
"quantum_type": {
|
968
1062
|
"kind": "qbit"
|
969
1063
|
},
|
1064
|
+
"kind": "PortDeclaration",
|
970
1065
|
"direction": "inout"
|
971
1066
|
},
|
972
1067
|
"aux": {
|
@@ -974,18 +1069,21 @@ C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
974
1069
|
"quantum_type": {
|
975
1070
|
"kind": "qbit"
|
976
1071
|
},
|
1072
|
+
"kind": "PortDeclaration",
|
977
1073
|
"direction": "inout"
|
978
1074
|
}
|
979
1075
|
},
|
980
1076
|
"operand_declarations": {},
|
981
1077
|
"positional_arg_declarations": [
|
982
1078
|
{
|
1079
|
+
"kind": "ClassicalParameterDeclaration",
|
983
1080
|
"name": "n",
|
984
1081
|
"classical_type": {
|
985
1082
|
"kind": "int"
|
986
1083
|
}
|
987
1084
|
},
|
988
1085
|
{
|
1086
|
+
"kind": "ClassicalParameterDeclaration",
|
989
1087
|
"name": "a",
|
990
1088
|
"classical_type": {
|
991
1089
|
"kind": "int"
|
@@ -997,6 +1095,7 @@ C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
997
1095
|
"kind": "qvec",
|
998
1096
|
"length": null
|
999
1097
|
},
|
1098
|
+
"kind": "PortDeclaration",
|
1000
1099
|
"direction": "inout"
|
1001
1100
|
},
|
1002
1101
|
{
|
@@ -1005,6 +1104,7 @@ C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
1005
1104
|
"kind": "qvec",
|
1006
1105
|
"length": null
|
1007
1106
|
},
|
1107
|
+
"kind": "PortDeclaration",
|
1008
1108
|
"direction": "inout"
|
1009
1109
|
},
|
1010
1110
|
{
|
@@ -1012,6 +1112,7 @@ C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
1012
1112
|
"quantum_type": {
|
1013
1113
|
"kind": "qbit"
|
1014
1114
|
},
|
1115
|
+
"kind": "PortDeclaration",
|
1015
1116
|
"direction": "inout"
|
1016
1117
|
},
|
1017
1118
|
{
|
@@ -1019,6 +1120,7 @@ C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
1019
1120
|
"quantum_type": {
|
1020
1121
|
"kind": "qbit"
|
1021
1122
|
},
|
1123
|
+
"kind": "PortDeclaration",
|
1022
1124
|
"direction": "inout"
|
1023
1125
|
}
|
1024
1126
|
]
|
@@ -1037,6 +1139,7 @@ MULTISWAP = QuantumFunctionDeclaration.parse_raw(
|
|
1037
1139
|
"kind": "qvec",
|
1038
1140
|
"length": null
|
1039
1141
|
},
|
1142
|
+
"kind": "PortDeclaration",
|
1040
1143
|
"direction": "inout"
|
1041
1144
|
},
|
1042
1145
|
"y": {
|
@@ -1045,6 +1148,7 @@ MULTISWAP = QuantumFunctionDeclaration.parse_raw(
|
|
1045
1148
|
"kind": "qvec",
|
1046
1149
|
"length": null
|
1047
1150
|
},
|
1151
|
+
"kind": "PortDeclaration",
|
1048
1152
|
"direction": "inout"
|
1049
1153
|
}
|
1050
1154
|
},
|
@@ -1056,6 +1160,7 @@ MULTISWAP = QuantumFunctionDeclaration.parse_raw(
|
|
1056
1160
|
"kind": "qvec",
|
1057
1161
|
"length": null
|
1058
1162
|
},
|
1163
|
+
"kind": "PortDeclaration",
|
1059
1164
|
"direction": "inout"
|
1060
1165
|
},
|
1061
1166
|
{
|
@@ -1064,6 +1169,7 @@ MULTISWAP = QuantumFunctionDeclaration.parse_raw(
|
|
1064
1169
|
"kind": "qvec",
|
1065
1170
|
"length": null
|
1066
1171
|
},
|
1172
|
+
"kind": "PortDeclaration",
|
1067
1173
|
"direction": "inout"
|
1068
1174
|
}
|
1069
1175
|
]
|
@@ -1089,6 +1195,7 @@ INPLACE_C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
1089
1195
|
"kind": "qvec",
|
1090
1196
|
"length": null
|
1091
1197
|
},
|
1198
|
+
"kind": "PortDeclaration",
|
1092
1199
|
"direction": "inout"
|
1093
1200
|
},
|
1094
1201
|
"ctrl": {
|
@@ -1096,6 +1203,7 @@ INPLACE_C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
1096
1203
|
"quantum_type": {
|
1097
1204
|
"kind": "qbit"
|
1098
1205
|
},
|
1206
|
+
"kind": "PortDeclaration",
|
1099
1207
|
"direction": "inout"
|
1100
1208
|
},
|
1101
1209
|
"aux": {
|
@@ -1103,18 +1211,21 @@ INPLACE_C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
1103
1211
|
"quantum_type": {
|
1104
1212
|
"kind": "qbit"
|
1105
1213
|
},
|
1214
|
+
"kind": "PortDeclaration",
|
1106
1215
|
"direction": "inout"
|
1107
1216
|
}
|
1108
1217
|
},
|
1109
1218
|
"operand_declarations": {},
|
1110
1219
|
"positional_arg_declarations": [
|
1111
1220
|
{
|
1221
|
+
"kind": "ClassicalParameterDeclaration",
|
1112
1222
|
"name": "n",
|
1113
1223
|
"classical_type": {
|
1114
1224
|
"kind": "int"
|
1115
1225
|
}
|
1116
1226
|
},
|
1117
1227
|
{
|
1228
|
+
"kind": "ClassicalParameterDeclaration",
|
1118
1229
|
"name": "a",
|
1119
1230
|
"classical_type": {
|
1120
1231
|
"kind": "int"
|
@@ -1126,6 +1237,7 @@ INPLACE_C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
1126
1237
|
"kind": "qvec",
|
1127
1238
|
"length": null
|
1128
1239
|
},
|
1240
|
+
"kind": "PortDeclaration",
|
1129
1241
|
"direction": "inout"
|
1130
1242
|
},
|
1131
1243
|
{
|
@@ -1133,6 +1245,7 @@ INPLACE_C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
1133
1245
|
"quantum_type": {
|
1134
1246
|
"kind": "qbit"
|
1135
1247
|
},
|
1248
|
+
"kind": "PortDeclaration",
|
1136
1249
|
"direction": "inout"
|
1137
1250
|
},
|
1138
1251
|
{
|
@@ -1140,6 +1253,7 @@ INPLACE_C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
|
1140
1253
|
"quantum_type": {
|
1141
1254
|
"kind": "qbit"
|
1142
1255
|
},
|
1256
|
+
"kind": "PortDeclaration",
|
1143
1257
|
"direction": "inout"
|
1144
1258
|
}
|
1145
1259
|
]
|
@@ -1165,6 +1279,7 @@ MODULAR_EXP = QuantumFunctionDeclaration.parse_raw(
|
|
1165
1279
|
"kind": "qvec",
|
1166
1280
|
"length": null
|
1167
1281
|
},
|
1282
|
+
"kind": "PortDeclaration",
|
1168
1283
|
"direction": "inout"
|
1169
1284
|
},
|
1170
1285
|
"power": {
|
@@ -1173,18 +1288,21 @@ MODULAR_EXP = QuantumFunctionDeclaration.parse_raw(
|
|
1173
1288
|
"kind": "qvec",
|
1174
1289
|
"length": null
|
1175
1290
|
},
|
1291
|
+
"kind": "PortDeclaration",
|
1176
1292
|
"direction": "inout"
|
1177
1293
|
}
|
1178
1294
|
},
|
1179
1295
|
"operand_declarations": {},
|
1180
1296
|
"positional_arg_declarations": [
|
1181
1297
|
{
|
1298
|
+
"kind": "ClassicalParameterDeclaration",
|
1182
1299
|
"name": "n",
|
1183
1300
|
"classical_type": {
|
1184
1301
|
"kind": "int"
|
1185
1302
|
}
|
1186
1303
|
},
|
1187
1304
|
{
|
1305
|
+
"kind": "ClassicalParameterDeclaration",
|
1188
1306
|
"name": "a",
|
1189
1307
|
"classical_type": {
|
1190
1308
|
"kind": "int"
|
@@ -1196,6 +1314,7 @@ MODULAR_EXP = QuantumFunctionDeclaration.parse_raw(
|
|
1196
1314
|
"kind": "qvec",
|
1197
1315
|
"length": null
|
1198
1316
|
},
|
1317
|
+
"kind": "PortDeclaration",
|
1199
1318
|
"direction": "inout"
|
1200
1319
|
},
|
1201
1320
|
{
|
@@ -1204,6 +1323,655 @@ MODULAR_EXP = QuantumFunctionDeclaration.parse_raw(
|
|
1204
1323
|
"kind": "qvec",
|
1205
1324
|
"length": null
|
1206
1325
|
},
|
1326
|
+
"kind": "PortDeclaration",
|
1327
|
+
"direction": "inout"
|
1328
|
+
}
|
1329
|
+
]
|
1330
|
+
}"""
|
1331
|
+
)
|
1332
|
+
|
1333
|
+
QSVT_STEP = QuantumFunctionDeclaration.parse_raw(
|
1334
|
+
"""{
|
1335
|
+
"source_ref": null,
|
1336
|
+
"name": "qsvt_step",
|
1337
|
+
"param_decls": {
|
1338
|
+
"phase_seq": {
|
1339
|
+
"kind": "list",
|
1340
|
+
"element_type": {
|
1341
|
+
"kind": "real"
|
1342
|
+
}
|
1343
|
+
},
|
1344
|
+
"index": {
|
1345
|
+
"kind": "int"
|
1346
|
+
}
|
1347
|
+
},
|
1348
|
+
"port_declarations": {
|
1349
|
+
"qvar": {
|
1350
|
+
"name": "qvar",
|
1351
|
+
"quantum_type": {
|
1352
|
+
"kind": "qvec",
|
1353
|
+
"length": null
|
1354
|
+
},
|
1355
|
+
"kind": "PortDeclaration",
|
1356
|
+
"direction": "inout"
|
1357
|
+
},
|
1358
|
+
"aux": {
|
1359
|
+
"name": "aux",
|
1360
|
+
"quantum_type": {
|
1361
|
+
"kind": "qbit"
|
1362
|
+
},
|
1363
|
+
"kind": "PortDeclaration",
|
1364
|
+
"direction": "inout"
|
1365
|
+
}
|
1366
|
+
},
|
1367
|
+
"operand_declarations": {
|
1368
|
+
"proj_cnot_1": {
|
1369
|
+
"name": "proj_cnot_1",
|
1370
|
+
"positional_arg_declarations": [
|
1371
|
+
{
|
1372
|
+
"name": "arg0",
|
1373
|
+
"quantum_type": {
|
1374
|
+
"kind": "qvec",
|
1375
|
+
"length": null
|
1376
|
+
},
|
1377
|
+
"kind": "PortDeclaration",
|
1378
|
+
"direction": "inout"
|
1379
|
+
},
|
1380
|
+
{
|
1381
|
+
"name": "arg1",
|
1382
|
+
"quantum_type": {
|
1383
|
+
"kind": "qbit"
|
1384
|
+
},
|
1385
|
+
"kind": "PortDeclaration",
|
1386
|
+
"direction": "inout"
|
1387
|
+
}
|
1388
|
+
],
|
1389
|
+
"kind": "QuantumOperandDeclaration",
|
1390
|
+
"is_list": false
|
1391
|
+
},
|
1392
|
+
"proj_cnot_2": {
|
1393
|
+
"name": "proj_cnot_2",
|
1394
|
+
"positional_arg_declarations": [
|
1395
|
+
{
|
1396
|
+
"name": "arg0",
|
1397
|
+
"quantum_type": {
|
1398
|
+
"kind": "qvec",
|
1399
|
+
"length": null
|
1400
|
+
},
|
1401
|
+
"kind": "PortDeclaration",
|
1402
|
+
"direction": "inout"
|
1403
|
+
},
|
1404
|
+
{
|
1405
|
+
"name": "arg1",
|
1406
|
+
"quantum_type": {
|
1407
|
+
"kind": "qbit"
|
1408
|
+
},
|
1409
|
+
"kind": "PortDeclaration",
|
1410
|
+
"direction": "inout"
|
1411
|
+
}
|
1412
|
+
],
|
1413
|
+
"kind": "QuantumOperandDeclaration",
|
1414
|
+
"is_list": false
|
1415
|
+
},
|
1416
|
+
"u": {
|
1417
|
+
"name": "u",
|
1418
|
+
"positional_arg_declarations": [
|
1419
|
+
{
|
1420
|
+
"name": "arg0",
|
1421
|
+
"quantum_type": {
|
1422
|
+
"kind": "qvec",
|
1423
|
+
"length": null
|
1424
|
+
},
|
1425
|
+
"kind": "PortDeclaration",
|
1426
|
+
"direction": "inout"
|
1427
|
+
}
|
1428
|
+
],
|
1429
|
+
"kind": "QuantumOperandDeclaration",
|
1430
|
+
"is_list": false
|
1431
|
+
}
|
1432
|
+
},
|
1433
|
+
"positional_arg_declarations": [
|
1434
|
+
{
|
1435
|
+
"kind": "ClassicalParameterDeclaration",
|
1436
|
+
"name": "phase_seq",
|
1437
|
+
"classical_type": {
|
1438
|
+
"kind": "list",
|
1439
|
+
"element_type": {
|
1440
|
+
"kind": "real"
|
1441
|
+
}
|
1442
|
+
}
|
1443
|
+
},
|
1444
|
+
{
|
1445
|
+
"kind": "ClassicalParameterDeclaration",
|
1446
|
+
"name": "index",
|
1447
|
+
"classical_type": {
|
1448
|
+
"kind": "int"
|
1449
|
+
}
|
1450
|
+
},
|
1451
|
+
{
|
1452
|
+
"name": "proj_cnot_1",
|
1453
|
+
"positional_arg_declarations": [
|
1454
|
+
{
|
1455
|
+
"name": "arg0",
|
1456
|
+
"quantum_type": {
|
1457
|
+
"kind": "qvec",
|
1458
|
+
"length": null
|
1459
|
+
},
|
1460
|
+
"kind": "PortDeclaration",
|
1461
|
+
"direction": "inout"
|
1462
|
+
},
|
1463
|
+
{
|
1464
|
+
"name": "arg1",
|
1465
|
+
"quantum_type": {
|
1466
|
+
"kind": "qbit"
|
1467
|
+
},
|
1468
|
+
"kind": "PortDeclaration",
|
1469
|
+
"direction": "inout"
|
1470
|
+
}
|
1471
|
+
],
|
1472
|
+
"kind": "QuantumOperandDeclaration",
|
1473
|
+
"is_list": false
|
1474
|
+
},
|
1475
|
+
{
|
1476
|
+
"name": "proj_cnot_2",
|
1477
|
+
"positional_arg_declarations": [
|
1478
|
+
{
|
1479
|
+
"name": "arg0",
|
1480
|
+
"quantum_type": {
|
1481
|
+
"kind": "qvec",
|
1482
|
+
"length": null
|
1483
|
+
},
|
1484
|
+
"kind": "PortDeclaration",
|
1485
|
+
"direction": "inout"
|
1486
|
+
},
|
1487
|
+
{
|
1488
|
+
"name": "arg1",
|
1489
|
+
"quantum_type": {
|
1490
|
+
"kind": "qbit"
|
1491
|
+
},
|
1492
|
+
"kind": "PortDeclaration",
|
1493
|
+
"direction": "inout"
|
1494
|
+
}
|
1495
|
+
],
|
1496
|
+
"kind": "QuantumOperandDeclaration",
|
1497
|
+
"is_list": false
|
1498
|
+
},
|
1499
|
+
{
|
1500
|
+
"name": "u",
|
1501
|
+
"positional_arg_declarations": [
|
1502
|
+
{
|
1503
|
+
"name": "arg0",
|
1504
|
+
"quantum_type": {
|
1505
|
+
"kind": "qvec",
|
1506
|
+
"length": null
|
1507
|
+
},
|
1508
|
+
"kind": "PortDeclaration",
|
1509
|
+
"direction": "inout"
|
1510
|
+
}
|
1511
|
+
],
|
1512
|
+
"kind": "QuantumOperandDeclaration",
|
1513
|
+
"is_list": false
|
1514
|
+
},
|
1515
|
+
{
|
1516
|
+
"name": "qvar",
|
1517
|
+
"quantum_type": {
|
1518
|
+
"kind": "qvec",
|
1519
|
+
"length": null
|
1520
|
+
},
|
1521
|
+
"kind": "PortDeclaration",
|
1522
|
+
"direction": "inout"
|
1523
|
+
},
|
1524
|
+
{
|
1525
|
+
"name": "aux",
|
1526
|
+
"quantum_type": {
|
1527
|
+
"kind": "qbit"
|
1528
|
+
},
|
1529
|
+
"kind": "PortDeclaration",
|
1530
|
+
"direction": "inout"
|
1531
|
+
}
|
1532
|
+
]
|
1533
|
+
}"""
|
1534
|
+
)
|
1535
|
+
|
1536
|
+
QSVT = QuantumFunctionDeclaration.parse_raw(
|
1537
|
+
"""{
|
1538
|
+
"source_ref": null,
|
1539
|
+
"name": "qsvt",
|
1540
|
+
"param_decls": {
|
1541
|
+
"phase_seq": {
|
1542
|
+
"kind": "list",
|
1543
|
+
"element_type": {
|
1544
|
+
"kind": "real"
|
1545
|
+
}
|
1546
|
+
}
|
1547
|
+
},
|
1548
|
+
"port_declarations": {
|
1549
|
+
"qvar": {
|
1550
|
+
"name": "qvar",
|
1551
|
+
"quantum_type": {
|
1552
|
+
"kind": "qvec",
|
1553
|
+
"length": null
|
1554
|
+
},
|
1555
|
+
"kind": "PortDeclaration",
|
1556
|
+
"direction": "inout"
|
1557
|
+
},
|
1558
|
+
"aux": {
|
1559
|
+
"name": "aux",
|
1560
|
+
"quantum_type": {
|
1561
|
+
"kind": "qbit"
|
1562
|
+
},
|
1563
|
+
"kind": "PortDeclaration",
|
1564
|
+
"direction": "inout"
|
1565
|
+
}
|
1566
|
+
},
|
1567
|
+
"operand_declarations": {
|
1568
|
+
"proj_cnot_1": {
|
1569
|
+
"name": "proj_cnot_1",
|
1570
|
+
"positional_arg_declarations": [
|
1571
|
+
{
|
1572
|
+
"name": "arg0",
|
1573
|
+
"quantum_type": {
|
1574
|
+
"kind": "qvec",
|
1575
|
+
"length": null
|
1576
|
+
},
|
1577
|
+
"kind": "PortDeclaration",
|
1578
|
+
"direction": "inout"
|
1579
|
+
},
|
1580
|
+
{
|
1581
|
+
"name": "arg1",
|
1582
|
+
"quantum_type": {
|
1583
|
+
"kind": "qbit"
|
1584
|
+
},
|
1585
|
+
"kind": "PortDeclaration",
|
1586
|
+
"direction": "inout"
|
1587
|
+
}
|
1588
|
+
],
|
1589
|
+
"kind": "QuantumOperandDeclaration",
|
1590
|
+
"is_list": false
|
1591
|
+
},
|
1592
|
+
"proj_cnot_2": {
|
1593
|
+
"name": "proj_cnot_2",
|
1594
|
+
"positional_arg_declarations": [
|
1595
|
+
{
|
1596
|
+
"name": "arg0",
|
1597
|
+
"quantum_type": {
|
1598
|
+
"kind": "qvec",
|
1599
|
+
"length": null
|
1600
|
+
},
|
1601
|
+
"kind": "PortDeclaration",
|
1602
|
+
"direction": "inout"
|
1603
|
+
},
|
1604
|
+
{
|
1605
|
+
"name": "arg1",
|
1606
|
+
"quantum_type": {
|
1607
|
+
"kind": "qbit"
|
1608
|
+
},
|
1609
|
+
"kind": "PortDeclaration",
|
1610
|
+
"direction": "inout"
|
1611
|
+
}
|
1612
|
+
],
|
1613
|
+
"kind": "QuantumOperandDeclaration",
|
1614
|
+
"is_list": false
|
1615
|
+
},
|
1616
|
+
"u": {
|
1617
|
+
"name": "u",
|
1618
|
+
"positional_arg_declarations": [
|
1619
|
+
{
|
1620
|
+
"name": "arg0",
|
1621
|
+
"quantum_type": {
|
1622
|
+
"kind": "qvec",
|
1623
|
+
"length": null
|
1624
|
+
},
|
1625
|
+
"kind": "PortDeclaration",
|
1626
|
+
"direction": "inout"
|
1627
|
+
}
|
1628
|
+
],
|
1629
|
+
"kind": "QuantumOperandDeclaration",
|
1630
|
+
"is_list": false
|
1631
|
+
}
|
1632
|
+
},
|
1633
|
+
"positional_arg_declarations": [
|
1634
|
+
{
|
1635
|
+
"kind": "ClassicalParameterDeclaration",
|
1636
|
+
"name": "phase_seq",
|
1637
|
+
"classical_type": {
|
1638
|
+
"kind": "list",
|
1639
|
+
"element_type": {
|
1640
|
+
"kind": "real"
|
1641
|
+
}
|
1642
|
+
}
|
1643
|
+
},
|
1644
|
+
{
|
1645
|
+
"name": "proj_cnot_1",
|
1646
|
+
"positional_arg_declarations": [
|
1647
|
+
{
|
1648
|
+
"name": "arg0",
|
1649
|
+
"quantum_type": {
|
1650
|
+
"kind": "qvec",
|
1651
|
+
"length": null
|
1652
|
+
},
|
1653
|
+
"kind": "PortDeclaration",
|
1654
|
+
"direction": "inout"
|
1655
|
+
},
|
1656
|
+
{
|
1657
|
+
"name": "arg1",
|
1658
|
+
"quantum_type": {
|
1659
|
+
"kind": "qbit"
|
1660
|
+
},
|
1661
|
+
"kind": "PortDeclaration",
|
1662
|
+
"direction": "inout"
|
1663
|
+
}
|
1664
|
+
],
|
1665
|
+
"kind": "QuantumOperandDeclaration",
|
1666
|
+
"is_list": false
|
1667
|
+
},
|
1668
|
+
{
|
1669
|
+
"name": "proj_cnot_2",
|
1670
|
+
"positional_arg_declarations": [
|
1671
|
+
{
|
1672
|
+
"name": "arg0",
|
1673
|
+
"quantum_type": {
|
1674
|
+
"kind": "qvec",
|
1675
|
+
"length": null
|
1676
|
+
},
|
1677
|
+
"kind": "PortDeclaration",
|
1678
|
+
"direction": "inout"
|
1679
|
+
},
|
1680
|
+
{
|
1681
|
+
"name": "arg1",
|
1682
|
+
"quantum_type": {
|
1683
|
+
"kind": "qbit"
|
1684
|
+
},
|
1685
|
+
"kind": "PortDeclaration",
|
1686
|
+
"direction": "inout"
|
1687
|
+
}
|
1688
|
+
],
|
1689
|
+
"kind": "QuantumOperandDeclaration",
|
1690
|
+
"is_list": false
|
1691
|
+
},
|
1692
|
+
{
|
1693
|
+
"name": "u",
|
1694
|
+
"positional_arg_declarations": [
|
1695
|
+
{
|
1696
|
+
"name": "arg0",
|
1697
|
+
"quantum_type": {
|
1698
|
+
"kind": "qvec",
|
1699
|
+
"length": null
|
1700
|
+
},
|
1701
|
+
"kind": "PortDeclaration",
|
1702
|
+
"direction": "inout"
|
1703
|
+
}
|
1704
|
+
],
|
1705
|
+
"kind": "QuantumOperandDeclaration",
|
1706
|
+
"is_list": false
|
1707
|
+
},
|
1708
|
+
{
|
1709
|
+
"name": "qvar",
|
1710
|
+
"quantum_type": {
|
1711
|
+
"kind": "qvec",
|
1712
|
+
"length": null
|
1713
|
+
},
|
1714
|
+
"kind": "PortDeclaration",
|
1715
|
+
"direction": "inout"
|
1716
|
+
},
|
1717
|
+
{
|
1718
|
+
"name": "aux",
|
1719
|
+
"quantum_type": {
|
1720
|
+
"kind": "qbit"
|
1721
|
+
},
|
1722
|
+
"kind": "PortDeclaration",
|
1723
|
+
"direction": "inout"
|
1724
|
+
}
|
1725
|
+
]
|
1726
|
+
}"""
|
1727
|
+
)
|
1728
|
+
|
1729
|
+
PROJECTOR_CONTROLLED_PHASE = QuantumFunctionDeclaration.parse_raw(
|
1730
|
+
"""{
|
1731
|
+
"source_ref": null,
|
1732
|
+
"name": "projector_controlled_phase",
|
1733
|
+
"param_decls": {
|
1734
|
+
"phase": {
|
1735
|
+
"kind": "real"
|
1736
|
+
}
|
1737
|
+
},
|
1738
|
+
"port_declarations": {
|
1739
|
+
"qvar": {
|
1740
|
+
"name": "qvar",
|
1741
|
+
"quantum_type": {
|
1742
|
+
"kind": "qvec",
|
1743
|
+
"length": null
|
1744
|
+
},
|
1745
|
+
"kind": "PortDeclaration",
|
1746
|
+
"direction": "inout"
|
1747
|
+
},
|
1748
|
+
"aux": {
|
1749
|
+
"name": "aux",
|
1750
|
+
"quantum_type": {
|
1751
|
+
"kind": "qbit"
|
1752
|
+
},
|
1753
|
+
"kind": "PortDeclaration",
|
1754
|
+
"direction": "inout"
|
1755
|
+
}
|
1756
|
+
},
|
1757
|
+
"operand_declarations": {
|
1758
|
+
"proj_cnot": {
|
1759
|
+
"name": "proj_cnot",
|
1760
|
+
"positional_arg_declarations": [
|
1761
|
+
{
|
1762
|
+
"name": "arg0",
|
1763
|
+
"quantum_type": {
|
1764
|
+
"kind": "qvec",
|
1765
|
+
"length": null
|
1766
|
+
},
|
1767
|
+
"kind": "PortDeclaration",
|
1768
|
+
"direction": "inout"
|
1769
|
+
},
|
1770
|
+
{
|
1771
|
+
"name": "arg1",
|
1772
|
+
"quantum_type": {
|
1773
|
+
"kind": "qbit"
|
1774
|
+
},
|
1775
|
+
"kind": "PortDeclaration",
|
1776
|
+
"direction": "inout"
|
1777
|
+
}
|
1778
|
+
],
|
1779
|
+
"kind": "QuantumOperandDeclaration",
|
1780
|
+
"is_list": false
|
1781
|
+
}
|
1782
|
+
},
|
1783
|
+
"positional_arg_declarations": [
|
1784
|
+
{
|
1785
|
+
"kind": "ClassicalParameterDeclaration",
|
1786
|
+
"name": "phase",
|
1787
|
+
"classical_type": {
|
1788
|
+
"kind": "real"
|
1789
|
+
}
|
1790
|
+
},
|
1791
|
+
{
|
1792
|
+
"name": "proj_cnot",
|
1793
|
+
"positional_arg_declarations": [
|
1794
|
+
{
|
1795
|
+
"name": "arg0",
|
1796
|
+
"quantum_type": {
|
1797
|
+
"kind": "qvec",
|
1798
|
+
"length": null
|
1799
|
+
},
|
1800
|
+
"kind": "PortDeclaration",
|
1801
|
+
"direction": "inout"
|
1802
|
+
},
|
1803
|
+
{
|
1804
|
+
"name": "arg1",
|
1805
|
+
"quantum_type": {
|
1806
|
+
"kind": "qbit"
|
1807
|
+
},
|
1808
|
+
"kind": "PortDeclaration",
|
1809
|
+
"direction": "inout"
|
1810
|
+
}
|
1811
|
+
],
|
1812
|
+
"kind": "QuantumOperandDeclaration",
|
1813
|
+
"is_list": false
|
1814
|
+
},
|
1815
|
+
{
|
1816
|
+
"name": "qvar",
|
1817
|
+
"quantum_type": {
|
1818
|
+
"kind": "qvec",
|
1819
|
+
"length": null
|
1820
|
+
},
|
1821
|
+
"kind": "PortDeclaration",
|
1822
|
+
"direction": "inout"
|
1823
|
+
},
|
1824
|
+
{
|
1825
|
+
"name": "aux",
|
1826
|
+
"quantum_type": {
|
1827
|
+
"kind": "qbit"
|
1828
|
+
},
|
1829
|
+
"kind": "PortDeclaration",
|
1830
|
+
"direction": "inout"
|
1831
|
+
}
|
1832
|
+
]
|
1833
|
+
}"""
|
1834
|
+
)
|
1835
|
+
|
1836
|
+
QSVT_INVERSION = QuantumFunctionDeclaration.parse_raw(
|
1837
|
+
"""{
|
1838
|
+
"source_ref": null,
|
1839
|
+
"name": "qsvt_inversion",
|
1840
|
+
"param_decls": {
|
1841
|
+
"phase_seq": {
|
1842
|
+
"kind": "list",
|
1843
|
+
"element_type": {
|
1844
|
+
"kind": "real"
|
1845
|
+
}
|
1846
|
+
}
|
1847
|
+
},
|
1848
|
+
"port_declarations": {
|
1849
|
+
"qvar": {
|
1850
|
+
"name": "qvar",
|
1851
|
+
"quantum_type": {
|
1852
|
+
"kind": "qvec",
|
1853
|
+
"length": null
|
1854
|
+
},
|
1855
|
+
"kind": "PortDeclaration",
|
1856
|
+
"direction": "inout"
|
1857
|
+
},
|
1858
|
+
"aux": {
|
1859
|
+
"name": "aux",
|
1860
|
+
"quantum_type": {
|
1861
|
+
"kind": "qbit"
|
1862
|
+
},
|
1863
|
+
"kind": "PortDeclaration",
|
1864
|
+
"direction": "inout"
|
1865
|
+
}
|
1866
|
+
},
|
1867
|
+
"operand_declarations": {
|
1868
|
+
"block_encoding_cnot": {
|
1869
|
+
"name": "block_encoding_cnot",
|
1870
|
+
"positional_arg_declarations": [
|
1871
|
+
{
|
1872
|
+
"name": "arg0",
|
1873
|
+
"quantum_type": {
|
1874
|
+
"kind": "qvec",
|
1875
|
+
"length": null
|
1876
|
+
},
|
1877
|
+
"kind": "PortDeclaration",
|
1878
|
+
"direction": "inout"
|
1879
|
+
},
|
1880
|
+
{
|
1881
|
+
"name": "arg1",
|
1882
|
+
"quantum_type": {
|
1883
|
+
"kind": "qbit"
|
1884
|
+
},
|
1885
|
+
"kind": "PortDeclaration",
|
1886
|
+
"direction": "inout"
|
1887
|
+
}
|
1888
|
+
],
|
1889
|
+
"kind": "QuantumOperandDeclaration",
|
1890
|
+
"is_list": false
|
1891
|
+
},
|
1892
|
+
"u": {
|
1893
|
+
"name": "u",
|
1894
|
+
"positional_arg_declarations": [
|
1895
|
+
{
|
1896
|
+
"name": "arg0",
|
1897
|
+
"quantum_type": {
|
1898
|
+
"kind": "qvec",
|
1899
|
+
"length": null
|
1900
|
+
},
|
1901
|
+
"kind": "PortDeclaration",
|
1902
|
+
"direction": "inout"
|
1903
|
+
}
|
1904
|
+
],
|
1905
|
+
"kind": "QuantumOperandDeclaration",
|
1906
|
+
"is_list": false
|
1907
|
+
}
|
1908
|
+
},
|
1909
|
+
"positional_arg_declarations": [
|
1910
|
+
{
|
1911
|
+
"kind": "ClassicalParameterDeclaration",
|
1912
|
+
"name": "phase_seq",
|
1913
|
+
"classical_type": {
|
1914
|
+
"kind": "list",
|
1915
|
+
"element_type": {
|
1916
|
+
"kind": "real"
|
1917
|
+
}
|
1918
|
+
}
|
1919
|
+
},
|
1920
|
+
{
|
1921
|
+
"name": "block_encoding_cnot",
|
1922
|
+
"positional_arg_declarations": [
|
1923
|
+
{
|
1924
|
+
"name": "arg0",
|
1925
|
+
"quantum_type": {
|
1926
|
+
"kind": "qvec",
|
1927
|
+
"length": null
|
1928
|
+
},
|
1929
|
+
"kind": "PortDeclaration",
|
1930
|
+
"direction": "inout"
|
1931
|
+
},
|
1932
|
+
{
|
1933
|
+
"name": "arg1",
|
1934
|
+
"quantum_type": {
|
1935
|
+
"kind": "qbit"
|
1936
|
+
},
|
1937
|
+
"kind": "PortDeclaration",
|
1938
|
+
"direction": "inout"
|
1939
|
+
}
|
1940
|
+
],
|
1941
|
+
"kind": "QuantumOperandDeclaration",
|
1942
|
+
"is_list": false
|
1943
|
+
},
|
1944
|
+
{
|
1945
|
+
"name": "u",
|
1946
|
+
"positional_arg_declarations": [
|
1947
|
+
{
|
1948
|
+
"name": "arg0",
|
1949
|
+
"quantum_type": {
|
1950
|
+
"kind": "qvec",
|
1951
|
+
"length": null
|
1952
|
+
},
|
1953
|
+
"kind": "PortDeclaration",
|
1954
|
+
"direction": "inout"
|
1955
|
+
}
|
1956
|
+
],
|
1957
|
+
"kind": "QuantumOperandDeclaration",
|
1958
|
+
"is_list": false
|
1959
|
+
},
|
1960
|
+
{
|
1961
|
+
"name": "qvar",
|
1962
|
+
"quantum_type": {
|
1963
|
+
"kind": "qvec",
|
1964
|
+
"length": null
|
1965
|
+
},
|
1966
|
+
"kind": "PortDeclaration",
|
1967
|
+
"direction": "inout"
|
1968
|
+
},
|
1969
|
+
{
|
1970
|
+
"name": "aux",
|
1971
|
+
"quantum_type": {
|
1972
|
+
"kind": "qbit"
|
1973
|
+
},
|
1974
|
+
"kind": "PortDeclaration",
|
1207
1975
|
"direction": "inout"
|
1208
1976
|
}
|
1209
1977
|
]
|
@@ -1240,6 +2008,7 @@ ALLOCATE_NUM = QuantumFunctionDeclaration.parse_raw(
|
|
1240
2008
|
"expr": "fraction_digits"
|
1241
2009
|
}
|
1242
2010
|
},
|
2011
|
+
"kind": "PortDeclaration",
|
1243
2012
|
"direction": "output"
|
1244
2013
|
}
|
1245
2014
|
},
|
@@ -1260,6 +2029,7 @@ QAOA_MIXER_LAYER = QuantumFunctionDeclaration.parse_raw(
|
|
1260
2029
|
"port_declarations": {
|
1261
2030
|
"target": {
|
1262
2031
|
"name": "target",
|
2032
|
+
"kind": "PortDeclaration",
|
1263
2033
|
"direction": "inout"
|
1264
2034
|
}
|
1265
2035
|
},
|
@@ -1287,6 +2057,7 @@ QAOA_COST_LAYER = QuantumFunctionDeclaration.parse_raw(
|
|
1287
2057
|
"port_declarations": {
|
1288
2058
|
"target": {
|
1289
2059
|
"name": "target",
|
2060
|
+
"kind": "PortDeclaration",
|
1290
2061
|
"direction": "inout"
|
1291
2062
|
}
|
1292
2063
|
},
|
@@ -1317,6 +2088,7 @@ QAOA_LAYER = QuantumFunctionDeclaration.parse_raw(
|
|
1317
2088
|
"port_declarations": {
|
1318
2089
|
"target": {
|
1319
2090
|
"name": "target",
|
2091
|
+
"kind": "PortDeclaration",
|
1320
2092
|
"direction": "inout"
|
1321
2093
|
}
|
1322
2094
|
},
|
@@ -1333,6 +2105,7 @@ QAOA_INIT = QuantumFunctionDeclaration.parse_raw(
|
|
1333
2105
|
"port_declarations": {
|
1334
2106
|
"target": {
|
1335
2107
|
"name": "target",
|
2108
|
+
"kind": "PortDeclaration",
|
1336
2109
|
"direction": "inout"
|
1337
2110
|
}
|
1338
2111
|
},
|
@@ -1369,6 +2142,7 @@ QAOA_PENALTY = QuantumFunctionDeclaration.parse_raw(
|
|
1369
2142
|
"size": {
|
1370
2143
|
"expr": "num_qubits"
|
1371
2144
|
},
|
2145
|
+
"kind": "PortDeclaration",
|
1372
2146
|
"direction": "inout"
|
1373
2147
|
}
|
1374
2148
|
},
|
@@ -1416,6 +2190,7 @@ FULL_HEA = QuantumFunctionDeclaration.parse_raw(
|
|
1416
2190
|
"size": {
|
1417
2191
|
"expr": "num_qubits"
|
1418
2192
|
},
|
2193
|
+
"kind": "PortDeclaration",
|
1419
2194
|
"direction": "inout"
|
1420
2195
|
}
|
1421
2196
|
},
|
@@ -1433,9 +2208,11 @@ FULL_HEA = QuantumFunctionDeclaration.parse_raw(
|
|
1433
2208
|
"size": {
|
1434
2209
|
"expr": "1"
|
1435
2210
|
},
|
2211
|
+
"kind": "PortDeclaration",
|
1436
2212
|
"direction": "inout"
|
1437
2213
|
}
|
1438
2214
|
},
|
2215
|
+
"kind": "QuantumOperandDeclaration",
|
1439
2216
|
"is_list": true
|
1440
2217
|
},
|
1441
2218
|
"operands_2qubit": {
|
@@ -1451,6 +2228,7 @@ FULL_HEA = QuantumFunctionDeclaration.parse_raw(
|
|
1451
2228
|
"size": {
|
1452
2229
|
"expr": "1"
|
1453
2230
|
},
|
2231
|
+
"kind": "PortDeclaration",
|
1454
2232
|
"direction": "inout"
|
1455
2233
|
},
|
1456
2234
|
"q2": {
|
@@ -1458,9 +2236,11 @@ FULL_HEA = QuantumFunctionDeclaration.parse_raw(
|
|
1458
2236
|
"size": {
|
1459
2237
|
"expr": "1"
|
1460
2238
|
},
|
2239
|
+
"kind": "PortDeclaration",
|
1461
2240
|
"direction": "inout"
|
1462
2241
|
}
|
1463
2242
|
},
|
2243
|
+
"kind": "QuantumOperandDeclaration",
|
1464
2244
|
"is_list": true
|
1465
2245
|
}
|
1466
2246
|
},
|
@@ -1480,6 +2260,7 @@ SWAP_TEST = QuantumFunctionDeclaration.parse_raw(
|
|
1480
2260
|
"kind": "qvec",
|
1481
2261
|
"length": null
|
1482
2262
|
},
|
2263
|
+
"kind": "PortDeclaration",
|
1483
2264
|
"direction": "inout"
|
1484
2265
|
},
|
1485
2266
|
"state2": {
|
@@ -1488,6 +2269,7 @@ SWAP_TEST = QuantumFunctionDeclaration.parse_raw(
|
|
1488
2269
|
"kind": "qvec",
|
1489
2270
|
"length": null
|
1490
2271
|
},
|
2272
|
+
"kind": "PortDeclaration",
|
1491
2273
|
"direction": "inout"
|
1492
2274
|
},
|
1493
2275
|
"test": {
|
@@ -1495,6 +2277,7 @@ SWAP_TEST = QuantumFunctionDeclaration.parse_raw(
|
|
1495
2277
|
"quantum_type": {
|
1496
2278
|
"kind": "qbit"
|
1497
2279
|
},
|
2280
|
+
"kind": "PortDeclaration",
|
1498
2281
|
"direction": "output"
|
1499
2282
|
}
|
1500
2283
|
},
|
@@ -1506,6 +2289,7 @@ SWAP_TEST = QuantumFunctionDeclaration.parse_raw(
|
|
1506
2289
|
"kind": "qvec",
|
1507
2290
|
"length": null
|
1508
2291
|
},
|
2292
|
+
"kind": "PortDeclaration",
|
1509
2293
|
"direction": "inout"
|
1510
2294
|
},
|
1511
2295
|
{
|
@@ -1514,6 +2298,7 @@ SWAP_TEST = QuantumFunctionDeclaration.parse_raw(
|
|
1514
2298
|
"kind": "qvec",
|
1515
2299
|
"length": null
|
1516
2300
|
},
|
2301
|
+
"kind": "PortDeclaration",
|
1517
2302
|
"direction": "inout"
|
1518
2303
|
},
|
1519
2304
|
{
|
@@ -1521,6 +2306,7 @@ SWAP_TEST = QuantumFunctionDeclaration.parse_raw(
|
|
1521
2306
|
"quantum_type": {
|
1522
2307
|
"kind": "qbit"
|
1523
2308
|
},
|
2309
|
+
"kind": "PortDeclaration",
|
1524
2310
|
"direction": "output"
|
1525
2311
|
}
|
1526
2312
|
]
|
@@ -1543,12 +2329,14 @@ PREPARE_GHZ_STATE = QuantumFunctionDeclaration.parse_raw(
|
|
1543
2329
|
"kind": "qvec",
|
1544
2330
|
"length": null
|
1545
2331
|
},
|
2332
|
+
"kind": "PortDeclaration",
|
1546
2333
|
"direction": "output"
|
1547
2334
|
}
|
1548
2335
|
},
|
1549
2336
|
"operand_declarations": {},
|
1550
2337
|
"positional_arg_declarations": [
|
1551
2338
|
{
|
2339
|
+
"kind": "ClassicalParameterDeclaration",
|
1552
2340
|
"name": "size",
|
1553
2341
|
"classical_type": {
|
1554
2342
|
"kind": "int"
|
@@ -1560,6 +2348,7 @@ PREPARE_GHZ_STATE = QuantumFunctionDeclaration.parse_raw(
|
|
1560
2348
|
"kind": "qvec",
|
1561
2349
|
"length": null
|
1562
2350
|
},
|
2351
|
+
"kind": "PortDeclaration",
|
1563
2352
|
"direction": "output"
|
1564
2353
|
}
|
1565
2354
|
]
|
@@ -1582,12 +2371,14 @@ PREPARE_EXPONENTIAL_STATE = QuantumFunctionDeclaration.parse_raw(
|
|
1582
2371
|
"kind": "qvec",
|
1583
2372
|
"length": null
|
1584
2373
|
},
|
2374
|
+
"kind": "PortDeclaration",
|
1585
2375
|
"direction": "inout"
|
1586
2376
|
}
|
1587
2377
|
},
|
1588
2378
|
"operand_declarations": {},
|
1589
2379
|
"positional_arg_declarations": [
|
1590
2380
|
{
|
2381
|
+
"kind": "ClassicalParameterDeclaration",
|
1591
2382
|
"name": "rate",
|
1592
2383
|
"classical_type": {
|
1593
2384
|
"kind": "int"
|
@@ -1599,6 +2390,7 @@ PREPARE_EXPONENTIAL_STATE = QuantumFunctionDeclaration.parse_raw(
|
|
1599
2390
|
"kind": "qvec",
|
1600
2391
|
"length": null
|
1601
2392
|
},
|
2393
|
+
"kind": "PortDeclaration",
|
1602
2394
|
"direction": "inout"
|
1603
2395
|
}
|
1604
2396
|
]
|
@@ -1623,12 +2415,14 @@ PREPARE_BELL_STATE = QuantumFunctionDeclaration.parse_raw(
|
|
1623
2415
|
"expr": "2"
|
1624
2416
|
}
|
1625
2417
|
},
|
2418
|
+
"kind": "PortDeclaration",
|
1626
2419
|
"direction": "output"
|
1627
2420
|
}
|
1628
2421
|
},
|
1629
2422
|
"operand_declarations": {},
|
1630
2423
|
"positional_arg_declarations": [
|
1631
2424
|
{
|
2425
|
+
"kind": "ClassicalParameterDeclaration",
|
1632
2426
|
"name": "state_num",
|
1633
2427
|
"classical_type": {
|
1634
2428
|
"kind": "int"
|
@@ -1642,6 +2436,7 @@ PREPARE_BELL_STATE = QuantumFunctionDeclaration.parse_raw(
|
|
1642
2436
|
"expr": "2"
|
1643
2437
|
}
|
1644
2438
|
},
|
2439
|
+
"kind": "PortDeclaration",
|
1645
2440
|
"direction": "output"
|
1646
2441
|
}
|
1647
2442
|
]
|
@@ -1664,12 +2459,14 @@ INPLACE_PREPARE_INT = QuantumFunctionDeclaration.parse_raw(
|
|
1664
2459
|
"kind": "qvec",
|
1665
2460
|
"length": null
|
1666
2461
|
},
|
2462
|
+
"kind": "PortDeclaration",
|
1667
2463
|
"direction": "inout"
|
1668
2464
|
}
|
1669
2465
|
},
|
1670
2466
|
"operand_declarations": {},
|
1671
2467
|
"positional_arg_declarations": [
|
1672
2468
|
{
|
2469
|
+
"kind": "ClassicalParameterDeclaration",
|
1673
2470
|
"name": "value",
|
1674
2471
|
"classical_type": {
|
1675
2472
|
"kind": "int"
|
@@ -1681,6 +2478,7 @@ INPLACE_PREPARE_INT = QuantumFunctionDeclaration.parse_raw(
|
|
1681
2478
|
"kind": "qvec",
|
1682
2479
|
"length": null
|
1683
2480
|
},
|
2481
|
+
"kind": "PortDeclaration",
|
1684
2482
|
"direction": "inout"
|
1685
2483
|
}
|
1686
2484
|
]
|
@@ -1702,12 +2500,14 @@ PREPARE_INT = QuantumFunctionDeclaration.parse_raw(
|
|
1702
2500
|
"quantum_type": {
|
1703
2501
|
"kind": "qnum"
|
1704
2502
|
},
|
2503
|
+
"kind": "PortDeclaration",
|
1705
2504
|
"direction": "output"
|
1706
2505
|
}
|
1707
2506
|
},
|
1708
2507
|
"operand_declarations": {},
|
1709
2508
|
"positional_arg_declarations": [
|
1710
2509
|
{
|
2510
|
+
"kind": "ClassicalParameterDeclaration",
|
1711
2511
|
"name": "value",
|
1712
2512
|
"classical_type": {
|
1713
2513
|
"kind": "int"
|
@@ -1718,6 +2518,7 @@ PREPARE_INT = QuantumFunctionDeclaration.parse_raw(
|
|
1718
2518
|
"quantum_type": {
|
1719
2519
|
"kind": "qnum"
|
1720
2520
|
},
|
2521
|
+
"kind": "PortDeclaration",
|
1721
2522
|
"direction": "output"
|
1722
2523
|
}
|
1723
2524
|
]
|
@@ -1738,11 +2539,13 @@ SWITCH = QuantumFunctionDeclaration.parse_raw(
|
|
1738
2539
|
"cases": {
|
1739
2540
|
"name": "cases",
|
1740
2541
|
"positional_arg_declarations": [],
|
2542
|
+
"kind": "QuantumOperandDeclaration",
|
1741
2543
|
"is_list": true
|
1742
2544
|
}
|
1743
2545
|
},
|
1744
2546
|
"positional_arg_declarations": [
|
1745
2547
|
{
|
2548
|
+
"kind": "ClassicalParameterDeclaration",
|
1746
2549
|
"name": "selector",
|
1747
2550
|
"classical_type": {
|
1748
2551
|
"kind": "int"
|
@@ -1751,6 +2554,7 @@ SWITCH = QuantumFunctionDeclaration.parse_raw(
|
|
1751
2554
|
{
|
1752
2555
|
"name": "cases",
|
1753
2556
|
"positional_arg_declarations": [],
|
2557
|
+
"kind": "QuantumOperandDeclaration",
|
1754
2558
|
"is_list": true
|
1755
2559
|
}
|
1756
2560
|
]
|
@@ -1785,6 +2589,10 @@ __all__ = [
|
|
1785
2589
|
"MULTISWAP",
|
1786
2590
|
"INPLACE_C_MODULAR_MULTIPLY",
|
1787
2591
|
"MODULAR_EXP",
|
2592
|
+
"QSVT_STEP",
|
2593
|
+
"QSVT",
|
2594
|
+
"PROJECTOR_CONTROLLED_PHASE",
|
2595
|
+
"QSVT_INVERSION",
|
1788
2596
|
"ALLOCATE_NUM",
|
1789
2597
|
"QAOA_MIXER_LAYER",
|
1790
2598
|
"QAOA_COST_LAYER",
|