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
@@ -6,6 +6,7 @@ from classiq.interface.model.quantum_function_declaration import (
6
6
 
7
7
  QFT_STEP = QuantumFunctionDeclaration.parse_raw(
8
8
  """{
9
+ "source_ref": null,
9
10
  "name": "qft_step",
10
11
  "param_decls": {},
11
12
  "port_declarations": {
@@ -21,6 +22,7 @@ QFT_STEP = QuantumFunctionDeclaration.parse_raw(
21
22
 
22
23
  QFT = QuantumFunctionDeclaration.parse_raw(
23
24
  """{
25
+ "source_ref": null,
24
26
  "name": "qft",
25
27
  "param_decls": {},
26
28
  "port_declarations": {
@@ -36,13 +38,13 @@ QFT = QuantumFunctionDeclaration.parse_raw(
36
38
 
37
39
  QPE_FLEXIBLE = QuantumFunctionDeclaration.parse_raw(
38
40
  """{
41
+ "source_ref": null,
39
42
  "name": "qpe_flexible",
40
43
  "param_decls": {},
41
44
  "port_declarations": {
42
45
  "phase": {
43
46
  "name": "phase",
44
47
  "quantum_type": {
45
- "size": null,
46
48
  "kind": "qnum"
47
49
  },
48
50
  "direction": "inout"
@@ -78,7 +80,6 @@ QPE_FLEXIBLE = QuantumFunctionDeclaration.parse_raw(
78
80
  {
79
81
  "name": "phase",
80
82
  "quantum_type": {
81
- "size": null,
82
83
  "kind": "qnum"
83
84
  },
84
85
  "direction": "inout"
@@ -89,13 +90,13 @@ QPE_FLEXIBLE = QuantumFunctionDeclaration.parse_raw(
89
90
 
90
91
  QPE = QuantumFunctionDeclaration.parse_raw(
91
92
  """{
93
+ "source_ref": null,
92
94
  "name": "qpe",
93
95
  "param_decls": {},
94
96
  "port_declarations": {
95
97
  "phase": {
96
98
  "name": "phase",
97
99
  "quantum_type": {
98
- "size": null,
99
100
  "kind": "qnum"
100
101
  },
101
102
  "direction": "inout"
@@ -117,7 +118,6 @@ QPE = QuantumFunctionDeclaration.parse_raw(
117
118
  {
118
119
  "name": "phase",
119
120
  "quantum_type": {
120
- "size": null,
121
121
  "kind": "qnum"
122
122
  },
123
123
  "direction": "inout"
@@ -126,34 +126,9 @@ QPE = QuantumFunctionDeclaration.parse_raw(
126
126
  }"""
127
127
  )
128
128
 
129
- STANDARD_QPE = QuantumFunctionDeclaration.parse_raw(
130
- """{
131
- "name": "standard_qpe",
132
- "param_decls": {
133
- "precision": {
134
- "kind": "int"
135
- }
136
- },
137
- "port_declarations": {
138
- "phase": {
139
- "name": "phase",
140
- "size": {
141
- "expr": "precision"
142
- },
143
- "direction": "inout"
144
- }
145
- },
146
- "operand_declarations": {
147
- "unitary": {
148
- "name": "unitary"
149
- }
150
- },
151
- "positional_arg_declarations": []
152
- }"""
153
- )
154
-
155
129
  SINGLE_PAULI = QuantumFunctionDeclaration.parse_raw(
156
130
  """{
131
+ "source_ref": null,
157
132
  "name": "single_pauli",
158
133
  "param_decls": {
159
134
  "slope": {
@@ -201,6 +176,7 @@ SINGLE_PAULI = QuantumFunctionDeclaration.parse_raw(
201
176
 
202
177
  LINEAR_PAULI_ROTATIONS = QuantumFunctionDeclaration.parse_raw(
203
178
  """{
179
+ "source_ref": null,
204
180
  "name": "linear_pauli_rotations",
205
181
  "param_decls": {
206
182
  "bases": {
@@ -239,261 +215,452 @@ LINEAR_PAULI_ROTATIONS = QuantumFunctionDeclaration.parse_raw(
239
215
 
240
216
  AMPLITUDE_ESTIMATION = QuantumFunctionDeclaration.parse_raw(
241
217
  """{
218
+ "source_ref": null,
242
219
  "name": "amplitude_estimation",
243
- "param_decls": {
244
- "num_phase_qubits": {
245
- "kind": "int"
246
- },
247
- "num_unitary_qubits": {
248
- "kind": "int"
249
- }
250
- },
220
+ "param_decls": {},
251
221
  "port_declarations": {
252
- "phase_port": {
253
- "name": "phase_port",
254
- "size": {
255
- "expr": "num_phase_qubits"
222
+ "phase": {
223
+ "name": "phase",
224
+ "quantum_type": {
225
+ "kind": "qnum"
256
226
  },
257
- "direction": "output"
227
+ "direction": "inout"
258
228
  },
259
- "unitary_port": {
260
- "name": "unitary_port",
261
- "size": {
262
- "expr": "num_unitary_qubits"
229
+ "packed_vars": {
230
+ "name": "packed_vars",
231
+ "quantum_type": {
232
+ "length": null,
233
+ "kind": "qvec"
263
234
  },
264
- "direction": "output"
235
+ "direction": "inout"
265
236
  }
266
237
  },
267
238
  "operand_declarations": {
268
- "sp_op": {
269
- "name": "sp_op",
270
- "param_decls": {
271
- "num_unitary_qubits": {
272
- "kind": "int"
273
- }
274
- },
275
- "port_declarations": {
276
- "spq": {
277
- "name": "spq",
278
- "size": {
279
- "expr": "num_unitary_qubits"
239
+ "oracle": {
240
+ "name": "oracle",
241
+ "positional_arg_declarations": [
242
+ {
243
+ "name": "arg0",
244
+ "quantum_type": {
245
+ "length": null,
246
+ "kind": "qvec"
280
247
  },
281
248
  "direction": "inout"
282
249
  }
283
- }
250
+ ],
251
+ "is_list": false
284
252
  },
285
- "oracle_op": {
286
- "name": "oracle_op",
287
- "param_decls": {
288
- "num_unitary_qubits": {
289
- "kind": "int"
290
- }
291
- },
292
- "port_declarations": {
293
- "oq": {
294
- "name": "oq",
295
- "size": {
296
- "expr": "num_unitary_qubits"
253
+ "space_transform": {
254
+ "name": "space_transform",
255
+ "positional_arg_declarations": [
256
+ {
257
+ "name": "arg0",
258
+ "quantum_type": {
259
+ "length": null,
260
+ "kind": "qvec"
297
261
  },
298
262
  "direction": "inout"
299
263
  }
300
- }
264
+ ],
265
+ "is_list": false
301
266
  }
302
267
  },
303
- "positional_arg_declarations": []
268
+ "positional_arg_declarations": [
269
+ {
270
+ "name": "oracle",
271
+ "positional_arg_declarations": [
272
+ {
273
+ "name": "arg0",
274
+ "quantum_type": {
275
+ "length": null,
276
+ "kind": "qvec"
277
+ },
278
+ "direction": "inout"
279
+ }
280
+ ],
281
+ "is_list": false
282
+ },
283
+ {
284
+ "name": "space_transform",
285
+ "positional_arg_declarations": [
286
+ {
287
+ "name": "arg0",
288
+ "quantum_type": {
289
+ "length": null,
290
+ "kind": "qvec"
291
+ },
292
+ "direction": "inout"
293
+ }
294
+ ],
295
+ "is_list": false
296
+ },
297
+ {
298
+ "name": "phase",
299
+ "quantum_type": {
300
+ "kind": "qnum"
301
+ },
302
+ "direction": "inout"
303
+ },
304
+ {
305
+ "name": "packed_vars",
306
+ "quantum_type": {
307
+ "length": null,
308
+ "kind": "qvec"
309
+ },
310
+ "direction": "inout"
311
+ }
312
+ ]
304
313
  }"""
305
314
  )
306
315
 
307
- SIMPLE_ORACLE = QuantumFunctionDeclaration.parse_raw(
316
+ PHASE_ORACLE = QuantumFunctionDeclaration.parse_raw(
308
317
  """{
309
- "name": "simple_oracle",
318
+ "source_ref": null,
319
+ "name": "phase_oracle",
310
320
  "param_decls": {},
311
321
  "port_declarations": {
312
322
  "target": {
313
323
  "name": "target",
324
+ "quantum_type": {
325
+ "length": null,
326
+ "kind": "qvec"
327
+ },
314
328
  "direction": "inout"
315
329
  }
316
330
  },
317
331
  "operand_declarations": {
318
332
  "predicate": {
319
333
  "name": "predicate",
320
- "port_declarations": {
321
- "vars": {
322
- "name": "vars",
323
- "size": {
324
- "expr": "len(target)"
334
+ "positional_arg_declarations": [
335
+ {
336
+ "name": "arg0",
337
+ "quantum_type": {
338
+ "length": null,
339
+ "kind": "qvec"
325
340
  },
326
341
  "direction": "inout"
327
342
  },
328
- "result": {
329
- "name": "result",
330
- "size": {
331
- "expr": "1"
343
+ {
344
+ "name": "arg1",
345
+ "quantum_type": {
346
+ "kind": "qbit"
332
347
  },
333
348
  "direction": "inout"
334
349
  }
335
- }
350
+ ],
351
+ "is_list": false
336
352
  }
337
353
  },
338
- "positional_arg_declarations": []
354
+ "positional_arg_declarations": [
355
+ {
356
+ "name": "predicate",
357
+ "positional_arg_declarations": [
358
+ {
359
+ "name": "arg0",
360
+ "quantum_type": {
361
+ "length": null,
362
+ "kind": "qvec"
363
+ },
364
+ "direction": "inout"
365
+ },
366
+ {
367
+ "name": "arg1",
368
+ "quantum_type": {
369
+ "kind": "qbit"
370
+ },
371
+ "direction": "inout"
372
+ }
373
+ ],
374
+ "is_list": false
375
+ },
376
+ {
377
+ "name": "target",
378
+ "quantum_type": {
379
+ "length": null,
380
+ "kind": "qvec"
381
+ },
382
+ "direction": "inout"
383
+ }
384
+ ]
339
385
  }"""
340
386
  )
341
387
 
342
- GROVER_DIFFUSER = QuantumFunctionDeclaration.parse_raw(
388
+ REFLECT_ABOUT_ZERO = QuantumFunctionDeclaration.parse_raw(
343
389
  """{
344
- "name": "grover_diffuser",
345
- "param_decls": {
346
- "num_qubits": {
347
- "kind": "int"
348
- }
349
- },
390
+ "source_ref": null,
391
+ "name": "reflect_about_zero",
392
+ "param_decls": {},
350
393
  "port_declarations": {
351
- "p": {
352
- "name": "p",
353
- "size": {
354
- "expr": "num_qubits"
394
+ "packed_vars": {
395
+ "name": "packed_vars",
396
+ "quantum_type": {
397
+ "length": null,
398
+ "kind": "qvec"
355
399
  },
356
400
  "direction": "inout"
357
401
  }
358
402
  },
359
403
  "operand_declarations": {},
360
- "positional_arg_declarations": []
404
+ "positional_arg_declarations": [
405
+ {
406
+ "name": "packed_vars",
407
+ "quantum_type": {
408
+ "length": null,
409
+ "kind": "qvec"
410
+ },
411
+ "direction": "inout"
412
+ }
413
+ ]
361
414
  }"""
362
415
  )
363
416
 
364
- GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
417
+ GROVER_DIFFUSER = QuantumFunctionDeclaration.parse_raw(
365
418
  """{
366
- "name": "grover_operator",
367
- "param_decls": {
368
- "num_qubits": {
369
- "kind": "int"
370
- }
371
- },
419
+ "source_ref": null,
420
+ "name": "grover_diffuser",
421
+ "param_decls": {},
372
422
  "port_declarations": {
373
- "p": {
374
- "name": "p",
375
- "size": {
376
- "expr": "num_qubits"
423
+ "packed_vars": {
424
+ "name": "packed_vars",
425
+ "quantum_type": {
426
+ "length": null,
427
+ "kind": "qvec"
377
428
  },
378
429
  "direction": "inout"
379
430
  }
380
431
  },
381
432
  "operand_declarations": {
382
- "sp_op": {
383
- "name": "sp_op",
384
- "param_decls": {
385
- "num_qubits": {
386
- "kind": "int"
387
- }
388
- },
389
- "port_declarations": {
390
- "spq": {
391
- "name": "spq",
392
- "size": {
393
- "expr": "num_qubits"
433
+ "space_transform": {
434
+ "name": "space_transform",
435
+ "positional_arg_declarations": [
436
+ {
437
+ "name": "arg0",
438
+ "quantum_type": {
439
+ "length": null,
440
+ "kind": "qvec"
394
441
  },
395
442
  "direction": "inout"
396
443
  }
397
- }
398
- },
399
- "oracle_op": {
400
- "name": "oracle_op",
401
- "param_decls": {
402
- "num_qubits": {
403
- "kind": "int"
404
- }
405
- },
406
- "port_declarations": {
407
- "oq": {
408
- "name": "oq",
409
- "size": {
410
- "expr": "num_qubits"
444
+ ],
445
+ "is_list": false
446
+ }
447
+ },
448
+ "positional_arg_declarations": [
449
+ {
450
+ "name": "space_transform",
451
+ "positional_arg_declarations": [
452
+ {
453
+ "name": "arg0",
454
+ "quantum_type": {
455
+ "length": null,
456
+ "kind": "qvec"
411
457
  },
412
458
  "direction": "inout"
413
459
  }
414
- }
460
+ ],
461
+ "is_list": false
462
+ },
463
+ {
464
+ "name": "packed_vars",
465
+ "quantum_type": {
466
+ "length": null,
467
+ "kind": "qvec"
468
+ },
469
+ "direction": "inout"
415
470
  }
416
- },
417
- "positional_arg_declarations": []
471
+ ]
418
472
  }"""
419
473
  )
420
474
 
421
- HADAMARD_TRANSFORM = QuantumFunctionDeclaration.parse_raw(
475
+ GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
422
476
  """{
423
- "name": "hadamard_transform",
477
+ "source_ref": null,
478
+ "name": "grover_operator",
424
479
  "param_decls": {},
425
480
  "port_declarations": {
426
- "target": {
427
- "name": "target",
481
+ "packed_vars": {
482
+ "name": "packed_vars",
483
+ "quantum_type": {
484
+ "length": null,
485
+ "kind": "qvec"
486
+ },
428
487
  "direction": "inout"
429
488
  }
430
489
  },
431
- "operand_declarations": {},
432
- "positional_arg_declarations": []
490
+ "operand_declarations": {
491
+ "oracle": {
492
+ "name": "oracle",
493
+ "positional_arg_declarations": [
494
+ {
495
+ "name": "arg0",
496
+ "quantum_type": {
497
+ "length": null,
498
+ "kind": "qvec"
499
+ },
500
+ "direction": "inout"
501
+ }
502
+ ],
503
+ "is_list": false
504
+ },
505
+ "space_transform": {
506
+ "name": "space_transform",
507
+ "positional_arg_declarations": [
508
+ {
509
+ "name": "arg0",
510
+ "quantum_type": {
511
+ "length": null,
512
+ "kind": "qvec"
513
+ },
514
+ "direction": "inout"
515
+ }
516
+ ],
517
+ "is_list": false
518
+ }
519
+ },
520
+ "positional_arg_declarations": [
521
+ {
522
+ "name": "oracle",
523
+ "positional_arg_declarations": [
524
+ {
525
+ "name": "arg0",
526
+ "quantum_type": {
527
+ "length": null,
528
+ "kind": "qvec"
529
+ },
530
+ "direction": "inout"
531
+ }
532
+ ],
533
+ "is_list": false
534
+ },
535
+ {
536
+ "name": "space_transform",
537
+ "positional_arg_declarations": [
538
+ {
539
+ "name": "arg0",
540
+ "quantum_type": {
541
+ "length": null,
542
+ "kind": "qvec"
543
+ },
544
+ "direction": "inout"
545
+ }
546
+ ],
547
+ "is_list": false
548
+ },
549
+ {
550
+ "name": "packed_vars",
551
+ "quantum_type": {
552
+ "length": null,
553
+ "kind": "qvec"
554
+ },
555
+ "direction": "inout"
556
+ }
557
+ ]
433
558
  }"""
434
559
  )
435
560
 
436
- APPLY_TO_ALL = QuantumFunctionDeclaration.parse_raw(
561
+ GROVER_SEARCH = QuantumFunctionDeclaration.parse_raw(
437
562
  """{
438
- "name": "apply_to_all",
439
- "param_decls": {},
563
+ "source_ref": null,
564
+ "name": "grover_search",
565
+ "param_decls": {
566
+ "reps": {
567
+ "kind": "int"
568
+ }
569
+ },
440
570
  "port_declarations": {
441
- "target": {
442
- "name": "target",
571
+ "packed_vars": {
572
+ "name": "packed_vars",
573
+ "quantum_type": {
574
+ "length": null,
575
+ "kind": "qvec"
576
+ },
443
577
  "direction": "inout"
444
578
  }
445
579
  },
446
580
  "operand_declarations": {
447
- "gate_operand": {
448
- "name": "gate_operand",
449
- "port_declarations": {
450
- "target": {
451
- "name": "target",
452
- "size": {
453
- "expr": "1"
581
+ "oracle": {
582
+ "name": "oracle",
583
+ "positional_arg_declarations": [
584
+ {
585
+ "name": "arg0",
586
+ "quantum_type": {
587
+ "length": null,
588
+ "kind": "qvec"
454
589
  },
455
590
  "direction": "inout"
456
591
  }
592
+ ],
593
+ "is_list": false
594
+ }
595
+ },
596
+ "positional_arg_declarations": [
597
+ {
598
+ "name": "reps",
599
+ "classical_type": {
600
+ "kind": "int"
457
601
  }
602
+ },
603
+ {
604
+ "name": "oracle",
605
+ "positional_arg_declarations": [
606
+ {
607
+ "name": "arg0",
608
+ "quantum_type": {
609
+ "length": null,
610
+ "kind": "qvec"
611
+ },
612
+ "direction": "inout"
613
+ }
614
+ ],
615
+ "is_list": false
616
+ },
617
+ {
618
+ "name": "packed_vars",
619
+ "quantum_type": {
620
+ "length": null,
621
+ "kind": "qvec"
622
+ },
623
+ "direction": "inout"
624
+ }
625
+ ]
626
+ }"""
627
+ )
628
+
629
+ HADAMARD_TRANSFORM = QuantumFunctionDeclaration.parse_raw(
630
+ """{
631
+ "source_ref": null,
632
+ "name": "hadamard_transform",
633
+ "param_decls": {},
634
+ "port_declarations": {
635
+ "target": {
636
+ "name": "target",
637
+ "direction": "inout"
458
638
  }
459
639
  },
640
+ "operand_declarations": {},
460
641
  "positional_arg_declarations": []
461
642
  }"""
462
643
  )
463
644
 
464
- GROVER_SEARCH = QuantumFunctionDeclaration.parse_raw(
645
+ APPLY_TO_ALL = QuantumFunctionDeclaration.parse_raw(
465
646
  """{
466
- "name": "grover_search",
467
- "param_decls": {
468
- "num_qubits": {
469
- "kind": "int"
470
- },
471
- "reps": {
472
- "kind": "int"
473
- }
474
- },
647
+ "source_ref": null,
648
+ "name": "apply_to_all",
649
+ "param_decls": {},
475
650
  "port_declarations": {
476
- "gsq": {
477
- "name": "gsq",
478
- "size": {
479
- "expr": "num_qubits"
480
- },
651
+ "target": {
652
+ "name": "target",
481
653
  "direction": "inout"
482
654
  }
483
655
  },
484
656
  "operand_declarations": {
485
- "oracle_op": {
486
- "name": "oracle_op",
487
- "param_decls": {
488
- "num_qubits": {
489
- "kind": "int"
490
- }
491
- },
657
+ "gate_operand": {
658
+ "name": "gate_operand",
492
659
  "port_declarations": {
493
- "oq": {
494
- "name": "oq",
660
+ "target": {
661
+ "name": "target",
495
662
  "size": {
496
- "expr": "num_qubits"
663
+ "expr": "1"
497
664
  },
498
665
  "direction": "inout"
499
666
  }
@@ -504,30 +671,9 @@ GROVER_SEARCH = QuantumFunctionDeclaration.parse_raw(
504
671
  }"""
505
672
  )
506
673
 
507
- PREPARE_INT = QuantumFunctionDeclaration.parse_raw(
508
- """{
509
- "name": "prepare_int",
510
- "param_decls": {
511
- "val": {
512
- "kind": "int"
513
- }
514
- },
515
- "port_declarations": {
516
- "out": {
517
- "name": "out",
518
- "quantum_type": {
519
- "kind": "qnum"
520
- },
521
- "direction": "output"
522
- }
523
- },
524
- "operand_declarations": {},
525
- "positional_arg_declarations": []
526
- }"""
527
- )
528
-
529
674
  ALLOCATE_NUM = QuantumFunctionDeclaration.parse_raw(
530
675
  """{
676
+ "source_ref": null,
531
677
  "name": "allocate_num",
532
678
  "param_decls": {
533
679
  "num_qubits": {
@@ -544,7 +690,16 @@ ALLOCATE_NUM = QuantumFunctionDeclaration.parse_raw(
544
690
  "out": {
545
691
  "name": "out",
546
692
  "quantum_type": {
547
- "kind": "qnum"
693
+ "kind": "qnum",
694
+ "size": {
695
+ "expr": "num_qubits"
696
+ },
697
+ "is_signed": {
698
+ "expr": "is_signed"
699
+ },
700
+ "fraction_digits": {
701
+ "expr": "fraction_digits"
702
+ }
548
703
  },
549
704
  "direction": "output"
550
705
  }
@@ -556,6 +711,7 @@ ALLOCATE_NUM = QuantumFunctionDeclaration.parse_raw(
556
711
 
557
712
  QAOA_MIXER_LAYER = QuantumFunctionDeclaration.parse_raw(
558
713
  """{
714
+ "source_ref": null,
559
715
  "name": "qaoa_mixer_layer",
560
716
  "param_decls": {
561
717
  "b": {
@@ -575,6 +731,7 @@ QAOA_MIXER_LAYER = QuantumFunctionDeclaration.parse_raw(
575
731
 
576
732
  QAOA_COST_LAYER = QuantumFunctionDeclaration.parse_raw(
577
733
  """{
734
+ "source_ref": null,
578
735
  "name": "qaoa_cost_layer",
579
736
  "param_decls": {
580
737
  "g": {
@@ -586,9 +743,6 @@ QAOA_COST_LAYER = QuantumFunctionDeclaration.parse_raw(
586
743
  "kind": "struct_instance",
587
744
  "name": "PauliTerm"
588
745
  }
589
- },
590
- "is_st": {
591
- "kind": "bool"
592
746
  }
593
747
  },
594
748
  "port_declarations": {
@@ -604,6 +758,7 @@ QAOA_COST_LAYER = QuantumFunctionDeclaration.parse_raw(
604
758
 
605
759
  QAOA_LAYER = QuantumFunctionDeclaration.parse_raw(
606
760
  """{
761
+ "source_ref": null,
607
762
  "name": "qaoa_layer",
608
763
  "param_decls": {
609
764
  "g": {
@@ -618,9 +773,6 @@ QAOA_LAYER = QuantumFunctionDeclaration.parse_raw(
618
773
  "kind": "struct_instance",
619
774
  "name": "PauliTerm"
620
775
  }
621
- },
622
- "is_st": {
623
- "kind": "bool"
624
776
  }
625
777
  },
626
778
  "port_declarations": {
@@ -636,6 +788,7 @@ QAOA_LAYER = QuantumFunctionDeclaration.parse_raw(
636
788
 
637
789
  QAOA_INIT = QuantumFunctionDeclaration.parse_raw(
638
790
  """{
791
+ "source_ref": null,
639
792
  "name": "qaoa_init",
640
793
  "param_decls": {},
641
794
  "port_declarations": {
@@ -651,6 +804,7 @@ QAOA_INIT = QuantumFunctionDeclaration.parse_raw(
651
804
 
652
805
  QAOA_PENALTY = QuantumFunctionDeclaration.parse_raw(
653
806
  """{
807
+ "source_ref": null,
654
808
  "name": "qaoa_penalty",
655
809
  "param_decls": {
656
810
  "num_qubits": {
@@ -668,9 +822,6 @@ QAOA_PENALTY = QuantumFunctionDeclaration.parse_raw(
668
822
  "kind": "struct_instance",
669
823
  "name": "PauliTerm"
670
824
  }
671
- },
672
- "is_st": {
673
- "kind": "bool"
674
825
  }
675
826
  },
676
827
  "port_declarations": {
@@ -689,6 +840,7 @@ QAOA_PENALTY = QuantumFunctionDeclaration.parse_raw(
689
840
 
690
841
  FULL_HEA = QuantumFunctionDeclaration.parse_raw(
691
842
  """{
843
+ "source_ref": null,
692
844
  "name": "full_hea",
693
845
  "param_decls": {
694
846
  "num_qubits": {
@@ -779,6 +931,7 @@ FULL_HEA = QuantumFunctionDeclaration.parse_raw(
779
931
 
780
932
  SWAP_TEST = QuantumFunctionDeclaration.parse_raw(
781
933
  """{
934
+ "source_ref": null,
782
935
  "name": "swap_test",
783
936
  "param_decls": {},
784
937
  "port_declarations": {
@@ -835,22 +988,255 @@ SWAP_TEST = QuantumFunctionDeclaration.parse_raw(
835
988
  }"""
836
989
  )
837
990
 
991
+ PREPARE_GHZ_STATE = QuantumFunctionDeclaration.parse_raw(
992
+ """{
993
+ "source_ref": null,
994
+ "name": "prepare_ghz_state",
995
+ "param_decls": {
996
+ "size": {
997
+ "kind": "int"
998
+ }
999
+ },
1000
+ "port_declarations": {
1001
+ "q": {
1002
+ "name": "q",
1003
+ "quantum_type": {
1004
+ "length": null,
1005
+ "kind": "qvec"
1006
+ },
1007
+ "direction": "output"
1008
+ }
1009
+ },
1010
+ "operand_declarations": {},
1011
+ "positional_arg_declarations": [
1012
+ {
1013
+ "name": "size",
1014
+ "classical_type": {
1015
+ "kind": "int"
1016
+ }
1017
+ },
1018
+ {
1019
+ "name": "q",
1020
+ "quantum_type": {
1021
+ "length": null,
1022
+ "kind": "qvec"
1023
+ },
1024
+ "direction": "output"
1025
+ }
1026
+ ]
1027
+ }"""
1028
+ )
1029
+
1030
+ PREPARE_EXPONENTIAL_STATE = QuantumFunctionDeclaration.parse_raw(
1031
+ """{
1032
+ "source_ref": null,
1033
+ "name": "prepare_exponential_state",
1034
+ "param_decls": {
1035
+ "rate": {
1036
+ "kind": "int"
1037
+ }
1038
+ },
1039
+ "port_declarations": {
1040
+ "q": {
1041
+ "name": "q",
1042
+ "quantum_type": {
1043
+ "length": null,
1044
+ "kind": "qvec"
1045
+ },
1046
+ "direction": "inout"
1047
+ }
1048
+ },
1049
+ "operand_declarations": {},
1050
+ "positional_arg_declarations": [
1051
+ {
1052
+ "name": "rate",
1053
+ "classical_type": {
1054
+ "kind": "int"
1055
+ }
1056
+ },
1057
+ {
1058
+ "name": "q",
1059
+ "quantum_type": {
1060
+ "length": null,
1061
+ "kind": "qvec"
1062
+ },
1063
+ "direction": "inout"
1064
+ }
1065
+ ]
1066
+ }"""
1067
+ )
1068
+
1069
+ PREPARE_BELL_STATE = QuantumFunctionDeclaration.parse_raw(
1070
+ """{
1071
+ "source_ref": null,
1072
+ "name": "prepare_bell_state",
1073
+ "param_decls": {
1074
+ "state_num": {
1075
+ "kind": "int"
1076
+ }
1077
+ },
1078
+ "port_declarations": {
1079
+ "q": {
1080
+ "name": "q",
1081
+ "quantum_type": {
1082
+ "length": {
1083
+ "expr": "2"
1084
+ },
1085
+ "kind": "qvec"
1086
+ },
1087
+ "direction": "output"
1088
+ }
1089
+ },
1090
+ "operand_declarations": {},
1091
+ "positional_arg_declarations": [
1092
+ {
1093
+ "name": "state_num",
1094
+ "classical_type": {
1095
+ "kind": "int"
1096
+ }
1097
+ },
1098
+ {
1099
+ "name": "q",
1100
+ "quantum_type": {
1101
+ "length": {
1102
+ "expr": "2"
1103
+ },
1104
+ "kind": "qvec"
1105
+ },
1106
+ "direction": "output"
1107
+ }
1108
+ ]
1109
+ }"""
1110
+ )
1111
+
1112
+ INPLACE_PREPARE_INT = QuantumFunctionDeclaration.parse_raw(
1113
+ """{
1114
+ "source_ref": null,
1115
+ "name": "inplace_prepare_int",
1116
+ "param_decls": {
1117
+ "value": {
1118
+ "kind": "int"
1119
+ }
1120
+ },
1121
+ "port_declarations": {
1122
+ "target": {
1123
+ "name": "target",
1124
+ "quantum_type": {
1125
+ "length": null,
1126
+ "kind": "qvec"
1127
+ },
1128
+ "direction": "inout"
1129
+ }
1130
+ },
1131
+ "operand_declarations": {},
1132
+ "positional_arg_declarations": [
1133
+ {
1134
+ "name": "value",
1135
+ "classical_type": {
1136
+ "kind": "int"
1137
+ }
1138
+ },
1139
+ {
1140
+ "name": "target",
1141
+ "quantum_type": {
1142
+ "length": null,
1143
+ "kind": "qvec"
1144
+ },
1145
+ "direction": "inout"
1146
+ }
1147
+ ]
1148
+ }"""
1149
+ )
1150
+
1151
+ PREPARE_INT = QuantumFunctionDeclaration.parse_raw(
1152
+ """{
1153
+ "source_ref": null,
1154
+ "name": "prepare_int",
1155
+ "param_decls": {
1156
+ "value": {
1157
+ "kind": "int"
1158
+ }
1159
+ },
1160
+ "port_declarations": {
1161
+ "out": {
1162
+ "name": "out",
1163
+ "quantum_type": {
1164
+ "kind": "qnum"
1165
+ },
1166
+ "direction": "output"
1167
+ }
1168
+ },
1169
+ "operand_declarations": {},
1170
+ "positional_arg_declarations": [
1171
+ {
1172
+ "name": "value",
1173
+ "classical_type": {
1174
+ "kind": "int"
1175
+ }
1176
+ },
1177
+ {
1178
+ "name": "out",
1179
+ "quantum_type": {
1180
+ "kind": "qnum"
1181
+ },
1182
+ "direction": "output"
1183
+ }
1184
+ ]
1185
+ }"""
1186
+ )
1187
+
1188
+ SWITCH = QuantumFunctionDeclaration.parse_raw(
1189
+ """{
1190
+ "source_ref": null,
1191
+ "name": "switch",
1192
+ "param_decls": {
1193
+ "selector": {
1194
+ "kind": "int"
1195
+ }
1196
+ },
1197
+ "port_declarations": {},
1198
+ "operand_declarations": {
1199
+ "cases": {
1200
+ "name": "cases",
1201
+ "positional_arg_declarations": [],
1202
+ "is_list": true
1203
+ }
1204
+ },
1205
+ "positional_arg_declarations": [
1206
+ {
1207
+ "name": "selector",
1208
+ "classical_type": {
1209
+ "kind": "int"
1210
+ }
1211
+ },
1212
+ {
1213
+ "name": "cases",
1214
+ "positional_arg_declarations": [],
1215
+ "is_list": true
1216
+ }
1217
+ ]
1218
+ }"""
1219
+ )
1220
+
1221
+ OPEN_LIB_DECLS = [
1222
+ func for func in vars().values() if isinstance(func, QuantumFunctionDeclaration)
1223
+ ]
1224
+
838
1225
  __all__ = [
839
1226
  "QFT_STEP",
840
1227
  "QFT",
841
1228
  "QPE_FLEXIBLE",
842
1229
  "QPE",
843
- "STANDARD_QPE",
844
1230
  "SINGLE_PAULI",
845
1231
  "LINEAR_PAULI_ROTATIONS",
846
1232
  "AMPLITUDE_ESTIMATION",
847
- "SIMPLE_ORACLE",
1233
+ "PHASE_ORACLE",
1234
+ "REFLECT_ABOUT_ZERO",
848
1235
  "GROVER_DIFFUSER",
849
1236
  "GROVER_OPERATOR",
1237
+ "GROVER_SEARCH",
850
1238
  "HADAMARD_TRANSFORM",
851
1239
  "APPLY_TO_ALL",
852
- "GROVER_SEARCH",
853
- "PREPARE_INT",
854
1240
  "ALLOCATE_NUM",
855
1241
  "QAOA_MIXER_LAYER",
856
1242
  "QAOA_COST_LAYER",
@@ -859,4 +1245,11 @@ __all__ = [
859
1245
  "QAOA_PENALTY",
860
1246
  "FULL_HEA",
861
1247
  "SWAP_TEST",
1248
+ "PREPARE_GHZ_STATE",
1249
+ "PREPARE_EXPONENTIAL_STATE",
1250
+ "PREPARE_BELL_STATE",
1251
+ "INPLACE_PREPARE_INT",
1252
+ "PREPARE_INT",
1253
+ "SWITCH",
1254
+ "OPEN_LIB_DECLS",
862
1255
  ]