classiq 0.93.0__py3-none-any.whl → 0.94.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.
Potentially problematic release.
This version of classiq might be problematic. Click here for more details.
- classiq/__init__.py +6 -19
- classiq/_analyzer_extras/_ipywidgets_async_extension.py +7 -7
- classiq/_analyzer_extras/interactive_hardware.py +19 -12
- classiq/_internals/api_wrapper.py +38 -52
- classiq/_internals/async_utils.py +4 -7
- classiq/_internals/authentication/auth0.py +3 -3
- classiq/_internals/authentication/device.py +4 -4
- classiq/_internals/authentication/password_manager.py +13 -13
- classiq/_internals/authentication/token_manager.py +4 -5
- classiq/_internals/client.py +17 -44
- classiq/_internals/config.py +1 -2
- classiq/_internals/help.py +1 -2
- classiq/_internals/host_checker.py +3 -3
- classiq/_internals/jobs.py +14 -14
- classiq/_internals/type_validation.py +3 -3
- classiq/analyzer/analyzer.py +18 -18
- classiq/analyzer/rb.py +17 -8
- classiq/applications/chemistry/__init__.py +0 -30
- classiq/applications/chemistry/op_utils.py +4 -4
- classiq/applications/chemistry/problems.py +3 -3
- classiq/applications/chemistry/ucc.py +1 -2
- classiq/applications/chemistry/z2_symmetries.py +4 -4
- classiq/applications/combinatorial_helpers/allowed_constraints.py +1 -3
- classiq/applications/combinatorial_helpers/arithmetic/arithmetic_expression.py +2 -1
- classiq/applications/combinatorial_helpers/combinatorial_problem_utils.py +2 -2
- classiq/applications/combinatorial_helpers/encoding_mapping.py +2 -3
- classiq/applications/combinatorial_helpers/encoding_utils.py +2 -2
- classiq/applications/combinatorial_helpers/optimization_model.py +3 -4
- classiq/applications/combinatorial_helpers/pauli_helpers/pauli_sparsing.py +2 -2
- classiq/applications/combinatorial_helpers/pyomo_utils.py +8 -8
- classiq/applications/combinatorial_helpers/sympy_utils.py +1 -3
- classiq/applications/combinatorial_helpers/transformations/encoding.py +3 -3
- classiq/applications/combinatorial_helpers/transformations/fixed_variables.py +1 -2
- classiq/applications/combinatorial_optimization/combinatorial_optimization_config.py +2 -3
- classiq/applications/combinatorial_optimization/combinatorial_optimization_model_constructor.py +4 -6
- classiq/applications/combinatorial_optimization/combinatorial_problem.py +15 -10
- classiq/applications/hamiltonian/pauli_decomposition.py +6 -4
- classiq/applications/iqae/iqae.py +8 -8
- classiq/applications/qnn/datasets/dataset_base_classes.py +6 -6
- classiq/applications/qnn/datasets/dataset_parity.py +6 -6
- classiq/applications/qnn/qlayer.py +8 -7
- classiq/applications/qnn/torch_utils.py +3 -4
- classiq/applications/qnn/types.py +2 -1
- classiq/applications/qsp/qsp.py +5 -4
- classiq/applications/qsvm/qsvm_data_generation.py +1 -2
- classiq/evaluators/classical_expression.py +0 -4
- classiq/evaluators/parameter_types.py +7 -8
- classiq/evaluators/qmod_annotated_expression.py +24 -26
- classiq/evaluators/qmod_expression_visitors/qmod_expression_evaluator.py +14 -14
- classiq/evaluators/qmod_expression_visitors/qmod_expression_simplifier.py +2 -1
- classiq/evaluators/qmod_expression_visitors/sympy_wrappers.py +8 -8
- classiq/evaluators/qmod_node_evaluators/classical_function_evaluation.py +4 -4
- classiq/evaluators/qmod_node_evaluators/list_evaluation.py +2 -2
- classiq/evaluators/qmod_node_evaluators/numeric_attrs_utils.py +3 -3
- classiq/evaluators/qmod_node_evaluators/subscript_evaluation.py +9 -9
- classiq/evaluators/qmod_node_evaluators/utils.py +6 -6
- classiq/evaluators/qmod_type_inference/classical_type_inference.py +9 -10
- classiq/evaluators/qmod_type_inference/quantum_type_inference.py +5 -5
- classiq/execution/execution_session.py +18 -19
- classiq/execution/jobs.py +26 -26
- classiq/execution/qnn.py +1 -2
- classiq/execution/user_budgets.py +52 -7
- classiq/executor.py +1 -3
- classiq/interface/_version.py +1 -1
- classiq/interface/analyzer/analysis_params.py +4 -4
- classiq/interface/analyzer/cytoscape_graph.py +3 -3
- classiq/interface/analyzer/result.py +4 -4
- classiq/interface/applications/qsvm.py +5 -8
- classiq/interface/ast_node.py +3 -3
- classiq/interface/backend/backend_preferences.py +16 -16
- classiq/interface/backend/ionq/ionq_quantum_program.py +5 -5
- classiq/interface/chemistry/ansatz_library.py +3 -5
- classiq/interface/chemistry/operator.py +3 -3
- classiq/interface/combinatorial_optimization/examples/knapsack.py +2 -4
- classiq/interface/combinatorial_optimization/examples/tsp_digraph.py +1 -2
- classiq/interface/compression_utils.py +2 -3
- classiq/interface/debug_info/debug_info.py +7 -7
- classiq/interface/exceptions.py +2 -3
- classiq/interface/execution/iqcc.py +1 -3
- classiq/interface/execution/primitives.py +6 -6
- classiq/interface/executor/estimate_cost.py +1 -1
- classiq/interface/executor/execution_preferences.py +3 -5
- classiq/interface/executor/execution_request.py +10 -10
- classiq/interface/executor/execution_result.py +1 -2
- classiq/interface/executor/quantum_code.py +8 -8
- classiq/interface/executor/result.py +28 -18
- classiq/interface/executor/user_budget.py +2 -3
- classiq/interface/executor/vqe_result.py +5 -6
- classiq/interface/generator/ansatz_library.py +6 -8
- classiq/interface/generator/application_apis/__init__.py +0 -2
- classiq/interface/generator/arith/arithmetic.py +2 -2
- classiq/interface/generator/arith/arithmetic_arg_type_validator.py +2 -3
- classiq/interface/generator/arith/arithmetic_expression_abc.py +4 -5
- classiq/interface/generator/arith/arithmetic_expression_parser.py +11 -4
- classiq/interface/generator/arith/arithmetic_expression_validator.py +12 -15
- classiq/interface/generator/arith/arithmetic_operations.py +4 -6
- classiq/interface/generator/arith/arithmetic_param_getters.py +70 -107
- classiq/interface/generator/arith/arithmetic_result_builder.py +4 -4
- classiq/interface/generator/arith/ast_node_rewrite.py +8 -4
- classiq/interface/generator/arith/binary_ops.py +7 -36
- classiq/interface/generator/arith/logical_ops.py +2 -3
- classiq/interface/generator/arith/number_utils.py +2 -2
- classiq/interface/generator/arith/register_user_input.py +2 -2
- classiq/interface/generator/arith/unary_ops.py +2 -2
- classiq/interface/generator/circuit_code/circuit_code.py +8 -10
- classiq/interface/generator/circuit_code/types_and_constants.py +1 -1
- classiq/interface/generator/complex_type.py +2 -2
- classiq/interface/generator/copy.py +1 -3
- classiq/interface/generator/expressions/atomic_expression_functions.py +0 -5
- classiq/interface/generator/expressions/evaluated_expression.py +2 -3
- classiq/interface/generator/expressions/expression.py +2 -2
- classiq/interface/generator/expressions/proxies/classical/classical_array_proxy.py +4 -7
- classiq/interface/generator/function_param_list.py +0 -20
- classiq/interface/generator/function_params.py +5 -6
- classiq/interface/generator/functions/classical_function_declaration.py +2 -2
- classiq/interface/generator/functions/classical_type.py +3 -3
- classiq/interface/generator/functions/type_modifier.py +0 -14
- classiq/interface/generator/functions/type_name.py +2 -2
- classiq/interface/generator/generated_circuit_data.py +12 -13
- classiq/interface/generator/hamiltonian_evolution/exponentiation.py +2 -4
- classiq/interface/generator/hardware/hardware_data.py +8 -8
- classiq/interface/generator/hardware_efficient_ansatz.py +8 -8
- classiq/interface/generator/mcu.py +3 -3
- classiq/interface/generator/mcx.py +3 -3
- classiq/interface/generator/model/constraints.py +34 -5
- classiq/interface/generator/model/preferences/preferences.py +15 -21
- classiq/interface/generator/model/quantum_register.py +7 -10
- classiq/interface/generator/noise_properties.py +3 -7
- classiq/interface/generator/parameters.py +1 -1
- classiq/interface/generator/partitioned_register.py +1 -2
- classiq/interface/generator/preferences/qasm_to_qmod_params.py +11 -0
- classiq/interface/generator/qsvm.py +2 -2
- classiq/interface/generator/quantum_function_call.py +8 -11
- classiq/interface/generator/quantum_program.py +12 -15
- classiq/interface/generator/range_types.py +3 -3
- classiq/interface/generator/slice_parsing_utils.py +4 -5
- classiq/interface/generator/standard_gates/standard_gates.py +2 -4
- classiq/interface/generator/state_preparation/state_preparation.py +6 -8
- classiq/interface/generator/synthesis_execution_parameter.py +1 -3
- classiq/interface/generator/synthesis_metadata/synthesis_execution_data.py +2 -3
- classiq/interface/generator/transpiler_basis_gates.py +2 -4
- classiq/interface/generator/types/builtin_enum_declarations.py +0 -136
- classiq/interface/generator/types/compilation_metadata.py +12 -1
- classiq/interface/generator/types/enum_declaration.py +2 -1
- classiq/interface/generator/validations/flow_graph.py +3 -3
- classiq/interface/generator/visitor.py +10 -12
- classiq/interface/hardware.py +2 -2
- classiq/interface/helpers/classproperty.py +2 -2
- classiq/interface/helpers/custom_encoders.py +2 -1
- classiq/interface/helpers/custom_pydantic_types.py +1 -1
- classiq/interface/helpers/text_utils.py +1 -4
- classiq/interface/ide/visual_model.py +5 -5
- classiq/interface/jobs.py +3 -3
- classiq/interface/model/allocate.py +4 -4
- classiq/interface/model/block.py +2 -2
- classiq/interface/model/bounds.py +3 -3
- classiq/interface/model/control.py +1 -1
- classiq/interface/model/inplace_binary_operation.py +2 -2
- classiq/interface/model/model.py +4 -4
- classiq/interface/model/parameter.py +1 -3
- classiq/interface/model/port_declaration.py +1 -1
- classiq/interface/model/quantum_expressions/quantum_expression.py +1 -2
- classiq/interface/model/quantum_function_call.py +3 -6
- classiq/interface/model/quantum_function_declaration.py +1 -0
- classiq/interface/model/quantum_lambda_function.py +4 -4
- classiq/interface/model/quantum_statement.py +4 -4
- classiq/interface/model/quantum_type.py +14 -14
- classiq/interface/model/validation_handle.py +2 -3
- classiq/interface/model/variable_declaration_statement.py +2 -2
- classiq/interface/pretty_print/expression_to_qmod.py +3 -4
- classiq/interface/server/routes.py +0 -4
- classiq/interface/source_reference.py +3 -4
- classiq/model_expansions/arithmetic.py +6 -7
- classiq/model_expansions/arithmetic_compute_result_attrs.py +4 -5
- classiq/model_expansions/capturing/captured_vars.py +3 -3
- classiq/model_expansions/capturing/mangling_utils.py +1 -2
- classiq/model_expansions/closure.py +12 -11
- classiq/model_expansions/function_builder.py +14 -6
- classiq/model_expansions/generative_functions.py +1 -4
- classiq/model_expansions/interpreters/base_interpreter.py +2 -6
- classiq/model_expansions/interpreters/generative_interpreter.py +5 -3
- classiq/model_expansions/quantum_operations/allocate.py +4 -4
- classiq/model_expansions/quantum_operations/assignment_result_processor.py +2 -4
- classiq/model_expansions/quantum_operations/call_emitter.py +31 -37
- classiq/model_expansions/quantum_operations/declarative_call_emitter.py +2 -2
- classiq/model_expansions/quantum_operations/emitter.py +3 -5
- classiq/model_expansions/quantum_operations/expression_evaluator.py +3 -3
- classiq/model_expansions/quantum_operations/skip_control_verifier.py +1 -2
- classiq/model_expansions/quantum_operations/variable_decleration.py +2 -2
- classiq/model_expansions/scope.py +7 -7
- classiq/model_expansions/scope_initialization.py +4 -0
- classiq/model_expansions/visitors/symbolic_param_inference.py +3 -3
- classiq/model_expansions/visitors/uncomputation_signature_inference.py +317 -0
- classiq/model_expansions/visitors/variable_references.py +15 -14
- classiq/open_library/functions/__init__.py +6 -0
- classiq/open_library/functions/discrete_sine_cosine_transform.py +5 -5
- classiq/open_library/functions/grover.py +8 -10
- classiq/open_library/functions/modular_exponentiation.py +96 -8
- classiq/qmod/__init__.py +5 -2
- classiq/qmod/builtins/classical_execution_primitives.py +4 -11
- classiq/qmod/builtins/classical_functions.py +1 -42
- classiq/qmod/builtins/enums.py +0 -136
- classiq/qmod/builtins/functions/__init__.py +0 -13
- classiq/qmod/builtins/functions/allocation.py +4 -4
- classiq/qmod/builtins/functions/arithmetic.py +22 -27
- classiq/qmod/builtins/functions/standard_gates.py +27 -27
- classiq/qmod/builtins/operations.py +35 -58
- classiq/qmod/builtins/structs.py +2 -58
- classiq/qmod/cfunc.py +3 -2
- classiq/qmod/classical_function.py +2 -1
- classiq/qmod/cparam.py +2 -8
- classiq/qmod/create_model_function.py +7 -7
- classiq/qmod/declaration_inferrer.py +33 -30
- classiq/qmod/model_state_container.py +2 -2
- classiq/qmod/native/pretty_printer.py +25 -14
- classiq/qmod/pretty_print/expression_to_python.py +5 -3
- classiq/qmod/pretty_print/pretty_printer.py +39 -17
- classiq/qmod/python_classical_type.py +40 -13
- classiq/qmod/qfunc.py +139 -16
- classiq/qmod/qmod_constant.py +2 -2
- classiq/qmod/qmod_parameter.py +5 -2
- classiq/qmod/qmod_variable.py +47 -43
- classiq/qmod/quantum_callable.py +18 -13
- classiq/qmod/quantum_expandable.py +31 -26
- classiq/qmod/quantum_function.py +51 -32
- classiq/qmod/semantics/annotation/call_annotation.py +2 -2
- classiq/qmod/semantics/error_manager.py +5 -6
- classiq/qmod/semantics/lambdas.py +1 -2
- classiq/qmod/semantics/validation/types_validation.py +1 -2
- classiq/qmod/symbolic.py +2 -4
- classiq/qmod/utilities.py +13 -10
- classiq/qmod/write_qmod.py +3 -4
- classiq/quantum_program.py +1 -3
- classiq/synthesis.py +11 -7
- {classiq-0.93.0.dist-info → classiq-0.94.0.dist-info}/METADATA +2 -3
- {classiq-0.93.0.dist-info → classiq-0.94.0.dist-info}/RECORD +238 -260
- classiq/applications/chemistry/ansatz_parameters.py +0 -29
- classiq/applications/chemistry/chemistry_execution_parameters.py +0 -16
- classiq/applications/chemistry/chemistry_model_constructor.py +0 -532
- classiq/applications/chemistry/ground_state_problem.py +0 -42
- classiq/evaluators/qmod_expression_visitors/qmod_expression_bwc.py +0 -129
- classiq/interface/chemistry/elements.py +0 -120
- classiq/interface/chemistry/fermionic_operator.py +0 -208
- classiq/interface/chemistry/ground_state_problem.py +0 -132
- classiq/interface/chemistry/ground_state_result.py +0 -8
- classiq/interface/chemistry/molecule.py +0 -71
- classiq/interface/generator/application_apis/chemistry_declarations.py +0 -69
- classiq/interface/generator/application_apis/entangler_declarations.py +0 -29
- classiq/interface/generator/chemistry_function_params.py +0 -50
- classiq/interface/generator/entangler_params.py +0 -72
- classiq/interface/generator/entanglers.py +0 -14
- classiq/interface/generator/hartree_fock.py +0 -26
- classiq/interface/generator/hva.py +0 -22
- classiq/interface/generator/linear_pauli_rotations.py +0 -92
- classiq/interface/generator/qft.py +0 -37
- classiq/interface/generator/ucc.py +0 -74
- classiq/interface/helpers/backward_compatibility.py +0 -9
- classiq/model_expansions/transformers/type_modifier_inference.py +0 -392
- classiq/qmod/builtins/functions/chemistry.py +0 -123
- {classiq-0.93.0.dist-info → classiq-0.94.0.dist-info}/WHEEL +0 -0
- {classiq-0.93.0.dist-info → classiq-0.94.0.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
from collections.abc import Sequence
|
|
2
2
|
from enum import IntEnum
|
|
3
|
-
from typing import TYPE_CHECKING, Annotated, Any, Optional,
|
|
3
|
+
from typing import TYPE_CHECKING, Annotated, Any, Optional, TypeAlias
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from pydantic import Field
|
|
7
7
|
from pydantic_core.core_schema import ValidationInfo
|
|
8
|
-
from typing_extensions import Self
|
|
8
|
+
from typing_extensions import Self
|
|
9
9
|
|
|
10
10
|
from classiq.interface.backend.backend_preferences import (
|
|
11
11
|
BackendPreferences,
|
|
@@ -135,21 +135,15 @@ class Preferences(pydantic.BaseModel, extra="forbid"):
|
|
|
135
135
|
- If `backend_service_provider` is not valid.
|
|
136
136
|
"""
|
|
137
137
|
|
|
138
|
-
_backend_preferences:
|
|
139
|
-
default=None
|
|
140
|
-
)
|
|
138
|
+
_backend_preferences: BackendPreferences | None = pydantic.PrivateAttr(default=None)
|
|
141
139
|
machine_precision: PydanticMachinePrecision = DEFAULT_MACHINE_PRECISION
|
|
142
140
|
|
|
143
|
-
backend_service_provider:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
description="Provider company or cloud for the requested backend.",
|
|
147
|
-
)
|
|
141
|
+
backend_service_provider: Provider | ProviderVendor | str | None = pydantic.Field(
|
|
142
|
+
default=None,
|
|
143
|
+
description="Provider company or cloud for the requested backend.",
|
|
148
144
|
)
|
|
149
|
-
backend_name:
|
|
150
|
-
|
|
151
|
-
default=None, description="Name of the requested backend or target."
|
|
152
|
-
)
|
|
145
|
+
backend_name: PydanticBackendName | AllBackendsNameByVendor | None = pydantic.Field(
|
|
146
|
+
default=None, description="Name of the requested backend or target."
|
|
153
147
|
)
|
|
154
148
|
custom_hardware_settings: CustomHardwareSettings = pydantic.Field(
|
|
155
149
|
default_factory=CustomHardwareSettings,
|
|
@@ -182,7 +176,7 @@ class Preferences(pydantic.BaseModel, extra="forbid"):
|
|
|
182
176
|
"declarations).",
|
|
183
177
|
)
|
|
184
178
|
|
|
185
|
-
qasm3:
|
|
179
|
+
qasm3: bool | None = pydantic.Field(
|
|
186
180
|
None,
|
|
187
181
|
description="Output OpenQASM 3.0 instead of OpenQASM 2.0. Relevant only for "
|
|
188
182
|
"the `qasm` and `transpiled_circuit.qasm` attributes of `GeneratedCircuit`.",
|
|
@@ -194,7 +188,7 @@ class Preferences(pydantic.BaseModel, extra="forbid"):
|
|
|
194
188
|
"transpiled circuit and its depth",
|
|
195
189
|
)
|
|
196
190
|
|
|
197
|
-
solovay_kitaev_max_iterations:
|
|
191
|
+
solovay_kitaev_max_iterations: pydantic.PositiveInt | None = pydantic.Field(
|
|
198
192
|
None,
|
|
199
193
|
description="Maximum iterations for the Solovay-Kitaev algorithm (if applied).",
|
|
200
194
|
)
|
|
@@ -203,7 +197,7 @@ class Preferences(pydantic.BaseModel, extra="forbid"):
|
|
|
203
197
|
default=300, description="Generation timeout in seconds"
|
|
204
198
|
)
|
|
205
199
|
|
|
206
|
-
optimization_timeout_seconds:
|
|
200
|
+
optimization_timeout_seconds: pydantic.PositiveInt | None = pydantic.Field(
|
|
207
201
|
default=None,
|
|
208
202
|
description="Optimization timeout in seconds, or None for no "
|
|
209
203
|
"optimization timeout (will still timeout when the generation timeout is over)",
|
|
@@ -217,9 +211,9 @@ class Preferences(pydantic.BaseModel, extra="forbid"):
|
|
|
217
211
|
@classmethod
|
|
218
212
|
def optimization_timeout_less_than_generation_timeout(
|
|
219
213
|
cls,
|
|
220
|
-
optimization_timeout_seconds:
|
|
214
|
+
optimization_timeout_seconds: pydantic.PositiveInt | None,
|
|
221
215
|
info: ValidationInfo,
|
|
222
|
-
) ->
|
|
216
|
+
) -> pydantic.PositiveInt | None:
|
|
223
217
|
generation_timeout_seconds = info.data.get("timeout_seconds")
|
|
224
218
|
if generation_timeout_seconds is None or optimization_timeout_seconds is None:
|
|
225
219
|
return optimization_timeout_seconds
|
|
@@ -256,7 +250,7 @@ class Preferences(pydantic.BaseModel, extra="forbid"):
|
|
|
256
250
|
|
|
257
251
|
@pydantic.field_validator("backend_name")
|
|
258
252
|
@classmethod
|
|
259
|
-
def validate_backend_name(cls, backend_name:
|
|
253
|
+
def validate_backend_name(cls, backend_name: str | None) -> str | None:
|
|
260
254
|
if backend_name is None:
|
|
261
255
|
return backend_name
|
|
262
256
|
return backend_name.rstrip()
|
|
@@ -270,7 +264,7 @@ class Preferences(pydantic.BaseModel, extra="forbid"):
|
|
|
270
264
|
return self
|
|
271
265
|
|
|
272
266
|
@property
|
|
273
|
-
def backend_preferences(self) ->
|
|
267
|
+
def backend_preferences(self) -> BackendPreferences | None:
|
|
274
268
|
"""
|
|
275
269
|
Returns the backend preferences. If the backend preferences are not provided, the function sets the backend preferences according to backend name and provider.
|
|
276
270
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import itertools
|
|
2
|
-
import sys
|
|
3
2
|
from collections.abc import Iterator
|
|
4
3
|
from types import GenericAlias as TypesGenericAlias
|
|
5
4
|
from typing import ( # type: ignore[attr-defined]
|
|
6
5
|
Any,
|
|
7
|
-
Optional,
|
|
8
|
-
Union,
|
|
9
6
|
_GenericAlias,
|
|
10
7
|
)
|
|
11
8
|
|
|
@@ -31,7 +28,7 @@ class QRegGenericAlias(_GenericAlias, _root=True): # type: ignore[call-arg]
|
|
|
31
28
|
return super().__call__(*args, **kwargs, **arith_info)
|
|
32
29
|
|
|
33
30
|
def __eq__(self, other: Any) -> bool:
|
|
34
|
-
if
|
|
31
|
+
if isinstance(other, TypesGenericAlias):
|
|
35
32
|
return (
|
|
36
33
|
self.__origin__ == other.__origin__ and self.__args__ == other.__args__
|
|
37
34
|
)
|
|
@@ -39,23 +36,23 @@ class QRegGenericAlias(_GenericAlias, _root=True): # type: ignore[call-arg]
|
|
|
39
36
|
return super().__eq__(other)
|
|
40
37
|
|
|
41
38
|
@property
|
|
42
|
-
def role(self) ->
|
|
39
|
+
def role(self) -> RegisterRole | None:
|
|
43
40
|
return getattr(self.__origin__, "role", None)
|
|
44
41
|
|
|
45
42
|
@property
|
|
46
|
-
def size(self) ->
|
|
43
|
+
def size(self) -> int | None:
|
|
47
44
|
if self.integer_places is not None:
|
|
48
45
|
return self.integer_places + (self.fraction_places or 0)
|
|
49
46
|
return None
|
|
50
47
|
|
|
51
48
|
@property
|
|
52
|
-
def integer_places(self) ->
|
|
49
|
+
def integer_places(self) -> int | None:
|
|
53
50
|
if len(self.__args__) in (1, 2) and isinstance(self.__args__[0], int):
|
|
54
51
|
return self.__args__[0]
|
|
55
52
|
return None
|
|
56
53
|
|
|
57
54
|
@property
|
|
58
|
-
def fraction_places(self) ->
|
|
55
|
+
def fraction_places(self) -> int | None:
|
|
59
56
|
if len(self.__args__) == 2 and isinstance(self.__args__[1], int):
|
|
60
57
|
return self.__args__[1]
|
|
61
58
|
return None
|
|
@@ -96,11 +93,11 @@ class QReg:
|
|
|
96
93
|
qreg._qubits = qubits
|
|
97
94
|
return qreg
|
|
98
95
|
|
|
99
|
-
def __getitem__(self, key:
|
|
96
|
+
def __getitem__(self, key: int | slice) -> "QReg":
|
|
100
97
|
state = self._qubits[key]
|
|
101
98
|
return QReg._from_qubits(state if isinstance(state, list) else [state])
|
|
102
99
|
|
|
103
|
-
def __setitem__(self, key:
|
|
100
|
+
def __setitem__(self, key: int | slice, value: "QReg") -> None:
|
|
104
101
|
if isinstance(key, int) and len(value) != 1:
|
|
105
102
|
raise ClassiqQRegError(
|
|
106
103
|
f"Size mismatch: value size {len(value)}, expected size 1"
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import Optional
|
|
2
|
-
|
|
3
1
|
import pydantic
|
|
4
2
|
from pydantic import BaseModel
|
|
5
3
|
|
|
@@ -7,9 +5,7 @@ from classiq.interface.helpers.custom_pydantic_types import PydanticProbabilityF
|
|
|
7
5
|
|
|
8
6
|
|
|
9
7
|
class NoiseProperties(BaseModel):
|
|
10
|
-
measurement_bit_flip_probability:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
description="Probability of measuring the wrong value for each qubit.",
|
|
14
|
-
)
|
|
8
|
+
measurement_bit_flip_probability: PydanticProbabilityFloat | None = pydantic.Field(
|
|
9
|
+
default=None,
|
|
10
|
+
description="Probability of measuring the wrong value for each qubit.",
|
|
15
11
|
)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import itertools
|
|
2
2
|
from collections.abc import Iterator
|
|
3
3
|
from dataclasses import dataclass
|
|
4
|
-
from typing import Optional
|
|
5
4
|
|
|
6
5
|
from classiq.interface.exceptions import ClassiqValueError
|
|
7
6
|
from classiq.interface.generator.slice_parsing_utils import parse_io_slicing
|
|
@@ -72,7 +71,7 @@ class RegisterPartition:
|
|
|
72
71
|
partitioned_register: PartitionedRegister
|
|
73
72
|
|
|
74
73
|
# index == None means this is the partition containing the leftover qubits.
|
|
75
|
-
_index:
|
|
74
|
+
_index: int | None
|
|
76
75
|
|
|
77
76
|
def __post_init__(self) -> None:
|
|
78
77
|
num_partitions = len(self.partitioned_register.partitions)
|
|
@@ -5,8 +5,19 @@ from classiq.interface.enum_utils import StrEnum
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class QmodFormat(StrEnum):
|
|
8
|
+
"""
|
|
9
|
+
Qmod code format.
|
|
10
|
+
"""
|
|
11
|
+
|
|
8
12
|
NATIVE = "native"
|
|
13
|
+
"""
|
|
14
|
+
Native Qmod (`.qmod`).
|
|
15
|
+
"""
|
|
16
|
+
|
|
9
17
|
PYTHON = "python"
|
|
18
|
+
"""
|
|
19
|
+
Python Qmod (`.py`).
|
|
20
|
+
"""
|
|
10
21
|
|
|
11
22
|
|
|
12
23
|
class QasmToQmodParams(BaseModel):
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Literal,
|
|
1
|
+
from typing import Literal, Union
|
|
2
2
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
import pydantic
|
|
@@ -28,7 +28,7 @@ class QSVMFeatureMapEntanglement(StrEnum):
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
class QSVMFeatureMapDimensional(HashablePydanticBaseModel):
|
|
31
|
-
feature_dimension:
|
|
31
|
+
feature_dimension: int | None = None
|
|
32
32
|
model_config = ConfigDict(frozen=True)
|
|
33
33
|
|
|
34
34
|
|
|
@@ -10,7 +10,6 @@ from collections.abc import Iterable, Mapping, Sequence
|
|
|
10
10
|
from re import Match
|
|
11
11
|
from typing import (
|
|
12
12
|
Any,
|
|
13
|
-
Optional,
|
|
14
13
|
Union,
|
|
15
14
|
)
|
|
16
15
|
from uuid import UUID, uuid4
|
|
@@ -151,13 +150,11 @@ class SynthesisQuantumFunctionCall(BaseModel):
|
|
|
151
150
|
description="The name of the function instance. "
|
|
152
151
|
"If not set, determined automatically.",
|
|
153
152
|
)
|
|
154
|
-
caller_parameters:
|
|
155
|
-
parameter_assignments:
|
|
156
|
-
|
|
157
|
-
)
|
|
158
|
-
|
|
159
|
-
arithmetic_id: Optional[str] = pydantic.Field(default=None)
|
|
160
|
-
inverse_op_id: Optional[UUID] = pydantic.Field(default=None)
|
|
153
|
+
caller_parameters: list[str] | None = pydantic.Field(default=None)
|
|
154
|
+
parameter_assignments: dict[str, ClassicalArg] | None = pydantic.Field(default=None)
|
|
155
|
+
source_id: UUID | None = pydantic.Field(default=None)
|
|
156
|
+
arithmetic_id: str | None = pydantic.Field(default=None)
|
|
157
|
+
inverse_op_id: UUID | None = pydantic.Field(default=None)
|
|
161
158
|
|
|
162
159
|
uuid: UUID = pydantic.Field(default_factory=uuid4)
|
|
163
160
|
|
|
@@ -222,7 +219,7 @@ class SynthesisQuantumFunctionCall(BaseModel):
|
|
|
222
219
|
|
|
223
220
|
@pydantic.field_validator("name", mode="before")
|
|
224
221
|
@classmethod
|
|
225
|
-
def _create_name(cls, name:
|
|
222
|
+
def _create_name(cls, name: str | None, info: ValidationInfo) -> str:
|
|
226
223
|
"""
|
|
227
224
|
generates a name to a user defined-functions as follows:
|
|
228
225
|
<function_name>_<SUFFIX_MARKER>_<random_suffix>
|
|
@@ -400,7 +397,7 @@ class SynthesisQuantumFunctionCall(BaseModel):
|
|
|
400
397
|
@pydantic.field_validator("inputs", mode="before")
|
|
401
398
|
@classmethod
|
|
402
399
|
def _validate_inputs(cls, inputs: IOType, info: ValidationInfo) -> WireDict:
|
|
403
|
-
params:
|
|
400
|
+
params: FunctionParams | None = info.data.get("function_params")
|
|
404
401
|
is_inverse: bool = info.data.get("is_inverse", False)
|
|
405
402
|
strict_zero_ios: bool = info.data.get("strict_zero_ios", True)
|
|
406
403
|
control_states: list[ControlState] = info.data.get("control_states", list())
|
|
@@ -556,7 +553,7 @@ class SynthesisQuantumFunctionCall(BaseModel):
|
|
|
556
553
|
control_states: list[ControlState],
|
|
557
554
|
strict_zero_ios: bool,
|
|
558
555
|
) -> tuple[list[str], list[str], list[str]]:
|
|
559
|
-
expression_matches: Iterable[
|
|
556
|
+
expression_matches: Iterable[Match | None] = map(
|
|
560
557
|
functools.partial(re.fullmatch, IO_REGEX), expressions
|
|
561
558
|
)
|
|
562
559
|
|
|
@@ -2,10 +2,9 @@ import uuid
|
|
|
2
2
|
import warnings
|
|
3
3
|
from datetime import datetime, timezone
|
|
4
4
|
from pathlib import Path
|
|
5
|
-
from typing import
|
|
5
|
+
from typing import TypeAlias
|
|
6
6
|
|
|
7
7
|
import pydantic
|
|
8
|
-
from typing_extensions import TypeAlias
|
|
9
8
|
|
|
10
9
|
from classiq.interface.compression_utils import decompress
|
|
11
10
|
from classiq.interface.exceptions import (
|
|
@@ -60,19 +59,17 @@ def _get_formatted_utc_current_time() -> str:
|
|
|
60
59
|
|
|
61
60
|
class QuantumProgram(VersionedModel, CircuitCodeInterface):
|
|
62
61
|
hardware_data: SynthesisHardwareData
|
|
63
|
-
initial_values:
|
|
62
|
+
initial_values: InitialConditions | None = pydantic.Field(default=None)
|
|
64
63
|
data: GeneratedCircuitData
|
|
65
64
|
model: ExecutionModel
|
|
66
|
-
transpiled_circuit:
|
|
65
|
+
transpiled_circuit: TranspiledCircuitData | None = pydantic.Field(default=None)
|
|
67
66
|
creation_time: str = pydantic.Field(default_factory=_get_formatted_utc_current_time)
|
|
68
|
-
synthesis_duration:
|
|
69
|
-
debug_info:
|
|
70
|
-
|
|
71
|
-
)
|
|
72
|
-
compressed_debug_info: Optional[bytes] = pydantic.Field(default=None)
|
|
67
|
+
synthesis_duration: SynthesisStepDurations | None = pydantic.Field(default=None)
|
|
68
|
+
debug_info: list[FunctionDebugInfoInterface] | None = pydantic.Field(default=None)
|
|
69
|
+
compressed_debug_info: bytes | None = pydantic.Field(default=None)
|
|
73
70
|
program_id: str = pydantic.Field(default_factory=get_uuid_as_str)
|
|
74
|
-
execution_primitives_input:
|
|
75
|
-
synthesis_warnings:
|
|
71
|
+
execution_primitives_input: PrimitivesInput | None = pydantic.Field(default=None)
|
|
72
|
+
synthesis_warnings: list[str] | None = pydantic.Field(default=None)
|
|
76
73
|
should_warn: bool = pydantic.Field(default=False)
|
|
77
74
|
# Unique identifier for the circuit (since the program_id might change when running show). Used for the circuit store.
|
|
78
75
|
circuit_id: str = pydantic.Field(default_factory=get_uuid_as_str)
|
|
@@ -95,8 +92,8 @@ class QuantumProgram(VersionedModel, CircuitCodeInterface):
|
|
|
95
92
|
|
|
96
93
|
def to_program(
|
|
97
94
|
self,
|
|
98
|
-
initial_values:
|
|
99
|
-
instruction_set:
|
|
95
|
+
initial_values: InitialConditions | None = None,
|
|
96
|
+
instruction_set: QuantumInstructionSet | None = None,
|
|
100
97
|
) -> quantum_code.QuantumCode:
|
|
101
98
|
initial_values = initial_values or self.initial_values
|
|
102
99
|
if instruction_set is not None:
|
|
@@ -141,7 +138,7 @@ class QuantumProgram(VersionedModel, CircuitCodeInterface):
|
|
|
141
138
|
for name, init_value in initial_values.items()
|
|
142
139
|
}
|
|
143
140
|
|
|
144
|
-
def save_results(self, filename:
|
|
141
|
+
def save_results(self, filename: str | Path | None = None) -> None:
|
|
145
142
|
"""
|
|
146
143
|
Saves quantum program results as json into a file.
|
|
147
144
|
Parameters:
|
|
@@ -171,7 +168,7 @@ class QuantumProgram(VersionedModel, CircuitCodeInterface):
|
|
|
171
168
|
else self
|
|
172
169
|
)
|
|
173
170
|
|
|
174
|
-
def get_debug_info(self) ->
|
|
171
|
+
def get_debug_info(self) -> list[FunctionDebugInfoInterface] | None:
|
|
175
172
|
# Support legacy uncompressed debug info
|
|
176
173
|
if self.debug_info is not None:
|
|
177
174
|
return self.debug_info
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import math
|
|
2
|
-
from typing import Generic,
|
|
2
|
+
from typing import Generic, TypeVar
|
|
3
3
|
|
|
4
4
|
import pydantic
|
|
5
5
|
from pydantic import BaseModel, ConfigDict
|
|
@@ -17,8 +17,8 @@ DEF_RTOL: float = 1e-05
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class Range(BaseModel, Generic[RangeType]):
|
|
20
|
-
lower_bound:
|
|
21
|
-
upper_bound:
|
|
20
|
+
lower_bound: RangeType | None = None
|
|
21
|
+
upper_bound: RangeType | None = None
|
|
22
22
|
model_config = ConfigDict(frozen=True)
|
|
23
23
|
|
|
24
24
|
@pydantic.model_validator(mode="after")
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import re
|
|
2
2
|
from re import Match
|
|
3
|
-
from typing import Optional
|
|
4
3
|
|
|
5
4
|
from classiq.interface.exceptions import ClassiqValueError
|
|
6
5
|
from classiq.interface.generator.function_params import NAME_REGEX
|
|
@@ -17,8 +16,8 @@ def parse_io_slicing(io_str: str) -> tuple[str, slice]:
|
|
|
17
16
|
return name, get_slice(slicing)
|
|
18
17
|
|
|
19
18
|
|
|
20
|
-
def separate_name_and_slice(io_str: str) -> tuple[str,
|
|
21
|
-
match:
|
|
19
|
+
def separate_name_and_slice(io_str: str) -> tuple[str, str | None]:
|
|
20
|
+
match: Match | None = re.fullmatch(IO_REGEX, io_str)
|
|
22
21
|
if match is None:
|
|
23
22
|
raise AssertionError("Input/output name validation error")
|
|
24
23
|
name, slicing = (match.groupdict().get(x) for x in [NAME, SLICING])
|
|
@@ -27,7 +26,7 @@ def separate_name_and_slice(io_str: str) -> tuple[str, Optional[str]]:
|
|
|
27
26
|
return name, slicing
|
|
28
27
|
|
|
29
28
|
|
|
30
|
-
def get_slice(slicing:
|
|
29
|
+
def get_slice(slicing: str | None) -> slice:
|
|
31
30
|
if slicing is None:
|
|
32
31
|
return slice(None)
|
|
33
32
|
|
|
@@ -61,5 +60,5 @@ def get_slice(slicing: Optional[str]) -> slice:
|
|
|
61
60
|
raise AssertionError("Input/output slicing validation error")
|
|
62
61
|
|
|
63
62
|
|
|
64
|
-
def _int_or_none(v: str) ->
|
|
63
|
+
def _int_or_none(v: str) -> int | None:
|
|
65
64
|
return int(v) if v else None
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any, Literal
|
|
1
|
+
from typing import Any, Literal
|
|
2
2
|
|
|
3
3
|
import pydantic
|
|
4
4
|
|
|
@@ -38,9 +38,7 @@ class _StandardGate(FunctionParams, metaclass=MyMetaAngledClassModel): # type:
|
|
|
38
38
|
def num_target_qubits(self) -> int:
|
|
39
39
|
return self._num_target_qubits
|
|
40
40
|
|
|
41
|
-
def __init_subclass__(
|
|
42
|
-
cls, angles: Optional[list[str]] = None, **kwargs: Any
|
|
43
|
-
) -> None:
|
|
41
|
+
def __init_subclass__(cls, angles: list[str] | None = None, **kwargs: Any) -> None:
|
|
44
42
|
super().__init_subclass__(**kwargs)
|
|
45
43
|
|
|
46
44
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import Optional, Union
|
|
2
|
-
|
|
3
1
|
import numpy as np
|
|
4
2
|
import pydantic
|
|
5
3
|
from pydantic_core.core_schema import ValidationInfo
|
|
@@ -26,12 +24,12 @@ from classiq.interface.generator.validations.validator_functions import (
|
|
|
26
24
|
|
|
27
25
|
|
|
28
26
|
class StatePreparation(StatePreparationABC):
|
|
29
|
-
amplitudes:
|
|
27
|
+
amplitudes: Amplitudes | None = pydantic.Field(
|
|
30
28
|
description="vector of probabilities",
|
|
31
29
|
default=None,
|
|
32
30
|
validate_default=True,
|
|
33
31
|
)
|
|
34
|
-
probabilities:
|
|
32
|
+
probabilities: Probabilities | None = pydantic.Field(
|
|
35
33
|
description="vector of amplitudes",
|
|
36
34
|
default=None,
|
|
37
35
|
validate_default=True,
|
|
@@ -46,8 +44,8 @@ class StatePreparation(StatePreparationABC):
|
|
|
46
44
|
@pydantic.field_validator("amplitudes", mode="before")
|
|
47
45
|
@classmethod
|
|
48
46
|
def _initialize_amplitudes(
|
|
49
|
-
cls, amplitudes:
|
|
50
|
-
) ->
|
|
47
|
+
cls, amplitudes: FlexibleAmplitudes | None
|
|
48
|
+
) -> Amplitudes | None:
|
|
51
49
|
if amplitudes is None:
|
|
52
50
|
return None
|
|
53
51
|
amplitudes = np.array(amplitudes).squeeze()
|
|
@@ -61,8 +59,8 @@ class StatePreparation(StatePreparationABC):
|
|
|
61
59
|
@pydantic.field_validator("probabilities", mode="before")
|
|
62
60
|
@classmethod
|
|
63
61
|
def _initialize_probabilities(
|
|
64
|
-
cls, probabilities:
|
|
65
|
-
) ->
|
|
62
|
+
cls, probabilities: FlexibleProbabilities | None
|
|
63
|
+
) -> PMF | GaussianMixture | dict | None:
|
|
66
64
|
if probabilities is None:
|
|
67
65
|
return None
|
|
68
66
|
if isinstance(probabilities, Probabilities.__args__): # type: ignore[attr-defined]
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from itertools import chain
|
|
2
|
-
from typing import Optional
|
|
3
2
|
|
|
4
3
|
import pydantic
|
|
5
4
|
import sympy
|
|
@@ -10,10 +9,10 @@ from classiq.interface.generator.parameters import ParameterType
|
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class FunctionExecutionData(pydantic.BaseModel):
|
|
13
|
-
power_parameter:
|
|
12
|
+
power_parameter: ParameterType | None = pydantic.Field(default=None)
|
|
14
13
|
|
|
15
14
|
@property
|
|
16
|
-
def power_vars(self) ->
|
|
15
|
+
def power_vars(self) -> list[str] | None:
|
|
17
16
|
if self.power_parameter is None:
|
|
18
17
|
return None
|
|
19
18
|
return list(map(str, sympy.sympify(self.power_parameter).free_symbols))
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
from typing import TYPE_CHECKING,
|
|
2
|
-
|
|
3
|
-
from typing_extensions import TypeAlias
|
|
1
|
+
from typing import TYPE_CHECKING, TypeAlias
|
|
4
2
|
|
|
5
3
|
from classiq.interface.enum_utils import StrEnum
|
|
6
4
|
|
|
@@ -80,7 +78,7 @@ ALL_GATES_DICT = {gate.upper(): gate.lower() for gate in sorted(ALL_GATES)}
|
|
|
80
78
|
|
|
81
79
|
class LowerValsEnum(StrEnum):
|
|
82
80
|
@classmethod
|
|
83
|
-
def _missing_(cls, value:
|
|
81
|
+
def _missing_(cls, value: str | None) -> str | None: # type: ignore[override]
|
|
84
82
|
if not isinstance(value, str):
|
|
85
83
|
return None
|
|
86
84
|
lower = value.lower()
|
|
@@ -4,139 +4,6 @@
|
|
|
4
4
|
from enum import IntEnum
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class Element(IntEnum):
|
|
8
|
-
H = 0
|
|
9
|
-
He = 1
|
|
10
|
-
Li = 2
|
|
11
|
-
Be = 3
|
|
12
|
-
B = 4
|
|
13
|
-
C = 5
|
|
14
|
-
N = 6
|
|
15
|
-
O = 7 # noqa: E741
|
|
16
|
-
F = 8
|
|
17
|
-
Ne = 9
|
|
18
|
-
Na = 10
|
|
19
|
-
Mg = 11
|
|
20
|
-
Al = 12
|
|
21
|
-
Si = 13
|
|
22
|
-
P = 14
|
|
23
|
-
S = 15
|
|
24
|
-
Cl = 16
|
|
25
|
-
Ar = 17
|
|
26
|
-
K = 18
|
|
27
|
-
Ca = 19
|
|
28
|
-
Sc = 20
|
|
29
|
-
Ti = 21
|
|
30
|
-
V = 22
|
|
31
|
-
Cr = 23
|
|
32
|
-
Mn = 24
|
|
33
|
-
Fe = 25
|
|
34
|
-
Co = 26
|
|
35
|
-
Ni = 27
|
|
36
|
-
Cu = 28
|
|
37
|
-
Zn = 29
|
|
38
|
-
Ga = 30
|
|
39
|
-
Ge = 31
|
|
40
|
-
As = 32
|
|
41
|
-
Se = 33
|
|
42
|
-
Br = 34
|
|
43
|
-
Kr = 35
|
|
44
|
-
Rb = 36
|
|
45
|
-
Sr = 37
|
|
46
|
-
Y = 38
|
|
47
|
-
Zr = 39
|
|
48
|
-
Nb = 40
|
|
49
|
-
Mo = 41
|
|
50
|
-
Tc = 42
|
|
51
|
-
Ru = 43
|
|
52
|
-
Rh = 44
|
|
53
|
-
Pd = 45
|
|
54
|
-
Ag = 46
|
|
55
|
-
Cd = 47
|
|
56
|
-
In = 48
|
|
57
|
-
Sn = 49
|
|
58
|
-
Sb = 50
|
|
59
|
-
Te = 51
|
|
60
|
-
I = 52 # noqa: E741
|
|
61
|
-
Xe = 53
|
|
62
|
-
Cs = 54
|
|
63
|
-
Ba = 55
|
|
64
|
-
La = 56
|
|
65
|
-
Ce = 57
|
|
66
|
-
Pr = 58
|
|
67
|
-
Nd = 59
|
|
68
|
-
Pm = 60
|
|
69
|
-
Sm = 61
|
|
70
|
-
Eu = 62
|
|
71
|
-
Gd = 63
|
|
72
|
-
Tb = 64
|
|
73
|
-
Dy = 65
|
|
74
|
-
Ho = 66
|
|
75
|
-
Er = 67
|
|
76
|
-
Tm = 68
|
|
77
|
-
Yb = 69
|
|
78
|
-
Lu = 70
|
|
79
|
-
Hf = 71
|
|
80
|
-
Ta = 72
|
|
81
|
-
W = 73
|
|
82
|
-
Re = 74
|
|
83
|
-
Os = 75
|
|
84
|
-
Ir = 76
|
|
85
|
-
Pt = 77
|
|
86
|
-
Au = 78
|
|
87
|
-
Hg = 79
|
|
88
|
-
Tl = 80
|
|
89
|
-
Pb = 81
|
|
90
|
-
Bi = 82
|
|
91
|
-
Po = 83
|
|
92
|
-
At = 84
|
|
93
|
-
Rn = 85
|
|
94
|
-
Fr = 86
|
|
95
|
-
Ra = 87
|
|
96
|
-
Ac = 88
|
|
97
|
-
Th = 89
|
|
98
|
-
Pa = 90
|
|
99
|
-
U = 91
|
|
100
|
-
Np = 92
|
|
101
|
-
Pu = 93
|
|
102
|
-
Am = 94
|
|
103
|
-
Cm = 95
|
|
104
|
-
Bk = 96
|
|
105
|
-
Cf = 97
|
|
106
|
-
Es = 98
|
|
107
|
-
Fm = 99
|
|
108
|
-
Md = 100
|
|
109
|
-
No = 101
|
|
110
|
-
Lr = 102
|
|
111
|
-
Rf = 103
|
|
112
|
-
Db = 104
|
|
113
|
-
Sg = 105
|
|
114
|
-
Bh = 106
|
|
115
|
-
Hs = 107
|
|
116
|
-
Mt = 108
|
|
117
|
-
Ds = 109
|
|
118
|
-
Rg = 110
|
|
119
|
-
Cn = 111
|
|
120
|
-
Nh = 112
|
|
121
|
-
Fl = 113
|
|
122
|
-
Mc = 114
|
|
123
|
-
Lv = 115
|
|
124
|
-
Ts = 116
|
|
125
|
-
Og = 117
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
class FermionMapping(IntEnum):
|
|
129
|
-
JORDAN_WIGNER = 0
|
|
130
|
-
PARITY = 1
|
|
131
|
-
BRAVYI_KITAEV = 2
|
|
132
|
-
FAST_BRAVYI_KITAEV = 3
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
class LadderOperator(IntEnum):
|
|
136
|
-
PLUS = 0
|
|
137
|
-
MINUS = 1
|
|
138
|
-
|
|
139
|
-
|
|
140
7
|
class Optimizer(IntEnum):
|
|
141
8
|
COBYLA = 1
|
|
142
9
|
SPSA = 2
|
|
@@ -162,9 +29,6 @@ class QSVMFeatureMapEntanglement(IntEnum):
|
|
|
162
29
|
|
|
163
30
|
|
|
164
31
|
__all__ = [
|
|
165
|
-
"Element",
|
|
166
|
-
"FermionMapping",
|
|
167
|
-
"LadderOperator",
|
|
168
32
|
"Optimizer",
|
|
169
33
|
"Pauli",
|
|
170
34
|
"QSVMFeatureMapEntanglement",
|