classiq 0.41.2__py3-none-any.whl → 0.42.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/applications/chemistry/chemistry_model_constructor.py +31 -31
- classiq/execution/execution_session.py +42 -3
- classiq/interface/_version.py +1 -1
- classiq/interface/analyzer/analysis_params.py +16 -6
- classiq/interface/analyzer/result.py +2 -1
- classiq/interface/ast_node.py +2 -2
- classiq/interface/backend/pydantic_backend.py +1 -3
- classiq/interface/chemistry/fermionic_operator.py +17 -7
- classiq/interface/generator/amplitude_loading.py +12 -3
- classiq/interface/generator/application_apis/finance_declarations.py +22 -1
- classiq/interface/generator/expressions/atomic_expression_functions.py +2 -1
- classiq/interface/generator/expressions/enums/classical_enum.py +11 -0
- classiq/interface/generator/expressions/enums/ladder_operator.py +0 -10
- classiq/interface/generator/expressions/expression_constants.py +1 -0
- classiq/interface/generator/expressions/qmod_qarray_proxy.py +14 -1
- classiq/interface/generator/expressions/qmod_qscalar_proxy.py +7 -2
- classiq/interface/generator/expressions/qmod_sized_proxy.py +8 -3
- classiq/interface/generator/expressions/qmod_struct_instance.py +12 -1
- classiq/interface/generator/functions/builtins/core_library/atomic_quantum_functions.py +262 -195
- classiq/interface/generator/functions/builtins/internal_operators.py +1 -0
- classiq/interface/generator/functions/builtins/open_lib_functions.py +1645 -44
- classiq/interface/generator/functions/classical_type.py +21 -3
- classiq/interface/generator/generated_circuit_data.py +2 -0
- classiq/interface/generator/model/model.py +1 -1
- classiq/interface/{model → generator/model}/quantum_register.py +3 -0
- classiq/interface/helpers/classproperty.py +8 -0
- classiq/interface/ide/visual_model.py +68 -0
- classiq/interface/model/control.py +11 -1
- classiq/interface/model/quantum_expressions/amplitude_loading_operation.py +3 -8
- classiq/interface/model/quantum_expressions/quantum_expression.py +1 -30
- classiq/interface/model/quantum_function_call.py +0 -12
- classiq/interface/model/validations/handles_validator.py +2 -7
- classiq/interface/server/routes.py +1 -0
- classiq/qmod/builtins/classical_execution_primitives.py +1 -1
- classiq/qmod/builtins/functions.py +83 -31
- classiq/qmod/builtins/operations.py +16 -1
- classiq/qmod/declaration_inferrer.py +28 -4
- classiq/qmod/pretty_print/pretty_printer.py +22 -2
- classiq/qmod/qmod_constant.py +2 -1
- classiq/qmod/qmod_parameter.py +9 -2
- classiq/qmod/quantum_expandable.py +35 -11
- classiq/qmod/quantum_function.py +6 -5
- classiq/qmod/symbolic.py +22 -1
- classiq/qmod/utilities.py +5 -5
- {classiq-0.41.2.dist-info → classiq-0.42.0.dist-info}/METADATA +1 -1
- {classiq-0.41.2.dist-info → classiq-0.42.0.dist-info}/RECORD +47 -46
- classiq/interface/model/call_synthesis_data.py +0 -57
- {classiq-0.41.2.dist-info → classiq-0.42.0.dist-info}/WHEEL +0 -0
@@ -7,6 +7,9 @@ from classiq.interface.generator.functions.classical_type import (
|
|
7
7
|
from classiq.interface.generator.functions.port_declaration import (
|
8
8
|
PortDeclarationDirection,
|
9
9
|
)
|
10
|
+
from classiq.interface.model.classical_parameter_declaration import (
|
11
|
+
ClassicalParameterDeclaration,
|
12
|
+
)
|
10
13
|
from classiq.interface.model.port_declaration import PortDeclaration
|
11
14
|
from classiq.interface.model.quantum_function_declaration import (
|
12
15
|
QuantumFunctionDeclaration,
|
@@ -16,586 +19,650 @@ DEFAULT_TARGET_NAME = "target"
|
|
16
19
|
|
17
20
|
H_FUNCTION = QuantumFunctionDeclaration(
|
18
21
|
name="H",
|
19
|
-
|
20
|
-
|
22
|
+
positional_arg_declarations=[
|
23
|
+
PortDeclaration(
|
21
24
|
name=DEFAULT_TARGET_NAME,
|
22
25
|
direction=PortDeclarationDirection.Inout,
|
23
26
|
size=Expression(expr="1"),
|
24
27
|
),
|
25
|
-
|
28
|
+
],
|
26
29
|
)
|
27
30
|
|
28
31
|
|
29
32
|
X_FUNCTION = QuantumFunctionDeclaration(
|
30
33
|
name="X",
|
31
|
-
|
32
|
-
|
34
|
+
positional_arg_declarations=[
|
35
|
+
PortDeclaration(
|
33
36
|
name=DEFAULT_TARGET_NAME,
|
34
37
|
direction=PortDeclarationDirection.Inout,
|
35
38
|
size=Expression(expr="1"),
|
36
39
|
),
|
37
|
-
|
40
|
+
],
|
38
41
|
)
|
39
42
|
|
40
43
|
|
41
44
|
Y_FUNCTION = QuantumFunctionDeclaration(
|
42
45
|
name="Y",
|
43
|
-
|
44
|
-
|
46
|
+
positional_arg_declarations=[
|
47
|
+
PortDeclaration(
|
45
48
|
name=DEFAULT_TARGET_NAME,
|
46
49
|
direction=PortDeclarationDirection.Inout,
|
47
50
|
size=Expression(expr="1"),
|
48
51
|
),
|
49
|
-
|
52
|
+
],
|
50
53
|
)
|
51
54
|
|
52
55
|
Z_FUNCTION = QuantumFunctionDeclaration(
|
53
56
|
name="Z",
|
54
|
-
|
55
|
-
|
57
|
+
positional_arg_declarations=[
|
58
|
+
PortDeclaration(
|
56
59
|
name=DEFAULT_TARGET_NAME,
|
57
60
|
direction=PortDeclarationDirection.Inout,
|
58
61
|
size=Expression(expr="1"),
|
59
62
|
),
|
60
|
-
|
63
|
+
],
|
61
64
|
)
|
62
65
|
|
63
66
|
|
64
67
|
I_FUNCTION = QuantumFunctionDeclaration(
|
65
68
|
name="I",
|
66
|
-
|
67
|
-
|
69
|
+
positional_arg_declarations=[
|
70
|
+
PortDeclaration(
|
68
71
|
name=DEFAULT_TARGET_NAME,
|
69
72
|
direction=PortDeclarationDirection.Inout,
|
70
73
|
size=Expression(expr="1"),
|
71
74
|
),
|
72
|
-
|
75
|
+
],
|
73
76
|
)
|
74
77
|
|
75
78
|
|
76
79
|
S_FUNCTION = QuantumFunctionDeclaration(
|
77
80
|
name="S",
|
78
|
-
|
79
|
-
|
81
|
+
positional_arg_declarations=[
|
82
|
+
PortDeclaration(
|
80
83
|
name=DEFAULT_TARGET_NAME,
|
81
84
|
direction=PortDeclarationDirection.Inout,
|
82
85
|
size=Expression(expr="1"),
|
83
86
|
),
|
84
|
-
|
87
|
+
],
|
85
88
|
)
|
86
89
|
|
87
90
|
|
88
91
|
T_FUNCTION = QuantumFunctionDeclaration(
|
89
92
|
name="T",
|
90
|
-
|
91
|
-
|
93
|
+
positional_arg_declarations=[
|
94
|
+
PortDeclaration(
|
92
95
|
name=DEFAULT_TARGET_NAME,
|
93
96
|
direction=PortDeclarationDirection.Inout,
|
94
97
|
size=Expression(expr="1"),
|
95
98
|
),
|
96
|
-
|
99
|
+
],
|
97
100
|
)
|
98
101
|
|
99
102
|
|
100
103
|
SDG_FUNCTION = QuantumFunctionDeclaration(
|
101
104
|
name="SDG",
|
102
|
-
|
103
|
-
|
105
|
+
positional_arg_declarations=[
|
106
|
+
PortDeclaration(
|
104
107
|
name=DEFAULT_TARGET_NAME,
|
105
108
|
direction=PortDeclarationDirection.Inout,
|
106
109
|
size=Expression(expr="1"),
|
107
110
|
),
|
108
|
-
|
111
|
+
],
|
109
112
|
)
|
110
113
|
|
111
114
|
|
112
115
|
TDG_FUNCTION = QuantumFunctionDeclaration(
|
113
116
|
name="TDG",
|
114
|
-
|
115
|
-
|
117
|
+
positional_arg_declarations=[
|
118
|
+
PortDeclaration(
|
116
119
|
name=DEFAULT_TARGET_NAME,
|
117
120
|
direction=PortDeclarationDirection.Inout,
|
118
121
|
size=Expression(expr="1"),
|
119
122
|
),
|
120
|
-
|
123
|
+
],
|
121
124
|
)
|
122
125
|
|
123
126
|
|
124
127
|
PHASE_FUNCTION = QuantumFunctionDeclaration(
|
125
128
|
name="PHASE",
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
+
positional_arg_declarations=[
|
130
|
+
ClassicalParameterDeclaration(
|
131
|
+
name="theta",
|
132
|
+
classical_type=Real(),
|
133
|
+
),
|
134
|
+
PortDeclaration(
|
129
135
|
name=DEFAULT_TARGET_NAME,
|
130
136
|
direction=PortDeclarationDirection.Inout,
|
131
137
|
size=Expression(expr="1"),
|
132
138
|
),
|
133
|
-
|
139
|
+
],
|
134
140
|
)
|
135
141
|
|
136
142
|
|
137
143
|
RX_FUNCTION = QuantumFunctionDeclaration(
|
138
144
|
name="RX",
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
145
|
+
positional_arg_declarations=[
|
146
|
+
ClassicalParameterDeclaration(
|
147
|
+
name="theta",
|
148
|
+
classical_type=Real(),
|
149
|
+
),
|
150
|
+
PortDeclaration(
|
144
151
|
name=DEFAULT_TARGET_NAME,
|
145
152
|
direction=PortDeclarationDirection.Inout,
|
146
153
|
size=Expression(expr="1"),
|
147
|
-
)
|
148
|
-
|
154
|
+
),
|
155
|
+
],
|
149
156
|
)
|
150
157
|
|
151
158
|
|
152
159
|
RY_FUNCTION = QuantumFunctionDeclaration(
|
153
160
|
name="RY",
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
161
|
+
positional_arg_declarations=[
|
162
|
+
ClassicalParameterDeclaration(
|
163
|
+
name="theta",
|
164
|
+
classical_type=Real(),
|
165
|
+
),
|
166
|
+
PortDeclaration(
|
159
167
|
name=DEFAULT_TARGET_NAME,
|
160
168
|
direction=PortDeclarationDirection.Inout,
|
161
169
|
size=Expression(expr="1"),
|
162
|
-
)
|
163
|
-
|
170
|
+
),
|
171
|
+
],
|
164
172
|
)
|
165
173
|
|
166
174
|
|
167
175
|
RZ_FUNCTION = QuantumFunctionDeclaration(
|
168
176
|
name="RZ",
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
177
|
+
positional_arg_declarations=[
|
178
|
+
ClassicalParameterDeclaration(
|
179
|
+
name="theta",
|
180
|
+
classical_type=Real(),
|
181
|
+
),
|
182
|
+
PortDeclaration(
|
174
183
|
name=DEFAULT_TARGET_NAME,
|
175
184
|
direction=PortDeclarationDirection.Inout,
|
176
185
|
size=Expression(expr="1"),
|
177
|
-
)
|
178
|
-
|
186
|
+
),
|
187
|
+
],
|
179
188
|
)
|
180
189
|
|
181
190
|
R_FUNCTION = QuantumFunctionDeclaration(
|
182
191
|
name="R",
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
192
|
+
positional_arg_declarations=[
|
193
|
+
ClassicalParameterDeclaration(
|
194
|
+
name="theta",
|
195
|
+
classical_type=Real(),
|
196
|
+
),
|
197
|
+
ClassicalParameterDeclaration(
|
198
|
+
name="phi",
|
199
|
+
classical_type=Real(),
|
200
|
+
),
|
201
|
+
PortDeclaration(
|
189
202
|
name=DEFAULT_TARGET_NAME,
|
190
203
|
direction=PortDeclarationDirection.Inout,
|
191
204
|
size=Expression(expr="1"),
|
192
|
-
)
|
193
|
-
|
205
|
+
),
|
206
|
+
],
|
194
207
|
)
|
195
208
|
|
196
209
|
|
197
210
|
RXX_FUNCTION = QuantumFunctionDeclaration(
|
198
211
|
name="RXX",
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
212
|
+
positional_arg_declarations=[
|
213
|
+
ClassicalParameterDeclaration(
|
214
|
+
name="theta",
|
215
|
+
classical_type=Real(),
|
216
|
+
),
|
217
|
+
PortDeclaration(
|
204
218
|
name=DEFAULT_TARGET_NAME,
|
205
219
|
direction=PortDeclarationDirection.Inout,
|
206
220
|
size=Expression(expr="2"),
|
207
|
-
)
|
208
|
-
|
221
|
+
),
|
222
|
+
],
|
209
223
|
)
|
210
224
|
|
211
225
|
|
212
226
|
RYY_FUNCTION = QuantumFunctionDeclaration(
|
213
227
|
name="RYY",
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
228
|
+
positional_arg_declarations=[
|
229
|
+
ClassicalParameterDeclaration(
|
230
|
+
name="theta",
|
231
|
+
classical_type=Real(),
|
232
|
+
),
|
233
|
+
PortDeclaration(
|
219
234
|
name=DEFAULT_TARGET_NAME,
|
220
235
|
direction=PortDeclarationDirection.Inout,
|
221
236
|
size=Expression(expr="2"),
|
222
|
-
)
|
223
|
-
|
237
|
+
),
|
238
|
+
],
|
224
239
|
)
|
225
240
|
|
226
241
|
|
227
242
|
RZZ_FUNCTION = QuantumFunctionDeclaration(
|
228
243
|
name="RZZ",
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
244
|
+
positional_arg_declarations=[
|
245
|
+
ClassicalParameterDeclaration(
|
246
|
+
name="theta",
|
247
|
+
classical_type=Real(),
|
248
|
+
),
|
249
|
+
PortDeclaration(
|
234
250
|
name=DEFAULT_TARGET_NAME,
|
235
251
|
direction=PortDeclarationDirection.Inout,
|
236
252
|
size=Expression(expr="2"),
|
237
|
-
)
|
238
|
-
|
253
|
+
),
|
254
|
+
],
|
239
255
|
)
|
240
256
|
|
241
257
|
|
242
258
|
CH_FUNCTION = QuantumFunctionDeclaration(
|
243
259
|
name="CH",
|
244
|
-
|
245
|
-
|
260
|
+
positional_arg_declarations=[
|
261
|
+
PortDeclaration(
|
246
262
|
name="control",
|
247
263
|
direction=PortDeclarationDirection.Inout,
|
248
264
|
size=Expression(expr="1"),
|
249
265
|
),
|
250
|
-
|
266
|
+
PortDeclaration(
|
251
267
|
name=DEFAULT_TARGET_NAME,
|
252
268
|
direction=PortDeclarationDirection.Inout,
|
253
269
|
size=Expression(expr="1"),
|
254
270
|
),
|
255
|
-
|
271
|
+
],
|
256
272
|
)
|
257
273
|
|
258
274
|
|
259
275
|
CX_FUNCTION = QuantumFunctionDeclaration(
|
260
276
|
name="CX",
|
261
|
-
|
262
|
-
|
277
|
+
positional_arg_declarations=[
|
278
|
+
PortDeclaration(
|
263
279
|
name="control",
|
264
280
|
direction=PortDeclarationDirection.Inout,
|
265
281
|
size=Expression(expr="1"),
|
266
282
|
),
|
267
|
-
|
283
|
+
PortDeclaration(
|
268
284
|
name=DEFAULT_TARGET_NAME,
|
269
285
|
direction=PortDeclarationDirection.Inout,
|
270
286
|
size=Expression(expr="1"),
|
271
287
|
),
|
272
|
-
|
288
|
+
],
|
273
289
|
)
|
274
290
|
|
275
291
|
|
276
292
|
CY_FUNCTION = QuantumFunctionDeclaration(
|
277
293
|
name="CY",
|
278
|
-
|
279
|
-
|
294
|
+
positional_arg_declarations=[
|
295
|
+
PortDeclaration(
|
280
296
|
name="control",
|
281
297
|
direction=PortDeclarationDirection.Inout,
|
282
298
|
size=Expression(expr="1"),
|
283
299
|
),
|
284
|
-
|
300
|
+
PortDeclaration(
|
285
301
|
name=DEFAULT_TARGET_NAME,
|
286
302
|
direction=PortDeclarationDirection.Inout,
|
287
303
|
size=Expression(expr="1"),
|
288
304
|
),
|
289
|
-
|
305
|
+
],
|
290
306
|
)
|
291
307
|
|
292
308
|
|
293
309
|
CZ_FUNCTION = QuantumFunctionDeclaration(
|
294
310
|
name="CZ",
|
295
|
-
|
296
|
-
|
311
|
+
positional_arg_declarations=[
|
312
|
+
PortDeclaration(
|
297
313
|
name="control",
|
298
314
|
direction=PortDeclarationDirection.Inout,
|
299
315
|
size=Expression(expr="1"),
|
300
316
|
),
|
301
|
-
|
317
|
+
PortDeclaration(
|
302
318
|
name=DEFAULT_TARGET_NAME,
|
303
319
|
direction=PortDeclarationDirection.Inout,
|
304
320
|
size=Expression(expr="1"),
|
305
321
|
),
|
306
|
-
|
322
|
+
],
|
307
323
|
)
|
308
324
|
|
309
325
|
|
310
326
|
CRX_FUNCTION = QuantumFunctionDeclaration(
|
311
327
|
name="CRX",
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
328
|
+
positional_arg_declarations=[
|
329
|
+
ClassicalParameterDeclaration(
|
330
|
+
name="theta",
|
331
|
+
classical_type=Real(),
|
332
|
+
),
|
333
|
+
PortDeclaration(
|
317
334
|
name="control",
|
318
335
|
direction=PortDeclarationDirection.Inout,
|
319
336
|
size=Expression(expr="1"),
|
320
337
|
),
|
321
|
-
|
338
|
+
PortDeclaration(
|
322
339
|
name=DEFAULT_TARGET_NAME,
|
323
340
|
direction=PortDeclarationDirection.Inout,
|
324
341
|
size=Expression(expr="1"),
|
325
342
|
),
|
326
|
-
|
343
|
+
],
|
327
344
|
)
|
328
345
|
|
329
346
|
|
330
347
|
CRY_FUNCTION = QuantumFunctionDeclaration(
|
331
348
|
name="CRY",
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
349
|
+
positional_arg_declarations=[
|
350
|
+
ClassicalParameterDeclaration(
|
351
|
+
name="theta",
|
352
|
+
classical_type=Real(),
|
353
|
+
),
|
354
|
+
PortDeclaration(
|
337
355
|
name="control",
|
338
356
|
direction=PortDeclarationDirection.Inout,
|
339
357
|
size=Expression(expr="1"),
|
340
358
|
),
|
341
|
-
|
359
|
+
PortDeclaration(
|
342
360
|
name=DEFAULT_TARGET_NAME,
|
343
361
|
direction=PortDeclarationDirection.Inout,
|
344
362
|
size=Expression(expr="1"),
|
345
363
|
),
|
346
|
-
|
364
|
+
],
|
347
365
|
)
|
348
366
|
|
349
367
|
|
350
368
|
CRZ_FUNCTION = QuantumFunctionDeclaration(
|
351
369
|
name="CRZ",
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
370
|
+
positional_arg_declarations=[
|
371
|
+
ClassicalParameterDeclaration(
|
372
|
+
name="theta",
|
373
|
+
classical_type=Real(),
|
374
|
+
),
|
375
|
+
PortDeclaration(
|
357
376
|
name="control",
|
358
377
|
direction=PortDeclarationDirection.Inout,
|
359
378
|
size=Expression(expr="1"),
|
360
379
|
),
|
361
|
-
|
380
|
+
PortDeclaration(
|
362
381
|
name=DEFAULT_TARGET_NAME,
|
363
382
|
direction=PortDeclarationDirection.Inout,
|
364
383
|
size=Expression(expr="1"),
|
365
384
|
),
|
366
|
-
|
385
|
+
],
|
367
386
|
)
|
368
387
|
|
369
388
|
|
370
389
|
CPHASE_FUNCTION = QuantumFunctionDeclaration(
|
371
390
|
name="CPHASE",
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
391
|
+
positional_arg_declarations=[
|
392
|
+
ClassicalParameterDeclaration(
|
393
|
+
name="theta",
|
394
|
+
classical_type=Real(),
|
395
|
+
),
|
396
|
+
PortDeclaration(
|
377
397
|
name="control",
|
378
398
|
direction=PortDeclarationDirection.Inout,
|
379
399
|
size=Expression(expr="1"),
|
380
400
|
),
|
381
|
-
|
401
|
+
PortDeclaration(
|
382
402
|
name=DEFAULT_TARGET_NAME,
|
383
403
|
direction=PortDeclarationDirection.Inout,
|
384
404
|
size=Expression(expr="1"),
|
385
405
|
),
|
386
|
-
|
406
|
+
],
|
387
407
|
)
|
388
408
|
|
389
409
|
|
390
410
|
SWAP_FUNCTION = QuantumFunctionDeclaration(
|
391
411
|
name="SWAP",
|
392
|
-
|
393
|
-
|
412
|
+
positional_arg_declarations=[
|
413
|
+
PortDeclaration(
|
394
414
|
name="qbit0",
|
395
415
|
direction=PortDeclarationDirection.Inout,
|
396
416
|
size=Expression(expr="1"),
|
397
417
|
),
|
398
|
-
|
418
|
+
PortDeclaration(
|
399
419
|
name="qbit1",
|
400
420
|
direction=PortDeclarationDirection.Inout,
|
401
421
|
size=Expression(expr="1"),
|
402
422
|
),
|
403
|
-
|
423
|
+
],
|
404
424
|
)
|
405
425
|
|
406
426
|
|
407
427
|
IDENTITY_FUNCTION = QuantumFunctionDeclaration(
|
408
428
|
name="IDENTITY",
|
409
|
-
|
410
|
-
|
429
|
+
positional_arg_declarations=[
|
430
|
+
PortDeclaration(
|
411
431
|
name=DEFAULT_TARGET_NAME,
|
412
432
|
direction=PortDeclarationDirection.Inout,
|
413
433
|
)
|
414
|
-
|
434
|
+
],
|
415
435
|
)
|
416
436
|
|
417
437
|
UNITARY_FUNCTION = QuantumFunctionDeclaration(
|
418
438
|
name="unitary",
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
439
|
+
positional_arg_declarations=[
|
440
|
+
ClassicalParameterDeclaration(
|
441
|
+
name="elements",
|
442
|
+
classical_type=ClassicalList(
|
443
|
+
element_type=ClassicalList(element_type=Real())
|
444
|
+
),
|
445
|
+
),
|
446
|
+
PortDeclaration(
|
424
447
|
name=DEFAULT_TARGET_NAME,
|
425
448
|
direction=PortDeclarationDirection.Inout,
|
426
449
|
size=Expression(expr="log(get_field(elements[0], 'len'), 2)"),
|
427
|
-
)
|
428
|
-
|
450
|
+
),
|
451
|
+
],
|
429
452
|
)
|
430
453
|
|
431
454
|
|
432
455
|
PREPARE_STATE_FUNCTION = QuantumFunctionDeclaration(
|
433
456
|
name="prepare_state",
|
434
|
-
|
435
|
-
|
436
|
-
|
457
|
+
positional_arg_declarations=[
|
458
|
+
ClassicalParameterDeclaration(
|
459
|
+
name="probabilities",
|
460
|
+
classical_type=ClassicalList(element_type=Real()),
|
461
|
+
),
|
462
|
+
ClassicalParameterDeclaration(name="bound", classical_type=Real()),
|
463
|
+
PortDeclaration(
|
437
464
|
name="out",
|
438
465
|
direction=PortDeclarationDirection.Output,
|
439
466
|
size=Expression(expr="log(get_field(probabilities, 'len'), 2)"),
|
440
|
-
)
|
441
|
-
|
467
|
+
),
|
468
|
+
],
|
442
469
|
)
|
443
470
|
|
444
471
|
PREPARE_AMPLITUDES_FUNCTION = QuantumFunctionDeclaration(
|
445
472
|
name="prepare_amplitudes",
|
446
|
-
|
447
|
-
|
448
|
-
|
473
|
+
positional_arg_declarations=[
|
474
|
+
ClassicalParameterDeclaration(
|
475
|
+
name="amplitudes",
|
476
|
+
classical_type=ClassicalList(element_type=Real()),
|
477
|
+
),
|
478
|
+
ClassicalParameterDeclaration(
|
479
|
+
name="bound",
|
480
|
+
classical_type=Real(),
|
481
|
+
),
|
482
|
+
PortDeclaration(
|
449
483
|
name="out",
|
450
484
|
direction=PortDeclarationDirection.Output,
|
451
485
|
size=Expression(expr="log(get_field(amplitudes, 'len'), 2)"),
|
452
|
-
)
|
453
|
-
|
486
|
+
),
|
487
|
+
],
|
454
488
|
)
|
455
489
|
|
456
490
|
ADD_FUNCTION = QuantumFunctionDeclaration(
|
457
491
|
name="add",
|
458
|
-
|
459
|
-
|
492
|
+
positional_arg_declarations=[
|
493
|
+
PortDeclaration(
|
460
494
|
name="left",
|
461
495
|
direction=PortDeclarationDirection.Inout,
|
462
496
|
),
|
463
|
-
|
497
|
+
PortDeclaration(
|
464
498
|
name="right",
|
465
499
|
direction=PortDeclarationDirection.Inout,
|
466
500
|
),
|
467
|
-
|
501
|
+
PortDeclaration(
|
468
502
|
name="result",
|
469
503
|
direction=PortDeclarationDirection.Output,
|
470
504
|
size=Expression(
|
471
505
|
expr="Max(get_field(left, 'len'), get_field(right, 'len')) + 1"
|
472
506
|
),
|
473
507
|
),
|
474
|
-
|
508
|
+
],
|
475
509
|
)
|
476
510
|
|
477
511
|
|
478
512
|
MODULAR_ADD_FUNCTION = QuantumFunctionDeclaration(
|
479
513
|
name="modular_add",
|
480
|
-
|
481
|
-
|
514
|
+
positional_arg_declarations=[
|
515
|
+
PortDeclaration(
|
482
516
|
name="left",
|
483
517
|
direction=PortDeclarationDirection.Inout,
|
484
518
|
),
|
485
|
-
|
519
|
+
PortDeclaration(
|
486
520
|
name="right",
|
487
521
|
direction=PortDeclarationDirection.Inout,
|
488
522
|
),
|
489
|
-
|
523
|
+
],
|
490
524
|
)
|
491
525
|
|
492
526
|
|
493
527
|
INTEGER_XOR_FUNCTION = QuantumFunctionDeclaration(
|
494
528
|
name="integer_xor",
|
495
|
-
|
496
|
-
|
529
|
+
positional_arg_declarations=[
|
530
|
+
PortDeclaration(
|
497
531
|
name="left",
|
498
532
|
direction=PortDeclarationDirection.Inout,
|
499
533
|
),
|
500
|
-
|
534
|
+
PortDeclaration(
|
501
535
|
name="right",
|
502
536
|
direction=PortDeclarationDirection.Inout,
|
503
537
|
),
|
504
|
-
|
538
|
+
],
|
505
539
|
)
|
506
540
|
|
507
541
|
|
508
542
|
U_FUNCTION = QuantumFunctionDeclaration(
|
509
543
|
name="U",
|
510
|
-
|
511
|
-
|
512
|
-
|
544
|
+
positional_arg_declarations=[
|
545
|
+
ClassicalParameterDeclaration(
|
546
|
+
name="theta",
|
547
|
+
classical_type=Real(),
|
548
|
+
),
|
549
|
+
ClassicalParameterDeclaration(
|
550
|
+
name="phi",
|
551
|
+
classical_type=Real(),
|
552
|
+
),
|
553
|
+
ClassicalParameterDeclaration(
|
554
|
+
name="lam",
|
555
|
+
classical_type=Real(),
|
556
|
+
),
|
557
|
+
ClassicalParameterDeclaration(
|
558
|
+
name="gam",
|
559
|
+
classical_type=Real(),
|
560
|
+
),
|
561
|
+
PortDeclaration(
|
513
562
|
name=DEFAULT_TARGET_NAME,
|
514
563
|
direction=PortDeclarationDirection.Inout,
|
515
564
|
size=Expression(expr="1"),
|
516
|
-
)
|
517
|
-
|
565
|
+
),
|
566
|
+
],
|
518
567
|
)
|
519
568
|
|
520
569
|
|
521
570
|
CCX_FUNCTION = QuantumFunctionDeclaration(
|
522
571
|
name="CCX",
|
523
|
-
|
524
|
-
|
572
|
+
positional_arg_declarations=[
|
573
|
+
PortDeclaration(
|
525
574
|
name="control",
|
526
575
|
direction=PortDeclarationDirection.Inout,
|
527
576
|
size=Expression(expr="2"),
|
528
577
|
),
|
529
|
-
|
578
|
+
PortDeclaration(
|
530
579
|
name=DEFAULT_TARGET_NAME,
|
531
580
|
direction=PortDeclarationDirection.Inout,
|
532
581
|
size=Expression(expr="1"),
|
533
582
|
),
|
534
|
-
|
583
|
+
],
|
535
584
|
)
|
536
585
|
|
537
586
|
|
538
587
|
ALLOCATE_FUNCTION = QuantumFunctionDeclaration(
|
539
588
|
name="allocate",
|
540
|
-
|
541
|
-
|
542
|
-
|
589
|
+
positional_arg_declarations=[
|
590
|
+
ClassicalParameterDeclaration(
|
591
|
+
name="num_qubits",
|
592
|
+
classical_type=Integer(),
|
593
|
+
),
|
594
|
+
PortDeclaration(
|
543
595
|
name="out",
|
544
596
|
direction=PortDeclarationDirection.Output,
|
545
597
|
size=Expression(expr="num_qubits"),
|
546
|
-
)
|
547
|
-
|
598
|
+
),
|
599
|
+
],
|
548
600
|
)
|
549
601
|
|
550
602
|
|
551
603
|
FREE_FUNCTION = QuantumFunctionDeclaration(
|
552
604
|
name="free",
|
553
|
-
|
554
|
-
|
605
|
+
positional_arg_declarations=[
|
606
|
+
PortDeclaration(
|
555
607
|
name="in",
|
556
608
|
direction=PortDeclarationDirection.Input,
|
557
609
|
)
|
558
|
-
|
610
|
+
],
|
559
611
|
)
|
560
612
|
|
561
613
|
|
562
614
|
RANDOMIZED_BENCHMARKING = QuantumFunctionDeclaration(
|
563
615
|
name="randomized_benchmarking",
|
564
|
-
|
565
|
-
|
616
|
+
positional_arg_declarations=[
|
617
|
+
ClassicalParameterDeclaration(
|
618
|
+
name="num_of_cliffords",
|
619
|
+
classical_type=Integer(),
|
620
|
+
),
|
621
|
+
PortDeclaration(
|
566
622
|
name=DEFAULT_TARGET_NAME,
|
567
623
|
direction=PortDeclarationDirection.Inout,
|
568
624
|
),
|
569
|
-
|
570
|
-
param_decls={
|
571
|
-
"num_of_cliffords": Integer(),
|
572
|
-
},
|
625
|
+
],
|
573
626
|
)
|
574
627
|
|
575
628
|
|
576
629
|
INPLACE_PREPARE_STATE = QuantumFunctionDeclaration(
|
577
630
|
name="inplace_prepare_state",
|
578
|
-
|
579
|
-
|
580
|
-
|
631
|
+
positional_arg_declarations=[
|
632
|
+
ClassicalParameterDeclaration(
|
633
|
+
name="probabilities",
|
634
|
+
classical_type=ClassicalList(element_type=Real()),
|
635
|
+
),
|
636
|
+
ClassicalParameterDeclaration(
|
637
|
+
name="bound",
|
638
|
+
classical_type=Real(),
|
639
|
+
),
|
640
|
+
PortDeclaration(
|
581
641
|
name="target",
|
582
642
|
direction=PortDeclarationDirection.Inout,
|
583
643
|
size=Expression(expr="log(get_field(probabilities, 'len'), 2)"),
|
584
|
-
)
|
585
|
-
|
644
|
+
),
|
645
|
+
],
|
586
646
|
)
|
587
647
|
|
588
648
|
|
589
649
|
INPLACE_PREPARE_AMPLITUDES = QuantumFunctionDeclaration(
|
590
650
|
name="inplace_prepare_amplitudes",
|
591
|
-
|
592
|
-
|
593
|
-
|
651
|
+
positional_arg_declarations=[
|
652
|
+
ClassicalParameterDeclaration(
|
653
|
+
name="amplitudes",
|
654
|
+
classical_type=ClassicalList(element_type=Real()),
|
655
|
+
),
|
656
|
+
ClassicalParameterDeclaration(
|
657
|
+
name="bound",
|
658
|
+
classical_type=Real(),
|
659
|
+
),
|
660
|
+
PortDeclaration(
|
594
661
|
name="target",
|
595
662
|
direction=PortDeclarationDirection.Inout,
|
596
663
|
size=Expression(expr="log(get_field(amplitudes, 'len'), 2)"),
|
597
|
-
)
|
598
|
-
|
664
|
+
),
|
665
|
+
],
|
599
666
|
)
|
600
667
|
|
601
668
|
|