classiq 0.93.0__py3-none-any.whl → 0.100.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.
Files changed (318) hide show
  1. classiq/__init__.py +11 -19
  2. classiq/_analyzer_extras/_ipywidgets_async_extension.py +7 -7
  3. classiq/_analyzer_extras/interactive_hardware.py +19 -12
  4. classiq/_internals/api_wrapper.py +31 -142
  5. classiq/_internals/async_utils.py +4 -7
  6. classiq/_internals/authentication/auth0.py +41 -15
  7. classiq/_internals/authentication/authorization_code.py +9 -0
  8. classiq/_internals/authentication/authorization_flow.py +41 -0
  9. classiq/_internals/authentication/device.py +33 -52
  10. classiq/_internals/authentication/hybrid_flow.py +19 -0
  11. classiq/_internals/authentication/password_manager.py +13 -13
  12. classiq/_internals/authentication/token_manager.py +9 -9
  13. classiq/_internals/client.py +17 -44
  14. classiq/_internals/config.py +19 -5
  15. classiq/_internals/help.py +1 -2
  16. classiq/_internals/host_checker.py +3 -3
  17. classiq/_internals/jobs.py +14 -14
  18. classiq/_internals/type_validation.py +3 -3
  19. classiq/analyzer/analyzer.py +18 -18
  20. classiq/analyzer/rb.py +17 -8
  21. classiq/analyzer/show_interactive_hack.py +1 -1
  22. classiq/applications/__init__.py +2 -2
  23. classiq/applications/chemistry/__init__.py +0 -30
  24. classiq/applications/chemistry/op_utils.py +4 -4
  25. classiq/applications/chemistry/problems.py +3 -3
  26. classiq/applications/chemistry/ucc.py +1 -2
  27. classiq/applications/chemistry/z2_symmetries.py +4 -4
  28. classiq/applications/combinatorial_helpers/allowed_constraints.py +1 -3
  29. classiq/applications/combinatorial_helpers/arithmetic/arithmetic_expression.py +2 -1
  30. classiq/applications/combinatorial_helpers/combinatorial_problem_utils.py +2 -2
  31. classiq/applications/combinatorial_helpers/encoding_mapping.py +2 -3
  32. classiq/applications/combinatorial_helpers/encoding_utils.py +2 -2
  33. classiq/applications/combinatorial_helpers/optimization_model.py +3 -4
  34. classiq/applications/combinatorial_helpers/pauli_helpers/pauli_sparsing.py +2 -2
  35. classiq/applications/combinatorial_helpers/pyomo_utils.py +8 -8
  36. classiq/applications/combinatorial_helpers/sympy_utils.py +1 -3
  37. classiq/applications/combinatorial_helpers/transformations/encoding.py +3 -3
  38. classiq/applications/combinatorial_helpers/transformations/fixed_variables.py +1 -2
  39. classiq/applications/combinatorial_optimization/combinatorial_optimization_config.py +2 -3
  40. classiq/applications/combinatorial_optimization/combinatorial_optimization_model_constructor.py +4 -6
  41. classiq/applications/combinatorial_optimization/combinatorial_problem.py +15 -10
  42. classiq/applications/hamiltonian/pauli_decomposition.py +6 -4
  43. classiq/applications/iqae/iqae.py +14 -11
  44. classiq/applications/qnn/datasets/dataset_base_classes.py +6 -6
  45. classiq/applications/qnn/datasets/dataset_parity.py +6 -6
  46. classiq/applications/qnn/gradients/simple_quantum_gradient.py +1 -1
  47. classiq/applications/qnn/qlayer.py +9 -8
  48. classiq/applications/qnn/torch_utils.py +5 -6
  49. classiq/applications/qnn/types.py +2 -1
  50. classiq/applications/qsp/__init__.py +20 -2
  51. classiq/applications/qsp/qsp.py +238 -10
  52. classiq/applications/qsvm/qsvm_data_generation.py +1 -2
  53. classiq/evaluators/classical_expression.py +0 -4
  54. classiq/evaluators/parameter_types.py +10 -8
  55. classiq/evaluators/qmod_annotated_expression.py +31 -26
  56. classiq/evaluators/qmod_expression_visitors/qmod_expression_evaluator.py +14 -14
  57. classiq/evaluators/qmod_expression_visitors/qmod_expression_simplifier.py +2 -1
  58. classiq/evaluators/qmod_expression_visitors/sympy_wrappers.py +8 -8
  59. classiq/evaluators/qmod_node_evaluators/binary_op_evaluation.py +4 -4
  60. classiq/evaluators/qmod_node_evaluators/classical_function_evaluation.py +14 -4
  61. classiq/evaluators/qmod_node_evaluators/list_evaluation.py +2 -2
  62. classiq/evaluators/qmod_node_evaluators/numeric_attrs_utils.py +3 -3
  63. classiq/evaluators/qmod_node_evaluators/subscript_evaluation.py +9 -9
  64. classiq/evaluators/qmod_node_evaluators/utils.py +6 -6
  65. classiq/evaluators/qmod_type_inference/classical_type_inference.py +9 -10
  66. classiq/evaluators/qmod_type_inference/quantum_type_inference.py +5 -5
  67. classiq/execution/__init__.py +0 -3
  68. classiq/execution/execution_session.py +28 -21
  69. classiq/execution/jobs.py +26 -26
  70. classiq/execution/qnn.py +1 -2
  71. classiq/execution/user_budgets.py +71 -37
  72. classiq/executor.py +1 -3
  73. classiq/interface/_version.py +1 -1
  74. classiq/interface/analyzer/analysis_params.py +4 -4
  75. classiq/interface/analyzer/cytoscape_graph.py +3 -3
  76. classiq/interface/analyzer/result.py +4 -4
  77. classiq/interface/ast_node.py +3 -3
  78. classiq/interface/backend/backend_preferences.py +26 -50
  79. classiq/interface/backend/ionq/ionq_quantum_program.py +5 -5
  80. classiq/interface/backend/provider_config/__init__.py +0 -0
  81. classiq/interface/backend/provider_config/provider_config.py +8 -0
  82. classiq/interface/backend/provider_config/providers/__init__.py +0 -0
  83. classiq/interface/backend/provider_config/providers/alice_bob.py +47 -0
  84. classiq/interface/backend/provider_config/providers/aqt.py +16 -0
  85. classiq/interface/backend/provider_config/providers/azure.py +37 -0
  86. classiq/interface/backend/provider_config/providers/braket.py +39 -0
  87. classiq/interface/backend/provider_config/providers/ibm.py +26 -0
  88. classiq/interface/backend/provider_config/providers/ionq.py +22 -0
  89. classiq/interface/backend/quantum_backend_providers.py +20 -2
  90. classiq/interface/chemistry/ansatz_library.py +3 -5
  91. classiq/interface/chemistry/operator.py +3 -3
  92. classiq/interface/combinatorial_optimization/examples/knapsack.py +2 -4
  93. classiq/interface/combinatorial_optimization/examples/tsp_digraph.py +1 -2
  94. classiq/interface/compression_utils.py +2 -3
  95. classiq/interface/debug_info/debug_info.py +8 -7
  96. classiq/interface/exceptions.py +6 -7
  97. classiq/interface/execution/primitives.py +6 -6
  98. classiq/interface/executor/estimate_cost.py +1 -1
  99. classiq/interface/executor/execution_preferences.py +3 -5
  100. classiq/interface/executor/execution_request.py +10 -10
  101. classiq/interface/executor/execution_result.py +1 -2
  102. classiq/interface/executor/quantum_code.py +8 -8
  103. classiq/interface/executor/result.py +28 -18
  104. classiq/interface/executor/user_budget.py +21 -17
  105. classiq/interface/executor/vqe_result.py +5 -6
  106. classiq/interface/generator/ansatz_library.py +6 -8
  107. classiq/interface/generator/application_apis/__init__.py +0 -3
  108. classiq/interface/generator/arith/arithmetic.py +2 -2
  109. classiq/interface/generator/arith/arithmetic_arg_type_validator.py +2 -3
  110. classiq/interface/generator/arith/arithmetic_expression_abc.py +4 -5
  111. classiq/interface/generator/arith/arithmetic_expression_parser.py +11 -4
  112. classiq/interface/generator/arith/arithmetic_expression_validator.py +12 -15
  113. classiq/interface/generator/arith/arithmetic_operations.py +4 -6
  114. classiq/interface/generator/arith/arithmetic_param_getters.py +70 -107
  115. classiq/interface/generator/arith/arithmetic_result_builder.py +4 -4
  116. classiq/interface/generator/arith/ast_node_rewrite.py +8 -4
  117. classiq/interface/generator/arith/binary_ops.py +15 -40
  118. classiq/interface/generator/arith/logical_ops.py +2 -3
  119. classiq/interface/generator/arith/number_utils.py +2 -2
  120. classiq/interface/generator/arith/register_user_input.py +3 -3
  121. classiq/interface/generator/arith/unary_ops.py +2 -2
  122. classiq/interface/generator/circuit_code/circuit_code.py +8 -10
  123. classiq/interface/generator/circuit_code/types_and_constants.py +1 -1
  124. classiq/interface/generator/complex_type.py +2 -2
  125. classiq/interface/generator/copy.py +1 -3
  126. classiq/interface/generator/expressions/atomic_expression_functions.py +0 -5
  127. classiq/interface/generator/expressions/evaluated_expression.py +2 -3
  128. classiq/interface/generator/expressions/expression.py +2 -2
  129. classiq/interface/generator/expressions/proxies/classical/classical_array_proxy.py +4 -7
  130. classiq/interface/generator/function_param_list.py +0 -40
  131. classiq/interface/generator/function_params.py +5 -6
  132. classiq/interface/generator/functions/classical_function_declaration.py +2 -2
  133. classiq/interface/generator/functions/classical_type.py +3 -3
  134. classiq/interface/generator/functions/type_modifier.py +0 -15
  135. classiq/interface/generator/functions/type_name.py +2 -2
  136. classiq/interface/generator/generated_circuit_data.py +14 -18
  137. classiq/interface/generator/generation_request.py +35 -0
  138. classiq/interface/generator/hamiltonian_evolution/exponentiation.py +2 -4
  139. classiq/interface/generator/hardware/hardware_data.py +8 -8
  140. classiq/interface/generator/hardware_efficient_ansatz.py +9 -9
  141. classiq/interface/generator/mcu.py +3 -3
  142. classiq/interface/generator/mcx.py +3 -3
  143. classiq/interface/generator/model/constraints.py +34 -5
  144. classiq/interface/generator/model/preferences/preferences.py +15 -21
  145. classiq/interface/generator/model/quantum_register.py +7 -10
  146. classiq/interface/generator/noise_properties.py +3 -7
  147. classiq/interface/generator/parameters.py +1 -1
  148. classiq/interface/generator/partitioned_register.py +1 -2
  149. classiq/interface/generator/preferences/qasm_to_qmod_params.py +11 -0
  150. classiq/interface/generator/quantum_function_call.py +9 -12
  151. classiq/interface/generator/quantum_program.py +10 -23
  152. classiq/interface/generator/range_types.py +3 -3
  153. classiq/interface/generator/slice_parsing_utils.py +4 -5
  154. classiq/interface/generator/standard_gates/standard_gates.py +2 -4
  155. classiq/interface/generator/synthesis_execution_parameter.py +1 -3
  156. classiq/interface/generator/synthesis_metadata/synthesis_duration.py +9 -0
  157. classiq/interface/generator/synthesis_metadata/synthesis_execution_data.py +2 -3
  158. classiq/interface/generator/transpiler_basis_gates.py +10 -4
  159. classiq/interface/generator/types/builtin_enum_declarations.py +0 -145
  160. classiq/interface/generator/types/compilation_metadata.py +13 -2
  161. classiq/interface/generator/types/enum_declaration.py +2 -1
  162. classiq/interface/generator/validations/flow_graph.py +3 -3
  163. classiq/interface/generator/visitor.py +10 -12
  164. classiq/interface/hardware.py +2 -3
  165. classiq/interface/helpers/classproperty.py +2 -2
  166. classiq/interface/helpers/custom_encoders.py +2 -1
  167. classiq/interface/helpers/custom_pydantic_types.py +1 -1
  168. classiq/interface/helpers/text_utils.py +5 -4
  169. classiq/interface/ide/visual_model.py +6 -5
  170. classiq/interface/interface_version.py +1 -1
  171. classiq/interface/jobs.py +3 -3
  172. classiq/interface/model/allocate.py +4 -4
  173. classiq/interface/model/bind_operation.py +3 -0
  174. classiq/interface/model/block.py +6 -2
  175. classiq/interface/model/bounds.py +3 -3
  176. classiq/interface/model/classical_if.py +4 -0
  177. classiq/interface/model/control.py +8 -1
  178. classiq/interface/model/inplace_binary_operation.py +2 -2
  179. classiq/interface/model/invert.py +4 -0
  180. classiq/interface/model/model.py +4 -4
  181. classiq/interface/model/model_visitor.py +40 -1
  182. classiq/interface/model/parameter.py +1 -3
  183. classiq/interface/model/port_declaration.py +1 -1
  184. classiq/interface/model/power.py +4 -0
  185. classiq/interface/model/quantum_expressions/quantum_expression.py +1 -2
  186. classiq/interface/model/quantum_function_call.py +3 -6
  187. classiq/interface/model/quantum_function_declaration.py +1 -0
  188. classiq/interface/model/quantum_lambda_function.py +4 -4
  189. classiq/interface/model/quantum_statement.py +11 -4
  190. classiq/interface/model/quantum_type.py +14 -14
  191. classiq/interface/model/repeat.py +4 -0
  192. classiq/interface/model/skip_control.py +4 -0
  193. classiq/interface/model/validation_handle.py +2 -3
  194. classiq/interface/model/variable_declaration_statement.py +2 -2
  195. classiq/interface/model/within_apply_operation.py +4 -0
  196. classiq/interface/pretty_print/expression_to_qmod.py +3 -4
  197. classiq/interface/server/routes.py +0 -16
  198. classiq/interface/source_reference.py +3 -4
  199. classiq/model_expansions/arithmetic.py +11 -7
  200. classiq/model_expansions/arithmetic_compute_result_attrs.py +40 -28
  201. classiq/model_expansions/capturing/captured_vars.py +3 -3
  202. classiq/model_expansions/capturing/mangling_utils.py +1 -2
  203. classiq/model_expansions/closure.py +12 -11
  204. classiq/model_expansions/function_builder.py +14 -6
  205. classiq/model_expansions/generative_functions.py +7 -12
  206. classiq/model_expansions/interpreters/base_interpreter.py +3 -7
  207. classiq/model_expansions/interpreters/frontend_generative_interpreter.py +2 -1
  208. classiq/model_expansions/interpreters/generative_interpreter.py +5 -3
  209. classiq/model_expansions/quantum_operations/allocate.py +4 -4
  210. classiq/model_expansions/quantum_operations/assignment_result_processor.py +2 -4
  211. classiq/model_expansions/quantum_operations/call_emitter.py +31 -40
  212. classiq/model_expansions/quantum_operations/declarative_call_emitter.py +2 -2
  213. classiq/model_expansions/quantum_operations/emitter.py +3 -5
  214. classiq/model_expansions/quantum_operations/expression_evaluator.py +3 -3
  215. classiq/model_expansions/quantum_operations/skip_control_verifier.py +1 -2
  216. classiq/model_expansions/quantum_operations/variable_decleration.py +2 -2
  217. classiq/model_expansions/scope.py +7 -7
  218. classiq/model_expansions/scope_initialization.py +4 -0
  219. classiq/model_expansions/visitors/symbolic_param_inference.py +6 -6
  220. classiq/model_expansions/visitors/uncomputation_signature_inference.py +328 -0
  221. classiq/model_expansions/visitors/variable_references.py +15 -14
  222. classiq/open_library/functions/__init__.py +41 -11
  223. classiq/open_library/functions/amplitude_loading.py +81 -0
  224. classiq/open_library/functions/discrete_sine_cosine_transform.py +5 -5
  225. classiq/open_library/functions/encodings.py +182 -0
  226. classiq/open_library/functions/grover.py +8 -10
  227. classiq/open_library/functions/lcu.py +47 -18
  228. classiq/open_library/functions/modular_exponentiation.py +93 -8
  229. classiq/open_library/functions/qsvt.py +66 -79
  230. classiq/open_library/functions/qsvt_temp.py +536 -0
  231. classiq/open_library/functions/state_preparation.py +137 -31
  232. classiq/qmod/__init__.py +6 -4
  233. classiq/qmod/builtins/classical_execution_primitives.py +4 -23
  234. classiq/qmod/builtins/classical_functions.py +1 -42
  235. classiq/qmod/builtins/enums.py +15 -153
  236. classiq/qmod/builtins/functions/__init__.py +9 -18
  237. classiq/qmod/builtins/functions/allocation.py +25 -4
  238. classiq/qmod/builtins/functions/arithmetic.py +22 -27
  239. classiq/qmod/builtins/functions/exponentiation.py +51 -2
  240. classiq/qmod/builtins/functions/mcx_func.py +7 -0
  241. classiq/qmod/builtins/functions/standard_gates.py +46 -27
  242. classiq/qmod/builtins/operations.py +165 -79
  243. classiq/qmod/builtins/structs.py +24 -91
  244. classiq/qmod/cfunc.py +3 -2
  245. classiq/qmod/classical_function.py +2 -1
  246. classiq/qmod/cparam.py +2 -8
  247. classiq/qmod/create_model_function.py +7 -7
  248. classiq/qmod/declaration_inferrer.py +33 -30
  249. classiq/qmod/expression_query.py +7 -4
  250. classiq/qmod/model_state_container.py +2 -2
  251. classiq/qmod/native/pretty_printer.py +25 -14
  252. classiq/qmod/pretty_print/expression_to_python.py +5 -3
  253. classiq/qmod/pretty_print/pretty_printer.py +39 -17
  254. classiq/qmod/python_classical_type.py +40 -13
  255. classiq/qmod/qfunc.py +124 -19
  256. classiq/qmod/qmod_constant.py +2 -2
  257. classiq/qmod/qmod_parameter.py +5 -2
  258. classiq/qmod/qmod_variable.py +48 -47
  259. classiq/qmod/quantum_callable.py +18 -13
  260. classiq/qmod/quantum_expandable.py +31 -26
  261. classiq/qmod/quantum_function.py +84 -36
  262. classiq/qmod/semantics/annotation/call_annotation.py +5 -5
  263. classiq/qmod/semantics/error_manager.py +23 -15
  264. classiq/qmod/semantics/lambdas.py +1 -2
  265. classiq/qmod/semantics/validation/types_validation.py +1 -2
  266. classiq/qmod/symbolic.py +2 -4
  267. classiq/qmod/utilities.py +13 -20
  268. classiq/qmod/write_qmod.py +3 -4
  269. classiq/quantum_program.py +1 -3
  270. classiq/synthesis.py +11 -7
  271. {classiq-0.93.0.dist-info → classiq-0.100.0.dist-info}/METADATA +2 -3
  272. {classiq-0.93.0.dist-info → classiq-0.100.0.dist-info}/RECORD +274 -300
  273. {classiq-0.93.0.dist-info → classiq-0.100.0.dist-info}/WHEEL +1 -1
  274. classiq/applications/chemistry/ansatz_parameters.py +0 -29
  275. classiq/applications/chemistry/chemistry_execution_parameters.py +0 -16
  276. classiq/applications/chemistry/chemistry_model_constructor.py +0 -532
  277. classiq/applications/chemistry/ground_state_problem.py +0 -42
  278. classiq/applications/qsvm/__init__.py +0 -8
  279. classiq/applications/qsvm/qsvm.py +0 -11
  280. classiq/evaluators/qmod_expression_visitors/qmod_expression_bwc.py +0 -129
  281. classiq/execution/iqcc.py +0 -128
  282. classiq/interface/applications/qsvm.py +0 -117
  283. classiq/interface/chemistry/elements.py +0 -120
  284. classiq/interface/chemistry/fermionic_operator.py +0 -208
  285. classiq/interface/chemistry/ground_state_problem.py +0 -132
  286. classiq/interface/chemistry/ground_state_result.py +0 -8
  287. classiq/interface/chemistry/molecule.py +0 -71
  288. classiq/interface/execution/iqcc.py +0 -44
  289. classiq/interface/generator/application_apis/chemistry_declarations.py +0 -69
  290. classiq/interface/generator/application_apis/entangler_declarations.py +0 -29
  291. classiq/interface/generator/application_apis/qsvm_declarations.py +0 -6
  292. classiq/interface/generator/chemistry_function_params.py +0 -50
  293. classiq/interface/generator/entangler_params.py +0 -72
  294. classiq/interface/generator/entanglers.py +0 -14
  295. classiq/interface/generator/hamiltonian_evolution/qdrift.py +0 -27
  296. classiq/interface/generator/hartree_fock.py +0 -26
  297. classiq/interface/generator/hva.py +0 -22
  298. classiq/interface/generator/linear_pauli_rotations.py +0 -92
  299. classiq/interface/generator/qft.py +0 -37
  300. classiq/interface/generator/qsvm.py +0 -96
  301. classiq/interface/generator/state_preparation/__init__.py +0 -14
  302. classiq/interface/generator/state_preparation/bell_state_preparation.py +0 -27
  303. classiq/interface/generator/state_preparation/computational_basis_state_preparation.py +0 -28
  304. classiq/interface/generator/state_preparation/distributions.py +0 -53
  305. classiq/interface/generator/state_preparation/exponential_state_preparation.py +0 -14
  306. classiq/interface/generator/state_preparation/ghz_state_preparation.py +0 -14
  307. classiq/interface/generator/state_preparation/metrics.py +0 -41
  308. classiq/interface/generator/state_preparation/state_preparation.py +0 -113
  309. classiq/interface/generator/state_preparation/state_preparation_abc.py +0 -24
  310. classiq/interface/generator/state_preparation/uniform_distibution_state_preparation.py +0 -13
  311. classiq/interface/generator/state_preparation/w_state_preparation.py +0 -13
  312. classiq/interface/generator/ucc.py +0 -74
  313. classiq/interface/helpers/backward_compatibility.py +0 -9
  314. classiq/model_expansions/transformers/type_modifier_inference.py +0 -392
  315. classiq/open_library/functions/lookup_table.py +0 -58
  316. classiq/qmod/builtins/functions/chemistry.py +0 -123
  317. classiq/qmod/builtins/functions/qsvm.py +0 -24
  318. {classiq-0.93.0.dist-info → classiq-0.100.0.dist-info}/licenses/LICENSE.txt +0 -0
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, Optional, Union
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: Optional[ResultsCollection]
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) -> Optional[str]:
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) -> Optional[datetime]:
61
+ def end_time(self) -> datetime | None:
62
62
  return self._details.end_time
63
63
 
64
64
  @property
65
- def provider(self) -> Optional[str]:
65
+ def provider(self) -> str | None:
66
66
  return self._details.provider
67
67
 
68
68
  @property
69
- def backend_name(self) -> Optional[str]:
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) -> Optional[int]:
77
+ def num_shots(self) -> int | None:
78
78
  return self._details.num_shots
79
79
 
80
80
  @property
81
- def program_id(self) -> Optional[str]:
81
+ def program_id(self) -> str | None:
82
82
  return self._details.program_id
83
83
 
84
84
  @property
85
- def error(self) -> Optional[str]:
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) -> Union[str, JobCost]:
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: Optional[httpx.AsyncClient] = None,
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: Optional[httpx.AsyncClient] = None,
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: Optional[float] = None,
130
- _http_client: Optional[httpx.AsyncClient] = None,
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: Optional[httpx.AsyncClient] = None
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: Optional[httpx.AsyncClient] = None
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: Optional[httpx.AsyncClient] = None
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: Optional[httpx.AsyncClient] = None
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: Optional[httpx.AsyncClient] = None
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: Optional[float] = None,
285
- _http_client: Optional[httpx.AsyncClient] = None,
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: Optional[float] = None,
295
- _http_client: Optional[httpx.AsyncClient] = None,
294
+ timeout_sec: float | None = None,
295
+ _http_client: httpx.AsyncClient | None = None,
296
296
  ) -> None:
297
- def response_parser(json_response: JSONObject) -> Optional[bool]:
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: Optional[httpx.AsyncClient] = None,
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: Optional[httpx.AsyncClient] = None,
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: Optional[PauliOperator] = None,
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 typing import Optional
2
-
3
- from classiq.interface.backend.quantum_backend_providers import ProviderVendor
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
- provider_vendor: Optional[ProviderVendor] = None,
12
+ provider: ProviderVendor | None = None,
26
13
  ) -> UserBudgets:
27
14
 
28
15
  budgets_list = await ApiWrapper().call_get_all_budgets()
29
- if provider_vendor:
30
- provider = PROVIDER_MAPPER.get(provider_vendor, None)
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 == 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 = syncify_function(get_budget_async)
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
- provider_vendor: ProviderVendor,
43
+ provider: ProviderVendor,
43
44
  limit: float,
44
45
  ) -> UserBudgets:
45
- provider = PROVIDER_MAPPER.get(provider_vendor, None)
46
- if not provider:
47
- raise ValueError(f"Unsupported provider: {provider_vendor}")
46
+ _provider = PROVIDER_NAME_MAPPER.get(provider, None)
47
+ if not _provider:
48
+ raise ValueError(f"Unsupported provider: {provider}")
48
49
 
49
- budget = get_budget(provider_vendor)
50
+ budget = await get_budget_async(provider)
50
51
  if budget is None:
51
- raise ValueError(f"No budget found for provider: {provider_vendor}")
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 {provider_vendor}.\n"
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(provider, 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 = syncify_function(set_budget_limit_async)
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
- async def clear_budget_limit_async(provider_vendor: ProviderVendor) -> UserBudgets:
69
- provider = PROVIDER_MAPPER.get(provider_vendor, None)
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
- budgets_list = await ApiWrapper().call_clear_budget_limit(provider)
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 = syncify_function(clear_budget_limit_async)
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
@@ -3,5 +3,5 @@ from packaging.version import Version
3
3
  # This file was generated automatically
4
4
  # Please don't track in version control (DONTTRACK)
5
5
 
6
- SEMVER_VERSION = '0.93.0'
6
+ SEMVER_VERSION = '0.100.0'
7
7
  VERSION = str(Version(SEMVER_VERSION))
@@ -1,4 +1,4 @@
1
- from typing import Annotated, Optional
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: Optional[list[PydanticNonEmptyString]] = pydantic.Field(
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: Optional[list[AnalyzerProviderVendor]]
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: Optional[SynthesisHardwareData] = None
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, Optional
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: Optional[CytoScapePosition] = pydantic.Field(
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: Optional[CytoScapeGraph] = pydantic.Field(
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, Optional, Union
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: Optional[dict[PydanticNonEmptyString, bool]] = pydantic.Field(
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: Optional[dict[PydanticNonEmptyString, bool]] = pydantic.Field(
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: Optional[dict[PydanticNonEmptyString, bool]] = pydantic.Field(
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
  )
@@ -1,4 +1,4 @@
1
- from typing import Any, Optional, TypeVar
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: Optional[SourceReference] = pydantic.Field(default=None)
17
- back_ref: Optional[UUID] = pydantic.Field(default=None)
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, Optional, Union
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: Optional[int] = pydantic.Field(
106
+ distance: int | None = pydantic.Field(
107
107
  default=None, description="Repetition code distance"
108
108
  )
109
- kappa_1: Optional[float] = pydantic.Field(
109
+ kappa_1: float | None = pydantic.Field(
110
110
  default=None, description="One-photon dissipation rate (Hz)"
111
111
  )
112
- kappa_2: Optional[float] = pydantic.Field(
112
+ kappa_2: float | None = pydantic.Field(
113
113
  default=None, description="Two-photon dissipation rate (Hz)"
114
114
  )
115
- average_nb_photons: Optional[float] = pydantic.Field(
115
+ average_nb_photons: float | None = pydantic.Field(
116
116
  default=None, description="Average number of photons"
117
117
  )
118
- api_key: Optional[pydantic_backend.PydanticAliceBobApiKeyType] = pydantic.Field(
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: Optional[str]) -> Optional[str]:
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
- aws_role_arn (pydantic_backend.PydanticAwsRoleArn):
176
- The Amazon Resource Name (ARN) of the role that will be assumed for execution
177
- on your Braket account. This is a required field and should be provided to allow
178
- secure and authorized access to AWS resources.
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
- aws_role_arn: Optional[str] = pydantic.Field(
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="ARN of the role to be assumed for execution on your Braket account.",
203
+ description="Secret access key assigned to user with credentials to access Braket service",
199
204
  )
200
- s3_bucket_name: Optional[str] = pydantic.Field(
205
+ s3_bucket_name: str | None = pydantic.Field(
201
206
  default=None, description="S3 Bucket Name"
202
207
  )
203
- s3_folder: Optional[str] = pydantic.Field(
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: Optional[str] = pydantic.Field(
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: Optional[str] = pydantic.Field(
242
+ channel: str | None = pydantic.Field(
238
243
  default=None, description="Channel to use for IBM cloud backends."
239
244
  )
240
- instance_crn: Optional[str] = pydantic.Field(
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: Optional[AzureCredential] = pydantic.Field(
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: Optional[bool] = pydantic.Field(
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: Optional[pydantic_backend.PydanticIonQApiKeyType] = pydantic.Field(
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, Optional
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: Optional[int] = None
26
- control: Optional[int] = None
27
- targets: Optional[list[int]] = None
28
- controls: Optional[list[int]] = None
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