classiq 0.43.3__py3-none-any.whl → 0.44.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 +7 -1
- classiq/_internals/client.py +4 -7
- classiq/_internals/host_checker.py +34 -12
- classiq/_internals/jobs.py +2 -2
- classiq/applications/chemistry/chemistry_model_constructor.py +12 -6
- classiq/applications/combinatorial_helpers/allowed_constraints.py +4 -1
- classiq/applications/combinatorial_optimization/combinatorial_optimization_model_constructor.py +1 -1
- classiq/applications/finance/finance_model_constructor.py +3 -2
- classiq/applications/grover/grover_model_constructor.py +7 -5
- classiq/applications/hamiltonian/__init__.py +0 -0
- classiq/applications/hamiltonian/pauli_decomposition.py +113 -0
- classiq/applications/qnn/qlayer.py +1 -1
- classiq/exceptions.py +4 -0
- classiq/interface/_version.py +1 -1
- classiq/interface/ast_node.py +1 -18
- classiq/interface/backend/backend_preferences.py +10 -16
- classiq/interface/backend/ionq/ionq_quantum_program.py +1 -1
- classiq/interface/backend/pydantic_backend.py +0 -5
- classiq/interface/backend/quantum_backend_providers.py +3 -2
- classiq/interface/chemistry/operator.py +5 -1
- classiq/interface/debug_info/__init__.py +0 -0
- classiq/interface/debug_info/debug_info.py +32 -0
- classiq/interface/executor/execution_preferences.py +1 -45
- classiq/interface/executor/result.py +25 -12
- classiq/interface/generator/application_apis/arithmetic_declarations.py +8 -5
- classiq/interface/generator/application_apis/chemistry_declarations.py +78 -60
- classiq/interface/generator/application_apis/combinatorial_optimization_declarations.py +19 -10
- classiq/interface/generator/application_apis/entangler_declarations.py +11 -6
- classiq/interface/generator/application_apis/finance_declarations.py +36 -22
- classiq/interface/generator/application_apis/qsvm_declarations.py +21 -15
- classiq/interface/generator/arith/arithmetic_expression_abc.py +21 -1
- classiq/interface/generator/arith/binary_ops.py +5 -4
- classiq/interface/generator/arith/extremum_operations.py +43 -19
- classiq/interface/generator/constant.py +1 -1
- classiq/interface/generator/expressions/atomic_expression_functions.py +1 -0
- classiq/interface/generator/expressions/expression_constants.py +3 -1
- classiq/interface/generator/expressions/qmod_qarray_proxy.py +52 -66
- classiq/interface/generator/expressions/qmod_qstruct_proxy.py +35 -0
- classiq/interface/generator/expressions/sympy_supported_expressions.py +2 -1
- classiq/interface/generator/functions/builtins/core_library/__init__.py +4 -2
- classiq/interface/generator/functions/builtins/core_library/atomic_quantum_functions.py +41 -41
- classiq/interface/generator/functions/builtins/core_library/exponentiation_functions.py +52 -42
- classiq/interface/generator/functions/builtins/open_lib_functions.py +1095 -3347
- classiq/interface/generator/functions/builtins/quantum_operators.py +9 -22
- classiq/interface/generator/functions/classical_function_declaration.py +14 -6
- classiq/interface/generator/functions/classical_type.py +7 -76
- classiq/interface/generator/functions/concrete_types.py +55 -0
- classiq/interface/generator/functions/function_declaration.py +10 -10
- classiq/interface/generator/functions/type_name.py +104 -0
- classiq/interface/generator/generated_circuit_data.py +3 -3
- classiq/interface/generator/model/model.py +11 -0
- classiq/interface/generator/model/preferences/preferences.py +5 -0
- classiq/interface/generator/quantum_function_call.py +3 -0
- classiq/interface/generator/quantum_program.py +2 -2
- classiq/interface/generator/register_role.py +7 -1
- classiq/interface/generator/synthesis_metadata/synthesis_execution_data.py +1 -3
- classiq/interface/generator/types/builtin_struct_declarations/pauli_struct_declarations.py +1 -2
- classiq/interface/generator/types/qstruct_declaration.py +17 -0
- classiq/interface/generator/types/struct_declaration.py +1 -1
- classiq/interface/helpers/validation_helpers.py +1 -17
- classiq/interface/ide/visual_model.py +9 -2
- classiq/interface/interface_version.py +1 -0
- classiq/interface/model/bind_operation.py +25 -5
- classiq/interface/model/classical_parameter_declaration.py +8 -5
- classiq/interface/model/control.py +5 -5
- classiq/interface/model/handle_binding.py +185 -12
- classiq/interface/model/inplace_binary_operation.py +16 -4
- classiq/interface/model/model.py +28 -5
- classiq/interface/model/native_function_definition.py +8 -4
- classiq/interface/model/parameter.py +14 -0
- classiq/interface/model/port_declaration.py +20 -2
- classiq/interface/model/quantum_expressions/amplitude_loading_operation.py +21 -6
- classiq/interface/model/quantum_expressions/arithmetic_operation.py +30 -6
- classiq/interface/model/quantum_expressions/quantum_expression.py +4 -9
- classiq/interface/model/quantum_function_call.py +135 -192
- classiq/interface/model/quantum_function_declaration.py +147 -165
- classiq/interface/model/quantum_lambda_function.py +24 -6
- classiq/interface/model/quantum_statement.py +34 -8
- classiq/interface/model/quantum_type.py +61 -10
- classiq/interface/model/quantum_variable_declaration.py +1 -1
- classiq/interface/model/statement_block.py +2 -0
- classiq/interface/model/validation_handle.py +7 -0
- classiq/interface/server/global_versions.py +4 -4
- classiq/interface/server/routes.py +2 -0
- classiq/interface/source_reference.py +59 -0
- classiq/qmod/__init__.py +2 -3
- classiq/qmod/builtins/functions.py +39 -11
- classiq/qmod/builtins/operations.py +171 -40
- classiq/qmod/declaration_inferrer.py +99 -56
- classiq/qmod/expression_query.py +1 -1
- classiq/qmod/model_state_container.py +2 -0
- classiq/qmod/native/pretty_printer.py +71 -53
- classiq/qmod/pretty_print/pretty_printer.py +98 -52
- classiq/qmod/qfunc.py +11 -5
- classiq/qmod/qmod_parameter.py +1 -2
- classiq/qmod/qmod_variable.py +364 -172
- classiq/qmod/quantum_callable.py +3 -3
- classiq/qmod/quantum_expandable.py +119 -65
- classiq/qmod/quantum_function.py +15 -3
- classiq/qmod/semantics/annotation.py +12 -13
- classiq/qmod/semantics/error_manager.py +36 -10
- classiq/qmod/semantics/static_semantics_visitor.py +163 -75
- classiq/qmod/semantics/validation/func_call_validation.py +42 -96
- classiq/qmod/semantics/validation/handle_validation.py +85 -0
- classiq/qmod/semantics/validation/types_validation.py +108 -1
- classiq/qmod/type_attribute_remover.py +32 -0
- classiq/qmod/utilities.py +26 -5
- {classiq-0.43.3.dist-info → classiq-0.44.0.dist-info}/METADATA +3 -3
- {classiq-0.43.3.dist-info → classiq-0.44.0.dist-info}/RECORD +111 -99
- classiq/qmod/qmod_struct.py +0 -13
- /classiq/{interface/ide/show.py → show.py} +0 -0
- {classiq-0.43.3.dist-info → classiq-0.44.0.dist-info}/WHEEL +0 -0
@@ -617,7 +617,7 @@ class Power(BinaryOpParams[RegisterArithmeticInfo, pydantic.PositiveInt]):
|
|
617
617
|
*,
|
618
618
|
arg: RegisterArithmeticInfo,
|
619
619
|
action_right_arg: RegisterOrConst,
|
620
|
-
compute_power: int
|
620
|
+
compute_power: int,
|
621
621
|
) -> pydantic.NonNegativeInt:
|
622
622
|
inner_compute_power_params = Power(
|
623
623
|
left_arg=arg,
|
@@ -800,6 +800,7 @@ class Modulo(EffectiveUnaryOpParams[int]):
|
|
800
800
|
return 2 ** (repr_qubits)
|
801
801
|
|
802
802
|
def _get_result_register(self) -> RegisterArithmeticInfo:
|
803
|
-
|
804
|
-
|
805
|
-
|
803
|
+
size = round(math.log2(self.right_arg))
|
804
|
+
if size <= 0:
|
805
|
+
raise ClassiqValueError("Cannot use a quantum expression with zero size")
|
806
|
+
return RegisterArithmeticInfo(size=size, is_signed=False, fraction_places=0)
|
@@ -57,38 +57,56 @@ class Extremum(ArithmeticOperationParams):
|
|
57
57
|
def _bound_calculator(cls, arg1: float, arg2: float) -> float:
|
58
58
|
pass
|
59
59
|
|
60
|
+
@staticmethod
|
61
|
+
def _less_qubits_arg(
|
62
|
+
arg1: RegisterOrConst, arg2: RegisterOrConst
|
63
|
+
) -> RegisterOrConst:
|
64
|
+
if not isinstance(arg1, RegisterArithmeticInfo):
|
65
|
+
return arg1
|
66
|
+
if not isinstance(arg2, RegisterArithmeticInfo):
|
67
|
+
return arg2
|
68
|
+
return arg1 if arg1.size <= arg2.size else arg2
|
69
|
+
|
60
70
|
@classmethod
|
61
71
|
@abc.abstractmethod
|
62
|
-
def
|
72
|
+
def preferred_arg(
|
63
73
|
cls, arg1: RegisterOrConst, arg2: RegisterOrConst
|
64
74
|
) -> RegisterOrConst:
|
65
75
|
pass
|
66
76
|
|
67
77
|
def _get_result_register(self) -> RegisterArithmeticInfo:
|
68
|
-
|
69
|
-
|
78
|
+
eff_left_arg = argument_utils.limit_fraction_places(
|
79
|
+
self.left_arg, self.machine_precision
|
80
|
+
)
|
81
|
+
eff_right_arg = argument_utils.limit_fraction_places(
|
82
|
+
self.right_arg, self.machine_precision
|
83
|
+
)
|
84
|
+
if argument_utils.arg_bounds_overlap((eff_left_arg, eff_right_arg)):
|
85
|
+
return self._get_general_case_result_register(eff_left_arg, eff_right_arg)
|
70
86
|
return argument_utils.as_arithmetic_info(
|
71
|
-
self.
|
87
|
+
self.preferred_arg(eff_left_arg, eff_right_arg)
|
72
88
|
)
|
73
89
|
|
74
|
-
def _get_general_case_result_register(
|
90
|
+
def _get_general_case_result_register(
|
91
|
+
self, eff_left_arg: RegisterOrConst, eff_right_arg: RegisterOrConst
|
92
|
+
) -> RegisterArithmeticInfo:
|
75
93
|
integer_part_size = max(
|
76
|
-
argument_utils.integer_part_size(
|
77
|
-
argument_utils.integer_part_size(
|
94
|
+
argument_utils.integer_part_size(eff_left_arg),
|
95
|
+
argument_utils.integer_part_size(eff_right_arg),
|
78
96
|
)
|
79
97
|
fraction_places = max(
|
80
|
-
argument_utils.fraction_places(
|
81
|
-
argument_utils.fraction_places(
|
98
|
+
argument_utils.fraction_places(eff_left_arg),
|
99
|
+
argument_utils.fraction_places(eff_right_arg),
|
82
100
|
)
|
83
101
|
required_size = integer_part_size + fraction_places
|
84
102
|
bounds = (
|
85
103
|
self._bound_calculator(
|
86
|
-
argument_utils.lower_bound(
|
87
|
-
argument_utils.lower_bound(
|
104
|
+
argument_utils.lower_bound(eff_left_arg),
|
105
|
+
argument_utils.lower_bound(eff_right_arg),
|
88
106
|
),
|
89
107
|
self._bound_calculator(
|
90
|
-
argument_utils.upper_bound(
|
91
|
-
argument_utils.upper_bound(
|
108
|
+
argument_utils.upper_bound(eff_left_arg),
|
109
|
+
argument_utils.upper_bound(eff_right_arg),
|
92
110
|
),
|
93
111
|
)
|
94
112
|
return RegisterArithmeticInfo(
|
@@ -107,12 +125,15 @@ class Min(Extremum):
|
|
107
125
|
return min(arg1, arg2)
|
108
126
|
|
109
127
|
@classmethod
|
110
|
-
def
|
128
|
+
def preferred_arg(
|
111
129
|
cls, arg1: RegisterOrConst, arg2: RegisterOrConst
|
112
130
|
) -> RegisterOrConst:
|
113
|
-
|
131
|
+
min1, min2 = min(argument_utils.bounds(arg1)), min(argument_utils.bounds(arg2))
|
132
|
+
if min1 < min2:
|
114
133
|
return arg1
|
115
|
-
|
134
|
+
if min2 < min1:
|
135
|
+
return arg2
|
136
|
+
return cls._less_qubits_arg(arg1, arg2)
|
116
137
|
|
117
138
|
|
118
139
|
class Max(Extremum):
|
@@ -123,9 +144,12 @@ class Max(Extremum):
|
|
123
144
|
return max(arg1, arg2)
|
124
145
|
|
125
146
|
@classmethod
|
126
|
-
def
|
147
|
+
def preferred_arg(
|
127
148
|
cls, arg1: RegisterOrConst, arg2: RegisterOrConst
|
128
149
|
) -> RegisterOrConst:
|
129
|
-
|
150
|
+
max1, max2 = max(argument_utils.bounds(arg1)), max(argument_utils.bounds(arg2))
|
151
|
+
if max1 > max2:
|
130
152
|
return arg1
|
131
|
-
|
153
|
+
if max2 > max1:
|
154
|
+
return arg2
|
155
|
+
return cls._less_qubits_arg(arg1, arg2)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from classiq.interface.ast_node import ASTNode
|
2
2
|
from classiq.interface.generator.expressions.expression import Expression
|
3
|
-
from classiq.interface.generator.functions.
|
3
|
+
from classiq.interface.generator.functions.concrete_types import ConcreteClassicalType
|
4
4
|
|
5
5
|
|
6
6
|
class Constant(ASTNode):
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import keyword
|
2
|
-
from typing import Set
|
2
|
+
from typing import Final, FrozenSet, Set
|
3
3
|
|
4
4
|
from classiq.interface.generator.arith.arithmetic_expression_parser import (
|
5
5
|
DEFAULT_SUPPORTED_FUNC_NAMES,
|
@@ -18,3 +18,5 @@ SUPPORTED_FUNC_NAMES: Set[str] = (
|
|
18
18
|
)
|
19
19
|
BOOLEAN_LITERALS = {"True", "False"}
|
20
20
|
FORBIDDEN_LITERALS: Set[str] = set(keyword.kwlist) - SUPPORTED_FUNC_NAMES
|
21
|
+
CPARAM_EXECUTION_SUFFIX: Final[str] = "_param"
|
22
|
+
RESERVED_EXPRESSIONS: FrozenSet[str] = frozenset({"i"})
|
@@ -1,4 +1,6 @@
|
|
1
|
-
from typing import
|
1
|
+
from typing import TYPE_CHECKING, Any, Mapping, Union
|
2
|
+
|
3
|
+
from sympy import Integer
|
2
4
|
|
3
5
|
from classiq.interface.generator.expressions.expression import Expression
|
4
6
|
from classiq.interface.generator.expressions.non_symbolic_expr import NonSymbolicExpr
|
@@ -11,88 +13,81 @@ from classiq.interface.model.handle_binding import (
|
|
11
13
|
|
12
14
|
from classiq.exceptions import ClassiqValueError
|
13
15
|
|
16
|
+
if TYPE_CHECKING:
|
17
|
+
from classiq.interface.model.quantum_type import QuantumType
|
18
|
+
|
19
|
+
|
14
20
|
ILLEGAL_SLICING_STEP_MSG = "Slicing with a step of a quantum variable is not supported"
|
15
|
-
SLICE_OUT_OF_BOUNDS_MSG = "Slice
|
16
|
-
|
21
|
+
SLICE_OUT_OF_BOUNDS_MSG = "Slice indices out of bounds"
|
22
|
+
SUBSCRIPT_OUT_OF_BOUNDS_MSG = "Subscript index out of bounds"
|
23
|
+
ILLEGAL_SLICE_MSG = "Quantum array slice must be of the form [<int-value>:<int-value>]."
|
24
|
+
ILLEGAL_SLICE_BOUNDS_MSG = (
|
25
|
+
"The quantum array slice start value ({}) must be lower than its stop value ({})."
|
26
|
+
)
|
17
27
|
|
18
28
|
|
19
29
|
class QmodQArrayProxy(NonSymbolicExpr, QmodSizedProxy):
|
20
30
|
def __init__(
|
21
31
|
self,
|
22
32
|
handle: HandleBinding,
|
23
|
-
|
33
|
+
element_type: "QuantumType",
|
24
34
|
element_size: int,
|
25
35
|
length: int,
|
26
36
|
) -> None:
|
27
37
|
super().__init__(handle, element_size * length)
|
28
38
|
self._length = length
|
29
|
-
self.
|
39
|
+
self._element_type = element_type
|
30
40
|
self._element_size = element_size
|
31
41
|
|
32
|
-
def __getitem__(self, key: Union[slice, int]) -> "QmodSizedProxy":
|
33
|
-
|
34
|
-
|
42
|
+
def __getitem__(self, key: Union[slice, int, Integer]) -> "QmodSizedProxy":
|
43
|
+
return (
|
44
|
+
self._get_slice(key) if isinstance(key, slice) else self._get_subscript(key)
|
45
|
+
)
|
35
46
|
|
36
|
-
|
47
|
+
def _get_subscript(self, index: Union[int, Integer]) -> "QmodSizedProxy":
|
48
|
+
if isinstance(index, Integer):
|
49
|
+
index = int(index)
|
50
|
+
if index < 0 or index >= self._length:
|
51
|
+
raise ClassiqValueError(SUBSCRIPT_OUT_OF_BOUNDS_MSG)
|
37
52
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
new_index = new_slice[0]
|
53
|
+
return self._element_type.get_proxy(
|
54
|
+
SubscriptHandleBinding(
|
55
|
+
base_handle=self.handle,
|
56
|
+
index=Expression(expr=str(index)),
|
57
|
+
)
|
58
|
+
)
|
45
59
|
|
46
|
-
|
47
|
-
|
48
|
-
|
60
|
+
def _get_slice(self, slice_: slice) -> "QmodSizedProxy":
|
61
|
+
if slice_.step is not None:
|
62
|
+
raise ClassiqValueError(ILLEGAL_SLICING_STEP_MSG)
|
63
|
+
if isinstance(slice_.start, Integer):
|
64
|
+
slice_ = slice(int(slice_.start), slice_.stop)
|
65
|
+
if isinstance(slice_.stop, Integer):
|
66
|
+
slice_ = slice(slice_.start, int(slice_.stop))
|
67
|
+
if not isinstance(slice_.start, int) or not isinstance(slice_.stop, int):
|
68
|
+
raise ClassiqValueError(ILLEGAL_SLICE_MSG)
|
69
|
+
if slice_.start >= slice_.stop:
|
70
|
+
raise ClassiqValueError(
|
71
|
+
ILLEGAL_SLICE_BOUNDS_MSG.format(slice_.start, slice_.stop)
|
72
|
+
)
|
73
|
+
if slice_.start < 0 or slice_.stop > self._length:
|
49
74
|
raise ClassiqValueError(SLICE_OUT_OF_BOUNDS_MSG)
|
50
75
|
|
51
|
-
new_handle = self._get_new_handle(new_index, new_slice)
|
52
|
-
if new_index is not None:
|
53
|
-
return self._element_proxy(new_handle)
|
54
76
|
return QmodQArrayProxy(
|
55
|
-
|
56
|
-
|
77
|
+
SlicedHandleBinding(
|
78
|
+
base_handle=self.handle,
|
79
|
+
start=Expression(expr=str(slice_.start)),
|
80
|
+
end=Expression(expr=str(slice_.stop)),
|
81
|
+
),
|
82
|
+
self._element_type,
|
57
83
|
self._element_size,
|
58
|
-
|
84
|
+
slice_.stop - slice_.start,
|
59
85
|
)
|
60
86
|
|
61
|
-
def _get_new_slice(self, start: int, end: int) -> Tuple[int, int]:
|
62
|
-
if self._slice is not None:
|
63
|
-
return self._slice[0] + start, self._slice[0] + end
|
64
|
-
return start, end
|
65
|
-
|
66
87
|
@property
|
67
88
|
def type_name(self) -> str:
|
68
89
|
return "Quantum array"
|
69
90
|
|
70
|
-
@property
|
71
|
-
def _index(self) -> Optional[int]:
|
72
|
-
if not isinstance(self._handle, SubscriptHandleBinding):
|
73
|
-
return None
|
74
|
-
return self._handle.index.to_int_value()
|
75
|
-
|
76
|
-
@property
|
77
|
-
def _slice(self) -> Optional[Tuple[int, int]]:
|
78
|
-
if not isinstance(self._handle, SlicedHandleBinding):
|
79
|
-
return None
|
80
|
-
return self._handle.start.to_int_value(), self._handle.end.to_int_value()
|
81
|
-
|
82
|
-
def _get_new_handle(
|
83
|
-
self, new_index: Optional[int], new_slice: Tuple[int, int]
|
84
|
-
) -> HandleBinding:
|
85
|
-
if new_index is not None:
|
86
|
-
return SubscriptHandleBinding(
|
87
|
-
name=self.handle.name,
|
88
|
-
index=Expression(expr=str(new_index)),
|
89
|
-
)
|
90
|
-
return SlicedHandleBinding(
|
91
|
-
name=self.handle.name,
|
92
|
-
start=Expression(expr=str(new_slice[0])),
|
93
|
-
end=Expression(expr=str(new_slice[1])),
|
94
|
-
)
|
95
|
-
|
96
91
|
@property
|
97
92
|
def len(self) -> int:
|
98
93
|
return self._length
|
@@ -105,13 +100,4 @@ class QmodQArrayProxy(NonSymbolicExpr, QmodSizedProxy):
|
|
105
100
|
|
106
101
|
@property
|
107
102
|
def size(self) -> int:
|
108
|
-
|
109
|
-
length = slice_[1] - slice_[0]
|
110
|
-
elif self._index is not None:
|
111
|
-
length = 1
|
112
|
-
else:
|
113
|
-
length = self._length
|
114
|
-
return length * self._element_size
|
115
|
-
|
116
|
-
def __str__(self) -> str:
|
117
|
-
return str(self.handle)
|
103
|
+
return self.len * self._element_size
|
@@ -0,0 +1,35 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Mapping
|
2
|
+
|
3
|
+
from classiq.interface.generator.expressions.non_symbolic_expr import NonSymbolicExpr
|
4
|
+
from classiq.interface.generator.expressions.qmod_sized_proxy import QmodSizedProxy
|
5
|
+
from classiq.interface.model.handle_binding import (
|
6
|
+
FieldHandleBinding,
|
7
|
+
HandleBinding,
|
8
|
+
)
|
9
|
+
|
10
|
+
if TYPE_CHECKING:
|
11
|
+
from classiq.interface.model.quantum_type import QuantumType
|
12
|
+
|
13
|
+
|
14
|
+
class QmodQStructProxy(NonSymbolicExpr, QmodSizedProxy):
|
15
|
+
def __init__(
|
16
|
+
self,
|
17
|
+
handle: HandleBinding,
|
18
|
+
struct_name: str,
|
19
|
+
fields: Mapping[str, "QuantumType"],
|
20
|
+
) -> None:
|
21
|
+
self._fields = {
|
22
|
+
name: type_.get_proxy(FieldHandleBinding(base_handle=handle, field=name))
|
23
|
+
for name, type_ in fields.items()
|
24
|
+
}
|
25
|
+
size = sum(proxy.size for proxy in self._fields.values())
|
26
|
+
super().__init__(handle, size)
|
27
|
+
self._struct_name = struct_name
|
28
|
+
|
29
|
+
@property
|
30
|
+
def type_name(self) -> str:
|
31
|
+
return self._struct_name
|
32
|
+
|
33
|
+
@property
|
34
|
+
def fields(self) -> Mapping[str, QmodSizedProxy]:
|
35
|
+
return self._fields
|
@@ -66,7 +66,8 @@ NUMERIC_CONSTANTS: List[str] = [
|
|
66
66
|
"EulerGamma",
|
67
67
|
"Catalan",
|
68
68
|
]
|
69
|
-
|
69
|
+
BOOLEAN_CONSTANTS: List[str] = ["true", "false"]
|
70
|
+
CONSTANTS: List[str] = NUMERIC_CONSTANTS + BOOLEAN_CONSTANTS
|
70
71
|
|
71
72
|
DATA_TYPES: List[str] = ["Matrix"]
|
72
73
|
LOGIC_OPERATORS: List[str] = [
|
@@ -3,12 +3,14 @@ from classiq.interface.generator.application_apis.combinatorial_optimization_dec
|
|
3
3
|
from classiq.interface.generator.application_apis.finance_declarations import * # noqa: F403
|
4
4
|
from classiq.interface.generator.application_apis.qsvm_declarations import * # noqa: F403
|
5
5
|
from classiq.interface.model.quantum_function_declaration import (
|
6
|
-
|
6
|
+
NamedParamsQuantumFunctionDeclaration,
|
7
7
|
)
|
8
8
|
|
9
9
|
from .atomic_quantum_functions import * # noqa: F403
|
10
10
|
from .exponentiation_functions import * # noqa: F403
|
11
11
|
|
12
12
|
CORE_LIB_DECLS = [
|
13
|
-
func
|
13
|
+
func
|
14
|
+
for func in vars().values()
|
15
|
+
if isinstance(func, NamedParamsQuantumFunctionDeclaration)
|
14
16
|
]
|