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
@@ -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
|
-
@
|
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
|
-
@
|
157
|
+
@qfunc(external=True)
|
21
158
|
def X(
|
22
159
|
target: QBit,
|
23
160
|
) -> None:
|
24
161
|
pass
|
25
162
|
|
26
163
|
|
27
|
-
@
|
164
|
+
@qfunc(external=True)
|
28
165
|
def Y(
|
29
166
|
target: QBit,
|
30
167
|
) -> None:
|
31
168
|
pass
|
32
169
|
|
33
170
|
|
34
|
-
@
|
171
|
+
@qfunc(external=True)
|
35
172
|
def Z(
|
36
173
|
target: QBit,
|
37
174
|
) -> None:
|
38
175
|
pass
|
39
176
|
|
40
177
|
|
41
|
-
@
|
178
|
+
@qfunc(external=True)
|
42
179
|
def I(
|
43
180
|
target: QBit,
|
44
181
|
) -> None:
|
45
182
|
pass
|
46
183
|
|
47
184
|
|
48
|
-
@
|
185
|
+
@qfunc(external=True)
|
49
186
|
def S(
|
50
187
|
target: QBit,
|
51
188
|
) -> None:
|
52
189
|
pass
|
53
190
|
|
54
191
|
|
55
|
-
@
|
192
|
+
@qfunc(external=True)
|
56
193
|
def T(
|
57
194
|
target: QBit,
|
58
195
|
) -> None:
|
59
196
|
pass
|
60
197
|
|
61
198
|
|
62
|
-
@
|
199
|
+
@qfunc(external=True)
|
63
200
|
def SDG(
|
64
201
|
target: QBit,
|
65
202
|
) -> None:
|
66
203
|
pass
|
67
204
|
|
68
205
|
|
69
|
-
@
|
206
|
+
@qfunc(external=True)
|
70
207
|
def TDG(
|
71
208
|
target: QBit,
|
72
209
|
) -> None:
|
73
210
|
pass
|
74
211
|
|
75
212
|
|
76
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
354
|
+
@qfunc(external=True)
|
218
355
|
def IDENTITY(
|
219
356
|
target: QArray[QBit],
|
220
357
|
) -> None:
|
221
358
|
pass
|
222
359
|
|
223
360
|
|
224
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
519
|
+
@qfunc(external=True)
|
383
520
|
def qft(
|
384
521
|
target: QArray[QBit],
|
385
522
|
) -> None:
|
386
523
|
pass
|
387
524
|
|
388
525
|
|
389
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
564
|
+
@qfunc(external=True)
|
437
565
|
def amplitude_estimation(
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
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
|
-
@
|
449
|
-
def
|
450
|
-
predicate: QCallable[QArray[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
|
-
@
|
457
|
-
def
|
458
|
-
|
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
|
-
@
|
465
|
-
def
|
466
|
-
|
467
|
-
|
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
|
-
@
|
475
|
-
def
|
476
|
-
|
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
|
-
@
|
482
|
-
def
|
483
|
-
|
484
|
-
|
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
|
-
@
|
490
|
-
def
|
491
|
-
|
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
|
-
@
|
500
|
-
def
|
501
|
-
|
502
|
-
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
588
|
-
def
|
589
|
-
|
590
|
-
|
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
|
-
@
|
648
|
-
def
|
649
|
-
|
650
|
-
|
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
|
-
@
|
766
|
-
def
|
767
|
-
|
768
|
-
|
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
|
-
@
|
776
|
-
def
|
777
|
-
|
778
|
-
|
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
|
-
@
|
791
|
-
def
|
792
|
-
|
793
|
-
|
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
|
-
@
|
799
|
-
def
|
800
|
-
|
801
|
-
|
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
|
-
"
|
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
|
-
"
|
875
|
-
"
|
876
|
-
"
|
877
|
-
"
|
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
|
]
|