classiq 0.39.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 +1 -0
- classiq/applications/chemistry/chemistry_model_constructor.py +1 -1
- classiq/applications/combinatorial_helpers/combinatorial_problem_utils.py +5 -6
- classiq/applications/combinatorial_helpers/optimization_model.py +7 -6
- classiq/applications/combinatorial_helpers/pauli_helpers/pauli_utils.py +0 -10
- classiq/applications/combinatorial_optimization/__init__.py +2 -0
- classiq/applications/combinatorial_optimization/combinatorial_optimization_model_constructor.py +2 -2
- classiq/interface/_version.py +1 -1
- classiq/interface/backend/backend_preferences.py +5 -5
- classiq/interface/backend/quantum_backend_providers.py +7 -7
- classiq/interface/executor/execution_preferences.py +4 -9
- 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/expressions/qmod_qarray_proxy.py +82 -0
- classiq/interface/generator/expressions/qmod_qscalar_proxy.py +21 -0
- classiq/interface/generator/expressions/qmod_sized_proxy.py +22 -0
- classiq/interface/generator/functions/builtins/core_library/atomic_quantum_functions.py +8 -6
- classiq/interface/generator/functions/builtins/core_library/exponentiation_functions.py +10 -4
- classiq/interface/generator/functions/builtins/open_lib_functions.py +624 -76
- classiq/interface/generator/functions/classical_type.py +29 -17
- classiq/interface/generator/model/preferences/preferences.py +4 -2
- classiq/interface/model/control.py +104 -8
- classiq/interface/model/quantum_type.py +6 -5
- classiq/interface/model/resolvers/function_call_resolver.py +0 -5
- classiq/interface/model/statement_block.py +1 -4
- classiq/qmod/__init__.py +6 -2
- classiq/qmod/builtins/classical_functions.py +30 -35
- classiq/qmod/builtins/functions.py +213 -153
- classiq/qmod/builtins/operations.py +78 -24
- 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 +7 -14
- classiq/qmod/qmod_constant.py +7 -7
- classiq/qmod/qmod_parameter.py +54 -33
- classiq/qmod/qmod_struct.py +2 -2
- classiq/qmod/qmod_variable.py +40 -29
- classiq/qmod/quantum_callable.py +7 -4
- classiq/qmod/quantum_expandable.py +19 -13
- classiq/qmod/quantum_function.py +25 -2
- classiq/qmod/symbolic.py +78 -68
- classiq/qmod/symbolic_expr.py +1 -1
- classiq/qmod/symbolic_type.py +1 -4
- classiq/qmod/utilities.py +29 -0
- {classiq-0.39.0.dist-info → classiq-0.40.0.dist-info}/METADATA +1 -1
- {classiq-0.39.0.dist-info → classiq-0.40.0.dist-info}/RECORD +48 -50
- classiq/interface/executor/error_mitigation.py +0 -6
- classiq/interface/generator/functions/builtins/core_library/chemistry_functions.py +0 -0
- classiq/interface/model/quantum_if_operation.py +0 -94
- {classiq-0.39.0.dist-info → classiq-0.40.0.dist-info}/WHEEL +0 -0
@@ -1,9 +1,9 @@
|
|
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
|
|
@@ -26,91 +26,61 @@ def apply(
|
|
26
26
|
|
27
27
|
@qfunc(external=True)
|
28
28
|
def molecule_ucc(
|
29
|
-
molecule_problem:
|
30
|
-
excitations:
|
31
|
-
qbv: QArray[
|
32
|
-
QBit,
|
33
|
-
Literal[
|
34
|
-
"len(get_field(molecule_problem_to_hamiltonian(molecule_problem)[0], 'pauli'))"
|
35
|
-
],
|
36
|
-
],
|
29
|
+
molecule_problem: MoleculeProblem,
|
30
|
+
excitations: CArray[CInt],
|
31
|
+
qbv: QArray[QBit],
|
37
32
|
) -> None:
|
38
33
|
pass
|
39
34
|
|
40
35
|
|
41
36
|
@qfunc(external=True)
|
42
37
|
def molecule_hva(
|
43
|
-
molecule_problem:
|
44
|
-
reps:
|
45
|
-
qbv: QArray[
|
46
|
-
QBit,
|
47
|
-
Literal[
|
48
|
-
"len(get_field(molecule_problem_to_hamiltonian(molecule_problem)[0], 'pauli'))"
|
49
|
-
],
|
50
|
-
],
|
38
|
+
molecule_problem: MoleculeProblem,
|
39
|
+
reps: CInt,
|
40
|
+
qbv: QArray[QBit],
|
51
41
|
) -> None:
|
52
42
|
pass
|
53
43
|
|
54
44
|
|
55
45
|
@qfunc(external=True)
|
56
46
|
def molecule_hartree_fock(
|
57
|
-
molecule_problem:
|
58
|
-
qbv: QArray[
|
59
|
-
QBit,
|
60
|
-
Literal[
|
61
|
-
"len(get_field(molecule_problem_to_hamiltonian(molecule_problem)[0], 'pauli'))"
|
62
|
-
],
|
63
|
-
],
|
47
|
+
molecule_problem: MoleculeProblem,
|
48
|
+
qbv: QArray[QBit],
|
64
49
|
) -> None:
|
65
50
|
pass
|
66
51
|
|
67
52
|
|
68
53
|
@qfunc(external=True)
|
69
54
|
def fock_hamiltonian_ucc(
|
70
|
-
fock_hamiltonian_problem:
|
71
|
-
excitations:
|
72
|
-
qbv: QArray[
|
73
|
-
QBit,
|
74
|
-
Literal[
|
75
|
-
"len(get_field(fock_hamiltonian_problem_to_hamiltonian(fock_hamiltonian_problem)[0], 'pauli'))"
|
76
|
-
],
|
77
|
-
],
|
55
|
+
fock_hamiltonian_problem: FockHamiltonianProblem,
|
56
|
+
excitations: CArray[CInt],
|
57
|
+
qbv: QArray[QBit],
|
78
58
|
) -> None:
|
79
59
|
pass
|
80
60
|
|
81
61
|
|
82
62
|
@qfunc(external=True)
|
83
63
|
def fock_hamiltonian_hva(
|
84
|
-
fock_hamiltonian_problem:
|
85
|
-
reps:
|
86
|
-
qbv: QArray[
|
87
|
-
QBit,
|
88
|
-
Literal[
|
89
|
-
"len(get_field(fock_hamiltonian_problem_to_hamiltonian(fock_hamiltonian_problem)[0], 'pauli'))"
|
90
|
-
],
|
91
|
-
],
|
64
|
+
fock_hamiltonian_problem: FockHamiltonianProblem,
|
65
|
+
reps: CInt,
|
66
|
+
qbv: QArray[QBit],
|
92
67
|
) -> None:
|
93
68
|
pass
|
94
69
|
|
95
70
|
|
96
71
|
@qfunc(external=True)
|
97
72
|
def fock_hamiltonian_hartree_fock(
|
98
|
-
fock_hamiltonian_problem:
|
99
|
-
qbv: QArray[
|
100
|
-
QBit,
|
101
|
-
Literal[
|
102
|
-
"len(get_field(fock_hamiltonian_problem_to_hamiltonian(fock_hamiltonian_problem)[0], 'pauli'))"
|
103
|
-
],
|
104
|
-
],
|
73
|
+
fock_hamiltonian_problem: FockHamiltonianProblem,
|
74
|
+
qbv: QArray[QBit],
|
105
75
|
) -> None:
|
106
76
|
pass
|
107
77
|
|
108
78
|
|
109
79
|
@qfunc(external=True)
|
110
80
|
def log_normal_finance(
|
111
|
-
finance_model:
|
112
|
-
finance_function:
|
113
|
-
func_port: QArray[QBit
|
81
|
+
finance_model: LogNormalModel,
|
82
|
+
finance_function: FinanceFunction,
|
83
|
+
func_port: QArray[QBit],
|
114
84
|
obj_port: QBit,
|
115
85
|
) -> None:
|
116
86
|
pass
|
@@ -118,14 +88,9 @@ def log_normal_finance(
|
|
118
88
|
|
119
89
|
@qfunc(external=True)
|
120
90
|
def gaussian_finance(
|
121
|
-
finance_model:
|
122
|
-
finance_function:
|
123
|
-
func_port: QArray[
|
124
|
-
QBit,
|
125
|
-
Literal[
|
126
|
-
"get_field(finance_model, 'num_qubits') + len(get_field(finance_model, 'rhos')) + floor(log(sum(get_field(finance_model, 'loss')), 2)) + 1"
|
127
|
-
],
|
128
|
-
],
|
91
|
+
finance_model: GaussianModel,
|
92
|
+
finance_function: FinanceFunction,
|
93
|
+
func_port: QArray[QBit],
|
129
94
|
obj_port: QBit,
|
130
95
|
) -> None:
|
131
96
|
pass
|
@@ -133,16 +98,16 @@ def gaussian_finance(
|
|
133
98
|
|
134
99
|
@qfunc(external=True)
|
135
100
|
def pauli_feature_map(
|
136
|
-
feature_map:
|
137
|
-
qbv: QArray[QBit
|
101
|
+
feature_map: QSVMFeatureMapPauli,
|
102
|
+
qbv: QArray[QBit],
|
138
103
|
) -> None:
|
139
104
|
pass
|
140
105
|
|
141
106
|
|
142
107
|
@qfunc(external=True)
|
143
108
|
def bloch_sphere_feature_map(
|
144
|
-
feature_dimension:
|
145
|
-
qbv: QArray[QBit
|
109
|
+
feature_dimension: CInt,
|
110
|
+
qbv: QArray[QBit],
|
146
111
|
) -> None:
|
147
112
|
pass
|
148
113
|
|
@@ -212,7 +177,7 @@ def TDG(
|
|
212
177
|
|
213
178
|
@qfunc(external=True)
|
214
179
|
def PHASE(
|
215
|
-
theta:
|
180
|
+
theta: CReal,
|
216
181
|
target: QBit,
|
217
182
|
) -> None:
|
218
183
|
pass
|
@@ -220,7 +185,7 @@ def PHASE(
|
|
220
185
|
|
221
186
|
@qfunc(external=True)
|
222
187
|
def RX(
|
223
|
-
theta:
|
188
|
+
theta: CReal,
|
224
189
|
target: QBit,
|
225
190
|
) -> None:
|
226
191
|
pass
|
@@ -228,7 +193,7 @@ def RX(
|
|
228
193
|
|
229
194
|
@qfunc(external=True)
|
230
195
|
def RY(
|
231
|
-
theta:
|
196
|
+
theta: CReal,
|
232
197
|
target: QBit,
|
233
198
|
) -> None:
|
234
199
|
pass
|
@@ -236,7 +201,7 @@ def RY(
|
|
236
201
|
|
237
202
|
@qfunc(external=True)
|
238
203
|
def RZ(
|
239
|
-
theta:
|
204
|
+
theta: CReal,
|
240
205
|
target: QBit,
|
241
206
|
) -> None:
|
242
207
|
pass
|
@@ -244,8 +209,8 @@ def RZ(
|
|
244
209
|
|
245
210
|
@qfunc(external=True)
|
246
211
|
def R(
|
247
|
-
theta:
|
248
|
-
phi:
|
212
|
+
theta: CReal,
|
213
|
+
phi: CReal,
|
249
214
|
target: QBit,
|
250
215
|
) -> None:
|
251
216
|
pass
|
@@ -253,24 +218,24 @@ def R(
|
|
253
218
|
|
254
219
|
@qfunc(external=True)
|
255
220
|
def RXX(
|
256
|
-
theta:
|
257
|
-
target: QArray[QBit
|
221
|
+
theta: CReal,
|
222
|
+
target: QArray[QBit],
|
258
223
|
) -> None:
|
259
224
|
pass
|
260
225
|
|
261
226
|
|
262
227
|
@qfunc(external=True)
|
263
228
|
def RYY(
|
264
|
-
theta:
|
265
|
-
target: QArray[QBit
|
229
|
+
theta: CReal,
|
230
|
+
target: QArray[QBit],
|
266
231
|
) -> None:
|
267
232
|
pass
|
268
233
|
|
269
234
|
|
270
235
|
@qfunc(external=True)
|
271
236
|
def RZZ(
|
272
|
-
theta:
|
273
|
-
target: QArray[QBit
|
237
|
+
theta: CReal,
|
238
|
+
target: QArray[QBit],
|
274
239
|
) -> None:
|
275
240
|
pass
|
276
241
|
|
@@ -309,7 +274,7 @@ def CZ(
|
|
309
274
|
|
310
275
|
@qfunc(external=True)
|
311
276
|
def CRX(
|
312
|
-
theta:
|
277
|
+
theta: CReal,
|
313
278
|
control: QBit,
|
314
279
|
target: QBit,
|
315
280
|
) -> None:
|
@@ -318,7 +283,7 @@ def CRX(
|
|
318
283
|
|
319
284
|
@qfunc(external=True)
|
320
285
|
def CRY(
|
321
|
-
theta:
|
286
|
+
theta: CReal,
|
322
287
|
control: QBit,
|
323
288
|
target: QBit,
|
324
289
|
) -> None:
|
@@ -327,7 +292,7 @@ def CRY(
|
|
327
292
|
|
328
293
|
@qfunc(external=True)
|
329
294
|
def CRZ(
|
330
|
-
theta:
|
295
|
+
theta: CReal,
|
331
296
|
control: QBit,
|
332
297
|
target: QBit,
|
333
298
|
) -> None:
|
@@ -336,7 +301,7 @@ def CRZ(
|
|
336
301
|
|
337
302
|
@qfunc(external=True)
|
338
303
|
def CPHASE(
|
339
|
-
theta:
|
304
|
+
theta: CReal,
|
340
305
|
control: QBit,
|
341
306
|
target: QBit,
|
342
307
|
) -> None:
|
@@ -360,26 +325,26 @@ def IDENTITY(
|
|
360
325
|
|
361
326
|
@qfunc(external=True)
|
362
327
|
def prepare_state(
|
363
|
-
probabilities:
|
364
|
-
bound:
|
365
|
-
out: Output[QArray[QBit
|
328
|
+
probabilities: CArray[CReal],
|
329
|
+
bound: CReal,
|
330
|
+
out: Output[QArray[QBit]],
|
366
331
|
) -> None:
|
367
332
|
pass
|
368
333
|
|
369
334
|
|
370
335
|
@qfunc(external=True)
|
371
336
|
def prepare_amplitudes(
|
372
|
-
amplitudes:
|
373
|
-
bound:
|
374
|
-
out: Output[QArray[QBit
|
337
|
+
amplitudes: CArray[CReal],
|
338
|
+
bound: CReal,
|
339
|
+
out: Output[QArray[QBit]],
|
375
340
|
) -> None:
|
376
341
|
pass
|
377
342
|
|
378
343
|
|
379
344
|
@qfunc(external=True)
|
380
345
|
def unitary(
|
381
|
-
elements:
|
382
|
-
target: QArray[QBit
|
346
|
+
elements: CArray[CArray[CReal]],
|
347
|
+
target: QArray[QBit],
|
383
348
|
) -> None:
|
384
349
|
pass
|
385
350
|
|
@@ -388,7 +353,7 @@ def unitary(
|
|
388
353
|
def add(
|
389
354
|
left: QArray[QBit],
|
390
355
|
right: QArray[QBit],
|
391
|
-
result: Output[QArray[QBit
|
356
|
+
result: Output[QArray[QBit]],
|
392
357
|
) -> None:
|
393
358
|
pass
|
394
359
|
|
@@ -411,10 +376,10 @@ def integer_xor(
|
|
411
376
|
|
412
377
|
@qfunc(external=True)
|
413
378
|
def U(
|
414
|
-
theta:
|
415
|
-
phi:
|
416
|
-
lam:
|
417
|
-
gam:
|
379
|
+
theta: CReal,
|
380
|
+
phi: CReal,
|
381
|
+
lam: CReal,
|
382
|
+
gam: CReal,
|
418
383
|
target: QBit,
|
419
384
|
) -> None:
|
420
385
|
pass
|
@@ -422,7 +387,7 @@ def U(
|
|
422
387
|
|
423
388
|
@qfunc(external=True)
|
424
389
|
def CCX(
|
425
|
-
control: QArray[QBit
|
390
|
+
control: QArray[QBit],
|
426
391
|
target: QBit,
|
427
392
|
) -> None:
|
428
393
|
pass
|
@@ -430,8 +395,8 @@ def CCX(
|
|
430
395
|
|
431
396
|
@qfunc(external=True)
|
432
397
|
def allocate(
|
433
|
-
num_qubits:
|
434
|
-
out: Output[QArray[QBit
|
398
|
+
num_qubits: CInt,
|
399
|
+
out: Output[QArray[QBit]],
|
435
400
|
) -> None:
|
436
401
|
pass
|
437
402
|
|
@@ -445,7 +410,7 @@ def free(
|
|
445
410
|
|
446
411
|
@qfunc(external=True)
|
447
412
|
def randomized_benchmarking(
|
448
|
-
num_of_cliffords:
|
413
|
+
num_of_cliffords: CInt,
|
449
414
|
target: QArray[QBit],
|
450
415
|
) -> None:
|
451
416
|
pass
|
@@ -453,58 +418,58 @@ def randomized_benchmarking(
|
|
453
418
|
|
454
419
|
@qfunc(external=True)
|
455
420
|
def inplace_prepare_state(
|
456
|
-
probabilities:
|
457
|
-
bound:
|
458
|
-
target: QArray[QBit
|
421
|
+
probabilities: CArray[CReal],
|
422
|
+
bound: CReal,
|
423
|
+
target: QArray[QBit],
|
459
424
|
) -> None:
|
460
425
|
pass
|
461
426
|
|
462
427
|
|
463
428
|
@qfunc(external=True)
|
464
429
|
def inplace_prepare_amplitudes(
|
465
|
-
amplitudes:
|
466
|
-
bound:
|
467
|
-
target: QArray[QBit
|
430
|
+
amplitudes: CArray[CReal],
|
431
|
+
bound: CReal,
|
432
|
+
target: QArray[QBit],
|
468
433
|
) -> None:
|
469
434
|
pass
|
470
435
|
|
471
436
|
|
472
437
|
@qfunc(external=True)
|
473
438
|
def single_pauli_exponent(
|
474
|
-
pauli_string:
|
475
|
-
coefficient:
|
476
|
-
qbv: QArray[QBit
|
439
|
+
pauli_string: CArray[Pauli],
|
440
|
+
coefficient: CReal,
|
441
|
+
qbv: QArray[QBit],
|
477
442
|
) -> None:
|
478
443
|
pass
|
479
444
|
|
480
445
|
|
481
446
|
@qfunc(external=True)
|
482
447
|
def suzuki_trotter(
|
483
|
-
pauli_operator:
|
484
|
-
evolution_coefficient:
|
485
|
-
order:
|
486
|
-
repetitions:
|
487
|
-
qbv: QArray[QBit
|
448
|
+
pauli_operator: CArray[PauliTerm],
|
449
|
+
evolution_coefficient: CReal,
|
450
|
+
order: CInt,
|
451
|
+
repetitions: CInt,
|
452
|
+
qbv: QArray[QBit],
|
488
453
|
) -> None:
|
489
454
|
pass
|
490
455
|
|
491
456
|
|
492
457
|
@qfunc(external=True)
|
493
458
|
def qdrift(
|
494
|
-
pauli_operator:
|
495
|
-
evolution_coefficient:
|
496
|
-
num_qdrift:
|
497
|
-
qbv: QArray[QBit
|
459
|
+
pauli_operator: CArray[PauliTerm],
|
460
|
+
evolution_coefficient: CReal,
|
461
|
+
num_qdrift: CInt,
|
462
|
+
qbv: QArray[QBit],
|
498
463
|
) -> None:
|
499
464
|
pass
|
500
465
|
|
501
466
|
|
502
467
|
@qfunc(external=True)
|
503
468
|
def exponentiation_with_depth_constraint(
|
504
|
-
pauli_operator:
|
505
|
-
evolution_coefficient:
|
506
|
-
max_depth:
|
507
|
-
qbv: QArray[QBit
|
469
|
+
pauli_operator: CArray[PauliTerm],
|
470
|
+
evolution_coefficient: CReal,
|
471
|
+
max_depth: CInt,
|
472
|
+
qbv: QArray[QBit],
|
508
473
|
) -> None:
|
509
474
|
pass
|
510
475
|
|
@@ -525,7 +490,7 @@ def qft(
|
|
525
490
|
|
526
491
|
@qfunc(external=True)
|
527
492
|
def qpe_flexible(
|
528
|
-
unitary_with_power: QCallable[
|
493
|
+
unitary_with_power: QCallable[CInt],
|
529
494
|
phase: QNum,
|
530
495
|
) -> None:
|
531
496
|
pass
|
@@ -541,9 +506,9 @@ def qpe(
|
|
541
506
|
|
542
507
|
@qfunc(external=True)
|
543
508
|
def single_pauli(
|
544
|
-
slope:
|
545
|
-
offset:
|
546
|
-
q1_qfunc: QCallable[
|
509
|
+
slope: CReal,
|
510
|
+
offset: CReal,
|
511
|
+
q1_qfunc: QCallable[CReal, QBit],
|
547
512
|
x: QArray[QBit],
|
548
513
|
q: QBit,
|
549
514
|
) -> None:
|
@@ -552,9 +517,9 @@ def single_pauli(
|
|
552
517
|
|
553
518
|
@qfunc(external=True)
|
554
519
|
def linear_pauli_rotations(
|
555
|
-
bases:
|
556
|
-
slopes:
|
557
|
-
offsets:
|
520
|
+
bases: CArray[Pauli],
|
521
|
+
slopes: CArray[CReal],
|
522
|
+
offsets: CArray[CReal],
|
558
523
|
x: QArray[QBit],
|
559
524
|
q: QArray[QBit],
|
560
525
|
) -> None:
|
@@ -605,7 +570,7 @@ def grover_operator(
|
|
605
570
|
|
606
571
|
@qfunc(external=True)
|
607
572
|
def grover_search(
|
608
|
-
reps:
|
573
|
+
reps: CInt,
|
609
574
|
oracle: QCallable[QArray[QBit]],
|
610
575
|
packed_vars: QArray[QBit],
|
611
576
|
) -> None:
|
@@ -627,11 +592,97 @@ def apply_to_all(
|
|
627
592
|
pass
|
628
593
|
|
629
594
|
|
595
|
+
@qfunc(external=True)
|
596
|
+
def qft_no_swap(
|
597
|
+
qbv: QArray[QBit],
|
598
|
+
) -> None:
|
599
|
+
pass
|
600
|
+
|
601
|
+
|
602
|
+
@qfunc(external=True)
|
603
|
+
def _check_msb(
|
604
|
+
ref: CInt,
|
605
|
+
x: QArray[QBit],
|
606
|
+
aux: QArray[QBit],
|
607
|
+
) -> None:
|
608
|
+
pass
|
609
|
+
|
610
|
+
|
611
|
+
@qfunc(external=True)
|
612
|
+
def _ctrl_x(
|
613
|
+
ref: CInt,
|
614
|
+
ctrl: QArray[QBit],
|
615
|
+
aux: QArray[QBit],
|
616
|
+
) -> None:
|
617
|
+
pass
|
618
|
+
|
619
|
+
|
620
|
+
@qfunc(external=True)
|
621
|
+
def qft_space_add_const(
|
622
|
+
value: CInt,
|
623
|
+
phi_b: QArray[QBit],
|
624
|
+
) -> None:
|
625
|
+
pass
|
626
|
+
|
627
|
+
|
628
|
+
@qfunc(external=True)
|
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],
|
636
|
+
) -> None:
|
637
|
+
pass
|
638
|
+
|
639
|
+
|
640
|
+
@qfunc(external=True)
|
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],
|
648
|
+
) -> None:
|
649
|
+
pass
|
650
|
+
|
651
|
+
|
652
|
+
@qfunc(external=True)
|
653
|
+
def multiswap(
|
654
|
+
x: QArray[QBit],
|
655
|
+
y: QArray[QBit],
|
656
|
+
) -> None:
|
657
|
+
pass
|
658
|
+
|
659
|
+
|
660
|
+
@qfunc(external=True)
|
661
|
+
def inplace_c_modular_multiply(
|
662
|
+
n: CInt,
|
663
|
+
a: CInt,
|
664
|
+
x: QArray[QBit],
|
665
|
+
ctrl: QArray[QBit],
|
666
|
+
aux: QArray[QBit],
|
667
|
+
) -> None:
|
668
|
+
pass
|
669
|
+
|
670
|
+
|
671
|
+
@qfunc(external=True)
|
672
|
+
def modular_exp(
|
673
|
+
n: CInt,
|
674
|
+
a: CInt,
|
675
|
+
x: QArray[QBit],
|
676
|
+
power: QArray[QBit],
|
677
|
+
) -> None:
|
678
|
+
pass
|
679
|
+
|
680
|
+
|
630
681
|
@qfunc(external=True)
|
631
682
|
def allocate_num(
|
632
|
-
num_qubits:
|
633
|
-
is_signed:
|
634
|
-
fraction_digits:
|
683
|
+
num_qubits: CInt,
|
684
|
+
is_signed: CBool,
|
685
|
+
fraction_digits: CInt,
|
635
686
|
out: Output[QNum],
|
636
687
|
) -> None:
|
637
688
|
pass
|
@@ -639,7 +690,7 @@ def allocate_num(
|
|
639
690
|
|
640
691
|
@qfunc(external=True)
|
641
692
|
def qaoa_mixer_layer(
|
642
|
-
b:
|
693
|
+
b: CReal,
|
643
694
|
target: QArray[QBit],
|
644
695
|
) -> None:
|
645
696
|
pass
|
@@ -647,8 +698,8 @@ def qaoa_mixer_layer(
|
|
647
698
|
|
648
699
|
@qfunc(external=True)
|
649
700
|
def qaoa_cost_layer(
|
650
|
-
g:
|
651
|
-
hamiltonian:
|
701
|
+
g: CReal,
|
702
|
+
hamiltonian: CArray[PauliTerm],
|
652
703
|
target: QArray[QBit],
|
653
704
|
) -> None:
|
654
705
|
pass
|
@@ -656,9 +707,9 @@ def qaoa_cost_layer(
|
|
656
707
|
|
657
708
|
@qfunc(external=True)
|
658
709
|
def qaoa_layer(
|
659
|
-
g:
|
660
|
-
b:
|
661
|
-
hamiltonian:
|
710
|
+
g: CReal,
|
711
|
+
b: CReal,
|
712
|
+
hamiltonian: CArray[PauliTerm],
|
662
713
|
target: QArray[QBit],
|
663
714
|
) -> None:
|
664
715
|
pass
|
@@ -673,24 +724,24 @@ def qaoa_init(
|
|
673
724
|
|
674
725
|
@qfunc(external=True)
|
675
726
|
def qaoa_penalty(
|
676
|
-
num_qubits:
|
677
|
-
params_list:
|
678
|
-
hamiltonian:
|
679
|
-
target: QArray[QBit
|
727
|
+
num_qubits: CInt,
|
728
|
+
params_list: CArray[CReal],
|
729
|
+
hamiltonian: CArray[PauliTerm],
|
730
|
+
target: QArray[QBit],
|
680
731
|
) -> None:
|
681
732
|
pass
|
682
733
|
|
683
734
|
|
684
735
|
@qfunc(external=True)
|
685
736
|
def full_hea(
|
686
|
-
num_qubits:
|
687
|
-
is_parametrized:
|
688
|
-
angle_params:
|
689
|
-
connectivity_map:
|
690
|
-
reps:
|
691
|
-
operands_1qubit: QCallableList[
|
692
|
-
operands_2qubit: QCallableList[
|
693
|
-
x: QArray[QBit
|
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],
|
694
745
|
) -> None:
|
695
746
|
pass
|
696
747
|
|
@@ -706,7 +757,7 @@ def swap_test(
|
|
706
757
|
|
707
758
|
@qfunc(external=True)
|
708
759
|
def prepare_ghz_state(
|
709
|
-
size:
|
760
|
+
size: CInt,
|
710
761
|
q: Output[QArray[QBit]],
|
711
762
|
) -> None:
|
712
763
|
pass
|
@@ -714,7 +765,7 @@ def prepare_ghz_state(
|
|
714
765
|
|
715
766
|
@qfunc(external=True)
|
716
767
|
def prepare_exponential_state(
|
717
|
-
rate:
|
768
|
+
rate: CInt,
|
718
769
|
q: QArray[QBit],
|
719
770
|
) -> None:
|
720
771
|
pass
|
@@ -722,7 +773,7 @@ def prepare_exponential_state(
|
|
722
773
|
|
723
774
|
@qfunc(external=True)
|
724
775
|
def prepare_bell_state(
|
725
|
-
state_num:
|
776
|
+
state_num: CInt,
|
726
777
|
q: Output[QArray[QBit]],
|
727
778
|
) -> None:
|
728
779
|
pass
|
@@ -730,7 +781,7 @@ def prepare_bell_state(
|
|
730
781
|
|
731
782
|
@qfunc(external=True)
|
732
783
|
def inplace_prepare_int(
|
733
|
-
value:
|
784
|
+
value: CInt,
|
734
785
|
target: QArray[QBit],
|
735
786
|
) -> None:
|
736
787
|
pass
|
@@ -738,7 +789,7 @@ def inplace_prepare_int(
|
|
738
789
|
|
739
790
|
@qfunc(external=True)
|
740
791
|
def prepare_int(
|
741
|
-
value:
|
792
|
+
value: CInt,
|
742
793
|
out: Output[QNum],
|
743
794
|
) -> None:
|
744
795
|
pass
|
@@ -746,7 +797,7 @@ def prepare_int(
|
|
746
797
|
|
747
798
|
@qfunc(external=True)
|
748
799
|
def switch(
|
749
|
-
selector:
|
800
|
+
selector: CInt,
|
750
801
|
cases: QCallableList,
|
751
802
|
) -> None:
|
752
803
|
pass
|
@@ -823,6 +874,15 @@ __all__ = [
|
|
823
874
|
"grover_search",
|
824
875
|
"hadamard_transform",
|
825
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",
|
826
886
|
"allocate_num",
|
827
887
|
"qaoa_mixer_layer",
|
828
888
|
"qaoa_cost_layer",
|