classiq 0.45.1__py3-none-any.whl → 0.46.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 +0 -1
- classiq/_internals/__init__.py +20 -0
- classiq/_internals/authentication/authentication.py +11 -0
- classiq/analyzer/analyzer.py +12 -10
- classiq/applications/combinatorial_helpers/combinatorial_problem_utils.py +1 -1
- classiq/applications/combinatorial_helpers/pauli_helpers/pauli_utils.py +1 -1
- classiq/applications/combinatorial_optimization/combinatorial_optimization_model_constructor.py +1 -1
- classiq/applications/libraries/qmci_library.py +4 -9
- classiq/execution/execution_session.py +68 -7
- classiq/executor.py +14 -2
- classiq/interface/_version.py +1 -1
- classiq/interface/backend/backend_preferences.py +189 -0
- classiq/interface/backend/quantum_backend_providers.py +38 -0
- classiq/interface/debug_info/debug_info.py +22 -2
- classiq/interface/exceptions.py +16 -1
- classiq/interface/executor/execution_preferences.py +18 -0
- classiq/interface/generator/application_apis/chemistry_declarations.py +1 -177
- classiq/interface/generator/application_apis/combinatorial_optimization_declarations.py +0 -12
- classiq/interface/generator/application_apis/finance_declarations.py +8 -43
- classiq/interface/generator/application_apis/qsvm_declarations.py +0 -78
- classiq/interface/generator/builtin_api_builder.py +0 -3
- classiq/interface/generator/functions/__init__.py +0 -2
- classiq/interface/generator/functions/builtins/__init__.py +0 -15
- classiq/interface/generator/generated_circuit_data.py +2 -0
- classiq/interface/generator/hardware/hardware_data.py +37 -0
- classiq/interface/generator/model/constraints.py +18 -1
- classiq/interface/generator/model/preferences/preferences.py +53 -1
- classiq/interface/generator/model/quantum_register.py +1 -1
- classiq/interface/generator/quantum_program.py +10 -2
- classiq/interface/generator/transpiler_basis_gates.py +4 -0
- classiq/interface/generator/types/builtin_enum_declarations.py +136 -21
- classiq/interface/generator/types/enum_declaration.py +1 -3
- classiq/interface/generator/types/struct_declaration.py +1 -3
- classiq/interface/hardware.py +5 -0
- classiq/interface/ide/visual_model.py +1 -1
- classiq/interface/model/classical_parameter_declaration.py +6 -0
- classiq/interface/model/inplace_binary_operation.py +0 -14
- classiq/interface/model/model.py +1 -18
- classiq/interface/model/port_declaration.py +4 -2
- classiq/interface/model/quantum_function_declaration.py +19 -6
- classiq/interface/model/quantum_lambda_function.py +11 -1
- classiq/interface/model/quantum_variable_declaration.py +1 -1
- classiq/model_expansions/__init__.py +0 -0
- classiq/model_expansions/atomic_expression_functions_defs.py +250 -0
- classiq/model_expansions/capturing/__init__.py +0 -0
- classiq/model_expansions/capturing/captured_var_manager.py +50 -0
- classiq/model_expansions/capturing/mangling_utils.py +17 -0
- classiq/model_expansions/capturing/propagated_var_stack.py +180 -0
- classiq/model_expansions/closure.py +160 -0
- classiq/model_expansions/debug_flag.py +3 -0
- classiq/model_expansions/evaluators/__init__.py +0 -0
- classiq/model_expansions/evaluators/arg_type_match.py +160 -0
- classiq/model_expansions/evaluators/argument_types.py +42 -0
- classiq/model_expansions/evaluators/classical_expression.py +36 -0
- classiq/model_expansions/evaluators/control.py +144 -0
- classiq/model_expansions/evaluators/parameter_types.py +227 -0
- classiq/model_expansions/evaluators/quantum_type_utils.py +235 -0
- classiq/model_expansions/evaluators/type_type_match.py +90 -0
- classiq/model_expansions/expression_evaluator.py +125 -0
- classiq/model_expansions/expression_renamer.py +76 -0
- classiq/model_expansions/function_builder.py +192 -0
- classiq/model_expansions/generative_functions.py +101 -0
- classiq/model_expansions/interpreter.py +365 -0
- classiq/model_expansions/model_tables.py +105 -0
- classiq/model_expansions/quantum_operations/__init__.py +19 -0
- classiq/model_expansions/quantum_operations/bind.py +64 -0
- classiq/model_expansions/quantum_operations/classicalif.py +39 -0
- classiq/model_expansions/quantum_operations/control.py +235 -0
- classiq/model_expansions/quantum_operations/emitter.py +215 -0
- classiq/model_expansions/quantum_operations/expression_operation.py +218 -0
- classiq/model_expansions/quantum_operations/inplace_binary_operation.py +250 -0
- classiq/model_expansions/quantum_operations/invert.py +38 -0
- classiq/model_expansions/quantum_operations/power.py +74 -0
- classiq/model_expansions/quantum_operations/quantum_assignment_operation.py +174 -0
- classiq/model_expansions/quantum_operations/quantum_function_call.py +15 -0
- classiq/model_expansions/quantum_operations/repeat.py +33 -0
- classiq/model_expansions/quantum_operations/variable_decleration.py +28 -0
- classiq/model_expansions/quantum_operations/within_apply.py +46 -0
- classiq/model_expansions/scope.py +226 -0
- classiq/model_expansions/scope_initialization.py +136 -0
- classiq/model_expansions/sympy_conversion/__init__.py +0 -0
- classiq/model_expansions/sympy_conversion/arithmetics.py +49 -0
- classiq/model_expansions/sympy_conversion/expression_to_sympy.py +150 -0
- classiq/model_expansions/sympy_conversion/sympy_to_python.py +113 -0
- classiq/model_expansions/utils/__init__.py +0 -0
- classiq/model_expansions/utils/counted_name_allocator.py +11 -0
- classiq/model_expansions/visitors/__init__.py +0 -0
- classiq/model_expansions/visitors/boolean_expression_transformers.py +214 -0
- classiq/model_expansions/visitors/variable_references.py +115 -0
- classiq/qmod/__init__.py +1 -3
- classiq/qmod/builtins/enums.py +33 -2
- classiq/qmod/builtins/functions/__init__.py +251 -0
- classiq/qmod/builtins/functions/amplitude_estimation.py +26 -0
- classiq/qmod/builtins/functions/arithmetic.py +68 -0
- classiq/qmod/builtins/functions/benchmarking.py +8 -0
- classiq/qmod/builtins/functions/chemistry.py +91 -0
- classiq/qmod/builtins/functions/discrete_sine_cosine_transform.py +105 -0
- classiq/qmod/builtins/functions/exponentiation.py +110 -0
- classiq/qmod/builtins/functions/finance.py +34 -0
- classiq/qmod/builtins/functions/grover.py +179 -0
- classiq/qmod/builtins/functions/hea.py +59 -0
- classiq/qmod/builtins/functions/linear_pauli_rotation.py +65 -0
- classiq/qmod/builtins/functions/modular_exponentiation.py +137 -0
- classiq/qmod/builtins/functions/operators.py +22 -0
- classiq/qmod/builtins/functions/qaoa_penalty.py +116 -0
- classiq/qmod/builtins/functions/qft.py +23 -0
- classiq/qmod/builtins/functions/qpe.py +39 -0
- classiq/qmod/builtins/functions/qsvm.py +24 -0
- classiq/qmod/builtins/functions/qsvt.py +136 -0
- classiq/qmod/builtins/functions/standard_gates.py +739 -0
- classiq/qmod/builtins/functions/state_preparation.py +356 -0
- classiq/qmod/builtins/functions/swap_test.py +25 -0
- classiq/qmod/builtins/structs.py +50 -28
- classiq/qmod/cparam.py +64 -0
- classiq/qmod/create_model_function.py +190 -0
- classiq/qmod/declaration_inferrer.py +52 -81
- classiq/qmod/expression_query.py +16 -0
- classiq/qmod/generative.py +48 -0
- classiq/qmod/model_state_container.py +1 -2
- classiq/qmod/native/pretty_printer.py +7 -11
- classiq/qmod/pretty_print/pretty_printer.py +7 -11
- classiq/qmod/python_classical_type.py +67 -0
- classiq/qmod/qfunc.py +19 -4
- classiq/qmod/qmod_parameter.py +15 -64
- classiq/qmod/qmod_variable.py +27 -45
- classiq/qmod/quantum_callable.py +1 -1
- classiq/qmod/quantum_expandable.py +10 -4
- classiq/qmod/quantum_function.py +22 -40
- classiq/qmod/semantics/error_manager.py +22 -10
- classiq/qmod/semantics/static_semantics_visitor.py +10 -12
- classiq/qmod/semantics/validation/types_validation.py +6 -7
- classiq/qmod/utilities.py +2 -2
- classiq/qmod/write_qmod.py +14 -0
- classiq/show.py +10 -0
- classiq/synthesis.py +46 -2
- {classiq-0.45.1.dist-info → classiq-0.46.0.dist-info}/METADATA +1 -1
- {classiq-0.45.1.dist-info → classiq-0.46.0.dist-info}/RECORD +138 -74
- classiq/interface/generator/functions/builtins/core_library/__init__.py +0 -16
- classiq/interface/generator/functions/builtins/core_library/atomic_quantum_functions.py +0 -710
- classiq/interface/generator/functions/builtins/core_library/exponentiation_functions.py +0 -105
- classiq/interface/generator/functions/builtins/open_lib_functions.py +0 -2489
- classiq/interface/generator/functions/builtins/quantum_operators.py +0 -24
- classiq/interface/generator/types/builtin_struct_declarations/__init__.py +0 -1
- classiq/interface/generator/types/builtin_struct_declarations/pauli_struct_declarations.py +0 -21
- classiq/qmod/builtins/functions.py +0 -1029
- {classiq-0.45.1.dist-info → classiq-0.46.0.dist-info}/WHEEL +0 -0
@@ -1,710 +0,0 @@
|
|
1
|
-
from classiq.interface.generator.expressions.expression import Expression
|
2
|
-
from classiq.interface.generator.functions.classical_type import (
|
3
|
-
ClassicalList,
|
4
|
-
Integer,
|
5
|
-
Real,
|
6
|
-
)
|
7
|
-
from classiq.interface.generator.functions.port_declaration import (
|
8
|
-
PortDeclarationDirection,
|
9
|
-
)
|
10
|
-
from classiq.interface.model.classical_parameter_declaration import (
|
11
|
-
ClassicalParameterDeclaration,
|
12
|
-
)
|
13
|
-
from classiq.interface.model.port_declaration import PortDeclaration
|
14
|
-
from classiq.interface.model.quantum_function_declaration import (
|
15
|
-
NamedParamsQuantumFunctionDeclaration,
|
16
|
-
)
|
17
|
-
|
18
|
-
DEFAULT_TARGET_NAME = "target"
|
19
|
-
|
20
|
-
H_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
21
|
-
name="H",
|
22
|
-
positional_arg_declarations=[
|
23
|
-
PortDeclaration(
|
24
|
-
name=DEFAULT_TARGET_NAME,
|
25
|
-
direction=PortDeclarationDirection.Inout,
|
26
|
-
size=Expression(expr="1"),
|
27
|
-
),
|
28
|
-
],
|
29
|
-
)
|
30
|
-
|
31
|
-
|
32
|
-
X_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
33
|
-
name="X",
|
34
|
-
positional_arg_declarations=[
|
35
|
-
PortDeclaration(
|
36
|
-
name=DEFAULT_TARGET_NAME,
|
37
|
-
direction=PortDeclarationDirection.Inout,
|
38
|
-
size=Expression(expr="1"),
|
39
|
-
),
|
40
|
-
],
|
41
|
-
)
|
42
|
-
|
43
|
-
|
44
|
-
Y_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
45
|
-
name="Y",
|
46
|
-
positional_arg_declarations=[
|
47
|
-
PortDeclaration(
|
48
|
-
name=DEFAULT_TARGET_NAME,
|
49
|
-
direction=PortDeclarationDirection.Inout,
|
50
|
-
size=Expression(expr="1"),
|
51
|
-
),
|
52
|
-
],
|
53
|
-
)
|
54
|
-
|
55
|
-
Z_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
56
|
-
name="Z",
|
57
|
-
positional_arg_declarations=[
|
58
|
-
PortDeclaration(
|
59
|
-
name=DEFAULT_TARGET_NAME,
|
60
|
-
direction=PortDeclarationDirection.Inout,
|
61
|
-
size=Expression(expr="1"),
|
62
|
-
),
|
63
|
-
],
|
64
|
-
)
|
65
|
-
|
66
|
-
|
67
|
-
I_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
68
|
-
name="I",
|
69
|
-
positional_arg_declarations=[
|
70
|
-
PortDeclaration(
|
71
|
-
name=DEFAULT_TARGET_NAME,
|
72
|
-
direction=PortDeclarationDirection.Inout,
|
73
|
-
size=Expression(expr="1"),
|
74
|
-
),
|
75
|
-
],
|
76
|
-
)
|
77
|
-
|
78
|
-
|
79
|
-
S_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
80
|
-
name="S",
|
81
|
-
positional_arg_declarations=[
|
82
|
-
PortDeclaration(
|
83
|
-
name=DEFAULT_TARGET_NAME,
|
84
|
-
direction=PortDeclarationDirection.Inout,
|
85
|
-
size=Expression(expr="1"),
|
86
|
-
),
|
87
|
-
],
|
88
|
-
)
|
89
|
-
|
90
|
-
|
91
|
-
T_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
92
|
-
name="T",
|
93
|
-
positional_arg_declarations=[
|
94
|
-
PortDeclaration(
|
95
|
-
name=DEFAULT_TARGET_NAME,
|
96
|
-
direction=PortDeclarationDirection.Inout,
|
97
|
-
size=Expression(expr="1"),
|
98
|
-
),
|
99
|
-
],
|
100
|
-
)
|
101
|
-
|
102
|
-
|
103
|
-
SDG_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
104
|
-
name="SDG",
|
105
|
-
positional_arg_declarations=[
|
106
|
-
PortDeclaration(
|
107
|
-
name=DEFAULT_TARGET_NAME,
|
108
|
-
direction=PortDeclarationDirection.Inout,
|
109
|
-
size=Expression(expr="1"),
|
110
|
-
),
|
111
|
-
],
|
112
|
-
)
|
113
|
-
|
114
|
-
|
115
|
-
TDG_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
116
|
-
name="TDG",
|
117
|
-
positional_arg_declarations=[
|
118
|
-
PortDeclaration(
|
119
|
-
name=DEFAULT_TARGET_NAME,
|
120
|
-
direction=PortDeclarationDirection.Inout,
|
121
|
-
size=Expression(expr="1"),
|
122
|
-
),
|
123
|
-
],
|
124
|
-
)
|
125
|
-
|
126
|
-
|
127
|
-
PHASE_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
128
|
-
name="PHASE",
|
129
|
-
positional_arg_declarations=[
|
130
|
-
ClassicalParameterDeclaration(
|
131
|
-
name="theta",
|
132
|
-
classical_type=Real(),
|
133
|
-
),
|
134
|
-
PortDeclaration(
|
135
|
-
name=DEFAULT_TARGET_NAME,
|
136
|
-
direction=PortDeclarationDirection.Inout,
|
137
|
-
size=Expression(expr="1"),
|
138
|
-
),
|
139
|
-
],
|
140
|
-
)
|
141
|
-
|
142
|
-
|
143
|
-
RX_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
144
|
-
name="RX",
|
145
|
-
positional_arg_declarations=[
|
146
|
-
ClassicalParameterDeclaration(
|
147
|
-
name="theta",
|
148
|
-
classical_type=Real(),
|
149
|
-
),
|
150
|
-
PortDeclaration(
|
151
|
-
name=DEFAULT_TARGET_NAME,
|
152
|
-
direction=PortDeclarationDirection.Inout,
|
153
|
-
size=Expression(expr="1"),
|
154
|
-
),
|
155
|
-
],
|
156
|
-
)
|
157
|
-
|
158
|
-
|
159
|
-
RY_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
160
|
-
name="RY",
|
161
|
-
positional_arg_declarations=[
|
162
|
-
ClassicalParameterDeclaration(
|
163
|
-
name="theta",
|
164
|
-
classical_type=Real(),
|
165
|
-
),
|
166
|
-
PortDeclaration(
|
167
|
-
name=DEFAULT_TARGET_NAME,
|
168
|
-
direction=PortDeclarationDirection.Inout,
|
169
|
-
size=Expression(expr="1"),
|
170
|
-
),
|
171
|
-
],
|
172
|
-
)
|
173
|
-
|
174
|
-
|
175
|
-
RZ_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
176
|
-
name="RZ",
|
177
|
-
positional_arg_declarations=[
|
178
|
-
ClassicalParameterDeclaration(
|
179
|
-
name="theta",
|
180
|
-
classical_type=Real(),
|
181
|
-
),
|
182
|
-
PortDeclaration(
|
183
|
-
name=DEFAULT_TARGET_NAME,
|
184
|
-
direction=PortDeclarationDirection.Inout,
|
185
|
-
size=Expression(expr="1"),
|
186
|
-
),
|
187
|
-
],
|
188
|
-
)
|
189
|
-
|
190
|
-
R_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
191
|
-
name="R",
|
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(
|
202
|
-
name=DEFAULT_TARGET_NAME,
|
203
|
-
direction=PortDeclarationDirection.Inout,
|
204
|
-
size=Expression(expr="1"),
|
205
|
-
),
|
206
|
-
],
|
207
|
-
)
|
208
|
-
|
209
|
-
|
210
|
-
RXX_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
211
|
-
name="RXX",
|
212
|
-
positional_arg_declarations=[
|
213
|
-
ClassicalParameterDeclaration(
|
214
|
-
name="theta",
|
215
|
-
classical_type=Real(),
|
216
|
-
),
|
217
|
-
PortDeclaration(
|
218
|
-
name=DEFAULT_TARGET_NAME,
|
219
|
-
direction=PortDeclarationDirection.Inout,
|
220
|
-
size=Expression(expr="2"),
|
221
|
-
),
|
222
|
-
],
|
223
|
-
)
|
224
|
-
|
225
|
-
|
226
|
-
RYY_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
227
|
-
name="RYY",
|
228
|
-
positional_arg_declarations=[
|
229
|
-
ClassicalParameterDeclaration(
|
230
|
-
name="theta",
|
231
|
-
classical_type=Real(),
|
232
|
-
),
|
233
|
-
PortDeclaration(
|
234
|
-
name=DEFAULT_TARGET_NAME,
|
235
|
-
direction=PortDeclarationDirection.Inout,
|
236
|
-
size=Expression(expr="2"),
|
237
|
-
),
|
238
|
-
],
|
239
|
-
)
|
240
|
-
|
241
|
-
|
242
|
-
RZZ_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
243
|
-
name="RZZ",
|
244
|
-
positional_arg_declarations=[
|
245
|
-
ClassicalParameterDeclaration(
|
246
|
-
name="theta",
|
247
|
-
classical_type=Real(),
|
248
|
-
),
|
249
|
-
PortDeclaration(
|
250
|
-
name=DEFAULT_TARGET_NAME,
|
251
|
-
direction=PortDeclarationDirection.Inout,
|
252
|
-
size=Expression(expr="2"),
|
253
|
-
),
|
254
|
-
],
|
255
|
-
)
|
256
|
-
|
257
|
-
|
258
|
-
CH_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
259
|
-
name="CH",
|
260
|
-
positional_arg_declarations=[
|
261
|
-
PortDeclaration(
|
262
|
-
name="control",
|
263
|
-
direction=PortDeclarationDirection.Inout,
|
264
|
-
size=Expression(expr="1"),
|
265
|
-
),
|
266
|
-
PortDeclaration(
|
267
|
-
name=DEFAULT_TARGET_NAME,
|
268
|
-
direction=PortDeclarationDirection.Inout,
|
269
|
-
size=Expression(expr="1"),
|
270
|
-
),
|
271
|
-
],
|
272
|
-
)
|
273
|
-
|
274
|
-
|
275
|
-
CX_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
276
|
-
name="CX",
|
277
|
-
positional_arg_declarations=[
|
278
|
-
PortDeclaration(
|
279
|
-
name="control",
|
280
|
-
direction=PortDeclarationDirection.Inout,
|
281
|
-
size=Expression(expr="1"),
|
282
|
-
),
|
283
|
-
PortDeclaration(
|
284
|
-
name=DEFAULT_TARGET_NAME,
|
285
|
-
direction=PortDeclarationDirection.Inout,
|
286
|
-
size=Expression(expr="1"),
|
287
|
-
),
|
288
|
-
],
|
289
|
-
)
|
290
|
-
|
291
|
-
|
292
|
-
CY_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
293
|
-
name="CY",
|
294
|
-
positional_arg_declarations=[
|
295
|
-
PortDeclaration(
|
296
|
-
name="control",
|
297
|
-
direction=PortDeclarationDirection.Inout,
|
298
|
-
size=Expression(expr="1"),
|
299
|
-
),
|
300
|
-
PortDeclaration(
|
301
|
-
name=DEFAULT_TARGET_NAME,
|
302
|
-
direction=PortDeclarationDirection.Inout,
|
303
|
-
size=Expression(expr="1"),
|
304
|
-
),
|
305
|
-
],
|
306
|
-
)
|
307
|
-
|
308
|
-
|
309
|
-
CZ_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
310
|
-
name="CZ",
|
311
|
-
positional_arg_declarations=[
|
312
|
-
PortDeclaration(
|
313
|
-
name="control",
|
314
|
-
direction=PortDeclarationDirection.Inout,
|
315
|
-
size=Expression(expr="1"),
|
316
|
-
),
|
317
|
-
PortDeclaration(
|
318
|
-
name=DEFAULT_TARGET_NAME,
|
319
|
-
direction=PortDeclarationDirection.Inout,
|
320
|
-
size=Expression(expr="1"),
|
321
|
-
),
|
322
|
-
],
|
323
|
-
)
|
324
|
-
|
325
|
-
|
326
|
-
CRX_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
327
|
-
name="CRX",
|
328
|
-
positional_arg_declarations=[
|
329
|
-
ClassicalParameterDeclaration(
|
330
|
-
name="theta",
|
331
|
-
classical_type=Real(),
|
332
|
-
),
|
333
|
-
PortDeclaration(
|
334
|
-
name="control",
|
335
|
-
direction=PortDeclarationDirection.Inout,
|
336
|
-
size=Expression(expr="1"),
|
337
|
-
),
|
338
|
-
PortDeclaration(
|
339
|
-
name=DEFAULT_TARGET_NAME,
|
340
|
-
direction=PortDeclarationDirection.Inout,
|
341
|
-
size=Expression(expr="1"),
|
342
|
-
),
|
343
|
-
],
|
344
|
-
)
|
345
|
-
|
346
|
-
|
347
|
-
CRY_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
348
|
-
name="CRY",
|
349
|
-
positional_arg_declarations=[
|
350
|
-
ClassicalParameterDeclaration(
|
351
|
-
name="theta",
|
352
|
-
classical_type=Real(),
|
353
|
-
),
|
354
|
-
PortDeclaration(
|
355
|
-
name="control",
|
356
|
-
direction=PortDeclarationDirection.Inout,
|
357
|
-
size=Expression(expr="1"),
|
358
|
-
),
|
359
|
-
PortDeclaration(
|
360
|
-
name=DEFAULT_TARGET_NAME,
|
361
|
-
direction=PortDeclarationDirection.Inout,
|
362
|
-
size=Expression(expr="1"),
|
363
|
-
),
|
364
|
-
],
|
365
|
-
)
|
366
|
-
|
367
|
-
|
368
|
-
CRZ_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
369
|
-
name="CRZ",
|
370
|
-
positional_arg_declarations=[
|
371
|
-
ClassicalParameterDeclaration(
|
372
|
-
name="theta",
|
373
|
-
classical_type=Real(),
|
374
|
-
),
|
375
|
-
PortDeclaration(
|
376
|
-
name="control",
|
377
|
-
direction=PortDeclarationDirection.Inout,
|
378
|
-
size=Expression(expr="1"),
|
379
|
-
),
|
380
|
-
PortDeclaration(
|
381
|
-
name=DEFAULT_TARGET_NAME,
|
382
|
-
direction=PortDeclarationDirection.Inout,
|
383
|
-
size=Expression(expr="1"),
|
384
|
-
),
|
385
|
-
],
|
386
|
-
)
|
387
|
-
|
388
|
-
|
389
|
-
CPHASE_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
390
|
-
name="CPHASE",
|
391
|
-
positional_arg_declarations=[
|
392
|
-
ClassicalParameterDeclaration(
|
393
|
-
name="theta",
|
394
|
-
classical_type=Real(),
|
395
|
-
),
|
396
|
-
PortDeclaration(
|
397
|
-
name="control",
|
398
|
-
direction=PortDeclarationDirection.Inout,
|
399
|
-
size=Expression(expr="1"),
|
400
|
-
),
|
401
|
-
PortDeclaration(
|
402
|
-
name=DEFAULT_TARGET_NAME,
|
403
|
-
direction=PortDeclarationDirection.Inout,
|
404
|
-
size=Expression(expr="1"),
|
405
|
-
),
|
406
|
-
],
|
407
|
-
)
|
408
|
-
|
409
|
-
|
410
|
-
SWAP_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
411
|
-
name="SWAP",
|
412
|
-
positional_arg_declarations=[
|
413
|
-
PortDeclaration(
|
414
|
-
name="qbit0",
|
415
|
-
direction=PortDeclarationDirection.Inout,
|
416
|
-
size=Expression(expr="1"),
|
417
|
-
),
|
418
|
-
PortDeclaration(
|
419
|
-
name="qbit1",
|
420
|
-
direction=PortDeclarationDirection.Inout,
|
421
|
-
size=Expression(expr="1"),
|
422
|
-
),
|
423
|
-
],
|
424
|
-
)
|
425
|
-
|
426
|
-
|
427
|
-
IDENTITY_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
428
|
-
name="IDENTITY",
|
429
|
-
positional_arg_declarations=[
|
430
|
-
PortDeclaration(
|
431
|
-
name=DEFAULT_TARGET_NAME,
|
432
|
-
direction=PortDeclarationDirection.Inout,
|
433
|
-
)
|
434
|
-
],
|
435
|
-
)
|
436
|
-
|
437
|
-
UNITARY_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
438
|
-
name="unitary",
|
439
|
-
positional_arg_declarations=[
|
440
|
-
ClassicalParameterDeclaration(
|
441
|
-
name="elements",
|
442
|
-
classical_type=ClassicalList(
|
443
|
-
element_type=ClassicalList(element_type=Real())
|
444
|
-
),
|
445
|
-
),
|
446
|
-
PortDeclaration(
|
447
|
-
name=DEFAULT_TARGET_NAME,
|
448
|
-
direction=PortDeclarationDirection.Inout,
|
449
|
-
size=Expression(expr="log(get_field(elements[0], 'len'), 2)"),
|
450
|
-
),
|
451
|
-
],
|
452
|
-
)
|
453
|
-
|
454
|
-
|
455
|
-
PREPARE_STATE_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
456
|
-
name="prepare_state",
|
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(
|
464
|
-
name="out",
|
465
|
-
direction=PortDeclarationDirection.Output,
|
466
|
-
size=Expression(expr="log(get_field(probabilities, 'len'), 2)"),
|
467
|
-
),
|
468
|
-
],
|
469
|
-
)
|
470
|
-
|
471
|
-
PREPARE_AMPLITUDES_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
472
|
-
name="prepare_amplitudes",
|
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(
|
483
|
-
name="out",
|
484
|
-
direction=PortDeclarationDirection.Output,
|
485
|
-
size=Expression(expr="log(get_field(amplitudes, 'len'), 2)"),
|
486
|
-
),
|
487
|
-
],
|
488
|
-
)
|
489
|
-
|
490
|
-
ADD_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
491
|
-
name="add",
|
492
|
-
positional_arg_declarations=[
|
493
|
-
PortDeclaration(
|
494
|
-
name="left",
|
495
|
-
direction=PortDeclarationDirection.Inout,
|
496
|
-
),
|
497
|
-
PortDeclaration(
|
498
|
-
name="right",
|
499
|
-
direction=PortDeclarationDirection.Inout,
|
500
|
-
),
|
501
|
-
PortDeclaration(
|
502
|
-
name="result",
|
503
|
-
direction=PortDeclarationDirection.Output,
|
504
|
-
size=Expression(
|
505
|
-
expr="Max(get_field(left, 'len'), get_field(right, 'len')) + 1"
|
506
|
-
),
|
507
|
-
),
|
508
|
-
],
|
509
|
-
)
|
510
|
-
|
511
|
-
|
512
|
-
MODULAR_ADD_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
513
|
-
name="modular_add",
|
514
|
-
positional_arg_declarations=[
|
515
|
-
PortDeclaration(
|
516
|
-
name="left",
|
517
|
-
direction=PortDeclarationDirection.Inout,
|
518
|
-
),
|
519
|
-
PortDeclaration(
|
520
|
-
name="right",
|
521
|
-
direction=PortDeclarationDirection.Inout,
|
522
|
-
),
|
523
|
-
],
|
524
|
-
)
|
525
|
-
|
526
|
-
|
527
|
-
INTEGER_XOR_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
528
|
-
name="integer_xor",
|
529
|
-
positional_arg_declarations=[
|
530
|
-
PortDeclaration(
|
531
|
-
name="left",
|
532
|
-
direction=PortDeclarationDirection.Inout,
|
533
|
-
),
|
534
|
-
PortDeclaration(
|
535
|
-
name="right",
|
536
|
-
direction=PortDeclarationDirection.Inout,
|
537
|
-
),
|
538
|
-
],
|
539
|
-
)
|
540
|
-
|
541
|
-
|
542
|
-
U_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
543
|
-
name="U",
|
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(
|
562
|
-
name=DEFAULT_TARGET_NAME,
|
563
|
-
direction=PortDeclarationDirection.Inout,
|
564
|
-
size=Expression(expr="1"),
|
565
|
-
),
|
566
|
-
],
|
567
|
-
)
|
568
|
-
|
569
|
-
|
570
|
-
CCX_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
571
|
-
name="CCX",
|
572
|
-
positional_arg_declarations=[
|
573
|
-
PortDeclaration(
|
574
|
-
name="control",
|
575
|
-
direction=PortDeclarationDirection.Inout,
|
576
|
-
size=Expression(expr="2"),
|
577
|
-
),
|
578
|
-
PortDeclaration(
|
579
|
-
name=DEFAULT_TARGET_NAME,
|
580
|
-
direction=PortDeclarationDirection.Inout,
|
581
|
-
size=Expression(expr="1"),
|
582
|
-
),
|
583
|
-
],
|
584
|
-
)
|
585
|
-
|
586
|
-
|
587
|
-
ALLOCATE_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
588
|
-
name="allocate",
|
589
|
-
positional_arg_declarations=[
|
590
|
-
ClassicalParameterDeclaration(
|
591
|
-
name="num_qubits",
|
592
|
-
classical_type=Integer(),
|
593
|
-
),
|
594
|
-
PortDeclaration(
|
595
|
-
name="out",
|
596
|
-
direction=PortDeclarationDirection.Output,
|
597
|
-
size=Expression(expr="num_qubits"),
|
598
|
-
),
|
599
|
-
],
|
600
|
-
)
|
601
|
-
|
602
|
-
|
603
|
-
FREE_FUNCTION = NamedParamsQuantumFunctionDeclaration(
|
604
|
-
name="free",
|
605
|
-
positional_arg_declarations=[
|
606
|
-
PortDeclaration(
|
607
|
-
name="in",
|
608
|
-
direction=PortDeclarationDirection.Input,
|
609
|
-
)
|
610
|
-
],
|
611
|
-
)
|
612
|
-
|
613
|
-
|
614
|
-
RANDOMIZED_BENCHMARKING = NamedParamsQuantumFunctionDeclaration(
|
615
|
-
name="randomized_benchmarking",
|
616
|
-
positional_arg_declarations=[
|
617
|
-
ClassicalParameterDeclaration(
|
618
|
-
name="num_of_cliffords",
|
619
|
-
classical_type=Integer(),
|
620
|
-
),
|
621
|
-
PortDeclaration(
|
622
|
-
name=DEFAULT_TARGET_NAME,
|
623
|
-
direction=PortDeclarationDirection.Inout,
|
624
|
-
),
|
625
|
-
],
|
626
|
-
)
|
627
|
-
|
628
|
-
|
629
|
-
INPLACE_PREPARE_STATE = NamedParamsQuantumFunctionDeclaration(
|
630
|
-
name="inplace_prepare_state",
|
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(
|
641
|
-
name="target",
|
642
|
-
direction=PortDeclarationDirection.Inout,
|
643
|
-
size=Expression(expr="log(get_field(probabilities, 'len'), 2)"),
|
644
|
-
),
|
645
|
-
],
|
646
|
-
)
|
647
|
-
|
648
|
-
|
649
|
-
INPLACE_PREPARE_AMPLITUDES = NamedParamsQuantumFunctionDeclaration(
|
650
|
-
name="inplace_prepare_amplitudes",
|
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(
|
661
|
-
name="target",
|
662
|
-
direction=PortDeclarationDirection.Inout,
|
663
|
-
size=Expression(expr="log(get_field(amplitudes, 'len'), 2)"),
|
664
|
-
),
|
665
|
-
],
|
666
|
-
)
|
667
|
-
|
668
|
-
|
669
|
-
__all__ = [
|
670
|
-
"H_FUNCTION",
|
671
|
-
"X_FUNCTION",
|
672
|
-
"Y_FUNCTION",
|
673
|
-
"Z_FUNCTION",
|
674
|
-
"I_FUNCTION",
|
675
|
-
"S_FUNCTION",
|
676
|
-
"T_FUNCTION",
|
677
|
-
"SDG_FUNCTION",
|
678
|
-
"TDG_FUNCTION",
|
679
|
-
"PHASE_FUNCTION",
|
680
|
-
"RX_FUNCTION",
|
681
|
-
"RY_FUNCTION",
|
682
|
-
"RZ_FUNCTION",
|
683
|
-
"R_FUNCTION",
|
684
|
-
"RXX_FUNCTION",
|
685
|
-
"RYY_FUNCTION",
|
686
|
-
"RZZ_FUNCTION",
|
687
|
-
"CH_FUNCTION",
|
688
|
-
"CX_FUNCTION",
|
689
|
-
"CY_FUNCTION",
|
690
|
-
"CZ_FUNCTION",
|
691
|
-
"CRX_FUNCTION",
|
692
|
-
"CRY_FUNCTION",
|
693
|
-
"CRZ_FUNCTION",
|
694
|
-
"CPHASE_FUNCTION",
|
695
|
-
"SWAP_FUNCTION",
|
696
|
-
"IDENTITY_FUNCTION",
|
697
|
-
"PREPARE_STATE_FUNCTION",
|
698
|
-
"PREPARE_AMPLITUDES_FUNCTION",
|
699
|
-
"UNITARY_FUNCTION",
|
700
|
-
"ADD_FUNCTION",
|
701
|
-
"MODULAR_ADD_FUNCTION",
|
702
|
-
"INTEGER_XOR_FUNCTION",
|
703
|
-
"U_FUNCTION",
|
704
|
-
"CCX_FUNCTION",
|
705
|
-
"ALLOCATE_FUNCTION",
|
706
|
-
"FREE_FUNCTION",
|
707
|
-
"RANDOMIZED_BENCHMARKING",
|
708
|
-
"INPLACE_PREPARE_STATE",
|
709
|
-
"INPLACE_PREPARE_AMPLITUDES",
|
710
|
-
]
|