classiq 0.92.0__py3-none-any.whl → 0.99.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 +11 -19
- classiq/_analyzer_extras/_ipywidgets_async_extension.py +7 -7
- classiq/_analyzer_extras/interactive_hardware.py +19 -12
- classiq/_internals/api_wrapper.py +31 -142
- classiq/_internals/async_utils.py +4 -7
- classiq/_internals/authentication/auth0.py +41 -15
- classiq/_internals/authentication/authorization_code.py +9 -0
- classiq/_internals/authentication/authorization_flow.py +41 -0
- classiq/_internals/authentication/device.py +33 -52
- classiq/_internals/authentication/hybrid_flow.py +19 -0
- classiq/_internals/authentication/password_manager.py +13 -13
- classiq/_internals/authentication/token_manager.py +9 -9
- classiq/_internals/client.py +17 -44
- classiq/_internals/config.py +19 -5
- 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/analyzer/show_interactive_hack.py +1 -1
- classiq/applications/__init__.py +2 -2
- 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 +14 -11
- classiq/applications/qnn/datasets/dataset_base_classes.py +6 -6
- classiq/applications/qnn/datasets/dataset_parity.py +6 -6
- classiq/applications/qnn/gradients/simple_quantum_gradient.py +1 -1
- classiq/applications/qnn/qlayer.py +9 -8
- classiq/applications/qnn/torch_utils.py +5 -6
- classiq/applications/qnn/types.py +2 -1
- classiq/applications/qsp/__init__.py +20 -2
- classiq/applications/qsp/qsp.py +239 -11
- classiq/applications/qsvm/qsvm_data_generation.py +1 -2
- classiq/evaluators/classical_expression.py +0 -4
- classiq/evaluators/parameter_types.py +20 -12
- classiq/evaluators/qmod_annotated_expression.py +31 -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/binary_op_evaluation.py +4 -4
- classiq/evaluators/qmod_node_evaluators/classical_function_evaluation.py +14 -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/__init__.py +0 -3
- classiq/execution/execution_session.py +28 -21
- classiq/execution/jobs.py +26 -26
- classiq/execution/qnn.py +1 -2
- classiq/execution/user_budgets.py +71 -37
- 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/ast_node.py +3 -3
- classiq/interface/backend/backend_preferences.py +26 -50
- classiq/interface/backend/ionq/ionq_quantum_program.py +5 -5
- classiq/interface/backend/provider_config/__init__.py +0 -0
- classiq/interface/backend/provider_config/provider_config.py +8 -0
- classiq/interface/backend/provider_config/providers/__init__.py +0 -0
- classiq/interface/backend/provider_config/providers/alice_bob.py +47 -0
- classiq/interface/backend/provider_config/providers/aqt.py +16 -0
- classiq/interface/backend/provider_config/providers/azure.py +37 -0
- classiq/interface/backend/provider_config/providers/braket.py +39 -0
- classiq/interface/backend/provider_config/providers/ibm.py +26 -0
- classiq/interface/backend/provider_config/providers/ionq.py +22 -0
- classiq/interface/backend/quantum_backend_providers.py +20 -2
- 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 +8 -7
- classiq/interface/exceptions.py +10 -7
- 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 +25 -17
- classiq/interface/executor/vqe_result.py +5 -6
- classiq/interface/generator/ansatz_library.py +6 -8
- classiq/interface/generator/application_apis/__init__.py +0 -3
- 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 +15 -40
- 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 +3 -3
- 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 -40
- 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 -15
- classiq/interface/generator/functions/type_name.py +2 -2
- classiq/interface/generator/generated_circuit_data.py +14 -18
- 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 +9 -9
- 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/quantum_function_call.py +9 -12
- classiq/interface/generator/quantum_program.py +10 -23
- 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/synthesis_execution_parameter.py +1 -3
- classiq/interface/generator/synthesis_metadata/synthesis_duration.py +9 -0
- classiq/interface/generator/synthesis_metadata/synthesis_execution_data.py +2 -3
- classiq/interface/generator/transpiler_basis_gates.py +12 -4
- classiq/interface/generator/types/builtin_enum_declarations.py +0 -145
- 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 -3
- 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 +6 -5
- classiq/interface/interface_version.py +1 -1
- classiq/interface/jobs.py +3 -3
- classiq/interface/model/allocate.py +4 -4
- classiq/interface/model/block.py +6 -2
- classiq/interface/model/bounds.py +3 -3
- classiq/interface/model/classical_if.py +4 -0
- classiq/interface/model/control.py +8 -1
- classiq/interface/model/inplace_binary_operation.py +2 -2
- classiq/interface/model/invert.py +4 -0
- classiq/interface/model/model.py +4 -4
- classiq/interface/model/model_visitor.py +40 -1
- classiq/interface/model/parameter.py +1 -3
- classiq/interface/model/port_declaration.py +1 -1
- classiq/interface/model/power.py +4 -0
- 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 +11 -4
- classiq/interface/model/quantum_type.py +14 -14
- classiq/interface/model/repeat.py +4 -0
- classiq/interface/model/skip_control.py +4 -0
- classiq/interface/model/validation_handle.py +2 -3
- classiq/interface/model/variable_declaration_statement.py +2 -2
- classiq/interface/model/within_apply_operation.py +4 -0
- classiq/interface/pretty_print/expression_to_qmod.py +3 -4
- classiq/interface/server/routes.py +0 -16
- classiq/interface/source_reference.py +3 -4
- classiq/model_expansions/arithmetic.py +11 -7
- classiq/model_expansions/arithmetic_compute_result_attrs.py +30 -27
- 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 +7 -12
- classiq/model_expansions/interpreters/base_interpreter.py +3 -7
- classiq/model_expansions/interpreters/frontend_generative_interpreter.py +2 -1
- classiq/model_expansions/interpreters/generative_interpreter.py +8 -4
- classiq/model_expansions/quantum_operations/allocate.py +4 -4
- classiq/model_expansions/quantum_operations/assignment_result_processor.py +8 -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 +61 -29
- classiq/model_expansions/scope.py +7 -7
- classiq/model_expansions/scope_initialization.py +4 -0
- classiq/model_expansions/visitors/symbolic_param_inference.py +6 -6
- classiq/model_expansions/visitors/uncomputation_signature_inference.py +328 -0
- classiq/model_expansions/visitors/variable_references.py +15 -14
- classiq/open_library/functions/__init__.py +28 -11
- classiq/open_library/functions/amplitude_loading.py +81 -0
- classiq/open_library/functions/discrete_sine_cosine_transform.py +19 -14
- classiq/open_library/functions/grover.py +8 -10
- classiq/open_library/functions/lcu.py +47 -18
- classiq/open_library/functions/modular_exponentiation.py +93 -8
- classiq/open_library/functions/qsvt.py +66 -79
- classiq/open_library/functions/qsvt_temp.py +536 -0
- classiq/open_library/functions/state_preparation.py +130 -27
- classiq/qmod/__init__.py +6 -4
- classiq/qmod/builtins/classical_execution_primitives.py +4 -23
- classiq/qmod/builtins/classical_functions.py +1 -42
- classiq/qmod/builtins/enums.py +15 -153
- classiq/qmod/builtins/functions/__init__.py +9 -18
- classiq/qmod/builtins/functions/allocation.py +25 -4
- classiq/qmod/builtins/functions/arithmetic.py +22 -27
- classiq/qmod/builtins/functions/exponentiation.py +51 -2
- classiq/qmod/builtins/functions/mcx_func.py +7 -0
- classiq/qmod/builtins/functions/standard_gates.py +46 -27
- classiq/qmod/builtins/operations.py +173 -79
- classiq/qmod/builtins/structs.py +24 -91
- classiq/qmod/cfunc.py +3 -2
- classiq/qmod/classical_function.py +2 -1
- classiq/qmod/classical_variable.py +4 -2
- classiq/qmod/cparam.py +2 -8
- classiq/qmod/create_model_function.py +7 -7
- classiq/qmod/declaration_inferrer.py +33 -30
- classiq/qmod/expression_query.py +7 -4
- 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 +124 -19
- classiq/qmod/qmod_constant.py +2 -2
- classiq/qmod/qmod_parameter.py +5 -2
- classiq/qmod/qmod_variable.py +47 -46
- classiq/qmod/quantum_callable.py +18 -13
- classiq/qmod/quantum_expandable.py +33 -26
- classiq/qmod/quantum_function.py +84 -36
- classiq/qmod/semantics/annotation/call_annotation.py +5 -5
- classiq/qmod/semantics/error_manager.py +12 -14
- classiq/qmod/semantics/lambdas.py +1 -2
- classiq/qmod/semantics/validation/types_validation.py +1 -2
- classiq/qmod/symbolic.py +2 -4
- classiq/qmod/symbolic_expr.py +12 -4
- classiq/qmod/utilities.py +13 -20
- classiq/qmod/write_qmod.py +3 -4
- classiq/quantum_program.py +1 -3
- classiq/synthesis.py +11 -7
- {classiq-0.92.0.dist-info → classiq-0.99.0.dist-info}/METADATA +38 -37
- {classiq-0.92.0.dist-info → classiq-0.99.0.dist-info}/RECORD +273 -300
- classiq-0.99.0.dist-info/WHEEL +4 -0
- classiq-0.99.0.dist-info/licenses/LICENSE.txt +27 -0
- 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/applications/qsvm/__init__.py +0 -8
- classiq/applications/qsvm/qsvm.py +0 -11
- classiq/evaluators/qmod_expression_visitors/qmod_expression_bwc.py +0 -129
- classiq/execution/iqcc.py +0 -128
- classiq/interface/applications/qsvm.py +0 -117
- 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/execution/iqcc.py +0 -44
- classiq/interface/generator/application_apis/chemistry_declarations.py +0 -69
- classiq/interface/generator/application_apis/entangler_declarations.py +0 -29
- classiq/interface/generator/application_apis/qsvm_declarations.py +0 -6
- 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/hamiltonian_evolution/qdrift.py +0 -27
- 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/qsvm.py +0 -96
- classiq/interface/generator/state_preparation/__init__.py +0 -14
- classiq/interface/generator/state_preparation/bell_state_preparation.py +0 -27
- classiq/interface/generator/state_preparation/computational_basis_state_preparation.py +0 -28
- classiq/interface/generator/state_preparation/distributions.py +0 -53
- classiq/interface/generator/state_preparation/exponential_state_preparation.py +0 -14
- classiq/interface/generator/state_preparation/ghz_state_preparation.py +0 -14
- classiq/interface/generator/state_preparation/metrics.py +0 -41
- classiq/interface/generator/state_preparation/state_preparation.py +0 -113
- classiq/interface/generator/state_preparation/state_preparation_abc.py +0 -24
- classiq/interface/generator/state_preparation/uniform_distibution_state_preparation.py +0 -13
- classiq/interface/generator/state_preparation/w_state_preparation.py +0 -13
- 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/open_library/functions/lookup_table.py +0 -58
- classiq/qmod/builtins/functions/chemistry.py +0 -123
- classiq/qmod/builtins/functions/qsvm.py +0 -24
- classiq-0.92.0.dist-info/WHEEL +0 -4
classiq/execution/jobs.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import warnings
|
|
2
2
|
import webbrowser
|
|
3
3
|
from datetime import datetime
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
from urllib.parse import urljoin
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
@@ -39,7 +39,7 @@ class ClassiqExecutionResultError(ClassiqError):
|
|
|
39
39
|
|
|
40
40
|
class ExecutionJob:
|
|
41
41
|
_details: ExecutionJobDetails
|
|
42
|
-
_result:
|
|
42
|
+
_result: ResultsCollection | None
|
|
43
43
|
|
|
44
44
|
def __init__(self, details: ExecutionJobDetails) -> None:
|
|
45
45
|
self._details = details
|
|
@@ -50,7 +50,7 @@ class ExecutionJob:
|
|
|
50
50
|
return self._details.id
|
|
51
51
|
|
|
52
52
|
@property
|
|
53
|
-
def name(self) ->
|
|
53
|
+
def name(self) -> str | None:
|
|
54
54
|
return self._details.name
|
|
55
55
|
|
|
56
56
|
@property
|
|
@@ -58,15 +58,15 @@ class ExecutionJob:
|
|
|
58
58
|
return self._details.start_time
|
|
59
59
|
|
|
60
60
|
@property
|
|
61
|
-
def end_time(self) ->
|
|
61
|
+
def end_time(self) -> datetime | None:
|
|
62
62
|
return self._details.end_time
|
|
63
63
|
|
|
64
64
|
@property
|
|
65
|
-
def provider(self) ->
|
|
65
|
+
def provider(self) -> str | None:
|
|
66
66
|
return self._details.provider
|
|
67
67
|
|
|
68
68
|
@property
|
|
69
|
-
def backend_name(self) ->
|
|
69
|
+
def backend_name(self) -> str | None:
|
|
70
70
|
return self._details.backend_name
|
|
71
71
|
|
|
72
72
|
@property
|
|
@@ -74,15 +74,15 @@ class ExecutionJob:
|
|
|
74
74
|
return self._details.status
|
|
75
75
|
|
|
76
76
|
@property
|
|
77
|
-
def num_shots(self) ->
|
|
77
|
+
def num_shots(self) -> int | None:
|
|
78
78
|
return self._details.num_shots
|
|
79
79
|
|
|
80
80
|
@property
|
|
81
|
-
def program_id(self) ->
|
|
81
|
+
def program_id(self) -> str | None:
|
|
82
82
|
return self._details.program_id
|
|
83
83
|
|
|
84
84
|
@property
|
|
85
|
-
def error(self) ->
|
|
85
|
+
def error(self) -> str | None:
|
|
86
86
|
return self._details.error
|
|
87
87
|
|
|
88
88
|
def __repr__(self) -> str:
|
|
@@ -92,7 +92,7 @@ class ExecutionJob:
|
|
|
92
92
|
else:
|
|
93
93
|
return f"{class_name}(name={self.name!r}, id={self.id!r})"
|
|
94
94
|
|
|
95
|
-
def cost(self, *, verbose: bool = False) ->
|
|
95
|
+
def cost(self, *, verbose: bool = False) -> str | JobCost:
|
|
96
96
|
if self._details.cost is None:
|
|
97
97
|
self._details.cost = JobCost()
|
|
98
98
|
if verbose:
|
|
@@ -103,7 +103,7 @@ class ExecutionJob:
|
|
|
103
103
|
async def from_id_async(
|
|
104
104
|
cls,
|
|
105
105
|
id: str,
|
|
106
|
-
_http_client:
|
|
106
|
+
_http_client: httpx.AsyncClient | None = None,
|
|
107
107
|
) -> "ExecutionJob":
|
|
108
108
|
details = await ApiWrapper.call_get_execution_job_details(
|
|
109
109
|
JobID(job_id=id), http_client=_http_client
|
|
@@ -116,7 +116,7 @@ class ExecutionJob:
|
|
|
116
116
|
def from_id(
|
|
117
117
|
cls,
|
|
118
118
|
id: str,
|
|
119
|
-
_http_client:
|
|
119
|
+
_http_client: httpx.AsyncClient | None = None,
|
|
120
120
|
) -> "ExecutionJob":
|
|
121
121
|
return syncify_function(cls.from_id_async)(id, _http_client=_http_client)
|
|
122
122
|
|
|
@@ -126,8 +126,8 @@ class ExecutionJob:
|
|
|
126
126
|
|
|
127
127
|
async def result_async(
|
|
128
128
|
self,
|
|
129
|
-
timeout_sec:
|
|
130
|
-
_http_client:
|
|
129
|
+
timeout_sec: float | None = None,
|
|
130
|
+
_http_client: httpx.AsyncClient | None = None,
|
|
131
131
|
) -> ResultsCollection:
|
|
132
132
|
await self.poll_async(timeout_sec=timeout_sec, _http_client=_http_client)
|
|
133
133
|
|
|
@@ -151,7 +151,7 @@ class ExecutionJob:
|
|
|
151
151
|
return self.result(*args, **kwargs)[0].value
|
|
152
152
|
|
|
153
153
|
def get_sample_result(
|
|
154
|
-
self, _http_client:
|
|
154
|
+
self, _http_client: httpx.AsyncClient | None = None
|
|
155
155
|
) -> ExecutionDetails:
|
|
156
156
|
"""
|
|
157
157
|
Returns the job's result as a single sample result after validation. If the result is not yet available, waits for it.
|
|
@@ -177,7 +177,7 @@ class ExecutionJob:
|
|
|
177
177
|
return result
|
|
178
178
|
|
|
179
179
|
def get_batch_sample_result(
|
|
180
|
-
self, _http_client:
|
|
180
|
+
self, _http_client: httpx.AsyncClient | None = None
|
|
181
181
|
) -> list[ExecutionDetails]:
|
|
182
182
|
"""
|
|
183
183
|
Returns the job's result as a single batch_sample result after validation. If the result is not yet available, waits for it.
|
|
@@ -209,7 +209,7 @@ class ExecutionJob:
|
|
|
209
209
|
return result_list
|
|
210
210
|
|
|
211
211
|
def get_estimate_result(
|
|
212
|
-
self, _http_client:
|
|
212
|
+
self, _http_client: httpx.AsyncClient | None = None
|
|
213
213
|
) -> EstimationResult:
|
|
214
214
|
"""
|
|
215
215
|
Returns the job's result as a single estimate result after validation. If the result is not yet available, waits for it.
|
|
@@ -233,7 +233,7 @@ class ExecutionJob:
|
|
|
233
233
|
raise ClassiqExecutionResultError("estimate")
|
|
234
234
|
|
|
235
235
|
def get_batch_estimate_result(
|
|
236
|
-
self, _http_client:
|
|
236
|
+
self, _http_client: httpx.AsyncClient | None = None
|
|
237
237
|
) -> list[EstimationResult]:
|
|
238
238
|
"""
|
|
239
239
|
Returns the job's result as a single batch_estimate result after validation. If the result is not yet available, waits for it.
|
|
@@ -258,7 +258,7 @@ class ExecutionJob:
|
|
|
258
258
|
raise ClassiqExecutionResultError("batch_estimate")
|
|
259
259
|
|
|
260
260
|
def get_minimization_result(
|
|
261
|
-
self, _http_client:
|
|
261
|
+
self, _http_client: httpx.AsyncClient | None = None
|
|
262
262
|
) -> TaggedMinimizeResult:
|
|
263
263
|
"""
|
|
264
264
|
Returns the job's result as a single minimization result after validation. If the result is not yet available, waits for it.
|
|
@@ -281,8 +281,8 @@ class ExecutionJob:
|
|
|
281
281
|
|
|
282
282
|
async def poll_async(
|
|
283
283
|
self,
|
|
284
|
-
timeout_sec:
|
|
285
|
-
_http_client:
|
|
284
|
+
timeout_sec: float | None = None,
|
|
285
|
+
_http_client: httpx.AsyncClient | None = None,
|
|
286
286
|
) -> None:
|
|
287
287
|
if not self.status.is_final():
|
|
288
288
|
await self._poll_job(timeout_sec=timeout_sec, _http_client=_http_client)
|
|
@@ -291,10 +291,10 @@ class ExecutionJob:
|
|
|
291
291
|
|
|
292
292
|
async def _poll_job(
|
|
293
293
|
self,
|
|
294
|
-
timeout_sec:
|
|
295
|
-
_http_client:
|
|
294
|
+
timeout_sec: float | None = None,
|
|
295
|
+
_http_client: httpx.AsyncClient | None = None,
|
|
296
296
|
) -> None:
|
|
297
|
-
def response_parser(json_response: JSONObject) ->
|
|
297
|
+
def response_parser(json_response: JSONObject) -> bool | None:
|
|
298
298
|
self._details = ExecutionJobDetails.model_validate(json_response)
|
|
299
299
|
if self.status.is_final():
|
|
300
300
|
return True
|
|
@@ -313,7 +313,7 @@ class ExecutionJob:
|
|
|
313
313
|
async def rename_async(
|
|
314
314
|
self,
|
|
315
315
|
name: str,
|
|
316
|
-
_http_client:
|
|
316
|
+
_http_client: httpx.AsyncClient | None = None,
|
|
317
317
|
) -> None:
|
|
318
318
|
self._details = await ApiWrapper.call_patch_execution_job(
|
|
319
319
|
self._job_id,
|
|
@@ -325,7 +325,7 @@ class ExecutionJob:
|
|
|
325
325
|
|
|
326
326
|
async def cancel_async(
|
|
327
327
|
self,
|
|
328
|
-
_http_client:
|
|
328
|
+
_http_client: httpx.AsyncClient | None = None,
|
|
329
329
|
) -> None:
|
|
330
330
|
"""
|
|
331
331
|
Cancels the execution job. This implies the cancellation of any ongoing jobs
|
classiq/execution/qnn.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import functools
|
|
2
|
-
from typing import Optional
|
|
3
2
|
|
|
4
3
|
import more_itertools
|
|
5
4
|
|
|
@@ -60,7 +59,7 @@ def _execute_qnn_sample(
|
|
|
60
59
|
def execute_qnn(
|
|
61
60
|
quantum_program: QuantumProgram,
|
|
62
61
|
arguments: MultipleArguments,
|
|
63
|
-
observable:
|
|
62
|
+
observable: PauliOperator | None = None,
|
|
64
63
|
) -> ResultsCollection:
|
|
65
64
|
with ExecutionSession(quantum_program) as session:
|
|
66
65
|
if observable:
|
|
@@ -1,77 +1,111 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
from classiq.interface.backend.quantum_backend_providers import (
|
|
2
|
+
PROVIDER_NAME_MAPPER,
|
|
3
|
+
ProviderVendor,
|
|
4
|
+
)
|
|
4
5
|
from classiq.interface.executor.user_budget import UserBudgets
|
|
5
6
|
|
|
6
7
|
from classiq._internals.api_wrapper import ApiWrapper
|
|
7
8
|
from classiq._internals.async_utils import syncify_function
|
|
8
9
|
|
|
9
|
-
PROVIDER_MAPPER = {
|
|
10
|
-
ProviderVendor.IONQ: "IONQ",
|
|
11
|
-
ProviderVendor.IBM_QUANTUM: "IBM_CLOUD",
|
|
12
|
-
ProviderVendor.AZURE_QUANTUM: "AZURE",
|
|
13
|
-
ProviderVendor.AMAZON_BRAKET: "AMAZON",
|
|
14
|
-
ProviderVendor.GOOGLE: "GOOGLE",
|
|
15
|
-
ProviderVendor.ALICE_AND_BOB: "ALICE_AND_BOB",
|
|
16
|
-
ProviderVendor.OQC: "OQC",
|
|
17
|
-
ProviderVendor.INTEL: "INTEL",
|
|
18
|
-
ProviderVendor.AQT: "AQT",
|
|
19
|
-
ProviderVendor.IQCC: "IQCC",
|
|
20
|
-
ProviderVendor.CLASSIQ: "CLASSIQ",
|
|
21
|
-
}
|
|
22
|
-
|
|
23
10
|
|
|
24
11
|
async def get_budget_async(
|
|
25
|
-
|
|
12
|
+
provider: ProviderVendor | None = None,
|
|
26
13
|
) -> UserBudgets:
|
|
27
14
|
|
|
28
15
|
budgets_list = await ApiWrapper().call_get_all_budgets()
|
|
29
|
-
if
|
|
30
|
-
|
|
16
|
+
if provider:
|
|
17
|
+
_provider = PROVIDER_NAME_MAPPER.get(provider, None)
|
|
31
18
|
budgets_list = [
|
|
32
|
-
budget for budget in budgets_list if budget.provider ==
|
|
19
|
+
budget for budget in budgets_list if budget.provider == _provider
|
|
33
20
|
]
|
|
34
21
|
|
|
35
22
|
return UserBudgets(budgets=budgets_list)
|
|
36
23
|
|
|
37
24
|
|
|
38
|
-
get_budget
|
|
25
|
+
def get_budget(
|
|
26
|
+
provider: ProviderVendor | None = None,
|
|
27
|
+
) -> UserBudgets:
|
|
28
|
+
"""
|
|
29
|
+
Retrieve the user's budget information for quantum computing resources.
|
|
30
|
+
|
|
31
|
+
Args:
|
|
32
|
+
provider:
|
|
33
|
+
(Optional) The quantum backend provider to filter budgets by.
|
|
34
|
+
If not provided, budgets for all providers will be returned.
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
UserBudgets: An object containing the user's budget information.
|
|
38
|
+
"""
|
|
39
|
+
return syncify_function(get_budget_async)(provider)
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
async def set_budget_limit_async(
|
|
42
|
-
|
|
43
|
+
provider: ProviderVendor,
|
|
43
44
|
limit: float,
|
|
44
45
|
) -> UserBudgets:
|
|
45
|
-
|
|
46
|
-
if not
|
|
47
|
-
raise ValueError(f"Unsupported provider: {
|
|
46
|
+
_provider = PROVIDER_NAME_MAPPER.get(provider, None)
|
|
47
|
+
if not _provider:
|
|
48
|
+
raise ValueError(f"Unsupported provider: {provider}")
|
|
48
49
|
|
|
49
|
-
budget =
|
|
50
|
+
budget = await get_budget_async(provider)
|
|
50
51
|
if budget is None:
|
|
51
|
-
raise ValueError(f"No budget found for provider: {
|
|
52
|
+
raise ValueError(f"No budget found for provider: {provider}")
|
|
52
53
|
|
|
53
54
|
if limit <= 0:
|
|
54
55
|
raise ValueError("Budget limit must be greater than zero.")
|
|
55
56
|
|
|
56
57
|
if limit > budget.budgets[0].available_budget:
|
|
57
58
|
print( # noqa: T201
|
|
58
|
-
f"Budget limit {limit} exceeds available budget {budget.budgets[0].available_budget} for provider {
|
|
59
|
+
f"Budget limit {limit} exceeds available budget {budget.budgets[0].available_budget} for provider {provider}.\n"
|
|
59
60
|
"Setting budget limit to the maximum available budget."
|
|
60
61
|
)
|
|
61
|
-
budgets_list = await ApiWrapper().call_set_budget_limit(
|
|
62
|
+
budgets_list = await ApiWrapper().call_set_budget_limit(_provider, limit)
|
|
62
63
|
return UserBudgets(budgets=[budgets_list])
|
|
63
64
|
|
|
64
65
|
|
|
65
|
-
set_budget_limit
|
|
66
|
+
def set_budget_limit(
|
|
67
|
+
provider: ProviderVendor,
|
|
68
|
+
limit: float,
|
|
69
|
+
) -> UserBudgets:
|
|
70
|
+
"""
|
|
71
|
+
Set a budget limit for a specific quantum backend provider.
|
|
66
72
|
|
|
73
|
+
Args:
|
|
74
|
+
provider:
|
|
75
|
+
The quantum backend provider for which to set the budget limit.
|
|
76
|
+
limit:
|
|
77
|
+
The budget limit to set. Must be greater than zero and not exceed the available budget.
|
|
67
78
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if not provider:
|
|
71
|
-
raise ValueError(f"Unsupported provider: {provider_vendor}")
|
|
79
|
+
Returns:
|
|
80
|
+
UserBudgets: An object containing the updated budget information.
|
|
72
81
|
|
|
73
|
-
|
|
82
|
+
Raises:
|
|
83
|
+
ValueError: If the provider is unsupported, no budget is found, or the limit is invalid.
|
|
84
|
+
"""
|
|
85
|
+
return syncify_function(set_budget_limit_async)(provider, limit)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
async def clear_budget_limit_async(provider: ProviderVendor) -> UserBudgets:
|
|
89
|
+
_provider = PROVIDER_NAME_MAPPER.get(provider, None)
|
|
90
|
+
if not _provider:
|
|
91
|
+
raise ValueError(f"Unsupported provider: {provider}")
|
|
92
|
+
|
|
93
|
+
budgets_list = await ApiWrapper().call_clear_budget_limit(_provider)
|
|
74
94
|
return UserBudgets(budgets=[budgets_list])
|
|
75
95
|
|
|
76
96
|
|
|
77
|
-
clear_budget_limit
|
|
97
|
+
def clear_budget_limit(provider: ProviderVendor) -> UserBudgets:
|
|
98
|
+
"""
|
|
99
|
+
Clear the budget limit for a specific quantum backend provider.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
provider:
|
|
103
|
+
The quantum backend provider for which to clear the budget limit.
|
|
104
|
+
|
|
105
|
+
Returns:
|
|
106
|
+
UserBudgets: An object containing the updated budget information.
|
|
107
|
+
|
|
108
|
+
Raises:
|
|
109
|
+
ValueError: If the provider is unsupported.
|
|
110
|
+
"""
|
|
111
|
+
return syncify_function(clear_budget_limit_async)(provider)
|
classiq/executor.py
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"""Executor module, implementing facilities for executing quantum programs using Classiq platform."""
|
|
2
2
|
|
|
3
|
-
from typing import Union
|
|
4
|
-
|
|
5
|
-
from typing_extensions import TypeAlias
|
|
3
|
+
from typing import TypeAlias, Union
|
|
6
4
|
|
|
7
5
|
from classiq.interface.backend.backend_preferences import BackendPreferencesTypes
|
|
8
6
|
from classiq.interface.executor.estimation import OperatorsEstimation
|
classiq/interface/_version.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Annotated
|
|
1
|
+
from typing import Annotated
|
|
2
2
|
|
|
3
3
|
import pydantic
|
|
4
4
|
from pydantic import Field, StringConstraints
|
|
@@ -26,7 +26,7 @@ class AnalysisParams(pydantic.BaseModel):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class HardwareListParams(pydantic.BaseModel):
|
|
29
|
-
devices:
|
|
29
|
+
devices: list[PydanticNonEmptyString] | None = pydantic.Field(
|
|
30
30
|
default=None, description="Devices"
|
|
31
31
|
)
|
|
32
32
|
providers: list[Provider]
|
|
@@ -35,7 +35,7 @@ class HardwareListParams(pydantic.BaseModel):
|
|
|
35
35
|
@pydantic.field_validator("providers")
|
|
36
36
|
@classmethod
|
|
37
37
|
def set_default_providers(
|
|
38
|
-
cls, providers:
|
|
38
|
+
cls, providers: list[AnalyzerProviderVendor] | None
|
|
39
39
|
) -> list[AnalyzerProviderVendor]:
|
|
40
40
|
if providers is None:
|
|
41
41
|
providers = list(AnalyzerProviderVendor)
|
|
@@ -67,7 +67,7 @@ class LatexParams(AnalysisParams):
|
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
class AnalysisHardwareTranspilationParams(pydantic.BaseModel):
|
|
70
|
-
hardware_data:
|
|
70
|
+
hardware_data: SynthesisHardwareData | None = None
|
|
71
71
|
random_seed: int
|
|
72
72
|
transpilation_option: TranspilationOption
|
|
73
73
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any
|
|
1
|
+
from typing import Any
|
|
2
2
|
|
|
3
3
|
import pydantic
|
|
4
4
|
|
|
@@ -42,7 +42,7 @@ class CytoScapeNode(pydantic.BaseModel):
|
|
|
42
42
|
default=...,
|
|
43
43
|
description="Data of the Node, such as label, and color, can be of free form",
|
|
44
44
|
)
|
|
45
|
-
position:
|
|
45
|
+
position: CytoScapePosition | None = pydantic.Field(
|
|
46
46
|
default=..., description="Position of the Node to be rendered in Cytocape"
|
|
47
47
|
)
|
|
48
48
|
|
|
@@ -66,7 +66,7 @@ class ConnectivityErrors(StrEnum):
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
class HardwareConnectivityGraphResult(VersionedModel):
|
|
69
|
-
graph:
|
|
69
|
+
graph: CytoScapeGraph | None = pydantic.Field(
|
|
70
70
|
default=...,
|
|
71
71
|
description="The Cytoscape graph in the desired Structure for the FE",
|
|
72
72
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Annotated, Literal,
|
|
1
|
+
from typing import Annotated, Literal, Union
|
|
2
2
|
|
|
3
3
|
import pydantic
|
|
4
4
|
from pydantic import Field
|
|
@@ -125,15 +125,15 @@ class HardwareComparisonDataColumns(pydantic.BaseModel):
|
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
class AvailableHardware(pydantic.BaseModel):
|
|
128
|
-
ibm_quantum:
|
|
128
|
+
ibm_quantum: dict[PydanticNonEmptyString, bool] | None = pydantic.Field(
|
|
129
129
|
default=None,
|
|
130
130
|
description="available IBM Quantum devices with boolean indicates if a given device has enough qubits.",
|
|
131
131
|
)
|
|
132
|
-
azure_quantum:
|
|
132
|
+
azure_quantum: dict[PydanticNonEmptyString, bool] | None = pydantic.Field(
|
|
133
133
|
default=None,
|
|
134
134
|
description="available Azure Quantum devices with boolean indicates if a given device has enough qubits.",
|
|
135
135
|
)
|
|
136
|
-
amazon_braket:
|
|
136
|
+
amazon_braket: dict[PydanticNonEmptyString, bool] | None = pydantic.Field(
|
|
137
137
|
default=None,
|
|
138
138
|
description="available Amazon Braket devices with boolean indicates if a given device has enough qubits.",
|
|
139
139
|
)
|
classiq/interface/ast_node.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any,
|
|
1
|
+
from typing import Any, TypeVar
|
|
2
2
|
from uuid import UUID
|
|
3
3
|
|
|
4
4
|
import pydantic
|
|
@@ -13,8 +13,8 @@ ASTNodeType = TypeVar("ASTNodeType", bound="ASTNode")
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class ASTNode(HashablePydanticBaseModel):
|
|
16
|
-
source_ref:
|
|
17
|
-
back_ref:
|
|
16
|
+
source_ref: SourceReference | None = pydantic.Field(default=None)
|
|
17
|
+
back_ref: UUID | None = pydantic.Field(default=None)
|
|
18
18
|
|
|
19
19
|
def _as_back_ref(self: Self) -> Self:
|
|
20
20
|
return self
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import warnings
|
|
4
4
|
from collections.abc import Iterable
|
|
5
|
-
from typing import Any,
|
|
5
|
+
from typing import Any, Union
|
|
6
6
|
|
|
7
7
|
import pydantic
|
|
8
8
|
from pydantic import BaseModel
|
|
@@ -103,19 +103,19 @@ class AliceBobBackendPreferences(BackendPreferences):
|
|
|
103
103
|
backend_service_provider: ProviderTypeVendor.ALICE_BOB = pydantic.Field(
|
|
104
104
|
default=ProviderVendor.ALICE_AND_BOB
|
|
105
105
|
)
|
|
106
|
-
distance:
|
|
106
|
+
distance: int | None = pydantic.Field(
|
|
107
107
|
default=None, description="Repetition code distance"
|
|
108
108
|
)
|
|
109
|
-
kappa_1:
|
|
109
|
+
kappa_1: float | None = pydantic.Field(
|
|
110
110
|
default=None, description="One-photon dissipation rate (Hz)"
|
|
111
111
|
)
|
|
112
|
-
kappa_2:
|
|
112
|
+
kappa_2: float | None = pydantic.Field(
|
|
113
113
|
default=None, description="Two-photon dissipation rate (Hz)"
|
|
114
114
|
)
|
|
115
|
-
average_nb_photons:
|
|
115
|
+
average_nb_photons: float | None = pydantic.Field(
|
|
116
116
|
default=None, description="Average number of photons"
|
|
117
117
|
)
|
|
118
|
-
api_key:
|
|
118
|
+
api_key: pydantic_backend.PydanticAliceBobApiKeyType | None = pydantic.Field(
|
|
119
119
|
default=None, description="AliceBob API key"
|
|
120
120
|
)
|
|
121
121
|
|
|
@@ -131,7 +131,7 @@ class AliceBobBackendPreferences(BackendPreferences):
|
|
|
131
131
|
|
|
132
132
|
@pydantic.field_validator("api_key", mode="after")
|
|
133
133
|
@classmethod
|
|
134
|
-
def _validate_api_key(cls, api_key:
|
|
134
|
+
def _validate_api_key(cls, api_key: str | None) -> str | None:
|
|
135
135
|
if api_key is not None:
|
|
136
136
|
warnings.warn(
|
|
137
137
|
"API key is no longer required for Alice&Bob backends.",
|
|
@@ -172,10 +172,11 @@ class AwsBackendPreferences(BackendPreferences):
|
|
|
172
172
|
backend_service_provider (ProviderTypeVendor.AMAZON_BRAKET):
|
|
173
173
|
The service provider for the backend, which is Amazon Braket.
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
The
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
aws_access_key_id (str):
|
|
176
|
+
The access key id of AWS user with full braket access
|
|
177
|
+
|
|
178
|
+
aws_secret_access_key (str):
|
|
179
|
+
The secret key assigned to the access key id for the user with full braket access.
|
|
179
180
|
|
|
180
181
|
s3_bucket_name (str):
|
|
181
182
|
The name of the S3 bucket where results and other related data will be stored.
|
|
@@ -193,14 +194,18 @@ class AwsBackendPreferences(BackendPreferences):
|
|
|
193
194
|
backend_service_provider: ProviderTypeVendor.AMAZON_BRAKET = pydantic.Field(
|
|
194
195
|
default=ProviderVendor.AMAZON_BRAKET
|
|
195
196
|
)
|
|
196
|
-
|
|
197
|
+
aws_access_key_id: str | None = pydantic.Field(
|
|
198
|
+
default=None,
|
|
199
|
+
description="Key id assigned to user with credentials to access Braket service",
|
|
200
|
+
)
|
|
201
|
+
aws_secret_access_key: str | None = pydantic.Field(
|
|
197
202
|
default=None,
|
|
198
|
-
description="
|
|
203
|
+
description="Secret access key assigned to user with credentials to access Braket service",
|
|
199
204
|
)
|
|
200
|
-
s3_bucket_name:
|
|
205
|
+
s3_bucket_name: str | None = pydantic.Field(
|
|
201
206
|
default=None, description="S3 Bucket Name"
|
|
202
207
|
)
|
|
203
|
-
s3_folder:
|
|
208
|
+
s3_folder: str | None = pydantic.Field(
|
|
204
209
|
default=None, description="S3 Folder Path Within The S3 Bucket"
|
|
205
210
|
)
|
|
206
211
|
run_through_classiq: bool = pydantic.Field(
|
|
@@ -229,15 +234,15 @@ class IBMBackendPreferences(BackendPreferences):
|
|
|
229
234
|
backend_service_provider: ProviderTypeVendor.IBM_CLOUD = pydantic.Field(
|
|
230
235
|
default=ProviderVendor.IBM_QUANTUM
|
|
231
236
|
)
|
|
232
|
-
access_token:
|
|
237
|
+
access_token: str | None = pydantic.Field(
|
|
233
238
|
default=None,
|
|
234
239
|
description="IBM Cloud access token to be used"
|
|
235
240
|
" with IBM Quantum hosted backends",
|
|
236
241
|
)
|
|
237
|
-
channel:
|
|
242
|
+
channel: str | None = pydantic.Field(
|
|
238
243
|
default=None, description="Channel to use for IBM cloud backends."
|
|
239
244
|
)
|
|
240
|
-
instance_crn:
|
|
245
|
+
instance_crn: str | None = pydantic.Field(
|
|
241
246
|
default=None, description="IBM Cloud instance CRN."
|
|
242
247
|
)
|
|
243
248
|
run_through_classiq: bool = pydantic.Field(
|
|
@@ -303,12 +308,12 @@ class AzureBackendPreferences(BackendPreferences):
|
|
|
303
308
|
default="East US", description="Azure personal resource region"
|
|
304
309
|
)
|
|
305
310
|
|
|
306
|
-
credentials:
|
|
311
|
+
credentials: AzureCredential | None = pydantic.Field(
|
|
307
312
|
default=None,
|
|
308
313
|
description="The service principal credential to access personal quantum workspace",
|
|
309
314
|
)
|
|
310
315
|
|
|
311
|
-
ionq_error_mitigation_flag:
|
|
316
|
+
ionq_error_mitigation_flag: bool | None = pydantic.Field(
|
|
312
317
|
default=False,
|
|
313
318
|
description="Error mitigation configuration upon running on IonQ through Azure.",
|
|
314
319
|
)
|
|
@@ -343,7 +348,7 @@ class IonqBackendPreferences(BackendPreferences):
|
|
|
343
348
|
backend_service_provider: ProviderTypeVendor.IONQ = pydantic.Field(
|
|
344
349
|
default=ProviderVendor.IONQ
|
|
345
350
|
)
|
|
346
|
-
api_key:
|
|
351
|
+
api_key: pydantic_backend.PydanticIonQApiKeyType | None = pydantic.Field(
|
|
347
352
|
default=None, description="IonQ API key"
|
|
348
353
|
)
|
|
349
354
|
error_mitigation: bool = pydantic.Field(
|
|
@@ -428,33 +433,6 @@ class AQTBackendPreferences(BackendPreferences):
|
|
|
428
433
|
workspace: str = pydantic.Field(description="AQT workspace")
|
|
429
434
|
|
|
430
435
|
|
|
431
|
-
class IQCCBackendPreferences(BackendPreferences):
|
|
432
|
-
"""
|
|
433
|
-
NOTE: This is a work in progress and is subject to change.
|
|
434
|
-
|
|
435
|
-
Represents the backend preferences specific to IQCC (Israeli Quantum Computing
|
|
436
|
-
Center).
|
|
437
|
-
|
|
438
|
-
Attributes:
|
|
439
|
-
auth_token: The authorization token generated by calling `generate_iqcc_token`.
|
|
440
|
-
target_id: The target ID of the login node.
|
|
441
|
-
target_scope_id: The scope ID of the specified target.
|
|
442
|
-
ssh_user_name: The user name to use when connecting to the SSH server on the login node.
|
|
443
|
-
ssh_key: The private key to use when connecting to the SSH server on the login node.
|
|
444
|
-
slurm_account: The account to use when initiating SLURM jobs.
|
|
445
|
-
"""
|
|
446
|
-
|
|
447
|
-
backend_service_provider: ProviderTypeVendor.IQCC = pydantic.Field(
|
|
448
|
-
default=ProviderVendor.IQCC
|
|
449
|
-
)
|
|
450
|
-
auth_token: str
|
|
451
|
-
target_id: str
|
|
452
|
-
target_scope_id: str
|
|
453
|
-
ssh_user_name: str
|
|
454
|
-
ssh_key: str
|
|
455
|
-
slurm_account: str
|
|
456
|
-
|
|
457
|
-
|
|
458
436
|
class CINECABackendPreferences(BackendPreferences):
|
|
459
437
|
"""
|
|
460
438
|
Represents the backend preferences specific to CINECA.
|
|
@@ -507,7 +485,6 @@ BackendPreferencesTypes = Union[
|
|
|
507
485
|
OQCBackendPreferences,
|
|
508
486
|
IntelBackendPreferences,
|
|
509
487
|
AQTBackendPreferences,
|
|
510
|
-
IQCCBackendPreferences,
|
|
511
488
|
CINECABackendPreferences,
|
|
512
489
|
]
|
|
513
490
|
|
|
@@ -525,7 +502,6 @@ __all__ = [
|
|
|
525
502
|
"ClassiqSimulatorBackendNames",
|
|
526
503
|
"GCPBackendPreferences",
|
|
527
504
|
"IBMBackendPreferences",
|
|
528
|
-
"IQCCBackendPreferences",
|
|
529
505
|
"IntelBackendNames",
|
|
530
506
|
"IntelBackendPreferences",
|
|
531
507
|
"IonqBackendNames",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import TYPE_CHECKING, Annotated
|
|
3
|
+
from typing import TYPE_CHECKING, Annotated
|
|
4
4
|
|
|
5
5
|
from pydantic import BaseModel, ConfigDict, Field
|
|
6
6
|
|
|
@@ -22,10 +22,10 @@ else:
|
|
|
22
22
|
|
|
23
23
|
class Gate(BaseModel):
|
|
24
24
|
gate: PydanticGateName
|
|
25
|
-
target:
|
|
26
|
-
control:
|
|
27
|
-
targets:
|
|
28
|
-
controls:
|
|
25
|
+
target: int | None = None
|
|
26
|
+
control: int | None = None
|
|
27
|
+
targets: list[int] | None = None
|
|
28
|
+
controls: list[int] | None = None
|
|
29
29
|
model_config = ConfigDict(extra="allow")
|
|
30
30
|
|
|
31
31
|
|
|
File without changes
|