classiq 0.52.0__py3-none-any.whl → 0.54.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 -3
- classiq/_analyzer_extras/_ipywidgets_async_extension.py +2 -1
- classiq/_internals/__init__.py +0 -20
- classiq/_internals/api_wrapper.py +23 -17
- classiq/_internals/async_utils.py +1 -3
- classiq/_internals/authentication/auth0.py +5 -5
- classiq/_internals/authentication/device.py +5 -4
- classiq/_internals/authentication/password_manager.py +3 -3
- classiq/_internals/authentication/token_manager.py +3 -2
- classiq/_internals/client.py +11 -13
- classiq/_internals/config.py +2 -2
- classiq/_internals/jobs.py +7 -6
- classiq/_internals/type_validation.py +9 -9
- classiq/analyzer/__init__.py +1 -3
- classiq/analyzer/analyzer.py +8 -7
- classiq/analyzer/analyzer_utilities.py +8 -8
- classiq/analyzer/rb.py +11 -11
- classiq/applications/__init__.py +1 -3
- classiq/applications/chemistry/__init__.py +1 -3
- classiq/applications/chemistry/ansatz_parameters.py +4 -4
- classiq/applications/chemistry/chemistry_model_constructor.py +10 -9
- classiq/applications/combinatorial_helpers/combinatorial_problem_utils.py +26 -9
- classiq/applications/combinatorial_helpers/encoding_mapping.py +10 -10
- classiq/applications/combinatorial_helpers/encoding_utils.py +4 -4
- classiq/applications/combinatorial_helpers/memory.py +5 -7
- classiq/applications/combinatorial_helpers/optimization_model.py +43 -24
- classiq/applications/combinatorial_helpers/pauli_helpers/pauli_utils.py +4 -6
- classiq/applications/combinatorial_helpers/pyomo_utils.py +95 -24
- classiq/applications/combinatorial_helpers/sympy_utils.py +2 -2
- classiq/applications/combinatorial_helpers/transformations/encoding.py +8 -8
- classiq/applications/combinatorial_helpers/transformations/fixed_variables.py +5 -5
- classiq/applications/combinatorial_helpers/transformations/ising_converter.py +7 -9
- classiq/applications/combinatorial_helpers/transformations/penalty.py +1 -2
- classiq/applications/combinatorial_helpers/transformations/sign_seperation.py +1 -2
- classiq/applications/combinatorial_helpers/transformations/slack_variables.py +1 -2
- classiq/applications/combinatorial_optimization/__init__.py +1 -3
- classiq/applications/combinatorial_optimization/combinatorial_optimization_config.py +2 -2
- classiq/applications/combinatorial_optimization/examples/__init__.py +1 -3
- classiq/applications/finance/__init__.py +1 -3
- classiq/applications/grover/__init__.py +1 -3
- classiq/applications/grover/grover_model_constructor.py +7 -9
- classiq/applications/hamiltonian/pauli_decomposition.py +6 -6
- classiq/applications/qnn/__init__.py +1 -3
- classiq/applications/qnn/circuit_utils.py +5 -5
- classiq/applications/qnn/datasets/__init__.py +1 -3
- classiq/applications/qnn/datasets/dataset_base_classes.py +5 -4
- classiq/applications/qnn/datasets/dataset_parity.py +2 -2
- classiq/applications/qnn/gradients/simple_quantum_gradient.py +2 -1
- classiq/applications/qnn/qlayer.py +25 -6
- classiq/applications/qnn/torch_utils.py +2 -2
- classiq/applications/qnn/types.py +5 -5
- classiq/applications/qsvm/qsvm.py +1 -3
- classiq/applications/qsvm/qsvm_data_generation.py +3 -3
- classiq/applications/qsvm/qsvm_model_constructor.py +5 -5
- classiq/execution/__init__.py +3 -3
- classiq/execution/all_hardware_devices.py +1 -3
- classiq/execution/execution_session.py +57 -16
- classiq/execution/iqcc.py +1 -1
- classiq/execution/jobs.py +4 -4
- classiq/execution/qaoa.py +84 -0
- classiq/execution/qnn.py +3 -3
- classiq/executor.py +4 -4
- classiq/interface/_version.py +1 -1
- classiq/interface/analyzer/analysis_params.py +9 -10
- classiq/interface/analyzer/cytoscape_graph.py +5 -5
- classiq/interface/analyzer/result.py +17 -17
- classiq/interface/applications/qsvm.py +6 -10
- classiq/interface/backend/backend_preferences.py +4 -3
- classiq/interface/backend/ionq/ionq_quantum_program.py +4 -5
- classiq/interface/backend/pydantic_backend.py +1 -2
- classiq/interface/chemistry/fermionic_operator.py +5 -5
- classiq/interface/chemistry/ground_state_problem.py +7 -8
- classiq/interface/chemistry/molecule.py +4 -4
- classiq/interface/chemistry/operator.py +11 -13
- classiq/interface/combinatorial_optimization/examples/ascending_sequence.py +1 -3
- classiq/interface/combinatorial_optimization/examples/integer_portfolio_optimization.py +2 -4
- classiq/interface/combinatorial_optimization/examples/knapsack.py +3 -3
- classiq/interface/combinatorial_optimization/examples/mht.py +2 -3
- classiq/interface/combinatorial_optimization/examples/portfolio_variations.py +2 -2
- classiq/interface/combinatorial_optimization/examples/set_cover.py +1 -2
- classiq/interface/combinatorial_optimization/mht_qaoa_input.py +5 -7
- classiq/interface/combinatorial_optimization/optimization_problem.py +2 -2
- classiq/interface/combinatorial_optimization/result.py +1 -3
- classiq/interface/debug_info/debug_info.py +8 -7
- classiq/interface/exceptions.py +11 -7
- classiq/interface/execution/iqcc.py +1 -3
- classiq/interface/execution/jobs.py +2 -2
- classiq/interface/execution/primitives.py +3 -3
- classiq/interface/executor/aws_execution_cost.py +4 -4
- classiq/interface/executor/execution_request.py +2 -3
- classiq/interface/executor/execution_result.py +3 -3
- classiq/interface/executor/iqae_result.py +3 -5
- classiq/interface/executor/optimizer_preferences.py +2 -2
- classiq/interface/executor/quantum_code.py +6 -6
- classiq/interface/executor/register_initialization.py +2 -4
- classiq/interface/executor/result.py +35 -28
- classiq/interface/executor/vqe_result.py +8 -8
- classiq/interface/finance/function_input.py +2 -2
- classiq/interface/finance/gaussian_model_input.py +5 -5
- classiq/interface/finance/log_normal_model_input.py +2 -2
- classiq/interface/finance/model_input.py +1 -2
- classiq/interface/generator/adjacency.py +1 -3
- classiq/interface/generator/ansatz_library.py +4 -4
- classiq/interface/generator/application_apis/finance_declarations.py +1 -1
- classiq/interface/generator/arith/argument_utils.py +3 -3
- classiq/interface/generator/arith/arithmetic.py +7 -7
- classiq/interface/generator/arith/arithmetic_arg_type_validator.py +5 -5
- classiq/interface/generator/arith/arithmetic_expression_abc.py +11 -11
- classiq/interface/generator/arith/arithmetic_expression_parser.py +8 -7
- classiq/interface/generator/arith/arithmetic_expression_validator.py +8 -8
- classiq/interface/generator/arith/arithmetic_operations.py +4 -3
- classiq/interface/generator/arith/arithmetic_param_getters.py +6 -6
- classiq/interface/generator/arith/arithmetic_result_builder.py +9 -9
- classiq/interface/generator/arith/ast_node_rewrite.py +2 -1
- classiq/interface/generator/arith/binary_ops.py +10 -13
- classiq/interface/generator/arith/extremum_operations.py +3 -2
- classiq/interface/generator/arith/logical_ops.py +7 -6
- classiq/interface/generator/arith/number_utils.py +4 -4
- classiq/interface/generator/arith/register_user_input.py +4 -4
- classiq/interface/generator/arith/unary_ops.py +2 -1
- classiq/interface/generator/builtin_api_builder.py +2 -1
- classiq/interface/generator/circuit_code/circuit_code.py +4 -4
- classiq/interface/generator/circuit_code/types_and_constants.py +3 -5
- classiq/interface/generator/complex_type.py +1 -2
- classiq/interface/generator/control_state.py +2 -2
- classiq/interface/generator/custom_ansatz.py +1 -3
- classiq/interface/generator/distance.py +3 -5
- classiq/interface/generator/excitations.py +3 -2
- classiq/interface/generator/expressions/enums/finance_functions.py +1 -3
- classiq/interface/generator/expressions/evaluated_expression.py +4 -3
- classiq/interface/generator/expressions/expression.py +4 -5
- classiq/interface/generator/expressions/expression_constants.py +4 -4
- classiq/interface/generator/expressions/qmod_qarray_proxy.py +2 -1
- classiq/interface/generator/expressions/qmod_qscalar_proxy.py +2 -1
- classiq/interface/generator/expressions/qmod_qstruct_proxy.py +2 -1
- classiq/interface/generator/expressions/qmod_sized_proxy.py +2 -1
- classiq/interface/generator/expressions/qmod_struct_instance.py +2 -1
- classiq/interface/generator/expressions/sympy_supported_expressions.py +11 -13
- classiq/interface/generator/finance.py +2 -2
- classiq/interface/generator/function_param_library.py +6 -6
- classiq/interface/generator/function_params.py +13 -19
- classiq/interface/generator/functions/classical_function_declaration.py +4 -3
- classiq/interface/generator/functions/classical_type.py +13 -13
- classiq/interface/generator/functions/concrete_types.py +1 -2
- classiq/interface/generator/functions/function_declaration.py +1 -1
- classiq/interface/generator/functions/qmod_python_interface.py +2 -1
- classiq/interface/generator/functions/type_name.py +3 -2
- classiq/interface/generator/generated_circuit_data.py +34 -22
- classiq/interface/generator/grover_diffuser.py +7 -7
- classiq/interface/generator/grover_operator.py +2 -2
- classiq/interface/generator/hardware/hardware_data.py +7 -6
- classiq/interface/generator/hardware_efficient_ansatz.py +8 -8
- classiq/interface/generator/identity.py +5 -6
- classiq/interface/generator/linear_pauli_rotations.py +6 -6
- classiq/interface/generator/mcu.py +2 -2
- classiq/interface/generator/mcx.py +6 -6
- classiq/interface/generator/model/__init__.py +1 -3
- classiq/interface/generator/model/constraints.py +2 -2
- classiq/interface/generator/model/model.py +5 -6
- classiq/interface/generator/model/preferences/preferences.py +7 -6
- classiq/interface/generator/model/quantum_register.py +6 -11
- classiq/interface/generator/oracles/arithmetic_oracle.py +1 -2
- classiq/interface/generator/oracles/custom_oracle.py +2 -2
- classiq/interface/generator/oracles/oracle_abc.py +6 -5
- classiq/interface/generator/partitioned_register.py +6 -5
- classiq/interface/generator/piecewise_linear_amplitude_loading.py +8 -7
- classiq/interface/generator/qpe.py +4 -4
- classiq/interface/generator/qsvm.py +3 -3
- classiq/interface/generator/quantum_function_call.py +24 -29
- classiq/interface/generator/quantum_program.py +9 -9
- classiq/interface/generator/register_role.py +2 -4
- classiq/interface/generator/slice_parsing_utils.py +4 -3
- classiq/interface/generator/standard_gates/standard_gates.py +3 -3
- classiq/interface/generator/state_preparation/bell_state_preparation.py +3 -3
- classiq/interface/generator/state_preparation/distributions.py +6 -5
- classiq/interface/generator/state_preparation/metrics.py +2 -4
- classiq/interface/generator/state_preparation/state_preparation.py +4 -4
- classiq/interface/generator/synthesis_metadata/synthesis_execution_data.py +3 -3
- classiq/interface/generator/transpiler_basis_gates.py +2 -2
- classiq/interface/generator/types/enum_declaration.py +2 -3
- classiq/interface/generator/types/qstruct_declaration.py +2 -1
- classiq/interface/generator/types/struct_declaration.py +3 -2
- classiq/interface/generator/ucc.py +2 -1
- classiq/interface/generator/unitary_gate.py +2 -2
- classiq/interface/generator/user_defined_function_params.py +1 -1
- classiq/interface/generator/validations/flow_graph.py +6 -5
- classiq/interface/generator/validations/validator_functions.py +3 -2
- classiq/interface/generator/visitor.py +9 -14
- classiq/interface/hardware.py +5 -6
- classiq/interface/helpers/custom_encoders.py +2 -2
- classiq/interface/helpers/custom_pydantic_types.py +8 -9
- classiq/interface/helpers/dotdict.py +18 -0
- classiq/interface/helpers/hashable_mixin.py +3 -2
- classiq/interface/helpers/hashable_pydantic_base_model.py +2 -1
- classiq/interface/helpers/pydantic_model_helpers.py +4 -3
- classiq/interface/helpers/validation_helpers.py +2 -2
- classiq/interface/ide/ide_data.py +11 -15
- classiq/interface/ide/visual_model.py +33 -22
- classiq/interface/jobs.py +2 -2
- classiq/interface/model/bind_operation.py +5 -4
- classiq/interface/model/classical_parameter_declaration.py +2 -2
- classiq/interface/model/handle_binding.py +3 -2
- classiq/interface/model/inplace_binary_operation.py +2 -1
- classiq/interface/model/model.py +12 -11
- classiq/interface/model/native_function_definition.py +10 -0
- classiq/interface/model/port_declaration.py +2 -2
- classiq/interface/model/quantum_expressions/amplitude_loading_operation.py +3 -2
- classiq/interface/model/quantum_expressions/arithmetic_operation.py +3 -2
- classiq/interface/model/quantum_expressions/quantum_expression.py +8 -7
- classiq/interface/model/quantum_function_call.py +9 -14
- classiq/interface/model/quantum_function_declaration.py +10 -12
- classiq/interface/model/quantum_lambda_function.py +3 -16
- classiq/interface/model/quantum_statement.py +4 -3
- classiq/interface/model/quantum_type.py +5 -5
- classiq/interface/model/statement_block.py +2 -3
- classiq/interface/model/validation_handle.py +5 -4
- classiq/interface/server/global_versions.py +3 -3
- classiq/model_expansions/atomic_expression_functions_defs.py +3 -2
- classiq/model_expansions/call_to_model_converter.py +190 -0
- classiq/model_expansions/capturing/captured_var_manager.py +4 -6
- classiq/model_expansions/capturing/propagated_var_stack.py +7 -7
- classiq/model_expansions/closure.py +17 -9
- classiq/model_expansions/evaluators/arg_type_match.py +3 -2
- classiq/model_expansions/evaluators/argument_types.py +3 -3
- classiq/model_expansions/evaluators/control.py +3 -3
- classiq/model_expansions/evaluators/parameter_types.py +7 -7
- classiq/model_expansions/evaluators/quantum_type_utils.py +2 -1
- classiq/model_expansions/evaluators/type_type_match.py +1 -1
- classiq/model_expansions/expression_evaluator.py +10 -9
- classiq/model_expansions/expression_renamer.py +6 -6
- classiq/model_expansions/function_builder.py +19 -12
- classiq/model_expansions/generative_functions.py +3 -2
- classiq/model_expansions/interpreter.py +31 -19
- classiq/model_expansions/model_tables.py +14 -14
- classiq/model_expansions/quantum_operations/bind.py +2 -4
- classiq/model_expansions/quantum_operations/classicalif.py +1 -1
- classiq/model_expansions/quantum_operations/control.py +2 -4
- classiq/model_expansions/quantum_operations/emitter.py +10 -13
- classiq/model_expansions/quantum_operations/expression_operation.py +23 -16
- classiq/model_expansions/quantum_operations/inplace_binary_operation.py +164 -38
- classiq/model_expansions/quantum_operations/phase.py +6 -6
- classiq/model_expansions/quantum_operations/quantum_assignment_operation.py +25 -5
- classiq/model_expansions/quantum_operations/quantum_function_call.py +41 -2
- classiq/model_expansions/quantum_operations/repeat.py +1 -3
- classiq/model_expansions/scope.py +11 -10
- classiq/model_expansions/scope_initialization.py +6 -5
- classiq/model_expansions/sympy_conversion/expression_to_sympy.py +6 -6
- classiq/model_expansions/sympy_conversion/sympy_to_python.py +2 -2
- classiq/model_expansions/visitors/variable_references.py +5 -4
- classiq/qmod/__init__.py +2 -0
- classiq/qmod/builtins/classical_execution_primitives.py +9 -9
- classiq/qmod/builtins/functions/__init__.py +75 -53
- classiq/qmod/builtins/functions/amplitude_estimation.py +4 -1
- classiq/qmod/builtins/functions/arithmetic.py +14 -1
- classiq/qmod/builtins/functions/discrete_sine_cosine_transform.py +86 -6
- classiq/qmod/builtins/functions/grover.py +41 -45
- classiq/qmod/builtins/functions/hea.py +60 -4
- classiq/qmod/builtins/functions/linear_pauli_rotation.py +26 -4
- classiq/qmod/builtins/functions/modular_exponentiation.py +90 -29
- classiq/qmod/builtins/functions/operators.py +1 -1
- classiq/qmod/builtins/functions/qaoa_penalty.py +14 -5
- classiq/qmod/builtins/functions/qft_functions.py +57 -0
- classiq/qmod/builtins/functions/qpe.py +20 -4
- classiq/qmod/builtins/functions/qsvt.py +49 -4
- classiq/qmod/builtins/functions/standard_gates.py +18 -18
- classiq/qmod/builtins/functions/state_preparation.py +92 -10
- classiq/qmod/builtins/functions/swap_test.py +7 -1
- classiq/qmod/builtins/functions/utility_functions.py +43 -0
- classiq/qmod/builtins/functions/variational.py +53 -0
- classiq/qmod/builtins/operations.py +4 -5
- classiq/qmod/cfunc.py +2 -2
- classiq/qmod/classical_function.py +3 -7
- classiq/qmod/create_model_function.py +19 -8
- classiq/qmod/declaration_inferrer.py +7 -10
- classiq/qmod/expression_query.py +3 -3
- classiq/qmod/generative.py +2 -1
- classiq/qmod/model_state_container.py +5 -7
- classiq/qmod/native/__init__.py +1 -3
- classiq/qmod/native/expression_to_qmod.py +9 -8
- classiq/qmod/native/pretty_printer.py +6 -5
- classiq/qmod/pretty_print/__init__.py +1 -3
- classiq/qmod/pretty_print/expression_to_python.py +13 -12
- classiq/qmod/pretty_print/pretty_printer.py +13 -12
- classiq/qmod/python_classical_type.py +8 -4
- classiq/qmod/qfunc.py +4 -4
- classiq/qmod/qmod_parameter.py +3 -1
- classiq/qmod/qmod_variable.py +11 -10
- classiq/qmod/quantum_expandable.py +32 -15
- classiq/qmod/quantum_function.py +34 -5
- classiq/qmod/semantics/annotation.py +1 -1
- classiq/qmod/semantics/error_manager.py +8 -7
- classiq/qmod/semantics/static_semantics_visitor.py +19 -24
- classiq/qmod/semantics/validation/constants_validation.py +1 -1
- classiq/qmod/semantics/validation/func_call_validation.py +2 -2
- classiq/qmod/semantics/validation/main_validation.py +33 -0
- classiq/qmod/semantics/validation/types_validation.py +2 -1
- classiq/qmod/symbolic.py +5 -8
- classiq/qmod/symbolic_type.py +2 -2
- classiq/qmod/synthesize_separately.py +16 -0
- {classiq-0.52.0.dist-info → classiq-0.54.0.dist-info}/METADATA +1 -1
- {classiq-0.52.0.dist-info → classiq-0.54.0.dist-info}/RECORD +302 -295
- classiq/qmod/builtins/functions/qft.py +0 -23
- {classiq-0.52.0.dist-info → classiq-0.54.0.dist-info}/WHEEL +0 -0
@@ -1,14 +1,9 @@
|
|
1
1
|
from collections import abc
|
2
|
+
from collections.abc import Collection, Mapping, Sequence
|
2
3
|
from typing import (
|
3
4
|
TYPE_CHECKING,
|
4
5
|
Any,
|
5
|
-
Collection,
|
6
|
-
Dict,
|
7
|
-
List,
|
8
|
-
Mapping,
|
9
6
|
Optional,
|
10
|
-
Sequence,
|
11
|
-
Tuple,
|
12
7
|
TypeVar,
|
13
8
|
Union,
|
14
9
|
)
|
@@ -21,7 +16,7 @@ NodeType = Union[
|
|
21
16
|
BaseModel,
|
22
17
|
int,
|
23
18
|
bool,
|
24
|
-
|
19
|
+
tuple["NodeType", ...],
|
25
20
|
Mapping[Key, "NodeType"],
|
26
21
|
Sequence["NodeType"],
|
27
22
|
]
|
@@ -47,19 +42,19 @@ class Visitor:
|
|
47
42
|
|
48
43
|
return node
|
49
44
|
|
50
|
-
def visit_list(self, node:
|
45
|
+
def visit_list(self, node: list[NodeType]) -> Optional[RetType]:
|
51
46
|
for elem in node:
|
52
47
|
self.visit(elem)
|
53
48
|
|
54
49
|
return None
|
55
50
|
|
56
|
-
def visit_dict(self, node:
|
51
|
+
def visit_dict(self, node: dict[Key, NodeType]) -> Optional[RetType]:
|
57
52
|
for value in node.values():
|
58
53
|
self.visit(value)
|
59
54
|
|
60
55
|
return None
|
61
56
|
|
62
|
-
def visit_tuple(self, node:
|
57
|
+
def visit_tuple(self, node: tuple[NodeType, ...]) -> Optional[tuple[RetType, ...]]:
|
63
58
|
for value in node:
|
64
59
|
self.visit(value)
|
65
60
|
|
@@ -83,13 +78,13 @@ class Transformer(Visitor):
|
|
83
78
|
|
84
79
|
def visit(self, node: NodeType) -> Any: ...
|
85
80
|
|
86
|
-
def visit_list(self, node:
|
81
|
+
def visit_list(self, node: list[NodeType]) -> list[RetType]:
|
87
82
|
return [self.visit(elem) for elem in node]
|
88
83
|
|
89
|
-
def visit_dict(self, node:
|
84
|
+
def visit_dict(self, node: dict[Key, NodeType]) -> dict[Key, RetType]:
|
90
85
|
return {key: self.visit(value) for key, value in node.items()}
|
91
86
|
|
92
|
-
def visit_tuple(self, node:
|
87
|
+
def visit_tuple(self, node: tuple[NodeType, ...]) -> tuple[RetType, ...]:
|
93
88
|
return tuple(self.visit(value) for value in node)
|
94
89
|
|
95
90
|
def visit_BaseModel(
|
@@ -97,7 +92,7 @@ class Transformer(Visitor):
|
|
97
92
|
) -> RetType:
|
98
93
|
fields_to_skip = fields_to_skip or set()
|
99
94
|
|
100
|
-
result:
|
95
|
+
result: dict[str, Any] = dict()
|
101
96
|
for name, value in node:
|
102
97
|
if name not in fields_to_skip:
|
103
98
|
result[name] = self.visit(value)
|
classiq/interface/hardware.py
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
import datetime
|
2
|
-
from typing import TYPE_CHECKING,
|
2
|
+
from typing import TYPE_CHECKING, Annotated, Optional
|
3
3
|
|
4
4
|
import pydantic
|
5
|
-
from typing_extensions import Annotated
|
6
5
|
|
7
6
|
from classiq.interface.enum_utils import StrEnum
|
8
7
|
|
@@ -75,9 +74,9 @@ class HardwareStatus(pydantic.BaseModel):
|
|
75
74
|
|
76
75
|
|
77
76
|
if TYPE_CHECKING:
|
78
|
-
ConnectivityMapEntry =
|
77
|
+
ConnectivityMapEntry = tuple[int, int]
|
79
78
|
else:
|
80
|
-
ConnectivityMapEntry =
|
79
|
+
ConnectivityMapEntry = list[int]
|
81
80
|
|
82
81
|
|
83
82
|
class HardwareInformation(pydantic.BaseModel):
|
@@ -87,8 +86,8 @@ class HardwareInformation(pydantic.BaseModel):
|
|
87
86
|
display_name: str
|
88
87
|
device_type: DeviceType
|
89
88
|
number_of_qubits: int
|
90
|
-
connectivity_map: Optional[
|
91
|
-
basis_gates:
|
89
|
+
connectivity_map: Optional[list[ConnectivityMapEntry]] = None
|
90
|
+
basis_gates: list[str]
|
92
91
|
status: HardwareStatus
|
93
92
|
|
94
93
|
def is_simulator(self) -> bool:
|
@@ -1,3 +1,3 @@
|
|
1
|
-
from typing import Any, Callable
|
1
|
+
from typing import Any, Callable
|
2
2
|
|
3
|
-
CUSTOM_ENCODERS:
|
3
|
+
CUSTOM_ENCODERS: dict[type, Callable[[Any], Any]] = {complex: str}
|
@@ -1,8 +1,7 @@
|
|
1
|
-
from typing import TYPE_CHECKING,
|
1
|
+
from typing import TYPE_CHECKING, Annotated, Any
|
2
2
|
|
3
3
|
import pydantic
|
4
4
|
from pydantic import Field, StrictStr, StringConstraints
|
5
|
-
from typing_extensions import Annotated
|
6
5
|
|
7
6
|
from classiq.interface.generator.arith.number_utils import MAXIMAL_MACHINE_PRECISION
|
8
7
|
from classiq.interface.generator.parameters import ParameterComplexType
|
@@ -57,7 +56,7 @@ else:
|
|
57
56
|
if TYPE_CHECKING:
|
58
57
|
PydanticPauliMonomial = tuple
|
59
58
|
else:
|
60
|
-
PydanticPauliMonomial = Annotated[
|
59
|
+
PydanticPauliMonomial = Annotated[list[Any], Field(min_length=2, max_length=2)]
|
61
60
|
|
62
61
|
if TYPE_CHECKING:
|
63
62
|
PydanticPauliMonomialStr = str
|
@@ -68,16 +67,16 @@ else:
|
|
68
67
|
]
|
69
68
|
|
70
69
|
PydanticPauliList = Annotated[
|
71
|
-
|
70
|
+
list[tuple[PydanticPauliMonomialStr, ParameterComplexType]], Field(min_length=1)
|
72
71
|
]
|
73
72
|
|
74
73
|
if TYPE_CHECKING:
|
75
|
-
PydanticFloatTuple =
|
74
|
+
PydanticFloatTuple = tuple[float, float]
|
76
75
|
else:
|
77
|
-
PydanticFloatTuple = Annotated[
|
76
|
+
PydanticFloatTuple = Annotated[list[float], Field(min_length=2, max_length=2)]
|
78
77
|
|
79
78
|
PydanticNonNegIntTuple = Annotated[
|
80
|
-
|
79
|
+
list[pydantic.NonNegativeInt], Field(min_length=2, max_length=2)
|
81
80
|
]
|
82
81
|
|
83
82
|
if TYPE_CHECKING:
|
@@ -90,9 +89,9 @@ else:
|
|
90
89
|
),
|
91
90
|
]
|
92
91
|
if TYPE_CHECKING:
|
93
|
-
AtomType =
|
92
|
+
AtomType = tuple[str, list[float]]
|
94
93
|
else:
|
95
|
-
AtomType = Annotated[
|
94
|
+
AtomType = Annotated[list[Any], Field(min_length=2, max_length=2)]
|
96
95
|
|
97
96
|
|
98
97
|
if TYPE_CHECKING:
|
@@ -0,0 +1,18 @@
|
|
1
|
+
from typing import Any
|
2
|
+
|
3
|
+
|
4
|
+
class DotDict(dict):
|
5
|
+
def __getattr__(self, key: str) -> Any:
|
6
|
+
return super().get(key)
|
7
|
+
|
8
|
+
def __setattr__(self, key: str, value: Any) -> None:
|
9
|
+
super().__setitem__(key, value)
|
10
|
+
|
11
|
+
def __delattr__(self, key: str) -> None:
|
12
|
+
super().__delitem__(key)
|
13
|
+
|
14
|
+
|
15
|
+
def get_recursive_dotdict(obj: Any) -> Any:
|
16
|
+
if not isinstance(obj, dict):
|
17
|
+
return obj
|
18
|
+
return DotDict({k: get_recursive_dotdict(v) for k, v in obj.items()})
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import itertools
|
2
2
|
import numbers
|
3
|
+
from collections.abc import Iterator
|
3
4
|
from enum import EnumMeta
|
4
|
-
from typing import Any
|
5
|
+
from typing import Any
|
5
6
|
|
6
7
|
|
7
8
|
def immutable_version(value: Any) -> Any:
|
@@ -29,5 +30,5 @@ class HashableMixin:
|
|
29
30
|
for val in self._values_to_hash():
|
30
31
|
yield immutable_version(val)
|
31
32
|
|
32
|
-
def _value_tuple(self) ->
|
33
|
+
def _value_tuple(self) -> tuple[Any, ...]:
|
33
34
|
return tuple(itertools.chain((str(type(self))), self._immutable_fields()))
|
@@ -1,9 +1,10 @@
|
|
1
|
-
from
|
1
|
+
from collections.abc import Sequence
|
2
|
+
from typing import Any, Protocol, TypeVar
|
2
3
|
|
3
4
|
|
4
5
|
def values_with_discriminator(
|
5
6
|
values: Any, discriminator: str, discriminator_value: Any
|
6
|
-
) ->
|
7
|
+
) -> dict[str, Any]:
|
7
8
|
if isinstance(values, dict):
|
8
9
|
values.setdefault(discriminator, discriminator_value)
|
9
10
|
return values
|
@@ -16,5 +17,5 @@ class Nameable(Protocol):
|
|
16
17
|
NameableType = TypeVar("NameableType", bound=Nameable)
|
17
18
|
|
18
19
|
|
19
|
-
def nameables_to_dict(nameables: Sequence[NameableType]) ->
|
20
|
+
def nameables_to_dict(nameables: Sequence[NameableType]) -> dict[str, NameableType]:
|
20
21
|
return {value.name: value for value in nameables}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
from
|
1
|
+
from collections.abc import Hashable, Mapping
|
2
2
|
|
3
3
|
from classiq.interface.exceptions import ClassiqValueError
|
4
4
|
from classiq.interface.helpers.pydantic_model_helpers import Nameable
|
5
5
|
|
6
6
|
|
7
|
-
def is_list_unique(lst:
|
7
|
+
def is_list_unique(lst: list[Hashable]) -> bool:
|
8
8
|
return len(set(lst)) == len(lst)
|
9
9
|
|
10
10
|
|
@@ -1,13 +1,14 @@
|
|
1
1
|
from enum import IntEnum
|
2
|
-
from typing import
|
2
|
+
from typing import Optional, Union
|
3
3
|
|
4
4
|
import pydantic
|
5
5
|
|
6
6
|
from classiq.interface.generator.generated_circuit_data import GeneratedFunction
|
7
7
|
from classiq.interface.generator.hardware.hardware_data import SynthesisHardwareData
|
8
8
|
from classiq.interface.helpers.versioned_model import VersionedModel
|
9
|
+
from classiq.interface.ide.visual_model import CircuitMetrics
|
9
10
|
|
10
|
-
GateCount =
|
11
|
+
GateCount = dict[str, int]
|
11
12
|
Depth = int
|
12
13
|
|
13
14
|
|
@@ -51,17 +52,17 @@ class ConditionalRender(IntEnum):
|
|
51
52
|
class IDEDataOperation(pydantic.BaseModel):
|
52
53
|
gate: str
|
53
54
|
displayName: str
|
54
|
-
children:
|
55
|
+
children: list["IDEDataOperation"]
|
55
56
|
depth: Depth
|
56
57
|
width: int
|
57
58
|
gate_count: GateCount
|
58
59
|
_qubits: list = pydantic.PrivateAttr() # list[Qubit]
|
59
60
|
|
60
61
|
displayArgs: str = ""
|
61
|
-
targets: Union[
|
62
|
+
targets: Union[list[IDEQubitDef], list[IDEClassicalBitDef]] = pydantic.Field(
|
62
63
|
default_factory=list
|
63
64
|
)
|
64
|
-
controls:
|
65
|
+
controls: list[IDEQubitDef] = list()
|
65
66
|
dataAttributes: DataAttributes = pydantic.Field(default_factory=DataAttributes)
|
66
67
|
isControlled: bool = False
|
67
68
|
isMeasurement: bool = False
|
@@ -81,7 +82,7 @@ class IDEDataProperties(pydantic.BaseModel):
|
|
81
82
|
|
82
83
|
|
83
84
|
class RegisterData(pydantic.BaseModel):
|
84
|
-
segmentIds:
|
85
|
+
segmentIds: list[str]
|
85
86
|
properties: IDEDataProperties
|
86
87
|
registerId: str
|
87
88
|
|
@@ -91,16 +92,11 @@ class InterfaceSegmentData(pydantic.BaseModel):
|
|
91
92
|
properties: IDEDataProperties
|
92
93
|
|
93
94
|
|
94
|
-
class CircuitMetrics(pydantic.BaseModel):
|
95
|
-
depth: int
|
96
|
-
count_ops: Dict[str, int]
|
97
|
-
|
98
|
-
|
99
95
|
class IDEData(VersionedModel):
|
100
|
-
qubits:
|
101
|
-
operations:
|
102
|
-
register_data:
|
103
|
-
segment_data:
|
96
|
+
qubits: list[IDEDataQubit]
|
97
|
+
operations: list[IDEDataOperation]
|
98
|
+
register_data: list[RegisterData]
|
99
|
+
segment_data: list[InterfaceSegmentData]
|
104
100
|
circuit_metrics: Optional[CircuitMetrics]
|
105
101
|
hardware_data: SynthesisHardwareData
|
106
102
|
creation_time: str
|
@@ -1,20 +1,17 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, Optional
|
2
2
|
|
3
3
|
import pydantic
|
4
4
|
from pydantic import ConfigDict
|
5
5
|
|
6
6
|
from classiq.interface.enum_utils import StrEnum
|
7
|
+
from classiq.interface.generator.generated_circuit_data import (
|
8
|
+
OperationLevel,
|
9
|
+
OperationParameter,
|
10
|
+
)
|
7
11
|
from classiq.interface.generator.hardware.hardware_data import SynthesisHardwareData
|
8
12
|
from classiq.interface.helpers.versioned_model import VersionedModel
|
9
13
|
|
10
14
|
|
11
|
-
class OperationLevel(StrEnum):
|
12
|
-
QMOD_FUNCTION_CALL = "QMOD_CALL"
|
13
|
-
QMOD_STATEMENT = "QMOD_STATEMENT"
|
14
|
-
ENGINE_FUNCTION_CALL = "ENGINE_CALL"
|
15
|
-
UNKNOWN = "UNKNOWN"
|
16
|
-
|
17
|
-
|
18
15
|
class OperationType(StrEnum):
|
19
16
|
REGULAR = "REGULAR"
|
20
17
|
ALLOCATE = "ALLOCATE"
|
@@ -26,22 +23,23 @@ class OperationType(StrEnum):
|
|
26
23
|
class OperationData(pydantic.BaseModel):
|
27
24
|
approximated_depth: Optional[int] = None
|
28
25
|
width: int
|
29
|
-
gate_count:
|
26
|
+
gate_count: dict[str, int] = pydantic.Field(default_factory=dict)
|
30
27
|
|
31
28
|
|
32
|
-
class
|
33
|
-
|
29
|
+
class CircuitMetrics(pydantic.BaseModel):
|
30
|
+
depth: int
|
31
|
+
count_ops: dict[str, int]
|
34
32
|
|
35
33
|
|
36
|
-
class
|
37
|
-
|
38
|
-
|
34
|
+
class ProgramData(pydantic.BaseModel):
|
35
|
+
hardware_data: SynthesisHardwareData
|
36
|
+
circuit_metrics: CircuitMetrics
|
39
37
|
|
40
38
|
|
41
39
|
class OperationLink(pydantic.BaseModel):
|
42
40
|
label: str
|
43
41
|
inner_label: Optional[str] = None
|
44
|
-
qubits:
|
42
|
+
qubits: tuple[int, ...]
|
45
43
|
type: str
|
46
44
|
|
47
45
|
model_config = ConfigDict(frozen=True)
|
@@ -56,8 +54,16 @@ class OperationLink(pydantic.BaseModel):
|
|
56
54
|
|
57
55
|
|
58
56
|
class OperationLinks(pydantic.BaseModel):
|
59
|
-
inputs:
|
60
|
-
outputs:
|
57
|
+
inputs: list[OperationLink]
|
58
|
+
outputs: list[OperationLink]
|
59
|
+
|
60
|
+
@property
|
61
|
+
def input_width(self) -> int:
|
62
|
+
return sum(len(link.qubits) for link in self.inputs)
|
63
|
+
|
64
|
+
@property
|
65
|
+
def output_width(self) -> int:
|
66
|
+
return sum(len(link.qubits) for link in self.outputs)
|
61
67
|
|
62
68
|
|
63
69
|
class AtomicGate(StrEnum):
|
@@ -89,17 +95,22 @@ class AtomicGate(StrEnum):
|
|
89
95
|
CPHASE = "CPHASE"
|
90
96
|
SWAP = "SWAP"
|
91
97
|
IDENTITY = "IDENTITY"
|
98
|
+
U = "U"
|
99
|
+
|
100
|
+
@property
|
101
|
+
def is_control_gate(self) -> bool:
|
102
|
+
return self.startswith("C")
|
92
103
|
|
93
104
|
|
94
105
|
class Operation(pydantic.BaseModel):
|
95
106
|
name: str
|
96
|
-
children:
|
107
|
+
children: list["Operation"]
|
97
108
|
operation_data: Optional[OperationData] = None
|
98
109
|
operation_links: OperationLinks
|
99
|
-
control_qubits:
|
100
|
-
auxiliary_qubits:
|
101
|
-
target_qubits:
|
102
|
-
parameters:
|
110
|
+
control_qubits: tuple[int, ...] = pydantic.Field(default_factory=tuple)
|
111
|
+
auxiliary_qubits: tuple[int, ...]
|
112
|
+
target_qubits: tuple[int, ...]
|
113
|
+
parameters: list[OperationParameter] = pydantic.Field(default_factory=list)
|
103
114
|
operation_level: OperationLevel
|
104
115
|
operation_type: OperationType = pydantic.Field(
|
105
116
|
description="Identifies unique operations that are visualized differently"
|
classiq/interface/jobs.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, Generic, Optional, TypeVar, Union
|
2
2
|
|
3
3
|
import pydantic
|
4
4
|
from pydantic import BaseModel
|
@@ -8,7 +8,7 @@ from classiq.interface.enum_utils import StrEnum
|
|
8
8
|
from classiq.interface.exceptions import ClassiqAPIError
|
9
9
|
from classiq.interface.helpers.custom_encoders import CUSTOM_ENCODERS
|
10
10
|
|
11
|
-
JSONObject =
|
11
|
+
JSONObject = dict[str, Any]
|
12
12
|
T = TypeVar("T", bound=Union[pydantic.BaseModel, JSONObject])
|
13
13
|
AUTH_HEADER = "Classiq-BE-Auth"
|
14
14
|
INVALID_RESPONSE_ERROR_MSG = "Invalid response from Classiq API"
|
@@ -1,4 +1,5 @@
|
|
1
|
-
from
|
1
|
+
from collections.abc import Mapping, Sequence
|
2
|
+
from typing import Literal
|
2
3
|
|
3
4
|
import pydantic
|
4
5
|
|
@@ -13,8 +14,8 @@ BIND_OUTPUT_NAME = "bind_output"
|
|
13
14
|
class BindOperation(QuantumOperation):
|
14
15
|
kind: Literal["BindOperation"]
|
15
16
|
|
16
|
-
in_handles:
|
17
|
-
out_handles:
|
17
|
+
in_handles: list[ConcreteHandleBinding]
|
18
|
+
out_handles: list[ConcreteHandleBinding]
|
18
19
|
|
19
20
|
@property
|
20
21
|
def wiring_inputs(self) -> Mapping[str, HandleBinding]:
|
@@ -51,7 +52,7 @@ class BindOperation(QuantumOperation):
|
|
51
52
|
|
52
53
|
@pydantic.field_validator("in_handles", "out_handles")
|
53
54
|
@classmethod
|
54
|
-
def validate_handle(cls, handles:
|
55
|
+
def validate_handle(cls, handles: list[HandleBinding]) -> list[HandleBinding]:
|
55
56
|
for handle in handles:
|
56
57
|
if not handle.is_bindable():
|
57
58
|
raise ClassiqValueError(f"Cannot bind '{handle}'")
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, Literal
|
2
2
|
|
3
3
|
import pydantic
|
4
4
|
|
@@ -14,7 +14,7 @@ class AnonClassicalParameterDeclaration(Parameter):
|
|
14
14
|
|
15
15
|
@pydantic.model_validator(mode="before")
|
16
16
|
@classmethod
|
17
|
-
def _set_kind(cls, values: Any) ->
|
17
|
+
def _set_kind(cls, values: Any) -> dict[str, Any]:
|
18
18
|
return values_with_discriminator(
|
19
19
|
values, "kind", "ClassicalParameterDeclaration"
|
20
20
|
)
|
@@ -1,5 +1,6 @@
|
|
1
|
+
from collections.abc import Sequence
|
1
2
|
from itertools import chain
|
2
|
-
from typing import TYPE_CHECKING, Any,
|
3
|
+
from typing import TYPE_CHECKING, Any, Union
|
3
4
|
|
4
5
|
import pydantic
|
5
6
|
from pydantic import ConfigDict, Field
|
@@ -51,7 +52,7 @@ class NestedHandleBinding(HandleBinding):
|
|
51
52
|
|
52
53
|
@pydantic.model_validator(mode="before")
|
53
54
|
@classmethod
|
54
|
-
def _set_name(cls, values: Any) ->
|
55
|
+
def _set_name(cls, values: Any) -> dict[str, Any]:
|
55
56
|
if isinstance(values, dict):
|
56
57
|
orig = values
|
57
58
|
while "base_handle" in values:
|
classiq/interface/model/model.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
from collections import Counter
|
2
|
-
from
|
2
|
+
from collections.abc import Mapping
|
3
|
+
from typing import Any, Literal, NewType
|
3
4
|
|
4
5
|
import pydantic
|
5
6
|
|
@@ -58,23 +59,23 @@ class Model(VersionedModel, ASTNode):
|
|
58
59
|
kind: Literal["user"] = pydantic.Field(default=USER_MODEL_MARKER)
|
59
60
|
|
60
61
|
# Must be validated before logic_flow
|
61
|
-
functions:
|
62
|
+
functions: list[NativeFunctionDefinition] = pydantic.Field(
|
62
63
|
default_factory=list,
|
63
64
|
description="The user-defined custom type library.",
|
64
65
|
validate_default=True,
|
65
66
|
)
|
66
67
|
|
67
|
-
enums:
|
68
|
+
enums: list[EnumDeclaration] = pydantic.Field(
|
68
69
|
default_factory=list,
|
69
70
|
description="user-defined enums",
|
70
71
|
)
|
71
72
|
|
72
|
-
types:
|
73
|
+
types: list[StructDeclaration] = pydantic.Field(
|
73
74
|
default_factory=list,
|
74
75
|
description="user-defined structs",
|
75
76
|
)
|
76
77
|
|
77
|
-
qstructs:
|
78
|
+
qstructs: list[QStructDeclaration] = pydantic.Field(
|
78
79
|
default_factory=list,
|
79
80
|
description="user-defined quantum structs",
|
80
81
|
)
|
@@ -83,7 +84,7 @@ class Model(VersionedModel, ASTNode):
|
|
83
84
|
description="The classical execution code of the model", default=""
|
84
85
|
)
|
85
86
|
|
86
|
-
constants:
|
87
|
+
constants: list[Constant] = pydantic.Field(
|
87
88
|
default_factory=list,
|
88
89
|
)
|
89
90
|
|
@@ -133,8 +134,8 @@ class Model(VersionedModel, ASTNode):
|
|
133
134
|
@pydantic.field_validator("functions")
|
134
135
|
@classmethod
|
135
136
|
def _add_empty_main(
|
136
|
-
cls, functions:
|
137
|
-
) ->
|
137
|
+
cls, functions: list[NativeFunctionDefinition]
|
138
|
+
) -> list[NativeFunctionDefinition]:
|
138
139
|
function_dict = nameables_to_dict(functions)
|
139
140
|
if MAIN_FUNCTION_NAME not in function_dict:
|
140
141
|
functions.append(_create_empty_main_function())
|
@@ -146,8 +147,8 @@ class Model(VersionedModel, ASTNode):
|
|
146
147
|
@pydantic.field_validator("functions")
|
147
148
|
@classmethod
|
148
149
|
def _validate_entry_point(
|
149
|
-
cls, functions:
|
150
|
-
) ->
|
150
|
+
cls, functions: list[NativeFunctionDefinition]
|
151
|
+
) -> list[NativeFunctionDefinition]:
|
151
152
|
function_dict = nameables_to_dict(functions)
|
152
153
|
if MAIN_FUNCTION_NAME not in function_dict:
|
153
154
|
raise ClassiqValueError("The model must contain a `main` function")
|
@@ -161,7 +162,7 @@ class Model(VersionedModel, ASTNode):
|
|
161
162
|
|
162
163
|
@pydantic.field_validator("constants")
|
163
164
|
@classmethod
|
164
|
-
def _validate_constants(cls, constants:
|
165
|
+
def _validate_constants(cls, constants: list[Constant]) -> list[Constant]:
|
165
166
|
constant_definition_counts = Counter(
|
166
167
|
[constant.name for constant in constants]
|
167
168
|
).items()
|
@@ -10,6 +10,13 @@ if TYPE_CHECKING:
|
|
10
10
|
from classiq.interface.model.statement_block import StatementBlock
|
11
11
|
|
12
12
|
|
13
|
+
class FunctionSynthesisData(pydantic.BaseModel):
|
14
|
+
should_synthesize_separately: bool = pydantic.Field(
|
15
|
+
default=False,
|
16
|
+
description="Whether the function should be synthesized separately.",
|
17
|
+
)
|
18
|
+
|
19
|
+
|
13
20
|
class NativeFunctionDefinition(NamedParamsQuantumFunctionDeclaration):
|
14
21
|
"""
|
15
22
|
Facilitates the creation of a user-defined composite function
|
@@ -21,3 +28,6 @@ class NativeFunctionDefinition(NamedParamsQuantumFunctionDeclaration):
|
|
21
28
|
body: "StatementBlock" = pydantic.Field(
|
22
29
|
default_factory=list, description="List of function calls to perform."
|
23
30
|
)
|
31
|
+
synthesis_data: FunctionSynthesisData = pydantic.Field(
|
32
|
+
default_factory=FunctionSynthesisData,
|
33
|
+
)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, Literal
|
2
2
|
|
3
3
|
import pydantic
|
4
4
|
from pydantic_core.core_schema import ValidationInfo
|
@@ -19,7 +19,7 @@ class AnonPortDeclaration(Parameter):
|
|
19
19
|
|
20
20
|
@pydantic.model_validator(mode="before")
|
21
21
|
@classmethod
|
22
|
-
def _set_kind(cls, values: Any) ->
|
22
|
+
def _set_kind(cls, values: Any) -> dict[str, Any]:
|
23
23
|
return values_with_discriminator(values, "kind", "PortDeclaration")
|
24
24
|
|
25
25
|
@pydantic.field_validator("direction", mode="before")
|
@@ -1,4 +1,5 @@
|
|
1
|
-
from
|
1
|
+
from collections.abc import Mapping, Sequence
|
2
|
+
from typing import Literal
|
2
3
|
|
3
4
|
import pydantic
|
4
5
|
|
@@ -61,7 +62,7 @@ class AmplitudeLoadingOperation(QuantumAssignmentOperation):
|
|
61
62
|
|
62
63
|
def initialize_var_types(
|
63
64
|
self,
|
64
|
-
var_types:
|
65
|
+
var_types: dict[str, QuantumType],
|
65
66
|
machine_precision: int,
|
66
67
|
) -> None:
|
67
68
|
if len(var_types) != 1:
|
@@ -1,4 +1,5 @@
|
|
1
|
-
from
|
1
|
+
from collections.abc import Mapping, Sequence
|
2
|
+
from typing import Literal, Optional
|
2
3
|
|
3
4
|
import pydantic
|
4
5
|
from pydantic_core.core_schema import ValidationInfo
|
@@ -60,7 +61,7 @@ class ArithmeticOperation(QuantumAssignmentOperation):
|
|
60
61
|
|
61
62
|
def initialize_var_types(
|
62
63
|
self,
|
63
|
-
var_types:
|
64
|
+
var_types: dict[str, QuantumType],
|
64
65
|
machine_precision: int,
|
65
66
|
) -> None:
|
66
67
|
super().initialize_var_types(var_types, machine_precision)
|