classiq 0.38.0__py3-none-any.whl → 0.40.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 +22 -22
- classiq/_internals/api_wrapper.py +13 -1
- classiq/_internals/client.py +12 -2
- classiq/analyzer/analyzer.py +3 -1
- classiq/applications/__init__.py +1 -8
- classiq/applications/chemistry/__init__.py +6 -0
- classiq/{applications_model_constructors → applications/chemistry}/chemistry_model_constructor.py +1 -1
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/arithmetic/arithmetic_expression.py +1 -1
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/combinatorial_problem_utils.py +25 -6
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/encoding_mapping.py +1 -1
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/encoding_utils.py +1 -1
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/memory.py +2 -4
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/optimization_model.py +13 -16
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/pyomo_utils.py +4 -2
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/encoding.py +3 -10
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/fixed_variables.py +4 -6
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/ising_converter.py +3 -5
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/penalty_support.py +3 -7
- classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/slack_variables.py +4 -6
- classiq/applications/combinatorial_optimization/__init__.py +11 -3
- classiq/{applications_model_constructors → applications/combinatorial_optimization}/combinatorial_optimization_model_constructor.py +9 -10
- classiq/applications/finance/__init__.py +3 -2
- classiq/{applications_model_constructors → applications/finance}/finance_model_constructor.py +24 -14
- classiq/applications/grover/__init__.py +11 -0
- classiq/applications/libraries/qmci_library.py +35 -0
- classiq/applications/qsvm/__init__.py +5 -1
- classiq/execution/all_hardware_devices.py +13 -0
- classiq/executor.py +2 -1
- classiq/interface/_version.py +1 -1
- classiq/interface/analyzer/result.py +1 -5
- classiq/interface/applications/qsvm.py +4 -2
- classiq/interface/ast_node.py +23 -0
- classiq/interface/backend/backend_preferences.py +5 -5
- classiq/interface/backend/quantum_backend_providers.py +7 -7
- classiq/interface/combinatorial_optimization/examples/mht.py +8 -3
- classiq/interface/executor/execution_preferences.py +4 -9
- classiq/interface/executor/execution_request.py +2 -37
- classiq/interface/executor/vqe_result.py +1 -1
- classiq/interface/generator/application_apis/chemistry_declarations.py +2 -4
- classiq/interface/generator/application_apis/finance_declarations.py +1 -1
- classiq/interface/generator/arith/arithmetic_expression_validator.py +2 -0
- classiq/interface/generator/builtin_api_builder.py +0 -5
- classiq/interface/generator/constant.py +2 -3
- classiq/interface/generator/expressions/expression.py +2 -4
- classiq/interface/generator/expressions/qmod_qarray_proxy.py +82 -0
- classiq/interface/generator/expressions/qmod_qscalar_proxy.py +22 -1
- classiq/interface/generator/expressions/qmod_sized_proxy.py +22 -0
- 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/{core_lib_declarations/quantum_functions → builtins/core_library}/atomic_quantum_functions.py +8 -6
- classiq/interface/generator/functions/{core_lib_declarations/quantum_functions → builtins/core_library}/exponentiation_functions.py +10 -4
- 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} +893 -319
- classiq/interface/generator/functions/builtins/quantum_operators.py +37 -0
- classiq/interface/generator/functions/classical_type.py +31 -21
- classiq/interface/generator/functions/function_declaration.py +2 -2
- classiq/interface/generator/hartree_fock.py +10 -2
- classiq/interface/generator/model/classical_main_validator.py +1 -1
- classiq/interface/generator/model/model.py +1 -1
- classiq/interface/generator/model/preferences/preferences.py +4 -2
- classiq/interface/generator/quantum_function_call.py +1 -1
- classiq/interface/generator/types/struct_declaration.py +2 -4
- classiq/interface/model/call_synthesis_data.py +3 -3
- classiq/interface/model/classical_if.py +13 -0
- classiq/interface/model/classical_parameter_declaration.py +2 -3
- classiq/interface/model/{quantum_if_operation.py → control.py} +39 -21
- classiq/interface/model/handle_binding.py +3 -2
- classiq/interface/model/invert.py +10 -0
- classiq/interface/model/model.py +2 -1
- classiq/interface/model/power.py +12 -0
- classiq/interface/model/quantum_function_call.py +9 -4
- classiq/interface/model/quantum_lambda_function.py +3 -9
- classiq/interface/model/quantum_statement.py +3 -2
- classiq/interface/model/quantum_type.py +8 -9
- classiq/interface/model/quantum_variable_declaration.py +2 -2
- classiq/interface/model/repeat.py +13 -0
- classiq/interface/model/resolvers/function_call_resolver.py +21 -0
- classiq/interface/model/statement_block.py +18 -4
- classiq/interface/model/validations/handles_validator.py +8 -12
- classiq/interface/model/within_apply_operation.py +4 -4
- classiq/interface/server/routes.py +0 -4
- classiq/qmod/__init__.py +6 -2
- classiq/qmod/builtins/classical_functions.py +34 -39
- classiq/qmod/builtins/functions.py +287 -300
- classiq/qmod/builtins/operations.py +217 -16
- classiq/qmod/builtins/structs.py +50 -48
- classiq/qmod/declaration_inferrer.py +30 -18
- classiq/qmod/native/expression_to_qmod.py +5 -4
- classiq/qmod/native/pretty_printer.py +48 -26
- classiq/qmod/qmod_constant.py +29 -5
- classiq/qmod/qmod_parameter.py +56 -34
- classiq/qmod/qmod_struct.py +2 -2
- classiq/qmod/qmod_variable.py +87 -43
- classiq/qmod/quantum_callable.py +8 -4
- classiq/qmod/quantum_expandable.py +25 -20
- classiq/qmod/quantum_function.py +29 -2
- classiq/qmod/symbolic.py +79 -69
- classiq/qmod/symbolic_expr.py +1 -1
- classiq/qmod/symbolic_type.py +1 -4
- classiq/qmod/utilities.py +29 -0
- {classiq-0.38.0.dist-info → classiq-0.40.0.dist-info}/METADATA +1 -1
- {classiq-0.38.0.dist-info → classiq-0.40.0.dist-info}/RECORD +122 -141
- classiq/applications/benchmarking/__init__.py +0 -9
- classiq/applications/benchmarking/mirror_benchmarking.py +0 -70
- classiq/applications/numpy_utils.py +0 -37
- classiq/applications_model_constructors/__init__.py +0 -25
- classiq/applications_model_constructors/combinatorial_helpers/multiple_comp_basis_sp.py +0 -34
- classiq/applications_model_constructors/libraries/qmci_library.py +0 -107
- 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/executor/error_mitigation.py +0 -6
- classiq/interface/generator/functions/core_lib_declarations/quantum_functions/__init__.py +0 -18
- classiq/interface/generator/functions/core_lib_declarations/quantum_functions/chemistry_functions.py +0 -0
- classiq/interface/generator/functions/core_lib_declarations/quantum_operators.py +0 -95
- classiq/model/__init__.py +0 -14
- classiq/model/composite_function_generator.py +0 -33
- classiq/model/function_handler.py +0 -462
- classiq/model/logic_flow.py +0 -149
- classiq/model/logic_flow_change_handler.py +0 -71
- classiq/model/model.py +0 -229
- classiq/quantum_functions/__init__.py +0 -17
- classiq/quantum_functions/annotation_parser.py +0 -205
- 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 → applications}/combinatorial_helpers/__init__.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/allowed_constraints.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/arithmetic/__init__.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/arithmetic/isolation.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/pauli_helpers/__init__.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/pauli_helpers/pauli_sparsing.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/pauli_helpers/pauli_utils.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/py.typed +0 -0
- /classiq/{applications_model_constructors/combinatorial_helpers/transformations → applications/combinatorial_helpers/solvers}/__init__.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/sympy_utils.py +0 -0
- /classiq/{applications_model_constructors/libraries → applications/combinatorial_helpers/transformations}/__init__.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/penalty.py +0 -0
- /classiq/{applications_model_constructors → applications}/combinatorial_helpers/transformations/sign_seperation.py +0 -0
- /classiq/{applications_model_constructors → applications/grover}/grover_model_constructor.py +0 -0
- /classiq/{interface/generator/functions/core_lib_declarations → applications/libraries}/__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/{quantum_register.py → interface/model/quantum_register.py} +0 -0
- {classiq-0.38.0.dist-info → classiq-0.40.0.dist-info}/WHEEL +0 -0
@@ -1,14 +1,22 @@
|
|
1
|
+
from typing import Any, Mapping
|
2
|
+
|
1
3
|
from sympy import Symbol
|
2
4
|
|
3
5
|
from classiq.interface.generator.expressions.qmod_sized_proxy import QmodSizedProxy
|
6
|
+
from classiq.interface.model.handle_binding import HandleBinding
|
4
7
|
|
5
8
|
|
6
9
|
class QmodQScalarProxy(Symbol, QmodSizedProxy):
|
7
|
-
def __new__(cls, name, **assumptions):
|
10
|
+
def __new__(cls, name: str, **assumptions: bool) -> "QmodQScalarProxy":
|
8
11
|
return super().__new__(cls, name, **assumptions)
|
9
12
|
|
10
13
|
def __init__(self, name: str, size: int) -> None:
|
11
14
|
super().__init__(size)
|
15
|
+
self.name = name
|
16
|
+
|
17
|
+
@property
|
18
|
+
def handle(self) -> HandleBinding:
|
19
|
+
return HandleBinding(name=self.name)
|
12
20
|
|
13
21
|
|
14
22
|
class QmodQBitProxy(QmodQScalarProxy):
|
@@ -24,6 +32,10 @@ class QmodQNumProxy(QmodQScalarProxy):
|
|
24
32
|
self._fraction_digits = fraction_digits
|
25
33
|
self._is_signed = is_signed
|
26
34
|
|
35
|
+
@property
|
36
|
+
def size(self) -> int:
|
37
|
+
return self._size
|
38
|
+
|
27
39
|
@property
|
28
40
|
def fraction_digits(self) -> int:
|
29
41
|
return self._fraction_digits
|
@@ -31,3 +43,12 @@ class QmodQNumProxy(QmodQScalarProxy):
|
|
31
43
|
@property
|
32
44
|
def is_signed(self) -> bool:
|
33
45
|
return self._is_signed
|
46
|
+
|
47
|
+
@property
|
48
|
+
def fields(self) -> Mapping[str, Any]:
|
49
|
+
return {
|
50
|
+
"size": self.size,
|
51
|
+
"is_signed": self.is_signed,
|
52
|
+
"fraction_digits": self.fraction_digits,
|
53
|
+
"len": self.size,
|
54
|
+
}
|
@@ -1,6 +1,28 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Mapping
|
2
|
+
|
3
|
+
from classiq.exceptions import ClassiqNotImplementedError
|
4
|
+
|
5
|
+
if TYPE_CHECKING:
|
6
|
+
from classiq.interface.model.handle_binding import HandleBinding
|
7
|
+
|
8
|
+
|
1
9
|
class QmodSizedProxy:
|
2
10
|
def __init__(self, size: int) -> None:
|
3
11
|
self._size = size
|
4
12
|
|
5
13
|
def __len__(self) -> int:
|
6
14
|
return self._size
|
15
|
+
|
16
|
+
@property
|
17
|
+
def handle(self) -> "HandleBinding":
|
18
|
+
raise ClassiqNotImplementedError("cannot compute handle")
|
19
|
+
|
20
|
+
@property
|
21
|
+
def len(self) -> int:
|
22
|
+
return self._size
|
23
|
+
|
24
|
+
@property
|
25
|
+
def fields(self) -> Mapping[str, Any]:
|
26
|
+
return {
|
27
|
+
"len": self.len,
|
28
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from typing import List
|
2
2
|
|
3
|
-
import classiq.interface.generator.functions.
|
4
|
-
import classiq.interface.generator.functions.
|
3
|
+
import classiq.interface.generator.functions.builtins.core_library
|
4
|
+
import classiq.interface.generator.functions.builtins.quantum_operators
|
5
5
|
from classiq.interface.generator.functions.foreign_function_definition import *
|
6
6
|
from classiq.interface.generator.functions.foreign_function_definition import (
|
7
7
|
SynthesisForeignFunctionDefinition as ForeignFunctionDefinition,
|
@@ -0,0 +1,15 @@
|
|
1
|
+
from classiq.interface.generator.functions.builtins.core_library import CORE_LIB_DECLS
|
2
|
+
from classiq.interface.generator.functions.builtins.open_lib_functions import (
|
3
|
+
OPEN_LIB_DECLS,
|
4
|
+
)
|
5
|
+
from classiq.interface.generator.functions.builtins.quantum_operators import (
|
6
|
+
STD_QMOD_OPERATORS,
|
7
|
+
)
|
8
|
+
from classiq.interface.helpers.pydantic_model_helpers import nameables_to_dict
|
9
|
+
from classiq.interface.model.quantum_function_declaration import (
|
10
|
+
QuantumFunctionDeclaration,
|
11
|
+
)
|
12
|
+
|
13
|
+
QuantumFunctionDeclaration.BUILTIN_FUNCTION_DECLARATIONS.update(
|
14
|
+
nameables_to_dict(STD_QMOD_OPERATORS + CORE_LIB_DECLS + OPEN_LIB_DECLS)
|
15
|
+
)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
from classiq.interface.generator.application_apis.chemistry_declarations import * # noqa: F403
|
2
|
+
from classiq.interface.generator.application_apis.combinatorial_optimization_declarations import * # noqa: F403
|
3
|
+
from classiq.interface.generator.application_apis.finance_declarations import * # noqa: F403
|
4
|
+
from classiq.interface.generator.application_apis.qsvm_declarations import * # noqa: F403
|
5
|
+
from classiq.interface.model.quantum_function_declaration import (
|
6
|
+
QuantumFunctionDeclaration,
|
7
|
+
)
|
8
|
+
|
9
|
+
from .atomic_quantum_functions import * # noqa: F403
|
10
|
+
from .exponentiation_functions import * # noqa: F403
|
11
|
+
|
12
|
+
CORE_LIB_DECLS = [
|
13
|
+
func for func in vars().values() if isinstance(func, QuantumFunctionDeclaration)
|
14
|
+
]
|
@@ -423,7 +423,7 @@ UNITARY_FUNCTION = QuantumFunctionDeclaration(
|
|
423
423
|
DEFAULT_TARGET_NAME: PortDeclaration(
|
424
424
|
name=DEFAULT_TARGET_NAME,
|
425
425
|
direction=PortDeclarationDirection.Inout,
|
426
|
-
size=Expression(expr="log(
|
426
|
+
size=Expression(expr="log(get_field(elements[0], 'len'), 2)"),
|
427
427
|
)
|
428
428
|
},
|
429
429
|
)
|
@@ -436,7 +436,7 @@ PREPARE_STATE_FUNCTION = QuantumFunctionDeclaration(
|
|
436
436
|
"out": PortDeclaration(
|
437
437
|
name="out",
|
438
438
|
direction=PortDeclarationDirection.Output,
|
439
|
-
size=Expression(expr="log(
|
439
|
+
size=Expression(expr="log(get_field(probabilities, 'len'), 2)"),
|
440
440
|
)
|
441
441
|
},
|
442
442
|
)
|
@@ -448,7 +448,7 @@ PREPARE_AMPLITUDES_FUNCTION = QuantumFunctionDeclaration(
|
|
448
448
|
"out": PortDeclaration(
|
449
449
|
name="out",
|
450
450
|
direction=PortDeclarationDirection.Output,
|
451
|
-
size=Expression(expr="log(
|
451
|
+
size=Expression(expr="log(get_field(amplitudes, 'len'), 2)"),
|
452
452
|
)
|
453
453
|
},
|
454
454
|
)
|
@@ -467,7 +467,9 @@ ADD_FUNCTION = QuantumFunctionDeclaration(
|
|
467
467
|
"result": PortDeclaration(
|
468
468
|
name="result",
|
469
469
|
direction=PortDeclarationDirection.Output,
|
470
|
-
size=Expression(
|
470
|
+
size=Expression(
|
471
|
+
expr="Max(get_field(left, 'len'), get_field(right, 'len')) + 1"
|
472
|
+
),
|
471
473
|
),
|
472
474
|
},
|
473
475
|
)
|
@@ -578,7 +580,7 @@ INPLACE_PREPARE_STATE = QuantumFunctionDeclaration(
|
|
578
580
|
"target": PortDeclaration(
|
579
581
|
name="target",
|
580
582
|
direction=PortDeclarationDirection.Inout,
|
581
|
-
size=Expression(expr="log(
|
583
|
+
size=Expression(expr="log(get_field(probabilities, 'len'), 2)"),
|
582
584
|
)
|
583
585
|
},
|
584
586
|
)
|
@@ -591,7 +593,7 @@ INPLACE_PREPARE_AMPLITUDES = QuantumFunctionDeclaration(
|
|
591
593
|
"target": PortDeclaration(
|
592
594
|
name="target",
|
593
595
|
direction=PortDeclarationDirection.Inout,
|
594
|
-
size=Expression(expr="log(
|
596
|
+
size=Expression(expr="log(get_field(amplitudes, 'len'), 2)"),
|
595
597
|
)
|
596
598
|
},
|
597
599
|
)
|
@@ -26,7 +26,7 @@ SINGLE_PAULI_EXPONENT_FUNCTION = QuantumFunctionDeclaration(
|
|
26
26
|
"qbv": PortDeclaration(
|
27
27
|
name="qbv",
|
28
28
|
direction=PortDeclarationDirection.Inout,
|
29
|
-
size=Expression(expr="
|
29
|
+
size=Expression(expr="get_field(pauli_string, 'len')"),
|
30
30
|
)
|
31
31
|
},
|
32
32
|
)
|
@@ -44,7 +44,9 @@ SUZUKI_TROTTER_FUNCTION = QuantumFunctionDeclaration(
|
|
44
44
|
"qbv": PortDeclaration(
|
45
45
|
name="qbv",
|
46
46
|
direction=PortDeclarationDirection.Inout,
|
47
|
-
size=Expression(
|
47
|
+
size=Expression(
|
48
|
+
expr="get_field(get_field(pauli_operator[0], 'pauli'), 'len')"
|
49
|
+
),
|
48
50
|
)
|
49
51
|
},
|
50
52
|
)
|
@@ -60,7 +62,9 @@ QDRIFT_FUNCTION = QuantumFunctionDeclaration(
|
|
60
62
|
"qbv": PortDeclaration(
|
61
63
|
name="qbv",
|
62
64
|
direction=PortDeclarationDirection.Inout,
|
63
|
-
size=Expression(
|
65
|
+
size=Expression(
|
66
|
+
expr="get_field(get_field(pauli_operator[0], 'pauli'), 'len')"
|
67
|
+
),
|
64
68
|
)
|
65
69
|
},
|
66
70
|
)
|
@@ -76,7 +80,9 @@ EXPONENTIATION_WITH_DEPTH_CONSTRAINT = QuantumFunctionDeclaration(
|
|
76
80
|
"qbv": PortDeclaration(
|
77
81
|
name="qbv",
|
78
82
|
direction=PortDeclarationDirection.Inout,
|
79
|
-
size=Expression(
|
83
|
+
size=Expression(
|
84
|
+
expr="get_field(get_field(pauli_operator[0], 'pauli'), 'len')"
|
85
|
+
),
|
80
86
|
)
|
81
87
|
},
|
82
88
|
)
|
@@ -0,0 +1,62 @@
|
|
1
|
+
from classiq.interface.generator.functions.builtins.quantum_operators import (
|
2
|
+
get_single_empty_operand_operator,
|
3
|
+
)
|
4
|
+
from classiq.interface.generator.functions.classical_type import Bool, Integer
|
5
|
+
from classiq.interface.generator.functions.port_declaration import (
|
6
|
+
PortDeclarationDirection,
|
7
|
+
)
|
8
|
+
from classiq.interface.helpers.pydantic_model_helpers import nameables_to_dict
|
9
|
+
from classiq.interface.model.port_declaration import PortDeclaration
|
10
|
+
from classiq.interface.model.quantum_function_declaration import (
|
11
|
+
QuantumFunctionDeclaration,
|
12
|
+
QuantumOperandDeclaration,
|
13
|
+
)
|
14
|
+
|
15
|
+
_CTRL_FIELD_NAME = "ctrl"
|
16
|
+
CONTROL_OPERATOR = get_single_empty_operand_operator(
|
17
|
+
operator_name="control",
|
18
|
+
port_declarations={
|
19
|
+
_CTRL_FIELD_NAME: PortDeclaration(
|
20
|
+
name=_CTRL_FIELD_NAME,
|
21
|
+
direction=PortDeclarationDirection.Inout,
|
22
|
+
)
|
23
|
+
},
|
24
|
+
)
|
25
|
+
|
26
|
+
REPEAT_OPERATOR = QuantumFunctionDeclaration(
|
27
|
+
name="repeat",
|
28
|
+
param_decls={"count": Integer()},
|
29
|
+
operand_declarations={
|
30
|
+
"iteration": QuantumOperandDeclaration(
|
31
|
+
name="iteration", param_decls={"index": Integer()}
|
32
|
+
)
|
33
|
+
},
|
34
|
+
)
|
35
|
+
POWER_OPERATOR = get_single_empty_operand_operator(
|
36
|
+
operator_name="power", param_decls={"power": Integer()}
|
37
|
+
)
|
38
|
+
INVERT_OPERATOR = get_single_empty_operand_operator(operator_name="invert")
|
39
|
+
|
40
|
+
IF_OPERATOR = QuantumFunctionDeclaration(
|
41
|
+
name="if",
|
42
|
+
param_decls={"condition": Bool()},
|
43
|
+
operand_declarations={
|
44
|
+
"then": QuantumOperandDeclaration(name="then"),
|
45
|
+
"else": QuantumOperandDeclaration(name="else"),
|
46
|
+
},
|
47
|
+
)
|
48
|
+
COMPUTE = get_single_empty_operand_operator(operator_name="compute")
|
49
|
+
UNCOMPUTE = get_single_empty_operand_operator(operator_name="uncompute")
|
50
|
+
|
51
|
+
|
52
|
+
INTERNAL_OPERATORS = nameables_to_dict(
|
53
|
+
[
|
54
|
+
CONTROL_OPERATOR,
|
55
|
+
REPEAT_OPERATOR,
|
56
|
+
POWER_OPERATOR,
|
57
|
+
INVERT_OPERATOR,
|
58
|
+
IF_OPERATOR,
|
59
|
+
COMPUTE,
|
60
|
+
UNCOMPUTE,
|
61
|
+
]
|
62
|
+
)
|