ApplyIfElseRA 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 adjointable operations, depending on the value of a classical result.

operation ApplyIfElseRA<'T, 'U> (result : Result, (zeroOp : ('T => Unit is Adj), zeroInput : 'T), (oneOp : ('U => Unit is Adj), oneInput : 'U)) : Unit is Adj

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 Adj

The adjointable operation to be applied when result == Zero.

zeroInput : 'T

The input to be provided to zeroOp when result == Zero.

oneOp : 'U => Unit is Adj

The adjointable 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