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
@@ -229,8 +229,8 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
229
229
|
"packed_vars": {
|
230
230
|
"name": "packed_vars",
|
231
231
|
"quantum_type": {
|
232
|
-
"
|
233
|
-
"
|
232
|
+
"kind": "qvec",
|
233
|
+
"length": null
|
234
234
|
},
|
235
235
|
"direction": "inout"
|
236
236
|
}
|
@@ -242,8 +242,8 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
242
242
|
{
|
243
243
|
"name": "arg0",
|
244
244
|
"quantum_type": {
|
245
|
-
"
|
246
|
-
"
|
245
|
+
"kind": "qvec",
|
246
|
+
"length": null
|
247
247
|
},
|
248
248
|
"direction": "inout"
|
249
249
|
}
|
@@ -256,8 +256,8 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
256
256
|
{
|
257
257
|
"name": "arg0",
|
258
258
|
"quantum_type": {
|
259
|
-
"
|
260
|
-
"
|
259
|
+
"kind": "qvec",
|
260
|
+
"length": null
|
261
261
|
},
|
262
262
|
"direction": "inout"
|
263
263
|
}
|
@@ -272,8 +272,8 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
272
272
|
{
|
273
273
|
"name": "arg0",
|
274
274
|
"quantum_type": {
|
275
|
-
"
|
276
|
-
"
|
275
|
+
"kind": "qvec",
|
276
|
+
"length": null
|
277
277
|
},
|
278
278
|
"direction": "inout"
|
279
279
|
}
|
@@ -286,8 +286,8 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
286
286
|
{
|
287
287
|
"name": "arg0",
|
288
288
|
"quantum_type": {
|
289
|
-
"
|
290
|
-
"
|
289
|
+
"kind": "qvec",
|
290
|
+
"length": null
|
291
291
|
},
|
292
292
|
"direction": "inout"
|
293
293
|
}
|
@@ -304,8 +304,8 @@ AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
|
|
304
304
|
{
|
305
305
|
"name": "packed_vars",
|
306
306
|
"quantum_type": {
|
307
|
-
"
|
308
|
-
"
|
307
|
+
"kind": "qvec",
|
308
|
+
"length": null
|
309
309
|
},
|
310
310
|
"direction": "inout"
|
311
311
|
}
|
@@ -322,8 +322,8 @@ PHASE_ORACLE = QuantumFunctionDeclaration.parse_raw(
|
|
322
322
|
"target": {
|
323
323
|
"name": "target",
|
324
324
|
"quantum_type": {
|
325
|
-
"
|
326
|
-
"
|
325
|
+
"kind": "qvec",
|
326
|
+
"length": null
|
327
327
|
},
|
328
328
|
"direction": "inout"
|
329
329
|
}
|
@@ -335,8 +335,8 @@ PHASE_ORACLE = QuantumFunctionDeclaration.parse_raw(
|
|
335
335
|
{
|
336
336
|
"name": "arg0",
|
337
337
|
"quantum_type": {
|
338
|
-
"
|
339
|
-
"
|
338
|
+
"kind": "qvec",
|
339
|
+
"length": null
|
340
340
|
},
|
341
341
|
"direction": "inout"
|
342
342
|
},
|
@@ -358,8 +358,8 @@ PHASE_ORACLE = QuantumFunctionDeclaration.parse_raw(
|
|
358
358
|
{
|
359
359
|
"name": "arg0",
|
360
360
|
"quantum_type": {
|
361
|
-
"
|
362
|
-
"
|
361
|
+
"kind": "qvec",
|
362
|
+
"length": null
|
363
363
|
},
|
364
364
|
"direction": "inout"
|
365
365
|
},
|
@@ -376,8 +376,8 @@ PHASE_ORACLE = QuantumFunctionDeclaration.parse_raw(
|
|
376
376
|
{
|
377
377
|
"name": "target",
|
378
378
|
"quantum_type": {
|
379
|
-
"
|
380
|
-
"
|
379
|
+
"kind": "qvec",
|
380
|
+
"length": null
|
381
381
|
},
|
382
382
|
"direction": "inout"
|
383
383
|
}
|
@@ -394,8 +394,8 @@ REFLECT_ABOUT_ZERO = QuantumFunctionDeclaration.parse_raw(
|
|
394
394
|
"packed_vars": {
|
395
395
|
"name": "packed_vars",
|
396
396
|
"quantum_type": {
|
397
|
-
"
|
398
|
-
"
|
397
|
+
"kind": "qvec",
|
398
|
+
"length": null
|
399
399
|
},
|
400
400
|
"direction": "inout"
|
401
401
|
}
|
@@ -405,8 +405,8 @@ REFLECT_ABOUT_ZERO = QuantumFunctionDeclaration.parse_raw(
|
|
405
405
|
{
|
406
406
|
"name": "packed_vars",
|
407
407
|
"quantum_type": {
|
408
|
-
"
|
409
|
-
"
|
408
|
+
"kind": "qvec",
|
409
|
+
"length": null
|
410
410
|
},
|
411
411
|
"direction": "inout"
|
412
412
|
}
|
@@ -423,8 +423,8 @@ GROVER_DIFFUSER = QuantumFunctionDeclaration.parse_raw(
|
|
423
423
|
"packed_vars": {
|
424
424
|
"name": "packed_vars",
|
425
425
|
"quantum_type": {
|
426
|
-
"
|
427
|
-
"
|
426
|
+
"kind": "qvec",
|
427
|
+
"length": null
|
428
428
|
},
|
429
429
|
"direction": "inout"
|
430
430
|
}
|
@@ -436,8 +436,8 @@ GROVER_DIFFUSER = QuantumFunctionDeclaration.parse_raw(
|
|
436
436
|
{
|
437
437
|
"name": "arg0",
|
438
438
|
"quantum_type": {
|
439
|
-
"
|
440
|
-
"
|
439
|
+
"kind": "qvec",
|
440
|
+
"length": null
|
441
441
|
},
|
442
442
|
"direction": "inout"
|
443
443
|
}
|
@@ -452,8 +452,8 @@ GROVER_DIFFUSER = QuantumFunctionDeclaration.parse_raw(
|
|
452
452
|
{
|
453
453
|
"name": "arg0",
|
454
454
|
"quantum_type": {
|
455
|
-
"
|
456
|
-
"
|
455
|
+
"kind": "qvec",
|
456
|
+
"length": null
|
457
457
|
},
|
458
458
|
"direction": "inout"
|
459
459
|
}
|
@@ -463,8 +463,8 @@ GROVER_DIFFUSER = QuantumFunctionDeclaration.parse_raw(
|
|
463
463
|
{
|
464
464
|
"name": "packed_vars",
|
465
465
|
"quantum_type": {
|
466
|
-
"
|
467
|
-
"
|
466
|
+
"kind": "qvec",
|
467
|
+
"length": null
|
468
468
|
},
|
469
469
|
"direction": "inout"
|
470
470
|
}
|
@@ -481,8 +481,8 @@ GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
|
|
481
481
|
"packed_vars": {
|
482
482
|
"name": "packed_vars",
|
483
483
|
"quantum_type": {
|
484
|
-
"
|
485
|
-
"
|
484
|
+
"kind": "qvec",
|
485
|
+
"length": null
|
486
486
|
},
|
487
487
|
"direction": "inout"
|
488
488
|
}
|
@@ -494,8 +494,8 @@ GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
|
|
494
494
|
{
|
495
495
|
"name": "arg0",
|
496
496
|
"quantum_type": {
|
497
|
-
"
|
498
|
-
"
|
497
|
+
"kind": "qvec",
|
498
|
+
"length": null
|
499
499
|
},
|
500
500
|
"direction": "inout"
|
501
501
|
}
|
@@ -508,8 +508,8 @@ GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
|
|
508
508
|
{
|
509
509
|
"name": "arg0",
|
510
510
|
"quantum_type": {
|
511
|
-
"
|
512
|
-
"
|
511
|
+
"kind": "qvec",
|
512
|
+
"length": null
|
513
513
|
},
|
514
514
|
"direction": "inout"
|
515
515
|
}
|
@@ -524,8 +524,8 @@ GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
|
|
524
524
|
{
|
525
525
|
"name": "arg0",
|
526
526
|
"quantum_type": {
|
527
|
-
"
|
528
|
-
"
|
527
|
+
"kind": "qvec",
|
528
|
+
"length": null
|
529
529
|
},
|
530
530
|
"direction": "inout"
|
531
531
|
}
|
@@ -538,8 +538,8 @@ GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
|
|
538
538
|
{
|
539
539
|
"name": "arg0",
|
540
540
|
"quantum_type": {
|
541
|
-
"
|
542
|
-
"
|
541
|
+
"kind": "qvec",
|
542
|
+
"length": null
|
543
543
|
},
|
544
544
|
"direction": "inout"
|
545
545
|
}
|
@@ -549,8 +549,8 @@ GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
|
|
549
549
|
{
|
550
550
|
"name": "packed_vars",
|
551
551
|
"quantum_type": {
|
552
|
-
"
|
553
|
-
"
|
552
|
+
"kind": "qvec",
|
553
|
+
"length": null
|
554
554
|
},
|
555
555
|
"direction": "inout"
|
556
556
|
}
|
@@ -571,8 +571,8 @@ GROVER_SEARCH = QuantumFunctionDeclaration.parse_raw(
|
|
571
571
|
"packed_vars": {
|
572
572
|
"name": "packed_vars",
|
573
573
|
"quantum_type": {
|
574
|
-
"
|
575
|
-
"
|
574
|
+
"kind": "qvec",
|
575
|
+
"length": null
|
576
576
|
},
|
577
577
|
"direction": "inout"
|
578
578
|
}
|
@@ -584,8 +584,8 @@ GROVER_SEARCH = QuantumFunctionDeclaration.parse_raw(
|
|
584
584
|
{
|
585
585
|
"name": "arg0",
|
586
586
|
"quantum_type": {
|
587
|
-
"
|
588
|
-
"
|
587
|
+
"kind": "qvec",
|
588
|
+
"length": null
|
589
589
|
},
|
590
590
|
"direction": "inout"
|
591
591
|
}
|
@@ -606,8 +606,8 @@ GROVER_SEARCH = QuantumFunctionDeclaration.parse_raw(
|
|
606
606
|
{
|
607
607
|
"name": "arg0",
|
608
608
|
"quantum_type": {
|
609
|
-
"
|
610
|
-
"
|
609
|
+
"kind": "qvec",
|
610
|
+
"length": null
|
611
611
|
},
|
612
612
|
"direction": "inout"
|
613
613
|
}
|
@@ -617,8 +617,8 @@ GROVER_SEARCH = QuantumFunctionDeclaration.parse_raw(
|
|
617
617
|
{
|
618
618
|
"name": "packed_vars",
|
619
619
|
"quantum_type": {
|
620
|
-
"
|
621
|
-
"
|
620
|
+
"kind": "qvec",
|
621
|
+
"length": null
|
622
622
|
},
|
623
623
|
"direction": "inout"
|
624
624
|
}
|
@@ -671,6 +671,545 @@ APPLY_TO_ALL = QuantumFunctionDeclaration.parse_raw(
|
|
671
671
|
}"""
|
672
672
|
)
|
673
673
|
|
674
|
+
QFT_NO_SWAP = QuantumFunctionDeclaration.parse_raw(
|
675
|
+
"""{
|
676
|
+
"source_ref": null,
|
677
|
+
"name": "qft_no_swap",
|
678
|
+
"param_decls": {},
|
679
|
+
"port_declarations": {
|
680
|
+
"qbv": {
|
681
|
+
"name": "qbv",
|
682
|
+
"quantum_type": {
|
683
|
+
"kind": "qvec",
|
684
|
+
"length": null
|
685
|
+
},
|
686
|
+
"direction": "inout"
|
687
|
+
}
|
688
|
+
},
|
689
|
+
"operand_declarations": {},
|
690
|
+
"positional_arg_declarations": [
|
691
|
+
{
|
692
|
+
"name": "qbv",
|
693
|
+
"quantum_type": {
|
694
|
+
"kind": "qvec",
|
695
|
+
"length": null
|
696
|
+
},
|
697
|
+
"direction": "inout"
|
698
|
+
}
|
699
|
+
]
|
700
|
+
}"""
|
701
|
+
)
|
702
|
+
|
703
|
+
_CHECK_MSB = QuantumFunctionDeclaration.parse_raw(
|
704
|
+
"""{
|
705
|
+
"source_ref": null,
|
706
|
+
"name": "_check_msb",
|
707
|
+
"param_decls": {
|
708
|
+
"ref": {
|
709
|
+
"kind": "int"
|
710
|
+
}
|
711
|
+
},
|
712
|
+
"port_declarations": {
|
713
|
+
"x": {
|
714
|
+
"name": "x",
|
715
|
+
"quantum_type": {
|
716
|
+
"kind": "qvec",
|
717
|
+
"length": null
|
718
|
+
},
|
719
|
+
"direction": "inout"
|
720
|
+
},
|
721
|
+
"aux": {
|
722
|
+
"name": "aux",
|
723
|
+
"quantum_type": {
|
724
|
+
"kind": "qbit"
|
725
|
+
},
|
726
|
+
"direction": "inout"
|
727
|
+
}
|
728
|
+
},
|
729
|
+
"operand_declarations": {},
|
730
|
+
"positional_arg_declarations": [
|
731
|
+
{
|
732
|
+
"name": "ref",
|
733
|
+
"classical_type": {
|
734
|
+
"kind": "int"
|
735
|
+
}
|
736
|
+
},
|
737
|
+
{
|
738
|
+
"name": "x",
|
739
|
+
"quantum_type": {
|
740
|
+
"kind": "qvec",
|
741
|
+
"length": null
|
742
|
+
},
|
743
|
+
"direction": "inout"
|
744
|
+
},
|
745
|
+
{
|
746
|
+
"name": "aux",
|
747
|
+
"quantum_type": {
|
748
|
+
"kind": "qbit"
|
749
|
+
},
|
750
|
+
"direction": "inout"
|
751
|
+
}
|
752
|
+
]
|
753
|
+
}"""
|
754
|
+
)
|
755
|
+
|
756
|
+
_CTRL_X = QuantumFunctionDeclaration.parse_raw(
|
757
|
+
"""{
|
758
|
+
"source_ref": null,
|
759
|
+
"name": "_ctrl_x",
|
760
|
+
"param_decls": {
|
761
|
+
"ref": {
|
762
|
+
"kind": "int"
|
763
|
+
}
|
764
|
+
},
|
765
|
+
"port_declarations": {
|
766
|
+
"ctrl": {
|
767
|
+
"name": "ctrl",
|
768
|
+
"quantum_type": {
|
769
|
+
"kind": "qnum"
|
770
|
+
},
|
771
|
+
"direction": "inout"
|
772
|
+
},
|
773
|
+
"aux": {
|
774
|
+
"name": "aux",
|
775
|
+
"quantum_type": {
|
776
|
+
"kind": "qbit"
|
777
|
+
},
|
778
|
+
"direction": "inout"
|
779
|
+
}
|
780
|
+
},
|
781
|
+
"operand_declarations": {},
|
782
|
+
"positional_arg_declarations": [
|
783
|
+
{
|
784
|
+
"name": "ref",
|
785
|
+
"classical_type": {
|
786
|
+
"kind": "int"
|
787
|
+
}
|
788
|
+
},
|
789
|
+
{
|
790
|
+
"name": "ctrl",
|
791
|
+
"quantum_type": {
|
792
|
+
"kind": "qnum"
|
793
|
+
},
|
794
|
+
"direction": "inout"
|
795
|
+
},
|
796
|
+
{
|
797
|
+
"name": "aux",
|
798
|
+
"quantum_type": {
|
799
|
+
"kind": "qbit"
|
800
|
+
},
|
801
|
+
"direction": "inout"
|
802
|
+
}
|
803
|
+
]
|
804
|
+
}"""
|
805
|
+
)
|
806
|
+
|
807
|
+
QFT_SPACE_ADD_CONST = QuantumFunctionDeclaration.parse_raw(
|
808
|
+
"""{
|
809
|
+
"source_ref": null,
|
810
|
+
"name": "qft_space_add_const",
|
811
|
+
"param_decls": {
|
812
|
+
"value": {
|
813
|
+
"kind": "int"
|
814
|
+
}
|
815
|
+
},
|
816
|
+
"port_declarations": {
|
817
|
+
"phi_b": {
|
818
|
+
"name": "phi_b",
|
819
|
+
"quantum_type": {
|
820
|
+
"kind": "qvec",
|
821
|
+
"length": null
|
822
|
+
},
|
823
|
+
"direction": "inout"
|
824
|
+
}
|
825
|
+
},
|
826
|
+
"operand_declarations": {},
|
827
|
+
"positional_arg_declarations": [
|
828
|
+
{
|
829
|
+
"name": "value",
|
830
|
+
"classical_type": {
|
831
|
+
"kind": "int"
|
832
|
+
}
|
833
|
+
},
|
834
|
+
{
|
835
|
+
"name": "phi_b",
|
836
|
+
"quantum_type": {
|
837
|
+
"kind": "qvec",
|
838
|
+
"length": null
|
839
|
+
},
|
840
|
+
"direction": "inout"
|
841
|
+
}
|
842
|
+
]
|
843
|
+
}"""
|
844
|
+
)
|
845
|
+
|
846
|
+
CC_MODULAR_ADD = QuantumFunctionDeclaration.parse_raw(
|
847
|
+
"""{
|
848
|
+
"source_ref": null,
|
849
|
+
"name": "cc_modular_add",
|
850
|
+
"param_decls": {
|
851
|
+
"n": {
|
852
|
+
"kind": "int"
|
853
|
+
},
|
854
|
+
"a": {
|
855
|
+
"kind": "int"
|
856
|
+
}
|
857
|
+
},
|
858
|
+
"port_declarations": {
|
859
|
+
"phi_b": {
|
860
|
+
"name": "phi_b",
|
861
|
+
"quantum_type": {
|
862
|
+
"kind": "qvec",
|
863
|
+
"length": null
|
864
|
+
},
|
865
|
+
"direction": "inout"
|
866
|
+
},
|
867
|
+
"c1": {
|
868
|
+
"name": "c1",
|
869
|
+
"quantum_type": {
|
870
|
+
"kind": "qbit"
|
871
|
+
},
|
872
|
+
"direction": "inout"
|
873
|
+
},
|
874
|
+
"c2": {
|
875
|
+
"name": "c2",
|
876
|
+
"quantum_type": {
|
877
|
+
"kind": "qbit"
|
878
|
+
},
|
879
|
+
"direction": "inout"
|
880
|
+
},
|
881
|
+
"aux": {
|
882
|
+
"name": "aux",
|
883
|
+
"quantum_type": {
|
884
|
+
"kind": "qbit"
|
885
|
+
},
|
886
|
+
"direction": "inout"
|
887
|
+
}
|
888
|
+
},
|
889
|
+
"operand_declarations": {},
|
890
|
+
"positional_arg_declarations": [
|
891
|
+
{
|
892
|
+
"name": "n",
|
893
|
+
"classical_type": {
|
894
|
+
"kind": "int"
|
895
|
+
}
|
896
|
+
},
|
897
|
+
{
|
898
|
+
"name": "a",
|
899
|
+
"classical_type": {
|
900
|
+
"kind": "int"
|
901
|
+
}
|
902
|
+
},
|
903
|
+
{
|
904
|
+
"name": "phi_b",
|
905
|
+
"quantum_type": {
|
906
|
+
"kind": "qvec",
|
907
|
+
"length": null
|
908
|
+
},
|
909
|
+
"direction": "inout"
|
910
|
+
},
|
911
|
+
{
|
912
|
+
"name": "c1",
|
913
|
+
"quantum_type": {
|
914
|
+
"kind": "qbit"
|
915
|
+
},
|
916
|
+
"direction": "inout"
|
917
|
+
},
|
918
|
+
{
|
919
|
+
"name": "c2",
|
920
|
+
"quantum_type": {
|
921
|
+
"kind": "qbit"
|
922
|
+
},
|
923
|
+
"direction": "inout"
|
924
|
+
},
|
925
|
+
{
|
926
|
+
"name": "aux",
|
927
|
+
"quantum_type": {
|
928
|
+
"kind": "qbit"
|
929
|
+
},
|
930
|
+
"direction": "inout"
|
931
|
+
}
|
932
|
+
]
|
933
|
+
}"""
|
934
|
+
)
|
935
|
+
|
936
|
+
C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
937
|
+
"""{
|
938
|
+
"source_ref": null,
|
939
|
+
"name": "c_modular_multiply",
|
940
|
+
"param_decls": {
|
941
|
+
"n": {
|
942
|
+
"kind": "int"
|
943
|
+
},
|
944
|
+
"a": {
|
945
|
+
"kind": "int"
|
946
|
+
}
|
947
|
+
},
|
948
|
+
"port_declarations": {
|
949
|
+
"b": {
|
950
|
+
"name": "b",
|
951
|
+
"quantum_type": {
|
952
|
+
"kind": "qvec",
|
953
|
+
"length": null
|
954
|
+
},
|
955
|
+
"direction": "inout"
|
956
|
+
},
|
957
|
+
"x": {
|
958
|
+
"name": "x",
|
959
|
+
"quantum_type": {
|
960
|
+
"kind": "qvec",
|
961
|
+
"length": null
|
962
|
+
},
|
963
|
+
"direction": "inout"
|
964
|
+
},
|
965
|
+
"ctrl": {
|
966
|
+
"name": "ctrl",
|
967
|
+
"quantum_type": {
|
968
|
+
"kind": "qbit"
|
969
|
+
},
|
970
|
+
"direction": "inout"
|
971
|
+
},
|
972
|
+
"aux": {
|
973
|
+
"name": "aux",
|
974
|
+
"quantum_type": {
|
975
|
+
"kind": "qbit"
|
976
|
+
},
|
977
|
+
"direction": "inout"
|
978
|
+
}
|
979
|
+
},
|
980
|
+
"operand_declarations": {},
|
981
|
+
"positional_arg_declarations": [
|
982
|
+
{
|
983
|
+
"name": "n",
|
984
|
+
"classical_type": {
|
985
|
+
"kind": "int"
|
986
|
+
}
|
987
|
+
},
|
988
|
+
{
|
989
|
+
"name": "a",
|
990
|
+
"classical_type": {
|
991
|
+
"kind": "int"
|
992
|
+
}
|
993
|
+
},
|
994
|
+
{
|
995
|
+
"name": "b",
|
996
|
+
"quantum_type": {
|
997
|
+
"kind": "qvec",
|
998
|
+
"length": null
|
999
|
+
},
|
1000
|
+
"direction": "inout"
|
1001
|
+
},
|
1002
|
+
{
|
1003
|
+
"name": "x",
|
1004
|
+
"quantum_type": {
|
1005
|
+
"kind": "qvec",
|
1006
|
+
"length": null
|
1007
|
+
},
|
1008
|
+
"direction": "inout"
|
1009
|
+
},
|
1010
|
+
{
|
1011
|
+
"name": "ctrl",
|
1012
|
+
"quantum_type": {
|
1013
|
+
"kind": "qbit"
|
1014
|
+
},
|
1015
|
+
"direction": "inout"
|
1016
|
+
},
|
1017
|
+
{
|
1018
|
+
"name": "aux",
|
1019
|
+
"quantum_type": {
|
1020
|
+
"kind": "qbit"
|
1021
|
+
},
|
1022
|
+
"direction": "inout"
|
1023
|
+
}
|
1024
|
+
]
|
1025
|
+
}"""
|
1026
|
+
)
|
1027
|
+
|
1028
|
+
MULTISWAP = QuantumFunctionDeclaration.parse_raw(
|
1029
|
+
"""{
|
1030
|
+
"source_ref": null,
|
1031
|
+
"name": "multiswap",
|
1032
|
+
"param_decls": {},
|
1033
|
+
"port_declarations": {
|
1034
|
+
"x": {
|
1035
|
+
"name": "x",
|
1036
|
+
"quantum_type": {
|
1037
|
+
"kind": "qvec",
|
1038
|
+
"length": null
|
1039
|
+
},
|
1040
|
+
"direction": "inout"
|
1041
|
+
},
|
1042
|
+
"y": {
|
1043
|
+
"name": "y",
|
1044
|
+
"quantum_type": {
|
1045
|
+
"kind": "qvec",
|
1046
|
+
"length": null
|
1047
|
+
},
|
1048
|
+
"direction": "inout"
|
1049
|
+
}
|
1050
|
+
},
|
1051
|
+
"operand_declarations": {},
|
1052
|
+
"positional_arg_declarations": [
|
1053
|
+
{
|
1054
|
+
"name": "x",
|
1055
|
+
"quantum_type": {
|
1056
|
+
"kind": "qvec",
|
1057
|
+
"length": null
|
1058
|
+
},
|
1059
|
+
"direction": "inout"
|
1060
|
+
},
|
1061
|
+
{
|
1062
|
+
"name": "y",
|
1063
|
+
"quantum_type": {
|
1064
|
+
"kind": "qvec",
|
1065
|
+
"length": null
|
1066
|
+
},
|
1067
|
+
"direction": "inout"
|
1068
|
+
}
|
1069
|
+
]
|
1070
|
+
}"""
|
1071
|
+
)
|
1072
|
+
|
1073
|
+
INPLACE_C_MODULAR_MULTIPLY = QuantumFunctionDeclaration.parse_raw(
|
1074
|
+
"""{
|
1075
|
+
"source_ref": null,
|
1076
|
+
"name": "inplace_c_modular_multiply",
|
1077
|
+
"param_decls": {
|
1078
|
+
"n": {
|
1079
|
+
"kind": "int"
|
1080
|
+
},
|
1081
|
+
"a": {
|
1082
|
+
"kind": "int"
|
1083
|
+
}
|
1084
|
+
},
|
1085
|
+
"port_declarations": {
|
1086
|
+
"x": {
|
1087
|
+
"name": "x",
|
1088
|
+
"quantum_type": {
|
1089
|
+
"kind": "qvec",
|
1090
|
+
"length": null
|
1091
|
+
},
|
1092
|
+
"direction": "inout"
|
1093
|
+
},
|
1094
|
+
"ctrl": {
|
1095
|
+
"name": "ctrl",
|
1096
|
+
"quantum_type": {
|
1097
|
+
"kind": "qbit"
|
1098
|
+
},
|
1099
|
+
"direction": "inout"
|
1100
|
+
},
|
1101
|
+
"aux": {
|
1102
|
+
"name": "aux",
|
1103
|
+
"quantum_type": {
|
1104
|
+
"kind": "qbit"
|
1105
|
+
},
|
1106
|
+
"direction": "inout"
|
1107
|
+
}
|
1108
|
+
},
|
1109
|
+
"operand_declarations": {},
|
1110
|
+
"positional_arg_declarations": [
|
1111
|
+
{
|
1112
|
+
"name": "n",
|
1113
|
+
"classical_type": {
|
1114
|
+
"kind": "int"
|
1115
|
+
}
|
1116
|
+
},
|
1117
|
+
{
|
1118
|
+
"name": "a",
|
1119
|
+
"classical_type": {
|
1120
|
+
"kind": "int"
|
1121
|
+
}
|
1122
|
+
},
|
1123
|
+
{
|
1124
|
+
"name": "x",
|
1125
|
+
"quantum_type": {
|
1126
|
+
"kind": "qvec",
|
1127
|
+
"length": null
|
1128
|
+
},
|
1129
|
+
"direction": "inout"
|
1130
|
+
},
|
1131
|
+
{
|
1132
|
+
"name": "ctrl",
|
1133
|
+
"quantum_type": {
|
1134
|
+
"kind": "qbit"
|
1135
|
+
},
|
1136
|
+
"direction": "inout"
|
1137
|
+
},
|
1138
|
+
{
|
1139
|
+
"name": "aux",
|
1140
|
+
"quantum_type": {
|
1141
|
+
"kind": "qbit"
|
1142
|
+
},
|
1143
|
+
"direction": "inout"
|
1144
|
+
}
|
1145
|
+
]
|
1146
|
+
}"""
|
1147
|
+
)
|
1148
|
+
|
1149
|
+
MODULAR_EXP = QuantumFunctionDeclaration.parse_raw(
|
1150
|
+
"""{
|
1151
|
+
"source_ref": null,
|
1152
|
+
"name": "modular_exp",
|
1153
|
+
"param_decls": {
|
1154
|
+
"n": {
|
1155
|
+
"kind": "int"
|
1156
|
+
},
|
1157
|
+
"a": {
|
1158
|
+
"kind": "int"
|
1159
|
+
}
|
1160
|
+
},
|
1161
|
+
"port_declarations": {
|
1162
|
+
"x": {
|
1163
|
+
"name": "x",
|
1164
|
+
"quantum_type": {
|
1165
|
+
"kind": "qvec",
|
1166
|
+
"length": null
|
1167
|
+
},
|
1168
|
+
"direction": "inout"
|
1169
|
+
},
|
1170
|
+
"power": {
|
1171
|
+
"name": "power",
|
1172
|
+
"quantum_type": {
|
1173
|
+
"kind": "qvec",
|
1174
|
+
"length": null
|
1175
|
+
},
|
1176
|
+
"direction": "inout"
|
1177
|
+
}
|
1178
|
+
},
|
1179
|
+
"operand_declarations": {},
|
1180
|
+
"positional_arg_declarations": [
|
1181
|
+
{
|
1182
|
+
"name": "n",
|
1183
|
+
"classical_type": {
|
1184
|
+
"kind": "int"
|
1185
|
+
}
|
1186
|
+
},
|
1187
|
+
{
|
1188
|
+
"name": "a",
|
1189
|
+
"classical_type": {
|
1190
|
+
"kind": "int"
|
1191
|
+
}
|
1192
|
+
},
|
1193
|
+
{
|
1194
|
+
"name": "x",
|
1195
|
+
"quantum_type": {
|
1196
|
+
"kind": "qvec",
|
1197
|
+
"length": null
|
1198
|
+
},
|
1199
|
+
"direction": "inout"
|
1200
|
+
},
|
1201
|
+
{
|
1202
|
+
"name": "power",
|
1203
|
+
"quantum_type": {
|
1204
|
+
"kind": "qvec",
|
1205
|
+
"length": null
|
1206
|
+
},
|
1207
|
+
"direction": "inout"
|
1208
|
+
}
|
1209
|
+
]
|
1210
|
+
}"""
|
1211
|
+
)
|
1212
|
+
|
674
1213
|
ALLOCATE_NUM = QuantumFunctionDeclaration.parse_raw(
|
675
1214
|
"""{
|
676
1215
|
"source_ref": null,
|
@@ -938,16 +1477,16 @@ SWAP_TEST = QuantumFunctionDeclaration.parse_raw(
|
|
938
1477
|
"state1": {
|
939
1478
|
"name": "state1",
|
940
1479
|
"quantum_type": {
|
941
|
-
"
|
942
|
-
"
|
1480
|
+
"kind": "qvec",
|
1481
|
+
"length": null
|
943
1482
|
},
|
944
1483
|
"direction": "inout"
|
945
1484
|
},
|
946
1485
|
"state2": {
|
947
1486
|
"name": "state2",
|
948
1487
|
"quantum_type": {
|
949
|
-
"
|
950
|
-
"
|
1488
|
+
"kind": "qvec",
|
1489
|
+
"length": null
|
951
1490
|
},
|
952
1491
|
"direction": "inout"
|
953
1492
|
},
|
@@ -964,16 +1503,16 @@ SWAP_TEST = QuantumFunctionDeclaration.parse_raw(
|
|
964
1503
|
{
|
965
1504
|
"name": "state1",
|
966
1505
|
"quantum_type": {
|
967
|
-
"
|
968
|
-
"
|
1506
|
+
"kind": "qvec",
|
1507
|
+
"length": null
|
969
1508
|
},
|
970
1509
|
"direction": "inout"
|
971
1510
|
},
|
972
1511
|
{
|
973
1512
|
"name": "state2",
|
974
1513
|
"quantum_type": {
|
975
|
-
"
|
976
|
-
"
|
1514
|
+
"kind": "qvec",
|
1515
|
+
"length": null
|
977
1516
|
},
|
978
1517
|
"direction": "inout"
|
979
1518
|
},
|
@@ -1001,8 +1540,8 @@ PREPARE_GHZ_STATE = QuantumFunctionDeclaration.parse_raw(
|
|
1001
1540
|
"q": {
|
1002
1541
|
"name": "q",
|
1003
1542
|
"quantum_type": {
|
1004
|
-
"
|
1005
|
-
"
|
1543
|
+
"kind": "qvec",
|
1544
|
+
"length": null
|
1006
1545
|
},
|
1007
1546
|
"direction": "output"
|
1008
1547
|
}
|
@@ -1018,8 +1557,8 @@ PREPARE_GHZ_STATE = QuantumFunctionDeclaration.parse_raw(
|
|
1018
1557
|
{
|
1019
1558
|
"name": "q",
|
1020
1559
|
"quantum_type": {
|
1021
|
-
"
|
1022
|
-
"
|
1560
|
+
"kind": "qvec",
|
1561
|
+
"length": null
|
1023
1562
|
},
|
1024
1563
|
"direction": "output"
|
1025
1564
|
}
|
@@ -1040,8 +1579,8 @@ PREPARE_EXPONENTIAL_STATE = QuantumFunctionDeclaration.parse_raw(
|
|
1040
1579
|
"q": {
|
1041
1580
|
"name": "q",
|
1042
1581
|
"quantum_type": {
|
1043
|
-
"
|
1044
|
-
"
|
1582
|
+
"kind": "qvec",
|
1583
|
+
"length": null
|
1045
1584
|
},
|
1046
1585
|
"direction": "inout"
|
1047
1586
|
}
|
@@ -1057,8 +1596,8 @@ PREPARE_EXPONENTIAL_STATE = QuantumFunctionDeclaration.parse_raw(
|
|
1057
1596
|
{
|
1058
1597
|
"name": "q",
|
1059
1598
|
"quantum_type": {
|
1060
|
-
"
|
1061
|
-
"
|
1599
|
+
"kind": "qvec",
|
1600
|
+
"length": null
|
1062
1601
|
},
|
1063
1602
|
"direction": "inout"
|
1064
1603
|
}
|
@@ -1079,10 +1618,10 @@ PREPARE_BELL_STATE = QuantumFunctionDeclaration.parse_raw(
|
|
1079
1618
|
"q": {
|
1080
1619
|
"name": "q",
|
1081
1620
|
"quantum_type": {
|
1621
|
+
"kind": "qvec",
|
1082
1622
|
"length": {
|
1083
1623
|
"expr": "2"
|
1084
|
-
}
|
1085
|
-
"kind": "qvec"
|
1624
|
+
}
|
1086
1625
|
},
|
1087
1626
|
"direction": "output"
|
1088
1627
|
}
|
@@ -1098,10 +1637,10 @@ PREPARE_BELL_STATE = QuantumFunctionDeclaration.parse_raw(
|
|
1098
1637
|
{
|
1099
1638
|
"name": "q",
|
1100
1639
|
"quantum_type": {
|
1640
|
+
"kind": "qvec",
|
1101
1641
|
"length": {
|
1102
1642
|
"expr": "2"
|
1103
|
-
}
|
1104
|
-
"kind": "qvec"
|
1643
|
+
}
|
1105
1644
|
},
|
1106
1645
|
"direction": "output"
|
1107
1646
|
}
|
@@ -1122,8 +1661,8 @@ INPLACE_PREPARE_INT = QuantumFunctionDeclaration.parse_raw(
|
|
1122
1661
|
"target": {
|
1123
1662
|
"name": "target",
|
1124
1663
|
"quantum_type": {
|
1125
|
-
"
|
1126
|
-
"
|
1664
|
+
"kind": "qvec",
|
1665
|
+
"length": null
|
1127
1666
|
},
|
1128
1667
|
"direction": "inout"
|
1129
1668
|
}
|
@@ -1139,8 +1678,8 @@ INPLACE_PREPARE_INT = QuantumFunctionDeclaration.parse_raw(
|
|
1139
1678
|
{
|
1140
1679
|
"name": "target",
|
1141
1680
|
"quantum_type": {
|
1142
|
-
"
|
1143
|
-
"
|
1681
|
+
"kind": "qvec",
|
1682
|
+
"length": null
|
1144
1683
|
},
|
1145
1684
|
"direction": "inout"
|
1146
1685
|
}
|
@@ -1237,6 +1776,15 @@ __all__ = [
|
|
1237
1776
|
"GROVER_SEARCH",
|
1238
1777
|
"HADAMARD_TRANSFORM",
|
1239
1778
|
"APPLY_TO_ALL",
|
1779
|
+
"QFT_NO_SWAP",
|
1780
|
+
"_CHECK_MSB",
|
1781
|
+
"_CTRL_X",
|
1782
|
+
"QFT_SPACE_ADD_CONST",
|
1783
|
+
"CC_MODULAR_ADD",
|
1784
|
+
"C_MODULAR_MULTIPLY",
|
1785
|
+
"MULTISWAP",
|
1786
|
+
"INPLACE_C_MODULAR_MULTIPLY",
|
1787
|
+
"MODULAR_EXP",
|
1240
1788
|
"ALLOCATE_NUM",
|
1241
1789
|
"QAOA_MIXER_LAYER",
|
1242
1790
|
"QAOA_COST_LAYER",
|