ApplyIfElseRC operation
Warning
This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.
Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.
Namespace: Microsoft.Quantum.Canon
Package: Microsoft.Quantum.Standard
Applies one of two controllable operations, depending on the value of a classical result.
operation ApplyIfElseRC<'T, 'U> (result : Result, (zeroOp : ('T => Unit is Ctl), zeroInput : 'T), (oneOp : ('U => Unit is Ctl), oneInput : 'U)) : Unit is Ctl
Description
Given a result result
, applies the operation zeroOp
with zeroInput
as
its input when result
is equal to Zero
, and applies oneOp(oneInput)
when result == One
.
Input
result : Result
The measurement result used to determine if zeroOp
or oneOp
is
applied.
zeroOp : 'T => Unit is Ctl
The controllable operation to be applied when result == Zero
.
zeroInput : 'T
The input to be provided to zeroOp
when result == Zero
.
oneOp : 'U => Unit is Ctl
The controllable operation to be applied when result == One
.
oneInput : 'U
The input to be provided to oneOp
when result == One
.
Output : Unit
Type Parameters
'T
The input type of the operation zeroOp
to be conditionally applied.
'U
The input type of the operation oneOp
to be conditionally applied.
See Also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for