ApplyIfOne operation
Namespace: Microsoft.Quantum.Canon
Package: Microsoft.Quantum.Standard
Applies an operation conditioned on a classical result value being one.
operation ApplyIfOne<'T> (result : Result, (op : ('T => Unit), target : 'T)) : Unit
Description
Given an operation op and a result value result, applies op to the target
if result is One. If Zero, nothing happens to the target.
Input
result : Result
A measurement result that controls whether op is applied or not.
op : 'T => Unit
An operation to be conditionally applied.
target : 'T
The input to which the operation is applied.
Output : Unit
Type Parameters
'T
The input type of the operation to be conditionally applied.
See Also
反馈
提交和查看相关反馈