classiq 0.45.1__py3-none-any.whl → 0.46.1__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 +27 -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 +111 -0
- classiq/qmod/builtins/functions/finance.py +34 -0
- classiq/qmod/builtins/functions/grover.py +178 -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 +357 -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.1.dist-info}/METADATA +1 -1
- {classiq-0.45.1.dist-info → classiq-0.46.1.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.1.dist-info}/WHEEL +0 -0
@@ -1,1029 +0,0 @@
|
|
1
|
-
# This file was generated automatically - do not edit manually
|
2
|
-
|
3
|
-
from classiq.qmod.builtins.enums import Pauli
|
4
|
-
from classiq.qmod.qfunc import qfunc
|
5
|
-
from classiq.qmod.qmod_parameter import CArray, CBool, CInt, CReal
|
6
|
-
from classiq.qmod.qmod_variable import Input, Output, QArray, QBit, QNum
|
7
|
-
from classiq.qmod.quantum_callable import QCallable, QCallableList
|
8
|
-
|
9
|
-
from .structs import *
|
10
|
-
|
11
|
-
|
12
|
-
@qfunc(external=True)
|
13
|
-
def permute(
|
14
|
-
functions: QCallableList,
|
15
|
-
) -> None:
|
16
|
-
pass
|
17
|
-
|
18
|
-
|
19
|
-
@qfunc(external=True)
|
20
|
-
def apply(
|
21
|
-
operand: QCallable,
|
22
|
-
) -> None:
|
23
|
-
pass
|
24
|
-
|
25
|
-
|
26
|
-
@qfunc(external=True)
|
27
|
-
def molecule_ucc(
|
28
|
-
molecule_problem: MoleculeProblem,
|
29
|
-
excitations: CArray[CInt],
|
30
|
-
qbv: QArray[QBit],
|
31
|
-
) -> None:
|
32
|
-
pass
|
33
|
-
|
34
|
-
|
35
|
-
@qfunc(external=True)
|
36
|
-
def molecule_hva(
|
37
|
-
molecule_problem: MoleculeProblem,
|
38
|
-
reps: CInt,
|
39
|
-
qbv: QArray[QBit],
|
40
|
-
) -> None:
|
41
|
-
pass
|
42
|
-
|
43
|
-
|
44
|
-
@qfunc(external=True)
|
45
|
-
def molecule_hartree_fock(
|
46
|
-
molecule_problem: MoleculeProblem,
|
47
|
-
qbv: QArray[QBit],
|
48
|
-
) -> None:
|
49
|
-
pass
|
50
|
-
|
51
|
-
|
52
|
-
@qfunc(external=True)
|
53
|
-
def fock_hamiltonian_ucc(
|
54
|
-
fock_hamiltonian_problem: FockHamiltonianProblem,
|
55
|
-
excitations: CArray[CInt],
|
56
|
-
qbv: QArray[QBit],
|
57
|
-
) -> None:
|
58
|
-
pass
|
59
|
-
|
60
|
-
|
61
|
-
@qfunc(external=True)
|
62
|
-
def fock_hamiltonian_hva(
|
63
|
-
fock_hamiltonian_problem: FockHamiltonianProblem,
|
64
|
-
reps: CInt,
|
65
|
-
qbv: QArray[QBit],
|
66
|
-
) -> None:
|
67
|
-
pass
|
68
|
-
|
69
|
-
|
70
|
-
@qfunc(external=True)
|
71
|
-
def fock_hamiltonian_hartree_fock(
|
72
|
-
fock_hamiltonian_problem: FockHamiltonianProblem,
|
73
|
-
qbv: QArray[QBit],
|
74
|
-
) -> None:
|
75
|
-
pass
|
76
|
-
|
77
|
-
|
78
|
-
@qfunc(external=True)
|
79
|
-
def log_normal_finance(
|
80
|
-
finance_model: LogNormalModel,
|
81
|
-
finance_function: FinanceFunction,
|
82
|
-
func_port: QArray[QBit],
|
83
|
-
obj_port: QBit,
|
84
|
-
) -> None:
|
85
|
-
pass
|
86
|
-
|
87
|
-
|
88
|
-
@qfunc(external=True)
|
89
|
-
def gaussian_finance(
|
90
|
-
finance_model: GaussianModel,
|
91
|
-
finance_function: FinanceFunction,
|
92
|
-
func_port: QArray[QBit],
|
93
|
-
obj_port: QBit,
|
94
|
-
) -> None:
|
95
|
-
pass
|
96
|
-
|
97
|
-
|
98
|
-
@qfunc(external=True)
|
99
|
-
def pauli_feature_map(
|
100
|
-
feature_map: QSVMFeatureMapPauli,
|
101
|
-
qbv: QArray[QBit],
|
102
|
-
) -> None:
|
103
|
-
pass
|
104
|
-
|
105
|
-
|
106
|
-
@qfunc(external=True)
|
107
|
-
def bloch_sphere_feature_map(
|
108
|
-
feature_dimension: CInt,
|
109
|
-
qbv: QArray[QBit],
|
110
|
-
) -> None:
|
111
|
-
pass
|
112
|
-
|
113
|
-
|
114
|
-
@qfunc(external=True)
|
115
|
-
def H(
|
116
|
-
target: QBit,
|
117
|
-
) -> None:
|
118
|
-
pass
|
119
|
-
|
120
|
-
|
121
|
-
@qfunc(external=True)
|
122
|
-
def X(
|
123
|
-
target: QBit,
|
124
|
-
) -> None:
|
125
|
-
pass
|
126
|
-
|
127
|
-
|
128
|
-
@qfunc(external=True)
|
129
|
-
def Y(
|
130
|
-
target: QBit,
|
131
|
-
) -> None:
|
132
|
-
pass
|
133
|
-
|
134
|
-
|
135
|
-
@qfunc(external=True)
|
136
|
-
def Z(
|
137
|
-
target: QBit,
|
138
|
-
) -> None:
|
139
|
-
pass
|
140
|
-
|
141
|
-
|
142
|
-
@qfunc(external=True)
|
143
|
-
def I(
|
144
|
-
target: QBit,
|
145
|
-
) -> None:
|
146
|
-
pass
|
147
|
-
|
148
|
-
|
149
|
-
@qfunc(external=True)
|
150
|
-
def S(
|
151
|
-
target: QBit,
|
152
|
-
) -> None:
|
153
|
-
pass
|
154
|
-
|
155
|
-
|
156
|
-
@qfunc(external=True)
|
157
|
-
def T(
|
158
|
-
target: QBit,
|
159
|
-
) -> None:
|
160
|
-
pass
|
161
|
-
|
162
|
-
|
163
|
-
@qfunc(external=True)
|
164
|
-
def SDG(
|
165
|
-
target: QBit,
|
166
|
-
) -> None:
|
167
|
-
pass
|
168
|
-
|
169
|
-
|
170
|
-
@qfunc(external=True)
|
171
|
-
def TDG(
|
172
|
-
target: QBit,
|
173
|
-
) -> None:
|
174
|
-
pass
|
175
|
-
|
176
|
-
|
177
|
-
@qfunc(external=True)
|
178
|
-
def PHASE(
|
179
|
-
theta: CReal,
|
180
|
-
target: QBit,
|
181
|
-
) -> None:
|
182
|
-
pass
|
183
|
-
|
184
|
-
|
185
|
-
@qfunc(external=True)
|
186
|
-
def RX(
|
187
|
-
theta: CReal,
|
188
|
-
target: QBit,
|
189
|
-
) -> None:
|
190
|
-
pass
|
191
|
-
|
192
|
-
|
193
|
-
@qfunc(external=True)
|
194
|
-
def RY(
|
195
|
-
theta: CReal,
|
196
|
-
target: QBit,
|
197
|
-
) -> None:
|
198
|
-
pass
|
199
|
-
|
200
|
-
|
201
|
-
@qfunc(external=True)
|
202
|
-
def RZ(
|
203
|
-
theta: CReal,
|
204
|
-
target: QBit,
|
205
|
-
) -> None:
|
206
|
-
pass
|
207
|
-
|
208
|
-
|
209
|
-
@qfunc(external=True)
|
210
|
-
def R(
|
211
|
-
theta: CReal,
|
212
|
-
phi: CReal,
|
213
|
-
target: QBit,
|
214
|
-
) -> None:
|
215
|
-
pass
|
216
|
-
|
217
|
-
|
218
|
-
@qfunc(external=True)
|
219
|
-
def RXX(
|
220
|
-
theta: CReal,
|
221
|
-
target: QArray[QBit],
|
222
|
-
) -> None:
|
223
|
-
pass
|
224
|
-
|
225
|
-
|
226
|
-
@qfunc(external=True)
|
227
|
-
def RYY(
|
228
|
-
theta: CReal,
|
229
|
-
target: QArray[QBit],
|
230
|
-
) -> None:
|
231
|
-
pass
|
232
|
-
|
233
|
-
|
234
|
-
@qfunc(external=True)
|
235
|
-
def RZZ(
|
236
|
-
theta: CReal,
|
237
|
-
target: QArray[QBit],
|
238
|
-
) -> None:
|
239
|
-
pass
|
240
|
-
|
241
|
-
|
242
|
-
@qfunc(external=True)
|
243
|
-
def CH(
|
244
|
-
control: QBit,
|
245
|
-
target: QBit,
|
246
|
-
) -> None:
|
247
|
-
pass
|
248
|
-
|
249
|
-
|
250
|
-
@qfunc(external=True)
|
251
|
-
def CX(
|
252
|
-
control: QBit,
|
253
|
-
target: QBit,
|
254
|
-
) -> None:
|
255
|
-
pass
|
256
|
-
|
257
|
-
|
258
|
-
@qfunc(external=True)
|
259
|
-
def CY(
|
260
|
-
control: QBit,
|
261
|
-
target: QBit,
|
262
|
-
) -> None:
|
263
|
-
pass
|
264
|
-
|
265
|
-
|
266
|
-
@qfunc(external=True)
|
267
|
-
def CZ(
|
268
|
-
control: QBit,
|
269
|
-
target: QBit,
|
270
|
-
) -> None:
|
271
|
-
pass
|
272
|
-
|
273
|
-
|
274
|
-
@qfunc(external=True)
|
275
|
-
def CRX(
|
276
|
-
theta: CReal,
|
277
|
-
control: QBit,
|
278
|
-
target: QBit,
|
279
|
-
) -> None:
|
280
|
-
pass
|
281
|
-
|
282
|
-
|
283
|
-
@qfunc(external=True)
|
284
|
-
def CRY(
|
285
|
-
theta: CReal,
|
286
|
-
control: QBit,
|
287
|
-
target: QBit,
|
288
|
-
) -> None:
|
289
|
-
pass
|
290
|
-
|
291
|
-
|
292
|
-
@qfunc(external=True)
|
293
|
-
def CRZ(
|
294
|
-
theta: CReal,
|
295
|
-
control: QBit,
|
296
|
-
target: QBit,
|
297
|
-
) -> None:
|
298
|
-
pass
|
299
|
-
|
300
|
-
|
301
|
-
@qfunc(external=True)
|
302
|
-
def CPHASE(
|
303
|
-
theta: CReal,
|
304
|
-
control: QBit,
|
305
|
-
target: QBit,
|
306
|
-
) -> None:
|
307
|
-
pass
|
308
|
-
|
309
|
-
|
310
|
-
@qfunc(external=True)
|
311
|
-
def SWAP(
|
312
|
-
qbit0: QBit,
|
313
|
-
qbit1: QBit,
|
314
|
-
) -> None:
|
315
|
-
pass
|
316
|
-
|
317
|
-
|
318
|
-
@qfunc(external=True)
|
319
|
-
def IDENTITY(
|
320
|
-
target: QArray[QBit],
|
321
|
-
) -> None:
|
322
|
-
pass
|
323
|
-
|
324
|
-
|
325
|
-
@qfunc(external=True)
|
326
|
-
def prepare_state(
|
327
|
-
probabilities: CArray[CReal],
|
328
|
-
bound: CReal,
|
329
|
-
out: Output[QArray[QBit]],
|
330
|
-
) -> None:
|
331
|
-
pass
|
332
|
-
|
333
|
-
|
334
|
-
@qfunc(external=True)
|
335
|
-
def prepare_amplitudes(
|
336
|
-
amplitudes: CArray[CReal],
|
337
|
-
bound: CReal,
|
338
|
-
out: Output[QArray[QBit]],
|
339
|
-
) -> None:
|
340
|
-
pass
|
341
|
-
|
342
|
-
|
343
|
-
@qfunc(external=True)
|
344
|
-
def unitary(
|
345
|
-
elements: CArray[CArray[CReal]],
|
346
|
-
target: QArray[QBit],
|
347
|
-
) -> None:
|
348
|
-
pass
|
349
|
-
|
350
|
-
|
351
|
-
@qfunc(external=True)
|
352
|
-
def add(
|
353
|
-
left: QArray[QBit],
|
354
|
-
right: QArray[QBit],
|
355
|
-
result: Output[QArray[QBit]],
|
356
|
-
) -> None:
|
357
|
-
pass
|
358
|
-
|
359
|
-
|
360
|
-
@qfunc(external=True)
|
361
|
-
def modular_add(
|
362
|
-
left: QArray[QBit],
|
363
|
-
right: QArray[QBit],
|
364
|
-
) -> None:
|
365
|
-
pass
|
366
|
-
|
367
|
-
|
368
|
-
@qfunc(external=True)
|
369
|
-
def integer_xor(
|
370
|
-
left: QArray[QBit],
|
371
|
-
right: QArray[QBit],
|
372
|
-
) -> None:
|
373
|
-
pass
|
374
|
-
|
375
|
-
|
376
|
-
@qfunc(external=True)
|
377
|
-
def U(
|
378
|
-
theta: CReal,
|
379
|
-
phi: CReal,
|
380
|
-
lam: CReal,
|
381
|
-
gam: CReal,
|
382
|
-
target: QBit,
|
383
|
-
) -> None:
|
384
|
-
pass
|
385
|
-
|
386
|
-
|
387
|
-
@qfunc(external=True)
|
388
|
-
def CCX(
|
389
|
-
control: QArray[QBit],
|
390
|
-
target: QBit,
|
391
|
-
) -> None:
|
392
|
-
pass
|
393
|
-
|
394
|
-
|
395
|
-
@qfunc(external=True)
|
396
|
-
def allocate(
|
397
|
-
num_qubits: CInt,
|
398
|
-
out: Output[QArray[QBit]],
|
399
|
-
) -> None:
|
400
|
-
pass
|
401
|
-
|
402
|
-
|
403
|
-
@qfunc(external=True)
|
404
|
-
def free(
|
405
|
-
in_: Input[QArray[QBit]],
|
406
|
-
) -> None:
|
407
|
-
pass
|
408
|
-
|
409
|
-
|
410
|
-
@qfunc(external=True)
|
411
|
-
def randomized_benchmarking(
|
412
|
-
num_of_cliffords: CInt,
|
413
|
-
target: QArray[QBit],
|
414
|
-
) -> None:
|
415
|
-
pass
|
416
|
-
|
417
|
-
|
418
|
-
@qfunc(external=True)
|
419
|
-
def inplace_prepare_state(
|
420
|
-
probabilities: CArray[CReal],
|
421
|
-
bound: CReal,
|
422
|
-
target: QArray[QBit],
|
423
|
-
) -> None:
|
424
|
-
pass
|
425
|
-
|
426
|
-
|
427
|
-
@qfunc(external=True)
|
428
|
-
def inplace_prepare_amplitudes(
|
429
|
-
amplitudes: CArray[CReal],
|
430
|
-
bound: CReal,
|
431
|
-
target: QArray[QBit],
|
432
|
-
) -> None:
|
433
|
-
pass
|
434
|
-
|
435
|
-
|
436
|
-
@qfunc(external=True)
|
437
|
-
def single_pauli_exponent(
|
438
|
-
pauli_string: CArray[Pauli],
|
439
|
-
coefficient: CReal,
|
440
|
-
qbv: QArray[QBit],
|
441
|
-
) -> None:
|
442
|
-
pass
|
443
|
-
|
444
|
-
|
445
|
-
@qfunc(external=True)
|
446
|
-
def suzuki_trotter(
|
447
|
-
pauli_operator: CArray[PauliTerm],
|
448
|
-
evolution_coefficient: CReal,
|
449
|
-
order: CInt,
|
450
|
-
repetitions: CInt,
|
451
|
-
qbv: QArray[QBit],
|
452
|
-
) -> None:
|
453
|
-
pass
|
454
|
-
|
455
|
-
|
456
|
-
@qfunc(external=True)
|
457
|
-
def qdrift(
|
458
|
-
pauli_operator: CArray[PauliTerm],
|
459
|
-
evolution_coefficient: CReal,
|
460
|
-
num_qdrift: CInt,
|
461
|
-
qbv: QArray[QBit],
|
462
|
-
) -> None:
|
463
|
-
pass
|
464
|
-
|
465
|
-
|
466
|
-
@qfunc(external=True)
|
467
|
-
def exponentiation_with_depth_constraint(
|
468
|
-
pauli_operator: CArray[PauliTerm],
|
469
|
-
evolution_coefficient: CReal,
|
470
|
-
max_depth: CInt,
|
471
|
-
qbv: QArray[QBit],
|
472
|
-
) -> None:
|
473
|
-
pass
|
474
|
-
|
475
|
-
|
476
|
-
@qfunc(external=True)
|
477
|
-
def qpe_flexible(
|
478
|
-
unitary_with_power: QCallable[CInt],
|
479
|
-
phase: QNum,
|
480
|
-
) -> None:
|
481
|
-
pass
|
482
|
-
|
483
|
-
|
484
|
-
@qfunc(external=True)
|
485
|
-
def qpe(
|
486
|
-
unitary: QCallable,
|
487
|
-
phase: QNum,
|
488
|
-
) -> None:
|
489
|
-
pass
|
490
|
-
|
491
|
-
|
492
|
-
@qfunc(external=True)
|
493
|
-
def single_pauli(
|
494
|
-
slope: CReal,
|
495
|
-
offset: CReal,
|
496
|
-
q1_qfunc: QCallable[CReal, QBit],
|
497
|
-
x: QArray[QBit],
|
498
|
-
q: QBit,
|
499
|
-
) -> None:
|
500
|
-
pass
|
501
|
-
|
502
|
-
|
503
|
-
@qfunc(external=True)
|
504
|
-
def linear_pauli_rotations(
|
505
|
-
bases: CArray[Pauli],
|
506
|
-
slopes: CArray[CReal],
|
507
|
-
offsets: CArray[CReal],
|
508
|
-
x: QArray[QBit],
|
509
|
-
q: QArray[QBit],
|
510
|
-
) -> None:
|
511
|
-
pass
|
512
|
-
|
513
|
-
|
514
|
-
@qfunc(external=True)
|
515
|
-
def amplitude_estimation(
|
516
|
-
oracle: QCallable[QArray[QBit]],
|
517
|
-
space_transform: QCallable[QArray[QBit]],
|
518
|
-
phase: QNum,
|
519
|
-
packed_vars: QArray[QBit],
|
520
|
-
) -> None:
|
521
|
-
pass
|
522
|
-
|
523
|
-
|
524
|
-
@qfunc(external=True)
|
525
|
-
def phase_oracle(
|
526
|
-
predicate: QCallable[QArray[QBit], QBit],
|
527
|
-
target: QArray[QBit],
|
528
|
-
) -> None:
|
529
|
-
pass
|
530
|
-
|
531
|
-
|
532
|
-
@qfunc(external=True)
|
533
|
-
def reflect_about_zero(
|
534
|
-
packed_vars: QArray[QBit],
|
535
|
-
) -> None:
|
536
|
-
pass
|
537
|
-
|
538
|
-
|
539
|
-
@qfunc(external=True)
|
540
|
-
def grover_diffuser(
|
541
|
-
space_transform: QCallable[QArray[QBit]],
|
542
|
-
packed_vars: QArray[QBit],
|
543
|
-
) -> None:
|
544
|
-
pass
|
545
|
-
|
546
|
-
|
547
|
-
@qfunc(external=True)
|
548
|
-
def grover_operator(
|
549
|
-
oracle: QCallable[QArray[QBit]],
|
550
|
-
space_transform: QCallable[QArray[QBit]],
|
551
|
-
packed_vars: QArray[QBit],
|
552
|
-
) -> None:
|
553
|
-
pass
|
554
|
-
|
555
|
-
|
556
|
-
@qfunc(external=True)
|
557
|
-
def grover_search(
|
558
|
-
reps: CInt,
|
559
|
-
oracle: QCallable[QArray[QBit]],
|
560
|
-
packed_vars: QArray[QBit],
|
561
|
-
) -> None:
|
562
|
-
pass
|
563
|
-
|
564
|
-
|
565
|
-
@qfunc(external=True)
|
566
|
-
def hadamard_transform(
|
567
|
-
target: QArray[QBit],
|
568
|
-
) -> None:
|
569
|
-
pass
|
570
|
-
|
571
|
-
|
572
|
-
@qfunc(external=True)
|
573
|
-
def apply_to_all(
|
574
|
-
gate_operand: QCallable[QBit],
|
575
|
-
target: QArray[QBit],
|
576
|
-
) -> None:
|
577
|
-
pass
|
578
|
-
|
579
|
-
|
580
|
-
@qfunc(external=True)
|
581
|
-
def qft_no_swap(
|
582
|
-
qbv: QArray[QBit],
|
583
|
-
) -> None:
|
584
|
-
pass
|
585
|
-
|
586
|
-
|
587
|
-
@qfunc(external=True)
|
588
|
-
def _check_msb(
|
589
|
-
ref: CInt,
|
590
|
-
x: QArray[QBit],
|
591
|
-
aux: QBit,
|
592
|
-
) -> None:
|
593
|
-
pass
|
594
|
-
|
595
|
-
|
596
|
-
@qfunc(external=True)
|
597
|
-
def _ctrl_x(
|
598
|
-
ref: CInt,
|
599
|
-
ctrl: QNum,
|
600
|
-
aux: QBit,
|
601
|
-
) -> None:
|
602
|
-
pass
|
603
|
-
|
604
|
-
|
605
|
-
@qfunc(external=True)
|
606
|
-
def qft_space_add_const(
|
607
|
-
value: CInt,
|
608
|
-
phi_b: QArray[QBit],
|
609
|
-
) -> None:
|
610
|
-
pass
|
611
|
-
|
612
|
-
|
613
|
-
@qfunc(external=True)
|
614
|
-
def cc_modular_add(
|
615
|
-
n: CInt,
|
616
|
-
a: CInt,
|
617
|
-
phi_b: QArray[QBit],
|
618
|
-
c1: QBit,
|
619
|
-
c2: QBit,
|
620
|
-
) -> None:
|
621
|
-
pass
|
622
|
-
|
623
|
-
|
624
|
-
@qfunc(external=True)
|
625
|
-
def c_modular_multiply(
|
626
|
-
n: CInt,
|
627
|
-
a: CInt,
|
628
|
-
b: QArray[QBit],
|
629
|
-
x: QArray[QBit],
|
630
|
-
ctrl: QBit,
|
631
|
-
) -> None:
|
632
|
-
pass
|
633
|
-
|
634
|
-
|
635
|
-
@qfunc(external=True)
|
636
|
-
def multiswap(
|
637
|
-
x: QArray[QBit],
|
638
|
-
y: QArray[QBit],
|
639
|
-
) -> None:
|
640
|
-
pass
|
641
|
-
|
642
|
-
|
643
|
-
@qfunc(external=True)
|
644
|
-
def inplace_c_modular_multiply(
|
645
|
-
n: CInt,
|
646
|
-
a: CInt,
|
647
|
-
x: QArray[QBit],
|
648
|
-
ctrl: QBit,
|
649
|
-
) -> None:
|
650
|
-
pass
|
651
|
-
|
652
|
-
|
653
|
-
@qfunc(external=True)
|
654
|
-
def modular_exp(
|
655
|
-
n: CInt,
|
656
|
-
a: CInt,
|
657
|
-
x: QArray[QBit],
|
658
|
-
power: QArray[QBit],
|
659
|
-
) -> None:
|
660
|
-
pass
|
661
|
-
|
662
|
-
|
663
|
-
@qfunc(external=True)
|
664
|
-
def qsvt_step(
|
665
|
-
phase1: CReal,
|
666
|
-
phase2: CReal,
|
667
|
-
proj_cnot_1: QCallable[QArray[QBit], QBit],
|
668
|
-
proj_cnot_2: QCallable[QArray[QBit], QBit],
|
669
|
-
u: QCallable[QArray[QBit]],
|
670
|
-
qvar: QArray[QBit],
|
671
|
-
aux: QBit,
|
672
|
-
) -> None:
|
673
|
-
pass
|
674
|
-
|
675
|
-
|
676
|
-
@qfunc(external=True)
|
677
|
-
def qsvt(
|
678
|
-
phase_seq: CArray[CReal],
|
679
|
-
proj_cnot_1: QCallable[QArray[QBit], QBit],
|
680
|
-
proj_cnot_2: QCallable[QArray[QBit], QBit],
|
681
|
-
u: QCallable[QArray[QBit]],
|
682
|
-
qvar: QArray[QBit],
|
683
|
-
aux: QBit,
|
684
|
-
) -> None:
|
685
|
-
pass
|
686
|
-
|
687
|
-
|
688
|
-
@qfunc(external=True)
|
689
|
-
def projector_controlled_phase(
|
690
|
-
phase: CReal,
|
691
|
-
proj_cnot: QCallable[QArray[QBit], QBit],
|
692
|
-
qvar: QArray[QBit],
|
693
|
-
aux: QBit,
|
694
|
-
) -> None:
|
695
|
-
pass
|
696
|
-
|
697
|
-
|
698
|
-
@qfunc(external=True)
|
699
|
-
def qsvt_inversion(
|
700
|
-
phase_seq: CArray[CReal],
|
701
|
-
block_encoding_cnot: QCallable[QArray[QBit], QBit],
|
702
|
-
u: QCallable[QArray[QBit]],
|
703
|
-
qvar: QArray[QBit],
|
704
|
-
aux: QBit,
|
705
|
-
) -> None:
|
706
|
-
pass
|
707
|
-
|
708
|
-
|
709
|
-
@qfunc(external=True)
|
710
|
-
def allocate_num(
|
711
|
-
num_qubits: CInt,
|
712
|
-
is_signed: CBool,
|
713
|
-
fraction_digits: CInt,
|
714
|
-
out: Output[QNum],
|
715
|
-
) -> None:
|
716
|
-
pass
|
717
|
-
|
718
|
-
|
719
|
-
@qfunc(external=True)
|
720
|
-
def qaoa_mixer_layer(
|
721
|
-
b: CReal,
|
722
|
-
target: QArray[QBit],
|
723
|
-
) -> None:
|
724
|
-
pass
|
725
|
-
|
726
|
-
|
727
|
-
@qfunc(external=True)
|
728
|
-
def qaoa_cost_layer(
|
729
|
-
g: CReal,
|
730
|
-
hamiltonian: CArray[PauliTerm],
|
731
|
-
target: QArray[QBit],
|
732
|
-
) -> None:
|
733
|
-
pass
|
734
|
-
|
735
|
-
|
736
|
-
@qfunc(external=True)
|
737
|
-
def qaoa_layer(
|
738
|
-
g: CReal,
|
739
|
-
b: CReal,
|
740
|
-
hamiltonian: CArray[PauliTerm],
|
741
|
-
target: QArray[QBit],
|
742
|
-
) -> None:
|
743
|
-
pass
|
744
|
-
|
745
|
-
|
746
|
-
@qfunc(external=True)
|
747
|
-
def qaoa_init(
|
748
|
-
target: QArray[QBit],
|
749
|
-
) -> None:
|
750
|
-
pass
|
751
|
-
|
752
|
-
|
753
|
-
@qfunc(external=True)
|
754
|
-
def qaoa_penalty(
|
755
|
-
num_qubits: CInt,
|
756
|
-
params_list: CArray[CReal],
|
757
|
-
hamiltonian: CArray[PauliTerm],
|
758
|
-
target: QArray[QBit],
|
759
|
-
) -> None:
|
760
|
-
pass
|
761
|
-
|
762
|
-
|
763
|
-
@qfunc(external=True)
|
764
|
-
def full_hea(
|
765
|
-
num_qubits: CInt,
|
766
|
-
is_parametrized: CArray[CInt],
|
767
|
-
angle_params: CArray[CReal],
|
768
|
-
connectivity_map: CArray[CArray[CInt]],
|
769
|
-
reps: CInt,
|
770
|
-
operands_1qubit: QCallableList[CReal, QBit],
|
771
|
-
operands_2qubit: QCallableList[CReal, QBit, QBit],
|
772
|
-
x: QArray[QBit],
|
773
|
-
) -> None:
|
774
|
-
pass
|
775
|
-
|
776
|
-
|
777
|
-
@qfunc(external=True)
|
778
|
-
def swap_test(
|
779
|
-
state1: QArray[QBit],
|
780
|
-
state2: QArray[QBit],
|
781
|
-
test: Output[QBit],
|
782
|
-
) -> None:
|
783
|
-
pass
|
784
|
-
|
785
|
-
|
786
|
-
@qfunc(external=True)
|
787
|
-
def _prepare_uniform_trimmed_state_step(
|
788
|
-
size_lsb: CInt,
|
789
|
-
ctrl_val: CInt,
|
790
|
-
lsbs_val: CInt,
|
791
|
-
ctrl_var: QNum,
|
792
|
-
rotation_var: QBit,
|
793
|
-
) -> None:
|
794
|
-
pass
|
795
|
-
|
796
|
-
|
797
|
-
@qfunc(external=True)
|
798
|
-
def prepare_uniform_trimmed_state(
|
799
|
-
m: CInt,
|
800
|
-
q: QArray[QBit],
|
801
|
-
) -> None:
|
802
|
-
pass
|
803
|
-
|
804
|
-
|
805
|
-
@qfunc(external=True)
|
806
|
-
def prepare_uniform_interval_state(
|
807
|
-
start: CInt,
|
808
|
-
end: CInt,
|
809
|
-
q: QArray[QBit],
|
810
|
-
) -> None:
|
811
|
-
pass
|
812
|
-
|
813
|
-
|
814
|
-
@qfunc(external=True)
|
815
|
-
def prepare_ghz_state(
|
816
|
-
size: CInt,
|
817
|
-
q: Output[QArray[QBit]],
|
818
|
-
) -> None:
|
819
|
-
pass
|
820
|
-
|
821
|
-
|
822
|
-
@qfunc(external=True)
|
823
|
-
def prepare_exponential_state(
|
824
|
-
rate: CInt,
|
825
|
-
q: QArray[QBit],
|
826
|
-
) -> None:
|
827
|
-
pass
|
828
|
-
|
829
|
-
|
830
|
-
@qfunc(external=True)
|
831
|
-
def prepare_bell_state(
|
832
|
-
state_num: CInt,
|
833
|
-
q: Output[QArray[QBit]],
|
834
|
-
) -> None:
|
835
|
-
pass
|
836
|
-
|
837
|
-
|
838
|
-
@qfunc(external=True)
|
839
|
-
def inplace_prepare_int(
|
840
|
-
value: CInt,
|
841
|
-
target: QArray[QBit],
|
842
|
-
) -> None:
|
843
|
-
pass
|
844
|
-
|
845
|
-
|
846
|
-
@qfunc(external=True)
|
847
|
-
def prepare_int(
|
848
|
-
value: CInt,
|
849
|
-
out: Output[QNum],
|
850
|
-
) -> None:
|
851
|
-
pass
|
852
|
-
|
853
|
-
|
854
|
-
@qfunc(external=True)
|
855
|
-
def switch(
|
856
|
-
selector: CInt,
|
857
|
-
cases: QCallableList,
|
858
|
-
) -> None:
|
859
|
-
pass
|
860
|
-
|
861
|
-
|
862
|
-
@qfunc(external=True)
|
863
|
-
def _qct_d_operator(
|
864
|
-
x: QNum,
|
865
|
-
q: QBit,
|
866
|
-
) -> None:
|
867
|
-
pass
|
868
|
-
|
869
|
-
|
870
|
-
@qfunc(external=True)
|
871
|
-
def _qct_pi_operator(
|
872
|
-
x: QArray[QBit],
|
873
|
-
q: QBit,
|
874
|
-
) -> None:
|
875
|
-
pass
|
876
|
-
|
877
|
-
|
878
|
-
@qfunc(external=True)
|
879
|
-
def qct_qst_type1(
|
880
|
-
x: QArray[QBit],
|
881
|
-
) -> None:
|
882
|
-
pass
|
883
|
-
|
884
|
-
|
885
|
-
@qfunc(external=True)
|
886
|
-
def qct_qst_type2(
|
887
|
-
x: QArray[QBit],
|
888
|
-
q: QBit,
|
889
|
-
) -> None:
|
890
|
-
pass
|
891
|
-
|
892
|
-
|
893
|
-
@qfunc(external=True)
|
894
|
-
def qct_type2(
|
895
|
-
x: QArray[QBit],
|
896
|
-
) -> None:
|
897
|
-
pass
|
898
|
-
|
899
|
-
|
900
|
-
@qfunc(external=True)
|
901
|
-
def qst_type2(
|
902
|
-
x: QArray[QBit],
|
903
|
-
) -> None:
|
904
|
-
pass
|
905
|
-
|
906
|
-
|
907
|
-
@qfunc(external=True)
|
908
|
-
def modular_increment(
|
909
|
-
a: CInt,
|
910
|
-
x: QArray[QBit],
|
911
|
-
) -> None:
|
912
|
-
pass
|
913
|
-
|
914
|
-
|
915
|
-
@qfunc(external=True)
|
916
|
-
def qft(
|
917
|
-
target: QArray[QBit],
|
918
|
-
) -> None:
|
919
|
-
pass
|
920
|
-
|
921
|
-
|
922
|
-
__all__ = [
|
923
|
-
"permute",
|
924
|
-
"apply",
|
925
|
-
"molecule_ucc",
|
926
|
-
"molecule_hva",
|
927
|
-
"molecule_hartree_fock",
|
928
|
-
"fock_hamiltonian_ucc",
|
929
|
-
"fock_hamiltonian_hva",
|
930
|
-
"fock_hamiltonian_hartree_fock",
|
931
|
-
"log_normal_finance",
|
932
|
-
"gaussian_finance",
|
933
|
-
"pauli_feature_map",
|
934
|
-
"bloch_sphere_feature_map",
|
935
|
-
"H",
|
936
|
-
"X",
|
937
|
-
"Y",
|
938
|
-
"Z",
|
939
|
-
"I",
|
940
|
-
"S",
|
941
|
-
"T",
|
942
|
-
"SDG",
|
943
|
-
"TDG",
|
944
|
-
"PHASE",
|
945
|
-
"RX",
|
946
|
-
"RY",
|
947
|
-
"RZ",
|
948
|
-
"R",
|
949
|
-
"RXX",
|
950
|
-
"RYY",
|
951
|
-
"RZZ",
|
952
|
-
"CH",
|
953
|
-
"CX",
|
954
|
-
"CY",
|
955
|
-
"CZ",
|
956
|
-
"CRX",
|
957
|
-
"CRY",
|
958
|
-
"CRZ",
|
959
|
-
"CPHASE",
|
960
|
-
"SWAP",
|
961
|
-
"IDENTITY",
|
962
|
-
"prepare_state",
|
963
|
-
"prepare_amplitudes",
|
964
|
-
"unitary",
|
965
|
-
"add",
|
966
|
-
"modular_add",
|
967
|
-
"integer_xor",
|
968
|
-
"U",
|
969
|
-
"CCX",
|
970
|
-
"allocate",
|
971
|
-
"free",
|
972
|
-
"randomized_benchmarking",
|
973
|
-
"inplace_prepare_state",
|
974
|
-
"inplace_prepare_amplitudes",
|
975
|
-
"single_pauli_exponent",
|
976
|
-
"suzuki_trotter",
|
977
|
-
"qdrift",
|
978
|
-
"exponentiation_with_depth_constraint",
|
979
|
-
"qpe_flexible",
|
980
|
-
"qpe",
|
981
|
-
"single_pauli",
|
982
|
-
"linear_pauli_rotations",
|
983
|
-
"amplitude_estimation",
|
984
|
-
"phase_oracle",
|
985
|
-
"reflect_about_zero",
|
986
|
-
"grover_diffuser",
|
987
|
-
"grover_operator",
|
988
|
-
"grover_search",
|
989
|
-
"hadamard_transform",
|
990
|
-
"apply_to_all",
|
991
|
-
"qft_no_swap",
|
992
|
-
"_check_msb",
|
993
|
-
"_ctrl_x",
|
994
|
-
"qft_space_add_const",
|
995
|
-
"cc_modular_add",
|
996
|
-
"c_modular_multiply",
|
997
|
-
"multiswap",
|
998
|
-
"inplace_c_modular_multiply",
|
999
|
-
"modular_exp",
|
1000
|
-
"qsvt_step",
|
1001
|
-
"qsvt",
|
1002
|
-
"projector_controlled_phase",
|
1003
|
-
"qsvt_inversion",
|
1004
|
-
"allocate_num",
|
1005
|
-
"qaoa_mixer_layer",
|
1006
|
-
"qaoa_cost_layer",
|
1007
|
-
"qaoa_layer",
|
1008
|
-
"qaoa_init",
|
1009
|
-
"qaoa_penalty",
|
1010
|
-
"full_hea",
|
1011
|
-
"swap_test",
|
1012
|
-
"_prepare_uniform_trimmed_state_step",
|
1013
|
-
"prepare_uniform_trimmed_state",
|
1014
|
-
"prepare_uniform_interval_state",
|
1015
|
-
"prepare_ghz_state",
|
1016
|
-
"prepare_exponential_state",
|
1017
|
-
"prepare_bell_state",
|
1018
|
-
"inplace_prepare_int",
|
1019
|
-
"prepare_int",
|
1020
|
-
"switch",
|
1021
|
-
"_qct_d_operator",
|
1022
|
-
"_qct_pi_operator",
|
1023
|
-
"qct_qst_type1",
|
1024
|
-
"qct_qst_type2",
|
1025
|
-
"qct_type2",
|
1026
|
-
"qst_type2",
|
1027
|
-
"modular_increment",
|
1028
|
-
"qft",
|
1029
|
-
]
|