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.
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 +239 -11
  52. classiq/applications/qsvm/qsvm_data_generation.py +1 -2
  53. classiq/evaluators/classical_expression.py +0 -4
  54. classiq/evaluators/parameter_types.py +20 -12
  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 +10 -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 +25 -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/hamiltonian_evolution/exponentiation.py +2 -4
  138. classiq/interface/generator/hardware/hardware_data.py +8 -8
  139. classiq/interface/generator/hardware_efficient_ansatz.py +9 -9
  140. classiq/interface/generator/mcu.py +3 -3
  141. classiq/interface/generator/mcx.py +3 -3
  142. classiq/interface/generator/model/constraints.py +34 -5
  143. classiq/interface/generator/model/preferences/preferences.py +15 -21
  144. classiq/interface/generator/model/quantum_register.py +7 -10
  145. classiq/interface/generator/noise_properties.py +3 -7
  146. classiq/interface/generator/parameters.py +1 -1
  147. classiq/interface/generator/partitioned_register.py +1 -2
  148. classiq/interface/generator/preferences/qasm_to_qmod_params.py +11 -0
  149. classiq/interface/generator/quantum_function_call.py +9 -12
  150. classiq/interface/generator/quantum_program.py +10 -23
  151. classiq/interface/generator/range_types.py +3 -3
  152. classiq/interface/generator/slice_parsing_utils.py +4 -5
  153. classiq/interface/generator/standard_gates/standard_gates.py +2 -4
  154. classiq/interface/generator/synthesis_execution_parameter.py +1 -3
  155. classiq/interface/generator/synthesis_metadata/synthesis_duration.py +9 -0
  156. classiq/interface/generator/synthesis_metadata/synthesis_execution_data.py +2 -3
  157. classiq/interface/generator/transpiler_basis_gates.py +12 -4
  158. classiq/interface/generator/types/builtin_enum_declarations.py +0 -145
  159. classiq/interface/generator/types/compilation_metadata.py +12 -1
  160. classiq/interface/generator/types/enum_declaration.py +2 -1
  161. classiq/interface/generator/validations/flow_graph.py +3 -3
  162. classiq/interface/generator/visitor.py +10 -12
  163. classiq/interface/hardware.py +2 -3
  164. classiq/interface/helpers/classproperty.py +2 -2
  165. classiq/interface/helpers/custom_encoders.py +2 -1
  166. classiq/interface/helpers/custom_pydantic_types.py +1 -1
  167. classiq/interface/helpers/text_utils.py +1 -4
  168. classiq/interface/ide/visual_model.py +6 -5
  169. classiq/interface/interface_version.py +1 -1
  170. classiq/interface/jobs.py +3 -3
  171. classiq/interface/model/allocate.py +4 -4
  172. classiq/interface/model/block.py +6 -2
  173. classiq/interface/model/bounds.py +3 -3
  174. classiq/interface/model/classical_if.py +4 -0
  175. classiq/interface/model/control.py +8 -1
  176. classiq/interface/model/inplace_binary_operation.py +2 -2
  177. classiq/interface/model/invert.py +4 -0
  178. classiq/interface/model/model.py +4 -4
  179. classiq/interface/model/model_visitor.py +40 -1
  180. classiq/interface/model/parameter.py +1 -3
  181. classiq/interface/model/port_declaration.py +1 -1
  182. classiq/interface/model/power.py +4 -0
  183. classiq/interface/model/quantum_expressions/quantum_expression.py +1 -2
  184. classiq/interface/model/quantum_function_call.py +3 -6
  185. classiq/interface/model/quantum_function_declaration.py +1 -0
  186. classiq/interface/model/quantum_lambda_function.py +4 -4
  187. classiq/interface/model/quantum_statement.py +11 -4
  188. classiq/interface/model/quantum_type.py +14 -14
  189. classiq/interface/model/repeat.py +4 -0
  190. classiq/interface/model/skip_control.py +4 -0
  191. classiq/interface/model/validation_handle.py +2 -3
  192. classiq/interface/model/variable_declaration_statement.py +2 -2
  193. classiq/interface/model/within_apply_operation.py +4 -0
  194. classiq/interface/pretty_print/expression_to_qmod.py +3 -4
  195. classiq/interface/server/routes.py +0 -16
  196. classiq/interface/source_reference.py +3 -4
  197. classiq/model_expansions/arithmetic.py +11 -7
  198. classiq/model_expansions/arithmetic_compute_result_attrs.py +30 -27
  199. classiq/model_expansions/capturing/captured_vars.py +3 -3
  200. classiq/model_expansions/capturing/mangling_utils.py +1 -2
  201. classiq/model_expansions/closure.py +12 -11
  202. classiq/model_expansions/function_builder.py +14 -6
  203. classiq/model_expansions/generative_functions.py +7 -12
  204. classiq/model_expansions/interpreters/base_interpreter.py +3 -7
  205. classiq/model_expansions/interpreters/frontend_generative_interpreter.py +2 -1
  206. classiq/model_expansions/interpreters/generative_interpreter.py +8 -4
  207. classiq/model_expansions/quantum_operations/allocate.py +4 -4
  208. classiq/model_expansions/quantum_operations/assignment_result_processor.py +8 -4
  209. classiq/model_expansions/quantum_operations/call_emitter.py +31 -37
  210. classiq/model_expansions/quantum_operations/declarative_call_emitter.py +2 -2
  211. classiq/model_expansions/quantum_operations/emitter.py +3 -5
  212. classiq/model_expansions/quantum_operations/expression_evaluator.py +3 -3
  213. classiq/model_expansions/quantum_operations/skip_control_verifier.py +1 -2
  214. classiq/model_expansions/quantum_operations/variable_decleration.py +61 -29
  215. classiq/model_expansions/scope.py +7 -7
  216. classiq/model_expansions/scope_initialization.py +4 -0
  217. classiq/model_expansions/visitors/symbolic_param_inference.py +6 -6
  218. classiq/model_expansions/visitors/uncomputation_signature_inference.py +328 -0
  219. classiq/model_expansions/visitors/variable_references.py +15 -14
  220. classiq/open_library/functions/__init__.py +28 -11
  221. classiq/open_library/functions/amplitude_loading.py +81 -0
  222. classiq/open_library/functions/discrete_sine_cosine_transform.py +19 -14
  223. classiq/open_library/functions/grover.py +8 -10
  224. classiq/open_library/functions/lcu.py +47 -18
  225. classiq/open_library/functions/modular_exponentiation.py +93 -8
  226. classiq/open_library/functions/qsvt.py +66 -79
  227. classiq/open_library/functions/qsvt_temp.py +536 -0
  228. classiq/open_library/functions/state_preparation.py +130 -27
  229. classiq/qmod/__init__.py +6 -4
  230. classiq/qmod/builtins/classical_execution_primitives.py +4 -23
  231. classiq/qmod/builtins/classical_functions.py +1 -42
  232. classiq/qmod/builtins/enums.py +15 -153
  233. classiq/qmod/builtins/functions/__init__.py +9 -18
  234. classiq/qmod/builtins/functions/allocation.py +25 -4
  235. classiq/qmod/builtins/functions/arithmetic.py +22 -27
  236. classiq/qmod/builtins/functions/exponentiation.py +51 -2
  237. classiq/qmod/builtins/functions/mcx_func.py +7 -0
  238. classiq/qmod/builtins/functions/standard_gates.py +46 -27
  239. classiq/qmod/builtins/operations.py +173 -79
  240. classiq/qmod/builtins/structs.py +24 -91
  241. classiq/qmod/cfunc.py +3 -2
  242. classiq/qmod/classical_function.py +2 -1
  243. classiq/qmod/classical_variable.py +4 -2
  244. classiq/qmod/cparam.py +2 -8
  245. classiq/qmod/create_model_function.py +7 -7
  246. classiq/qmod/declaration_inferrer.py +33 -30
  247. classiq/qmod/expression_query.py +7 -4
  248. classiq/qmod/model_state_container.py +2 -2
  249. classiq/qmod/native/pretty_printer.py +25 -14
  250. classiq/qmod/pretty_print/expression_to_python.py +5 -3
  251. classiq/qmod/pretty_print/pretty_printer.py +39 -17
  252. classiq/qmod/python_classical_type.py +40 -13
  253. classiq/qmod/qfunc.py +124 -19
  254. classiq/qmod/qmod_constant.py +2 -2
  255. classiq/qmod/qmod_parameter.py +5 -2
  256. classiq/qmod/qmod_variable.py +47 -46
  257. classiq/qmod/quantum_callable.py +18 -13
  258. classiq/qmod/quantum_expandable.py +33 -26
  259. classiq/qmod/quantum_function.py +84 -36
  260. classiq/qmod/semantics/annotation/call_annotation.py +5 -5
  261. classiq/qmod/semantics/error_manager.py +12 -14
  262. classiq/qmod/semantics/lambdas.py +1 -2
  263. classiq/qmod/semantics/validation/types_validation.py +1 -2
  264. classiq/qmod/symbolic.py +2 -4
  265. classiq/qmod/symbolic_expr.py +12 -4
  266. classiq/qmod/utilities.py +13 -20
  267. classiq/qmod/write_qmod.py +3 -4
  268. classiq/quantum_program.py +1 -3
  269. classiq/synthesis.py +11 -7
  270. {classiq-0.92.0.dist-info → classiq-0.99.0.dist-info}/METADATA +38 -37
  271. {classiq-0.92.0.dist-info → classiq-0.99.0.dist-info}/RECORD +273 -300
  272. classiq-0.99.0.dist-info/WHEEL +4 -0
  273. classiq-0.99.0.dist-info/licenses/LICENSE.txt +27 -0
  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.92.0.dist-info/WHEEL +0 -4
@@ -0,0 +1,8 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class ProviderConfig(BaseModel):
5
+ """
6
+ Provider-specific configuration data for execution, such as API keys and
7
+ machine-specific parameters.
8
+ """
@@ -0,0 +1,47 @@
1
+ import pydantic
2
+
3
+ from classiq.interface.backend.provider_config.provider_config import ProviderConfig
4
+
5
+
6
+ class AliceBobConfig(ProviderConfig):
7
+ """
8
+ Configuration specific to Alice&Bob.
9
+
10
+ Attributes:
11
+ distance (int | None):
12
+ The number of times information is duplicated in the repetition code.
13
+ - **Tooltip**: Phase-flip probability decreases exponentially with this parameter, bit-flip probability increases linearly.
14
+ - **Supported Values**: 3 to 300, though practical values are usually lower than 30.
15
+ - **Default**: None.
16
+
17
+ kappa_1 (float | None):
18
+ The rate at which the cat qubit loses one photon, creating a bit-flip.
19
+ - **Tooltip**: Lower values mean lower error rates.
20
+ - **Supported Values**: 10 to 10^5. Current hardware is at ~10^3.
21
+ - **Default**: None.
22
+
23
+ kappa_2 (float | None):
24
+ The rate at which the cat qubit is stabilized using two-photon dissipation.
25
+ - **Tooltip**: Higher values mean lower error rates.
26
+ - **Supported Values**: 100 to 10^9. Current hardware is at ~10^5.
27
+ - **Default**: None.
28
+
29
+ average_nb_photons (float | None):
30
+ The average number of photons.
31
+ - **Tooltip**: Bit-flip probability decreases exponentially with this parameter, phase-flip probability increases linearly.
32
+ - **Supported Values**: 4 to 10^5, though practical values are usually lower than 30.
33
+ - **Default**: None.
34
+ """
35
+
36
+ distance: int | None = pydantic.Field(
37
+ default=None, description="Repetition code distance"
38
+ )
39
+ kappa_1: float | None = pydantic.Field(
40
+ default=None, description="One-photon dissipation rate (Hz)"
41
+ )
42
+ kappa_2: float | None = pydantic.Field(
43
+ default=None, description="Two-photon dissipation rate (Hz)"
44
+ )
45
+ average_nb_photons: float | None = pydantic.Field(
46
+ default=None, description="Average number of photons"
47
+ )
@@ -0,0 +1,16 @@
1
+ import pydantic
2
+
3
+ from classiq.interface.backend.provider_config.provider_config import ProviderConfig
4
+
5
+
6
+ class AQTConfig(ProviderConfig):
7
+ """
8
+ Configuration specific to AQT (Alpine Quantum Technologies).
9
+
10
+ Attributes:
11
+ api_key: The API key required to access AQT's quantum computing services.
12
+ workspace: The AQT workspace where the simulator/hardware is located.
13
+ """
14
+
15
+ api_key: str | None = pydantic.Field(default=None, description="AQT API key")
16
+ workspace: str = pydantic.Field(description="AQT workspace")
@@ -0,0 +1,37 @@
1
+ import pydantic
2
+
3
+ from classiq.interface.backend import pydantic_backend
4
+ from classiq.interface.backend.provider_config.provider_config import ProviderConfig
5
+
6
+
7
+ class AzureConfig(ProviderConfig):
8
+ """
9
+ Configuration specific to Azure.
10
+
11
+ Attributes:
12
+ location (str): Azure region. Defaults to `"East US"`.
13
+ tenant_id (str | None): Azure Tenant ID used to identify the directory in which the application is registered.
14
+ client_id (str | None): Azure Client ID, also known as the application ID, which is used to authenticate the application.
15
+ client_secret (str | None): Azure Client Secret associated with the application, used for authentication.
16
+ resource_id (str | None): Azure Resource ID, including the subscription ID, resource group, and workspace, typically used for personal resources.
17
+ ionq_error_mitigation (bool): Should use error mitigation when running on IonQ through Azure. Defaults to `False`.
18
+ """
19
+
20
+ location: str = pydantic.Field(
21
+ default="East US", description="Azure personal resource region"
22
+ )
23
+
24
+ tenant_id: str | None = pydantic.Field(default=None, description="Azure Tenant ID")
25
+ client_id: str | None = pydantic.Field(default=None, description="Azure Client ID")
26
+ client_secret: str | None = pydantic.Field(
27
+ default=None, description="Azure Client Secret"
28
+ )
29
+ resource_id: pydantic_backend.PydanticAzureResourceIDType | None = pydantic.Field(
30
+ default=None,
31
+ description="Azure Resource ID (including Azure subscription ID, resource "
32
+ "group and workspace), for personal resource",
33
+ )
34
+ ionq_error_mitigation: bool = pydantic.Field(
35
+ default=False,
36
+ description="Error mitigation configuration upon running on IonQ through Azure.",
37
+ )
@@ -0,0 +1,39 @@
1
+ import pydantic
2
+
3
+ from classiq.interface.backend.provider_config.provider_config import ProviderConfig
4
+
5
+
6
+ class BraketConfig(ProviderConfig):
7
+ """
8
+ Configuration specific to Amazon Braket.
9
+
10
+ Attributes:
11
+ braket_access_key_id (str | None):
12
+ The access key id of user with full braket access
13
+
14
+ braket_secret_access_key (str | None):
15
+ The secret key assigned to the access key id for the user with full braket access.
16
+
17
+ s3_bucket_name (str | None):
18
+ The name of the S3 bucket where results and other related data will be stored.
19
+ This field should contain a valid S3 bucket name under your AWS account.
20
+
21
+ s3_folder (pydantic_backend.PydanticS3BucketKey | None):
22
+ The folder path within the specified S3 bucket. This allows for organizing
23
+ results and data under a specific directory within the S3 bucket.
24
+ """
25
+
26
+ braket_access_key_id: str | None = pydantic.Field(
27
+ default=None,
28
+ description="Key id assigned to user with credentials to access Braket service",
29
+ )
30
+ braket_secret_access_key: str | None = pydantic.Field(
31
+ default=None,
32
+ description="Secret access key assigned to user with credentials to access Braket service",
33
+ )
34
+ s3_bucket_name: str | None = pydantic.Field(
35
+ default=None, description="S3 Bucket Name"
36
+ )
37
+ s3_folder: str | None = pydantic.Field(
38
+ default=None, description="S3 Folder Path Within The S3 Bucket"
39
+ )
@@ -0,0 +1,26 @@
1
+ import pydantic
2
+
3
+ from classiq.interface.backend.provider_config.provider_config import ProviderConfig
4
+
5
+
6
+ class IBMConfig(ProviderConfig):
7
+ """
8
+ Configuration specific to IBM.
9
+
10
+ Attributes:
11
+ access_token (str | None): The IBM Cloud access token to be used with IBM Quantum hosted backends. Defaults to `None`.
12
+ channel (str): Channel to use for IBM cloud backends. Defaults to `"ibm_cloud"`.
13
+ instance_crn (str): The IBM Cloud instance CRN (Cloud Resource Name) for the IBM Quantum service.
14
+ """
15
+
16
+ access_token: str | None = pydantic.Field(
17
+ default=None,
18
+ description="IBM Cloud access token to be used"
19
+ " with IBM Quantum hosted backends.",
20
+ )
21
+ channel: str = pydantic.Field(
22
+ default="ibm_cloud", description="Channel to use for IBM cloud backends."
23
+ )
24
+ instance_crn: str | None = pydantic.Field(
25
+ default=None, description="IBM Cloud instance CRN."
26
+ )
@@ -0,0 +1,22 @@
1
+ import pydantic
2
+
3
+ from classiq.interface.backend import pydantic_backend
4
+ from classiq.interface.backend.provider_config.provider_config import ProviderConfig
5
+
6
+
7
+ class IonQConfig(ProviderConfig):
8
+ """
9
+ Configuration specific to IonQ.
10
+
11
+ Attributes:
12
+ api_key (PydanticIonQApiKeyType | None): Key to access IonQ API.
13
+ error_mitigation (bool): A configuration option to enable or disable error mitigation during execution. Defaults to `False`.
14
+ """
15
+
16
+ api_key: pydantic_backend.PydanticIonQApiKeyType | None = pydantic.Field(
17
+ default=None, description="IonQ API key."
18
+ )
19
+ error_mitigation: bool = pydantic.Field(
20
+ default=False,
21
+ description="Enable error mitigation during execution.",
22
+ )
@@ -2,6 +2,8 @@ from typing import Literal, Union
2
2
 
3
3
  from classiq.interface.enum_utils import StrEnum
4
4
 
5
+ __all__ = ["ProviderVendor"]
6
+
5
7
 
6
8
  class AnalyzerProviderVendor(StrEnum):
7
9
  IBM_QUANTUM = "IBM Quantum"
@@ -10,6 +12,10 @@ class AnalyzerProviderVendor(StrEnum):
10
12
 
11
13
 
12
14
  class ProviderVendor(StrEnum):
15
+ """
16
+ Enum representing various quantum computing service providers.
17
+ """
18
+
13
19
  CLASSIQ = "Classiq"
14
20
  IBM_QUANTUM = "IBM Quantum"
15
21
  AZURE_QUANTUM = "Azure Quantum"
@@ -20,7 +26,6 @@ class ProviderVendor(StrEnum):
20
26
  OQC = "OQC"
21
27
  INTEL = "Intel"
22
28
  AQT = "AQT"
23
- IQCC = "IQCC"
24
29
  CINECA = "CINECA"
25
30
 
26
31
 
@@ -35,10 +40,23 @@ class ProviderTypeVendor:
35
40
  OQC = Literal[ProviderVendor.OQC]
36
41
  INTEL = Literal[ProviderVendor.INTEL]
37
42
  AQT = Literal[ProviderVendor.AQT]
38
- IQCC = Literal[ProviderVendor.IQCC]
39
43
  CINECA = Literal[ProviderVendor.CINECA]
40
44
 
41
45
 
46
+ PROVIDER_NAME_MAPPER = {
47
+ ProviderVendor.IONQ: "IONQ",
48
+ ProviderVendor.IBM_QUANTUM: "IBM_CLOUD",
49
+ ProviderVendor.AZURE_QUANTUM: "AZURE",
50
+ ProviderVendor.AMAZON_BRAKET: "AMAZON",
51
+ ProviderVendor.GOOGLE: "GOOGLE",
52
+ ProviderVendor.ALICE_AND_BOB: "ALICE_AND_BOB",
53
+ ProviderVendor.OQC: "OQC",
54
+ ProviderVendor.INTEL: "INTEL",
55
+ ProviderVendor.AQT: "AQT",
56
+ ProviderVendor.CLASSIQ: "CLASSIQ",
57
+ }
58
+
59
+
42
60
  class ClassiqSimulatorBackendNames(StrEnum):
43
61
  """
44
62
 
@@ -1,13 +1,11 @@
1
- from typing import Optional
2
-
3
1
  from pydantic import BaseModel
4
2
 
5
3
 
6
4
  class HardwareEfficientConstraints(BaseModel):
7
5
  num_qubits: int
8
- num_two_qubit_gates: Optional[int] = None
9
- num_one_qubit_gates: Optional[int] = None
10
- max_depth: Optional[int] = None
6
+ num_two_qubit_gates: int | None = None
7
+ num_one_qubit_gates: int | None = None
8
+ max_depth: int | None = None
11
9
 
12
10
 
13
11
  class HardwareEfficient(BaseModel):
@@ -1,7 +1,7 @@
1
1
  from collections.abc import Collection, Iterable
2
2
  from functools import reduce
3
3
  from itertools import combinations
4
- from typing import Any, Optional, Union, cast
4
+ from typing import Any, cast
5
5
 
6
6
  import numpy as np
7
7
  import pydantic
@@ -65,7 +65,7 @@ class PauliOperator(HashablePydanticBaseModel, VersionedModel):
65
65
 
66
66
  @staticmethod
67
67
  def _validate_monomial_coefficient(
68
- coeff: Union[sympy.Expr, ParameterComplexType],
68
+ coeff: sympy.Expr | ParameterComplexType,
69
69
  ) -> ParameterComplexType:
70
70
  if isinstance(coeff, str):
71
71
  validate_expression_str(coeff)
@@ -219,7 +219,7 @@ class PauliOperator(HashablePydanticBaseModel, VersionedModel):
219
219
  def from_unzipped_lists(
220
220
  cls,
221
221
  operators: list[list["Pauli"]],
222
- coefficients: Optional[list[complex]] = None,
222
+ coefficients: list[complex] | None = None,
223
223
  ) -> "PauliOperator":
224
224
  if coefficients is None:
225
225
  coefficients = [1] * len(operators)
@@ -1,5 +1,3 @@
1
- from typing import Optional
2
-
3
1
  import numpy as np
4
2
  import pyomo.core as pyo
5
3
 
@@ -7,8 +5,8 @@ import pyomo.core as pyo
7
5
  def knapsack(
8
6
  values: list[int],
9
7
  upper_bound: int,
10
- weights: Optional[list[int]] = None,
11
- max_weight: Optional[int] = None,
8
+ weights: list[int] | None = None,
9
+ max_weight: int | None = None,
12
10
  ) -> pyo.ConcreteModel:
13
11
  model = pyo.ConcreteModel()
14
12
 
@@ -1,12 +1,11 @@
1
1
  import itertools
2
- from typing import Union
3
2
 
4
3
  import networkx as nx
5
4
  import pyomo.core as pyo
6
5
 
7
6
 
8
7
  def tsp_digraph(
9
- graph: nx.DiGraph, source: Union[int, str], sink: Union[int, str], nonedge: int
8
+ graph: nx.DiGraph, source: int | str, sink: int | str, nonedge: int
10
9
  ) -> pyo.ConcreteModel:
11
10
  model = pyo.ConcreteModel()
12
11
 
@@ -1,19 +1,18 @@
1
1
  import base64
2
2
  from collections.abc import Sequence
3
- from typing import Union
4
3
 
5
4
  import zstandard as zstd
6
5
  from pydantic import BaseModel
7
6
  from pydantic_core import from_json, to_json
8
7
 
9
8
 
10
- def compress_pydantic(obj: Union[BaseModel, Sequence[BaseModel]]) -> bytes:
9
+ def compress_pydantic(obj: BaseModel | Sequence[BaseModel]) -> bytes:
11
10
  json_data = to_json(obj)
12
11
  compressed_data = _compress(json_data, level=22) # max compression level
13
12
  return compressed_data
14
13
 
15
14
 
16
- def decompress(compressed_data: bytes) -> Union[dict, list[dict]]:
15
+ def decompress(compressed_data: bytes) -> dict | list[dict]:
17
16
  decompressed_data = _decompress(compressed_data)
18
17
  return from_json(decompressed_data)
19
18
 
@@ -1,5 +1,5 @@
1
1
  from collections.abc import Mapping, Sequence
2
- from typing import Optional, Union, cast
2
+ from typing import Union, cast
3
3
  from uuid import UUID
4
4
 
5
5
  from pydantic import BaseModel, Field
@@ -20,11 +20,12 @@ ParameterValue = Union[float, int, str, None]
20
20
 
21
21
  class FunctionDebugInfo(BaseModel):
22
22
  name: str
23
- statement_type: Union[StatementType, None] = None
23
+ statement_type: StatementType | None = None
24
24
  is_inverse: bool = Field(default=False)
25
- control_variable: Optional[str] = Field(default=None)
25
+ is_daggered: bool = Field(default=False)
26
+ control_variable: str | None = Field(default=None)
26
27
  port_to_passed_variable_map: dict[str, str] = Field(default_factory=dict)
27
- node: Optional[ConcreteQuantumStatement] = None
28
+ node: ConcreteQuantumStatement | None = None
28
29
 
29
30
  @property
30
31
  def is_allocate_or_free(self) -> bool:
@@ -61,7 +62,7 @@ class DebugInfoCollection(BaseModel):
61
62
  def __setitem__(self, key: UUID, value: FunctionDebugInfo) -> None:
62
63
  self.data[str(key)] = value
63
64
 
64
- def get(self, key: UUID) -> Optional[FunctionDebugInfo]:
65
+ def get(self, key: UUID) -> FunctionDebugInfo | None:
65
66
  return self.data.get(str(key))
66
67
 
67
68
  def __getitem__(self, key: UUID) -> FunctionDebugInfo:
@@ -70,7 +71,7 @@ class DebugInfoCollection(BaseModel):
70
71
  def __contains__(self, key: UUID) -> bool:
71
72
  return str(key) in self.data
72
73
 
73
- def get_blackbox_data(self, key: UUID) -> Optional[FunctionDebugInfoInterface]:
74
+ def get_blackbox_data(self, key: UUID) -> FunctionDebugInfoInterface | None:
74
75
  if (debug_info := self.get(key)) is None:
75
76
  return None
76
77
  return self.blackbox_data.get(debug_info.name)
@@ -103,7 +104,7 @@ def new_function_debug_info_by_node(
103
104
 
104
105
 
105
106
  def calculate_port_to_passed_variable_mapping(
106
- arg_decls: Sequence[PositionalArg], args: Sequence[Union[ArgValue, None]]
107
+ arg_decls: Sequence[PositionalArg], args: Sequence[ArgValue | None]
107
108
  ) -> dict[str, str]:
108
109
  return {
109
110
  arg_decl.name: str(cast(ConcreteHandleBinding, arg))
@@ -1,6 +1,5 @@
1
1
  import logging
2
2
  from collections.abc import Iterable
3
- from typing import Optional
4
3
 
5
4
  _logger = logging.getLogger(__name__)
6
5
 
@@ -53,7 +52,7 @@ class ClassiqAnalyzerVisualizationError(ClassiqError):
53
52
 
54
53
 
55
54
  class ClassiqAPIError(ClassiqError):
56
- def __init__(self, message: str, status_code: Optional[int] = None) -> None:
55
+ def __init__(self, message: str, status_code: int | None = None) -> None:
57
56
  self.status_code = status_code
58
57
  super().__init__(message)
59
58
 
@@ -66,6 +65,10 @@ class ClassiqValueError(ClassiqError, ValueError):
66
65
  pass
67
66
 
68
67
 
68
+ class ClassiqTypeError(ClassiqError, TypeError):
69
+ pass
70
+
71
+
69
72
  class ClassiqArithmeticError(ClassiqValueError):
70
73
  pass
71
74
 
@@ -92,10 +95,6 @@ class ClassiqQFuncError(ClassiqValueError):
92
95
  pass
93
96
 
94
97
 
95
- class ClassiqQSVMError(ClassiqValueError):
96
- pass
97
-
98
-
99
98
  class ClassiqQNNError(ClassiqValueError):
100
99
  pass
101
100
 
@@ -187,7 +186,7 @@ class ClassiqExpansionError(ClassiqError):
187
186
 
188
187
 
189
188
  class ClassiqInternalError(ClassiqError):
190
- def __init__(self, message: Optional[str] = None) -> None:
189
+ def __init__(self, message: str | None = None) -> None:
191
190
  final_message = "Internal error occurred. Please contact Classiq support."
192
191
  if message is not None:
193
192
  final_message += f"\nError: {message}"
@@ -196,3 +195,7 @@ class ClassiqInternalError(ClassiqError):
196
195
 
197
196
  class ClassiqInternalExpansionError(ClassiqInternalError):
198
197
  pass
198
+
199
+
200
+ class ClassiqInternalArithmeticError(ClassiqInternalError):
201
+ pass
@@ -1,4 +1,4 @@
1
- from typing import Annotated, Literal, Optional, Union
1
+ from typing import Annotated, Literal, Union
2
2
 
3
3
  from pydantic import BaseModel, Field
4
4
 
@@ -17,7 +17,7 @@ class MinimizeCostInput(BaseModel, json_encoders=CUSTOM_ENCODERS):
17
17
  initial_params: Arguments
18
18
  max_iteration: int
19
19
  quantile: float
20
- tolerance: Optional[float]
20
+ tolerance: float | None
21
21
 
22
22
 
23
23
  class MinimizeClassicalCostInput(MinimizeCostInput):
@@ -41,7 +41,7 @@ ConcreteMinimizeCostInput = Annotated[
41
41
 
42
42
 
43
43
  class PrimitivesInput(BaseModel, json_encoders=CUSTOM_ENCODERS):
44
- sample: Optional[list[Arguments]] = Field(default=None)
45
- estimate: Optional[EstimateInput] = Field(default=None)
46
- minimize: Optional[ConcreteMinimizeCostInput] = Field(default=None)
47
- random_seed: Optional[int] = Field(default=None)
44
+ sample: list[Arguments] | None = Field(default=None)
45
+ estimate: EstimateInput | None = Field(default=None)
46
+ minimize: ConcreteMinimizeCostInput | None = Field(default=None)
47
+ random_seed: int | None = Field(default=None)
@@ -1,4 +1,4 @@
1
- from typing import Callable
1
+ from collections.abc import Callable
2
2
 
3
3
  import numpy as np
4
4
 
@@ -1,5 +1,3 @@
1
- from typing import Optional
2
-
3
1
  import pydantic
4
2
 
5
3
  from classiq.interface.backend.backend_preferences import (
@@ -43,7 +41,7 @@ class ExecutionPreferences(pydantic.BaseModel):
43
41
  job_name (Optional[str]): The name of the job, with a minimum length of 1 character.
44
42
  """
45
43
 
46
- noise_properties: Optional[NoiseProperties] = pydantic.Field(
44
+ noise_properties: NoiseProperties | None = pydantic.Field(
47
45
  default=None, description="Properties of the noise in the circuit"
48
46
  )
49
47
  random_seed: int = pydantic.Field(
@@ -53,13 +51,13 @@ class ExecutionPreferences(pydantic.BaseModel):
53
51
  backend_preferences: BackendPreferencesTypes = backend_preferences_field(
54
52
  backend_name=ClassiqSimulatorBackendNames.SIMULATOR
55
53
  )
56
- num_shots: Optional[pydantic.PositiveInt] = pydantic.Field(default=None)
54
+ num_shots: pydantic.PositiveInt | None = pydantic.Field(default=None)
57
55
  transpile_to_hardware: TranspilationOption = pydantic.Field(
58
56
  default=TranspilationOption.DECOMPOSE,
59
57
  description="Transpile the circuit to the hardware basis gates before execution",
60
58
  title="Transpilation Option",
61
59
  )
62
- job_name: Optional[str] = pydantic.Field(
60
+ job_name: str | None = pydantic.Field(
63
61
  min_length=1, description="The job name", default=None
64
62
  )
65
63
 
@@ -1,5 +1,5 @@
1
1
  from datetime import datetime
2
- from typing import Annotated, Literal, Optional, Union
2
+ from typing import Annotated, Literal, Union
3
3
 
4
4
  import pydantic
5
5
  from pydantic import BaseModel, Field
@@ -51,28 +51,28 @@ class ProviderJobs(BaseModel):
51
51
  class JobCost(BaseModel):
52
52
  total_cost: float = Field(default=0)
53
53
  currency_code: str = Field(default="USD")
54
- organization: Optional[str] = Field(default=None)
54
+ organization: str | None = Field(default=None)
55
55
  jobs: list[ProviderJobs] = Field(default=[])
56
56
 
57
57
 
58
58
  class ExecutionJobDetails(VersionedModel):
59
59
  id: str
60
60
 
61
- name: Optional[str] = Field(default=None)
61
+ name: str | None = Field(default=None)
62
62
  start_time: datetime
63
- end_time: Optional[datetime] = Field(default=None)
63
+ end_time: datetime | None = Field(default=None)
64
64
 
65
- provider: Optional[str] = Field(default=None)
66
- backend_name: Optional[str] = Field(default=None)
65
+ provider: str | None = Field(default=None)
66
+ backend_name: str | None = Field(default=None)
67
67
 
68
68
  status: JobStatus
69
69
 
70
- num_shots: Optional[int] = Field(default=None)
71
- program_id: Optional[str] = Field(default=None)
70
+ num_shots: int | None = Field(default=None)
71
+ program_id: str | None = Field(default=None)
72
72
 
73
- error: Optional[str] = Field(default=None)
73
+ error: str | None = Field(default=None)
74
74
 
75
- cost: Optional[JobCost] = Field(default=None)
75
+ cost: JobCost | None = Field(default=None)
76
76
 
77
77
 
78
78
  class ExecutionJobsQueryResults(VersionedModel):
@@ -1,7 +1,6 @@
1
- from typing import Annotated, Any, Literal, Union
1
+ from typing import Annotated, Any, Literal, TypeAlias, Union
2
2
 
3
3
  from pydantic import BaseModel, ConfigDict, Field
4
- from typing_extensions import TypeAlias
5
4
 
6
5
  from classiq.interface.applications.iqae.iqae_result import IQAEResult
7
6
  from classiq.interface.enum_utils import StrEnum
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from pathlib import Path
4
- from typing import Any, Optional, Union
4
+ from typing import Any
5
5
 
6
6
  import pydantic
7
7
  from pydantic import BaseModel, ConfigDict
@@ -35,7 +35,7 @@ class QuantumBaseCode(BaseModel):
35
35
  @pydantic.field_validator("code")
36
36
  @classmethod
37
37
  def load_quantum_program(
38
- cls, code: Union[CodeType, IonqQuantumCircuit], values: ValidationInfo
38
+ cls, code: CodeType | IonqQuantumCircuit, values: ValidationInfo
39
39
  ) -> CodeType:
40
40
  syntax = values.data.get("syntax")
41
41
  if isinstance(code, IonqQuantumCircuit):
@@ -57,11 +57,11 @@ class QuantumCode(QuantumBaseCode):
57
57
  default_factory=dict,
58
58
  description="The map of outputs to their qubits in the circuit.",
59
59
  )
60
- registers_initialization: Optional[RegistersInitialization] = pydantic.Field(
60
+ registers_initialization: RegistersInitialization | None = pydantic.Field(
61
61
  default=None,
62
62
  description="Initial conditions for the different registers in the circuit.",
63
63
  )
64
- synthesis_execution_data: Optional[ExecutionData] = pydantic.Field(default=None)
64
+ synthesis_execution_data: ExecutionData | None = pydantic.Field(default=None)
65
65
  synthesis_execution_arguments: Arguments = pydantic.Field(default_factory=dict)
66
66
  model_config = ConfigDict(validate_assignment=True)
67
67
 
@@ -90,9 +90,9 @@ class QuantumCode(QuantumBaseCode):
90
90
  @classmethod
91
91
  def validate_synthesis_execution_data(
92
92
  cls,
93
- synthesis_execution_data: Optional[ExecutionData],
93
+ synthesis_execution_data: ExecutionData | None,
94
94
  values: ValidationInfo,
95
- ) -> Optional[ExecutionData]:
95
+ ) -> ExecutionData | None:
96
96
  if (
97
97
  synthesis_execution_data is not None
98
98
  and synthesis_execution_data.function_execution
@@ -103,8 +103,8 @@ class QuantumCode(QuantumBaseCode):
103
103
 
104
104
  @staticmethod
105
105
  def from_file(
106
- file_path: Union[str, Path],
107
- syntax: Optional[Union[str, QuantumInstructionSet]] = None,
106
+ file_path: str | Path,
107
+ syntax: str | QuantumInstructionSet | None = None,
108
108
  arguments: MultipleArguments = (),
109
109
  ) -> QuantumCode:
110
110
  path = Path(file_path)