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.
- classiq/__init__.py +23 -24
- classiq/_analyzer_extras/_ipywidgets_async_extension.py +1 -1
- classiq/_analyzer_extras/interactive_hardware.py +3 -3
- classiq/_internals/api_wrapper.py +37 -17
- classiq/_internals/async_utils.py +1 -74
- classiq/_internals/authentication/device.py +9 -4
- classiq/_internals/authentication/password_manager.py +25 -10
- classiq/_internals/authentication/token_manager.py +2 -2
- classiq/_internals/client.py +24 -6
- classiq/_internals/jobs.py +10 -7
- classiq/analyzer/analyzer.py +29 -29
- classiq/analyzer/analyzer_utilities.py +5 -5
- classiq/analyzer/rb.py +4 -5
- classiq/analyzer/show_interactive_hack.py +6 -6
- classiq/applications/__init__.py +1 -8
- classiq/applications/chemistry/__init__.py +6 -0
- classiq/{applications_model_constructors → applications/chemistry}/chemistry_model_constructor.py +9 -16
- classiq/applications/combinatorial_helpers/allowed_constraints.py +20 -0
- classiq/applications/combinatorial_helpers/arithmetic/arithmetic_expression.py +35 -0
- classiq/applications/combinatorial_helpers/arithmetic/isolation.py +42 -0
- classiq/applications/combinatorial_helpers/combinatorial_problem_utils.py +150 -0
- classiq/applications/combinatorial_helpers/encoding_mapping.py +107 -0
- classiq/applications/combinatorial_helpers/encoding_utils.py +122 -0
- classiq/applications/combinatorial_helpers/memory.py +77 -0
- classiq/applications/combinatorial_helpers/optimization_model.py +162 -0
- classiq/applications/combinatorial_helpers/pauli_helpers/pauli_sparsing.py +31 -0
- classiq/applications/combinatorial_helpers/pauli_helpers/pauli_utils.py +75 -0
- classiq/applications/combinatorial_helpers/py.typed +0 -0
- classiq/applications/combinatorial_helpers/pyomo_utils.py +245 -0
- classiq/applications/combinatorial_helpers/solvers/__init__.py +0 -0
- classiq/applications/combinatorial_helpers/sympy_utils.py +22 -0
- classiq/applications/combinatorial_helpers/transformations/__init__.py +0 -0
- classiq/applications/combinatorial_helpers/transformations/encoding.py +187 -0
- classiq/applications/combinatorial_helpers/transformations/fixed_variables.py +142 -0
- classiq/applications/combinatorial_helpers/transformations/ising_converter.py +122 -0
- classiq/applications/combinatorial_helpers/transformations/penalty.py +32 -0
- classiq/applications/combinatorial_helpers/transformations/penalty_support.py +37 -0
- classiq/applications/combinatorial_helpers/transformations/sign_seperation.py +75 -0
- classiq/applications/combinatorial_helpers/transformations/slack_variables.py +88 -0
- classiq/applications/combinatorial_optimization/__init__.py +13 -2
- classiq/applications/combinatorial_optimization/combinatorial_optimization_model_constructor.py +134 -0
- classiq/applications/finance/__init__.py +3 -2
- classiq/{applications_model_constructors → applications/finance}/finance_model_constructor.py +27 -30
- classiq/applications/grover/__init__.py +11 -0
- classiq/{applications_model_constructors → applications/grover}/grover_model_constructor.py +20 -91
- classiq/applications/libraries/__init__.py +0 -0
- classiq/applications/libraries/qmci_library.py +35 -0
- classiq/applications/qnn/circuit_utils.py +2 -2
- classiq/applications/qnn/gradients/quantum_gradient.py +2 -2
- classiq/applications/qnn/types.py +2 -2
- classiq/applications/qsvm/__init__.py +5 -1
- classiq/applications/qsvm/qsvm.py +4 -7
- classiq/applications/qsvm/qsvm_data_generation.py +2 -5
- classiq/exceptions.py +43 -1
- classiq/execution/all_hardware_devices.py +13 -0
- classiq/executor.py +12 -10
- classiq/interface/_version.py +1 -1
- classiq/interface/analyzer/analysis_params.py +6 -3
- classiq/interface/analyzer/result.py +12 -8
- classiq/interface/applications/qsvm.py +17 -3
- classiq/interface/ast_node.py +23 -0
- classiq/interface/backend/backend_preferences.py +4 -2
- classiq/interface/backend/pydantic_backend.py +3 -1
- classiq/interface/backend/quantum_backend_providers.py +1 -0
- classiq/interface/chemistry/fermionic_operator.py +15 -13
- classiq/interface/chemistry/ground_state_problem.py +18 -3
- classiq/interface/chemistry/molecule.py +8 -6
- classiq/interface/chemistry/operator.py +20 -14
- classiq/interface/combinatorial_optimization/examples/ascending_sequence.py +1 -1
- classiq/interface/combinatorial_optimization/examples/greater_than_ilp.py +1 -1
- classiq/interface/combinatorial_optimization/examples/ilp.py +2 -1
- classiq/interface/combinatorial_optimization/examples/integer_portfolio_optimization.py +2 -2
- classiq/interface/combinatorial_optimization/examples/mds.py +2 -1
- classiq/interface/combinatorial_optimization/examples/mht.py +8 -3
- classiq/interface/combinatorial_optimization/examples/mis.py +4 -1
- classiq/interface/combinatorial_optimization/examples/mvc.py +2 -1
- classiq/interface/combinatorial_optimization/examples/set_cover.py +2 -1
- classiq/interface/combinatorial_optimization/examples/tsp.py +4 -3
- classiq/interface/combinatorial_optimization/examples/tsp_digraph.py +6 -2
- classiq/interface/combinatorial_optimization/mht_qaoa_input.py +9 -3
- classiq/interface/executor/aws_execution_cost.py +4 -3
- classiq/interface/executor/estimation.py +2 -2
- classiq/interface/executor/execution_preferences.py +5 -34
- classiq/interface/executor/execution_request.py +15 -48
- classiq/interface/executor/optimizer_preferences.py +22 -13
- classiq/interface/executor/{quantum_program.py → quantum_code.py} +21 -15
- classiq/interface/executor/quantum_instruction_set.py +2 -1
- classiq/interface/executor/register_initialization.py +1 -3
- classiq/interface/executor/result.py +41 -10
- classiq/interface/executor/vqe_result.py +2 -2
- classiq/interface/finance/function_input.py +17 -4
- classiq/interface/finance/gaussian_model_input.py +3 -1
- classiq/interface/finance/log_normal_model_input.py +3 -1
- classiq/interface/finance/model_input.py +2 -0
- classiq/interface/generator/amplitude_loading.py +6 -3
- classiq/interface/generator/application_apis/__init__.py +1 -0
- classiq/interface/generator/application_apis/arithmetic_declarations.py +14 -0
- classiq/interface/generator/arith/argument_utils.py +14 -4
- classiq/interface/generator/arith/arithmetic.py +3 -1
- classiq/interface/generator/arith/arithmetic_arg_type_validator.py +12 -13
- classiq/interface/generator/arith/arithmetic_expression_abc.py +4 -1
- classiq/interface/generator/arith/arithmetic_expression_parser.py +8 -2
- classiq/interface/generator/arith/arithmetic_expression_validator.py +16 -2
- classiq/interface/generator/arith/arithmetic_operations.py +5 -10
- classiq/interface/generator/arith/ast_node_rewrite.py +1 -1
- classiq/interface/generator/arith/binary_ops.py +202 -54
- classiq/interface/generator/arith/extremum_operations.py +5 -3
- classiq/interface/generator/arith/logical_ops.py +4 -2
- classiq/interface/generator/arith/machine_precision.py +3 -0
- classiq/interface/generator/arith/number_utils.py +34 -44
- classiq/interface/generator/arith/register_user_input.py +21 -1
- classiq/interface/generator/arith/unary_ops.py +16 -25
- classiq/interface/generator/builtin_api_builder.py +0 -5
- classiq/interface/generator/chemistry_function_params.py +4 -4
- classiq/interface/generator/commuting_pauli_exponentiation.py +3 -1
- classiq/interface/generator/compiler_keywords.py +4 -0
- classiq/interface/generator/complex_type.py +3 -10
- classiq/interface/generator/constant.py +2 -3
- classiq/interface/generator/control_state.py +5 -3
- classiq/interface/generator/credit_risk_example/linear_gci.py +10 -3
- classiq/interface/generator/credit_risk_example/weighted_adder.py +14 -4
- classiq/interface/generator/expressions/atomic_expression_functions.py +5 -3
- classiq/interface/generator/expressions/evaluated_expression.py +18 -4
- classiq/interface/generator/expressions/expression.py +3 -5
- classiq/interface/generator/expressions/qmod_qscalar_proxy.py +33 -0
- classiq/interface/generator/expressions/sympy_supported_expressions.py +2 -1
- classiq/interface/generator/finance.py +1 -1
- classiq/interface/generator/function_params.py +7 -6
- classiq/interface/generator/functions/__init__.py +2 -2
- classiq/interface/generator/functions/builtins/__init__.py +15 -0
- classiq/interface/generator/functions/builtins/core_library/__init__.py +14 -0
- classiq/interface/generator/functions/builtins/core_library/chemistry_functions.py +0 -0
- classiq/interface/generator/functions/builtins/internal_operators.py +62 -0
- classiq/interface/generator/functions/{core_lib_declarations/quantum_functions/std_lib_functions.py → builtins/open_lib_functions.py} +612 -219
- classiq/interface/generator/functions/builtins/quantum_operators.py +37 -0
- classiq/interface/generator/functions/classical_type.py +2 -4
- classiq/interface/generator/functions/foreign_function_definition.py +12 -4
- classiq/interface/generator/functions/function_declaration.py +2 -2
- classiq/interface/generator/functions/function_implementation.py +8 -4
- classiq/interface/generator/functions/native_function_definition.py +4 -2
- classiq/interface/generator/functions/register.py +4 -2
- classiq/interface/generator/functions/register_mapping_data.py +14 -10
- classiq/interface/generator/generated_circuit_data.py +2 -2
- classiq/interface/generator/grover_operator.py +5 -3
- classiq/interface/generator/hamiltonian_evolution/suzuki_trotter.py +5 -1
- classiq/interface/generator/hardware/hardware_data.py +6 -4
- classiq/interface/generator/hardware_efficient_ansatz.py +25 -8
- classiq/interface/generator/hartree_fock.py +13 -3
- classiq/interface/generator/linear_pauli_rotations.py +3 -1
- classiq/interface/generator/mcu.py +5 -3
- classiq/interface/generator/mcx.py +7 -5
- classiq/interface/generator/model/classical_main_validator.py +1 -1
- classiq/interface/generator/model/constraints.py +2 -1
- classiq/interface/generator/model/model.py +12 -20
- classiq/interface/generator/model/preferences/preferences.py +4 -3
- classiq/interface/generator/oracles/custom_oracle.py +4 -2
- classiq/interface/generator/oracles/oracle_abc.py +2 -2
- classiq/interface/generator/qpe.py +6 -4
- classiq/interface/generator/qsvm.py +5 -8
- classiq/interface/generator/quantum_function_call.py +21 -16
- classiq/interface/generator/{generated_circuit.py → quantum_program.py} +10 -14
- classiq/interface/generator/range_types.py +3 -1
- classiq/interface/generator/slice_parsing_utils.py +8 -3
- classiq/interface/generator/standard_gates/controlled_standard_gates.py +4 -2
- classiq/interface/generator/state_preparation/metrics.py +2 -1
- classiq/interface/generator/state_preparation/state_preparation.py +7 -5
- classiq/interface/generator/state_propagator.py +16 -5
- classiq/interface/generator/types/builtin_struct_declarations/__init__.py +0 -1
- classiq/interface/generator/types/struct_declaration.py +10 -7
- classiq/interface/generator/ucc.py +6 -4
- classiq/interface/generator/unitary_gate.py +7 -3
- classiq/interface/generator/validations/flow_graph.py +6 -4
- classiq/interface/generator/validations/validator_functions.py +6 -4
- classiq/interface/hardware.py +2 -2
- classiq/interface/helpers/custom_encoders.py +3 -0
- classiq/interface/helpers/pydantic_model_helpers.py +0 -6
- classiq/interface/helpers/validation_helpers.py +1 -1
- classiq/interface/helpers/versioned_model.py +4 -1
- classiq/interface/ide/show.py +2 -2
- classiq/interface/jobs.py +72 -3
- classiq/interface/model/bind_operation.py +18 -11
- classiq/interface/model/call_synthesis_data.py +68 -0
- classiq/interface/model/classical_if.py +13 -0
- classiq/interface/model/classical_parameter_declaration.py +2 -3
- classiq/interface/model/control.py +16 -0
- classiq/interface/model/handle_binding.py +3 -2
- classiq/interface/model/inplace_binary_operation.py +2 -2
- classiq/interface/model/invert.py +10 -0
- classiq/interface/model/model.py +29 -22
- classiq/interface/model/native_function_definition.py +3 -5
- classiq/interface/model/power.py +12 -0
- classiq/interface/model/quantum_expressions/amplitude_loading_operation.py +9 -4
- classiq/interface/model/quantum_expressions/control_state.py +2 -2
- classiq/interface/model/quantum_function_call.py +33 -142
- classiq/interface/model/quantum_function_declaration.py +8 -0
- classiq/interface/model/quantum_if_operation.py +4 -5
- classiq/interface/model/quantum_lambda_function.py +58 -0
- classiq/{quantum_register.py → interface/model/quantum_register.py} +17 -9
- classiq/interface/model/quantum_statement.py +3 -2
- classiq/interface/model/quantum_type.py +58 -59
- classiq/interface/model/quantum_variable_declaration.py +3 -3
- classiq/interface/model/repeat.py +13 -0
- classiq/interface/model/resolvers/function_call_resolver.py +26 -0
- classiq/interface/model/statement_block.py +49 -0
- classiq/interface/model/validations/handles_validator.py +16 -18
- classiq/interface/model/within_apply_operation.py +11 -0
- classiq/interface/pyomo_extension/pyomo_sympy_bimap.py +4 -1
- classiq/interface/server/routes.py +5 -4
- classiq/qmod/__init__.py +13 -6
- classiq/qmod/builtins/classical_execution_primitives.py +27 -36
- classiq/qmod/builtins/classical_functions.py +22 -12
- classiq/qmod/builtins/functions.py +272 -328
- classiq/qmod/builtins/operations.py +171 -35
- classiq/qmod/builtins/structs.py +15 -15
- classiq/qmod/cfunc.py +42 -0
- classiq/qmod/classical_function.py +6 -14
- classiq/qmod/declaration_inferrer.py +12 -21
- classiq/qmod/expression_query.py +23 -0
- classiq/qmod/model_state_container.py +2 -0
- classiq/qmod/native/__init__.py +0 -0
- classiq/qmod/native/expression_to_qmod.py +189 -0
- classiq/qmod/native/pretty_printer.py +340 -0
- classiq/qmod/qfunc.py +27 -0
- classiq/qmod/qmod_constant.py +100 -0
- classiq/qmod/qmod_parameter.py +36 -13
- classiq/qmod/qmod_struct.py +3 -3
- classiq/qmod/qmod_variable.py +148 -31
- classiq/qmod/quantum_callable.py +1 -0
- classiq/qmod/quantum_expandable.py +18 -19
- classiq/qmod/quantum_function.py +41 -8
- classiq/qmod/symbolic.py +48 -5
- classiq/qmod/symbolic_expr.py +9 -0
- classiq/qmod/utilities.py +13 -0
- classiq/qmod/write_qmod.py +39 -0
- {classiq-0.37.1.dist-info → classiq-0.39.0.dist-info}/METADATA +2 -1
- {classiq-0.37.1.dist-info → classiq-0.39.0.dist-info}/RECORD +244 -225
- {classiq-0.37.1.dist-info → classiq-0.39.0.dist-info}/WHEEL +1 -1
- classiq/applications/benchmarking/__init__.py +0 -9
- classiq/applications/benchmarking/mirror_benchmarking.py +0 -67
- classiq/applications/numpy_utils.py +0 -37
- classiq/applications_model_constructors/__init__.py +0 -17
- classiq/applications_model_constructors/combinatorial_optimization_model_constructor.py +0 -178
- classiq/applications_model_constructors/libraries/qmci_library.py +0 -109
- classiq/builtin_functions/__init__.py +0 -43
- classiq/builtin_functions/amplitude_loading.py +0 -3
- classiq/builtin_functions/binary_ops.py +0 -1
- classiq/builtin_functions/exponentiation.py +0 -5
- classiq/builtin_functions/qpe.py +0 -4
- classiq/builtin_functions/qsvm.py +0 -7
- classiq/builtin_functions/range_types.py +0 -5
- classiq/builtin_functions/standard_gates.py +0 -1
- classiq/builtin_functions/state_preparation.py +0 -6
- classiq/builtin_functions/suzuki_trotter.py +0 -3
- classiq/interface/generator/expressions/qmod_qnum_proxy.py +0 -22
- classiq/interface/generator/functions/core_lib_declarations/quantum_functions/__init__.py +0 -18
- classiq/interface/generator/functions/core_lib_declarations/quantum_operators.py +0 -169
- classiq/interface/generator/types/builtin_struct_declarations/qaoa_declarations.py +0 -23
- classiq/interface/generator/types/combinatorial_problem.py +0 -26
- classiq/interface/model/numeric_reinterpretation.py +0 -25
- classiq/interface/model/operator_synthesis_data.py +0 -48
- classiq/model/__init__.py +0 -14
- classiq/model/composite_function_generator.py +0 -33
- classiq/model/function_handler.py +0 -466
- classiq/model/function_handler.pyi +0 -152
- classiq/model/logic_flow.py +0 -149
- classiq/model/logic_flow_change_handler.py +0 -71
- classiq/model/model.py +0 -246
- classiq/quantum_functions/__init__.py +0 -17
- classiq/quantum_functions/annotation_parser.py +0 -207
- classiq/quantum_functions/decorators.py +0 -22
- classiq/quantum_functions/function_library.py +0 -181
- classiq/quantum_functions/function_parser.py +0 -74
- classiq/quantum_functions/quantum_function.py +0 -236
- /classiq/{applications_model_constructors/libraries → applications/combinatorial_helpers}/__init__.py +0 -0
- /classiq/{interface/generator/functions/core_lib_declarations → applications/combinatorial_helpers/arithmetic}/__init__.py +0 -0
- /classiq/{interface/generator/functions/core_lib_declarations/quantum_functions/chemistry_functions.py → applications/combinatorial_helpers/pauli_helpers/__init__.py} +0 -0
- /classiq/{applications_model_constructors → applications}/libraries/ampltitude_estimation_library.py +0 -0
- /classiq/{applications_model_constructors → applications/qsvm}/qsvm_model_constructor.py +0 -0
- /classiq/interface/generator/functions/{core_lib_declarations/quantum_functions → builtins/core_library}/atomic_quantum_functions.py +0 -0
- /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
|
-
"
|
253
|
-
"name": "
|
254
|
-
"
|
255
|
-
"
|
222
|
+
"phase": {
|
223
|
+
"name": "phase",
|
224
|
+
"quantum_type": {
|
225
|
+
"kind": "qnum"
|
256
226
|
},
|
257
|
-
"direction": "
|
227
|
+
"direction": "inout"
|
258
228
|
},
|
259
|
-
"
|
260
|
-
"name": "
|
261
|
-
"
|
262
|
-
"
|
229
|
+
"packed_vars": {
|
230
|
+
"name": "packed_vars",
|
231
|
+
"quantum_type": {
|
232
|
+
"length": null,
|
233
|
+
"kind": "qvec"
|
263
234
|
},
|
264
|
-
"direction": "
|
235
|
+
"direction": "inout"
|
265
236
|
}
|
266
237
|
},
|
267
238
|
"operand_declarations": {
|
268
|
-
"
|
269
|
-
"name": "
|
270
|
-
"
|
271
|
-
|
272
|
-
"
|
273
|
-
|
274
|
-
|
275
|
-
|
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
|
-
"
|
286
|
-
"name": "
|
287
|
-
"
|
288
|
-
|
289
|
-
"
|
290
|
-
|
291
|
-
|
292
|
-
|
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
|
-
|
316
|
+
PHASE_ORACLE = QuantumFunctionDeclaration.parse_raw(
|
308
317
|
"""{
|
309
|
-
"
|
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
|
-
"
|
321
|
-
|
322
|
-
"name": "
|
323
|
-
"
|
324
|
-
"
|
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
|
-
|
329
|
-
"name": "
|
330
|
-
"
|
331
|
-
"
|
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
|
-
|
388
|
+
REFLECT_ABOUT_ZERO = QuantumFunctionDeclaration.parse_raw(
|
343
389
|
"""{
|
344
|
-
"
|
345
|
-
"
|
346
|
-
|
347
|
-
"kind": "int"
|
348
|
-
}
|
349
|
-
},
|
390
|
+
"source_ref": null,
|
391
|
+
"name": "reflect_about_zero",
|
392
|
+
"param_decls": {},
|
350
393
|
"port_declarations": {
|
351
|
-
"
|
352
|
-
"name": "
|
353
|
-
"
|
354
|
-
"
|
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
|
-
|
417
|
+
GROVER_DIFFUSER = QuantumFunctionDeclaration.parse_raw(
|
365
418
|
"""{
|
366
|
-
"
|
367
|
-
"
|
368
|
-
|
369
|
-
"kind": "int"
|
370
|
-
}
|
371
|
-
},
|
419
|
+
"source_ref": null,
|
420
|
+
"name": "grover_diffuser",
|
421
|
+
"param_decls": {},
|
372
422
|
"port_declarations": {
|
373
|
-
"
|
374
|
-
"name": "
|
375
|
-
"
|
376
|
-
"
|
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
|
-
"
|
383
|
-
"name": "
|
384
|
-
"
|
385
|
-
|
386
|
-
"
|
387
|
-
|
388
|
-
|
389
|
-
|
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
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
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
|
-
|
475
|
+
GROVER_OPERATOR = QuantumFunctionDeclaration.parse_raw(
|
422
476
|
"""{
|
423
|
-
"
|
477
|
+
"source_ref": null,
|
478
|
+
"name": "grover_operator",
|
424
479
|
"param_decls": {},
|
425
480
|
"port_declarations": {
|
426
|
-
"
|
427
|
-
"name": "
|
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
|
-
|
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
|
-
|
561
|
+
GROVER_SEARCH = QuantumFunctionDeclaration.parse_raw(
|
437
562
|
"""{
|
438
|
-
"
|
439
|
-
"
|
563
|
+
"source_ref": null,
|
564
|
+
"name": "grover_search",
|
565
|
+
"param_decls": {
|
566
|
+
"reps": {
|
567
|
+
"kind": "int"
|
568
|
+
}
|
569
|
+
},
|
440
570
|
"port_declarations": {
|
441
|
-
"
|
442
|
-
"name": "
|
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
|
-
"
|
448
|
-
"name": "
|
449
|
-
"
|
450
|
-
|
451
|
-
"name": "
|
452
|
-
"
|
453
|
-
"
|
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
|
-
|
645
|
+
APPLY_TO_ALL = QuantumFunctionDeclaration.parse_raw(
|
465
646
|
"""{
|
466
|
-
"
|
467
|
-
"
|
468
|
-
|
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
|
-
"
|
477
|
-
"name": "
|
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
|
-
"
|
486
|
-
"name": "
|
487
|
-
"param_decls": {
|
488
|
-
"num_qubits": {
|
489
|
-
"kind": "int"
|
490
|
-
}
|
491
|
-
},
|
657
|
+
"gate_operand": {
|
658
|
+
"name": "gate_operand",
|
492
659
|
"port_declarations": {
|
493
|
-
"
|
494
|
-
"name": "
|
660
|
+
"target": {
|
661
|
+
"name": "target",
|
495
662
|
"size": {
|
496
|
-
"expr": "
|
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
|
-
"
|
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
|
]
|