ControlledOnInt function

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

Returns a unitary operator that applies an oracle on the target register if the control register state corresponds to a specified nonnegative integer.

function ControlledOnInt<'T> (numberState : Int, oracle : ('T => Unit is Adj + Ctl)) : ((Qubit[], 'T) => Unit is Adj + Ctl)

Input

numberState : Int

Nonnegative integer.

oracle : 'T => Unit is Adj + Ctl

Unitary operator.

Output : (Qubit[],'T) => Unit is Adj + Ctl

A unitary operator that applies oracle on the target register if the control register state corresponds to the number state numberState.

Type Parameters

'T

Remarks

The value of numberState is interpreted using a little-endian encoding.