classiq 0.38.0__py3-none-any.whl → 0.40.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 +22 -22
- classiq/_internals/api_wrapper.py +13 -1
- classiq/_internals/client.py +12 -2
- classiq/analyzer/analyzer.py +3 -1
- classiq/applications/__init__.py +1 -8
- classiq/applications/chemistry/__init__.py +6 -0
- classiq/{applications_model_constructors → applications/chemistry}/chemistry_model_constructor.py +1 -1
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/arithmetic/arithmetic_expression.py +1 -1
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/combinatorial_problem_utils.py +25 -6
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/encoding_mapping.py +1 -1
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/encoding_utils.py +1 -1
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/memory.py +2 -4
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/optimization_model.py +13 -16
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/pyomo_utils.py +4 -2
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/encoding.py +3 -10
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/fixed_variables.py +4 -6
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/ising_converter.py +3 -5
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/penalty_support.py +3 -7
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/slack_variables.py +4 -6
- classiq/applications/combinatorial_optimization/__init__.py +11 -3
- classiq/{applications_model_constructors → applications/combinatorial_optimization}/combinatorial_optimization_model_constructor.py +9 -10
- classiq/applications/finance/__init__.py +3 -2
- classiq/{applications_model_constructors → applications/finance}/finance_model_constructor.py +24 -14
- classiq/applications/grover/__init__.py +11 -0
- classiq/applications/libraries/qmci_library.py +35 -0
- classiq/applications/qsvm/__init__.py +5 -1
- classiq/execution/all_hardware_devices.py +13 -0
- classiq/executor.py +2 -1
- classiq/interface/_version.py +1 -1
- classiq/interface/analyzer/result.py +1 -5
- classiq/interface/applications/qsvm.py +4 -2
- classiq/interface/ast_node.py +23 -0
- classiq/interface/backend/backend_preferences.py +5 -5
- classiq/interface/backend/quantum_backend_providers.py +7 -7
- classiq/interface/combinatorial_optimization/examples/mht.py +8 -3
- classiq/interface/executor/execution_preferences.py +4 -9
- classiq/interface/executor/execution_request.py +2 -37
- classiq/interface/executor/vqe_result.py +1 -1
- classiq/interface/generator/application_apis/chemistry_declarations.py +2 -4
- classiq/interface/generator/application_apis/finance_declarations.py +1 -1
- classiq/interface/generator/arith/arithmetic_expression_validator.py +2 -0
- classiq/interface/generator/builtin_api_builder.py +0 -5
- classiq/interface/generator/constant.py +2 -3
- classiq/interface/generator/expressions/expression.py +2 -4
- classiq/interface/generator/expressions/qmod_qarray_proxy.py +82 -0
- classiq/interface/generator/expressions/qmod_qscalar_proxy.py +22 -1
- classiq/interface/generator/expressions/qmod_sized_proxy.py +22 -0
- classiq/interface/generator/functions/__init__.py +2 -2
- classiq/interface/generator/functions/builtins/__init__.py +15 -0
- classiq/interface/generator/functions/builtins/core_library/__init__.py +14 -0
- classiq/interface/generator/functions/{core_lib_declarations/quantum_functions → builtins/core_library}/atomic_quantum_functions.py +8 -6
- classiq/interface/generator/functions/{core_lib_declarations/quantum_functions → builtins/core_library}/exponentiation_functions.py +10 -4
- classiq/interface/generator/functions/builtins/internal_operators.py +62 -0
- classiq/interface/generator/functions/{core_lib_declarations/quantum_functions/std_lib_functions.py → builtins/open_lib_functions.py} +893 -319
- classiq/interface/generator/functions/builtins/quantum_operators.py +37 -0
- classiq/interface/generator/functions/classical_type.py +31 -21
- classiq/interface/generator/functions/function_declaration.py +2 -2
- classiq/interface/generator/hartree_fock.py +10 -2
- classiq/interface/generator/model/classical_main_validator.py +1 -1
- classiq/interface/generator/model/model.py +1 -1
- classiq/interface/generator/model/preferences/preferences.py +4 -2
- classiq/interface/generator/quantum_function_call.py +1 -1
- classiq/interface/generator/types/struct_declaration.py +2 -4
- classiq/interface/model/call_synthesis_data.py +3 -3
- classiq/interface/model/classical_if.py +13 -0
- classiq/interface/model/classical_parameter_declaration.py +2 -3
- classiq/interface/model/{quantum_if_operation.py → control.py} +39 -21
- classiq/interface/model/handle_binding.py +3 -2
- classiq/interface/model/invert.py +10 -0
- classiq/interface/model/model.py +2 -1
- classiq/interface/model/power.py +12 -0
- classiq/interface/model/quantum_function_call.py +9 -4
- classiq/interface/model/quantum_lambda_function.py +3 -9
- classiq/interface/model/quantum_statement.py +3 -2
- classiq/interface/model/quantum_type.py +8 -9
- classiq/interface/model/quantum_variable_declaration.py +2 -2
- classiq/interface/model/repeat.py +13 -0
- classiq/interface/model/resolvers/function_call_resolver.py +21 -0
- classiq/interface/model/statement_block.py +18 -4
- classiq/interface/model/validations/handles_validator.py +8 -12
- classiq/interface/model/within_apply_operation.py +4 -4
- classiq/interface/server/routes.py +0 -4
- classiq/qmod/__init__.py +6 -2
- classiq/qmod/builtins/classical_functions.py +34 -39
- classiq/qmod/builtins/functions.py +287 -300
- classiq/qmod/builtins/operations.py +217 -16
- classiq/qmod/builtins/structs.py +50 -48
- classiq/qmod/declaration_inferrer.py +30 -18
- classiq/qmod/native/expression_to_qmod.py +5 -4
- classiq/qmod/native/pretty_printer.py +48 -26
- classiq/qmod/qmod_constant.py +29 -5
- classiq/qmod/qmod_parameter.py +56 -34
- classiq/qmod/qmod_struct.py +2 -2
- classiq/qmod/qmod_variable.py +87 -43
- classiq/qmod/quantum_callable.py +8 -4
- classiq/qmod/quantum_expandable.py +25 -20
- classiq/qmod/quantum_function.py +29 -2
- classiq/qmod/symbolic.py +79 -69
- classiq/qmod/symbolic_expr.py +1 -1
- classiq/qmod/symbolic_type.py +1 -4
- classiq/qmod/utilities.py +29 -0
- {classiq-0.38.0.dist-info → classiq-0.40.0.dist-info}/METADATA +1 -1
- {classiq-0.38.0.dist-info → classiq-0.40.0.dist-info}/RECORD +122 -141
- classiq/applications/benchmarking/__init__.py +0 -9
- classiq/applications/benchmarking/mirror_benchmarking.py +0 -70
- classiq/applications/numpy_utils.py +0 -37
- classiq/applications_model_constructors/__init__.py +0 -25
- classiq/applications_model_constructors/combinatorial_helpers/multiple_comp_basis_sp.py +0 -34
- classiq/applications_model_constructors/libraries/qmci_library.py +0 -107
- classiq/builtin_functions/__init__.py +0 -43
- classiq/builtin_functions/amplitude_loading.py +0 -3
- classiq/builtin_functions/binary_ops.py +0 -1
- classiq/builtin_functions/exponentiation.py +0 -5
- classiq/builtin_functions/qpe.py +0 -4
- classiq/builtin_functions/qsvm.py +0 -7
- classiq/builtin_functions/range_types.py +0 -5
- classiq/builtin_functions/standard_gates.py +0 -1
- classiq/builtin_functions/state_preparation.py +0 -6
- classiq/builtin_functions/suzuki_trotter.py +0 -3
- classiq/interface/executor/error_mitigation.py +0 -6
- classiq/interface/generator/functions/core_lib_declarations/quantum_functions/__init__.py +0 -18
- classiq/interface/generator/functions/core_lib_declarations/quantum_functions/chemistry_functions.py +0 -0
- classiq/interface/generator/functions/core_lib_declarations/quantum_operators.py +0 -95
- classiq/model/__init__.py +0 -14
- classiq/model/composite_function_generator.py +0 -33
- classiq/model/function_handler.py +0 -462
- classiq/model/logic_flow.py +0 -149
- classiq/model/logic_flow_change_handler.py +0 -71
- classiq/model/model.py +0 -229
- classiq/quantum_functions/__init__.py +0 -17
- classiq/quantum_functions/annotation_parser.py +0 -205
- classiq/quantum_functions/decorators.py +0 -22
- classiq/quantum_functions/function_library.py +0 -181
- classiq/quantum_functions/function_parser.py +0 -74
- classiq/quantum_functions/quantum_function.py +0 -236
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/__init__.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/allowed_constraints.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/arithmetic/__init__.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/arithmetic/isolation.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/pauli_helpers/__init__.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/pauli_helpers/pauli_sparsing.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/pauli_helpers/pauli_utils.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/py.typed +0 -0
- /classiq/{applications_model_constructors/combinatorial_helpers/transformations → applications/combinatorial_helpers/solvers}/__init__.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/sympy_utils.py +0 -0
- /classiq/{applications_model_constructors/libraries → applications/combinatorial_helpers/transformations}/__init__.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/penalty.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/sign_seperation.py +0 -0
- /classiq/{applications_model_constructors → applications/grover}/grover_model_constructor.py +0 -0
- /classiq/{interface/generator/functions/core_lib_declarations → applications/libraries}/__init__.py +0 -0
- /classiq/{applications_model_constructors → applications}/libraries/ampltitude_estimation_library.py +0 -0
- /classiq/{applications_model_constructors → applications/qsvm}/qsvm_model_constructor.py +0 -0
- /classiq/{quantum_register.py → interface/model/quantum_register.py} +0 -0
- {classiq-0.38.0.dist-info → classiq-0.40.0.dist-info}/WHEEL +0 -0
@@ -1,15 +1,117 @@
|
|
1
1
|
# This file was generated automatically - do not edit manually
|
2
2
|
|
3
|
-
from
|
3
|
+
from classiq.interface.generator.expressions.enums.pauli import Pauli
|
4
4
|
|
5
5
|
from classiq.qmod.qfunc import qfunc
|
6
|
-
from classiq.qmod.qmod_parameter import
|
6
|
+
from classiq.qmod.qmod_parameter import CArray, CBool, CInt, CReal
|
7
7
|
from classiq.qmod.qmod_variable import Input, Output, QArray, QBit, QNum
|
8
8
|
from classiq.qmod.quantum_callable import QCallable, QCallableList
|
9
9
|
|
10
10
|
from .structs import *
|
11
11
|
|
12
12
|
|
13
|
+
@qfunc(external=True)
|
14
|
+
def permute(
|
15
|
+
functions: QCallableList,
|
16
|
+
) -> None:
|
17
|
+
pass
|
18
|
+
|
19
|
+
|
20
|
+
@qfunc(external=True)
|
21
|
+
def apply(
|
22
|
+
operand: QCallable,
|
23
|
+
) -> None:
|
24
|
+
pass
|
25
|
+
|
26
|
+
|
27
|
+
@qfunc(external=True)
|
28
|
+
def molecule_ucc(
|
29
|
+
molecule_problem: MoleculeProblem,
|
30
|
+
excitations: CArray[CInt],
|
31
|
+
qbv: QArray[QBit],
|
32
|
+
) -> None:
|
33
|
+
pass
|
34
|
+
|
35
|
+
|
36
|
+
@qfunc(external=True)
|
37
|
+
def molecule_hva(
|
38
|
+
molecule_problem: MoleculeProblem,
|
39
|
+
reps: CInt,
|
40
|
+
qbv: QArray[QBit],
|
41
|
+
) -> None:
|
42
|
+
pass
|
43
|
+
|
44
|
+
|
45
|
+
@qfunc(external=True)
|
46
|
+
def molecule_hartree_fock(
|
47
|
+
molecule_problem: MoleculeProblem,
|
48
|
+
qbv: QArray[QBit],
|
49
|
+
) -> None:
|
50
|
+
pass
|
51
|
+
|
52
|
+
|
53
|
+
@qfunc(external=True)
|
54
|
+
def fock_hamiltonian_ucc(
|
55
|
+
fock_hamiltonian_problem: FockHamiltonianProblem,
|
56
|
+
excitations: CArray[CInt],
|
57
|
+
qbv: QArray[QBit],
|
58
|
+
) -> None:
|
59
|
+
pass
|
60
|
+
|
61
|
+
|
62
|
+
@qfunc(external=True)
|
63
|
+
def fock_hamiltonian_hva(
|
64
|
+
fock_hamiltonian_problem: FockHamiltonianProblem,
|
65
|
+
reps: CInt,
|
66
|
+
qbv: QArray[QBit],
|
67
|
+
) -> None:
|
68
|
+
pass
|
69
|
+
|
70
|
+
|
71
|
+
@qfunc(external=True)
|
72
|
+
def fock_hamiltonian_hartree_fock(
|
73
|
+
fock_hamiltonian_problem: FockHamiltonianProblem,
|
74
|
+
qbv: QArray[QBit],
|
75
|
+
) -> None:
|
76
|
+
pass
|
77
|
+
|
78
|
+
|
79
|
+
@qfunc(external=True)
|
80
|
+
def log_normal_finance(
|
81
|
+
finance_model: LogNormalModel,
|
82
|
+
finance_function: FinanceFunction,
|
83
|
+
func_port: QArray[QBit],
|
84
|
+
obj_port: QBit,
|
85
|
+
) -> None:
|
86
|
+
pass
|
87
|
+
|
88
|
+
|
89
|
+
@qfunc(external=True)
|
90
|
+
def gaussian_finance(
|
91
|
+
finance_model: GaussianModel,
|
92
|
+
finance_function: FinanceFunction,
|
93
|
+
func_port: QArray[QBit],
|
94
|
+
obj_port: QBit,
|
95
|
+
) -> None:
|
96
|
+
pass
|
97
|
+
|
98
|
+
|
99
|
+
@qfunc(external=True)
|
100
|
+
def pauli_feature_map(
|
101
|
+
feature_map: QSVMFeatureMapPauli,
|
102
|
+
qbv: QArray[QBit],
|
103
|
+
) -> None:
|
104
|
+
pass
|
105
|
+
|
106
|
+
|
107
|
+
@qfunc(external=True)
|
108
|
+
def bloch_sphere_feature_map(
|
109
|
+
feature_dimension: CInt,
|
110
|
+
qbv: QArray[QBit],
|
111
|
+
) -> None:
|
112
|
+
pass
|
113
|
+
|
114
|
+
|
13
115
|
@qfunc(external=True)
|
14
116
|
def H(
|
15
117
|
target: QBit,
|
@@ -75,7 +177,7 @@ def TDG(
|
|
75
177
|
|
76
178
|
@qfunc(external=True)
|
77
179
|
def PHASE(
|
78
|
-
theta:
|
180
|
+
theta: CReal,
|
79
181
|
target: QBit,
|
80
182
|
) -> None:
|
81
183
|
pass
|
@@ -83,7 +185,7 @@ def PHASE(
|
|
83
185
|
|
84
186
|
@qfunc(external=True)
|
85
187
|
def RX(
|
86
|
-
theta:
|
188
|
+
theta: CReal,
|
87
189
|
target: QBit,
|
88
190
|
) -> None:
|
89
191
|
pass
|
@@ -91,7 +193,7 @@ def RX(
|
|
91
193
|
|
92
194
|
@qfunc(external=True)
|
93
195
|
def RY(
|
94
|
-
theta:
|
196
|
+
theta: CReal,
|
95
197
|
target: QBit,
|
96
198
|
) -> None:
|
97
199
|
pass
|
@@ -99,7 +201,7 @@ def RY(
|
|
99
201
|
|
100
202
|
@qfunc(external=True)
|
101
203
|
def RZ(
|
102
|
-
theta:
|
204
|
+
theta: CReal,
|
103
205
|
target: QBit,
|
104
206
|
) -> None:
|
105
207
|
pass
|
@@ -107,8 +209,8 @@ def RZ(
|
|
107
209
|
|
108
210
|
@qfunc(external=True)
|
109
211
|
def R(
|
110
|
-
theta:
|
111
|
-
phi:
|
212
|
+
theta: CReal,
|
213
|
+
phi: CReal,
|
112
214
|
target: QBit,
|
113
215
|
) -> None:
|
114
216
|
pass
|
@@ -116,24 +218,24 @@ def R(
|
|
116
218
|
|
117
219
|
@qfunc(external=True)
|
118
220
|
def RXX(
|
119
|
-
theta:
|
120
|
-
target: QArray[QBit
|
221
|
+
theta: CReal,
|
222
|
+
target: QArray[QBit],
|
121
223
|
) -> None:
|
122
224
|
pass
|
123
225
|
|
124
226
|
|
125
227
|
@qfunc(external=True)
|
126
228
|
def RYY(
|
127
|
-
theta:
|
128
|
-
target: QArray[QBit
|
229
|
+
theta: CReal,
|
230
|
+
target: QArray[QBit],
|
129
231
|
) -> None:
|
130
232
|
pass
|
131
233
|
|
132
234
|
|
133
235
|
@qfunc(external=True)
|
134
236
|
def RZZ(
|
135
|
-
theta:
|
136
|
-
target: QArray[QBit
|
237
|
+
theta: CReal,
|
238
|
+
target: QArray[QBit],
|
137
239
|
) -> None:
|
138
240
|
pass
|
139
241
|
|
@@ -172,7 +274,7 @@ def CZ(
|
|
172
274
|
|
173
275
|
@qfunc(external=True)
|
174
276
|
def CRX(
|
175
|
-
theta:
|
277
|
+
theta: CReal,
|
176
278
|
control: QBit,
|
177
279
|
target: QBit,
|
178
280
|
) -> None:
|
@@ -181,7 +283,7 @@ def CRX(
|
|
181
283
|
|
182
284
|
@qfunc(external=True)
|
183
285
|
def CRY(
|
184
|
-
theta:
|
286
|
+
theta: CReal,
|
185
287
|
control: QBit,
|
186
288
|
target: QBit,
|
187
289
|
) -> None:
|
@@ -190,7 +292,7 @@ def CRY(
|
|
190
292
|
|
191
293
|
@qfunc(external=True)
|
192
294
|
def CRZ(
|
193
|
-
theta:
|
295
|
+
theta: CReal,
|
194
296
|
control: QBit,
|
195
297
|
target: QBit,
|
196
298
|
) -> None:
|
@@ -199,7 +301,7 @@ def CRZ(
|
|
199
301
|
|
200
302
|
@qfunc(external=True)
|
201
303
|
def CPHASE(
|
202
|
-
theta:
|
304
|
+
theta: CReal,
|
203
305
|
control: QBit,
|
204
306
|
target: QBit,
|
205
307
|
) -> None:
|
@@ -223,26 +325,26 @@ def IDENTITY(
|
|
223
325
|
|
224
326
|
@qfunc(external=True)
|
225
327
|
def prepare_state(
|
226
|
-
probabilities:
|
227
|
-
bound:
|
228
|
-
out: Output[QArray[QBit
|
328
|
+
probabilities: CArray[CReal],
|
329
|
+
bound: CReal,
|
330
|
+
out: Output[QArray[QBit]],
|
229
331
|
) -> None:
|
230
332
|
pass
|
231
333
|
|
232
334
|
|
233
335
|
@qfunc(external=True)
|
234
336
|
def prepare_amplitudes(
|
235
|
-
amplitudes:
|
236
|
-
bound:
|
237
|
-
out: Output[QArray[QBit
|
337
|
+
amplitudes: CArray[CReal],
|
338
|
+
bound: CReal,
|
339
|
+
out: Output[QArray[QBit]],
|
238
340
|
) -> None:
|
239
341
|
pass
|
240
342
|
|
241
343
|
|
242
344
|
@qfunc(external=True)
|
243
345
|
def unitary(
|
244
|
-
elements:
|
245
|
-
target: QArray[QBit
|
346
|
+
elements: CArray[CArray[CReal]],
|
347
|
+
target: QArray[QBit],
|
246
348
|
) -> None:
|
247
349
|
pass
|
248
350
|
|
@@ -251,7 +353,7 @@ def unitary(
|
|
251
353
|
def add(
|
252
354
|
left: QArray[QBit],
|
253
355
|
right: QArray[QBit],
|
254
|
-
result: Output[QArray[QBit
|
356
|
+
result: Output[QArray[QBit]],
|
255
357
|
) -> None:
|
256
358
|
pass
|
257
359
|
|
@@ -274,10 +376,10 @@ def integer_xor(
|
|
274
376
|
|
275
377
|
@qfunc(external=True)
|
276
378
|
def U(
|
277
|
-
theta:
|
278
|
-
phi:
|
279
|
-
lam:
|
280
|
-
gam:
|
379
|
+
theta: CReal,
|
380
|
+
phi: CReal,
|
381
|
+
lam: CReal,
|
382
|
+
gam: CReal,
|
281
383
|
target: QBit,
|
282
384
|
) -> None:
|
283
385
|
pass
|
@@ -285,7 +387,7 @@ def U(
|
|
285
387
|
|
286
388
|
@qfunc(external=True)
|
287
389
|
def CCX(
|
288
|
-
control: QArray[QBit
|
390
|
+
control: QArray[QBit],
|
289
391
|
target: QBit,
|
290
392
|
) -> None:
|
291
393
|
pass
|
@@ -293,8 +395,8 @@ def CCX(
|
|
293
395
|
|
294
396
|
@qfunc(external=True)
|
295
397
|
def allocate(
|
296
|
-
num_qubits:
|
297
|
-
out: Output[QArray[QBit
|
398
|
+
num_qubits: CInt,
|
399
|
+
out: Output[QArray[QBit]],
|
298
400
|
) -> None:
|
299
401
|
pass
|
300
402
|
|
@@ -308,7 +410,7 @@ def free(
|
|
308
410
|
|
309
411
|
@qfunc(external=True)
|
310
412
|
def randomized_benchmarking(
|
311
|
-
num_of_cliffords:
|
413
|
+
num_of_cliffords: CInt,
|
312
414
|
target: QArray[QBit],
|
313
415
|
) -> None:
|
314
416
|
pass
|
@@ -316,58 +418,58 @@ def randomized_benchmarking(
|
|
316
418
|
|
317
419
|
@qfunc(external=True)
|
318
420
|
def inplace_prepare_state(
|
319
|
-
probabilities:
|
320
|
-
bound:
|
321
|
-
target: QArray[QBit
|
421
|
+
probabilities: CArray[CReal],
|
422
|
+
bound: CReal,
|
423
|
+
target: QArray[QBit],
|
322
424
|
) -> None:
|
323
425
|
pass
|
324
426
|
|
325
427
|
|
326
428
|
@qfunc(external=True)
|
327
429
|
def inplace_prepare_amplitudes(
|
328
|
-
amplitudes:
|
329
|
-
bound:
|
330
|
-
target: QArray[QBit
|
430
|
+
amplitudes: CArray[CReal],
|
431
|
+
bound: CReal,
|
432
|
+
target: QArray[QBit],
|
331
433
|
) -> None:
|
332
434
|
pass
|
333
435
|
|
334
436
|
|
335
437
|
@qfunc(external=True)
|
336
438
|
def single_pauli_exponent(
|
337
|
-
pauli_string:
|
338
|
-
coefficient:
|
339
|
-
qbv: QArray[QBit
|
439
|
+
pauli_string: CArray[Pauli],
|
440
|
+
coefficient: CReal,
|
441
|
+
qbv: QArray[QBit],
|
340
442
|
) -> None:
|
341
443
|
pass
|
342
444
|
|
343
445
|
|
344
446
|
@qfunc(external=True)
|
345
447
|
def suzuki_trotter(
|
346
|
-
pauli_operator:
|
347
|
-
evolution_coefficient:
|
348
|
-
order:
|
349
|
-
repetitions:
|
350
|
-
qbv: QArray[QBit
|
448
|
+
pauli_operator: CArray[PauliTerm],
|
449
|
+
evolution_coefficient: CReal,
|
450
|
+
order: CInt,
|
451
|
+
repetitions: CInt,
|
452
|
+
qbv: QArray[QBit],
|
351
453
|
) -> None:
|
352
454
|
pass
|
353
455
|
|
354
456
|
|
355
457
|
@qfunc(external=True)
|
356
458
|
def qdrift(
|
357
|
-
pauli_operator:
|
358
|
-
evolution_coefficient:
|
359
|
-
num_qdrift:
|
360
|
-
qbv: QArray[QBit
|
459
|
+
pauli_operator: CArray[PauliTerm],
|
460
|
+
evolution_coefficient: CReal,
|
461
|
+
num_qdrift: CInt,
|
462
|
+
qbv: QArray[QBit],
|
361
463
|
) -> None:
|
362
464
|
pass
|
363
465
|
|
364
466
|
|
365
467
|
@qfunc(external=True)
|
366
468
|
def exponentiation_with_depth_constraint(
|
367
|
-
pauli_operator:
|
368
|
-
evolution_coefficient:
|
369
|
-
max_depth:
|
370
|
-
qbv: QArray[QBit
|
469
|
+
pauli_operator: CArray[PauliTerm],
|
470
|
+
evolution_coefficient: CReal,
|
471
|
+
max_depth: CInt,
|
472
|
+
qbv: QArray[QBit],
|
371
473
|
) -> None:
|
372
474
|
pass
|
373
475
|
|
@@ -388,7 +490,7 @@ def qft(
|
|
388
490
|
|
389
491
|
@qfunc(external=True)
|
390
492
|
def qpe_flexible(
|
391
|
-
unitary_with_power: QCallable[
|
493
|
+
unitary_with_power: QCallable[CInt],
|
392
494
|
phase: QNum,
|
393
495
|
) -> None:
|
394
496
|
pass
|
@@ -402,20 +504,11 @@ def qpe(
|
|
402
504
|
pass
|
403
505
|
|
404
506
|
|
405
|
-
@qfunc(external=True)
|
406
|
-
def standard_qpe(
|
407
|
-
precision: QParam[int],
|
408
|
-
unitary: QCallable,
|
409
|
-
phase: QArray[QBit, Literal["precision"]],
|
410
|
-
) -> None:
|
411
|
-
pass
|
412
|
-
|
413
|
-
|
414
507
|
@qfunc(external=True)
|
415
508
|
def single_pauli(
|
416
|
-
slope:
|
417
|
-
offset:
|
418
|
-
q1_qfunc: QCallable[
|
509
|
+
slope: CReal,
|
510
|
+
offset: CReal,
|
511
|
+
q1_qfunc: QCallable[CReal, QBit],
|
419
512
|
x: QArray[QBit],
|
420
513
|
q: QBit,
|
421
514
|
) -> None:
|
@@ -424,9 +517,9 @@ def single_pauli(
|
|
424
517
|
|
425
518
|
@qfunc(external=True)
|
426
519
|
def linear_pauli_rotations(
|
427
|
-
bases:
|
428
|
-
slopes:
|
429
|
-
offsets:
|
520
|
+
bases: CArray[Pauli],
|
521
|
+
slopes: CArray[CReal],
|
522
|
+
offsets: CArray[CReal],
|
430
523
|
x: QArray[QBit],
|
431
524
|
q: QArray[QBit],
|
432
525
|
) -> None:
|
@@ -435,12 +528,10 @@ def linear_pauli_rotations(
|
|
435
528
|
|
436
529
|
@qfunc(external=True)
|
437
530
|
def amplitude_estimation(
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
phase_port: Output[QNum],
|
443
|
-
unitary_port: Output[QArray[QBit, Literal["num_unitary_qubits"]]],
|
531
|
+
oracle: QCallable[QArray[QBit]],
|
532
|
+
space_transform: QCallable[QArray[QBit]],
|
533
|
+
phase: QNum,
|
534
|
+
packed_vars: QArray[QBit],
|
444
535
|
) -> None:
|
445
536
|
pass
|
446
537
|
|
@@ -479,7 +570,7 @@ def grover_operator(
|
|
479
570
|
|
480
571
|
@qfunc(external=True)
|
481
572
|
def grover_search(
|
482
|
-
reps:
|
573
|
+
reps: CInt,
|
483
574
|
oracle: QCallable[QArray[QBit]],
|
484
575
|
packed_vars: QArray[QBit],
|
485
576
|
) -> None:
|
@@ -502,322 +593,229 @@ def apply_to_all(
|
|
502
593
|
|
503
594
|
|
504
595
|
@qfunc(external=True)
|
505
|
-
def
|
506
|
-
|
507
|
-
is_signed: QParam[bool],
|
508
|
-
fraction_digits: QParam[int],
|
509
|
-
out: Output[QNum],
|
510
|
-
) -> None:
|
511
|
-
pass
|
512
|
-
|
513
|
-
|
514
|
-
@qfunc(external=True)
|
515
|
-
def qaoa_mixer_layer(
|
516
|
-
b: QParam[float],
|
517
|
-
target: QArray[QBit],
|
518
|
-
) -> None:
|
519
|
-
pass
|
520
|
-
|
521
|
-
|
522
|
-
@qfunc(external=True)
|
523
|
-
def qaoa_cost_layer(
|
524
|
-
g: QParam[float],
|
525
|
-
hamiltonian: QParam[List[PauliTerm]],
|
526
|
-
target: QArray[QBit],
|
527
|
-
) -> None:
|
528
|
-
pass
|
529
|
-
|
530
|
-
|
531
|
-
@qfunc(external=True)
|
532
|
-
def qaoa_layer(
|
533
|
-
g: QParam[float],
|
534
|
-
b: QParam[float],
|
535
|
-
hamiltonian: QParam[List[PauliTerm]],
|
536
|
-
target: QArray[QBit],
|
537
|
-
) -> None:
|
538
|
-
pass
|
539
|
-
|
540
|
-
|
541
|
-
@qfunc(external=True)
|
542
|
-
def qaoa_init(
|
543
|
-
target: QArray[QBit],
|
544
|
-
) -> None:
|
545
|
-
pass
|
546
|
-
|
547
|
-
|
548
|
-
@qfunc(external=True)
|
549
|
-
def qaoa_penalty(
|
550
|
-
num_qubits: QParam[int],
|
551
|
-
params_list: QParam[List[float]],
|
552
|
-
hamiltonian: QParam[List[PauliTerm]],
|
553
|
-
target: QArray[QBit, Literal["num_qubits"]],
|
554
|
-
) -> None:
|
555
|
-
pass
|
556
|
-
|
557
|
-
|
558
|
-
@qfunc(external=True)
|
559
|
-
def full_hea(
|
560
|
-
num_qubits: QParam[int],
|
561
|
-
is_parametrized: QParam[List[int]],
|
562
|
-
angle_params: QParam[List[float]],
|
563
|
-
connectivity_map: QParam[List[List[int]]],
|
564
|
-
reps: QParam[int],
|
565
|
-
operands_1qubit: QCallableList[QParam[float], QBit],
|
566
|
-
operands_2qubit: QCallableList[QParam[float], QBit, QBit],
|
567
|
-
x: QArray[QBit, Literal["num_qubits"]],
|
568
|
-
) -> None:
|
569
|
-
pass
|
570
|
-
|
571
|
-
|
572
|
-
@qfunc(external=True)
|
573
|
-
def swap_test(
|
574
|
-
state1: QArray[QBit],
|
575
|
-
state2: QArray[QBit],
|
576
|
-
test: Output[QArray[QBit]],
|
577
|
-
) -> None:
|
578
|
-
pass
|
579
|
-
|
580
|
-
|
581
|
-
@qfunc(external=True)
|
582
|
-
def prepare_ghz_state(
|
583
|
-
size: QParam[int],
|
584
|
-
q: Output[QArray[QBit]],
|
585
|
-
) -> None:
|
586
|
-
pass
|
587
|
-
|
588
|
-
|
589
|
-
@qfunc(external=True)
|
590
|
-
def prepare_exponential_state(
|
591
|
-
rate: QParam[int],
|
592
|
-
q: QArray[QBit],
|
596
|
+
def qft_no_swap(
|
597
|
+
qbv: QArray[QBit],
|
593
598
|
) -> None:
|
594
599
|
pass
|
595
600
|
|
596
601
|
|
597
602
|
@qfunc(external=True)
|
598
|
-
def
|
599
|
-
|
600
|
-
|
603
|
+
def _check_msb(
|
604
|
+
ref: CInt,
|
605
|
+
x: QArray[QBit],
|
606
|
+
aux: QArray[QBit],
|
601
607
|
) -> None:
|
602
608
|
pass
|
603
609
|
|
604
610
|
|
605
611
|
@qfunc(external=True)
|
606
|
-
def
|
607
|
-
|
608
|
-
|
612
|
+
def _ctrl_x(
|
613
|
+
ref: CInt,
|
614
|
+
ctrl: QArray[QBit],
|
615
|
+
aux: QArray[QBit],
|
609
616
|
) -> None:
|
610
617
|
pass
|
611
618
|
|
612
619
|
|
613
620
|
@qfunc(external=True)
|
614
|
-
def
|
615
|
-
value:
|
616
|
-
|
621
|
+
def qft_space_add_const(
|
622
|
+
value: CInt,
|
623
|
+
phi_b: QArray[QBit],
|
617
624
|
) -> None:
|
618
625
|
pass
|
619
626
|
|
620
627
|
|
621
628
|
@qfunc(external=True)
|
622
|
-
def
|
623
|
-
|
624
|
-
|
629
|
+
def cc_modular_add(
|
630
|
+
n: CInt,
|
631
|
+
a: CInt,
|
632
|
+
phi_b: QArray[QBit],
|
633
|
+
c1: QArray[QBit],
|
634
|
+
c2: QArray[QBit],
|
635
|
+
aux: QArray[QBit],
|
625
636
|
) -> None:
|
626
637
|
pass
|
627
638
|
|
628
639
|
|
629
640
|
@qfunc(external=True)
|
630
|
-
def
|
631
|
-
|
632
|
-
|
641
|
+
def c_modular_multiply(
|
642
|
+
n: CInt,
|
643
|
+
a: CInt,
|
644
|
+
b: QArray[QBit],
|
645
|
+
x: QArray[QBit],
|
646
|
+
ctrl: QArray[QBit],
|
647
|
+
aux: QArray[QBit],
|
633
648
|
) -> None:
|
634
649
|
pass
|
635
650
|
|
636
651
|
|
637
652
|
@qfunc(external=True)
|
638
|
-
def
|
639
|
-
|
653
|
+
def multiswap(
|
654
|
+
x: QArray[QBit],
|
655
|
+
y: QArray[QBit],
|
640
656
|
) -> None:
|
641
657
|
pass
|
642
658
|
|
643
659
|
|
644
660
|
@qfunc(external=True)
|
645
|
-
def
|
646
|
-
|
661
|
+
def inplace_c_modular_multiply(
|
662
|
+
n: CInt,
|
663
|
+
a: CInt,
|
664
|
+
x: QArray[QBit],
|
647
665
|
ctrl: QArray[QBit],
|
666
|
+
aux: QArray[QBit],
|
648
667
|
) -> None:
|
649
668
|
pass
|
650
669
|
|
651
670
|
|
652
671
|
@qfunc(external=True)
|
653
|
-
def
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
pass
|
659
|
-
|
660
|
-
|
661
|
-
@qfunc(external=True)
|
662
|
-
def permute(
|
663
|
-
functions: QCallableList,
|
672
|
+
def modular_exp(
|
673
|
+
n: CInt,
|
674
|
+
a: CInt,
|
675
|
+
x: QArray[QBit],
|
676
|
+
power: QArray[QBit],
|
664
677
|
) -> None:
|
665
678
|
pass
|
666
679
|
|
667
680
|
|
668
681
|
@qfunc(external=True)
|
669
|
-
def
|
670
|
-
|
671
|
-
|
682
|
+
def allocate_num(
|
683
|
+
num_qubits: CInt,
|
684
|
+
is_signed: CBool,
|
685
|
+
fraction_digits: CInt,
|
686
|
+
out: Output[QNum],
|
672
687
|
) -> None:
|
673
688
|
pass
|
674
689
|
|
675
690
|
|
676
691
|
@qfunc(external=True)
|
677
|
-
def
|
678
|
-
|
692
|
+
def qaoa_mixer_layer(
|
693
|
+
b: CReal,
|
694
|
+
target: QArray[QBit],
|
679
695
|
) -> None:
|
680
696
|
pass
|
681
697
|
|
682
698
|
|
683
699
|
@qfunc(external=True)
|
684
|
-
def
|
685
|
-
|
700
|
+
def qaoa_cost_layer(
|
701
|
+
g: CReal,
|
702
|
+
hamiltonian: CArray[PauliTerm],
|
703
|
+
target: QArray[QBit],
|
686
704
|
) -> None:
|
687
705
|
pass
|
688
706
|
|
689
707
|
|
690
708
|
@qfunc(external=True)
|
691
|
-
def
|
692
|
-
|
709
|
+
def qaoa_layer(
|
710
|
+
g: CReal,
|
711
|
+
b: CReal,
|
712
|
+
hamiltonian: CArray[PauliTerm],
|
713
|
+
target: QArray[QBit],
|
693
714
|
) -> None:
|
694
715
|
pass
|
695
716
|
|
696
717
|
|
697
718
|
@qfunc(external=True)
|
698
|
-
def
|
699
|
-
|
700
|
-
excitations: QParam[List[int]],
|
701
|
-
qbv: QArray[
|
702
|
-
QBit,
|
703
|
-
Literal[
|
704
|
-
"len(get_field(molecule_problem_to_hamiltonian(molecule_problem)[0], 'pauli'))"
|
705
|
-
],
|
706
|
-
],
|
719
|
+
def qaoa_init(
|
720
|
+
target: QArray[QBit],
|
707
721
|
) -> None:
|
708
722
|
pass
|
709
723
|
|
710
724
|
|
711
725
|
@qfunc(external=True)
|
712
|
-
def
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
Literal[
|
718
|
-
"len(get_field(molecule_problem_to_hamiltonian(molecule_problem)[0], 'pauli'))"
|
719
|
-
],
|
720
|
-
],
|
726
|
+
def qaoa_penalty(
|
727
|
+
num_qubits: CInt,
|
728
|
+
params_list: CArray[CReal],
|
729
|
+
hamiltonian: CArray[PauliTerm],
|
730
|
+
target: QArray[QBit],
|
721
731
|
) -> None:
|
722
732
|
pass
|
723
733
|
|
724
734
|
|
725
735
|
@qfunc(external=True)
|
726
|
-
def
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
],
|
736
|
+
def full_hea(
|
737
|
+
num_qubits: CInt,
|
738
|
+
is_parametrized: CArray[CInt],
|
739
|
+
angle_params: CArray[CReal],
|
740
|
+
connectivity_map: CArray[CArray[CInt]],
|
741
|
+
reps: CInt,
|
742
|
+
operands_1qubit: QCallableList[CReal, QBit],
|
743
|
+
operands_2qubit: QCallableList[CReal, QBit, QBit],
|
744
|
+
x: QArray[QBit],
|
734
745
|
) -> None:
|
735
746
|
pass
|
736
747
|
|
737
748
|
|
738
749
|
@qfunc(external=True)
|
739
|
-
def
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
QBit,
|
744
|
-
Literal[
|
745
|
-
"len(get_field(fock_hamiltonian_problem_to_hamiltonian(fock_hamiltonian_problem)[0], 'pauli'))"
|
746
|
-
],
|
747
|
-
],
|
750
|
+
def swap_test(
|
751
|
+
state1: QArray[QBit],
|
752
|
+
state2: QArray[QBit],
|
753
|
+
test: Output[QArray[QBit]],
|
748
754
|
) -> None:
|
749
755
|
pass
|
750
756
|
|
751
757
|
|
752
758
|
@qfunc(external=True)
|
753
|
-
def
|
754
|
-
|
755
|
-
|
756
|
-
qbv: QArray[
|
757
|
-
QBit,
|
758
|
-
Literal[
|
759
|
-
"len(get_field(fock_hamiltonian_problem_to_hamiltonian(fock_hamiltonian_problem)[0], 'pauli'))"
|
760
|
-
],
|
761
|
-
],
|
759
|
+
def prepare_ghz_state(
|
760
|
+
size: CInt,
|
761
|
+
q: Output[QArray[QBit]],
|
762
762
|
) -> None:
|
763
763
|
pass
|
764
764
|
|
765
765
|
|
766
766
|
@qfunc(external=True)
|
767
|
-
def
|
768
|
-
|
769
|
-
|
770
|
-
QBit,
|
771
|
-
Literal[
|
772
|
-
"len(get_field(fock_hamiltonian_problem_to_hamiltonian(fock_hamiltonian_problem)[0], 'pauli'))"
|
773
|
-
],
|
774
|
-
],
|
767
|
+
def prepare_exponential_state(
|
768
|
+
rate: CInt,
|
769
|
+
q: QArray[QBit],
|
775
770
|
) -> None:
|
776
771
|
pass
|
777
772
|
|
778
773
|
|
779
774
|
@qfunc(external=True)
|
780
|
-
def
|
781
|
-
|
782
|
-
|
783
|
-
func_port: QArray[QBit, Literal["get_field(finance_model, 'num_qubits')"]],
|
784
|
-
obj_port: QBit,
|
775
|
+
def prepare_bell_state(
|
776
|
+
state_num: CInt,
|
777
|
+
q: Output[QArray[QBit]],
|
785
778
|
) -> None:
|
786
779
|
pass
|
787
780
|
|
788
781
|
|
789
782
|
@qfunc(external=True)
|
790
|
-
def
|
791
|
-
|
792
|
-
|
793
|
-
func_port: QArray[
|
794
|
-
QBit,
|
795
|
-
Literal[
|
796
|
-
"get_field(finance_model, 'num_qubits') + len(get_field(finance_model, 'rhos')) + floor(log(sum(get_field(finance_model, 'loss')), 2)) + 1"
|
797
|
-
],
|
798
|
-
],
|
799
|
-
obj_port: QBit,
|
783
|
+
def inplace_prepare_int(
|
784
|
+
value: CInt,
|
785
|
+
target: QArray[QBit],
|
800
786
|
) -> None:
|
801
787
|
pass
|
802
788
|
|
803
789
|
|
804
790
|
@qfunc(external=True)
|
805
|
-
def
|
806
|
-
|
807
|
-
|
791
|
+
def prepare_int(
|
792
|
+
value: CInt,
|
793
|
+
out: Output[QNum],
|
808
794
|
) -> None:
|
809
795
|
pass
|
810
796
|
|
811
797
|
|
812
798
|
@qfunc(external=True)
|
813
|
-
def
|
814
|
-
|
815
|
-
|
799
|
+
def switch(
|
800
|
+
selector: CInt,
|
801
|
+
cases: QCallableList,
|
816
802
|
) -> None:
|
817
803
|
pass
|
818
804
|
|
819
805
|
|
820
806
|
__all__ = [
|
807
|
+
"permute",
|
808
|
+
"apply",
|
809
|
+
"molecule_ucc",
|
810
|
+
"molecule_hva",
|
811
|
+
"molecule_hartree_fock",
|
812
|
+
"fock_hamiltonian_ucc",
|
813
|
+
"fock_hamiltonian_hva",
|
814
|
+
"fock_hamiltonian_hartree_fock",
|
815
|
+
"log_normal_finance",
|
816
|
+
"gaussian_finance",
|
817
|
+
"pauli_feature_map",
|
818
|
+
"bloch_sphere_feature_map",
|
821
819
|
"H",
|
822
820
|
"X",
|
823
821
|
"Y",
|
@@ -866,7 +864,6 @@ __all__ = [
|
|
866
864
|
"qft",
|
867
865
|
"qpe_flexible",
|
868
866
|
"qpe",
|
869
|
-
"standard_qpe",
|
870
867
|
"single_pauli",
|
871
868
|
"linear_pauli_rotations",
|
872
869
|
"amplitude_estimation",
|
@@ -877,6 +874,15 @@ __all__ = [
|
|
877
874
|
"grover_search",
|
878
875
|
"hadamard_transform",
|
879
876
|
"apply_to_all",
|
877
|
+
"qft_no_swap",
|
878
|
+
"_check_msb",
|
879
|
+
"_ctrl_x",
|
880
|
+
"qft_space_add_const",
|
881
|
+
"cc_modular_add",
|
882
|
+
"c_modular_multiply",
|
883
|
+
"multiswap",
|
884
|
+
"inplace_c_modular_multiply",
|
885
|
+
"modular_exp",
|
880
886
|
"allocate_num",
|
881
887
|
"qaoa_mixer_layer",
|
882
888
|
"qaoa_cost_layer",
|
@@ -891,23 +897,4 @@ __all__ = [
|
|
891
897
|
"inplace_prepare_int",
|
892
898
|
"prepare_int",
|
893
899
|
"switch",
|
894
|
-
"repeat",
|
895
|
-
"invert",
|
896
|
-
"control",
|
897
|
-
"if_",
|
898
|
-
"permute",
|
899
|
-
"power",
|
900
|
-
"apply",
|
901
|
-
"compute",
|
902
|
-
"uncompute",
|
903
|
-
"molecule_ucc",
|
904
|
-
"molecule_hva",
|
905
|
-
"molecule_hartree_fock",
|
906
|
-
"fock_hamiltonian_ucc",
|
907
|
-
"fock_hamiltonian_hva",
|
908
|
-
"fock_hamiltonian_hartree_fock",
|
909
|
-
"log_normal_finance",
|
910
|
-
"gaussian_finance",
|
911
|
-
"pauli_feature_map",
|
912
|
-
"bloch_sphere_feature_map",
|
913
900
|
]
|