classiq 0.56.0__py3-none-any.whl → 0.56.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/interface/_version.py +1 -1
- classiq/qmod/__init__.py +0 -2
- classiq/qmod/qfunc.py +33 -1
- {classiq-0.56.0.dist-info → classiq-0.56.1.dist-info}/METADATA +1 -1
- {classiq-0.56.0.dist-info → classiq-0.56.1.dist-info}/RECORD +6 -7
- classiq/qmod/synthesize_separately.py +0 -15
- {classiq-0.56.0.dist-info → classiq-0.56.1.dist-info}/WHEEL +0 -0
classiq/interface/_version.py
CHANGED
classiq/qmod/__init__.py
CHANGED
@@ -8,7 +8,6 @@ from .qmod_constant import QConstant
|
|
8
8
|
from .qmod_parameter import Array, CArray, CBool, CInt, CReal
|
9
9
|
from .qmod_variable import Input, Output, QArray, QBit, QNum, QStruct
|
10
10
|
from .quantum_callable import QCallable, QCallableList
|
11
|
-
from .synthesize_separately import synthesize_separately
|
12
11
|
from .write_qmod import write_qmod
|
13
12
|
|
14
13
|
__all__ = [
|
@@ -31,5 +30,4 @@ __all__ = [
|
|
31
30
|
"get_expression_numeric_attributes",
|
32
31
|
"qfunc",
|
33
32
|
"write_qmod",
|
34
|
-
"synthesize_separately",
|
35
33
|
] + _builtins_all
|
classiq/qmod/qfunc.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
from typing import Callable, Literal, Optional, Union, overload
|
2
2
|
|
3
|
+
from classiq.interface.exceptions import ClassiqError
|
4
|
+
|
3
5
|
from classiq.qmod.quantum_callable import QCallable
|
4
6
|
from classiq.qmod.quantum_function import ExternalQFunc, GenerativeQFunc, QFunc
|
5
7
|
|
@@ -20,25 +22,55 @@ def set_discovered_functions(
|
|
20
22
|
def qfunc(func: Callable) -> QFunc: ...
|
21
23
|
|
22
24
|
|
25
|
+
@overload
|
26
|
+
def qfunc(*, synthesize_separately: Literal[True]) -> Callable[[Callable], QFunc]: ...
|
27
|
+
|
28
|
+
|
23
29
|
@overload
|
24
30
|
def qfunc(*, external: Literal[True]) -> Callable[[Callable], ExternalQFunc]: ...
|
25
31
|
|
26
32
|
|
33
|
+
@overload
|
34
|
+
def qfunc(
|
35
|
+
*, external: Literal[True], synthesize_separately: Literal[True]
|
36
|
+
) -> Callable[[Callable], ExternalQFunc]: ...
|
37
|
+
|
38
|
+
|
27
39
|
@overload
|
28
40
|
def qfunc(*, generative: Literal[True]) -> Callable[[Callable], GenerativeQFunc]: ...
|
29
41
|
|
30
42
|
|
43
|
+
@overload
|
44
|
+
def qfunc(
|
45
|
+
*, generative: Literal[True], synthesize_separately: Literal[True]
|
46
|
+
) -> Callable[[Callable], GenerativeQFunc]: ...
|
47
|
+
|
48
|
+
|
31
49
|
def qfunc(
|
32
|
-
func: Optional[Callable] = None,
|
50
|
+
func: Optional[Callable] = None,
|
51
|
+
*,
|
52
|
+
external: bool = False,
|
53
|
+
generative: bool = False,
|
54
|
+
synthesize_separately: bool = False,
|
33
55
|
) -> Union[Callable[[Callable], QCallable], QCallable]:
|
34
56
|
def wrapper(func: Callable) -> QCallable:
|
35
57
|
if generative:
|
36
58
|
gen_qfunc = GenerativeQFunc(func)
|
59
|
+
if synthesize_separately:
|
60
|
+
raise ClassiqError(
|
61
|
+
"Generative functions can not be synthesized separately"
|
62
|
+
)
|
37
63
|
GEN_QFUNCS.append(gen_qfunc)
|
38
64
|
return gen_qfunc
|
39
65
|
if external:
|
66
|
+
if synthesize_separately:
|
67
|
+
raise ClassiqError(
|
68
|
+
"External functions can not be synthesized separately"
|
69
|
+
)
|
40
70
|
return ExternalQFunc(func)
|
41
71
|
dec_qfunc = QFunc(func)
|
72
|
+
if synthesize_separately:
|
73
|
+
dec_qfunc.should_synthesize_separately = True
|
42
74
|
DEC_QFUNCS.append(dec_qfunc)
|
43
75
|
return dec_qfunc
|
44
76
|
|
@@ -95,7 +95,7 @@ classiq/execution/qaoa.py,sha256=IiicS_L41FeR_9kDcqLKnbuBuWj5ABuuGKqyC6SVsHk,300
|
|
95
95
|
classiq/execution/qnn.py,sha256=6lAKO0TpSEkcY_EwbJfVqNeqCeOegmkBQC1AzUrWxy0,2333
|
96
96
|
classiq/executor.py,sha256=TbGAu6p70kNWMWvq3d9YldAd6LZqBJ2xl915vg8rM2Y,2602
|
97
97
|
classiq/interface/__init__.py,sha256=cg7hD_XVu1_jJ1fgwmT0rMIoZHopNVeB8xtlmMx-E_A,83
|
98
|
-
classiq/interface/_version.py,sha256=
|
98
|
+
classiq/interface/_version.py,sha256=T2umr9YUBaCEgha3vdcTQAf6Ui0qu3nQVIxMqTDiZxg,197
|
99
99
|
classiq/interface/analyzer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
100
100
|
classiq/interface/analyzer/analysis_params.py,sha256=dM5rwSks798cxk4FWe4_X5ToRYtgZQh34F1u0XrFkK8,3881
|
101
101
|
classiq/interface/analyzer/cytoscape_graph.py,sha256=MpeRBIYS1TfwYwiFpgTO51IE0KoxhY510pmEM3S0rbw,2361
|
@@ -437,7 +437,7 @@ classiq/model_expansions/visitors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
|
|
437
437
|
classiq/model_expansions/visitors/boolean_expression_transformers.py,sha256=a8ITXY48uROZFd9MF8tXdXs14Uxh8XbBpuvRXvRehjY,8067
|
438
438
|
classiq/model_expansions/visitors/variable_references.py,sha256=HfAU6UZUtfcy7KkrvQbNQdnSXD79wwbyagnv8ZpMukQ,4111
|
439
439
|
classiq/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
440
|
-
classiq/qmod/__init__.py,sha256=
|
440
|
+
classiq/qmod/__init__.py,sha256=ktAnNYCn6UJGvpMjwEjed3MKtdOwpevBD3JPErM7lqs,842
|
441
441
|
classiq/qmod/builtins/__init__.py,sha256=pYNdaroGuxuXRPX3oHdwGoF5sCfHSqU9IG3uuenCmT8,1206
|
442
442
|
classiq/qmod/builtins/classical_execution_primitives.py,sha256=v6XCeAlXNSEFteKXdh1L7rT6JwyNnoOk4hQYnOcSTLA,3232
|
443
443
|
classiq/qmod/builtins/classical_functions.py,sha256=sOMYm_vU24mAGgR63qmJ5eMTgpacXCRIhNEXa6pl0Q4,1914
|
@@ -483,7 +483,7 @@ classiq/qmod/pretty_print/__init__.py,sha256=jhR0cpXumOJnyb-zWnvMLpEuUOYPnnJ7DJm
|
|
483
483
|
classiq/qmod/pretty_print/expression_to_python.py,sha256=QoRP817CFEp3Ad3Q3hxWW-hbVzWQbHQIGUHjZkpZDm8,7480
|
484
484
|
classiq/qmod/pretty_print/pretty_printer.py,sha256=JvRRqvrPROCpRwteLiEMetJabnEo7ZQCVaj-pTOzFbo,22286
|
485
485
|
classiq/qmod/python_classical_type.py,sha256=S_CbuxMHmYDgYcT31kCIy1xjhWvnAHHVJNWZ6lUPV8w,2513
|
486
|
-
classiq/qmod/qfunc.py,sha256=
|
486
|
+
classiq/qmod/qfunc.py,sha256=cD9T7S0UoLHUx2yv1GznkM6D5IfOBdb7_Uo0JlCoWbY,2214
|
487
487
|
classiq/qmod/qmod_constant.py,sha256=YawkwhhOLqFyFUyhE13Q_zCnex_Ki46hePRwGJmr5oU,4853
|
488
488
|
classiq/qmod/qmod_parameter.py,sha256=PpK4rzY0Hszgbzr_lclROcZ7JPqnhDJBYsSQkUjkcs8,4294
|
489
489
|
classiq/qmod/qmod_variable.py,sha256=T53o_GQWXPCIfW6bTIvNUTHoE3bodIHec8r6a_YJXfU,24105
|
@@ -503,11 +503,10 @@ classiq/qmod/semantics/validation/types_validation.py,sha256=DBtpqUR1Ua3t-AVUAdJ
|
|
503
503
|
classiq/qmod/symbolic.py,sha256=-pfC93Rfa685vBN0Z5ij8AaQB0aTfVNOrtaMyPykkLg,7607
|
504
504
|
classiq/qmod/symbolic_expr.py,sha256=LJoa9c6puMvUu4d5oU0SNzc7VXzSFBUNLf19ADzktLs,6133
|
505
505
|
classiq/qmod/symbolic_type.py,sha256=ded7bVfWmHFw8MoyivVDJsG5vZZVRQontOZYb1kCrTQ,162
|
506
|
-
classiq/qmod/synthesize_separately.py,sha256=pORY__n4kd1vXX3b3Q_qMW1yREbwzuMEe4VMG1SC3p4,608
|
507
506
|
classiq/qmod/type_attribute_remover.py,sha256=NZmTXAsngWqthXjE8n-n6yE72fiWTFM12-TXXJ1kJ-Q,1242
|
508
507
|
classiq/qmod/utilities.py,sha256=z_VnIRmOYTWjJp2UlOcWK0rQRtMqysmP_Gr6WYY_nak,2734
|
509
508
|
classiq/qmod/write_qmod.py,sha256=x4K4N9XPQqGTett1vCZd-D2yVAo_DmXTJ_TyEm0fff8,1800
|
510
509
|
classiq/synthesis.py,sha256=kh2BZECSw1tYWMyVXtSvXvVpZR6rSn0JkG8xQ1uTaJQ,8029
|
511
|
-
classiq-0.56.
|
512
|
-
classiq-0.56.
|
513
|
-
classiq-0.56.
|
510
|
+
classiq-0.56.1.dist-info/METADATA,sha256=Sax-IZcRdbCnX9k47fo00HB1bEU1JUL1yOMSUsRjMkw,3458
|
511
|
+
classiq-0.56.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
512
|
+
classiq-0.56.1.dist-info/RECORD,,
|
@@ -1,15 +0,0 @@
|
|
1
|
-
from typing import Union
|
2
|
-
|
3
|
-
from classiq.interface.exceptions import ClassiqError
|
4
|
-
|
5
|
-
from classiq.qmod.quantum_function import ExternalQFunc, GenerativeQFunc, QFunc
|
6
|
-
|
7
|
-
|
8
|
-
def synthesize_separately(qfunc: Union[QFunc, GenerativeQFunc, ExternalQFunc]) -> QFunc:
|
9
|
-
if isinstance(qfunc, QFunc):
|
10
|
-
qfunc.should_synthesize_separately = True
|
11
|
-
return qfunc
|
12
|
-
if isinstance(qfunc, GenerativeQFunc):
|
13
|
-
raise ClassiqError("Generative functions can not be synthesized separately")
|
14
|
-
if isinstance(qfunc, ExternalQFunc):
|
15
|
-
raise ClassiqError("External functions can not be synthesized separately")
|
File without changes
|