classiq 0.37.1__py3-none-any.whl → 0.39.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 (280) hide show
  1. classiq/__init__.py +23 -24
  2. classiq/_analyzer_extras/_ipywidgets_async_extension.py +1 -1
  3. classiq/_analyzer_extras/interactive_hardware.py +3 -3
  4. classiq/_internals/api_wrapper.py +37 -17
  5. classiq/_internals/async_utils.py +1 -74
  6. classiq/_internals/authentication/device.py +9 -4
  7. classiq/_internals/authentication/password_manager.py +25 -10
  8. classiq/_internals/authentication/token_manager.py +2 -2
  9. classiq/_internals/client.py +24 -6
  10. classiq/_internals/jobs.py +10 -7
  11. classiq/analyzer/analyzer.py +29 -29
  12. classiq/analyzer/analyzer_utilities.py +5 -5
  13. classiq/analyzer/rb.py +4 -5
  14. classiq/analyzer/show_interactive_hack.py +6 -6
  15. classiq/applications/__init__.py +1 -8
  16. classiq/applications/chemistry/__init__.py +6 -0
  17. classiq/{applications_model_constructors → applications/chemistry}/chemistry_model_constructor.py +9 -16
  18. classiq/applications/combinatorial_helpers/allowed_constraints.py +20 -0
  19. classiq/applications/combinatorial_helpers/arithmetic/arithmetic_expression.py +35 -0
  20. classiq/applications/combinatorial_helpers/arithmetic/isolation.py +42 -0
  21. classiq/applications/combinatorial_helpers/combinatorial_problem_utils.py +150 -0
  22. classiq/applications/combinatorial_helpers/encoding_mapping.py +107 -0
  23. classiq/applications/combinatorial_helpers/encoding_utils.py +122 -0
  24. classiq/applications/combinatorial_helpers/memory.py +77 -0
  25. classiq/applications/combinatorial_helpers/optimization_model.py +162 -0
  26. classiq/applications/combinatorial_helpers/pauli_helpers/pauli_sparsing.py +31 -0
  27. classiq/applications/combinatorial_helpers/pauli_helpers/pauli_utils.py +75 -0
  28. classiq/applications/combinatorial_helpers/py.typed +0 -0
  29. classiq/applications/combinatorial_helpers/pyomo_utils.py +245 -0
  30. classiq/applications/combinatorial_helpers/solvers/__init__.py +0 -0
  31. classiq/applications/combinatorial_helpers/sympy_utils.py +22 -0
  32. classiq/applications/combinatorial_helpers/transformations/__init__.py +0 -0
  33. classiq/applications/combinatorial_helpers/transformations/encoding.py +187 -0
  34. classiq/applications/combinatorial_helpers/transformations/fixed_variables.py +142 -0
  35. classiq/applications/combinatorial_helpers/transformations/ising_converter.py +122 -0
  36. classiq/applications/combinatorial_helpers/transformations/penalty.py +32 -0
  37. classiq/applications/combinatorial_helpers/transformations/penalty_support.py +37 -0
  38. classiq/applications/combinatorial_helpers/transformations/sign_seperation.py +75 -0
  39. classiq/applications/combinatorial_helpers/transformations/slack_variables.py +88 -0
  40. classiq/applications/combinatorial_optimization/__init__.py +13 -2
  41. classiq/applications/combinatorial_optimization/combinatorial_optimization_model_constructor.py +134 -0
  42. classiq/applications/finance/__init__.py +3 -2
  43. classiq/{applications_model_constructors → applications/finance}/finance_model_constructor.py +27 -30
  44. classiq/applications/grover/__init__.py +11 -0
  45. classiq/{applications_model_constructors → applications/grover}/grover_model_constructor.py +20 -91
  46. classiq/applications/libraries/__init__.py +0 -0
  47. classiq/applications/libraries/qmci_library.py +35 -0
  48. classiq/applications/qnn/circuit_utils.py +2 -2
  49. classiq/applications/qnn/gradients/quantum_gradient.py +2 -2
  50. classiq/applications/qnn/types.py +2 -2
  51. classiq/applications/qsvm/__init__.py +5 -1
  52. classiq/applications/qsvm/qsvm.py +4 -7
  53. classiq/applications/qsvm/qsvm_data_generation.py +2 -5
  54. classiq/exceptions.py +43 -1
  55. classiq/execution/all_hardware_devices.py +13 -0
  56. classiq/executor.py +12 -10
  57. classiq/interface/_version.py +1 -1
  58. classiq/interface/analyzer/analysis_params.py +6 -3
  59. classiq/interface/analyzer/result.py +12 -8
  60. classiq/interface/applications/qsvm.py +17 -3
  61. classiq/interface/ast_node.py +23 -0
  62. classiq/interface/backend/backend_preferences.py +4 -2
  63. classiq/interface/backend/pydantic_backend.py +3 -1
  64. classiq/interface/backend/quantum_backend_providers.py +1 -0
  65. classiq/interface/chemistry/fermionic_operator.py +15 -13
  66. classiq/interface/chemistry/ground_state_problem.py +18 -3
  67. classiq/interface/chemistry/molecule.py +8 -6
  68. classiq/interface/chemistry/operator.py +20 -14
  69. classiq/interface/combinatorial_optimization/examples/ascending_sequence.py +1 -1
  70. classiq/interface/combinatorial_optimization/examples/greater_than_ilp.py +1 -1
  71. classiq/interface/combinatorial_optimization/examples/ilp.py +2 -1
  72. classiq/interface/combinatorial_optimization/examples/integer_portfolio_optimization.py +2 -2
  73. classiq/interface/combinatorial_optimization/examples/mds.py +2 -1
  74. classiq/interface/combinatorial_optimization/examples/mht.py +8 -3
  75. classiq/interface/combinatorial_optimization/examples/mis.py +4 -1
  76. classiq/interface/combinatorial_optimization/examples/mvc.py +2 -1
  77. classiq/interface/combinatorial_optimization/examples/set_cover.py +2 -1
  78. classiq/interface/combinatorial_optimization/examples/tsp.py +4 -3
  79. classiq/interface/combinatorial_optimization/examples/tsp_digraph.py +6 -2
  80. classiq/interface/combinatorial_optimization/mht_qaoa_input.py +9 -3
  81. classiq/interface/executor/aws_execution_cost.py +4 -3
  82. classiq/interface/executor/estimation.py +2 -2
  83. classiq/interface/executor/execution_preferences.py +5 -34
  84. classiq/interface/executor/execution_request.py +15 -48
  85. classiq/interface/executor/optimizer_preferences.py +22 -13
  86. classiq/interface/executor/{quantum_program.py → quantum_code.py} +21 -15
  87. classiq/interface/executor/quantum_instruction_set.py +2 -1
  88. classiq/interface/executor/register_initialization.py +1 -3
  89. classiq/interface/executor/result.py +41 -10
  90. classiq/interface/executor/vqe_result.py +2 -2
  91. classiq/interface/finance/function_input.py +17 -4
  92. classiq/interface/finance/gaussian_model_input.py +3 -1
  93. classiq/interface/finance/log_normal_model_input.py +3 -1
  94. classiq/interface/finance/model_input.py +2 -0
  95. classiq/interface/generator/amplitude_loading.py +6 -3
  96. classiq/interface/generator/application_apis/__init__.py +1 -0
  97. classiq/interface/generator/application_apis/arithmetic_declarations.py +14 -0
  98. classiq/interface/generator/arith/argument_utils.py +14 -4
  99. classiq/interface/generator/arith/arithmetic.py +3 -1
  100. classiq/interface/generator/arith/arithmetic_arg_type_validator.py +12 -13
  101. classiq/interface/generator/arith/arithmetic_expression_abc.py +4 -1
  102. classiq/interface/generator/arith/arithmetic_expression_parser.py +8 -2
  103. classiq/interface/generator/arith/arithmetic_expression_validator.py +16 -2
  104. classiq/interface/generator/arith/arithmetic_operations.py +5 -10
  105. classiq/interface/generator/arith/ast_node_rewrite.py +1 -1
  106. classiq/interface/generator/arith/binary_ops.py +202 -54
  107. classiq/interface/generator/arith/extremum_operations.py +5 -3
  108. classiq/interface/generator/arith/logical_ops.py +4 -2
  109. classiq/interface/generator/arith/machine_precision.py +3 -0
  110. classiq/interface/generator/arith/number_utils.py +34 -44
  111. classiq/interface/generator/arith/register_user_input.py +21 -1
  112. classiq/interface/generator/arith/unary_ops.py +16 -25
  113. classiq/interface/generator/builtin_api_builder.py +0 -5
  114. classiq/interface/generator/chemistry_function_params.py +4 -4
  115. classiq/interface/generator/commuting_pauli_exponentiation.py +3 -1
  116. classiq/interface/generator/compiler_keywords.py +4 -0
  117. classiq/interface/generator/complex_type.py +3 -10
  118. classiq/interface/generator/constant.py +2 -3
  119. classiq/interface/generator/control_state.py +5 -3
  120. classiq/interface/generator/credit_risk_example/linear_gci.py +10 -3
  121. classiq/interface/generator/credit_risk_example/weighted_adder.py +14 -4
  122. classiq/interface/generator/expressions/atomic_expression_functions.py +5 -3
  123. classiq/interface/generator/expressions/evaluated_expression.py +18 -4
  124. classiq/interface/generator/expressions/expression.py +3 -5
  125. classiq/interface/generator/expressions/qmod_qscalar_proxy.py +33 -0
  126. classiq/interface/generator/expressions/sympy_supported_expressions.py +2 -1
  127. classiq/interface/generator/finance.py +1 -1
  128. classiq/interface/generator/function_params.py +7 -6
  129. classiq/interface/generator/functions/__init__.py +2 -2
  130. classiq/interface/generator/functions/builtins/__init__.py +15 -0
  131. classiq/interface/generator/functions/builtins/core_library/__init__.py +14 -0
  132. classiq/interface/generator/functions/builtins/core_library/chemistry_functions.py +0 -0
  133. classiq/interface/generator/functions/builtins/internal_operators.py +62 -0
  134. classiq/interface/generator/functions/{core_lib_declarations/quantum_functions/std_lib_functions.py → builtins/open_lib_functions.py} +612 -219
  135. classiq/interface/generator/functions/builtins/quantum_operators.py +37 -0
  136. classiq/interface/generator/functions/classical_type.py +2 -4
  137. classiq/interface/generator/functions/foreign_function_definition.py +12 -4
  138. classiq/interface/generator/functions/function_declaration.py +2 -2
  139. classiq/interface/generator/functions/function_implementation.py +8 -4
  140. classiq/interface/generator/functions/native_function_definition.py +4 -2
  141. classiq/interface/generator/functions/register.py +4 -2
  142. classiq/interface/generator/functions/register_mapping_data.py +14 -10
  143. classiq/interface/generator/generated_circuit_data.py +2 -2
  144. classiq/interface/generator/grover_operator.py +5 -3
  145. classiq/interface/generator/hamiltonian_evolution/suzuki_trotter.py +5 -1
  146. classiq/interface/generator/hardware/hardware_data.py +6 -4
  147. classiq/interface/generator/hardware_efficient_ansatz.py +25 -8
  148. classiq/interface/generator/hartree_fock.py +13 -3
  149. classiq/interface/generator/linear_pauli_rotations.py +3 -1
  150. classiq/interface/generator/mcu.py +5 -3
  151. classiq/interface/generator/mcx.py +7 -5
  152. classiq/interface/generator/model/classical_main_validator.py +1 -1
  153. classiq/interface/generator/model/constraints.py +2 -1
  154. classiq/interface/generator/model/model.py +12 -20
  155. classiq/interface/generator/model/preferences/preferences.py +4 -3
  156. classiq/interface/generator/oracles/custom_oracle.py +4 -2
  157. classiq/interface/generator/oracles/oracle_abc.py +2 -2
  158. classiq/interface/generator/qpe.py +6 -4
  159. classiq/interface/generator/qsvm.py +5 -8
  160. classiq/interface/generator/quantum_function_call.py +21 -16
  161. classiq/interface/generator/{generated_circuit.py → quantum_program.py} +10 -14
  162. classiq/interface/generator/range_types.py +3 -1
  163. classiq/interface/generator/slice_parsing_utils.py +8 -3
  164. classiq/interface/generator/standard_gates/controlled_standard_gates.py +4 -2
  165. classiq/interface/generator/state_preparation/metrics.py +2 -1
  166. classiq/interface/generator/state_preparation/state_preparation.py +7 -5
  167. classiq/interface/generator/state_propagator.py +16 -5
  168. classiq/interface/generator/types/builtin_struct_declarations/__init__.py +0 -1
  169. classiq/interface/generator/types/struct_declaration.py +10 -7
  170. classiq/interface/generator/ucc.py +6 -4
  171. classiq/interface/generator/unitary_gate.py +7 -3
  172. classiq/interface/generator/validations/flow_graph.py +6 -4
  173. classiq/interface/generator/validations/validator_functions.py +6 -4
  174. classiq/interface/hardware.py +2 -2
  175. classiq/interface/helpers/custom_encoders.py +3 -0
  176. classiq/interface/helpers/pydantic_model_helpers.py +0 -6
  177. classiq/interface/helpers/validation_helpers.py +1 -1
  178. classiq/interface/helpers/versioned_model.py +4 -1
  179. classiq/interface/ide/show.py +2 -2
  180. classiq/interface/jobs.py +72 -3
  181. classiq/interface/model/bind_operation.py +18 -11
  182. classiq/interface/model/call_synthesis_data.py +68 -0
  183. classiq/interface/model/classical_if.py +13 -0
  184. classiq/interface/model/classical_parameter_declaration.py +2 -3
  185. classiq/interface/model/control.py +16 -0
  186. classiq/interface/model/handle_binding.py +3 -2
  187. classiq/interface/model/inplace_binary_operation.py +2 -2
  188. classiq/interface/model/invert.py +10 -0
  189. classiq/interface/model/model.py +29 -22
  190. classiq/interface/model/native_function_definition.py +3 -5
  191. classiq/interface/model/power.py +12 -0
  192. classiq/interface/model/quantum_expressions/amplitude_loading_operation.py +9 -4
  193. classiq/interface/model/quantum_expressions/control_state.py +2 -2
  194. classiq/interface/model/quantum_function_call.py +33 -142
  195. classiq/interface/model/quantum_function_declaration.py +8 -0
  196. classiq/interface/model/quantum_if_operation.py +4 -5
  197. classiq/interface/model/quantum_lambda_function.py +58 -0
  198. classiq/{quantum_register.py → interface/model/quantum_register.py} +17 -9
  199. classiq/interface/model/quantum_statement.py +3 -2
  200. classiq/interface/model/quantum_type.py +58 -59
  201. classiq/interface/model/quantum_variable_declaration.py +3 -3
  202. classiq/interface/model/repeat.py +13 -0
  203. classiq/interface/model/resolvers/function_call_resolver.py +26 -0
  204. classiq/interface/model/statement_block.py +49 -0
  205. classiq/interface/model/validations/handles_validator.py +16 -18
  206. classiq/interface/model/within_apply_operation.py +11 -0
  207. classiq/interface/pyomo_extension/pyomo_sympy_bimap.py +4 -1
  208. classiq/interface/server/routes.py +5 -4
  209. classiq/qmod/__init__.py +13 -6
  210. classiq/qmod/builtins/classical_execution_primitives.py +27 -36
  211. classiq/qmod/builtins/classical_functions.py +22 -12
  212. classiq/qmod/builtins/functions.py +272 -328
  213. classiq/qmod/builtins/operations.py +171 -35
  214. classiq/qmod/builtins/structs.py +15 -15
  215. classiq/qmod/cfunc.py +42 -0
  216. classiq/qmod/classical_function.py +6 -14
  217. classiq/qmod/declaration_inferrer.py +12 -21
  218. classiq/qmod/expression_query.py +23 -0
  219. classiq/qmod/model_state_container.py +2 -0
  220. classiq/qmod/native/__init__.py +0 -0
  221. classiq/qmod/native/expression_to_qmod.py +189 -0
  222. classiq/qmod/native/pretty_printer.py +340 -0
  223. classiq/qmod/qfunc.py +27 -0
  224. classiq/qmod/qmod_constant.py +100 -0
  225. classiq/qmod/qmod_parameter.py +36 -13
  226. classiq/qmod/qmod_struct.py +3 -3
  227. classiq/qmod/qmod_variable.py +148 -31
  228. classiq/qmod/quantum_callable.py +1 -0
  229. classiq/qmod/quantum_expandable.py +18 -19
  230. classiq/qmod/quantum_function.py +41 -8
  231. classiq/qmod/symbolic.py +48 -5
  232. classiq/qmod/symbolic_expr.py +9 -0
  233. classiq/qmod/utilities.py +13 -0
  234. classiq/qmod/write_qmod.py +39 -0
  235. {classiq-0.37.1.dist-info → classiq-0.39.0.dist-info}/METADATA +2 -1
  236. {classiq-0.37.1.dist-info → classiq-0.39.0.dist-info}/RECORD +244 -225
  237. {classiq-0.37.1.dist-info → classiq-0.39.0.dist-info}/WHEEL +1 -1
  238. classiq/applications/benchmarking/__init__.py +0 -9
  239. classiq/applications/benchmarking/mirror_benchmarking.py +0 -67
  240. classiq/applications/numpy_utils.py +0 -37
  241. classiq/applications_model_constructors/__init__.py +0 -17
  242. classiq/applications_model_constructors/combinatorial_optimization_model_constructor.py +0 -178
  243. classiq/applications_model_constructors/libraries/qmci_library.py +0 -109
  244. classiq/builtin_functions/__init__.py +0 -43
  245. classiq/builtin_functions/amplitude_loading.py +0 -3
  246. classiq/builtin_functions/binary_ops.py +0 -1
  247. classiq/builtin_functions/exponentiation.py +0 -5
  248. classiq/builtin_functions/qpe.py +0 -4
  249. classiq/builtin_functions/qsvm.py +0 -7
  250. classiq/builtin_functions/range_types.py +0 -5
  251. classiq/builtin_functions/standard_gates.py +0 -1
  252. classiq/builtin_functions/state_preparation.py +0 -6
  253. classiq/builtin_functions/suzuki_trotter.py +0 -3
  254. classiq/interface/generator/expressions/qmod_qnum_proxy.py +0 -22
  255. classiq/interface/generator/functions/core_lib_declarations/quantum_functions/__init__.py +0 -18
  256. classiq/interface/generator/functions/core_lib_declarations/quantum_operators.py +0 -169
  257. classiq/interface/generator/types/builtin_struct_declarations/qaoa_declarations.py +0 -23
  258. classiq/interface/generator/types/combinatorial_problem.py +0 -26
  259. classiq/interface/model/numeric_reinterpretation.py +0 -25
  260. classiq/interface/model/operator_synthesis_data.py +0 -48
  261. classiq/model/__init__.py +0 -14
  262. classiq/model/composite_function_generator.py +0 -33
  263. classiq/model/function_handler.py +0 -466
  264. classiq/model/function_handler.pyi +0 -152
  265. classiq/model/logic_flow.py +0 -149
  266. classiq/model/logic_flow_change_handler.py +0 -71
  267. classiq/model/model.py +0 -246
  268. classiq/quantum_functions/__init__.py +0 -17
  269. classiq/quantum_functions/annotation_parser.py +0 -207
  270. classiq/quantum_functions/decorators.py +0 -22
  271. classiq/quantum_functions/function_library.py +0 -181
  272. classiq/quantum_functions/function_parser.py +0 -74
  273. classiq/quantum_functions/quantum_function.py +0 -236
  274. /classiq/{applications_model_constructors/libraries → applications/combinatorial_helpers}/__init__.py +0 -0
  275. /classiq/{interface/generator/functions/core_lib_declarations → applications/combinatorial_helpers/arithmetic}/__init__.py +0 -0
  276. /classiq/{interface/generator/functions/core_lib_declarations/quantum_functions/chemistry_functions.py → applications/combinatorial_helpers/pauli_helpers/__init__.py} +0 -0
  277. /classiq/{applications_model_constructors → applications}/libraries/ampltitude_estimation_library.py +0 -0
  278. /classiq/{applications_model_constructors → applications/qsvm}/qsvm_model_constructor.py +0 -0
  279. /classiq/interface/generator/functions/{core_lib_declarations/quantum_functions → builtins/core_library}/atomic_quantum_functions.py +0 -0
  280. /classiq/interface/generator/functions/{core_lib_declarations/quantum_functions → builtins/core_library}/exponentiation_functions.py +0 -0
@@ -2,78 +2,215 @@
2
2
 
3
3
  from typing import List, Literal
4
4
 
5
+ from classiq.qmod.qfunc import qfunc
5
6
  from classiq.qmod.qmod_parameter import QParam
6
7
  from classiq.qmod.qmod_variable import Input, Output, QArray, QBit, QNum
7
8
  from classiq.qmod.quantum_callable import QCallable, QCallableList
8
- from classiq.qmod.quantum_function import ExternalQFunc
9
9
 
10
10
  from .structs import *
11
11
 
12
12
 
13
- @ExternalQFunc
13
+ @qfunc(external=True)
14
+ def permute(
15
+ functions: QCallableList,
16
+ ) -> None:
17
+ pass
18
+
19
+
20
+ @qfunc(external=True)
21
+ def apply(
22
+ operand: QCallable,
23
+ ) -> None:
24
+ pass
25
+
26
+
27
+ @qfunc(external=True)
28
+ def molecule_ucc(
29
+ molecule_problem: QParam[MoleculeProblem],
30
+ excitations: QParam[List[int]],
31
+ qbv: QArray[
32
+ QBit,
33
+ Literal[
34
+ "len(get_field(molecule_problem_to_hamiltonian(molecule_problem)[0], 'pauli'))"
35
+ ],
36
+ ],
37
+ ) -> None:
38
+ pass
39
+
40
+
41
+ @qfunc(external=True)
42
+ def molecule_hva(
43
+ molecule_problem: QParam[MoleculeProblem],
44
+ reps: QParam[int],
45
+ qbv: QArray[
46
+ QBit,
47
+ Literal[
48
+ "len(get_field(molecule_problem_to_hamiltonian(molecule_problem)[0], 'pauli'))"
49
+ ],
50
+ ],
51
+ ) -> None:
52
+ pass
53
+
54
+
55
+ @qfunc(external=True)
56
+ def molecule_hartree_fock(
57
+ molecule_problem: QParam[MoleculeProblem],
58
+ qbv: QArray[
59
+ QBit,
60
+ Literal[
61
+ "len(get_field(molecule_problem_to_hamiltonian(molecule_problem)[0], 'pauli'))"
62
+ ],
63
+ ],
64
+ ) -> None:
65
+ pass
66
+
67
+
68
+ @qfunc(external=True)
69
+ def fock_hamiltonian_ucc(
70
+ fock_hamiltonian_problem: QParam[FockHamiltonianProblem],
71
+ excitations: QParam[List[int]],
72
+ qbv: QArray[
73
+ QBit,
74
+ Literal[
75
+ "len(get_field(fock_hamiltonian_problem_to_hamiltonian(fock_hamiltonian_problem)[0], 'pauli'))"
76
+ ],
77
+ ],
78
+ ) -> None:
79
+ pass
80
+
81
+
82
+ @qfunc(external=True)
83
+ def fock_hamiltonian_hva(
84
+ fock_hamiltonian_problem: QParam[FockHamiltonianProblem],
85
+ reps: QParam[int],
86
+ qbv: QArray[
87
+ QBit,
88
+ Literal[
89
+ "len(get_field(fock_hamiltonian_problem_to_hamiltonian(fock_hamiltonian_problem)[0], 'pauli'))"
90
+ ],
91
+ ],
92
+ ) -> None:
93
+ pass
94
+
95
+
96
+ @qfunc(external=True)
97
+ def fock_hamiltonian_hartree_fock(
98
+ fock_hamiltonian_problem: QParam[FockHamiltonianProblem],
99
+ qbv: QArray[
100
+ QBit,
101
+ Literal[
102
+ "len(get_field(fock_hamiltonian_problem_to_hamiltonian(fock_hamiltonian_problem)[0], 'pauli'))"
103
+ ],
104
+ ],
105
+ ) -> None:
106
+ pass
107
+
108
+
109
+ @qfunc(external=True)
110
+ def log_normal_finance(
111
+ finance_model: QParam[LogNormalModel],
112
+ finance_function: QParam[FinanceFunction],
113
+ func_port: QArray[QBit, Literal["get_field(finance_model, 'num_qubits')"]],
114
+ obj_port: QBit,
115
+ ) -> None:
116
+ pass
117
+
118
+
119
+ @qfunc(external=True)
120
+ def gaussian_finance(
121
+ finance_model: QParam[GaussianModel],
122
+ finance_function: QParam[FinanceFunction],
123
+ func_port: QArray[
124
+ QBit,
125
+ Literal[
126
+ "get_field(finance_model, 'num_qubits') + len(get_field(finance_model, 'rhos')) + floor(log(sum(get_field(finance_model, 'loss')), 2)) + 1"
127
+ ],
128
+ ],
129
+ obj_port: QBit,
130
+ ) -> None:
131
+ pass
132
+
133
+
134
+ @qfunc(external=True)
135
+ def pauli_feature_map(
136
+ feature_map: QParam[QSVMFeatureMapPauli],
137
+ qbv: QArray[QBit, Literal["get_field(feature_map, 'feature_dimension')"]],
138
+ ) -> None:
139
+ pass
140
+
141
+
142
+ @qfunc(external=True)
143
+ def bloch_sphere_feature_map(
144
+ feature_dimension: QParam[int],
145
+ qbv: QArray[QBit, Literal["ceiling(feature_dimension/2)"]],
146
+ ) -> None:
147
+ pass
148
+
149
+
150
+ @qfunc(external=True)
14
151
  def H(
15
152
  target: QBit,
16
153
  ) -> None:
17
154
  pass
18
155
 
19
156
 
20
- @ExternalQFunc
157
+ @qfunc(external=True)
21
158
  def X(
22
159
  target: QBit,
23
160
  ) -> None:
24
161
  pass
25
162
 
26
163
 
27
- @ExternalQFunc
164
+ @qfunc(external=True)
28
165
  def Y(
29
166
  target: QBit,
30
167
  ) -> None:
31
168
  pass
32
169
 
33
170
 
34
- @ExternalQFunc
171
+ @qfunc(external=True)
35
172
  def Z(
36
173
  target: QBit,
37
174
  ) -> None:
38
175
  pass
39
176
 
40
177
 
41
- @ExternalQFunc
178
+ @qfunc(external=True)
42
179
  def I(
43
180
  target: QBit,
44
181
  ) -> None:
45
182
  pass
46
183
 
47
184
 
48
- @ExternalQFunc
185
+ @qfunc(external=True)
49
186
  def S(
50
187
  target: QBit,
51
188
  ) -> None:
52
189
  pass
53
190
 
54
191
 
55
- @ExternalQFunc
192
+ @qfunc(external=True)
56
193
  def T(
57
194
  target: QBit,
58
195
  ) -> None:
59
196
  pass
60
197
 
61
198
 
62
- @ExternalQFunc
199
+ @qfunc(external=True)
63
200
  def SDG(
64
201
  target: QBit,
65
202
  ) -> None:
66
203
  pass
67
204
 
68
205
 
69
- @ExternalQFunc
206
+ @qfunc(external=True)
70
207
  def TDG(
71
208
  target: QBit,
72
209
  ) -> None:
73
210
  pass
74
211
 
75
212
 
76
- @ExternalQFunc
213
+ @qfunc(external=True)
77
214
  def PHASE(
78
215
  theta: QParam[float],
79
216
  target: QBit,
@@ -81,7 +218,7 @@ def PHASE(
81
218
  pass
82
219
 
83
220
 
84
- @ExternalQFunc
221
+ @qfunc(external=True)
85
222
  def RX(
86
223
  theta: QParam[float],
87
224
  target: QBit,
@@ -89,7 +226,7 @@ def RX(
89
226
  pass
90
227
 
91
228
 
92
- @ExternalQFunc
229
+ @qfunc(external=True)
93
230
  def RY(
94
231
  theta: QParam[float],
95
232
  target: QBit,
@@ -97,7 +234,7 @@ def RY(
97
234
  pass
98
235
 
99
236
 
100
- @ExternalQFunc
237
+ @qfunc(external=True)
101
238
  def RZ(
102
239
  theta: QParam[float],
103
240
  target: QBit,
@@ -105,7 +242,7 @@ def RZ(
105
242
  pass
106
243
 
107
244
 
108
- @ExternalQFunc
245
+ @qfunc(external=True)
109
246
  def R(
110
247
  theta: QParam[float],
111
248
  phi: QParam[float],
@@ -114,7 +251,7 @@ def R(
114
251
  pass
115
252
 
116
253
 
117
- @ExternalQFunc
254
+ @qfunc(external=True)
118
255
  def RXX(
119
256
  theta: QParam[float],
120
257
  target: QArray[QBit, Literal[2]],
@@ -122,7 +259,7 @@ def RXX(
122
259
  pass
123
260
 
124
261
 
125
- @ExternalQFunc
262
+ @qfunc(external=True)
126
263
  def RYY(
127
264
  theta: QParam[float],
128
265
  target: QArray[QBit, Literal[2]],
@@ -130,7 +267,7 @@ def RYY(
130
267
  pass
131
268
 
132
269
 
133
- @ExternalQFunc
270
+ @qfunc(external=True)
134
271
  def RZZ(
135
272
  theta: QParam[float],
136
273
  target: QArray[QBit, Literal[2]],
@@ -138,7 +275,7 @@ def RZZ(
138
275
  pass
139
276
 
140
277
 
141
- @ExternalQFunc
278
+ @qfunc(external=True)
142
279
  def CH(
143
280
  control: QBit,
144
281
  target: QBit,
@@ -146,7 +283,7 @@ def CH(
146
283
  pass
147
284
 
148
285
 
149
- @ExternalQFunc
286
+ @qfunc(external=True)
150
287
  def CX(
151
288
  control: QBit,
152
289
  target: QBit,
@@ -154,7 +291,7 @@ def CX(
154
291
  pass
155
292
 
156
293
 
157
- @ExternalQFunc
294
+ @qfunc(external=True)
158
295
  def CY(
159
296
  control: QBit,
160
297
  target: QBit,
@@ -162,7 +299,7 @@ def CY(
162
299
  pass
163
300
 
164
301
 
165
- @ExternalQFunc
302
+ @qfunc(external=True)
166
303
  def CZ(
167
304
  control: QBit,
168
305
  target: QBit,
@@ -170,7 +307,7 @@ def CZ(
170
307
  pass
171
308
 
172
309
 
173
- @ExternalQFunc
310
+ @qfunc(external=True)
174
311
  def CRX(
175
312
  theta: QParam[float],
176
313
  control: QBit,
@@ -179,7 +316,7 @@ def CRX(
179
316
  pass
180
317
 
181
318
 
182
- @ExternalQFunc
319
+ @qfunc(external=True)
183
320
  def CRY(
184
321
  theta: QParam[float],
185
322
  control: QBit,
@@ -188,7 +325,7 @@ def CRY(
188
325
  pass
189
326
 
190
327
 
191
- @ExternalQFunc
328
+ @qfunc(external=True)
192
329
  def CRZ(
193
330
  theta: QParam[float],
194
331
  control: QBit,
@@ -197,7 +334,7 @@ def CRZ(
197
334
  pass
198
335
 
199
336
 
200
- @ExternalQFunc
337
+ @qfunc(external=True)
201
338
  def CPHASE(
202
339
  theta: QParam[float],
203
340
  control: QBit,
@@ -206,7 +343,7 @@ def CPHASE(
206
343
  pass
207
344
 
208
345
 
209
- @ExternalQFunc
346
+ @qfunc(external=True)
210
347
  def SWAP(
211
348
  qbit0: QBit,
212
349
  qbit1: QBit,
@@ -214,14 +351,14 @@ def SWAP(
214
351
  pass
215
352
 
216
353
 
217
- @ExternalQFunc
354
+ @qfunc(external=True)
218
355
  def IDENTITY(
219
356
  target: QArray[QBit],
220
357
  ) -> None:
221
358
  pass
222
359
 
223
360
 
224
- @ExternalQFunc
361
+ @qfunc(external=True)
225
362
  def prepare_state(
226
363
  probabilities: QParam[List[float]],
227
364
  bound: QParam[float],
@@ -230,7 +367,7 @@ def prepare_state(
230
367
  pass
231
368
 
232
369
 
233
- @ExternalQFunc
370
+ @qfunc(external=True)
234
371
  def prepare_amplitudes(
235
372
  amplitudes: QParam[List[float]],
236
373
  bound: QParam[float],
@@ -239,7 +376,7 @@ def prepare_amplitudes(
239
376
  pass
240
377
 
241
378
 
242
- @ExternalQFunc
379
+ @qfunc(external=True)
243
380
  def unitary(
244
381
  elements: QParam[List[List[float]]],
245
382
  target: QArray[QBit, Literal["log(len(elements[0]), 2)"]],
@@ -247,7 +384,7 @@ def unitary(
247
384
  pass
248
385
 
249
386
 
250
- @ExternalQFunc
387
+ @qfunc(external=True)
251
388
  def add(
252
389
  left: QArray[QBit],
253
390
  right: QArray[QBit],
@@ -256,7 +393,7 @@ def add(
256
393
  pass
257
394
 
258
395
 
259
- @ExternalQFunc
396
+ @qfunc(external=True)
260
397
  def modular_add(
261
398
  left: QArray[QBit],
262
399
  right: QArray[QBit],
@@ -264,7 +401,7 @@ def modular_add(
264
401
  pass
265
402
 
266
403
 
267
- @ExternalQFunc
404
+ @qfunc(external=True)
268
405
  def integer_xor(
269
406
  left: QArray[QBit],
270
407
  right: QArray[QBit],
@@ -272,7 +409,7 @@ def integer_xor(
272
409
  pass
273
410
 
274
411
 
275
- @ExternalQFunc
412
+ @qfunc(external=True)
276
413
  def U(
277
414
  theta: QParam[float],
278
415
  phi: QParam[float],
@@ -283,7 +420,7 @@ def U(
283
420
  pass
284
421
 
285
422
 
286
- @ExternalQFunc
423
+ @qfunc(external=True)
287
424
  def CCX(
288
425
  control: QArray[QBit, Literal[2]],
289
426
  target: QBit,
@@ -291,7 +428,7 @@ def CCX(
291
428
  pass
292
429
 
293
430
 
294
- @ExternalQFunc
431
+ @qfunc(external=True)
295
432
  def allocate(
296
433
  num_qubits: QParam[int],
297
434
  out: Output[QArray[QBit, Literal["num_qubits"]]],
@@ -299,14 +436,14 @@ def allocate(
299
436
  pass
300
437
 
301
438
 
302
- @ExternalQFunc
439
+ @qfunc(external=True)
303
440
  def free(
304
441
  in_: Input[QArray[QBit]],
305
442
  ) -> None:
306
443
  pass
307
444
 
308
445
 
309
- @ExternalQFunc
446
+ @qfunc(external=True)
310
447
  def randomized_benchmarking(
311
448
  num_of_cliffords: QParam[int],
312
449
  target: QArray[QBit],
@@ -314,7 +451,7 @@ def randomized_benchmarking(
314
451
  pass
315
452
 
316
453
 
317
- @ExternalQFunc
454
+ @qfunc(external=True)
318
455
  def inplace_prepare_state(
319
456
  probabilities: QParam[List[float]],
320
457
  bound: QParam[float],
@@ -323,7 +460,7 @@ def inplace_prepare_state(
323
460
  pass
324
461
 
325
462
 
326
- @ExternalQFunc
463
+ @qfunc(external=True)
327
464
  def inplace_prepare_amplitudes(
328
465
  amplitudes: QParam[List[float]],
329
466
  bound: QParam[float],
@@ -332,7 +469,7 @@ def inplace_prepare_amplitudes(
332
469
  pass
333
470
 
334
471
 
335
- @ExternalQFunc
472
+ @qfunc(external=True)
336
473
  def single_pauli_exponent(
337
474
  pauli_string: QParam[List[int]],
338
475
  coefficient: QParam[float],
@@ -341,7 +478,7 @@ def single_pauli_exponent(
341
478
  pass
342
479
 
343
480
 
344
- @ExternalQFunc
481
+ @qfunc(external=True)
345
482
  def suzuki_trotter(
346
483
  pauli_operator: QParam[List[PauliTerm]],
347
484
  evolution_coefficient: QParam[float],
@@ -352,7 +489,7 @@ def suzuki_trotter(
352
489
  pass
353
490
 
354
491
 
355
- @ExternalQFunc
492
+ @qfunc(external=True)
356
493
  def qdrift(
357
494
  pauli_operator: QParam[List[PauliTerm]],
358
495
  evolution_coefficient: QParam[float],
@@ -362,7 +499,7 @@ def qdrift(
362
499
  pass
363
500
 
364
501
 
365
- @ExternalQFunc
502
+ @qfunc(external=True)
366
503
  def exponentiation_with_depth_constraint(
367
504
  pauli_operator: QParam[List[PauliTerm]],
368
505
  evolution_coefficient: QParam[float],
@@ -372,21 +509,21 @@ def exponentiation_with_depth_constraint(
372
509
  pass
373
510
 
374
511
 
375
- @ExternalQFunc
512
+ @qfunc(external=True)
376
513
  def qft_step(
377
514
  target: QArray[QBit],
378
515
  ) -> None:
379
516
  pass
380
517
 
381
518
 
382
- @ExternalQFunc
519
+ @qfunc(external=True)
383
520
  def qft(
384
521
  target: QArray[QBit],
385
522
  ) -> None:
386
523
  pass
387
524
 
388
525
 
389
- @ExternalQFunc
526
+ @qfunc(external=True)
390
527
  def qpe_flexible(
391
528
  unitary_with_power: QCallable[QParam[int]],
392
529
  phase: QNum,
@@ -394,7 +531,7 @@ def qpe_flexible(
394
531
  pass
395
532
 
396
533
 
397
- @ExternalQFunc
534
+ @qfunc(external=True)
398
535
  def qpe(
399
536
  unitary: QCallable,
400
537
  phase: QNum,
@@ -402,16 +539,7 @@ def qpe(
402
539
  pass
403
540
 
404
541
 
405
- @ExternalQFunc
406
- def standard_qpe(
407
- precision: QParam[int],
408
- unitary: QCallable,
409
- phase: QArray[QBit, Literal["precision"]],
410
- ) -> None:
411
- pass
412
-
413
-
414
- @ExternalQFunc
542
+ @qfunc(external=True)
415
543
  def single_pauli(
416
544
  slope: QParam[float],
417
545
  offset: QParam[float],
@@ -422,7 +550,7 @@ def single_pauli(
422
550
  pass
423
551
 
424
552
 
425
- @ExternalQFunc
553
+ @qfunc(external=True)
426
554
  def linear_pauli_rotations(
427
555
  bases: QParam[List[int]],
428
556
  slopes: QParam[List[float]],
@@ -433,78 +561,73 @@ def linear_pauli_rotations(
433
561
  pass
434
562
 
435
563
 
436
- @ExternalQFunc
564
+ @qfunc(external=True)
437
565
  def amplitude_estimation(
438
- num_phase_qubits: QParam[int],
439
- num_unitary_qubits: QParam[int],
440
- sp_op: QCallable[QParam[int], QArray[QBit, Literal["num_unitary_qubits"]]],
441
- oracle_op: QCallable[QParam[int], QArray[QBit, Literal["num_unitary_qubits"]]],
442
- phase_port: Output[QArray[QBit, Literal["num_phase_qubits"]]],
443
- unitary_port: Output[QArray[QBit, Literal["num_unitary_qubits"]]],
566
+ oracle: QCallable[QArray[QBit]],
567
+ space_transform: QCallable[QArray[QBit]],
568
+ phase: QNum,
569
+ packed_vars: QArray[QBit],
444
570
  ) -> None:
445
571
  pass
446
572
 
447
573
 
448
- @ExternalQFunc
449
- def simple_oracle(
450
- predicate: QCallable[QArray[QBit, Literal["len(target)"]], QBit],
574
+ @qfunc(external=True)
575
+ def phase_oracle(
576
+ predicate: QCallable[QArray[QBit], QArray[QBit]],
451
577
  target: QArray[QBit],
452
578
  ) -> None:
453
579
  pass
454
580
 
455
581
 
456
- @ExternalQFunc
457
- def grover_diffuser(
458
- num_qubits: QParam[int],
459
- p: QArray[QBit, Literal["num_qubits"]],
582
+ @qfunc(external=True)
583
+ def reflect_about_zero(
584
+ packed_vars: QArray[QBit],
460
585
  ) -> None:
461
586
  pass
462
587
 
463
588
 
464
- @ExternalQFunc
465
- def grover_operator(
466
- num_qubits: QParam[int],
467
- sp_op: QCallable[QParam[int], QArray[QBit, Literal["num_qubits"]]],
468
- oracle_op: QCallable[QParam[int], QArray[QBit, Literal["num_qubits"]]],
469
- p: QArray[QBit, Literal["num_qubits"]],
589
+ @qfunc(external=True)
590
+ def grover_diffuser(
591
+ space_transform: QCallable[QArray[QBit]],
592
+ packed_vars: QArray[QBit],
470
593
  ) -> None:
471
594
  pass
472
595
 
473
596
 
474
- @ExternalQFunc
475
- def hadamard_transform(
476
- target: QArray[QBit],
597
+ @qfunc(external=True)
598
+ def grover_operator(
599
+ oracle: QCallable[QArray[QBit]],
600
+ space_transform: QCallable[QArray[QBit]],
601
+ packed_vars: QArray[QBit],
477
602
  ) -> None:
478
603
  pass
479
604
 
480
605
 
481
- @ExternalQFunc
482
- def apply_to_all(
483
- gate_operand: QCallable[QBit],
484
- target: QArray[QBit],
606
+ @qfunc(external=True)
607
+ def grover_search(
608
+ reps: QParam[int],
609
+ oracle: QCallable[QArray[QBit]],
610
+ packed_vars: QArray[QBit],
485
611
  ) -> None:
486
612
  pass
487
613
 
488
614
 
489
- @ExternalQFunc
490
- def grover_search(
491
- num_qubits: QParam[int],
492
- reps: QParam[int],
493
- oracle_op: QCallable[QParam[int], QArray[QBit, Literal["num_qubits"]]],
494
- gsq: QArray[QBit, Literal["num_qubits"]],
615
+ @qfunc(external=True)
616
+ def hadamard_transform(
617
+ target: QArray[QBit],
495
618
  ) -> None:
496
619
  pass
497
620
 
498
621
 
499
- @ExternalQFunc
500
- def prepare_int(
501
- val: QParam[int],
502
- out: Output[QNum],
622
+ @qfunc(external=True)
623
+ def apply_to_all(
624
+ gate_operand: QCallable[QBit],
625
+ target: QArray[QBit],
503
626
  ) -> None:
504
627
  pass
505
628
 
506
629
 
507
- @ExternalQFunc
630
+ @qfunc(external=True)
508
631
  def allocate_num(
509
632
  num_qubits: QParam[int],
510
633
  is_signed: QParam[bool],
@@ -514,7 +637,7 @@ def allocate_num(
514
637
  pass
515
638
 
516
639
 
517
- @ExternalQFunc
640
+ @qfunc(external=True)
518
641
  def qaoa_mixer_layer(
519
642
  b: QParam[float],
520
643
  target: QArray[QBit],
@@ -522,46 +645,43 @@ def qaoa_mixer_layer(
522
645
  pass
523
646
 
524
647
 
525
- @ExternalQFunc
648
+ @qfunc(external=True)
526
649
  def qaoa_cost_layer(
527
650
  g: QParam[float],
528
651
  hamiltonian: QParam[List[PauliTerm]],
529
- is_st: QParam[bool],
530
652
  target: QArray[QBit],
531
653
  ) -> None:
532
654
  pass
533
655
 
534
656
 
535
- @ExternalQFunc
657
+ @qfunc(external=True)
536
658
  def qaoa_layer(
537
659
  g: QParam[float],
538
660
  b: QParam[float],
539
661
  hamiltonian: QParam[List[PauliTerm]],
540
- is_st: QParam[bool],
541
662
  target: QArray[QBit],
542
663
  ) -> None:
543
664
  pass
544
665
 
545
666
 
546
- @ExternalQFunc
667
+ @qfunc(external=True)
547
668
  def qaoa_init(
548
669
  target: QArray[QBit],
549
670
  ) -> None:
550
671
  pass
551
672
 
552
673
 
553
- @ExternalQFunc
674
+ @qfunc(external=True)
554
675
  def qaoa_penalty(
555
676
  num_qubits: QParam[int],
556
677
  params_list: QParam[List[float]],
557
678
  hamiltonian: QParam[List[PauliTerm]],
558
- is_st: QParam[bool],
559
679
  target: QArray[QBit, Literal["num_qubits"]],
560
680
  ) -> None:
561
681
  pass
562
682
 
563
683
 
564
- @ExternalQFunc
684
+ @qfunc(external=True)
565
685
  def full_hea(
566
686
  num_qubits: QParam[int],
567
687
  is_parametrized: QParam[List[int]],
@@ -575,7 +695,7 @@ def full_hea(
575
695
  pass
576
696
 
577
697
 
578
- @ExternalQFunc
698
+ @qfunc(external=True)
579
699
  def swap_test(
580
700
  state1: QArray[QBit],
581
701
  state2: QArray[QBit],
@@ -584,226 +704,67 @@ def swap_test(
584
704
  pass
585
705
 
586
706
 
587
- @ExternalQFunc
588
- def repeat(
589
- count: QParam[int],
590
- iteration: QCallable[QParam[int]],
591
- ) -> None:
592
- pass
593
-
594
-
595
- @ExternalQFunc
596
- def invert(
597
- operand: QCallable,
598
- ) -> None:
599
- pass
600
-
601
-
602
- @ExternalQFunc
603
- def control(
604
- operand: QCallable,
605
- ctrl: QArray[QBit],
606
- ) -> None:
607
- pass
608
-
609
-
610
- @ExternalQFunc
611
- def if_(
612
- condition: QParam[bool],
613
- then: QCallable,
614
- else_: QCallable,
615
- ) -> None:
616
- pass
617
-
618
-
619
- @ExternalQFunc
620
- def switch(
621
- selector: QParam[int],
622
- cases: QCallableList,
623
- ) -> None:
624
- pass
625
-
626
-
627
- @ExternalQFunc
628
- def join(
629
- in1: Input[QArray[QBit]],
630
- in2: Input[QArray[QBit]],
631
- out: Output[QArray[QBit, Literal["len(in1)+len(in2)"]]],
632
- ) -> None:
633
- pass
634
-
635
-
636
- @ExternalQFunc
637
- def split(
638
- out1_size: QParam[int],
639
- out2_size: QParam[int],
640
- in_: Input[QArray[QBit, Literal["out1_size+out2_size"]]],
641
- out1: Output[QArray[QBit, Literal["out1_size"]]],
642
- out2: Output[QArray[QBit, Literal["out2_size"]]],
707
+ @qfunc(external=True)
708
+ def prepare_ghz_state(
709
+ size: QParam[int],
710
+ q: Output[QArray[QBit]],
643
711
  ) -> None:
644
712
  pass
645
713
 
646
714
 
647
- @ExternalQFunc
648
- def permute(
649
- functions: QCallableList,
650
- ) -> None:
651
- pass
652
-
653
-
654
- @ExternalQFunc
655
- def power(
656
- power: QParam[int],
657
- operand: QCallable,
658
- ) -> None:
659
- pass
660
-
661
-
662
- @ExternalQFunc
663
- def apply(
664
- operand: QCallable,
665
- ) -> None:
666
- pass
667
-
668
-
669
- @ExternalQFunc
670
- def compute(
671
- operand: QCallable,
672
- ) -> None:
673
- pass
674
-
675
-
676
- @ExternalQFunc
677
- def uncompute(
678
- operand: QCallable,
679
- ) -> None:
680
- pass
681
-
682
-
683
- @ExternalQFunc
684
- def molecule_ucc(
685
- molecule_problem: QParam[MoleculeProblem],
686
- excitations: QParam[List[int]],
687
- qbv: QArray[
688
- QBit,
689
- Literal[
690
- "len(get_field(molecule_problem_to_hamiltonian(molecule_problem)[0], 'pauli'))"
691
- ],
692
- ],
693
- ) -> None:
694
- pass
695
-
696
-
697
- @ExternalQFunc
698
- def molecule_hva(
699
- molecule_problem: QParam[MoleculeProblem],
700
- reps: QParam[int],
701
- qbv: QArray[
702
- QBit,
703
- Literal[
704
- "len(get_field(molecule_problem_to_hamiltonian(molecule_problem)[0], 'pauli'))"
705
- ],
706
- ],
707
- ) -> None:
708
- pass
709
-
710
-
711
- @ExternalQFunc
712
- def molecule_hartree_fock(
713
- molecule_problem: QParam[MoleculeProblem],
714
- qbv: QArray[
715
- QBit,
716
- Literal[
717
- "len(get_field(molecule_problem_to_hamiltonian(molecule_problem)[0], 'pauli'))"
718
- ],
719
- ],
720
- ) -> None:
721
- pass
722
-
723
-
724
- @ExternalQFunc
725
- def fock_hamiltonian_ucc(
726
- fock_hamiltonian_problem: QParam[FockHamiltonianProblem],
727
- excitations: QParam[List[int]],
728
- qbv: QArray[
729
- QBit,
730
- Literal[
731
- "len(get_field(fock_hamiltonian_problem_to_hamiltonian(fock_hamiltonian_problem)[0], 'pauli'))"
732
- ],
733
- ],
734
- ) -> None:
735
- pass
736
-
737
-
738
- @ExternalQFunc
739
- def fock_hamiltonian_hva(
740
- fock_hamiltonian_problem: QParam[FockHamiltonianProblem],
741
- reps: QParam[int],
742
- qbv: QArray[
743
- QBit,
744
- Literal[
745
- "len(get_field(fock_hamiltonian_problem_to_hamiltonian(fock_hamiltonian_problem)[0], 'pauli'))"
746
- ],
747
- ],
748
- ) -> None:
749
- pass
750
-
751
-
752
- @ExternalQFunc
753
- def fock_hamiltonian_hartree_fock(
754
- fock_hamiltonian_problem: QParam[FockHamiltonianProblem],
755
- qbv: QArray[
756
- QBit,
757
- Literal[
758
- "len(get_field(fock_hamiltonian_problem_to_hamiltonian(fock_hamiltonian_problem)[0], 'pauli'))"
759
- ],
760
- ],
715
+ @qfunc(external=True)
716
+ def prepare_exponential_state(
717
+ rate: QParam[int],
718
+ q: QArray[QBit],
761
719
  ) -> None:
762
720
  pass
763
721
 
764
722
 
765
- @ExternalQFunc
766
- def log_normal_finance(
767
- finance_model: QParam[LogNormalModel],
768
- finance_function: QParam[FinanceFunction],
769
- func_port: QArray[QBit, Literal["get_field(finance_model, 'num_qubits')"]],
770
- obj_port: QBit,
723
+ @qfunc(external=True)
724
+ def prepare_bell_state(
725
+ state_num: QParam[int],
726
+ q: Output[QArray[QBit]],
771
727
  ) -> None:
772
728
  pass
773
729
 
774
730
 
775
- @ExternalQFunc
776
- def gaussian_finance(
777
- finance_model: QParam[GaussianModel],
778
- finance_function: QParam[FinanceFunction],
779
- func_port: QArray[
780
- QBit,
781
- Literal[
782
- "get_field(finance_model, 'num_qubits') + len(get_field(finance_model, 'rhos')) + floor(log(sum(get_field(finance_model, 'loss')), 2)) + 1"
783
- ],
784
- ],
785
- obj_port: QBit,
731
+ @qfunc(external=True)
732
+ def inplace_prepare_int(
733
+ value: QParam[int],
734
+ target: QArray[QBit],
786
735
  ) -> None:
787
736
  pass
788
737
 
789
738
 
790
- @ExternalQFunc
791
- def pauli_feature_map(
792
- feature_map: QParam[QSVMFeatureMapPauli],
793
- qbv: QArray[QBit, Literal["get_field(feature_map, 'feature_dimension')"]],
739
+ @qfunc(external=True)
740
+ def prepare_int(
741
+ value: QParam[int],
742
+ out: Output[QNum],
794
743
  ) -> None:
795
744
  pass
796
745
 
797
746
 
798
- @ExternalQFunc
799
- def bloch_sphere_feature_map(
800
- feature_dimension: QParam[int],
801
- qbv: QArray[QBit, Literal["ceiling(feature_dimension/2)"]],
747
+ @qfunc(external=True)
748
+ def switch(
749
+ selector: QParam[int],
750
+ cases: QCallableList,
802
751
  ) -> None:
803
752
  pass
804
753
 
805
754
 
806
755
  __all__ = [
756
+ "permute",
757
+ "apply",
758
+ "molecule_ucc",
759
+ "molecule_hva",
760
+ "molecule_hartree_fock",
761
+ "fock_hamiltonian_ucc",
762
+ "fock_hamiltonian_hva",
763
+ "fock_hamiltonian_hartree_fock",
764
+ "log_normal_finance",
765
+ "gaussian_finance",
766
+ "pauli_feature_map",
767
+ "bloch_sphere_feature_map",
807
768
  "H",
808
769
  "X",
809
770
  "Y",
@@ -852,17 +813,16 @@ __all__ = [
852
813
  "qft",
853
814
  "qpe_flexible",
854
815
  "qpe",
855
- "standard_qpe",
856
816
  "single_pauli",
857
817
  "linear_pauli_rotations",
858
818
  "amplitude_estimation",
859
- "simple_oracle",
819
+ "phase_oracle",
820
+ "reflect_about_zero",
860
821
  "grover_diffuser",
861
822
  "grover_operator",
823
+ "grover_search",
862
824
  "hadamard_transform",
863
825
  "apply_to_all",
864
- "grover_search",
865
- "prepare_int",
866
826
  "allocate_num",
867
827
  "qaoa_mixer_layer",
868
828
  "qaoa_cost_layer",
@@ -871,26 +831,10 @@ __all__ = [
871
831
  "qaoa_penalty",
872
832
  "full_hea",
873
833
  "swap_test",
874
- "repeat",
875
- "invert",
876
- "control",
877
- "if_",
834
+ "prepare_ghz_state",
835
+ "prepare_exponential_state",
836
+ "prepare_bell_state",
837
+ "inplace_prepare_int",
838
+ "prepare_int",
878
839
  "switch",
879
- "join",
880
- "split",
881
- "permute",
882
- "power",
883
- "apply",
884
- "compute",
885
- "uncompute",
886
- "molecule_ucc",
887
- "molecule_hva",
888
- "molecule_hartree_fock",
889
- "fock_hamiltonian_ucc",
890
- "fock_hamiltonian_hva",
891
- "fock_hamiltonian_hartree_fock",
892
- "log_normal_finance",
893
- "gaussian_finance",
894
- "pauli_feature_map",
895
- "bloch_sphere_feature_map",
896
840
  ]