ClassicalControl
- class braket.experimental_capabilities.iqm.classical_control.ExperimentalQuantumOperator(qubit_count, ascii_symbols)[source]
Bases:
QuantumOperatorBase class for experimental quantum operators.
This class provides the foundation for quantum operators that are part of experimental capabilities and ensures that they can only be instantiated when the appropriate capability is enabled.
- Parameters:
qubit_count (
int) – The number of qubits this operator acts on.ascii_symbols (
list[str]) – ASCII string symbols for the operator.
- property ascii_symbols: tuple[str, ...]
Get the ASCII symbols for this operator.
- Returns:
tuple[str] – The ASCII symbols for this operator.
- property parameters: list[FreeParameterExpression | float | int]
Get the parameters associated with this operator.
- Returns:
list[FreeParameterExpression | float | int] –
- The free parameters or fixed values
associated with this operator.
- to_ir(target=None, ir_type=IRType.OPENQASM, serialization_properties=None, **kwargs)[source]
Convert this operator to its IR representation.
- Parameters:
target (
QubitSet|None) – Target qubit(s). Defaults to None.ir_type (
IRType) – The IR type to use. Defaults to IRType.OPENQASM.serialization_properties (
OpenQASMSerializationProperties|None) – Properties to use for serialization. Defaults to None.kwargs (
Any)
- Return type:
Any- Returns:
Any – The IR representation of this operator.
- class braket.experimental_capabilities.iqm.classical_control.CCPRx(angle_1, angle_2, feedback_key)[source]
Bases:
ExperimentalQuantumOperatorClassically controlled Phased Rx gate.
A rotation around the X-axis with a phase factor, where the rotation depends on the value of a classical feedback.
- Parameters:
angle_1 (FreeParameterExpression | float) – The first angle of the gate in radians or expression representation.
angle_2 (FreeParameterExpression | float) – The second angle of the gate in radians or expression representation.
feedback_key (int) – The integer feedback key that points to a measurement result.
Base class for experimental quantum operators.
This class provides the foundation for quantum operators that are part of experimental capabilities and ensures that they can only be instantiated when the appropriate capability is enabled.
- Parameters:
qubit_count – The number of qubits this operator acts on.
ascii_symbols – ASCII string symbols for the operator.
angle_1 (
FreeParameterExpression|float)angle_2 (
FreeParameterExpression|float)feedback_key (
int)
- static cc_prx(target, angle_1, angle_2, feedback_key)[source]
Conditional PhaseRx gate.
Applies a rotation around the X-axis with a phase factor, conditioned on the value in a classical feedback register.
- Parameters:
target (QubitSetInput) – Target qubit(s).
angle_1 (FreeParameterExpression | float) – First angle in radians.
angle_2 (FreeParameterExpression | float) – Second angle in radians.
feedback_key (int) – The integer feedback key that points to a measurement result.
- Return type:
Iterable[Instruction]
- Returns:
Iterable[Instruction] – CCPRx instruction.
Examples
>>> circ = Circuit().cc_prx(0, 0.15, 0.25, 0)
- class braket.experimental_capabilities.iqm.classical_control.MeasureFF(feedback_key)[source]
Bases:
ExperimentalQuantumOperatorMeasurement for Feed Forward control.
Performs a measurement. The result is associated with a feedback key that can be used later in conditional operations.
- Parameters:
feedback_key (int) – The integer feedback key that points to a measurement result.
Base class for experimental quantum operators.
This class provides the foundation for quantum operators that are part of experimental capabilities and ensures that they can only be instantiated when the appropriate capability is enabled.
- Parameters:
qubit_count – The number of qubits this operator acts on.
ascii_symbols – ASCII string symbols for the operator.
feedback_key (
int)
- static measure_ff(target, feedback_key)[source]
Measure and store result for feed-forward operations.
Performs a measurement on the target qubit and stores the result in a classical feedback register for later use in conditional operations.
- Parameters:
target (QubitSetInput) – Target qubit(s).
feedback_key (int) – The integer feedback key that points to a measurement result.
- Return type:
Iterable[Instruction]
- Returns:
Iterable[Instruction] – MeasureFF instruction.
Examples
>>> circ = Circuit().measure_ff(0, 0)